@odigos/ui-kit 0.0.196 → 0.0.198

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.
package/lib/containers.js CHANGED
@@ -1,4 +1,4 @@
1
- import{jsxs as e,jsx as t,Fragment as i}from"react/jsx-runtime";import{useState as n,useEffect as a,forwardRef as o,useRef as r,useImperativeHandle as l,useMemo as s,Fragment as c,useCallback as d,Children as u}from"react";import p,{css as h,useTheme as m}from"styled-components";import{a4 as g,aN as y,h as v,K as b,A as f,aO as x,aP as S,aQ as $,aR as C,c as w,i as k,aS as D,aT as T,aU as N,aV as E,g as O,aW as F,a0 as A,aX as I,aY as R,aZ as M,a_ as L,a$ as P,b0 as j,am as K,az as q,b1 as z,b2 as H,b3 as V,aj as B,aq as W,b4 as _,b5 as J,b6 as U,b7 as Y,b8 as G,b9 as X,ba as Q,bb as Z,bc as ee,bd as te,be as ie,p as ne,a5 as ae,bf as oe,bg as re,bh as le,F as se,bi as ce,bj as de,bk as ue,k as pe,bl as he,J as me,bm as ge,bn as ye,bo as ve,bp as be,bq as fe,br as xe,bs as Se,bt as $e,bu as Ce,bv as we,bw as ke,bx as De,l as Te,by as Ne,bz as Ee,bA as Oe,bB as Fe,aF as Ae,bC as Ie,bD as Re,bE as Me,au as Le,G as Pe,bF as je,S as Ke,bG as qe,aa as ze,bH as He,bI as Ve,ah as Be,ak as We,bJ as _e,ac as Je,bK as Ue,bL as Ye,bM as Ge,bN as Xe,bO as Qe,bP as Ze,bQ as et,bR as tt,bS as it,bT as nt,bU as at,bV as ot,bW as rt,_ as lt,M as st,bX as ct,bY as dt,bZ as ut,b_ as pt,ai as ht,b$ as mt,c0 as gt,c1 as yt,c2 as vt,c3 as bt,c4 as ft,w as xt,y as St,E as $t,c5 as Ct,c6 as wt,c7 as kt,z as Dt,a9 as Tt,a8 as Nt,j as Et,c8 as Ot,c9 as Ft,ca as At,cb as It,O as Rt,U as Mt,X as Lt,Q as Pt,H as jt,P as Kt,Y as qt,cc as zt,$ as Ht,cd as Vt,ce as Bt,ad as Wt,cf as _t,cg as Jt,ch as Ut,ci as Yt,an as Gt,cj as Xt,ck as Qt,cl as Zt,cm as ei,cn as ti,co as ii,cp as ni,cq as ai,cr as oi,cs as ri,ct as li,cu as si,aw as ci,cv as di,cw as ui,cx as pi,cy as hi,cz as mi,cA as gi,cB as yi,cC as vi,cD as bi,ao as fi,al as xi,a3 as Si,a7 as $i,cE as Ci,cF as wi,cG as ki,cH as Di,cI as Ti,cJ as Ni}from"./chunks/ui-components-OrgB9V7b.js";import{VSquareIcon as Ei,XSquareIcon as Oi,EditIcon as Fi,TrashIcon as Ai,OdigosLogoText as Ii,PlusIcon as Ri,RefreshIcon as Mi,SearchIcon as Li,FilterIcon as Pi,DataStreamIcon as ji,VIcon as Ki,OdigosLogo as qi,ArrowIcon as zi,RefreshLeftArrowIcon as Hi,NotificationIcon as Vi,UserIcon as Bi,ImageErrorIcon as Wi,OverviewIcon as _i,SourceIcon as Ji,DestinationIcon as Ui,InstrumentationRuleIcon as Yi,ActionIcon as Gi,SlackLogo as Xi,KeyIcon as Qi,TerminalIcon as Zi,ExclamationTriangleIcon as en,TraceViewIcon as tn}from"./icons.js";import{MarkerType as nn,useNodesState as an,useEdgesState as on,applyNodeChanges as rn}from"@xyflow/react";import{Y as ln}from"./chunks/index-CjudHPMe.js";import"zustand";import"javascript-time-ago";import"./chunks/vendor-DUWBN0Mg.js";import"react-dom";import"prism-react-renderer";import"react-error-boundary";import"lottie-react";import"virtua";const sn=e=>{const{type:t,name:i,notes:n,signals:a,disabled:o,fields:{collectContainerAttributes:r,collectReplicaSetAttributes:l,collectWorkloadId:s,collectClusterId:c,labelsAttributes:d,annotationsAttributes:u,clusterAttributes:p,overwriteExistingValues:h,attributeNamesToDelete:m,renames:f,piiCategories:x,fallbackSamplingRatio:S,samplingPercentage:$,endpointsFilters:C,servicesNameFilters:w,attributeFilters:k}}=e,D=[{title:g.TYPE,value:t},{type:y.ActiveStatus,title:g.STATUS,value:String(!o)},{type:y.Monitors,title:g.SIGNALS_FOR_PROCESSING,value:a?.join(", ")||""},{title:g.NAME,value:i||""},{title:g.NOTES,value:n||""},{type:y.Divider}];if(t===v.K8sAttributes&&(D.push({title:"Collect Container Attributes",value:String(r)}),D.push({title:"Collect ReplicaSet Attributes",value:String(l)}),D.push({title:"Collect Workload ID",value:String(s)}),D.push({title:"Collect Cluster ID",value:String(c)}),d?.length&&D.push({type:y.Divider}),d?.forEach(({labelKey:e,attributeKey:t,from:i,fromSources:n},a)=>{let o="";o+=`Label Key: ${e}\n`,o+=`Attribute Key: ${t}\n`,o+=`From: ${n?.length?n.join(", "):i||b.Pod}\n`,D.push({title:"Label"+(d.length>1?` #${a+1}`:""),value:o})}),u?.length&&D.push({type:y.Divider}),u?.forEach(({annotationKey:e,attributeKey:t,from:i,fromSources:n},a)=>{let o="";o+=`Annotation Key: ${e}\n`,o+=`Attribute Key: ${t}\n`,o+=`From: ${n?.length?n.join(", "):i||b.Pod}\n`,D.push({title:"Annotation"+(u.length>1?` #${a+1}`:""),value:o})})),t===v.AddClusterInfo){D.push({title:"Overwrite Existing Values",value:String(h||!1)});let e="";p?.forEach(({attributeName:t,attributeStringValue:i},n)=>{e+=`${t}: ${i}`,n<p.length-1&&(e+=", ")}),D.push({title:"Attributes",value:e})}if(t===v.DeleteAttributes){let e="";m?.forEach((t,i)=>{e+=t,i<m.length-1&&(e+=", ")}),D.push({title:"Attributes",value:e})}if(t===v.RenameAttributes){let e="";const t=Object.entries(f||{});t.forEach(([i,n],a)=>{e+=`${i}: ${n}`,a<t.length-1&&(e+=", ")}),D.push({title:"Attributes",value:e})}if(t===v.PiiMasking){let e="";x?.forEach((t,i)=>{e+=t,i<x.length-1&&(e+=", ")}),D.push({title:"Categories",value:e})}return t===v.ErrorSampler&&D.push({title:"Sampling Ratio",value:String(S)}),t===v.ProbabilisticSampler&&D.push({title:"Sampling Percentage",value:String($)}),t===v.LatencySampler&&C?.forEach(({serviceName:e,httpRoute:t,minimumLatencyThreshold:i,fallbackSamplingRatio:n},a)=>{let o="";o+=`Service Name: ${e}\n`,o+=`HTTP Route: ${t}\n`,o+=`Min. Latency: ${i}\n`,o+=`Fallback Sampling Ratio: ${n}`,D.push({title:"Endpoint"+(C.length>1?` #${a+1}`:""),value:o})}),t===v.ServiceNameSampler&&w?.forEach(({serviceName:e,samplingRatio:t,fallbackSamplingRatio:i},n)=>{let a="";a+=`Service Name: ${e}\n`,a+=`Sampling Ratio: ${t}\n`,a+=`Fallback Sampling Ratio: ${i}`,D.push({title:"Filter"+(w.length>1?` #${n+1}`:""),value:a})}),t===v.SpanAttributeSampler&&k?.forEach(({serviceName:e,attributeKey:t,fallbackSamplingRatio:i,condition:n},a)=>{let o="";o+=`Service Name: ${e}\n`,o+=`Attribute Key: ${t}\n`,o+=`Fallback Sampling Ratio: ${i}\n`;const r=Object.keys(n)[0];o+=`Condition: ${r}\n`,o+=`Operation: ${n[r]?.operation}\n`,o+=`Expected Value: ${n[r]?.expectedValue}`,"jsonCondition"===r&&(o+=`\nJSON Path: ${n[r].jsonPath}`),D.push({title:"Filter"+(k.length>1?` #${a+1}`:""),value:o})}),D},cn=f.PiiCategories,dn=p.div`
1
+ import{jsxs as e,jsx as t,Fragment as i}from"react/jsx-runtime";import{useState as n,useEffect as a,forwardRef as o,useRef as r,useImperativeHandle as l,useMemo as s,Fragment as c,useCallback as d,Children as u}from"react";import p,{css as h,useTheme as m}from"styled-components";import{a4 as g,aN as y,h as v,K as b,A as f,aO as x,aP as S,aQ as $,aR as C,c as w,i as k,aS as D,aT as T,aU as N,aV as E,g as F,aW as O,a0 as A,aX as I,aY as R,aZ as M,a_ as L,a$ as P,b0 as j,am as K,az as q,b1 as z,b2 as H,b3 as V,aj as B,aq as W,b4 as _,b5 as J,b6 as U,b7 as Y,b8 as G,b9 as X,ba as Q,bb as Z,bc as ee,bd as te,be as ie,p as ne,a5 as ae,bf as oe,bg as re,bh as le,F as se,bi as ce,bj as de,bk as ue,k as pe,bl as he,J as me,bm as ge,bn as ye,bo as ve,bp as be,bq as fe,br as xe,bs as Se,bt as $e,bu as Ce,bv as we,bw as ke,bx as De,l as Te,by as Ne,bz as Ee,bA as Fe,bB as Oe,aF as Ae,bC as Ie,bD as Re,bE as Me,au as Le,G as Pe,bF as je,S as Ke,bG as qe,aa as ze,bH as He,bI as Ve,ah as Be,ak as We,bJ as _e,ac as Je,bK as Ue,bL as Ye,bM as Ge,bN as Xe,bO as Qe,bP as Ze,bQ as et,bR as tt,bS as it,bT as nt,bU as at,bV as ot,bW as rt,_ as lt,M as st,bX as ct,bY as dt,bZ as ut,b_ as pt,ai as ht,b$ as mt,c0 as gt,c1 as yt,c2 as vt,c3 as bt,c4 as ft,w as xt,y as St,E as $t,c5 as Ct,c6 as wt,c7 as kt,z as Dt,a9 as Tt,a8 as Nt,j as Et,c8 as Ft,c9 as Ot,ca as At,cb as It,O as Rt,U as Mt,X as Lt,Q as Pt,H as jt,P as Kt,Y as qt,cc as zt,$ as Ht,cd as Vt,ce as Bt,ad as Wt,cf as _t,cg as Jt,ch as Ut,ci as Yt,an as Gt,cj as Xt,ck as Qt,cl as Zt,cm as ei,cn as ti,co as ii,cp as ni,cq as ai,cr as oi,cs as ri,ct as li,cu as si,aw as ci,cv as di,cw as ui,cx as pi,cy as hi,cz as mi,cA as gi,cB as yi,cC as vi,cD as bi,ao as fi,al as xi,a3 as Si,a7 as $i,cE as Ci,cF as wi,cG as ki,cH as Di,cI as Ti,cJ as Ni}from"./chunks/ui-components-DSKV7uC0.js";import{VSquareIcon as Ei,XSquareIcon as Fi,EditIcon as Oi,TrashIcon as Ai,OdigosLogoText as Ii,PlusIcon as Ri,RefreshIcon as Mi,SearchIcon as Li,FilterIcon as Pi,DataStreamIcon as ji,VIcon as Ki,OdigosLogo as qi,ArrowIcon as zi,RefreshLeftArrowIcon as Hi,NotificationIcon as Vi,UserIcon as Bi,ImageErrorIcon as Wi,OverviewIcon as _i,SourceIcon as Ji,DestinationIcon as Ui,InstrumentationRuleIcon as Yi,ActionIcon as Gi,SlackLogo as Xi,KeyIcon as Qi,TerminalIcon as Zi,ExclamationTriangleIcon as en,TraceViewIcon as tn}from"./icons.js";import{MarkerType as nn,useNodesState as an,useEdgesState as on,applyNodeChanges as rn}from"@xyflow/react";import{Y as ln}from"./chunks/index-DXnojvL1.js";import"zustand";import"javascript-time-ago";import"./chunks/vendor-DUWBN0Mg.js";import"react-dom";import"prism-react-renderer";import"react-error-boundary";import"lottie-react";import"virtua";const sn=e=>{const{type:t,name:i,notes:n,signals:a,disabled:o,fields:{collectContainerAttributes:r,collectReplicaSetAttributes:l,collectWorkloadId:s,collectClusterId:c,labelsAttributes:d,annotationsAttributes:u,clusterAttributes:p,overwriteExistingValues:h,attributeNamesToDelete:m,renames:f,piiCategories:x,fallbackSamplingRatio:S,samplingPercentage:$,endpointsFilters:C,servicesNameFilters:w,attributeFilters:k}}=e,D=[{title:g.TYPE,value:t},{type:y.ActiveStatus,title:g.STATUS,value:String(!o)},{type:y.Monitors,title:g.SIGNALS_FOR_PROCESSING,value:a?.join(", ")||""},{title:g.NAME,value:i||""},{title:g.NOTES,value:n||""},{type:y.Divider}];if(t===v.K8sAttributes&&(D.push({title:"Collect Container Attributes",value:String(r)}),D.push({title:"Collect ReplicaSet Attributes",value:String(l)}),D.push({title:"Collect Workload ID",value:String(s)}),D.push({title:"Collect Cluster ID",value:String(c)}),d?.length&&D.push({type:y.Divider}),d?.forEach(({labelKey:e,attributeKey:t,from:i,fromSources:n},a)=>{let o="";o+=`Label Key: ${e}\n`,o+=`Attribute Key: ${t}\n`,o+=`From: ${n?.length?n.join(", "):i||b.Pod}\n`,D.push({title:"Label"+(d.length>1?` #${a+1}`:""),value:o})}),u?.length&&D.push({type:y.Divider}),u?.forEach(({annotationKey:e,attributeKey:t,from:i,fromSources:n},a)=>{let o="";o+=`Annotation Key: ${e}\n`,o+=`Attribute Key: ${t}\n`,o+=`From: ${n?.length?n.join(", "):i||b.Pod}\n`,D.push({title:"Annotation"+(u.length>1?` #${a+1}`:""),value:o})})),t===v.AddClusterInfo){D.push({title:"Overwrite Existing Values",value:String(h||!1)});let e="";p?.forEach(({attributeName:t,attributeStringValue:i},n)=>{e+=`${t}: ${i}`,n<p.length-1&&(e+=", ")}),D.push({title:"Attributes",value:e})}if(t===v.DeleteAttributes){let e="";m?.forEach((t,i)=>{e+=t,i<m.length-1&&(e+=", ")}),D.push({title:"Attributes",value:e})}if(t===v.RenameAttributes){let e="";const t=Object.entries(f||{});t.forEach(([i,n],a)=>{e+=`${i}: ${n}`,a<t.length-1&&(e+=", ")}),D.push({title:"Attributes",value:e})}if(t===v.PiiMasking){let e="";x?.forEach((t,i)=>{e+=t,i<x.length-1&&(e+=", ")}),D.push({title:"Categories",value:e})}return t===v.ErrorSampler&&D.push({title:"Sampling Ratio",value:String(S)}),t===v.ProbabilisticSampler&&D.push({title:"Sampling Percentage",value:String($)}),t===v.LatencySampler&&C?.forEach(({serviceName:e,httpRoute:t,minimumLatencyThreshold:i,fallbackSamplingRatio:n},a)=>{let o="";o+=`Service Name: ${e}\n`,o+=`HTTP Route: ${t}\n`,o+=`Min. Latency: ${i}\n`,o+=`Fallback Sampling Ratio: ${n}`,D.push({title:"Endpoint"+(C.length>1?` #${a+1}`:""),value:o})}),t===v.ServiceNameSampler&&w?.forEach(({serviceName:e,samplingRatio:t,fallbackSamplingRatio:i},n)=>{let a="";a+=`Service Name: ${e}\n`,a+=`Sampling Ratio: ${t}\n`,a+=`Fallback Sampling Ratio: ${i}`,D.push({title:"Filter"+(w.length>1?` #${n+1}`:""),value:a})}),t===v.SpanAttributeSampler&&k?.forEach(({serviceName:e,attributeKey:t,fallbackSamplingRatio:i,condition:n},a)=>{let o="";o+=`Service Name: ${e}\n`,o+=`Attribute Key: ${t}\n`,o+=`Fallback Sampling Ratio: ${i}\n`;const r=Object.keys(n)[0];o+=`Condition: ${r}\n`,o+=`Operation: ${n[r]?.operation}\n`,o+=`Expected Value: ${n[r]?.expectedValue}`,"jsonCondition"===r&&(o+=`\nJSON Path: ${n[r].jsonPath}`),D.push({title:"Filter"+(k.length>1?` #${a+1}`:""),value:o})}),D},cn=f.PiiCategories,dn=p.div`
2
2
  display: flex;
3
3
  flex-direction: row;
4
4
  gap: 32px;
@@ -7,14 +7,14 @@ import{jsxs as e,jsx as t,Fragment as i}from"react/jsx-runtime";import{useState
7
7
  border-radius: 32px;
8
8
  padding: 8px;
9
9
  `}
10
- `,un=[{id:"CREDIT_CARD",label:"Credit Card"}],pn=f.FallbackSamplingRatio,hn=[{value:b.Pod,id:b.Pod},{value:b.Namespace,id:b.Namespace},{value:b.Node,id:b.Node}],mn=[{title:"Label Key",keyName:"labelKey",placeholder:"app.kubernetes.io/name",required:!0},{title:"Attribute Key",keyName:"attributeKey",placeholder:"app.kubernetes.name",required:!0},{title:"From Sources",keyName:"fromSources",placeholder:"pod, namespace",componentType:"multi-dropdown",options:hn,required:!1,tooltip:"Select multiple sources. Higher precedence sources (pod > namespace > node) will override lower ones."}],gn=[{title:"Annotation Key",keyName:"annotationKey",placeholder:"kubectl.kubernetes.io/restartedAt",required:!0},{title:"Attribute Key",keyName:"attributeKey",placeholder:"kubectl.kubernetes.restartedAt",required:!0},{title:"From Sources",keyName:"fromSources",placeholder:"pod, namespace",componentType:"multi-dropdown",options:hn,required:!1,tooltip:"Select multiple sources. Higher precedence sources (pod > namespace > node) will override lower ones."}],yn=f.EndpointsFilters,vn=[{title:"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.",required:!0},{title:"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.",required:!0},{title:"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.",required:!0,type:w.Number},{title:"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.",required:!0,type:w.Number}],bn=f.AttributeNamesToDelete,fn=f.Renames,xn=f.ServicesNameFilters,Sn=[{title:"Service Name",keyName:"serviceName",placeholder:"e.g. my-service",tooltip:"Specifies the service name to search within the trace (Across all available spans).",required:!0},{title:"Sampling Ratio",keyName:"samplingRatio",placeholder:"e.g. 10",tooltip:"Specifies the sample rate for all traces.",required:!0,type:w.Number},{title:"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.",required:!0,type:w.Number}],$n=f.SamplingPercentage,Cn=f.AttributeFilters,wn=[{title:"Service Name",keyName:"serviceName",placeholder:"e.g. my-service",tooltip:"Specifies the service name to search within the trace (across all available spans).",required:!0},{title:"Attribute Key",keyName:"attributeKey",placeholder:"e.g. http.request.method",tooltip:"Specifies the attribute key inside of the span.",required:!0},{title:"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.",required:!0,type:w.Number},{title:"Condition",keyName:"condition",tooltip:"An object representing the filters for span attributes filters.",required:!0,componentType:O.Dropdown,options:[{id:"stringCondition",value:"String Condition"},{id:"numberCondition",value:"Number Condition"},{id:"booleanCondition",value:"Boolean Condition"},{id:"jsonCondition",value:"JSON Condition"}]},{title:"Operation",keyName:"operation",tooltip:"Specifies the operation to run against the attribute.",required:!0,componentType:O.Dropdown,options:[{id:"exists",value:"Exists"},{id:"equals",value:"Equals"},{id:"not_equals",value:"Not Equals"},{id:"contains",value:"Contains"},{id:"not_contains",value:"Not Contains"},{id:"regex",value:"Regex"},{id:"greater_than",value:"Greater Than"},{id:"less_than",value:"Less Than"},{id:"greater_than_or_equal",value:"Greater Than Or Equal"},{id:"less_than_or_equal",value:"Less Than Or Equal"},{id:"is_valid_json",value:"Is Valid JSON"},{id:"is_invalid_json",value:"Is Invalid JSON"},{id:"jsonpath_exists",value:"JSON Path Exists"},{id:"key_equals",value:"Key Equals"},{id:"key_not_equals",value:"Key Not Equals"}]},{title:"Expected Value",keyName:"expectedValue",placeholder:"e.g. GET",tooltip:"The values to test the attribute against.",required:!0},{title:"JSON Path",keyName:"jsonPath",placeholder:"e.g. $.user.role",tooltip:"An expression used to navigate the JSON structure.",required:!1,renderCondition:e=>"jsonCondition"===e.condition}],kn={[v.K8sAttributes]:({value:n,setValue:o,formErrors:r})=>(a(()=>{n[f.CollectContainerAttributes]||n[f.CollectReplicaSetAttributes]||n[f.CollectWorkloadId]||n[f.CollectClusterId]||n[f.LabelsAttributes]?.length||n[f.AnnotationsAttributes]?.length||(o(f.CollectContainerAttributes,!0),o(f.CollectReplicaSetAttributes,!0),o(f.CollectWorkloadId,!0),o(f.CollectClusterId,!0),o(f.LabelsAttributes,[]),o(f.AnnotationsAttributes,[]))},[]),e(i,{children:[t(S,{title:"Collect Container Attributes",value:n[f.CollectContainerAttributes]||!1,onChange:e=>o(f.CollectContainerAttributes,e),errorMessage:r[f.CollectContainerAttributes]}),t(S,{title:"Collect ReplicaSet Attributes",value:n[f.CollectReplicaSetAttributes]||!1,onChange:e=>o(f.CollectReplicaSetAttributes,e),errorMessage:r[f.CollectReplicaSetAttributes]}),t(S,{title:"Collect Workload ID",value:n[f.CollectWorkloadId]||!1,onChange:e=>o(f.CollectWorkloadId,e),errorMessage:r[f.CollectWorkloadId]}),t(S,{title:"Collect Cluster ID",value:n[f.CollectClusterId]||!1,onChange:e=>o(f.CollectClusterId,e),errorMessage:r[f.CollectClusterId]}),t(D,{columns:mn,value:n[f.LabelsAttributes]||[],onChange:e=>o(f.LabelsAttributes,e),errorMessage:r[f.LabelsAttributes]}),t(D,{columns:gn,value:n[f.AnnotationsAttributes]||[],onChange:e=>o(f.AnnotationsAttributes,e),errorMessage:r[f.AnnotationsAttributes]})]})),[v.AddClusterInfo]:({value:n,setValue:a,formErrors:o})=>e(i,{children:[t(T,{title:"Overwrite Existing Values",tooltip:"If enabled, the resource attributes will overwrite any existing attributes with the same name.",initialValue:n[f.OverwriteExistingValues]||!1,onChange:e=>a(f.OverwriteExistingValues,e)}),t(N,{title:"Resource Attributes",value:n[f.ClusterAttributes]?.map(e=>({key:e.attributeName,value:e.attributeStringValue}))||[],onChange:e=>a(f.ClusterAttributes,e.map(e=>({attributeName:e.key,attributeStringValue:e.value}))),required:!0,errorMessage:o[f.ClusterAttributes]})]}),[v.DeleteAttributes]:({value:e,setValue:i,formErrors:n})=>{const a=n[bn],o=e[bn]||[];return t(E,{title:"Attributes to delete",value:o,onChange:e=>i(bn,e),required:!0,errorMessage:a})},[v.RenameAttributes]:({value:e,setValue:i,formErrors:n})=>{const a=n[fn],o=Object.entries(e[fn]||{}).map(([e,t])=>({key:e,value:t}));return t(N,{title:"Attributes to rename",value:o,onChange:e=>{const t={};e.forEach(e=>t[e.key]=e.value),i(fn,t)},required:!0,errorMessage:a})},[v.PiiMasking]:({value:i,setValue:o,formErrors:r})=>{const l=r[cn],s=i[cn]||[],[c,d]=n(1===s.length);return a(()=>{if(!s.length){const e=un.map(({id:e})=>e);o(cn,e),d(1===un.length)}},[]),e("div",{children:[t(x,{title:"Attributes to mask",required:!0}),t(dn,{$hasError:!!l,children:un.map(({id:e,label:i})=>t(S,{title:i,disabled:c&&s.includes(e),value:s.includes(e),onChange:t=>((e,t)=>{const i=t?[...s,e]:s.filter(t=>t!==e);o(cn,i),d(1===i.length)})(e,t)},e))}),!!l&&t($,{children:l})]})},[v.ErrorSampler]:({value:e,setValue:i,formErrors:n})=>{const a=n[pn],o=e[pn];return t(C,{title:"Fallback sampling ratio",required:!0,type:w.Number,min:0,max:100,value:k(o)?"":String(o),onChange:({target:{value:e}})=>{return t=e,i(pn,Math.max(0,Math.min(Number(t),100))||0);var t},errorMessage:a})},[v.ProbabilisticSampler]:({value:e,setValue:i,formErrors:n})=>{const a=n[$n],o=e[$n];return t(C,{title:"Sampling percentage",required:!0,type:w.Number,min:0,max:100,value:k(o)?"":String(o),onChange:({target:{value:e}})=>{return t=e,i($n,Math.max(0,Math.min(Number(t),100))||0);var t},errorMessage:a})},[v.LatencySampler]:({value:e,setValue:i,formErrors:n})=>{const a=n[yn],o=e[yn]||[];return t(D,{columns:vn,value:o,onChange:e=>{const t=e.map(({serviceName:e,httpRoute:t,minimumLatencyThreshold:i,fallbackSamplingRatio:n})=>({serviceName:e,httpRoute:t,minimumLatencyThreshold:Number(i),fallbackSamplingRatio:Number(n)}));i(yn,t)},errorMessage:a})},[v.ServiceNameSampler]:({value:e,setValue:i,formErrors:n})=>{const a=n[xn],o=e[xn]||[];return t(D,{columns:Sn,value:o,onChange:e=>{const t=e.map(({serviceName:e,samplingRatio:t,fallbackSamplingRatio:i})=>({serviceName:e,samplingRatio:Number(t),fallbackSamplingRatio:Number(i)}));i(xn,t)},errorMessage:a})},[v.SpanAttributeSampler]:({value:e,setValue:i,formErrors:n})=>{const a=n[Cn],o=(e[Cn]||[]).map(({serviceName:e,attributeKey:t,fallbackSamplingRatio:i,condition:n})=>{const a=Object.entries(n).filter(([e,t])=>t)[0][0];return{serviceName:e,attributeKey:t,fallbackSamplingRatio:i,condition:a,operation:n[a]?.operation,expectedValue:n[a]?.expectedValue,jsonPath:n[a]?.jsonPath}});return t(D,{columns:wn,value:o,onChange:e=>{const t=e.map(({serviceName:e,attributeKey:t,fallbackSamplingRatio:i,condition:n,operation:a,expectedValue:o,jsonPath:r})=>{const l={serviceName:e,attributeKey:t,fallbackSamplingRatio:Number(i),condition:{[n]:{operation:a,expectedValue:o}}};return r&&(l.condition[n].jsonPath=r),l});i(Cn,t)},errorMessage:a,limitFieldsPerRow:3})}},Dn=({actionType:e,value:i,setValue:n,formErrors:a})=>{if(!e)return null;const o=kn[e];return o?t(o,{value:i,setValue:n,formErrors:a}):null},Tn=p.div`
10
+ `,un=[{id:"CREDIT_CARD",label:"Credit Card"}],pn=f.FallbackSamplingRatio,hn=[{value:b.Pod,id:b.Pod},{value:b.Namespace,id:b.Namespace},{value:b.Node,id:b.Node}],mn=[{title:"Label Key",keyName:"labelKey",placeholder:"app.kubernetes.io/name",required:!0},{title:"Attribute Key",keyName:"attributeKey",placeholder:"app.kubernetes.name",required:!0},{title:"From Sources",keyName:"fromSources",placeholder:"pod, namespace",componentType:"multi-dropdown",options:hn,required:!1,tooltip:"Select multiple sources. Higher precedence sources (pod > namespace > node) will override lower ones."}],gn=[{title:"Annotation Key",keyName:"annotationKey",placeholder:"kubectl.kubernetes.io/restartedAt",required:!0},{title:"Attribute Key",keyName:"attributeKey",placeholder:"kubectl.kubernetes.restartedAt",required:!0},{title:"From Sources",keyName:"fromSources",placeholder:"pod, namespace",componentType:"multi-dropdown",options:hn,required:!1,tooltip:"Select multiple sources. Higher precedence sources (pod > namespace > node) will override lower ones."}],yn=f.EndpointsFilters,vn=[{title:"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.",required:!0},{title:"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.",required:!0},{title:"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.",required:!0,type:w.Number},{title:"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.",required:!0,type:w.Number}],bn=f.AttributeNamesToDelete,fn=f.Renames,xn=f.ServicesNameFilters,Sn=[{title:"Service Name",keyName:"serviceName",placeholder:"e.g. my-service",tooltip:"Specifies the service name to search within the trace (Across all available spans).",required:!0},{title:"Sampling Ratio",keyName:"samplingRatio",placeholder:"e.g. 10",tooltip:"Specifies the sample rate for all traces.",required:!0,type:w.Number},{title:"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.",required:!0,type:w.Number}],$n=f.SamplingPercentage,Cn=f.AttributeFilters,wn=[{title:"Service Name",keyName:"serviceName",placeholder:"e.g. my-service",tooltip:"Specifies the service name to search within the trace (across all available spans).",required:!0},{title:"Attribute Key",keyName:"attributeKey",placeholder:"e.g. http.request.method",tooltip:"Specifies the attribute key inside of the span.",required:!0},{title:"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.",required:!0,type:w.Number},{title:"Condition",keyName:"condition",tooltip:"An object representing the filters for span attributes filters.",required:!0,componentType:F.Dropdown,options:[{id:"stringCondition",value:"String Condition"},{id:"numberCondition",value:"Number Condition"},{id:"booleanCondition",value:"Boolean Condition"},{id:"jsonCondition",value:"JSON Condition"}]},{title:"Operation",keyName:"operation",tooltip:"Specifies the operation to run against the attribute.",required:!0,componentType:F.Dropdown,options:[{id:"exists",value:"Exists"},{id:"equals",value:"Equals"},{id:"not_equals",value:"Not Equals"},{id:"contains",value:"Contains"},{id:"not_contains",value:"Not Contains"},{id:"regex",value:"Regex"},{id:"greater_than",value:"Greater Than"},{id:"less_than",value:"Less Than"},{id:"greater_than_or_equal",value:"Greater Than Or Equal"},{id:"less_than_or_equal",value:"Less Than Or Equal"},{id:"is_valid_json",value:"Is Valid JSON"},{id:"is_invalid_json",value:"Is Invalid JSON"},{id:"jsonpath_exists",value:"JSON Path Exists"},{id:"key_equals",value:"Key Equals"},{id:"key_not_equals",value:"Key Not Equals"}]},{title:"Expected Value",keyName:"expectedValue",placeholder:"e.g. GET",tooltip:"The values to test the attribute against.",required:!0},{title:"JSON Path",keyName:"jsonPath",placeholder:"e.g. $.user.role",tooltip:"An expression used to navigate the JSON structure.",required:!1,renderCondition:e=>"jsonCondition"===e.condition}],kn={[v.K8sAttributes]:({value:n,setValue:o,formErrors:r})=>(a(()=>{n[f.CollectContainerAttributes]||n[f.CollectReplicaSetAttributes]||n[f.CollectWorkloadId]||n[f.CollectClusterId]||n[f.LabelsAttributes]?.length||n[f.AnnotationsAttributes]?.length||(o(f.CollectContainerAttributes,!0),o(f.CollectReplicaSetAttributes,!0),o(f.CollectWorkloadId,!0),o(f.CollectClusterId,!0),o(f.LabelsAttributes,[]),o(f.AnnotationsAttributes,[]))},[]),e(i,{children:[t(S,{title:"Collect Container Attributes",value:n[f.CollectContainerAttributes]||!1,onChange:e=>o(f.CollectContainerAttributes,e),errorMessage:r[f.CollectContainerAttributes]}),t(S,{title:"Collect ReplicaSet Attributes",value:n[f.CollectReplicaSetAttributes]||!1,onChange:e=>o(f.CollectReplicaSetAttributes,e),errorMessage:r[f.CollectReplicaSetAttributes]}),t(S,{title:"Collect Workload ID",value:n[f.CollectWorkloadId]||!1,onChange:e=>o(f.CollectWorkloadId,e),errorMessage:r[f.CollectWorkloadId]}),t(S,{title:"Collect Cluster ID",value:n[f.CollectClusterId]||!1,onChange:e=>o(f.CollectClusterId,e),errorMessage:r[f.CollectClusterId]}),t(D,{columns:mn,value:n[f.LabelsAttributes]||[],onChange:e=>o(f.LabelsAttributes,e),errorMessage:r[f.LabelsAttributes]}),t(D,{columns:gn,value:n[f.AnnotationsAttributes]||[],onChange:e=>o(f.AnnotationsAttributes,e),errorMessage:r[f.AnnotationsAttributes]})]})),[v.AddClusterInfo]:({value:n,setValue:a,formErrors:o})=>e(i,{children:[t(T,{title:"Overwrite Existing Values",tooltip:"If enabled, the resource attributes will overwrite any existing attributes with the same name.",initialValue:n[f.OverwriteExistingValues]||!1,onChange:e=>a(f.OverwriteExistingValues,e)}),t(N,{title:"Resource Attributes",value:n[f.ClusterAttributes]?.map(e=>({key:e.attributeName,value:e.attributeStringValue}))||[],onChange:e=>a(f.ClusterAttributes,e.map(e=>({attributeName:e.key,attributeStringValue:e.value}))),required:!0,errorMessage:o[f.ClusterAttributes]})]}),[v.DeleteAttributes]:({value:e,setValue:i,formErrors:n})=>{const a=n[bn],o=e[bn]||[];return t(E,{title:"Attributes to delete",value:o,onChange:e=>i(bn,e),required:!0,errorMessage:a})},[v.RenameAttributes]:({value:e,setValue:i,formErrors:n})=>{const a=n[fn],o=Object.entries(e[fn]||{}).map(([e,t])=>({key:e,value:t}));return t(N,{title:"Attributes to rename",value:o,onChange:e=>{const t={};e.forEach(e=>t[e.key]=e.value),i(fn,t)},required:!0,errorMessage:a})},[v.PiiMasking]:({value:i,setValue:o,formErrors:r})=>{const l=r[cn],s=i[cn]||[],[c,d]=n(1===s.length);return a(()=>{if(!s.length){const e=un.map(({id:e})=>e);o(cn,e),d(1===un.length)}},[]),e("div",{children:[t(x,{title:"Attributes to mask",required:!0}),t(dn,{$hasError:!!l,children:un.map(({id:e,label:i})=>t(S,{title:i,disabled:c&&s.includes(e),value:s.includes(e),onChange:t=>((e,t)=>{const i=t?[...s,e]:s.filter(t=>t!==e);o(cn,i),d(1===i.length)})(e,t)},e))}),!!l&&t($,{children:l})]})},[v.ErrorSampler]:({value:e,setValue:i,formErrors:n})=>{const a=n[pn],o=e[pn];return t(C,{title:"Fallback sampling ratio",required:!0,type:w.Number,min:0,max:100,value:k(o)?"":String(o),onChange:({target:{value:e}})=>{return t=e,i(pn,Math.max(0,Math.min(Number(t),100))||0);var t},errorMessage:a})},[v.ProbabilisticSampler]:({value:e,setValue:i,formErrors:n})=>{const a=n[$n],o=e[$n];return t(C,{title:"Sampling percentage",required:!0,type:w.Number,min:0,max:100,value:k(o)?"":String(o),onChange:({target:{value:e}})=>{return t=e,i($n,Math.max(0,Math.min(Number(t),100))||0);var t},errorMessage:a})},[v.LatencySampler]:({value:e,setValue:i,formErrors:n})=>{const a=n[yn],o=e[yn]||[];return t(D,{columns:vn,value:o,onChange:e=>{const t=e.map(({serviceName:e,httpRoute:t,minimumLatencyThreshold:i,fallbackSamplingRatio:n})=>({serviceName:e,httpRoute:t,minimumLatencyThreshold:Number(i),fallbackSamplingRatio:Number(n)}));i(yn,t)},errorMessage:a})},[v.ServiceNameSampler]:({value:e,setValue:i,formErrors:n})=>{const a=n[xn],o=e[xn]||[];return t(D,{columns:Sn,value:o,onChange:e=>{const t=e.map(({serviceName:e,samplingRatio:t,fallbackSamplingRatio:i})=>({serviceName:e,samplingRatio:Number(t),fallbackSamplingRatio:Number(i)}));i(xn,t)},errorMessage:a})},[v.SpanAttributeSampler]:({value:e,setValue:i,formErrors:n})=>{const a=n[Cn],o=(e[Cn]||[]).map(({serviceName:e,attributeKey:t,fallbackSamplingRatio:i,condition:n})=>{const a=Object.entries(n).filter(([e,t])=>t)[0][0];return{serviceName:e,attributeKey:t,fallbackSamplingRatio:i,condition:a,operation:n[a]?.operation,expectedValue:n[a]?.expectedValue,jsonPath:n[a]?.jsonPath}});return t(D,{columns:wn,value:o,onChange:e=>{const t=e.map(({serviceName:e,attributeKey:t,fallbackSamplingRatio:i,condition:n,operation:a,expectedValue:o,jsonPath:r})=>{const l={serviceName:e,attributeKey:t,fallbackSamplingRatio:Number(i),condition:{[n]:{operation:a,expectedValue:o}}};return r&&(l.condition[n].jsonPath=r),l});i(Cn,t)},errorMessage:a,limitFieldsPerRow:3})}},Dn=({actionType:e,value:i,setValue:n,formErrors:a})=>{if(!e)return null;const o=kn[e];return o?t(o,{value:i,setValue:n,formErrors:a}):null},Tn=p.div`
11
11
  display: flex;
12
12
  flex-direction: column;
13
13
  gap: 24px;
14
14
  padding: 4px;
15
15
  `,Nn=p(P)`
16
16
  margin-bottom: 12px;
17
- `,En=({isUpdate:i,action:n,formData:a,formErrors:o,handleFormChange:r})=>{const l=m();return e(Tn,{children:[i&&e("div",{children:[t(Nn,{children:"Status"}),t(F,{options:[{icon:Ei,label:g.ENABLED,value:!1,selectedBgColor:l.text.success+A["050"]},{icon:Oi,label:g.DISABLED,value:!0,selectedBgColor:l.text.error+A["050"]}],selected:a.disabled,setSelected:e=>r("disabled",e)})]}),!i&&t(I,{title:"",description:n.docsDescription,actionButton:t(R,{endpoint:n.docsEndpoint})}),t(M,{title:"Signals for Processing",required:!0,allowedSignals:n.allowedSignals,selectedSignals:a.signals||[],setSelectedSignals:e=>r("signals",e),errorMessage:o.signals}),!i&&t(C,{title:"Action name",placeholder:"Use a name that describes the action",value:a.name||"",onChange:({target:{value:e}})=>r("name",e),errorMessage:o.name}),t(Dn,{actionType:n.type,value:a.fields,setValue:(e,t)=>r(`fields.${e}`,t),formErrors:o}),t(L,{title:"Notes",value:a.notes||"",onChange:({target:{value:e}})=>r("notes",e),errorMessage:o.notes})]})},On=o(({children:a,width:o=640,title:s,titleTooltip:c,hideEditTitleFromEdit:d,icons:u,iconSrcs:p,isEdit:h=!1,isFormDirty:g=!1,isLastItem:y=!1,onClose:v,onEdit:b,onSave:f,onDelete:x,onCancel:S,tabs:$,headerActionButtons:C},w)=>{const k=m(),{drawerType:D,setDrawerType:T,setDrawerEntityId:N}=j();K({key:"Enter",active:h},()=>U());const[E,O]=n(!1),[F,A]=n(!1),I=r(null),R=D===B.Source,M=()=>{O(!1),A(!1)},L=()=>{M(),b&&b(!1),T(null),N(null),v?.()};l(w,()=>({closeDrawer:L}));const W=()=>{I.current?.clearTitle(),S&&S(),M()},_=()=>{const e=I.current?.isTitleDirty();g||e?A(!0):W()},J=()=>{O(!0)},U=()=>{f&&f(I.current?.getTitle()||"")},Y=C||[];return b&&!h&&Y.push({"data-id":"drawer-edit",variant:"tertiary",onClick:()=>b(!0),children:e(i,{children:[t(Fi,{}),t(P,{size:14,family:"secondary",decoration:"underline",children:"Edit"})]})}),x&&!h&&Y.push({"data-id":"drawer-delete",variant:"tertiary",onClick:J,children:e(i,{children:[t(Ai,{}),t(P,{color:k.text.error,size:14,family:"secondary",decoration:"underline",children:R?q.UNINSTRUMENT:q.DELETE})]})}),e(i,{children:[t(z,{isOpen:!0,onClose:h?_:L,closeOnEscape:!E&&!F,width:`${o+64}px`,header:{icons:u,iconSrcs:p,title:s,titleTooltip:c,replaceTitleWith:!d&&h?t(Fn,{ref:I,title:s}):void 0,actionButtons:Y,tabs:$},footer:{isOpen:h,leftButtons:[{"data-id":"drawer-save",variant:"primary",onClick:U,children:q.SAVE},{"data-id":"drawer-cancel",variant:"secondary",onClick:_,children:q.CANCEL}],rightButtons:x?[{"data-id":"drawer-delete",variant:"tertiary",onClick:J,children:e(i,{children:[t(Ai,{}),t(P,{size:14,color:k.text.error,family:"secondary",decoration:"underline",children:q.DELETE})]})}]:[]},children:a}),t(H,{isOpen:E,noOverlay:!0,name:`${D}${s?` (${s})`:""}`,type:D,isLastItem:y,onApprove:()=>{x&&x(),M()},onDeny:M}),t(V,{isOpen:F,noOverlay:!0,name:"edit mode",onApprove:W,onDeny:M})]})}),Fn=o(({title:e},i)=>{const[o,r]=n(e);return a(()=>{r(e)},[e]),l(i,()=>({getTitle:()=>o||e,isTitleDirty:()=>o!==e,clearTitle:()=>r(e)})),t(C,{"data-id":"title",value:o,onChange:e=>r(e.target.value)})});Fn.displayName=Fn.name,On.displayName=On.name;const An=p.div`
17
+ `,En=({isUpdate:i,action:n,formData:a,formErrors:o,handleFormChange:r})=>{const l=m();return e(Tn,{children:[i&&e("div",{children:[t(Nn,{children:"Status"}),t(O,{options:[{icon:Ei,label:g.ENABLED,value:!1,selectedBgColor:l.text.success+A["050"]},{icon:Fi,label:g.DISABLED,value:!0,selectedBgColor:l.text.error+A["050"]}],selected:a.disabled,setSelected:e=>r("disabled",e)})]}),!i&&t(I,{title:"",description:n.docsDescription,actionButton:t(R,{endpoint:n.docsEndpoint})}),t(M,{title:"Signals for Processing",required:!0,allowedSignals:n.allowedSignals,selectedSignals:a.signals||[],setSelectedSignals:e=>r("signals",e),errorMessage:o.signals}),!i&&t(C,{title:"Action name",placeholder:"Use a name that describes the action",value:a.name||"",onChange:({target:{value:e}})=>r("name",e),errorMessage:o.name}),t(Dn,{actionType:n.type,value:a.fields,setValue:(e,t)=>r(`fields.${e}`,t),formErrors:o}),t(L,{title:"Notes",value:a.notes||"",onChange:({target:{value:e}})=>r("notes",e),errorMessage:o.notes})]})},Fn=o(({children:a,width:o=640,title:s,titleTooltip:c,hideEditTitleFromEdit:d,icons:u,iconSrcs:p,isEdit:h=!1,isFormDirty:g=!1,isLastItem:y=!1,onClose:v,onEdit:b,onSave:f,onDelete:x,onCancel:S,tabs:$,headerActionButtons:C},w)=>{const k=m(),{drawerType:D,setDrawerType:T,setDrawerEntityId:N}=j();K({key:"Enter",active:h},()=>U());const[E,F]=n(!1),[O,A]=n(!1),I=r(null),R=D===B.Source,M=()=>{F(!1),A(!1)},L=()=>{M(),b&&b(!1),T(null),N(null),v?.()};l(w,()=>({closeDrawer:L}));const W=()=>{I.current?.clearTitle(),S&&S(),M()},_=()=>{const e=I.current?.isTitleDirty();g||e?A(!0):W()},J=()=>{F(!0)},U=()=>{f&&f(I.current?.getTitle()||"")},Y=C||[];return b&&!h&&Y.push({"data-id":"drawer-edit",variant:"tertiary",onClick:()=>b(!0),children:e(i,{children:[t(Oi,{}),t(P,{size:14,family:"secondary",decoration:"underline",children:"Edit"})]})}),x&&!h&&Y.push({"data-id":"drawer-delete",variant:"tertiary",onClick:J,children:e(i,{children:[t(Ai,{}),t(P,{color:k.text.error,size:14,family:"secondary",decoration:"underline",children:R?q.UNINSTRUMENT:q.DELETE})]})}),e(i,{children:[t(z,{isOpen:!0,onClose:h?_:L,closeOnEscape:!E&&!O,width:`${o+64}px`,header:{icons:u,iconSrcs:p,title:s,titleTooltip:c,replaceTitleWith:!d&&h?t(On,{ref:I,title:s}):void 0,actionButtons:Y,tabs:$},footer:{isOpen:h,leftButtons:[{"data-id":"drawer-save",variant:"primary",onClick:U,children:q.SAVE},{"data-id":"drawer-cancel",variant:"secondary",onClick:_,children:q.CANCEL}],rightButtons:x?[{"data-id":"drawer-delete",variant:"tertiary",onClick:J,children:e(i,{children:[t(Ai,{}),t(P,{size:14,color:k.text.error,family:"secondary",decoration:"underline",children:q.DELETE})]})}]:[]},children:a}),t(H,{isOpen:E,noOverlay:!0,name:`${D}${s?` (${s})`:""}`,type:D,isLastItem:y,onApprove:()=>{x&&x(),M()},onDeny:M}),t(V,{isOpen:O,noOverlay:!0,name:"edit mode",onApprove:W,onDeny:M})]})}),On=o(({title:e},i)=>{const[o,r]=n(e);return a(()=>{r(e)},[e]),l(i,()=>({getTitle:()=>o||e,isTitleDirty:()=>o!==e,clearTitle:()=>r(e)})),t(C,{"data-id":"title",value:o,onChange:e=>r(e.target.value)})});On.displayName=On.name,Fn.displayName=Fn.name;const An=p.div`
18
18
  width: 100%;
19
19
  height: 100%;
20
20
  max-height: calc(100vh - 220px);
@@ -24,7 +24,7 @@ import{jsxs as e,jsx as t,Fragment as i}from"react/jsx-runtime";import{useState
24
24
  display: flex;
25
25
  flex-direction: column;
26
26
  gap: 12px;
27
- `,Rn=({updateAction:i,deleteAction:o})=>{const{actions:l}=W(),{drawerType:c,drawerEntityId:d}=j(),u=r(null),p=c===B.Action,[h,m]=n(!1),[y,v]=n(!1),{formData:b,formErrors:f,handleFormChange:x,resetFormData:S,validateForm:$,loadFormWithDrawerItem:C}=_(),w=s(()=>{if(d)return l?.find(e=>J(e)===d)},[d,l]);if(a(()=>{p&&w?C(w):S()},[p,w]),!w)return null;const k=U.find(({type:e})=>e===w.type)||U.find(({label:e})=>"Attributes"===e)?.items?.find(({type:e})=>e===w.type)||U.find(({label:e})=>"Samplers"===e)?.items?.find(({type:e})=>e===w.type);return t(On,{ref:u,title:w.name||w.type,icons:[X(w.type)],isEdit:h,isFormDirty:y,onEdit:e=>{m("boolean"!=typeof e||e)},onSave:e=>{if($({withAlert:!0,alertTitle:Q.Update})){const t=e!==w.type?e:"";x("name",t),i(d,{...b,name:t}),m(!1),v(!1)}},onDelete:()=>{o(d,w.type),m(!1),v(!1),u.current?.closeDrawer()},onCancel:()=>{m(!1),v(!1),C(w)},children:h&&k?t(An,{children:t(En,{isUpdate:!0,action:k,formData:b,formErrors:f,handleFormChange:(...e)=>{v(!0),x(...e)}})}):e(In,{children:[t(Y,{conditions:w.conditions||[]}),t(G,{title:g.ACTION_DETAILS,data:w?sn(w):[]})]})})},Mn=p(se)`
27
+ `,Rn=({updateAction:i,deleteAction:o})=>{const{actions:l}=W(),{drawerType:c,drawerEntityId:d}=j(),u=r(null),p=c===B.Action,[h,m]=n(!1),[y,v]=n(!1),{formData:b,formErrors:f,handleFormChange:x,resetFormData:S,validateForm:$,loadFormWithDrawerItem:C}=_(),w=s(()=>{if(d)return l?.find(e=>J(e)===d)},[d,l]);if(a(()=>{p&&w?C(w):S()},[p,w]),!w)return null;const k=U.find(({type:e})=>e===w.type)||U.find(({label:e})=>"Attributes"===e)?.items?.find(({type:e})=>e===w.type)||U.find(({label:e})=>"Samplers"===e)?.items?.find(({type:e})=>e===w.type);return t(Fn,{ref:u,title:w.name||w.type,icons:[X(w.type)],isEdit:h,isFormDirty:y,onEdit:e=>{m("boolean"!=typeof e||e)},onSave:e=>{if($({withAlert:!0,alertTitle:Q.Update})){const t=e!==w.type?e:"";x("name",t),i(d,{...b,name:t}),m(!1),v(!1)}},onDelete:()=>{o(d,w.type),m(!1),v(!1),u.current?.closeDrawer()},onCancel:()=>{m(!1),v(!1),C(w)},children:h&&k?t(An,{children:t(En,{isUpdate:!0,action:k,formData:b,formErrors:f,handleFormChange:(...e)=>{v(!0),x(...e)}})}):e(In,{children:[t(Y,{conditions:w.conditions||[]}),t(G,{title:g.ACTION_DETAILS,data:w?sn(w):[]})]})})},Mn=p(se)`
28
28
  margin-top: 24px;
29
29
  gap: 12px;
30
30
  `,Ln=({createAction:i})=>{const{currentModal:a,setCurrentModal:o}=Z(),r=a===B.Action,{formData:l,formErrors:s,handleFormChange:c,resetFormData:d,validateForm:u}=_(),[p,h]=n(void 0),m=()=>{d(),h(void 0),o("")},y=()=>{if(!u({withAlert:!0,alertTitle:Q.Create}))return null;i(l),m()};return K({key:"Enter",active:r},()=>y()),t(ee,{isOpen:r,onClose:m,header:{title:"Add Action"},actionComponent:t(le,{buttons:[{variant:"primary",label:"DONE",onClick:y,disabled:!p}]}),children:e(te,{children:[t(I,{title:"Select Action",description:"Select an action to modify telemetry data before it`s sent to destinations. Choose an action type and configure its details."}),e(Mn,{children:[t(ie,{type:ne.Warning,message:ae.DEFINED_FOR_ALL_STREAMS(g.ACTIONS)}),t(oe,{options:U,selectedOption:p,onOptionSelect:e=>{return t=e,d(),c("type",t?.type||""),void h(t);var t},autoFocus:!p?.type})]}),p?.type?e("div",{children:[t(re,{margin:"16px 0"}),t(En,{action:p,formData:l,formErrors:s,handleFormChange:c})]}):null]})})},Pn=e=>{const{type:t,fields:{collectContainerAttributes:i,collectReplicaSetAttributes:n,collectWorkloadId:a,collectClusterId:o,labelsAttributes:r,annotationsAttributes:l,clusterAttributes:s,overwriteExistingValues:c,attributeNamesToDelete:d,renames:u,piiCategories:p,fallbackSamplingRatio:h,samplingPercentage:m,endpointsFilters:g,attributeFilters:y,servicesNameFilters:f}}=e;let x="";if(t===v.K8sAttributes&&(i&&(x+="Container Attributes, "),n&&(x+="ReplicaSet Attributes, "),a&&(x+="Workload ID, "),o&&(x+="Cluster ID, "),r?.forEach(({labelKey:e,attributeKey:t,from:i,fromSources:n},a)=>{const o=n?.length?n.join(","):i||b.Pod;x+=`Label: ${e} ${t} ${o} `,a===r.length-1&&(x+=", ")}),l?.forEach(({annotationKey:e,attributeKey:t,from:i,fromSources:n},a)=>{const o=n?.length?n.join(","):i||b.Pod;x+=`Annotation: ${e} ${t} ${o} `,a===l.length-1&&(x+=", ")})),t===v.AddClusterInfo&&(x+=`Overwrite Existing: ${c}\n`,s?.forEach(({attributeName:e,attributeStringValue:t},i)=>{x+=`${e}: ${t}`,i<s.length-1&&(x+=", ")})),t===v.DeleteAttributes&&d?.forEach((e,t)=>{x+=e,t<d.length-1&&(x+=", ")}),t===v.RenameAttributes){const e=Object.entries(u||{});e.forEach(([t,i],n)=>{x+=`${t}: ${i}`,n<e.length-1&&(x+=", ")})}return t===v.PiiMasking&&p?.forEach((e,t)=>{x+=e,t<p.length-1&&(x+=", ")}),t===v.ErrorSampler&&(x+=String(h)),t===v.ProbabilisticSampler&&(x+=String(m),x+="%"),t===v.LatencySampler&&g?.forEach(({serviceName:e,httpRoute:t,minimumLatencyThreshold:i,fallbackSamplingRatio:n},a)=>{x+=`Endpoint${g.length>1?` #${a+1}`:""}=${e}${t}\n`,x+=` Latency=${i}`,x+=` Sampling=${n}`,a<g.length-1&&(x+=", ")}),t===v.ServiceNameSampler&&f?.forEach(({serviceName:e,samplingRatio:t,fallbackSamplingRatio:i})=>{x+=`Service Name: ${e}, `,x+=`Sampling Ratio: ${t}, `,x+=`Fallback Sampling Ratio: ${i}\n`}),t===v.SpanAttributeSampler&&y?.forEach(({serviceName:e,attributeKey:t,fallbackSamplingRatio:i})=>{x+=`Service Name: ${e}, `,x+=`Attribute Key: ${t}, `,x+=`Fallback Sampling Ratio: ${i}\n`}),x},jn=({conditions:e,id:i})=>{const{errors:n,warnings:a,disableds:o,hasLoadings:r}=s(()=>ce(e),[e]),l=n.length>0?n:a.length>0?a:o.length>0?o:[];if(l.length>0)return t("div",{style:{lineHeight:1},children:t(Kn,{conditions:l,id:i})});const c=r?ue.Loading:ne.Success;return t("div",{style:{lineHeight:1},children:t(de,{status:c,title:c,withBorder:!0,withIcon:!0})})},Kn=({conditions:e,id:i})=>{const n=m();return t(pe,{children:he(e).map(({status:e,type:a,reason:o,message:r,lastTransitionTime:l},s)=>{"loading"!==e&&"disabled"!==e||(e=ne.Info);const c=ge(e,n);return t(me,{titleIcon:c,title:a,text:r||o||"",timestamp:l,children:t(de,{status:e,title:o||a,withBorder:!0,withIcon:!0})},`condition-${i}-${e}-${a}-${s}`)})})},qn=({instrumentationRules:e,sources:t,actions:i,destinations:n,searchText:a,selectedCategory:o})=>{const r=a?e.filter(e=>e.type?.toLowerCase().includes(a)||e.ruleName?.toLowerCase().includes(a)):e,l=a?t.filter(e=>e.name?.toLowerCase().includes(a)||e.otelServiceName?.toLowerCase().includes(a)||e.namespace?.toLowerCase().includes(a)):t,s=a?i.filter(e=>e.type?.toLowerCase().includes(a)||e.name?.toLowerCase().includes(a)):i,c=a?n.filter(e=>e.destinationType.displayName?.toLowerCase().includes(a)||e.name?.toLowerCase().includes(a)):n,d=[{category:B.Source,label:"Sources",count:l.length,entities:[]},{category:B.Action,label:"Actions",count:s.length,entities:[]},{category:B.Destination,label:"Destinations",count:c.length,entities:[]},{category:B.InstrumentationRule,label:"Instrumentation Rules",count:r.length,entities:[]}];d.unshift({category:"all",label:"All",count:r.length+l.length+s.length+c.length,entities:[]});const u=d.filter(({count:e,category:t})=>!!e&&"all"!==t&&["all",t].includes(o)).map(e=>({...e,entities:e.category===B.InstrumentationRule?r:e.category===B.Source?l:e.category===B.Action?s:e.category===B.Destination?c:[]}));return{categories:d,searchResults:u}},zn=[{key:"icon",title:""},{key:"name",title:g.NAME,sortable:!0},{key:"signals",title:g.MONITORS},{key:"active-status",title:g.STATUS},{key:"conditions",title:"Conditions"},{key:"type",title:g.TYPE,sortable:!0},{key:"spec",title:"Spec",sortable:!0},{key:"notes",title:g.NOTES,sortable:!0}],Hn=({maxHeight:i,maxWidth:n})=>{const a=m(),o=ye(),{actions:r,actionsLoading:l}=W(),{setDrawerType:c,setDrawerEntityId:d}=j(),u=s(()=>qn({instrumentationRules:[],sources:[],actions:ve(r,o),destinations:[],searchText:o.searchText,selectedCategory:B.Action}).searchResults.find(({category:e})=>e===B.Action)?.entities||[],[r,o]),p=s(()=>u.map(e=>{const{hasErrors:i,hasWarnings:n,hasDisableds:o}=ce(e.conditions||[]);return{status:i?ne.Error:n?ne.Warning:void 0,faded:o,onClick:()=>{c(B.Action),d(e.id)},cells:[{columnKey:"icon",component:()=>t(be,{icon:X(e.type)})},{columnKey:"name",value:fe(e,B.Action,{prioritizeDisplayName:!0})},{columnKey:"type",value:e.type,textColor:a.text.info},{columnKey:"notes",value:e.notes,textColor:a.text.info,withTooltip:!0},{columnKey:"spec",value:Pn(e),textColor:a.text.info,withTooltip:!0},{columnKey:"signals",component:()=>t(xe,{withLabels:!0,monitors:e.signals||[]})},{columnKey:"conditions",component:()=>t(jn,{conditions:e.conditions||[],id:e.id})},{columnKey:"active-status",component:()=>t("div",{style:{lineHeight:1},children:t(de,{status:e.disabled?ne.Error:ne.Success,title:e.disabled?g.DISABLED:g.ENABLED,withIcon:!0,withBorder:!0})})}]}}),[u]),{badge:h,badgeTooltip:y}=s(()=>u.length!==r.length?{badge:`${u.length}/${r.length}`,badgeTooltip:g.FILTERED_COUNT_TOOLTIP}:{badge:r.length,badgeTooltip:void 0},[u,r]);return e(Se,{$maxWidth:n,children:[t($e,{children:t(Ce,{icon:we(B.Action),title:g.ACTIONS,badge:h,badgeTooltip:y,loading:l})}),t(ke,{$maxHeight:i,children:t(De,{columns:zn,rows:p})}),!u.length&&t(Te,{style:{marginTop:"2rem"},children:t(Ne,{})})]})},Vn=p(se)`
@@ -45,7 +45,7 @@ import{jsxs as e,jsx as t,Fragment as i}from"react/jsx-runtime";import{useState
45
45
  text-align: center;
46
46
  line-height: 26px;
47
47
  color: ${({theme:e})=>e.text.info};
48
- `,Jn=()=>{const[i,o]=n(0);return a(()=>{(async()=>{for(let e=0;e<=100;e+=5)await Fe(500),o(e)})()},[]),e(Vn,{children:[t(Ii,{size:100}),t(Ee,{width:400}),e(Bn,{children:[e(pe,{$gap:16,children:[t(Wn,{children:"Preparing your workspace..."}),t(Oe,{label:`${i}%`})]}),t(_n,{children:"It can take up to a few minutes. Grab a cup of coffee, look out a window, and enjoy your free moment!"})]})]})},Un=p(se)`
48
+ `,Jn=()=>{const[i,o]=n(0);return a(()=>{(async()=>{for(let e=0;e<=100;e+=5)await Oe(500),o(e)})()},[]),e(Vn,{children:[t(Ii,{size:100}),t(Ee,{width:400}),e(Bn,{children:[e(pe,{$gap:16,children:[t(Wn,{children:"Preparing your workspace..."}),t(Fe,{label:`${i}%`})]}),t(_n,{children:"It can take up to a few minutes. Grab a cup of coffee, look out a window, and enjoy your free moment!"})]})]})},Un=p(se)`
49
49
  align-items: center !important;
50
50
  justify-content: center !important;
51
51
  align-self: stretch;
@@ -129,13 +129,13 @@ import{jsxs as e,jsx as t,Fragment as i}from"react/jsx-runtime";import{useState
129
129
  display: flex;
130
130
  flex-direction: column;
131
131
  gap: 12px;
132
- `,la=({entityType:i,entities:n,unfilteredCount:a,metrics:o,loading:r,maxHeight:l,refetch:c})=>{const{isVm:d}=Le(),{frameHeight:u,hasFiltersApplied:p,isSources:h}=s(()=>({frameHeight:Math.min(l,80*n.length),hasFiltersApplied:n.length!==a,isSources:i===B.Source}),[i,n.length,l,a]),{progress:m}=Be(),y=s(()=>h&&(m[We.Instrumenting]||m[We.Uninstrumenting])?m[We.Instrumenting]?.percentage||m[We.Uninstrumenting]?.percentage||0:void 0,[h,m[We.Instrumenting],m[We.Uninstrumenting]]),{selectedSources:v,setSelectedSources:b}=Re(),f=s(()=>h?Object.values(v).reduce((e,t)=>e+t.length,0):0,[h,v]);return d&&[B.InstrumentationRule,B.Action].includes(i)?null:e(ra,{$isVm:d,children:[t(ea,{entityType:i,badge:"number"==typeof y?`${y}%`:p?`${n.length}/${a}`:a,badgeTooltip:p?g.FILTERED_COUNT_TOOLTIP:void 0,isLoading:r,refetch:c,partiallySelected:f>0&&n?.length!==f,allSelected:f>0&&n?.length===f,onSelectAll:h?e=>{if(h)if(e){const e={};n?.forEach(t=>{const{namespace:i}=t;e[i]?e[i].push(t):e[i]=[t]}),b(e)}else b({})}:void 0,progressPercent:y}),n.length?t(oa,{height:u,entityType:i,entities:n,metrics:o}):r?t(_e,{size:3}):t(Yn,{entityType:i,description:g.TO_COLLECT_OTEL_DATA})]})},sa=p.div`
132
+ `,la=({entityType:i,entities:n,unfilteredCount:a,metrics:o,loading:r,maxHeight:l,refetch:c})=>{const{isVm:d}=Le(),{frameHeight:u,hasFiltersApplied:p,isSources:h}=s(()=>({frameHeight:Math.min(l,80*n.length+12),hasFiltersApplied:n.length!==a,isSources:i===B.Source}),[i,n.length,l,a]),{progress:m}=Be(),y=s(()=>h&&(m[We.Instrumenting]||m[We.Uninstrumenting])?m[We.Instrumenting]?.percentage||m[We.Uninstrumenting]?.percentage||0:void 0,[h,m[We.Instrumenting],m[We.Uninstrumenting]]),{selectedSources:v,setSelectedSources:b}=Re(),f=s(()=>h?Object.values(v).reduce((e,t)=>e+t.length,0):0,[h,v]);return d&&[B.InstrumentationRule,B.Action].includes(i)?null:e(ra,{$isVm:d,children:[t(ea,{entityType:i,badge:"number"==typeof y?`${y}%`:p?`${n.length}/${a}`:a,badgeTooltip:p?g.FILTERED_COUNT_TOOLTIP:void 0,isLoading:r,refetch:c,partiallySelected:f>0&&n?.length!==f,allSelected:f>0&&n?.length===f,onSelectAll:h?e=>{if(h)if(e){const e={};n?.forEach(t=>{const{namespace:i}=t;e[i]?e[i].push(t):e[i]=[t]}),b(e)}else b({})}:void 0,progressPercent:y}),n.length?t(oa,{height:u,entityType:i,entities:n,metrics:o}):r?t(_e,{size:3}):t(Yn,{entityType:i,description:g.TO_COLLECT_OTEL_DATA})]})},sa=p.div`
133
133
  width: 100%;
134
134
  height: ${({$height:e})=>e};
135
135
  display: flex;
136
136
  justify-content: space-evenly;
137
137
  gap: 24px;
138
- `,ca=({height:i,metrics:o,refetchSources:r,refetchDestinations:l,refetchActions:c,refetchInstrumentationRules:d})=>{const u=ye(),{selectedStreamName:p}=Je(),{containerRef:h,containerHeight:m}=Ue(),{sources:g,sourcesLoading:y,destinations:v,destinationsLoading:b,actions:f,actionsLoading:x,instrumentationRules:S,instrumentationRulesLoading:$}=W(),C=s(()=>Ye(g,p),[g,p]),w=s(()=>Ge(v,p),[v,p]),[k,D]=n([]),[T,N]=n([]),[E,O]=n([]),[F,A]=n([]);return a(()=>{D(Xe(C,u))},[C,u]),a(()=>{N(Qe(w,u))},[w,u]),a(()=>{O(ve(f,u))},[f,u]),a(()=>{A(S)},[S]),e(sa,{ref:h,$height:i,children:[t(la,{entityType:B.InstrumentationRule,entities:F,unfilteredCount:S.length,loading:$,maxHeight:m,refetch:d}),t(la,{entityType:B.Source,entities:k,unfilteredCount:C.length,metrics:o,loading:y,maxHeight:m,refetch:r}),t(la,{entityType:B.Action,entities:E,unfilteredCount:f.length,loading:x,maxHeight:m,refetch:c}),t(la,{entityType:B.Destination,entities:T,unfilteredCount:w.length,metrics:o,loading:b,maxHeight:m,refetch:l})]})},da=p.div`
138
+ `,ca=({height:i,metrics:o,refetchSources:r,refetchDestinations:l,refetchActions:c,refetchInstrumentationRules:d})=>{const u=ye(),{selectedStreamName:p}=Je(),{containerRef:h,containerHeight:m}=Ue(),{sources:g,sourcesLoading:y,destinations:v,destinationsLoading:b,actions:f,actionsLoading:x,instrumentationRules:S,instrumentationRulesLoading:$}=W(),C=s(()=>Ye(g,p),[g,p]),w=s(()=>Ge(v,p),[v,p]),[k,D]=n([]),[T,N]=n([]),[E,F]=n([]),[O,A]=n([]);return a(()=>{D(Xe(C,u))},[C,u]),a(()=>{N(Qe(w,u))},[w,u]),a(()=>{F(ve(f,u))},[f,u]),a(()=>{A(S)},[S]),e(sa,{ref:h,$height:i,children:[t(la,{entityType:B.InstrumentationRule,entities:O,unfilteredCount:S.length,loading:$,maxHeight:m,refetch:d}),t(la,{entityType:B.Source,entities:k,unfilteredCount:C.length,metrics:o,loading:y,maxHeight:m,refetch:r}),t(la,{entityType:B.Action,entities:E,unfilteredCount:f.length,loading:x,maxHeight:m,refetch:c}),t(la,{entityType:B.Destination,entities:T,unfilteredCount:w.length,metrics:o,loading:b,maxHeight:m,refetch:l})]})},da=p.div`
139
139
  position: relative;
140
140
  max-width: 200px;
141
141
  `;p.div`
@@ -165,7 +165,7 @@ import{jsxs as e,jsx as t,Fragment as i}from"react/jsx-runtime";import{useState
165
165
  ${({$color:e})=>`color: ${e};`}
166
166
  `,wa=p.div`
167
167
  margin-left: auto;
168
- `,ka=e=>{let t=0;return Object.values(e).forEach(e=>{e&&Array.isArray(e)&&e.length>0&&(t+=e.length)}),e.onlyErrors&&t++,e.searchText&&t++,t},Da=()=>{const i=m(),{namespaces:o,sources:l}=W(),{selectedStreamName:c}=Je(),{getItemSS:d,setItemSS:u,removeItemSS:p}=dt(),{popupRef:h,popupOpen:g,setPopupOpen:y,popupPosition:v,handlePosition:b}=et(),{namespaces:f,kinds:x,monitors:S,languages:$,conditions:C,errors:w,onlyErrors:k,podsAgentInjectionStatus:D,setAll:N,clearAll:E,getEmptyState:O}=ye(),F=s(()=>Ye(l,c),[l,c]),[A,I]=n({namespaces:f,kinds:x,monitors:S,languages:$,conditions:C,errors:w,onlyErrors:k,podsAgentInjectionStatus:D}),[R,M]=n(ka(A));a(()=>{const e=d(ct.OVERVIEW_FILTERS,O());N(e)},[]),a(()=>{if(!g){const e={namespaces:f,kinds:x,monitors:S,languages:$,conditions:C,errors:w,onlyErrors:k};I(e),M(ka(e))}},[g,f,x,S,$,C,w,k]);const L=()=>{y(!1)},P=r(null);return at(P,L),K({key:"Escape",active:g},L),e(da,{ref:P,children:[t(nt,{label:"Filters",icon:Pi,badgeLabel:R,badgeFilled:!!R,withBorder:!0,color:"transparent",onClick:()=>{b(0,50),y(!0)}}),t(tt,{ref:h,isOpen:g,top:v.top,left:v.left,width:"420px",footer:e(pe,{children:[t(Ca,{variant:"primary",onClick:()=>{u(ct.OVERVIEW_FILTERS,A),N(A),M(ka(A)),y(!1)},children:"Apply"}),t(Ca,{variant:"secondary",onClick:L,children:"Cancel"}),t(wa,{children:t(Ca,{variant:"tertiary",onClick:()=>{p(ct.OVERVIEW_FILTERS),E(),I(O()),M(0),y(!1)},$color:i.text.error,children:"Reset"})})]}),children:e(Sa,{children:[t(ba,{namespaces:o,value:A.namespaces,onSelect:e=>I(t=>({...t,namespaces:[...t.namespaces||[],e]})),onDeselect:e=>I(t=>({...t,namespaces:(t.namespaces||[]).filter(t=>t.id!==e.id)})),showSearch:!0,required:!0,isMulti:!0}),t(fa,{sources:F,value:A.kinds,onSelect:e=>I(t=>({...t,kinds:[...t.kinds||[],e]})),onDeselect:e=>I(t=>({...t,kinds:(t.kinds||[]).filter(t=>t.id!==e.id)})),showSearch:!0,required:!0,isMulti:!0}),t(ya,{sources:F,value:A.languages,onSelect:e=>I(t=>({...t,languages:[...t.languages||[],e]})),onDeselect:e=>I(t=>({...t,languages:(t.languages||[]).filter(t=>t.id!==e.id)})),showSearch:!0,required:!0,isMulti:!0}),t(va,{value:A.monitors,onSelect:e=>I(t=>({...t,monitors:[...t.monitors||[],e]})),onDeselect:e=>I(t=>({...t,monitors:(t.monitors||[]).filter(t=>t.id!==e.id)})),showSearch:!0,required:!0,isMulti:!0}),t(ma,{sources:F,value:A.conditions,onSelect:e=>I(t=>({...t,conditions:[...t.conditions||[],e]})),onDeselect:e=>I(t=>({...t,conditions:(t.conditions||[]).filter(t=>t.id!==e.id)})),showSearch:!0,required:!0,isMulti:!0}),t(xa,{sources:F,value:A.podsAgentInjectionStatus,onSelect:e=>I(t=>({...t,podsAgentInjectionStatus:[...t.podsAgentInjectionStatus||[],e]})),onDeselect:e=>I(t=>({...t,podsAgentInjectionStatus:(t.podsAgentInjectionStatus||[]).filter(t=>t.id!==e.id)})),showSearch:!0,required:!0,isMulti:!0}),t($a,{children:t(T,{title:"Show only sources with errors",initialValue:A.onlyErrors,onChange:e=>I(t=>({...t,errors:[],onlyErrors:e}))})}),t(ga,{sources:F,value:A.errors,onSelect:e=>I(t=>({...t,errors:[...t.errors||[],e]})),onDeselect:e=>I(t=>({...t,errors:(t.errors||[]).filter(t=>t.id!==e.id)})),disabled:!A.onlyErrors,showSearch:!0,required:!0,isMulti:!0})]})})]})},Ta=p.div`
168
+ `,ka=e=>{let t=0;return Object.values(e).forEach(e=>{e&&Array.isArray(e)&&e.length>0&&(t+=e.length)}),e.onlyErrors&&t++,e.searchText&&t++,t},Da=()=>{const i=m(),{namespaces:o,sources:l}=W(),{selectedStreamName:c}=Je(),{getItemSS:d,setItemSS:u,removeItemSS:p}=dt(),{popupRef:h,popupOpen:g,setPopupOpen:y,popupPosition:v,handlePosition:b}=et(),{namespaces:f,kinds:x,monitors:S,languages:$,conditions:C,errors:w,onlyErrors:k,podsAgentInjectionStatus:D,setAll:N,clearAll:E,getEmptyState:F}=ye(),O=s(()=>Ye(l,c),[l,c]),[A,I]=n({namespaces:f,kinds:x,monitors:S,languages:$,conditions:C,errors:w,onlyErrors:k,podsAgentInjectionStatus:D}),[R,M]=n(ka(A));a(()=>{const e=d(ct.OVERVIEW_FILTERS,F());N(e)},[]),a(()=>{if(!g){const e={namespaces:f,kinds:x,monitors:S,languages:$,conditions:C,errors:w,onlyErrors:k};I(e),M(ka(e))}},[g,f,x,S,$,C,w,k]);const L=()=>{y(!1)},P=r(null);return at(P,L),K({key:"Escape",active:g},L),e(da,{ref:P,children:[t(nt,{label:"Filters",icon:Pi,badgeLabel:R,badgeFilled:!!R,withBorder:!0,color:"transparent",onClick:()=>{b(0,50),y(!0)}}),t(tt,{ref:h,isOpen:g,top:v.top,left:v.left,width:"420px",footer:e(pe,{children:[t(Ca,{variant:"primary",onClick:()=>{u(ct.OVERVIEW_FILTERS,A),N(A),M(ka(A)),y(!1)},children:"Apply"}),t(Ca,{variant:"secondary",onClick:L,children:"Cancel"}),t(wa,{children:t(Ca,{variant:"tertiary",onClick:()=>{p(ct.OVERVIEW_FILTERS),E(),I(F()),M(0),y(!1)},$color:i.text.error,children:"Reset"})})]}),children:e(Sa,{children:[t(ba,{namespaces:o,value:A.namespaces,onSelect:e=>I(t=>({...t,namespaces:[...t.namespaces||[],e]})),onDeselect:e=>I(t=>({...t,namespaces:(t.namespaces||[]).filter(t=>t.id!==e.id)})),showSearch:!0,required:!0,isMulti:!0}),t(fa,{sources:O,value:A.kinds,onSelect:e=>I(t=>({...t,kinds:[...t.kinds||[],e]})),onDeselect:e=>I(t=>({...t,kinds:(t.kinds||[]).filter(t=>t.id!==e.id)})),showSearch:!0,required:!0,isMulti:!0}),t(ya,{sources:O,value:A.languages,onSelect:e=>I(t=>({...t,languages:[...t.languages||[],e]})),onDeselect:e=>I(t=>({...t,languages:(t.languages||[]).filter(t=>t.id!==e.id)})),showSearch:!0,required:!0,isMulti:!0}),t(va,{value:A.monitors,onSelect:e=>I(t=>({...t,monitors:[...t.monitors||[],e]})),onDeselect:e=>I(t=>({...t,monitors:(t.monitors||[]).filter(t=>t.id!==e.id)})),showSearch:!0,required:!0,isMulti:!0}),t(ma,{sources:O,value:A.conditions,onSelect:e=>I(t=>({...t,conditions:[...t.conditions||[],e]})),onDeselect:e=>I(t=>({...t,conditions:(t.conditions||[]).filter(t=>t.id!==e.id)})),showSearch:!0,required:!0,isMulti:!0}),t(xa,{sources:O,value:A.podsAgentInjectionStatus,onSelect:e=>I(t=>({...t,podsAgentInjectionStatus:[...t.podsAgentInjectionStatus||[],e]})),onDeselect:e=>I(t=>({...t,podsAgentInjectionStatus:(t.podsAgentInjectionStatus||[]).filter(t=>t.id!==e.id)})),showSearch:!0,required:!0,isMulti:!0}),t($a,{children:t(T,{title:"Show only sources with errors",initialValue:A.onlyErrors,onChange:e=>I(t=>({...t,errors:[],onlyErrors:e}))})}),t(ga,{sources:O,value:A.errors,onSelect:e=>I(t=>({...t,errors:[...t.errors||[],e]})),onDeselect:e=>I(t=>({...t,errors:(t.errors||[]).filter(t=>t.id!==e.id)})),disabled:!A.onlyErrors,showSearch:!0,required:!0,isMulti:!0})]})})]})},Ta=p.div`
169
169
  display: flex;
170
170
  flex-direction: column;
171
171
  gap: 24px;
@@ -176,7 +176,7 @@ import{jsxs as e,jsx as t,Fragment as i}from"react/jsx-runtime";import{useState
176
176
  max-height: calc(100vh - 220px);
177
177
  overflow: overlay;
178
178
  overflow-y: auto;
179
- `,Oa=({isOpen:e,onClose:i,dataStreamName:a,updateDataStream:o})=>{const{dataStreams:l}=Je(),c=r(null),[u,p]=n(!1),{formData:h,handleFormChange:m,formErrors:g,validateForm:y,resetFormData:v,loadFormWithDrawerItem:b}=ut({name:a}),f=s(()=>{if(!e)return v();const t=l?.find(e=>e.name===a);return t?b(t):v(),t},[e,l,a]),x=d((e,t)=>{m(e,t),p(!0)},[m]);return f?t(On,{ref:c,title:f.name,icons:[ji],hideEditTitleFromEdit:!0,isEdit:!0,isFormDirty:u,onSave:()=>{y({withAlert:!0,alertTitle:Q.Update})&&(o(a,h),p(!1),i())},onCancel:()=>{v(),p(!1),i()},children:t(Ea,{children:t(Na,{formData:h,handleFormChange:x,formErrors:g,editingStreamName:a})})}):null},Fa=p.div`
179
+ `,Fa=({isOpen:e,onClose:i,dataStreamName:a,updateDataStream:o})=>{const{dataStreams:l}=Je(),c=r(null),[u,p]=n(!1),{formData:h,handleFormChange:m,formErrors:g,validateForm:y,resetFormData:v,loadFormWithDrawerItem:b}=ut({name:a}),f=s(()=>{if(!e)return v();const t=l?.find(e=>e.name===a);return t?b(t):v(),t},[e,l,a]),x=d((e,t)=>{m(e,t),p(!0)},[m]);return f?t(Fn,{ref:c,title:f.name,icons:[ji],hideEditTitleFromEdit:!0,isEdit:!0,isFormDirty:u,onSave:()=>{y({withAlert:!0,alertTitle:Q.Update})&&(o(a,h),p(!1),i())},onCancel:()=>{v(),p(!1),i()},children:t(Ea,{children:t(Na,{formData:h,handleFormChange:x,formErrors:g,editingStreamName:a})})}):null},Oa=p.div`
180
180
  position: relative;
181
181
  `,Aa=p(pe)`
182
182
  border: 1px solid ${({theme:e})=>e.colors.border};
@@ -194,7 +194,7 @@ import{jsxs as e,jsx as t,Fragment as i}from"react/jsx-runtime";import{useState
194
194
  width: 100%;
195
195
  `,La=p.div`
196
196
  width: 100%;
197
- `,Pa=({onClickNewDataStream:a,updateDataStream:o,deleteDataStream:r})=>{const l=m(),{clearStore:c}=pt(),{popupRef:d,popupOpen:u,setPopupOpen:p,popupPosition:h,handlePosition:g}=et(),{dataStreams:y,selectedStreamName:v,setSelectedStreamName:b}=Je(),[f,x]=n(""),[S,$]=n(""),[w,k]=n(""),D=s(()=>y.filter(({name:e})=>!w||e.toLowerCase().includes(w.toLowerCase())).map(({name:i})=>e(Ma,{children:[t(La,{children:t(nt,{label:i,isSelected:v===i,onClick:()=>{c(),b(i),p(!1)},color:"transparent",style:{width:"100%",justifyContent:"flex-start"}})}),i!==ht&&t(mt,{onClick:()=>$(i),tooltip:q.DELETE,children:t(Ai,{})}),t(mt,{onClick:()=>x(i),tooltip:q.EDIT,children:t(Fi,{})})]},`stream-${i}`)),[y,v,w]);return e(i,{children:[e(Fa,{children:[e(Aa,{$gap:0,children:[e(Ie,{variant:"tertiary",onClick:()=>{g(0,50),p(e=>!e)},children:[t(ji,{fill:l.text.info}),e(Ia,{children:["Data Stream: ",v]}),t(gt,{extend:u}),t(Oe,{label:y.length})]}),t(re,{orientation:"vertical",length:"32px",thickness:2,margin:"0"}),t(yt,{onClick:()=>{c(),a()},label:q.NEW})]}),t(tt,{ref:d,isOpen:u,top:h.top,left:h.left,header:t(C,{placeholder:"Search...",icon:Li,value:w,onChange:e=>k(e.target.value)}),children:t(Ra,{children:D})})]}),t(H,{isOpen:""!==S,name:S,onApprove:()=>{r(S),$("")},onDeny:()=>{$("")}}),t(Oa,{isOpen:""!==f,onClose:()=>{x("")},dataStreamName:f,updateDataStream:o})]})},ja=p.div`
197
+ `,Pa=({onClickNewDataStream:a,updateDataStream:o,deleteDataStream:r})=>{const l=m(),{clearStore:c}=pt(),{popupRef:d,popupOpen:u,setPopupOpen:p,popupPosition:h,handlePosition:g}=et(),{dataStreams:y,selectedStreamName:v,setSelectedStreamName:b}=Je(),[f,x]=n(""),[S,$]=n(""),[w,k]=n(""),D=s(()=>y.filter(({name:e})=>!w||e.toLowerCase().includes(w.toLowerCase())).map(({name:i})=>e(Ma,{children:[t(La,{children:t(nt,{label:i,isSelected:v===i,onClick:()=>{c(),b(i),p(!1)},color:"transparent",style:{width:"100%",justifyContent:"flex-start"}})}),i!==ht&&t(mt,{onClick:()=>$(i),tooltip:q.DELETE,children:t(Ai,{})}),t(mt,{onClick:()=>x(i),tooltip:q.EDIT,children:t(Oi,{})})]},`stream-${i}`)),[y,v,w]);return e(i,{children:[e(Oa,{children:[e(Aa,{$gap:0,children:[e(Ie,{variant:"tertiary",onClick:()=>{g(0,50),p(e=>!e)},children:[t(ji,{fill:l.text.info}),e(Ia,{children:["Data Stream: ",v]}),t(gt,{extend:u}),t(Fe,{label:y.length})]}),t(re,{orientation:"vertical",length:"32px",thickness:2,margin:"0"}),t(yt,{onClick:()=>{c(),a()},label:q.NEW})]}),t(tt,{ref:d,isOpen:u,top:h.top,left:h.left,header:t(C,{placeholder:"Search...",icon:Li,value:w,onChange:e=>k(e.target.value)}),children:t(Ra,{children:D})})]}),t(H,{isOpen:""!==S,name:S,onApprove:()=>{r(S),$("")},onDeny:()=>{$("")}}),t(Fa,{isOpen:""!==f,onClose:()=>{x("")},dataStreamName:f,updateDataStream:o})]})},ja=p.div`
198
198
  display: flex;
199
199
  align-items: center;
200
200
  margin: 20px 0;
@@ -202,7 +202,7 @@ import{jsxs as e,jsx as t,Fragment as i}from"react/jsx-runtime";import{useState
202
202
  gap: 8px;
203
203
  `,Ka=p.div`
204
204
  margin-left: auto;
205
- `,qa=({addEntity:i,preventSearchPopup:n,onClickNewDataStream:a,updateDataStream:o,deleteDataStream:r})=>{const{isVm:l}=Le(),{setCurrentModal:s}=Z();return e(ja,{children:[!l&&t(Pa,{onClickNewDataStream:a,updateDataStream:o,deleteDataStream:r}),t(ha,{preventPopup:n}),t(Da,{}),i&&t(Ka,{children:t(yt,{"data-id":`add-${i}`,onClick:()=>s(i),label:`${q.ADD} ${ot(i)}`,variant:"primary",textProps:{weight:900}})})]})},za=o(({isModal:i,onClickSummary:n},a)=>{const{selectedStreamName:o}=Je(),{formData:r,handleFormChange:s,formErrors:c,validateForm:d}=ut({name:o});return l(a,()=>({validateForm:d,getFormValues:()=>r})),t(te,{$isNotModal:!i,children:e(se,{$gap:24,children:[n&&t(vt,{onClick:n}),t(I,{title:g.NAME_YOUR_STREAM,description:g.STREAM_DESCRIPTION}),t(Na,{formData:r,handleFormChange:s,formErrors:c})]})})});za.displayName=za.name;const Ha=({createDataStream:e})=>{const{currentModal:i,setCurrentModal:n}=Z(),{addDataStreams:a,setSelectedStreamName:o}=Je(),l=i===bt.DataStream,s=()=>n(""),c=async()=>{if(d.current&&d.current.validateForm()){const t=d.current.getFormValues();e?e(t):(a([t]),o(t.name)),s()}},d=r(null);return K({key:"Enter",active:l},c),t(ee,{isOpen:l,onClose:s,header:{title:"Add Data Stream"},actionComponent:t(le,{buttons:[{label:"DONE",variant:"primary",onClick:c}]}),children:t(za,{ref:d,isModal:!0})})},Va=(e,t)=>{const{destinationType:i,disabled:n,exportedSignals:a}=e,o=[{title:g.TYPE,value:i.type},{type:y.ActiveStatus,title:g.STATUS,value:String(!n)},{type:y.Monitors,title:g.MONITORS,value:Pe(a).join(", ")},{title:g.NAME,value:i.displayName}],r=ft(e,t),l=r.map(e=>({name:e.key,value:e.value}));return r.map(({key:e,name:i,value:n})=>{const{secret:r,componentProperties:s,hideFromReadData:c,customReadDataLabels:d}=t.find(t=>t.name===e)||{};if(!c?.length||!xt(c,Pe(a),l)){const{type:e}=St(s,{type:""}),t=(r||"password"===e)&&n.length?new Array(10).fill("•").join(""):"";o.push({type:y.Divider}),d?.length?d.forEach(({condition:e,...t})=>{e==n&&o.push({title:t.title,value:t.value})}):o.push({title:i,value:t||n})}}),o},Ba=({signals:e,fields:i,onChange:n,formErrors:a})=>i?.map(o=>{const{componentType:r,renderCondition:l,...s}=o;if(l&&!xt(l,e,i))return null;switch(r){case O.Input:return t(C,{...s,onChange:e=>n(o.name,e.target.value),errorMessage:a[o.name]},o.name);case O.Dropdown:return t(rt,{...s,showSearch:!0,value:{id:s.value||"",value:s.value||""},options:s.options||[],onSelect:e=>n(o.name,e.id),errorMessage:a[o.name]},o.name);case O.MultiInput:return t(E,{...s,value:"string"==typeof s.value?St(s.value,[]):s.value,onChange:e=>n(o.name,JSON.stringify(e)),errorMessage:a[o.name]},o.name);case O.KeyValuePair:return t(N,{...s,value:"string"==typeof s.value?St(s.value,[]):s.value,onChange:e=>n(o.name,JSON.stringify(e)),errorMessage:a[o.name]},o.name);case O.TextArea:return t(L,{...s,onChange:e=>n(o.name,e.target.value),errorMessage:a[o.name]},o.name);case O.Checkbox:return t(S,{...s,value:"true"==s.value,onChange:e=>n(o.name,String(e)),errorMessage:a[o.name]},o.name);default:return null}}),Wa=p(Ie)`
205
+ `,qa=({addEntity:i,preventSearchPopup:n,onClickNewDataStream:a,updateDataStream:o,deleteDataStream:r})=>{const{isVm:l}=Le(),{setCurrentModal:s}=Z();return e(ja,{children:[!l&&t(Pa,{onClickNewDataStream:a,updateDataStream:o,deleteDataStream:r}),t(ha,{preventPopup:n}),t(Da,{}),i&&t(Ka,{children:t(yt,{"data-id":`add-${i}`,onClick:()=>s(i),label:`${q.ADD} ${ot(i)}`,variant:"primary",textProps:{weight:900}})})]})},za=o(({isModal:i,onClickSummary:n},a)=>{const{selectedStreamName:o}=Je(),{formData:r,handleFormChange:s,formErrors:c,validateForm:d}=ut({name:o});return l(a,()=>({validateForm:d,getFormValues:()=>r})),t(te,{$isNotModal:!i,children:e(se,{$gap:24,children:[n&&t(vt,{onClick:n}),t(I,{title:g.NAME_YOUR_STREAM,description:g.STREAM_DESCRIPTION}),t(Na,{formData:r,handleFormChange:s,formErrors:c})]})})});za.displayName=za.name;const Ha=({createDataStream:e})=>{const{currentModal:i,setCurrentModal:n}=Z(),{addDataStreams:a,setSelectedStreamName:o}=Je(),l=i===bt.DataStream,s=()=>n(""),c=async()=>{if(d.current&&d.current.validateForm()){const t=d.current.getFormValues();e?e(t):(a([t]),o(t.name)),s()}},d=r(null);return K({key:"Enter",active:l},c),t(ee,{isOpen:l,onClose:s,header:{title:"Add Data Stream"},actionComponent:t(le,{buttons:[{label:"DONE",variant:"primary",onClick:c}]}),children:t(za,{ref:d,isModal:!0})})},Va=(e,t)=>{const{destinationType:i,disabled:n,exportedSignals:a}=e,o=[{title:g.TYPE,value:i.type},{type:y.ActiveStatus,title:g.STATUS,value:String(!n)},{type:y.Monitors,title:g.MONITORS,value:Pe(a).join(", ")},{title:g.NAME,value:i.displayName}],r=ft(e,t),l=r.map(e=>({name:e.key,value:e.value}));return r.map(({key:e,name:i,value:n})=>{const{secret:r,componentProperties:s,hideFromReadData:c,customReadDataLabels:d}=t.find(t=>t.name===e)||{};if(!c?.length||!xt(c,Pe(a),l)){const{type:e}=St(s,{type:""}),t=(r||"password"===e)&&n.length?new Array(10).fill("•").join(""):"";o.push({type:y.Divider}),d?.length?d.forEach(({condition:e,...t})=>{e==n&&o.push({title:t.title,value:t.value})}):o.push({title:i,value:t||n})}}),o},Ba=({signals:e,fields:i,onChange:n,formErrors:a})=>i?.map(o=>{const{componentType:r,renderCondition:l,...s}=o;if(l&&!xt(l,e,i))return null;switch(r){case F.Input:return t(C,{...s,onChange:e=>n(o.name,e.target.value),errorMessage:a[o.name]},o.name);case F.Dropdown:return t(rt,{...s,showSearch:!0,value:{id:s.value||"",value:s.value||""},options:s.options||[],onSelect:e=>n(o.name,e.id),errorMessage:a[o.name]},o.name);case F.MultiInput:return t(E,{...s,value:"string"==typeof s.value?St(s.value,[]):s.value,onChange:e=>n(o.name,JSON.stringify(e)),errorMessage:a[o.name]},o.name);case F.KeyValuePair:return t(N,{...s,value:"string"==typeof s.value?St(s.value,[]):s.value,onChange:e=>n(o.name,JSON.stringify(e)),errorMessage:a[o.name]},o.name);case F.TextArea:return t(L,{...s,onChange:e=>n(o.name,e.target.value),errorMessage:a[o.name]},o.name);case F.Checkbox:return t(S,{...s,value:"true"==s.value,onChange:e=>n(o.name,String(e)),errorMessage:a[o.name]},o.name);default:return null}}),Wa=p(Ie)`
206
206
  display: flex;
207
207
  align-items: center;
208
208
  gap: 8px;
@@ -227,7 +227,7 @@ import{jsxs as e,jsx as t,Fragment as i}from"react/jsx-runtime";import{useState
227
227
  justify-content: space-between;
228
228
  `,Ga=p(P)`
229
229
  margin-bottom: 12px;
230
- `,Xa=({isUpdate:i,categoryItem:o,formData:l,formErrors:c,validateForm:d,handleFormChange:u,dynamicFields:p,setDynamicFields:h,testConnection:y})=>{const{type:v,displayName:b,supportedSignals:f,testConnectionSupported:x}=o||{},S=m(),[$,w]=n(!1),[k,D]=n(!1),[T,N]=n(void 0),E=r(!1);a(()=>{if(p.length&&!E.current){E.current=!0;let e=!1;for(let t=0;t<p.length;t++){const{required:i,value:n}=p[t];if(i){if([void 0,null,""].includes(n)){e=!1;break}e=!0}}w(e)}},[p,k]);const O=s(()=>{const{logs:e,metrics:t,traces:i}=f||{},n=[];return e?.supported&&n.push($t.Logs),t?.supported&&n.push($t.Metrics),i?.supported&&n.push($t.Traces),n},[f]),L=s(()=>{const{logs:e,metrics:t,traces:i}=l.exportedSignals||{},n=[];return e&&n.push($t.Logs),t&&n.push($t.Metrics),i&&n.push($t.Traces),n},[l.exportedSignals]),P=()=>{w(!1),D(!0),N(void 0)};return e(Ja,{$gap:24,children:[e(Ja,{$gap:12,children:[t(I,{title:i?"Update destination":"Create destination",description:`Connect ${b} with Odigos.`,actionButton:x&&t(_a,{destination:l,validateForm:d,status:T?.type,testConnection:y,onError:e=>{D(!1),N({type:ne.Error,title:e?.reason||"Connection failed",message:e?.message||"Please check your input and try again."})},onSuccess:e=>{D(!1),N({type:ne.Success,title:e?.reason||"Connection succeeded",message:e?.message||""})}})}),e(Ua,{children:[x&&T&&t(ie,{type:T.type,title:T.title,message:T.message}),$&&!T&&!i&&t(ie,{type:ne.Default,message:`Odigos autocompleted ${b} destination details.`})]}),t(re,{})]}),e(Ya,{children:[t(M,{title:i?"":"This connection will monitor:",required:!0,allowedSignals:O,selectedSignals:L,setSelectedSignals:e=>{P(),u("exportedSignals",{logs:e.includes($t.Logs),metrics:e.includes($t.Metrics),traces:e.includes($t.Traces)})},errorMessage:c.exportedSignals}),!i&&t(R,{endpoint:`/backends/${v}`})]}),i&&e("div",{children:[t(Ga,{children:"Status"}),t(F,{options:[{icon:Ei,label:g.ENABLED,value:!1,selectedBgColor:S.text.success+A["050"]},{icon:Oi,label:g.DISABLED,value:!0,selectedBgColor:S.text.error+A["050"]}],selected:l.disabled,setSelected:e=>u("disabled",e)})]}),!i&&t(C,{title:"Destination name",placeholder:"Enter destination name",value:l.name,onChange:e=>{P(),u("name",e.target.value)},errorMessage:c.name}),t(Ba,{signals:L,fields:p,onChange:(e,t)=>{P(),h(i=>{const n=[...i],a=n.findIndex(t=>t.name===e);return-1!==a&&(n[a]={...n[a],value:t}),n})},formErrors:c})]})},Qa=p.div`
230
+ `,Xa=({isUpdate:i,categoryItem:o,formData:l,formErrors:c,validateForm:d,handleFormChange:u,dynamicFields:p,setDynamicFields:h,testConnection:y})=>{const{type:v,displayName:b,supportedSignals:f,testConnectionSupported:x}=o||{},S=m(),[$,w]=n(!1),[k,D]=n(!1),[T,N]=n(void 0),E=r(!1);a(()=>{if(p.length&&!E.current){E.current=!0;let e=!1;for(let t=0;t<p.length;t++){const{required:i,value:n}=p[t];if(i){if([void 0,null,""].includes(n)){e=!1;break}e=!0}}w(e)}},[p,k]);const F=s(()=>{const{logs:e,metrics:t,traces:i}=f||{},n=[];return e?.supported&&n.push($t.Logs),t?.supported&&n.push($t.Metrics),i?.supported&&n.push($t.Traces),n},[f]),L=s(()=>{const{logs:e,metrics:t,traces:i}=l.exportedSignals||{},n=[];return e&&n.push($t.Logs),t&&n.push($t.Metrics),i&&n.push($t.Traces),n},[l.exportedSignals]),P=()=>{w(!1),D(!0),N(void 0)};return e(Ja,{$gap:24,children:[e(Ja,{$gap:12,children:[t(I,{title:i?"Update destination":"Create destination",description:`Connect ${b} with Odigos.`,actionButton:x&&t(_a,{destination:l,validateForm:d,status:T?.type,testConnection:y,onError:e=>{D(!1),N({type:ne.Error,title:e?.reason||"Connection failed",message:e?.message||"Please check your input and try again."})},onSuccess:e=>{D(!1),N({type:ne.Success,title:e?.reason||"Connection succeeded",message:e?.message||""})}})}),e(Ua,{children:[x&&T&&t(ie,{type:T.type,title:T.title,message:T.message}),$&&!T&&!i&&t(ie,{type:ne.Default,message:`Odigos autocompleted ${b} destination details.`})]}),t(re,{})]}),e(Ya,{children:[t(M,{title:i?"":"This connection will monitor:",required:!0,allowedSignals:F,selectedSignals:L,setSelectedSignals:e=>{P(),u("exportedSignals",{logs:e.includes($t.Logs),metrics:e.includes($t.Metrics),traces:e.includes($t.Traces)})},errorMessage:c.exportedSignals}),!i&&t(R,{endpoint:`/backends/${v}`})]}),i&&e("div",{children:[t(Ga,{children:"Status"}),t(O,{options:[{icon:Ei,label:g.ENABLED,value:!1,selectedBgColor:S.text.success+A["050"]},{icon:Fi,label:g.DISABLED,value:!0,selectedBgColor:S.text.error+A["050"]}],selected:l.disabled,setSelected:e=>u("disabled",e)})]}),!i&&t(C,{title:"Destination name",placeholder:"Enter destination name",value:l.name,onChange:e=>{P(),u("name",e.target.value)},errorMessage:c.name}),t(Ba,{signals:L,fields:p,onChange:(e,t)=>{P(),h(i=>{const n=[...i],a=n.findIndex(t=>t.name===e);return-1!==a&&(n[a]={...n[a],value:t}),n})},formErrors:c})]})},Qa=p.div`
231
231
  width: 100%;
232
232
  height: 100%;
233
233
  max-height: calc(100vh - 220px);
@@ -237,7 +237,7 @@ import{jsxs as e,jsx as t,Fragment as i}from"react/jsx-runtime";import{useState
237
237
  display: flex;
238
238
  flex-direction: column;
239
239
  gap: 12px;
240
- `,eo=({categories:i,updateDestination:o,deleteDestination:l,testConnection:c})=>{const{destinations:d}=W(),{selectedStreamName:u}=Je(),{drawerType:p,drawerEntityId:h}=j(),m=s(()=>Ge(d,u),[d,u]),y=r(null),v=p===B.Destination,[b,f]=n(!1),[x,S]=n(!1),{formData:$,formErrors:C,handleFormChange:w,resetFormData:k,validateForm:D,loadFormWithDrawerItem:T,yamlFields:N,setYamlFields:E,dynamicFields:O,setDynamicFields:F}=Ct({}),A=s(()=>{if(h)return m?.find(e=>J(e)===h)},[h,m]);if(a(()=>{v&&A?(E(wt(i,A)),T(A)):k()},[v,A,i]),!A)return null;const I=i.flatMap(e=>e.items).find(e=>e.type===A.destinationType.type),{icon:R,iconSrc:M}=I?ze(I?.type):{icon:void 0,iconSrc:void 0};return t(On,{ref:y,title:A.name||A.destinationType.displayName,icons:R?[R]:void 0,iconSrcs:M?[M]:void 0,isEdit:b,isFormDirty:x,onEdit:e=>{f("boolean"!=typeof e||e)},onSave:async e=>{if(D({withAlert:!0,alertTitle:Q.Update})){const t=e!==A.destinationType.displayName?e:"";w("name",t),o(h,{...$,name:t}),f(!1),S(!1)}},onDelete:async()=>{l(h),f(!1),S(!1),y.current?.closeDrawer()},onCancel:()=>{f(!1),S(!1),T(A)},isLastItem:1===m.length,children:b?t(Qa,{children:t(Xa,{isUpdate:!0,categoryItem:I,formData:$,formErrors:C,handleFormChange:(...e)=>{S(!0),w(...e)},dynamicFields:O,setDynamicFields:(...e)=>{S(!0),F(...e)},validateForm:D,testConnection:c})}):e(Za,{children:[A.conditions?.length?t(Y,{conditions:A.conditions}):null,t(G,{title:g.DESTINATION_DETAILS,data:A?Va(A,N):[]})]})})},to=p.div`
240
+ `,eo=({categories:i,updateDestination:o,deleteDestination:l,testConnection:c})=>{const{destinations:d}=W(),{selectedStreamName:u}=Je(),{drawerType:p,drawerEntityId:h}=j(),m=s(()=>Ge(d,u),[d,u]),y=r(null),v=p===B.Destination,[b,f]=n(!1),[x,S]=n(!1),{formData:$,formErrors:C,handleFormChange:w,resetFormData:k,validateForm:D,loadFormWithDrawerItem:T,yamlFields:N,setYamlFields:E,dynamicFields:F,setDynamicFields:O}=Ct({}),A=s(()=>{if(h)return m?.find(e=>J(e)===h)},[h,m]);if(a(()=>{v&&A?(E(wt(i,A)),T(A)):k()},[v,A,i]),!A)return null;const I=i.flatMap(e=>e.items).find(e=>e.type===A.destinationType.type),{icon:R,iconSrc:M}=I?ze(I?.type):{icon:void 0,iconSrc:void 0};return t(Fn,{ref:y,title:A.name||A.destinationType.displayName,icons:R?[R]:void 0,iconSrcs:M?[M]:void 0,isEdit:b,isFormDirty:x,onEdit:e=>{f("boolean"!=typeof e||e)},onSave:async e=>{if(D({withAlert:!0,alertTitle:Q.Update})){const t=e!==A.destinationType.displayName?e:"";w("name",t),o(h,{...$,name:t}),f(!1),S(!1)}},onDelete:async()=>{l(h),f(!1),S(!1),y.current?.closeDrawer()},onCancel:()=>{f(!1),S(!1),T(A)},isLastItem:1===m.length,children:b?t(Qa,{children:t(Xa,{isUpdate:!0,categoryItem:I,formData:$,formErrors:C,handleFormChange:(...e)=>{S(!0),w(...e)},dynamicFields:F,setDynamicFields:(...e)=>{S(!0),O(...e)},validateForm:D,testConnection:c})}):e(Za,{children:[A.conditions?.length?t(Y,{conditions:A.conditions}):null,t(G,{title:g.DESTINATION_DETAILS,data:A?Va(A,N):[]})]})})},to=p.div`
241
241
  display: flex;
242
242
  flex-direction: column;
243
243
  gap: 12px;
@@ -265,7 +265,7 @@ import{jsxs as e,jsx as t,Fragment as i}from"react/jsx-runtime";import{useState
265
265
  }
266
266
  `,lo=p(no)`
267
267
  margin-top: 80px;
268
- `,so=Object.values(Nt).map(e=>({value:Tt[e].TITLE,id:e})),co=so[0],uo=[$t.Logs,$t.Metrics,$t.Traces],po=(e,t,i)=>e.map(e=>{const{type:n,displayName:a}=e.destinationType,o=e.dataStreamNames?.includes(t),r=i.has(e.id);return{id:e.id,type:n,displayName:a,selected:o||r,fields:[],testConnectionSupported:!1,supportedSignals:{logs:{supported:e.exportedSignals.logs},metrics:{supported:e.exportedSignals.metrics},traces:{supported:e.exportedSignals.traces}}}}),ho=({hidden:i,categories:a,potentialDestinations:o,onSelectNew:r,onSelectConfigured:l,isLoadingForDestinationIds:c})=>{const{destinations:d}=W(),{selectedStreamName:u}=Je(),{configuredDestinations:p,configuredDestinationsUpdateOnly:h}=pt(),[m,g]=n(""),[y,v]=n(co),[b,f]=n(uo),x=s(()=>{const e=Et(a);return e.unshift({name:Nt.EXISTS,description:Tt[Nt.EXISTS].DESCRIPTION,icon:Ki,items:po(d,u,new Set(p.concat(h).map(e=>e.id)))}),e.unshift({name:Nt.DETECTED,description:Tt[Nt.DETECTED].DESCRIPTION,icon:qi,items:o}),e.map(e=>{const t=e.items.filter(t=>{const i=!m||t.displayName.toLowerCase().includes(m.toLowerCase()),n="all"===y.id||y.id===e.name,a=b.some(e=>t.supportedSignals[Ot[e]]?.supported);return i&&n&&a});return{...e,items:t}}).filter(({items:e})=>!!e.length)},[a,o,d,m,y,b,u,p,h]);return i?null:e(no,{children:[t(I,{title:"Choose destination",description:"Add backend destination you want to connect with Odigos."}),e(ao,{children:[t(oo,{children:t(C,{placeholder:"Search...",icon:Li,value:m,onChange:({target:{value:e}})=>g(e)})}),t(oo,{children:t(rt,{options:so,value:y,onSelect:v,onDeselect:()=>{}})}),t(M,{title:"",selectedSignals:b,setSelectedSignals:f})]}),t(re,{}),x.length?t(ro,{children:t(io,{items:x,onSelectNew:e=>r(e,b),onSelectConfigured:l,isLoadingForDestinationIds:c})}):t(lo,{children:t(Ne,{title:"No destinations found"})})]})},mo=p.div`
268
+ `,so=Object.values(Nt).map(e=>({value:Tt[e].TITLE,id:e})),co=so[0],uo=[$t.Logs,$t.Metrics,$t.Traces],po=(e,t,i)=>e.map(e=>{const{type:n,displayName:a}=e.destinationType,o=e.dataStreamNames?.includes(t),r=i.has(e.id);return{id:e.id,type:n,displayName:a,selected:o||r,fields:[],testConnectionSupported:!1,supportedSignals:{logs:{supported:e.exportedSignals.logs},metrics:{supported:e.exportedSignals.metrics},traces:{supported:e.exportedSignals.traces}}}}),ho=({hidden:i,categories:a,potentialDestinations:o,onSelectNew:r,onSelectConfigured:l,isLoadingForDestinationIds:c})=>{const{destinations:d}=W(),{selectedStreamName:u}=Je(),{configuredDestinations:p,configuredDestinationsUpdateOnly:h}=pt(),[m,g]=n(""),[y,v]=n(co),[b,f]=n(uo),x=s(()=>{const e=Et(a);return e.unshift({name:Nt.EXISTS,description:Tt[Nt.EXISTS].DESCRIPTION,icon:Ki,items:po(d,u,new Set(p.concat(h).map(e=>e.id)))}),e.unshift({name:Nt.DETECTED,description:Tt[Nt.DETECTED].DESCRIPTION,icon:qi,items:o}),e.map(e=>{const t=e.items.filter(t=>{const i=!m||t.displayName.toLowerCase().includes(m.toLowerCase()),n="all"===y.id||y.id?.toLowerCase()?.replaceAll("-"," ")===e.name.toLowerCase()?.replaceAll("-"," "),a=b.some(e=>t.supportedSignals[Ft[e]]?.supported);return i&&n&&a});return{...e,items:t}}).filter(({items:e})=>!!e.length)},[a,o,d,m,y,b,u,p,h]);return i?null:e(no,{children:[t(I,{title:"Choose destination",description:"Add backend destination you want to connect with Odigos."}),e(ao,{children:[t(oo,{children:t(C,{placeholder:"Search...",icon:Li,value:m,onChange:({target:{value:e}})=>g(e)})}),t(oo,{children:t(rt,{options:so,value:y,onSelect:v,onDeselect:()=>{}})}),t(M,{title:"",selectedSignals:b,setSelectedSignals:f})]}),t(re,{}),x.length?t(ro,{children:t(io,{items:x,onSelectNew:e=>r(e,b),onSelectConfigured:l,isLoadingForDestinationIds:c})}):t(lo,{children:t(Ne,{title:"No destinations found"})})]})},mo=p.div`
269
269
  display: flex;
270
270
  `,go=p.div`
271
271
  border-right: 1px solid ${({theme:e})=>e.colors.border};
@@ -274,7 +274,7 @@ import{jsxs as e,jsx as t,Fragment as i}from"react/jsx-runtime";import{useState
274
274
  @media (max-width: 1050px) {
275
275
  display: none;
276
276
  }
277
- `,yo=({isOnboarding:i,categories:a,potentialDestinations:o,createDestination:r,updateDestination:l,deleteDestination:s,testConnection:c})=>{const{destinations:d}=W(),{selectedStreamName:u}=Je(),{currentModal:p,setCurrentModal:h}=Z(),{addConfiguredDestination:m,addConfiguredDestinationUpdateOnly:y,removeConfiguredDestinationUpdateOnly:v,configuredDestinationsUpdateOnly:b}=pt(),f=p===B.Destination,[x,S]=n(void 0),{formData:$,formErrors:C,handleFormChange:w,resetFormData:k,validateForm:D,setYamlFields:T,dynamicFields:N,setDynamicFields:E,loadFormWithDrawerItem:O}=Ct({supportedSignals:x?.supportedSignals,preLoadedFields:x?.fields}),[F,A]=n([]),I=e=>{const t={};return e||N.forEach(e=>t[e.name]=e.value),{id:e?.id||"",name:e?.name||$.name,disabled:e?.disabled||$.disabled,dataStreamNames:e?.dataStreamNames||[],conditions:e?.conditions||[],exportedSignals:e?.exportedSignals||$.exportedSignals,fields:e?.fields||JSON.stringify(t),destinationType:e?.destinationType||{type:x.type,displayName:x.displayName,supportedSignals:{logs:{supported:!1},metrics:{supported:!1},traces:{supported:!1}}}}},R=async e=>{if(i&&!e){const e=I();m(e)}else if(i&&e){const t=I(e);b.some(t=>t.id===e.id)?v(e):y(t)}else if(i||e){if(!i&&e){const t=I(e),i=t.dataStreamNames.some(e=>e===u);A(t=>[...t,e.id]),i?await s(e.id):await l(e.id,O(t)),A(t=>t.filter(t=>t!==e.id))}}else r($)},M=()=>{k(),S(void 0),h("")},L=()=>{k(),S(void 0)},P=async()=>{if(x){if(!D({withAlert:!i,alertTitle:Q.Create}))return null;R()}M()};return K({key:"Enter",active:f},()=>P()),t(ee,{isOpen:f,onClose:M,header:{title:g.ADD_DESTINATION},actionComponent:t(le,{buttons:(()=>{const e=[{label:"DONE",variant:"primary",onClick:P}];return x&&e.unshift({label:"BACK",icon:()=>t(zi,{rotate:-90}),variant:"secondary",onClick:L}),e})()}),children:e(mo,{children:[t(go,{children:t(Ft,{currentStep:x?2:1,data:[{stepNumber:1,title:g.DESTINATIONS},{stepNumber:2,title:g.CONNECTION}]})}),e(te,{style:{margin:"32px 24px 12px 24px"},children:[t(ho,{hidden:void 0!==x,categories:a,potentialDestinations:o,onSelectNew:(e,t)=>{k(),w("type",e?.type||""),w("currentStreamName",u);const i={logs:!1,metrics:!1,traces:!1};t.filter(t=>e.supportedSignals[Ot[t]].supported).forEach(e=>i[Ot[e]]=!0),w("exportedSignals",i),T(e?.fields||[]),S(e)},onSelectConfigured:e=>{const t=d.find(t=>t.id===e);t&&R(t)},isLoadingForDestinationIds:F}),x&&t(Xa,{categoryItem:x,formData:$,formErrors:C,handleFormChange:w,dynamicFields:N,setDynamicFields:E,validateForm:D,testConnection:c})]})]})})},vo=p.div`
277
+ `,yo=({isOnboarding:i,categories:a,potentialDestinations:o,createDestination:r,updateDestination:l,deleteDestination:s,testConnection:c})=>{const{destinations:d}=W(),{selectedStreamName:u}=Je(),{currentModal:p,setCurrentModal:h}=Z(),{addConfiguredDestination:m,addConfiguredDestinationUpdateOnly:y,removeConfiguredDestinationUpdateOnly:v,configuredDestinationsUpdateOnly:b}=pt(),f=p===B.Destination,[x,S]=n(void 0),{formData:$,formErrors:C,handleFormChange:w,resetFormData:k,validateForm:D,setYamlFields:T,dynamicFields:N,setDynamicFields:E,loadFormWithDrawerItem:F}=Ct({supportedSignals:x?.supportedSignals,preLoadedFields:x?.fields}),[O,A]=n([]),I=e=>{const t={};return e||N.forEach(e=>t[e.name]=e.value),{id:e?.id||"",name:e?.name||$.name,disabled:e?.disabled||$.disabled,dataStreamNames:e?.dataStreamNames||[],conditions:e?.conditions||[],exportedSignals:e?.exportedSignals||$.exportedSignals,fields:e?.fields||JSON.stringify(t),destinationType:e?.destinationType||{type:x.type,displayName:x.displayName,supportedSignals:{logs:{supported:!1},metrics:{supported:!1},traces:{supported:!1}}}}},R=async e=>{if(i&&!e){const e=I();m(e)}else if(i&&e){const t=I(e);b.some(t=>t.id===e.id)?v(e):y(t)}else if(i||e){if(!i&&e){const t=I(e),i=t.dataStreamNames.some(e=>e===u);A(t=>[...t,e.id]),i?await s(e.id):await l(e.id,F(t)),A(t=>t.filter(t=>t!==e.id))}}else r($)},M=()=>{k(),S(void 0),h("")},L=()=>{k(),S(void 0)},P=async()=>{if(x){if(!D({withAlert:!i,alertTitle:Q.Create}))return null;R()}M()};return K({key:"Enter",active:f},()=>P()),t(ee,{isOpen:f,onClose:M,header:{title:g.ADD_DESTINATION},actionComponent:t(le,{buttons:(()=>{const e=[{label:"DONE",variant:"primary",onClick:P}];return x&&e.unshift({label:"BACK",icon:()=>t(zi,{rotate:-90}),variant:"secondary",onClick:L}),e})()}),children:e(mo,{children:[t(go,{children:t(Ot,{currentStep:x?2:1,data:[{stepNumber:1,title:g.DESTINATIONS},{stepNumber:2,title:g.CONNECTION}]})}),e(te,{style:{margin:"32px 24px 12px 24px"},children:[t(ho,{hidden:void 0!==x,categories:a,potentialDestinations:o,onSelectNew:(e,t)=>{k(),w("type",e?.type||""),w("currentStreamName",u);const i={logs:!1,metrics:!1,traces:!1};t.filter(t=>e.supportedSignals[Ft[t]].supported).forEach(e=>i[Ft[e]]=!0),w("exportedSignals",i),T(e?.fields||[]),S(e)},onSelectConfigured:e=>{const t=d.find(t=>t.id===e);t&&R(t)},isLoadingForDestinationIds:O}),x&&t(Xa,{categoryItem:x,formData:$,formErrors:C,handleFormChange:w,dynamicFields:N,setDynamicFields:E,validateForm:D,testConnection:c})]})]})})},vo=p.div`
278
278
  display: flex;
279
279
  flex-direction: column;
280
280
  align-items: center;
@@ -302,7 +302,7 @@ import{jsxs as e,jsx as t,Fragment as i}from"react/jsx-runtime";import{useState
302
302
  border-radius: 16px;
303
303
  padding: 8px;
304
304
  `}
305
- `,Do=[{id:jt.FilePath,label:"Collect File Path",tooltip:"Indicates whether to record the `code.filepath` attribute."},{id:jt.Function,label:"Collect Function",tooltip:"Indicates whether to record the `code.function` attribute."},{id:jt.LineNumber,label:"Collect Line Number",tooltip:"Indicates whether to record the `code.lineno` attribute."}],To=[{id:jt.Column,label:"Collect Column",tooltip:"Indicates whether to record the `code.column` attribute."},{id:jt.Namespace,label:"Collect Namespace",tooltip:"Indicates whether to record the `code.namespace` attribute."},{id:jt.StackTrace,label:"Collect Stacktrace",tooltip:"Indicates whether to record the `code.stacktrace` attribute."}],No={[Lt.Java]:[new Mt("","")],[Lt.Golang]:[new Pt("")]},Eo=["*"],Oo=p.div`
305
+ `,Do=[{id:jt.FilePath,label:"Collect File Path",tooltip:"Indicates whether to record the `code.filepath` attribute."},{id:jt.Function,label:"Collect Function",tooltip:"Indicates whether to record the `code.function` attribute."},{id:jt.LineNumber,label:"Collect Line Number",tooltip:"Indicates whether to record the `code.lineno` attribute."}],To=[{id:jt.Column,label:"Collect Column",tooltip:"Indicates whether to record the `code.column` attribute."},{id:jt.Namespace,label:"Collect Namespace",tooltip:"Indicates whether to record the `code.namespace` attribute."},{id:jt.StackTrace,label:"Collect Stacktrace",tooltip:"Indicates whether to record the `code.stacktrace` attribute."}],No={[Lt.Java]:[new Mt("","")],[Lt.Golang]:[new Pt("")]},Eo=["*"],Fo=p.div`
306
306
  display: flex;
307
307
  flex-direction: column;
308
308
  gap: 12px;
@@ -312,14 +312,14 @@ import{jsxs as e,jsx as t,Fragment as i}from"react/jsx-runtime";import{useState
312
312
  border-radius: 16px;
313
313
  padding: 8px;
314
314
  `}
315
- `,Fo=[{id:Kt.HttpRequest,label:"Collect HTTP Request"},{id:Kt.HttpResponse,label:"Collect HTTP Response"},{id:Kt.DbQuery,label:"Collect DB Query"},{id:Kt.Messaging,label:"Collect Messaging"}],Ao={[qt.CodeAttributes]:({value:o,setValue:r,formErrors:l})=>{const c=l.codeAttributes,d=s(()=>Object.entries(o.codeAttributes||{}).filter(([e,t])=>!!t).map(([e])=>e),[o]),[u,p]=n(1===d.length);a(()=>{if(!d.length){const e={[jt.Column]:null,[jt.FilePath]:!0,[jt.Function]:!0,[jt.LineNumber]:!0,[jt.Namespace]:null,[jt.StackTrace]:null};r("codeAttributes",e),p(!1)}},[]);const h=(e,t)=>{const i=t?[...d,e]:d.filter(t=>t!==e),n=Object.values(jt).reduce((e,t)=>(e[t]=!!i.includes(t)||null,e),{});r("codeAttributes",n),p(1===i.length)};return e(i,{children:[e("div",{children:[t(x,{title:"Recommended data to collect",required:!0}),t(ko,{$hasError:!!c,children:Do.map(({id:e,label:i,tooltip:n})=>t(me,{text:n,withIcon:!0,children:t(S,{title:i,disabled:u&&d.includes(e),value:d.includes(e),onChange:t=>h(e,t)})},e))}),!!c&&t($,{children:c})]}),e("div",{children:[t(x,{title:"Verbose data to collect",required:!0}),t(ko,{$hasError:!!c,children:To.map(({id:e,label:i,tooltip:n})=>t(me,{text:n,withIcon:!0,children:t(S,{title:i,disabled:u&&d.includes(e),value:d.includes(e),onChange:t=>h(e,t)})},e))}),!!c&&t($,{children:c})]})]})},[qt.CustomInstrumentation]:({value:i,setValue:n,formErrors:o})=>{const r=o.customInstrumentations,l=s(()=>(i?.customInstrumentations?.[Lt.Java]||[]).map(e=>({key:e.className,value:e.methodName})),[i]),c=s(()=>(i?.customInstrumentations?.[Lt.Golang]||[]).map(e=>new Pt(e.packageName,e.functionName,e.receiverName,e.receiverMethodName)),[i]),d=(e,t)=>{const i={};switch(t){case"java":i[Lt.Java]=e.map(e=>new Mt(e.className,e.methodName)),i[Lt.Golang]=c.map(e=>new Pt(e.packageName,e.functionName,e.receiverName,e.receiverMethodName));break;case"golang":i[Lt.Golang]=e.map(e=>new Pt(e.packageName,e.functionName,e.receiverName,e.receiverMethodName)),i[Lt.Java]=l.map(({key:e,value:t})=>new Mt(e,t))}n("customInstrumentations",i)};return a(()=>{i?.customInstrumentations||n("customInstrumentations",{[Lt.Golang]:No[Lt.Golang],[Lt.Java]:No[Lt.Java]})},[n,i]),e("div",{children:[t(D,{title:"Golang Custom Probes",columns:[{title:"",keyName:"packageName",placeholder:"Package name",required:!0,tooltip:"The full import path of the package containing the function or method to be instrumented."},{title:"",keyName:"functionName",placeholder:"Function name",required:!1,tooltip:"The name of the function to be instrumented. Leave empty if instrumenting a receiver method."},{title:"",keyName:"receiverName",placeholder:"Receiver name",required:!1,tooltip:"The name of the receiver type if instrumenting a method. Leave empty if instrumenting a standalone function."},{title:"",keyName:"receiverMethodName",placeholder:"Receiver method name",required:!1,tooltip:"The name of the method to be instrumented. Leave empty if instrumenting a standalone function."}],value:c,onChange:e=>d(e,"golang"),errorMessage:r,limitFieldsPerRow:2}),t(N,{title:"Java Custom Probes",tooltip:"Specify class name and method name pair to instrument.",value:l,onChange:(e=[])=>d(e.map(({key:e,value:t})=>({className:e,methodName:t})),"java"),errorMessage:r,keyPlaceholder:"Class name",valuePlaceholder:"Method name"})]})},[qt.HeadersCollection]:({value:e,setValue:i,formErrors:n})=>{const o=n.headersCollection,r=s(()=>e?.headersCollection?.[Rt.HeaderKeys]||[],[e]),l=e=>{const t={[Rt.HeaderKeys]:e};i("headersCollection",t)};return a(()=>{r.length||l(Eo)},[r]),t("div",{children:r.length>0&&t(E,{title:"Header Keys",tooltip:"Specify which headers you want to collect, asterisk (*) will collect all headers.",value:r,onChange:e=>l(e),errorMessage:o})})},[qt.PayloadCollection]:({value:i,setValue:o,formErrors:r})=>{const l=r.payloadCollection,c=s(()=>Object.entries(i.payloadCollection||{}).filter(([e,t])=>!!t).map(([e])=>e),[i]),[d,u]=n(1===c.length);return a(()=>{if(!c.length){const e={[Kt.HttpRequest]:{},[Kt.HttpResponse]:{},[Kt.DbQuery]:{},[Kt.Messaging]:{}};o("payloadCollection",e),u(!1)}},[]),e("div",{children:[t(x,{title:"Type of data to collect",required:!0}),t(Oo,{$hasError:!!l,children:Fo.map(({id:e,label:i})=>t(S,{title:i,disabled:d&&c.includes(e),value:c.includes(e),onChange:t=>((e,t)=>{const i=t?[...c,e]:c.filter(t=>t!==e),n={[Kt.HttpRequest]:i.includes(Kt.HttpRequest)?{}:null,[Kt.HttpResponse]:i.includes(Kt.HttpResponse)?{}:null,[Kt.DbQuery]:i.includes(Kt.DbQuery)?{}:null,[Kt.Messaging]:i.includes(Kt.Messaging)?{}:null};o("payloadCollection",n),u(1===i.length)})(e,t)},e))}),!!l&&t($,{children:l})]})},[qt.UnknownType]:null},Io=({ruleType:e,value:i,setValue:n,formErrors:a})=>{if(!e)return null;const o=Ao[e];return o?t(o,{value:i,setValue:n,formErrors:a}):null},Ro=p.div`
315
+ `,Oo=[{id:Kt.HttpRequest,label:"Collect HTTP Request"},{id:Kt.HttpResponse,label:"Collect HTTP Response"},{id:Kt.DbQuery,label:"Collect DB Query"},{id:Kt.Messaging,label:"Collect Messaging"}],Ao={[qt.CodeAttributes]:({value:o,setValue:r,formErrors:l})=>{const c=l.codeAttributes,d=s(()=>Object.entries(o.codeAttributes||{}).filter(([e,t])=>!!t).map(([e])=>e),[o]),[u,p]=n(1===d.length);a(()=>{if(!d.length){const e={[jt.Column]:null,[jt.FilePath]:!0,[jt.Function]:!0,[jt.LineNumber]:!0,[jt.Namespace]:null,[jt.StackTrace]:null};r("codeAttributes",e),p(!1)}},[]);const h=(e,t)=>{const i=t?[...d,e]:d.filter(t=>t!==e),n=Object.values(jt).reduce((e,t)=>(e[t]=!!i.includes(t)||null,e),{});r("codeAttributes",n),p(1===i.length)};return e(i,{children:[e("div",{children:[t(x,{title:"Recommended data to collect",required:!0}),t(ko,{$hasError:!!c,children:Do.map(({id:e,label:i,tooltip:n})=>t(me,{text:n,withIcon:!0,children:t(S,{title:i,disabled:u&&d.includes(e),value:d.includes(e),onChange:t=>h(e,t)})},e))}),!!c&&t($,{children:c})]}),e("div",{children:[t(x,{title:"Verbose data to collect",required:!0}),t(ko,{$hasError:!!c,children:To.map(({id:e,label:i,tooltip:n})=>t(me,{text:n,withIcon:!0,children:t(S,{title:i,disabled:u&&d.includes(e),value:d.includes(e),onChange:t=>h(e,t)})},e))}),!!c&&t($,{children:c})]})]})},[qt.CustomInstrumentation]:({value:i,setValue:n,formErrors:o})=>{const r=o.customInstrumentations,l=s(()=>(i?.customInstrumentations?.[Lt.Java]||[]).map(e=>({key:e.className,value:e.methodName})),[i]),c=s(()=>(i?.customInstrumentations?.[Lt.Golang]||[]).map(e=>new Pt(e.packageName,e.functionName,e.receiverName,e.receiverMethodName)),[i]),d=(e,t)=>{const i={};switch(t){case"java":i[Lt.Java]=e.map(e=>new Mt(e.className,e.methodName)),i[Lt.Golang]=c.map(e=>new Pt(e.packageName,e.functionName,e.receiverName,e.receiverMethodName));break;case"golang":i[Lt.Golang]=e.map(e=>new Pt(e.packageName,e.functionName,e.receiverName,e.receiverMethodName)),i[Lt.Java]=l.map(({key:e,value:t})=>new Mt(e,t))}n("customInstrumentations",i)};return a(()=>{i?.customInstrumentations||n("customInstrumentations",{[Lt.Golang]:No[Lt.Golang],[Lt.Java]:No[Lt.Java]})},[n,i]),e("div",{children:[t(D,{title:"Golang Custom Probes",columns:[{title:"",keyName:"packageName",placeholder:"Package name",required:!0,tooltip:"The full import path of the package containing the function or method to be instrumented."},{title:"",keyName:"functionName",placeholder:"Function name",required:!1,tooltip:"The name of the function to be instrumented. Leave empty if instrumenting a receiver method."},{title:"",keyName:"receiverName",placeholder:"Receiver name",required:!1,tooltip:"The name of the receiver type if instrumenting a method. Leave empty if instrumenting a standalone function."},{title:"",keyName:"receiverMethodName",placeholder:"Receiver method name",required:!1,tooltip:"The name of the method to be instrumented. Leave empty if instrumenting a standalone function."}],value:c,onChange:e=>d(e,"golang"),errorMessage:r,limitFieldsPerRow:2}),t(N,{title:"Java Custom Probes",tooltip:"Specify class name and method name pair to instrument.",value:l,onChange:(e=[])=>d(e.map(({key:e,value:t})=>({className:e,methodName:t})),"java"),errorMessage:r,keyPlaceholder:"Class name",valuePlaceholder:"Method name"})]})},[qt.HeadersCollection]:({value:e,setValue:i,formErrors:n})=>{const o=n.headersCollection,r=s(()=>e?.headersCollection?.[Rt.HeaderKeys]||[],[e]),l=e=>{const t={[Rt.HeaderKeys]:e};i("headersCollection",t)};return a(()=>{r.length||l(Eo)},[r]),t("div",{children:r.length>0&&t(E,{title:"Header Keys",tooltip:"Specify which headers you want to collect, asterisk (*) will collect all headers.",value:r,onChange:e=>l(e),errorMessage:o})})},[qt.PayloadCollection]:({value:i,setValue:o,formErrors:r})=>{const l=r.payloadCollection,c=s(()=>Object.entries(i.payloadCollection||{}).filter(([e,t])=>!!t).map(([e])=>e),[i]),[d,u]=n(1===c.length);return a(()=>{if(!c.length){const e={[Kt.HttpRequest]:{},[Kt.HttpResponse]:{},[Kt.DbQuery]:{},[Kt.Messaging]:{}};o("payloadCollection",e),u(!1)}},[]),e("div",{children:[t(x,{title:"Type of data to collect",required:!0}),t(Fo,{$hasError:!!l,children:Oo.map(({id:e,label:i})=>t(S,{title:i,disabled:d&&c.includes(e),value:c.includes(e),onChange:t=>((e,t)=>{const i=t?[...c,e]:c.filter(t=>t!==e),n={[Kt.HttpRequest]:i.includes(Kt.HttpRequest)?{}:null,[Kt.HttpResponse]:i.includes(Kt.HttpResponse)?{}:null,[Kt.DbQuery]:i.includes(Kt.DbQuery)?{}:null,[Kt.Messaging]:i.includes(Kt.Messaging)?{}:null};o("payloadCollection",n),u(1===i.length)})(e,t)},e))}),!!l&&t($,{children:l})]})},[qt.UnknownType]:null},Io=({ruleType:e,value:i,setValue:n,formErrors:a})=>{if(!e)return null;const o=Ao[e];return o?t(o,{value:i,setValue:n,formErrors:a}):null},Ro=p.div`
316
316
  display: flex;
317
317
  flex-direction: column;
318
318
  gap: 24px;
319
319
  padding: 4px;
320
320
  `,Mo=p(P)`
321
321
  margin-bottom: 12px;
322
- `,Lo=({isUpdate:n,rule:a,formData:o,formErrors:r,handleFormChange:l})=>{const s=m();return e(Ro,{children:[t(pe,{children:a.supportedLanguages.map(e=>t(zt,{icon:Ht(e),type:ne.Info,children:lt[e]},e))}),n?e("div",{children:[t(Mo,{children:"Status"}),t(F,{options:[{icon:Ei,label:g.ENABLED,value:!1,selectedBgColor:s.text.success+A["050"]},{icon:Oi,label:g.DISABLED,value:!0,selectedBgColor:s.text.error+A["050"]}],selected:o.disabled,setSelected:e=>l("disabled",e)})]}):e(i,{children:[t(I,{title:"",description:a.docsDescription,actionButton:t(R,{endpoint:a.docsEndpoint})}),t(C,{title:"Rule name",placeholder:"Use a name that describes the rule",value:o.ruleName,onChange:({target:{value:e}})=>l("ruleName",e),errorMessage:r.ruleName})]}),t(Io,{ruleType:a.type,value:o,setValue:(e,t)=>l(e,t),formErrors:r}),t(L,{title:"Notes",value:o.notes,onChange:({target:{value:e}})=>l("notes",e),errorMessage:r.notes})]})},Po=p.div`
322
+ `,Lo=({isUpdate:n,rule:a,formData:o,formErrors:r,handleFormChange:l})=>{const s=m();return e(Ro,{children:[t(pe,{children:a.supportedLanguages.map(e=>t(zt,{icon:Ht(e),type:ne.Info,children:lt[e]},e))}),n?e("div",{children:[t(Mo,{children:"Status"}),t(O,{options:[{icon:Ei,label:g.ENABLED,value:!1,selectedBgColor:s.text.success+A["050"]},{icon:Fi,label:g.DISABLED,value:!0,selectedBgColor:s.text.error+A["050"]}],selected:o.disabled,setSelected:e=>l("disabled",e)})]}):e(i,{children:[t(I,{title:"",description:a.docsDescription,actionButton:t(R,{endpoint:a.docsEndpoint})}),t(C,{title:"Rule name",placeholder:"Use a name that describes the rule",value:o.ruleName,onChange:({target:{value:e}})=>l("ruleName",e),errorMessage:r.ruleName})]}),t(Io,{ruleType:a.type,value:o,setValue:(e,t)=>l(e,t),formErrors:r}),t(L,{title:"Notes",value:o.notes,onChange:({target:{value:e}})=>l("notes",e),errorMessage:r.notes})]})},Po=p.div`
323
323
  width: 100%;
324
324
  height: 100%;
325
325
  max-height: calc(100vh - 220px);
@@ -329,7 +329,7 @@ import{jsxs as e,jsx as t,Fragment as i}from"react/jsx-runtime";import{useState
329
329
  display: flex;
330
330
  flex-direction: column;
331
331
  gap: 12px;
332
- `,Ko=({updateInstrumentationRule:i,deleteInstrumentationRule:o})=>{const{instrumentationRules:l}=W(),{addNotification:c}=Vt(),{drawerType:d,drawerEntityId:u}=j(),p=r(null),h=d===B.InstrumentationRule,[m,g]=n(!1),[y,v]=n(!1),{formData:b,formErrors:f,handleFormChange:x,resetFormData:S,validateForm:$,loadFormWithDrawerItem:C}=Bt(),w=s(()=>{if(u)return l?.find(e=>J(e)===u)},[u,l]);if(a(()=>{h&&w?C(w):S()},[h,w]),!w)return null;const k=Wt.find(({type:e})=>e===w.type);return t(On,{ref:p,title:w.ruleName||w.type,icons:[qe(w.type)],isEdit:m,isFormDirty:y,onEdit:e=>{w.mutable||!e&&void 0!==e?g("boolean"!=typeof e||e):c({type:ne.Warning,title:ae.FORBIDDEN,message:ae.CANNOT_EDIT_RULE,crdType:B.InstrumentationRule,target:u,hideFromHistory:!0})},onSave:e=>{if($()){const t=e!==w.type?e:"";x("ruleName",t),i(u,{...b,ruleName:t}),g(!1),v(!1)}},onDelete:()=>{w.mutable?(o(u),g(!1),v(!1),p.current?.closeDrawer()):c({type:ne.Warning,title:ae.FORBIDDEN,message:ae.CANNOT_DELETE_RULE,crdType:B.InstrumentationRule,target:u,hideFromHistory:!0})},onCancel:()=>{g(!1),v(!1),C(w)},children:m&&k?t(Po,{children:t(Lo,{isUpdate:!0,rule:k,formData:b,formErrors:f,handleFormChange:(...e)=>{v(!0),x(...e)}})}):e(jo,{children:[t(Y,{conditions:w.conditions||[]}),t(G,{title:"Instrumentation Rule Details",data:w?wo(w):[]})]})})},qo=p(se)`
332
+ `,Ko=({updateInstrumentationRule:i,deleteInstrumentationRule:o})=>{const{instrumentationRules:l}=W(),{addNotification:c}=Vt(),{drawerType:d,drawerEntityId:u}=j(),p=r(null),h=d===B.InstrumentationRule,[m,g]=n(!1),[y,v]=n(!1),{formData:b,formErrors:f,handleFormChange:x,resetFormData:S,validateForm:$,loadFormWithDrawerItem:C}=Bt(),w=s(()=>{if(u)return l?.find(e=>J(e)===u)},[u,l]);if(a(()=>{h&&w?C(w):S()},[h,w]),!w)return null;const k=Wt.find(({type:e})=>e===w.type);return t(Fn,{ref:p,title:w.ruleName||w.type,icons:[qe(w.type)],isEdit:m,isFormDirty:y,onEdit:e=>{w.mutable||!e&&void 0!==e?g("boolean"!=typeof e||e):c({type:ne.Warning,title:ae.FORBIDDEN,message:ae.CANNOT_EDIT_RULE,crdType:B.InstrumentationRule,target:u,hideFromHistory:!0})},onSave:e=>{if($()){const t=e!==w.type?e:"";x("ruleName",t),i(u,{...b,ruleName:t}),g(!1),v(!1)}},onDelete:()=>{w.mutable?(o(u),g(!1),v(!1),p.current?.closeDrawer()):c({type:ne.Warning,title:ae.FORBIDDEN,message:ae.CANNOT_DELETE_RULE,crdType:B.InstrumentationRule,target:u,hideFromHistory:!0})},onCancel:()=>{g(!1),v(!1),C(w)},children:m&&k?t(Po,{children:t(Lo,{isUpdate:!0,rule:k,formData:b,formErrors:f,handleFormChange:(...e)=>{v(!0),x(...e)}})}):e(jo,{children:[t(Y,{conditions:w.conditions||[]}),t(G,{title:"Instrumentation Rule Details",data:w?wo(w):[]})]})})},qo=p(se)`
333
333
  margin-top: 24px;
334
334
  gap: 12px;
335
335
  `,zo=Wt,Ho=({createInstrumentationRule:i})=>{const{tier:a}=Le(),o=a===_t.Onprem,{currentModal:r,setCurrentModal:l}=Z(),s=r===B.InstrumentationRule,{formData:c,formErrors:d,handleFormChange:u,resetFormData:p,validateForm:h}=Bt(),[m,y]=n(void 0),v=()=>{p(),y(void 0),l("")},b=()=>{if(!h())return null;i(c),v()};return K({key:"Enter",active:s},()=>b()),t(ee,{isOpen:s,onClose:v,header:{title:"Add Instrumentation Rule"},actionComponent:t(le,{buttons:[{variant:"primary",label:"DONE",onClick:b,disabled:!o||!m,tooltip:o?"":ae.ENTERPRISE_ONLY("Instrumentation Rules")}]}),children:e(te,{children:[t(I,{title:"Select Instrumentation Rule",description:"Define how telemetry is recorded from your application. Choose a rule type and configure the details."}),e(qo,{children:[t(ie,o?{type:ne.Warning,message:ae.DEFINED_FOR_ALL_STREAMS(g.INSTRUMENTATION_RULES)}:{type:ne.Default,message:ae.ENTERPRISE_ONLY(g.INSTRUMENTATION_RULES)}),t(oe,{options:zo,selectedOption:m,onOptionSelect:e=>{return t=e,p(),void y(t);var t},autoFocus:!m?.type})]}),m?.type?e("div",{children:[t(re,{margin:"16px 0"}),t(Lo,{rule:m,formData:c,formErrors:d,handleFormChange:u})]}):null]})})},Vo=e=>{const{payloadCollection:t,codeAttributes:i,customInstrumentations:n}=e;let a="";return t&&(a+=Object.entries(t).filter(([e,t])=>!!t).map(([e,t])=>e).join(", ")),i&&(a+=Object.entries(i).filter(([e,t])=>!!t).map(([e,t])=>e).join(", ")),n&&Object.values(Lt).forEach(e=>{const t=(n[e]||[]).filter(e=>e).join(", ");t&&(a+=a?`, ${t}`:t)}),a},Bo=[{key:"icon",title:""},{key:"name",title:g.NAME,sortable:!0},{key:"profile",title:g.MANAGED_BY_PROFILE,sortable:!0},{key:"active-status",title:g.STATUS},{key:"conditions",title:"Conditions"},{key:"source-count",title:"Applicable Source"},{key:"type",title:g.TYPE,sortable:!0},{key:"spec",title:"Spec",sortable:!0},{key:"notes",title:g.NOTES,sortable:!0}],Wo=({maxHeight:i,maxWidth:n})=>{const a=m(),o=ye(),{setDrawerType:r,setDrawerEntityId:l}=j(),{instrumentationRules:c,instrumentationRulesLoading:d}=W(),u=s(()=>qn({instrumentationRules:c,sources:[],actions:[],destinations:[],searchText:o.searchText,selectedCategory:B.InstrumentationRule}).searchResults.find(({category:e})=>e===B.InstrumentationRule)?.entities||[],[c,o]),p=s(()=>u.map(e=>{const{hasErrors:i,hasWarnings:n,hasDisableds:o}=ce(e.conditions||[]);return{status:i?ne.Error:n?ne.Warning:void 0,faded:o,onClick:()=>{r(B.InstrumentationRule),l(e.ruleId)},cells:[{columnKey:"icon",component:()=>t(be,{icon:qe(e.type)})},{columnKey:"name",value:fe(e,B.InstrumentationRule,{prioritizeDisplayName:!0})},{columnKey:"type",value:e.type,textColor:a.text.info},{columnKey:"profile",value:e.profileName,textColor:a.text.info},{columnKey:"notes",value:e.notes,textColor:a.text.info,withTooltip:!0},{columnKey:"spec",value:Vo(e),textColor:a.text.info,withTooltip:!0},{columnKey:"conditions",component:()=>t(jn,{conditions:e.conditions||[],id:e.ruleId})},{columnKey:"active-status",component:()=>t("div",{style:{lineHeight:1},children:t(de,{status:e.disabled?ne.Error:ne.Success,title:e.disabled?g.DISABLED:g.ENABLED,withIcon:!0,withBorder:!0})})},{columnKey:"source-count",component:()=>t("div",{style:{lineHeight:1},children:t(de,{status:ne.Info,title:"all sources",withBorder:!0})})}]}}),[u]),{badge:h,badgeTooltip:y}=s(()=>u.length!==c.length?{badge:`${u.length}/${c.length}`,badgeTooltip:g.FILTERED_COUNT_TOOLTIP}:{badge:c.length,badgeTooltip:void 0},[u,c]);return e(Se,{$maxWidth:n,children:[t($e,{children:t(Ce,{icon:we(B.Action),title:g.INSTRUMENTATION_RULES,badge:h,badgeTooltip:y,loading:d})}),t(ke,{$maxHeight:i,children:t(De,{columns:Bo,rows:p})}),!u.length&&t(Te,{style:{marginTop:"2rem"},children:t(Ne,{})})]})},_o=p.div`
@@ -346,7 +346,7 @@ import{jsxs as e,jsx as t,Fragment as i}from"react/jsx-runtime";import{useState
346
346
  border: 1px solid ${({theme:e})=>e.colors.border};
347
347
  background-color: ${({theme:e})=>e.colors.dropdown_bg};
348
348
  animation-name: ${Ut.in.center};
349
- `,Jo=({totalSourceCount:i,uninstrumentSources:a,restartWorkloads:o})=>{const r=m(),{selectedSources:l,setSelectedSources:d}=Re(),[u,p]=n(!1),[h,g]=n(!1),y=s(()=>{let e=0;return Object.values(l).forEach(t=>{e+=t.length}),e},[l]),v=()=>{d({})};return y?e(c,{children:[e(_o,{"data-id":"multi-source-control",children:[t(P,{children:"Selected sources"}),t(Oe,{label:y,filled:!0}),t(re,{orientation:"vertical",length:"16px"}),t(Ie,{variant:"tertiary",onClick:v,children:t(P,{family:"secondary",decoration:"underline",children:"Deselect"})}),e(Ie,{variant:"tertiary",onClick:()=>g(!0),children:[t(Hi,{}),t(P,{family:"secondary",decoration:"underline",children:"Restart"})]}),e(Ie,{variant:"tertiary",onClick:()=>p(!0),children:[t(Ai,{}),t(P,{family:"secondary",decoration:"underline",color:r.text.error,children:"Uninstrument"})]})]}),t(H,{isOpen:u,name:`${y} sources`,type:B.Source,isLastItem:y===i,onApprove:()=>{const e={};Object.entries(l).forEach(([t,i])=>{e[t]=i.map(e=>({...e,selected:!1}))}),a(e),p(!1),v()},onDeny:()=>p(!1)}),t(Jt,{isOpen:h,title:"Rollout Restart Workloads",description:"Are you sure you want to rollout restart these workloads?",approveButton:{text:"Confirm",variant:ne.Warning,onClick:()=>{const e=[];Object.values(l).forEach(t=>{e.push(...t.map(e=>Yt(e)))}),o(e),v()}},denyButton:{text:"Go Back",onClick:()=>g(!1)}})]}):null},Uo=p.div`
349
+ `,Jo=({totalSourceCount:i,uninstrumentSources:a,restartWorkloads:o})=>{const r=m(),{selectedSources:l,setSelectedSources:d}=Re(),[u,p]=n(!1),[h,g]=n(!1),y=s(()=>{let e=0;return Object.values(l).forEach(t=>{e+=t.length}),e},[l]),v=()=>{d({})};return y?e(c,{children:[e(_o,{"data-id":"multi-source-control",children:[t(P,{children:"Selected sources"}),t(Fe,{label:y,filled:!0}),t(re,{orientation:"vertical",length:"16px"}),t(Ie,{variant:"tertiary",onClick:v,children:t(P,{family:"secondary",decoration:"underline",children:"Deselect"})}),e(Ie,{variant:"tertiary",onClick:()=>g(!0),children:[t(Hi,{}),t(P,{family:"secondary",decoration:"underline",children:"Restart"})]}),e(Ie,{variant:"tertiary",onClick:()=>p(!0),children:[t(Ai,{}),t(P,{family:"secondary",decoration:"underline",color:r.text.error,children:"Uninstrument"})]})]}),t(H,{isOpen:u,name:`${y} sources`,type:B.Source,isLastItem:y===i,onApprove:()=>{const e={};Object.entries(l).forEach(([t,i])=>{e[t]=i.map(e=>({...e,selected:!1}))}),a(e),p(!1),v()},onDeny:()=>p(!1)}),t(Jt,{isOpen:h,title:"Rollout Restart Workloads",description:"Are you sure you want to rollout restart these workloads?",approveButton:{text:"Confirm",variant:ne.Warning,onClick:()=>{const e=[];Object.values(l).forEach(t=>{e.push(...t.map(e=>Yt(e)))}),o(e),v()}},denyButton:{text:"Go Back",onClick:()=>g(!1)}})]}):null},Uo=p.div`
350
350
  position: relative;
351
351
  width: fit-content;
352
352
  `,Yo=p(pe)`
@@ -455,11 +455,11 @@ import{jsxs as e,jsx as t,Fragment as i}from"react/jsx-runtime";import{useState
455
455
  flex-direction: column;
456
456
  gap: 24px;
457
457
  padding: 4px;
458
- `,Nr=({formData:e,handleFormChange:i})=>t(Tr,{children:t(C,{name:"sourceName",title:"Source name",tooltip:"This overrides the default service name that runs in your cluster.",placeholder:"Use a name that overrides the source name",value:e.otelServiceName,onChange:({target:{value:e}})=>i("otelServiceName",e)})}),Er=({workloadOdigosHealthStatus:e})=>{if(!e)return null;const i=ni(e?.status),n=ot(e?.reasonEnum),a=e?.message;return t(pe,{$alignItems:"center",$justifyContent:"center",children:t(de,{status:i,title:n,subtitle:a,withBackground:i!==ue.Disabled,withBorder:!0,withIcon:!0,width:"calc(100% - 24px)"})})},Or=({source:i,fetchSourceDescribe:o,onClickRestartPod:r})=>{const[l,s]=n(!1),[c,d]=n(null);return a(()=>{i&&o({namespace:i.namespace,name:i.name,kind:i.kind}).then(({data:e})=>{e?.describeSource?d(e.describeSource):s(!0)})},[i.namespace,i.name,i.kind]),c||l?t(se,{$gap:12,children:l?t(Te,{$height:"70vh",children:t(Ne,{subTitle:"Could not fetch describe for this source"})}):c?.pods?.length?c.pods.map(({podName:n,nodeName:a,phase:o,agentInjected:l,runningLatestWorkloadRevision:s,containers:d,manifestYAML:p})=>{const h=o.status!==ne.Success||ai(d)?ne.Error:ne.Success,m=[];return m.push(t(oi,{value:`kubectl get pod ${n.value} -n ${c?.namespace?.value||i.namespace}`.toLowerCase()},"copy-text")),m.push(t(re,{length:"100%",margin:"0"},"divider-1")),m.push(t(ri,{title:a.name,tooltip:a.explain||"",value:{status:a.status||void 0,text:a.value}},"describe-row-1")),m.push(t(re,{length:"100%",margin:"0"},"divider-2")),m.push(t(ri,{title:o.name,tooltip:o.explain||"",value:{status:o.status||void 0,text:o.value}},"describe-row-2")),m.push(t(re,{length:"100%",margin:"0"},"divider-3")),m.push(t(ri,{title:l.name,tooltip:l.explain||"",value:{status:l.status||void 0,text:l.value}},"describe-row-3")),m.push(t(re,{length:"100%",margin:"0"},"divider-4")),s?.name&&(m.push(t(ri,{title:s.name,tooltip:s.explain||void 0,value:{status:s.status||void 0,text:s.value}},"describe-row-4")),m.push(t(re,{length:"100%",margin:"0"},"divider-5"))),d.forEach(e=>{m.push(t(li,{...e},`pod-container-${e.containerName.value}`))}),p&&(m.push(t(re,{length:"100%",margin:"0"},"divider-6")),m.push(t(ln,{yaml:p},"yaml-section-card"))),t(G,{title:`Pod: ${n.value}`,withExtend:!0,action:({hovered:a})=>e("div",{style:{position:"relative"},children:[t(de,{status:h,title:h,withIcon:!0,withBorder:!0},"status"),a&&t(si,{isOpen:!0,positionRight:"calc(100% + 12px)",actions:r?[{id:ci(),label:"Restart",rightIcon:Mi,onClick:()=>r(c?.namespace?.value||i.namespace,n.value)}]:[]},"hover-actions")]}),children:u.toArray(m)},`pod-${n.value}`)}):t(Te,{$height:"70vh",children:t(Ne,{subTitle:"Check if you have any running pods and try again"})})}):t(Te,{$height:"70vh",children:t(Ae,{})})},Fr=p(pe)`
458
+ `,Nr=({formData:e,handleFormChange:i})=>t(Tr,{children:t(C,{name:"sourceName",title:"Source name",tooltip:"This overrides the default service name that runs in your cluster.",placeholder:"Use a name that overrides the source name",value:e.otelServiceName,onChange:({target:{value:e}})=>i("otelServiceName",e)})}),Er=({workloadOdigosHealthStatus:e})=>{if(!e)return null;const i=ni(e?.status),n=ot(e?.reasonEnum),a=e?.message;return t(pe,{$alignItems:"center",$justifyContent:"center",children:t(de,{status:i,title:n,subtitle:a,withBackground:i!==ue.Disabled,withBorder:!0,withIcon:!0,width:"calc(100% - 24px)"})})},Fr=({source:i,fetchSourceDescribe:o,onClickRestartPod:r})=>{const[l,s]=n(!1),[c,d]=n(null);return a(()=>{i&&o({namespace:i.namespace,name:i.name,kind:i.kind}).then(({data:e})=>{e?.describeSource?d(e.describeSource):s(!0)})},[i.namespace,i.name,i.kind]),c||l?t(se,{$gap:12,children:l?t(Te,{$height:"70vh",children:t(Ne,{subTitle:"Could not fetch describe for this source"})}):c?.pods?.length?c.pods.map(({podName:n,nodeName:a,phase:o,agentInjected:l,runningLatestWorkloadRevision:s,containers:d,manifestYAML:p})=>{const h=o.status!==ne.Success||ai(d)?ne.Error:ne.Success,m=[];return m.push(t(oi,{value:`kubectl get pod ${n.value} -n ${c?.namespace?.value||i.namespace}`.toLowerCase()},"copy-text")),m.push(t(re,{length:"100%",margin:"0"},"divider-1")),m.push(t(ri,{title:a.name,tooltip:a.explain||"",value:{status:a.status||void 0,text:a.value}},"describe-row-1")),m.push(t(re,{length:"100%",margin:"0"},"divider-2")),m.push(t(ri,{title:o.name,tooltip:o.explain||"",value:{status:o.status||void 0,text:o.value}},"describe-row-2")),m.push(t(re,{length:"100%",margin:"0"},"divider-3")),m.push(t(ri,{title:l.name,tooltip:l.explain||"",value:{status:l.status||void 0,text:l.value}},"describe-row-3")),m.push(t(re,{length:"100%",margin:"0"},"divider-4")),s?.name&&(m.push(t(ri,{title:s.name,tooltip:s.explain||void 0,value:{status:s.status||void 0,text:s.value}},"describe-row-4")),m.push(t(re,{length:"100%",margin:"0"},"divider-5"))),d.forEach(e=>{m.push(t(li,{...e},`pod-container-${e.containerName.value}`))}),p&&(m.push(t(re,{length:"100%",margin:"0"},"divider-6")),m.push(t(ln,{yaml:p},"yaml-section-card"))),t(G,{title:`Pod: ${n.value}`,withExtend:!0,action:({hovered:a})=>e("div",{style:{position:"relative"},children:[t(de,{status:h,title:h,withIcon:!0,withBorder:!0},"status"),a&&t(si,{isOpen:!0,positionRight:"calc(100% + 12px)",actions:r?[{id:ci(),label:"Restart",rightIcon:Mi,onClick:()=>r(c?.namespace?.value||i.namespace,n.value)}]:[]},"hover-actions")]}),children:u.toArray(m)},`pod-${n.value}`)}):t(Te,{$height:"70vh",children:t(Ne,{subTitle:"Check if you have any running pods and try again"})})}):t(Te,{$height:"70vh",children:t(Ae,{})})},Or=p(pe)`
459
459
  width: 100%;
460
460
  align-items: center;
461
461
  justify-content: space-between;
462
- `,Ar=({source:i,fetchSourceLibraries:o})=>{const r=m(),[l,s]=n(!1),[d,u]=n(null);return a(()=>{i&&o({namespace:i.namespace,name:i.name,kind:i.kind}).then(({data:e})=>{e?.instrumentationInstanceComponents?u(Et(e.instrumentationInstanceComponents).sort((e,t)=>e.name.localeCompare(t.name))):s(!0)})},[i.namespace,i.name,i.kind]),d||l?t(se,{$gap:12,children:l?t(Te,{$height:"70vh",children:t(Ne,{subTitle:"Could not fetch libraries for this source"})}):d?.length?t(G,{title:"Instrumented Libraries",children:d.map(({name:i,healthy:n,message:a,nonIdentifyingAttributes:o},l)=>e(c,{children:[e(se,{$gap:4,$width:"100%",children:[e(Fr,{$width:"100%",children:[t(P,{size:12,color:r.text.grey,children:i}),e(pe,{$gap:4,children:[o.map(({key:e,value:n})=>di(n)&&ui(n)&&"is_standard_lib"===e?t(de,{status:ne.Default,title:"STANDARD",withBorder:!0},`${i}-${e}`):null),"boolean"==typeof n&&t(de,{status:n?ne.Success:ne.Error,title:n?"HEALTHY":"UNHEALTHY",withBorder:!0})]})]}),a&&t(P,{size:10,color:r.text.error,align:"right",children:a})]}),l!==d.length-1&&t(re,{length:"100%",margin:"0"})]},`library-${i}`))}):e(Te,{$height:"70vh",$gap:12,children:[t(Ne,{title:"No libraries found",subTitle:""}),t(ie,{type:ne.Warning,message:"This feature is in early development, and has very limited support"})]})}):t(Te,{$height:"70vh",children:t(Ae,{})})};var Ir;!function(e){e.Overview="Overview",e.Pods="Pods",e.Libraries="Libraries"}(Ir||(Ir={}));const Rr=[hi.Deployment,hi.StatefulSet,hi.DaemonSet,hi.DeploymentConfig,hi.Rollout,hi.StaticPod],Mr=[hi.Deployment,hi.StatefulSet,hi.DaemonSet,hi.DeploymentConfig,hi.Rollout,hi.Pod],Lr=[mi.Python,mi.Go,mi.Java],Pr=p.div`
462
+ `,Ar=({source:i,fetchSourceLibraries:o})=>{const r=m(),[l,s]=n(!1),[d,u]=n(null);return a(()=>{i&&o({namespace:i.namespace,name:i.name,kind:i.kind}).then(({data:e})=>{e?.instrumentationInstanceComponents?u(Et(e.instrumentationInstanceComponents).sort((e,t)=>e.name.localeCompare(t.name))):s(!0)})},[i.namespace,i.name,i.kind]),d||l?t(se,{$gap:12,children:l?t(Te,{$height:"70vh",children:t(Ne,{subTitle:"Could not fetch libraries for this source"})}):d?.length?t(G,{title:"Instrumented Libraries",children:d.map(({name:i,healthy:n,message:a,nonIdentifyingAttributes:o},l)=>e(c,{children:[e(se,{$gap:4,$width:"100%",children:[e(Or,{$width:"100%",children:[t(P,{size:12,color:r.text.grey,children:i}),e(pe,{$gap:4,children:[o.map(({key:e,value:n})=>di(n)&&ui(n)&&"is_standard_lib"===e?t(de,{status:ne.Default,title:"STANDARD",withBorder:!0},`${i}-${e}`):null),"boolean"==typeof n&&t(de,{status:n?ne.Success:ne.Error,title:n?"HEALTHY":"UNHEALTHY",withBorder:!0})]})]}),a&&t(P,{size:10,color:r.text.error,align:"right",children:a})]}),l!==d.length-1&&t(re,{length:"100%",margin:"0"})]},`library-${i}`))}):e(Te,{$height:"70vh",$gap:12,children:[t(Ne,{title:"No libraries found",subTitle:""}),t(ie,{type:ne.Warning,message:"This feature is in early development, and has very limited support"})]})}):t(Te,{$height:"70vh",children:t(Ae,{})})};var Ir;!function(e){e.Overview="Overview",e.Pods="Pods",e.Libraries="Libraries"}(Ir||(Ir={}));const Rr=[hi.Deployment,hi.StatefulSet,hi.DaemonSet,hi.DeploymentConfig,hi.Rollout,hi.StaticPod],Mr=[hi.Deployment,hi.StatefulSet,hi.DaemonSet,hi.DeploymentConfig,hi.Rollout,hi.Pod],Lr=[mi.Python,mi.Go,mi.Java],Pr=p.div`
463
463
  width: 100%;
464
464
  height: 100%;
465
465
  max-height: calc(100vh - 220px);
@@ -469,12 +469,12 @@ import{jsxs as e,jsx as t,Fragment as i}from"react/jsx-runtime";import{useState
469
469
  display: flex;
470
470
  flex-direction: column;
471
471
  gap: 12px;
472
- `;var Kr;!function(e){e.Workload="Workload",e.Pod="Pod"}(Kr||(Kr={}));const qr=({persistSources:o,updateSource:l,restartWorkloads:c,fetchSourceById:d,fetchSourceDescribe:u,fetchSourceLibraries:p,restartPod:h})=>{const{isVm:m}=Le(),{sources:y}=W(),{selectedStreamName:v}=Je(),{drawerType:b,drawerEntityId:f}=j(),x=s(()=>Ye(y,v),[y,v]),S=r(null),$=b===B.Source,[C,w]=n(!1),[k,D]=n(!1),[T,N]=n(Ir.Overview),[E,O]=n(null);a(()=>{$&&f&&d(f).then(e=>O(e||null))},[$,f]);const{formData:F,handleFormChange:A,resetFormData:I,loadFormWithDrawerItem:R}=pi(),M=s(()=>{if(f)return E&&JSON.stringify(Yt(E))===JSON.stringify(Yt(f))?E:x?.find(e=>JSON.stringify(Yt(e))===JSON.stringify(Yt(f)))},[f,x,E]);a(()=>{$&&M?R(M):I()},[$,M]);const L=s(()=>{const e=M?.conditions?.find(({type:e})=>"RuntimeDetection"===e);return{description:e?.message,isLoading:e?.status===ue.Loading,containers:M?.containers||[]}},[M]),K=s(()=>{const e=[{label:Ir.Overview,onClick:()=>N(Ir.Overview),selected:T===Ir.Overview}];return m||(Rr.includes(M?.kind)&&e.push({label:Ir.Pods,onClick:()=>N(Ir.Pods),selected:T===Ir.Pods}),M?.containers?.some(({language:e})=>Lr.includes(e))&&e.push({label:Ir.Libraries,onClick:()=>N(Ir.Libraries),selected:T===Ir.Libraries})),e},[T,M,m]),q=Mr.includes(M?.kind),[z,H]=n({openFor:null,workloadId:void 0,podNamespace:void 0,podName:void 0});return M?e(On,{ref:S,onClose:()=>{N(Ir.Overview),O(null)},title:M.otelServiceName||M.name,titleTooltip:"This attribute is used to identify the name of the service (service.name) that is generating telemetry data.",hideEditTitleFromEdit:!0,icons:He(M.containers),isEdit:C,isFormDirty:k,onEdit:T===Ir.Overview?e=>{w("boolean"!=typeof e||e)}:void 0,onSave:async()=>{const e=F.otelServiceName!==M.name?F.otelServiceName:"";A("otelServiceName",e),await l(f,{...F,otelServiceName:e}),O(null),D(!1),w(!1)},onDelete:T===Ir.Overview?async()=>{const{namespace:e}=M;o({[e]:[{...M,selected:!1,currentStreamName:v}]},{}),O(null),D(!1),w(!1),S.current?.closeDrawer()}:void 0,onCancel:()=>{D(!1),w(!1),A("otelServiceName",M.otelServiceName||M.name||"")},isLastItem:1===x.length,tabs:K,headerActionButtons:m?[]:q?[{"data-id":"rollout-restart",variant:"tertiary",onClick:()=>H({openFor:Kr.Workload,workloadId:f}),children:e(i,{children:[t(Hi,{}),t(P,{size:14,family:"secondary",decoration:"underline",children:"Restart"})]})}]:[],children:[T===Ir.Overview?C?t(Pr,{children:t(Nr,{formData:F,handleFormChange:(...e)=>{D(!0),A(...e),A("currentStreamName",v)}})}):e(jr,{children:[t(Er,{workloadOdigosHealthStatus:M.workloadOdigosHealthStatus}),t(Y,{conditions:M.conditions||[]}),t(G,{title:g.SOURCE_DETAILS,data:M?Dr(M,m):[]}),t(G,{title:m?g.DETECTED_PROCESSES:g.DETECTED_CONTAINERS,titleBadge:L.isLoading?ue.Loading:L.containers.length,description:L.description||(m?g.DETECTED_PROCESSES_DESCRIPTION:g.DETECTED_CONTAINERS_DESCRIPTION),children:L.containers.map(e=>t(gi,{...e,callbackRuntimeOverride:e=>l(f,e)},`source-container-${e.containerName}`))}),M.manifestYAML&&t(ln,{title:`${M.kind} YAML`,yaml:M.manifestYAML,defaultOpen:!M.instrumentationConfigYAML}),M.instrumentationConfigYAML&&t(ln,{title:"Instrumentation Config YAML",yaml:M.instrumentationConfigYAML,defaultOpen:!M.manifestYAML})]}):T===Ir.Pods?t(Or,{source:M,fetchSourceDescribe:u,onClickRestartPod:q?(e,t)=>H({openFor:Kr.Pod,podNamespace:e,podName:t}):void 0}):t(Ar,{source:M,fetchSourceLibraries:p}),t(Jt,{isOpen:!!z.openFor,title:`Rollout Restart ${z.openFor}`,description:`Are you sure you want to rollout restart this ${z.openFor?.toLowerCase()}?`,approveButton:{text:"Confirm",variant:ne.Warning,onClick:()=>{z.openFor===Kr.Workload&&z.workloadId?c([z.workloadId]):z.openFor===Kr.Pod&&z.podNamespace&&z.podName&&h(z.podNamespace,z.podName),H({openFor:null})}},denyButton:{text:"Go Back",onClick:()=>{H({openFor:null})}}})]}):null},zr=p.div`
472
+ `;var Kr;!function(e){e.Workload="Workload",e.Pod="Pod"}(Kr||(Kr={}));const qr=({persistSources:o,updateSource:l,restartWorkloads:c,fetchSourceById:d,fetchSourceDescribe:u,fetchSourceLibraries:p,restartPod:h,recoverFromRollback:m})=>{const{isVm:y}=Le(),{sources:v}=W(),{selectedStreamName:b}=Je(),{drawerType:f,drawerEntityId:x}=j(),S=s(()=>Ye(v,b),[v,b]),$=r(null),C=f===B.Source,[w,k]=n(!1),[D,T]=n(!1),[N,E]=n(Ir.Overview),[F,O]=n(null);a(()=>{C&&x&&d(x).then(e=>O(e||null))},[C,x]);const{formData:A,handleFormChange:I,resetFormData:R,loadFormWithDrawerItem:M}=pi(),L=s(()=>{if(x)return F&&JSON.stringify(Yt(F))===JSON.stringify(Yt(x))?F:S?.find(e=>JSON.stringify(Yt(e))===JSON.stringify(Yt(x)))},[x,S,F]);a(()=>{C&&L?M(L):R()},[C,L]);const K=s(()=>{const e=L?.conditions?.find(({type:e})=>"RuntimeDetection"===e);return{description:e?.message,isLoading:e?.status===ue.Loading,containers:L?.containers||[]}},[L]),q=s(()=>!!L?.rollbackOccurred,[L?.rollbackOccurred]),z=s(()=>{const e=[{label:Ir.Overview,onClick:()=>E(Ir.Overview),selected:N===Ir.Overview}];return y||(Rr.includes(L?.kind)&&e.push({label:Ir.Pods,onClick:()=>E(Ir.Pods),selected:N===Ir.Pods}),L?.containers?.some(({language:e})=>Lr.includes(e))&&e.push({label:Ir.Libraries,onClick:()=>E(Ir.Libraries),selected:N===Ir.Libraries})),e},[N,L,y]),H=Mr.includes(L?.kind),[V,_]=n({openFor:null,workloadId:void 0,podNamespace:void 0,podName:void 0});return L?e(Fn,{ref:$,onClose:()=>{E(Ir.Overview),O(null)},title:L.otelServiceName||L.name,titleTooltip:"This attribute is used to identify the name of the service (service.name) that is generating telemetry data.",hideEditTitleFromEdit:!0,icons:He(L.containers),isEdit:w,isFormDirty:D,onEdit:N===Ir.Overview?e=>{k("boolean"!=typeof e||e)}:void 0,onSave:async()=>{const e=A.otelServiceName!==L.name?A.otelServiceName:"";I("otelServiceName",e),await l(x,{...A,otelServiceName:e}),O(null),T(!1),k(!1)},onDelete:N===Ir.Overview?async()=>{const{namespace:e}=L;o({[e]:[{...L,selected:!1,currentStreamName:b}]},{}),O(null),T(!1),k(!1),$.current?.closeDrawer()}:void 0,onCancel:()=>{T(!1),k(!1),I("otelServiceName",L.otelServiceName||L.name||"")},isLastItem:1===S.length,tabs:z,headerActionButtons:y?[]:H?[{"data-id":"rollout-restart",variant:"tertiary",onClick:()=>_({openFor:Kr.Workload,workloadId:x}),children:e(i,{children:[t(Hi,{}),t(P,{size:14,family:"secondary",decoration:"underline",children:"Restart"})]})}]:[],children:[N===Ir.Overview?w?t(Pr,{children:t(Nr,{formData:A,handleFormChange:(...e)=>{T(!0),I(...e),I("currentStreamName",b)}})}):e(jr,{children:[t(Er,{workloadOdigosHealthStatus:L.workloadOdigosHealthStatus}),q&&t(ie,{type:ne.Warning,message:g.ROLLBACK_OCCURRED_MESSAGE,action:{label:g.ROLLBACK_RECOVER,onClick:async()=>{await m(x);const e=await d(x);e&&O(e)}}}),t(Y,{conditions:L.conditions||[]}),t(G,{title:g.SOURCE_DETAILS,data:L?Dr(L,y):[]}),t(G,{title:y?g.DETECTED_PROCESSES:g.DETECTED_CONTAINERS,titleBadge:K.isLoading?ue.Loading:K.containers.length,description:K.description||(y?g.DETECTED_PROCESSES_DESCRIPTION:g.DETECTED_CONTAINERS_DESCRIPTION),children:K.containers.map(e=>t(gi,{...e,callbackRuntimeOverride:e=>l(x,e)},`source-container-${e.containerName}`))}),L.manifestYAML&&t(ln,{title:`${L.kind} YAML`,yaml:L.manifestYAML,defaultOpen:!L.instrumentationConfigYAML}),L.instrumentationConfigYAML&&t(ln,{title:"Instrumentation Config YAML",yaml:L.instrumentationConfigYAML,defaultOpen:!L.manifestYAML})]}):N===Ir.Pods?t(Fr,{source:L,fetchSourceDescribe:u,onClickRestartPod:H?(e,t)=>_({openFor:Kr.Pod,podNamespace:e,podName:t}):void 0}):t(Ar,{source:L,fetchSourceLibraries:p}),t(Jt,{isOpen:!!V.openFor,title:`Rollout Restart ${V.openFor}`,description:`Are you sure you want to rollout restart this ${V.openFor?.toLowerCase()}?`,approveButton:{text:"Confirm",variant:ne.Warning,onClick:()=>{V.openFor===Kr.Workload&&V.workloadId?c([V.workloadId]):V.openFor===Kr.Pod&&V.podNamespace&&V.podName&&h(V.podNamespace,V.podName),_({openFor:null})}},denyButton:{text:"Go Back",onClick:()=>{_({openFor:null})}}})]}):null},zr=p.div`
473
473
  max-width: ${({$fullWidth:e})=>e?"unset":"420px"};
474
474
  width: 100%;
475
- `,Hr=o(({isModal:i,fetchSingleNamespace:n,onClickSummary:a},o)=>{const r=m(),{isVm:s}=Le(),c=yi({fetchSingleNamespace:n}),{selectedSources:d,fetchingNamespace:u,selectedAllNamespaces:p,onSelectAllNamespaces:h,getApiSourcesPayload:y,getApiFutureAppsPayload:v,searchText:b,setSearchText:f,searchBy:x,setSearchBy:S,showSelectedOnly:$,setShowSelectedOnly:w,showRunningOnly:k,setShowRunningOnly:D}=c;l(o,()=>({getFormValues:()=>({apps:y(),futureApps:v()})}));const N=Object.values(d).reduce((e,t)=>e+t.filter(e=>e.selected).length,0);return t(te,{$isNotModal:!i,children:e(se,{$gap:12,children:[e(se,{$gap:24,children:[a&&t(vt,{onClick:a}),t(I,{title:g.SELECT_SOURCES,badgeLabel:N,description:g.SELECT_SOURCES_DESCRIPTION}),e(pe,{$justifyContent:"space-between",children:[t(zr,{$fullWidth:s,children:t(C,{placeholder:x===B.Source?g.SEARCH_SOURCES:g.SEARCH_NAMESPACES,icon:Li,value:b,onChange:e=>f(e.target.value.toLowerCase())})}),!s&&t(F,{options:[{label:g.SOURCE,value:B.Source,selectedBgColor:r.text.secondary,selectedTextColor:r.text.primary},{label:g.NAMESPACE,value:B.Namespace,selectedBgColor:r.text.secondary,selectedTextColor:r.text.primary}],selected:x,setSelected:S})]}),e(pe,{$gap:36,children:[t(T,{title:g.SELECT_ALL,initialValue:p,onChange:h,disabled:!!u}),t(T,{title:g.ONLY_SELECTED,initialValue:$,onChange:w}),t(T,{title:g.ONLY_RUNNING_INSTANCES,initialValue:k,onChange:D})]})]}),t(re,{}),t(fr,{isModal:i,...c})]})})});Hr.displayName=Hr.name;const Vr=({fetchSingleNamespace:e,persistSources:i})=>{const{currentModal:n,setCurrentModal:a}=Z(),o=n===B.Source,l=()=>{a("")},s=async()=>{if(c.current){const{apps:e,futureApps:t}=c.current.getFormValues();i(e,t),l()}},c=r(null);return K({key:"Enter",active:o},s),o?t(ee,{isOpen:o,onClose:l,header:{title:"Add Source"},actionComponent:t(le,{buttons:[{label:"DONE",variant:"primary",onClick:s}]}),children:t(Hr,{ref:c,isModal:!0,fetchSingleNamespace:e})}):null},Br=e=>{const t=[{key:"checkbox-and-icon",title:""},{key:"name",title:g.NAME,sortable:!0},{key:"kind",title:"Kind",sortable:!0}];return e||t.push({key:"namespace",title:g.NAMESPACE,sortable:!0}),t.push({key:"containers",title:g.DETECTED_CONTAINERS}),t.push({key:"conditions",title:"Conditions"}),t.push({key:"throughput",title:"Throughput",sortable:!0}),t},Wr=({metrics:i,maxHeight:n,maxWidth:a})=>{const o=m(),{isVm:r}=Le(),l=ye(),{selectedStreamName:c}=Je(),{sources:u,sourcesLoading:p}=W(),{setDrawerType:h,setDrawerEntityId:y}=j(),{selectedSources:v,setSelectedSources:b}=Re(),{progress:f}=Be(),x=s(()=>f[We.Instrumenting]||f[We.Uninstrumenting]?f[We.Instrumenting]?.percentage||f[We.Uninstrumenting]?.percentage||0:void 0,[f[We.Instrumenting],f[We.Uninstrumenting]]),$=s(()=>Ye(u,c),[u,c]),C=s(()=>qn({instrumentationRules:[],sources:Xe($,l),actions:[],destinations:[],searchText:l.searchText,selectedCategory:B.Source}).searchResults.find(({category:e})=>e===B.Source)?.entities||[],[$,l]),[w,k]=s(()=>{let e=0;return Object.values(v).forEach(t=>{e+=t.length}),[0!==e,e]},[v]),D=d(e=>{if(e){const e={};C.forEach(t=>{const{namespace:i}=t;e[i]?e[i].push(t):e[i]=[t]}),b(e)}else b({})},[C]),T=d(e=>{const{namespace:t,name:i,kind:n}=e,a={...v};a[t]||(a[t]=[]);const o=a[t].findIndex(e=>e.name===i&&e.kind===n);-1===o?a[t].push(e):a[t].splice(o,1),b(a)},[v]),N=s(()=>C.map(n=>{const a=Yt(n),r=JSON.stringify(a),{hasErrors:l,hasWarnings:s,hasDisableds:c}=ce(n.conditions||[]),d=!!v[a.namespace]?.find(e=>e.namespace===a.namespace&&e.name===a.name&&e.kind===a.kind);return{status:l?ne.Error:s?ne.Warning:void 0,faded:c,onClick:()=>{h(B.Source),y(a)},cells:[{columnKey:"checkbox-and-icon",component:()=>e(pe,{$gap:16,children:[t(S,{value:d,onChange:()=>T(n)}),t(vi,{icons:He(n.containers),id:r})]})},{columnKey:"name",value:fe(n,B.Source,{extended:!0})},{columnKey:"kind",value:n.kind,textColor:o.text.info},{columnKey:"namespace",value:n.namespace,textColor:o.text.info},{columnKey:"throughput",value:je(It(i,B.Source,a).throughput),textColor:o.text.info},{columnKey:"conditions",component:()=>t(jn,{conditions:n.conditions||[],id:r})},{columnKey:"containers",component:()=>t("div",{style:{lineHeight:1},children:t(de,{status:ne.Info,title:bi(n.containers),withBorder:!0})})}]}}),[C,v,i,T]),{badge:E,badgeTooltip:O}=s(()=>C.length!==$.length?{badge:`${C.length}/${$.length}`,badgeTooltip:g.FILTERED_COUNT_TOOLTIP}:{badge:$.length,badgeTooltip:void 0},[C,$]);return e(Se,{$maxWidth:a,children:[e($e,{children:[t(S,{partiallyChecked:w&&C?.length!==k,value:w&&C?.length===k,onChange:D,disabled:!C?.length}),t(Ce,{icon:we(B.Source),title:g.SOURCES,badge:E,badgeTooltip:O,loading:p||"number"==typeof x})]}),t(ke,{$maxHeight:n,children:t(De,{columns:Br(r),rows:N})}),"number"!=typeof x||N.length?N.length?null:t(Te,{style:{marginTop:"2rem"},children:t(Ne,{})}):e(Te,{style:{marginTop:"2rem",gap:"24px"},children:[t(Ee,{width:420}),e(pe,{$gap:16,children:[e(P,{color:o.text.info,children:[f[We.Instrumenting]?"Instrumenting":"Uninstrumenting"," workloads..."]}),t(Oe,{label:`${x}%`})]})]})]})},_r=({expiresAt:t})=>{const i=m(),{formatTimeAgo:n}=Gt(),a=n(t),o=new Date(t).toDateString().split(" ").slice(1).join(" "),r=fi(t,0)?i.text.error:fi(t,6048e5)?i.text.warning:i.text.success;return e(P,{size:14,color:r,children:[a," (",o,")"]})},Jr=p.div`
475
+ `,Hr=o(({isModal:i,fetchSingleNamespace:n,onClickSummary:a},o)=>{const r=m(),{isVm:s}=Le(),c=yi({fetchSingleNamespace:n}),{selectedSources:d,fetchingNamespace:u,selectedAllNamespaces:p,onSelectAllNamespaces:h,getApiSourcesPayload:y,getApiFutureAppsPayload:v,searchText:b,setSearchText:f,searchBy:x,setSearchBy:S,showSelectedOnly:$,setShowSelectedOnly:w,showRunningOnly:k,setShowRunningOnly:D}=c;l(o,()=>({getFormValues:()=>({apps:y(),futureApps:v()})}));const N=Object.values(d).reduce((e,t)=>e+t.filter(e=>e.selected).length,0);return t(te,{$isNotModal:!i,children:e(se,{$gap:12,children:[e(se,{$gap:24,children:[a&&t(vt,{onClick:a}),t(I,{title:g.SELECT_SOURCES,badgeLabel:N,description:g.SELECT_SOURCES_DESCRIPTION}),e(pe,{$justifyContent:"space-between",children:[t(zr,{$fullWidth:s,children:t(C,{placeholder:x===B.Source?g.SEARCH_SOURCES:g.SEARCH_NAMESPACES,icon:Li,value:b,onChange:e=>f(e.target.value.toLowerCase())})}),!s&&t(O,{options:[{label:g.SOURCE,value:B.Source,selectedBgColor:r.text.secondary,selectedTextColor:r.text.primary},{label:g.NAMESPACE,value:B.Namespace,selectedBgColor:r.text.secondary,selectedTextColor:r.text.primary}],selected:x,setSelected:S})]}),e(pe,{$gap:36,children:[t(T,{title:g.SELECT_ALL,initialValue:p,onChange:h,disabled:!!u}),t(T,{title:g.ONLY_SELECTED,initialValue:$,onChange:w}),t(T,{title:g.ONLY_RUNNING_INSTANCES,initialValue:k,onChange:D})]})]}),t(re,{}),t(fr,{isModal:i,...c})]})})});Hr.displayName=Hr.name;const Vr=({fetchSingleNamespace:e,persistSources:i})=>{const{currentModal:n,setCurrentModal:a}=Z(),o=n===B.Source,l=()=>{a("")},s=async()=>{if(c.current){const{apps:e,futureApps:t}=c.current.getFormValues();i(e,t),l()}},c=r(null);return K({key:"Enter",active:o},s),o?t(ee,{isOpen:o,onClose:l,header:{title:"Add Source"},actionComponent:t(le,{buttons:[{label:"DONE",variant:"primary",onClick:s}]}),children:t(Hr,{ref:c,isModal:!0,fetchSingleNamespace:e})}):null},Br=e=>{const t=[{key:"checkbox-and-icon",title:""},{key:"name",title:g.NAME,sortable:!0},{key:"kind",title:"Kind",sortable:!0}];return e||t.push({key:"namespace",title:g.NAMESPACE,sortable:!0}),t.push({key:"containers",title:g.DETECTED_CONTAINERS}),t.push({key:"conditions",title:"Conditions"}),t.push({key:"throughput",title:"Throughput",sortable:!0}),t},Wr=({metrics:i,maxHeight:n,maxWidth:a})=>{const o=m(),{isVm:r}=Le(),l=ye(),{selectedStreamName:c}=Je(),{sources:u,sourcesLoading:p}=W(),{setDrawerType:h,setDrawerEntityId:y}=j(),{selectedSources:v,setSelectedSources:b}=Re(),{progress:f}=Be(),x=s(()=>f[We.Instrumenting]||f[We.Uninstrumenting]?f[We.Instrumenting]?.percentage||f[We.Uninstrumenting]?.percentage||0:void 0,[f[We.Instrumenting],f[We.Uninstrumenting]]),$=s(()=>Ye(u,c),[u,c]),C=s(()=>qn({instrumentationRules:[],sources:Xe($,l),actions:[],destinations:[],searchText:l.searchText,selectedCategory:B.Source}).searchResults.find(({category:e})=>e===B.Source)?.entities||[],[$,l]),[w,k]=s(()=>{let e=0;return Object.values(v).forEach(t=>{e+=t.length}),[0!==e,e]},[v]),D=d(e=>{if(e){const e={};C.forEach(t=>{const{namespace:i}=t;e[i]?e[i].push(t):e[i]=[t]}),b(e)}else b({})},[C]),T=d(e=>{const{namespace:t,name:i,kind:n}=e,a={...v};a[t]||(a[t]=[]);const o=a[t].findIndex(e=>e.name===i&&e.kind===n);-1===o?a[t].push(e):a[t].splice(o,1),b(a)},[v]),N=s(()=>C.map(n=>{const a=Yt(n),r=JSON.stringify(a),{hasErrors:l,hasWarnings:s,hasDisableds:c}=ce(n.conditions||[]),d=!!v[a.namespace]?.find(e=>e.namespace===a.namespace&&e.name===a.name&&e.kind===a.kind);return{status:l?ne.Error:s?ne.Warning:void 0,faded:c,onClick:()=>{h(B.Source),y(a)},cells:[{columnKey:"checkbox-and-icon",component:()=>e(pe,{$gap:16,children:[t(S,{value:d,onChange:()=>T(n)}),t(vi,{icons:He(n.containers),id:r})]})},{columnKey:"name",value:fe(n,B.Source,{extended:!0})},{columnKey:"kind",value:n.kind,textColor:o.text.info},{columnKey:"namespace",value:n.namespace,textColor:o.text.info},{columnKey:"throughput",value:je(It(i,B.Source,a).throughput),textColor:o.text.info},{columnKey:"conditions",component:()=>t(jn,{conditions:n.conditions||[],id:r})},{columnKey:"containers",component:()=>t("div",{style:{lineHeight:1},children:t(de,{status:ne.Info,title:bi(n.containers),withBorder:!0})})}]}}),[C,v,i,T]),{badge:E,badgeTooltip:F}=s(()=>C.length!==$.length?{badge:`${C.length}/${$.length}`,badgeTooltip:g.FILTERED_COUNT_TOOLTIP}:{badge:$.length,badgeTooltip:void 0},[C,$]);return e(Se,{$maxWidth:a,children:[e($e,{children:[t(S,{partiallyChecked:w&&C?.length!==k,value:w&&C?.length===k,onChange:D,disabled:!C?.length}),t(Ce,{icon:we(B.Source),title:g.SOURCES,badge:E,badgeTooltip:F,loading:p||"number"==typeof x})]}),t(ke,{$maxHeight:n,children:t(De,{columns:Br(r),rows:N})}),"number"!=typeof x||N.length?N.length?null:t(Te,{style:{marginTop:"2rem"},children:t(Ne,{})}):e(Te,{style:{marginTop:"2rem",gap:"24px"},children:[t(Ee,{width:420}),e(pe,{$gap:16,children:[e(P,{color:o.text.info,children:[f[We.Instrumenting]?"Instrumenting":"Uninstrumenting"," workloads..."]}),t(Fe,{label:`${x}%`})]})]})]})},_r=({expiresAt:t})=>{const i=m(),{formatTimeAgo:n}=Gt(),a=n(t),o=new Date(t).toDateString().split(" ").slice(1).join(" "),r=fi(t,0)?i.text.error:fi(t,6048e5)?i.text.warning:i.text.success;return e(P,{size:14,color:r,children:[a," (",o,")"]})},Jr=p.div`
476
476
  position: relative;
477
- `,Ur=({token:i,saveToken:a})=>{const{CopyButton:o}=xi(),{formData:r,handleFormChange:l,resetFormData:s}=Si({token:i}),[c,d]=n(!1),u=()=>{d(!1),s()};return e(pe,{$gap:0,children:[t(o,{value:i,size:$i.L}),t(re,{orientation:"vertical",length:"12px"}),e(Jr,{children:[t(mt,{size:32,onClick:()=>{d(!0)},children:t(Fi,{})}),c&&t(Ci,{flipX:!0,clientX:36,isOpen:c,onClose:u,onSave:()=>{a(r.token).then(u)},title:"Enter a new API Token",titleTooltip:"Contact us to generate a new one",children:t(C,{placeholder:"API Token",type:"password",value:r.token,onChange:e=>l("token",e.target.value)})})]})]})},Yr=({tokens:e,saveToken:i})=>t(G,{title:"Authorization Tokens",titleBadge:e.length,data:[{type:y.Table,value:{columns:[{key:"icon",title:""},{key:"name",title:"Name"},{key:"expires_at",title:"Expires"},{key:"token",title:"Token"},{key:"actions",title:""}],rows:e.map(({name:e,token:n,expiresAt:a})=>({cells:[{columnKey:"icon",icon:Qi},{columnKey:"name",value:e},{columnKey:"token",value:`${new Array(15).fill("•").join("")}`},{columnKey:"expires_at",component:()=>t(_r,{expiresAt:a})},{columnKey:"actions",component:()=>t(Ur,{token:n,saveToken:i})}]}))}}]}),Gr=({fetchDescribeOdigos:o})=>{const[r,l]=n(null);if(a(()=>{o().then(({data:e})=>l(e?.describeOdigos||null))},[]),!r)return t(Te,{children:t(Ae,{})});const s=e=>e?.name?[t(re,{},`divider-${e.name}`),t(ri,{title:e.name,subTitle:e.explain||void 0,value:{status:e.status||(di(e.value)?ui(e.value)?ne.Success:ne.Error:ne.Default),text:e.value}},`describe-row-${e.name}`)]:[];return e(i,{children:[t(G,{title:"General Information",withExtend:!0,initialExtended:!0,data:[{title:r?.odigosVersion?.name,value:r?.odigosVersion?.value},{title:r?.kubernetesVersion?.name,value:r?.kubernetesVersion?.value},{title:r?.installationMethod?.name,value:r?.installationMethod?.value},{title:r?.tier?.name,value:r?.tier?.value},{title:"# of sources",value:r?.numberOfSources?.toString()},{title:"# of destinations",value:r?.numberOfDestinations?.toString()}]}),t(G,{title:"Cluster Collector",withExtend:!0,children:Object.values(r?.clusterCollector||{}).map(s)}),t(G,{title:"Node Collector",withExtend:!0,children:Object.values(r?.nodeCollector||{}).map(s)})]})},Xr=p.div`
477
+ `,Ur=({token:i,saveToken:a})=>{const{CopyButton:o}=xi(),{formData:r,handleFormChange:l,resetFormData:s}=Si({token:i}),[c,d]=n(!1),u=()=>{d(!1),s()};return e(pe,{$gap:0,children:[t(o,{value:i,size:$i.L}),t(re,{orientation:"vertical",length:"12px"}),e(Jr,{children:[t(mt,{size:32,onClick:()=>{d(!0)},children:t(Oi,{})}),c&&t(Ci,{flipX:!0,clientX:36,isOpen:c,onClose:u,onSave:()=>{a(r.token).then(u)},title:"Enter a new API Token",titleTooltip:"Contact us to generate a new one",children:t(C,{placeholder:"API Token",type:"password",value:r.token,onChange:e=>l("token",e.target.value)})})]})]})},Yr=({tokens:e,saveToken:i})=>t(G,{title:"Authorization Tokens",titleBadge:e.length,data:[{type:y.Table,value:{columns:[{key:"icon",title:""},{key:"name",title:"Name"},{key:"expires_at",title:"Expires"},{key:"token",title:"Token"},{key:"actions",title:""}],rows:e.map(({name:e,token:n,expiresAt:a})=>({cells:[{columnKey:"icon",icon:Qi},{columnKey:"name",value:e},{columnKey:"token",value:`${new Array(15).fill("•").join("")}`},{columnKey:"expires_at",component:()=>t(_r,{expiresAt:a})},{columnKey:"actions",component:()=>t(Ur,{token:n,saveToken:i})}]}))}}]}),Gr=({fetchDescribeOdigos:o})=>{const[r,l]=n(null);if(a(()=>{o().then(({data:e})=>l(e?.describeOdigos||null))},[]),!r)return t(Te,{children:t(Ae,{})});const s=e=>e?.name?[t(re,{},`divider-${e.name}`),t(ri,{title:e.name,subTitle:e.explain||void 0,value:{status:e.status||(di(e.value)?ui(e.value)?ne.Success:ne.Error:ne.Default),text:e.value}},`describe-row-${e.name}`)]:[];return e(i,{children:[t(G,{title:"General Information",withExtend:!0,initialExtended:!0,data:[{title:r?.odigosVersion?.name,value:r?.odigosVersion?.value},{title:r?.kubernetesVersion?.name,value:r?.kubernetesVersion?.value},{title:r?.installationMethod?.name,value:r?.installationMethod?.value},{title:r?.tier?.name,value:r?.tier?.value},{title:"# of sources",value:r?.numberOfSources?.toString()},{title:"# of destinations",value:r?.numberOfDestinations?.toString()}]}),t(G,{title:"Cluster Collector",withExtend:!0,children:Object.values(r?.clusterCollector||{}).map(s)}),t(G,{title:"Node Collector",withExtend:!0,children:Object.values(r?.nodeCollector||{}).map(s)})]})},Xr=p.div`
478
478
  display: flex;
479
479
  flex-direction: column;
480
480
  gap: 12px;
@@ -587,4 +587,4 @@ import{jsxs as e,jsx as t,Fragment as i}from"react/jsx-runtime";import{useState
587
587
  padding-top: 12px;
588
588
  padding-left: 12px;
589
589
  white-space: nowrap;
590
- `,Tl=({heightToRemove:a,traces:o,isLoading:r})=>{const[l,c]=n([]),[d,u]=n(null),p=s(()=>Et(o).sort((e,t)=>t.spans[0].startTime-e.spans[0].startTime).map(e=>({...e,spans:rl(e)})),[o]),h=s(()=>p.reduce((e,t)=>Math.max(e,t.spans.reduce((e,t)=>e+t.duration,0)),0),[p]),m=s(()=>{const e=p.find(e=>e.spans.some(e=>e.spanID===d?.spanID)),t=e?.processes.find(e=>e.serviceName===d?.processID);return t},[p,d]);return e(i,{children:[t($l,{$heightToRemove:a,children:r?t(Te,{$height:"50vh",children:t(Ae,{scale:1.5})}):p.length?e(Cl,{$heightToRemove:a,children:[t(wl,{children:t(P,{children:"Service & operation"})}),new Array(5).fill(null).map((e,i)=>t(kl,{$heightToRemove:a,index:i,children:t(Dl,{children:ki(h/5*i)})},`${i}-divider`)),p.map((e,i)=>{const{spans:n}=e,a=n.reduce((e,t)=>Math.min(e,t.startTime),Number.MAX_SAFE_INTEGER),o=n.reduce((e,t)=>Math.max(e,t.startTime+t.duration),0);return t(Sl,{spans:n,logs:[],depth:1,indexInMatrix:i,maxDuration:h,minStartTime:a,maxEndTime:o,openSpanIdsState:{value:l,set:c},selectedSpanState:{value:d,set:u}},`recursive-spans-${e.traceID}`)})]}):t(Te,{$height:"50vh",children:t(Ne,{title:g.NO_TRACES_FOUND,subTitle:g.ARE_SERVICES_INSTRUMENTED_AND_PRODUCING_TRAFFIC})})}),d&&t(pl,{span:d,process:m,onClose:()=>u(null)})]})};export{Rn as ActionDrawer,En as ActionForm,Ln as ActionModal,Hn as ActionTable,Jn as AwaitPipeline,ma as ConditionDropdown,ca as DataFlow,qa as DataFlowActionsMenu,Oa as DataStreamDrawer,Na as DataStreamForm,Ha as DataStreamModal,za as DataStreamSelectionForm,eo as DestinationDrawer,Xa as DestinationForm,yo as DestinationModal,So as DestinationSelectionForm,Co as DestinationTable,ga as ErrorDropdown,Ko as InstrumentationRuleDrawer,Lo as InstrumentationRuleForm,Ho as InstrumentationRuleModal,Wo as InstrumentationRuleTable,fa as KindDropdown,ya as LanguageDropdown,va as MonitorDropdown,Jo as MultiSourceControl,ba as NamespaceDropdown,Cr as NavIconIds,Zo as NotificationManager,On as OverviewDrawer,xa as PodsAgentInjectionStatusDropdown,dr as ServiceMap,$r as SetupSummary,wr as SideNav,kr as SlackInvite,qr as SourceDrawer,Nr as SourceForm,Vr as SourceModal,Hr as SourceSelectionForm,Wr as SourceTable,Zr as SystemOverview,jn as TableCellConditions,tl as ToastList,ol as ToggleDarkMode,Tl as TraceView};
590
+ `,Tl=({heightToRemove:a,traces:o,isLoading:r})=>{const[l,c]=n([]),[d,u]=n(null),p=s(()=>Et(o).sort((e,t)=>t.spans[0].startTime-e.spans[0].startTime).map(e=>({...e,spans:rl(e)})),[o]),h=s(()=>p.reduce((e,t)=>Math.max(e,t.spans.reduce((e,t)=>e+t.duration,0)),0),[p]),m=s(()=>{const e=p.find(e=>e.spans.some(e=>e.spanID===d?.spanID)),t=e?.processes.find(e=>e.serviceName===d?.processID);return t},[p,d]);return e(i,{children:[t($l,{$heightToRemove:a,children:r?t(Te,{$height:"50vh",children:t(Ae,{scale:1.5})}):p.length?e(Cl,{$heightToRemove:a,children:[t(wl,{children:t(P,{children:"Service & operation"})}),new Array(5).fill(null).map((e,i)=>t(kl,{$heightToRemove:a,index:i,children:t(Dl,{children:ki(h/5*i)})},`${i}-divider`)),p.map((e,i)=>{const{spans:n}=e,a=n.reduce((e,t)=>Math.min(e,t.startTime),Number.MAX_SAFE_INTEGER),o=n.reduce((e,t)=>Math.max(e,t.startTime+t.duration),0);return t(Sl,{spans:n,logs:[],depth:1,indexInMatrix:i,maxDuration:h,minStartTime:a,maxEndTime:o,openSpanIdsState:{value:l,set:c},selectedSpanState:{value:d,set:u}},`recursive-spans-${e.traceID}`)})]}):t(Te,{$height:"50vh",children:t(Ne,{title:g.NO_TRACES_FOUND,subTitle:g.ARE_SERVICES_INSTRUMENTED_AND_PRODUCING_TRAFFIC})})}),d&&t(pl,{span:d,process:m,onClose:()=>u(null)})]})};export{Rn as ActionDrawer,En as ActionForm,Ln as ActionModal,Hn as ActionTable,Jn as AwaitPipeline,ma as ConditionDropdown,ca as DataFlow,qa as DataFlowActionsMenu,Fa as DataStreamDrawer,Na as DataStreamForm,Ha as DataStreamModal,za as DataStreamSelectionForm,eo as DestinationDrawer,Xa as DestinationForm,yo as DestinationModal,So as DestinationSelectionForm,Co as DestinationTable,ga as ErrorDropdown,Ko as InstrumentationRuleDrawer,Lo as InstrumentationRuleForm,Ho as InstrumentationRuleModal,Wo as InstrumentationRuleTable,fa as KindDropdown,ya as LanguageDropdown,va as MonitorDropdown,Jo as MultiSourceControl,ba as NamespaceDropdown,Cr as NavIconIds,Zo as NotificationManager,Fn as OverviewDrawer,xa as PodsAgentInjectionStatusDropdown,dr as ServiceMap,$r as SetupSummary,wr as SideNav,kr as SlackInvite,qr as SourceDrawer,Nr as SourceForm,Vr as SourceModal,Hr as SourceSelectionForm,Wr as SourceTable,Zr as SystemOverview,jn as TableCellConditions,tl as ToastList,ol as ToggleDarkMode,Tl as TraceView};
package/lib/contexts.js CHANGED
@@ -1 +1 @@
1
- export{dw as OdigosProvider,dx as StorybookProvider,ax as checkVersionSupport,au as useOdigos,dy as useStorybook}from"./chunks/ui-components-OrgB9V7b.js";import"./icons.js";import"react/jsx-runtime";import"styled-components";import"zustand";import"react";import"javascript-time-ago";import"./chunks/vendor-DUWBN0Mg.js";import"@xyflow/react";import"react-dom";import"prism-react-renderer";import"react-error-boundary";import"lottie-react";import"virtua";
1
+ export{dw as OdigosProvider,dx as StorybookProvider,ax as checkVersionSupport,au as useOdigos,dy as useStorybook}from"./chunks/ui-components-DSKV7uC0.js";import"./icons.js";import"react/jsx-runtime";import"styled-components";import"zustand";import"react";import"javascript-time-ago";import"./chunks/vendor-DUWBN0Mg.js";import"@xyflow/react";import"react-dom";import"prism-react-renderer";import"react-error-boundary";import"lottie-react";import"virtua";
package/lib/functions.js CHANGED
@@ -1 +1 @@
1
- export{c7 as capitalizeFirstLetter,d3 as cleanObjectEmptyStringsValues,w as compareCondition,j as deepClone,bo as filterActions,bO as filterDestinations,bM as filterDestinationsByStream,bN as filterSources,bL as filterSourcesByStream,d4 as flattenObjectKeys,bF as formatBytes,cG as formatDuration,aw as generateId,b9 as getActionIcon,bi as getConditionsBooleans,bH as getContainersIcons,cD as getContainersInstrumentedCount,aa as getDestinationIcon,bv as getEntityIcon,b5 as getEntityId,bq as getEntityLabel,d5 as getIdFromSseTarget,bG as getInstrumentationRuleIcon,d6 as getMainContainerLanguage,cb as getMetricForEntity,d7 as getMonitorIcon,d8 as getPlatformIcon,d9 as getPlatformLabel,$ as getProgrammingLanguageIcon,cI as getRecursiveValues,da as getSseTargetFromId,db as getStatusColor,aE as getStatusFromPodStatus,bm as getStatusIcon,cp as getStatusTypeFromOdigosHealth,dc as getValueForRange,ci as getWorkloadId,c6 as getYamlFieldsForDestination,cq as hasUnhealthyInstances,i as isEmpty,dd as isLegalK8sLabel,ao as isOverTime,cv as isStringABoolean,de as isTimeElapsed,df as isValidVersion,bl as mapConditions,c4 as mapDestinationFieldsForDisplay,G as mapExportedSignals,z as mapSupportedSignals,dg as numbersOnly,cw as parseBooleanFromString,dh as parseJsonStringToPrettyString,di as removeEmptyValuesFromObject,y as safeJsonParse,dj as safeJsonStringify,bB as sleep,bV as splitCamelString,dk as stringifyNonStringValues,dl as trimVersion}from"./chunks/ui-components-OrgB9V7b.js";import"./icons.js";import"react/jsx-runtime";import"styled-components";import"zustand";import"react";import"javascript-time-ago";import"./chunks/vendor-DUWBN0Mg.js";import"@xyflow/react";import"react-dom";import"prism-react-renderer";import"react-error-boundary";import"lottie-react";import"virtua";
1
+ export{c7 as capitalizeFirstLetter,d3 as cleanObjectEmptyStringsValues,w as compareCondition,j as deepClone,bo as filterActions,bO as filterDestinations,bM as filterDestinationsByStream,bN as filterSources,bL as filterSourcesByStream,d4 as flattenObjectKeys,bF as formatBytes,cG as formatDuration,aw as generateId,b9 as getActionIcon,bi as getConditionsBooleans,bH as getContainersIcons,cD as getContainersInstrumentedCount,aa as getDestinationIcon,bv as getEntityIcon,b5 as getEntityId,bq as getEntityLabel,d5 as getIdFromSseTarget,bG as getInstrumentationRuleIcon,d6 as getMainContainerLanguage,cb as getMetricForEntity,d7 as getMonitorIcon,d8 as getPlatformIcon,d9 as getPlatformLabel,$ as getProgrammingLanguageIcon,cI as getRecursiveValues,da as getSseTargetFromId,db as getStatusColor,aE as getStatusFromPodStatus,bm as getStatusIcon,cp as getStatusTypeFromOdigosHealth,dc as getValueForRange,ci as getWorkloadId,c6 as getYamlFieldsForDestination,cq as hasUnhealthyInstances,i as isEmpty,dd as isLegalK8sLabel,ao as isOverTime,cv as isStringABoolean,de as isTimeElapsed,df as isValidVersion,bl as mapConditions,c4 as mapDestinationFieldsForDisplay,G as mapExportedSignals,z as mapSupportedSignals,dg as numbersOnly,cw as parseBooleanFromString,dh as parseJsonStringToPrettyString,di as removeEmptyValuesFromObject,y as safeJsonParse,dj as safeJsonStringify,bB as sleep,bV as splitCamelString,dk as stringifyNonStringValues,dl as trimVersion}from"./chunks/ui-components-DSKV7uC0.js";import"./icons.js";import"react/jsx-runtime";import"styled-components";import"zustand";import"react";import"javascript-time-ago";import"./chunks/vendor-DUWBN0Mg.js";import"@xyflow/react";import"react-dom";import"prism-react-renderer";import"react-error-boundary";import"lottie-react";import"virtua";
package/lib/hooks.js CHANGED
@@ -1 +1 @@
1
- export{b4 as useActionFormData,dv as useBodyScroll,bP as useClickNode,cj as useClickNotification,bK as useContainerSize,al as useCopy,bZ as useDataStreamFormData,c5 as useDestinationFormData,a3 as useGenericForm,ce as useInstrumentationRuleFormData,am as useKeyDown,bU as useOnClickOutside,bQ as usePopup,bY as useSessionStorage,cx as useSourceFormData,cB as useSourceSelectionFormData,an as useTimeAgo}from"./chunks/ui-components-OrgB9V7b.js";import"./icons.js";import"react/jsx-runtime";import"styled-components";import"zustand";import"react";import"javascript-time-ago";import"./chunks/vendor-DUWBN0Mg.js";import"@xyflow/react";import"react-dom";import"prism-react-renderer";import"react-error-boundary";import"lottie-react";import"virtua";
1
+ export{b4 as useActionFormData,dv as useBodyScroll,bP as useClickNode,cj as useClickNotification,bK as useContainerSize,al as useCopy,bZ as useDataStreamFormData,c5 as useDestinationFormData,a3 as useGenericForm,ce as useInstrumentationRuleFormData,am as useKeyDown,bU as useOnClickOutside,bQ as usePopup,bY as useSessionStorage,cx as useSourceFormData,cB as useSourceSelectionFormData,an as useTimeAgo}from"./chunks/ui-components-DSKV7uC0.js";import"./icons.js";import"react/jsx-runtime";import"styled-components";import"zustand";import"react";import"javascript-time-ago";import"./chunks/vendor-DUWBN0Mg.js";import"@xyflow/react";import"react-dom";import"prism-react-renderer";import"react-error-boundary";import"lottie-react";import"virtua";
package/lib/snippets.js CHANGED
@@ -1 +1 @@
1
- export{c1 as AddButton,cr as CopyText,cn as EditButton,cl as Flow,dz as MapItemNode,dA as NoDataNode,c2 as NoteBackToSummary,ct as PodContainer,cA as SourceContainer}from"./chunks/ui-components-OrgB9V7b.js";import"./icons.js";import"react/jsx-runtime";import"styled-components";import"zustand";import"react";import"javascript-time-ago";import"./chunks/vendor-DUWBN0Mg.js";import"@xyflow/react";import"react-dom";import"prism-react-renderer";import"react-error-boundary";import"lottie-react";import"virtua";
1
+ export{c1 as AddButton,cr as CopyText,cn as EditButton,cl as Flow,dz as MapItemNode,dA as NoDataNode,c2 as NoteBackToSummary,ct as PodContainer,cA as SourceContainer}from"./chunks/ui-components-DSKV7uC0.js";import"./icons.js";import"react/jsx-runtime";import"styled-components";import"zustand";import"react";import"javascript-time-ago";import"./chunks/vendor-DUWBN0Mg.js";import"@xyflow/react";import"react-dom";import"prism-react-renderer";import"react-error-boundary";import"lottie-react";import"virtua";
package/lib/store.js CHANGED
@@ -1 +1 @@
1
- export{ak as ProgressKeys,dq as useActiveNodeStore,cF as useDarkMode,ac as useDataStreamStore,b0 as useDrawerStore,aq as useEntityStore,bn as useFilterStore,bb as useModalStore,cd as useNotificationStore,ah as useProgressStore,bD as useSelectedStore,b_ as useSetupStore}from"./chunks/ui-components-OrgB9V7b.js";import"./icons.js";import"react/jsx-runtime";import"styled-components";import"zustand";import"react";import"javascript-time-ago";import"./chunks/vendor-DUWBN0Mg.js";import"@xyflow/react";import"react-dom";import"prism-react-renderer";import"react-error-boundary";import"lottie-react";import"virtua";
1
+ export{ak as ProgressKeys,dq as useActiveNodeStore,cF as useDarkMode,ac as useDataStreamStore,b0 as useDrawerStore,aq as useEntityStore,bn as useFilterStore,bb as useModalStore,cd as useNotificationStore,ah as useProgressStore,bD as useSelectedStore,b_ as useSetupStore}from"./chunks/ui-components-DSKV7uC0.js";import"./icons.js";import"react/jsx-runtime";import"styled-components";import"zustand";import"react";import"javascript-time-ago";import"./chunks/vendor-DUWBN0Mg.js";import"@xyflow/react";import"react-dom";import"prism-react-renderer";import"react-error-boundary";import"lottie-react";import"virtua";