@odigos/ui-kit 0.0.265 → 0.0.266

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/lib/containers.js CHANGED
@@ -1,4 +1,4 @@
1
- import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import n,{useEffect as i,useMemo as a,useRef as l,useCallback as r,useState as s,Fragment as c,forwardRef as d,useImperativeHandle as u,Children as p,createContext as h,useContext as m,useLayoutEffect as g,memo as f}from"react";import b,{useTheme as v,css as y,keyframes as C}from"styled-components";import{u as S,n as x,C as w,f as T,e as k,d as E,q as I,g as N,h as $,j as O,p as A,l as R,c as D,r as _,S as P,s as L,R as F,t as M,w as z,o as B,x as X,y as U,z as V,A as H,B as j,D as G,E as W,F as K,G as Y,H as q,I as J,J as Z}from"./chunks/odigos-context-Dq_yIuDF.js";import{bi as Q,w as ee,x as te,C as oe,aT as ne,I as ie,bs as ae,d as le,e as re,j as se,aX as ce,bt as de,N as ue,Q as pe,U as he,y as me,m as ge,n as fe,B as be,S as ve,bu as ye,bv as Ce,a1 as Se,bw as xe,bx as we,k as Te,by as ke,F as Ee,bz as Ie,s as Ne,T as $e,bA as Oe,bj as Ae,aW as Re,bB as De,bC as _e,i as Pe,az as Le,aB as Fe,bD as Me,bo as ze,bp as Be,bn as Xe,bE as Ue,u as Ve,H as He,r as je,G as Ge,J as We,q as Ke,p as Ye,bF as qe,bG as Je,aJ as Ze,W as Qe,D as et,b6 as tt,bH as ot,bI as nt,bJ as it,bK as at,bL as lt,bM as rt,bN as st,bO as ct,z as dt,bP as ut,bQ as pt,bR as ht,bS as mt,bT as gt,aV as ft,bm as bt,h as vt,bU as yt,bV as Ct,aY as St,bW as xt,bX as wt,aR as Tt,bq as kt,b5 as Et,b as It,f as Nt,bY as $t,b7 as Ot,bZ as At,b_ as Rt,b9 as Dt,b$ as _t,a_ as Pt,c0 as Lt,c as Ft,l as Mt,bc as zt,bh as Bt,ay as Xt,c1 as Ut,c2 as Vt,bg as Ht,c3 as jt,c4 as Gt,c5 as Wt,v as Kt,b1 as Yt,b2 as qt,aD as Jt,c6 as Zt,c7 as Qt,c8 as eo,c9 as to,ca as oo,cb as no,cc as io,cd as ao,ce as lo,cf as ro,cg as so,A as co,aZ as uo,aU as po,ch as ho,ci as mo,cj as go,ck as fo,cl as bo,cm as vo,br as yo,cn as Co,co as So,cp as xo,cq as wo,cr as To,cs as ko,ct as Eo,cu as Io,aI as No,cv as $o,cw as Oo,cx as Ao,cy as Ro,cz as Do,cA as _o,cB as Po,cC as Lo,cD as Fo,cE as Mo,cF as zo,cG as Bo,cH as Xo,ao as Uo,cI as Vo,cJ as Ho,cK as jo,cL as Go,cM as Wo,cN as Ko,cO as Yo,cP as qo,cQ as Jo,cR as Zo,cS as Qo,cT as en,cU as tn,cV as on,cW as nn,a7 as an,cX as ln,cY as rn,a$ as sn,cZ as cn,c_ as dn,c$ as un,d0 as pn,d1 as hn,d2 as mn,d3 as gn,d4 as fn,d5 as bn,d6 as vn,d7 as yn,d8 as Cn,d9 as Sn,da as xn,db as wn,dc as Tn,dd as kn,de as En,df as In,dg as Nn,dh as $n,di as On,dj as An,dk as Rn,dl as Dn,dm as _n,dn as Pn,dp as Ln,dq as Fn,dr as Mn,ds as zn,dt as Bn,du as Xn,dv as Un,dw as Vn,dx as Hn,dy as jn,dz as Gn,dA as Wn,dB as Kn,dC as Yn,dD as qn,dE as Jn,dF as Zn,dG as Qn,dH as ei,dI as ti,dJ as oi,dK as ni,dL as ii,dM as ai,dN as li,dO as ri,dP as si,dQ as ci,dR as di,dS as ui,dT as pi,dU as hi,dV as mi,dW as gi,dX as fi,dY as bi,dZ as vi,d_ as yi,d$ as Ci,e0 as Si,e1 as xi,e2 as wi,e3 as Ti,e4 as ki,e5 as Ei,e6 as Ii,e7 as Ni,e8 as $i,e9 as Oi,ea as Ai,P as Ri,eb as Di,ec as _i,ed as Pi,ee as Li,ef as Fi,eg as Mi,aS as zi,eh as Bi,aN as Xi,ei as Ui,ej as Vi,ek as Hi,el as ji,em as Gi,en as Wi,eo as Ki,ep as Yi,eq as qi,er as Ji,es as Zi,et as Qi,b8 as ea,eu as ta,R as oa,a as na,ev as ia,ew as aa,ex as la,ey as ra,ez as sa,eA as ca,eB as da,eC as ua,eD as pa,eE as ha,eF as ma,eG as ga,eH as fa,eI as ba,eJ as va,eK as ya,eL as Ca,eM as Sa,eN as xa,eO as wa,eP as Ta,eQ as ka}from"./chunks/ui-components-CoDVeDqt.js";import{TrashIcon as Ea,PlusIcon as Ia,ArrowRightIcon as Na,VSquareIcon as $a,XSquareIcon as Oa,BookIcon as Aa,DeleteIcon as Ra,EditIcon as Da,GoLogo as _a,JavaLogo as Pa,ChevronRightIcon as La,ActionIcon as Fa,DestinationIcon as Ma,ChevronUpIcon as za,ChevronDownIcon as Ba,VIcon as Xa,XIcon as Ua,InstrumentationRuleIcon as Va,SourceIcon as Ha,NamespacesIcon as ja,AwsLogo as Ga,CloudConnectorIcon as Wa,EyeOpenIcon as Ka,CloudConnectorPolicyIcon as Ya,ArrowLeftIcon as qa,ISquareIcon as Ja,RefreshIcon as Za,SettingsIcon as Qa,PodIcon as el,OdigosLogo as tl,K8sLogo as ol,ExclamationCircleIcon as nl,QuestionCircleIcon as il,InboundIcon as al,OutboundIcon as ll,UserIcon as rl,TerminalIcon as sl,MinusIcon as cl,SearchIcon as dl,ExpandIcon as ul,CopyIcon as pl,DotIcon as hl,ArrowDownIcon as ml,DownloadIcon as gl,RefreshLeftArrowIcon as fl,VmLogo as bl,SamplingIcon as vl,ExclamationTriangleIcon as yl,KeyIcon as Cl,DiagnoseIcon as Sl,StarIcon as xl,ArrowIcon as wl,ConnectionsIcon as Tl,FilterIcon as kl,DataStreamIcon as El,PipelineCollectorIcon as Il,ArrowDownSquareIcon as Nl,ArrowUpSquareIcon as $l,GatewayIcon as Ol,YamlIcon as Al,ImageErrorIcon as Rl,LockIcon as Dl}from"./icons.js";import{h as _l,o as Pl,n as Ll,q as Fl,m as Ml,t as zl,s as Bl,S as Xl,w as Ul,E as Vl,x as Hl,y as jl,v as Gl,l as Wl,d as Kl,O as Yl,f as ql,b as Jl,A as Zl,R as Ql,C as er,e as tr,D as or}from"./chunks/source-instrument-form-context-D1tB6ZAx.js";import{d as nr,i as ir,I as ar,j as lr,A as rr,g as sr,P as cr,S as dr,R as ur,e as pr,h as hr,c as mr,f as gr,k as fr,W as br,C as vr,b as yr,Y as Cr,O as Sr,a as xr,U as wr}from"./chunks/index-BMLDblot.js";import{createPortal as Tr}from"react-dom";import{MarkerType as kr,useNodesState as Er,useEdgesState as Ir,Handle as Nr,Position as $r,getSmoothStepPath as Or,BaseEdge as Ar,EdgeLabelRenderer as Rr,ReactFlowProvider as Dr,ReactFlow as _r,Background as Pr,Controls as Lr,ControlButton as Fr,useReactFlow as Mr}from"@xyflow/react";import zr from"elkjs/lib/elk.bundled.js";import"@xyflow/react/dist/style.css";import"zustand";import"javascript-time-ago";import"javascript-time-ago/locale/en";import"prism-react-renderer";import"zustand/middleware";import"react-error-boundary";import"virtua";import"@apollo/client/react";import"@apollo/client/link/error";import"@apollo/client/link/context";import"@apollo/client/utilities";import"@apollo/client/errors";import"@apollo/client";const Br=[{id:"CREDIT_CARD",label:"Credit card"}],Xr=[{id:Q.CollectContainerAttributes,label:"Collect container attributes"},{id:Q.CollectReplicaSetAttributes,label:"Collect ReplicaSet attributes"},{id:Q.CollectWorkloadId,label:"Collect workload ID"},{id:Q.CollectClusterId,label:"Collect cluster ID"}],Ur=[{id:ae.Pod,label:ae.Pod},{id:ae.Namespace,label:ae.Namespace},{id:ae.Node,label:ae.Node}],Vr=[{label:"Label key",keyName:"labelKey",placeholder:"app.kubernetes.io/name"},{label:"Attribute key",keyName:"attributeKey",placeholder:"app.kubernetes.name"},{label:"From sources",keyName:"fromSources",placeholder:"pod, namespace",tooltip:"Select multiple sources. Higher precedence sources (pod > namespace > node) will override lower ones.",componentType:"multi-dropdown",options:Ur}],Hr=[{label:"Annotation key",keyName:"annotationKey",placeholder:"kubectl.kubernetes.io/restartedAt"},{label:"Attribute key",keyName:"attributeKey",placeholder:"kubectl.kubernetes.restartedAt"},{label:"From sources",keyName:"fromSources",placeholder:"pod, namespace",tooltip:"Select multiple sources. Higher precedence sources (pod > namespace > node) will override lower ones.",componentType:"multi-dropdown",options:Ur}],jr=/^[a-zA-Z]$/,Gr=new Set(["*","+","?"]),Wr=new Set(["^","$"]),Kr={group:"rgba(102, 242, 102, 0.5)","anchor-quantifier":"rgba(102, 191, 255, 0.5)","class-bracket":"rgba(255, 153, 153, 0.5)","class-content":"rgba(178, 1, 1, 0.5)",alternation:"rgba(255, 153, 153, 0.5)",literal:"transparent"},Yr=b.div`
1
+ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import n,{useEffect as i,useMemo as a,useRef as l,useCallback as r,useState as s,Fragment as c,forwardRef as d,useImperativeHandle as p,Children as u,createContext as h,useContext as m,useLayoutEffect as g,memo as f}from"react";import b,{useTheme as v,css as y,keyframes as C}from"styled-components";import{u as S,n as x,C as w,f as T,e as k,d as E,q as I,g as N,h as $,j as O,p as A,l as R,c as D,r as _,S as P,s as L,R as F,t as M,w as z,o as B,x as X,y as U,z as V,A as H,B as j,D as G,E as W,F as K,G as Y,H as q,I as J,J as Z}from"./chunks/odigos-context-DzuZq_D5.js";import{bi as Q,w as ee,x as te,C as oe,aT as ne,I as ie,bs as ae,d as le,e as re,j as se,aX as ce,bt as de,N as pe,Q as ue,U as he,y as me,m as ge,n as fe,B as be,S as ve,bu as ye,bv as Ce,a1 as Se,bw as xe,bx as we,k as Te,by as ke,F as Ee,bz as Ie,s as Ne,T as $e,bA as Oe,bj as Ae,aW as Re,bB as De,bC as _e,i as Pe,az as Le,aB as Fe,bD as Me,bo as ze,bp as Be,bn as Xe,bE as Ue,u as Ve,H as He,r as je,G as Ge,J as We,q as Ke,p as Ye,bF as qe,bG as Je,aJ as Ze,W as Qe,D as et,b6 as tt,bH as ot,bI as nt,bJ as it,bK as at,bL as lt,bM as rt,bN as st,bO as ct,z as dt,bP as pt,bQ as ut,bR as ht,bS as mt,bT as gt,aV as ft,bm as bt,h as vt,bU as yt,bV as Ct,aY as St,bW as xt,bX as wt,aR as Tt,bq as kt,b5 as Et,b as It,f as Nt,bY as $t,b7 as Ot,bZ as At,b_ as Rt,b9 as Dt,b$ as _t,a_ as Pt,c0 as Lt,c as Ft,l as Mt,bc as zt,bh as Bt,ay as Xt,c1 as Ut,c2 as Vt,bg as Ht,c3 as jt,c4 as Gt,c5 as Wt,v as Kt,b1 as Yt,b2 as qt,aD as Jt,c6 as Zt,c7 as Qt,c8 as eo,c9 as to,ca as oo,cb as no,cc as io,cd as ao,ce as lo,cf as ro,cg as so,A as co,aZ as po,aU as uo,ch as ho,ci as mo,cj as go,ck as fo,cl as bo,cm as vo,br as yo,cn as Co,co as So,cp as xo,cq as wo,cr as To,cs as ko,ct as Eo,cu as Io,cv as No,aI as $o,cw as Oo,cx as Ao,cy as Ro,cz as Do,cA as _o,cB as Po,cC as Lo,cD as Fo,cE as Mo,cF as zo,cG as Bo,cH as Xo,cI as Uo,ao as Vo,cJ as Ho,cK as jo,cL as Go,cM as Wo,cN as Ko,cO as Yo,cP as qo,cQ as Jo,cR as Zo,cS as Qo,cT as en,cU as tn,cV as on,cW as nn,cX as an,a7 as ln,cY as rn,cZ as sn,a$ as cn,c_ as dn,c$ as pn,d0 as un,d1 as hn,d2 as mn,d3 as gn,d4 as fn,d5 as bn,d6 as vn,d7 as yn,d8 as Cn,d9 as Sn,da as xn,db as wn,dc as Tn,dd as kn,de as En,df as In,dg as Nn,dh as $n,di as On,dj as An,dk as Rn,dl as Dn,dm as _n,dn as Pn,dp as Ln,dq as Fn,dr as Mn,ds as zn,dt as Bn,du as Xn,dv as Un,dw as Vn,dx as Hn,dy as jn,dz as Gn,dA as Wn,dB as Kn,dC as Yn,dD as qn,dE as Jn,dF as Zn,dG as Qn,dH as ei,dI as ti,dJ as oi,dK as ni,dL as ii,dM as ai,dN as li,dO as ri,dP as si,dQ as ci,dR as di,dS as pi,dT as ui,dU as hi,dV as mi,dW as gi,dX as fi,dY as bi,dZ as vi,d_ as yi,d$ as Ci,e0 as Si,e1 as xi,e2 as wi,e3 as Ti,e4 as ki,e5 as Ei,e6 as Ii,e7 as Ni,e8 as $i,e9 as Oi,ea as Ai,eb as Ri,P as Di,ec as _i,ed as Pi,ee as Li,ef as Fi,eg as Mi,eh as zi,aS as Bi,ei as Xi,aN as Ui,ej as Vi,ek as Hi,el as ji,em as Gi,en as Wi,eo as Ki,ep as Yi,eq as qi,er as Ji,es as Zi,et as Qi,eu as ea,b8 as ta,ev as oa,R as na,a as ia,ew as aa,ex as la,ey as ra,ez as sa,eA as ca,eB as da,eC as pa,eD as ua,eE as ha,eF as ma,eG as ga,eH as fa,eI as ba,eJ as va,eK as ya,eL as Ca,eM as Sa,eN as xa,eO as wa,eP as Ta,eQ as ka,eR as Ea}from"./chunks/ui-components-Dq_j4_BI.js";import{TrashIcon as Ia,PlusIcon as Na,ArrowRightIcon as $a,VSquareIcon as Oa,XSquareIcon as Aa,BookIcon as Ra,DeleteIcon as Da,EditIcon as _a,GoLogo as Pa,JavaLogo as La,ChevronRightIcon as Fa,ActionIcon as Ma,DestinationIcon as za,ChevronUpIcon as Ba,ChevronDownIcon as Xa,VIcon as Ua,XIcon as Va,InstrumentationRuleIcon as Ha,SourceIcon as ja,NamespacesIcon as Ga,AwsLogo as Wa,CloudConnectorIcon as Ka,EyeOpenIcon as Ya,CloudConnectorPolicyIcon as qa,ArrowLeftIcon as Ja,ISquareIcon as Za,RefreshIcon as Qa,SettingsIcon as el,PodIcon as tl,OdigosLogo as ol,K8sLogo as nl,ExclamationCircleIcon as il,QuestionCircleIcon as al,InboundIcon as ll,OutboundIcon as rl,UserIcon as sl,TerminalIcon as cl,RefreshLeftArrowIcon as dl,MinusIcon as pl,SearchIcon as ul,ExpandIcon as hl,CopyIcon as ml,DotIcon as gl,ArrowDownIcon as fl,DownloadIcon as bl,VmLogo as vl,SamplingIcon as yl,ExclamationTriangleIcon as Cl,KeyIcon as Sl,DiagnoseIcon as xl,StarIcon as wl,ArrowIcon as Tl,ConnectionsIcon as kl,FilterIcon as El,DataStreamIcon as Il,PipelineCollectorIcon as Nl,ArrowDownSquareIcon as $l,ArrowUpSquareIcon as Ol,GatewayIcon as Al,YamlIcon as Rl,ImageErrorIcon as Dl,LockIcon as _l}from"./icons.js";import{h as Pl,o as Ll,n as Fl,q as Ml,m as zl,t as Bl,s as Xl,S as Ul,w as Vl,E as Hl,x as jl,y as Gl,v as Wl,l as Kl,d as Yl,O as ql,f as Jl,b as Zl,A as Ql,R as er,C as tr,e as or,D as nr}from"./chunks/source-instrument-form-context-DnvGijkN.js";import{d as ir,i as ar,I as lr,j as rr,A as sr,g as cr,P as dr,S as pr,R as ur,e as hr,h as mr,c as gr,f as fr,k as br,W as vr,C as yr,b as Cr,Y as Sr,O as xr,a as wr,U as Tr}from"./chunks/index-DUhfkGj1.js";import{createPortal as kr}from"react-dom";import{MarkerType as Er,useNodesState as Ir,useEdgesState as Nr,Handle as $r,Position as Or,getSmoothStepPath as Ar,BaseEdge as Rr,EdgeLabelRenderer as Dr,ReactFlowProvider as _r,ReactFlow as Pr,Background as Lr,Controls as Fr,ControlButton as Mr,useReactFlow as zr}from"@xyflow/react";import Br from"elkjs/lib/elk.bundled.js";import"@xyflow/react/dist/style.css";import"zustand";import"javascript-time-ago";import"javascript-time-ago/locale/en";import"prism-react-renderer";import"zustand/middleware";import"react-error-boundary";import"virtua";import"@apollo/client/react";import"@apollo/client/link/error";import"@apollo/client/link/context";import"@apollo/client/utilities";import"@apollo/client/errors";import"@apollo/client";const Xr=[{id:"CREDIT_CARD",label:"Credit card"}],Ur=[{id:Q.CollectContainerAttributes,label:"Collect container attributes"},{id:Q.CollectReplicaSetAttributes,label:"Collect ReplicaSet attributes"},{id:Q.CollectWorkloadId,label:"Collect workload ID"},{id:Q.CollectClusterId,label:"Collect cluster ID"}],Vr=[{id:ae.Pod,label:ae.Pod},{id:ae.Namespace,label:ae.Namespace},{id:ae.Node,label:ae.Node}],Hr=[{label:"Label key",keyName:"labelKey",placeholder:"app.kubernetes.io/name"},{label:"Attribute key",keyName:"attributeKey",placeholder:"app.kubernetes.name"},{label:"From sources",keyName:"fromSources",placeholder:"pod, namespace",tooltip:"Select multiple sources. Higher precedence sources (pod > namespace > node) will override lower ones.",componentType:"multi-dropdown",options:Vr}],jr=[{label:"Annotation key",keyName:"annotationKey",placeholder:"kubectl.kubernetes.io/restartedAt"},{label:"Attribute key",keyName:"attributeKey",placeholder:"kubectl.kubernetes.restartedAt"},{label:"From sources",keyName:"fromSources",placeholder:"pod, namespace",tooltip:"Select multiple sources. Higher precedence sources (pod > namespace > node) will override lower ones.",componentType:"multi-dropdown",options:Vr}],Gr=/^[a-zA-Z]$/,Wr=new Set(["*","+","?"]),Kr=new Set(["^","$"]),Yr={group:"rgba(102, 242, 102, 0.5)","anchor-quantifier":"rgba(102, 191, 255, 0.5)","class-bracket":"rgba(255, 153, 153, 0.5)","class-content":"rgba(178, 1, 1, 0.5)",alternation:"rgba(255, 153, 153, 0.5)",literal:"transparent"},qr=b.div`
2
2
  padding: 8px 16px;
3
3
  border-radius: 6px;
4
4
  border: 1px solid ${({theme:e})=>e.v2.colors.silver[500]};
@@ -18,9 +18,9 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import n,{useEff
18
18
  box-decoration-break: clone;
19
19
  -webkit-box-decoration-break: clone;
20
20
  }
21
- `,qr=b.span`
22
- background: ${({$kind:e})=>Kr[e]};
23
- `,Jr=({pattern:e,"data-id":o})=>{const n=a(()=>(e=>{const t=[];let o=0,n=!1;const i=(e,o)=>{const n=t[t.length-1];n&&n.kind===o?n.text+=e:t.push({text:e,kind:o})};for(;o<e.length;){const t=e[o];if(n){if("]"===t){i("]","class-bracket"),n=!1,o++;continue}if("\\"===t&&o+1<e.length){i(e.slice(o,o+2),"class-content"),o+=2;continue}i(t,"class-content"),o++}else{if("("===t&&"?"===e[o+1]){let t=2;const n=e[o+2];if(":"===n||"="===n||"!"===n)t=3;else if("<"===n){const n=e[o+3];if("="===n||"!"===n)t=4;else{const n=e.indexOf(">",o+2);-1!==n&&(t=n-o+1)}}i(e.slice(o,o+t),"group"),o+=t;continue}if("("!==t&&")"!==t)if("["!==t)if(Gr.has(t)||Wr.has(t))i(t,"anchor-quantifier"),o++;else{if("{"===t){const t=e.indexOf("}",o);if(t>o&&/^\{\d+,?\d*\}$/.test(e.slice(o,t+1))){i(e.slice(o,t+1),"anchor-quantifier"),o=t+1;continue}}if("\\"===t&&o+1<e.length){const t=e[o+1];jr.test(t)?i(e.slice(o,o+2),"anchor-quantifier"):i(e.slice(o,o+2),"literal"),o+=2;continue}"|"!==t?(i(t,"literal"),o++):(i("|","alternation"),o++)}else"^"===e[o+1]?(i("[^","class-bracket"),o+=2):(i("[","class-bracket"),o++),n=!0;else i(t,"group"),o++}}return t})(e),[e]);return t(Yr,e?{"data-id":o,children:n.map((e,o)=>t(qr,{$kind:e.kind,children:e.text},o))}:{"data-id":o,children:" "})},Zr="rgba(102, 191, 255, 0.5)",Qr=y`
21
+ `,Jr=b.span`
22
+ background: ${({$kind:e})=>Yr[e]};
23
+ `,Zr=({pattern:e,"data-id":o})=>{const n=a(()=>(e=>{const t=[];let o=0,n=!1;const i=(e,o)=>{const n=t[t.length-1];n&&n.kind===o?n.text+=e:t.push({text:e,kind:o})};for(;o<e.length;){const t=e[o];if(n){if("]"===t){i("]","class-bracket"),n=!1,o++;continue}if("\\"===t&&o+1<e.length){i(e.slice(o,o+2),"class-content"),o+=2;continue}i(t,"class-content"),o++}else{if("("===t&&"?"===e[o+1]){let t=2;const n=e[o+2];if(":"===n||"="===n||"!"===n)t=3;else if("<"===n){const n=e[o+3];if("="===n||"!"===n)t=4;else{const n=e.indexOf(">",o+2);-1!==n&&(t=n-o+1)}}i(e.slice(o,o+t),"group"),o+=t;continue}if("("!==t&&")"!==t)if("["!==t)if(Wr.has(t)||Kr.has(t))i(t,"anchor-quantifier"),o++;else{if("{"===t){const t=e.indexOf("}",o);if(t>o&&/^\{\d+,?\d*\}$/.test(e.slice(o,t+1))){i(e.slice(o,t+1),"anchor-quantifier"),o=t+1;continue}}if("\\"===t&&o+1<e.length){const t=e[o+1];Gr.test(t)?i(e.slice(o,o+2),"anchor-quantifier"):i(e.slice(o,o+2),"literal"),o+=2;continue}"|"!==t?(i(t,"literal"),o++):(i("|","alternation"),o++)}else"^"===e[o+1]?(i("[^","class-bracket"),o+=2):(i("[","class-bracket"),o++),n=!0;else i(t,"group"),o++}}return t})(e),[e]);return t(qr,e?{"data-id":o,children:n.map((e,o)=>t(Jr,{$kind:e.kind,children:e.text},o))}:{"data-id":o,children:" "})},Qr="rgba(102, 191, 255, 0.5)",es=y`
24
24
  font-family: ${({theme:e})=>e.font_family.code};
25
25
  font-size: 12px;
26
26
  line-height: 20px;
@@ -33,7 +33,7 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import n,{useEff
33
33
  -moz-tab-size: 4;
34
34
  tab-size: 4;
35
35
  margin: 0;
36
- `,es=b.div`
36
+ `,ts=b.div`
37
37
  position: relative;
38
38
  width: 100%;
39
39
  min-height: ${({$minHeight:e})=>e}px;
@@ -45,8 +45,8 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import n,{useEff
45
45
  &:focus-within {
46
46
  border-color: ${({theme:e})=>e.v2.colors.silver[300]};
47
47
  }
48
- `,ts=b.div`
49
- ${Qr}
48
+ `,os=b.div`
49
+ ${es}
50
50
  position: absolute;
51
51
  inset: 0;
52
52
  padding: 12px;
@@ -59,8 +59,8 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import n,{useEff
59
59
  box-decoration-break: clone;
60
60
  -webkit-box-decoration-break: clone;
61
61
  }
62
- `,os=b.textarea`
63
- ${Qr}
62
+ `,ns=b.textarea`
63
+ ${es}
64
64
  position: relative;
65
65
  z-index: 1;
66
66
  display: block;
@@ -78,18 +78,18 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import n,{useEff
78
78
  &::placeholder {
79
79
  color: ${({theme:e})=>e.v2.colors.silver[600]};
80
80
  }
81
- `,ns=e=>({before:e,matchPre:"",capture:"",matchPost:"",after:""}),is=({regex:o,value:n,onChange:i,minHeight:s=240,...c})=>{const d=l(null),u=l(null),p=a(()=>((e,t)=>{if(!e||!t)return ns(t);let o;try{o=new RegExp(e)}catch{return ns(t)}const n=o.exec(t);if(!n)return ns(t);const i=n.index,a=n.index+n[0].length;if(n.length<2||null==n[1])return{before:t.slice(0,i),matchPre:"",capture:t.slice(i,a),matchPost:"",after:t.slice(a)};const l=n[0].indexOf(n[1]),r=l>=0?i+l:i,s=r+n[1].length;return{before:t.slice(0,i),matchPre:t.slice(i,r),capture:t.slice(r,s),matchPost:t.slice(s,a),after:t.slice(a)}})(o,n),[o,n]),h=r(()=>{d.current&&u.current&&(d.current.scrollTop=u.current.scrollTop,d.current.scrollLeft=u.current.scrollLeft)},[]);return e(es,{$minHeight:s,children:[e(ts,{ref:d,"aria-hidden":!0,children:[p.before,t("span",{style:{background:Zr},children:p.matchPre}),t("span",{style:{background:"rgba(102, 242, 102, 0.5)"},children:p.capture}),t("span",{style:{background:Zr},children:p.matchPost}),p.after,n.endsWith("\n")?" ":""]}),t(os,{ref:u,$minHeight:s,value:n,onChange:e=>i(e.target.value),onScroll:h,spellCheck:!1,...c})]})},as=b.div`
81
+ `,is=e=>({before:e,matchPre:"",capture:"",matchPost:"",after:""}),as=({regex:o,value:n,onChange:i,minHeight:s=240,...c})=>{const d=l(null),p=l(null),u=a(()=>((e,t)=>{if(!e||!t)return is(t);let o;try{o=new RegExp(e)}catch{return is(t)}const n=o.exec(t);if(!n)return is(t);const i=n.index,a=n.index+n[0].length;if(n.length<2||null==n[1])return{before:t.slice(0,i),matchPre:"",capture:t.slice(i,a),matchPost:"",after:t.slice(a)};const l=n[0].indexOf(n[1]),r=l>=0?i+l:i,s=r+n[1].length;return{before:t.slice(0,i),matchPre:t.slice(i,r),capture:t.slice(r,s),matchPost:t.slice(s,a),after:t.slice(a)}})(o,n),[o,n]),h=r(()=>{d.current&&p.current&&(d.current.scrollTop=p.current.scrollTop,d.current.scrollLeft=p.current.scrollLeft)},[]);return e(ts,{$minHeight:s,children:[e(os,{ref:d,"aria-hidden":!0,children:[u.before,t("span",{style:{background:Qr},children:u.matchPre}),t("span",{style:{background:"rgba(102, 242, 102, 0.5)"},children:u.capture}),t("span",{style:{background:Qr},children:u.matchPost}),u.after,n.endsWith("\n")?" ":""]}),t(ns,{ref:p,$minHeight:s,value:n,onChange:e=>i(e.target.value),onScroll:h,spellCheck:!1,...c})]})},ls=b.div`
82
82
  flex: 1;
83
83
  min-height: 0;
84
84
  overflow-y: auto;
85
- `,ls=b.div`
85
+ `,rs=b.div`
86
86
  background: ${({theme:e})=>e.v2.colors.silver[900]};
87
87
  border-radius: 8px;
88
88
  padding: 8px;
89
89
  display: flex;
90
90
  flex-direction: column;
91
91
  gap: 12px;
92
- `,rs=b.div`
92
+ `,ss=b.div`
93
93
  padding: 8px 16px;
94
94
  border-radius: 8px;
95
95
  background: ${({theme:e})=>e.v2.colors.silver[800]};
@@ -100,7 +100,7 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import n,{useEff
100
100
  word-break: break-all;
101
101
  white-space: pre-wrap;
102
102
  user-select: text;
103
- `,ss=({isOpen:o,regex:n,onClose:i,initialTestString:l=""})=>{const[r,c]=s(l),d=a(()=>((e,t)=>{if(!e)return{ok:!0,isMatch:!1,message:de.RESULT_EMPTY_REGEX};if(!t)return{ok:!0,isMatch:!1,message:de.RESULT_EMPTY_INPUT};let o;try{o=new RegExp(e)}catch(e){return{ok:!1,message:e instanceof Error?e.message:de.RESULT_INVALID_REGEX_FALLBACK}}const n=o.exec(t);return n?{ok:!0,isMatch:!0,message:n.length>1?n[1]:n[0]}:{ok:!0,isMatch:!1,message:de.RESULT_NO_MATCH}})(n,r),[n,r]),u=d.ok?d.isMatch?"match":"neutral":"error";return t(ce,{isOpen:o,header:{title:de.TITLE,onClose:()=>{c(""),i()}},children:t(as,{children:e(ls,{children:[e(ee,{$gap:6,children:[t(te,{label:de.REGEX_LABEL}),t(Jr,{pattern:n,"data-id":"regex-tester-regex"}),!n&&t(ue,{size:he.XXS,color:pe.Secondary,children:de.REGEX_EMPTY_HINT})]}),e(ee,{$gap:6,children:[e(me,{$width:"100%",$justifyContent:"space-between",$alignItems:"center",children:[t(te,{label:de.TEST_STRING_LABEL}),t(ge,{"data-id":"regex-tester-unescape",label:de.UNESCAPE_LABEL,tooltip:de.UNESCAPE_TOOLTIP,variant:be.Secondary,size:fe.S,onClick:()=>c(e=>(e=>{let t="";for(let o=0;o<e.length;o++){if("\\"===e[o]&&o+1<e.length){const n=e[o+1],i="n"===n?"\n":"t"===n?"\t":"r"===n?"\r":'"'===n?'"':"'"===n?"'":"\\"===n?"\\":null;if(null!=i){t+=i,o++;continue}}t+=e[o]}return t})(e)),disabled:(p=r,!/\\["'\\nrt]/.test(p))})]}),t(is,{name:"regex-tester-test-string","data-id":"regex-tester-test-string",placeholder:de.TEST_STRING_PLACEHOLDER,regex:n,value:r,onChange:c,minHeight:240}),t(ne,{helpMessage:de.TEST_STRING_HELP})]}),e(ee,{$gap:8,children:[t(te,{label:de.RESULT_LABEL}),t(rs,{$tone:u,"data-id":"regex-tester-result",children:d.message}),d.ok&&d.isMatch&&t(ue,{size:he.XXS,color:pe.Secondary,children:de.RESULT_CAPTURE_HINT})]})]})})});var p},cs=Q.ExtractAttribute;var ds;(e=>{e.Preset="preset",e.Regex="regex"})(ds||(ds={}));const us=[Ce.JSON,Ce.SQL,Ce.ResourcePath],ps=(e=Ce.JSON)=>({targetAttributeName:"",lookupKey:"",dataFormat:e,regex:""}),hs=e=>!!e.regex&&!e.lookupKey&&!e.dataFormat,ms=b.div`
103
+ `,cs=({isOpen:o,regex:n,onClose:i,initialTestString:l=""})=>{const[r,c]=s(l),d=a(()=>((e,t)=>{if(!e)return{ok:!0,isMatch:!1,message:de.RESULT_EMPTY_REGEX};if(!t)return{ok:!0,isMatch:!1,message:de.RESULT_EMPTY_INPUT};let o;try{o=new RegExp(e)}catch(e){return{ok:!1,message:e instanceof Error?e.message:de.RESULT_INVALID_REGEX_FALLBACK}}const n=o.exec(t);return n?{ok:!0,isMatch:!0,message:n.length>1?n[1]:n[0]}:{ok:!0,isMatch:!1,message:de.RESULT_NO_MATCH}})(n,r),[n,r]),p=d.ok?d.isMatch?"match":"neutral":"error";return t(ce,{isOpen:o,header:{title:de.TITLE,onClose:()=>{c(""),i()}},children:t(ls,{children:e(rs,{children:[e(ee,{$gap:6,children:[t(te,{label:de.REGEX_LABEL}),t(Zr,{pattern:n,"data-id":"regex-tester-regex"}),!n&&t(pe,{size:he.XXS,color:ue.Secondary,children:de.REGEX_EMPTY_HINT})]}),e(ee,{$gap:6,children:[e(me,{$width:"100%",$justifyContent:"space-between",$alignItems:"center",children:[t(te,{label:de.TEST_STRING_LABEL}),t(ge,{"data-id":"regex-tester-unescape",label:de.UNESCAPE_LABEL,tooltip:de.UNESCAPE_TOOLTIP,variant:be.Secondary,size:fe.S,onClick:()=>c(e=>(e=>{let t="";for(let o=0;o<e.length;o++){if("\\"===e[o]&&o+1<e.length){const n=e[o+1],i="n"===n?"\n":"t"===n?"\t":"r"===n?"\r":'"'===n?'"':"'"===n?"'":"\\"===n?"\\":null;if(null!=i){t+=i,o++;continue}}t+=e[o]}return t})(e)),disabled:(u=r,!/\\["'\\nrt]/.test(u))})]}),t(as,{name:"regex-tester-test-string","data-id":"regex-tester-test-string",placeholder:de.TEST_STRING_PLACEHOLDER,regex:n,value:r,onChange:c,minHeight:240}),t(ne,{helpMessage:de.TEST_STRING_HELP})]}),e(ee,{$gap:8,children:[t(te,{label:de.RESULT_LABEL}),t(ss,{$tone:p,"data-id":"regex-tester-result",children:d.message}),d.ok&&d.isMatch&&t(pe,{size:he.XXS,color:ue.Secondary,children:de.RESULT_CAPTURE_HINT})]})]})})});var u},ds=Q.ExtractAttribute;var ps;(e=>{e.Preset="preset",e.Regex="regex"})(ps||(ps={}));const us=[Ce.JSON,Ce.SQL,Ce.ResourcePath],hs=(e=Ce.JSON)=>({targetAttributeName:"",lookupKey:"",dataFormat:e,regex:""}),ms=e=>!!e.regex&&!e.lookupKey&&!e.dataFormat,gs=b.div`
104
104
  width: 100%;
105
105
  background: ${({theme:e})=>e.v2.colors.silver[800]};
106
106
  border-radius: 8px;
@@ -108,13 +108,13 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import n,{useEff
108
108
  display: flex;
109
109
  flex-direction: column;
110
110
  gap: 8px;
111
- `,gs=b.div`
111
+ `,fs=b.div`
112
112
  flex: 1;
113
113
  min-width: 0;
114
- `,fs=b.div`
114
+ `,bs=b.div`
115
115
  /* Pushes the arrow down to sit next to the inputs rather than the field titles. */
116
116
  padding-top: 24px;
117
- `,bs=e=>Object.entries(e||{}).map(([e,t])=>({oldKey:e,newKey:t})),vs=e=>{const t={};return e.forEach(({oldKey:e,newKey:o})=>{t[e]=o}),t},ys=Q.UrlTemplatizationRulesGroups,Cs=[{keyName:"kind",label:"Kind",placeholder:"Any kind",componentType:"dropdown",options:[{id:"Deployment",label:"Deployment"},{id:"StatefulSet",label:"StatefulSet"},{id:"DaemonSet",label:"DaemonSet"}]},{keyName:"name",label:"Name",placeholder:"Any name"}],Ss=e=>{if(Array.isArray(e))return e.map(e=>"string"==typeof e?{id:e,label:e}:e)},xs=e=>{if(!Array.isArray(e)||e.length<3)return;const[t,o,n]=e;return e=>{const i=null==e?.[t]?"":String(e[t]);switch(o){case"=":case"==":case"===":return i===n;case"!=":case"!==":return i!==n;default:return!0}}},ws=e=>{if(Array.isArray(e))return e.map(e=>{const t=e;return{keyName:String(t.keyName??t.name??""),label:t.label??t.displayName,tooltip:t.tooltip,placeholder:t.placeholder,helpMessage:t.helpMessage,componentType:t.componentType,options:Ss(t.options??t.values),fullRow:t.fullRow,defaultValue:t.defaultValue,withRegexTester:t.withRegexTester,separator:t.separator,copyByColumn:t.copyByColumn,renderCondition:xs(t.renderCondition)}})},Ts=e=>{if(Array.isArray(e))return e.map(e=>{if("string"==typeof e)return{id:e,label:e};const t=e;return{id:String(t.id??t.keyName??t.name??""),label:t.label??t.displayName??String(t.id??""),tooltip:t.tooltip,fields:Array.isArray(t.fields)?t.fields.map(ks):void 0}})},ks=e=>{const t="string"==typeof e.componentProperties?Ne(e.componentProperties,{}):e.componentProps||{};return{name:e.name,componentType:e.componentType,inputType:e.inputType??t.inputType,title:e.displayName,tooltip:t.tooltip,placeholder:t.placeholder,helpMessage:t.helpMessage,required:t.required,initialValue:e.initialValue,renderCondition:e.renderCondition,options:Ss(t.options??t.values),itemWrapperKey:t.itemWrapperKey,columns:ws(t.columns),limitFieldsPerRow:t.limitFieldsPerRow,variant:t.variant,wrapKey:t.wrapKey,checkboxOptions:Ts(t.options??t.values),checkedValue:t.checkedValue??"true",valueMode:t.valueMode??"object",fields:Array.isArray(t.fields)?t.fields.map(ks):void 0,addLabel:t.addLabel,itemLabel:t.itemLabel,keyLabel:t.titleKey??t.keyLabel,valueLabel:t.titleValue??t.valueLabel}},Es=e=>"object"==typeof e&&null!==e&&!Array.isArray(e),Is=e=>Array.isArray(e)?e:[],Ns=e=>{const t={};return e.forEach(e=>{t[String(e.key??"")]=String(e.value??"")}),t},$s=e=>Es(e)?Object.entries(e).map(([e,t])=>({key:e,value:String(t??"")})):[],Os=({field:e,value:o,setValue:n,errorMessage:a,disabled:l})=>{const[r,c]=s(()=>$s(o));return i(()=>{const e=Es(o)?o:{};((e,t)=>{const o=Object.keys(e),n=Object.keys(t);return o.length===n.length&&o.every(o=>Object.prototype.hasOwnProperty.call(t,o)&&t[o]===e[o])})(Ns(r),e)||c($s(o))},[o]),t(ie,{name:e.name,label:e.title,tooltip:e.tooltip,helpMessage:e.helpMessage,required:e.required,disabled:l,limitFieldsPerRow:2,columns:[{keyName:"key",label:e.keyLabel||"Key",placeholder:e.keyLabel||"Key"},{keyName:"value",label:e.valueLabel||"Value",placeholder:e.valueLabel||"Value"}],values:r,setValues:e=>{c(e),n(Ns(e))},errorMessage:a})},As=({field:n,value:i,setValue:a,errorMessage:l,disabled:r})=>{const{name:c,componentType:d,inputType:u,title:p,tooltip:h,placeholder:m,helpMessage:g,required:f,initialValue:b,options:v,itemWrapperKey:y,columns:C,limitFieldsPerRow:S,variant:x,wrapKey:w,checkboxOptions:T}=n,[k,E]=s({open:!1,value:""});if(d===Ee.CheckboxList&&"array"===n.valueMode){const o=Is(i),n=(e,t)=>a(t?[...o.filter(t=>t!==e),e]:o.filter(t=>t!==e));return e(ee,{$gap:12,children:[p&&t(te,{label:p,tooltip:h,required:f}),t(ee,{$gap:8,children:(T||[]).map(e=>{const i=t(oe,{name:e.id,label:e.label,value:o.includes(e.id),disabled:r,onChange:t=>n(e.id,t)},e.id);return e.tooltip?t($e,{text:e.tooltip,withIcon:!0,children:i},e.id):i})}),t(ne,{errorMessage:l,helpMessage:g})]})}if(d===Ee.CheckboxList){const o=Es(i)?i:{},s=(e=>"emptyObject"!==e.checkedValue||{})(n),d=e=>"emptyObject"===n.checkedValue?Es(e):!!e;return e(ee,{$gap:12,children:[p&&t(ue,{size:he.XS,color:pe.Secondary,nowrap:!0,children:p}),t(ee,{$gap:12,children:(T||[]).map(n=>{const i=o[n.id],l=d(i),u=Es(i)?i:{},p=t(oe,{label:n.label,value:l,disabled:r,onChange:e=>a({...o,[n.id]:e?Es(i)?i:s:null})}),h=n.tooltip?t($e,{text:n.tooltip,withIcon:!0,children:p}):p,m=l&&n.fields?.length?t(ee,{$gap:12,$padding:"0 0 0 24px",children:n.fields.map(e=>t(As,{field:e,value:u[e.name],setValue:t=>a({...o,[n.id]:{...u,[e.name]:t}}),disabled:r},`${c}-${n.id}-${e.name}`))}):null;return e(ee,{$gap:12,children:[h,m]},n.id)})}),t(ne,{errorMessage:l,helpMessage:g})]})}if(d===Ee.MultiTabledInput){const n=Is(w?i?.[w]:i),s=e=>a(w?{...Es(i)?i:{},[w]:e}:e),d=(C||[]).some(e=>e.withRegexTester);return e(o,{children:[t("cards"===x?Oe:ie,{name:c,label:p,tooltip:h,helpMessage:g,required:f,disabled:r,columns:C||[],limitFieldsPerRow:S,values:n,setValues:s,errorMessage:l,onTestRegex:d?e=>E({open:!0,value:e}):void 0}),d&&t(ss,{isOpen:k.open,regex:k.value,onClose:()=>E({open:!1,value:""})})]})}if(d===Ee.MultiInput&&w){const e=Is(i?.[w]);return t(se,{name:c,label:p,tooltip:h,helpMessage:g,required:f,disabled:r,placeholder:m,values:e,setValues:e=>a({...Es(i)?i:{},[w]:e}),errorMessage:l})}if(d===Ee.MultiInput&&y){const e=Is(i).map(e=>String(e?.[y]??""));return t(se,{name:c,label:p,tooltip:h,helpMessage:g,required:f,disabled:r,placeholder:m,values:e,setValues:e=>a(e.map(e=>({[y]:e}))),errorMessage:l})}return d===Ee.KeyValuePair?t(Os,{field:n,value:i,setValue:a,errorMessage:l,disabled:r}):t(nr,{componentType:d,inputType:u,name:c,label:p,tooltip:h,helpMessage:g,disabled:r,required:f,placeholder:m,errorMessage:l,dropdownOptions:v,value:(null==i?b:i)??"",setValue:a})},Rs=({field:n,value:i,setValue:a,disabled:l})=>{const r=v(),s=Is(i),d=s.length?s:[{}],u=n.fields||[],p=e=>a(e);return e(o,{children:[d.map((o,i)=>e(c,{children:[t(ke,{}),e(ee,{$gap:12,children:[e(me,{$justifyContent:"space-between",$alignItems:"center",children:[t(te,{label:`${n.itemLabel||n.title||"Item"} ${i+1}`}),t(ge,{leftIcon:()=>t(Ea,{fill:r.v2.colors.red[500]}),variant:be.Secondary,size:fe.S,onClick:()=>(e=>{const t=d.filter((t,o)=>o!==e);p(t)})(i),disabled:l||1===d.length})]}),u.map(e=>t(As,{field:e,value:o[e.name],setValue:t=>((e,t,o)=>p(d.map((n,i)=>i===e?{...n,[t]:o}:n)))(i,e.name,t),disabled:l},`${n.name}-group-${i}-${e.name}`))]})]},`${n.name}-group-${i}`)),t(ge,{variant:be.Secondary,label:n.addLabel||"Add",leftIcon:Ia,onClick:()=>p([...d,{}]),disabled:l}),t(ke,{})]})},Ds=({field:o,value:n,setValue:i,errorMessage:a,disabled:l})=>e(ee,{$gap:12,children:[o.title&&t(te,{label:o.title,tooltip:o.tooltip,required:o.required}),t(ee,{$gap:8,children:(o.checkboxOptions||[]).map(e=>{const o=t(oe,{name:e.id,label:e.label,value:!0===n?.[e.id],disabled:l,onChange:t=>i(e.id,t)},e.id);return e.tooltip?t($e,{text:e.tooltip,withIcon:!0,children:o},e.id):o})}),t(ne,{errorMessage:a,helpMessage:o.helpMessage})]}),_s=({signals:e,fields:n,value:a,setValue:l,formErrors:r,disabled:s,seedInitialValues:c})=>{const d=(n||[]).filter(e=>!!e).map(e=>ks(e));return i(()=>{if(!c)return;const e=a||{},t={};d.forEach(o=>{const n=(e=>{const t=e.initialValue;if(void 0!==t&&""!==t)return e.componentType===Ee.CheckboxList?"array"===e.valueMode?Ne(t,[]):Ne(t,{}):e.componentType!==Ee.MultiInput&&e.componentType!==Ee.MultiTabledInput||!e.wrapKey?e.componentType===Ee.MultiInput||e.componentType===Ee.MultiTabledInput?Ne(t,[]):t:{[e.wrapKey]:Ne(t,[])}})(o);if(void 0===n)return;if(o.componentType===Ee.CheckboxList&&"flatFields"===o.valueMode&&Es(n))return void Object.entries(n).forEach(([o,n])=>{void 0!==e[o]&&null!==e[o]||(t[o]=n)});null==e[o.name]&&(t[o.name]=Es(n)&&Es(t[o.name])?{...t[o.name],...n}:n)}),Object.entries(t).forEach(([e,t])=>l(e,t))},[]),t(o,{children:d.map(o=>{const n=Object.entries(a||{}).map(([e,t])=>({name:e,value:t}));if(o.renderCondition&&!Ie(o.renderCondition,e,n))return null;const i=a?.[o.name];if(o.componentType===Ee.FieldGroup)return t(Rs,{field:o,value:i,setValue:e=>l(o.name,e),disabled:s},o.name);if(o.componentType===Ee.CheckboxList&&"flatFields"===o.valueMode){const e=o.checkboxOptions?.map(e=>r[e.id]).find(Boolean);return t(Ds,{field:o,value:a||{},setValue:l,errorMessage:e,disabled:s},o.name)}return t(As,{field:o,value:i,setValue:e=>l(o.name,e),errorMessage:r[o.name],disabled:s},o.name)})})},Ps={[Ae.K8sAttributes]:({value:n,setValue:a,formErrors:l})=>(i(()=>{n[Q.CollectContainerAttributes]||n[Q.CollectReplicaSetAttributes]||n[Q.CollectWorkloadId]||n[Q.CollectClusterId]||n[Q.LabelsAttributes]?.length||n[Q.AnnotationsAttributes]?.length||(a(Q.CollectContainerAttributes,!0),a(Q.CollectReplicaSetAttributes,!0),a(Q.CollectWorkloadId,!0),a(Q.CollectClusterId,!0),a(Q.LabelsAttributes,[]),a(Q.AnnotationsAttributes,[]))},[]),e(o,{children:[t(ee,{$gap:6,children:Xr.map(({id:o,label:i})=>e(ee,{children:[t(oe,{label:i,value:n[o]||!1,onChange:e=>a(o,e)}),t(ne,{errorMessage:l[o]})]},o))}),t(ie,{name:"labelsAttributes",label:"Label attributes",limitFieldsPerRow:2,columns:Vr,values:n[Q.LabelsAttributes]||[],setValues:e=>a(Q.LabelsAttributes,e),errorMessage:l[Q.LabelsAttributes]}),t(ie,{name:"annotationsAttributes",label:"Annotation attributes",limitFieldsPerRow:2,columns:Hr,values:n[Q.AnnotationsAttributes]||[],setValues:e=>a(Q.AnnotationsAttributes,e),errorMessage:l[Q.AnnotationsAttributes]})]})),[Ae.AddClusterInfo]:({value:n,setValue:i,formErrors:a})=>{const l=v();return e(o,{children:[t(le,{label:"Overwrite existing values",labelAlign:re.Left,labelColor:l.v2.colors.silver[200],tooltip:"If enabled, the resource attributes will overwrite any existing attributes with the same name.",value:n[Q.OverwriteExistingValues]||!1,onChange:e=>i(Q.OverwriteExistingValues,e)}),t(ie,{name:"clusterAttributes",label:"Resource attributes",limitFieldsPerRow:2,columns:[{keyName:"attributeName",label:"Attribute name",placeholder:"Attribute name"},{keyName:"attributeStringValue",label:"Attribute value",placeholder:"Attribute value"}],values:n[Q.ClusterAttributes]||[],setValues:e=>i(Q.ClusterAttributes,e),errorMessage:a[Q.ClusterAttributes]})]})},[Ae.DeleteAttributes]:({value:e,setValue:o,formErrors:n})=>t(se,{name:"attributeNamesToDelete",label:"Attributes to delete",values:e[Q.AttributeNamesToDelete]||[],setValues:e=>o(Q.AttributeNamesToDelete,e),errorMessage:n[Q.AttributeNamesToDelete]}),[Ae.RenameAttributes]:({value:e,setValue:o,formErrors:n})=>{const a=e[Q.Renames],[l,r]=s(()=>bs(a));return i(()=>{((e,t)=>{const o=Object.keys(e),n=Object.keys(t);return o.length===n.length&&o.every(o=>Object.prototype.hasOwnProperty.call(t,o)&&t[o]===e[o])})(vs(l),a||{})||r(bs(a))},[a]),t(ie,{name:"renames",label:"Attributes to rename",limitFieldsPerRow:2,columns:[{keyName:"oldKey",label:"Old key",placeholder:"Old key"},{keyName:"newKey",label:"New key",placeholder:"New key"}],values:l,setValues:e=>{const t=e.map(e=>({oldKey:String(e.oldKey??""),newKey:String(e.newKey??"")}));r(t),o(Q.Renames,vs(t))},errorMessage:n[Q.Renames]})},[Ae.PiiMasking]:({value:o,setValue:n,formErrors:a})=>(i(()=>{o[Q.PiiCategories]?.length||n(Q.PiiCategories,Br.map(({id:e})=>e))},[]),e(ee,{$gap:12,children:[t(te,{label:"Attributes to mask"}),t(ee,{$gap:6,children:Br.map(({id:e,label:i})=>t(oe,{label:i,value:o[Q.PiiCategories]?.includes(e)||!1,onChange:t=>{const i=o[Q.PiiCategories]||[],a=t?[...i,e]:i.filter(t=>t!==e);n(Q.PiiCategories,a)}},e))}),t(ne,{errorMessage:a[Q.PiiCategories]})]})),[Ae.URLTemplatization]:({value:n,setValue:i,formErrors:a})=>{const l=v(),r=n[ys]||[{filterK8sNamespace:"",workloadFilters:[],templatizationRules:[{template:""}],notes:""}],s=e=>i(ys,e),d=(e,t)=>s(r.map((o,n)=>n===e?{...o,...t}:o));return e(o,{children:[r.map((o,n)=>e(c,{children:[t(ke,{}),e(ee,{$gap:12,children:[e(me,{$justifyContent:"space-between",$alignItems:"center",children:[t(te,{label:`Rule Group ${n+1}`}),t(ge,{leftIcon:()=>t(Ea,{fill:l.v2.colors.red[500]}),variant:be.Secondary,size:fe.S,onClick:()=>{return e=n,s(r.filter((t,o)=>o!==e));var e},disabled:1===r.length})]}),t(Te,{name:`urlGroup-${n}-namespace`,label:"Namespace",placeholder:"All namespaces",tooltip:"Filter rules to a specific Kubernetes namespace.",value:o.filterK8sNamespace||"",onChange:e=>d(n,{filterK8sNamespace:e.target.value})}),t(ie,{name:`urlGroup-${n}-workloadFilters`,label:"Workload filters",tooltip:"Optionally scope templates to specific workloads.",columns:Cs,values:o.workloadFilters||[],setValues:e=>d(n,{workloadFilters:e})}),t(se,{name:`urlGroup-${n}-templates`,label:"Templates",required:!0,placeholder:"e.g. /user/{id}",values:o.templatizationRules.map(e=>e.template),setValues:e=>d(n,{templatizationRules:e.map(e=>({template:e}))})})]}),t(ne,{errorMessage:a[ys]})]},`url-templatization-group-${n}`)),t(ge,{variant:be.Secondary,label:"Add rule group",leftIcon:Ia,onClick:()=>s([...r,{filterK8sNamespace:"",workloadFilters:[],templatizationRules:[{template:""}],notes:""}])}),t(ke,{})]})},[Ae.ExtractAttribute]:({value:o,setValue:n,formErrors:a})=>{const l=v(),r=a[cs],c=o[cs]?.extractions||[],[d,u]=s(()=>(e=>e.length&&e.some(hs)?ds.Regex:ds.Preset)(c)),[p,h]=s(null),m=e=>n(cs,{extractions:e});i(()=>{0===c.length&&m([d===ds.Preset?ps():{targetAttributeName:"",lookupKey:"",dataFormat:"",regex:""}])},[]);const g=(e,t)=>{m(c.map((o,n)=>n===e?{...o,...t}:o))},f=()=>{m([...c,d===ds.Preset?ps():{targetAttributeName:"",lookupKey:"",dataFormat:"",regex:""}])},b=d===ds.Preset,y=c.length?c:[b?ps():{targetAttributeName:"",lookupKey:"",dataFormat:"",regex:""}],C=null!=p&&y[p]?.regex||"";return e(ee,{$gap:16,$width:"100%",children:[t(ve,{options:[{value:ds.Preset,label:ye.SEGMENT_PRESET_LABEL,tooltip:ye.SEGMENT_PRESET_TOOLTIP,selectedBgColor:l.v2.colors.purple[500]},{value:ds.Regex,label:ye.SEGMENT_REGEX_LABEL,tooltip:ye.SEGMENT_REGEX_TOOLTIP,selectedBgColor:l.v2.colors.purple[500]}],selected:d,setSelected:e=>{u(e),m([e===ds.Preset?ps():{targetAttributeName:"",lookupKey:"",dataFormat:"",regex:""}])}}),e(ee,{$gap:8,$width:"100%",children:[y.map((o,n)=>{const i=n===y.length-1,a=o.dataFormat||Ce.JSON,r=xe[a];return e(ms,{"data-id":`extract-row-${n}`,children:[e(me,{$gap:10,$alignItems:"flex-start",$width:"100%",$justifyContent:"space-between",children:[e(ee,{$gap:10,children:[t(te,{label:b?ye.PRESET_ROW_TITLE(n):ye.REGEX_ROW_TITLE(n)}),b&&t(me,{$gap:24,children:us.map(e=>t(Se,{"data-id":`extract-row-${n}-fmt-${e}`,size:we.L,label:xe[e].label,value:a===e,onChange:t=>t&&g(n,{dataFormat:e})},`extract-row-${n}-fmt-${e}`))})]}),e(me,{$gap:4,$alignItems:"center",children:[!b&&t(ge,{"data-id":`extract-row-${n}-test-regex`,label:ye.TEST_REGEX_LABEL,variant:be.Secondary,size:fe.S,onClick:()=>h(n),disabled:!o.regex?.trim()}),t(ge,{"data-id":`extract-row-${n}-delete`,leftIcon:()=>t(Ea,{fill:l.v2.colors.red[500]}),variant:be.Secondary,size:fe.S,onClick:()=>(e=>{const t=c.filter((t,o)=>o!==e);m(t.length?t:[d===ds.Preset?ps():{targetAttributeName:"",lookupKey:"",dataFormat:"",regex:""}])})(n)}),i&&t(ge,{"data-id":`extract-row-${n}-add`,leftIcon:Ia,variant:be.Secondary,size:fe.S,onClick:f})]})]}),b?e(me,{$gap:8,$alignItems:"flex-start",$width:"100%",children:[t(gs,{children:t(Te,{name:`extract-row-${n}-lookupKey`,label:r.keyLabel,placeholder:r.placeholder,helpMessage:r.helpMessage,width:"100%",value:o.lookupKey||"",onChange:e=>g(n,{lookupKey:e.target.value})})}),t(fs,{children:t(Na,{size:24,fill:l.v2.colors.silver[200]})}),t(gs,{children:t(Te,{name:`extract-row-${n}-targetAttributeName`,label:ye.TARGET_LABEL,placeholder:ye.TARGET_PLACEHOLDER,helpMessage:ye.TARGET_HELP,width:"100%",value:o.targetAttributeName||"",onChange:e=>g(n,{targetAttributeName:e.target.value})})})]}):e(ee,{$gap:12,$width:"100%",children:[t(Te,{name:`extract-row-${n}-regex`,label:ye.REGEX_LABEL,placeholder:ye.REGEX_PLACEHOLDER,helpMessage:ye.REGEX_HELP,width:"100%",value:o.regex||"",onChange:e=>g(n,{regex:e.target.value})}),t(Te,{name:`extract-row-${n}-targetAttributeName`,label:ye.TARGET_LABEL,placeholder:ye.TARGET_PLACEHOLDER,helpMessage:ye.TARGET_HELP,width:"100%",value:o.targetAttributeName||"",onChange:e=>g(n,{targetAttributeName:e.target.value})})]})]},`extract-row-${n}`)}),t(ne,{errorMessage:r})]}),t(ss,{isOpen:null!=p,regex:C,onClose:()=>h(null)})]})}},Ls=({actionType:e,value:o,setValue:n,formErrors:i,dynamicFields:a,signals:l})=>{if(!e)return null;if(a?.length)return t(_s,{fields:a,value:o,setValue:n,formErrors:i||{},signals:l||[],seedInitialValues:!0},e);const r=Ps[e];return r?t(r,{value:o,setValue:n,formErrors:i}):null},Fs=()=>{const o=v(),{selectedOption:n,genericForm:i}=_l();if(!i||!n)return t(Re,{title:"No active form"});const{formData:a,handleFormChange:l,formErrors:r}=i;return e(ee,{$gap:24,children:[e(me,{$gap:12,$justifyContent:"space-between",children:[t(De,{size:he.XXXS,maxLines:2,children:n.description}),e(me,{$gap:12,children:[t(ve,{options:[{icon:$a,label:"Enabled",value:!1,selectedBgColor:o.v2.colors.green[800]},{icon:Oa,label:"Disabled",value:!0,selectedBgColor:o.v2.colors.red[800]}],size:_e.S,selected:a.disabled,setSelected:e=>l("disabled",e)}),t(ge,{leftIcon:Aa,variant:be.Secondary,size:fe.S,onClick:()=>n.docsUrl&&window.open(n.docsUrl,"_blank","noopener noreferrer")})]})]}),t(ir,{title:"Signals for processing",allowedSignals:n.allowedSignals,selectedSignals:a.signals||[],setSelectedSignals:e=>l("signals",e),errorMessage:r.signals}),t(Te,{name:"actionName",label:"Action name",placeholder:"Use a name that describes the action...",value:a.name||"",onChange:({target:{value:e}})=>l("name",e),errorMessage:r.name}),t(Ls,{actionType:n.type,dynamicFields:n.fields,signals:a.signals||[],value:a.fields,setValue:(e,t)=>l(`fields.${e}`,t),formErrors:r}),t(Pe,{name:"notes",label:"Notes",placeholder:"Your personal notes...",value:a.notes||"",onChange:({target:{value:e}})=>l("notes",e),errorMessage:r.notes})]})},Ms=({signals:e,fields:o,disabled:n,formData:i,handleFormChange:a,formErrors:l})=>o?.map(({renderCondition:o,componentType:r,type:s,name:c,title:d,tooltip:u,placeholder:p,value:h,required:m,options:g})=>{if(o&&!Ie(o,e,i.fields))return null;const f=c,b=i.fields.find(e=>e.key===f),v=b?b.value:h;return t(nr,{componentType:r,inputType:s,name:f,label:d,tooltip:u,disabled:n,required:m,placeholder:p,errorMessage:l[f],dropdownOptions:g,value:v||"",setValue:e=>a(f,e)},f)}),zs=b(me)`
117
+ `,vs=e=>Object.entries(e||{}).map(([e,t])=>({oldKey:e,newKey:t})),ys=e=>{const t={};return e.forEach(({oldKey:e,newKey:o})=>{t[e]=o}),t},Cs=Q.UrlTemplatizationRulesGroups,Ss=[{keyName:"kind",label:"Kind",placeholder:"Any kind",componentType:"dropdown",options:[{id:"Deployment",label:"Deployment"},{id:"StatefulSet",label:"StatefulSet"},{id:"DaemonSet",label:"DaemonSet"}]},{keyName:"name",label:"Name",placeholder:"Any name"}],xs=e=>{if(Array.isArray(e))return e.map(e=>"string"==typeof e?{id:e,label:e}:e)},ws=e=>{if(!Array.isArray(e)||e.length<3)return;const[t,o,n]=e;return e=>{const i=null==e?.[t]?"":String(e[t]);switch(o){case"=":case"==":case"===":return i===n;case"!=":case"!==":return i!==n;default:return!0}}},Ts=e=>{if(Array.isArray(e))return e.map(e=>{const t=e;return{keyName:String(t.keyName??t.name??""),label:t.label??t.displayName,tooltip:t.tooltip,placeholder:t.placeholder,helpMessage:t.helpMessage,componentType:t.componentType,options:xs(t.options??t.values),fullRow:t.fullRow,defaultValue:t.defaultValue,withRegexTester:t.withRegexTester,separator:t.separator,copyByColumn:t.copyByColumn,renderCondition:ws(t.renderCondition)}})},ks=e=>{if(Array.isArray(e))return e.map(e=>{if("string"==typeof e)return{id:e,label:e};const t=e;return{id:String(t.id??t.keyName??t.name??""),label:t.label??t.displayName??String(t.id??""),tooltip:t.tooltip,fields:Array.isArray(t.fields)?t.fields.map(Es):void 0}})},Es=e=>{const t="string"==typeof e.componentProperties?Ne(e.componentProperties,{}):e.componentProps||{};return{name:e.name,componentType:e.componentType,inputType:e.inputType??t.inputType,title:e.displayName,tooltip:t.tooltip,placeholder:t.placeholder,helpMessage:t.helpMessage,required:t.required,initialValue:e.initialValue,renderCondition:e.renderCondition,options:xs(t.options??t.values),itemWrapperKey:t.itemWrapperKey,columns:Ts(t.columns),limitFieldsPerRow:t.limitFieldsPerRow,variant:t.variant,wrapKey:t.wrapKey,checkboxOptions:ks(t.options??t.values),checkedValue:t.checkedValue??"true",valueMode:t.valueMode??"object",fields:Array.isArray(t.fields)?t.fields.map(Es):void 0,addLabel:t.addLabel,itemLabel:t.itemLabel,keyLabel:t.titleKey??t.keyLabel,valueLabel:t.titleValue??t.valueLabel}},Is=e=>"object"==typeof e&&null!==e&&!Array.isArray(e),Ns=e=>Array.isArray(e)?e:[],$s=e=>{const t={};return e.forEach(e=>{t[String(e.key??"")]=String(e.value??"")}),t},Os=e=>Is(e)?Object.entries(e).map(([e,t])=>({key:e,value:String(t??"")})):[],As=({field:e,value:o,setValue:n,errorMessage:a,disabled:l})=>{const[r,c]=s(()=>Os(o));return i(()=>{const e=Is(o)?o:{};((e,t)=>{const o=Object.keys(e),n=Object.keys(t);return o.length===n.length&&o.every(o=>Object.prototype.hasOwnProperty.call(t,o)&&t[o]===e[o])})($s(r),e)||c(Os(o))},[o]),t(ie,{name:e.name,label:e.title,tooltip:e.tooltip,helpMessage:e.helpMessage,required:e.required,disabled:l,limitFieldsPerRow:2,columns:[{keyName:"key",label:e.keyLabel||"Key",placeholder:e.keyLabel||"Key"},{keyName:"value",label:e.valueLabel||"Value",placeholder:e.valueLabel||"Value"}],values:r,setValues:e=>{c(e),n($s(e))},errorMessage:a})},Rs=({field:n,value:i,setValue:a,errorMessage:l,disabled:r})=>{const{name:c,componentType:d,inputType:p,title:u,tooltip:h,placeholder:m,helpMessage:g,required:f,initialValue:b,options:v,itemWrapperKey:y,columns:C,limitFieldsPerRow:S,variant:x,wrapKey:w,checkboxOptions:T}=n,[k,E]=s({open:!1,value:""});if(d===Ee.CheckboxList&&"array"===n.valueMode){const o=Ns(i),n=(e,t)=>a(t?[...o.filter(t=>t!==e),e]:o.filter(t=>t!==e));return e(ee,{$gap:12,children:[u&&t(te,{label:u,tooltip:h,required:f}),t(ee,{$gap:8,children:(T||[]).map(e=>{const i=t(oe,{name:e.id,label:e.label,value:o.includes(e.id),disabled:r,onChange:t=>n(e.id,t)},e.id);return e.tooltip?t($e,{text:e.tooltip,withIcon:!0,children:i},e.id):i})}),t(ne,{errorMessage:l,helpMessage:g})]})}if(d===Ee.CheckboxList){const o=Is(i)?i:{},s=(e=>"emptyObject"!==e.checkedValue||{})(n),d=e=>"emptyObject"===n.checkedValue?Is(e):!!e;return e(ee,{$gap:12,children:[u&&t(pe,{size:he.XS,color:ue.Secondary,nowrap:!0,children:u}),t(ee,{$gap:12,children:(T||[]).map(n=>{const i=o[n.id],l=d(i),p=Is(i)?i:{},u=t(oe,{label:n.label,value:l,disabled:r,onChange:e=>a({...o,[n.id]:e?Is(i)?i:s:null})}),h=n.tooltip?t($e,{text:n.tooltip,withIcon:!0,children:u}):u,m=l&&n.fields?.length?t(ee,{$gap:12,$padding:"0 0 0 24px",children:n.fields.map(e=>t(Rs,{field:e,value:p[e.name],setValue:t=>a({...o,[n.id]:{...p,[e.name]:t}}),disabled:r},`${c}-${n.id}-${e.name}`))}):null;return e(ee,{$gap:12,children:[h,m]},n.id)})}),t(ne,{errorMessage:l,helpMessage:g})]})}if(d===Ee.MultiTabledInput){const n=Ns(w?i?.[w]:i),s=e=>a(w?{...Is(i)?i:{},[w]:e}:e),d=(C||[]).some(e=>e.withRegexTester);return e(o,{children:[t("cards"===x?Oe:ie,{name:c,label:u,tooltip:h,helpMessage:g,required:f,disabled:r,columns:C||[],limitFieldsPerRow:S,values:n,setValues:s,errorMessage:l,onTestRegex:d?e=>E({open:!0,value:e}):void 0}),d&&t(cs,{isOpen:k.open,regex:k.value,onClose:()=>E({open:!1,value:""})})]})}if(d===Ee.MultiInput&&w){const e=Ns(i?.[w]);return t(se,{name:c,label:u,tooltip:h,helpMessage:g,required:f,disabled:r,placeholder:m,values:e,setValues:e=>a({...Is(i)?i:{},[w]:e}),errorMessage:l})}if(d===Ee.MultiInput&&y){const e=Ns(i).map(e=>String(e?.[y]??""));return t(se,{name:c,label:u,tooltip:h,helpMessage:g,required:f,disabled:r,placeholder:m,values:e,setValues:e=>a(e.map(e=>({[y]:e}))),errorMessage:l})}return d===Ee.KeyValuePair?t(As,{field:n,value:i,setValue:a,errorMessage:l,disabled:r}):t(ir,{componentType:d,inputType:p,name:c,label:u,tooltip:h,helpMessage:g,disabled:r,required:f,placeholder:m,errorMessage:l,dropdownOptions:v,value:(null==i?b:i)??"",setValue:a})},Ds=({field:n,value:i,setValue:a,disabled:l})=>{const r=v(),s=Ns(i),d=s.length?s:[{}],p=n.fields||[],u=e=>a(e);return e(o,{children:[d.map((o,i)=>e(c,{children:[t(ke,{}),e(ee,{$gap:12,children:[e(me,{$justifyContent:"space-between",$alignItems:"center",children:[t(te,{label:`${n.itemLabel||n.title||"Item"} ${i+1}`}),t(ge,{leftIcon:()=>t(Ia,{fill:r.v2.colors.red[500]}),variant:be.Secondary,size:fe.S,onClick:()=>(e=>{const t=d.filter((t,o)=>o!==e);u(t)})(i),disabled:l||1===d.length})]}),p.map(e=>t(Rs,{field:e,value:o[e.name],setValue:t=>((e,t,o)=>u(d.map((n,i)=>i===e?{...n,[t]:o}:n)))(i,e.name,t),disabled:l},`${n.name}-group-${i}-${e.name}`))]})]},`${n.name}-group-${i}`)),t(ge,{variant:be.Secondary,label:n.addLabel||"Add",leftIcon:Na,onClick:()=>u([...d,{}]),disabled:l}),t(ke,{})]})},_s=({field:o,value:n,setValue:i,errorMessage:a,disabled:l})=>e(ee,{$gap:12,children:[o.title&&t(te,{label:o.title,tooltip:o.tooltip,required:o.required}),t(ee,{$gap:8,children:(o.checkboxOptions||[]).map(e=>{const o=t(oe,{name:e.id,label:e.label,value:!0===n?.[e.id],disabled:l,onChange:t=>i(e.id,t)},e.id);return e.tooltip?t($e,{text:e.tooltip,withIcon:!0,children:o},e.id):o})}),t(ne,{errorMessage:a,helpMessage:o.helpMessage})]}),Ps=({signals:e,fields:n,value:a,setValue:l,formErrors:r,disabled:s,seedInitialValues:c})=>{const d=(n||[]).filter(e=>!!e).map(e=>Es(e));return i(()=>{if(!c)return;const e=a||{},t={};d.forEach(o=>{const n=(e=>{const t=e.initialValue;if(void 0!==t&&""!==t)return e.componentType===Ee.CheckboxList?"array"===e.valueMode?Ne(t,[]):Ne(t,{}):e.componentType!==Ee.MultiInput&&e.componentType!==Ee.MultiTabledInput||!e.wrapKey?e.componentType===Ee.MultiInput||e.componentType===Ee.MultiTabledInput?Ne(t,[]):t:{[e.wrapKey]:Ne(t,[])}})(o);if(void 0===n)return;if(o.componentType===Ee.CheckboxList&&"flatFields"===o.valueMode&&Is(n))return void Object.entries(n).forEach(([o,n])=>{void 0!==e[o]&&null!==e[o]||(t[o]=n)});null==e[o.name]&&(t[o.name]=Is(n)&&Is(t[o.name])?{...t[o.name],...n}:n)}),Object.entries(t).forEach(([e,t])=>l(e,t))},[]),t(o,{children:d.map(o=>{const n=Object.entries(a||{}).map(([e,t])=>({name:e,value:t}));if(o.renderCondition&&!Ie(o.renderCondition,e,n))return null;const i=a?.[o.name];if(o.componentType===Ee.FieldGroup)return t(Ds,{field:o,value:i,setValue:e=>l(o.name,e),disabled:s},o.name);if(o.componentType===Ee.CheckboxList&&"flatFields"===o.valueMode){const e=o.checkboxOptions?.map(e=>r[e.id]).find(Boolean);return t(_s,{field:o,value:a||{},setValue:l,errorMessage:e,disabled:s},o.name)}return t(Rs,{field:o,value:i,setValue:e=>l(o.name,e),errorMessage:r[o.name],disabled:s},o.name)})})},Ls={[Ae.K8sAttributes]:({value:n,setValue:a,formErrors:l})=>(i(()=>{n[Q.CollectContainerAttributes]||n[Q.CollectReplicaSetAttributes]||n[Q.CollectWorkloadId]||n[Q.CollectClusterId]||n[Q.LabelsAttributes]?.length||n[Q.AnnotationsAttributes]?.length||(a(Q.CollectContainerAttributes,!0),a(Q.CollectReplicaSetAttributes,!0),a(Q.CollectWorkloadId,!0),a(Q.CollectClusterId,!0),a(Q.LabelsAttributes,[]),a(Q.AnnotationsAttributes,[]))},[]),e(o,{children:[t(ee,{$gap:6,children:Ur.map(({id:o,label:i})=>e(ee,{children:[t(oe,{label:i,value:n[o]||!1,onChange:e=>a(o,e)}),t(ne,{errorMessage:l[o]})]},o))}),t(ie,{name:"labelsAttributes",label:"Label attributes",limitFieldsPerRow:2,columns:Hr,values:n[Q.LabelsAttributes]||[],setValues:e=>a(Q.LabelsAttributes,e),errorMessage:l[Q.LabelsAttributes]}),t(ie,{name:"annotationsAttributes",label:"Annotation attributes",limitFieldsPerRow:2,columns:jr,values:n[Q.AnnotationsAttributes]||[],setValues:e=>a(Q.AnnotationsAttributes,e),errorMessage:l[Q.AnnotationsAttributes]})]})),[Ae.AddClusterInfo]:({value:n,setValue:i,formErrors:a})=>{const l=v();return e(o,{children:[t(le,{label:"Overwrite existing values",labelAlign:re.Left,labelColor:l.v2.colors.silver[200],tooltip:"If enabled, the resource attributes will overwrite any existing attributes with the same name.",value:n[Q.OverwriteExistingValues]||!1,onChange:e=>i(Q.OverwriteExistingValues,e)}),t(ie,{name:"clusterAttributes",label:"Resource attributes",limitFieldsPerRow:2,columns:[{keyName:"attributeName",label:"Attribute name",placeholder:"Attribute name"},{keyName:"attributeStringValue",label:"Attribute value",placeholder:"Attribute value"}],values:n[Q.ClusterAttributes]||[],setValues:e=>i(Q.ClusterAttributes,e),errorMessage:a[Q.ClusterAttributes]})]})},[Ae.DeleteAttributes]:({value:e,setValue:o,formErrors:n})=>t(se,{name:"attributeNamesToDelete",label:"Attributes to delete",values:e[Q.AttributeNamesToDelete]||[],setValues:e=>o(Q.AttributeNamesToDelete,e),errorMessage:n[Q.AttributeNamesToDelete]}),[Ae.RenameAttributes]:({value:e,setValue:o,formErrors:n})=>{const a=e[Q.Renames],[l,r]=s(()=>vs(a));return i(()=>{((e,t)=>{const o=Object.keys(e),n=Object.keys(t);return o.length===n.length&&o.every(o=>Object.prototype.hasOwnProperty.call(t,o)&&t[o]===e[o])})(ys(l),a||{})||r(vs(a))},[a]),t(ie,{name:"renames",label:"Attributes to rename",limitFieldsPerRow:2,columns:[{keyName:"oldKey",label:"Old key",placeholder:"Old key"},{keyName:"newKey",label:"New key",placeholder:"New key"}],values:l,setValues:e=>{const t=e.map(e=>({oldKey:String(e.oldKey??""),newKey:String(e.newKey??"")}));r(t),o(Q.Renames,ys(t))},errorMessage:n[Q.Renames]})},[Ae.PiiMasking]:({value:o,setValue:n,formErrors:a})=>(i(()=>{o[Q.PiiCategories]?.length||n(Q.PiiCategories,Xr.map(({id:e})=>e))},[]),e(ee,{$gap:12,children:[t(te,{label:"Attributes to mask"}),t(ee,{$gap:6,children:Xr.map(({id:e,label:i})=>t(oe,{label:i,value:o[Q.PiiCategories]?.includes(e)||!1,onChange:t=>{const i=o[Q.PiiCategories]||[],a=t?[...i,e]:i.filter(t=>t!==e);n(Q.PiiCategories,a)}},e))}),t(ne,{errorMessage:a[Q.PiiCategories]})]})),[Ae.URLTemplatization]:({value:n,setValue:i,formErrors:a})=>{const l=v(),r=n[Cs]||[{filterK8sNamespace:"",workloadFilters:[],templatizationRules:[{template:""}],notes:""}],s=e=>i(Cs,e),d=(e,t)=>s(r.map((o,n)=>n===e?{...o,...t}:o));return e(o,{children:[r.map((o,n)=>e(c,{children:[t(ke,{}),e(ee,{$gap:12,children:[e(me,{$justifyContent:"space-between",$alignItems:"center",children:[t(te,{label:`Rule Group ${n+1}`}),t(ge,{leftIcon:()=>t(Ia,{fill:l.v2.colors.red[500]}),variant:be.Secondary,size:fe.S,onClick:()=>{return e=n,s(r.filter((t,o)=>o!==e));var e},disabled:1===r.length})]}),t(Te,{name:`urlGroup-${n}-namespace`,label:"Namespace",placeholder:"All namespaces",tooltip:"Filter rules to a specific Kubernetes namespace.",value:o.filterK8sNamespace||"",onChange:e=>d(n,{filterK8sNamespace:e.target.value})}),t(ie,{name:`urlGroup-${n}-workloadFilters`,label:"Workload filters",tooltip:"Optionally scope templates to specific workloads.",columns:Ss,values:o.workloadFilters||[],setValues:e=>d(n,{workloadFilters:e})}),t(se,{name:`urlGroup-${n}-templates`,label:"Templates",required:!0,placeholder:"e.g. /user/{id}",values:o.templatizationRules.map(e=>e.template),setValues:e=>d(n,{templatizationRules:e.map(e=>({template:e}))})})]}),t(ne,{errorMessage:a[Cs]})]},`url-templatization-group-${n}`)),t(ge,{variant:be.Secondary,label:"Add rule group",leftIcon:Na,onClick:()=>s([...r,{filterK8sNamespace:"",workloadFilters:[],templatizationRules:[{template:""}],notes:""}])}),t(ke,{})]})},[Ae.ExtractAttribute]:({value:o,setValue:n,formErrors:a})=>{const l=v(),r=a[ds],c=o[ds]?.extractions||[],[d,p]=s(()=>(e=>e.length&&e.some(ms)?ps.Regex:ps.Preset)(c)),[u,h]=s(null),m=e=>n(ds,{extractions:e});i(()=>{0===c.length&&m([d===ps.Preset?hs():{targetAttributeName:"",lookupKey:"",dataFormat:"",regex:""}])},[]);const g=(e,t)=>{m(c.map((o,n)=>n===e?{...o,...t}:o))},f=()=>{m([...c,d===ps.Preset?hs():{targetAttributeName:"",lookupKey:"",dataFormat:"",regex:""}])},b=d===ps.Preset,y=c.length?c:[b?hs():{targetAttributeName:"",lookupKey:"",dataFormat:"",regex:""}],C=null!=u&&y[u]?.regex||"";return e(ee,{$gap:16,$width:"100%",children:[t(ve,{options:[{value:ps.Preset,label:ye.SEGMENT_PRESET_LABEL,tooltip:ye.SEGMENT_PRESET_TOOLTIP,selectedBgColor:l.v2.colors.purple[500]},{value:ps.Regex,label:ye.SEGMENT_REGEX_LABEL,tooltip:ye.SEGMENT_REGEX_TOOLTIP,selectedBgColor:l.v2.colors.purple[500]}],selected:d,setSelected:e=>{p(e),m([e===ps.Preset?hs():{targetAttributeName:"",lookupKey:"",dataFormat:"",regex:""}])}}),e(ee,{$gap:8,$width:"100%",children:[y.map((o,n)=>{const i=n===y.length-1,a=o.dataFormat||Ce.JSON,r=xe[a];return e(gs,{"data-id":`extract-row-${n}`,children:[e(me,{$gap:10,$alignItems:"flex-start",$width:"100%",$justifyContent:"space-between",children:[e(ee,{$gap:10,children:[t(te,{label:b?ye.PRESET_ROW_TITLE(n):ye.REGEX_ROW_TITLE(n)}),b&&t(me,{$gap:24,children:us.map(e=>t(Se,{"data-id":`extract-row-${n}-fmt-${e}`,size:we.L,label:xe[e].label,value:a===e,onChange:t=>t&&g(n,{dataFormat:e})},`extract-row-${n}-fmt-${e}`))})]}),e(me,{$gap:4,$alignItems:"center",children:[!b&&t(ge,{"data-id":`extract-row-${n}-test-regex`,label:ye.TEST_REGEX_LABEL,variant:be.Secondary,size:fe.S,onClick:()=>h(n),disabled:!o.regex?.trim()}),t(ge,{"data-id":`extract-row-${n}-delete`,leftIcon:()=>t(Ia,{fill:l.v2.colors.red[500]}),variant:be.Secondary,size:fe.S,onClick:()=>(e=>{const t=c.filter((t,o)=>o!==e);m(t.length?t:[d===ps.Preset?hs():{targetAttributeName:"",lookupKey:"",dataFormat:"",regex:""}])})(n)}),i&&t(ge,{"data-id":`extract-row-${n}-add`,leftIcon:Na,variant:be.Secondary,size:fe.S,onClick:f})]})]}),b?e(me,{$gap:8,$alignItems:"flex-start",$width:"100%",children:[t(fs,{children:t(Te,{name:`extract-row-${n}-lookupKey`,label:r.keyLabel,placeholder:r.placeholder,helpMessage:r.helpMessage,width:"100%",value:o.lookupKey||"",onChange:e=>g(n,{lookupKey:e.target.value})})}),t(bs,{children:t($a,{size:24,fill:l.v2.colors.silver[200]})}),t(fs,{children:t(Te,{name:`extract-row-${n}-targetAttributeName`,label:ye.TARGET_LABEL,placeholder:ye.TARGET_PLACEHOLDER,helpMessage:ye.TARGET_HELP,width:"100%",value:o.targetAttributeName||"",onChange:e=>g(n,{targetAttributeName:e.target.value})})})]}):e(ee,{$gap:12,$width:"100%",children:[t(Te,{name:`extract-row-${n}-regex`,label:ye.REGEX_LABEL,placeholder:ye.REGEX_PLACEHOLDER,helpMessage:ye.REGEX_HELP,width:"100%",value:o.regex||"",onChange:e=>g(n,{regex:e.target.value})}),t(Te,{name:`extract-row-${n}-targetAttributeName`,label:ye.TARGET_LABEL,placeholder:ye.TARGET_PLACEHOLDER,helpMessage:ye.TARGET_HELP,width:"100%",value:o.targetAttributeName||"",onChange:e=>g(n,{targetAttributeName:e.target.value})})]})]},`extract-row-${n}`)}),t(ne,{errorMessage:r})]}),t(cs,{isOpen:null!=u,regex:C,onClose:()=>h(null)})]})}},Fs=({actionType:e,value:o,setValue:n,formErrors:i,dynamicFields:a,signals:l})=>{if(!e)return null;if(a?.length)return t(Ps,{fields:a,value:o,setValue:n,formErrors:i||{},signals:l||[],seedInitialValues:!0},e);const r=Ls[e];return r?t(r,{value:o,setValue:n,formErrors:i}):null},Ms=()=>{const o=v(),{selectedOption:n,genericForm:i}=Pl();if(!i||!n)return t(Re,{title:"No active form"});const{formData:a,handleFormChange:l,formErrors:r}=i;return e(ee,{$gap:24,children:[e(me,{$gap:12,$justifyContent:"space-between",children:[t(De,{size:he.XXXS,maxLines:2,children:n.description}),e(me,{$gap:12,children:[t(ve,{options:[{icon:Oa,label:"Enabled",value:!1,selectedBgColor:o.v2.colors.green[800]},{icon:Aa,label:"Disabled",value:!0,selectedBgColor:o.v2.colors.red[800]}],size:_e.S,selected:a.disabled,setSelected:e=>l("disabled",e)}),t(ge,{leftIcon:Ra,variant:be.Secondary,size:fe.S,onClick:()=>n.docsUrl&&window.open(n.docsUrl,"_blank","noopener noreferrer")})]})]}),t(ar,{title:"Signals for processing",allowedSignals:n.allowedSignals,selectedSignals:a.signals||[],setSelectedSignals:e=>l("signals",e),errorMessage:r.signals}),t(Te,{name:"actionName",label:"Action name",placeholder:"Use a name that describes the action...",value:a.name||"",onChange:({target:{value:e}})=>l("name",e),errorMessage:r.name}),t(Fs,{actionType:n.type,dynamicFields:n.fields,signals:a.signals||[],value:a.fields,setValue:(e,t)=>l(`fields.${e}`,t),formErrors:r}),t(Pe,{name:"notes",label:"Notes",placeholder:"Your personal notes...",value:a.notes||"",onChange:({target:{value:e}})=>l("notes",e),errorMessage:r.notes})]})},zs=({signals:e,fields:o,disabled:n,formData:i,handleFormChange:a,formErrors:l})=>o?.map(({renderCondition:o,componentType:r,type:s,name:c,title:d,tooltip:p,placeholder:u,value:h,required:m,options:g})=>{if(o&&!Ie(o,e,i.fields))return null;const f=c,b=i.fields.find(e=>e.key===f),v=b?b.value:h;return t(ir,{componentType:r,inputType:s,name:f,label:d,tooltip:p,disabled:n,required:m,placeholder:u,errorMessage:l[f],dropdownOptions:g,value:v||"",setValue:e=>a(f,e)},f)}),Bs=b(me)`
118
118
  position: sticky;
119
119
  bottom: 4px;
120
120
  align-self: center;
@@ -125,17 +125,17 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import n,{useEff
125
125
  background-color: ${({theme:e})=>e.v2.colors.black[500]};
126
126
  box-shadow: 0 4px 16.7px 0 rgba(0, 0, 0, 0.83);
127
127
  z-index: 1;
128
- `,Bs=d(({isEdit:o},n)=>{const a=v(),{isVm:l}=S(),{destinationsApi:r}=Pl(),{activeForm:c,genericForm:d,validateFormData:p,thisUnsavedDestination:h,addUnsavedDestination:m,updateUnsavedDestination:g,deleteUnsavedDestination:f}=Ll(),[b,y]=s(h?.testResult),[C,x]=s(!!h);i(()=>{h?(y(h.testResult),x(!0)):(y(void 0),x(!1))},[h]);const w=async()=>{if(!c?.option.testConnectionSupported||!d||l)return;const e=await r.testConnection(Ue(d.formData));return y(e),e};return u(n,()=>({testConnection:w,testConnectionSupported:!!c?.option.testConnectionSupported}),[c?.option.testConnectionSupported,d,r]),d&&c?e(ee,{$gap:24,style:{minHeight:"100%"},children:[e(me,{$gap:12,$justifyContent:"space-between",children:[b?b.succeeded?t(Le,{status:Fe.Success,message:b.message||"Connection OK",fullWidth:!0,smallIcon:!0}):t(Le,{status:Fe.Error,message:b.message||"Connection Failed",fullWidth:!0,smallIcon:!0}):t("div",{}),e(me,{$gap:12,children:[!l&&t(ve,{options:[{icon:$a,label:"Enabled",value:!1,selectedBgColor:a.v2.colors.green[800]},{icon:Oa,label:"Disabled",value:!0,selectedBgColor:a.v2.colors.red[800]}],size:_e.S,selected:d.formData.disabled,setSelected:e=>d.handleFormChange("disabled",e),disabled:C}),t(ge,{"data-id":"dest-form-docs",leftIcon:Aa,variant:be.Secondary,size:fe.S,onClick:()=>window.open(`${Me}/backends/${c.option.type}`,"_blank","noopener noreferrer")})]})]}),t(ir,{title:"This connection will monitor:",allowedSignals:Xe(c.option.supportedSignals),selectedSignals:Be(d.formData.exportedSignals),setSelectedSignals:e=>d.handleFormChange("exportedSignals",{logs:e.includes(ze.Logs),metrics:e.includes(ze.Metrics),traces:e.includes(ze.Traces),profiles:e.includes(ze.Profiles)}),disabled:C,errorMessage:d.formErrors.exportedSignals}),t(Te,{name:"destinationName",label:"Destination name",placeholder:"Use a name that describes the destination...",value:d.formData.name,onChange:({target:{value:e}})=>d.handleFormChange("name",e),disabled:C,errorMessage:d.formErrors.name}),t(Ms,{signals:Be(d.formData.exportedSignals),fields:c.dynamicFields,disabled:C,formData:d.formData,handleFormChange:(e,t)=>{d.handleFormChange("fields",d.formData.fields.map(o=>o.key===e?{...o,value:t}:o)),e&&d.formErrors[e]&&d.handleErrorChange(e,void 0)},formErrors:d.formErrors}),!o&&e(zs,{$gap:8,$justifyContent:"center",children:[h&&t("div",{style:{width:"150px"},children:t(ge,{"data-id":"dest-form-delete",fullWidth:!0,label:"Delete",rightIcon:Ra,variant:be.Secondary,textColor:a.v2.colors.red[500],onClick:()=>f(c.unsavedIdx)})}),!l&&(!h||h.option.testConnectionSupported&&!C)&&t("div",{style:{width:"150px"},children:t(ge,{"data-id":"dest-form-test-connection",fullWidth:!0,label:"Test Connection",variant:be.Secondary,onClick:w})}),h&&t("div",C?{style:{width:"150px"},children:t(ge,{"data-id":"dest-form-edit",fullWidth:!0,label:"Edit",rightIcon:Da,variant:be.Secondary,onClick:()=>x(!1)})}:{style:{width:"150px"},children:t(ge,{"data-id":"dest-form-save",fullWidth:!0,label:"Save Changes",variant:be.Primary,onClick:async()=>{const{errorMessage:e,preparedFormData:t}=p();if(!e){const e=await w(),o=!!e&&!e.succeeded;g(c.unsavedIdx,{formData:t,testResult:e},o)}}})}),!h&&t("div",{style:{width:"150px"},children:t(ge,{"data-id":"dest-form-add",fullWidth:!0,label:"Add Destination",variant:be.Primary,onClick:async()=>{const{errorMessage:e,preparedFormData:t}=p();if(!e){const e=await w(),o=!!e&&!e.succeeded;m({formData:t,testResult:e},o)}}})})]})]}):t(Re,{title:"No active form"})});Bs.displayName="AddDestinationForm";const Xs=[{id:Ve.FilePath,label:"Collect file path",tooltip:"Indicates whether to record the `code.filepath` attribute."},{id:Ve.Function,label:"Collect function",tooltip:"Indicates whether to record the `code.function` attribute."},{id:Ve.LineNumber,label:"Collect line number",tooltip:"Indicates whether to record the `code.lineno` attribute."}],Us=[{id:Ve.Column,label:"Collect column",tooltip:"Indicates whether to record the `code.column` attribute."},{id:Ve.Namespace,label:"Collect namespace",tooltip:"Indicates whether to record the `code.namespace` attribute."},{id:Ve.StackTrace,label:"Collect stacktrace",tooltip:"Indicates whether to record the `code.stacktrace` attribute."}],Vs=["*"],Hs=[{id:je.HttpRequest,label:"Collect HTTP request",tooltip:""},{id:je.HttpResponse,label:"Collect HTTP response",tooltip:""},{id:je.DbQuery,label:"Collect DB query",tooltip:""},{id:je.Messaging,label:"Collect messaging",tooltip:""}],js={[Ke.Java]:[new We("","")],[Ke.Golang]:[new Ge("")]},Gs={[Ye.CodeAttributes]:({value:n,setValue:l,formErrors:r})=>{const s=r.codeAttributes,c=a(()=>Object.entries(n.codeAttributes||{}).filter(([e,t])=>!!t).map(([e])=>e),[n]);i(()=>{if(!c.length&&!s){const e={[Ve.FilePath]:!0,[Ve.Function]:!0,[Ve.LineNumber]:!0,[Ve.Column]:null,[Ve.Namespace]:null,[Ve.StackTrace]:null};l("codeAttributes",e)}},[]);const d=(e,t)=>{const o=t?[...c,e]:c.filter(t=>t!==e),n=Object.values(Ve).reduce((e,t)=>(e[t]=!!o.includes(t)||null,e),{});l("codeAttributes",n)};return e(o,{children:[e(ee,{$gap:12,children:[t(ue,{size:he.XS,color:pe.Secondary,nowrap:!0,children:"Recommended data to collect"}),t(ee,{$gap:6,children:Xs.map(({id:e,label:o,tooltip:n})=>t($e,{text:n,withIcon:!0,children:t(oe,{label:o,value:c.includes(e),onChange:t=>d(e,t)})},e))}),t(ne,{errorMessage:s})]}),e(ee,{$gap:12,children:[t(ue,{size:he.XS,color:pe.Secondary,nowrap:!0,children:"Verbose data to collect"}),t(ee,{$gap:6,children:Us.map(({id:e,label:o,tooltip:n})=>t($e,{text:n,withIcon:!0,children:t(oe,{label:o,value:c.includes(e),onChange:t=>d(e,t)})},e))}),t(ne,{errorMessage:s})]})]})},[Ye.CustomInstrumentation]:({value:n,setValue:l,formErrors:r})=>{const s=r.customInstrumentations,c=a(()=>(n?.customInstrumentations?.[Ke.Golang]||[]).map(e=>new Ge(e.packageName,e.functionName,e.receiverName,e.receiverMethodName)),[n]),d=a(()=>(n?.customInstrumentations?.[Ke.Java]||[]).map(e=>new We(e.className,e.methodName)),[n]);return i(()=>{n?.customInstrumentations||s||l("customInstrumentations",{[Ke.Golang]:js[Ke.Golang],[Ke.Java]:js[Ke.Java]})},[]),e(o,{children:[e(ee,{children:[e(me,{$gap:8,children:[t(_a,{}),t(te,{label:"Golang custom probes"})]}),t(ie,{name:"golangProbes",columns:[{keyName:"packageName",label:"Package name",placeholder:"e.g. github.com/my-org/my-package",tooltip:"The full import path of the package containing the function or method to be instrumented."},{keyName:"functionName",label:"Function name",placeholder:"e.g. myFunction",tooltip:"The name of the function to be instrumented. Leave empty if instrumenting a receiver method."},{keyName:"receiverName",label:"Receiver name",placeholder:"e.g. myReceiver",tooltip:"The name of the receiver type if instrumenting a method. Leave empty if instrumenting a standalone function."},{keyName:"receiverMethodName",label:"Receiver method name",placeholder:"e.g. myMethod",tooltip:"The name of the method to be instrumented. Leave empty if instrumenting a standalone function."}],values:c,setValues:e=>{const t={};t[Ke.Golang]=e.map(e=>new Ge(e.packageName,e.functionName,e.receiverName,e.receiverMethodName)),t[Ke.Java]=d,l("customInstrumentations",t)},errorMessage:s,limitFieldsPerRow:2})]}),e(ee,{children:[e(me,{$gap:8,children:[t(Pa,{}),t(te,{label:"Java custom probes"})]}),t(ie,{name:"javaProbes",columns:[{keyName:"className",label:"Class name",placeholder:"e.g. com.example.MyClass",tooltip:"The name of the class to be instrumented."},{keyName:"methodName",label:"Method name",placeholder:"e.g. myMethod",tooltip:"The name of the method to be instrumented."}],values:d,setValues:e=>{const t={};t[Ke.Golang]=c,t[Ke.Java]=e.map(e=>new We(e.className,e.methodName)),l("customInstrumentations",t)},errorMessage:s,limitFieldsPerRow:2})]})]})},[Ye.HeadersCollection]:({value:e,setValue:o,formErrors:n})=>{const l=n.headersCollection,r=a(()=>e?.headersCollection?.[He.HeaderKeys]||[],[e]),s=e=>{const t={[He.HeaderKeys]:e};o("headersCollection",t)};return i(()=>{r.length||l||s(Vs)},[]),t(se,{name:"headerKeys",label:"Header keys",tooltip:"Specify which headers you want to collect",helpMessage:"Asterisk (*) will collect all headers",values:r,setValues:s,errorMessage:l})},[Ye.PayloadCollection]:({value:o,setValue:n,formErrors:l})=>{const r=l.payloadCollection,s=a(()=>Object.entries(o.payloadCollection||{}).filter(([e,t])=>!!t).map(([e])=>e),[o]);return i(()=>{if(!s.length&&!r){const e={[je.HttpRequest]:{},[je.HttpResponse]:{},[je.DbQuery]:{},[je.Messaging]:{}};n("payloadCollection",e)}},[]),e(ee,{$gap:12,children:[t(ue,{size:he.XS,color:pe.Secondary,nowrap:!0,children:"Type of data to collect"}),t(ee,{$gap:6,children:Hs.map(({id:e,label:o,tooltip:i})=>t($e,{text:i,withIcon:!0,children:t(oe,{label:o,value:s.includes(e),onChange:t=>((e,t)=>{const o=t?[...s,e]:s.filter(t=>t!==e),i={[je.HttpRequest]:o.includes(je.HttpRequest)?{}:null,[je.HttpResponse]:o.includes(je.HttpResponse)?{}:null,[je.DbQuery]:o.includes(je.DbQuery)?{}:null,[je.Messaging]:o.includes(je.Messaging)?{}:null};n("payloadCollection",i)})(e,t)})},e))}),t(ne,{errorMessage:r})]})},[Ye.UnknownType]:null},Ws=({ruleType:e,value:o,setValue:n,formErrors:i,dynamicFields:a})=>{if(!e)return null;if(a?.length)return t(_s,{fields:a,value:o,setValue:n,formErrors:i||{},signals:[],seedInitialValues:!0});const l=Gs[e];return l?t(l,{value:o,setValue:n,formErrors:i}):null},Ks=()=>{const o=v(),{isVm:n}=S(),{selectedOption:i,genericForm:a,sourceOptions:l,namespaceOptions:r}=Fl();if(!a||!i)return t(Re,{title:"No active form"});const{formData:s,handleFormChange:c,formErrors:d}=a;return e(ee,{$gap:24,children:[e(me,{$gap:12,$justifyContent:"space-between",children:[t(De,{size:he.XXXS,maxLines:2,children:i.description}),e(me,{$gap:12,children:[t(ve,{options:[{icon:$a,label:"Enabled",value:!1,selectedBgColor:o.v2.colors.green[800]},{icon:Oa,label:"Disabled",value:!0,selectedBgColor:o.v2.colors.red[800]}],size:_e.S,selected:s.disabled,setSelected:e=>c("disabled",e)}),t(ge,{leftIcon:Aa,variant:be.Secondary,size:fe.S,onClick:()=>i.docsUrl&&window.open(i.docsUrl,"_blank","noopener noreferrer")})]})]}),t(ar,{option:i,formState:s}),e(me,{$gap:12,children:[t(ue,{size:he.XS,color:pe.Secondary,nowrap:!0,children:"Supported Languages:"}),i.supportedLanguages.map(e=>t(qe,{label:Je[e],leftIcon:Ze(e),backgroundColor:o.v2.colors.purple[900]},e))]}),!n&&t(lr,{scopes:s.sourceScopes,onChange:e=>c("sourceScopes",e),sourceOptions:l,namespaceOptions:r,supportedLanguages:i.type===Ye.CustomInstrumentation?[]:i.supportedLanguages,dataIdPrefix:"instrumentation-rule",slim:!0}),t(Te,{name:"ruleName",label:"Rule name",placeholder:"Use a name that describes the rule...",value:s.ruleName,onChange:({target:{value:e}})=>c("ruleName",e),errorMessage:d.ruleName}),t(Ws,{ruleType:i.type,dynamicFields:i.fields,value:s,setValue:(e,t)=>c(e,t),formErrors:d}),t(Pe,{name:"notes",label:"Notes",placeholder:"Your personal notes...",value:s.notes,onChange:({target:{value:e}})=>c("notes",e),errorMessage:d.notes})]})},Ys=()=>{const{pendingMerge:e,confirmMerge:o,cancelMerge:n}=Ml();if(!e)return null;const{existingName:i,editingName:a}=e;return t(Qe,{isOpen:!0,onClose:n,title:"Merge with existing Data Stream?",description:et.DATA_STREAM_MERGE_WARNING(a,i),approveButton:{"data-id":"data-stream-merge-confirm",label:"Merge",variant:be.Primary,onClick:o},denyButton:{"data-id":"data-stream-merge-cancel",label:"Cancel",variant:be.Secondary,onClick:n}})},qs=({autoFocus:o})=>{const{dataStreams:n}=tt(),{genericForm:i,excludeName:l,editingName:r}=Ml(),{formData:s,formErrors:c,handleFormChange:d}=i,u=s.name,p=a(()=>n.find(e=>e.name===u&&e.name!==l),[n,u,l]);return e(ee,{$width:"100%",$gap:12,children:[t(Te,{name:"data-stream-name",label:et.STREAM_NAME,placeholder:et.NAME_YOUR_STREAM_PLACEHOLDER,tooltip:et.STREAM_DESCRIPTION,required:!0,autoFocus:o,value:u,onChange:e=>d("name",e.target.value),errorMessage:c.name}),p&&t(Le,{status:Fe.Warning,message:et.DATA_STREAM_MERGE_WARNING(r,p.name),fullWidth:!0})]})},Js=()=>{const{selectedStreamName:e}=tt(),{genericForm:o}=zl();if(!o)return t(Re,{title:"No active form"});const{formData:n,handleFormChange:i,formErrors:a}=o;return t(Te,{name:"sourceName",label:et.NAME,tooltip:"This overrides the default service name (service.name) reported in your telemetry.",placeholder:"Use a name that overrides the source name",value:n.otelServiceName,onChange:({target:{value:t}})=>{i("otelServiceName",t),i("currentStreamName",e)},errorMessage:a.otelServiceName})},Zs=[{value:"all",label:"Drop All"},{value:"sample",label:"Sample"}],Qs=b.div`
128
+ `,Xs=d(({isEdit:o},n)=>{const a=v(),{isVm:l}=S(),{destinationsApi:r}=Ll(),{activeForm:c,genericForm:d,validateFormData:u,thisUnsavedDestination:h,addUnsavedDestination:m,updateUnsavedDestination:g,deleteUnsavedDestination:f}=Fl(),[b,y]=s(h?.testResult),[C,x]=s(!!h);i(()=>{h?(y(h.testResult),x(!0)):(y(void 0),x(!1))},[h]);const w=async()=>{if(!c?.option.testConnectionSupported||!d||l)return;const e=await r.testConnection(Ue(d.formData));return y(e),e};return p(n,()=>({testConnection:w,testConnectionSupported:!!c?.option.testConnectionSupported}),[c?.option.testConnectionSupported,d,r]),d&&c?e(ee,{$gap:24,style:{minHeight:"100%"},children:[e(me,{$gap:12,$justifyContent:"space-between",children:[b?b.succeeded?t(Le,{status:Fe.Success,message:b.message||"Connection OK",fullWidth:!0,smallIcon:!0}):t(Le,{status:Fe.Error,message:b.message||"Connection Failed",fullWidth:!0,smallIcon:!0}):t("div",{}),e(me,{$gap:12,children:[!l&&t(ve,{options:[{icon:Oa,label:"Enabled",value:!1,selectedBgColor:a.v2.colors.green[800]},{icon:Aa,label:"Disabled",value:!0,selectedBgColor:a.v2.colors.red[800]}],size:_e.S,selected:d.formData.disabled,setSelected:e=>d.handleFormChange("disabled",e),disabled:C}),t(ge,{"data-id":"dest-form-docs",leftIcon:Ra,variant:be.Secondary,size:fe.S,onClick:()=>window.open(`${Me}/backends/${c.option.type}`,"_blank","noopener noreferrer")})]})]}),t(ar,{title:"This connection will monitor:",allowedSignals:Xe(c.option.supportedSignals),selectedSignals:Be(d.formData.exportedSignals),setSelectedSignals:e=>d.handleFormChange("exportedSignals",{logs:e.includes(ze.Logs),metrics:e.includes(ze.Metrics),traces:e.includes(ze.Traces),profiles:e.includes(ze.Profiles)}),disabled:C,errorMessage:d.formErrors.exportedSignals}),t(Te,{name:"destinationName",label:"Destination name",placeholder:"Use a name that describes the destination...",value:d.formData.name,onChange:({target:{value:e}})=>d.handleFormChange("name",e),disabled:C,errorMessage:d.formErrors.name}),t(zs,{signals:Be(d.formData.exportedSignals),fields:c.dynamicFields,disabled:C,formData:d.formData,handleFormChange:(e,t)=>{d.handleFormChange("fields",d.formData.fields.map(o=>o.key===e?{...o,value:t}:o)),e&&d.formErrors[e]&&d.handleErrorChange(e,void 0)},formErrors:d.formErrors}),!o&&e(Bs,{$gap:8,$justifyContent:"center",children:[h&&t("div",{style:{width:"150px"},children:t(ge,{"data-id":"dest-form-delete",fullWidth:!0,label:"Delete",rightIcon:Da,variant:be.Secondary,textColor:a.v2.colors.red[500],onClick:()=>f(c.unsavedIdx)})}),!l&&(!h||h.option.testConnectionSupported&&!C)&&t("div",{style:{width:"150px"},children:t(ge,{"data-id":"dest-form-test-connection",fullWidth:!0,label:"Test Connection",variant:be.Secondary,onClick:w})}),h&&t("div",C?{style:{width:"150px"},children:t(ge,{"data-id":"dest-form-edit",fullWidth:!0,label:"Edit",rightIcon:_a,variant:be.Secondary,onClick:()=>x(!1)})}:{style:{width:"150px"},children:t(ge,{"data-id":"dest-form-save",fullWidth:!0,label:"Save Changes",variant:be.Primary,onClick:async()=>{const{errorMessage:e,preparedFormData:t}=u();if(!e){const e=await w(),o=!!e&&!e.succeeded;g(c.unsavedIdx,{formData:t,testResult:e},o)}}})}),!h&&t("div",{style:{width:"150px"},children:t(ge,{"data-id":"dest-form-add",fullWidth:!0,label:"Add Destination",variant:be.Primary,onClick:async()=>{const{errorMessage:e,preparedFormData:t}=u();if(!e){const e=await w(),o=!!e&&!e.succeeded;m({formData:t,testResult:e},o)}}})})]})]}):t(Re,{title:"No active form"})});Xs.displayName="AddDestinationForm";const Us=[{id:Ve.FilePath,label:"Collect file path",tooltip:"Indicates whether to record the `code.filepath` attribute."},{id:Ve.Function,label:"Collect function",tooltip:"Indicates whether to record the `code.function` attribute."},{id:Ve.LineNumber,label:"Collect line number",tooltip:"Indicates whether to record the `code.lineno` attribute."}],Vs=[{id:Ve.Column,label:"Collect column",tooltip:"Indicates whether to record the `code.column` attribute."},{id:Ve.Namespace,label:"Collect namespace",tooltip:"Indicates whether to record the `code.namespace` attribute."},{id:Ve.StackTrace,label:"Collect stacktrace",tooltip:"Indicates whether to record the `code.stacktrace` attribute."}],Hs=["*"],js=[{id:je.HttpRequest,label:"Collect HTTP request",tooltip:""},{id:je.HttpResponse,label:"Collect HTTP response",tooltip:""},{id:je.DbQuery,label:"Collect DB query",tooltip:""},{id:je.Messaging,label:"Collect messaging",tooltip:""}],Gs={[Ke.Java]:[new We("","")],[Ke.Golang]:[new Ge("")]},Ws={[Ye.CodeAttributes]:({value:n,setValue:l,formErrors:r})=>{const s=r.codeAttributes,c=a(()=>Object.entries(n.codeAttributes||{}).filter(([e,t])=>!!t).map(([e])=>e),[n]);i(()=>{if(!c.length&&!s){const e={[Ve.FilePath]:!0,[Ve.Function]:!0,[Ve.LineNumber]:!0,[Ve.Column]:null,[Ve.Namespace]:null,[Ve.StackTrace]:null};l("codeAttributes",e)}},[]);const d=(e,t)=>{const o=t?[...c,e]:c.filter(t=>t!==e),n=Object.values(Ve).reduce((e,t)=>(e[t]=!!o.includes(t)||null,e),{});l("codeAttributes",n)};return e(o,{children:[e(ee,{$gap:12,children:[t(pe,{size:he.XS,color:ue.Secondary,nowrap:!0,children:"Recommended data to collect"}),t(ee,{$gap:6,children:Us.map(({id:e,label:o,tooltip:n})=>t($e,{text:n,withIcon:!0,children:t(oe,{label:o,value:c.includes(e),onChange:t=>d(e,t)})},e))}),t(ne,{errorMessage:s})]}),e(ee,{$gap:12,children:[t(pe,{size:he.XS,color:ue.Secondary,nowrap:!0,children:"Verbose data to collect"}),t(ee,{$gap:6,children:Vs.map(({id:e,label:o,tooltip:n})=>t($e,{text:n,withIcon:!0,children:t(oe,{label:o,value:c.includes(e),onChange:t=>d(e,t)})},e))}),t(ne,{errorMessage:s})]})]})},[Ye.CustomInstrumentation]:({value:n,setValue:l,formErrors:r})=>{const s=r.customInstrumentations,c=a(()=>(n?.customInstrumentations?.[Ke.Golang]||[]).map(e=>new Ge(e.packageName,e.functionName,e.receiverName,e.receiverMethodName)),[n]),d=a(()=>(n?.customInstrumentations?.[Ke.Java]||[]).map(e=>new We(e.className,e.methodName)),[n]);return i(()=>{n?.customInstrumentations||s||l("customInstrumentations",{[Ke.Golang]:Gs[Ke.Golang],[Ke.Java]:Gs[Ke.Java]})},[]),e(o,{children:[e(ee,{children:[e(me,{$gap:8,children:[t(Pa,{}),t(te,{label:"Golang custom probes"})]}),t(ie,{name:"golangProbes",columns:[{keyName:"packageName",label:"Package name",placeholder:"e.g. github.com/my-org/my-package",tooltip:"The full import path of the package containing the function or method to be instrumented."},{keyName:"functionName",label:"Function name",placeholder:"e.g. myFunction",tooltip:"The name of the function to be instrumented. Leave empty if instrumenting a receiver method."},{keyName:"receiverName",label:"Receiver name",placeholder:"e.g. myReceiver",tooltip:"The name of the receiver type if instrumenting a method. Leave empty if instrumenting a standalone function."},{keyName:"receiverMethodName",label:"Receiver method name",placeholder:"e.g. myMethod",tooltip:"The name of the method to be instrumented. Leave empty if instrumenting a standalone function."}],values:c,setValues:e=>{const t={};t[Ke.Golang]=e.map(e=>new Ge(e.packageName,e.functionName,e.receiverName,e.receiverMethodName)),t[Ke.Java]=d,l("customInstrumentations",t)},errorMessage:s,limitFieldsPerRow:2})]}),e(ee,{children:[e(me,{$gap:8,children:[t(La,{}),t(te,{label:"Java custom probes"})]}),t(ie,{name:"javaProbes",columns:[{keyName:"className",label:"Class name",placeholder:"e.g. com.example.MyClass",tooltip:"The name of the class to be instrumented."},{keyName:"methodName",label:"Method name",placeholder:"e.g. myMethod",tooltip:"The name of the method to be instrumented."}],values:d,setValues:e=>{const t={};t[Ke.Golang]=c,t[Ke.Java]=e.map(e=>new We(e.className,e.methodName)),l("customInstrumentations",t)},errorMessage:s,limitFieldsPerRow:2})]})]})},[Ye.HeadersCollection]:({value:e,setValue:o,formErrors:n})=>{const l=n.headersCollection,r=a(()=>e?.headersCollection?.[He.HeaderKeys]||[],[e]),s=e=>{const t={[He.HeaderKeys]:e};o("headersCollection",t)};return i(()=>{r.length||l||s(Hs)},[]),t(se,{name:"headerKeys",label:"Header keys",tooltip:"Specify which headers you want to collect",helpMessage:"Asterisk (*) will collect all headers",values:r,setValues:s,errorMessage:l})},[Ye.PayloadCollection]:({value:o,setValue:n,formErrors:l})=>{const r=l.payloadCollection,s=a(()=>Object.entries(o.payloadCollection||{}).filter(([e,t])=>!!t).map(([e])=>e),[o]);return i(()=>{if(!s.length&&!r){const e={[je.HttpRequest]:{},[je.HttpResponse]:{},[je.DbQuery]:{},[je.Messaging]:{}};n("payloadCollection",e)}},[]),e(ee,{$gap:12,children:[t(pe,{size:he.XS,color:ue.Secondary,nowrap:!0,children:"Type of data to collect"}),t(ee,{$gap:6,children:js.map(({id:e,label:o,tooltip:i})=>t($e,{text:i,withIcon:!0,children:t(oe,{label:o,value:s.includes(e),onChange:t=>((e,t)=>{const o=t?[...s,e]:s.filter(t=>t!==e),i={[je.HttpRequest]:o.includes(je.HttpRequest)?{}:null,[je.HttpResponse]:o.includes(je.HttpResponse)?{}:null,[je.DbQuery]:o.includes(je.DbQuery)?{}:null,[je.Messaging]:o.includes(je.Messaging)?{}:null};n("payloadCollection",i)})(e,t)})},e))}),t(ne,{errorMessage:r})]})},[Ye.UnknownType]:null},Ks=({ruleType:e,value:o,setValue:n,formErrors:i,dynamicFields:a})=>{if(!e)return null;if(a?.length)return t(Ps,{fields:a,value:o,setValue:n,formErrors:i||{},signals:[],seedInitialValues:!0});const l=Ws[e];return l?t(l,{value:o,setValue:n,formErrors:i}):null},Ys=()=>{const o=v(),{isVm:n}=S(),{selectedOption:i,genericForm:a,sourceOptions:l,namespaceOptions:r}=Ml();if(!a||!i)return t(Re,{title:"No active form"});const{formData:s,handleFormChange:c,formErrors:d}=a;return e(ee,{$gap:24,children:[e(me,{$gap:12,$justifyContent:"space-between",children:[t(De,{size:he.XXXS,maxLines:2,children:i.description}),e(me,{$gap:12,children:[t(ve,{options:[{icon:Oa,label:"Enabled",value:!1,selectedBgColor:o.v2.colors.green[800]},{icon:Aa,label:"Disabled",value:!0,selectedBgColor:o.v2.colors.red[800]}],size:_e.S,selected:s.disabled,setSelected:e=>c("disabled",e)}),t(ge,{leftIcon:Ra,variant:be.Secondary,size:fe.S,onClick:()=>i.docsUrl&&window.open(i.docsUrl,"_blank","noopener noreferrer")})]})]}),t(lr,{option:i,formState:s}),e(me,{$gap:12,children:[t(pe,{size:he.XS,color:ue.Secondary,nowrap:!0,children:"Supported Languages:"}),i.supportedLanguages.map(e=>t(qe,{label:Je[e],leftIcon:Ze(e),backgroundColor:o.v2.colors.purple[900]},e))]}),!n&&t(rr,{scopes:s.sourceScopes,onChange:e=>c("sourceScopes",e),sourceOptions:l,namespaceOptions:r,supportedLanguages:i.type===Ye.CustomInstrumentation?[]:i.supportedLanguages,dataIdPrefix:"instrumentation-rule",slim:!0}),t(Te,{name:"ruleName",label:"Rule name",placeholder:"Use a name that describes the rule...",value:s.ruleName,onChange:({target:{value:e}})=>c("ruleName",e),errorMessage:d.ruleName}),t(Ks,{ruleType:i.type,dynamicFields:i.fields,value:s,setValue:(e,t)=>c(e,t),formErrors:d}),t(Pe,{name:"notes",label:"Notes",placeholder:"Your personal notes...",value:s.notes,onChange:({target:{value:e}})=>c("notes",e),errorMessage:d.notes})]})},qs=()=>{const{pendingMerge:e,confirmMerge:o,cancelMerge:n}=zl();if(!e)return null;const{existingName:i,editingName:a}=e;return t(Qe,{isOpen:!0,onClose:n,title:"Merge with existing Data Stream?",description:et.DATA_STREAM_MERGE_WARNING(a,i),approveButton:{"data-id":"data-stream-merge-confirm",label:"Merge",variant:be.Primary,onClick:o},denyButton:{"data-id":"data-stream-merge-cancel",label:"Cancel",variant:be.Secondary,onClick:n}})},Js=({autoFocus:o})=>{const{dataStreams:n}=tt(),{genericForm:i,excludeName:l,editingName:r}=zl(),{formData:s,formErrors:c,handleFormChange:d}=i,p=s.name,u=a(()=>n.find(e=>e.name===p&&e.name!==l),[n,p,l]);return e(ee,{$width:"100%",$gap:12,children:[t(Te,{name:"data-stream-name",label:et.STREAM_NAME,placeholder:et.NAME_YOUR_STREAM_PLACEHOLDER,tooltip:et.STREAM_DESCRIPTION,required:!0,autoFocus:o,value:p,onChange:e=>d("name",e.target.value),errorMessage:c.name}),u&&t(Le,{status:Fe.Warning,message:et.DATA_STREAM_MERGE_WARNING(r,u.name),fullWidth:!0})]})},Zs=()=>{const{selectedStreamName:e}=tt(),{genericForm:o}=Bl();if(!o)return t(Re,{title:"No active form"});const{formData:n,handleFormChange:i,formErrors:a}=o;return t(Te,{name:"sourceName",label:et.NAME,tooltip:"This overrides the default service name (service.name) reported in your telemetry.",placeholder:"Use a name that overrides the source name",value:n.otelServiceName,onChange:({target:{value:t}})=>{i("otelServiceName",t),i("currentStreamName",e)},errorMessage:a.otelServiceName})},Qs=[{value:"all",label:"Drop All"},{value:"sample",label:"Sample"}],ec=b.div`
129
129
  display: flex;
130
130
  flex-direction: column;
131
131
  gap: 24px;
132
- `,ec=b.div`
132
+ `,tc=b.div`
133
133
  display: contents;
134
134
  & > * {
135
135
  opacity: ${({$faded:e})=>e?.4:1};
136
136
  transition: opacity 0.2s ease;
137
137
  }
138
- `,tc=({value:e})=>{const o=v();return t(qe,e?{status:Fe.Success,label:st,leftIcon:$a}:{label:ct,leftIcon:Oa,backgroundColor:o.v2.colors.silver[500],textColor:o.v2.colors.white[500]})},oc=({value:e,onChange:o})=>{const n=v(),i=a(()=>[{icon:$a,label:st,value:!0,selectedBgColor:n.v2.colors.green[800]},{icon:Oa,label:ct,value:!1,selectedBgColor:n.v2.colors.silver[500]}],[n]);return t(ve,{options:i,selected:e,setSelected:o??(()=>{}),disabled:!o})},nc=()=>{const e=Bl();switch(e.formType){case Xl.Create:return t(ic,{category:e.category,formData:e.formData,onChange:e.handleChange,sourceOptions:e.sourceOptions,namespaceOptions:e.namespaceOptions,renderAction:()=>t(oc,{value:!e.formData.disabled,onChange:t=>e.handleChange({disabled:!t})})});case Xl.View:return e.data?e.isEditing?t(ic,{category:e.data.category,formData:e.formData,onChange:e.handleChange,sourceOptions:e.sourceOptions,namespaceOptions:e.namespaceOptions,renderAction:()=>t(oc,{value:!e.formData.disabled,onChange:t=>e.handleChange({disabled:!t})})}):t(ac,{data:e.data,renderAction:()=>t(tc,{value:!e.data?.rule.disabled})}):null;case Xl.EditAutoNoisy:return t(lc,{enabled:e.localEnabled,summary:e.summary,inactiveTitle:rt,sectionTitle:it,sectionSubTitle:lt,presetLabel:nt,customInputName:"sampling-auto-input-custom-percentage",percentageMode:e.percentageMode,setPercentageMode:e.setPercentageMode,percentagePreset:e.percentagePreset,setPercentagePreset:e.setPercentagePreset,customPercentage:e.customPercentage,setCustomPercentage:e.setCustomPercentage,renderAction:()=>t(oc,{value:e.localEnabled,onChange:e.setLocalEnabled})});case Xl.EditAutoCostReduction:return t(lc,{enabled:e.localEnabled,summary:e.summary,inactiveTitle:at,sectionTitle:it,presetLabel:nt,customInputName:"sampling-cr-auto-input-custom-percentage",showModeToggle:!1,percentageMode:e.percentageMode,setPercentageMode:e.setPercentageMode,percentagePreset:e.percentagePreset,setPercentagePreset:e.setPercentagePreset,customPercentage:e.customPercentage,setCustomPercentage:e.setCustomPercentage,renderAction:()=>t(oc,{value:e.localEnabled,onChange:e.setLocalEnabled})});case Xl.EditAutoHighlyRelevant:return t(Qs,{children:t(rr,{title:e.localEnabled?void 0:ot,summary:e.summary,renderAction:()=>t(oc,{value:e.localEnabled,onChange:e.setLocalEnabled})})})}},ic=({category:o,formData:n,onChange:i,sourceOptions:a,namespaceOptions:l,renderAction:r})=>e(Qs,{children:[t(dr,{category:o,formState:n,renderAction:r}),e(ec,{$faded:!!n.disabled,children:[t(ur,{category:o,formState:n,onChange:i}),t(lr,{scopes:n.sourceScopes,onChange:e=>i({sourceScopes:e}),sourceOptions:a,namespaceOptions:l,titleNumber:1,dataIdPrefix:"sampling"}),t(pr,{category:o,formState:n,onChange:i}),"highlyRelevant"===o&&t(hr,{formState:n,onChange:i}),"highlyRelevant"===o&&t(mr,{ruleType:n.ruleType,formState:n,onChange:i}),t(gr,{category:o,formState:n,onChange:i})]})]}),ac=({data:o,renderAction:n})=>e(Qs,{children:[t(dr,{readOnly:!0,summary:o.summary,renderAction:n}),t(ur,{readOnly:!0,data:o}),t(lr,{readOnly:!0,scopes:x(o.rule.sourceScopes)}),t(pr,{readOnly:!0,data:o}),t(gr,{readOnly:!0,data:o}),"highlyRelevant"===o.category&&t(mr,{readOnly:!0,rule:o.rule})]}),lc=({enabled:o,summary:n,inactiveTitle:i,sectionTitle:a,sectionSubTitle:l,presetLabel:s,customInputName:c,showModeToggle:d=!0,percentageMode:u,setPercentageMode:p,percentagePreset:h,setPercentagePreset:m,customPercentage:g,setCustomPercentage:f,renderAction:b})=>{const v=r(e=>p(e),[p]),y=r(e=>m(e),[m]),C=r(e=>f(e.target.value),[f]),S=!d||"sample"===u;return e(Qs,{children:[t(rr,{title:o?void 0:i,summary:n,renderAction:b}),t(ec,{$faded:!o,children:e(dt,{richTitle:{title:a,subTitle:l},children:[d&&t(ee,{$alignItems:"flex-start",children:t(ve,{options:Zs,selected:u,setSelected:v})}),S&&t(sr,{description:s,options:cr,selected:h,onSelect:y,customName:c,customLabel:ut,customPlaceholder:"5%",customValue:g,onCustomChange:C})]})})]})},rc=b.div`
138
+ `,oc=({value:e})=>{const o=v();return t(qe,e?{status:Fe.Success,label:st,leftIcon:Oa}:{label:ct,leftIcon:Aa,backgroundColor:o.v2.colors.silver[500],textColor:o.v2.colors.white[500]})},nc=({value:e,onChange:o})=>{const n=v(),i=a(()=>[{icon:Oa,label:st,value:!0,selectedBgColor:n.v2.colors.green[800]},{icon:Aa,label:ct,value:!1,selectedBgColor:n.v2.colors.silver[500]}],[n]);return t(ve,{options:i,selected:e,setSelected:o??(()=>{}),disabled:!o})},ic=()=>{const e=Xl();switch(e.formType){case Ul.Create:return t(ac,{category:e.category,formData:e.formData,onChange:e.handleChange,sourceOptions:e.sourceOptions,namespaceOptions:e.namespaceOptions,renderAction:()=>t(nc,{value:!e.formData.disabled,onChange:t=>e.handleChange({disabled:!t})})});case Ul.View:return e.data?e.isEditing?t(ac,{category:e.data.category,formData:e.formData,onChange:e.handleChange,sourceOptions:e.sourceOptions,namespaceOptions:e.namespaceOptions,renderAction:()=>t(nc,{value:!e.formData.disabled,onChange:t=>e.handleChange({disabled:!t})})}):t(lc,{data:e.data,renderAction:()=>t(oc,{value:!e.data?.rule.disabled})}):null;case Ul.EditAutoNoisy:return t(rc,{enabled:e.localEnabled,summary:e.summary,inactiveTitle:rt,sectionTitle:it,sectionSubTitle:lt,presetLabel:nt,customInputName:"sampling-auto-input-custom-percentage",percentageMode:e.percentageMode,setPercentageMode:e.setPercentageMode,percentagePreset:e.percentagePreset,setPercentagePreset:e.setPercentagePreset,customPercentage:e.customPercentage,setCustomPercentage:e.setCustomPercentage,renderAction:()=>t(nc,{value:e.localEnabled,onChange:e.setLocalEnabled})});case Ul.EditAutoCostReduction:return t(rc,{enabled:e.localEnabled,summary:e.summary,inactiveTitle:at,sectionTitle:it,presetLabel:nt,customInputName:"sampling-cr-auto-input-custom-percentage",showModeToggle:!1,percentageMode:e.percentageMode,setPercentageMode:e.setPercentageMode,percentagePreset:e.percentagePreset,setPercentagePreset:e.setPercentagePreset,customPercentage:e.customPercentage,setCustomPercentage:e.setCustomPercentage,renderAction:()=>t(nc,{value:e.localEnabled,onChange:e.setLocalEnabled})});case Ul.EditAutoHighlyRelevant:return t(ec,{children:t(sr,{title:e.localEnabled?void 0:ot,summary:e.summary,renderAction:()=>t(nc,{value:e.localEnabled,onChange:e.setLocalEnabled})})})}},ac=({category:o,formData:n,onChange:i,sourceOptions:a,namespaceOptions:l,renderAction:r})=>e(ec,{children:[t(pr,{category:o,formState:n,renderAction:r}),e(tc,{$faded:!!n.disabled,children:[t(ur,{category:o,formState:n,onChange:i}),t(rr,{scopes:n.sourceScopes,onChange:e=>i({sourceScopes:e}),sourceOptions:a,namespaceOptions:l,titleNumber:1,dataIdPrefix:"sampling"}),t(hr,{category:o,formState:n,onChange:i}),"highlyRelevant"===o&&t(mr,{formState:n,onChange:i}),"highlyRelevant"===o&&t(gr,{ruleType:n.ruleType,formState:n,onChange:i}),t(fr,{category:o,formState:n,onChange:i})]})]}),lc=({data:o,renderAction:n})=>e(ec,{children:[t(pr,{readOnly:!0,summary:o.summary,renderAction:n}),t(ur,{readOnly:!0,data:o}),t(rr,{readOnly:!0,scopes:x(o.rule.sourceScopes)}),t(hr,{readOnly:!0,data:o}),t(fr,{readOnly:!0,data:o}),"highlyRelevant"===o.category&&t(gr,{readOnly:!0,rule:o.rule})]}),rc=({enabled:o,summary:n,inactiveTitle:i,sectionTitle:a,sectionSubTitle:l,presetLabel:s,customInputName:c,showModeToggle:d=!0,percentageMode:p,setPercentageMode:u,percentagePreset:h,setPercentagePreset:m,customPercentage:g,setCustomPercentage:f,renderAction:b})=>{const v=r(e=>u(e),[u]),y=r(e=>m(e),[m]),C=r(e=>f(e.target.value),[f]),S=!d||"sample"===p;return e(ec,{children:[t(sr,{title:o?void 0:i,summary:n,renderAction:b}),t(tc,{$faded:!o,children:e(dt,{richTitle:{title:a,subTitle:l},children:[d&&t(ee,{$alignItems:"flex-start",children:t(ve,{options:Qs,selected:p,setSelected:v})}),S&&t(cr,{description:s,options:dr,selected:h,onSelect:y,customName:c,customLabel:pt,customPlaceholder:"5%",customValue:g,onCustomChange:C})]})})]})},sc=b.div`
139
139
  display: flex;
140
140
  align-items: center;
141
141
  justify-content: space-between;
@@ -148,27 +148,27 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import n,{useEff
148
148
  &:hover {
149
149
  background-color: ${({$isSelected:e,$purpleColors:t,theme:o})=>o.v2.colors[t?"purple":"silver"][e?"700":"800"]};
150
150
  }
151
- `,sc=b.div`
151
+ `,cc=b.div`
152
152
  display: flex;
153
153
  align-items: center;
154
154
  justify-content: center;
155
155
  padding: 8px;
156
156
  border-radius: 8px;
157
- background-color: ${({theme:e})=>e.v2.colors.white[500]+pt["004"]};
158
- `,cc=({dataId:o,icon:n,title:i,description:a,withCarret:l,purpleColors:r,disabled:s,children:c,isSelected:d,onClick:u,isChecked:p,isPartiallyChecked:h,onCheckboxChange:m})=>e(rc,{"data-id":o||`list-item-${i}`,$isSelected:d,$purpleColors:r,$disabled:s,onClick:()=>!d&&!s&&u(),children:[e(ee,{$gap:4,children:[e(me,{$gap:12,children:[m&&t(oe,{partiallyChecked:h||!1,value:p||!1,onChange:e=>m(e)}),n&&t(sc,{children:t(n,{size:20})}),t(ue,{size:he.XS,children:i})]}),a&&t(ue,{size:he.XXXS,color:pe.Secondary,children:a})]}),(l||c)&&e(me,{$gap:8,children:[c,l&&t(La,{size:18})]})]}),dc=({onClose:e,selectedConnectionIds:o,setSelectedConnectionIds:n,withOverlay:i})=>{const{actionsApi:r}=Pl(),{platformType:c,version:d}=S(),[u,p]=s(""),h=l(null),{selectedOption:m,onSelectOption:g,genericForm:f,validateFormData:b}=_l(),{options:v,loading:y}=r.useActionTypes(),C=a(()=>v.length?v:ht(c,d),[v,c,d]),x=a(()=>(u?C.filter(e=>e?.label?.toLowerCase().includes(u.toLowerCase())):C).filter(e=>!!e),[C,u]),w=a(()=>y?[t(mt,{$padding:"8px 12px",children:t(gt,{size:6})},"loading")]:x.map(e=>{const o=m?.type===e.type;return t(cc,{dataId:e.type?`option-${e.type}`:void 0,title:e.label,description:e.description,withCarret:!0,isSelected:o,onClick:()=>{h.current?.clearErrors(),g(e)}},e.type)}),[y,m?.type,x,g]),T=a(()=>y?[t(mt,{$padding:"8px 12px",children:t(gt,{size:4})},"loading")]:m?[t(Fs,{},m.type)]:[t(ft,{$height:"100%",children:t(Re,{icon:Fa,title:"Action not selected",subTitle:"Please select an action to add"})},"no-data")],[y,m]);return t(fr,{ref:h,isOpen:!0,withOverlay:i,onClose:e,onSave:async()=>{const{errorMessage:e,preparedFormData:t}=b();if(e)return!1;await r.create(t)},disableSave:!m||!f?.isFormDirty,isFormDirty:f?.isFormDirty,hideDirtyNote:!0,progress:{title:et.CREATING_ACTION,subTitle:et.CREATING_ACTION_SUBTITLE},header:{icon:Fa,title:et.ADD_ACTION,subTitle:et.ADD_ACTION_DESCRIPTION},connectionIds:o&&n?{value:o,setValue:n}:void 0,search:{value:u,onChange:p},leftColumn:{width:"40%",list:w},rightColumn:{width:"60%",list:T}})},uc=({destinationsByCategory:n,filters:i,setFilters:l})=>{const r=a(()=>Object.values(bt).map(e=>({id:e,label:e.charAt(0).toUpperCase()+e.slice(1).toLowerCase()})).filter(e=>n[e.id]?.length),[n]),s=a(()=>{const e=Object.values(ze).map(e=>({value:e,label:e.charAt(0).toUpperCase()+e.slice(1).toLowerCase()}));return e.unshift({value:null,label:"All"}),e},[]);return e(o,{children:[t(vt,{placeholder:"Select category",options:r,values:i.categoryType?[i.categoryType]:[],setValues:e=>l({...i,categoryType:i.categoryType===e[0]?null:e[0]})}),t(ve,{options:s,selected:i.signalType,setSelected:e=>l({...i,signalType:e})})]})},pc=b.div`
157
+ background-color: ${({theme:e})=>e.v2.colors.white[500]+ut["004"]};
158
+ `,dc=({dataId:o,icon:n,title:i,description:a,withCarret:l,purpleColors:r,disabled:s,children:c,isSelected:d,onClick:p,isChecked:u,isPartiallyChecked:h,onCheckboxChange:m})=>e(sc,{"data-id":o||`list-item-${i}`,$isSelected:d,$purpleColors:r,$disabled:s,onClick:()=>!d&&!s&&p(),children:[e(ee,{$gap:4,children:[e(me,{$gap:12,children:[m&&t(oe,{partiallyChecked:h||!1,value:u||!1,onChange:e=>m(e)}),n&&t(cc,{children:t(n,{size:20})}),t(pe,{size:he.XS,children:i})]}),a&&t(pe,{size:he.XXXS,color:ue.Secondary,children:a})]}),(l||c)&&e(me,{$gap:8,children:[c,l&&t(Fa,{size:18})]})]}),pc=({onClose:e,selectedConnectionIds:o,setSelectedConnectionIds:n,withOverlay:i})=>{const{actionsApi:r}=Ll(),{platformType:c,version:d}=S(),[p,u]=s(""),h=l(null),{selectedOption:m,onSelectOption:g,genericForm:f,validateFormData:b}=Pl(),{options:v,loading:y}=r.useActionTypes(),C=a(()=>v.length?v:ht(c,d),[v,c,d]),x=a(()=>(p?C.filter(e=>e?.label?.toLowerCase().includes(p.toLowerCase())):C).filter(e=>!!e),[C,p]),w=a(()=>y?[t(mt,{$padding:"8px 12px",children:t(gt,{size:6})},"loading")]:x.map(e=>{const o=m?.type===e.type;return t(dc,{dataId:e.type?`option-${e.type}`:void 0,title:e.label,description:e.description,withCarret:!0,isSelected:o,onClick:()=>{h.current?.clearErrors(),g(e)}},e.type)}),[y,m?.type,x,g]),T=a(()=>y?[t(mt,{$padding:"8px 12px",children:t(gt,{size:4})},"loading")]:m?[t(Ms,{},m.type)]:[t(ft,{$height:"100%",children:t(Re,{icon:Ma,title:"Action not selected",subTitle:"Please select an action to add"})},"no-data")],[y,m]);return t(br,{ref:h,isOpen:!0,withOverlay:i,onClose:e,onSave:async()=>{const{errorMessage:e,preparedFormData:t}=b();if(e)return!1;await r.create(t)},disableSave:!m||!f?.isFormDirty,isFormDirty:f?.isFormDirty,hideDirtyNote:!0,progress:{title:et.CREATING_ACTION,subTitle:et.CREATING_ACTION_SUBTITLE},header:{icon:Ma,title:et.ADD_ACTION,subTitle:et.ADD_ACTION_DESCRIPTION},connectionIds:o&&n?{value:o,setValue:n}:void 0,search:{value:p,onChange:u},leftColumn:{width:"40%",list:w},rightColumn:{width:"60%",list:T}})},uc=({destinationsByCategory:n,filters:i,setFilters:l})=>{const r=a(()=>Object.values(bt).map(e=>({id:e,label:e.charAt(0).toUpperCase()+e.slice(1).toLowerCase()})).filter(e=>n[e.id]?.length),[n]),s=a(()=>{const e=Object.values(ze).map(e=>({value:e,label:e.charAt(0).toUpperCase()+e.slice(1).toLowerCase()}));return e.unshift({value:null,label:"All"}),e},[]);return e(o,{children:[t(vt,{placeholder:"Select category",options:r,values:i.categoryType?[i.categoryType]:[],setValues:e=>l({...i,categoryType:i.categoryType===e[0]?null:e[0]})}),t(ve,{options:s,selected:i.signalType,setSelected:e=>l({...i,signalType:e})})]})},hc=b.div`
159
159
  display: flex;
160
160
  flex-direction: column;
161
161
  padding: 8px;
162
162
  border-radius: 16px;
163
163
  border: ${({$purpleColors:e,theme:t})=>e?`1px solid ${t.v2.colors.purple[500]}`:"1px solid transparent"};
164
164
  background-color: ${({$noBgColor:e,$purpleColors:t,theme:o})=>e?"transparent":t?o.v2.colors.purple[900]:o.v2.colors.silver[800]};
165
- `,hc=b.div`
165
+ `,mc=b.div`
166
166
  display: flex;
167
167
  align-items: center;
168
168
  justify-content: space-between;
169
169
  gap: 12px;
170
170
  padding: ${({$isOpen:e})=>e?"2px 12px 8px 12px":"2px 12px"};
171
- `,mc=({title:o,tooltip:n,list:i,noBgColor:a,purpleColors:l})=>{const[r,c]=s(!0);return e(pc,{"data-id":`collapse-${o}`,$noBgColor:a,$purpleColors:l,children:[e(hc,{$isOpen:r,children:[e(me,{$gap:10,children:[t(ue,{size:he.XS,children:o}),n&&t($e,{text:n,withIcon:!0}),t(qe,{label:i.length,status:l?Fe.Default:void 0})]}),t(yt,{icon:r?za:Ba,size:Ct.M,onClick:()=>c(e=>!e)})]}),r?t(ee,{children:i.length?p.toArray(i):t(ft,{$padding:"12px 0",children:t(Re,{})})}):null]})},gc=(e,t,o)=>t||o.signalType?e.filter(e=>e.displayName.toLowerCase().includes(t.toLowerCase())&&(!o.signalType||Xe(e.supportedSignals).includes(o.signalType))):e,fc=({option:e,formData:o,testResult:n,isSelected:i,onSelect:a})=>t(cc,{icon:wt(e.type).icon,title:o?.name||e.displayName,withCarret:!0,purpleColors:!!o,isSelected:i,onClick:()=>a(),children:n&&t(qe,{status:n.succeeded?Fe.Success:Fe.Error,leftIcon:n.succeeded?Xa:Ua})}),bc=({listType:e,destinationOptions:o,unsavedDestinations:n})=>{const{activeForm:i,onChangeActiveForm:a}=Ll();return o?.length?t(mc,{title:xt[e].TITLE,tooltip:xt[e].DESCRIPTION,list:o.map((o,n)=>t(fc,{option:o,isSelected:i?.listType===e&&"number"!=typeof i?.unsavedIdx&&(null!=o.id&&""!==o.id?i?.option.id===o.id:i?.option.type===o.type),onSelect:()=>a({listType:e,option:o})},`${e}-${o.id??o.type}-${n}`))}):n?.length?t(mc,{purpleColors:!0,title:xt[e].TITLE,tooltip:xt[e].DESCRIPTION,list:n.map(({option:o,formData:n,testResult:l},r)=>t(fc,{option:o,formData:n,testResult:l,isSelected:i?.unsavedIdx===r&&i?.listType===e,onSelect:()=>a({listType:e,option:o,unsavedIdx:r})},`${e}-${r}`))},e):void 0};var vc;(e=>{e.SELF_HOSTED="self hosted",e.MANAGED="managed"})(vc||(vc={}));const yc=(e,t)=>{const o=[],n=[],i=[];return e&&e.destinationCategories.categories.forEach(e=>{e.name===vc.SELF_HOSTED?n.push(...e.items):e.name===vc.MANAGED&&i.push(...e.items)}),t&&t?.potentialDestinations.forEach(t=>{for(const n of e?.destinationCategories?.categories||[]){const e=Tt(n),i=e.items.findIndex(e=>e.type===t.type);if(-1!==i){const n=Ne(t.fields,{});Object.keys(n).length&&(e.items[i].fields=e.items[i].fields.map(e=>({...e,initialValue:n[e.name]})),o.push(e.items[i]))}}}),{[bt.DETECTED]:o,[bt.SELF_HOSTED]:n,[bt.MANAGED]:i}},Cc=({onClose:e,onBack:o,onNext:n,selectedConnectionIds:l,setSelectedConnectionIds:c,initialInputs:d,withOverlay:u,disableAnimation:p})=>{const{destinationsApi:h}=Pl(),[m,g]=s(""),[f,b]=s({categoryType:null,signalType:null}),{items:v}=h.useDestinations(),{data:y,loading:C}=h.useDestinationCategories(),{data:S,loading:x}=h.usePotentialDestinations(),{activeForm:w,genericForm:T,unsavedDestinations:k,setUnsavedDestinations:E}=Ll();i(()=>{d&&E(d)},[d]);const I=C||x,N=a(()=>y?.destinationCategories?.categories??[],[y]),[$,O]=s({[bt.ALL]:[],[bt.UNSAVED]:[],[bt.EXISTS]:[],[bt.DETECTED]:[],[bt.SELF_HOSTED]:[],[bt.MANAGED]:[]});i(()=>{const e=v.map(e=>{let t;for(const o of N){const n=o.items.find(t=>t.type===e.destinationType.type);if(n){t=n;break}}const o=Ne(e.fields,{});return{id:e.id,type:e.destinationType.type,displayName:e.name||e.destinationType.displayName,selected:!0,testConnectionSupported:t?.testConnectionSupported??!1,supportedSignals:e.destinationType.supportedSignals,fields:t?t.fields.map(e=>({...e,initialValue:o[e.name]??e.initialValue})):[]}});O(t=>({...t,[bt.EXISTS]:e}))},[v,N]),i(()=>{(y||S)&&O(e=>({...e,...yc(y,S)}))},[y,S]);const A=r(async()=>{for(const{option:e,formData:t}of k){const o=Ue(t);if(e.id){const t=Object.fromEntries(e.fields.map(e=>[e.name,e.initialValue??""])),n=Object.fromEntries(o.fields.map(e=>[e.key,e.value??""]));if(!Object.keys(t).some(e=>t[e]!==n[e])){await h.update(e.id,o);continue}}await h.create(o)}},[k,h]),R=(({isFetching:e,destinationsByCategory:o,searchText:n,filters:i})=>{const{unsavedDestinations:l}=Ll();return{width:"40%",list:a(()=>{const a=[];l.length&&a.push(t(bc,{listType:bt.UNSAVED,unsavedDestinations:l},"unsaved"));for(const e of Object.values(bt)){if(i.categoryType&&i.categoryType!==e)continue;const l=gc(o[e],n,i);l.length&&a.push(t(bc,{listType:e,destinationOptions:l},e))}return e&&a.push(t(ft,{$height:"100%",children:t(St,{title:"Fetching destinations",withSpinner:!0})},"loading-more")),a},[l,o,n,i,e])}})({isFetching:I,destinationsByCategory:$,searchText:m,filters:f}),D=(()=>{const{activeForm:e}=Ll();return{width:"60%",list:e?[t(Bs,{},e.option.type)]:[t(ft,{$height:"100%",children:t(Re,{icon:Ma,title:"Select destination from the list",subTitle:"Add destination so your data has somewhere to go."})},"no-data")]}})();return t(fr,{isOpen:!0,withOverlay:u,disableAnimation:p,onClose:e,onBack:o?()=>o(k):void 0,onNext:n?()=>n(k):void 0,nextIsSkip:!k.length,onSave:A,disableSave:!w&&!k.length,isFetching:I,isFormDirty:k.length>0||T?.isFormDirty,hideDirtyNote:!0,progress:{title:et.CREATING_DESTINATION,subTitle:et.CREATING_DESTINATION_SUBTITLE},header:{icon:Ma,title:et.ADD_DESTINATIONS,subTitle:et.ADD_DESTINATION_DRAWER_DESCRIPTION},connectionIds:l&&c?{value:l,setValue:c}:void 0,search:{value:m,onChange:g},filters:t(uc,{destinationsByCategory:$,filters:f,setFilters:b}),leftColumn:R,rightColumn:D})},Sc=({onClose:e,selectedConnectionIds:o,setSelectedConnectionIds:n,withOverlay:i})=>{const{instrumentationRulesApi:r}=Pl(),[c,d]=s(""),u=l(null),{selectedOption:p,onSelectOption:h,genericForm:m,validateFormData:g}=Fl(),{options:f,loading:b}=r.useRuleTypes(),v=a(()=>f.length?f:kt,[f]),y=a(()=>c?v.filter(e=>e.label.toLowerCase().includes(c.toLowerCase())):v,[v,c]),C=a(()=>b?[t(mt,{$padding:"8px 12px",children:t(gt,{size:4})},"loading")]:y.map(e=>{const o=p?.type===e.type;return t(cc,{dataId:`option-${e.type}`,title:e.label,description:e.description,withCarret:!0,isSelected:o,onClick:()=>{u.current?.clearErrors(),h(e)}},e.type)}),[b,p?.type,y,h]),S=a(()=>b?[t(mt,{$padding:"8px 12px",children:t(gt,{size:4})},"loading")]:p?[t(Ks,{},p.type)]:[t(ft,{$height:"100%",children:t(Re,{icon:Va,title:"Instrumentation rule not selected",subTitle:"Please select an instrumentation rule to add"})},"no-data")],[b,p]);return t(fr,{ref:u,isOpen:!0,withOverlay:i,onClose:e,onSave:async()=>{const{errorMessage:e,preparedFormData:t}=g();if(e)return!1;await r.create(t,p?.type)},disableSave:!p||!m?.isFormDirty,isFormDirty:m?.isFormDirty,hideDirtyNote:!0,progress:{title:et.CREATING_INSTRUMENTATION_RULE,subTitle:et.CREATING_INSTRUMENTATION_RULE_SUBTITLE},header:{icon:Va,title:et.ADD_INSTRUMENTATION_RULE,subTitle:et.ADD_INSTRUMENTATION_RULE_DESCRIPTION},connectionIds:o&&n?{value:o,setValue:n}:void 0,search:{value:c,onChange:d},leftColumn:{width:"40%",list:C},rightColumn:{width:"60%",list:S}})},xc={groupSegmentLabel:"Namespace",itemSegmentLabel:"Source",searchPlaceholder:()=>{},groupColumnHeader:"Namespaces",fetchingGroups:{title:et.FETCHING_NAMESPACES,subTitle:et.FETCHING_NAMESPACES_SUBTITLE},noGroups:{title:"No namespaces",subTitle:"No namespaces found in this cluster"},noGroupMatchedFilter:e=>`No namespace matched the filter '${e}'`,itemColumnHeader:"Workloads",selectGroupPrompt:{title:et.SELECT_NAMESPACE,subTitle:et.SELECT_NAMESPACE_SUBTITLE},noItemsInGroupSubTitle:"No sources found in this namespace"},wc={groupSegmentLabel:"Kind",itemSegmentLabel:"Source",searchPlaceholder:e=>"Search by "+(e===Et.Namespace?"kind":"source"),groupColumnHeader:"Kinds",fetchingGroups:{title:"Fetching kinds",subTitle:"Please wait while we fetch the kinds"},noGroups:{title:"No kinds",subTitle:"No kinds found on this host"},noGroupMatchedFilter:e=>`No kind matched the filter '${e}'`,itemColumnHeader:"Sources",selectGroupPrompt:{title:"Select kind from the list",subTitle:"Pick a kind so you can select sources from it."},noItemsInGroupSubTitle:"No sources found in this kind"},Tc=e=>e?wc:xc,kc="No matches",Ec=e=>(e?"Unselect":"Select")+" all",Ic="Selected",Nc=b.div``,$c=b.div`
171
+ `,gc=({title:o,tooltip:n,list:i,noBgColor:a,purpleColors:l})=>{const[r,c]=s(!0);return e(hc,{"data-id":`collapse-${o}`,$noBgColor:a,$purpleColors:l,children:[e(mc,{$isOpen:r,children:[e(me,{$gap:10,children:[t(pe,{size:he.XS,children:o}),n&&t($e,{text:n,withIcon:!0}),t(qe,{label:i.length,status:l?Fe.Default:void 0})]}),t(yt,{icon:r?Ba:Xa,size:Ct.M,onClick:()=>c(e=>!e)})]}),r?t(ee,{children:i.length?u.toArray(i):t(ft,{$padding:"12px 0",children:t(Re,{})})}):null]})},fc=(e,t,o)=>t||o.signalType?e.filter(e=>e.displayName.toLowerCase().includes(t.toLowerCase())&&(!o.signalType||Xe(e.supportedSignals).includes(o.signalType))):e,bc=({option:e,formData:o,testResult:n,isSelected:i,onSelect:a})=>t(dc,{icon:wt(e.type).icon,title:o?.name||e.displayName,withCarret:!0,purpleColors:!!o,isSelected:i,onClick:()=>a(),children:n&&t(qe,{status:n.succeeded?Fe.Success:Fe.Error,leftIcon:n.succeeded?Ua:Va})}),vc=({listType:e,destinationOptions:o,unsavedDestinations:n})=>{const{activeForm:i,onChangeActiveForm:a}=Fl();return o?.length?t(gc,{title:xt[e].TITLE,tooltip:xt[e].DESCRIPTION,list:o.map((o,n)=>t(bc,{option:o,isSelected:i?.listType===e&&"number"!=typeof i?.unsavedIdx&&(null!=o.id&&""!==o.id?i?.option.id===o.id:i?.option.type===o.type),onSelect:()=>a({listType:e,option:o})},`${e}-${o.id??o.type}-${n}`))}):n?.length?t(gc,{purpleColors:!0,title:xt[e].TITLE,tooltip:xt[e].DESCRIPTION,list:n.map(({option:o,formData:n,testResult:l},r)=>t(bc,{option:o,formData:n,testResult:l,isSelected:i?.unsavedIdx===r&&i?.listType===e,onSelect:()=>a({listType:e,option:o,unsavedIdx:r})},`${e}-${r}`))},e):void 0};var yc;(e=>{e.SELF_HOSTED="self hosted",e.MANAGED="managed"})(yc||(yc={}));const Cc=(e,t)=>{const o=[],n=[],i=[];return e&&e.destinationCategories.categories.forEach(e=>{e.name===yc.SELF_HOSTED?n.push(...e.items):e.name===yc.MANAGED&&i.push(...e.items)}),t&&t?.potentialDestinations.forEach(t=>{for(const n of e?.destinationCategories?.categories||[]){const e=Tt(n),i=e.items.findIndex(e=>e.type===t.type);if(-1!==i){const n=Ne(t.fields,{});Object.keys(n).length&&(e.items[i].fields=e.items[i].fields.map(e=>({...e,initialValue:n[e.name]})),o.push(e.items[i]))}}}),{[bt.DETECTED]:o,[bt.SELF_HOSTED]:n,[bt.MANAGED]:i}},Sc=({onClose:e,onBack:o,onNext:n,selectedConnectionIds:l,setSelectedConnectionIds:c,initialInputs:d,withOverlay:p,disableAnimation:u})=>{const{destinationsApi:h}=Ll(),[m,g]=s(""),[f,b]=s({categoryType:null,signalType:null}),{items:v}=h.useDestinations(),{data:y,loading:C}=h.useDestinationCategories(),{data:S,loading:x}=h.usePotentialDestinations(),{activeForm:w,genericForm:T,unsavedDestinations:k,setUnsavedDestinations:E}=Fl();i(()=>{d&&E(d)},[d]);const I=C||x,N=a(()=>y?.destinationCategories?.categories??[],[y]),[$,O]=s({[bt.ALL]:[],[bt.UNSAVED]:[],[bt.EXISTS]:[],[bt.DETECTED]:[],[bt.SELF_HOSTED]:[],[bt.MANAGED]:[]});i(()=>{const e=v.map(e=>{let t;for(const o of N){const n=o.items.find(t=>t.type===e.destinationType.type);if(n){t=n;break}}const o=Ne(e.fields,{});return{id:e.id,type:e.destinationType.type,displayName:e.name||e.destinationType.displayName,selected:!0,testConnectionSupported:t?.testConnectionSupported??!1,supportedSignals:e.destinationType.supportedSignals,fields:t?t.fields.map(e=>({...e,initialValue:o[e.name]??e.initialValue})):[]}});O(t=>({...t,[bt.EXISTS]:e}))},[v,N]),i(()=>{(y||S)&&O(e=>({...e,...Cc(y,S)}))},[y,S]);const A=r(async()=>{for(const{option:e,formData:t}of k){const o=Ue(t);if(e.id){const t=Object.fromEntries(e.fields.map(e=>[e.name,e.initialValue??""])),n=Object.fromEntries(o.fields.map(e=>[e.key,e.value??""]));if(!Object.keys(t).some(e=>t[e]!==n[e])){await h.update(e.id,o);continue}}await h.create(o)}},[k,h]),R=(({isFetching:e,destinationsByCategory:o,searchText:n,filters:i})=>{const{unsavedDestinations:l}=Fl();return{width:"40%",list:a(()=>{const a=[];l.length&&a.push(t(vc,{listType:bt.UNSAVED,unsavedDestinations:l},"unsaved"));for(const e of Object.values(bt)){if(i.categoryType&&i.categoryType!==e)continue;const l=fc(o[e],n,i);l.length&&a.push(t(vc,{listType:e,destinationOptions:l},e))}return e&&a.push(t(ft,{$height:"100%",children:t(St,{title:"Fetching destinations",withSpinner:!0})},"loading-more")),a},[l,o,n,i,e])}})({isFetching:I,destinationsByCategory:$,searchText:m,filters:f}),D=(()=>{const{activeForm:e}=Fl();return{width:"60%",list:e?[t(Xs,{},e.option.type)]:[t(ft,{$height:"100%",children:t(Re,{icon:za,title:"Select destination from the list",subTitle:"Add destination so your data has somewhere to go."})},"no-data")]}})();return t(br,{isOpen:!0,withOverlay:p,disableAnimation:u,onClose:e,onBack:o?()=>o(k):void 0,onNext:n?()=>n(k):void 0,nextIsSkip:!k.length,onSave:A,disableSave:!w&&!k.length,isFetching:I,isFormDirty:k.length>0||T?.isFormDirty,hideDirtyNote:!0,progress:{title:et.CREATING_DESTINATION,subTitle:et.CREATING_DESTINATION_SUBTITLE},header:{icon:za,title:et.ADD_DESTINATIONS,subTitle:et.ADD_DESTINATION_DRAWER_DESCRIPTION},connectionIds:l&&c?{value:l,setValue:c}:void 0,search:{value:m,onChange:g},filters:t(uc,{destinationsByCategory:$,filters:f,setFilters:b}),leftColumn:R,rightColumn:D})},xc=({onClose:e,selectedConnectionIds:o,setSelectedConnectionIds:n,withOverlay:i})=>{const{instrumentationRulesApi:r}=Ll(),[c,d]=s(""),p=l(null),{selectedOption:u,onSelectOption:h,genericForm:m,validateFormData:g}=Ml(),{options:f,loading:b}=r.useRuleTypes(),v=a(()=>f.length?f:kt,[f]),y=a(()=>c?v.filter(e=>e.label.toLowerCase().includes(c.toLowerCase())):v,[v,c]),C=a(()=>b?[t(mt,{$padding:"8px 12px",children:t(gt,{size:4})},"loading")]:y.map(e=>{const o=u?.type===e.type;return t(dc,{dataId:`option-${e.type}`,title:e.label,description:e.description,withCarret:!0,isSelected:o,onClick:()=>{p.current?.clearErrors(),h(e)}},e.type)}),[b,u?.type,y,h]),S=a(()=>b?[t(mt,{$padding:"8px 12px",children:t(gt,{size:4})},"loading")]:u?[t(Ys,{},u.type)]:[t(ft,{$height:"100%",children:t(Re,{icon:Ha,title:"Instrumentation rule not selected",subTitle:"Please select an instrumentation rule to add"})},"no-data")],[b,u]);return t(br,{ref:p,isOpen:!0,withOverlay:i,onClose:e,onSave:async()=>{const{errorMessage:e,preparedFormData:t}=g();if(e)return!1;await r.create(t,u?.type)},disableSave:!u||!m?.isFormDirty,isFormDirty:m?.isFormDirty,hideDirtyNote:!0,progress:{title:et.CREATING_INSTRUMENTATION_RULE,subTitle:et.CREATING_INSTRUMENTATION_RULE_SUBTITLE},header:{icon:Ha,title:et.ADD_INSTRUMENTATION_RULE,subTitle:et.ADD_INSTRUMENTATION_RULE_DESCRIPTION},connectionIds:o&&n?{value:o,setValue:n}:void 0,search:{value:c,onChange:d},leftColumn:{width:"40%",list:C},rightColumn:{width:"60%",list:S}})},wc={groupSegmentLabel:"Namespace",itemSegmentLabel:"Source",searchPlaceholder:()=>{},groupColumnHeader:"Namespaces",fetchingGroups:{title:et.FETCHING_NAMESPACES,subTitle:et.FETCHING_NAMESPACES_SUBTITLE},noGroups:{title:"No namespaces",subTitle:"No namespaces found in this cluster"},noGroupMatchedFilter:e=>`No namespace matched the filter '${e}'`,itemColumnHeader:"Workloads",selectGroupPrompt:{title:et.SELECT_NAMESPACE,subTitle:et.SELECT_NAMESPACE_SUBTITLE},noItemsInGroupSubTitle:"No sources found in this namespace"},Tc={groupSegmentLabel:"Kind",itemSegmentLabel:"Source",searchPlaceholder:e=>"Search by "+(e===Et.Namespace?"kind":"source"),groupColumnHeader:"Kinds",fetchingGroups:{title:"Fetching kinds",subTitle:"Please wait while we fetch the kinds"},noGroups:{title:"No kinds",subTitle:"No kinds found on this host"},noGroupMatchedFilter:e=>`No kind matched the filter '${e}'`,itemColumnHeader:"Sources",selectGroupPrompt:{title:"Select kind from the list",subTitle:"Pick a kind so you can select sources from it."},noItemsInGroupSubTitle:"No sources found in this kind"},kc=e=>e?Tc:wc,Ec="No matches",Ic=e=>(e?"Unselect":"Select")+" all",Nc="Selected",$c=b.div``,Oc=b.div`
172
172
  visibility: hidden;
173
173
 
174
174
  transition: visibility 0s;
@@ -176,19 +176,19 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import n,{useEff
176
176
  transition-duration: 0s;
177
177
  }
178
178
 
179
- ${Nc}:hover & {
179
+ ${$c}:hover & {
180
180
  visibility: visible;
181
181
  }
182
- `,Oc=({workloadName:e,workloadKind:o,isChecked:n,onToggle:i,disabled:a})=>{const l=v(),r=()=>{};return t(Nc,{children:t(cc,{dataId:`source-${e}`,title:e,disabled:a,onClick:a?r:i,isChecked:n,onCheckboxChange:a?r:i,children:a?t($e,{text:"Static pods can only be instrumented with Odigos Enterprise.",children:t(qe,{label:"Enterprise only",status:Fe.Default,textSize:he.XXXS})}):t($c,{children:t(qe,{label:o,status:Fe.Info,textSize:he.XXXS,backgroundColor:l.v2.colors.blue[900]})})})})},Ac=b.div``,Rc=b.div`
182
+ `,Ac=({workloadName:e,workloadKind:o,isChecked:n,onToggle:i,disabled:a})=>{const l=v(),r=()=>{};return t($c,{children:t(dc,{dataId:`source-${e}`,title:e,disabled:a,onClick:a?r:i,isChecked:n,onCheckboxChange:a?r:i,children:a?t($e,{text:"Static pods can only be instrumented with Odigos Enterprise.",children:t(qe,{label:"Enterprise only",status:Fe.Default,textSize:he.XXXS})}):t(Oc,{children:t(qe,{label:o,status:Fe.Info,textSize:he.XXXS,backgroundColor:l.v2.colors.blue[900]})})})})},Rc=b.div``,Dc=b.div`
183
183
  visibility: ${({$visible:e})=>e?"visible":"hidden"};
184
184
 
185
185
  transition: visibility 0s;
186
186
  ${({$visible:e})=>!e&&"& * {\n transition-duration: 0s !important;\n }"}
187
187
 
188
- ${Ac}:hover & {
188
+ ${Rc}:hover & {
189
189
  visibility: visible;
190
190
  }
191
- `,Dc=({clusterId:o,namespaceName:n,checkbox:i,isFutureApps:a,selectedCounts:l,isActive:r,onActive:s,handleSourceChange:c})=>{const{isK8s:d}=S(),u=e=>{s(),c({clusterId:o,workloadId:{namespace:n},auto:e.auto,selected:e.all})};return t(Ac,{children:t(cc,{dataId:`namespace-${n}`,withCarret:!0,title:n,isSelected:r,onClick:s,isPartiallyChecked:i.partial,isChecked:i.all,onCheckboxChange:e=>u({auto:e,all:e}),children:e(me,{$gap:12,children:[d&&t(Rc,{$visible:r||a,children:t($e,{text:"Automatically instrument all workloads currently in the namespace, and all workloads that will be deployed to this namespace in the future",children:t(le,{label:"Auto",labelAlign:re.Left,size:Nt.S,value:a,onChange:e=>u({auto:e,all:e||void 0})})})}),e(me,{$gap:8,children:[t(ue,{variant:$t.Span,size:he.XXXS,color:pe.Secondary,align:"right",children:Ic}),t(qe,{label:`${l.sourced}/${l.total}`,status:r?Fe.Default:Fe.Unknown,minWidth:"42px"})]})]})})})},_c=({withCollapse:e,clusterId:o,clusterName:n,namespaces:i,selectedArea:l,setSelectedArea:r,handleSourceChange:s})=>{const c=a(()=>i.map(({name:e,totalWorkloads:i,selectedCount:a,isAllSourced:c,isSomeSourced:d,isFutureApps:u})=>t(Dc,{clusterId:o,namespaceName:e,isFutureApps:u,checkbox:{all:c||u,partial:d},selectedCounts:{sourced:a,total:i},isActive:l.clusterId===o&&l.namespaceName===e,onActive:()=>r({clusterId:o,clusterName:n,namespaceName:e}),handleSourceChange:s},`${o}#${e}`)),[o,n,i,l]);return e?t(mc,{title:n,list:c,noBgColor:!0}):c},Pc=({onClose:o,onBack:n,onNext:l,selectedConnectionIds:r,setSelectedConnectionIds:c,withOverlay:d,disableAnimation:u})=>{const{isVm:p,isConnector:h}=S(),{sourcesApi:m,snapshotsApi:g,namespacesApi:f}=Pl(),{data:b,loading:v,refetch:y}=g.useSnapshots(),{items:C,loading:x,refetch:w}=f.useNamespaces(),T=Tc(p||!!h),{selectedStreamName:k}=tt(),{progress:E,resetProgress:I}=Ot(),{isFetching:N,setIsFetching:$,setSnapshots:O,formData:A,handleSourceChange:R,handleSelectAll:D,formDiff:_,isFormDirty:P}=Gl();i(()=>{y(),w()},[]);const L=a(()=>{if(b)return b;const e=C;return e.length?{clusters:[{clusterId:Rt,clusterName:At,namespaces:e.map(e=>({name:e.name,selected:e.markedForInstrumentation&&e.dataStreamNames.includes(k),workloads:e.workloads?.map(e=>({namespace:e.id.namespace,name:e.id.name,kind:e.id.kind,region:e.id.region,selected:(e.markedForInstrumentation?.markedForInstrumentation??!1)&&(e.dataStreamNames?.includes(k)??!1)}))||[]}))}]}:null},[b,C,k]);i(()=>{$(v||x),L&&O(L)},[L,v,x,$,O]);const[F,M]=s(""),[z,B]=s(Et.Namespace),[X,U]=s({showOnlySelected:!1}),[V,H]=s({clusterId:"",clusterName:"",namespaceName:""}),j=(({isFetching:o,formData:n,handleSourceChange:i,handleSelectAll:l,selectedArea:r,setSelectedArea:s,searchText:c,searchBy:d,filters:u})=>{const{isVm:p,isConnector:h}=S(),m=Tc(p||!!h),g=a(()=>n.map(e=>{const t=[...e.namespaces].sort((e,t)=>e.name.localeCompare(t.name)).filter(e=>Hl(e,c,u)).map(e=>({name:e.name,totalWorkloads:e.workloads.length,...jl(e)}));return{clusterId:e.clusterId,clusterName:e.clusterName,visibleNamespaces:t}}),[n,c,u]),f=a(()=>{let e=!1;for(const{visibleNamespaces:t}of g)for(const{totalWorkloads:o,selectedCount:n}of t)if(e=!0,n!==o)return!1;return e},[g]),{list:b,withFilterCount:v,filteredCount:y,totalCount:C}=a(()=>{const e=g.map(({clusterId:e,clusterName:o,visibleNamespaces:n})=>n.length?t(_c,{withCollapse:g.length>1,clusterId:e,clusterName:o,namespaces:n,selectedArea:r,setSelectedArea:s,handleSourceChange:i},e):null).filter(e=>null!==e),o=g.reduce((e,{visibleNamespaces:t})=>e+t.length,0),a=n.reduce((e,{namespaces:t})=>e+t.length,0);return{list:e,withFilterCount:o!==a,filteredCount:o,totalCount:a}},[g,n,r]);return{width:"60%",header:e(me,{$width:"100%",$gap:12,$justifyContent:"space-between",children:[e(me,{$gap:8,children:[t(ue,{size:he.XS,nowrap:!0,children:m.groupColumnHeader}),t($e,{text:v?et.FILTERED_COUNT_TOOLTIP:void 0,children:t(qe,{label:`${v?`${y} / ${C}`:C}`,status:Fe.Unknown})})]}),t(ue,{"data-id":"namespaces-select-all",onClick:()=>l({boolean:!f,searchText:c,searchBy:d,filters:u}),disabled:!b.length,size:he.XS,children:Ec(f)})]}),list:b.length?b:o?[t(ft,{$height:"100%",children:t(St,{title:m.fetchingGroups.title,subTitle:m.fetchingGroups.subTitle,withSpinner:!0})},"loading")]:[t(ft,{$height:"100%",children:t(Re,c?{icon:ja,title:kc,subTitle:m.noGroupMatchedFilter(c)}:{icon:ja,title:m.noGroups.title,subTitle:m.noGroups.subTitle})},"no-data")]}})({isFetching:N,formData:A,handleSourceChange:R,handleSelectAll:D,selectedArea:V,setSelectedArea:H,searchText:z===Et.Namespace?F:"",searchBy:z,filters:X}),G=(({formData:o,handleSourceChange:n,handleSelectAll:i,selectedArea:l,searchText:r,searchBy:s,filters:c})=>{const{tier:d,isVm:u,isConnector:p,isK8s:h}=S(),m=Tc(u||!!p),g=d===It.Onprem,f=a(()=>l.value.namespaceName?o.find(({clusterId:e})=>e===l.value.clusterId)?.namespaces.find(({name:e})=>e===l.value.namespaceName):void 0,[o,l.value.clusterId,l.value.namespaceName]),b=a(()=>f?[...f.workloads].sort((e,t)=>e.name.localeCompare(t.name)).filter(e=>Ul(e,r,c)):[],[f,r,c]),v=a(()=>!!b.length&&b.every(({selected:e})=>e),[b]),y=a(()=>{if(!f)return[];const{clusterId:e}=l.value,{name:o}=f;return b.map(({name:i,selected:a,kind:l,region:r})=>{const s=h&&!g&&Vl.has(l);return t(Oc,{workloadName:i,workloadKind:l,isChecked:!s&&(a||!1),onToggle:()=>n({clusterId:e,workloadId:{namespace:o,name:i,kind:l,region:r}}),disabled:s},`${e}#${o}#${i}#${l}#${r??""}`)})},[b,f,l.value.clusterId,n,h,g]),{withFilterCount:C,filteredCount:x,totalCount:w}=a(()=>{const e=f?.workloads.length??0;return{withFilterCount:b.length!==e,filteredCount:b.length,totalCount:e}},[b,f]);return{width:"40%",header:e(me,{$width:"100%",$gap:12,$justifyContent:"space-between",children:[e(me,{$gap:8,children:[t(ue,{size:he.XS,nowrap:!0,children:l.value.namespaceName?`${l.value.namespaceName} > ${m.itemColumnHeader}`:m.itemColumnHeader}),t($e,{text:C?et.FILTERED_COUNT_TOOLTIP:void 0,children:t(qe,{label:`${C?`${x} / ${w}`:w}`,status:Fe.Unknown})})]}),t(ue,{"data-id":"workloads-select-all",onClick:()=>i({clusterId:l.value.clusterId,namespaceName:l.value.namespaceName,boolean:!v,searchText:r,searchBy:s,filters:c}),disabled:!y.length,size:he.XS,children:Ec(v)})]}),list:y.length?y:[t(ft,{$height:"100%",children:t(Re,f?r?{icon:Ha,title:kc,subTitle:(T=r,`No sources matched the filter '${T}'`)}:{icon:Ha,title:"No sources",subTitle:m.noItemsInGroupSubTitle}:{icon:Ha,title:m.selectGroupPrompt.title,subTitle:m.selectGroupPrompt.subTitle})},"no-data")]};var T})({formData:A,handleSourceChange:R,handleSelectAll:D,selectedArea:{value:V},searchText:z===Et.Source?F:"",searchBy:z,filters:X});return t(fr,{isOpen:!0,withOverlay:d,disableAnimation:u,onClose:o?()=>{I(Dt.BulkInstrumenting),o()}:void 0,onBack:n?()=>n(_):void 0,onNext:l?()=>l(_):void 0,nextIsSkip:!P,onSave:()=>m.persistV2(_),header:{icon:Ha,title:et.ADD_SOURCE,subTitle:et.ADD_SOURCES_DESCRIPTION},connectionIds:r&&c?{value:r,setValue:c}:void 0,search:{value:F,onChange:e=>{M(e),z===Et.Namespace&&H({clusterId:"",clusterName:"",namespaceName:""})},placeholder:T.searchPlaceholder(z),segment:{options:[{label:T.groupSegmentLabel,value:Et.Namespace},{label:T.itemSegmentLabel,value:Et.Source}],selected:z,setSelected:B}},filters:e(me,{$gap:8,children:[t(ue,{size:he.XXXS,color:pe.Secondary,nowrap:!0,children:"Show only:"}),t(le,{name:"filter-selected",size:Nt.S,label:Ic,value:X.showOnlySelected,onChange:e=>U(t=>({...t,showOnlySelected:e}))})]}),isFormDirty:P,isFetching:N,progress:{title:et.CREATING_SOURCES,subTitle:et.CREATING_SOURCES_SUBTITLE,percentage:E[Dt.BulkInstrumenting]?.percentage||0},leftColumn:j,rightColumn:G})},Lc={aws:Ga},Fc={lambda:"Lambda","fargate-task":"ECS","fargate-cluster":"ECS","ecs-cluster":"ECS",eks:"EKS",ec2:"EC2"},Mc=e=>e.split(/[-_]/).map(e=>e?e[0].toUpperCase()+e.slice(1):e).join(" "),zc=e=>e.provider.toUpperCase(),Bc=b.div`
191
+ `,_c=({clusterId:o,namespaceName:n,checkbox:i,isFutureApps:a,selectedCounts:l,isActive:r,onActive:s,handleSourceChange:c})=>{const{isK8s:d}=S(),p=e=>{s(),c({clusterId:o,workloadId:{namespace:n},auto:e.auto,selected:e.all})};return t(Rc,{children:t(dc,{dataId:`namespace-${n}`,withCarret:!0,title:n,isSelected:r,onClick:s,isPartiallyChecked:i.partial,isChecked:i.all,onCheckboxChange:e=>p({auto:e,all:e}),children:e(me,{$gap:12,children:[d&&t(Dc,{$visible:r||a,children:t($e,{text:"Automatically instrument all workloads currently in the namespace, and all workloads that will be deployed to this namespace in the future",children:t(le,{label:"Auto",labelAlign:re.Left,size:Nt.S,value:a,onChange:e=>p({auto:e,all:e||void 0})})})}),e(me,{$gap:8,children:[t(pe,{variant:$t.Span,size:he.XXXS,color:ue.Secondary,align:"right",children:Nc}),t(qe,{label:`${l.sourced}/${l.total}`,status:r?Fe.Default:Fe.Unknown,minWidth:"42px"})]})]})})})},Pc=({withCollapse:e,clusterId:o,clusterName:n,namespaces:i,selectedArea:l,setSelectedArea:r,handleSourceChange:s})=>{const c=a(()=>i.map(({name:e,totalWorkloads:i,selectedCount:a,isAllSourced:c,isSomeSourced:d,isFutureApps:p})=>t(_c,{clusterId:o,namespaceName:e,isFutureApps:p,checkbox:{all:c||p,partial:d},selectedCounts:{sourced:a,total:i},isActive:l.clusterId===o&&l.namespaceName===e,onActive:()=>r({clusterId:o,clusterName:n,namespaceName:e}),handleSourceChange:s},`${o}#${e}`)),[o,n,i,l]);return e?t(gc,{title:n,list:c,noBgColor:!0}):c},Lc=({onClose:o,onBack:n,onNext:l,selectedConnectionIds:r,setSelectedConnectionIds:c,withOverlay:d,disableAnimation:p})=>{const{isVm:u,isConnector:h}=S(),{sourcesApi:m,snapshotsApi:g,namespacesApi:f}=Ll(),{data:b,loading:v,refetch:y}=g.useSnapshots(),{items:C,loading:x,refetch:w}=f.useNamespaces(),T=kc(u||!!h),{selectedStreamName:k}=tt(),{progress:E,resetProgress:I}=Ot(),{isFetching:N,setIsFetching:$,setSnapshots:O,formData:A,handleSourceChange:R,handleSelectAll:D,formDiff:_,isFormDirty:P}=Wl();i(()=>{y(),w()},[]);const L=a(()=>{if(b)return b;const e=C;return e.length?{clusters:[{clusterId:Rt,clusterName:At,namespaces:e.map(e=>({name:e.name,selected:e.markedForInstrumentation&&e.dataStreamNames.includes(k),workloads:e.workloads?.map(e=>({namespace:e.id.namespace,name:e.id.name,kind:e.id.kind,region:e.id.region,selected:(e.markedForInstrumentation?.markedForInstrumentation??!1)&&(e.dataStreamNames?.includes(k)??!1)}))||[]}))}]}:null},[b,C,k]);i(()=>{$(v||x),L&&O(L)},[L,v,x,$,O]);const[F,M]=s(""),[z,B]=s(Et.Namespace),[X,U]=s({showOnlySelected:!1}),[V,H]=s({clusterId:"",clusterName:"",namespaceName:""}),j=(({isFetching:o,formData:n,handleSourceChange:i,handleSelectAll:l,selectedArea:r,setSelectedArea:s,searchText:c,searchBy:d,filters:p})=>{const{isVm:u,isConnector:h}=S(),m=kc(u||!!h),g=a(()=>n.map(e=>{const t=[...e.namespaces].sort((e,t)=>e.name.localeCompare(t.name)).filter(e=>jl(e,c,p)).map(e=>({name:e.name,totalWorkloads:e.workloads.length,...Gl(e)}));return{clusterId:e.clusterId,clusterName:e.clusterName,visibleNamespaces:t}}),[n,c,p]),f=a(()=>{let e=!1;for(const{visibleNamespaces:t}of g)for(const{totalWorkloads:o,selectedCount:n}of t)if(e=!0,n!==o)return!1;return e},[g]),{list:b,withFilterCount:v,filteredCount:y,totalCount:C}=a(()=>{const e=g.map(({clusterId:e,clusterName:o,visibleNamespaces:n})=>n.length?t(Pc,{withCollapse:g.length>1,clusterId:e,clusterName:o,namespaces:n,selectedArea:r,setSelectedArea:s,handleSourceChange:i},e):null).filter(e=>null!==e),o=g.reduce((e,{visibleNamespaces:t})=>e+t.length,0),a=n.reduce((e,{namespaces:t})=>e+t.length,0);return{list:e,withFilterCount:o!==a,filteredCount:o,totalCount:a}},[g,n,r]);return{width:"60%",header:e(me,{$width:"100%",$gap:12,$justifyContent:"space-between",children:[e(me,{$gap:8,children:[t(pe,{size:he.XS,nowrap:!0,children:m.groupColumnHeader}),t($e,{text:v?et.FILTERED_COUNT_TOOLTIP:void 0,children:t(qe,{label:`${v?`${y} / ${C}`:C}`,status:Fe.Unknown})})]}),t(pe,{"data-id":"namespaces-select-all",onClick:()=>l({boolean:!f,searchText:c,searchBy:d,filters:p}),disabled:!b.length,size:he.XS,children:Ic(f)})]}),list:b.length?b:o?[t(ft,{$height:"100%",children:t(St,{title:m.fetchingGroups.title,subTitle:m.fetchingGroups.subTitle,withSpinner:!0})},"loading")]:[t(ft,{$height:"100%",children:t(Re,c?{icon:Ga,title:Ec,subTitle:m.noGroupMatchedFilter(c)}:{icon:Ga,title:m.noGroups.title,subTitle:m.noGroups.subTitle})},"no-data")]}})({isFetching:N,formData:A,handleSourceChange:R,handleSelectAll:D,selectedArea:V,setSelectedArea:H,searchText:z===Et.Namespace?F:"",searchBy:z,filters:X}),G=(({formData:o,handleSourceChange:n,handleSelectAll:i,selectedArea:l,searchText:r,searchBy:s,filters:c})=>{const{tier:d,isVm:p,isConnector:u,isK8s:h}=S(),m=kc(p||!!u),g=d===It.Onprem,f=a(()=>l.value.namespaceName?o.find(({clusterId:e})=>e===l.value.clusterId)?.namespaces.find(({name:e})=>e===l.value.namespaceName):void 0,[o,l.value.clusterId,l.value.namespaceName]),b=a(()=>f?[...f.workloads].sort((e,t)=>e.name.localeCompare(t.name)).filter(e=>Vl(e,r,c)):[],[f,r,c]),v=a(()=>!!b.length&&b.every(({selected:e})=>e),[b]),y=a(()=>{if(!f)return[];const{clusterId:e}=l.value,{name:o}=f;return b.map(({name:i,selected:a,kind:l,region:r})=>{const s=h&&!g&&Hl.has(l);return t(Ac,{workloadName:i,workloadKind:l,isChecked:!s&&(a||!1),onToggle:()=>n({clusterId:e,workloadId:{namespace:o,name:i,kind:l,region:r}}),disabled:s},`${e}#${o}#${i}#${l}#${r??""}`)})},[b,f,l.value.clusterId,n,h,g]),{withFilterCount:C,filteredCount:x,totalCount:w}=a(()=>{const e=f?.workloads.length??0;return{withFilterCount:b.length!==e,filteredCount:b.length,totalCount:e}},[b,f]);return{width:"40%",header:e(me,{$width:"100%",$gap:12,$justifyContent:"space-between",children:[e(me,{$gap:8,children:[t(pe,{size:he.XS,nowrap:!0,children:l.value.namespaceName?`${l.value.namespaceName} > ${m.itemColumnHeader}`:m.itemColumnHeader}),t($e,{text:C?et.FILTERED_COUNT_TOOLTIP:void 0,children:t(qe,{label:`${C?`${x} / ${w}`:w}`,status:Fe.Unknown})})]}),t(pe,{"data-id":"workloads-select-all",onClick:()=>i({clusterId:l.value.clusterId,namespaceName:l.value.namespaceName,boolean:!v,searchText:r,searchBy:s,filters:c}),disabled:!y.length,size:he.XS,children:Ic(v)})]}),list:y.length?y:[t(ft,{$height:"100%",children:t(Re,f?r?{icon:ja,title:Ec,subTitle:(T=r,`No sources matched the filter '${T}'`)}:{icon:ja,title:"No sources",subTitle:m.noItemsInGroupSubTitle}:{icon:ja,title:m.selectGroupPrompt.title,subTitle:m.selectGroupPrompt.subTitle})},"no-data")]};var T})({formData:A,handleSourceChange:R,handleSelectAll:D,selectedArea:{value:V},searchText:z===Et.Source?F:"",searchBy:z,filters:X});return t(br,{isOpen:!0,withOverlay:d,disableAnimation:p,onClose:o?()=>{I(Dt.BulkInstrumenting),o()}:void 0,onBack:n?()=>n(_):void 0,onNext:l?()=>l(_):void 0,nextIsSkip:!P,onSave:()=>m.persistV2(_),header:{icon:ja,title:et.ADD_SOURCE,subTitle:et.ADD_SOURCES_DESCRIPTION},connectionIds:r&&c?{value:r,setValue:c}:void 0,search:{value:F,onChange:e=>{M(e),z===Et.Namespace&&H({clusterId:"",clusterName:"",namespaceName:""})},placeholder:T.searchPlaceholder(z),segment:{options:[{label:T.groupSegmentLabel,value:Et.Namespace},{label:T.itemSegmentLabel,value:Et.Source}],selected:z,setSelected:B}},filters:e(me,{$gap:8,children:[t(pe,{size:he.XXXS,color:ue.Secondary,nowrap:!0,children:"Show only:"}),t(le,{name:"filter-selected",size:Nt.S,label:Nc,value:X.showOnlySelected,onChange:e=>U(t=>({...t,showOnlySelected:e}))})]}),isFormDirty:P,isFetching:N,progress:{title:et.CREATING_SOURCES,subTitle:et.CREATING_SOURCES_SUBTITLE,percentage:E[Dt.BulkInstrumenting]?.percentage||0},leftColumn:j,rightColumn:G})},Fc={aws:Wa},Mc={lambda:"Lambda","fargate-task":"ECS","fargate-cluster":"ECS","ecs-cluster":"ECS",eks:"EKS",ec2:"EC2"},zc=e=>e.split(/[-_]/).map(e=>e?e[0].toUpperCase()+e.slice(1):e).join(" "),Bc=e=>e.provider.toUpperCase(),Xc=b.div`
192
192
  display: flex;
193
193
  flex-direction: column;
194
194
  gap: 8px;
@@ -196,7 +196,7 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import n,{useEff
196
196
  padding: 8px 12px;
197
197
  border-radius: 16px 0 0 16px;
198
198
  background-color: ${({theme:e})=>e.v2.colors.silver[900]};
199
- `,Xc=b.button`
199
+ `,Uc=b.button`
200
200
  display: flex;
201
201
  align-items: center;
202
202
  gap: 12px;
@@ -212,7 +212,7 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import n,{useEff
212
212
  &:hover {
213
213
  background-color: ${({theme:e})=>e.v2.colors.silver[800]};
214
214
  }
215
- `,Uc=b.div`
215
+ `,Vc=b.div`
216
216
  display: flex;
217
217
  align-items: center;
218
218
  justify-content: center;
@@ -221,13 +221,13 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import n,{useEff
221
221
  border-radius: 8px;
222
222
  background-color: ${({theme:e})=>e.v2.colors.silver[900]};
223
223
  flex-shrink: 0;
224
- `,Vc=b.div`
224
+ `,Hc=b.div`
225
225
  display: flex;
226
226
  flex-direction: column;
227
227
  gap: 2px;
228
228
  flex: 1;
229
229
  min-width: 0;
230
- `,Hc=({providers:o,selectedProvider:n,onSelect:i})=>{const a=v();return o.length?t(Bc,{children:o.map(o=>{const l=(e=>Lc[e.provider]??Wa)(o),r=o.provider===n,s=(e=>{const t=e.features.find(e=>e.key===_t.Discovery);if(!t)return"";const o=[],n=new Set;for(const e of t.types){const t=e.name.includes(".")?e.name.slice(e.name.indexOf(".")+1):e.name,i=Fc[t]??Mc(t);n.has(i)||(n.add(i),o.push(i))}return o.join(", ")})(o);return e(Xc,{type:"button",$selected:r,onClick:()=>i(o.provider),"data-id":`cloud-connector-provider-${o.provider}`,children:[t(Uc,{children:t(l,{size:24})}),e(Vc,{children:[t(ue,{size:he.S,weight:400,lineHeight:"24px",color:pe.Primary,children:zc(o)}),s&&t(ue,{size:he.XXXS,weight:400,lineHeight:"normal",color:pe.Secondary,children:s})]}),t(La,{size:18,fill:a.v2.colors.silver[300]})]},o.provider)})}):t(ue,{size:he.XS,color:pe.Secondary,children:"No providers available."})},jc=b.div`
230
+ `,jc=({providers:o,selectedProvider:n,onSelect:i})=>{const a=v();return o.length?t(Xc,{children:o.map(o=>{const l=(e=>Fc[e.provider]??Ka)(o),r=o.provider===n,s=(e=>{const t=e.features.find(e=>e.key===_t.Discovery);if(!t)return"";const o=[],n=new Set;for(const e of t.types){const t=e.name.includes(".")?e.name.slice(e.name.indexOf(".")+1):e.name,i=Mc[t]??zc(t);n.has(i)||(n.add(i),o.push(i))}return o.join(", ")})(o);return e(Uc,{type:"button",$selected:r,onClick:()=>i(o.provider),"data-id":`cloud-connector-provider-${o.provider}`,children:[t(Vc,{children:t(l,{size:24})}),e(Hc,{children:[t(pe,{size:he.S,weight:400,lineHeight:"24px",color:ue.Primary,children:Bc(o)}),s&&t(pe,{size:he.XXXS,weight:400,lineHeight:"normal",color:ue.Secondary,children:s})]}),t(Fa,{size:18,fill:a.v2.colors.silver[300]})]},o.provider)})}):t(pe,{size:he.XS,color:ue.Secondary,children:"No providers available."})},Gc=b.div`
231
231
  display: flex;
232
232
  flex-direction: column;
233
233
  gap: 8px;
@@ -237,15 +237,15 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import n,{useEff
237
237
  background-color: ${({theme:e})=>e.v2.colors.silver[900]};
238
238
  border: 1px solid ${({theme:e})=>e.v2.colors.silver[700]};
239
239
  cursor: default;
240
- `,Gc=b.div`
240
+ `,Wc=b.div`
241
241
  display: flex;
242
242
  align-items: center;
243
243
  gap: 4px;
244
244
  width: 100%;
245
- `,Wc=b.div`
245
+ `,Kc=b.div`
246
246
  flex: 1;
247
247
  min-width: 0;
248
- `,Kc=b.div`
248
+ `,Yc=b.div`
249
249
  width: 100%;
250
250
  max-height: 145px;
251
251
  overflow: auto;
@@ -267,39 +267,39 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import n,{useEff
267
267
  transition: background-color 0.2s ease;
268
268
  }
269
269
 
270
- ${jc}:hover & {
270
+ ${Gc}:hover & {
271
271
  scrollbar-color: ${({theme:e})=>e.v2.colors.silver[300]} transparent;
272
272
  }
273
273
 
274
- ${jc}:hover &::-webkit-scrollbar-thumb {
274
+ ${Gc}:hover &::-webkit-scrollbar-thumb {
275
275
  background-color: ${({theme:e})=>e.v2.colors.silver[300]};
276
276
  }
277
- `,Yc=b.pre`
277
+ `,qc=b.pre`
278
278
  margin: 0;
279
279
  font-family: ${({theme:e})=>e.font_family.code};
280
280
  font-size: 12px;
281
281
  line-height: 20px;
282
282
  color: ${({theme:e})=>e.v2.colors.green[400]};
283
283
  white-space: pre;
284
- `,qc=({policy:o})=>{const n=v(),{CopyButton:i}=Pt();return e(jc,{children:[e(Gc,{children:[t(Ka,{size:16,fill:n.v2.colors.silver[200]}),t(Wc,{children:t(ue,{size:he.XXS,color:pe.Primary,children:et.CLOUD_CONNECTOR_POLICY_PREVIEW})}),t(i,{value:o,size:Ct.XS})]}),t(Kc,{children:t(Yc,{children:o})})]})};var Jc;(e=>{e.DiscoveryOnly="discovery-only",e.DiscoveryInstrumentation="discovery-instrumentation",e.Custom="custom"})(Jc||(Jc={}));const Zc=[{id:Jc.DiscoveryOnly,title:et.CLOUD_CONNECTOR_PERMISSION_DISCOVERY_ONLY_TITLE,description:et.CLOUD_CONNECTOR_PERMISSION_DISCOVERY_ONLY_DESC,featureKeys:[_t.Discovery]},{id:Jc.DiscoveryInstrumentation,title:et.CLOUD_CONNECTOR_PERMISSION_DISCOVERY_INSTRUMENTATION_TITLE,description:et.CLOUD_CONNECTOR_PERMISSION_DISCOVERY_INSTRUMENTATION_DESC,featureKeys:[_t.Discovery,_t.Instrumentation]},{id:Jc.Custom,title:et.CLOUD_CONNECTOR_PERMISSION_CUSTOM_TITLE,description:et.CLOUD_CONNECTOR_PERMISSION_CUSTOM_DESC,featureKeys:[]}],Qc=(e,t)=>e.features?.find(e=>e.key===t),ed=e=>{if(!e)return[];const t=Qc(e,_t.Discovery),o=Qc(e,_t.Instrumentation);return t?t.types.map(e=>{const t=o?.types.find(t=>t.name===e.name);return{typeName:e.name,displayName:e.displayName||e.name,discoveryPermissions:e.permissions??[],instrumentationPermissions:t?t.permissions??[]:void 0}}):[]},td=()=>{const e=new Set,t=[];return{out:t,add:o=>o?.forEach(o=>{o&&!e.has(o)&&(e.add(o),t.push(o))})}},od=(e,t,o)=>{const n=t===Jc.Custom?((e,t)=>{if(!e)return[];const o=ed(e),n=Qc(e,_t.Discovery),i=o.some(e=>t[e.typeName]?.discovery),{out:a,add:l}=td();return l(e.auth?.permissions),i&&l(n?.permissions),o.forEach(e=>{const o=t[e.typeName];o?.discovery&&l(e.discoveryPermissions),o?.instrumentation&&l(e.instrumentationPermissions)}),a})(e,o??{}):((e,t)=>{if(!e)return[];const o=Zc.find(e=>e.id===t)?.featureKeys??[],{out:n,add:i}=td();return i(e.auth?.permissions),e.features?.forEach(e=>{e.enabled&&o.includes(e.key)&&(i(e.permissions),e.types?.forEach(e=>{!1!==e.implemented&&i(e.permissions)}))}),n})(e,t),i={Version:"2012-10-17",Statement:[{Sid:"OdigosCloudConnector",Effect:"Allow",Action:n,Resource:"*"}]};return JSON.stringify(i,null,2)},nd=b.div`
284
+ `,Jc=({policy:o})=>{const n=v(),{CopyButton:i}=Pt();return e(Gc,{children:[e(Wc,{children:[t(Ya,{size:16,fill:n.v2.colors.silver[200]}),t(Kc,{children:t(pe,{size:he.XXS,color:ue.Primary,children:et.CLOUD_CONNECTOR_POLICY_PREVIEW})}),t(i,{value:o,size:Ct.XS})]}),t(Yc,{children:t(qc,{children:o})})]})};var Zc;(e=>{e.DiscoveryOnly="discovery-only",e.DiscoveryInstrumentation="discovery-instrumentation",e.Custom="custom"})(Zc||(Zc={}));const Qc=[{id:Zc.DiscoveryOnly,title:et.CLOUD_CONNECTOR_PERMISSION_DISCOVERY_ONLY_TITLE,description:et.CLOUD_CONNECTOR_PERMISSION_DISCOVERY_ONLY_DESC,featureKeys:[_t.Discovery]},{id:Zc.DiscoveryInstrumentation,title:et.CLOUD_CONNECTOR_PERMISSION_DISCOVERY_INSTRUMENTATION_TITLE,description:et.CLOUD_CONNECTOR_PERMISSION_DISCOVERY_INSTRUMENTATION_DESC,featureKeys:[_t.Discovery,_t.Instrumentation]},{id:Zc.Custom,title:et.CLOUD_CONNECTOR_PERMISSION_CUSTOM_TITLE,description:et.CLOUD_CONNECTOR_PERMISSION_CUSTOM_DESC,featureKeys:[]}],ed=(e,t)=>e.features?.find(e=>e.key===t),td=e=>{if(!e)return[];const t=ed(e,_t.Discovery),o=ed(e,_t.Instrumentation);return t?t.types.map(e=>{const t=o?.types.find(t=>t.name===e.name);return{typeName:e.name,displayName:e.displayName||e.name,discoveryPermissions:e.permissions??[],instrumentationPermissions:t?t.permissions??[]:void 0}}):[]},od=()=>{const e=new Set,t=[];return{out:t,add:o=>o?.forEach(o=>{o&&!e.has(o)&&(e.add(o),t.push(o))})}},nd=(e,t,o)=>{const n=t===Zc.Custom?((e,t)=>{if(!e)return[];const o=td(e),n=ed(e,_t.Discovery),i=o.some(e=>t[e.typeName]?.discovery),{out:a,add:l}=od();return l(e.auth?.permissions),i&&l(n?.permissions),o.forEach(e=>{const o=t[e.typeName];o?.discovery&&l(e.discoveryPermissions),o?.instrumentation&&l(e.instrumentationPermissions)}),a})(e,o??{}):((e,t)=>{if(!e)return[];const o=Qc.find(e=>e.id===t)?.featureKeys??[],{out:n,add:i}=od();return i(e.auth?.permissions),e.features?.forEach(e=>{e.enabled&&o.includes(e.key)&&(i(e.permissions),e.types?.forEach(e=>{!1!==e.implemented&&i(e.permissions)}))}),n})(e,t),i={Version:"2012-10-17",Statement:[{Sid:"OdigosCloudConnector",Effect:"Allow",Action:n,Resource:"*"}]};return JSON.stringify(i,null,2)},id=b.div`
285
285
  width: 100%;
286
286
  padding: 12px 16px;
287
287
  border-radius: 12px;
288
288
  background-color: ${({theme:e})=>e.v2.colors.silver[900]};
289
289
  border: 1px solid ${({theme:e})=>e.v2.colors.silver[700]};
290
- `,id=b.div`
290
+ `,ad=b.div`
291
291
  display: grid;
292
292
  grid-template-columns: minmax(0, 1fr) 120px 150px;
293
293
  align-items: center;
294
294
  row-gap: 16px;
295
295
  column-gap: 8px;
296
- `,ad=b.div`
296
+ `,ld=b.div`
297
297
  display: flex;
298
298
  align-items: center;
299
299
  min-width: 0;
300
- `,ld=b(ad)`
300
+ `,rd=b(ld)`
301
301
  justify-content: center;
302
- `,rd={discovery:!1,instrumentation:!1},sd=({provider:o,capabilities:i,onCapabilitiesChange:a})=>{const l=ed(o),r=(e,t)=>{a({...i,[e]:t})};return l.length?t(nd,{children:e(id,{children:[t(ad,{children:t(ue,{size:he.XXS,color:pe.Secondary,children:et.CLOUD_CONNECTOR_CUSTOM_COL_TYPE})}),t(ld,{children:t(ue,{size:he.XXS,color:pe.Secondary,children:et.CLOUD_CONNECTOR_CUSTOM_COL_DISCOVERY})}),t(ld,{children:t(ue,{size:he.XXS,color:pe.Secondary,children:et.CLOUD_CONNECTOR_CUSTOM_COL_INSTRUMENTATION})}),l.map(o=>{const a=i[o.typeName]??rd,l=void 0!==o.instrumentationPermissions,s=a.instrumentation||a.discovery;return e(n.Fragment,{children:[t(ad,{children:t(ue,{size:he.XXS,weight:400,lineHeight:"normal",color:pe.Primary,children:o.displayName})}),t(ld,{children:t(le,{name:`cloud-connector-custom-${o.typeName}-discovery`,size:Nt.S,value:s,disabled:a.instrumentation,onChange:e=>r(o.typeName,{discovery:e,instrumentation:a.instrumentation})})}),t(ld,{children:t(le,{name:`cloud-connector-custom-${o.typeName}-instrumentation`,size:Nt.S,value:a.instrumentation,disabled:!l,onChange:e=>r(o.typeName,{discovery:!!e||a.discovery,instrumentation:e})})})]},o.typeName)})]})}):null},cd=b.div`
302
+ `,sd={discovery:!1,instrumentation:!1},cd=({provider:o,capabilities:i,onCapabilitiesChange:a})=>{const l=td(o),r=(e,t)=>{a({...i,[e]:t})};return l.length?t(id,{children:e(ad,{children:[t(ld,{children:t(pe,{size:he.XXS,color:ue.Secondary,children:et.CLOUD_CONNECTOR_CUSTOM_COL_TYPE})}),t(rd,{children:t(pe,{size:he.XXS,color:ue.Secondary,children:et.CLOUD_CONNECTOR_CUSTOM_COL_DISCOVERY})}),t(rd,{children:t(pe,{size:he.XXS,color:ue.Secondary,children:et.CLOUD_CONNECTOR_CUSTOM_COL_INSTRUMENTATION})}),l.map(o=>{const a=i[o.typeName]??sd,l=void 0!==o.instrumentationPermissions,s=a.instrumentation||a.discovery;return e(n.Fragment,{children:[t(ld,{children:t(pe,{size:he.XXS,weight:400,lineHeight:"normal",color:ue.Primary,children:o.displayName})}),t(rd,{children:t(le,{name:`cloud-connector-custom-${o.typeName}-discovery`,size:Nt.S,value:s,disabled:a.instrumentation,onChange:e=>r(o.typeName,{discovery:e,instrumentation:a.instrumentation})})}),t(rd,{children:t(le,{name:`cloud-connector-custom-${o.typeName}-instrumentation`,size:Nt.S,value:a.instrumentation,disabled:!l,onChange:e=>r(o.typeName,{discovery:!!e||a.discovery,instrumentation:e})})})]},o.typeName)})]})}):null},dd=b.div`
303
303
  display: flex;
304
304
  flex-direction: column;
305
305
  gap: 8px;
@@ -308,7 +308,7 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import n,{useEff
308
308
  padding: 8px;
309
309
  border-radius: 0 16px 16px 0;
310
310
  background-color: ${({theme:e})=>e.v2.colors.silver[900]};
311
- `,dd=b.div`
311
+ `,pd=b.div`
312
312
  display: flex;
313
313
  flex-direction: column;
314
314
  gap: 8px;
@@ -321,7 +321,7 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import n,{useEff
321
321
  padding: 4px 12px 4px 4px;
322
322
  border-radius: 8px;
323
323
  background-color: ${({theme:e})=>e.v2.colors.purple[900]};
324
- `,pd=b.div`
324
+ `,hd=b.div`
325
325
  display: flex;
326
326
  align-items: center;
327
327
  justify-content: center;
@@ -330,30 +330,30 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import n,{useEff
330
330
  border-radius: 6px;
331
331
  flex-shrink: 0;
332
332
  background-color: ${({theme:e})=>e.v2.colors.purple[800]};
333
- `,hd=({message:o})=>{const n=v();return e(ud,{children:[t(pd,{children:t(Ya,{size:24})}),t(ue,{size:he.XXS,color:n.v2.colors.purple[300],children:o})]})},md=({provider:o,selectedPermission:n,onSelect:i,capabilities:a,onCapabilitiesChange:l})=>t(cd,{children:Zc.map(r=>{const s=r.id===n,c=r.id===Jc.Custom,d=s?e(dd,{children:[c&&t(sd,{provider:o,capabilities:a,onCapabilitiesChange:l}),t(qc,{policy:od(o,r.id,a)})]}):void 0,u=s?t(hd,{message:c?et.CLOUD_CONNECTOR_POLICY_NOTE_CUSTOM:et.CLOUD_CONNECTOR_POLICY_NOTE}):void 0;return t(Lt,{"data-id":`cloud-connector-permission-${r.id}`,title:r.title,description:r.description,checked:s,onChange:()=>i(r.id),body:d,footerNote:u},r.id)})}),gd=b.div`
333
+ `,md=({message:o})=>{const n=v();return e(ud,{children:[t(hd,{children:t(qa,{size:24})}),t(pe,{size:he.XXS,color:n.v2.colors.purple[300],children:o})]})},gd=({provider:o,selectedPermission:n,onSelect:i,capabilities:a,onCapabilitiesChange:l})=>t(dd,{children:Qc.map(r=>{const s=r.id===n,c=r.id===Zc.Custom,d=s?e(pd,{children:[c&&t(cd,{provider:o,capabilities:a,onCapabilitiesChange:l}),t(Jc,{policy:nd(o,r.id,a)})]}):void 0,p=s?t(md,{message:c?et.CLOUD_CONNECTOR_POLICY_NOTE_CUSTOM:et.CLOUD_CONNECTOR_POLICY_NOTE}):void 0;return t(Lt,{"data-id":`cloud-connector-permission-${r.id}`,title:r.title,description:r.description,checked:s,onChange:()=>i(r.id),body:d,footerNote:p},r.id)})}),fd=b.div`
334
334
  display: flex;
335
335
  flex-direction: column;
336
336
  padding: 16px;
337
- `,fd=b.div`
337
+ `,bd=b.div`
338
338
  display: flex;
339
339
  flex-direction: column;
340
340
  gap: 16px;
341
341
  padding: 16px;
342
342
  border-radius: 16px;
343
343
  background-color: ${({theme:e})=>e.v2.colors.silver[1e3]};
344
- `,bd=b.div`
344
+ `,vd=b.div`
345
345
  display: flex;
346
346
  flex-direction: column;
347
347
  gap: 4px;
348
- `,vd=b.div`
348
+ `,yd=b.div`
349
349
  display: flex;
350
350
  align-items: stretch;
351
351
  width: 100%;
352
- `,yd=b.div`
352
+ `,Cd=b.div`
353
353
  display: flex;
354
354
  flex: 0 0 40%;
355
355
  min-width: 0;
356
- `,Cd=()=>{const{providers:o,genericForm:n}=Wl(),[l,r]=s(!0),c=a(()=>o.find(e=>e.provider===n.formData.provider),[o,n.formData.provider]);return i(()=>{!n.formData.provider&&o.length>0&&n.handleFormChange("provider",o[0].provider)},[o,n.formData.provider,n]),i(()=>{n.formData.permission||n.handleFormChange("permission",Jc.DiscoveryInstrumentation)},[n.formData.permission,n]),t(gd,{children:e(fd,{children:[e(bd,{children:[t(ue,{size:he.S,weight:500,lineHeight:"24px",color:pe.Primary,children:et.CLOUD_CONNECTOR_SELECT_PROVIDER_TITLE}),t(ue,{size:he.XXS,weight:400,lineHeight:"normal",color:pe.Secondary,children:et.CLOUD_CONNECTOR_SELECT_PROVIDER_SUBTITLE})]}),l&&t(Le,{fullWidth:!0,smallIcon:!0,status:Fe.Info,message:et.CLOUD_CONNECTOR_PERMISSIONS_NOTE,action:{"data-id":"cloud-connector-permissions-note-close",label:Ft.CLOSE,onClick:()=>r(!1)}}),e(vd,{children:[t(yd,{children:t(Hc,{providers:o,selectedProvider:n.formData.provider,onSelect:e=>n.handleFormChange("provider",e)})}),t(md,{provider:c,selectedPermission:n.formData.permission,onSelect:e=>n.handleFormChange("permission",e),capabilities:n.formData.customCapabilities,onCapabilitiesChange:e=>n.handleFormChange("customCapabilities",e)})]})]})})},Sd=b.div`
356
+ `,Sd=()=>{const{providers:o,genericForm:n}=Kl(),[l,r]=s(!0),c=a(()=>o.find(e=>e.provider===n.formData.provider),[o,n.formData.provider]);return i(()=>{!n.formData.provider&&o.length>0&&n.handleFormChange("provider",o[0].provider)},[o,n.formData.provider,n]),i(()=>{n.formData.permission||n.handleFormChange("permission",Zc.DiscoveryInstrumentation)},[n.formData.permission,n]),t(fd,{children:e(bd,{children:[e(vd,{children:[t(pe,{size:he.S,weight:500,lineHeight:"24px",color:ue.Primary,children:et.CLOUD_CONNECTOR_SELECT_PROVIDER_TITLE}),t(pe,{size:he.XXS,weight:400,lineHeight:"normal",color:ue.Secondary,children:et.CLOUD_CONNECTOR_SELECT_PROVIDER_SUBTITLE})]}),l&&t(Le,{fullWidth:!0,smallIcon:!0,status:Fe.Info,message:et.CLOUD_CONNECTOR_PERMISSIONS_NOTE,action:{"data-id":"cloud-connector-permissions-note-close",label:Ft.CLOSE,onClick:()=>r(!1)}}),e(yd,{children:[t(Cd,{children:t(jc,{providers:o,selectedProvider:n.formData.provider,onSelect:e=>n.handleFormChange("provider",e)})}),t(gd,{provider:c,selectedPermission:n.formData.permission,onSelect:e=>n.handleFormChange("permission",e),capabilities:n.formData.customCapabilities,onCapabilitiesChange:e=>n.handleFormChange("customCapabilities",e)})]})]})})},xd=b.div`
357
357
  display: flex;
358
358
  flex-direction: column;
359
359
  gap: 16px;
@@ -361,12 +361,12 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import n,{useEff
361
361
  padding: 12px;
362
362
  border-radius: 8px;
363
363
  background-color: ${({theme:e})=>e.v2.colors.silver[900]};
364
- `,xd=b.div`
364
+ `,wd=b.div`
365
365
  display: flex;
366
366
  align-items: center;
367
367
  gap: 12px;
368
368
  width: 100%;
369
- `,wd=b.div`
369
+ `,Td=b.div`
370
370
  display: flex;
371
371
  align-items: center;
372
372
  justify-content: center;
@@ -375,41 +375,41 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import n,{useEff
375
375
  height: 24px;
376
376
  border-radius: 16px;
377
377
  background-color: ${({theme:e})=>e.v2.colors.purple[500]};
378
- `,Td=b.div`
378
+ `,kd=b.div`
379
379
  display: flex;
380
380
  flex: 1;
381
381
  flex-direction: column;
382
382
  gap: 2px;
383
383
  min-width: 0;
384
- `,kd=b.div`
384
+ `,Ed=b.div`
385
385
  display: flex;
386
386
  flex-direction: column;
387
387
  gap: 10px;
388
388
  width: 100%;
389
389
  padding-left: 32px;
390
- `,Ed=({"data-id":o,step:n,title:i,description:a,children:l})=>e(Sd,{"data-id":o,children:[e(xd,{children:[t(wd,{children:t(ue,{size:he.XXS,weight:400,lineHeight:"20px",color:pe.Primary,children:n})}),e(Td,{children:[t(ue,{size:he.S,weight:400,lineHeight:"24px",color:pe.Primary,children:i}),t(ue,{size:he.XXS,weight:400,lineHeight:"normal",color:pe.Secondary,children:a})]})]}),l&&t(kd,{children:l})]});var Id,Nd;(e=>{e.AssumeRole="assume-role",e.StaticKeys="static-keys"})(Id||(Id={})),(e=>{e.CloudFormation="cloudformation",e.Terraform="terraform",e.AwsCli="aws-cli",e.Manual="manual"})(Nd||(Nd={}));const $d=[{id:Id.AssumeRole,label:et.CLOUD_CONNECTOR_AUTH_ASSUME_ROLE,note:et.CLOUD_CONNECTOR_AUTH_ASSUME_ROLE_NOTE},{id:Id.StaticKeys,label:et.CLOUD_CONNECTOR_AUTH_STATIC_KEYS,note:et.CLOUD_CONNECTOR_AUTH_STATIC_KEYS_NOTE}],Od=[{id:Nd.CloudFormation,label:et.CLOUD_CONNECTOR_SETUP_METHOD_CLOUDFORMATION},{id:Nd.Terraform,label:et.CLOUD_CONNECTOR_SETUP_METHOD_TERRAFORM},{id:Nd.AwsCli,label:et.CLOUD_CONNECTOR_SETUP_METHOD_AWS_CLI},{id:Nd.Manual,label:et.CLOUD_CONNECTOR_SETUP_METHOD_MANUAL}],Ad={[Nd.CloudFormation]:{description:"Launch the stack in your AWS account. It creates the IAM role with the policy above and returns the Role ARN.",steps:["Open the AWS CloudFormation console.","Choose Create stack → With new resources.","Upload the template below as the stack template.","Review the permissions, then deploy the stack.","Open the stack's Outputs tab.","Copy the RoleArn value and paste it below."],code:["aws cloudformation deploy \\"," --stack-name odigos-connector \\"," --template-file odigos-connector.yaml \\"," --capabilities CAPABILITY_NAMED_IAM"].join("\n")},[Nd.Terraform]:{description:"Run the Odigos connector module to provision the IAM role as code and expose the Role ARN as an output.",steps:["Add the odigos-connector module to your configuration.","Run terraform init to download the module.","Run terraform apply and confirm the plan.","Read the role_arn value from the apply output.","Copy the Role ARN and paste it below."],code:["terraform init","terraform apply","terraform output -raw role_arn"].join("\n")},[Nd.AwsCli]:{description:"Create the IAM role from your terminal using the AWS CLI, then return the Role ARN.",steps:["Make sure the AWS CLI is configured (aws configure).","Create the role with the trust policy.","Attach the permissions policy to the role.","Copy the ARN from the create-role output and paste it below."],code:["aws iam get-role \\"," --role-name OdigosConnectorRole \\"," --query 'Role.Arn' \\"," --output text"].join("\n")},[Nd.Manual]:{description:"Create the IAM role by hand in the AWS Console using the trust policy below, then return the Role ARN.",steps:["Open the AWS Console → IAM → Roles → Create role.","Select Custom trust policy.","Paste the trust policy below.","Attach the permissions policy from the previous step.","Name the role and create it.","Open the role summary and copy the Role ARN below."],code:["{",' "Version": "2012-10-17",',' "Statement": ['," {",' "Effect": "Allow",',' "Principal": { "AWS": "arn:aws:iam::657451249928:root" },',' "Action": "sts:AssumeRole",',' "Condition": {',' "StringEquals": { "sts:ExternalId": "odigos-connector" }'," }"," }"," ]","}"].join("\n")}},Rd=b.div`
390
+ `,Id=({"data-id":o,step:n,title:i,description:a,children:l})=>e(xd,{"data-id":o,children:[e(wd,{children:[t(Td,{children:t(pe,{size:he.XXS,weight:400,lineHeight:"20px",color:ue.Primary,children:n})}),e(kd,{children:[t(pe,{size:he.S,weight:400,lineHeight:"24px",color:ue.Primary,children:i}),t(pe,{size:he.XXS,weight:400,lineHeight:"normal",color:ue.Secondary,children:a})]})]}),l&&t(Ed,{children:l})]});var Nd,$d;(e=>{e.AssumeRole="assume-role",e.StaticKeys="static-keys"})(Nd||(Nd={})),(e=>{e.CloudFormation="cloudformation",e.Terraform="terraform",e.AwsCli="aws-cli",e.Manual="manual"})($d||($d={}));const Od=[{id:Nd.AssumeRole,label:et.CLOUD_CONNECTOR_AUTH_ASSUME_ROLE,note:et.CLOUD_CONNECTOR_AUTH_ASSUME_ROLE_NOTE},{id:Nd.StaticKeys,label:et.CLOUD_CONNECTOR_AUTH_STATIC_KEYS,note:et.CLOUD_CONNECTOR_AUTH_STATIC_KEYS_NOTE}],Ad=[{id:$d.CloudFormation,label:et.CLOUD_CONNECTOR_SETUP_METHOD_CLOUDFORMATION},{id:$d.Terraform,label:et.CLOUD_CONNECTOR_SETUP_METHOD_TERRAFORM},{id:$d.AwsCli,label:et.CLOUD_CONNECTOR_SETUP_METHOD_AWS_CLI},{id:$d.Manual,label:et.CLOUD_CONNECTOR_SETUP_METHOD_MANUAL}],Rd={[$d.CloudFormation]:{description:"Launch the stack in your AWS account. It creates the IAM role with the policy above and returns the Role ARN.",steps:["Open the AWS CloudFormation console.","Choose Create stack → With new resources.","Upload the template below as the stack template.","Review the permissions, then deploy the stack.","Open the stack's Outputs tab.","Copy the RoleArn value and paste it below."],code:["aws cloudformation deploy \\"," --stack-name odigos-connector \\"," --template-file odigos-connector.yaml \\"," --capabilities CAPABILITY_NAMED_IAM"].join("\n")},[$d.Terraform]:{description:"Run the Odigos connector module to provision the IAM role as code and expose the Role ARN as an output.",steps:["Add the odigos-connector module to your configuration.","Run terraform init to download the module.","Run terraform apply and confirm the plan.","Read the role_arn value from the apply output.","Copy the Role ARN and paste it below."],code:["terraform init","terraform apply","terraform output -raw role_arn"].join("\n")},[$d.AwsCli]:{description:"Create the IAM role from your terminal using the AWS CLI, then return the Role ARN.",steps:["Make sure the AWS CLI is configured (aws configure).","Create the role with the trust policy.","Attach the permissions policy to the role.","Copy the ARN from the create-role output and paste it below."],code:["aws iam get-role \\"," --role-name OdigosConnectorRole \\"," --query 'Role.Arn' \\"," --output text"].join("\n")},[$d.Manual]:{description:"Create the IAM role by hand in the AWS Console using the trust policy below, then return the Role ARN.",steps:["Open the AWS Console → IAM → Roles → Create role.","Select Custom trust policy.","Paste the trust policy below.","Attach the permissions policy from the previous step.","Name the role and create it.","Open the role summary and copy the Role ARN below."],code:["{",' "Version": "2012-10-17",',' "Statement": ['," {",' "Effect": "Allow",',' "Principal": { "AWS": "arn:aws:iam::657451249928:root" },',' "Action": "sts:AssumeRole",',' "Condition": {',' "StringEquals": { "sts:ExternalId": "odigos-connector" }'," }"," }"," ]","}"].join("\n")}},Dd=b.div`
391
391
  display: flex;
392
392
  align-items: stretch;
393
393
  gap: 10px;
394
394
  width: 100%;
395
- `,Dd=b.div`
395
+ `,_d=b.div`
396
396
  display: flex;
397
397
  flex: 2 1 0;
398
398
  flex-direction: column;
399
399
  gap: 12px;
400
400
  min-width: 0;
401
401
  padding: 12px 0;
402
- `,_d=b.div`
402
+ `,Pd=b.div`
403
403
  display: flex;
404
404
  flex-direction: column;
405
405
  gap: 8px;
406
406
  width: 100%;
407
- `,Pd=b.div`
407
+ `,Ld=b.div`
408
408
  display: flex;
409
409
  align-items: center;
410
410
  gap: 12px;
411
411
  width: 100%;
412
- `,Ld=b.div`
412
+ `,Fd=b.div`
413
413
  display: flex;
414
414
  align-items: center;
415
415
  justify-content: center;
@@ -418,7 +418,7 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import n,{useEff
418
418
  height: 24px;
419
419
  border-radius: 16px;
420
420
  background-color: ${({theme:e})=>e.v2.colors.purple[700]};
421
- `,Fd=b.div`
421
+ `,Md=b.div`
422
422
  display: flex;
423
423
  flex: 3 1 0;
424
424
  flex-direction: column;
@@ -427,60 +427,60 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import n,{useEff
427
427
  border-radius: 12px;
428
428
  background-color: ${({theme:e})=>e.v2.colors.silver[1e3]};
429
429
  border: 1px solid ${({theme:e})=>e.v2.colors.silver[700]};
430
- `,Md=b.div`
430
+ `,zd=b.div`
431
431
  display: flex;
432
432
  align-items: center;
433
433
  justify-content: flex-end;
434
434
  width: 100%;
435
- `,zd=b.div`
435
+ `,Bd=b.div`
436
436
  flex: 1;
437
437
  width: 100%;
438
438
  min-height: 200px;
439
439
  max-height: 260px;
440
440
  overflow: auto;
441
441
  padding: 0 12px 12px;
442
- `,Bd=b.pre`
442
+ `,Xd=b.pre`
443
443
  margin: 0;
444
444
  font-family: ${({theme:e})=>e.font_family.code};
445
445
  font-size: 12px;
446
446
  line-height: 20px;
447
447
  color: ${({theme:e})=>e.v2.colors.green[400]};
448
448
  white-space: pre;
449
- `,Xd=({step:o,setupMethod:n})=>{const i=v(),{CopyButton:a}=Pt(),{description:l,steps:r,code:s}=(e=>Ad[e]??Ad[Nd.CloudFormation])(n);return t(Ed,{"data-id":"cloud-connector-create-role",step:o,title:et.CLOUD_CONNECTOR_CREATE_ROLE_TITLE,description:l,children:e(Rd,{children:[e(Dd,{children:[t(ue,{size:he.XXS,weight:400,lineHeight:"20px",color:pe.Primary,children:et.CLOUD_CONNECTOR_CREATE_ROLE_STEPS_HEADING}),t(_d,{children:r.map((o,a)=>e(Pd,{children:[t(Ld,{children:t(ue,{size:he.XXS,weight:400,lineHeight:"20px",color:i.v2.colors.purple[200],children:a+1})}),t(ue,{size:he.XXS,weight:400,lineHeight:"20px",color:pe.Primary,children:o})]},`${n}-step-${a}`))})]}),e(Fd,{children:[t(Md,{children:t(a,{value:s,size:Ct.XS})}),t(zd,{children:t(Bd,{children:s})})]})]})})},Ud=b.div`
449
+ `,Ud=({step:o,setupMethod:n})=>{const i=v(),{CopyButton:a}=Pt(),{description:l,steps:r,code:s}=(e=>Rd[e]??Rd[$d.CloudFormation])(n);return t(Id,{"data-id":"cloud-connector-create-role",step:o,title:et.CLOUD_CONNECTOR_CREATE_ROLE_TITLE,description:l,children:e(Dd,{children:[e(_d,{children:[t(pe,{size:he.XXS,weight:400,lineHeight:"20px",color:ue.Primary,children:et.CLOUD_CONNECTOR_CREATE_ROLE_STEPS_HEADING}),t(Pd,{children:r.map((o,a)=>e(Ld,{children:[t(Fd,{children:t(pe,{size:he.XXS,weight:400,lineHeight:"20px",color:i.v2.colors.purple[200],children:a+1})}),t(pe,{size:he.XXS,weight:400,lineHeight:"20px",color:ue.Primary,children:o})]},`${n}-step-${a}`))})]}),e(Md,{children:[t(zd,{children:t(a,{value:s,size:Ct.XS})}),t(Bd,{children:t(Xd,{children:s})})]})]})})},Vd=b.div`
450
450
  display: flex;
451
451
  flex-direction: column;
452
452
  gap: 16px;
453
453
  width: 100%;
454
- `,Vd=b.div`
454
+ `,Hd=b.div`
455
455
  display: flex;
456
456
  flex-wrap: wrap;
457
457
  gap: 24px;
458
458
  width: 100%;
459
- `,Hd=b.div`
459
+ `,jd=b.div`
460
460
  display: flex;
461
461
  flex: 1 1 calc(50% - 12px);
462
462
  min-width: 0;
463
- `,jd=b.div`
463
+ `,Gd=b.div`
464
464
  display: flex;
465
465
  width: 100%;
466
466
  max-width: 479px;
467
- `,Gd=({step:o})=>{const{genericForm:n,providers:i}=Wl(),{provider:l,authMethod:r,awsAccountId:s,credentials:c}=n.formData,d=a(()=>i.find(e=>e.provider===l),[i,l]),u=a(()=>((e,t)=>{const o=e?.auth?.methods?.find(e=>e.id===t);if(!o)return[];const n=new Map(e?.auth?.methods?.map(e=>[e.id,e])),i=new Set,a=[],l=e=>e?.forEach(e=>{e.name&&!i.has(e.name)&&(i.add(e.name),a.push(e))});return o.baseMethods?.forEach(e=>l(n.get(e)?.fields)),l(o.fields),a})(d,r),[d,r]);return t(Ed,{"data-id":"cloud-connector-enter-arn",step:o,title:et.CLOUD_CONNECTOR_ENTER_ARN_TITLE,description:et.CLOUD_CONNECTOR_ENTER_ARN_SUBTITLE,children:e(Ud,{children:[t(jd,{children:t(Te,{name:"cloud-connector-aws-account-id",width:"100%",label:et.CLOUD_CONNECTOR_FIELD_ACCOUNT_ID_LABEL,placeholder:et.CLOUD_CONNECTOR_FIELD_ACCOUNT_ID_PLACEHOLDER,helpMessage:et.CLOUD_CONNECTOR_FIELD_ACCOUNT_ID_HELP,value:s,onChange:e=>n.handleFormChange("awsAccountId",e.target.value)})}),u.length>0&&t(Vd,{children:u.map(e=>t(Hd,{children:t(Te,{name:`cloud-connector-credential-${e.name}`,width:"100%",type:e.secret?Mt.Password:Mt.Text,label:e.displayName||e.name,required:e.required,tooltip:e.tooltip||void 0,helpMessage:e.tooltip||void 0,placeholder:e.displayName||e.name,value:c[e.name]??"",onChange:t=>{return o=e.name,i=t.target.value,void n.handleFormChange("credentials",{...c,[o]:i});var o,i}})},e.name))})]})})},Wd=b.div`
467
+ `,Wd=({step:o})=>{const{genericForm:n,providers:i}=Kl(),{provider:l,authMethod:r,awsAccountId:s,credentials:c}=n.formData,d=a(()=>i.find(e=>e.provider===l),[i,l]),p=a(()=>((e,t)=>{const o=e?.auth?.methods?.find(e=>e.id===t);if(!o)return[];const n=new Map(e?.auth?.methods?.map(e=>[e.id,e])),i=new Set,a=[],l=e=>e?.forEach(e=>{e.name&&!i.has(e.name)&&(i.add(e.name),a.push(e))});return o.baseMethods?.forEach(e=>l(n.get(e)?.fields)),l(o.fields),a})(d,r),[d,r]);return t(Id,{"data-id":"cloud-connector-enter-arn",step:o,title:et.CLOUD_CONNECTOR_ENTER_ARN_TITLE,description:et.CLOUD_CONNECTOR_ENTER_ARN_SUBTITLE,children:e(Vd,{children:[t(Gd,{children:t(Te,{name:"cloud-connector-aws-account-id",width:"100%",label:et.CLOUD_CONNECTOR_FIELD_ACCOUNT_ID_LABEL,placeholder:et.CLOUD_CONNECTOR_FIELD_ACCOUNT_ID_PLACEHOLDER,helpMessage:et.CLOUD_CONNECTOR_FIELD_ACCOUNT_ID_HELP,value:s,onChange:e=>n.handleFormChange("awsAccountId",e.target.value)})}),p.length>0&&t(Hd,{children:p.map(e=>t(jd,{children:t(Te,{name:`cloud-connector-credential-${e.name}`,width:"100%",type:e.secret?Mt.Password:Mt.Text,label:e.displayName||e.name,required:e.required,tooltip:e.tooltip||void 0,helpMessage:e.tooltip||void 0,placeholder:e.displayName||e.name,value:c[e.name]??"",onChange:t=>{return o=e.name,i=t.target.value,void n.handleFormChange("credentials",{...c,[o]:i});var o,i}})},e.name))})]})})},Kd=b.div`
468
468
  display: flex;
469
469
  flex-direction: column;
470
470
  padding: 16px;
471
- `,Kd=b.div`
471
+ `,Yd=b.div`
472
472
  display: flex;
473
473
  flex-direction: column;
474
474
  gap: 12px;
475
475
  padding: 16px 16px 12px;
476
476
  border-radius: 16px;
477
477
  background-color: ${({theme:e})=>e.v2.colors.silver[1e3]};
478
- `,Yd=b.div`
478
+ `,qd=b.div`
479
479
  display: flex;
480
480
  align-items: center;
481
481
  gap: 8px;
482
482
  width: 100%;
483
- `,qd=b.button`
483
+ `,Jd=b.button`
484
484
  display: flex;
485
485
  align-items: center;
486
486
  justify-content: center;
@@ -497,24 +497,24 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import n,{useEff
497
497
  &:hover {
498
498
  background-color: ${({theme:e})=>e.v2.colors.silver[900]};
499
499
  }
500
- `,Jd=b.div`
500
+ `,Zd=b.div`
501
501
  display: flex;
502
502
  flex: 1;
503
503
  flex-direction: column;
504
504
  gap: 4px;
505
505
  min-width: 0;
506
- `,Zd=b.div`
506
+ `,Qd=b.div`
507
507
  display: flex;
508
508
  align-items: center;
509
509
  gap: 4px;
510
510
  padding: 8px 0 8px 2px;
511
- `,Qd=({onBack:o})=>{const n=v(),{genericForm:a}=Wl(),l=a.formData.authMethod,r=a.formData.setupMethod;i(()=>{l||a.handleFormChange("authMethod",Id.AssumeRole)},[l,a]),i(()=>{r||a.handleFormChange("setupMethod",Nd.CloudFormation)},[r,a]);const s=$d.find(e=>e.id===l)?.note;return t(Wd,{children:e(Kd,{children:[e(Yd,{children:[t(qd,{"data-id":"cloud-connector-setup-back",type:"button",onClick:o,"aria-label":et.CLOUD_CONNECTOR_SETUP_CREDENTIALS_TITLE,children:t(qa,{size:24})}),e(Jd,{children:[t(ue,{size:he.S,weight:500,lineHeight:"24px",color:pe.Primary,children:et.CLOUD_CONNECTOR_SETUP_CREDENTIALS_TITLE}),t(ue,{size:he.XXS,weight:400,lineHeight:"normal",color:pe.Secondary,children:et.CLOUD_CONNECTOR_SETUP_CREDENTIALS_SUBTITLE})]})]}),e(Ed,{"data-id":"cloud-connector-auth-method",step:1,title:et.CLOUD_CONNECTOR_AUTH_TITLE,description:et.CLOUD_CONNECTOR_AUTH_SUBTITLE,children:[t(ve,{"data-id":"cloud-connector-auth-method-segment",size:_e.S,selected:l,setSelected:e=>a.handleFormChange("authMethod",e),options:$d.map(e=>({value:e.id,label:e.label}))}),s&&e(Zd,{children:[t(Ja,{size:16,fill:n.v2.colors.silver[200]}),t(ue,{size:he.XXXS,weight:400,lineHeight:"normal",color:pe.Secondary,children:s})]})]}),t(Ed,{"data-id":"cloud-connector-setup-method",step:2,title:et.CLOUD_CONNECTOR_SETUP_METHOD_TITLE,description:et.CLOUD_CONNECTOR_SETUP_METHOD_SUBTITLE,children:t(ve,{"data-id":"cloud-connector-setup-method-segment",size:_e.S,selected:r,setSelected:e=>a.handleFormChange("setupMethod",e),options:Od.map(e=>({value:e.id,label:e.label}))})}),t(Xd,{step:3,setupMethod:r}),t(Gd,{step:4})]})})},eu=b.div`
511
+ `,ep=({onBack:o})=>{const n=v(),{genericForm:a}=Kl(),l=a.formData.authMethod,r=a.formData.setupMethod;i(()=>{l||a.handleFormChange("authMethod",Nd.AssumeRole)},[l,a]),i(()=>{r||a.handleFormChange("setupMethod",$d.CloudFormation)},[r,a]);const s=Od.find(e=>e.id===l)?.note;return t(Kd,{children:e(Yd,{children:[e(qd,{children:[t(Jd,{"data-id":"cloud-connector-setup-back",type:"button",onClick:o,"aria-label":et.CLOUD_CONNECTOR_SETUP_CREDENTIALS_TITLE,children:t(Ja,{size:24})}),e(Zd,{children:[t(pe,{size:he.S,weight:500,lineHeight:"24px",color:ue.Primary,children:et.CLOUD_CONNECTOR_SETUP_CREDENTIALS_TITLE}),t(pe,{size:he.XXS,weight:400,lineHeight:"normal",color:ue.Secondary,children:et.CLOUD_CONNECTOR_SETUP_CREDENTIALS_SUBTITLE})]})]}),e(Id,{"data-id":"cloud-connector-auth-method",step:1,title:et.CLOUD_CONNECTOR_AUTH_TITLE,description:et.CLOUD_CONNECTOR_AUTH_SUBTITLE,children:[t(ve,{"data-id":"cloud-connector-auth-method-segment",size:_e.S,selected:l,setSelected:e=>a.handleFormChange("authMethod",e),options:Od.map(e=>({value:e.id,label:e.label}))}),s&&e(Qd,{children:[t(Za,{size:16,fill:n.v2.colors.silver[200]}),t(pe,{size:he.XXXS,weight:400,lineHeight:"normal",color:ue.Secondary,children:s})]})]}),t(Id,{"data-id":"cloud-connector-setup-method",step:2,title:et.CLOUD_CONNECTOR_SETUP_METHOD_TITLE,description:et.CLOUD_CONNECTOR_SETUP_METHOD_SUBTITLE,children:t(ve,{"data-id":"cloud-connector-setup-method-segment",size:_e.S,selected:r,setSelected:e=>a.handleFormChange("setupMethod",e),options:Ad.map(e=>({value:e.id,label:e.label}))})}),t(Ud,{step:3,setupMethod:r}),t(Wd,{step:4})]})})},tp=b.div`
512
512
  display: flex;
513
513
  flex-direction: column;
514
514
  flex: 1;
515
515
  min-height: 0;
516
516
  padding: 16px;
517
- `,tu=b.div`
517
+ `,op=b.div`
518
518
  display: flex;
519
519
  flex-direction: column;
520
520
  flex: 1;
@@ -522,13 +522,13 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import n,{useEff
522
522
  padding: 16px;
523
523
  border-radius: 16px;
524
524
  background-color: ${({theme:e})=>e.v2.colors.silver[1e3]};
525
- `,ou=b.div`
525
+ `,np=b.div`
526
526
  display: flex;
527
527
  flex: 1;
528
528
  align-items: center;
529
529
  justify-content: center;
530
530
  width: 100%;
531
- `,nu=b.div`
531
+ `,ip=b.div`
532
532
  display: flex;
533
533
  flex-direction: column;
534
534
  align-items: center;
@@ -538,7 +538,7 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import n,{useEff
538
538
  padding: 24px 8px;
539
539
  border-radius: 8px;
540
540
  background-color: ${({theme:e})=>e.v2.colors.silver[800]};
541
- `,iu=b.div`
541
+ `,ap=b.div`
542
542
  display: flex;
543
543
  flex-direction: column;
544
544
  align-items: center;
@@ -547,7 +547,7 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import n,{useEff
547
547
  padding: 16px;
548
548
  border-radius: 12px;
549
549
  background-color: ${({theme:e})=>e.v2.colors.silver[900]};
550
- `,au=b.div`
550
+ `,lp=b.div`
551
551
  display: flex;
552
552
  align-items: center;
553
553
  justify-content: center;
@@ -556,7 +556,7 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import n,{useEff
556
556
  height: 39px;
557
557
  border-radius: 20px;
558
558
  background-color: ${({theme:e})=>e.v2.colors.red[500]};
559
- `,lu=b.div`
559
+ `,rp=b.div`
560
560
  display: flex;
561
561
  align-items: flex-start;
562
562
  gap: 8px;
@@ -566,7 +566,7 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import n,{useEff
566
566
  padding: 12px;
567
567
  border-radius: 8px;
568
568
  background-color: ${({theme:e})=>e.v2.colors.silver[1e3]};
569
- `,ru=b.pre`
569
+ `,sp=b.pre`
570
570
  flex: 1;
571
571
  min-width: 0;
572
572
  margin: 0;
@@ -576,25 +576,25 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import n,{useEff
576
576
  color: ${({theme:e})=>e.v2.colors.silver[200]};
577
577
  white-space: pre-wrap;
578
578
  word-break: break-word;
579
- `,su=b.div`
579
+ `,cp=b.div`
580
580
  display: flex;
581
581
  flex-direction: column;
582
582
  gap: 12px;
583
583
  width: 100%;
584
- `,cu=b.div`
584
+ `,dp=b.div`
585
585
  display: flex;
586
586
  flex-wrap: wrap;
587
587
  gap: 24px;
588
588
  padding: 0 2px;
589
- `,du=b.div`
589
+ `,pp=b.div`
590
590
  display: flex;
591
591
  gap: 6px;
592
592
  min-width: 0;
593
- `,uu=b.div`
593
+ `,up=b.div`
594
594
  display: flex;
595
595
  flex-direction: column;
596
596
  gap: 8px;
597
- `,pu=b.div`
597
+ `,hp=b.div`
598
598
  display: flex;
599
599
  flex-direction: column;
600
600
  gap: 6px;
@@ -602,7 +602,7 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import n,{useEff
602
602
  border-radius: 12px;
603
603
  border: 1px solid ${({theme:e,$passed:t})=>t?e.v2.colors.silver[700]:e.v2.colors.red[800]};
604
604
  background-color: ${({theme:e})=>e.v2.colors.silver[900]};
605
- `,hu=({isTesting:o,error:n,result:i})=>{const l=v(),{CopyButton:r}=Pt(),s=a(()=>i?.checks.filter(e=>!e.passed)??[],[i]),c=!(o||!n&&(!i||i.success)),d=n?et.CLOUD_CONNECTOR_CONNECTION_FAILED_DEFAULT:s[0]?.remediation||s[0]?.message||et.CLOUD_CONNECTOR_CONNECTION_FAILED_DEFAULT,u=n||s.map(e=>e.message).filter(Boolean).join("\n");return t(eu,{children:t(tu,{children:o?t(ou,{children:t(nu,{children:t(St,{withVisual:!0,withGradient:!0,title:et.CLOUD_CONNECTOR_TESTING_TITLE,titleSize:he.XS})})}):c?t(ou,{children:e(iu,{children:[t(au,{children:t(Ua,{size:20,fill:l.v2.colors.black[500]})}),t(ue,{size:he.XS,weight:400,lineHeight:"20px",color:pe.Primary,children:et.CLOUD_CONNECTOR_CONNECTION_FAILED_TITLE}),t(ue,{align:"center",size:he.XXXS,weight:400,lineHeight:"normal",color:pe.Secondary,children:d}),u&&e(lu,{children:[t(ru,{children:u}),t(r,{value:u,size:Ct.XS})]})]})}):i?e(su,{children:[t(qe,{status:Fe.Success,label:et.CLOUD_CONNECTOR_VALIDATE_SUCCESS,leftIcon:Xa,fullWidth:!0}),(i.accountId||i.identity)&&e(cu,{children:[i.accountId&&e(du,{children:[e(ue,{size:he.XXS,weight:500,color:pe.Secondary,children:[et.CLOUD_CONNECTOR_VALIDATE_ACCOUNT,":"]}),t(ue,{size:he.XXS,weight:400,color:pe.Primary,children:i.accountId})]}),i.identity&&e(du,{children:[e(ue,{size:he.XXS,weight:500,color:pe.Secondary,children:[et.CLOUD_CONNECTOR_VALIDATE_IDENTITY,":"]}),t(ue,{size:he.XXS,weight:400,color:pe.Primary,children:i.identity})]})]}),i.checks.length>0&&t(uu,{children:i.checks.map(o=>e(pu,{$passed:o.passed,children:[t(qe,{status:o.passed?Fe.Success:Fe.Error,label:o.displayName,leftIcon:o.passed?Xa:Ua}),o.message&&t(ue,{size:he.XXS,weight:400,lineHeight:"normal",color:pe.Secondary,children:o.message}),!o.passed&&o.remediation&&t(ue,{size:he.XXS,weight:400,lineHeight:"normal",color:pe.Primary,children:o.remediation})]},o.name))})]}):t(ou,{children:t(ue,{size:he.XXS,weight:400,color:pe.Secondary,children:et.CLOUD_CONNECTOR_VALIDATE_EMPTY})})})})};var mu;(e=>{e[e.SelectProvider=1]="SelectProvider",e[e.Config=2]="Config",e[e.Validate=3]="Validate"})(mu||(mu={}));const gu=mu.SelectProvider,fu=mu.Validate,bu=({onClose:o,withOverlay:n,onCreateCloudConnector:i,onCreated:l})=>{const{providers:c,genericForm:d}=Wl(),[u,p]=s(gu),[h,m]=s(!1),[g,f]=s(!1),[b,v]=s(void 0),[y,C]=s(void 0),[S,x]=s(void 0),w=d.isFormDirty,T=u===gu,k=u===fu,E=r(()=>{w&&!h?m(!0):(m(!1),o?.())},[w,h,o]),I=r(()=>{x(void 0),C(void 0),v(void 0),p(e=>e>gu?e-1:e)},[]),N=r(()=>{if(x(void 0),u===mu.SelectProvider){if(!d.formData.provider)return void x("Please select a cloud provider");if(!d.formData.permission)return void x("Please select a permission level")}p(e=>e<fu?e+1:e)},[u,d.formData.provider,d.formData.permission]),$=r(async()=>{if(x(void 0),C(void 0),v(void 0),p(mu.Validate),!i)return;const{provider:e,permission:t,customCapabilities:o,awsAccountId:n,credentials:a,name:r}=d.formData,s=((e,t,o)=>{const n=ed(e),i=[];return n.forEach(e=>{const n=void 0!==e.instrumentationPermissions;let a=!1,l=!1;switch(t){case Jc.DiscoveryOnly:a=!0;break;case Jc.DiscoveryInstrumentation:a=!0,l=n;break;case Jc.Custom:{const t=o[e.typeName];a=!!t?.discovery,l=!!t?.instrumentation;break}}(a||l)&&i.push({type:e.typeName,discovery:a,instrumentation:l,computePlatforms:!1})}),i})(c.find(t=>t.provider===e),t,o);f(!0);try{const t=await i({provider:e,displayName:r,credentials:a,expectedAccountId:n,capabilities:s});if(t.created)return void l?.(t.connectorId);v(t.test)}catch(e){C(e instanceof Error?e.message:"Failed to create connector")}finally{f(!1)}},[i,l,d.formData,c]),O=g,A=k&&!g&&(!!y||!!b&&!b.success),R=a(()=>S?{status:Fe.Error,message:S}:void 0,[S]),D=a(()=>T?{"data-id":"cloud-connector-cancel",label:Ft.CANCEL,variant:be.Secondary,onClick:E,disabled:O}:{"data-id":"cloud-connector-back",label:Ft.BACK,variant:be.Text,leftIcon:qa,onClick:I,disabled:O},[T,E,I,O]),_=a(()=>{if(k){if(g)return;return A?{"data-id":"cloud-connector-retry",label:Ft.RETRY,variant:be.Primary,rightIcon:Za,onClick:$}:void 0}return u===mu.Config?{"data-id":"cloud-connector-verify",label:Ft.VERIFY_AND_CREATE_CONNECTOR,variant:be.Primary,onClick:$,disabled:O}:{"data-id":"cloud-connector-next",label:Ft.NEXT,variant:be.Primary,onClick:N,disabled:O}},[k,g,A,u,$,N,O]),P=a(()=>[D,_].filter(Boolean),[D,_]);return e(ce,{width:br,isOpen:!0,hideOverlay:!O&&!n,header:{icon:Wa,title:et.CREATE_CLOUD_CONNECTOR,onClose:o?E:void 0,onCloseDisabled:O},footer:{note:R,actions:P},children:[u===mu.SelectProvider&&t(Cd,{}),u===mu.Config&&t(Qd,{onBack:I}),u===mu.Validate&&t(hu,{isTesting:g,error:y,result:b}),t(vr,{isOpen:h,onClose:()=>m(!1),onApprove:()=>o?.()})]})},vu=(e,t)=>{const o=[{id:"type",title:et.TYPE,label:t.label},{id:"status",title:et.STATUS,badge:{status:e.disabled?Fe.Unknown:Fe.Success,label:e.disabled?et.DISABLED:et.ENABLED}}],n=e.signals?.map(e=>{let t=e.toLowerCase();return t=`${t.charAt(0).toUpperCase()}${t.slice(1)}`,t}).join(", ");return n&&o.push({id:"signals",title:et.SIGNALS_FOR_PROCESSING,label:n}),e.name&&o.push({id:"name",title:et.NAME,label:e.name}),e.notes&&o.push({id:"notes",title:et.NOTES,label:e.notes}),o},yu=({onClose:n,actionId:l})=>{const c=v(),{isVm:d}=S(),{actionsApi:u}=Pl(),{items:p,refetch:h}=u.useActions(),{options:m}=u.useActionTypes(),{selectedOption:g,loadAction:f,validateFormData:b,genericForm:y}=_l();i(()=>{h()},[]);const[C,x]=s(!1),[w,T]=s(!1),[k,E]=s(null),I=C&&!!y?.isFormDirty,N=a(()=>p?.find(e=>zt(e)===l),[l,p]),$=a(()=>m.find(({type:e})=>e===N?.type)??Bt.find(({type:e})=>e===N?.type)??null,[m,N?.type]);i(()=>{N&&f(N,$)},[N,$]);const O=r(()=>{N&&x(!0)},[N]),A=r(()=>{N&&(f(N,$),x(!1))},[N,$,f]),R=r(()=>{I?E("close"):n()},[I,n]),D=r(()=>{I?E("cancel"):A()},[I,A]),_=r(()=>{const e=k;E(null),"close"===e?(A(),n()):A()},[k,A,n]),P=r(async()=>{if(N){const{errorMessage:e,preparedFormData:t}=b();e||(await u.update(N.id,t),x(!1))}},[N,b,u]),L=r(()=>{N&&T(!0)},[N]),F=r(async()=>{N&&(await u.remove(N.id,N.type),n())},[N,u,n]);if(!N||!$)return null;const M=(e=>{const t=[],{type:o,fields:n}=e,i=e=>({status:e?Fe.Success:Fe.Unknown,label:e?"True":"False",invertColors:!0});if(o===Ae.K8sAttributes&&(t.push({id:"collectContainerAttributes",title:"Collect Container Attributes",badge:i(n.collectContainerAttributes)}),t.push({id:"collectReplicaSetAttributes",title:"Collect ReplicaSet Attributes",badge:i(n.collectReplicaSetAttributes)}),t.push({id:"collectWorkloadId",title:"Collect Workload ID",badge:i(n.collectWorkloadId)}),t.push({id:"collectClusterId",title:"Collect Cluster ID",badge:i(n.collectClusterId)}),n.labelsAttributes?.forEach(({labelKey:e,attributeKey:o,from:i,fromSources:a},l)=>{const r=a?.length?a.join(", "):i||ae.Pod,s=(n.labelsAttributes?.length??0)>1?`Label #${l+1} `:"Label ";t.push({id:`label-${l}-key`,title:`${s}Key`,label:e}),t.push({id:`label-${l}-attr`,title:`${s}Attribute Key`,label:o}),t.push({id:`label-${l}-from`,title:`${s}From`,label:r})}),n.annotationsAttributes?.forEach(({annotationKey:e,attributeKey:o,from:i,fromSources:a},l)=>{const r=a?.length?a.join(", "):i||ae.Pod,s=(n.annotationsAttributes?.length??0)>1?`Annotation #${l+1} `:"Annotation ";t.push({id:`annotation-${l}-key`,title:`${s}Key`,label:e}),t.push({id:`annotation-${l}-attr`,title:`${s}Attribute Key`,label:o}),t.push({id:`annotation-${l}-from`,title:`${s}From`,label:r})})),o===Ae.AddClusterInfo&&(t.push({id:"overwriteExistingValues",title:"Overwrite Existing Values",badge:i(n.overwriteExistingValues)}),n.clusterAttributes?.forEach(({attributeName:e,attributeStringValue:o},n)=>{t.push({id:`cluster-attr-${n}`,title:e,label:o})})),o===Ae.DeleteAttributes&&n.attributeNamesToDelete?.forEach((e,o)=>{t.push({id:`del-attr-${o}`,title:"Attribute"+((n.attributeNamesToDelete?.length??0)>1?` #${o+1}`:""),label:e})}),o===Ae.RenameAttributes&&Object.entries(n.renames||{}).forEach(([e,o],n)=>{t.push({id:`rename-${n}`,title:e,label:o})}),o===Ae.PiiMasking&&n.piiCategories?.forEach((e,o)=>{t.push({id:`pii-${o}`,title:"Category"+((n.piiCategories?.length??0)>1?` #${o+1}`:""),label:e})}),o===Ae.ExtractAttribute){const e=n.extractAttribute?.extractions??[];e.forEach(({targetAttributeName:o,lookupKey:n,dataFormat:i,regex:a},l)=>{const r=e.length>1?`Extraction #${l+1} `:"Extraction ";t.push({id:`extract-${l}-target`,title:`${r}New Attribute Name`,label:o||"-"}),n&&t.push({id:`extract-${l}-lookupKey`,title:`${r}Lookup Key`,label:n}),i&&t.push({id:`extract-${l}-format`,title:`${r}Data Format`,label:i}),a&&t.push({id:`extract-${l}-regex`,title:`${r}Regex`,label:a})})}return o===Ae.URLTemplatization&&n.urlTemplatizationRulesGroups?.forEach((e,o)=>{const i=(n.urlTemplatizationRulesGroups?.length??0)>1?`Group #${o+1} `:"Group ";e.filterK8sNamespace&&t.push({id:`group-${o}-ns`,title:`${i}Namespace`,label:e.filterK8sNamespace}),e.workloadFilters?.forEach((n,a)=>{const l=[n.kind,n.name].filter(Boolean).join("/");l&&t.push({id:`group-${o}-wf-${a}`,title:`${i}Workload${(e.workloadFilters?.length??0)>1?` #${a+1}`:""}`,label:l})});const a=e.templatizationRules?.map(e=>e.template).filter(Boolean).join(", ");a&&t.push({id:`group-${o}-templates`,title:`${i}Templates`,label:a}),e.notes&&t.push({id:`group-${o}-notes`,title:`${i}Notes`,label:e.notes})}),t})(N);return e(o,{children:[t(ce,{isOpen:!0,header:{icon:Vt(N.type),title:$.label,onClose:R,actions:[{id:"edit-action-btn-edit",label:Ft.EDIT,icon:Da,active:C,onClick:O},{id:"edit-action-btn-delete",label:Ft.DELETE,icon:Ea,color:c.v2.colors.red[500],active:w,onClick:L}]},footer:{actions:C?[{"data-id":"edit-action-btn-cancel",label:Ft.CANCEL,variant:be.Secondary,onClick:D},{"data-id":"edit-action-btn-save",label:Ft.SAVE,variant:be.Primary,onClick:P}]:[]},children:t(mt,{$padding:"4px 12px 12px",children:C&&g?t(Fs,{}):t(ee,{$gap:16,children:e(Xt,{bgTint:"1000",children:[e(Xt,{bgTint:"900",children:[!d&&t(Ut,{conditions:N.conditions||[]}),t(Xt,{bgTint:"800",cellsPerRow:2,items:vu(N,$)})]}),!!M?.length&&t(Xt,{bgTint:"900",richTitle:{title:"Configuration"},withCollapse:!0,collapseIsDefaultOpen:!0,children:t(Xt,{bgTint:"800",cellsPerRow:2,items:M})})]})})})}),t(yr,{target:"action",isOpen:w,onClose:()=>T(!1),onApprove:F}),t(vr,{isOpen:null!==k,onClose:()=>E(null),onApprove:_})]})},Cu=({onClose:o,connections:n,selectedConnectionIds:r,setSelectedConnectionIds:c})=>{const{configApi:d}=Pl(),[u,p]=s(""),[h,m]=s({showOnlySelected:!1}),g=a(()=>n.filter(e=>{const t=!u||e.name.toLowerCase().includes(u.toLowerCase()),o=!h.showOnlySelected||h.showOnlySelected&&r.includes(e.id);return t&&o}),[n.length,r.length,u,h]),f=e=>{c(t=>t.includes(e)?t.filter(t=>t!==e):[...t,e])},b=1===r.length?r[0]:void 0,{data:v,loading:y}=d.useEffectiveConfig(b?{id:b}:void 0,{skip:!b}),C=a(()=>{if(b&&v)return{rollout:{automaticRolloutDisabled:v.rollout?.automaticRolloutDisabled??!1}}},[b,v]),{formData:S,handleFormChange:x,areFormValuesEqual:w,resetFormData:T}=Ht(C||{rollout:{automaticRolloutDisabled:!1}}),k=l(T);k.current=T,i(()=>{C&&k.current(C)},[C]);const E=a(()=>r.length>1||void 0!==C&&!w(C,S),[r.length,C,S]);return t(fr,{isOpen:!0,onClose:o,onSave:async()=>await(d.applyConfigurations?.(S,r))??void 0,header:{icon:Qa,title:"Cluster Configuration"},connectionIds:{value:r,setValue:c},search:{placeholder:"Search by cluster name",value:u,onChange:p},filters:e(me,{$gap:8,children:[t(ue,{size:he.XXXS,color:pe.Secondary,nowrap:!0,children:"Show only:"}),t(le,{size:Nt.S,label:"Selected",value:h.showOnlySelected,onChange:e=>m(t=>({...t,showOnlySelected:e}))})]}),isFormDirty:E,isFetching:y,leftColumn:{width:"35%",header:e(me,{$width:"100%",$gap:12,$justifyContent:"space-between",children:[e(me,{$gap:8,children:[t(ue,{size:he.XS,children:"Clusters"}),t(qe,{label:g.length,status:Fe.Unknown})]}),e(me,{$gap:8,children:[t(ue,{size:he.XXXS,color:pe.Secondary,align:"right",children:"Selected clusters"}),t(qe,{label:`${r.length}/${g.length}`,status:Fe.Unknown})]})]}),list:g.map(e=>t(cc,{title:e.name,isChecked:r.includes(e.id),onClick:()=>f(e.id),onCheckboxChange:()=>f(e.id)},e.id))},rightColumn:{width:"65%",header:t(ue,{size:he.XS,children:"Configurations"}),list:[t(le,{label:"Automatic rollout disabled",tooltip:"Odigos automatically triggers a one-time rollout for workloads when instrumenting or uninstrumenting, ensuring that changes are applied without requiring manual intervention. When automatic rollout is disabled, Odigos will not restart workloads, and users will need to manually trigger rollouts after adding or removing sources.",value:S.rollout?.automaticRolloutDisabled||!1,onChange:e=>x("rollout.automaticRolloutDisabled",e)},"automatic-rollout-disabled")]}})},Su=e=>{const t=[{id:"type",title:et.TYPE,label:e.destinationType.displayName},{id:"status",title:et.STATUS,badge:{status:e.disabled?Fe.Unknown:Fe.Success,label:e.disabled?et.DISABLED:et.ENABLED}}],o=Be(e.exportedSignals).map(e=>{let t=e.toLowerCase();return t=`${t.charAt(0).toUpperCase()}${t.slice(1)}`,t}).join(", ");return o&&t.push({id:"monitors",title:et.MONITORS,label:o}),e.name&&t.push({id:"name",title:et.NAME,label:e.name}),t},xu=({onClose:n,destinationId:c})=>{const d=v(),{isVm:u}=S(),{destinationsApi:p}=Pl(),{selectedStreamName:h}=tt(),{items:m,refetch:g}=p.useDestinations(),{data:f,loading:b}=p.useDestinationCategories(),{activeForm:y,loadDestination:C,validateFormData:x,genericForm:w}=Ll();i(()=>{g()},[]);const T=l(null),[k,E]=s(!1),[I,N]=s(!1),[$,O]=s(null),A=k&&!!w?.isFormDirty,R=a(()=>Gt(m,h),[m,h]),D=a(()=>R?.find(e=>zt(e)===c),[c,R]),_=f?.destinationCategories?.categories??null;i(()=>{D&&_&&C(D,_)},[D,_]);const P=a(()=>D&&_?Wt(_,D):[],[D,_]),L=r(()=>{D&&E(!0)},[D]),F=r(()=>{D&&_&&(C(D,_),E(!1))},[D,_,C]),M=r(()=>{A?O("close"):n()},[A,n]),z=r(()=>{A?O("cancel"):F()},[A,F]),B=r(()=>{const e=$;O(null),"close"===e?(F(),n()):F()},[$,F,n]),X=r(async()=>{if(D){const{errorMessage:e,preparedFormData:t}=x();e||(await p.update(D.id,Ue(t)),E(!1))}},[D,x,p]),U=r(()=>{D&&N(!0)},[D]),V=r(async()=>{D&&(await p.remove(D.id),n())},[D,p,n]);if(!D)return null;const{icon:H,iconSrc:j}=wt(D.destinationType.type),G=((e,t)=>{const o=[],n=jt(e,t),i=n.map(e=>({name:e.key,value:e.value})),a=Be(e.exportedSignals);let l=[];const r=()=>{l.length&&(o.push({kind:"cells",id:`cells-${o.length}`,items:l}),l=[])};return n.forEach(({key:e,name:n,value:s})=>{const c=t.find(t=>t.name===e),{secret:d,componentType:u,componentProperties:p,hideFromReadData:h,customReadDataLabels:m}=c||{};if(h?.length&&Ie(h,a,i))return;const{type:g}=Ne(p,{type:""}),f=d||"password"===g;if(m?.length)m.forEach(({condition:t,...o},n)=>{t==s&&l.push({id:`${e}-custom-${n}`,title:o.title,label:o.value})});else if(s)if(f)l.push({id:e,title:n,label:new Array(10).fill("•").join("")});else{if(u===Ee.MultiInput){const t=Ne(s,null);if(Array.isArray(t)&&t.length)return r(),void o.push({kind:"list",id:e,title:n,items:t.map((t,o)=>({id:`${e}-${o}`,label:String(t)}))})}if(u===Ee.KeyValuePair){const t=Ne(s,null);if(Array.isArray(t)&&t.length)return r(),void o.push({kind:"pairs",id:e,title:n,items:t.map((t,o)=>{const n=t&&"object"==typeof t?t:{};return{id:`${e}-${o}`,title:null!=n.key?String(n.key):"",label:null!=n.value?String(n.value):""}})})}l.push({id:e,title:n,label:s})}else l.push({id:e,title:n,label:"-"})}),r(),o})(D,P);return e(o,{children:[t(ce,{isOpen:!0,header:{icon:H,iconSrc:j,title:D.name||D.destinationType.displayName,onClose:M,actions:[{id:"edit-destination-btn-edit",label:Ft.EDIT,icon:Da,active:k,onClick:L},{id:"edit-destination-btn-delete",label:Ft.DELETE,icon:Ea,color:d.v2.colors.red[500],active:I,onClick:U}]},footer:{actions:k?[{"data-id":"edit-destination-btn-cancel",label:Ft.CANCEL,variant:be.Secondary,onClick:z},...y?.option.testConnectionSupported&&!u?[{"data-id":"edit-destination-btn-test-connection",label:Ft.TEST_CONNECTION,variant:be.Secondary,onClick:()=>T.current?.testConnection()}]:[],{"data-id":"edit-destination-btn-save",label:Ft.SAVE,variant:be.Primary,onClick:X}]:[]},children:t(mt,{$padding:"4px 12px 12px",children:b?t(ft,{$height:"50vh",children:t(St,{withSpinner:!0})}):k&&y?t(Bs,{ref:T,isEdit:!0}):t(ee,{$gap:16,children:e(Xt,{bgTint:"1000",children:[e(Xt,{bgTint:"900",children:[!u&&t(Ut,{conditions:D.conditions||[]}),t(Xt,{bgTint:"800",cellsPerRow:2,items:Su(D)})]}),!!G.length&&t(Xt,{bgTint:"900",richTitle:{title:"Configuration"},withCollapse:!0,collapseIsDefaultOpen:!0,children:G.map(e=>"cells"===e.kind?t(Xt,{bgTint:"800",cellsPerRow:2,items:e.items},e.id):(e.kind,t(Xt,{bgTint:"800",richTitle:{title:e.title},cellsPerRow:2,items:e.items},e.id)))})]})})})}),t(yr,{target:"destination",isOpen:I,onClose:()=>N(!1),onApprove:V}),t(vr,{isOpen:null!==$,onClose:()=>O(null),onApprove:B})]})},wu=(e,t)=>{const o=[{id:"type",title:et.TYPE,label:t.label},{id:"status",title:et.STATUS,badge:{status:e.disabled?Fe.Unknown:Fe.Success,label:e.disabled?et.DISABLED:et.ENABLED}}];return e.ruleName&&o.push({id:"name",title:et.NAME,label:e.ruleName}),e.profileName&&o.push({id:"profile",title:et.MANAGED_BY_PROFILE,label:e.profileName}),e.notes&&o.push({id:"notes",title:et.NOTES,label:e.notes}),o},Tu=({onClose:n,ruleId:l})=>{const c=v(),{addNotification:d}=Yt(),{isVm:u}=S(),{instrumentationRulesApi:p}=Pl(),{items:h,refetch:m}=p.useRules(),{selectedOption:g,loadRule:f,validateFormData:b,genericForm:y}=Fl();i(()=>{m()},[]);const[C,x]=s(!1),[w,T]=s(!1),[k,E]=s(null),I=C&&!!y?.isFormDirty,N=a(()=>h?.find(e=>zt(e)===l),[l,h]),$=a(()=>kt.find(({type:e})=>e===N?.type)??null,[N?.type]);i(()=>{N&&f(N)},[N]);const O=r(()=>{if(N){if(!N.mutable)return void d({type:Fe.Warning,title:qt.FORBIDDEN,message:qt.CANNOT_EDIT_RULE,crdType:Et.InstrumentationRule,target:N.ruleId,hideFromHistory:!0});x(!0)}},[N,d]),A=r(()=>{N&&(f(N),x(!1))},[N,f]),R=r(()=>{I?E("close"):n()},[I,n]),D=r(()=>{I?E("cancel"):A()},[I,A]),_=r(()=>{const e=k;E(null),"close"===e?(A(),n()):A()},[k,A,n]),P=r(async()=>{if(N){const{errorMessage:e,preparedFormData:t}=b();e||(await p.update(N.ruleId,t,N.type),x(!1))}},[N,b,p]),L=r(()=>{if(N){if(!N.mutable)return void d({type:Fe.Warning,title:qt.FORBIDDEN,message:qt.CANNOT_DELETE_RULE,crdType:Et.InstrumentationRule,target:N.ruleId,hideFromHistory:!0});T(!0)}},[N,d]),F=r(async()=>{N&&(await p.remove(N.ruleId,N.type),n())},[N,p,n]);if(!N||!$)return null;const M=((e,o)=>{const n=[];return e.payloadCollection&&Object.entries(e.payloadCollection).forEach(([e,o])=>{o&&n.push(t(ue,{size:he.XS,children:`• ${Kt(e).toLowerCase()}`},`payload-${e}`))}),e.codeAttributes&&Object.entries(e.codeAttributes).forEach(([e,o])=>{o&&n.push(t(ue,{size:he.XS,children:`• ${Kt(e).toLowerCase()}`},`code-${e}`))}),e.headersCollection?.[He.HeaderKeys]?.length&&e.headersCollection[He.HeaderKeys].forEach((e,o)=>{e&&n.push(t(ue,{size:he.XS,children:e},`header-${o}-${e}`))}),e.customInstrumentations&&(e.customInstrumentations[Ke.Java]?.forEach((e,i)=>{const a=new We(e.className,e.methodName);if(a.Verify()){0===i&&n.push(t(ue,{size:he.XS,children:"Java Custom Probes:"},"java-custom-probes"));const e=a.toString();n.push(t(ue,{size:he.XXS,color:o.v2.colors.grey[200],children:`• ${e}`},`java-probe-${i}-${e}`))}}),e.customInstrumentations[Ke.Golang]?.forEach((e,i)=>{const a=new Ge(e.packageName,e.functionName,e.receiverName,e.receiverMethodName);if(a.Verify()){0===i&&n.push(t(ue,{size:he.XS,children:"Golang Custom Probes:"},"golang-custom-probes"));const e=a.toString();n.push(t(ue,{size:he.XXS,color:o.v2.colors.grey[200],children:`• ${e}`},`golang-probe-${i}-${e}`))}})),n})(N,c);return e(o,{children:[t(ce,{isOpen:!0,header:{icon:Zt(N.type),title:$.label,onClose:R,actions:[{id:"edit-rule-btn-edit",label:Ft.EDIT,icon:Da,active:C,onClick:O},{id:"edit-rule-btn-delete",label:Ft.DELETE,icon:Ea,color:c.v2.colors.red[500],active:w,onClick:L}]},footer:{actions:C?[{"data-id":"edit-rule-btn-cancel",label:Ft.CANCEL,variant:be.Secondary,onClick:D},{"data-id":"edit-rule-btn-save",label:Ft.SAVE,variant:be.Primary,onClick:P}]:[]},children:t(mt,{$padding:"4px 12px 12px",children:C&&g?t(Ks,{}):t(ee,{$gap:16,children:e(Xt,{bgTint:"1000",children:[e(Xt,{bgTint:"900",children:[!u&&t(Ut,{conditions:N.conditions||[]}),t(Xt,{bgTint:"800",cellsPerRow:2,items:wu(N,$)})]}),!u&&t(lr,{readOnly:!0,scopes:N.sourceScopes??null}),!!M.length&&t(Xt,{bgTint:"900",richTitle:{title:"Collect"},withCollapse:!0,collapseIsDefaultOpen:!0,children:t(Xt,{bgTint:"800",children:M})}),!!$.supportedLanguages.length&&t(Xt,{bgTint:"900",richTitle:{title:"Supported languages"},withCollapse:!0,collapseIsDefaultOpen:!0,children:t(Xt,{bgTint:"800",children:t(me,{$gap:12,$wrap:"wrap",children:$.supportedLanguages.map(e=>t(Jt,{label:Je[e],leftIcon:Ze(e),flex:"0.5"},e))})})})]})})})}),t(yr,{target:"instrumentation rule",isOpen:w,onClose:()=>T(!1),onApprove:F}),t(vr,{isOpen:null!==k,onClose:()=>E(null),onApprove:_})]})};var ku;(e=>{e.Overview="overview",e.Pods="pods",e.PeerSources="peer-sources",e.Profiling="profiling",e.Sampling="sampling",e.Debug="debug"})(ku||(ku={}));const Eu=({collapseIsDefaultOpen:e,isJumpToTarget:o,onClickRestartPod:n,namespace:i,podName:l,nodeName:r,startTime:s,agentInjectedStatus:c,odigosHealthStatus:d,k8sHealthStatus:u,children:p})=>{const{formatDurationAgo:h}=Qt(),m=eo(!!o),g=a(()=>({title:l,icon:el,withCopy:!0}),[l]),f=a(()=>{const e=[],t=to(c);t&&e.push(t);const o=to(d,tl,"health");o&&e.push(o);const n=to(u,ol,"health");return n&&e.push(n),e},[c,d,u]),b=a(()=>n?[{id:`restart-pod-${l}`,icon:Za,label:Ft.RESTART_POD,onClick:()=>n(i,l)}]:void 0,[n,i,l]),v=a(()=>[{id:"nodeName",title:et.NODE,label:r,withCopy:!0},{id:"age",title:et.AGE,label:s?h(s,{style:"short"}):et.NOT_RUNNING,labelTooltip:s}],[r,s,h]);return t("div",{ref:m,children:t(Xt,{bgTint:"900",richTitle:g,badges:f,dropDataActions:b,items:v,withCollapse:!0,collapseIsDefaultOpen:e,children:p})})},Iu=b.div`
605
+ `,mp=({isTesting:o,error:n,result:i})=>{const l=v(),{CopyButton:r}=Pt(),s=a(()=>i?.checks.filter(e=>!e.passed)??[],[i]),c=!(o||!n&&(!i||i.success)),d=n?et.CLOUD_CONNECTOR_CONNECTION_FAILED_DEFAULT:s[0]?.remediation||s[0]?.message||et.CLOUD_CONNECTOR_CONNECTION_FAILED_DEFAULT,p=n||s.map(e=>e.message).filter(Boolean).join("\n");return t(tp,{children:t(op,{children:o?t(np,{children:t(ip,{children:t(St,{withVisual:!0,withGradient:!0,title:et.CLOUD_CONNECTOR_TESTING_TITLE,titleSize:he.XS})})}):c?t(np,{children:e(ap,{children:[t(lp,{children:t(Va,{size:20,fill:l.v2.colors.black[500]})}),t(pe,{size:he.XS,weight:400,lineHeight:"20px",color:ue.Primary,children:et.CLOUD_CONNECTOR_CONNECTION_FAILED_TITLE}),t(pe,{align:"center",size:he.XXXS,weight:400,lineHeight:"normal",color:ue.Secondary,children:d}),p&&e(rp,{children:[t(sp,{children:p}),t(r,{value:p,size:Ct.XS})]})]})}):i?e(cp,{children:[t(qe,{status:Fe.Success,label:et.CLOUD_CONNECTOR_VALIDATE_SUCCESS,leftIcon:Ua,fullWidth:!0}),(i.accountId||i.identity)&&e(dp,{children:[i.accountId&&e(pp,{children:[e(pe,{size:he.XXS,weight:500,color:ue.Secondary,children:[et.CLOUD_CONNECTOR_VALIDATE_ACCOUNT,":"]}),t(pe,{size:he.XXS,weight:400,color:ue.Primary,children:i.accountId})]}),i.identity&&e(pp,{children:[e(pe,{size:he.XXS,weight:500,color:ue.Secondary,children:[et.CLOUD_CONNECTOR_VALIDATE_IDENTITY,":"]}),t(pe,{size:he.XXS,weight:400,color:ue.Primary,children:i.identity})]})]}),i.checks.length>0&&t(up,{children:i.checks.map(o=>e(hp,{$passed:o.passed,children:[t(qe,{status:o.passed?Fe.Success:Fe.Error,label:o.displayName,leftIcon:o.passed?Ua:Va}),o.message&&t(pe,{size:he.XXS,weight:400,lineHeight:"normal",color:ue.Secondary,children:o.message}),!o.passed&&o.remediation&&t(pe,{size:he.XXS,weight:400,lineHeight:"normal",color:ue.Primary,children:o.remediation})]},o.name))})]}):t(np,{children:t(pe,{size:he.XXS,weight:400,color:ue.Secondary,children:et.CLOUD_CONNECTOR_VALIDATE_EMPTY})})})})};var gp;(e=>{e[e.SelectProvider=1]="SelectProvider",e[e.Config=2]="Config",e[e.Validate=3]="Validate"})(gp||(gp={}));const fp=gp.SelectProvider,bp=gp.Validate,vp=({onClose:o,withOverlay:n,onCreateCloudConnector:i,onCreated:l})=>{const{providers:c,genericForm:d}=Kl(),[p,u]=s(fp),[h,m]=s(!1),[g,f]=s(!1),[b,v]=s(void 0),[y,C]=s(void 0),[S,x]=s(void 0),w=d.isFormDirty,T=p===fp,k=p===bp,E=r(()=>{w&&!h?m(!0):(m(!1),o?.())},[w,h,o]),I=r(()=>{x(void 0),C(void 0),v(void 0),u(e=>e>fp?e-1:e)},[]),N=r(()=>{if(x(void 0),p===gp.SelectProvider){if(!d.formData.provider)return void x("Please select a cloud provider");if(!d.formData.permission)return void x("Please select a permission level")}u(e=>e<bp?e+1:e)},[p,d.formData.provider,d.formData.permission]),$=r(async()=>{if(x(void 0),C(void 0),v(void 0),u(gp.Validate),!i)return;const{provider:e,permission:t,customCapabilities:o,awsAccountId:n,credentials:a,name:r}=d.formData,s=((e,t,o)=>{const n=td(e),i=[];return n.forEach(e=>{const n=void 0!==e.instrumentationPermissions;let a=!1,l=!1;switch(t){case Zc.DiscoveryOnly:a=!0;break;case Zc.DiscoveryInstrumentation:a=!0,l=n;break;case Zc.Custom:{const t=o[e.typeName];a=!!t?.discovery,l=!!t?.instrumentation;break}}(a||l)&&i.push({type:e.typeName,discovery:a,instrumentation:l,computePlatforms:!1})}),i})(c.find(t=>t.provider===e),t,o);f(!0);try{const t=await i({provider:e,displayName:r,credentials:a,expectedAccountId:n,capabilities:s});if(t.created)return void l?.(t.connectorId);v(t.test)}catch(e){C(e instanceof Error?e.message:"Failed to create connector")}finally{f(!1)}},[i,l,d.formData,c]),O=g,A=k&&!g&&(!!y||!!b&&!b.success),R=a(()=>S?{status:Fe.Error,message:S}:void 0,[S]),D=a(()=>T?{"data-id":"cloud-connector-cancel",label:Ft.CANCEL,variant:be.Secondary,onClick:E,disabled:O}:{"data-id":"cloud-connector-back",label:Ft.BACK,variant:be.Text,leftIcon:Ja,onClick:I,disabled:O},[T,E,I,O]),_=a(()=>{if(k){if(g)return;return A?{"data-id":"cloud-connector-retry",label:Ft.RETRY,variant:be.Primary,rightIcon:Qa,onClick:$}:void 0}return p===gp.Config?{"data-id":"cloud-connector-verify",label:Ft.VERIFY_AND_CREATE_CONNECTOR,variant:be.Primary,onClick:$,disabled:O}:{"data-id":"cloud-connector-next",label:Ft.NEXT,variant:be.Primary,onClick:N,disabled:O}},[k,g,A,p,$,N,O]),P=a(()=>[D,_].filter(Boolean),[D,_]);return e(ce,{width:vr,isOpen:!0,hideOverlay:!O&&!n,header:{icon:Ka,title:et.CREATE_CLOUD_CONNECTOR,onClose:o?E:void 0,onCloseDisabled:O},footer:{note:R,actions:P},children:[p===gp.SelectProvider&&t(Sd,{}),p===gp.Config&&t(ep,{onBack:I}),p===gp.Validate&&t(mp,{isTesting:g,error:y,result:b}),t(yr,{isOpen:h,onClose:()=>m(!1),onApprove:()=>o?.()})]})},yp=(e,t)=>{const o=[{id:"type",title:et.TYPE,label:t.label},{id:"status",title:et.STATUS,badge:{status:e.disabled?Fe.Unknown:Fe.Success,label:e.disabled?et.DISABLED:et.ENABLED}}],n=e.signals?.map(e=>{let t=e.toLowerCase();return t=`${t.charAt(0).toUpperCase()}${t.slice(1)}`,t}).join(", ");return n&&o.push({id:"signals",title:et.SIGNALS_FOR_PROCESSING,label:n}),e.name&&o.push({id:"name",title:et.NAME,label:e.name}),e.notes&&o.push({id:"notes",title:et.NOTES,label:e.notes}),o},Cp=({onClose:n,actionId:l})=>{const c=v(),{isVm:d}=S(),{actionsApi:p}=Ll(),{items:u,refetch:h}=p.useActions(),{options:m}=p.useActionTypes(),{selectedOption:g,loadAction:f,validateFormData:b,genericForm:y}=Pl();i(()=>{h()},[]);const[C,x]=s(!1),[w,T]=s(!1),[k,E]=s(null),I=C&&!!y?.isFormDirty,N=a(()=>u?.find(e=>zt(e)===l),[l,u]),$=a(()=>m.find(({type:e})=>e===N?.type)??Bt.find(({type:e})=>e===N?.type)??null,[m,N?.type]);i(()=>{N&&f(N,$)},[N,$]);const O=r(()=>{N&&x(!0)},[N]),A=r(()=>{N&&(f(N,$),x(!1))},[N,$,f]),R=r(()=>{I?E("close"):n()},[I,n]),D=r(()=>{I?E("cancel"):A()},[I,A]),_=r(()=>{const e=k;E(null),"close"===e?(A(),n()):A()},[k,A,n]),P=r(async()=>{if(N){const{errorMessage:e,preparedFormData:t}=b();e||(await p.update(N.id,t),x(!1))}},[N,b,p]),L=r(()=>{N&&T(!0)},[N]),F=r(async()=>{N&&(await p.remove(N.id,N.type),n())},[N,p,n]);if(!N||!$)return null;const M=(e=>{const t=[],{type:o,fields:n}=e,i=e=>({status:e?Fe.Success:Fe.Unknown,label:e?"True":"False",invertColors:!0});if(o===Ae.K8sAttributes&&(t.push({id:"collectContainerAttributes",title:"Collect Container Attributes",badge:i(n.collectContainerAttributes)}),t.push({id:"collectReplicaSetAttributes",title:"Collect ReplicaSet Attributes",badge:i(n.collectReplicaSetAttributes)}),t.push({id:"collectWorkloadId",title:"Collect Workload ID",badge:i(n.collectWorkloadId)}),t.push({id:"collectClusterId",title:"Collect Cluster ID",badge:i(n.collectClusterId)}),n.labelsAttributes?.forEach(({labelKey:e,attributeKey:o,from:i,fromSources:a},l)=>{const r=a?.length?a.join(", "):i||ae.Pod,s=(n.labelsAttributes?.length??0)>1?`Label #${l+1} `:"Label ";t.push({id:`label-${l}-key`,title:`${s}Key`,label:e}),t.push({id:`label-${l}-attr`,title:`${s}Attribute Key`,label:o}),t.push({id:`label-${l}-from`,title:`${s}From`,label:r})}),n.annotationsAttributes?.forEach(({annotationKey:e,attributeKey:o,from:i,fromSources:a},l)=>{const r=a?.length?a.join(", "):i||ae.Pod,s=(n.annotationsAttributes?.length??0)>1?`Annotation #${l+1} `:"Annotation ";t.push({id:`annotation-${l}-key`,title:`${s}Key`,label:e}),t.push({id:`annotation-${l}-attr`,title:`${s}Attribute Key`,label:o}),t.push({id:`annotation-${l}-from`,title:`${s}From`,label:r})})),o===Ae.AddClusterInfo&&(t.push({id:"overwriteExistingValues",title:"Overwrite Existing Values",badge:i(n.overwriteExistingValues)}),n.clusterAttributes?.forEach(({attributeName:e,attributeStringValue:o},n)=>{t.push({id:`cluster-attr-${n}`,title:e,label:o})})),o===Ae.DeleteAttributes&&n.attributeNamesToDelete?.forEach((e,o)=>{t.push({id:`del-attr-${o}`,title:"Attribute"+((n.attributeNamesToDelete?.length??0)>1?` #${o+1}`:""),label:e})}),o===Ae.RenameAttributes&&Object.entries(n.renames||{}).forEach(([e,o],n)=>{t.push({id:`rename-${n}`,title:e,label:o})}),o===Ae.PiiMasking&&n.piiCategories?.forEach((e,o)=>{t.push({id:`pii-${o}`,title:"Category"+((n.piiCategories?.length??0)>1?` #${o+1}`:""),label:e})}),o===Ae.ExtractAttribute){const e=n.extractAttribute?.extractions??[];e.forEach(({targetAttributeName:o,lookupKey:n,dataFormat:i,regex:a},l)=>{const r=e.length>1?`Extraction #${l+1} `:"Extraction ";t.push({id:`extract-${l}-target`,title:`${r}New Attribute Name`,label:o||"-"}),n&&t.push({id:`extract-${l}-lookupKey`,title:`${r}Lookup Key`,label:n}),i&&t.push({id:`extract-${l}-format`,title:`${r}Data Format`,label:i}),a&&t.push({id:`extract-${l}-regex`,title:`${r}Regex`,label:a})})}return o===Ae.URLTemplatization&&n.urlTemplatizationRulesGroups?.forEach((e,o)=>{const i=(n.urlTemplatizationRulesGroups?.length??0)>1?`Group #${o+1} `:"Group ";e.filterK8sNamespace&&t.push({id:`group-${o}-ns`,title:`${i}Namespace`,label:e.filterK8sNamespace}),e.workloadFilters?.forEach((n,a)=>{const l=[n.kind,n.name].filter(Boolean).join("/");l&&t.push({id:`group-${o}-wf-${a}`,title:`${i}Workload${(e.workloadFilters?.length??0)>1?` #${a+1}`:""}`,label:l})});const a=e.templatizationRules?.map(e=>e.template).filter(Boolean).join(", ");a&&t.push({id:`group-${o}-templates`,title:`${i}Templates`,label:a}),e.notes&&t.push({id:`group-${o}-notes`,title:`${i}Notes`,label:e.notes})}),t})(N);return e(o,{children:[t(ce,{isOpen:!0,header:{icon:Vt(N.type),title:$.label,onClose:R,actions:[{id:"edit-action-btn-edit",label:Ft.EDIT,icon:_a,active:C,onClick:O},{id:"edit-action-btn-delete",label:Ft.DELETE,icon:Ia,color:c.v2.colors.red[500],active:w,onClick:L}]},footer:{actions:C?[{"data-id":"edit-action-btn-cancel",label:Ft.CANCEL,variant:be.Secondary,onClick:D},{"data-id":"edit-action-btn-save",label:Ft.SAVE,variant:be.Primary,onClick:P}]:[]},children:t(mt,{$padding:"4px 12px 12px",children:C&&g?t(Ms,{}):t(ee,{$gap:16,children:e(Xt,{bgTint:"1000",children:[e(Xt,{bgTint:"900",children:[!d&&t(Ut,{conditions:N.conditions||[]}),t(Xt,{bgTint:"800",cellsPerRow:2,items:yp(N,$)})]}),!!M?.length&&t(Xt,{bgTint:"900",richTitle:{title:"Configuration"},withCollapse:!0,collapseIsDefaultOpen:!0,children:t(Xt,{bgTint:"800",cellsPerRow:2,items:M})})]})})})}),t(Cr,{target:"action",isOpen:w,onClose:()=>T(!1),onApprove:F}),t(yr,{isOpen:null!==k,onClose:()=>E(null),onApprove:_})]})},Sp=({onClose:o,connections:n,selectedConnectionIds:r,setSelectedConnectionIds:c})=>{const{configApi:d}=Ll(),[p,u]=s(""),[h,m]=s({showOnlySelected:!1}),g=a(()=>n.filter(e=>{const t=!p||e.name.toLowerCase().includes(p.toLowerCase()),o=!h.showOnlySelected||h.showOnlySelected&&r.includes(e.id);return t&&o}),[n.length,r.length,p,h]),f=e=>{c(t=>t.includes(e)?t.filter(t=>t!==e):[...t,e])},b=1===r.length?r[0]:void 0,{data:v,loading:y}=d.useEffectiveConfig(b?{id:b}:void 0,{skip:!b}),C=a(()=>{if(b&&v)return{rollout:{automaticRolloutDisabled:v.rollout?.automaticRolloutDisabled??!1}}},[b,v]),{formData:S,handleFormChange:x,areFormValuesEqual:w,resetFormData:T}=Ht(C||{rollout:{automaticRolloutDisabled:!1}}),k=l(T);k.current=T,i(()=>{C&&k.current(C)},[C]);const E=a(()=>r.length>1||void 0!==C&&!w(C,S),[r.length,C,S]);return t(br,{isOpen:!0,onClose:o,onSave:async()=>await(d.applyConfigurations?.(S,r))??void 0,header:{icon:el,title:"Cluster Configuration"},connectionIds:{value:r,setValue:c},search:{placeholder:"Search by cluster name",value:p,onChange:u},filters:e(me,{$gap:8,children:[t(pe,{size:he.XXXS,color:ue.Secondary,nowrap:!0,children:"Show only:"}),t(le,{size:Nt.S,label:"Selected",value:h.showOnlySelected,onChange:e=>m(t=>({...t,showOnlySelected:e}))})]}),isFormDirty:E,isFetching:y,leftColumn:{width:"35%",header:e(me,{$width:"100%",$gap:12,$justifyContent:"space-between",children:[e(me,{$gap:8,children:[t(pe,{size:he.XS,children:"Clusters"}),t(qe,{label:g.length,status:Fe.Unknown})]}),e(me,{$gap:8,children:[t(pe,{size:he.XXXS,color:ue.Secondary,align:"right",children:"Selected clusters"}),t(qe,{label:`${r.length}/${g.length}`,status:Fe.Unknown})]})]}),list:g.map(e=>t(dc,{title:e.name,isChecked:r.includes(e.id),onClick:()=>f(e.id),onCheckboxChange:()=>f(e.id)},e.id))},rightColumn:{width:"65%",header:t(pe,{size:he.XS,children:"Configurations"}),list:[t(le,{label:"Automatic rollout disabled",tooltip:"Odigos automatically triggers a one-time rollout for workloads when instrumenting or uninstrumenting, ensuring that changes are applied without requiring manual intervention. When automatic rollout is disabled, Odigos will not restart workloads, and users will need to manually trigger rollouts after adding or removing sources.",value:S.rollout?.automaticRolloutDisabled||!1,onChange:e=>x("rollout.automaticRolloutDisabled",e)},"automatic-rollout-disabled")]}})},xp=e=>{const t=[{id:"type",title:et.TYPE,label:e.destinationType.displayName},{id:"status",title:et.STATUS,badge:{status:e.disabled?Fe.Unknown:Fe.Success,label:e.disabled?et.DISABLED:et.ENABLED}}],o=Be(e.exportedSignals).map(e=>{let t=e.toLowerCase();return t=`${t.charAt(0).toUpperCase()}${t.slice(1)}`,t}).join(", ");return o&&t.push({id:"monitors",title:et.MONITORS,label:o}),e.name&&t.push({id:"name",title:et.NAME,label:e.name}),t},wp=({onClose:n,destinationId:c})=>{const d=v(),{isVm:p}=S(),{destinationsApi:u}=Ll(),{selectedStreamName:h}=tt(),{items:m,refetch:g}=u.useDestinations(),{data:f,loading:b}=u.useDestinationCategories(),{activeForm:y,loadDestination:C,validateFormData:x,genericForm:w}=Fl();i(()=>{g()},[]);const T=l(null),[k,E]=s(!1),[I,N]=s(!1),[$,O]=s(null),A=k&&!!w?.isFormDirty,R=a(()=>Gt(m,h),[m,h]),D=a(()=>R?.find(e=>zt(e)===c),[c,R]),_=f?.destinationCategories?.categories??null;i(()=>{D&&_&&C(D,_)},[D,_]);const P=a(()=>D&&_?Wt(_,D):[],[D,_]),L=r(()=>{D&&E(!0)},[D]),F=r(()=>{D&&_&&(C(D,_),E(!1))},[D,_,C]),M=r(()=>{A?O("close"):n()},[A,n]),z=r(()=>{A?O("cancel"):F()},[A,F]),B=r(()=>{const e=$;O(null),"close"===e?(F(),n()):F()},[$,F,n]),X=r(async()=>{if(D){const{errorMessage:e,preparedFormData:t}=x();e||(await u.update(D.id,Ue(t)),E(!1))}},[D,x,u]),U=r(()=>{D&&N(!0)},[D]),V=r(async()=>{D&&(await u.remove(D.id),n())},[D,u,n]);if(!D)return null;const{icon:H,iconSrc:j}=wt(D.destinationType.type),G=((e,t)=>{const o=[],n=jt(e,t),i=n.map(e=>({name:e.key,value:e.value})),a=Be(e.exportedSignals);let l=[];const r=()=>{l.length&&(o.push({kind:"cells",id:`cells-${o.length}`,items:l}),l=[])};return n.forEach(({key:e,name:n,value:s})=>{const c=t.find(t=>t.name===e),{secret:d,componentType:p,componentProperties:u,hideFromReadData:h,customReadDataLabels:m}=c||{};if(h?.length&&Ie(h,a,i))return;const{type:g}=Ne(u,{type:""}),f=d||"password"===g;if(m?.length)m.forEach(({condition:t,...o},n)=>{t==s&&l.push({id:`${e}-custom-${n}`,title:o.title,label:o.value})});else if(s)if(f)l.push({id:e,title:n,label:new Array(10).fill("•").join("")});else{if(p===Ee.MultiInput){const t=Ne(s,null);if(Array.isArray(t)&&t.length)return r(),void o.push({kind:"list",id:e,title:n,items:t.map((t,o)=>({id:`${e}-${o}`,label:String(t)}))})}if(p===Ee.KeyValuePair){const t=Ne(s,null);if(Array.isArray(t)&&t.length)return r(),void o.push({kind:"pairs",id:e,title:n,items:t.map((t,o)=>{const n=t&&"object"==typeof t?t:{};return{id:`${e}-${o}`,title:null!=n.key?String(n.key):"",label:null!=n.value?String(n.value):""}})})}l.push({id:e,title:n,label:s})}else l.push({id:e,title:n,label:"-"})}),r(),o})(D,P);return e(o,{children:[t(ce,{isOpen:!0,header:{icon:H,iconSrc:j,title:D.name||D.destinationType.displayName,onClose:M,actions:[{id:"edit-destination-btn-edit",label:Ft.EDIT,icon:_a,active:k,onClick:L},{id:"edit-destination-btn-delete",label:Ft.DELETE,icon:Ia,color:d.v2.colors.red[500],active:I,onClick:U}]},footer:{actions:k?[{"data-id":"edit-destination-btn-cancel",label:Ft.CANCEL,variant:be.Secondary,onClick:z},...y?.option.testConnectionSupported&&!p?[{"data-id":"edit-destination-btn-test-connection",label:Ft.TEST_CONNECTION,variant:be.Secondary,onClick:()=>T.current?.testConnection()}]:[],{"data-id":"edit-destination-btn-save",label:Ft.SAVE,variant:be.Primary,onClick:X}]:[]},children:t(mt,{$padding:"4px 12px 12px",children:b?t(ft,{$height:"50vh",children:t(St,{withSpinner:!0})}):k&&y?t(Xs,{ref:T,isEdit:!0}):t(ee,{$gap:16,children:e(Xt,{bgTint:"1000",children:[e(Xt,{bgTint:"900",children:[!p&&t(Ut,{conditions:D.conditions||[]}),t(Xt,{bgTint:"800",cellsPerRow:2,items:xp(D)})]}),!!G.length&&t(Xt,{bgTint:"900",richTitle:{title:"Configuration"},withCollapse:!0,collapseIsDefaultOpen:!0,children:G.map(e=>"cells"===e.kind?t(Xt,{bgTint:"800",cellsPerRow:2,items:e.items},e.id):(e.kind,t(Xt,{bgTint:"800",richTitle:{title:e.title},cellsPerRow:2,items:e.items},e.id)))})]})})})}),t(Cr,{target:"destination",isOpen:I,onClose:()=>N(!1),onApprove:V}),t(yr,{isOpen:null!==$,onClose:()=>O(null),onApprove:B})]})},Tp=(e,t)=>{const o=[{id:"type",title:et.TYPE,label:t.label},{id:"status",title:et.STATUS,badge:{status:e.disabled?Fe.Unknown:Fe.Success,label:e.disabled?et.DISABLED:et.ENABLED}}];return e.ruleName&&o.push({id:"name",title:et.NAME,label:e.ruleName}),e.profileName&&o.push({id:"profile",title:et.MANAGED_BY_PROFILE,label:e.profileName}),e.notes&&o.push({id:"notes",title:et.NOTES,label:e.notes}),o},kp=({onClose:n,ruleId:l})=>{const c=v(),{addNotification:d}=Yt(),{isVm:p}=S(),{instrumentationRulesApi:u}=Ll(),{items:h,refetch:m}=u.useRules(),{selectedOption:g,loadRule:f,validateFormData:b,genericForm:y}=Ml();i(()=>{m()},[]);const[C,x]=s(!1),[w,T]=s(!1),[k,E]=s(null),I=C&&!!y?.isFormDirty,N=a(()=>h?.find(e=>zt(e)===l),[l,h]),$=a(()=>kt.find(({type:e})=>e===N?.type)??null,[N?.type]);i(()=>{N&&f(N)},[N]);const O=r(()=>{if(N){if(!N.mutable)return void d({type:Fe.Warning,title:qt.FORBIDDEN,message:qt.CANNOT_EDIT_RULE,crdType:Et.InstrumentationRule,target:N.ruleId,hideFromHistory:!0});x(!0)}},[N,d]),A=r(()=>{N&&(f(N),x(!1))},[N,f]),R=r(()=>{I?E("close"):n()},[I,n]),D=r(()=>{I?E("cancel"):A()},[I,A]),_=r(()=>{const e=k;E(null),"close"===e?(A(),n()):A()},[k,A,n]),P=r(async()=>{if(N){const{errorMessage:e,preparedFormData:t}=b();e||(await u.update(N.ruleId,t,N.type),x(!1))}},[N,b,u]),L=r(()=>{if(N){if(!N.mutable)return void d({type:Fe.Warning,title:qt.FORBIDDEN,message:qt.CANNOT_DELETE_RULE,crdType:Et.InstrumentationRule,target:N.ruleId,hideFromHistory:!0});T(!0)}},[N,d]),F=r(async()=>{N&&(await u.remove(N.ruleId,N.type),n())},[N,u,n]);if(!N||!$)return null;const M=((e,o)=>{const n=[];return e.payloadCollection&&Object.entries(e.payloadCollection).forEach(([e,o])=>{o&&n.push(t(pe,{size:he.XS,children:`• ${Kt(e).toLowerCase()}`},`payload-${e}`))}),e.codeAttributes&&Object.entries(e.codeAttributes).forEach(([e,o])=>{o&&n.push(t(pe,{size:he.XS,children:`• ${Kt(e).toLowerCase()}`},`code-${e}`))}),e.headersCollection?.[He.HeaderKeys]?.length&&e.headersCollection[He.HeaderKeys].forEach((e,o)=>{e&&n.push(t(pe,{size:he.XS,children:e},`header-${o}-${e}`))}),e.customInstrumentations&&(e.customInstrumentations[Ke.Java]?.forEach((e,i)=>{const a=new We(e.className,e.methodName);if(a.Verify()){0===i&&n.push(t(pe,{size:he.XS,children:"Java Custom Probes:"},"java-custom-probes"));const e=a.toString();n.push(t(pe,{size:he.XXS,color:o.v2.colors.grey[200],children:`• ${e}`},`java-probe-${i}-${e}`))}}),e.customInstrumentations[Ke.Golang]?.forEach((e,i)=>{const a=new Ge(e.packageName,e.functionName,e.receiverName,e.receiverMethodName);if(a.Verify()){0===i&&n.push(t(pe,{size:he.XS,children:"Golang Custom Probes:"},"golang-custom-probes"));const e=a.toString();n.push(t(pe,{size:he.XXS,color:o.v2.colors.grey[200],children:`• ${e}`},`golang-probe-${i}-${e}`))}})),n})(N,c);return e(o,{children:[t(ce,{isOpen:!0,header:{icon:Zt(N.type),title:$.label,onClose:R,actions:[{id:"edit-rule-btn-edit",label:Ft.EDIT,icon:_a,active:C,onClick:O},{id:"edit-rule-btn-delete",label:Ft.DELETE,icon:Ia,color:c.v2.colors.red[500],active:w,onClick:L}]},footer:{actions:C?[{"data-id":"edit-rule-btn-cancel",label:Ft.CANCEL,variant:be.Secondary,onClick:D},{"data-id":"edit-rule-btn-save",label:Ft.SAVE,variant:be.Primary,onClick:P}]:[]},children:t(mt,{$padding:"4px 12px 12px",children:C&&g?t(Ys,{}):t(ee,{$gap:16,children:e(Xt,{bgTint:"1000",children:[e(Xt,{bgTint:"900",children:[!p&&t(Ut,{conditions:N.conditions||[]}),t(Xt,{bgTint:"800",cellsPerRow:2,items:Tp(N,$)})]}),!p&&t(rr,{readOnly:!0,scopes:N.sourceScopes??null}),!!M.length&&t(Xt,{bgTint:"900",richTitle:{title:"Collect"},withCollapse:!0,collapseIsDefaultOpen:!0,children:t(Xt,{bgTint:"800",children:M})}),!!$.supportedLanguages.length&&t(Xt,{bgTint:"900",richTitle:{title:"Supported languages"},withCollapse:!0,collapseIsDefaultOpen:!0,children:t(Xt,{bgTint:"800",children:t(me,{$gap:12,$wrap:"wrap",children:$.supportedLanguages.map(e=>t(Jt,{label:Je[e],leftIcon:Ze(e),flex:"0.5"},e))})})})]})})})}),t(Cr,{target:"instrumentation rule",isOpen:w,onClose:()=>T(!1),onApprove:F}),t(yr,{isOpen:null!==k,onClose:()=>E(null),onApprove:_})]})};var Ep;(e=>{e.Overview="overview",e.Pods="pods",e.Libraries="libraries",e.PeerSources="peer-sources",e.Profiling="profiling",e.Sampling="sampling",e.Debug="debug"})(Ep||(Ep={}));const Ip=({collapseIsDefaultOpen:e,isJumpToTarget:o,onClickRestartPod:n,namespace:i,podName:l,nodeName:r,startTime:s,agentInjectedStatus:c,odigosHealthStatus:d,k8sHealthStatus:p,children:u})=>{const{formatDurationAgo:h}=Qt(),m=eo(!!o),g=a(()=>({title:l,icon:tl,withCopy:!0}),[l]),f=a(()=>{const e=[],t=to(c);t&&e.push(t);const o=to(d,ol,"health");o&&e.push(o);const n=to(p,nl,"health");return n&&e.push(n),e},[c,d,p]),b=a(()=>n?[{id:`restart-pod-${l}`,icon:Qa,label:Ft.RESTART_POD,onClick:()=>n(i,l)}]:void 0,[n,i,l]),v=a(()=>[{id:"nodeName",title:et.NODE,label:r,withCopy:!0},{id:"age",title:et.AGE,label:s?h(s,{style:"short"}):et.NOT_RUNNING,labelTooltip:s}],[r,s,h]);return t("div",{ref:m,children:t(Xt,{bgTint:"900",richTitle:g,badges:f,dropDataActions:b,items:v,withCollapse:!0,collapseIsDefaultOpen:e,children:u})})},Np=b.div`
606
606
  display: flex;
607
607
  align-items: center;
608
608
  justify-content: space-between;
@@ -610,7 +610,7 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import n,{useEff
610
610
  padding: ${({$noPadding:e})=>e?"0":"12px"};
611
611
  border-radius: 12px;
612
612
  background-color: ${({theme:e})=>e.v2.colors.silver[900]};
613
- `,Nu=({podsOdigosHealthStatus:o,pods:n,noPadding:i})=>{const l=io(o?.status),r=Kt(o?.name),s=o?.message,{totalPodsCount:c,injectionsAsExpectedCount:d,odigosHealthyPodsCount:u,k8sHealthyPodsCount:p}=a(()=>({totalPodsCount:n?.length||0,injectionsAsExpectedCount:n?.reduce((e,t)=>e+(t.agentInjectedStatus?.status===oo.Success?1:0),0)||0,odigosHealthyPodsCount:n?.reduce((e,t)=>e+(t.odigosHealthStatus?.status===oo.Success?1:0),0)||0,k8sHealthyPodsCount:n?.reduce((e,t)=>e+(t.k8sHealthStatus?.status===oo.Success?1:0),0)||0}),[n]);return n?.length&&o&&l?e(Iu,{$noPadding:i,children:[t(no,{invertColors:!0,hideBackground:!0,status:l,title:r,subTitle:s}),e(me,{$gap:8,children:[t(Ou,{label:et.PODS,count:c}),t(Ou,{label:et.INJECTIONS_AS_EXPECTED,count:d,total:c}),t(Ou,{label:et.ODIGOS_HEALTHY,icon:tl,count:u,total:c}),t(Ou,{label:et.KUBERNETES_HEALTHY,icon:ol,count:p,total:c})]})]}):null},$u=b.div`
613
+ `,$p=({podsOdigosHealthStatus:o,pods:n,noPadding:i})=>{const l=io(o?.status),r=Kt(o?.name),s=o?.message,{totalPodsCount:c,odigosHealthyPodsCount:d,k8sHealthyPodsCount:p}=a(()=>({totalPodsCount:n?.length||0,odigosHealthyPodsCount:n?.reduce((e,t)=>e+(t.odigosHealthStatus?.status===oo.Success?1:0),0)||0,k8sHealthyPodsCount:n?.reduce((e,t)=>e+(t.k8sHealthStatus?.status===oo.Success?1:0),0)||0}),[n]);return n?.length&&o&&l?e(Np,{$noPadding:i,children:[t(no,{invertColors:!0,hideBackground:!0,status:l,title:r,subTitle:s}),e(me,{$gap:8,children:[t(Ap,{label:et.PODS,count:c}),t(Ap,{label:et.ODIGOS_HEALTHY,icon:ol,count:d,total:c}),t(Ap,{label:et.KUBERNETES_HEALTHY,icon:nl,count:p,total:c})]})]}):null},Op=b.div`
614
614
  display: flex;
615
615
  flex-direction: column;
616
616
  justify-content: center;
@@ -621,32 +621,32 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import n,{useEff
621
621
  width: fit-content;
622
622
  border-radius: 8px;
623
623
  background-color: ${({theme:e})=>e.v2.colors.silver[800]};
624
- `,Ou=({count:o,total:n,label:i,icon:a})=>{const l=v(),r=void 0===n?void 0:o===n?l.v2.colors.green[500]:l.v2.colors.red[500];return e($u,{children:[e(me,{$gap:0,$alignItems:"flex-end",children:[t(ue,{size:he.L,color:r,weight:500,nowrap:!0,children:o}),void 0!==n&&t(ue,{size:he.S,color:r,weight:500,nowrap:!0,children:`/${n}`})]}),e(me,{$alignItems:"center",$gap:4,children:[a&&t(a,{size:16}),t(ue,{size:he.XXXS,nowrap:!0,children:i})]})]})},Au=e=>{if(e.overrideProcessNum)return e.overrideProcessNum.toString();const t=e.identifyingAttributes?.find(({name:e})=>e===ao.PID)??e.identifyingAttributes?.find(({name:e})=>e===ao.VPID);return t?.value??null};var Ru;(e=>{e.IdentifyingAttributes="identifying-attributes",e.InstrumentationLibraries="instrumentation-libraries"})(Ru||(Ru={}));const Du=({overrideProcessNum:o,healthy:n,healthStatus:l,identifyingAttributes:r,instrumentations:c,isJumpToTarget:d})=>{const u=v(),[p,h]=s(Ru.IdentifyingAttributes),m=eo(!!d),{tabOptions:g,firstTabValue:f,bothTabsDisabled:b}=a(()=>{const e=c?.some(e=>!1===e.healthy),o=[{value:Ru.IdentifyingAttributes,label:et.IDENTIFYING_ATTRIBUTES,disabled:!r?.length,selectedBgColor:u.v2.colors.purple[500]},{value:Ru.InstrumentationLibraries,label:et.INSTRUMENTATION_LIBRARIES,icon:e?e=>t(nl,{...e,fill:u.v2.colors.red[500]}):void 0,disabled:!c?.length,selectedBgColor:u.v2.colors.purple[500]}];return{tabOptions:o,firstTabValue:o.find(e=>!e.disabled)?.value||o[0].value,bothTabsDisabled:o.every(e=>e.disabled)}},[r,c]);i(()=>{f&&h(f)},[f]);const y=a(()=>{switch(p){case Ru.IdentifyingAttributes:return t(ee,{children:r?.map((e,o)=>t(Mu,{label:e.name,value:e.value},`attr-${o}-${e.name}`))});case Ru.InstrumentationLibraries:return t(ee,{children:c?.map((e,o)=>t(Mu,{label:e.name,isStandardLibrary:e.isStandardLibrary,healthy:e.healthy,message:e.message},`instr-${o}-${e.name}`))});default:return null}},[p,r,c]),C=a(()=>Au({overrideProcessNum:o,identifyingAttributes:r}),[o,r]);return t("div",{ref:m,children:e(Xt,{bgTint:"800",richTitle:{title:C?`${et.PROCESS} ${et.PID(C)}`:et.PROCESS_FALLBACK_NAME},renderOnRightSide:t(ue,{color:n?pe.Success:pe.Error,size:he.XXXS,children:l?.message}),badges:[{key:"odigos-healthy",status:n?Fe.Success:Fe.Error,leftIcon:tl,label:n?et.HEALTHY:et.NOT_HEALTHY,textSize:he.XXXS,invertColors:!0,useSecondaryTone:!0}],withCollapse:!b,collapseIsDefaultOpen:d,children:[!b&&t(ve,{options:g,selected:p,setSelected:h}),!b&&y]})})},_u=b.div`
624
+ `,Ap=({count:o,total:n,label:i,icon:a})=>{const l=v(),r=void 0===n?void 0:o===n?l.v2.colors.green[500]:l.v2.colors.red[500];return e(Op,{children:[e(me,{$gap:0,$alignItems:"flex-end",children:[t(pe,{size:he.L,color:r,weight:500,nowrap:!0,children:o}),void 0!==n&&t(pe,{size:he.S,color:r,weight:500,nowrap:!0,children:`/${n}`})]}),e(me,{$alignItems:"center",$gap:4,children:[a&&t(a,{size:16}),t(pe,{size:he.XXXS,nowrap:!0,children:i})]})]})},Rp=e=>{if(e.overrideProcessNum)return e.overrideProcessNum.toString();const t=e.identifyingAttributes?.find(({name:e})=>e===ao.PID)??e.identifyingAttributes?.find(({name:e})=>e===ao.VPID);return t?.value??null};var Dp;(e=>{e.IdentifyingAttributes="identifying-attributes",e.InstrumentationLibraries="instrumentation-libraries"})(Dp||(Dp={}));const _p=({overrideProcessNum:o,healthy:n,healthStatus:l,identifyingAttributes:r,instrumentations:c,isJumpToTarget:d})=>{const p=v(),[u,h]=s(Dp.IdentifyingAttributes),m=eo(!!d),{tabOptions:g,firstTabValue:f,bothTabsDisabled:b}=a(()=>{const e=c?.some(e=>!1===e.healthy),o=[{value:Dp.IdentifyingAttributes,label:et.IDENTIFYING_ATTRIBUTES,disabled:!r?.length,selectedBgColor:p.v2.colors.purple[500]},{value:Dp.InstrumentationLibraries,label:et.INSTRUMENTATION_LIBRARIES,icon:e?e=>t(il,{...e,fill:p.v2.colors.red[500]}):void 0,disabled:!c?.length,selectedBgColor:p.v2.colors.purple[500]}];return{tabOptions:o,firstTabValue:o.find(e=>!e.disabled)?.value||o[0].value,bothTabsDisabled:o.every(e=>e.disabled)}},[r,c]);i(()=>{f&&h(f)},[f]);const y=a(()=>{switch(u){case Dp.IdentifyingAttributes:return t(ee,{children:r?.map((e,o)=>t(zp,{label:e.name,value:e.value},`attr-${o}-${e.name}`))});case Dp.InstrumentationLibraries:return t(ee,{children:c?.map((e,o)=>t(zp,{label:e.name,isStandardLibrary:e.isStandardLibrary,healthy:e.healthy,message:e.message},`instr-${o}-${e.name}`))});default:return null}},[u,r,c]),C=a(()=>Rp({overrideProcessNum:o,identifyingAttributes:r}),[o,r]);return t("div",{ref:m,children:e(Xt,{bgTint:"800",richTitle:{title:C?`${et.PROCESS} ${et.PID(C)}`:et.PROCESS_FALLBACK_NAME},renderOnRightSide:t(pe,{color:n?ue.Success:ue.Error,size:he.XXXS,children:l?.message}),badges:[{key:"odigos-healthy",status:n?Fe.Success:Fe.Error,leftIcon:ol,label:n?et.HEALTHY:et.NOT_HEALTHY,textSize:he.XXXS,invertColors:!0,useSecondaryTone:!0}],withCollapse:!b,collapseIsDefaultOpen:d,children:[!b&&t(ve,{options:g,selected:u,setSelected:h}),!b&&y]})})},Pp=b.div`
625
625
  display: flex;
626
- align-items: flex-start;
626
+ align-items: ${({$withHealthBadge:e})=>e?"center":"flex-start"};
627
627
  gap: 8px;
628
628
  padding: 8px;
629
629
  border-radius: 4px;
630
630
  &:hover {
631
631
  background-color: ${({theme:e})=>e.v2.colors.silver[700]};
632
632
  }
633
- `,Pu=b(ue)`
634
- flex: 0 0 30%;
635
- `,Lu=b(ue)`
633
+ `,Lp=b(pe)`
634
+ flex: 0 0 ${({$withHealthBadge:e})=>e?"auto":"30%"};
635
+ `,Fp=b(pe)`
636
636
  flex: 1 1 auto;
637
637
  min-width: 0;
638
- `,Fu=b(me)`
638
+ `,Mp=b(me)`
639
639
  flex: 1 1 auto;
640
640
  justify-content: flex-end;
641
641
  min-width: 0;
642
- `,Mu=({label:o,value:n,isStandardLibrary:i,healthy:a,message:l})=>{const r="boolean"==typeof a;return e(_u,{children:[t(Pu,{size:he.XXS,color:pe.Secondary,children:o}),n&&t(Lu,{size:he.XXS,color:pe.Primary,align:"right",children:n}),(r||i)&&e(Fu,{children:[i&&t(qe,{status:Fe.Info,label:et.STANDARD,textSize:he.XXXS,invertColors:!0}),r&&t(qe,{status:a?Fe.Success:Fe.Error,label:a?et.HEALTHY:et.NOT_HEALTHY,textSize:he.XXXS,invertColors:!0,tooltip:l??void 0})]})]})},zu=h(null),Bu=({value:e,children:o})=>t(zu.Provider,{value:e,children:o}),Xu=({podContainers:e,sourceContainers:o,jumpToTarget:n})=>{const i=e??[],l=a(()=>({title:et.CONTAINERS,titleSize:he.XS,badge:{label:i.length}}),[i.length]),r=a(()=>{const e=new Map;return o?.forEach(t=>e.set(t.containerName,t)),e},[o]);return t(Xt,{bgTint:"800",richTitle:l,withCollapse:!0,collapseIsDefaultOpen:!0,children:t(ee,{$gap:8,children:i.map(e=>{const o=n?.containerName===e.containerName;return t(Vu,{...e,language:lo(r.get(e.containerName)),jumpToTarget:o?n:null},`pod-container-${e.containerName}`)})})})},Uu=b.div`
642
+ `,zp=({label:o,value:n,isStandardLibrary:i,healthy:a,message:l})=>{const r="boolean"==typeof a;return e(Pp,{$withHealthBadge:r,children:[t(Lp,{size:he.XXS,color:ue.Secondary,$withHealthBadge:r,children:o}),n&&t(Fp,{size:he.XXS,color:ue.Primary,align:"right",children:n}),(i||r)&&e(Mp,{children:[i&&t(qe,{status:Fe.Info,label:et.STANDARD,textSize:he.XXXS,invertColors:!0}),r&&e(me,{$gap:4,children:[l&&t(Fp,{size:he.XXXS,color:ue.Error,align:"right",children:l}),t(qe,{status:a?Fe.Success:Fe.Error,label:a?et.HEALTHY:et.NOT_HEALTHY,leftIcon:ol,textSize:he.XXXS,invertColors:!0,tooltip:l??void 0})]})]})]})},Bp=h(null),Xp=({value:e,children:o})=>t(Bp.Provider,{value:e,children:o}),Up=({podContainers:e,sourceContainers:o,jumpToTarget:n})=>{const i=e??[],l=a(()=>({title:et.CONTAINERS,titleSize:he.XS,badge:{label:i.length}}),[i.length]),r=a(()=>{const e=new Map;return o?.forEach(t=>e.set(t.containerName,t)),e},[o]);return t(Xt,{bgTint:"800",richTitle:l,withCollapse:!0,collapseIsDefaultOpen:!0,children:t(ee,{$gap:8,children:i.map(e=>{const o=n?.containerName===e.containerName;return t(Hp,{...e,language:lo(r.get(e.containerName)),jumpToTarget:o?n:null},`pod-container-${e.containerName}`)})})})},Vp=b.div`
643
643
  display: flex;
644
644
  flex-direction: column;
645
645
  gap: 12px;
646
646
  padding: 8px 12px;
647
647
  border-radius: 8px;
648
648
  background-color: ${({theme:e})=>e.v2.colors.silver[800]};
649
- `,Vu=({language:o,containerName:n,otelDistroName:i,runningStartedTime:l,started:r,ready:s,restartCount:c,isCrashLoop:d,waitingReasonEnum:u,waitingMessage:p,odigosHealthStatus:h,k8sHealthStatus:m,processes:g,jumpToTarget:f})=>{const b=!!f,v=b&&!f?.processPid,{formatDurationAgo:y}=Qt(),C=eo(v),S=a(()=>({title:n,icon:o?Ze(o):il,iconWithWrapper:!0}),[n,o]),x=a(()=>{const e=[],t=to({status:i?oo.Success:oo.Disabled,reasonEnum:i?et.INSTRUMENTED_WITH_DISTRO(i):et.UNINSTRUMENTED,message:""});t&&e.push(t);const o=to(h,tl,"health");o&&e.push(o);const n=to(m,ol,"health");return n&&e.push(n),e},[m,h,i]),w=a(()=>[{id:"runningTime",title:et.RUNNING_TIME,label:l?y(l,{style:"short"}):et.NOT_RUNNING,labelTooltip:`${et.RUNNING_TIME_TOOLTIP}. (${l})`},{id:"blank",spacer:!0},{id:"started",badge:{status:r?Fe.Success:Fe.Disabled,leftIcon:r?$a:Oa,label:r?et.STARTED:et.NOT_STARTED,textSize:he.XXXS,invertColors:!0,useSecondaryTone:!0}},{id:"ready",badge:{status:s?Fe.Success:Fe.Disabled,leftIcon:s?$a:Oa,label:s?et.READY:et.NOT_READY,textSize:he.XXXS,invertColors:!0,useSecondaryTone:!0}},{id:"isCrashLoop",badge:{status:d?Fe.Error:Fe.Success,leftIcon:d?Oa:$a,label:d?et.CRASHLOOP:et.NO_CRASHLOOP,textSize:he.XXXS,invertColors:!0,useSecondaryTone:!0}},{id:"restartCount",title:et.RESTARTS,badge:{status:c?Fe.Error:void 0,label:c||0,textSize:he.XXXS}}],[l,y,r,s,d,c]),T=a(()=>p?Kt(u):"",[p,u]);return t("div",{ref:C,children:e(Xt,{bgTint:"750",richTitle:S,badges:x,items:w,withCollapse:!0,collapseIsDefaultOpen:b,children:[p&&t(Uu,{children:e(me,{$gap:10,$alignItems:"center",children:[t(Jt,{variant:ro.Pink,leftIcon:ol,label:T}),t(ue,{size:he.XXXS,color:pe.Error,children:p})]})}),(g??[]).map((e,o)=>{const i=o+1,a=b&&(l=f,r=e,!!l?.processPid&&Au({identifyingAttributes:r.identifyingAttributes})===l.processPid);var l,r;return t(Du,{...e,overrideProcessNum:i,isJumpToTarget:a},`pod-container-${n}-process-${i}`)})]})})},Hu=({podName:e,namespace:o,hasRestarted:n})=>{const i=a(()=>({title:et.DEBUG_COMMANDS,titleSize:he.XS}),[]),l=a(()=>[{label:et.GET_POD_YAML,value:`kubectl get pod ${e} -n ${o} -o yaml`},{label:et.DESCRIBE_POD,value:`kubectl describe pod ${e} -n ${o}`},{label:et.GET_POD_LOGS,value:`kubectl logs ${e} -n ${o}${n?" -p":""}`}],[e,o,n]);return t(Xt,{bgTint:"800",richTitle:i,withCollapse:!0,children:l.map(({label:e,value:o})=>t(so,{bgTint:"700",label:e,value:o},e))})},ju=({source:n,onClickRestartPod:i})=>{const{jumpToTarget:l}=(()=>{const e=m(zu);if(!e)throw new Error("useJumpToTargetContext must be used within a JumpToTargetContextProvider");return e})(),r=l?.tab===ku.Pods?l:null,s=n?.pods??[],c=s.length>0,d=a(()=>s.some(e=>e.containers?.some(e=>e.restartCount&&e.restartCount>0)),[s]),u=a(()=>({title:et.PODS,badge:{label:s.length}}),[s.length]);return t(ee,{$gap:12,children:c?e(o,{children:[t(Nu,{podsOdigosHealthStatus:n.podsOdigosHealthStatus,pods:s}),t(Xt,{bgTint:"1000",richTitle:u,children:s.map(o=>{const a=r?.podName===o.podName,l=a&&!r?.containerName;return e(Eu,{...o,namespace:n.id.namespace,onClickRestartPod:i,collapseIsDefaultOpen:a,isJumpToTarget:l,children:[t(Hu,{podName:o.podName,namespace:n.id.namespace,hasRestarted:d}),t(Xu,{podContainers:o.containers,sourceContainers:n.containers,jumpToTarget:a?r:null})]},`pod-${o.podName}`)})})]}):t(ft,{$height:"70vh",children:t(Re,{title:et.NO_RUNNING_PODS,subTitle:et.NO_RUNNING_PODS_SUBTITLE})})})},Gu="user",Wu=({source:o})=>{const n=a(()=>o.serviceName||o.id.name,[o]),{sourcesApi:i}=Pl(),{data:l,loading:r,refetch:s}=i.usePeerSources({serviceName:n},{fetchPolicy:"network-only"}),c=l?.peerSources??null;return!c||r?t(ft,r?{$height:"70vh",children:t(St,{withSpinner:!0})}:{$height:"70vh",children:t(Re,{subTitle:et.COULD_NOT_FETCH_PEER_SOURCES})}):e(me,{$gap:16,$alignItems:"flex-start",children:[t(Ku,{icon:al,title:et.INBOUND,subTitle:et.INBOUND_DESCRIPTION(n),onRefresh:s,items:c?.inbound??[]}),t(Ku,{icon:ll,title:et.OUTBOUND,subTitle:et.OUTBOUND_DESCRIPTION(n),onRefresh:s,items:c?.outbound??[]})]})},Ku=({icon:o,title:n,subTitle:i,onRefresh:l,items:r})=>{const[c,d]=s(""),u=a(()=>r.filter(e=>e.serviceName.toLowerCase().includes(c.toLowerCase())),[r,c]);return e(Xt,{bgTint:"1000",richTitle:{icon:o,title:n,titleSize:he.XS,subTitle:i,subTitleSize:he.XXXS,badge:{label:r.length}},actions:[{id:"refresh",type:co.Button,buttonProps:{variant:be.Secondary,size:fe.S,leftIcon:Za,onClick:l}}],children:[t(uo,{value:c,onChange:d,width:"100%"}),t(po,{height:"calc(100vh - 284px)",gap:4,elements:u.length||c?!u.length&&c?[t(ft,{$height:"50vh",children:t(Re,{icon:o,title:et.NO_RESULTS,subTitle:et.NO_RESULTS_FOR_FILTER(c)})},"no-results")]:u.map(e=>t(qu,{...e},`${n}-${e.serviceName}`)):[t(ft,{$height:"50vh",children:t(Re,{icon:o,title:`No ${n} connections yet`,subTitle:n===et.INBOUND?et.NO_INBOUND_CONNECTIONS_DESCRIPTION:et.NO_OUTBOUND_CONNECTIONS_DESCRIPTION})},"no-data")]})]})},Yu=b.div`
649
+ `,Hp=({language:o,containerName:n,otelDistroName:i,runningStartedTime:l,started:r,ready:s,restartCount:c,isCrashLoop:d,waitingReasonEnum:p,waitingMessage:u,odigosHealthStatus:h,k8sHealthStatus:m,processes:g,jumpToTarget:f})=>{const b=!!f,v=b&&!f?.processPid,{formatDurationAgo:y}=Qt(),C=eo(v),S=a(()=>({title:n,icon:o?Ze(o):al,iconWithWrapper:!0}),[n,o]),x=a(()=>{const e=[],t=to({status:i?oo.Success:oo.Disabled,reasonEnum:i?et.INSTRUMENTED_WITH_DISTRO(i):et.UNINSTRUMENTED,message:""});t&&e.push(t);const o=to(h,ol,"health");o&&e.push(o);const n=to(m,nl,"health");return n&&e.push(n),e},[m,h,i]),w=a(()=>[{id:"runningTime",title:et.RUNNING_TIME,label:l?y(l,{style:"short"}):et.NOT_RUNNING,labelTooltip:`${et.RUNNING_TIME_TOOLTIP}. (${l})`},{id:"blank",spacer:!0},{id:"started",badge:{status:r?Fe.Success:Fe.Disabled,leftIcon:r?Oa:Aa,label:r?et.STARTED:et.NOT_STARTED,textSize:he.XXXS,invertColors:!0,useSecondaryTone:!0}},{id:"ready",badge:{status:s?Fe.Success:Fe.Disabled,leftIcon:s?Oa:Aa,label:s?et.READY:et.NOT_READY,textSize:he.XXXS,invertColors:!0,useSecondaryTone:!0}},{id:"isCrashLoop",badge:{status:d?Fe.Error:Fe.Success,leftIcon:d?Aa:Oa,label:d?et.CRASHLOOP:et.NO_CRASHLOOP,textSize:he.XXXS,invertColors:!0,useSecondaryTone:!0}},{id:"restartCount",title:et.RESTARTS,badge:{status:c?Fe.Error:void 0,label:c||0,textSize:he.XXXS}}],[l,y,r,s,d,c]),T=a(()=>u?Kt(p):"",[u,p]);return t("div",{ref:C,children:e(Xt,{bgTint:"750",richTitle:S,badges:x,items:w,withCollapse:!0,collapseIsDefaultOpen:b,children:[u&&t(Vp,{children:e(me,{$gap:10,$alignItems:"center",children:[t(Jt,{variant:ro.Pink,leftIcon:nl,label:T}),t(pe,{size:he.XXXS,color:ue.Error,children:u})]})}),(g??[]).map((e,o)=>{const i=o+1,a=b&&(l=f,r=e,!!l?.processPid&&Rp({identifyingAttributes:r.identifyingAttributes})===l.processPid);var l,r;return t(_p,{...e,overrideProcessNum:i,isJumpToTarget:a},`pod-container-${n}-process-${i}`)})]})})},jp=({podName:e,namespace:o,hasRestarted:n})=>{const i=a(()=>({title:et.DEBUG_COMMANDS,titleSize:he.XS}),[]),l=a(()=>[{label:et.GET_POD_YAML,value:`kubectl get pod ${e} -n ${o} -o yaml`},{label:et.DESCRIBE_POD,value:`kubectl describe pod ${e} -n ${o}`},{label:et.GET_POD_LOGS,value:`kubectl logs ${e} -n ${o}${n?" -p":""}`}],[e,o,n]);return t(Xt,{bgTint:"800",richTitle:i,withCollapse:!0,children:l.map(({label:e,value:o})=>t(so,{bgTint:"700",label:e,value:o},e))})},Gp=({source:n,onClickRestartPod:i})=>{const{jumpToTarget:l}=(()=>{const e=m(Bp);if(!e)throw new Error("useJumpToTargetContext must be used within a JumpToTargetContextProvider");return e})(),r=l?.tab===Ep.Pods?l:null,s=n?.pods??[],c=s.length>0,d=a(()=>s.some(e=>e.containers?.some(e=>e.restartCount&&e.restartCount>0)),[s]),p=a(()=>({title:et.PODS,badge:{label:s.length}}),[s.length]);return t(ee,{$gap:12,children:c?e(o,{children:[t($p,{podsOdigosHealthStatus:n.podsOdigosHealthStatus,pods:s}),t(Xt,{bgTint:"1000",richTitle:p,children:s.map(o=>{const a=r?.podName===o.podName,l=a&&!r?.containerName;return e(Ip,{...o,namespace:n.id.namespace,onClickRestartPod:i,collapseIsDefaultOpen:a,isJumpToTarget:l,children:[t(jp,{podName:o.podName,namespace:n.id.namespace,hasRestarted:d}),t(Up,{podContainers:o.containers,sourceContainers:n.containers,jumpToTarget:a?r:null})]},`pod-${o.podName}`)})})]}):t(ft,{$height:"70vh",children:t(Re,{title:et.NO_RUNNING_PODS,subTitle:et.NO_RUNNING_PODS_SUBTITLE})})})},Wp="user",Kp=({source:o})=>{const n=a(()=>o.serviceName||o.id.name,[o]),{sourcesApi:i}=Ll(),{data:l,loading:r,refetch:s}=i.usePeerSources({serviceName:n},{fetchPolicy:"network-only"}),c=l?.peerSources??null;return!c||r?t(ft,r?{$height:"70vh",children:t(St,{withSpinner:!0})}:{$height:"70vh",children:t(Re,{subTitle:et.COULD_NOT_FETCH_PEER_SOURCES})}):e(me,{$gap:16,$alignItems:"flex-start",children:[t(Yp,{icon:ll,title:et.INBOUND,subTitle:et.INBOUND_DESCRIPTION(n),onRefresh:s,items:c?.inbound??[]}),t(Yp,{icon:rl,title:et.OUTBOUND,subTitle:et.OUTBOUND_DESCRIPTION(n),onRefresh:s,items:c?.outbound??[]})]})},Yp=({icon:o,title:n,subTitle:i,onRefresh:l,items:r})=>{const[c,d]=s(""),p=a(()=>r.filter(e=>e.serviceName.toLowerCase().includes(c.toLowerCase())),[r,c]);return e(Xt,{bgTint:"1000",richTitle:{icon:o,title:n,titleSize:he.XS,subTitle:i,subTitleSize:he.XXXS,badge:{label:r.length}},actions:[{id:"refresh",type:co.Button,buttonProps:{variant:be.Secondary,size:fe.S,leftIcon:Qa,onClick:l}}],children:[t(po,{value:c,onChange:d,width:"100%"}),t(uo,{height:"calc(100vh - 284px)",gap:4,elements:p.length||c?!p.length&&c?[t(ft,{$height:"50vh",children:t(Re,{icon:o,title:et.NO_RESULTS,subTitle:et.NO_RESULTS_FOR_FILTER(c)})},"no-results")]:p.map(e=>t(Jp,{...e},`${n}-${e.serviceName}`)):[t(ft,{$height:"50vh",children:t(Re,{icon:o,title:`No ${n} connections yet`,subTitle:n===et.INBOUND?et.NO_INBOUND_CONNECTIONS_DESCRIPTION:et.NO_OUTBOUND_CONNECTIONS_DESCRIPTION})},"no-data")]})]})},qp=b.div`
650
650
  display: flex;
651
651
  align-items: center;
652
652
  justify-content: space-between;
@@ -660,9 +660,9 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import n,{useEff
660
660
  background-color: ${({theme:e})=>e.v2.colors.silver[800]};
661
661
  }
662
662
  `}
663
- `,qu=({serviceName:o,isVirtual:n,nodeAttributes:i})=>{const l=ho(e=>e.drawerEntityId),{items:r}=Pl().sourcesApi.useSources(),s=a(()=>r.find(e=>e.id.name===o||e.serviceName===o),[r,o]),c=a(()=>s&&JSON.stringify(mo(s))!==JSON.stringify(mo(l)),[s,l]),d=a(()=>{if(n){const e=Object.fromEntries((i??[]).map(({key:e,value:t})=>[e,t]));return[go({serviceName:o,attributes:e})]}if(o?.toLowerCase()===Gu)return[rl];const e=s?fo(s):void 0;return e?.length?e:[il]},[n,i,o,s]),u=c?()=>{const{setDrawerType:e,setDrawerEntityId:t}=ho.getState();e(vo(Et.Source)),t({namespace:s?.id.namespace??"",name:s?.id.name??"",kind:s?.id.kind??"",region:s?.id.region??""})}:void 0;return e(Yu,{onClick:u,$withClick:!!u,children:[e(me,{$gap:8,children:[t(bo,{icons:d}),t(ue,{size:he.XXS,children:o})]}),n&&t(qe,{status:Fe.Info,label:et.VIRTUAL,textSize:he.XXXS,invertColors:!0,tooltip:et.VIRTUAL_TOOLTIP})]})},Ju=e=>{if("string"==typeof e)return e;if(e&&"object"==typeof e){const t=e;if("string"==typeof t.k8sActualManifest)return t.k8sActualManifest;if("string"==typeof t.manifest)return t.manifest}},Zu=({source:o})=>{const n=v(),{k8sManifestApi:l}=Pl(),[r,c]=s(!0),[d,u]=s(void 0),[p,h]=s(!0),[m,g]=s(void 0);i(()=>{l.fetch({namespace:o.id.namespace,kind:o.id.kind,name:o.id.name}).then(({data:e})=>u(Ju(e))).finally(()=>c(!1)),l.fetch({namespace:o.id.namespace,kind:yo.InstrumentationConfig,name:`${o.id.kind}-${o.id.name}`.toLowerCase()}).then(({data:e})=>g(Ju(e))).finally(()=>h(!1))},[l,o.id.namespace,o.id.kind,o.id.name]);const f=a(()=>[{label:et.DESCRIBE_POD,value:`kubectl describe ${o.id.kind} ${o.id.name} -n ${o.id.namespace}`},{label:et.GET_POD_YAML,value:`kubectl get ${o.id.kind} ${o.id.name} -n ${o.id.namespace} -o yaml`},{label:et.GET_POD_YAML,value:`kubectl get ${yo.InstrumentationConfig} ${o.id.kind}-${o.id.name} -n ${o.id.namespace} -o yaml`}],[o.id.kind,o.id.name,o.id.namespace]);return e(Xt,{bgTint:"1000",children:[t(Xt,{bgTint:"900",richTitle:{icon:sl,title:et.DEBUG_COMMANDS},withCollapse:!0,collapseIsDefaultOpen:!0,children:f.map(({label:e,value:o},n)=>t(so,{label:e,value:o},`debug-cmd-${n}-${e}`))}),r?t(gt,{size:1}):t(Cr,{bgTint:"800",codeBgColor:n.v2.colors.silver[900],title:`${o.id.kind} YAML`,yaml:d}),p?t(gt,{size:1}):t(Cr,{bgTint:"800",codeBgColor:n.v2.colors.silver[900],title:"Instrumentation Config YAML",yaml:m})]})},Qu=({title:o,children:n})=>e(ee,{$gap:8,children:[t(ue,{size:he.XXXS,color:pe.Secondary,children:o}),n]}),ep=({source:o})=>{const n=a(()=>{const[e,t]=So(o.telemetryMetrics?.[0]?.throughputBytes||0).split(" ");return{value:e,units:t}},[o]);return t(Qu,{title:et.THROUGHPUT_LAST_10_SECONDS,children:e(me,{$alignItems:"flex-end",$gap:4,children:[t(ue,{size:he.L,children:n.value}),t(ue,{size:he.XS,variant:$t.Span,children:n.units})]})})},tp=({source:o})=>{const{CopyButton:n}=Pt();return t(Qu,{title:et.NAMESPACE,children:e(me,{children:[t(Jt,{variant:ro.Blue,label:o.id.namespace}),t(n,{value:o.id.namespace,size:Ct.XS})]})})},op=({source:o})=>{const{CopyButton:n}=Pt(),i=o.id.region;return i?t(Qu,{title:et.REGION,children:e(me,{children:[t(Jt,{variant:ro.Blue,label:i}),t(n,{value:i,size:Ct.XS})]})}):null},np=({source:e})=>{const o=e.markedForInstrumentation?.markedForInstrumentation??!1;return t(Qu,{title:et.ENABLED,children:t(me,{children:t(Jt,{variant:o?ro.Green:ro.Default,label:o?et.ENABLED:et.DISABLED})})})},ip=({source:e,label:o})=>t(Qu,{title:et.KIND,children:t(me,{children:t(Jt,{variant:ro.Blue,label:o||e.id.kind})})}),ap=({source:o})=>{const{CopyButton:n}=Pt();return t(Qu,{title:et.NAME,children:e(me,{children:[t(Jt,{variant:ro.Blue,label:o.id.name}),t(n,{value:o.id.name,size:Ct.XS})]})})},lp=({source:o})=>{const{CopyButton:n}=Pt(),i=o.serviceName||o.id.name;return t(Qu,{title:et.SERVICE_NAME,children:e(me,{children:[t(Jt,{variant:ro.Blue,label:i}),t(n,{value:i,size:Ct.XS})]})})},rp=({source:o})=>{const{isVm:n,isConnector:i,isK8s:l}=S(),r=a(()=>Co(o.id.kind),[o.id.kind]);return t(Xt,{children:e(me,{$gap:24,$alignItems:"flex-start",$justifyContent:"flex-start",$wrap:"wrap",children:[l&&t(ep,{source:o}),l&&t(tp,{source:o}),i&&t(op,{source:o}),i&&t(np,{source:o}),t(ip,{source:o,label:r}),t(ap,{source:o}),(i||n)&&t(lp,{source:o})]})})},sp=({source:e})=>e.pods?.length?t(Xt,{bgTint:"900",children:t(Nu,{podsOdigosHealthStatus:e.podsOdigosHealthStatus,pods:e.pods,noPadding:!0})}):null,cp=({source:e})=>{const o=a(()=>e.workloadOdigosHealthStatus?{status:e.workloadOdigosHealthStatus.status?xo(e.workloadOdigosHealthStatus.status):Fe.Unknown,title:Kt(e.workloadOdigosHealthStatus.reasonEnum),subTitle:e.workloadOdigosHealthStatus.message}:null,[e]);return o?t(no,{...o,width:"100%"}):null},dp="calc(50% - 6px)",up=({source:o,onClickRollout:n,onClickRollback:i})=>{const l=a(()=>{const{status:e,reasonEnum:t,message:i}=o.conditions?.rollout||{},a=io(e);return a?{status:a,title:t?.toLowerCase().includes("rollout")?Kt(t):`${et.ROLLOUT} ${Kt(t)}`,subTitle:i,action:a!==Fe.Success?{icon:Za,tooltip:et.ROLLOUT_RESTART,onClick:n}:void 0}:null},[o]),r=a(()=>{const{status:e,reasonEnum:t,message:n}=o.autoRollback?.autoRollbackStatus||{},a=io(e);return a?{status:a,title:t?.toLowerCase().includes("rollback")?Kt(t):`${et.ROLLBACK} ${Kt(t)}`,subTitle:n,action:a!==Fe.Success?{icon:Za,tooltip:et.ROLLBACK_RECOVER,onClick:i}:void 0}:null},[o]);return l||r?e(me,{$gap:12,$alignItems:"stretch",children:[l&&t(no,{invertColors:!0,slim:!0,width:r?dp:"100%",...l}),r&&t(no,{invertColors:!0,slim:!0,width:dp,...r})]}):null},pp=h(null),hp=b.div`
663
+ `,Jp=({serviceName:o,isVirtual:n,nodeAttributes:i})=>{const l=ho(e=>e.drawerEntityId),{items:r}=Ll().sourcesApi.useSources(),s=a(()=>r.find(e=>e.id.name===o||e.serviceName===o),[r,o]),c=a(()=>s&&JSON.stringify(mo(s))!==JSON.stringify(mo(l)),[s,l]),d=a(()=>{if(n){const e=Object.fromEntries((i??[]).map(({key:e,value:t})=>[e,t]));return[go({serviceName:o,attributes:e})]}if(o?.toLowerCase()===Wp)return[sl];const e=s?fo(s):void 0;return e?.length?e:[al]},[n,i,o,s]),p=c?()=>{const{setDrawerType:e,setDrawerEntityId:t}=ho.getState();e(vo(Et.Source)),t({namespace:s?.id.namespace??"",name:s?.id.name??"",kind:s?.id.kind??"",region:s?.id.region??""})}:void 0;return e(qp,{onClick:p,$withClick:!!p,children:[e(me,{$gap:8,children:[t(bo,{icons:d}),t(pe,{size:he.XXS,children:o})]}),n&&t(qe,{status:Fe.Info,label:et.VIRTUAL,textSize:he.XXXS,invertColors:!0,tooltip:et.VIRTUAL_TOOLTIP})]})},Zp=e=>{if("string"==typeof e)return e;if(e&&"object"==typeof e){const t=e;if("string"==typeof t.k8sActualManifest)return t.k8sActualManifest;if("string"==typeof t.manifest)return t.manifest}},Qp=({source:o})=>{const n=v(),{k8sManifestApi:l}=Ll(),[r,c]=s(!0),[d,p]=s(void 0),[u,h]=s(!0),[m,g]=s(void 0);i(()=>{l.fetch({namespace:o.id.namespace,kind:o.id.kind,name:o.id.name}).then(({data:e})=>p(Zp(e))).finally(()=>c(!1)),l.fetch({namespace:o.id.namespace,kind:yo.InstrumentationConfig,name:`${o.id.kind}-${o.id.name}`.toLowerCase()}).then(({data:e})=>g(Zp(e))).finally(()=>h(!1))},[l,o.id.namespace,o.id.kind,o.id.name]);const f=a(()=>[{label:et.DESCRIBE_POD,value:`kubectl describe ${o.id.kind} ${o.id.name} -n ${o.id.namespace}`},{label:et.GET_POD_YAML,value:`kubectl get ${o.id.kind} ${o.id.name} -n ${o.id.namespace} -o yaml`},{label:et.GET_POD_YAML,value:`kubectl get ${yo.InstrumentationConfig} ${o.id.kind}-${o.id.name} -n ${o.id.namespace} -o yaml`}],[o.id.kind,o.id.name,o.id.namespace]);return e(Xt,{bgTint:"1000",children:[t(Xt,{bgTint:"900",richTitle:{icon:cl,title:et.DEBUG_COMMANDS},withCollapse:!0,collapseIsDefaultOpen:!0,children:f.map(({label:e,value:o},n)=>t(so,{label:e,value:o},`debug-cmd-${n}-${e}`))}),r?t(gt,{size:1}):t(Sr,{bgTint:"800",codeBgColor:n.v2.colors.silver[900],title:`${o.id.kind} YAML`,yaml:d}),u?t(gt,{size:1}):t(Sr,{bgTint:"800",codeBgColor:n.v2.colors.silver[900],title:"Instrumentation Config YAML",yaml:m})]})},eu=({title:o,children:n})=>e(ee,{$gap:8,children:[t(pe,{size:he.XXXS,color:ue.Secondary,children:o}),n]}),tu=({source:o})=>{const n=a(()=>{const[e,t]=So(o.telemetryMetrics?.[0]?.throughputBytes||0).split(" ");return{value:e,units:t}},[o]);return t(eu,{title:et.THROUGHPUT_LAST_10_SECONDS,children:e(me,{$alignItems:"flex-end",$gap:4,children:[t(pe,{size:he.L,children:n.value}),t(pe,{size:he.XS,variant:$t.Span,children:n.units})]})})},ou=({source:o})=>{const{CopyButton:n}=Pt();return t(eu,{title:et.NAMESPACE,children:e(me,{children:[t(Jt,{variant:ro.Blue,label:o.id.namespace}),t(n,{value:o.id.namespace,size:Ct.XS})]})})},nu=({source:o})=>{const{CopyButton:n}=Pt(),i=o.id.region;return i?t(eu,{title:et.REGION,children:e(me,{children:[t(Jt,{variant:ro.Blue,label:i}),t(n,{value:i,size:Ct.XS})]})}):null},iu=({source:e})=>{const o=e.markedForInstrumentation?.markedForInstrumentation??!1;return t(eu,{title:et.ENABLED,children:t(me,{children:t(Jt,{variant:o?ro.Green:ro.Default,label:o?et.ENABLED:et.DISABLED})})})},au=({source:e,label:o})=>t(eu,{title:et.KIND,children:t(me,{children:t(Jt,{variant:ro.Blue,label:o||e.id.kind})})}),lu=({source:o})=>{const{CopyButton:n}=Pt();return t(eu,{title:et.NAME,children:e(me,{children:[t(Jt,{variant:ro.Blue,label:o.id.name}),t(n,{value:o.id.name,size:Ct.XS})]})})},ru=({source:o})=>{const{CopyButton:n}=Pt(),i=o.serviceName||o.id.name;return t(eu,{title:et.SERVICE_NAME,children:e(me,{children:[t(Jt,{variant:ro.Blue,label:i}),t(n,{value:i,size:Ct.XS})]})})},su=({source:o})=>{const{isVm:n,isConnector:i,isK8s:l}=S(),r=a(()=>Co(o.id.kind),[o.id.kind]);return t(Xt,{children:e(me,{$gap:24,$alignItems:"flex-start",$justifyContent:"flex-start",$wrap:"wrap",children:[l&&t(tu,{source:o}),l&&t(ou,{source:o}),i&&t(nu,{source:o}),i&&t(iu,{source:o}),t(au,{source:o,label:r}),t(lu,{source:o}),(i||n)&&t(ru,{source:o})]})})},cu=({source:e})=>e.pods?.length&&e.podsOdigosHealthStatus?t(Xt,{bgTint:"900",children:t($p,{podsOdigosHealthStatus:e.podsOdigosHealthStatus,pods:e.pods,noPadding:!0})}):null,du=({source:e})=>{const o=a(()=>e.workloadOdigosHealthStatus?{status:e.workloadOdigosHealthStatus.status?xo(e.workloadOdigosHealthStatus.status):Fe.Unknown,title:Kt(e.workloadOdigosHealthStatus.reasonEnum),subTitle:e.workloadOdigosHealthStatus.message}:null,[e]);return o?t(no,{...o,width:"100%"}):null},pu="calc(50% - 6px)",uu=(e,t)=>{if(!e)return t;const o=e.toLowerCase();return o.includes("rollout")||o.includes("inject")||o.includes("restart")||o.includes("pod")?Kt(e):`${t} ${Kt(e)}`},hu=({source:o,onClickRollout:n,onClickRollback:l})=>{const r=o.rollout?.podsManifestInjectionStatus??o.conditions?.rollout,c=`${r?.status??""}:${r?.reasonEnum??""}`,[d,p]=s(()=>new Set);i(()=>{p(new Set)},[c]);const u=a(()=>{const{status:e,reasonEnum:t,message:o,actionItems:i}=r||{},a=io(e);if(!a)return null;const l=uu(t,et.ROLLOUT),s=o,c=(i??[]).flatMap(e=>e.type!==wo.RolloutWorkload?[]:[{"data-id":`rollout-action-${e.type}`,label:et.ROLLOUT,tooltip:e.userFacingText||void 0,leftIcon:dl,disabled:d.has(e.type),onClick:t=>{t.stopPropagation(),d.has(e.type)||(p(t=>new Set(t).add(e.type)),n())}}]);return{status:a,title:l,subTitle:s,action:c.length||a===Fe.Success?void 0:{icon:Qa,tooltip:et.ROLLOUT_RESTART,onClick:n},actionButtons:c.length?c:void 0}},[r,d,n]),h=a(()=>{const{status:e,reasonEnum:t,message:n}=o.autoRollback?.autoRollbackStatus||{},i=io(e);return i?{status:i,title:uu(t,et.ROLLBACK),subTitle:n,action:i!==Fe.Success?{icon:Qa,tooltip:et.ROLLBACK_RECOVER,onClick:l}:void 0}:null},[o,l]);return u||h?e(me,{$gap:12,$alignItems:"stretch",children:[u&&t(no,{invertColors:!0,slim:!0,width:h?pu:"100%",...u}),h&&t(no,{invertColors:!0,slim:!0,width:pu,...h})]}):null},mu=h(null),gu=b.div`
664
664
  position: relative;
665
- `,mp=({children:e})=>{const o=l(null);return t(hp,{ref:o,children:t(pp.Provider,{value:o,children:e})})},gp=b.div`
665
+ `,fu=({children:e})=>{const o=l(null);return t(gu,{ref:o,children:t(mu.Provider,{value:o,children:e})})},bu=b.div`
666
666
  position: fixed;
667
667
  top: ${({$coords:e})=>e.top}px;
668
668
  right: ${({$coords:e})=>e.right}px;
@@ -676,14 +676,14 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import n,{useEff
676
676
  padding: 12px 16px;
677
677
  border-radius: 12px;
678
678
  background-color: ${({theme:e})=>e.v2.colors.silver[750]};
679
- `,fp=b.div`
679
+ `,vu=b.div`
680
680
  display: flex;
681
681
  align-items: flex-end;
682
682
  justify-content: space-between;
683
683
  gap: 8px;
684
- `,bp=b.div`
684
+ `,yu=b.div`
685
685
  flex: 1;
686
- `,vp=({width:o,onClose:n,onSave:i,saveTooltip:a,onDelete:l,deleteTooltip:r,title:c,subTitle:d,warning:u,children:p,pushButtonsWith:h})=>{const f=v(),b=m(pp),[y,C]=s(null);return wo(b??{current:null},n),g(()=>{const e=b?.current?.getBoundingClientRect();e&&C({top:e.bottom+4,right:window.innerWidth-e.left-24})},[b]),y?Tr(e(gp,{$coords:y,$width:o,"data-ignore-outside-click":"true",children:[e(ee,{$gap:4,children:[t(ue,{size:he.XXS,children:c}),t(ue,{size:he.XXXS,color:pe.Secondary,children:d})]}),e(fp,{children:[t(bp,{children:p}),e(me,{$gap:8,$width:"fit-content",$margin:`0 0 ${h||0} 0`,children:[t(ge,{variant:be.Secondary,onClick:l,leftIcon:Ea,tooltip:r,hideTooltipIcon:!0,iconSize:16,size:fe.S,textColor:f.v2.colors.red[500]}),t(ge,{variant:be.Primary,onClick:i,leftIcon:Xa,tooltip:a,hideTooltipIcon:!0,iconSize:16,size:fe.S})]})]}),t("div",{children:t(Le,{status:Fe.Warning,message:u})})]}),document.body):null},yp=({language:o,overridden:n,onOverride:i,defaultValues:l})=>{const{tier:r}=S(),{formData:c,handleFormChange:d,resetFormData:u}=Ht(l),p=a(()=>{if(!o)return[];const e=To[o].community,t=r===It.Onprem?To[o].enterprise:[];return e.concat(t).map(e=>({id:e.id,label:e.label,icon:e.icon||void 0})).sort((e,t)=>e.label.localeCompare(t.label))},[o,r]),[h,m]=s(!1),[g,f]=s(!1),b=()=>{h||(g&&u(),f(e=>!e))};return e(me,{$gap:4,$alignItems:"center",children:[n?t(qe,{status:Fe.Info,invertColors:!0,label:et.OVERIDDEN}):null,e(mp,{children:[t($e,{text:et.OVERRIDE_OTEL_DISTRO_NAME,children:t(yt,{icon:Da,onClick:b})}),g&&t(vp,{width:"500px",onClose:b,onSave:async()=>{m(!0),await i(c),m(!1),b()},saveTooltip:et.OVERRIDE_OTEL_DISTRO_NAME_SAVE_TOOLTIP,onDelete:async()=>{m(!0),await i({otelDistroName:null}),m(!1),b()},deleteTooltip:et.OVERRIDE_OTEL_DISTRO_NAME_DELETE_TOOLTIP,title:et.OVERRIDE_OTEL_DISTRO_NAME,subTitle:et.OVERRIDE_OTEL_DISTRO_NAME_SUBTITLE,warning:et.OVERRIDE_OTEL_DISTRO_NAME_WARNING,children:t(vt,{label:et.OTEL_DISTRO_NAME,options:p,values:c.otelDistroName?[c.otelDistroName]:[],setValues:e=>d("otelDistroName",e[0])})})]})]})},Cp=({overridden:o,onOverride:n,defaultValues:i,originalValues:l})=>{const{addNotification:r}=Yt(),{formData:c,handleFormChange:d,resetFormData:u}=Ht(i),p=a(()=>ko.map(e=>({id:e.id,label:e.label,icon:e.icon||void 0})),[]),[h,m]=s(!1),[g,f]=s(!1),b=()=>{h||(g&&u(),f(e=>!e))};return e(me,{children:[o?t(qe,{status:Fe.Info,invertColors:!0,label:et.OVERIDDEN}):null,e(mp,{children:[t($e,{text:et.OVERRIDE_RUNTIME_DETAILS,children:t(yt,{icon:Da,onClick:b})}),g&&t(vp,{width:"500px",onClose:b,onSave:async()=>{!c.version||Eo(c.version)?(m(!0),await n(c),m(!1),b()):r({type:Fe.Warning,message:qt.INVALID_VERSION,hideFromHistory:!0})},saveTooltip:et.OVERRIDE_RUNTIME_DETAILS_SAVE_TOOLTIP,onDelete:async()=>{m(!0),await n({language:null,version:""}),m(!1),b()},deleteTooltip:et.OVERRIDE_RUNTIME_DETAILS_DELETE_TOOLTIP,title:et.OVERRIDE_RUNTIME_DETAILS,subTitle:et.OVERRIDE_RUNTIME_DETAILS_SUBTITLE,warning:et.OVERRIDE_RUNTIME_WARNING,pushButtonsWith:"20px",children:e(me,{$gap:8,children:[t(vt,{label:et.LANGUAGE,options:p,values:c.language?[c.language]:[],setValues:e=>d("language",e[0]),helpMessage:`Auto-detected: ${l.language||"none"}`}),t(Te,{label:et.RUNTIME_VERSION,placeholder:et.VERSION_PLACEHOLDER,value:c.version,onChange:e=>d("version",e.target.value),helpMessage:`Auto-detected: ${l.version||"none"}`})]})})]})]})},Sp=({source:e})=>{const{isVm:o}=S(),{containers:n,containersRichTitle:i}=a(()=>{const t=e?.conditions?.runtimeDetection;return{containers:e?.containers??[],containersRichTitle:{title:o?et.DETECTED_PROCESSES:`${e.id.kind} ${et.CONTAINERS}`,tooltip:t?.message||(o?et.DETECTED_PROCESSES_DESCRIPTION:et.DETECTED_CONTAINERS_DESCRIPTION),badge:io(t?.status)===Fe.Loading?{status:Fe.Loading,backgroundColor:"transparent"}:{label:e?.containers?.length}}}},[e,o]);return t(Xt,{bgTint:"1000",richTitle:i,withCollapse:!0,collapseIsDefaultOpen:!0,children:t(ee,{$gap:8,children:n.map(o=>o&&t(kp,{...o,sourceId:e.id},`source-container-${o.containerName}`))})})},xp=b.div`
686
+ `,Cu=({width:o,onClose:n,onSave:i,saveTooltip:a,onDelete:l,deleteTooltip:r,title:c,subTitle:d,warning:p,children:u,pushButtonsWith:h})=>{const f=v(),b=m(mu),[y,C]=s(null);return To(b??{current:null},n),g(()=>{const e=b?.current?.getBoundingClientRect();e&&C({top:e.bottom+4,right:window.innerWidth-e.left-24})},[b]),y?kr(e(bu,{$coords:y,$width:o,"data-ignore-outside-click":"true",children:[e(ee,{$gap:4,children:[t(pe,{size:he.XXS,children:c}),t(pe,{size:he.XXXS,color:ue.Secondary,children:d})]}),e(vu,{children:[t(yu,{children:u}),e(me,{$gap:8,$width:"fit-content",$margin:`0 0 ${h||0} 0`,children:[t(ge,{variant:be.Secondary,onClick:l,leftIcon:Ia,tooltip:r,hideTooltipIcon:!0,iconSize:16,size:fe.S,textColor:f.v2.colors.red[500]}),t(ge,{variant:be.Primary,onClick:i,leftIcon:Ua,tooltip:a,hideTooltipIcon:!0,iconSize:16,size:fe.S})]})]}),t("div",{children:t(Le,{status:Fe.Warning,message:p})})]}),document.body):null},Su=({language:o,overridden:n,onOverride:i,defaultValues:l})=>{const{tier:r}=S(),{formData:c,handleFormChange:d,resetFormData:p}=Ht(l),u=a(()=>{if(!o)return[];const e=ko[o].community,t=r===It.Onprem?ko[o].enterprise:[];return e.concat(t).map(e=>({id:e.id,label:e.label,icon:e.icon||void 0})).sort((e,t)=>e.label.localeCompare(t.label))},[o,r]),[h,m]=s(!1),[g,f]=s(!1),b=()=>{h||(g&&p(),f(e=>!e))};return e(me,{$gap:4,$alignItems:"center",children:[n?t(qe,{status:Fe.Info,invertColors:!0,label:et.OVERIDDEN}):null,e(fu,{children:[t($e,{text:et.OVERRIDE_OTEL_DISTRO_NAME,children:t(yt,{icon:_a,onClick:b})}),g&&t(Cu,{width:"500px",onClose:b,onSave:async()=>{m(!0),await i(c),m(!1),b()},saveTooltip:et.OVERRIDE_OTEL_DISTRO_NAME_SAVE_TOOLTIP,onDelete:async()=>{m(!0),await i({otelDistroName:null}),m(!1),b()},deleteTooltip:et.OVERRIDE_OTEL_DISTRO_NAME_DELETE_TOOLTIP,title:et.OVERRIDE_OTEL_DISTRO_NAME,subTitle:et.OVERRIDE_OTEL_DISTRO_NAME_SUBTITLE,warning:et.OVERRIDE_OTEL_DISTRO_NAME_WARNING,children:t(vt,{label:et.OTEL_DISTRO_NAME,options:u,values:c.otelDistroName?[c.otelDistroName]:[],setValues:e=>d("otelDistroName",e[0])})})]})]})},xu=({overridden:o,onOverride:n,defaultValues:i,originalValues:l})=>{const{addNotification:r}=Yt(),{formData:c,handleFormChange:d,resetFormData:p}=Ht(i),u=a(()=>Eo.map(e=>({id:e.id,label:e.label,icon:e.icon||void 0})),[]),[h,m]=s(!1),[g,f]=s(!1),b=()=>{h||(g&&p(),f(e=>!e))};return e(me,{children:[o?t(qe,{status:Fe.Info,invertColors:!0,label:et.OVERIDDEN}):null,e(fu,{children:[t($e,{text:et.OVERRIDE_RUNTIME_DETAILS,children:t(yt,{icon:_a,onClick:b})}),g&&t(Cu,{width:"500px",onClose:b,onSave:async()=>{!c.version||Io(c.version)?(m(!0),await n(c),m(!1),b()):r({type:Fe.Warning,message:qt.INVALID_VERSION,hideFromHistory:!0})},saveTooltip:et.OVERRIDE_RUNTIME_DETAILS_SAVE_TOOLTIP,onDelete:async()=>{m(!0),await n({language:null,version:""}),m(!1),b()},deleteTooltip:et.OVERRIDE_RUNTIME_DETAILS_DELETE_TOOLTIP,title:et.OVERRIDE_RUNTIME_DETAILS,subTitle:et.OVERRIDE_RUNTIME_DETAILS_SUBTITLE,warning:et.OVERRIDE_RUNTIME_WARNING,pushButtonsWith:"20px",children:e(me,{$gap:8,children:[t(vt,{label:et.LANGUAGE,options:u,values:c.language?[c.language]:[],setValues:e=>d("language",e[0]),helpMessage:`Auto-detected: ${l.language||"none"}`}),t(Te,{label:et.RUNTIME_VERSION,placeholder:et.VERSION_PLACEHOLDER,value:c.version,onChange:e=>d("version",e.target.value),helpMessage:`Auto-detected: ${l.version||"none"}`})]})})]})]})},wu=({source:e})=>{const{isVm:o}=S(),{containers:n,containersRichTitle:i}=a(()=>{const t=e?.conditions?.runtimeDetection;return{containers:e?.containers??[],containersRichTitle:{title:o?et.DETECTED_PROCESSES:`${e.id.kind} ${et.CONTAINERS}`,tooltip:t?.message||(o?et.DETECTED_PROCESSES_DESCRIPTION:et.DETECTED_CONTAINERS_DESCRIPTION),badge:io(t?.status)===Fe.Loading?{status:Fe.Loading,backgroundColor:"transparent"}:{label:e?.containers?.length}}}},[e,o]);return t(Xt,{bgTint:"1000",richTitle:i,withCollapse:!0,collapseIsDefaultOpen:!0,children:t(ee,{$gap:8,children:n.map(o=>o&&t(Iu,{...o,sourceId:e.id},`source-container-${o.containerName}`))})})},Tu=b.div`
687
687
  display: flex;
688
688
  flex-direction: column;
689
689
  align-self: stretch;
@@ -691,21 +691,32 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import n,{useEff
691
691
  padding: 8px 12px;
692
692
  border-radius: 8px;
693
693
  background-color: ${({theme:e})=>e.v2.colors.silver[900]};
694
- `,wp=b.div`
694
+ `,ku=b.div`
695
695
  display: flex;
696
696
  align-items: center;
697
697
  justify-content: center;
698
698
  padding: 8px;
699
699
  border-radius: 10px;
700
700
  background-color: ${({theme:e})=>e.v2.colors.silver[800]};
701
- `,Tp=b.div`
701
+ `,Eu=b.div`
702
702
  display: flex;
703
703
  flex-direction: column;
704
704
  gap: 12px;
705
705
  padding: 8px 12px;
706
706
  border-radius: 8px;
707
707
  background-color: ${({theme:e})=>e.v2.colors.silver[800]};
708
- `,kp=({sourceId:o,...n})=>{const{containerName:i,runtimeInfo:l,agentEnabled:r,overrides:s}=n,c=v(),{sourcesApi:d}=Pl(),u=a(()=>!!s?.runtimeInfo?.language||!!s?.runtimeInfo?.runtimeVersion,[s]),p=a(()=>({language:lo(n),version:Io(n)||void 0}),[n]),h=a(()=>!!s?.otelDistroName,[s]),m=a(()=>({otelDistroName:s?.otelDistroName||n.agentEnabled?.otelDistroName}),[s,n]),g=a(()=>!l&&!u,[l,u]),f=a(()=>g?il:Ze(p.language),[g,p]),b=a(()=>{if(g)return"";const{language:e,version:t}=p;return`${e}${t?` • ${t}`:""}`},[g,p]),y=a(()=>g?{status:Fe.Loading,label:et.WAITING_FOR_RUNTIME_DETECTION}:{status:r?.otelDistroName?Fe.Success:Fe.Disabled,leftIcon:r?.otelDistroName?$a:Oa,label:r?.otelDistroName?`Instrumented | ${r.otelDistroName}`:"Uninstrumented",tooltip:r?.agentEnabledStatus?.message},[g,r]),C=e=>d.update(o,{containerName:i,...h?m:{},...u?p:{},...e}),S=a(()=>{const e=[];return n.agentConfig?.traces?.headSampling?.noisyOperations?.length&&e.push(et.HEAD_SAMPLING),(n.collectorConfig?.tailSampling?.noisyOperations?.length||n.collectorConfig?.tailSampling?.highlyRelevantOperations?.length||n.collectorConfig?.tailSampling?.costReductionRules?.length)&&e.push(et.TAIL_SAMPLING),e},[n]);return e(xp,{children:[e(me,{$gap:16,$alignItems:"center",$justifyContent:"space-between",$wrap:"wrap",children:[e(me,{$gap:8,$alignItems:"center",children:[t(wp,{children:t(f,{size:24,fill:l?void 0:c.v2.colors.grey[400]})}),t(ue,{children:i}),t(Jt,b?{variant:ro.Blue,label:b}:{variant:ro.Loader,label:et.DETECTING_RUNTIME_INFO}),t(Cp,{overridden:u,onOverride:C,defaultValues:p,originalValues:{language:n.runtimeInfo?.language,version:n.runtimeInfo?.runtimeVersion||""}})]}),e(me,{$gap:8,$alignItems:"center",children:[t(qe,{...y,textSize:he.XXXS}),t(yp,{language:p.language,overridden:h,onOverride:C,defaultValues:m})]})]}),!r||r.agentEnabled||g?null:t(Tp,{children:e(me,{$gap:10,$alignItems:"center",children:[t(Jt,{variant:ro.Pink,label:Kt(r.agentEnabledStatus?.reasonEnum)||et.NO_AVAILABLE_AGENT}),t(ue,{size:he.XXXS,color:pe.Secondary,children:r?.agentEnabledStatus?.message})]})}),S.length>0&&t(Tp,{children:t(me,{$gap:16,$wrap:"wrap",children:S.map((e,o)=>t(qe,{label:e,leftIcon:$a,status:Fe.Success,invertColors:!0,useSecondaryTone:!0},`${i}-rule-${o}`))})})]})},Ep=b.div`
708
+ `,Iu=({sourceId:o,...n})=>{const{containerName:i,runtimeInfo:l,agentEnabled:r,overrides:s}=n,c=v(),{sourcesApi:d}=Ll(),p=a(()=>!!s?.runtimeInfo?.language||!!s?.runtimeInfo?.runtimeVersion,[s]),u=a(()=>({language:lo(n),version:No(n)||void 0}),[n]),h=a(()=>!!s?.otelDistroName,[s]),m=a(()=>({otelDistroName:s?.otelDistroName||n.agentEnabled?.otelDistroName}),[s,n]),g=a(()=>!l&&!p,[l,p]),f=a(()=>g?al:Ze(u.language),[g,u]),b=a(()=>{if(g)return"";const{language:e,version:t}=u;return`${e}${t?` • ${t}`:""}`},[g,u]),y=a(()=>g?{status:Fe.Loading,label:et.WAITING_FOR_RUNTIME_DETECTION}:{status:r?.otelDistroName?Fe.Success:Fe.Disabled,leftIcon:r?.otelDistroName?Oa:Aa,label:r?.otelDistroName?`Instrumented | ${r.otelDistroName}`:"Uninstrumented",tooltip:r?.agentEnabledStatus?.message},[g,r]),C=e=>d.update(o,{containerName:i,...h?m:{},...p?u:{},...e}),S=a(()=>{const e=[];return n.agentConfig?.traces?.headSampling?.noisyOperations?.length&&e.push(et.HEAD_SAMPLING),(n.collectorConfig?.tailSampling?.noisyOperations?.length||n.collectorConfig?.tailSampling?.highlyRelevantOperations?.length||n.collectorConfig?.tailSampling?.costReductionRules?.length)&&e.push(et.TAIL_SAMPLING),e},[n]);return e(Tu,{children:[e(me,{$gap:16,$alignItems:"center",$justifyContent:"space-between",$wrap:"wrap",children:[e(me,{$gap:8,$alignItems:"center",children:[t(ku,{children:t(f,{size:24,fill:l?void 0:c.v2.colors.grey[400]})}),t(pe,{children:i}),t(Jt,b?{variant:ro.Blue,label:b}:{variant:ro.Loader,label:et.DETECTING_RUNTIME_INFO}),t(xu,{overridden:p,onOverride:C,defaultValues:u,originalValues:{language:n.runtimeInfo?.language,version:n.runtimeInfo?.runtimeVersion||""}})]}),e(me,{$gap:8,$alignItems:"center",children:[t(qe,{...y,textSize:he.XXXS}),t(Su,{language:u.language,overridden:h,onOverride:C,defaultValues:m})]})]}),!r||r.agentEnabled||g?null:t(Eu,{children:e(me,{$gap:10,$alignItems:"center",children:[t(Jt,{variant:ro.Pink,label:Kt(r.agentEnabledStatus?.reasonEnum)||et.NO_AVAILABLE_AGENT}),t(pe,{size:he.XXXS,color:ue.Secondary,children:r?.agentEnabledStatus?.message})]})}),S.length>0&&t(Eu,{children:t(me,{$gap:16,$wrap:"wrap",children:S.map((e,o)=>t(qe,{label:e,leftIcon:Oa,status:Fe.Success,invertColors:!0,useSecondaryTone:!0},`${i}-rule-${o}`))})})]})},Nu=b.div`
709
+ display: flex;
710
+ flex-direction: column;
711
+ gap: 10px;
712
+ padding: 10px 12px 10px 20px;
713
+ border-radius: 8px;
714
+ background-color: ${({theme:e})=>e.v2.colors.silver[800]};
715
+ `,$u=b.div`
716
+ display: flex;
717
+ flex-wrap: wrap;
718
+ gap: 12px 24px;
719
+ `,Ou=({title:o,children:n})=>e(ee,{$gap:4,children:[t(pe,{size:he.XXXS,color:ue.Secondary,children:o}),n]}),Au=({processes:o})=>{const n=a(()=>[...o].sort((e,t)=>e.pid-t.pid),[o]);return n.length?e(ee,{$gap:6,children:[t(pe,{size:he.XXXS,color:ue.Secondary,children:`${et.PROCESSES} (${n.length})`}),n.map(o=>{const n=o.exe?.trim()||null,i=o.cmdline?.trim()||null;return e(Nu,{children:[t($u,{children:t(Ou,{title:et.PROCESS_PID,children:t(pe,{size:he.XS,children:String(o.pid)})})}),n?t(so,{label:et.EXECUTABLE,value:n,bgTint:"900"}):null,i&&i!==n?t(so,{label:et.COMMAND,value:i,bgTint:"900"}):null]},o.pid)})]}):null},Ru=b.div`
709
720
  display: flex;
710
721
  flex-direction: column;
711
722
  align-self: stretch;
@@ -713,19 +724,19 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import n,{useEff
713
724
  padding: 8px 12px;
714
725
  border-radius: 8px;
715
726
  background-color: ${({theme:e})=>e.v2.colors.silver[900]};
716
- `,Ip=b.div`
727
+ `,Du=b.div`
717
728
  display: flex;
718
729
  align-items: center;
719
730
  justify-content: center;
720
731
  padding: 8px;
721
732
  border-radius: 10px;
722
733
  background-color: ${({theme:e})=>e.v2.colors.silver[800]};
723
- `,Np=e=>{if(!e)return No.Unknown;const t=e.trim().toLowerCase();return{go:No.Go,golang:No.Go,javascript:No.JavaScript,js:No.JavaScript,node:No.JavaScript,nodejs:No.JavaScript,typescript:No.JavaScript,python:No.Python,java:No.Java,dotnet:No.DotNet,csharp:No.CSharp,php:No.Php,ruby:No.Ruby,rust:No.Rust,swift:No.Swift,elixir:No.Elixir}[t]??No.Unknown},$p=({source:o})=>{const n=v(),{isConnector:i,isVm:l}=S(),{sourcesApi:r}=Pl(),s=o.instrumentationReport,c=o.sourceConfig,d=a(()=>!(!c?.runtimeOverride?.language&&!c?.runtimeOverride?.version),[c]),u=a(()=>{const e=Np(s?.runtimeLanguage);return e!==No.Unknown?e:o.runtimeInfo?.detectedLanguages?.[0]??No.Unknown},[s?.runtimeLanguage,o.runtimeInfo?.detectedLanguages]),p=s?.runtimeVersion?.trim()||"",h=a(()=>{const e=Np(c?.runtimeOverride?.language);return{language:e!==No.Unknown?e:u,version:c?.runtimeOverride?.version?.trim()||p||void 0}},[c,u,p]),m=a(()=>!!c?.distroOverride?.otelDistroName,[c]),g=a(()=>({otelDistroName:c?.distroOverride?.otelDistroName||void 0}),[c]),f=a(()=>{const{language:e,version:t}=h;return e!==No.Unknown||t?e!==No.Unknown&&t?`${e} • ${t}`:e!==No.Unknown?e:t||null:null},[h]),b=!f&&!d&&"Instrumenting"===s?.state,y=a(()=>b||h.language===No.Unknown?il:Ze(h.language),[b,h.language]),C=a(()=>{const e=s?.state??"",t=s?.instrumented||"Instrumented"===e,o=c?.distroOverride?.otelDistroName?.trim()||s?.sdkType?.trim();return"Instrumenting"===e?{status:Fe.Loading,label:Kt(s?.progressStage||e)||e}:"NotImplemented"===e||"Unsupported"===e?{status:Fe.Disabled,leftIcon:Oa,label:Kt(e)||e}:"Error"===e?{status:Fe.Error,leftIcon:Oa,label:"Error"}:t?{status:Fe.Success,leftIcon:$a,label:o?`Instrumented | ${o}`:"Instrumented"}:{status:Fe.Disabled,leftIcon:Oa,label:et.UNINSTRUMENTED}},[s,c]),x=e=>r.update(o.id,{...m?g:{},...d?{language:h.language!==No.Unknown?h.language:void 0,version:h.version}:{},...e});return(i||l)&&s?t(Xt,{bgTint:"1000",richTitle:{title:et.INSTRUMENTATION,tooltip:et.INSTRUMENTATION_DESCRIPTION,badge:{label:1}},withCollapse:!0,collapseIsDefaultOpen:!0,children:t(ee,{$gap:8,children:t(Ep,{children:e(me,{$gap:16,$alignItems:"center",$justifyContent:"space-between",$wrap:"wrap",children:[e(me,{$gap:8,$alignItems:"center",children:[t(Ip,{children:t(y,{size:24,fill:b||h.language===No.Unknown?n.v2.colors.grey[400]:void 0})}),t(ue,{children:o.id.name}),b?t(Jt,{variant:ro.Loader,label:et.DETECTING_RUNTIME_INFO}):f?t(Jt,{variant:ro.Blue,label:f}):null,t(Cp,{overridden:d,onOverride:x,defaultValues:{language:h.language!==No.Unknown?h.language:void 0,version:h.version||""},originalValues:{language:u!==No.Unknown?u:void 0,version:p}})]}),e(me,{$gap:8,$alignItems:"center",children:[t(qe,{...C,textSize:he.XXXS}),t(yp,{language:h.language!==No.Unknown?h.language:null,overridden:m,onOverride:x,defaultValues:g})]})]})})})}):null},Op=({source:o,onClickRollout:n,onClickRollback:i})=>{const{isK8s:a,isConnector:l,isVm:r}=S();return e(ee,{$gap:12,children:[t(rp,{source:o}),t(cp,{source:o}),a&&t(up,{source:o,onClickRollout:n,onClickRollback:i}),a&&t(Sp,{source:o}),(l||r)&&t($p,{source:o}),a&&t(sp,{source:o})]})},Ap=b(ee)`
734
+ `,_u=e=>{if(!e)return $o.Unknown;const t=e.trim().toLowerCase();return{go:$o.Go,golang:$o.Go,javascript:$o.JavaScript,js:$o.JavaScript,node:$o.JavaScript,nodejs:$o.JavaScript,typescript:$o.JavaScript,python:$o.Python,java:$o.Java,dotnet:$o.DotNet,csharp:$o.CSharp,php:$o.Php,ruby:$o.Ruby,rust:$o.Rust,swift:$o.Swift,elixir:$o.Elixir}[t]??$o.Unknown},Pu=({source:o})=>{const n=v(),{isConnector:i,isVm:l}=S(),{sourcesApi:r}=Ll(),s=o.instrumentationReport,c=o.sourceConfig,d=l?s?.processes:null,p=a(()=>!(!c?.runtimeOverride?.language&&!c?.runtimeOverride?.version),[c]),u=a(()=>{const e=_u(s?.runtimeLanguage);return e!==$o.Unknown?e:o.runtimeInfo?.detectedLanguages?.[0]??$o.Unknown},[s?.runtimeLanguage,o.runtimeInfo?.detectedLanguages]),h=s?.runtimeVersion?.trim()||"",m=a(()=>{const e=_u(c?.runtimeOverride?.language);return{language:e!==$o.Unknown?e:u,version:c?.runtimeOverride?.version?.trim()||h||void 0}},[c,u,h]),g=a(()=>!!c?.distroOverride?.otelDistroName,[c]),f=a(()=>({otelDistroName:c?.distroOverride?.otelDistroName||void 0}),[c]),b=a(()=>{const{language:e,version:t}=m;return e!==$o.Unknown||t?e!==$o.Unknown&&t?`${e} • ${t}`:e!==$o.Unknown?e:t||null:null},[m]),y=!b&&!p&&"Instrumenting"===s?.state,C=a(()=>y||m.language===$o.Unknown?al:Ze(m.language),[y,m.language]),x=a(()=>{const e=s?.state??"",t=s?.instrumented||"Instrumented"===e,o=c?.distroOverride?.otelDistroName?.trim()||s?.sdkType?.trim();return"Instrumenting"===e?{status:Fe.Loading,label:Kt(s?.progressStage||e)||e}:"NotImplemented"===e||"Unsupported"===e?{status:Fe.Disabled,leftIcon:Aa,label:Kt(e)||e}:"Error"===e?{status:Fe.Error,leftIcon:Aa,label:"Error"}:t?{status:Fe.Success,leftIcon:Oa,label:o?`Instrumented | ${o}`:"Instrumented"}:{status:Fe.Disabled,leftIcon:Aa,label:et.UNINSTRUMENTED}},[s,c]),w=e=>r.update(o.id,{...g?f:{},...p?{language:m.language!==$o.Unknown?m.language:void 0,version:m.version}:{},...e});return(i||l)&&s?t(Xt,{bgTint:"1000",richTitle:{title:et.INSTRUMENTATION,tooltip:et.INSTRUMENTATION_DESCRIPTION,badge:{label:1}},withCollapse:!0,collapseIsDefaultOpen:!0,children:t(ee,{$gap:8,children:e(Ru,{children:[e(me,{$gap:16,$alignItems:"center",$justifyContent:"space-between",$wrap:"wrap",children:[e(me,{$gap:8,$alignItems:"center",children:[t(Du,{children:t(C,{size:24,fill:y||m.language===$o.Unknown?n.v2.colors.grey[400]:void 0})}),t(pe,{children:o.id.name}),y?t(Jt,{variant:ro.Loader,label:et.DETECTING_RUNTIME_INFO}):b?t(Jt,{variant:ro.Blue,label:b}):null,t(xu,{overridden:p,onOverride:w,defaultValues:{language:m.language!==$o.Unknown?m.language:void 0,version:m.version||""},originalValues:{language:u!==$o.Unknown?u:void 0,version:h}})]}),e(me,{$gap:8,$alignItems:"center",children:[t(qe,{...x,textSize:he.XXXS}),t(Su,{language:m.language!==$o.Unknown?m.language:null,overridden:g,onOverride:w,defaultValues:f})]})]}),d?.length?t(Au,{processes:d}):null]})})}):null},Lu=({source:o,onClickRollout:n,onClickRollback:i})=>{const{isK8s:a,isConnector:l,isVm:r}=S();return e(ee,{$gap:12,children:[t(su,{source:o}),t(du,{source:o}),a&&t(hu,{source:o,onClickRollout:n,onClickRollback:i}),a&&t(wu,{source:o}),(l||r)&&t(Pu,{source:o}),a&&t(cu,{source:o})]})},Fu=({source:e})=>{const o=e.containers||[];return t(Xt,{bgTint:"1000",richTitle:{title:et.INSTRUMENTED_LIBRARIES},children:o.length?o.map(e=>{const o=e.instrumentations||[];return t(Xt,{bgTint:"800",richTitle:{title:e.containerName,badge:{label:o.length}},withCollapse:!0,collapseIsDefaultOpen:!!o?.length,children:o?.length?t(ee,{children:o.map((e,o)=>t(zp,{label:e.name,isStandardLibrary:e.isStandardLibrary,healthy:e.healthy,message:e.message},`instr-${o}-${e.name}`))}):t(Re,{title:"No libraries found"})},e.containerName)}):t(Re,{title:"No containers found"})})},Mu=b(ee)`
724
735
  width: 100%;
725
736
  max-height: 320px;
726
737
  overflow-y: auto;
727
738
  gap: 8px;
728
- `,Rp=b(me)`
739
+ `,zu=b(me)`
729
740
  width: 100%;
730
741
  align-items: center;
731
742
  gap: 8px;
@@ -735,14 +746,14 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import n,{useEff
735
746
  & > * {
736
747
  font-family: monospace !important;
737
748
  }
738
- `,Dp=({pendingModify:o,onClose:n,onConfirm:i})=>{const a=v();return t(Qe,{isOpen:!!o,title:'Modify the "Profiling Symbols" rule',description:'These changes are applied immediately to a single custom instrumentation rule named "Profiling Symbols".\nSelected symbols are added to it; unchecked symbols are removed from it (the rule is deleted once empty). Symbols managed by other rules are never touched.',onClose:n,denyButton:{variant:be.Secondary,label:"Cancel",onClick:n},approveButton:{variant:be.Primary,label:"Confirm",onClick:i},children:o&&e(Ap,{children:[o.add.map(o=>e(Rp,{children:[t(qe,{leftIcon:Ia,status:Fe.Success,useSecondaryTone:!0,textColor:a.v2.colors.white[500],textSize:he.XXS}),t(ue,{size:he.XS,color:pe.Primary,children:o})]},`add-${o}`)),o.remove.map(o=>e(Rp,{children:[t(qe,{leftIcon:cl,status:Fe.Error,useSecondaryTone:!0,textColor:a.v2.colors.white[500],textSize:he.XXS}),t(ue,{size:he.XS,color:pe.Primary,children:o})]},`remove-${o}`))]})})};function _p(e,t){const o=e.names[t];if(null==o)return"";if("string"==typeof o)return o;if("object"==typeof o&&"name"in o){const e=o.name;if("string"==typeof e)return e}return"number"==typeof o||"boolean"==typeof o?String(o):""}function Pp(e){const t=Math.abs(e);return t>=1e9?`${Lp(e/1e9)}s`:t>=1e6?`${Lp(e/1e6)}ms`:t>=1e3?`${Lp(e/1e3)}μs`:String(Math.round(e))}function Lp(e){return e.toFixed(2).replace(/\.?0+$/,"")}function Fp(e){const t=[];for(let o=0;o<e.levels.length;o++){const n=e.levels[o];let i=0;for(let e=0;e+3<n.length;e+=4){const a=n[e],l=n[e+1],r=n[e+2],s=n[e+3],c=i+a;t.push({level:o,offset:c,size:l,self:r,nameIndex:s}),i=c+l}}return t}function Mp(e){return`${e.level}:${e.offset}:${e.size}:${e.nameIndex}`}function zp(e,t){return e.level===t.level&&e.offset===t.offset&&e.size===t.size&&e.nameIndex===t.nameIndex}function Bp(e,t,o){return((e,t)=>{const o=[];for(let n=0;n<=t.level;n++){let i;for(const o of e)if(o.level===n&&t.offset>=o.offset&&t.offset+t.size<=o.offset+o.size){i=o;break}if(!i)return o;o.push(i)}return o})(t,o).map(t=>_p(e,t.nameIndex))}function Xp(e,t,o){if(0===o.length)return null;let n=null,i=null;for(let a=0;a<o.length;a++){const l=o[a];let r=null;for(const o of t)o.level===a&&_p(e,o.nameIndex)===l&&(n&&(o.offset<n.offset||o.offset+o.size>n.offset+n.size)||(!r||o.size>r.size)&&(r=o));if(!r)return null;n=r,i=r}return i}function Up(e,t){const o=e.reduce((e,t)=>Math.max(e,t.level),t.level),n=new Map;for(const t of e){const e=n.get(t.level);e?e.push(t):n.set(t.level,[t])}const i=[t];for(let e=t.level+1;e<=o;e++){const t=i.filter(t=>t.level===e-1);if(0===t.length)break;const o=n.get(e);if(o?.length)for(const e of o)for(const o of t)if(e.offset>=o.offset&&e.offset+e.size<=o.offset+o.size){i.push(e);break}}return i}function Vp(e,t){const o=t.trim().toLowerCase();return!o||e.toLowerCase().includes(o)}function Hp(e,t){let o=0;for(let t=0;t<e.length;t++)o=31*o+e.charCodeAt(t)>>>0;const n=t.v2.colors.black[500],i=[{fill:t.v2.colors.purple[300],text:n},{fill:t.v2.colors.green[300],text:n},{fill:t.v2.colors.red[300],text:n},{fill:t.v2.colors.blue[300],text:n},{fill:t.v2.colors.yellow[300],text:n}];return i[o%i.length]}var jp,Gp;function Wp(e,t){return t<=0?"0":(100*e/t).toFixed(e/t<.001?2:1)}function Kp(e,t,o){for(const n of o)if(e>=n.x&&e<n.x+n.w&&t>=n.y&&t<n.y+n.h)return n;return null}function Yp(e){return e>=1073741824?`${(e/1073741824).toFixed(1)} GiB`:e>=1048576?`${(e/1048576).toFixed(1)} MiB`:e>=1024?`${(e/1024).toFixed(1)} KiB`:`${e} B`}(e=>{e[e.Fit=1]="Fit",e[e.X10=10]="X10"})(jp||(jp={})),(e=>{e[e.Fit=1]="Fit",e[e.X10=10]="X10"})(Gp||(Gp={}));const qp=({flamebearer:o,maxRowPx:n,searchQuery:c="",shouldKeepName:d,minHostHeight:u=200,onFullscreenChange:p,profilingSlots:h,onFrameClick:m,onZoomedSymbolsChange:f,onResetZoom:b})=>{const y=v(),C=l(null),S=l(null),x=l({x:0,y:0}),[w,T]=s({w:0,h:0}),[k,E]=s(""),[I,N]=s(null),[$,O]=s([]),[A,R]=s(!1),[D,_]=s(jp.Fit),[P,L]=s(Gp.Fit),[F,M]=s(!1),z=Math.max(1,Math.min(Math.floor(w.w*D),8192)),B=Math.max(1,Math.min(Math.floor(w.h*P),8192)),X=$.length>0?$[$.length-1]:null,U=X?.size??o.numTicks,V=a(()=>Fp(o),[o]),H=l({fb:o,rects:V});i(()=>{const e=H.current;e.fb!==o&&(H.current={fb:o,rects:V},O(t=>{if(0===t.length)return t;const n=((e,t,o,n,i)=>{const a=[];for(const l of i){const i=Bp(e,t,l);if(0===i.length)break;const r=Xp(o,n,i);if(!r)break;a.push(r)}return a})(e.fb,e.rects,o,V,t);return n.length===t.length&&n.every((e,o)=>zp(e,t[o]))?t:n}))},[o,V]),i(()=>{if(!f)return;if(!X)return void f(null);const e=Up(V,X),t=new Set;for(const n of e){const e=_p(o,n.nameIndex);e&&t.add(e)}f([...t])},[X,o,V,f]),g(()=>{const e=C.current;if(!e)return;const t=new ResizeObserver(()=>{const t=e.getBoundingClientRect();T({w:Math.floor(t.width),h:Math.floor(t.height)})});return t.observe(e),()=>t.disconnect()},[]),i(()=>{if(!A)return;const e=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=e}},[A]),i(()=>(p?.(A),()=>{A&&p?.(!1)}),[A,p]);const j=a(()=>function(e,t,o,n,i,a={}){if(0===e.levels.length||t<2||o<2)return null;const{zoomRoot:l=null,shouldKeepName:r,collapseRecursive:s=!1,allRects:c}=a,d=c??Fp(e);let u=l?Up(d,l):d;if(0===u.length)return null;if(r&&(u=u.filter(t=>r(_p(e,t.nameIndex))),0===u.length))return null;if(s&&(u=((e,t)=>{if(0===t.length)return t;const o=[...t].sort((e,t)=>e.level-t.level||e.offset-t.offset),n=new Map;for(const e of o){const t=n.get(e.level);t?t.push(e):n.set(e.level,[e])}const i=new Set;for(const t of o){const o=n.get(t.level+1);if(!o)continue;const a=o.filter(e=>e.offset>=t.offset&&e.offset+e.size<=t.offset+t.size);if(1!==a.length)continue;const l=a[0];l.size===t.size&&_p(e,l.nameIndex)===_p(e,t.nameIndex)&&i.add(Mp(l))}if(0===i.size)return o;const a=[];for(const e of o){if(i.has(Mp(e)))continue;let t=0;for(let o=0;o<e.level;o++){const a=n.get(o);if(!a)continue;const l=a.find(t=>e.offset>=t.offset&&e.offset+e.size<=t.offset+t.size);l&&i.has(Mp(l))&&t++}a.push({...e,level:e.level-t})}return a})(e,u),0===u.length))return null;const p=l?.level??0,h=l?.offset??0,m=l?.size??e.numTicks;if(m<=0)return null;const g=u.reduce((e,t)=>Math.max(e,t.level-p),0)+1,f=n??Number.POSITIVE_INFINITY,b=Math.max(1,Math.min(o/g,f)),v=i.trim(),y=b>8?1:0;return u.map(o=>{const n=o.level-p,i=(o.offset-h)/m*t,a=Math.max(o.size/m*t,1),l=n*b,r=Math.max(b-y,1),s=_p(e,o.nameIndex);return{...o,x:i,y:l,w:a,h:r,name:s,matchesSearch:Vp(s,v)}})}(o,z,B,n,c,{zoomRoot:X,shouldKeepName:d,collapseRecursive:F,allRects:V}),[o,n,c,B,z,X,d,F,V]),G=a(()=>(e=>[...e].sort((e,t)=>t.level-e.level))(j?.length?c.trim()?j.filter(e=>e.matchesSearch):j:[]),[j,c]),W=r(e=>{if(z<2||B<2)return;const t=e.currentTarget.getBoundingClientRect();if(t.width<1||t.height<1)return;const n=Kp((e.clientX-t.left)/t.width*z,(e.clientY-t.top)/t.height*B,G);if(n){const e=Mp(n);N(e);const t=U>0?(100*n.size/U).toFixed(1):"0",i=o.numTicks>0?(100*n.size/o.numTicks).toFixed(1):"0";E(`${n.name}\ntotal ${Pp(n.size)} (${t}% of view, ${i}% of profile) · self ${Pp(n.self)}`)}else N(null),E("")},[G,o.numTicks,B,z,U]),K=r(e=>{W(e)},[W]),Y=r(()=>{N(null),E("")},[]),q=r(e=>{x.current={x:e.clientX,y:e.clientY}},[]),J=r(e=>{const{x:t,y:o}=x.current;if(Math.abs(e.clientX-t)>3||Math.abs(e.clientY-o)>3)return;if(z<2||B<2)return;const n=e.currentTarget.getBoundingClientRect();if(n.width<1||n.height<1)return;const i=Kp((e.clientX-n.left)/n.width*z,(e.clientY-n.top)/n.height*B,G);if(!i)return;m?.(i.name);const a=(e=>({level:e.level,offset:e.offset,size:e.size,self:e.self,nameIndex:e.nameIndex}))(i);O(e=>{const t=e.length>0?e[e.length-1]:null;return t&&zp(a,t)?e.slice(0,-1):[...e,a]})},[G,B,z,m]);g(()=>{const e=S.current;if(!e||z<2||B<2)return;const t="undefined"!=typeof window&&window.devicePixelRatio||1,n=Math.max(z,B),i=Math.min(t,16384/n);e.width=Math.floor(z*i),e.height=Math.floor(B*i),e.style.width=`${z}px`,e.style.height=`${B}px`;const a=e.getContext("2d");a&&(a.setTransform(i,0,0,i,0,0),a.clearRect(0,0,z,B),j?.length?((e,t,o,n,i,a,l,r)=>{const s=a.v2.colors.silver[900];e.fillStyle=s,e.fillRect(0,0,t,o);const c=i.trim().length>0;e.textRendering="optimizeLegibility";for(const t of n){const{x:o,y:n,w:i,h:l,name:s,size:d,matchesSearch:u}=t;if(c&&!u)continue;const{fill:p,text:h}=Hp(s,a);e.fillStyle=p,e.fillRect(o,n,i,l),e.strokeStyle="rgba(255,255,255,0.14)",e.lineWidth=1,e.beginPath(),e.moveTo(o+.5,n+.5),e.lineTo(o+i-.5,n+.5),e.stroke(),e.strokeStyle="rgba(0,0,0,0.45)",e.lineWidth=1,e.strokeRect(o+.5,n+.5,Math.max(i-1,0),Math.max(l-1,0));const m=Wp(d,r),g=`${s} (${Pp(d)}, ${m}%)`,f=a.v2.text.size.xs,b=8,v=5,y=26,C=Math.min(f,Math.floor(l-2));if(i>=y&&C>=b){e.font=`${C}px ${a.font_family.primary}, -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif`,e.textBaseline="middle",e.textAlign="left";let t=g;for(;t.length>2&&e.measureText(t).width>i-2*v;)t=`${t.slice(0,-2)}…`;e.measureText(t).width<=i-2*v&&(e.lineWidth=1,e.strokeStyle="rgba(0, 0, 0, 0.5)",e.lineJoin="round",e.miterLimit=1,e.strokeText(t,o+v,n+l/2),e.fillStyle=h,e.fillText(t,o+v,n+l/2))}}if(l)for(const t of n){if(Mp(t)!==l)continue;if(c&&!t.matchesSearch)continue;const{x:o,y:n,w:i,h:a}=t;e.strokeStyle="rgba(255,255,255,0.88)",e.lineWidth=2,e.strokeRect(o+1,n+1,Math.max(i-2,0),Math.max(a-2,0));break}})(a,z,B,j,c,y,I,o.numTicks):(a.fillStyle=y.v2.colors.silver[900],a.fillRect(0,0,z,B)))},[j,o.numTicks,I,c,B,z,y]);const Z=r(()=>R(e=>!e),[]),Q=o.numTicks>0?Math.max(0,Math.min(100,Math.round(U/o.numTicks*100))):100,ee=a(()=>((e,t,o)=>{const n=o??Fp(e),i=t?.offset??0,a=i+(t?.size??e.numTicks),l=(t?.level??-1)+1,r=t?.size??e.numTicks;let s=null;for(const e of n)e.level<l||e.offset<i||e.offset+e.size>a||e.size>=r||(!s||e.size>s.size||e.size===s.size&&e.level<s.level)&&(s=e);return s})(o,X,V),[o,X,V]),te=null!==ee,oe=$.length>0,ne=X?_p(o,X.nameIndex):"",ie=r(()=>{O([]),b?.()},[b]),ae=r(()=>O(e=>e.slice(0,-1)),[]),se=r(()=>{ee&&O(e=>[...e,ee])},[ee]);return e("div",{style:A?{position:"fixed",inset:0,zIndex:9999,display:"flex",flexDirection:"column",gap:8,padding:16,background:y.v2.colors.silver[900]}:{flex:1,minHeight:u,minWidth:0,width:"100%",display:"flex",flexDirection:"column",gap:8,position:"relative"},children:[e(me,{$gap:8,$wrap:"nowrap",$justifyContent:"space-between",children:[t(le,{label:"Collapse recursive",tooltip:"Collapse straight-line recursion (parent → single same-name child of equal width) into a single bar. Helps deep recursive call chains fit on screen.",labelAlign:re.Left,size:Nt.S,value:F,onChange:M}),e(me,{$gap:8,children:[e(me,{children:[t(ge,{variant:be.Secondary,size:fe.S,label:"Reset zoom",leftIcon:dl,onClick:ie,disabled:!$.length}),t(ge,{variant:be.Secondary,size:fe.S,iconSize:20,leftIcon:cl,tooltip:"Zoom out",hideTooltipIcon:!0,disabled:!oe,onClick:ae}),t("div",{style:{minWidth:36,textAlign:"center",fontVariantNumeric:"tabular-nums"},children:t(ue,{size:he.XXS,color:pe.Secondary,nowrap:!0,align:"center",children:`${Q}%`})}),t(ge,{variant:be.Secondary,size:fe.S,iconSize:20,leftIcon:Ia,tooltip:"Zoom in",hideTooltipIcon:!0,disabled:!te,onClick:se})]}),e(me,{children:[t($e,{text:"Horizontal width: stretch the canvas wider than the viewport so narrow stacks become hoverable / readable.",children:t(ve,{variant:$o.Filled,options:[{value:jp.Fit,label:"W: Fit"},{value:jp.X10,label:"10x"}],selected:D,setSelected:_})}),t($e,{text:"Vertical height: scale rows taller than the viewport for deep call stacks. Scroll vertically to navigate.",children:t(ve,{variant:$o.Filled,options:[{value:Gp.Fit,label:"H: Fit"},{value:Gp.X10,label:"10x"}],selected:P,setSelected:L})})]}),t(ge,{variant:be.Secondary,size:fe.S,iconSize:24,leftIcon:A?Ua:ul,tooltip:A?"Exit fullscreen (Esc)":"Fullscreen",hideTooltipIcon:!0,onClick:Z})]})]}),t($e,{fullWidth:!0,keepAlive:!0,text:k,children:t("div",{ref:C,style:{flex:1,minWidth:0,width:"100%",height:A?"calc(100vh - 80px)":"calc(100vh - 364px)",position:"relative",overflow:"hidden"},children:t("div",{style:{position:"absolute",inset:0,overflowX:D>1?"auto":"hidden",overflowY:P>1?"auto":"hidden"},children:t("div",{style:{width:z||"100%",height:B||"100%",position:"relative"},children:t("canvas",{ref:S,style:{display:"block",position:"absolute",left:0,top:0,width:"100%",height:"100%",borderRadius:8,cursor:I?"pointer":"default"},onPointerDown:q,onPointerMove:K,onPointerLeave:Y,onClick:J})})})})}),e(me,{$justifyContent:"space-between",children:[t(ue,X?{size:he.XXXS,color:y.v2.colors.silver[300],children:`Zoomed: ${ne} • ${Pp(U)} samples in view`}:{size:he.XXXS,color:y.v2.colors.silver[300],children:m?"Click a frame to zoom in and jump to its row in the symbol table.":"Click a frame to zoom into its subtree (pprof-style)."}),h&&t(ue,{size:he.XXXS,color:y.v2.colors.silver[300],children:`${h.activeKeys.length} / ${h.maxSlots} profiling slots · ${Yp(h.totalBytesUsed)} / ${Yp(h.maxTotalBytesBudget)} budget · TTL ${h.slotTtlSeconds}s`})]})]})},Jp=[No.Go,No.Java],Zp="Profiling Symbols";function Qp(e,t){if(0===t.length)return null;const o=1===t.length?t[0]:(e=>e.includes("/")||/\.\(\*?[^)]+\)\./.test(e)?No.Go:e.includes(" ")||e.includes("(")?No.Java:No.Go)(e);if(o===No.Go){const t=(e=>{let t=e.trim();if(!t)return null;t=t.replace(/\[[^\]]*\]/g,"");const o=t.lastIndexOf("/"),n=t.indexOf(".",o+1);if(-1===n)return null;const i=t.slice(0,n),a=t.slice(n+1);if(!i||!a)return null;const l=a.match(/^\(\*?([^)]+)\)\.(.+)$/);if(l){const e=new Ge(i,"",l[1],l[2]);return e.Verify()?e:null}const r=new Ge(i,a);return r.Verify()?r:null})(e);return t?{language:o,golang:t}:null}if(o===No.Java){const t=(e=>{let t=e.trim();if(!t)return null;const o=t.indexOf("(");-1!==o&&(t=t.slice(0,o).trim());const n=t.split(/\s+/);t=n[n.length-1]??"";const i=t.lastIndexOf(".");if(-1===i)return null;const a=t.slice(0,i),l=t.slice(i+1),r=new We(a,l);return r.Verify()?r:null})(e);return t?{language:o,java:t}:null}return null}function eh(e,t){return e.namespace===t.namespace&&e.name===t.name&&e.kind===t.kind}function th(e,t,o){if(!e)return!0;const{sources:n=[],namespaces:i=[],languages:a=[]}=e,l=!n.length||n.some(e=>eh(e,t.id)),r=!i.length||i.includes(t.id.namespace),s=!a.length||null==o||a.includes(o);return l&&r&&s}function oh(e,t){return e.packageName===t.packageName&&(e.functionName||"")===(t.functionName||"")&&(e.receiverName||"")===(t.receiverName||"")&&(e.receiverMethodName||"")===(t.receiverMethodName||"")}function nh(e,t){return e.className===t.className&&e.methodName===t.methodName}function ih(e,t,o,n){const i=Qp(e,o);if(!i)return[];const a=[];for(const e of n){const o=e.customInstrumentations;if(!o)continue;if(!th(e.sourceScopes,t,i.language))continue;const n=!!i.golang&&!!o[Ke.Golang]?.some(e=>oh(e,i.golang)),l=!!i.java&&!!o[Ke.Java]?.some(e=>nh(e,i.java));(n||l)&&a.push({rule:e,resolved:i})}return a}var ah,lh,rh;(e=>{e.Symbol="symbol",e.Self="self",e.Total="total"})(ah||(ah={})),(e=>{e.OnlyInstrumentable="only-instrumentable"})(lh||(lh={})),(e=>{e.FilterOutVoid="filter-out-void",e.OnlyWithReturnValues="only-with-return-values"})(rh||(rh={}));const sh=/^[A-Za-z_$][A-Za-z0-9_$]*(\[\])*$/;function ch(e,t){const o=(e=>e.split(" ")[0]??"")(e);return(!t.includes(rh.FilterOutVoid)||"void"!==o)&&!!(!t.includes(rh.OnlyWithReturnValues)||e.includes(" ")&&"void"!==o&&sh.test(o))}const dh=({rows:e,languages:o,instrumentation:n,searchQuery:i,filters:l,onFiltersChange:s,zoomedSymbols:c,highlightSymbol:d,scrollSignal:u})=>{const p=!!o?.includes(No.Java),h=a(()=>{const t=c?new Set(c):null,o=i?.trim().toLowerCase();return e.filter(e=>(!t||t.has(e.name))&&(!o||e.name.toLowerCase().includes(o)))},[e,i,c]),m=a(()=>{const e=[];if(n.selectionEnabled&&e.push({id:lh.OnlyInstrumentable,label:"Only show instrumentable symbols"}),p&&(e.push({id:rh.FilterOutVoid,label:"Filter out void symbols"}),e.push({id:rh.OnlyWithReturnValues,label:"Only show functions with return values"})),0!==e.length)return{options:e,filterRow:(e,t)=>{const o=e.cells.find(e=>e.key===ah.Symbol)?.rawValue?.toString()??"";return!(t.includes(lh.OnlyInstrumentable)&&!n.getSymbolState(o).showCheckbox)&&ch(o,t)}}},[n,p]),g=a(()=>[{key:ah.Symbol,label:"Symbol",flex:"0 0 160px",filterOverride:m,noFilter:!m},{key:ah.Self,label:"Self",tooltip:"Time spent in this function itself, excluding time in functions it calls.",textAlign:"right",noFilter:!0},{key:ah.Total,label:"Total",tooltip:"Time spent in this function and all functions it calls (inclusive).",textAlign:"right",noFilter:!0}],[m]),f=a(()=>h.map(e=>{const t=n.getSymbolState(e.name),o=t.showCheckbox;return{id:e.name,cells:[{key:ah.Symbol,rawValue:e.name},{key:ah.Self,rawValue:Pp(e.self)},{key:ah.Total,rawValue:Pp(e.total)}],isSelected:o?n.isSelected(e.name):void 0,onSelect:o?()=>n.onToggleSymbol(e.name,!0):void 0,onDeselect:o?()=>n.onToggleSymbol(e.name,!1):void 0,hideCheckbox:!o,checkboxDisabled:o?t.checkboxDisabled:void 0,checkboxTooltip:o?t.checkboxTooltip:void 0}}),[h,n]),b=r(e=>{const t=e.cells[0].rawValue,o=n.getSymbolState(t),i=[];return o.inManagedRule?i.push({id:`remove-instrumentation-${t}`,label:"",leftIcon:Ea,tooltip:"Remove from the “Profiling Symbols” rule",onClick:()=>n.onRemove(t)}):i.push({id:`add-instrumentation-${t}`,label:"",leftIcon:Ia,tooltip:o.addTooltip,disabled:!o.addEnabled,onClick:()=>n.onAdd(t)}),i.push({id:`copy-${t}`,label:"",leftIcon:pl,tooltip:"Copy symbol name",onClick:()=>{navigator.clipboard.writeText(t)}}),i},[n]);return t(Oo,{variant:Ao.Data,maxHeight:"calc(100vh - 306px)",columns:g,rows:f,withCheckboxes:n.selectionEnabled,filters:l,onFiltersChange:s,activeRowId:d,scrollSignal:u,getRowActions:b})};var uh;(e=>{e.Table="table",e.Flame="flame",e.Both="both"})(uh||(uh={}));const ph=b(ee)`
749
+ `,Bu=({pendingModify:o,onClose:n,onConfirm:i})=>{const a=v();return t(Qe,{isOpen:!!o,title:'Modify the "Profiling Symbols" rule',description:'These changes are applied immediately to a single custom instrumentation rule named "Profiling Symbols".\nSelected symbols are added to it; unchecked symbols are removed from it (the rule is deleted once empty). Symbols managed by other rules are never touched.',onClose:n,denyButton:{variant:be.Secondary,label:"Cancel",onClick:n},approveButton:{variant:be.Primary,label:"Confirm",onClick:i},children:o&&e(Mu,{children:[o.add.map(o=>e(zu,{children:[t(qe,{leftIcon:Na,status:Fe.Success,useSecondaryTone:!0,textColor:a.v2.colors.white[500],textSize:he.XXS}),t(pe,{size:he.XS,color:ue.Primary,children:o})]},`add-${o}`)),o.remove.map(o=>e(zu,{children:[t(qe,{leftIcon:pl,status:Fe.Error,useSecondaryTone:!0,textColor:a.v2.colors.white[500],textSize:he.XXS}),t(pe,{size:he.XS,color:ue.Primary,children:o})]},`remove-${o}`))]})})};function Xu(e,t){const o=e.names[t];if(null==o)return"";if("string"==typeof o)return o;if("object"==typeof o&&"name"in o){const e=o.name;if("string"==typeof e)return e}return"number"==typeof o||"boolean"==typeof o?String(o):""}function Uu(e){const t=Math.abs(e);return t>=1e9?`${Vu(e/1e9)}s`:t>=1e6?`${Vu(e/1e6)}ms`:t>=1e3?`${Vu(e/1e3)}μs`:String(Math.round(e))}function Vu(e){return e.toFixed(2).replace(/\.?0+$/,"")}function Hu(e){const t=[];for(let o=0;o<e.levels.length;o++){const n=e.levels[o];let i=0;for(let e=0;e+3<n.length;e+=4){const a=n[e],l=n[e+1],r=n[e+2],s=n[e+3],c=i+a;t.push({level:o,offset:c,size:l,self:r,nameIndex:s}),i=c+l}}return t}function ju(e){return`${e.level}:${e.offset}:${e.size}:${e.nameIndex}`}function Gu(e,t){return e.level===t.level&&e.offset===t.offset&&e.size===t.size&&e.nameIndex===t.nameIndex}function Wu(e,t,o){return((e,t)=>{const o=[];for(let n=0;n<=t.level;n++){let i;for(const o of e)if(o.level===n&&t.offset>=o.offset&&t.offset+t.size<=o.offset+o.size){i=o;break}if(!i)return o;o.push(i)}return o})(t,o).map(t=>Xu(e,t.nameIndex))}function Ku(e,t,o){if(0===o.length)return null;let n=null,i=null;for(let a=0;a<o.length;a++){const l=o[a];let r=null;for(const o of t)o.level===a&&Xu(e,o.nameIndex)===l&&(n&&(o.offset<n.offset||o.offset+o.size>n.offset+n.size)||(!r||o.size>r.size)&&(r=o));if(!r)return null;n=r,i=r}return i}function Yu(e,t){const o=e.reduce((e,t)=>Math.max(e,t.level),t.level),n=new Map;for(const t of e){const e=n.get(t.level);e?e.push(t):n.set(t.level,[t])}const i=[t];for(let e=t.level+1;e<=o;e++){const t=i.filter(t=>t.level===e-1);if(0===t.length)break;const o=n.get(e);if(o?.length)for(const e of o)for(const o of t)if(e.offset>=o.offset&&e.offset+e.size<=o.offset+o.size){i.push(e);break}}return i}function qu(e,t){const o=t.trim().toLowerCase();return!o||e.toLowerCase().includes(o)}function Ju(e,t){let o=0;for(let t=0;t<e.length;t++)o=31*o+e.charCodeAt(t)>>>0;const n=t.v2.colors.black[500],i=[{fill:t.v2.colors.purple[300],text:n},{fill:t.v2.colors.green[300],text:n},{fill:t.v2.colors.red[300],text:n},{fill:t.v2.colors.blue[300],text:n},{fill:t.v2.colors.yellow[300],text:n}];return i[o%i.length]}var Zu,Qu;function eh(e,t){return t<=0?"0":(100*e/t).toFixed(e/t<.001?2:1)}function th(e,t,o){for(const n of o)if(e>=n.x&&e<n.x+n.w&&t>=n.y&&t<n.y+n.h)return n;return null}function oh(e){return e>=1073741824?`${(e/1073741824).toFixed(1)} GiB`:e>=1048576?`${(e/1048576).toFixed(1)} MiB`:e>=1024?`${(e/1024).toFixed(1)} KiB`:`${e} B`}(e=>{e[e.Fit=1]="Fit",e[e.X10=10]="X10"})(Zu||(Zu={})),(e=>{e[e.Fit=1]="Fit",e[e.X10=10]="X10"})(Qu||(Qu={}));const nh=({flamebearer:o,maxRowPx:n,searchQuery:c="",shouldKeepName:d,minHostHeight:p=200,onFullscreenChange:u,profilingSlots:h,onFrameClick:m,onZoomedSymbolsChange:f,onResetZoom:b})=>{const y=v(),C=l(null),S=l(null),x=l({x:0,y:0}),[w,T]=s({w:0,h:0}),[k,E]=s(""),[I,N]=s(null),[$,O]=s([]),[A,R]=s(!1),[D,_]=s(Zu.Fit),[P,L]=s(Qu.Fit),[F,M]=s(!1),z=Math.max(1,Math.min(Math.floor(w.w*D),8192)),B=Math.max(1,Math.min(Math.floor(w.h*P),8192)),X=$.length>0?$[$.length-1]:null,U=X?.size??o.numTicks,V=a(()=>Hu(o),[o]),H=l({fb:o,rects:V});i(()=>{const e=H.current;e.fb!==o&&(H.current={fb:o,rects:V},O(t=>{if(0===t.length)return t;const n=((e,t,o,n,i)=>{const a=[];for(const l of i){const i=Wu(e,t,l);if(0===i.length)break;const r=Ku(o,n,i);if(!r)break;a.push(r)}return a})(e.fb,e.rects,o,V,t);return n.length===t.length&&n.every((e,o)=>Gu(e,t[o]))?t:n}))},[o,V]),i(()=>{if(!f)return;if(!X)return void f(null);const e=Yu(V,X),t=new Set;for(const n of e){const e=Xu(o,n.nameIndex);e&&t.add(e)}f([...t])},[X,o,V,f]),g(()=>{const e=C.current;if(!e)return;const t=new ResizeObserver(()=>{const t=e.getBoundingClientRect();T({w:Math.floor(t.width),h:Math.floor(t.height)})});return t.observe(e),()=>t.disconnect()},[]),i(()=>{if(!A)return;const e=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=e}},[A]),i(()=>(u?.(A),()=>{A&&u?.(!1)}),[A,u]);const j=a(()=>function(e,t,o,n,i,a={}){if(0===e.levels.length||t<2||o<2)return null;const{zoomRoot:l=null,shouldKeepName:r,collapseRecursive:s=!1,allRects:c}=a,d=c??Hu(e);let p=l?Yu(d,l):d;if(0===p.length)return null;if(r&&(p=p.filter(t=>r(Xu(e,t.nameIndex))),0===p.length))return null;if(s&&(p=((e,t)=>{if(0===t.length)return t;const o=[...t].sort((e,t)=>e.level-t.level||e.offset-t.offset),n=new Map;for(const e of o){const t=n.get(e.level);t?t.push(e):n.set(e.level,[e])}const i=new Set;for(const t of o){const o=n.get(t.level+1);if(!o)continue;const a=o.filter(e=>e.offset>=t.offset&&e.offset+e.size<=t.offset+t.size);if(1!==a.length)continue;const l=a[0];l.size===t.size&&Xu(e,l.nameIndex)===Xu(e,t.nameIndex)&&i.add(ju(l))}if(0===i.size)return o;const a=[];for(const e of o){if(i.has(ju(e)))continue;let t=0;for(let o=0;o<e.level;o++){const a=n.get(o);if(!a)continue;const l=a.find(t=>e.offset>=t.offset&&e.offset+e.size<=t.offset+t.size);l&&i.has(ju(l))&&t++}a.push({...e,level:e.level-t})}return a})(e,p),0===p.length))return null;const u=l?.level??0,h=l?.offset??0,m=l?.size??e.numTicks;if(m<=0)return null;const g=p.reduce((e,t)=>Math.max(e,t.level-u),0)+1,f=n??Number.POSITIVE_INFINITY,b=Math.max(1,Math.min(o/g,f)),v=i.trim(),y=b>8?1:0;return p.map(o=>{const n=o.level-u,i=(o.offset-h)/m*t,a=Math.max(o.size/m*t,1),l=n*b,r=Math.max(b-y,1),s=Xu(e,o.nameIndex);return{...o,x:i,y:l,w:a,h:r,name:s,matchesSearch:qu(s,v)}})}(o,z,B,n,c,{zoomRoot:X,shouldKeepName:d,collapseRecursive:F,allRects:V}),[o,n,c,B,z,X,d,F,V]),G=a(()=>(e=>[...e].sort((e,t)=>t.level-e.level))(j?.length?c.trim()?j.filter(e=>e.matchesSearch):j:[]),[j,c]),W=r(e=>{if(z<2||B<2)return;const t=e.currentTarget.getBoundingClientRect();if(t.width<1||t.height<1)return;const n=th((e.clientX-t.left)/t.width*z,(e.clientY-t.top)/t.height*B,G);if(n){const e=ju(n);N(e);const t=U>0?(100*n.size/U).toFixed(1):"0",i=o.numTicks>0?(100*n.size/o.numTicks).toFixed(1):"0";E(`${n.name}\ntotal ${Uu(n.size)} (${t}% of view, ${i}% of profile) · self ${Uu(n.self)}`)}else N(null),E("")},[G,o.numTicks,B,z,U]),K=r(e=>{W(e)},[W]),Y=r(()=>{N(null),E("")},[]),q=r(e=>{x.current={x:e.clientX,y:e.clientY}},[]),J=r(e=>{const{x:t,y:o}=x.current;if(Math.abs(e.clientX-t)>3||Math.abs(e.clientY-o)>3)return;if(z<2||B<2)return;const n=e.currentTarget.getBoundingClientRect();if(n.width<1||n.height<1)return;const i=th((e.clientX-n.left)/n.width*z,(e.clientY-n.top)/n.height*B,G);if(!i)return;m?.(i.name);const a=(e=>({level:e.level,offset:e.offset,size:e.size,self:e.self,nameIndex:e.nameIndex}))(i);O(e=>{const t=e.length>0?e[e.length-1]:null;return t&&Gu(a,t)?e.slice(0,-1):[...e,a]})},[G,B,z,m]);g(()=>{const e=S.current;if(!e||z<2||B<2)return;const t="undefined"!=typeof window&&window.devicePixelRatio||1,n=Math.max(z,B),i=Math.min(t,16384/n);e.width=Math.floor(z*i),e.height=Math.floor(B*i),e.style.width=`${z}px`,e.style.height=`${B}px`;const a=e.getContext("2d");a&&(a.setTransform(i,0,0,i,0,0),a.clearRect(0,0,z,B),j?.length?((e,t,o,n,i,a,l,r)=>{const s=a.v2.colors.silver[900];e.fillStyle=s,e.fillRect(0,0,t,o);const c=i.trim().length>0;e.textRendering="optimizeLegibility";for(const t of n){const{x:o,y:n,w:i,h:l,name:s,size:d,matchesSearch:p}=t;if(c&&!p)continue;const{fill:u,text:h}=Ju(s,a);e.fillStyle=u,e.fillRect(o,n,i,l),e.strokeStyle="rgba(255,255,255,0.14)",e.lineWidth=1,e.beginPath(),e.moveTo(o+.5,n+.5),e.lineTo(o+i-.5,n+.5),e.stroke(),e.strokeStyle="rgba(0,0,0,0.45)",e.lineWidth=1,e.strokeRect(o+.5,n+.5,Math.max(i-1,0),Math.max(l-1,0));const m=eh(d,r),g=`${s} (${Uu(d)}, ${m}%)`,f=a.v2.text.size.xs,b=8,v=5,y=26,C=Math.min(f,Math.floor(l-2));if(i>=y&&C>=b){e.font=`${C}px ${a.font_family.primary}, -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif`,e.textBaseline="middle",e.textAlign="left";let t=g;for(;t.length>2&&e.measureText(t).width>i-2*v;)t=`${t.slice(0,-2)}…`;e.measureText(t).width<=i-2*v&&(e.lineWidth=1,e.strokeStyle="rgba(0, 0, 0, 0.5)",e.lineJoin="round",e.miterLimit=1,e.strokeText(t,o+v,n+l/2),e.fillStyle=h,e.fillText(t,o+v,n+l/2))}}if(l)for(const t of n){if(ju(t)!==l)continue;if(c&&!t.matchesSearch)continue;const{x:o,y:n,w:i,h:a}=t;e.strokeStyle="rgba(255,255,255,0.88)",e.lineWidth=2,e.strokeRect(o+1,n+1,Math.max(i-2,0),Math.max(a-2,0));break}})(a,z,B,j,c,y,I,o.numTicks):(a.fillStyle=y.v2.colors.silver[900],a.fillRect(0,0,z,B)))},[j,o.numTicks,I,c,B,z,y]);const Z=r(()=>R(e=>!e),[]),Q=o.numTicks>0?Math.max(0,Math.min(100,Math.round(U/o.numTicks*100))):100,ee=a(()=>((e,t,o)=>{const n=o??Hu(e),i=t?.offset??0,a=i+(t?.size??e.numTicks),l=(t?.level??-1)+1,r=t?.size??e.numTicks;let s=null;for(const e of n)e.level<l||e.offset<i||e.offset+e.size>a||e.size>=r||(!s||e.size>s.size||e.size===s.size&&e.level<s.level)&&(s=e);return s})(o,X,V),[o,X,V]),te=null!==ee,oe=$.length>0,ne=X?Xu(o,X.nameIndex):"",ie=r(()=>{O([]),b?.()},[b]),ae=r(()=>O(e=>e.slice(0,-1)),[]),se=r(()=>{ee&&O(e=>[...e,ee])},[ee]);return e("div",{style:A?{position:"fixed",inset:0,zIndex:9999,display:"flex",flexDirection:"column",gap:8,padding:16,background:y.v2.colors.silver[900]}:{flex:1,minHeight:p,minWidth:0,width:"100%",display:"flex",flexDirection:"column",gap:8,position:"relative"},children:[e(me,{$gap:8,$wrap:"nowrap",$justifyContent:"space-between",children:[t(le,{label:"Collapse recursive",tooltip:"Collapse straight-line recursion (parent → single same-name child of equal width) into a single bar. Helps deep recursive call chains fit on screen.",labelAlign:re.Left,size:Nt.S,value:F,onChange:M}),e(me,{$gap:8,children:[e(me,{children:[t(ge,{variant:be.Secondary,size:fe.S,label:"Reset zoom",leftIcon:ul,onClick:ie,disabled:!$.length}),t(ge,{variant:be.Secondary,size:fe.S,iconSize:20,leftIcon:pl,tooltip:"Zoom out",hideTooltipIcon:!0,disabled:!oe,onClick:ae}),t("div",{style:{minWidth:36,textAlign:"center",fontVariantNumeric:"tabular-nums"},children:t(pe,{size:he.XXS,color:ue.Secondary,nowrap:!0,align:"center",children:`${Q}%`})}),t(ge,{variant:be.Secondary,size:fe.S,iconSize:20,leftIcon:Na,tooltip:"Zoom in",hideTooltipIcon:!0,disabled:!te,onClick:se})]}),e(me,{children:[t($e,{text:"Horizontal width: stretch the canvas wider than the viewport so narrow stacks become hoverable / readable.",children:t(ve,{variant:Oo.Filled,options:[{value:Zu.Fit,label:"W: Fit"},{value:Zu.X10,label:"10x"}],selected:D,setSelected:_})}),t($e,{text:"Vertical height: scale rows taller than the viewport for deep call stacks. Scroll vertically to navigate.",children:t(ve,{variant:Oo.Filled,options:[{value:Qu.Fit,label:"H: Fit"},{value:Qu.X10,label:"10x"}],selected:P,setSelected:L})})]}),t(ge,{variant:be.Secondary,size:fe.S,iconSize:24,leftIcon:A?Va:hl,tooltip:A?"Exit fullscreen (Esc)":"Fullscreen",hideTooltipIcon:!0,onClick:Z})]})]}),t($e,{fullWidth:!0,keepAlive:!0,text:k,children:t("div",{ref:C,style:{flex:1,minWidth:0,width:"100%",height:A?"calc(100vh - 80px)":"calc(100vh - 364px)",position:"relative",overflow:"hidden"},children:t("div",{style:{position:"absolute",inset:0,overflowX:D>1?"auto":"hidden",overflowY:P>1?"auto":"hidden"},children:t("div",{style:{width:z||"100%",height:B||"100%",position:"relative"},children:t("canvas",{ref:S,style:{display:"block",position:"absolute",left:0,top:0,width:"100%",height:"100%",borderRadius:8,cursor:I?"pointer":"default"},onPointerDown:q,onPointerMove:K,onPointerLeave:Y,onClick:J})})})})}),e(me,{$justifyContent:"space-between",children:[t(pe,X?{size:he.XXXS,color:y.v2.colors.silver[300],children:`Zoomed: ${ne} • ${Uu(U)} samples in view`}:{size:he.XXXS,color:y.v2.colors.silver[300],children:m?"Click a frame to zoom in and jump to its row in the symbol table.":"Click a frame to zoom into its subtree (pprof-style)."}),h&&t(pe,{size:he.XXXS,color:y.v2.colors.silver[300],children:`${h.activeKeys.length} / ${h.maxSlots} profiling slots · ${oh(h.totalBytesUsed)} / ${oh(h.maxTotalBytesBudget)} budget · TTL ${h.slotTtlSeconds}s`})]})]})},ih=[$o.Go,$o.Java],ah="Profiling Symbols";function lh(e,t){if(0===t.length)return null;const o=1===t.length?t[0]:(e=>e.includes("/")||/\.\(\*?[^)]+\)\./.test(e)?$o.Go:e.includes(" ")||e.includes("(")?$o.Java:$o.Go)(e);if(o===$o.Go){const t=(e=>{let t=e.trim();if(!t)return null;t=t.replace(/\[[^\]]*\]/g,"");const o=t.lastIndexOf("/"),n=t.indexOf(".",o+1);if(-1===n)return null;const i=t.slice(0,n),a=t.slice(n+1);if(!i||!a)return null;const l=a.match(/^\(\*?([^)]+)\)\.(.+)$/);if(l){const e=new Ge(i,"",l[1],l[2]);return e.Verify()?e:null}const r=new Ge(i,a);return r.Verify()?r:null})(e);return t?{language:o,golang:t}:null}if(o===$o.Java){const t=(e=>{let t=e.trim();if(!t)return null;const o=t.indexOf("(");-1!==o&&(t=t.slice(0,o).trim());const n=t.split(/\s+/);t=n[n.length-1]??"";const i=t.lastIndexOf(".");if(-1===i)return null;const a=t.slice(0,i),l=t.slice(i+1),r=new We(a,l);return r.Verify()?r:null})(e);return t?{language:o,java:t}:null}return null}function rh(e,t){return e.namespace===t.namespace&&e.name===t.name&&e.kind===t.kind}function sh(e,t,o){if(!e)return!0;const{sources:n=[],namespaces:i=[],languages:a=[]}=e,l=!n.length||n.some(e=>rh(e,t.id)),r=!i.length||i.includes(t.id.namespace),s=!a.length||null==o||a.includes(o);return l&&r&&s}function ch(e,t){return e.packageName===t.packageName&&(e.functionName||"")===(t.functionName||"")&&(e.receiverName||"")===(t.receiverName||"")&&(e.receiverMethodName||"")===(t.receiverMethodName||"")}function dh(e,t){return e.className===t.className&&e.methodName===t.methodName}function ph(e,t,o,n){const i=lh(e,o);if(!i)return[];const a=[];for(const e of n){const o=e.customInstrumentations;if(!o)continue;if(!sh(e.sourceScopes,t,i.language))continue;const n=!!i.golang&&!!o[Ke.Golang]?.some(e=>ch(e,i.golang)),l=!!i.java&&!!o[Ke.Java]?.some(e=>dh(e,i.java));(n||l)&&a.push({rule:e,resolved:i})}return a}var uh,hh,mh;(e=>{e.Symbol="symbol",e.Self="self",e.Total="total"})(uh||(uh={})),(e=>{e.OnlyInstrumentable="only-instrumentable"})(hh||(hh={})),(e=>{e.FilterOutVoid="filter-out-void",e.OnlyWithReturnValues="only-with-return-values"})(mh||(mh={}));const gh=/^[A-Za-z_$][A-Za-z0-9_$]*(\[\])*$/;function fh(e,t){const o=(e=>e.split(" ")[0]??"")(e);return(!t.includes(mh.FilterOutVoid)||"void"!==o)&&!!(!t.includes(mh.OnlyWithReturnValues)||e.includes(" ")&&"void"!==o&&gh.test(o))}const bh=({rows:e,languages:o,instrumentation:n,searchQuery:i,filters:l,onFiltersChange:s,zoomedSymbols:c,highlightSymbol:d,scrollSignal:p})=>{const u=!!o?.includes($o.Java),h=a(()=>{const t=c?new Set(c):null,o=i?.trim().toLowerCase();return e.filter(e=>(!t||t.has(e.name))&&(!o||e.name.toLowerCase().includes(o)))},[e,i,c]),m=a(()=>{const e=[];if(n.selectionEnabled&&e.push({id:hh.OnlyInstrumentable,label:"Only show instrumentable symbols"}),u&&(e.push({id:mh.FilterOutVoid,label:"Filter out void symbols"}),e.push({id:mh.OnlyWithReturnValues,label:"Only show functions with return values"})),0!==e.length)return{options:e,filterRow:(e,t)=>{const o=e.cells.find(e=>e.key===uh.Symbol)?.rawValue?.toString()??"";return!(t.includes(hh.OnlyInstrumentable)&&!n.getSymbolState(o).showCheckbox)&&fh(o,t)}}},[n,u]),g=a(()=>[{key:uh.Symbol,label:"Symbol",flex:"0 0 160px",filterOverride:m,noFilter:!m},{key:uh.Self,label:"Self",tooltip:"Time spent in this function itself, excluding time in functions it calls.",textAlign:"right",noFilter:!0},{key:uh.Total,label:"Total",tooltip:"Time spent in this function and all functions it calls (inclusive).",textAlign:"right",noFilter:!0}],[m]),f=a(()=>h.map(e=>{const t=n.getSymbolState(e.name),o=t.showCheckbox;return{id:e.name,cells:[{key:uh.Symbol,rawValue:e.name},{key:uh.Self,rawValue:Uu(e.self)},{key:uh.Total,rawValue:Uu(e.total)}],isSelected:o?n.isSelected(e.name):void 0,onSelect:o?()=>n.onToggleSymbol(e.name,!0):void 0,onDeselect:o?()=>n.onToggleSymbol(e.name,!1):void 0,hideCheckbox:!o,checkboxDisabled:o?t.checkboxDisabled:void 0,checkboxTooltip:o?t.checkboxTooltip:void 0}}),[h,n]),b=r(e=>{const t=e.cells[0].rawValue,o=n.getSymbolState(t),i=[];return o.inManagedRule?i.push({id:`remove-instrumentation-${t}`,label:"",leftIcon:Ia,tooltip:"Remove from the “Profiling Symbols” rule",onClick:()=>n.onRemove(t)}):i.push({id:`add-instrumentation-${t}`,label:"",leftIcon:Na,tooltip:o.addTooltip,disabled:!o.addEnabled,onClick:()=>n.onAdd(t)}),i.push({id:`copy-${t}`,label:"",leftIcon:ml,tooltip:"Copy symbol name",onClick:()=>{navigator.clipboard.writeText(t)}}),i},[n]);return t(Ao,{variant:Ro.Data,maxHeight:"calc(100vh - 306px)",columns:g,rows:f,withCheckboxes:n.selectionEnabled,filters:l,onFiltersChange:s,activeRowId:d,scrollSignal:p,getRowActions:b})};var vh;(e=>{e.Table="table",e.Flame="flame",e.Both="both"})(vh||(vh={}));const yh=b(ee)`
739
750
  width: 100%;
740
751
  flex: 1;
741
752
  border-radius: 16px;
742
753
  overflow: hidden;
743
754
  background: ${({theme:e})=>e.v2.colors.silver[800]};
744
755
  box-shadow: 0 2px 14.1px 0 rgba(0, 0, 0, 0.25);
745
- `,hh=b.div`
756
+ `,Ch=b.div`
746
757
  display: flex;
747
758
  align-items: center;
748
759
  gap: 10px;
@@ -750,11 +761,11 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import n,{useEff
750
761
  padding: 12px 12px 8px;
751
762
  background: ${({theme:e})=>e.v2.colors.silver[800]};
752
763
  border-radius: 16px 16px 0 0;
753
- `,mh=b(me)`
764
+ `,Sh=b(me)`
754
765
  flex-shrink: 0;
755
766
  align-items: center;
756
767
  gap: 4px;
757
- `,gh=b.div`
768
+ `,xh=b.div`
758
769
  flex: 1;
759
770
  display: flex;
760
771
  align-items: stretch;
@@ -762,20 +773,20 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import n,{useEff
762
773
  padding: 16px;
763
774
  background: ${({theme:e})=>e.v2.colors.silver[800]};
764
775
  border-radius: 0 0 16px 16px;
765
- `,fh=b(ee)`
776
+ `,wh=b(ee)`
766
777
  flex: ${({$splitWithFlame:e})=>e?"0 0 min(413px, 42%)":"1 1 auto"};
767
778
  width: ${({$splitWithFlame:e})=>e?"auto":"100%"};
768
779
  max-width: ${({$splitWithFlame:e})=>e?"none":"100%"};
769
780
  gap: 10px;
770
- `,bh=b(ee)`
781
+ `,Th=b(ee)`
771
782
  flex: ${({$splitWithTable:e})=>e?"1":"1 1 auto"};
772
783
  width: ${({$splitWithTable:e})=>e?"auto":"100%"};
773
784
  gap: 10px;
774
- `,vh=b(me)`
785
+ `,kh=b(me)`
775
786
  width: 100%;
776
787
  min-height: 32px;
777
788
  flex-shrink: 0;
778
- `,yh=({source:o,onFlameFullscreenChange:n})=>{const d=v(),u=o.id,{profilingApi:p}=Pl(),[h,m]=s(!0),[g,f]=s(uh.Both),[b,y]=s(""),[C,S]=s({}),[x,w]=s(!1),T=l(!1);i(()=>{T.current||(T.current=!0,p.enableProfiling?.(u),w(!0))},[p,u]);const{data:k}=p.useSlots({skip:!x,pollInterval:h?3e3:0,fetchPolicy:"network-only"}),{data:E,loading:I,refetch:N}=p.useSourceProfiling(u,{skip:!x,pollInterval:h?3e3:0,fetchPolicy:"network-only"}),$=E?.profileJson??null,O=a(()=>(e=>{if(!e?.trim())return null;try{const t=JSON.parse(e),o=t.flamebearer;return!o?.names?.length||!Array.isArray(o.levels)||"number"!=typeof o.numTicks||o.numTicks<=0?null:{flamebearer:o,units:t.metadata?.units}}catch{return null}})($),[$]),A=a(()=>O?(e=>{const t=new Map;for(let o=0;o<e.levels.length;o++){const n=e.levels[o];for(let o=0;o+3<n.length;o+=4){const i=n[o+1],a=n[o+2],l=_p(e,n[o+3]);if(!l)continue;const r=t.get(l);(!r||i>r.total)&&t.set(l,{self:a,total:i})}}return[...t.entries()].map(([e,t])=>({name:e,self:t.self,total:t.total})).sort((e,t)=>t.self-e.self)})(O.flamebearer):[],[O]),R=g===uh.Table||g===uh.Both,D=g===uh.Flame||g===uh.Both,_=R&&D,P=o.runtimeInfo?.detectedLanguages?.join("\0")??"",L=o.containers?.map(e=>e.overrides?.runtimeInfo?.language??e.runtimeInfo?.language??"").join("\0")??"",F=a(()=>P?P.split("\0"):L?L.split("\0"):void 0,[P,L]),M=a(()=>((e,t)=>{if(!t?.includes(No.Java))return;const o=(e?.[ah.Symbol]?.filter(Boolean)??[]).filter(e=>e===rh.FilterOutVoid||e===rh.OnlyWithReturnValues);return 0!==o.length?e=>ch(e,o):void 0})(C,F),[C,F]),{instrumentation:z,pendingCount:B,pendingModify:X,closeModify:U,openBulkModify:V,resetSelection:H,confirmModify:j}=function({source:e,languages:t,rows:o}){const{instrumentationRulesApi:n,capabilities:i}=Pl(),{items:l}=n.useRules(),[c,d]=s(new Set),[u,p]=s(new Set),[h,m]=s(null),g=a(()=>(e=>{const t=new Set(e??[]);return Jp.filter(e=>t.has(e))})(t),[t]),f=i.canCreateInstrumentationRule,b=`${e.id.namespace}\0${e.id.kind}\0${e.id.name}`,v=a(()=>((e,t)=>{const o=e.filter(e=>e.type===Ye.CustomInstrumentation&&e.ruleName===Zp&&th(e.sourceScopes,t));return o.find(e=>e.sourceScopes?.sources?.some(e=>eh(e,t.id)))??o[0]??null})(l,e),[l,b]),y=f&&g.length>0,C=a(()=>{const t=new Map;for(const n of o){const o=!!Qp(n.name,g),i=ih(n.name,e,g,l),a=!!v&&i.some(e=>e.rule.ruleId===v.ruleId),r=i.filter(e=>e.rule.ruleId!==v?.ruleId),s=!a&&r.length>0,c=y&&o,d=s;let u;if(s){const e=[...new Set(r.map(e=>e.rule.ruleName))];u=`Managed by ${e.length>1?"rules":"rule"} ${e.map(e=>`“${e}”`).join(", ")}. Edit ${e.length>1?"those rules":"that rule"} to change this symbol.`}let p=!1,h="Add this symbol to the “Profiling Symbols” rule";s?h=u??"Managed by another rule":0===i.length&&(0===g.length?h="Custom instrumentation is only available for Go and Java sources":f?o?p=!0:h="This symbol could not be parsed into a probe automatically":h="You don’t have permission to add custom instrumentation"),t.set(n.name,{parsable:o,inManagedRule:a,otherRules:r,showCheckbox:c,checkboxDisabled:d,checkboxTooltip:u,addEnabled:p,addTooltip:h})}return t},[o,l,b,g,f,y,v]),S=a(()=>{const e=new Set;return C.forEach((t,o)=>{t.inManagedRule&&e.add(o)}),e},[C]),x=a(()=>[...c].filter(e=>C.get(e)?.addEnabled&&!S.has(e)),[c,C,S]),w=a(()=>[...u].filter(e=>S.has(e)),[u,S]),T=x.length+w.length,k=r(e=>{const t=C.get(e);return t?.inManagedRule?!u.has(e):!!(t&&t.otherRules.length>0)||c.has(e)},[C,u,c]),E=r((e,t)=>{const o=C.get(e);o&&!o.checkboxDisabled&&(o.inManagedRule?p(o=>{const n=new Set(o);return t?n.delete(e):n.add(e),n}):d(o=>{const n=new Set(o);return t?n.add(e):n.delete(e),n}))},[C]),I=r(()=>{d(new Set),p(new Set)},[]),N=r(t=>{(async()=>{const o=t.add.map(e=>Qp(e,g)).filter(e=>!!e),i=t.remove.map(e=>Qp(e,g)).filter(e=>!!e);if(v){const{customInstrumentations:e,isEmpty:t}=((e,t,o)=>{const n=e.customInstrumentations??{};let i=[...n[Ke.Golang]??[]],a=[...n[Ke.Java]??[]];for(const e of o)e.golang&&(i=i.filter(t=>!oh(t,e.golang))),e.java&&(a=a.filter(t=>!nh(t,e.java)));for(const e of t)e.golang&&!i.some(t=>oh(t,e.golang))&&i.push(e.golang),e.java&&!a.some(t=>nh(t,e.java))&&a.push(e.java);return{customInstrumentations:{[Ke.Golang]:i,[Ke.Java]:a},isEmpty:0===i.length&&0===a.length}})(v,o,i);t?await n.remove(v.ruleId,Ye.CustomInstrumentation):await n.update(v.ruleId,((e,t)=>({ruleName:e.ruleName,notes:e.notes,disabled:e.disabled,sourceScopes:e.sourceScopes??null,workloads:null,instrumentationLibraries:e.instrumentationLibraries??null,payloadCollection:null,codeAttributes:null,headersCollection:null,customInstrumentations:t}))(v,e),Ye.CustomInstrumentation)}else o.length>0&&await n.create(((e,t)=>{const o=e.map(e=>e.golang).filter(e=>!!e),n=e.map(e=>e.java).filter(e=>!!e),i={sources:[{namespace:t.id.namespace,name:t.id.name,kind:t.id.kind}],namespaces:[],languages:[]};return{ruleName:Zp,notes:"Symbols selected from the profiling tab.",disabled:!1,sourceScopes:i,workloads:null,instrumentationLibraries:null,payloadCollection:null,codeAttributes:null,headersCollection:null,customInstrumentations:{[Ke.Golang]:o,[Ke.Java]:n}}})(o,e),Ye.CustomInstrumentation)})()},[v,g,e,n]),$=r(()=>{T&&m({add:x,remove:w})},[T,x,w]),O=r(e=>m({add:[e],remove:[]}),[]),A=r(e=>m({add:[],remove:[e]}),[]),R=r(()=>m(null),[]),D=r(()=>{h&&(N(h),m(null),I())},[h,N,I]),_=r(e=>C.get(e)??{parsable:!1,inManagedRule:!1,otherRules:[],showCheckbox:!1,checkboxDisabled:!1,addEnabled:!1,addTooltip:"Custom instrumentation is only available for Go and Java sources"},[C]);return{instrumentation:a(()=>({getSymbolState:_,onAdd:O,onRemove:A,selectionEnabled:y,isSelected:k,onToggleSymbol:E}),[_,O,A,y,k,E]),pendingCount:T,pendingModify:h,closeModify:R,openBulkModify:$,resetSelection:I,confirmModify:D}}({source:o,languages:F,rows:A}),[G,W]=s(null),[K,Y]=s(0),[q,J]=s(null),Z=r(e=>{W(e),Y(e=>e+1),f(e=>e===uh.Flame?uh.Both:e)},[]),Q=r(e=>{J(t=>{if(null===e)return null===t?t:null;if(t&&t.length===e.length){const o=new Set(t);if(e.every(e=>o.has(e)))return t}return e})},[]),te=r(()=>W(null),[]);return!$&&I?t(ft,{$height:"70vh",children:t(St,{withSpinner:!0})}):e(ph,{$gap:0,$width:"100%",children:[e(hh,{children:[t($e,{text:"Live CPU profile collected from the workload agent. Search symbols, switch between the table and flame graph, or download a JSON snapshot.",withIcon:!0,children:t(mh,{children:t(ue,{size:he.S,weight:500,color:pe.Primary,nowrap:!0,children:"CPU Profiling"})})}),e(me,{style:{flex:1,minWidth:200,gap:10,alignItems:"center",flexWrap:"wrap"},children:[t("div",{style:{flex:"1 1 220px",minWidth:180},children:t(uo,{value:b,onChange:y,placeholder:"Search by symbol name",width:"100%",idleBackgroundColor:d.v2.colors.silver[900],emphasizeBackgroundColor:d.v2.colors.silver[800]})}),t(ve,{variant:$o.Filled,options:[{value:uh.Table,label:"Top table"},{value:uh.Flame,label:"Flame graph"},{value:uh.Both,label:"Both"}],selected:g,setSelected:f}),t(ge,h?{variant:be.Secondary,size:fe.S,label:"Live",tooltip:"Odigos profiler works in-memory and doesn't store any data on disk, to keep minimum memory footprint we store only last 10 minutes of data on demand",leftIcon:e=>t(hl,{...e,size:8,fill:d.v2.colors.green[500]})}:{variant:be.Secondary,size:fe.S,label:"Paused",tooltip:"Odigos profiler is still collecting data, but the UI is not updating in real time",leftIcon:e=>t(hl,{...e,size:8,fill:d.v2.colors.red[500]})})]})]}),t(gh,{$gap:R&&D?16:0,children:O?e(c,{children:[R&&e(fh,{$splitWithFlame:_,children:[e(vh,{$justifyContent:"space-between",children:[e(ee,{$margin:"0 0 0 20px",children:[t(ue,{size:he.XXXS,nowrap:!0,children:"Please select symbols to"}),e(me,{$gap:8,children:[e(me,{children:[t(ml,{size:24}),t(ue,{size:he.S,color:pe.Success,nowrap:!0,children:"Custom Instrument"})]}),t(ge,{leftIcon:Aa,variant:be.Secondary,size:fe.S,onClick:()=>window.open(`${Me}/enterprise/pipeline/rules/custominstrumentation`,"_blank","noopener noreferrer")})]})]}),e(me,{$gap:8,children:[q&&t($e,{text:"The table is scoped to the symbols inside the flame graph’s current zoom. Use “Reset zoom” on the flame graph to show all symbols again.",children:t(qe,{label:`Zoomed: ${q.length} symbols`,backgroundColor:d.v2.colors.silver[750],textColor:d.v2.colors.silver[200],textSize:he.XXS})}),t(ge,{variant:be.Secondary,size:fe.S,label:"Download snapshot",rightIcon:gl,onClick:()=>{if(!$)return;const e=new Blob([$],{type:"application/json"}),t=URL.createObjectURL(e),n=document.createElement("a");n.href=t,n.download=`cpu-profile-${o.id.namespace}-${o.id.kind}-${o.id.name}.json`,n.click(),URL.revokeObjectURL(t)},disabled:!$})]})]}),t(dh,{rows:A,languages:F,instrumentation:z,searchQuery:b,filters:C,onFiltersChange:S,zoomedSymbols:q,highlightSymbol:G,scrollSignal:K})]}),D&&e(bh,{$splitWithTable:_,children:[e(vh,{$justifyContent:"space-between",children:[t(qe,{label:O?`Total in view ${Pp(O.flamebearer.numTicks)}`:"No profile sample yet",backgroundColor:d.v2.colors.silver[750],textColor:d.v2.colors.silver[200],textSize:he.XXS}),e(me,{$gap:12,children:[!h&&t(ge,{variant:be.Secondary,size:fe.S,label:"Refresh",leftIcon:Za,onClick:N}),t(le,{label:"Auto refresh",labelAlign:re.Left,size:Nt.S,value:h,onChange:m})]})]}),t(qp,{flamebearer:O.flamebearer,maxRowPx:24,searchQuery:b,shouldKeepName:M,minHostHeight:280,onFullscreenChange:n,profilingSlots:k??null,onFrameClick:Z,onZoomedSymbolsChange:Q,onResetZoom:te})]})]}):t(ft,{children:t(Re,{title:"No profile samples yet",subTitle:"Dynamically collecting profiling samples — keep this tab open while the agent sends OTLP profiles."})})}),t(Dp,{pendingModify:X,onClose:U,onConfirm:j}),t(Ro,{isOpen:B>0,richTitle:{icon:Va,title:"Profiling Symbols",badge:{label:B}},actions:[{id:"profiling-bulk-cancel",type:co.Button,buttonProps:{variant:be.Secondary,size:fe.S,label:"Cancel",onClick:H}},{id:"profiling-bulk-apply",type:co.Button,buttonProps:{variant:be.Primary,size:fe.S,label:"Modify Rule",leftIcon:Da,onClick:V}}]})]})},Ch=b.div`
789
+ `,Eh=({source:o,onFlameFullscreenChange:n})=>{const d=v(),p=o.id,{profilingApi:u}=Ll(),[h,m]=s(!0),[g,f]=s(vh.Both),[b,y]=s(""),[C,S]=s({}),[x,w]=s(!1),T=l(!1);i(()=>{T.current||(T.current=!0,u.enableProfiling?.(p),w(!0))},[u,p]);const{data:k}=u.useSlots({skip:!x,pollInterval:h?3e3:0,fetchPolicy:"network-only"}),{data:E,loading:I,refetch:N}=u.useSourceProfiling(p,{skip:!x,pollInterval:h?3e3:0,fetchPolicy:"network-only"}),$=E?.profileJson??null,O=a(()=>(e=>{if(!e?.trim())return null;try{const t=JSON.parse(e),o=t.flamebearer;return!o?.names?.length||!Array.isArray(o.levels)||"number"!=typeof o.numTicks||o.numTicks<=0?null:{flamebearer:o,units:t.metadata?.units}}catch{return null}})($),[$]),A=a(()=>O?(e=>{const t=new Map;for(let o=0;o<e.levels.length;o++){const n=e.levels[o];for(let o=0;o+3<n.length;o+=4){const i=n[o+1],a=n[o+2],l=Xu(e,n[o+3]);if(!l)continue;const r=t.get(l);(!r||i>r.total)&&t.set(l,{self:a,total:i})}}return[...t.entries()].map(([e,t])=>({name:e,self:t.self,total:t.total})).sort((e,t)=>t.self-e.self)})(O.flamebearer):[],[O]),R=g===vh.Table||g===vh.Both,D=g===vh.Flame||g===vh.Both,_=R&&D,P=o.runtimeInfo?.detectedLanguages?.join("\0")??"",L=o.containers?.map(e=>e.overrides?.runtimeInfo?.language??e.runtimeInfo?.language??"").join("\0")??"",F=a(()=>P?P.split("\0"):L?L.split("\0"):void 0,[P,L]),M=a(()=>((e,t)=>{if(!t?.includes($o.Java))return;const o=(e?.[uh.Symbol]?.filter(Boolean)??[]).filter(e=>e===mh.FilterOutVoid||e===mh.OnlyWithReturnValues);return 0!==o.length?e=>fh(e,o):void 0})(C,F),[C,F]),{instrumentation:z,pendingCount:B,pendingModify:X,closeModify:U,openBulkModify:V,resetSelection:H,confirmModify:j}=function({source:e,languages:t,rows:o}){const{instrumentationRulesApi:n,capabilities:i}=Ll(),{items:l}=n.useRules(),[c,d]=s(new Set),[p,u]=s(new Set),[h,m]=s(null),g=a(()=>(e=>{const t=new Set(e??[]);return ih.filter(e=>t.has(e))})(t),[t]),f=i.canCreateInstrumentationRule,b=`${e.id.namespace}\0${e.id.kind}\0${e.id.name}`,v=a(()=>((e,t)=>{const o=e.filter(e=>e.type===Ye.CustomInstrumentation&&e.ruleName===ah&&sh(e.sourceScopes,t));return o.find(e=>e.sourceScopes?.sources?.some(e=>rh(e,t.id)))??o[0]??null})(l,e),[l,b]),y=f&&g.length>0,C=a(()=>{const t=new Map;for(const n of o){const o=!!lh(n.name,g),i=ph(n.name,e,g,l),a=!!v&&i.some(e=>e.rule.ruleId===v.ruleId),r=i.filter(e=>e.rule.ruleId!==v?.ruleId),s=!a&&r.length>0,c=y&&o,d=s;let p;if(s){const e=[...new Set(r.map(e=>e.rule.ruleName))];p=`Managed by ${e.length>1?"rules":"rule"} ${e.map(e=>`“${e}”`).join(", ")}. Edit ${e.length>1?"those rules":"that rule"} to change this symbol.`}let u=!1,h="Add this symbol to the “Profiling Symbols” rule";s?h=p??"Managed by another rule":0===i.length&&(0===g.length?h="Custom instrumentation is only available for Go and Java sources":f?o?u=!0:h="This symbol could not be parsed into a probe automatically":h="You don’t have permission to add custom instrumentation"),t.set(n.name,{parsable:o,inManagedRule:a,otherRules:r,showCheckbox:c,checkboxDisabled:d,checkboxTooltip:p,addEnabled:u,addTooltip:h})}return t},[o,l,b,g,f,y,v]),S=a(()=>{const e=new Set;return C.forEach((t,o)=>{t.inManagedRule&&e.add(o)}),e},[C]),x=a(()=>[...c].filter(e=>C.get(e)?.addEnabled&&!S.has(e)),[c,C,S]),w=a(()=>[...p].filter(e=>S.has(e)),[p,S]),T=x.length+w.length,k=r(e=>{const t=C.get(e);return t?.inManagedRule?!p.has(e):!!(t&&t.otherRules.length>0)||c.has(e)},[C,p,c]),E=r((e,t)=>{const o=C.get(e);o&&!o.checkboxDisabled&&(o.inManagedRule?u(o=>{const n=new Set(o);return t?n.delete(e):n.add(e),n}):d(o=>{const n=new Set(o);return t?n.add(e):n.delete(e),n}))},[C]),I=r(()=>{d(new Set),u(new Set)},[]),N=r(t=>{(async()=>{const o=t.add.map(e=>lh(e,g)).filter(e=>!!e),i=t.remove.map(e=>lh(e,g)).filter(e=>!!e);if(v){const{customInstrumentations:e,isEmpty:t}=((e,t,o)=>{const n=e.customInstrumentations??{};let i=[...n[Ke.Golang]??[]],a=[...n[Ke.Java]??[]];for(const e of o)e.golang&&(i=i.filter(t=>!ch(t,e.golang))),e.java&&(a=a.filter(t=>!dh(t,e.java)));for(const e of t)e.golang&&!i.some(t=>ch(t,e.golang))&&i.push(e.golang),e.java&&!a.some(t=>dh(t,e.java))&&a.push(e.java);return{customInstrumentations:{[Ke.Golang]:i,[Ke.Java]:a},isEmpty:0===i.length&&0===a.length}})(v,o,i);t?await n.remove(v.ruleId,Ye.CustomInstrumentation):await n.update(v.ruleId,((e,t)=>({ruleName:e.ruleName,notes:e.notes,disabled:e.disabled,sourceScopes:e.sourceScopes??null,workloads:null,instrumentationLibraries:e.instrumentationLibraries??null,payloadCollection:null,codeAttributes:null,headersCollection:null,customInstrumentations:t}))(v,e),Ye.CustomInstrumentation)}else o.length>0&&await n.create(((e,t)=>{const o=e.map(e=>e.golang).filter(e=>!!e),n=e.map(e=>e.java).filter(e=>!!e),i={sources:[{namespace:t.id.namespace,name:t.id.name,kind:t.id.kind}],namespaces:[],languages:[]};return{ruleName:ah,notes:"Symbols selected from the profiling tab.",disabled:!1,sourceScopes:i,workloads:null,instrumentationLibraries:null,payloadCollection:null,codeAttributes:null,headersCollection:null,customInstrumentations:{[Ke.Golang]:o,[Ke.Java]:n}}})(o,e),Ye.CustomInstrumentation)})()},[v,g,e,n]),$=r(()=>{T&&m({add:x,remove:w})},[T,x,w]),O=r(e=>m({add:[e],remove:[]}),[]),A=r(e=>m({add:[],remove:[e]}),[]),R=r(()=>m(null),[]),D=r(()=>{h&&(N(h),m(null),I())},[h,N,I]),_=r(e=>C.get(e)??{parsable:!1,inManagedRule:!1,otherRules:[],showCheckbox:!1,checkboxDisabled:!1,addEnabled:!1,addTooltip:"Custom instrumentation is only available for Go and Java sources"},[C]);return{instrumentation:a(()=>({getSymbolState:_,onAdd:O,onRemove:A,selectionEnabled:y,isSelected:k,onToggleSymbol:E}),[_,O,A,y,k,E]),pendingCount:T,pendingModify:h,closeModify:R,openBulkModify:$,resetSelection:I,confirmModify:D}}({source:o,languages:F,rows:A}),[G,W]=s(null),[K,Y]=s(0),[q,J]=s(null),Z=r(e=>{W(e),Y(e=>e+1),f(e=>e===vh.Flame?vh.Both:e)},[]),Q=r(e=>{J(t=>{if(null===e)return null===t?t:null;if(t&&t.length===e.length){const o=new Set(t);if(e.every(e=>o.has(e)))return t}return e})},[]),te=r(()=>W(null),[]);return!$&&I?t(ft,{$height:"70vh",children:t(St,{withSpinner:!0})}):e(yh,{$gap:0,$width:"100%",children:[e(Ch,{children:[t($e,{text:"Live CPU profile collected from the workload agent. Search symbols, switch between the table and flame graph, or download a JSON snapshot.",withIcon:!0,children:t(Sh,{children:t(pe,{size:he.S,weight:500,color:ue.Primary,nowrap:!0,children:"CPU Profiling"})})}),e(me,{style:{flex:1,minWidth:200,gap:10,alignItems:"center",flexWrap:"wrap"},children:[t("div",{style:{flex:"1 1 220px",minWidth:180},children:t(po,{value:b,onChange:y,placeholder:"Search by symbol name",width:"100%",idleBackgroundColor:d.v2.colors.silver[900],emphasizeBackgroundColor:d.v2.colors.silver[800]})}),t(ve,{variant:Oo.Filled,options:[{value:vh.Table,label:"Top table"},{value:vh.Flame,label:"Flame graph"},{value:vh.Both,label:"Both"}],selected:g,setSelected:f}),t(ge,h?{variant:be.Secondary,size:fe.S,label:"Live",tooltip:"Odigos profiler works in-memory and doesn't store any data on disk, to keep minimum memory footprint we store only last 10 minutes of data on demand",leftIcon:e=>t(gl,{...e,size:8,fill:d.v2.colors.green[500]})}:{variant:be.Secondary,size:fe.S,label:"Paused",tooltip:"Odigos profiler is still collecting data, but the UI is not updating in real time",leftIcon:e=>t(gl,{...e,size:8,fill:d.v2.colors.red[500]})})]})]}),t(xh,{$gap:R&&D?16:0,children:O?e(c,{children:[R&&e(wh,{$splitWithFlame:_,children:[e(kh,{$justifyContent:"space-between",children:[e(ee,{$margin:"0 0 0 20px",children:[t(pe,{size:he.XXXS,nowrap:!0,children:"Please select symbols to"}),e(me,{$gap:8,children:[e(me,{children:[t(fl,{size:24}),t(pe,{size:he.S,color:ue.Success,nowrap:!0,children:"Custom Instrument"})]}),t(ge,{leftIcon:Ra,variant:be.Secondary,size:fe.S,onClick:()=>window.open(`${Me}/enterprise/pipeline/rules/custominstrumentation`,"_blank","noopener noreferrer")})]})]}),e(me,{$gap:8,children:[q&&t($e,{text:"The table is scoped to the symbols inside the flame graph’s current zoom. Use “Reset zoom” on the flame graph to show all symbols again.",children:t(qe,{label:`Zoomed: ${q.length} symbols`,backgroundColor:d.v2.colors.silver[750],textColor:d.v2.colors.silver[200],textSize:he.XXS})}),t(ge,{variant:be.Secondary,size:fe.S,label:"Download snapshot",rightIcon:bl,onClick:()=>{if(!$)return;const e=new Blob([$],{type:"application/json"}),t=URL.createObjectURL(e),n=document.createElement("a");n.href=t,n.download=`cpu-profile-${o.id.namespace}-${o.id.kind}-${o.id.name}.json`,n.click(),URL.revokeObjectURL(t)},disabled:!$})]})]}),t(bh,{rows:A,languages:F,instrumentation:z,searchQuery:b,filters:C,onFiltersChange:S,zoomedSymbols:q,highlightSymbol:G,scrollSignal:K})]}),D&&e(Th,{$splitWithTable:_,children:[e(kh,{$justifyContent:"space-between",children:[t(qe,{label:O?`Total in view ${Uu(O.flamebearer.numTicks)}`:"No profile sample yet",backgroundColor:d.v2.colors.silver[750],textColor:d.v2.colors.silver[200],textSize:he.XXS}),e(me,{$gap:12,children:[!h&&t(ge,{variant:be.Secondary,size:fe.S,label:"Refresh",leftIcon:Qa,onClick:N}),t(le,{label:"Auto refresh",labelAlign:re.Left,size:Nt.S,value:h,onChange:m})]})]}),t(nh,{flamebearer:O.flamebearer,maxRowPx:24,searchQuery:b,shouldKeepName:M,minHostHeight:280,onFullscreenChange:n,profilingSlots:k??null,onFrameClick:Z,onZoomedSymbolsChange:Q,onResetZoom:te})]})]}):t(ft,{children:t(Re,{title:"No profile samples yet",subTitle:"Dynamically collecting profiling samples — keep this tab open while the agent sends OTLP profiles."})})}),t(Bu,{pendingModify:X,onClose:U,onConfirm:j}),t(Do,{isOpen:B>0,richTitle:{icon:Ha,title:"Profiling Symbols",badge:{label:B}},actions:[{id:"profiling-bulk-cancel",type:co.Button,buttonProps:{variant:be.Secondary,size:fe.S,label:"Cancel",onClick:H}},{id:"profiling-bulk-apply",type:co.Button,buttonProps:{variant:be.Primary,size:fe.S,label:"Modify Rule",leftIcon:_a,onClick:V}}]})]})},Ih=b.div`
779
790
  position: relative;
780
791
  display: flex;
781
792
  align-items: center;
@@ -783,23 +794,23 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import n,{useEff
783
794
  padding: 8px 16px;
784
795
  border-radius: 12px;
785
796
  background-color: ${({theme:e})=>e.v2.colors.silver[700]};
786
- `,Sh=b.div`
797
+ `,Nh=b.div`
787
798
  display: flex;
788
799
  flex-direction: column;
789
800
  gap: 4px;
790
801
  flex: 1;
791
802
  min-width: 0;
792
803
  opacity: ${({$disabled:e})=>e?.4:1};
793
- `,xh=b.div`
804
+ `,$h=b.div`
794
805
  flex-shrink: 0;
795
806
  display: flex;
796
807
  align-items: center;
797
808
  margin-right: ${({$reserveJumpSpace:e})=>e?"32px":"0"};
798
- `,wh=b.div`
809
+ `,Oh=b.div`
799
810
  min-width: 0;
800
811
  white-space: pre;
801
812
  overflow-x: auto;
802
- `,Th=b.div`
813
+ `,Ah=b.div`
803
814
  position: absolute;
804
815
  top: 50%;
805
816
  right: 8px;
@@ -808,24 +819,24 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import n,{useEff
808
819
  pointer-events: none;
809
820
  transition: opacity 0.15s ease;
810
821
 
811
- ${Ch}:hover & {
822
+ ${Ih}:hover & {
812
823
  opacity: 1;
813
824
  pointer-events: auto;
814
825
  }
815
- `,kh=({name:o,summary:n,disabled:i=!1,onJumpToRule:a})=>{const l=v();return e(Ch,{children:[e(Sh,{$disabled:i,children:[o&&t(ue,{size:he.XXXS,color:pe.Secondary,nowrap:!0,children:o}),t(wh,{children:t(w,{parts:n})})]}),i&&t(xh,{$reserveJumpSpace:!!a,children:t(qe,{label:Do,textSize:he.XXXS,backgroundColor:l.v2.colors.grey[700],textColor:l.v2.colors.grey[300]})}),a&&t(Th,{children:t($e,{text:et.OPEN_IN_SAMPLING_PAGE,children:t(ge,{"data-id":"sampling-rule-jump",variant:be.Primary,size:fe.S,leftIcon:ul,onClick:a})})})]})},Eh=b.div`
826
+ `,Rh=({name:o,summary:n,disabled:i=!1,onJumpToRule:a})=>{const l=v();return e(Ih,{children:[e(Nh,{$disabled:i,children:[o&&t(pe,{size:he.XXXS,color:ue.Secondary,nowrap:!0,children:o}),t(Oh,{children:t(w,{parts:n})})]}),i&&t($h,{$reserveJumpSpace:!!a,children:t(qe,{label:_o,textSize:he.XXXS,backgroundColor:l.v2.colors.grey[700],textColor:l.v2.colors.grey[300]})}),a&&t(Ah,{children:t($e,{text:et.OPEN_IN_SAMPLING_PAGE,children:t(ge,{"data-id":"sampling-rule-jump",variant:be.Primary,size:fe.S,leftIcon:hl,onClick:a})})})]})},Dh=b.div`
816
827
  opacity: 0;
817
828
  pointer-events: none;
818
829
  transition: opacity 0.15s ease;
819
- `,Ih=b.div`
820
- &:hover ${Eh} {
830
+ `,_h=b.div`
831
+ &:hover ${Dh} {
821
832
  opacity: 1;
822
833
  pointer-events: auto;
823
834
  }
824
- `,Nh=b.div`
835
+ `,Ph=b.div`
825
836
  display: flex;
826
837
  align-items: center;
827
838
  padding: 4px 12px;
828
- `,$h=({source:e,onRedirectToSampling:o})=>t(Xt,{bgTint:"1000",richTitle:{title:et.CONTAINERS,badge:{label:e.containers?.length??0}},children:e.containers?.map(e=>t(Rh,{container:e,onRedirectToSampling:o},e.containerName))});var Oh;(e=>{e.All="all",e.Noisy="noisy",e.HighlyRelevant="highly-relevant",e.CostReduction="cost-reduction"})(Oh||(Oh={}));const Ah=e=>"noisy"===e.type?T(e.rule,"source"):"highlyRelevant"===e.type?k(e.rule,"source"):"costReduction"===e.type?E(e.rule,"source"):[],Rh=({container:o,onRedirectToSampling:n})=>{const[i,l]=s(Oh.All),r=ho(e=>e.setPendingViewSamplingRule),c=o.agentConfig?.traces?.headSampling?.noisyOperations??[],d=a(()=>(o.collectorConfig?.tailSampling?.noisyOperations??[]).map(e=>({type:"noisy",rule:e})),[o.agentConfig?.traces?.headSampling?.noisyOperations]),u=a(()=>(o.collectorConfig?.tailSampling?.highlyRelevantOperations??[]).map(e=>({type:"highlyRelevant",rule:e})),[o.collectorConfig?.tailSampling?.highlyRelevantOperations]),p=a(()=>(o.collectorConfig?.tailSampling?.costReductionRules??[]).map(e=>({type:"costReduction",rule:e})),[o.collectorConfig?.tailSampling?.costReductionRules]),h=a(()=>i===Oh.Noisy?d:i===Oh.HighlyRelevant?u:i===Oh.CostReduction?p:[...d,...u,...p],[i,u,p]),m=d.length+u.length+p.length,g=a(()=>(e,t)=>{r({ruleId:e,category:t}),n()},[n,r]),f=t(Eh,{children:t(ge,{"data-id":"sampling-container-create-rule",variant:be.Secondary,size:fe.S,label:_o,rightIcon:Ia,onClick:e=>{e.stopPropagation(),n()}})});return t(Ih,{children:e(Xt,{bgTint:"900",richTitle:{title:o.containerName},renderOnRightSide:f,withCollapse:!0,collapseIsDefaultOpen:!0,children:[c.length?e(Xt,{bgTint:"800",richTitle:{title:et.HEAD_SAMPLING,badge:{label:c.length}},children:[t(ue,{size:he.XXS,children:et.NOISY_OPERATIONS}),t(ee,{$gap:4,children:c.map(e=>t(kh,{name:e.name,summary:T(e),disabled:e.disabled,onJumpToRule:()=>g(e.ruleId,"noisy")},e.ruleId))})]}):t(Nh,{children:t(ue,{size:he.XS,color:pe.Secondary,children:et.HEAD_SAMPLING})}),m?e(Xt,{bgTint:"800",richTitle:{title:et.TAIL_SAMPLING,badge:{label:m}},children:[t(ve,{options:(b=d.length,v=u.length,y=p.length,[{value:Oh.All,label:"All",badge:{label:b+v+y,textSize:he.XXXS}},{value:Oh.Noisy,label:et.NOISY_OPERATIONS,badge:{label:b,textSize:he.XXXS}},{value:Oh.HighlyRelevant,label:et.HIGHLY_RELEVANT_OPERATIONS,badge:{label:v,textSize:he.XXXS}},{value:Oh.CostReduction,label:et.COST_REDUCTION_OPERATIONS,badge:{label:y,textSize:he.XXXS}}]),selected:i,setSelected:l}),t(ee,{$gap:4,children:h.length?h.map(e=>t(kh,{name:e.rule.name,summary:Ah(e),disabled:e.rule.disabled,onJumpToRule:()=>g(e.rule.ruleId,e.type)},e.rule.ruleId)):t(Re,{title:`No ${i===Oh.All?`${Oh.Noisy}, ${Oh.HighlyRelevant} and ${Oh.CostReduction}`:i} operations`})})]}):t(Nh,{children:t(ue,{size:he.XS,color:pe.Secondary,children:et.TAIL_SAMPLING})})]})});var b,v,y},Dh=[yo.Deployment,yo.StatefulSet,yo.DaemonSet,yo.DeploymentConfig,yo.Rollout,yo.Pod];var _h;(e=>{e.Workload="Workload",e.Pod="Pod"})(_h||(_h={}));const Ph=e=>!!e&&io(e.status)===Fe.Error,Lh=e=>Ph(e.healthStatus),Fh=e=>Ph(e.odigosHealthStatus)||(e.processes??[]).some(Lh),Mh=e=>Ph(e.agentInjectedStatus)||Ph(e.odigosHealthStatus)||(e.containers??[]).some(Fh),zh=({onClose:o,sourceId:n,onRedirectToSampling:c})=>{const d=v(),{isVm:u,isConnector:p,isK8s:h}=S(),{sourcesApi:m,configApi:g}=Pl(),{selectedStreamName:f}=tt(),{genericForm:b,loadSource:y,validateFormData:C}=zl(),{data:x}=g.useEffectiveConfig(),[w,T]=s(!1),[k,E]=s(!1),[I,N]=s(!1),[$,O]=s(ku.Overview),[A,R]=s(null),[D,_]=s({openFor:null}),P=(()=>{const[e,t]=s(null),o=r(e=>{t({tab:ku.Pods,podName:e.podName})},[]),n=r((e,o)=>{t({tab:ku.Pods,podName:e.podName,containerName:o.containerName})},[]),i=r((e,o,n)=>{const i=Au({identifyingAttributes:n.identifyingAttributes});t({tab:ku.Pods,podName:e.podName,containerName:o.containerName,processPid:i})},[]),l=r(()=>t(null),[]);return a(()=>({jumpToTarget:e,jumpToPod:o,jumpToContainer:n,jumpToProcess:i,clearJumpToTarget:l}),[e,o,n,i,l])})();i(()=>{P.jumpToTarget&&O(P.jumpToTarget.tab)},[P.jumpToTarget]),i(()=>{A&&JSON.stringify(mo(n))!==JSON.stringify(mo(A))&&R(null)},[n,A]);const L=l(!1),F=r(async()=>R(await m.fetchById(n)||null),[n,m]);i(()=>{if(L.current||(F(),L.current=!0),!w){const e=setInterval(()=>F(),3e3);return()=>clearInterval(e)}},[F,w]),i(()=>{A&&y(A)},[A]);const M=A&&Dh.includes(A.id.kind),z=a(()=>{const e=[],o=(A?.pods??[]).some(Mh);return e.push({value:ku.Overview,label:et.OVERVIEW}),h?(e.push({value:ku.Pods,label:et.PODS,icon:o?e=>t(nl,{...e,fill:d.v2.colors.red[500]}):void 0}),e.push({value:ku.PeerSources,label:et.PEER_SOURCES}),x?.profiling?.enabled&&e.push({value:ku.Profiling,label:et.PROFILING}),e.push({value:ku.Sampling,label:et.SAMPLING}),e.push({value:ku.Debug,label:et.DEBUG}),e):e},[h,x,A?.pods,d]),B=r(()=>T(!0),[]),X=a(()=>()=>{o(),c()},[o,c]),U=r(()=>{A&&y(A),T(!1)},[A]),V=r(async()=>{if(!A||!b)return;const{errorMessage:e,preparedFormData:t}=C();if(e)return;const o=t.otelServiceName!==A.id.name?t.otelServiceName:"";await m.update(n,{...t,otelServiceName:o}),T(!1)},[A,b,C,n,m]),H=r(()=>E(!0),[]),j=r(async()=>{A&&(await m.persistV2({[Rt]:[{namespace:A.id.namespace,name:A.id.name,kind:A.id.kind,region:A.id.region??"",selected:!1,currentStreamName:f}]}),E(!1),o())},[A,m,f,o]),G=r(()=>{_({openFor:_h.Workload})},[]),W=r(e=>{O(e),P.clearJumpToTarget()},[P]),K=r(async()=>{await m.recoverFromRollback(n)},[m,n]),Y=r(()=>_({openFor:null}),[]),q=r(async()=>{D.openFor===_h.Workload?await m.restartWorkloads([n]):D.openFor===_h.Pod&&D.podNamespace&&D.podName&&await m.restartPod(D.podNamespace,D.podName),Y()},[D,m,n,Y]),J=a(()=>{const{kind:e,name:t}=n;return{title:`Rollout ${e}`,description:`Are you sure you want to rollout the ${e.toLowerCase()} "${t}"?`}},[n]),Z=a(()=>{const e=[];return w||$===ku.Overview&&(e.push({id:"edit-source-btn-edit",label:Ft.EDIT,icon:Da,active:w,onClick:B}),h&&M&&e.push({id:"edit-source-btn-restart",label:et.ROLLOUT,icon:fl,onClick:G}),e.push({id:"edit-source-btn-delete",label:Ft.UNINSTRUMENT,icon:Ea,color:d.v2.colors.red[500],active:k,onClick:H})),e},[$,w,k,h,M,B,G,H,d]),Q=a(()=>{if(!A)return[];const e=[],t={backgroundColor:"transparent",textSize:he.S};return e.push({...t,label:A.id.name,leftIcon:h?ol:void 0}),A.serviceName&&A.serviceName!==A.id.name&&e.push({...t,label:A.serviceName,leftIcon:tl,textColor:d.v2.colors.silver[200]}),e},[A,d,h]);if(!A)return t(ce,{isOpen:!0,children:t(ft,{$height:"80vh",children:t(St,{withSpinner:!0})})});const te=$===ku.Profiling?I?"95vw":"fit-content":w?void 0:"60vw",oe=u?bl:p?Wa:Po(A.containers)[0];return e(Bu,{value:P,children:[t(ce,{isOpen:!0,width:te,minWidth:"777px",header:{icon:oe,titleBadges:Q,onClose:()=>{W(ku.Overview),R(null),N(!1),o()},actions:Z},footer:{actions:w?[{"data-id":"edit-source-btn-cancel",label:Ft.CANCEL,variant:be.Secondary,onClick:U},{"data-id":"edit-source-btn-save",label:Ft.SAVE,variant:be.Primary,onClick:V}]:[]},children:t(mt,{$padding:"4px 12px 12px",children:e(ee,{$gap:16,children:[!w&&z.length>1&&t(ve,{options:z,selected:$,setSelected:W}),(()=>{switch($){case ku.Overview:return w?t(Js,{}):t(Op,{source:A,onClickRollout:G,onClickRollback:K});case ku.Pods:return t(ju,{source:A,onClickRestartPod:M?(e,t)=>_({openFor:_h.Pod,podNamespace:e,podName:t}):void 0});case ku.PeerSources:return t(Wu,{source:A});case ku.Profiling:return t(yh,{source:A,onFlameFullscreenChange:N});case ku.Sampling:return t($h,{source:A,onRedirectToSampling:X});case ku.Debug:return t(Zu,{source:A});default:return null}})()]})})}),t(yr,{target:"source",action:"uninstrument",isOpen:k,onClose:()=>E(!1),onApprove:j}),t(Qe,{isOpen:D.openFor===_h.Workload,title:J.title,description:J.description,onClose:Y,denyButton:{label:"Go back",variant:be.Secondary,onClick:Y},approveButton:{label:Ft.CONFIRM,variant:be.Primary,onClick:q}}),t(yr,{target:"pod",action:"restart",description:et.ROLLOUT_RESTART_WORKLOADS_DESCRIPTION,isOpen:D.openFor===_h.Pod,onClose:Y,onApprove:q,overrideApproveButtonLabel:et.DELETE_POD_TO_RESTART})]})},Bh=b.div`
839
+ `,Lh=({source:e,onRedirectToSampling:o})=>t(Xt,{bgTint:"1000",richTitle:{title:et.CONTAINERS,badge:{label:e.containers?.length??0}},children:e.containers?.map(e=>t(zh,{container:e,onRedirectToSampling:o},e.containerName))});var Fh;(e=>{e.All="all",e.Noisy="noisy",e.HighlyRelevant="highly-relevant",e.CostReduction="cost-reduction"})(Fh||(Fh={}));const Mh=e=>"noisy"===e.type?T(e.rule,"source"):"highlyRelevant"===e.type?k(e.rule,"source"):"costReduction"===e.type?E(e.rule,"source"):[],zh=({container:o,onRedirectToSampling:n})=>{const[i,l]=s(Fh.All),r=ho(e=>e.setPendingViewSamplingRule),c=o.agentConfig?.traces?.headSampling?.noisyOperations??[],d=a(()=>(o.collectorConfig?.tailSampling?.noisyOperations??[]).map(e=>({type:"noisy",rule:e})),[o.agentConfig?.traces?.headSampling?.noisyOperations]),p=a(()=>(o.collectorConfig?.tailSampling?.highlyRelevantOperations??[]).map(e=>({type:"highlyRelevant",rule:e})),[o.collectorConfig?.tailSampling?.highlyRelevantOperations]),u=a(()=>(o.collectorConfig?.tailSampling?.costReductionRules??[]).map(e=>({type:"costReduction",rule:e})),[o.collectorConfig?.tailSampling?.costReductionRules]),h=a(()=>i===Fh.Noisy?d:i===Fh.HighlyRelevant?p:i===Fh.CostReduction?u:[...d,...p,...u],[i,p,u]),m=d.length+p.length+u.length,g=a(()=>(e,t)=>{r({ruleId:e,category:t}),n()},[n,r]),f=t(Dh,{children:t(ge,{"data-id":"sampling-container-create-rule",variant:be.Secondary,size:fe.S,label:Po,rightIcon:Na,onClick:e=>{e.stopPropagation(),n()}})});return t(_h,{children:e(Xt,{bgTint:"900",richTitle:{title:o.containerName},renderOnRightSide:f,withCollapse:!0,collapseIsDefaultOpen:!0,children:[c.length?e(Xt,{bgTint:"800",richTitle:{title:et.HEAD_SAMPLING,badge:{label:c.length}},children:[t(pe,{size:he.XXS,children:et.NOISY_OPERATIONS}),t(ee,{$gap:4,children:c.map(e=>t(Rh,{name:e.name,summary:T(e),disabled:e.disabled,onJumpToRule:()=>g(e.ruleId,"noisy")},e.ruleId))})]}):t(Ph,{children:t(pe,{size:he.XS,color:ue.Secondary,children:et.HEAD_SAMPLING})}),m?e(Xt,{bgTint:"800",richTitle:{title:et.TAIL_SAMPLING,badge:{label:m}},children:[t(ve,{options:(b=d.length,v=p.length,y=u.length,[{value:Fh.All,label:"All",badge:{label:b+v+y,textSize:he.XXXS}},{value:Fh.Noisy,label:et.NOISY_OPERATIONS,badge:{label:b,textSize:he.XXXS}},{value:Fh.HighlyRelevant,label:et.HIGHLY_RELEVANT_OPERATIONS,badge:{label:v,textSize:he.XXXS}},{value:Fh.CostReduction,label:et.COST_REDUCTION_OPERATIONS,badge:{label:y,textSize:he.XXXS}}]),selected:i,setSelected:l}),t(ee,{$gap:4,children:h.length?h.map(e=>t(Rh,{name:e.rule.name,summary:Mh(e),disabled:e.rule.disabled,onJumpToRule:()=>g(e.rule.ruleId,e.type)},e.rule.ruleId)):t(Re,{title:`No ${i===Fh.All?`${Fh.Noisy}, ${Fh.HighlyRelevant} and ${Fh.CostReduction}`:i} operations`})})]}):t(Ph,{children:t(pe,{size:he.XS,color:ue.Secondary,children:et.TAIL_SAMPLING})})]})});var b,v,y},Bh=[yo.Deployment,yo.StatefulSet,yo.DaemonSet,yo.DeploymentConfig,yo.Rollout,yo.Pod];var Xh;(e=>{e.Workload="Workload",e.Pod="Pod"})(Xh||(Xh={}));const Uh=e=>!!e&&io(e.status)===Fe.Error,Vh=e=>Uh(e.healthStatus),Hh=e=>Uh(e.odigosHealthStatus)||(e.processes??[]).some(Vh),jh=e=>Uh(e.agentInjectedStatus)||Uh(e.odigosHealthStatus)||(e.containers??[]).some(Hh),Gh=({onClose:o,sourceId:n,onRedirectToSampling:c})=>{const d=v(),{isVm:p,isConnector:u,isK8s:h}=S(),{sourcesApi:m,configApi:g}=Ll(),{selectedStreamName:f}=tt(),{genericForm:b,loadSource:y,validateFormData:C}=Bl(),{data:x}=g.useEffectiveConfig(),[w,T]=s(!1),[k,E]=s(!1),[I,N]=s(!1),[$,O]=s(Ep.Overview),[A,R]=s(null),[D,_]=s({openFor:null}),P=(()=>{const[e,t]=s(null),o=r(e=>{t({tab:Ep.Pods,podName:e.podName})},[]),n=r((e,o)=>{t({tab:Ep.Pods,podName:e.podName,containerName:o.containerName})},[]),i=r((e,o,n)=>{const i=Rp({identifyingAttributes:n.identifyingAttributes});t({tab:Ep.Pods,podName:e.podName,containerName:o.containerName,processPid:i})},[]),l=r(()=>t(null),[]);return a(()=>({jumpToTarget:e,jumpToPod:o,jumpToContainer:n,jumpToProcess:i,clearJumpToTarget:l}),[e,o,n,i,l])})();i(()=>{P.jumpToTarget&&O(P.jumpToTarget.tab)},[P.jumpToTarget]),i(()=>{A&&JSON.stringify(mo(n))!==JSON.stringify(mo(A))&&R(null)},[n,A]);const L=l(!1),F=r(async()=>R(await m.fetchById(n)||null),[n,m]);i(()=>{if(L.current||(F(),L.current=!0),!w){const e=setInterval(()=>F(),3e3);return()=>clearInterval(e)}},[F,w]),i(()=>{A&&y(A)},[A]);const M=A&&Bh.includes(A.id.kind),z=a(()=>{const e=[],o=(A?.pods??[]).some(jh),n=(i=A,(i?.containers??[]).some(e=>(e.instrumentations??[]).some(e=>!1===e.healthy)));var i;const a=e=>t(il,{...e,fill:d.v2.colors.red[500]});return e.push({value:Ep.Overview,label:et.OVERVIEW}),h?(e.push({value:Ep.Pods,label:et.PODS,icon:o?a:void 0}),e.push({value:Ep.Libraries,label:et.LIBRARIES,icon:n?a:void 0}),e.push({value:Ep.PeerSources,label:et.PEER_SOURCES}),x?.profiling?.enabled&&e.push({value:Ep.Profiling,label:et.PROFILING}),e.push({value:Ep.Sampling,label:et.SAMPLING}),e.push({value:Ep.Debug,label:et.DEBUG}),e):e},[h,x,A?.pods,d]),B=r(()=>T(!0),[]),X=a(()=>()=>{o(),c()},[o,c]),U=r(()=>{A&&y(A),T(!1)},[A]),V=r(async()=>{if(!A||!b)return;const{errorMessage:e,preparedFormData:t}=C();if(e)return;const o=t.otelServiceName!==A.id.name?t.otelServiceName:"";await m.update(n,{...t,otelServiceName:o}),T(!1)},[A,b,C,n,m]),H=r(()=>E(!0),[]),j=r(async()=>{A&&(await m.persistV2({[Rt]:[{namespace:A.id.namespace,name:A.id.name,kind:A.id.kind,region:A.id.region??"",selected:!1,currentStreamName:f}]}),E(!1),o())},[A,m,f,o]),G=r(()=>{_({openFor:Xh.Workload})},[]),W=r(e=>{O(e),P.clearJumpToTarget()},[P]),K=r(async()=>{await m.recoverFromRollback(n)},[m,n]),Y=r(()=>_({openFor:null}),[]),q=r(async()=>{D.openFor===Xh.Workload?await m.restartWorkloads([n]):D.openFor===Xh.Pod&&D.podNamespace&&D.podName&&await m.restartPod(D.podNamespace,D.podName),Y()},[D,m,n,Y]),J=a(()=>{const{kind:e,name:t}=n;return{title:`Rollout ${e}`,description:`Are you sure you want to rollout the ${e.toLowerCase()} "${t}"?`}},[n]),Z=a(()=>{const e=[];return w||$===Ep.Overview&&(e.push({id:"edit-source-btn-edit",label:Ft.EDIT,icon:_a,active:w,onClick:B}),h&&M&&e.push({id:"edit-source-btn-restart",label:et.ROLLOUT,icon:dl,onClick:G}),e.push({id:"edit-source-btn-delete",label:Ft.UNINSTRUMENT,icon:Ia,color:d.v2.colors.red[500],active:k,onClick:H})),e},[$,w,k,h,M,B,G,H,d]),Q=a(()=>{if(!A)return[];const e=[],t={backgroundColor:"transparent",textSize:he.S};return e.push({...t,label:A.id.name,leftIcon:h?nl:void 0}),A.serviceName&&A.serviceName!==A.id.name&&e.push({...t,label:A.serviceName,leftIcon:ol,textColor:d.v2.colors.silver[200]}),e},[A,d,h]);if(!A)return t(ce,{isOpen:!0,children:t(ft,{$height:"80vh",children:t(St,{withSpinner:!0})})});const te=$===Ep.Profiling?I?"95vw":"fit-content":w?void 0:"60vw",oe=p?vl:u?Ka:Lo(A.containers)[0];return e(Xp,{value:P,children:[t(ce,{isOpen:!0,width:te,minWidth:"777px",header:{icon:oe,titleBadges:Q,onClose:()=>{W(Ep.Overview),R(null),N(!1),o()},actions:Z},footer:{actions:w?[{"data-id":"edit-source-btn-cancel",label:Ft.CANCEL,variant:be.Secondary,onClick:U},{"data-id":"edit-source-btn-save",label:Ft.SAVE,variant:be.Primary,onClick:V}]:[]},children:t(mt,{$padding:"4px 12px 12px",children:e(ee,{$gap:16,children:[!w&&z.length>1&&t(ve,{options:z,selected:$,setSelected:W}),(()=>{switch($){case Ep.Overview:return w?t(Zs,{}):t(Lu,{source:A,onClickRollout:G,onClickRollback:K});case Ep.Pods:return t(Gp,{source:A,onClickRestartPod:M?(e,t)=>_({openFor:Xh.Pod,podNamespace:e,podName:t}):void 0});case Ep.Libraries:return t(Fu,{source:A});case Ep.PeerSources:return t(Kp,{source:A});case Ep.Profiling:return t(Eh,{source:A,onFlameFullscreenChange:N});case Ep.Sampling:return t(Lh,{source:A,onRedirectToSampling:X});case Ep.Debug:return t(Qp,{source:A});default:return null}})()]})})}),t(Cr,{target:"source",action:"uninstrument",isOpen:k,onClose:()=>E(!1),onApprove:j}),t(Qe,{isOpen:D.openFor===Xh.Workload,title:J.title,description:J.description,onClose:Y,denyButton:{label:"Go back",variant:be.Secondary,onClick:Y},approveButton:{label:Ft.CONFIRM,variant:be.Primary,onClick:q}}),t(Cr,{target:"pod",action:"restart",description:et.ROLLOUT_RESTART_WORKLOADS_DESCRIPTION,isOpen:D.openFor===Xh.Pod,onClose:Y,onApprove:q,overrideApproveButtonLabel:et.DELETE_POD_TO_RESTART})]})},Wh=b.div`
829
840
  display: flex;
830
841
  align-items: center;
831
842
  gap: 8px;
@@ -835,9 +846,9 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import n,{useEff
835
846
  &:hover {
836
847
  background-color: ${({theme:e})=>e.v2.colors.silver[800]};
837
848
  }
838
- `,Xh=b.div`
849
+ `,Kh=b.div`
839
850
  flex: 1;
840
- `,Uh=({onClick:o})=>{const n=v().v2.colors.red[500];return e(Bh,{"data-id":"sampling-view-btn-delete",onClick:o,children:[t(ue,{size:he.XS,weight:500,color:n,children:zo}),t(Ea,{size:16,fill:n})]})};const Vh={[Xl.EditAutoNoisy]:{title:Qo,subTitle:Zo,cancelId:"sampling-edit-auto-rule-btn-cancel",saveId:"sampling-edit-auto-rule-btn-save"},[Xl.EditAutoCostReduction]:{title:Jo,subTitle:qo,cancelId:"sampling-edit-cost-reduction-auto-rule-btn-cancel",saveId:"sampling-edit-cost-reduction-auto-rule-btn-save"},[Xl.EditAutoHighlyRelevant]:{title:Yo,subTitle:Ko,cancelId:"sampling-edit-highly-relevant-auto-rule-btn-cancel",saveId:"sampling-edit-highly-relevant-auto-rule-btn-save"}},Hh=({isOpen:e,title:o,subTitle:n,onClose:i,footer:a,renderBody:l})=>t(ce,{isOpen:e,width:tn,header:{icon:vl,title:o,subTitle:n,onClose:i},footer:a,children:l?l():t(mt,{$padding:"12px",children:t(nc,{})})}),jh=({isOpen:n,onClose:l,onSubmit:c,validateForm:d,onNavigateToDuplicate:u})=>{const{category:p,formData:h,resetForm:m,duplicateWarning:g,setDuplicateWarning:f}=Bl(Xl.Create),[b,v]=s(!1);i(()=>{n&&(m(),v(!1))},[n]);const y=r(()=>{v(!1),c(h)},[h,c]),C=r(()=>{if(d){const e=d(h);if(e)return void f(e)}((e,t)=>JSON.stringify(e)===JSON.stringify(I(t)))(h,p)?v(!0):y()},[h,p,d,f,y]),S=a(()=>b?((e,t)=>{switch(e){case"noisy":return T(O(t));case"highlyRelevant":return k($(t));case"costReduction":return E(N(t))}})(p,h):[],[b,p,h]),x={note:g?{status:Fe.Warning,message:g.message,action:u?{"data-id":"sampling-create-btn-view-duplicate",label:"View rule",onClick:()=>u(g.ruleId)}:void 0}:void 0,actions:[{"data-id":"sampling-create-btn-cancel",label:Lo,variant:be.Secondary,size:fe.S,onClick:l},{"data-id":"sampling-create-btn-submit",label:_o,variant:be.Primary,size:fe.S,onClick:C,disabled:!!g}]};return e(o,{children:[t(Hh,{isOpen:n,title:Vo[p],subTitle:Bo[p],onClose:l,footer:x}),t(Qe,{isOpen:b,title:Go,description:jo,onClose:()=>v(!1),denyButton:{"data-id":"sampling-create-default-continue-editing",label:Ho,variant:be.Secondary,onClick:()=>v(!1)},approveButton:{"data-id":"sampling-create-default-confirm",label:_o,variant:be.Primary,onClick:y},children:e(ee,{$gap:8,$alignItems:"flex-start",style:{width:"100%"},children:[t(ue,{size:he.XS,weight:500,color:pe.Secondary,children:Wo}),t("div",{style:{width:"100%"},children:t(rr,{summary:S})})]})})]})},Gh=({onClose:n,onDelete:i,onSaveEdit:l,validateForm:s,onNavigateToDuplicate:c})=>{const{data:d,isEditing:u,formData:p,handleEdit:h,handleCancelEdit:m,duplicateWarning:g,setDuplicateWarning:f}=Bl(Xl.View),b=d?.rule.name||Uo,v=u&&d?Xo[d.category]:`${b} preview`,y=r(()=>{if(d&&u){if(s){const e=s(p);if(e)return void f(e)}l(p,d.rule.ruleId,d.samplingId),m()}},[d,u,p,l,s,f,m]),C=r(()=>{d&&i(d.rule.ruleId,d.samplingId)},[d,i]),S=a(()=>{if(!d)return;const i=g?{message:g.message,onViewRule:c?()=>c(g.ruleId):void 0}:null;return function(n){if(n.isEditing){const{onCancelEdit:i,onSave:a,onDelete:l,duplicateWarning:r}=n;return{children:e(o,{children:[t(Uh,{onClick:l}),r&&t(Le,{status:Fe.Warning,message:r.message,action:r.onViewRule?{"data-id":"sampling-view-edit-btn-view-duplicate",label:"View rule",onClick:r.onViewRule}:void 0}),t(Xh,{}),t(ge,{"data-id":"sampling-view-edit-btn-cancel",label:Lo,variant:be.Secondary,size:fe.S,onClick:i}),t(ge,{"data-id":"sampling-view-edit-btn-save",label:Fo,variant:be.Primary,size:fe.S,onClick:a,disabled:!!r})]})}}const{onDelete:i,onCancel:a,onEdit:l}=n;return{children:e(o,{children:[t(Uh,{onClick:i}),t(Xh,{}),t(ge,{"data-id":"sampling-view-btn-cancel",label:Lo,variant:be.Secondary,size:fe.S,onClick:a}),t(ge,{"data-id":"sampling-view-btn-edit",label:Mo,variant:be.Primary,size:fe.S,onClick:l})]})}}(u?{isEditing:!0,onCancelEdit:m,onSave:y,onDelete:C,duplicateWarning:i}:{isEditing:!1,onDelete:C,onCancel:n,onEdit:h})},[d,u,g,m,y,C,h,n,c]);return t(Hh,{isOpen:!!d,title:v,subTitle:d?Bo[d.category]:"",onClose:n,footer:S})},Wh=({isOpen:e,onClose:o,onSave:n})=>{const{localEnabled:i,resolvedPercentage:a}=Bl(Xl.EditAutoNoisy),l=r(()=>n(i,a),[n,i,a]);return t(qh,{formType:Xl.EditAutoNoisy,isOpen:e,onClose:o,onSave:l})},Kh=({isOpen:e,onClose:o,onSave:n})=>{const{localEnabled:i,resolvedPercentage:a}=Bl(Xl.EditAutoCostReduction),l=r(()=>n(i,a),[n,i,a]);return t(qh,{formType:Xl.EditAutoCostReduction,isOpen:e,onClose:o,onSave:l})},Yh=({isOpen:e,onClose:o,onSave:n})=>{const{localEnabled:i}=Bl(Xl.EditAutoHighlyRelevant),a=r(()=>n(i),[n,i]);return t(qh,{formType:Xl.EditAutoHighlyRelevant,isOpen:e,onClose:o,onSave:a})},qh=({formType:e,isOpen:o,onClose:n,onSave:i})=>{const a=Vh[e];return t(Hh,{isOpen:o,title:a.title,subTitle:a.subTitle,onClose:n,footer:{actions:[{"data-id":a.cancelId,label:Lo,variant:be.Secondary,size:fe.S,onClick:n},{"data-id":a.saveId,label:en,variant:be.Primary,size:fe.S,onClick:i}]}})},Jh=e=>{switch(e.formType){case Xl.Create:return t(Kl,{formType:Xl.Create,category:e.category,sourceOptions:e.sourceOptions,namespaceOptions:e.namespaceOptions,children:t(jh,{...e})});case Xl.View:return t(Kl,{formType:Xl.View,data:e.data,defaultEditMode:e.defaultEditMode,sourceOptions:e.sourceOptions,namespaceOptions:e.namespaceOptions,children:t(Gh,{...e})});case Xl.EditAutoNoisy:return t(Kl,{formType:Xl.EditAutoNoisy,enabled:e.enabled,keepPercentage:e.keepPercentage,children:t(Wh,{...e})});case Xl.EditAutoCostReduction:return t(Kl,{formType:Xl.EditAutoCostReduction,enabled:e.enabled,dropPercentage:e.dropPercentage,children:t(Kh,{...e})});case Xl.EditAutoHighlyRelevant:return t(Kl,{formType:Xl.EditAutoHighlyRelevant,enabled:e.enabled,children:t(Yh,{...e})})}},Zh=({token:n,isLoading:i,isEditing:a,onEdit:l,onCancel:r,onSave:s,formData:c,handleFormChange:d,handleErrorChange:u,formErrors:p})=>{const{CopyButton:h}=Pt(),m=!a||i||!c.newToken;return on({key:"Enter",active:!m},s),e(me,a?{$justifyContent:"space-between",$alignItems:"flex-start",$gap:12,children:[t(Te,{type:"password",value:c.newToken,onChange:e=>{d("newToken",e.target.value),u("newToken",void 0)},width:"430px",autoFocus:!0,errorMessage:p.newToken}),t(me,{$margin:i?"8px 0 0 0":"2px 0 0 0",$alignItems:"center",children:i?t(St,{title:"Saving...",withGradient:!0}):e(o,{children:[t(ge,{variant:be.Secondary,size:fe.S,leftIcon:Ua,onClick:r,disabled:i}),t(ge,{variant:be.Primary,size:fe.S,leftIcon:Xa,onClick:s,disabled:m})]})})]}:{$justifyContent:"space-between",$gap:12,children:[t(ue,{size:he.XS,children:new Array(55).fill("•").join("")}),e(me,{$alignItems:"center",$justifyContent:"space-between",children:[t(h,{value:n}),t(yt,{icon:Da,onClick:l})]})]})},Qh=({expiresAt:e,callbackValid:o,callbackExpired:n})=>{const{formatTimeAgo:l}=Qt(),r=a(()=>l(e),[e,l]),s=a(()=>new Date(e).toDateString().split(" ").slice(1).join(" "),[e]),c=a(()=>nn(e,0)?Fe.Error:nn(e,2592e6)?Fe.Warning:Fe.Success,[e]),d=a(()=>c===Fe.Success?Xa:c===Fe.Warning?yl:nl,[c]);return i(()=>{c===Fe.Success?o():c===Fe.Error&&n()},[c]),t($e,{text:s,children:t(qe,{leftIcon:d,label:r,status:c,invertColors:!0,useSecondaryTone:!0})})},em=b.div`
851
+ `,Yh=({onClick:o})=>{const n=v().v2.colors.red[500];return e(Wh,{"data-id":"sampling-view-btn-delete",onClick:o,children:[t(pe,{size:he.XS,weight:500,color:n,children:Bo}),t(Ia,{size:16,fill:n})]})};const qh={[Ul.EditAutoNoisy]:{title:en,subTitle:Qo,cancelId:"sampling-edit-auto-rule-btn-cancel",saveId:"sampling-edit-auto-rule-btn-save"},[Ul.EditAutoCostReduction]:{title:Zo,subTitle:Jo,cancelId:"sampling-edit-cost-reduction-auto-rule-btn-cancel",saveId:"sampling-edit-cost-reduction-auto-rule-btn-save"},[Ul.EditAutoHighlyRelevant]:{title:qo,subTitle:Yo,cancelId:"sampling-edit-highly-relevant-auto-rule-btn-cancel",saveId:"sampling-edit-highly-relevant-auto-rule-btn-save"}},Jh=({isOpen:e,title:o,subTitle:n,onClose:i,footer:a,renderBody:l})=>t(ce,{isOpen:e,width:on,header:{icon:yl,title:o,subTitle:n,onClose:i},footer:a,children:l?l():t(mt,{$padding:"12px",children:t(ic,{})})}),Zh=({isOpen:n,onClose:l,onSubmit:c,validateForm:d,onNavigateToDuplicate:p})=>{const{category:u,formData:h,resetForm:m,duplicateWarning:g,setDuplicateWarning:f}=Xl(Ul.Create),[b,v]=s(!1);i(()=>{n&&(m(),v(!1))},[n]);const y=r(()=>{v(!1),c(h)},[h,c]),C=r(()=>{if(d){const e=d(h);if(e)return void f(e)}((e,t)=>JSON.stringify(e)===JSON.stringify(I(t)))(h,u)?v(!0):y()},[h,u,d,f,y]),S=a(()=>b?((e,t)=>{switch(e){case"noisy":return T(O(t));case"highlyRelevant":return k($(t));case"costReduction":return E(N(t))}})(u,h):[],[b,u,h]),x={note:g?{status:Fe.Warning,message:g.message,action:p?{"data-id":"sampling-create-btn-view-duplicate",label:"View rule",onClick:()=>p(g.ruleId)}:void 0}:void 0,actions:[{"data-id":"sampling-create-btn-cancel",label:Fo,variant:be.Secondary,size:fe.S,onClick:l},{"data-id":"sampling-create-btn-submit",label:Po,variant:be.Primary,size:fe.S,onClick:C,disabled:!!g}]};return e(o,{children:[t(Jh,{isOpen:n,title:Ho[u],subTitle:Xo[u],onClose:l,footer:x}),t(Qe,{isOpen:b,title:Wo,description:Go,onClose:()=>v(!1),denyButton:{"data-id":"sampling-create-default-continue-editing",label:jo,variant:be.Secondary,onClick:()=>v(!1)},approveButton:{"data-id":"sampling-create-default-confirm",label:Po,variant:be.Primary,onClick:y},children:e(ee,{$gap:8,$alignItems:"flex-start",style:{width:"100%"},children:[t(pe,{size:he.XS,weight:500,color:ue.Secondary,children:Ko}),t("div",{style:{width:"100%"},children:t(sr,{summary:S})})]})})]})},Qh=({onClose:n,onDelete:i,onSaveEdit:l,validateForm:s,onNavigateToDuplicate:c})=>{const{data:d,isEditing:p,formData:u,handleEdit:h,handleCancelEdit:m,duplicateWarning:g,setDuplicateWarning:f}=Xl(Ul.View),b=d?.rule.name||Vo,v=p&&d?Uo[d.category]:`${b} preview`,y=r(()=>{if(d&&p){if(s){const e=s(u);if(e)return void f(e)}l(u,d.rule.ruleId,d.samplingId),m()}},[d,p,u,l,s,f,m]),C=r(()=>{d&&i(d.rule.ruleId,d.samplingId)},[d,i]),S=a(()=>{if(!d)return;const i=g?{message:g.message,onViewRule:c?()=>c(g.ruleId):void 0}:null;return function(n){if(n.isEditing){const{onCancelEdit:i,onSave:a,onDelete:l,duplicateWarning:r}=n;return{children:e(o,{children:[t(Yh,{onClick:l}),r&&t(Le,{status:Fe.Warning,message:r.message,action:r.onViewRule?{"data-id":"sampling-view-edit-btn-view-duplicate",label:"View rule",onClick:r.onViewRule}:void 0}),t(Kh,{}),t(ge,{"data-id":"sampling-view-edit-btn-cancel",label:Fo,variant:be.Secondary,size:fe.S,onClick:i}),t(ge,{"data-id":"sampling-view-edit-btn-save",label:Mo,variant:be.Primary,size:fe.S,onClick:a,disabled:!!r})]})}}const{onDelete:i,onCancel:a,onEdit:l}=n;return{children:e(o,{children:[t(Yh,{onClick:i}),t(Kh,{}),t(ge,{"data-id":"sampling-view-btn-cancel",label:Fo,variant:be.Secondary,size:fe.S,onClick:a}),t(ge,{"data-id":"sampling-view-btn-edit",label:zo,variant:be.Primary,size:fe.S,onClick:l})]})}}(p?{isEditing:!0,onCancelEdit:m,onSave:y,onDelete:C,duplicateWarning:i}:{isEditing:!1,onDelete:C,onCancel:n,onEdit:h})},[d,p,g,m,y,C,h,n,c]);return t(Jh,{isOpen:!!d,title:v,subTitle:d?Xo[d.category]:"",onClose:n,footer:S})},em=({isOpen:e,onClose:o,onSave:n})=>{const{localEnabled:i,resolvedPercentage:a}=Xl(Ul.EditAutoNoisy),l=r(()=>n(i,a),[n,i,a]);return t(nm,{formType:Ul.EditAutoNoisy,isOpen:e,onClose:o,onSave:l})},tm=({isOpen:e,onClose:o,onSave:n})=>{const{localEnabled:i,resolvedPercentage:a}=Xl(Ul.EditAutoCostReduction),l=r(()=>n(i,a),[n,i,a]);return t(nm,{formType:Ul.EditAutoCostReduction,isOpen:e,onClose:o,onSave:l})},om=({isOpen:e,onClose:o,onSave:n})=>{const{localEnabled:i}=Xl(Ul.EditAutoHighlyRelevant),a=r(()=>n(i),[n,i]);return t(nm,{formType:Ul.EditAutoHighlyRelevant,isOpen:e,onClose:o,onSave:a})},nm=({formType:e,isOpen:o,onClose:n,onSave:i})=>{const a=qh[e];return t(Jh,{isOpen:o,title:a.title,subTitle:a.subTitle,onClose:n,footer:{actions:[{"data-id":a.cancelId,label:Fo,variant:be.Secondary,size:fe.S,onClick:n},{"data-id":a.saveId,label:tn,variant:be.Primary,size:fe.S,onClick:i}]}})},im=e=>{switch(e.formType){case Ul.Create:return t(Yl,{formType:Ul.Create,category:e.category,sourceOptions:e.sourceOptions,namespaceOptions:e.namespaceOptions,children:t(Zh,{...e})});case Ul.View:return t(Yl,{formType:Ul.View,data:e.data,defaultEditMode:e.defaultEditMode,sourceOptions:e.sourceOptions,namespaceOptions:e.namespaceOptions,children:t(Qh,{...e})});case Ul.EditAutoNoisy:return t(Yl,{formType:Ul.EditAutoNoisy,enabled:e.enabled,keepPercentage:e.keepPercentage,children:t(em,{...e})});case Ul.EditAutoCostReduction:return t(Yl,{formType:Ul.EditAutoCostReduction,enabled:e.enabled,dropPercentage:e.dropPercentage,children:t(tm,{...e})});case Ul.EditAutoHighlyRelevant:return t(Yl,{formType:Ul.EditAutoHighlyRelevant,enabled:e.enabled,children:t(om,{...e})})}},am=({token:n,isLoading:i,isEditing:a,onEdit:l,onCancel:r,onSave:s,formData:c,handleFormChange:d,handleErrorChange:p,formErrors:u})=>{const{CopyButton:h}=Pt(),m=!a||i||!c.newToken;return nn({key:"Enter",active:!m},s),e(me,a?{$justifyContent:"space-between",$alignItems:"flex-start",$gap:12,children:[t(Te,{type:"password",value:c.newToken,onChange:e=>{d("newToken",e.target.value),p("newToken",void 0)},width:"430px",autoFocus:!0,errorMessage:u.newToken}),t(me,{$margin:i?"8px 0 0 0":"2px 0 0 0",$alignItems:"center",children:i?t(St,{title:"Saving...",withGradient:!0}):e(o,{children:[t(ge,{variant:be.Secondary,size:fe.S,leftIcon:Va,onClick:r,disabled:i}),t(ge,{variant:be.Primary,size:fe.S,leftIcon:Ua,onClick:s,disabled:m})]})})]}:{$justifyContent:"space-between",$gap:12,children:[t(pe,{size:he.XS,children:new Array(55).fill("•").join("")}),e(me,{$alignItems:"center",$justifyContent:"space-between",children:[t(h,{value:n}),t(yt,{icon:_a,onClick:l})]})]})},lm=({expiresAt:e,callbackValid:o,callbackExpired:n})=>{const{formatTimeAgo:l}=Qt(),r=a(()=>l(e),[e,l]),s=a(()=>new Date(e).toDateString().split(" ").slice(1).join(" "),[e]),c=a(()=>an(e,0)?Fe.Error:an(e,2592e6)?Fe.Warning:Fe.Success,[e]),d=a(()=>c===Fe.Success?Ua:c===Fe.Warning?Cl:il,[c]);return i(()=>{c===Fe.Success?o():c===Fe.Error&&n()},[c]),t($e,{text:s,children:t(qe,{leftIcon:d,label:r,status:c,invertColors:!0,useSecondaryTone:!0})})},rm=b.div`
841
852
  display: flex;
842
853
  flex-direction: column;
843
854
  gap: 12px;
@@ -845,7 +856,7 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import n,{useEff
845
856
  border-radius: 12px;
846
857
  border: 1px solid ${({theme:e,$isExpired:t})=>t?e.v2.colors.red[500]:e.v2.colors.silver[600]};
847
858
  background-color: ${({theme:e,$isExpired:t})=>t?e.v2.colors.red[1e3]:e.v2.colors.silver[800]};
848
- `,tm=({children:e})=>{const o=v();return t(ue,{size:he.XXXS,color:o.v2.colors.grey[150],children:e})},om=({token:o})=>{const{tokensApi:n}=Pl(),[i,a]=s(!1),[l,r]=s(!1),[c,d]=s(!1),{formData:u,handleFormChange:p,formErrors:h,handleErrorChange:m,resetFormData:g}=Ht({newToken:""});return t(dt,{richTitle:{icon:Cl,title:"Odigos Pro Token"},children:e(em,{$isExpired:c,children:[e(me,{$justifyContent:"space-between",children:[e(ee,{$gap:4,children:[t(tm,{children:"Issued for"}),t(ue,{size:he.XS,children:o.name||"N/A"})]}),e(ee,{$gap:4,children:[t(tm,{children:"Expiration"}),t(Qh,{expiresAt:o.expiresAt,callbackValid:()=>d(!1),callbackExpired:()=>d(!0)})]}),t(ee,{})]}),t(me,{children:e(ee,{children:[t(tm,{children:"Token"}),t(Zh,{token:o.token,newToken:u.newToken,isLoading:i,isEditing:l,onEdit:()=>r(!0),onCancel:()=>(r(!1),void p("newToken","")),onSave:()=>(async()=>{if(!n.updateToken)return;a(!0);const e=await n.updateToken(u.newToken.trim());a(!1),e?.error?m("newToken",e.error):(r(!1),g())})(),formData:u,handleFormChange:p,handleErrorChange:m,formErrors:h})]})})]})})},nm=b.div`
859
+ `,sm=({children:e})=>{const o=v();return t(pe,{size:he.XXXS,color:o.v2.colors.grey[150],children:e})},cm=({token:o})=>{const{tokensApi:n}=Ll(),[i,a]=s(!1),[l,r]=s(!1),[c,d]=s(!1),{formData:p,handleFormChange:u,formErrors:h,handleErrorChange:m,resetFormData:g}=Ht({newToken:""});return t(dt,{richTitle:{icon:Sl,title:"Odigos Pro Token"},children:e(rm,{$isExpired:c,children:[e(me,{$justifyContent:"space-between",children:[e(ee,{$gap:4,children:[t(sm,{children:"Issued for"}),t(pe,{size:he.XS,children:o.name||"N/A"})]}),e(ee,{$gap:4,children:[t(sm,{children:"Expiration"}),t(lm,{expiresAt:o.expiresAt,callbackValid:()=>d(!1),callbackExpired:()=>d(!0)})]}),t(ee,{})]}),t(me,{children:e(ee,{children:[t(sm,{children:"Token"}),t(am,{token:o.token,newToken:p.newToken,isLoading:i,isEditing:l,onEdit:()=>r(!0),onCancel:()=>(r(!1),void u("newToken","")),onSave:()=>(async()=>{if(!n.updateToken)return;a(!0);const e=await n.updateToken(p.newToken.trim());a(!1),e?.error?m("newToken",e.error):(r(!1),g())})(),formData:p,handleFormChange:u,handleErrorChange:m,formErrors:h})]})})]})})},dm=b.div`
849
860
  display: flex;
850
861
  flex-direction: column;
851
862
  align-items: center;
@@ -854,23 +865,23 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import n,{useEff
854
865
  padding: 12px 24px;
855
866
  border-radius: 8px;
856
867
  background-color: ${({theme:e})=>e.v2.colors.silver[800]};
857
- `,im=()=>{const{progress:o}=Ot(),{describeApi:n,namespacesApi:i}=Pl(),{items:a}=i.useNamespaces(),[l,r]=s(null),{formData:c,handleFormChange:d,resetFormData:u}=Ht({includeProfiles:!0,includeMetrics:!0,includeSourceWorkloads:!1,sourceWorkloadNamespaces:[]});return t(dt,{richTitle:{icon:Sl,title:"Diagnose"},children:l?e(nm,{children:[t(St,{title:"Creating file...",subTitle:"This may take a few moments. Do not refresh the page.",withGradient:!0,withSpinner:"number"==typeof o[Dt.DownloadingDiagnose]?.percentage,percentage:o[Dt.DownloadingDiagnose]?.percentage,withVisual:"number"!=typeof o[Dt.DownloadingDiagnose]?.percentage,visualIcon:gl,startedAt:l}),o[Dt.DownloadingDiagnose]?.list?.length&&t(ee,{$width:"100%",children:o[Dt.DownloadingDiagnose].list.map((o,n)=>e(me,{$gap:4,$alignItems:"center",children:[o.status===Fe.Success?t(Xa,{size:16}):o.status===Fe.Error?t(Ua,{size:16}):t(St,{withSpinnerOld:!0,scaleSpinnerOld:.7}),t(ue,{size:he.XXXS,color:pe.Secondary,children:o.label})]},`diagnose-item-${n}-${o.label}`))})]}):e(ee,{$gap:24,children:[t(ue,{size:he.XXS,color:pe.Secondary,children:"Download a tar.gz file with diagnostics from this cluster. Select which data to include before downloading, and share the file with the Odigos support team for troubleshooting."}),e(ee,{$gap:16,children:[e(me,{$gap:8,children:[t(oe,{label:"Profiles",value:c.includeProfiles,onChange:e=>d("includeProfiles",e),tooltip:"Note: Adds 30s to diagnose download time to collect Profiles"}),t(ue,{size:he.XXXS,color:pe.Secondary,children:"Include pprof profiles"})]}),e(me,{$gap:8,children:[t(oe,{label:"Metrics",value:c.includeMetrics,onChange:e=>d("includeMetrics",e)}),t(ue,{size:he.XXXS,color:pe.Secondary,children:"Include Prometheus metrics"})]}),e(me,{$gap:8,children:[t(oe,{label:"Source Workloads",value:c.includeSourceWorkloads,onChange:e=>{d("includeSourceWorkloads",e),e&&d("sourceWorkloadNamespaces",[])}}),t(ue,{size:he.XXXS,color:pe.Secondary,children:"Include workload and pod manifests for instrumented sources"})]})]}),t(an,{alignX:rn.Left,alignY:ln.Bottom,items:a.map(e=>({id:e.name,label:e.name,withCheckbox:!0})),selectedIds:c.sourceWorkloadNamespaces,setSelectedIds:e=>d("sourceWorkloadNamespaces",e),withMultiSelect:!0,withSearch:!0,fullWidth:!0,buttonProps:{label:(c.sourceWorkloadNamespaces.length?"Selected":"Select")+" Namespaces",variant:be.Secondary,disabled:c.includeSourceWorkloads,leftIcon:c.sourceWorkloadNamespaces.length?()=>t(qe,{label:c.sourceWorkloadNamespaces.length,status:Fe.Default}):void 0}}),t(me,{$justifyContent:"flex-end",children:t(ge,{label:"Download Diagnose",rightIcon:gl,variant:be.Primary,onClick:async()=>{n.downloadDiagnose&&(r(Date.now()),await n.downloadDiagnose(c),r(null),u())},disabled:null!==l})})]})})},am=()=>{const{platformType:e,version:o,tier:n}=S(),{describeApi:a}=Pl(),[l,r]=s(null);return i(()=>{a.fetchDescribeOdigos&&a.fetchDescribeOdigos().then(({data:e})=>r(e?.describeOdigos??null))},[]),t(dt,{richTitle:{icon:sl,title:"General Information"},children:t(Xt,{cellsPerRow:2,items:[{id:sn(),title:"Odigos Version",label:o},{id:sn(),title:`${e.toUpperCase()} Version`,label:l?.kubernetesVersion?.value||"-"},{id:sn(),title:"Installation Method",label:l?.installationMethod?.value||"-"},{id:sn(),title:"Tier",label:n}]})})},lm=({isOpen:o,onClose:n})=>{const{describeApi:i,tokensApi:a}=Pl(),l=a.useTokens().items[0];return e(ce,{isOpen:o,header:{icon:sl,title:"System Overview",onClose:n},children:[i.fetchDescribeOdigos&&t(am,{}),a.updateToken&&l&&t(om,{token:l}),i.downloadDiagnose&&t(im,{})]})},rm=({isOpen:n,onClose:i,onCloseEnd:a})=>{const{addDataStreams:l,setSelectedStreamName:s}=tt(),{dataStreamsApi:c}=Pl(),{requestSubmit:d}=Ml(),u=r(async e=>{c.create?await c.create(e):(l([e]),s(e.name)),i()},[c,l,s,i]),p=r(()=>d(u),[d,u]);return on({key:"Enter",active:n},p),e(o,{children:[t(Qe,{isOpen:n,onClose:i,onCloseEnd:a,title:et.NAME_YOUR_STREAM,description:et.STREAM_DESCRIPTION,approveButton:{"data-id":"add-stream-btn-done",label:Ft.DONE,variant:be.Primary,onClick:p},denyButton:{"data-id":"add-stream-btn-cancel",label:Ft.CANCEL,variant:be.Secondary,onClick:i},children:t(qs,{autoFocus:!0})}),t(Ys,{})]})},sm=({isOpen:n,onClose:a,onCloseEnd:l,dataStreamName:s})=>{const{dataStreamsApi:c}=Pl(),{genericForm:d,loadDataStream:u,requestSubmit:p}=Ml();i(()=>{n&&s&&u(s)},[n,s]);const h=!!d?.isFormDirty,m=r(async e=>{await c.update(s,e),a()},[c,s,a]),g=r(()=>p(m),[p,m]);return on({key:"Enter",active:n},g),e(o,{children:[t(Qe,{isOpen:n,onClose:a,onCloseEnd:l,title:et.RENAME_STREAM(s),description:et.STREAM_DESCRIPTION,approveButton:{"data-id":"edit-stream-btn-save",label:Ft.SAVE,variant:be.Primary,onClick:g,disabled:!h},denyButton:{"data-id":"edit-stream-btn-cancel",label:Ft.CANCEL,variant:be.Secondary,onClick:a},children:t(qs,{autoFocus:!0})}),t(Ys,{})]})},cm=({scale:o=1})=>e("svg",{width:742*o,height:533*o,viewBox:"0 0 742 533",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[t("path",{d:"M0 0H722C733.046 0 742 8.95431 742 20V513C742 524.046 733.046 533 722 533H0V0Z",fill:"url(#paint0_linear_1585_55266)"}),e("g",{clipPath:"url(#clip0_1585_55266)",children:[t("path",{opacity:"0.1",d:"M817.963 1364.02C1052.53 1129.46 1052.53 749.151 817.96 514.585C583.394 280.019 203.089 280.018 -31.4751 514.583C-266.039 749.147 -266.038 1129.45 -31.4725 1364.02C203.093 1598.58 583.398 1598.58 817.963 1364.02Z",fill:"url(#paint1_radial_1585_55266)"}),t("path",{opacity:"0.3",d:"M789.266 1335.32C1007.98 1116.61 1007.98 761.998 789.264 543.281C570.547 324.565 215.938 324.563 -2.7781 543.279C-221.494 761.995 -221.493 1116.6 -2.77577 1335.32C215.941 1554.04 570.55 1554.04 789.266 1335.32Z",fill:"url(#paint2_radial_1585_55266)"}),t("path",{opacity:"0.5",d:"M736.156 1282.21C925.539 1092.83 925.538 785.776 736.153 596.392C546.769 407.007 239.717 407.006 50.333 596.39C-139.05 785.773 -139.05 1092.83 50.3351 1282.21C239.72 1471.59 546.772 1471.6 736.156 1282.21Z",fill:"url(#paint3_radial_1585_55266)"}),t("path",{opacity:"0.7",d:"M628.365 1174.42C758.218 1044.57 758.217 834.036 628.364 704.182C498.51 574.329 287.977 574.328 158.124 704.181C28.2713 834.033 28.272 1044.57 158.125 1174.42C287.979 1304.27 498.512 1304.27 628.365 1174.42Z",fill:"url(#paint4_radial_1585_55266)"}),t("path",{opacity:"0.1",d:"M795.717 29.8993C1030.28 -204.665 1030.28 -584.97 795.714 -819.536C561.148 -1054.1 180.843 -1054.1 -53.7211 -819.539C-288.285 -584.974 -288.284 -204.669 -53.7185 29.8967C180.847 264.462 561.152 264.464 795.717 29.8993Z",fill:"url(#paint5_radial_1585_55266)"}),t("path",{opacity:"0.3",d:"M767.02 1.20219C985.736 -217.513 985.734 -572.123 767.017 -790.84C548.301 -1009.56 193.691 -1009.56 -25.0242 -790.842C-243.74 -572.126 -243.739 -217.517 -25.0219 1.19982C193.695 219.917 548.304 219.918 767.02 1.20219Z",fill:"url(#paint6_radial_1585_55266)"}),t("path",{opacity:"0.5",d:"M713.909 -51.908C903.293 -241.292 903.292 -548.344 713.907 -737.728C524.523 -927.113 217.47 -927.114 28.0869 -737.731C-161.297 -548.347 -161.296 -241.295 28.089 -51.91C217.474 137.475 524.526 137.476 713.909 -51.908Z",fill:"url(#paint7_radial_1585_55266)"}),t("path",{opacity:"0.7",d:"M606.119 -159.699C735.972 -289.552 735.971 -500.085 606.118 -629.939C476.264 -759.792 265.731 -759.793 135.878 -629.94C6.0252 -500.088 6.02586 -289.554 135.879 -159.701C265.733 -29.8472 476.266 -29.8465 606.119 -159.699Z",fill:"url(#paint8_radial_1585_55266)"})]}),e("defs",{children:[e("linearGradient",{id:"paint0_linear_1585_55266",x1:"371",y1:"0",x2:"371",y2:"533",gradientUnits:"userSpaceOnUse",children:[t("stop",{offset:"0.028197",stopColor:"#0B0517"}),t("stop",{offset:"1",stopColor:"#190D31"})]}),e("radialGradient",{id:"paint1_radial_1585_55266",cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",gradientTransform:"translate(334.074 991.405) rotate(-45) scale(599.732 599.736)",children:[t("stop",{stopColor:"#7C3BFF",stopOpacity:"0.1"}),t("stop",{offset:"0.41",stopColor:"#7C3BFF",stopOpacity:"0.11"}),t("stop",{offset:"0.56",stopColor:"#7C3BFF",stopOpacity:"0.13"}),t("stop",{offset:"0.67",stopColor:"#7C3BFF",stopOpacity:"0.18"}),t("stop",{offset:"0.75",stopColor:"#7C3BFF",stopOpacity:"0.25"}),t("stop",{offset:"0.83",stopColor:"#7C3BFF",stopOpacity:"0.33"}),t("stop",{offset:"0.89",stopColor:"#7C3BFF",stopOpacity:"0.44"}),t("stop",{offset:"0.95",stopColor:"#7C3BFF",stopOpacity:"0.56"}),t("stop",{offset:"1",stopColor:"#7C3BFF",stopOpacity:"0.7"})]}),e("radialGradient",{id:"paint2_radial_1585_55266",cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",gradientTransform:"translate(368.968 957.913) rotate(-45) scale(560.978 560.981)",children:[t("stop",{stopColor:"#7C3BFF",stopOpacity:"0.1"}),t("stop",{offset:"0.38",stopColor:"#7C3BFF",stopOpacity:"0.11"}),t("stop",{offset:"0.52",stopColor:"#7C3BFF",stopOpacity:"0.13"}),t("stop",{offset:"0.62",stopColor:"#7C3BFF",stopOpacity:"0.18"}),t("stop",{offset:"0.69",stopColor:"#7C3BFF",stopOpacity:"0.25"}),t("stop",{offset:"0.76",stopColor:"#7C3BFF",stopOpacity:"0.33"}),t("stop",{offset:"0.82",stopColor:"#7C3BFF",stopOpacity:"0.44"}),t("stop",{offset:"0.88",stopColor:"#7C3BFF",stopOpacity:"0.57"}),t("stop",{offset:"0.93",stopColor:"#7C3BFF",stopOpacity:"0.72"}),t("stop",{offset:"0.97",stopColor:"#7C3BFF",stopOpacity:"0.88"}),t("stop",{offset:"1",stopColor:"#7C3BFF"})]}),e("radialGradient",{id:"paint3_radial_1585_55266",cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",gradientTransform:"translate(351.265 971.313) rotate(-45) scale(484.947 484.95)",children:[t("stop",{stopColor:"#7C3BFF",stopOpacity:"0.1"}),t("stop",{offset:"0.31",stopColor:"#7C3BFF",stopOpacity:"0.11"}),t("stop",{offset:"0.45",stopColor:"#7C3BFF",stopOpacity:"0.14"}),t("stop",{offset:"0.56",stopColor:"#7C3BFF",stopOpacity:"0.19"}),t("stop",{offset:"0.65",stopColor:"#7C3BFF",stopOpacity:"0.26"}),t("stop",{offset:"0.73",stopColor:"#7C3BFF",stopOpacity:"0.35"}),t("stop",{offset:"0.8",stopColor:"#7C3BFF",stopOpacity:"0.46"}),t("stop",{offset:"0.86",stopColor:"#7C3BFF",stopOpacity:"0.6"}),t("stop",{offset:"0.92",stopColor:"#7C3BFF",stopOpacity:"0.76"}),t("stop",{offset:"0.98",stopColor:"#7C3BFF",stopOpacity:"0.93"}),t("stop",{offset:"1",stopColor:"#7C3BFF"})]}),e("radialGradient",{id:"paint4_radial_1585_55266",cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",gradientTransform:"translate(362.239 963.064) rotate(-45) scale(332.216 332.218)",children:[t("stop",{stopColor:"#7C3BFF",stopOpacity:"0.1"}),t("stop",{offset:"0.31",stopColor:"#7C3BFF",stopOpacity:"0.11"}),t("stop",{offset:"0.45",stopColor:"#7C3BFF",stopOpacity:"0.14"}),t("stop",{offset:"0.56",stopColor:"#7C3BFF",stopOpacity:"0.19"}),t("stop",{offset:"0.65",stopColor:"#7C3BFF",stopOpacity:"0.26"}),t("stop",{offset:"0.73",stopColor:"#7C3BFF",stopOpacity:"0.35"}),t("stop",{offset:"0.8",stopColor:"#7C3BFF",stopOpacity:"0.46"}),t("stop",{offset:"0.86",stopColor:"#7C3BFF",stopOpacity:"0.6"}),t("stop",{offset:"0.92",stopColor:"#7C3BFF",stopOpacity:"0.76"}),t("stop",{offset:"0.98",stopColor:"#7C3BFF",stopOpacity:"0.93"}),t("stop",{offset:"1",stopColor:"#7C3BFF"})]}),e("radialGradient",{id:"paint5_radial_1585_55266",cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",gradientTransform:"translate(311.828 -342.716) rotate(-45) scale(599.733 599.736)",children:[t("stop",{stopColor:"#7C3BFF",stopOpacity:"0.1"}),t("stop",{offset:"0.41",stopColor:"#7C3BFF",stopOpacity:"0.11"}),t("stop",{offset:"0.56",stopColor:"#7C3BFF",stopOpacity:"0.13"}),t("stop",{offset:"0.67",stopColor:"#7C3BFF",stopOpacity:"0.18"}),t("stop",{offset:"0.75",stopColor:"#7C3BFF",stopOpacity:"0.25"}),t("stop",{offset:"0.83",stopColor:"#7C3BFF",stopOpacity:"0.33"}),t("stop",{offset:"0.89",stopColor:"#7C3BFF",stopOpacity:"0.44"}),t("stop",{offset:"0.95",stopColor:"#7C3BFF",stopOpacity:"0.56"}),t("stop",{offset:"1",stopColor:"#7C3BFF",stopOpacity:"0.7"})]}),e("radialGradient",{id:"paint6_radial_1585_55266",cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",gradientTransform:"translate(346.722 -376.208) rotate(-45) scale(560.977 560.981)",children:[t("stop",{stopColor:"#7C3BFF",stopOpacity:"0.1"}),t("stop",{offset:"0.38",stopColor:"#7C3BFF",stopOpacity:"0.11"}),t("stop",{offset:"0.52",stopColor:"#7C3BFF",stopOpacity:"0.13"}),t("stop",{offset:"0.62",stopColor:"#7C3BFF",stopOpacity:"0.18"}),t("stop",{offset:"0.69",stopColor:"#7C3BFF",stopOpacity:"0.25"}),t("stop",{offset:"0.76",stopColor:"#7C3BFF",stopOpacity:"0.33"}),t("stop",{offset:"0.82",stopColor:"#7C3BFF",stopOpacity:"0.44"}),t("stop",{offset:"0.88",stopColor:"#7C3BFF",stopOpacity:"0.57"}),t("stop",{offset:"0.93",stopColor:"#7C3BFF",stopOpacity:"0.72"}),t("stop",{offset:"0.97",stopColor:"#7C3BFF",stopOpacity:"0.88"}),t("stop",{offset:"1",stopColor:"#7C3BFF"})]}),e("radialGradient",{id:"paint7_radial_1585_55266",cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",gradientTransform:"translate(329.019 -362.807) rotate(-45) scale(484.947 484.95)",children:[t("stop",{stopColor:"#7C3BFF",stopOpacity:"0.1"}),t("stop",{offset:"0.31",stopColor:"#7C3BFF",stopOpacity:"0.11"}),t("stop",{offset:"0.45",stopColor:"#7C3BFF",stopOpacity:"0.14"}),t("stop",{offset:"0.56",stopColor:"#7C3BFF",stopOpacity:"0.19"}),t("stop",{offset:"0.65",stopColor:"#7C3BFF",stopOpacity:"0.26"}),t("stop",{offset:"0.73",stopColor:"#7C3BFF",stopOpacity:"0.35"}),t("stop",{offset:"0.8",stopColor:"#7C3BFF",stopOpacity:"0.46"}),t("stop",{offset:"0.86",stopColor:"#7C3BFF",stopOpacity:"0.6"}),t("stop",{offset:"0.92",stopColor:"#7C3BFF",stopOpacity:"0.76"}),t("stop",{offset:"0.98",stopColor:"#7C3BFF",stopOpacity:"0.93"}),t("stop",{offset:"1",stopColor:"#7C3BFF"})]}),e("radialGradient",{id:"paint8_radial_1585_55266",cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",gradientTransform:"translate(339.993 -371.057) rotate(-45) scale(332.216 332.218)",children:[t("stop",{stopColor:"#7C3BFF",stopOpacity:"0.1"}),t("stop",{offset:"0.31",stopColor:"#7C3BFF",stopOpacity:"0.11"}),t("stop",{offset:"0.45",stopColor:"#7C3BFF",stopOpacity:"0.14"}),t("stop",{offset:"0.56",stopColor:"#7C3BFF",stopOpacity:"0.19"}),t("stop",{offset:"0.65",stopColor:"#7C3BFF",stopOpacity:"0.26"}),t("stop",{offset:"0.73",stopColor:"#7C3BFF",stopOpacity:"0.35"}),t("stop",{offset:"0.8",stopColor:"#7C3BFF",stopOpacity:"0.46"}),t("stop",{offset:"0.86",stopColor:"#7C3BFF",stopOpacity:"0.6"}),t("stop",{offset:"0.92",stopColor:"#7C3BFF",stopOpacity:"0.76"}),t("stop",{offset:"0.98",stopColor:"#7C3BFF",stopOpacity:"0.93"}),t("stop",{offset:"1",stopColor:"#7C3BFF"})]}),t("clipPath",{id:"clip0_1585_55266",children:t("rect",{width:"929.477",height:"667",fill:"white",transform:"translate(-93.7383 -134)"})})]})]}),dm=b.div`
868
+ `,pm=()=>{const{progress:o}=Ot(),{describeApi:n,namespacesApi:i}=Ll(),{items:a}=i.useNamespaces(),[l,r]=s(null),{formData:c,handleFormChange:d,resetFormData:p}=Ht({includeProfiles:!0,includeMetrics:!0,includeSourceWorkloads:!1,sourceWorkloadNamespaces:[]});return t(dt,{richTitle:{icon:xl,title:"Diagnose"},children:l?e(dm,{children:[t(St,{title:"Creating file...",subTitle:"This may take a few moments. Do not refresh the page.",withGradient:!0,withSpinner:"number"==typeof o[Dt.DownloadingDiagnose]?.percentage,percentage:o[Dt.DownloadingDiagnose]?.percentage,withVisual:"number"!=typeof o[Dt.DownloadingDiagnose]?.percentage,visualIcon:bl,startedAt:l}),o[Dt.DownloadingDiagnose]?.list?.length&&t(ee,{$width:"100%",children:o[Dt.DownloadingDiagnose].list.map((o,n)=>e(me,{$gap:4,$alignItems:"center",children:[o.status===Fe.Success?t(Ua,{size:16}):o.status===Fe.Error?t(Va,{size:16}):t(St,{withSpinnerOld:!0,scaleSpinnerOld:.7}),t(pe,{size:he.XXXS,color:ue.Secondary,children:o.label})]},`diagnose-item-${n}-${o.label}`))})]}):e(ee,{$gap:24,children:[t(pe,{size:he.XXS,color:ue.Secondary,children:"Download a tar.gz file with diagnostics from this cluster. Select which data to include before downloading, and share the file with the Odigos support team for troubleshooting."}),e(ee,{$gap:16,children:[e(me,{$gap:8,children:[t(oe,{label:"Profiles",value:c.includeProfiles,onChange:e=>d("includeProfiles",e),tooltip:"Note: Adds 30s to diagnose download time to collect Profiles"}),t(pe,{size:he.XXXS,color:ue.Secondary,children:"Include pprof profiles"})]}),e(me,{$gap:8,children:[t(oe,{label:"Metrics",value:c.includeMetrics,onChange:e=>d("includeMetrics",e)}),t(pe,{size:he.XXXS,color:ue.Secondary,children:"Include Prometheus metrics"})]}),e(me,{$gap:8,children:[t(oe,{label:"Source Workloads",value:c.includeSourceWorkloads,onChange:e=>{d("includeSourceWorkloads",e),e&&d("sourceWorkloadNamespaces",[])}}),t(pe,{size:he.XXXS,color:ue.Secondary,children:"Include workload and pod manifests for instrumented sources"})]})]}),t(ln,{alignX:sn.Left,alignY:rn.Bottom,items:a.map(e=>({id:e.name,label:e.name,withCheckbox:!0})),selectedIds:c.sourceWorkloadNamespaces,setSelectedIds:e=>d("sourceWorkloadNamespaces",e),withMultiSelect:!0,withSearch:!0,fullWidth:!0,buttonProps:{label:(c.sourceWorkloadNamespaces.length?"Selected":"Select")+" Namespaces",variant:be.Secondary,disabled:c.includeSourceWorkloads,leftIcon:c.sourceWorkloadNamespaces.length?()=>t(qe,{label:c.sourceWorkloadNamespaces.length,status:Fe.Default}):void 0}}),t(me,{$justifyContent:"flex-end",children:t(ge,{label:"Download Diagnose",rightIcon:bl,variant:be.Primary,onClick:async()=>{n.downloadDiagnose&&(r(Date.now()),await n.downloadDiagnose(c),r(null),p())},disabled:null!==l})})]})})},um=()=>{const{platformType:e,version:o,tier:n}=S(),{describeApi:a}=Ll(),[l,r]=s(null);return i(()=>{a.fetchDescribeOdigos&&a.fetchDescribeOdigos().then(({data:e})=>r(e?.describeOdigos??null))},[]),t(dt,{richTitle:{icon:cl,title:"General Information"},children:t(Xt,{cellsPerRow:2,items:[{id:cn(),title:"Odigos Version",label:o},{id:cn(),title:`${e.toUpperCase()} Version`,label:l?.kubernetesVersion?.value||"-"},{id:cn(),title:"Installation Method",label:l?.installationMethod?.value||"-"},{id:cn(),title:"Tier",label:n}]})})},hm=({isOpen:o,onClose:n})=>{const{describeApi:i,tokensApi:a}=Ll(),l=a.useTokens().items[0];return e(ce,{isOpen:o,header:{icon:cl,title:"System Overview",onClose:n},children:[i.fetchDescribeOdigos&&t(um,{}),a.updateToken&&l&&t(cm,{token:l}),i.downloadDiagnose&&t(pm,{})]})},mm=({isOpen:n,onClose:i,onCloseEnd:a})=>{const{addDataStreams:l,setSelectedStreamName:s}=tt(),{dataStreamsApi:c}=Ll(),{requestSubmit:d}=zl(),p=r(async e=>{c.create?await c.create(e):(l([e]),s(e.name)),i()},[c,l,s,i]),u=r(()=>d(p),[d,p]);return nn({key:"Enter",active:n},u),e(o,{children:[t(Qe,{isOpen:n,onClose:i,onCloseEnd:a,title:et.NAME_YOUR_STREAM,description:et.STREAM_DESCRIPTION,approveButton:{"data-id":"add-stream-btn-done",label:Ft.DONE,variant:be.Primary,onClick:u},denyButton:{"data-id":"add-stream-btn-cancel",label:Ft.CANCEL,variant:be.Secondary,onClick:i},children:t(Js,{autoFocus:!0})}),t(qs,{})]})},gm=({isOpen:n,onClose:a,onCloseEnd:l,dataStreamName:s})=>{const{dataStreamsApi:c}=Ll(),{genericForm:d,loadDataStream:p,requestSubmit:u}=zl();i(()=>{n&&s&&p(s)},[n,s]);const h=!!d?.isFormDirty,m=r(async e=>{await c.update(s,e),a()},[c,s,a]),g=r(()=>u(m),[u,m]);return nn({key:"Enter",active:n},g),e(o,{children:[t(Qe,{isOpen:n,onClose:a,onCloseEnd:l,title:et.RENAME_STREAM(s),description:et.STREAM_DESCRIPTION,approveButton:{"data-id":"edit-stream-btn-save",label:Ft.SAVE,variant:be.Primary,onClick:g,disabled:!h},denyButton:{"data-id":"edit-stream-btn-cancel",label:Ft.CANCEL,variant:be.Secondary,onClick:a},children:t(Js,{autoFocus:!0})}),t(qs,{})]})},fm=({scale:o=1})=>e("svg",{width:742*o,height:533*o,viewBox:"0 0 742 533",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[t("path",{d:"M0 0H722C733.046 0 742 8.95431 742 20V513C742 524.046 733.046 533 722 533H0V0Z",fill:"url(#paint0_linear_1585_55266)"}),e("g",{clipPath:"url(#clip0_1585_55266)",children:[t("path",{opacity:"0.1",d:"M817.963 1364.02C1052.53 1129.46 1052.53 749.151 817.96 514.585C583.394 280.019 203.089 280.018 -31.4751 514.583C-266.039 749.147 -266.038 1129.45 -31.4725 1364.02C203.093 1598.58 583.398 1598.58 817.963 1364.02Z",fill:"url(#paint1_radial_1585_55266)"}),t("path",{opacity:"0.3",d:"M789.266 1335.32C1007.98 1116.61 1007.98 761.998 789.264 543.281C570.547 324.565 215.938 324.563 -2.7781 543.279C-221.494 761.995 -221.493 1116.6 -2.77577 1335.32C215.941 1554.04 570.55 1554.04 789.266 1335.32Z",fill:"url(#paint2_radial_1585_55266)"}),t("path",{opacity:"0.5",d:"M736.156 1282.21C925.539 1092.83 925.538 785.776 736.153 596.392C546.769 407.007 239.717 407.006 50.333 596.39C-139.05 785.773 -139.05 1092.83 50.3351 1282.21C239.72 1471.59 546.772 1471.6 736.156 1282.21Z",fill:"url(#paint3_radial_1585_55266)"}),t("path",{opacity:"0.7",d:"M628.365 1174.42C758.218 1044.57 758.217 834.036 628.364 704.182C498.51 574.329 287.977 574.328 158.124 704.181C28.2713 834.033 28.272 1044.57 158.125 1174.42C287.979 1304.27 498.512 1304.27 628.365 1174.42Z",fill:"url(#paint4_radial_1585_55266)"}),t("path",{opacity:"0.1",d:"M795.717 29.8993C1030.28 -204.665 1030.28 -584.97 795.714 -819.536C561.148 -1054.1 180.843 -1054.1 -53.7211 -819.539C-288.285 -584.974 -288.284 -204.669 -53.7185 29.8967C180.847 264.462 561.152 264.464 795.717 29.8993Z",fill:"url(#paint5_radial_1585_55266)"}),t("path",{opacity:"0.3",d:"M767.02 1.20219C985.736 -217.513 985.734 -572.123 767.017 -790.84C548.301 -1009.56 193.691 -1009.56 -25.0242 -790.842C-243.74 -572.126 -243.739 -217.517 -25.0219 1.19982C193.695 219.917 548.304 219.918 767.02 1.20219Z",fill:"url(#paint6_radial_1585_55266)"}),t("path",{opacity:"0.5",d:"M713.909 -51.908C903.293 -241.292 903.292 -548.344 713.907 -737.728C524.523 -927.113 217.47 -927.114 28.0869 -737.731C-161.297 -548.347 -161.296 -241.295 28.089 -51.91C217.474 137.475 524.526 137.476 713.909 -51.908Z",fill:"url(#paint7_radial_1585_55266)"}),t("path",{opacity:"0.7",d:"M606.119 -159.699C735.972 -289.552 735.971 -500.085 606.118 -629.939C476.264 -759.792 265.731 -759.793 135.878 -629.94C6.0252 -500.088 6.02586 -289.554 135.879 -159.701C265.733 -29.8472 476.266 -29.8465 606.119 -159.699Z",fill:"url(#paint8_radial_1585_55266)"})]}),e("defs",{children:[e("linearGradient",{id:"paint0_linear_1585_55266",x1:"371",y1:"0",x2:"371",y2:"533",gradientUnits:"userSpaceOnUse",children:[t("stop",{offset:"0.028197",stopColor:"#0B0517"}),t("stop",{offset:"1",stopColor:"#190D31"})]}),e("radialGradient",{id:"paint1_radial_1585_55266",cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",gradientTransform:"translate(334.074 991.405) rotate(-45) scale(599.732 599.736)",children:[t("stop",{stopColor:"#7C3BFF",stopOpacity:"0.1"}),t("stop",{offset:"0.41",stopColor:"#7C3BFF",stopOpacity:"0.11"}),t("stop",{offset:"0.56",stopColor:"#7C3BFF",stopOpacity:"0.13"}),t("stop",{offset:"0.67",stopColor:"#7C3BFF",stopOpacity:"0.18"}),t("stop",{offset:"0.75",stopColor:"#7C3BFF",stopOpacity:"0.25"}),t("stop",{offset:"0.83",stopColor:"#7C3BFF",stopOpacity:"0.33"}),t("stop",{offset:"0.89",stopColor:"#7C3BFF",stopOpacity:"0.44"}),t("stop",{offset:"0.95",stopColor:"#7C3BFF",stopOpacity:"0.56"}),t("stop",{offset:"1",stopColor:"#7C3BFF",stopOpacity:"0.7"})]}),e("radialGradient",{id:"paint2_radial_1585_55266",cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",gradientTransform:"translate(368.968 957.913) rotate(-45) scale(560.978 560.981)",children:[t("stop",{stopColor:"#7C3BFF",stopOpacity:"0.1"}),t("stop",{offset:"0.38",stopColor:"#7C3BFF",stopOpacity:"0.11"}),t("stop",{offset:"0.52",stopColor:"#7C3BFF",stopOpacity:"0.13"}),t("stop",{offset:"0.62",stopColor:"#7C3BFF",stopOpacity:"0.18"}),t("stop",{offset:"0.69",stopColor:"#7C3BFF",stopOpacity:"0.25"}),t("stop",{offset:"0.76",stopColor:"#7C3BFF",stopOpacity:"0.33"}),t("stop",{offset:"0.82",stopColor:"#7C3BFF",stopOpacity:"0.44"}),t("stop",{offset:"0.88",stopColor:"#7C3BFF",stopOpacity:"0.57"}),t("stop",{offset:"0.93",stopColor:"#7C3BFF",stopOpacity:"0.72"}),t("stop",{offset:"0.97",stopColor:"#7C3BFF",stopOpacity:"0.88"}),t("stop",{offset:"1",stopColor:"#7C3BFF"})]}),e("radialGradient",{id:"paint3_radial_1585_55266",cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",gradientTransform:"translate(351.265 971.313) rotate(-45) scale(484.947 484.95)",children:[t("stop",{stopColor:"#7C3BFF",stopOpacity:"0.1"}),t("stop",{offset:"0.31",stopColor:"#7C3BFF",stopOpacity:"0.11"}),t("stop",{offset:"0.45",stopColor:"#7C3BFF",stopOpacity:"0.14"}),t("stop",{offset:"0.56",stopColor:"#7C3BFF",stopOpacity:"0.19"}),t("stop",{offset:"0.65",stopColor:"#7C3BFF",stopOpacity:"0.26"}),t("stop",{offset:"0.73",stopColor:"#7C3BFF",stopOpacity:"0.35"}),t("stop",{offset:"0.8",stopColor:"#7C3BFF",stopOpacity:"0.46"}),t("stop",{offset:"0.86",stopColor:"#7C3BFF",stopOpacity:"0.6"}),t("stop",{offset:"0.92",stopColor:"#7C3BFF",stopOpacity:"0.76"}),t("stop",{offset:"0.98",stopColor:"#7C3BFF",stopOpacity:"0.93"}),t("stop",{offset:"1",stopColor:"#7C3BFF"})]}),e("radialGradient",{id:"paint4_radial_1585_55266",cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",gradientTransform:"translate(362.239 963.064) rotate(-45) scale(332.216 332.218)",children:[t("stop",{stopColor:"#7C3BFF",stopOpacity:"0.1"}),t("stop",{offset:"0.31",stopColor:"#7C3BFF",stopOpacity:"0.11"}),t("stop",{offset:"0.45",stopColor:"#7C3BFF",stopOpacity:"0.14"}),t("stop",{offset:"0.56",stopColor:"#7C3BFF",stopOpacity:"0.19"}),t("stop",{offset:"0.65",stopColor:"#7C3BFF",stopOpacity:"0.26"}),t("stop",{offset:"0.73",stopColor:"#7C3BFF",stopOpacity:"0.35"}),t("stop",{offset:"0.8",stopColor:"#7C3BFF",stopOpacity:"0.46"}),t("stop",{offset:"0.86",stopColor:"#7C3BFF",stopOpacity:"0.6"}),t("stop",{offset:"0.92",stopColor:"#7C3BFF",stopOpacity:"0.76"}),t("stop",{offset:"0.98",stopColor:"#7C3BFF",stopOpacity:"0.93"}),t("stop",{offset:"1",stopColor:"#7C3BFF"})]}),e("radialGradient",{id:"paint5_radial_1585_55266",cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",gradientTransform:"translate(311.828 -342.716) rotate(-45) scale(599.733 599.736)",children:[t("stop",{stopColor:"#7C3BFF",stopOpacity:"0.1"}),t("stop",{offset:"0.41",stopColor:"#7C3BFF",stopOpacity:"0.11"}),t("stop",{offset:"0.56",stopColor:"#7C3BFF",stopOpacity:"0.13"}),t("stop",{offset:"0.67",stopColor:"#7C3BFF",stopOpacity:"0.18"}),t("stop",{offset:"0.75",stopColor:"#7C3BFF",stopOpacity:"0.25"}),t("stop",{offset:"0.83",stopColor:"#7C3BFF",stopOpacity:"0.33"}),t("stop",{offset:"0.89",stopColor:"#7C3BFF",stopOpacity:"0.44"}),t("stop",{offset:"0.95",stopColor:"#7C3BFF",stopOpacity:"0.56"}),t("stop",{offset:"1",stopColor:"#7C3BFF",stopOpacity:"0.7"})]}),e("radialGradient",{id:"paint6_radial_1585_55266",cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",gradientTransform:"translate(346.722 -376.208) rotate(-45) scale(560.977 560.981)",children:[t("stop",{stopColor:"#7C3BFF",stopOpacity:"0.1"}),t("stop",{offset:"0.38",stopColor:"#7C3BFF",stopOpacity:"0.11"}),t("stop",{offset:"0.52",stopColor:"#7C3BFF",stopOpacity:"0.13"}),t("stop",{offset:"0.62",stopColor:"#7C3BFF",stopOpacity:"0.18"}),t("stop",{offset:"0.69",stopColor:"#7C3BFF",stopOpacity:"0.25"}),t("stop",{offset:"0.76",stopColor:"#7C3BFF",stopOpacity:"0.33"}),t("stop",{offset:"0.82",stopColor:"#7C3BFF",stopOpacity:"0.44"}),t("stop",{offset:"0.88",stopColor:"#7C3BFF",stopOpacity:"0.57"}),t("stop",{offset:"0.93",stopColor:"#7C3BFF",stopOpacity:"0.72"}),t("stop",{offset:"0.97",stopColor:"#7C3BFF",stopOpacity:"0.88"}),t("stop",{offset:"1",stopColor:"#7C3BFF"})]}),e("radialGradient",{id:"paint7_radial_1585_55266",cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",gradientTransform:"translate(329.019 -362.807) rotate(-45) scale(484.947 484.95)",children:[t("stop",{stopColor:"#7C3BFF",stopOpacity:"0.1"}),t("stop",{offset:"0.31",stopColor:"#7C3BFF",stopOpacity:"0.11"}),t("stop",{offset:"0.45",stopColor:"#7C3BFF",stopOpacity:"0.14"}),t("stop",{offset:"0.56",stopColor:"#7C3BFF",stopOpacity:"0.19"}),t("stop",{offset:"0.65",stopColor:"#7C3BFF",stopOpacity:"0.26"}),t("stop",{offset:"0.73",stopColor:"#7C3BFF",stopOpacity:"0.35"}),t("stop",{offset:"0.8",stopColor:"#7C3BFF",stopOpacity:"0.46"}),t("stop",{offset:"0.86",stopColor:"#7C3BFF",stopOpacity:"0.6"}),t("stop",{offset:"0.92",stopColor:"#7C3BFF",stopOpacity:"0.76"}),t("stop",{offset:"0.98",stopColor:"#7C3BFF",stopOpacity:"0.93"}),t("stop",{offset:"1",stopColor:"#7C3BFF"})]}),e("radialGradient",{id:"paint8_radial_1585_55266",cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",gradientTransform:"translate(339.993 -371.057) rotate(-45) scale(332.216 332.218)",children:[t("stop",{stopColor:"#7C3BFF",stopOpacity:"0.1"}),t("stop",{offset:"0.31",stopColor:"#7C3BFF",stopOpacity:"0.11"}),t("stop",{offset:"0.45",stopColor:"#7C3BFF",stopOpacity:"0.14"}),t("stop",{offset:"0.56",stopColor:"#7C3BFF",stopOpacity:"0.19"}),t("stop",{offset:"0.65",stopColor:"#7C3BFF",stopOpacity:"0.26"}),t("stop",{offset:"0.73",stopColor:"#7C3BFF",stopOpacity:"0.35"}),t("stop",{offset:"0.8",stopColor:"#7C3BFF",stopOpacity:"0.46"}),t("stop",{offset:"0.86",stopColor:"#7C3BFF",stopOpacity:"0.6"}),t("stop",{offset:"0.92",stopColor:"#7C3BFF",stopOpacity:"0.76"}),t("stop",{offset:"0.98",stopColor:"#7C3BFF",stopOpacity:"0.93"}),t("stop",{offset:"1",stopColor:"#7C3BFF"})]}),t("clipPath",{id:"clip0_1585_55266",children:t("rect",{width:"929.477",height:"667",fill:"white",transform:"translate(-93.7383 -134)"})})]})]}),bm=b.div`
858
869
  position: absolute;
859
870
  top: 50%;
860
871
  left: 50%;
861
872
  transform: translate(-50%, -50%);
862
873
  z-index: ${({theme:e})=>e.v2.zIndex.modal};
863
- `,um=()=>{const{drawerType:o,setDrawerType:n}=ho(),i=o===dn.OnboardingDone,a=()=>n(null);return e(cn,{isOpen:i,onClose:a,children:[t(cm,{}),t(dm,{children:e(ee,{$gap:32,$alignItems:"center",children:[e(ee,{$gap:24,$alignItems:"center",children:[t(ue,{size:he.L,weight:500,children:"Welcome to"}),t(Sr,{size:260}),t(ue,{size:he.S,weight:400,children:"Your observability control plane is ready."})]}),t(ge,{label:"Get Started",rightIcon:Na,onClick:a})]})})]})},pm=b.div`
874
+ `,vm=()=>{const{drawerType:o,setDrawerType:n}=ho(),i=o===pn.OnboardingDone,a=()=>n(null);return e(dn,{isOpen:i,onClose:a,children:[t(fm,{}),t(bm,{children:e(ee,{$gap:32,$alignItems:"center",children:[e(ee,{$gap:24,$alignItems:"center",children:[t(pe,{size:he.L,weight:500,children:"Welcome to"}),t(xr,{size:260}),t(pe,{size:he.S,weight:400,children:"Your observability control plane is ready."})]}),t(ge,{label:"Get Started",rightIcon:$a,onClick:a})]})})]})},ym=b.div`
864
875
  display: flex;
865
876
  flex-direction: column;
866
877
  gap: 8px;
867
878
  padding: 4px 8px;
868
879
  border-radius: 8px;
869
880
  width: 100%;
870
- `,hm=b.div`
881
+ `,Cm=b.div`
871
882
  white-space: pre;
872
883
  overflow-x: auto;
873
- `,mm=({name:o,recommended:n,toggleLabel:i,enabled:a,onEnabledChange:l,summary:r,toggleName:s})=>{const c=v();return e(pm,{children:[e(me,{$gap:8,$justifyContent:"space-between",children:[e(me,{$gap:4,children:[t(ue,{size:he.XS,color:c.v2.colors.white[500],nowrap:!0,children:o}),n&&t(qe,{label:un,leftIcon:xl,backgroundColor:c.v2.colors.purple[700],textColor:c.v2.colors.white[500],textSize:he.XXXS})]}),t(le,{name:s??`sampling-onboarding-toggle-${o}`,label:i,labelAlign:re.Left,value:a,onChange:l,size:Nt.S})]}),t(hm,{children:t(w,{parts:r})})]})},gm=b.div`
884
+ `,Sm=({name:o,recommended:n,toggleLabel:i,enabled:a,onEnabledChange:l,summary:r,toggleName:s})=>{const c=v();return e(ym,{children:[e(me,{$gap:8,$justifyContent:"space-between",children:[e(me,{$gap:4,children:[t(pe,{size:he.XS,color:c.v2.colors.white[500],nowrap:!0,children:o}),n&&t(qe,{label:un,leftIcon:wl,backgroundColor:c.v2.colors.purple[700],textColor:c.v2.colors.white[500],textSize:he.XXXS})]}),t(le,{name:s??`sampling-onboarding-toggle-${o}`,label:i,labelAlign:re.Left,value:a,onChange:l,size:Nt.S})]}),t(Cm,{children:t(w,{parts:r})})]})},xm=b.div`
874
885
  position: relative;
875
886
  display: flex;
876
887
  align-items: center;
@@ -880,18 +891,18 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import n,{useEff
880
891
  background-color: ${({theme:e})=>e.v2.colors.black[500]};
881
892
  border-top-left-radius: 18px;
882
893
  border-top-right-radius: 18px;
883
- `,fm=b.div`
894
+ `,wm=b.div`
884
895
  position: absolute;
885
896
  left: 16px;
886
897
  top: 50%;
887
898
  transform: translateY(-50%);
888
- `,bm=b.div`
899
+ `,Tm=b.div`
889
900
  height: 16px;
890
901
  width: 100%;
891
902
  background-color: ${({theme:e})=>e.v2.colors.black[500]};
892
903
  border-top-left-radius: 18px;
893
904
  border-top-right-radius: 18px;
894
- `,vm=b.div`
905
+ `,km=b.div`
895
906
  width: ${({$width:e})=>e}px;
896
907
  display: flex;
897
908
  flex-direction: column;
@@ -899,7 +910,7 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import n,{useEff
899
910
  gap: 22px;
900
911
  padding: 8px 32px 32px 32px;
901
912
  background-color: ${({theme:e})=>e.v2.colors.black[500]};
902
- `,ym=e=>t(wl,{rotate:90,...e}),Cm=({children:o,center:n,onNext:i,nextLabel:a=pn,nextLoading:l})=>e(me,{$gap:8,$justifyContent:n?"center":"flex-end",$padding:"0 16px 16px 16px",children:[o,i&&t(ge,{"data-id":"sampling-onboarding-btn-next",label:a,rightIcon:ym,variant:be.Primary,size:fe.M,onClick:i,loading:l})]}),Sm=e=>t(wl,{rotate:-90,...e}),xm=({title:o,onBack:n})=>{const i=v();return e(gm,{$hasBack:!!n,children:[n&&t(fm,{children:t(yt,{"data-id":"sampling-onboarding-back",icon:Sm,size:Ct.M,onClick:n})}),t(ue,{size:he.M,weight:500,color:i.v2.colors.white[500],align:"center",children:o})]})},wm=b.div`
913
+ `,Em=e=>t(Tl,{rotate:90,...e}),Im=({children:o,center:n,onNext:i,nextLabel:a=hn,nextLoading:l})=>e(me,{$gap:8,$justifyContent:n?"center":"flex-end",$padding:"0 16px 16px 16px",children:[o,i&&t(ge,{"data-id":"sampling-onboarding-btn-next",label:a,rightIcon:Em,variant:be.Primary,size:fe.M,onClick:i,loading:l})]}),Nm=e=>t(Tl,{rotate:-90,...e}),$m=({title:o,onBack:n})=>{const i=v();return e(xm,{$hasBack:!!n,children:[n&&t(wm,{children:t(yt,{"data-id":"sampling-onboarding-back",icon:Nm,size:Ct.M,onClick:n})}),t(pe,{size:he.M,weight:500,color:i.v2.colors.white[500],align:"center",children:o})]})},Om=b.div`
903
914
  box-sizing: border-box;
904
915
  width: ${({$width:e})=>e??"100%"};
905
916
  ${({$fillHeight:e})=>e&&y`
@@ -912,16 +923,16 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import n,{useEff
912
923
  padding: 16px;
913
924
  border-radius: 16px;
914
925
  background-color: ${({theme:e})=>e.v2.colors.silver[1e3]};
915
- `,Tm=({children:e,fillHeight:o,width:n})=>t(wm,{$fillHeight:o,$width:n,children:e}),km=b.ul`
926
+ `,Am=({children:e,fillHeight:o,width:n})=>t(Om,{$fillHeight:o,$width:n,children:e}),Rm=b.ul`
916
927
  margin: 0;
917
928
  padding: 0;
918
929
  list-style: disc;
919
- `,Em=b.li`
930
+ `,Dm=b.li`
920
931
  margin-left: 18px;
921
932
  & + & {
922
933
  margin-top: 6px;
923
934
  }
924
- `,Im=({items:e,color:o})=>{const n=v(),i=o||n.v2.colors.silver[200];return t(km,{children:e.map((e,o)=>t(Em,{style:{color:i},children:t(ue,{size:he.XXS,color:i,children:e})},o))})},Nm=({items:o})=>{const n=v();return t(ee,{$gap:16,children:o.map((o,i)=>e(me,{$gap:8,$alignItems:"flex-start",children:[e(ue,{size:he.XS,color:n.v2.colors.silver[200],weight:400,children:[i+1,"."]}),e(ee,{$gap:2,children:[t(ue,{size:he.XS,color:n.v2.colors.white[500],weight:500,children:o.title}),t(ue,{size:he.XS,color:n.v2.colors.silver[200],children:o.description})]})]},i))})},$m=({message:e})=>t(Le,{status:Fe.Default,message:e,fullWidth:!0,smallIcon:!0}),Om=b.div`
935
+ `,_m=({items:e,color:o})=>{const n=v(),i=o||n.v2.colors.silver[200];return t(Rm,{children:e.map((e,o)=>t(Dm,{style:{color:i},children:t(pe,{size:he.XXS,color:i,children:e})},o))})},Pm=({items:o})=>{const n=v();return t(ee,{$gap:16,children:o.map((o,i)=>e(me,{$gap:8,$alignItems:"flex-start",children:[e(pe,{size:he.XS,color:n.v2.colors.silver[200],weight:400,children:[i+1,"."]}),e(ee,{$gap:2,children:[t(pe,{size:he.XS,color:n.v2.colors.white[500],weight:500,children:o.title}),t(pe,{size:he.XS,color:n.v2.colors.silver[200],children:o.description})]})]},i))})},Lm=({message:e})=>t(Le,{status:Fe.Default,message:e,fullWidth:!0,smallIcon:!0}),Fm=b.div`
925
936
  width: 100%;
926
937
  padding: 8px;
927
938
  display: flex;
@@ -929,12 +940,12 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import n,{useEff
929
940
  gap: 4px;
930
941
  border-radius: 16px;
931
942
  background-color: ${({theme:e})=>e.v2.colors.silver[800]};
932
- `,Am=b.div`
943
+ `,Mm=b.div`
933
944
  display: flex;
934
945
  align-items: center;
935
946
  gap: 8px;
936
947
  padding: 4px 8px 12px 8px;
937
- `,Rm=b.div`
948
+ `,zm=b.div`
938
949
  width: 100%;
939
950
  display: flex;
940
951
  flex-direction: column;
@@ -942,20 +953,20 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import n,{useEff
942
953
  padding: 8px;
943
954
  border-radius: 12px;
944
955
  background-color: ${({theme:e})=>e.v2.colors.silver[900]};
945
- `,Dm=({children:e})=>{const o=v();return t(ue,{size:he.S,weight:500,color:o.v2.colors.white[500],align:"center",children:e})},_m=b.div`
956
+ `,Bm=({children:e})=>{const o=v();return t(pe,{size:he.S,weight:500,color:o.v2.colors.white[500],align:"center",children:e})},Xm=b.div`
946
957
  white-space: pre-line;
947
- `,Pm=({enabled:n,onEnabledChange:i,onBack:l,onNext:r})=>{const s=v(),c=a(()=>A({enabled:n,keepPercentage:0}),[n]);return e(o,{children:[t(xm,{title:hn,onBack:l}),e(vm,{$width:854,children:[t(Dm,{children:mn}),e(ee,{$gap:8,$width:"100%",children:[t(Tm,{children:t(_m,{children:t(ue,{size:he.XXS,color:s.v2.colors.silver[200],children:gn})})}),e(ee,{$gap:8,$width:"100%",children:[e(Om,{children:[t(Am,{children:t(ue,{size:he.S,weight:500,color:s.v2.colors.white[500],children:fn})}),t(Rm,{children:t(mm,{name:vn,recommended:!0,toggleLabel:bn,enabled:n,onEnabledChange:i,summary:c,toggleName:"sampling-onboarding-noisy-toggle"})})]}),t($m,{message:yn})]})]})]}),t(Cm,{onNext:r})]})},Lm=e=>t(wl,{rotate:90,...e}),Fm=({onClose:n})=>{const i=v();return e(o,{children:[t(bm,{}),e(vm,{$width:732,children:[t(Cn,{icon:vl}),e(ee,{$gap:16,$alignItems:"center",$width:"100%",children:[t(ue,{size:he.M,weight:500,color:i.v2.colors.white[500],children:Sn}),xn.split("\n").map((e,o)=>t(Dm,{children:e},`subtitle-${o}-${e}`)),e(Tm,{children:[t(ue,{size:he.XS,color:i.v2.colors.silver[200],children:wn}),t(Im,{color:i.v2.colors.white[500],items:[Tn,kn,En]})]})]})]}),t(Cm,{center:!0,children:t(ge,{"data-id":"sampling-onboarding-btn-go-to",label:In,rightIcon:Lm,variant:be.Primary,size:fe.M,onClick:n})})]})},Mm=e=>t(wl,{rotate:90,...e}),zm=b.div`
958
+ `,Um=({enabled:n,onEnabledChange:i,onBack:l,onNext:r})=>{const s=v(),c=a(()=>A({enabled:n,keepPercentage:0}),[n]);return e(o,{children:[t($m,{title:mn,onBack:l}),e(km,{$width:854,children:[t(Bm,{children:gn}),e(ee,{$gap:8,$width:"100%",children:[t(Am,{children:t(Xm,{children:t(pe,{size:he.XXS,color:s.v2.colors.silver[200],children:fn})})}),e(ee,{$gap:8,$width:"100%",children:[e(Fm,{children:[t(Mm,{children:t(pe,{size:he.S,weight:500,color:s.v2.colors.white[500],children:bn})}),t(zm,{children:t(Sm,{name:yn,recommended:!0,toggleLabel:vn,enabled:n,onEnabledChange:i,summary:c,toggleName:"sampling-onboarding-noisy-toggle"})})]}),t(Lm,{message:Cn})]})]})]}),t(Im,{onNext:r})]})},Vm=e=>t(Tl,{rotate:90,...e}),Hm=({onClose:n})=>{const i=v();return e(o,{children:[t(Tm,{}),e(km,{$width:732,children:[t(Sn,{icon:yl}),e(ee,{$gap:16,$alignItems:"center",$width:"100%",children:[t(pe,{size:he.M,weight:500,color:i.v2.colors.white[500],children:xn}),wn.split("\n").map((e,o)=>t(Bm,{children:e},`subtitle-${o}-${e}`)),e(Am,{children:[t(pe,{size:he.XS,color:i.v2.colors.silver[200],children:Tn}),t(_m,{color:i.v2.colors.white[500],items:[kn,En,In]})]})]})]}),t(Im,{center:!0,children:t(ge,{"data-id":"sampling-onboarding-btn-go-to",label:Nn,rightIcon:Vm,variant:be.Primary,size:fe.M,onClick:n})})]})},jm=e=>t(Tl,{rotate:90,...e}),Gm=b.div`
948
959
  display: flex;
949
960
  flex-direction: column;
950
961
  align-items: center;
951
962
  gap: 8px;
952
963
  width: 100%;
953
- `,Bm=({onSkip:n,onNext:i})=>{const a=v();return e(o,{children:[t(bm,{}),e(vm,{$width:732,children:[t(Cn,{icon:vl}),e(ee,{$gap:16,$alignItems:"center",$width:"100%",children:[e(zm,{children:[t(ue,{size:he.M,weight:500,color:a.v2.colors.white[500],children:Nn}),t(Dm,{children:$n})]}),e(Tm,{children:[t(ue,{size:he.XS,color:a.v2.colors.silver[200],children:On}),t(Nm,{items:[{title:Rn,description:An},{title:_n,description:Dn},{title:Ln,description:Pn}]}),t($m,{message:Fn})]})]})]}),e(Cm,{center:!0,children:[t(ge,{"data-id":"sampling-onboarding-btn-skip",label:Mn,variant:be.Secondary,onClick:n}),t(ge,{"data-id":"sampling-onboarding-btn-start",label:zn,rightIcon:Mm,variant:be.Primary,onClick:i})]})]})},Xm=b.div`
964
+ `,Wm=({onSkip:n,onNext:i})=>{const a=v();return e(o,{children:[t(Tm,{}),e(km,{$width:732,children:[t(Sn,{icon:yl}),e(ee,{$gap:16,$alignItems:"center",$width:"100%",children:[e(Gm,{children:[t(pe,{size:he.M,weight:500,color:a.v2.colors.white[500],children:$n}),t(Bm,{children:On})]}),e(Am,{children:[t(pe,{size:he.XS,color:a.v2.colors.silver[200],children:An}),t(Pm,{items:[{title:Dn,description:Rn},{title:Pn,description:_n},{title:Fn,description:Ln}]}),t(Lm,{message:Mn})]})]})]}),e(Im,{center:!0,children:[t(ge,{"data-id":"sampling-onboarding-btn-skip",label:zn,variant:be.Secondary,onClick:n}),t(ge,{"data-id":"sampling-onboarding-btn-start",label:Bn,rightIcon:jm,variant:be.Primary,onClick:i})]})]})},Km=b.div`
954
965
  display: flex;
955
966
  align-items: stretch;
956
967
  gap: 16px;
957
968
  width: 100%;
958
- `,Um=b.div`
969
+ `,Ym=b.div`
959
970
  flex: 1;
960
971
  display: flex;
961
972
  flex-direction: column;
@@ -975,18 +986,18 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import n,{useEff
975
986
  background-color: ${t.v2.colors.silver[700]};
976
987
  }
977
988
  `}
978
- `,Vm=b.div`
989
+ `,qm=b.div`
979
990
  display: flex;
980
991
  align-items: center;
981
992
  gap: 8px;
982
993
  padding: 12px 16px;
983
- `,Hm=b.div`
994
+ `,Jm=b.div`
984
995
  flex: 1;
985
996
  padding: 8px;
986
997
  display: flex;
987
998
  flex-direction: column;
988
999
  gap: 8px;
989
- `,jm=b.div`
1000
+ `,Zm=b.div`
990
1001
  flex: 1;
991
1002
  display: flex;
992
1003
  flex-direction: column;
@@ -994,17 +1005,17 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import n,{useEff
994
1005
  padding: 12px;
995
1006
  border-radius: 12px;
996
1007
  background-color: ${({theme:e,$selected:t})=>t?e.v2.colors.purple[900]:e.v2.colors.silver[900]};
997
- `,Gm=b.div`
1008
+ `,Qm=b.div`
998
1009
  display: flex;
999
1010
  justify-content: flex-end;
1000
- `,Wm=b.div`
1011
+ `,eg=b.div`
1001
1012
  display: flex;
1002
1013
  align-items: center;
1003
1014
  gap: 8px;
1004
1015
  padding: 4px 12px 4px 4px;
1005
1016
  border-radius: 8px;
1006
1017
  background-color: ${({theme:e})=>e.v2.colors.yellow[1e3]};
1007
- `,Km=b.div`
1018
+ `,tg=b.div`
1008
1019
  display: flex;
1009
1020
  align-items: center;
1010
1021
  justify-content: center;
@@ -1012,13 +1023,13 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import n,{useEff
1012
1023
  height: 24px;
1013
1024
  border-radius: 6px;
1014
1025
  background-color: ${({theme:e})=>e.v2.colors.yellow[900]};
1015
- `,Ym=({selected:o,onSelect:n,name:i,description:a,badgeProps:l,bullets:r,warning:s,onReadMore:c})=>{const d=v(),u=o?d.v2.colors.white[500]:d.v2.colors.silver[200];return e(Um,{$selected:o,onClick:n,children:[e(Vm,{children:[t(Se,{"data-id":`sampling-onboarding-radio-${i}`,value:o,onChange:n,size:we.L}),t(vl,{size:24,fill:d.v2.colors.white[500]}),t(ue,{size:he.S,weight:500,color:d.v2.colors.white[500],children:i})]}),e(Hm,{children:[e(jm,{$selected:o,children:[e(ee,{$gap:8,children:[t(qe,{...l,textSize:he.XXXS}),t(ue,{size:he.XXS,color:u,children:a})]}),r&&r.length>0&&t(Im,{color:u,items:r}),s&&e(Wm,{children:[t(Km,{children:t(yl,{size:18,fill:d.v2.colors.yellow[500]})}),t(ue,{size:he.XXXS,color:d.v2.colors.yellow[500],children:s})]})]}),c&&t(Gm,{children:t(ge,{"data-id":`sampling-onboarding-btn-read-more-${i}`,label:oi,rightIcon:Aa,variant:be.Text,size:fe.S,onClick:e=>{e.stopPropagation(),c()}})})]})]})},qm=({strategy:n,onStrategyChange:i,onBack:a,onNext:l,docsUrl:r})=>{const s=v(),c=r?()=>window.open(r,"_blank"):void 0;return e(o,{children:[t(xm,{title:Bn,onBack:a}),e(vm,{$width:854,children:[t(Dm,{children:Xn}),e(Xm,{children:[t(Ym,{selected:"keep-list"===n,onSelect:()=>i("keep-list"),name:Wn,description:Gn,badgeProps:{label:jn,backgroundColor:s.v2.colors.purple[500],textColor:s.v2.colors.white[500]},bullets:[Vn,Hn],warning:Un,onReadMore:c}),t(Ym,{selected:"drop-list"===n,onSelect:()=>i("drop-list"),name:Zn,description:Jn,badgeProps:{label:qn,backgroundColor:s.v2.colors.green[500],textColor:s.v2.colors.black[500]},bullets:[Kn,Yn],onReadMore:c}),t(Ym,{selected:"advanced"===n,onSelect:()=>i("advanced"),name:ti,description:ei,badgeProps:{label:Qn,backgroundColor:s.v2.colors.blue[700],textColor:s.v2.colors.white[500]},onReadMore:c})]})]}),t(Cm,{onNext:l})]})},Jm=({onBack:n,onNext:i,submitting:l})=>{const r=v(),s=a(()=>[{title:li,bullets:[ni,ii,ai]},{title:pi,bullets:[ri,si,ci,di,ui]}],[]);return e(o,{children:[t(xm,{title:hi,onBack:n}),e(vm,{$width:854,children:[t(Dm,{children:mi}),t(me,{$gap:16,$width:"100%",$alignItems:"stretch",children:s.map((o,n)=>e(Tm,{fillHeight:!0,width:"50%",children:[t(ue,{size:he.XS,color:r.v2.colors.white[500],children:o.title}),t(Im,{items:o.bullets})]},n))}),t($m,{message:gi})]}),t(Cm,{onNext:i,nextLoading:l})]})},Zm=b.div`
1026
+ `,og=({selected:o,onSelect:n,name:i,description:a,badgeProps:l,bullets:r,warning:s,onReadMore:c})=>{const d=v(),p=o?d.v2.colors.white[500]:d.v2.colors.silver[200];return e(Ym,{$selected:o,onClick:n,children:[e(qm,{children:[t(Se,{"data-id":`sampling-onboarding-radio-${i}`,value:o,onChange:n,size:we.L}),t(yl,{size:24,fill:d.v2.colors.white[500]}),t(pe,{size:he.S,weight:500,color:d.v2.colors.white[500],children:i})]}),e(Jm,{children:[e(Zm,{$selected:o,children:[e(ee,{$gap:8,children:[t(qe,{...l,textSize:he.XXXS}),t(pe,{size:he.XXS,color:p,children:a})]}),r&&r.length>0&&t(_m,{color:p,items:r}),s&&e(eg,{children:[t(tg,{children:t(Cl,{size:18,fill:d.v2.colors.yellow[500]})}),t(pe,{size:he.XXXS,color:d.v2.colors.yellow[500],children:s})]})]}),c&&t(Qm,{children:t(ge,{"data-id":`sampling-onboarding-btn-read-more-${i}`,label:ni,rightIcon:Ra,variant:be.Text,size:fe.S,onClick:e=>{e.stopPropagation(),c()}})})]})]})},ng=({strategy:n,onStrategyChange:i,onBack:a,onNext:l,docsUrl:r})=>{const s=v(),c=r?()=>window.open(r,"_blank"):void 0;return e(o,{children:[t($m,{title:Xn,onBack:a}),e(km,{$width:854,children:[t(Bm,{children:Un}),e(Km,{children:[t(og,{selected:"keep-list"===n,onSelect:()=>i("keep-list"),name:Kn,description:Wn,badgeProps:{label:Gn,backgroundColor:s.v2.colors.purple[500],textColor:s.v2.colors.white[500]},bullets:[Hn,jn],warning:Vn,onReadMore:c}),t(og,{selected:"drop-list"===n,onSelect:()=>i("drop-list"),name:Qn,description:Zn,badgeProps:{label:Jn,backgroundColor:s.v2.colors.green[500],textColor:s.v2.colors.black[500]},bullets:[Yn,qn],onReadMore:c}),t(og,{selected:"advanced"===n,onSelect:()=>i("advanced"),name:oi,description:ti,badgeProps:{label:ei,backgroundColor:s.v2.colors.blue[700],textColor:s.v2.colors.white[500]},onReadMore:c})]})]}),t(Im,{onNext:l})]})},ig=({onBack:n,onNext:i,submitting:l})=>{const r=v(),s=a(()=>[{title:ri,bullets:[ii,ai,li]},{title:hi,bullets:[si,ci,di,pi,ui]}],[]);return e(o,{children:[t($m,{title:mi,onBack:n}),e(km,{$width:854,children:[t(Bm,{children:gi}),t(me,{$gap:16,$width:"100%",$alignItems:"stretch",children:s.map((o,n)=>e(Am,{fillHeight:!0,width:"50%",children:[t(pe,{size:he.XS,color:r.v2.colors.white[500],children:o.title}),t(_m,{items:o.bullets})]},n))}),t(Lm,{message:fi})]}),t(Im,{onNext:i,nextLoading:l})]})},ag=b.div`
1016
1027
  white-space: pre-line;
1017
- `,Qm=({errorPresetEnabled:n,onErrorPresetChange:i,onBack:l,onNext:r,submitting:s})=>{const c=v(),d=a(()=>R(n?{disabled:!1}:null),[n]);return e(o,{children:[t(xm,{title:fi,onBack:l}),e(vm,{$width:854,children:[t(Dm,{children:bi}),e(ee,{$gap:8,$width:"100%",children:[e(Tm,{children:[t(Zm,{children:t(ue,{size:he.XXS,color:c.v2.colors.silver[200],children:vi})}),t($m,{message:gi})]}),e(Om,{children:[e(Am,{children:[t(ue,{size:he.S,weight:500,color:c.v2.colors.white[500],children:yi}),t(il,{size:16,fill:c.v2.colors.silver[200]})]}),t(Rm,{children:t(mm,{name:Si,recommended:!0,toggleLabel:Ci,enabled:n,onEnabledChange:i,summary:d,toggleName:"sampling-onboarding-drop-error-preset-toggle"})})]})]})]}),t(Cm,{onNext:r,nextLoading:s})]})},eg=b.div`
1028
+ `,lg=({errorPresetEnabled:n,onErrorPresetChange:i,onBack:l,onNext:r,submitting:s})=>{const c=v(),d=a(()=>R(n?{disabled:!1}:null),[n]);return e(o,{children:[t($m,{title:bi,onBack:l}),e(km,{$width:854,children:[t(Bm,{children:vi}),e(ee,{$gap:8,$width:"100%",children:[e(Am,{children:[t(ag,{children:t(pe,{size:he.XXS,color:c.v2.colors.silver[200],children:yi})}),t(Lm,{message:fi})]}),e(Fm,{children:[e(Mm,{children:[t(pe,{size:he.S,weight:500,color:c.v2.colors.white[500],children:Ci}),t(al,{size:16,fill:c.v2.colors.silver[200]})]}),t(zm,{children:t(Sm,{name:xi,recommended:!0,toggleLabel:Si,enabled:n,onEnabledChange:i,summary:d,toggleName:"sampling-onboarding-drop-error-preset-toggle"})})]})]})]}),t(Im,{onNext:r,nextLoading:s})]})},rg=b.div`
1018
1029
  white-space: pre-line;
1019
- `,tg=b.div`
1030
+ `,sg=b.div`
1020
1031
  width: fit-content;
1021
- `,og=["50","25","10","1","0.1"],ng=({value:o,onChange:n,label:i})=>{const l=v(),r=a(()=>og.map(e=>({value:e,label:`${e}%`,selectedBgColor:l.v2.colors.purple[900],selectedBorderColor:l.v2.colors.purple[400]})),[l]);return e(ee,{$gap:8,children:[t(ue,{size:he.XS,color:l.v2.colors.white[500],children:i}),t(tg,{children:t(ve,{"data-id":"sampling-onboarding-ambient",options:r,selected:o,setSelected:n})})]})},ig=({errorPresetEnabled:n,onErrorPresetChange:i,ambientPercentage:l,onAmbientPercentageChange:r,onBack:s,onNext:c,submitting:d})=>{const u=v(),p=a(()=>R(n?{disabled:!1}:null),[n]);return e(o,{children:[t(xm,{title:xi,onBack:s}),e(vm,{$width:854,children:[t(Dm,{children:wi}),e(ee,{$gap:8,$width:"100%",children:[e(Tm,{children:[t(eg,{children:t(ue,{size:he.XXS,color:u.v2.colors.silver[200],children:Ti})}),t(Im,{items:[ki,Ei,Ii,Ni,$i]}),t($m,{message:gi})]}),e(Om,{children:[e(Am,{children:[t(ue,{size:he.S,weight:500,color:u.v2.colors.white[500],children:Oi}),t(il,{size:16,fill:u.v2.colors.silver[200]})]}),t(Rm,{children:t(mm,{name:Si,recommended:!0,toggleLabel:Ci,enabled:n,onEnabledChange:i,summary:p,toggleName:"sampling-onboarding-error-preset-toggle"})}),t(Rm,{children:t(ng,{value:l,onChange:r,label:Ai})})]})]})]}),t(Cm,{onNext:c,nextLoading:d})]})},ag=({isOpen:e,onClose:o,k8sHealthProbesConfig:n,samplingId:a,docsUrl:l})=>{const{samplingApi:c}=Pl(),[d,u]=s("welcome"),[p,h]=s(!0),[m,g]=s("keep-list"),[f,b]=s(!0),[v,y]=s("25"),[C,S]=s(!1);i(()=>{e&&(u("welcome"),h(n?.enabled??!0),g("keep-list"),b(!0),y("25"),S(!1))},[e,n?.enabled]);const x=r(async()=>{const e=a??"default",t=[];if(p!==(n?.enabled??!1)){const e=c.updateK8sHealthProbesConfig;e&&t.push(e({enabled:p,keepPercentage:n?.keepPercentage??0}))}if("advanced"!==m&&f){const o=c.createHighlyRelevant;o&&t.push(o({samplingId:e,rule:{name:"Auto - Keep All Error Traces",disabled:!1,error:!0,sourceScopes:null,operation:null,percentageAtLeast:null}}))}if("keep-list"===m){const o=c.createCostReduction;o&&t.push(o({samplingId:e,rule:{name:"Onboarding - Ambient sampling",disabled:!1,sourceScopes:null,operation:null,percentageAtMost:parseFloat(v)}}))}S(!0);try{await Promise.all(t),u("success")}catch{}finally{S(!1)}},[a,c,p,n?.enabled,n?.keepPercentage,m,f,v]);let w=null;switch(d){case"welcome":w=t(Bm,{onSkip:o,onNext:()=>u("noisy")});break;case"noisy":w=t(Pm,{enabled:p,onEnabledChange:h,onBack:()=>u("welcome"),onNext:()=>u("strategy")});break;case"strategy":w=t(qm,{strategy:m,onStrategyChange:g,onBack:()=>u("noisy"),onNext:()=>{u("keep-list"===m?"keep-list":"drop-list"===m?"drop-list":"advanced")},docsUrl:l});break;case"keep-list":w=t(ig,{errorPresetEnabled:f,onErrorPresetChange:b,ambientPercentage:v,onAmbientPercentageChange:y,onBack:()=>u("strategy"),onNext:x,submitting:C});break;case"drop-list":w=t(Qm,{errorPresetEnabled:f,onErrorPresetChange:b,onBack:()=>u("strategy"),onNext:x,submitting:C});break;case"advanced":w=t(Jm,{onBack:()=>u("strategy"),onNext:x,submitting:C});break;case"success":w=t(Fm,{onClose:o})}return t(cn,{isOpen:e,onClose:o,children:w})};var lg,rg;(e=>{e.BulkConfig="bulk-config",e.BulkSource="bulk-source",e.BulkDestination="bulk-destination",e.BulkAction="bulk-action",e.BulkInstrumentationRule="bulk-instrumentation-rule",e.Delete="delete"})(lg||(lg={})),(e=>{e.K8s="k8s",e.VmAgent="vm-agent",e.CloudConnector="cloud-connector"})(rg||(rg={}));const sg=[{id:rg.CloudConnector,label:"Cloud Connector"}];var cg;(e=>{e.Id="id",e.Name="name",e.Type="type",e.Status="status",e.OdigosVersion="odigosVersion",e.ConnectedSince="connectedSince",e.LastActivity="lastActivity"})(cg||(cg={}));const dg=[{key:cg.Name,label:"Name"},{key:cg.Type,label:"Type"},{key:cg.Status,label:"Status"},{key:cg.OdigosVersion,label:"Odigos Version"},{key:cg.ConnectedSince,label:"Connected Since"},{key:cg.LastActivity,label:"Last Activity"}],ug=(e,t)=>{const o=e.find(e=>e.key===cg.Id)?.rawValue;return t(o?.toString()||"")},pg={[Fe.Success]:"Connected",[Fe.Warning]:"Degraded",[Fe.Error]:"Error",[Fe.Disabled]:"Disabled",[Fe.Info]:"Pending"},hg={[Ri.K8s]:ro.Purple,[Ri.Vm]:ro.Blue,[Ri.Connector]:ro.Green},mg=({connections:o,getConnections:n,onClickConnection:l,deleteConnection:c,onCreateNew:d,cloudConnectorProviders:u,onCreateCloudConnector:p,configMinSupportedVersion:h=0,snapshotMinSupportedVersion:m=0})=>{const g=v(),{formatTimeAgo:f}=Qt(),{capabilities:b}=Pl(),[y,C]=s(!1),[S,x]=s(o||[]),w=r(async()=>{try{C(!0),x(await n()??[])}catch(e){}finally{C(!1)}},[]);i(()=>{S.length||w()},[]);const[T,k]=s(""),[E,I]=s(null),[N,$]=s([]),[O,A]=s(!1),[R,P]=s(!1),L=r(()=>{A(!1),P(!0),w()},[w]),F=r(e=>{e===rg.CloudConnector?A(!0):d?.(e)},[d]),M=a(()=>E===lg.BulkConfig?h:E===lg.BulkSource?m:0,[E,h,m]),{supportedConnections:z,supportedConnectionIds:B}=a(()=>{const e=((e,t)=>e.filter(e=>{const o=e.status===Fe.Success,n=D(e.odigosVersion,t,e.type);return o&&n}))(S,M);return{supportedConnections:e,supportedConnectionIds:e.map(e=>e.id)}},[S,M]);i(()=>{if(!E||E===lg.Delete)return;const e=N.filter(e=>!B.includes(e));e.length&&$(t=>t.filter(t=>!e.includes(t)))},[E,N.length,B.length]);const X=a(()=>S.filter(e=>!T||e.name.toLowerCase().includes(T.toLowerCase())).map(e=>({cells:[{key:cg.Id,rawValue:e.id},{key:cg.Name,rawValue:e.name},{key:cg.Type,rawValue:e.type,component:()=>t(Jt,{variant:hg[e.type]??ro.Default,label:Di(e.type)})},{key:cg.Status,rawValue:e.status,component:()=>(e=>{if(e.type===Ri.Connector){const o=pg[e.status]??"Pending",n=e.status===Fe.Success?Xa:e.status===Fe.Error?Ua:void 0;return t(qe,{status:e.status,label:o,leftIcon:n})}const o=e.status===Fe.Success?"Connection live":"Connection lost",n=e.status===Fe.Success?Xa:Ua;return t(qe,{status:e.status,label:o,leftIcon:n})})(e)},{key:cg.OdigosVersion,rawValue:e.odigosVersion},{key:cg.ConnectedSince,rawValue:e.connectedAt?f(e.connectedAt):"-"},{key:cg.LastActivity,rawValue:e.lastSeenAt?f(e.lastSeenAt):"-"}],onClick:e.status!==Fe.Success||E?void 0:()=>l(e),isSelected:N.includes(e.id),onSelect:()=>$(t=>Array.from(new Set([...t,e.id]))),onDeselect:()=>$(t=>t.filter(t=>t!==e.id)),hideCheckbox:e.status!==Fe.Success||E===lg.BulkConfig&&!D(e.odigosVersion,h,e.type)||E===lg.BulkSource&&!D(e.odigosVersion,m,e.type)})),[S,N,T,E,h,m,f,l]),U=a(()=>S.length>0&&S.every(e=>e.type===Ri.K8s),[S]),V=a(()=>{const e=(e,t)=>{$([e]),I(t)};return(e=>{const{connections:t,configMinSupportedVersion:o,snapshotMinSupportedVersion:n,onDelete:i,onAddSource:a,onAddDestination:l,onAddAction:r,onAddInstrumentationRule:s,onEditConfiguration:c}=e;return({cells:e})=>{if(!(e=>e.find(e=>e.key===cg.Status)?.rawValue===Fe.Success)(e))return[{id:sn(),label:"Delete Connection",rightIcon:Ra,onClick:()=>ug(e,i)}];const d=ug(e,e=>t.find(t=>t.id===e));if(d?.type!==Ri.K8s)return[];const u=!!d&&D(d.odigosVersion,o,d.type),p=!!d&&D(d.odigosVersion,n,d.type),h=_(o,d?.type),m=_(n,d?.type),g=[];return a&&g.push({id:sn(),tooltip:p?et.ADD_SOURCE:`To use this feature, please upgrade to Odigos v${m} or later.`,rightIcon:Ha,disabled:!p,onClick:()=>ug(e,a)}),l&&g.push({id:sn(),tooltip:et.ADD_DESTINATION,rightIcon:Ma,onClick:()=>ug(e,l)}),r&&g.push({id:sn(),tooltip:et.ADD_ACTION,rightIcon:Fa,onClick:()=>ug(e,r)}),s&&g.push({id:sn(),tooltip:et.ADD_INSTRUMENTATION_RULE,rightIcon:Va,onClick:()=>ug(e,s)}),c&&g.push({id:sn(),tooltip:u?"Edit Configuration":`To use this feature, please upgrade to Odigos v${h} or later.`,rightIcon:Qa,disabled:!u,onClick:()=>ug(e,c)}),g}})({connections:S,configMinSupportedVersion:h,snapshotMinSupportedVersion:m,onDelete:t=>e(t,lg.Delete),onAddSource:b.canFetchSnapshots&&b.canBulkPersistSources?t=>e(t,lg.BulkSource):void 0,onAddDestination:b.canFetchDestinationCategories&&b.canFetchPotentialDestinations&&b.canCreateDestination?t=>e(t,lg.BulkDestination):void 0,onAddAction:b.canCreateAction?t=>e(t,lg.BulkAction):void 0,onAddInstrumentationRule:b.canCreateInstrumentationRule?t=>e(t,lg.BulkInstrumentationRule):void 0,onEditConfiguration:b.canApplyEffectiveConfig?t=>e(t,lg.BulkConfig):void 0})},[S,h,m,b]),H=a(()=>(e=>{const{onCancel:t,onAddSource:o,onAddDestination:n,onAddAction:i,onAddInstrumentationRule:a,onManageConfigurations:l}=e,r=[];o&&r.push({id:sn(),type:co.Button,buttonProps:{variant:be.Primary,size:fe.S,label:"Add Sources",rightIcon:Ha,onClick:o}});const s=[n?{id:lg.BulkDestination,label:et.ADD_DESTINATION,icon:Ma}:null,i?{id:lg.BulkAction,label:et.ADD_ACTION,icon:Fa}:null,a?{id:lg.BulkInstrumentationRule,label:et.ADD_INSTRUMENTATION_RULE,icon:Va}:null,l?{id:lg.BulkConfig,label:"Manage Configurations",icon:Qa}:null];return s.some(Boolean)&&r.push({id:sn(),type:co.ButtonDropData,buttonProps:{variant:be.Secondary,size:fe.S,label:"Bulk Operations",onClick:e=>{e===lg.BulkSource?o?.():e===lg.BulkDestination?n?.():e===lg.BulkAction?i?.():e===lg.BulkInstrumentationRule?a?.():e===lg.BulkConfig&&l?.()}},dropDataProps:{alignX:rn.Left,items:s}}),r.push({id:sn(),type:co.Button,buttonProps:{variant:be.Text,size:fe.S,label:Ft.CANCEL,onClick:t}}),r})({onCancel:()=>$([]),onAddSource:b.canFetchSnapshots&&b.canBulkPersistSources?()=>I(lg.BulkSource):void 0,onAddDestination:b.canFetchDestinationCategories&&b.canFetchPotentialDestinations&&b.canCreateDestination?()=>I(lg.BulkDestination):void 0,onAddAction:b.canCreateAction?()=>I(lg.BulkAction):void 0,onAddInstrumentationRule:b.canCreateInstrumentationRule?()=>I(lg.BulkInstrumentationRule):void 0,onManageConfigurations:b.canApplyEffectiveConfig?()=>I(lg.BulkConfig):void 0}),[b]);return t(_i,{children:e(dt,{fullHeight:!0,richTitle:{icon:Tl,title:et.CONNECTIONS,badge:{label:S.length.toString(),status:Fe.Unknown}},search:{placeholder:"Search by cluster name",value:T,onChange:e=>k(e),width:"300px"},actions:[{id:"connections-refresh",type:co.Button,buttonProps:{variant:be.Secondary,size:fe.S,leftIcon:Za,onClick:w,disabled:y}},{id:"connections-create-new",type:co.ButtonDropData,buttonProps:{variant:be.Primary,size:fe.S,label:Ft.CREATE_NEW,onClick:e=>F(e)},dropDataProps:{alignX:rn.Right,items:sg}}],children:[t(Oo,{variant:Ao.Pretty,headerBackgroundColor:g.v2.colors.silver[1e3],isLoading:y,withCheckboxes:U,columns:dg,rows:X,rowActionsPushRightPosition:E?`calc(${br} - 24px)`:void 0,getRowActions:V}),E===lg.BulkConfig&&b.canApplyEffectiveConfig&&t(Yl,{connectionIds:N,children:t(Cu,{onClose:()=>I(null),connections:z,selectedConnectionIds:N,setSelectedConnectionIds:$})}),E===lg.BulkSource&&b.canFetchSnapshots&&b.canBulkPersistSources&&t(Yl,{connectionIds:N,children:t(ql,{selectedConnectionIds:N,children:t(Pc,{onClose:()=>I(null),selectedConnectionIds:N,setSelectedConnectionIds:$})})}),E===lg.BulkDestination&&b.canFetchDestinationCategories&&b.canFetchPotentialDestinations&&b.canTestConnection&&b.canCreateDestination&&t(Yl,{connectionIds:N,children:t(Jl,{children:t(Cc,{onClose:()=>I(null),selectedConnectionIds:N,setSelectedConnectionIds:$})})}),E===lg.BulkAction&&b.canCreateAction&&t(Yl,{connectionIds:N,children:t(Zl,{children:t(dc,{onClose:()=>I(null),selectedConnectionIds:N,setSelectedConnectionIds:$})})}),E===lg.BulkInstrumentationRule&&b.canCreateInstrumentationRule&&t(Yl,{connectionIds:N,children:t(Ql,{children:t(Sc,{onClose:()=>I(null),selectedConnectionIds:N,setSelectedConnectionIds:$})})}),O&&t(er,{providers:u,children:t(bu,{onClose:()=>A(!1),withOverlay:!0,onCreateCloudConnector:p,onCreated:L})}),t(xr,{isOpen:R,onClose:()=>P(!1)}),t(yr,{target:"connection",isOpen:E===lg.Delete,onClose:()=>{$([]),I(null)},onApprove:async()=>{const e=N[0];e&&(await c(e),await w())}}),t(Ro,{isOpen:!!N.length&&!E,richTitle:{icon:$a,title:"Selected Clusters",badge:{label:N.length}},actions:H})]})})},gg=b.div`
1032
+ `,cg=["50","25","10","1","0.1"],dg=({value:o,onChange:n,label:i})=>{const l=v(),r=a(()=>cg.map(e=>({value:e,label:`${e}%`,selectedBgColor:l.v2.colors.purple[900],selectedBorderColor:l.v2.colors.purple[400]})),[l]);return e(ee,{$gap:8,children:[t(pe,{size:he.XS,color:l.v2.colors.white[500],children:i}),t(sg,{children:t(ve,{"data-id":"sampling-onboarding-ambient",options:r,selected:o,setSelected:n})})]})},pg=({errorPresetEnabled:n,onErrorPresetChange:i,ambientPercentage:l,onAmbientPercentageChange:r,onBack:s,onNext:c,submitting:d})=>{const p=v(),u=a(()=>R(n?{disabled:!1}:null),[n]);return e(o,{children:[t($m,{title:wi,onBack:s}),e(km,{$width:854,children:[t(Bm,{children:Ti}),e(ee,{$gap:8,$width:"100%",children:[e(Am,{children:[t(rg,{children:t(pe,{size:he.XXS,color:p.v2.colors.silver[200],children:ki})}),t(_m,{items:[Ei,Ii,Ni,$i,Oi]}),t(Lm,{message:fi})]}),e(Fm,{children:[e(Mm,{children:[t(pe,{size:he.S,weight:500,color:p.v2.colors.white[500],children:Ai}),t(al,{size:16,fill:p.v2.colors.silver[200]})]}),t(zm,{children:t(Sm,{name:xi,recommended:!0,toggleLabel:Si,enabled:n,onEnabledChange:i,summary:u,toggleName:"sampling-onboarding-error-preset-toggle"})}),t(zm,{children:t(dg,{value:l,onChange:r,label:Ri})})]})]})]}),t(Im,{onNext:c,nextLoading:d})]})},ug=({isOpen:e,onClose:o,k8sHealthProbesConfig:n,samplingId:a,docsUrl:l})=>{const{samplingApi:c}=Ll(),[d,p]=s("welcome"),[u,h]=s(!0),[m,g]=s("keep-list"),[f,b]=s(!0),[v,y]=s("25"),[C,S]=s(!1);i(()=>{e&&(p("welcome"),h(n?.enabled??!0),g("keep-list"),b(!0),y("25"),S(!1))},[e,n?.enabled]);const x=r(async()=>{const e=a??"default",t=[];if(u!==(n?.enabled??!1)){const e=c.updateK8sHealthProbesConfig;e&&t.push(e({enabled:u,keepPercentage:n?.keepPercentage??0}))}if("advanced"!==m&&f){const o=c.createHighlyRelevant;o&&t.push(o({samplingId:e,rule:{name:"Auto - Keep All Error Traces",disabled:!1,error:!0,sourceScopes:null,operation:null,percentageAtLeast:null}}))}if("keep-list"===m){const o=c.createCostReduction;o&&t.push(o({samplingId:e,rule:{name:"Onboarding - Ambient sampling",disabled:!1,sourceScopes:null,operation:null,percentageAtMost:parseFloat(v)}}))}S(!0);try{await Promise.all(t),p("success")}catch{}finally{S(!1)}},[a,c,u,n?.enabled,n?.keepPercentage,m,f,v]);let w=null;switch(d){case"welcome":w=t(Wm,{onSkip:o,onNext:()=>p("noisy")});break;case"noisy":w=t(Um,{enabled:u,onEnabledChange:h,onBack:()=>p("welcome"),onNext:()=>p("strategy")});break;case"strategy":w=t(ng,{strategy:m,onStrategyChange:g,onBack:()=>p("noisy"),onNext:()=>{p("keep-list"===m?"keep-list":"drop-list"===m?"drop-list":"advanced")},docsUrl:l});break;case"keep-list":w=t(pg,{errorPresetEnabled:f,onErrorPresetChange:b,ambientPercentage:v,onAmbientPercentageChange:y,onBack:()=>p("strategy"),onNext:x,submitting:C});break;case"drop-list":w=t(lg,{errorPresetEnabled:f,onErrorPresetChange:b,onBack:()=>p("strategy"),onNext:x,submitting:C});break;case"advanced":w=t(ig,{onBack:()=>p("strategy"),onNext:x,submitting:C});break;case"success":w=t(Hm,{onClose:o})}return t(dn,{isOpen:e,onClose:o,children:w})};var hg,mg;(e=>{e.BulkConfig="bulk-config",e.BulkSource="bulk-source",e.BulkDestination="bulk-destination",e.BulkAction="bulk-action",e.BulkInstrumentationRule="bulk-instrumentation-rule",e.Delete="delete"})(hg||(hg={})),(e=>{e.K8s="k8s",e.VmAgent="vm-agent",e.CloudConnector="cloud-connector"})(mg||(mg={}));const gg=[{id:mg.CloudConnector,label:"Cloud Connector"}];var fg;(e=>{e.Id="id",e.Name="name",e.Type="type",e.Status="status",e.OdigosVersion="odigosVersion",e.ConnectedSince="connectedSince",e.LastActivity="lastActivity"})(fg||(fg={}));const bg=[{key:fg.Name,label:"Name"},{key:fg.Type,label:"Type"},{key:fg.Status,label:"Status"},{key:fg.OdigosVersion,label:"Odigos Version"},{key:fg.ConnectedSince,label:"Connected Since"},{key:fg.LastActivity,label:"Last Activity"}],vg=(e,t)=>{const o=e.find(e=>e.key===fg.Id)?.rawValue;return t(o?.toString()||"")},yg={[Fe.Success]:"Connected",[Fe.Warning]:"Degraded",[Fe.Error]:"Error",[Fe.Disabled]:"Disabled",[Fe.Info]:"Pending"},Cg={[Di.K8s]:ro.Purple,[Di.Vm]:ro.Blue,[Di.Connector]:ro.Green},Sg=({connections:o,getConnections:n,onClickConnection:l,deleteConnection:c,onCreateNew:d,cloudConnectorProviders:p,onCreateCloudConnector:u,configMinSupportedVersion:h=0,snapshotMinSupportedVersion:m=0})=>{const g=v(),{formatTimeAgo:f}=Qt(),{capabilities:b}=Ll(),[y,C]=s(!1),[S,x]=s(o||[]),w=r(async()=>{try{C(!0),x(await n()??[])}catch(e){}finally{C(!1)}},[]);i(()=>{S.length||w()},[]);const[T,k]=s(""),[E,I]=s(null),[N,$]=s([]),[O,A]=s(!1),[R,P]=s(!1),L=r(()=>{A(!1),P(!0),w()},[w]),F=r(e=>{e===mg.CloudConnector?A(!0):d?.(e)},[d]),M=a(()=>E===hg.BulkConfig?h:E===hg.BulkSource?m:0,[E,h,m]),{supportedConnections:z,supportedConnectionIds:B}=a(()=>{const e=((e,t)=>e.filter(e=>{const o=e.status===Fe.Success,n=D(e.odigosVersion,t,e.type);return o&&n}))(S,M);return{supportedConnections:e,supportedConnectionIds:e.map(e=>e.id)}},[S,M]);i(()=>{if(!E||E===hg.Delete)return;const e=N.filter(e=>!B.includes(e));e.length&&$(t=>t.filter(t=>!e.includes(t)))},[E,N.length,B.length]);const X=a(()=>S.filter(e=>!T||e.name.toLowerCase().includes(T.toLowerCase())).map(e=>({cells:[{key:fg.Id,rawValue:e.id},{key:fg.Name,rawValue:e.name},{key:fg.Type,rawValue:e.type,component:()=>t(Jt,{variant:Cg[e.type]??ro.Default,label:_i(e.type)})},{key:fg.Status,rawValue:e.status,component:()=>(e=>{if(e.type===Di.Connector){const o=yg[e.status]??"Pending",n=e.status===Fe.Success?Ua:e.status===Fe.Error?Va:void 0;return t(qe,{status:e.status,label:o,leftIcon:n})}const o=e.status===Fe.Success?"Connection live":"Connection lost",n=e.status===Fe.Success?Ua:Va;return t(qe,{status:e.status,label:o,leftIcon:n})})(e)},{key:fg.OdigosVersion,rawValue:e.odigosVersion},{key:fg.ConnectedSince,rawValue:e.connectedAt?f(e.connectedAt):"-"},{key:fg.LastActivity,rawValue:e.lastSeenAt?f(e.lastSeenAt):"-"}],onClick:e.status!==Fe.Success||E?void 0:()=>l(e),isSelected:N.includes(e.id),onSelect:()=>$(t=>Array.from(new Set([...t,e.id]))),onDeselect:()=>$(t=>t.filter(t=>t!==e.id)),hideCheckbox:e.status!==Fe.Success||E===hg.BulkConfig&&!D(e.odigosVersion,h,e.type)||E===hg.BulkSource&&!D(e.odigosVersion,m,e.type)})),[S,N,T,E,h,m,f,l]),U=a(()=>S.length>0&&S.every(e=>e.type===Di.K8s),[S]),V=a(()=>{const e=(e,t)=>{$([e]),I(t)};return(e=>{const{connections:t,configMinSupportedVersion:o,snapshotMinSupportedVersion:n,onDelete:i,onAddSource:a,onAddDestination:l,onAddAction:r,onAddInstrumentationRule:s,onEditConfiguration:c}=e;return({cells:e})=>{if(!(e=>e.find(e=>e.key===fg.Status)?.rawValue===Fe.Success)(e))return[{id:cn(),label:"Delete Connection",rightIcon:Da,onClick:()=>vg(e,i)}];const d=vg(e,e=>t.find(t=>t.id===e));if(d?.type!==Di.K8s)return[];const p=!!d&&D(d.odigosVersion,o,d.type),u=!!d&&D(d.odigosVersion,n,d.type),h=_(o,d?.type),m=_(n,d?.type),g=[];return a&&g.push({id:cn(),tooltip:u?et.ADD_SOURCE:`To use this feature, please upgrade to Odigos v${m} or later.`,rightIcon:ja,disabled:!u,onClick:()=>vg(e,a)}),l&&g.push({id:cn(),tooltip:et.ADD_DESTINATION,rightIcon:za,onClick:()=>vg(e,l)}),r&&g.push({id:cn(),tooltip:et.ADD_ACTION,rightIcon:Ma,onClick:()=>vg(e,r)}),s&&g.push({id:cn(),tooltip:et.ADD_INSTRUMENTATION_RULE,rightIcon:Ha,onClick:()=>vg(e,s)}),c&&g.push({id:cn(),tooltip:p?"Edit Configuration":`To use this feature, please upgrade to Odigos v${h} or later.`,rightIcon:el,disabled:!p,onClick:()=>vg(e,c)}),g}})({connections:S,configMinSupportedVersion:h,snapshotMinSupportedVersion:m,onDelete:t=>e(t,hg.Delete),onAddSource:b.canFetchSnapshots&&b.canBulkPersistSources?t=>e(t,hg.BulkSource):void 0,onAddDestination:b.canFetchDestinationCategories&&b.canFetchPotentialDestinations&&b.canCreateDestination?t=>e(t,hg.BulkDestination):void 0,onAddAction:b.canCreateAction?t=>e(t,hg.BulkAction):void 0,onAddInstrumentationRule:b.canCreateInstrumentationRule?t=>e(t,hg.BulkInstrumentationRule):void 0,onEditConfiguration:b.canApplyEffectiveConfig?t=>e(t,hg.BulkConfig):void 0})},[S,h,m,b]),H=a(()=>(e=>{const{onCancel:t,onAddSource:o,onAddDestination:n,onAddAction:i,onAddInstrumentationRule:a,onManageConfigurations:l}=e,r=[];o&&r.push({id:cn(),type:co.Button,buttonProps:{variant:be.Primary,size:fe.S,label:"Add Sources",rightIcon:ja,onClick:o}});const s=[n?{id:hg.BulkDestination,label:et.ADD_DESTINATION,icon:za}:null,i?{id:hg.BulkAction,label:et.ADD_ACTION,icon:Ma}:null,a?{id:hg.BulkInstrumentationRule,label:et.ADD_INSTRUMENTATION_RULE,icon:Ha}:null,l?{id:hg.BulkConfig,label:"Manage Configurations",icon:el}:null];return s.some(Boolean)&&r.push({id:cn(),type:co.ButtonDropData,buttonProps:{variant:be.Secondary,size:fe.S,label:"Bulk Operations",onClick:e=>{e===hg.BulkSource?o?.():e===hg.BulkDestination?n?.():e===hg.BulkAction?i?.():e===hg.BulkInstrumentationRule?a?.():e===hg.BulkConfig&&l?.()}},dropDataProps:{alignX:sn.Left,items:s}}),r.push({id:cn(),type:co.Button,buttonProps:{variant:be.Text,size:fe.S,label:Ft.CANCEL,onClick:t}}),r})({onCancel:()=>$([]),onAddSource:b.canFetchSnapshots&&b.canBulkPersistSources?()=>I(hg.BulkSource):void 0,onAddDestination:b.canFetchDestinationCategories&&b.canFetchPotentialDestinations&&b.canCreateDestination?()=>I(hg.BulkDestination):void 0,onAddAction:b.canCreateAction?()=>I(hg.BulkAction):void 0,onAddInstrumentationRule:b.canCreateInstrumentationRule?()=>I(hg.BulkInstrumentationRule):void 0,onManageConfigurations:b.canApplyEffectiveConfig?()=>I(hg.BulkConfig):void 0}),[b]);return t(Pi,{children:e(dt,{fullHeight:!0,richTitle:{icon:kl,title:et.CONNECTIONS,badge:{label:S.length.toString(),status:Fe.Unknown}},search:{placeholder:"Search by cluster name",value:T,onChange:e=>k(e),width:"300px"},actions:[{id:"connections-refresh",type:co.Button,buttonProps:{variant:be.Secondary,size:fe.S,leftIcon:Qa,onClick:w,disabled:y}},{id:"connections-create-new",type:co.ButtonDropData,buttonProps:{variant:be.Primary,size:fe.S,label:Ft.CREATE_NEW,onClick:e=>F(e)},dropDataProps:{alignX:sn.Right,items:gg}}],children:[t(Ao,{variant:Ro.Pretty,headerBackgroundColor:g.v2.colors.silver[1e3],isLoading:y,withCheckboxes:U,columns:bg,rows:X,rowActionsPushRightPosition:E?`calc(${vr} - 24px)`:void 0,getRowActions:V}),E===hg.BulkConfig&&b.canApplyEffectiveConfig&&t(ql,{connectionIds:N,children:t(Sp,{onClose:()=>I(null),connections:z,selectedConnectionIds:N,setSelectedConnectionIds:$})}),E===hg.BulkSource&&b.canFetchSnapshots&&b.canBulkPersistSources&&t(ql,{connectionIds:N,children:t(Jl,{selectedConnectionIds:N,children:t(Lc,{onClose:()=>I(null),selectedConnectionIds:N,setSelectedConnectionIds:$})})}),E===hg.BulkDestination&&b.canFetchDestinationCategories&&b.canFetchPotentialDestinations&&b.canTestConnection&&b.canCreateDestination&&t(ql,{connectionIds:N,children:t(Zl,{children:t(Sc,{onClose:()=>I(null),selectedConnectionIds:N,setSelectedConnectionIds:$})})}),E===hg.BulkAction&&b.canCreateAction&&t(ql,{connectionIds:N,children:t(Ql,{children:t(pc,{onClose:()=>I(null),selectedConnectionIds:N,setSelectedConnectionIds:$})})}),E===hg.BulkInstrumentationRule&&b.canCreateInstrumentationRule&&t(ql,{connectionIds:N,children:t(er,{children:t(xc,{onClose:()=>I(null),selectedConnectionIds:N,setSelectedConnectionIds:$})})}),O&&t(tr,{providers:p,children:t(vp,{onClose:()=>A(!1),withOverlay:!0,onCreateCloudConnector:u,onCreated:L})}),t(wr,{isOpen:R,onClose:()=>P(!1)}),t(Cr,{target:"connection",isOpen:E===hg.Delete,onClose:()=>{$([]),I(null)},onApprove:async()=>{const e=N[0];e&&(await c(e),await w())}}),t(Do,{isOpen:!!N.length&&!E,richTitle:{icon:Oa,title:"Selected Clusters",badge:{label:N.length}},actions:H})]})})},xg=b.div`
1022
1033
  display: flex;
1023
1034
  align-items: center;
1024
1035
  justify-content: space-between;
@@ -1027,26 +1038,26 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import n,{useEff
1027
1038
  width: 100%;
1028
1039
  border-radius: 16px;
1029
1040
  background-color: ${({theme:e})=>e.v2.colors.silver[800]};
1030
- `,fg=b.div`
1041
+ `,wg=b.div`
1031
1042
  display: flex;
1032
1043
  align-items: center;
1033
1044
  justify-content: center;
1034
1045
  padding: 8px;
1035
1046
  border-radius: 8px;
1036
- background-color: ${({theme:e})=>e.v2.colors.white[500]+pt["004"]};
1037
- `,bg=({setStep:o,onSave:n,sourcesPayload:i,destinationsPayload:l,disableAnimation:r})=>{const s=v(),c=()=>o(2),d=()=>o(3),u=a(()=>Object.values(i||{}).flatMap((o,n)=>o.map((o,i)=>{if(!o.selected)return null;const a=o.kind||Et.Namespace,l=a===Et.Namespace?o.namespace:`${o.namespace} → ${o.name}`;return e(gg,{children:[t(ue,{nowrap:!0,children:l}),t(qe,{label:a,status:Fe.Info,backgroundColor:s.v2.colors.blue[900]})]},`source-${n}-${i}`)})).filter(Boolean),[i]),p=a(()=>l?.map((o,n)=>{const i=wt(o.option.type).icon;return e(gg,{children:[e(me,{$gap:8,children:[i&&t(fg,{children:t(i,{size:24})}),t(ue,{nowrap:!0,children:o.formData.name||o.option.displayName})]}),void 0!==o.testResult&&t(qe,{status:o.testResult.succeeded?Fe.Success:Fe.Error,leftIcon:o.testResult.succeeded?Xa:Ua})]},`destination-${n}`)})||[],[l]);return t(fr,{isOpen:!0,disableAnimation:r,onBack:()=>o(3),onSave:n,header:{icon:tl,title:et.SUMMARY,subTitle:et.REVIEW_SETUP},leftColumn:{width:"50%",header:e(me,{$width:"100%",$gap:12,$justifyContent:"space-between",children:[e(me,{$gap:8,children:[t(Ha,{size:24}),t(ue,{nowrap:!0,children:et.SELECTED_SOURCES}),t(qe,{label:u.length})]}),t(ge,{"data-id":"summary-edit-sources",leftIcon:Da,variant:be.Secondary,size:fe.S,onClick:c})]}),list:u.length?u:[t(ft,{$height:"100%",children:t(Re,{icon:Ha,title:et.NO_SOURCES_SELECTED,subTitle:et.ADD_SOURCE_PROMPT,button:{leftIcon:Ia,label:et.ADD_SOURCE,onClick:c}})},"no-sources-data")]},rightColumn:{width:"50%",header:e(me,{$width:"100%",$gap:12,$justifyContent:"space-between",children:[e(me,{$gap:8,children:[t(Ma,{size:24}),t(ue,{nowrap:!0,children:et.SELECTED_DESTINATIONS}),t(qe,{label:p.length})]}),t(ge,{"data-id":"summary-edit-destinations",leftIcon:Da,variant:be.Secondary,size:fe.S,onClick:d})]}),list:p.length?p:[t(ft,{"data-id":"summary-no-destinations",$height:"100%",children:t(Re,{icon:Ma,title:et.NO_DESTINATIONS_SELECTED,subTitle:et.ADD_DESTINATION_PROMPT,button:{leftIcon:Ia,label:et.ADD_DESTINATIONS,onClick:d}})},"no-destinations-data")]}})},vg=b.div`
1047
+ background-color: ${({theme:e})=>e.v2.colors.white[500]+ut["004"]};
1048
+ `,Tg=({setStep:o,onSave:n,sourcesPayload:i,destinationsPayload:l,disableAnimation:r})=>{const s=v(),c=()=>o(2),d=()=>o(3),p=a(()=>Object.values(i||{}).flatMap((o,n)=>o.map((o,i)=>{if(!o.selected)return null;const a=o.kind||Et.Namespace,l=a===Et.Namespace?o.namespace:`${o.namespace} → ${o.name}`;return e(xg,{children:[t(pe,{nowrap:!0,children:l}),t(qe,{label:a,status:Fe.Info,backgroundColor:s.v2.colors.blue[900]})]},`source-${n}-${i}`)})).filter(Boolean),[i]),u=a(()=>l?.map((o,n)=>{const i=wt(o.option.type).icon;return e(xg,{children:[e(me,{$gap:8,children:[i&&t(wg,{children:t(i,{size:24})}),t(pe,{nowrap:!0,children:o.formData.name||o.option.displayName})]}),void 0!==o.testResult&&t(qe,{status:o.testResult.succeeded?Fe.Success:Fe.Error,leftIcon:o.testResult.succeeded?Ua:Va})]},`destination-${n}`)})||[],[l]);return t(br,{isOpen:!0,disableAnimation:r,onBack:()=>o(3),onSave:n,header:{icon:ol,title:et.SUMMARY,subTitle:et.REVIEW_SETUP},leftColumn:{width:"50%",header:e(me,{$width:"100%",$gap:12,$justifyContent:"space-between",children:[e(me,{$gap:8,children:[t(ja,{size:24}),t(pe,{nowrap:!0,children:et.SELECTED_SOURCES}),t(qe,{label:p.length})]}),t(ge,{"data-id":"summary-edit-sources",leftIcon:_a,variant:be.Secondary,size:fe.S,onClick:c})]}),list:p.length?p:[t(ft,{$height:"100%",children:t(Re,{icon:ja,title:et.NO_SOURCES_SELECTED,subTitle:et.ADD_SOURCE_PROMPT,button:{leftIcon:Na,label:et.ADD_SOURCE,onClick:c}})},"no-sources-data")]},rightColumn:{width:"50%",header:e(me,{$width:"100%",$gap:12,$justifyContent:"space-between",children:[e(me,{$gap:8,children:[t(za,{size:24}),t(pe,{nowrap:!0,children:et.SELECTED_DESTINATIONS}),t(qe,{label:u.length})]}),t(ge,{"data-id":"summary-edit-destinations",leftIcon:_a,variant:be.Secondary,size:fe.S,onClick:d})]}),list:u.length?u:[t(ft,{"data-id":"summary-no-destinations",$height:"100%",children:t(Re,{icon:za,title:et.NO_DESTINATIONS_SELECTED,subTitle:et.ADD_DESTINATION_PROMPT,button:{leftIcon:Na,label:et.ADD_DESTINATIONS,onClick:d}})},"no-destinations-data")]}})},kg=b.div`
1038
1049
  position: relative;
1039
1050
  overflow: hidden;
1040
1051
  width: 100vw;
1041
1052
  height: 100vh;
1042
1053
  box-sizing: border-box;
1043
- `,yg=b.svg`
1054
+ `,Eg=b.svg`
1044
1055
  position: absolute;
1045
1056
  top: 50%;
1046
1057
  left: 50%;
1047
1058
  transform: translate(-50%, -50%);
1048
1059
  z-index: -1;
1049
- `,Cg=[{opacity:"0.1"},{offset:"0.31",opacity:"0.11"},{offset:"0.45",opacity:"0.14"},{offset:"0.56",opacity:"0.19"},{offset:"0.65",opacity:"0.26"},{offset:"0.73",opacity:"0.35"},{offset:"0.8",opacity:"0.46"},{offset:"0.86",opacity:"0.6"},{offset:"0.92",opacity:"0.76"},{offset:"0.98",opacity:"0.93"},{offset:"1"}],Sg=[{width:1440,height:900,pathOpacity:.1,path:"M719.992 1169.99C322.351 1169.99 0 847.64 0 450C0 52.3591 322.351 -269.992 719.992 -269.992C1117.63 -269.992 1439.98 52.3591 1439.98 450C1439.98 847.64 1117.63 1169.99 719.992 1169.99Z",gradientTransform:"translate(814.309 444.011) rotate(180) scale(718.904)",stops:[{opacity:"0.1"},{offset:"0.41",opacity:"0.11"},{offset:"0.56",opacity:"0.13"},{offset:"0.67",opacity:"0.18"},{offset:"0.75",opacity:"0.25"},{offset:"0.83",opacity:"0.33"},{offset:"0.89",opacity:"0.44"},{offset:"0.95",opacity:"0.56"},{offset:"1",opacity:"0.7"}]},{width:1343,height:900,pathOpacity:.3,path:"M671.344 1121.34C300.571 1121.34 0 820.773 0 450C0 79.2264 300.571 -221.345 671.344 -221.345C1042.12 -221.345 1342.69 79.2264 1342.69 450C1342.69 820.773 1042.12 1121.34 671.344 1121.34Z",gradientTransform:"translate(644.026 441.551) rotate(180) scale(581.31)",stops:Cg},{width:1163,height:900,pathOpacity:.5,path:"M581.31 1031.31C260.261 1031.31 0 771.048 0 449.999C0 128.951 260.261 -131.311 581.31 -131.311C902.358 -131.311 1162.62 128.951 1162.62 449.999C1162.62 771.048 902.358 1031.31 581.31 1031.31Z",gradientTransform:"translate(644.026 441.551) rotate(180) scale(581.31)",stops:Cg},{width:798,height:798,pathOpacity:.7,path:"M398.581 797.162C178.451 797.162 0 618.711 0 398.581C0 178.451 178.451 0 398.581 0C618.711 0 797.162 178.451 797.162 398.581C797.162 618.711 618.711 797.162 398.581 797.162Z",gradientTransform:"translate(445.003 392.441) rotate(180) scale(398.23)",stops:Cg}],xg=({paddingXAxis:o="0px",paddingYAxis:n="0px",children:l})=>{const[r,c]=s(window.innerWidth),d=a(()=>r/Sg[0].width,[r]);return i(()=>{const e=()=>c(window.innerWidth);return window.addEventListener("resize",e),()=>window.removeEventListener("resize",e)},[]),e(vg,{$paddingXAxis:o,$paddingYAxis:n,children:[Sg.map(({width:o,height:n,pathOpacity:i,path:a,gradientTransform:l,stops:r},s)=>{const c=`purple-ring-${s}`;return e(yg,{width:o*d,height:"100%",viewBox:`0 0 ${o} ${n}`,fill:"none",children:[t("path",{opacity:i,d:a,fill:`url(#${c})`}),t("defs",{children:t("radialGradient",{id:c,cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",gradientTransform:l,children:r.map(({offset:e,opacity:o},n)=>t("stop",{offset:e,stopColor:"#7C3BFF",stopOpacity:o},n))})})]},c)}),l]})},wg=b.div`
1060
+ `,Ig=[{opacity:"0.1"},{offset:"0.31",opacity:"0.11"},{offset:"0.45",opacity:"0.14"},{offset:"0.56",opacity:"0.19"},{offset:"0.65",opacity:"0.26"},{offset:"0.73",opacity:"0.35"},{offset:"0.8",opacity:"0.46"},{offset:"0.86",opacity:"0.6"},{offset:"0.92",opacity:"0.76"},{offset:"0.98",opacity:"0.93"},{offset:"1"}],Ng=[{width:1440,height:900,pathOpacity:.1,path:"M719.992 1169.99C322.351 1169.99 0 847.64 0 450C0 52.3591 322.351 -269.992 719.992 -269.992C1117.63 -269.992 1439.98 52.3591 1439.98 450C1439.98 847.64 1117.63 1169.99 719.992 1169.99Z",gradientTransform:"translate(814.309 444.011) rotate(180) scale(718.904)",stops:[{opacity:"0.1"},{offset:"0.41",opacity:"0.11"},{offset:"0.56",opacity:"0.13"},{offset:"0.67",opacity:"0.18"},{offset:"0.75",opacity:"0.25"},{offset:"0.83",opacity:"0.33"},{offset:"0.89",opacity:"0.44"},{offset:"0.95",opacity:"0.56"},{offset:"1",opacity:"0.7"}]},{width:1343,height:900,pathOpacity:.3,path:"M671.344 1121.34C300.571 1121.34 0 820.773 0 450C0 79.2264 300.571 -221.345 671.344 -221.345C1042.12 -221.345 1342.69 79.2264 1342.69 450C1342.69 820.773 1042.12 1121.34 671.344 1121.34Z",gradientTransform:"translate(644.026 441.551) rotate(180) scale(581.31)",stops:Ig},{width:1163,height:900,pathOpacity:.5,path:"M581.31 1031.31C260.261 1031.31 0 771.048 0 449.999C0 128.951 260.261 -131.311 581.31 -131.311C902.358 -131.311 1162.62 128.951 1162.62 449.999C1162.62 771.048 902.358 1031.31 581.31 1031.31Z",gradientTransform:"translate(644.026 441.551) rotate(180) scale(581.31)",stops:Ig},{width:798,height:798,pathOpacity:.7,path:"M398.581 797.162C178.451 797.162 0 618.711 0 398.581C0 178.451 178.451 0 398.581 0C618.711 0 797.162 178.451 797.162 398.581C797.162 618.711 618.711 797.162 398.581 797.162Z",gradientTransform:"translate(445.003 392.441) rotate(180) scale(398.23)",stops:Ig}],$g=({paddingXAxis:o="0px",paddingYAxis:n="0px",children:l})=>{const[r,c]=s(window.innerWidth),d=a(()=>r/Ng[0].width,[r]);return i(()=>{const e=()=>c(window.innerWidth);return window.addEventListener("resize",e),()=>window.removeEventListener("resize",e)},[]),e(kg,{$paddingXAxis:o,$paddingYAxis:n,children:[Ng.map(({width:o,height:n,pathOpacity:i,path:a,gradientTransform:l,stops:r},s)=>{const c=`purple-ring-${s}`;return e(Eg,{width:o*d,height:"100%",viewBox:`0 0 ${o} ${n}`,fill:"none",children:[t("path",{opacity:i,d:a,fill:`url(#${c})`}),t("defs",{children:t("radialGradient",{id:c,cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",gradientTransform:l,children:r.map(({offset:e,opacity:o},n)=>t("stop",{offset:e,stopColor:"#7C3BFF",stopOpacity:o},n))})})]},c)}),l]})},Og=b.div`
1050
1061
  display: flex;
1051
1062
  flex-direction: column;
1052
1063
  align-items: center;
@@ -1057,7 +1068,7 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import n,{useEff
1057
1068
  width: 50vw;
1058
1069
  border-radius: 16px;
1059
1070
  background: ${({theme:e})=>e.v2.colors.silver[900]};
1060
- `,Tg=b.div`
1071
+ `,Ag=b.div`
1061
1072
  display: flex;
1062
1073
  flex-direction: column;
1063
1074
  align-items: center;
@@ -1067,15 +1078,15 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import n,{useEff
1067
1078
  & * {
1068
1079
  text-align: center;
1069
1080
  }
1070
- `,kg=({onStart:o})=>t(ce,{width:"75vw",isOpen:!0,hideOverlay:!0,disableAnimation:!0,children:t(ft,{$height:"100%",children:e(wg,{children:[e(Tg,{children:[t(ue,{size:he.L,weight:500,children:et.GET_STARTED_WITH}),t(Sr,{size:260}),t(ue,{size:he.S,weight:400,children:et.GET_STARTED_DESCRIPTION})]}),t(ge,{"data-id":"onboarding-get-started",label:Ft.GET_STARTED,rightIcon:Na,size:fe.L,onClick:o})]})})}),Eg=[{step:1,label:et.INSTALLATION,forceDoneBadge:!0},{step:2,label:et.SOURCES_SETUP},{step:3,label:et.DESTINATIONS_SETUP},{step:4,label:et.SUMMARY}],Ig=b.div`
1081
+ `,Rg=({onStart:o})=>t(ce,{width:"75vw",isOpen:!0,hideOverlay:!0,disableAnimation:!0,children:t(ft,{$height:"100%",children:e(Og,{children:[e(Ag,{children:[t(pe,{size:he.L,weight:500,children:et.GET_STARTED_WITH}),t(xr,{size:260}),t(pe,{size:he.S,weight:400,children:et.GET_STARTED_DESCRIPTION})]}),t(ge,{"data-id":"onboarding-get-started",label:Ft.GET_STARTED,rightIcon:$a,size:fe.L,onClick:o})]})})}),Dg=[{step:1,label:et.INSTALLATION,forceDoneBadge:!0},{step:2,label:et.SOURCES_SETUP},{step:3,label:et.DESTINATIONS_SETUP},{step:4,label:et.SUMMARY}],_g=b.div`
1071
1082
  display: flex;
1072
1083
  flex-direction: column;
1073
1084
  gap: 32px;
1074
1085
  padding: 64px;
1075
- `,Ng=({pagePaddingXAxis:o,pagePaddingYAxis:n,onDone:i})=>{const{setDrawerType:a}=ho(),{sourcesApi:l,destinationsApi:r}=Pl(),[c,d]=s(1),[u,p]=s(!1),[h,m]=s(null),[g,f]=s(null),b=()=>d(e=>e+1),v=()=>d(e=>e-1);return e(xg,{paddingXAxis:o,paddingYAxis:n,children:[e(Ig,{children:[t(Sr,{useInline:!0}),t(Pi,{currentStep:c,data:Eg,gap:32})]}),t(ql,{initialInputs:h,children:e(Jl,{children:[1===c&&t(kg,{onStart:b}),2===c&&t(Pc,{disableAnimation:!0,onBack:e=>{m(e),v()},onNext:e=>{m(e),b()}}),3===c&&t(Cc,{disableAnimation:!0,onBack:e=>{f(e),v()},onNext:e=>{f(e),b()},initialInputs:g}),4===c&&t(bg,{disableAnimation:!0,setStep:d,onSave:async()=>{if(!u){p(!0);try{const e=[];h&&e.push(l.persistV2(h)),g&&e.push(...g.map(e=>r.create(e.formData)));const t=await Promise.allSettled(e),o=[];for(const e of t)"rejected"===e.status?o.push(e.reason?.message||String(e.reason)):e.value&&"object"==typeof e.value&&"error"in e.value&&e.value.error&&o.push(e.value.error);if(o.length)return{error:o.join("\n")};a(dn.OnboardingDone),i()}catch(e){return p(!1),{error:e instanceof Error?e.message:String(e)}}}},sourcesPayload:h,destinationsPayload:g})]})})]})},$g=e=>(e||[]).filter(e=>!!e.id).map(e=>String(e.id)),Og=e=>{let t=0;return Object.values(e).forEach(e=>{Array.isArray(e)&&(t+=e.length)}),e.onlyErrors&&t++,t},Ag=b.div`
1086
+ `,Pg=({pagePaddingXAxis:o,pagePaddingYAxis:n,onDone:i})=>{const{setDrawerType:a}=ho(),{sourcesApi:l,destinationsApi:r}=Ll(),[c,d]=s(1),[p,u]=s(!1),[h,m]=s(null),[g,f]=s(null),b=()=>d(e=>e+1),v=()=>d(e=>e-1);return e($g,{paddingXAxis:o,paddingYAxis:n,children:[e(_g,{children:[t(xr,{useInline:!0}),t(Li,{currentStep:c,data:Dg,gap:32})]}),t(Jl,{initialInputs:h,children:e(Zl,{children:[1===c&&t(Rg,{onStart:b}),2===c&&t(Lc,{disableAnimation:!0,onBack:e=>{m(e),v()},onNext:e=>{m(e),b()}}),3===c&&t(Sc,{disableAnimation:!0,onBack:e=>{f(e),v()},onNext:e=>{f(e),b()},initialInputs:g}),4===c&&t(Tg,{disableAnimation:!0,setStep:d,onSave:async()=>{if(!p){u(!0);try{const e=[];h&&e.push(l.persistV2(h)),g&&e.push(...g.map(e=>r.create(e.formData)));const t=await Promise.allSettled(e),o=[];for(const e of t)"rejected"===e.status?o.push(e.reason?.message||String(e.reason)):e.value&&"object"==typeof e.value&&"error"in e.value&&e.value.error&&o.push(e.value.error);if(o.length)return{error:o.join("\n")};a(pn.OnboardingDone),i()}catch(e){return u(!1),{error:e instanceof Error?e.message:String(e)}}}},sourcesPayload:h,destinationsPayload:g})]})})]})},Lg=e=>(e||[]).filter(e=>!!e.id).map(e=>String(e.id)),Fg=e=>{let t=0;return Object.values(e).forEach(e=>{Array.isArray(e)&&(t+=e.length)}),e.onlyErrors&&t++,t},Mg=b.div`
1076
1087
  position: relative;
1077
1088
  display: inline-flex;
1078
- `,Rg=b.button`
1089
+ `,zg=b.button`
1079
1090
  display: inline-flex;
1080
1091
  align-items: center;
1081
1092
  gap: 8px;
@@ -1088,7 +1099,7 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import n,{useEff
1088
1099
  &:hover {
1089
1100
  background-color: ${({theme:e})=>e.v2.colors.silver[700]};
1090
1101
  }
1091
- `,Dg=b.div`
1102
+ `,Bg=b.div`
1092
1103
  position: absolute;
1093
1104
  top: calc(100% + 8px);
1094
1105
  right: 0;
@@ -1101,25 +1112,25 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import n,{useEff
1101
1112
  border-radius: 12px;
1102
1113
  background-color: ${({theme:e})=>e.v2.colors.silver[900]};
1103
1114
  box-shadow: 0 0 24px 0 rgba(0, 0, 0, 0.3);
1104
- `,_g=b.div`
1115
+ `,Xg=b.div`
1105
1116
  display: flex;
1106
1117
  flex-direction: column;
1107
1118
  gap: 12px;
1108
1119
  padding: 16px;
1109
1120
  max-height: 60vh;
1110
1121
  overflow-y: auto;
1111
- `,Pg=b.div`
1122
+ `,Ug=b.div`
1112
1123
  display: flex;
1113
1124
  align-items: center;
1114
1125
  gap: 8px;
1115
1126
  padding: 12px 16px;
1116
1127
  border-top: 1px solid ${({theme:e})=>e.v2.colors.silver[700]};
1117
- `,Lg=b.div`
1128
+ `,Vg=b.div`
1118
1129
  display: flex;
1119
1130
  align-items: center;
1120
1131
  gap: 8px;
1121
1132
  margin-left: auto;
1122
- `,Fg=()=>{const o=v(),{sourcesApi:n,namespacesApi:r}=Pl(),c=n.useSources().items,d=r.useNamespaces().items,{selectedStreamName:u}=tt(),{getItemSS:p,setItemSS:h,removeItemSS:m}=Bi(),{namespaces:g,kinds:f,monitors:b,languages:y,onlyErrors:C,podsAgentInjectionStatus:S,setAll:x,clearAll:w,getEmptyState:T}=Li(),k=a(()=>Fi(c,u),[c,u]);i(()=>{const e=p(Mi.OVERVIEW_FILTERS,T());x(e)},[]);const[E,I]=s({namespaces:g,kinds:f,monitors:b,languages:y,onlyErrors:C,podsAgentInjectionStatus:S}),[N,$]=s(Og(E)),[O,A]=s(!1);i(()=>{if(!O){const e={namespaces:g,kinds:f,monitors:b,languages:y,onlyErrors:C,podsAgentInjectionStatus:S};I(e),$(Og(e))}},[O,g,f,b,y,C,S]);const R=l(null);wo(R,()=>A(!1)),on({key:"Escape",active:O},()=>A(!1));const D=a(()=>{const e=new Set,t=[];return d.forEach(({name:o})=>{e.has(o)||(e.add(o),t.push({id:o,label:o,withCheckbox:!0}))}),t},[d]),_=a(()=>{const e=new Set,t=[];return k.forEach(({id:o})=>{const{kind:n}=o;e.has(n)||(e.add(n),t.push({id:n,label:n,withCheckbox:!0}))}),t},[k]),P=a(()=>{const e=new Set,t=[];return k.forEach(({runtimeInfo:o})=>{o?.detectedLanguages?.forEach(o=>{e.has(o)||(e.add(o),t.push({id:o,label:Je[o]||o,withCheckbox:!0}))})}),t.sort((e,t)=>e.id.localeCompare(t.id))},[k]),L=a(()=>zi.map(({id:e,value:t})=>({id:e,label:t,withCheckbox:!0})),[]),F=a(()=>{const e=new Set,t=[];return k.forEach(({podsAgentInjectionStatus:o})=>{const{reasonEnum:n,message:i}=o||{};if(n){if(e.has(n))return;e.add(n),t.push({id:n,label:Kt(n)})}else if(i){if(e.has(i))return;e.add(i),t.push({id:i,label:i,withCheckbox:!0})}}),t},[k]),M=(e,t,o)=>{const n=t.filter(e=>o.includes(e.id));I(t=>{return{...t,[e]:(o=n,o.map(({id:e,label:t})=>({id:e,label:t})))};var o})},z=O?za:Ba,B=a(()=>$g(E.languages),[E.languages]);return e(Ag,{ref:R,children:[e(Rg,{"data-id":"filters-trigger",$isOpen:O,type:"button",onClick:()=>A(e=>!e),children:[t(kl,{size:16,fill:o.v2.colors.white[500]}),t(ue,{size:he.XS,weight:500,nowrap:!0,children:"Filters"}),N>0&&t(qe,{label:N,status:Fe.Unknown,textSize:he.XXXS}),t(z,{size:16,fill:o.v2.colors.silver[200]})]}),O&&e(Dg,{children:[e(_g,{children:[t(vt,{label:"Namespace",placeholder:"All",withSearch:!0,withMultiSelect:!0,disabled:!D.length,options:D,values:$g(E.namespaces),setValues:e=>M("namespaces",D,e)}),t(vt,{label:"Kind",placeholder:"All",withSearch:!0,withMultiSelect:!0,disabled:!_.length,options:_,values:$g(E.kinds),setValues:e=>M("kinds",_,e)}),t(vt,{label:"Programming Language",placeholder:"All",withSearch:!0,withMultiSelect:!0,disabled:!P.length,options:P,values:B,setValues:e=>M("languages",P,e)}),t(vt,{label:"Monitors",placeholder:"All",withSearch:!0,withMultiSelect:!0,disabled:!L.length,options:L,values:$g(E.monitors),setValues:e=>M("monitors",L,e)}),t(vt,{label:"Agent Injection Status",placeholder:"All",withSearch:!0,withMultiSelect:!0,disabled:!F.length,options:F,values:$g(E.podsAgentInjectionStatus),setValues:e=>M("podsAgentInjectionStatus",F,e)}),t(le,{label:"Show only sources with errors",size:Nt.L,value:!!E.onlyErrors,onChange:e=>I(t=>({...t,onlyErrors:e}))})]}),e(Pg,{children:[t(ge,{"data-id":"filters-reset",size:fe.S,variant:be.Text,label:"Reset",onClick:()=>{m(Mi.OVERVIEW_FILTERS),w(),I(T()),$(0),A(!1)},textColor:o.v2.colors.red[500]}),e(Lg,{children:[t(ge,{"data-id":"filters-cancel",size:fe.S,variant:be.Secondary,label:"Cancel",onClick:()=>A(!1)}),t(ge,{"data-id":"filters-apply",size:fe.S,variant:be.Primary,label:"Apply",onClick:()=>{h(Mi.OVERVIEW_FILTERS,E),x(E),$(Og(E)),A(!1)}})]})]})]})]})},Mg=b.div`
1133
+ `,Hg=()=>{const o=v(),{sourcesApi:n,namespacesApi:r}=Ll(),c=n.useSources().items,d=r.useNamespaces().items,{selectedStreamName:p}=tt(),{getItemSS:u,setItemSS:h,removeItemSS:m}=Xi(),{namespaces:g,kinds:f,monitors:b,languages:y,onlyErrors:C,podsAgentInjectionStatus:S,setAll:x,clearAll:w,getEmptyState:T}=Fi(),k=a(()=>Mi(c,p),[c,p]);i(()=>{const e=u(zi.OVERVIEW_FILTERS,T());x(e)},[]);const[E,I]=s({namespaces:g,kinds:f,monitors:b,languages:y,onlyErrors:C,podsAgentInjectionStatus:S}),[N,$]=s(Fg(E)),[O,A]=s(!1);i(()=>{if(!O){const e={namespaces:g,kinds:f,monitors:b,languages:y,onlyErrors:C,podsAgentInjectionStatus:S};I(e),$(Fg(e))}},[O,g,f,b,y,C,S]);const R=l(null);To(R,()=>A(!1)),nn({key:"Escape",active:O},()=>A(!1));const D=a(()=>{const e=new Set,t=[];return d.forEach(({name:o})=>{e.has(o)||(e.add(o),t.push({id:o,label:o,withCheckbox:!0}))}),t},[d]),_=a(()=>{const e=new Set,t=[];return k.forEach(({id:o})=>{const{kind:n}=o;e.has(n)||(e.add(n),t.push({id:n,label:n,withCheckbox:!0}))}),t},[k]),P=a(()=>{const e=new Set,t=[];return k.forEach(({runtimeInfo:o})=>{o?.detectedLanguages?.forEach(o=>{e.has(o)||(e.add(o),t.push({id:o,label:Je[o]||o,withCheckbox:!0}))})}),t.sort((e,t)=>e.id.localeCompare(t.id))},[k]),L=a(()=>Bi.map(({id:e,value:t})=>({id:e,label:t,withCheckbox:!0})),[]),F=a(()=>{const e=new Set,t=[];return k.forEach(({podsAgentInjectionStatus:o})=>{const{reasonEnum:n,message:i}=o||{};if(n){if(e.has(n))return;e.add(n),t.push({id:n,label:Kt(n)})}else if(i){if(e.has(i))return;e.add(i),t.push({id:i,label:i,withCheckbox:!0})}}),t},[k]),M=(e,t,o)=>{const n=t.filter(e=>o.includes(e.id));I(t=>{return{...t,[e]:(o=n,o.map(({id:e,label:t})=>({id:e,label:t})))};var o})},z=O?Ba:Xa,B=a(()=>Lg(E.languages),[E.languages]);return e(Mg,{ref:R,children:[e(zg,{"data-id":"filters-trigger",$isOpen:O,type:"button",onClick:()=>A(e=>!e),children:[t(El,{size:16,fill:o.v2.colors.white[500]}),t(pe,{size:he.XS,weight:500,nowrap:!0,children:"Filters"}),N>0&&t(qe,{label:N,status:Fe.Unknown,textSize:he.XXXS}),t(z,{size:16,fill:o.v2.colors.silver[200]})]}),O&&e(Bg,{children:[e(Xg,{children:[t(vt,{label:"Namespace",placeholder:"All",withSearch:!0,withMultiSelect:!0,disabled:!D.length,options:D,values:Lg(E.namespaces),setValues:e=>M("namespaces",D,e)}),t(vt,{label:"Kind",placeholder:"All",withSearch:!0,withMultiSelect:!0,disabled:!_.length,options:_,values:Lg(E.kinds),setValues:e=>M("kinds",_,e)}),t(vt,{label:"Programming Language",placeholder:"All",withSearch:!0,withMultiSelect:!0,disabled:!P.length,options:P,values:B,setValues:e=>M("languages",P,e)}),t(vt,{label:"Monitors",placeholder:"All",withSearch:!0,withMultiSelect:!0,disabled:!L.length,options:L,values:Lg(E.monitors),setValues:e=>M("monitors",L,e)}),t(vt,{label:"Agent Injection Status",placeholder:"All",withSearch:!0,withMultiSelect:!0,disabled:!F.length,options:F,values:Lg(E.podsAgentInjectionStatus),setValues:e=>M("podsAgentInjectionStatus",F,e)}),t(le,{label:"Show only sources with errors",size:Nt.L,value:!!E.onlyErrors,onChange:e=>I(t=>({...t,onlyErrors:e}))})]}),e(Ug,{children:[t(ge,{"data-id":"filters-reset",size:fe.S,variant:be.Text,label:"Reset",onClick:()=>{m(zi.OVERVIEW_FILTERS),w(),I(T()),$(0),A(!1)},textColor:o.v2.colors.red[500]}),e(Vg,{children:[t(ge,{"data-id":"filters-cancel",size:fe.S,variant:be.Secondary,label:"Cancel",onClick:()=>A(!1)}),t(ge,{"data-id":"filters-apply",size:fe.S,variant:be.Primary,label:"Apply",onClick:()=>{h(zi.OVERVIEW_FILTERS,E),x(E),$(Fg(E)),A(!1)}})]})]})]})]})},jg=b.div`
1123
1134
  position: relative;
1124
1135
  display: flex;
1125
1136
  align-items: center;
@@ -1130,7 +1141,7 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import n,{useEff
1130
1141
  box-sizing: border-box;
1131
1142
  border-radius: 16px 16px 0 0;
1132
1143
  background-color: ${({theme:e})=>e.v2.colors.silver[800]};
1133
- `,zg=b.div`
1144
+ `,Gg=b.div`
1134
1145
  position: absolute;
1135
1146
  bottom: 0;
1136
1147
  left: 0;
@@ -1139,7 +1150,7 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import n,{useEff
1139
1150
  background-color: ${({theme:e})=>e.v2.colors.purple[500]};
1140
1151
  border-radius: 32px;
1141
1152
  transition: width 0.3s;
1142
- `,Bg=({entityType:o,badge:n,badgeTooltip:i,isLoading:a,refetch:l,partiallySelected:r,allSelected:s,onSelectAll:c,progressPercent:d})=>{const{setDrawerType:u}=ho();return e(Mg,{children:[e(me,{$gap:8,style:{flex:1,minWidth:0},children:[c&&t(oe,{size:Xi.S,partiallyChecked:r,value:!!s,onChange:c}),t(ue,{size:he.S,nowrap:!0,children:`${Kt(o)}s`}),t(qe,{label:n,tooltip:i,status:Fe.Unknown,textSize:he.XXXS})]}),e(me,{children:[t(yt,{"data-id":`add-${o}`,icon:Ia,onClick:()=>u(Ui(o))}),t(yt,{"data-id":`refresh-${o}`,icon:Za,onClick:l,disabled:a})]}),"number"==typeof d&&t(zg,{$percent:d})]})},Xg=b(ee)`
1153
+ `,Wg=({entityType:o,badge:n,badgeTooltip:i,isLoading:a,refetch:l,partiallySelected:r,allSelected:s,onSelectAll:c,progressPercent:d})=>{const{setDrawerType:p}=ho();return e(jg,{children:[e(me,{$gap:8,style:{flex:1,minWidth:0},children:[c&&t(oe,{size:Ui.S,partiallyChecked:r,value:!!s,onChange:c}),t(pe,{size:he.S,nowrap:!0,children:`${Kt(o)}s`}),t(qe,{label:n,tooltip:i,status:Fe.Unknown,textSize:he.XXXS})]}),e(me,{children:[t(yt,{"data-id":`add-${o}`,icon:Na,onClick:()=>p(Vi(o))}),t(yt,{"data-id":`refresh-${o}`,icon:Qa,onClick:l,disabled:a})]}),"number"==typeof d&&t(Gg,{$percent:d})]})},Kg=b(ee)`
1143
1154
  align-items: center !important;
1144
1155
  justify-content: center !important;
1145
1156
  align-self: stretch;
@@ -1154,7 +1165,7 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import n,{useEff
1154
1165
  &:hover {
1155
1166
  background-color: ${({theme:e})=>e.v2.colors.silver[1e3]};
1156
1167
  }
1157
- `,Ug=({entityType:o,description:n})=>{const{setDrawerType:i}=ho();return e(Xg,{onClick:()=>i(Ui(o)),children:[e(me,{$gap:4,children:[t(Ia,{size:16}),t(ue,{size:he.S,children:`Add ${Kt(o)}`})]}),t(ue,{size:he.XXS,align:"center",children:n})]})},Vg=b.div`
1168
+ `,Yg=({entityType:o,description:n})=>{const{setDrawerType:i}=ho();return e(Kg,{onClick:()=>i(Vi(o)),children:[e(me,{$gap:4,children:[t(Na,{size:16}),t(pe,{size:he.S,children:`Add ${Kt(o)}`})]}),t(pe,{size:he.XXS,align:"center",children:n})]})},qg=b.div`
1158
1169
  display: flex;
1159
1170
  align-items: center;
1160
1171
  gap: 12px;
@@ -1169,10 +1180,10 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import n,{useEff
1169
1180
  &:hover {
1170
1181
  background-color: ${({theme:e})=>e.v2.colors.silver[800]};
1171
1182
  }
1172
- `,Hg=b(me)`
1183
+ `,Jg=b(me)`
1173
1184
  flex: 1;
1174
1185
  min-width: 0;
1175
- `,jg=({entityId:o,entityType:n,title:i,status:l,faded:r,tooltip:s,throughput:c,icon:d,icons:u,iconSrc:p,isActive:h,raw:m})=>{const g=v(),f=n===Et.Source,b="boolean"==typeof h,y=r||b&&!h,{setDrawerType:C,setDrawerEntityId:S}=ho(),{selectedSources:x,setSelectedSources:w}=Vi(),T=m,k=f?T.id.namespace:"",E=a(()=>{if(!f)return-1;const e=x[k];return e?.length?e.findIndex(e=>e.id.name===T.id.name&&e.id.kind===T.id.kind&&(e.id.region??"")===(T.id.region??"")):-1},[f,x,k,T.id]),I=b&&!h?Hi(Fe.Info,g):l?Hi(l,g):void 0,N=f&&"object"==typeof o?`${o.namespace}-${o.name}-${o.kind}${o.region?`-${o.region}`:""}`:o;return e(Vg,{"data-id":N,$faded:y,onClick:()=>{C(vo(n)),S(o)},children:[f&&t(oe,{size:Xi.S,value:-1!==E,onChange:()=>{const e={...x};e[k]||(e[k]=[]),-1===E?e[k].push(T):e[k].splice(E,1),w(e)}}),t(bo,{icons:u,icon:d,iconSrc:p}),e(Hg,{$gap:4,children:[t(De,{size:he.XS,nowrap:!0,children:i}),t(me,{$gap:6,$justifyContent:"flex-end",style:{marginLeft:"auto",flexShrink:0},children:c&&t($e,{text:s||"Heads up! The data-flow metrics you see are calculated over 10-second intervals.",children:t(qe,{label:c,status:l&&[Fe.Error,Fe.Warning].includes(l)?l:Fe.Unknown,leftIcon:I,textSize:he.XXXS})})})]})]})};function Gg(e){return Object.values(e.conditions??{}).filter(Boolean).some(({status:e})=>e===Fe.Loading)?e:{...e,workloadOdigosHealthStatus:{status:oo.Pending,name:"WorkloadOdigosHealthStatus",reasonEnum:"Pending",message:""}}}function Wg(e){const t=Object.values(e.conditions??{}).filter(Boolean),o=t.filter(({status:e})=>e!==Fe.Loading);return o?.length===t?.length?e:{...e,conditions:o?.length?o.reduce((e,t)=>(e[t.name]=t,e),{}):{}}}const Kg=b.div`
1186
+ `,Zg=({entityId:o,entityType:n,title:i,status:l,faded:r,tooltip:s,throughput:c,icon:d,icons:p,iconSrc:u,isActive:h,raw:m})=>{const g=v(),f=n===Et.Source,b="boolean"==typeof h,y=r||b&&!h,{setDrawerType:C,setDrawerEntityId:S}=ho(),{selectedSources:x,setSelectedSources:w}=Hi(),T=m,k=f?T.id.namespace:"",E=a(()=>{if(!f)return-1;const e=x[k];return e?.length?e.findIndex(e=>e.id.name===T.id.name&&e.id.kind===T.id.kind&&(e.id.region??"")===(T.id.region??"")):-1},[f,x,k,T.id]),I=b&&!h?ji(Fe.Info,g):l?ji(l,g):void 0,N=f&&"object"==typeof o?`${o.namespace}-${o.name}-${o.kind}${o.region?`-${o.region}`:""}`:o;return e(qg,{"data-id":N,$faded:y,onClick:()=>{C(vo(n)),S(o)},children:[f&&t(oe,{size:Ui.S,value:-1!==E,onChange:()=>{const e={...x};e[k]||(e[k]=[]),-1===E?e[k].push(T):e[k].splice(E,1),w(e)}}),t(bo,{icons:p,icon:d,iconSrc:u}),e(Jg,{$gap:4,children:[t(De,{size:he.XS,nowrap:!0,children:i}),t(me,{$gap:6,$justifyContent:"flex-end",style:{marginLeft:"auto",flexShrink:0},children:c&&t($e,{text:s||"Heads up! The data-flow metrics you see are calculated over 10-second intervals.",children:t(qe,{label:c,status:l&&[Fe.Error,Fe.Warning].includes(l)?l:Fe.Unknown,leftIcon:I,textSize:he.XXXS})})})]})]})};function Qg(e){return Object.values(e.conditions??{}).filter(Boolean).some(({status:e})=>e===Fe.Loading)?e:{...e,workloadOdigosHealthStatus:{status:oo.Pending,name:"WorkloadOdigosHealthStatus",reasonEnum:"Pending",message:""}}}function ef(e){const t=Object.values(e.conditions??{}).filter(Boolean),o=t.filter(({status:e})=>e!==Fe.Loading);return o?.length===t?.length?e:{...e,conditions:o?.length?o.reduce((e,t)=>(e[t.name]=t,e),{}):{}}}const tf=b.div`
1176
1187
  position: absolute;
1177
1188
  top: 0;
1178
1189
  left: 0;
@@ -1183,21 +1194,21 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import n,{useEff
1183
1194
  background-color: ${({theme:e})=>e.v2.colors.silver[900]};
1184
1195
  border-bottom: 1px solid ${({theme:e})=>e.v2.colors.silver[700]};
1185
1196
  pointer-events: none;
1186
- `,Yg=b.div`
1197
+ `,of=b.div`
1187
1198
  display: flex;
1188
1199
  align-items: center;
1189
1200
  gap: 8px;
1190
1201
  padding: 4px 8px 0;
1191
- `,qg=b.div`
1202
+ `,nf=b.div`
1192
1203
  flex: 1;
1193
1204
  height: 1px;
1194
1205
  background: ${({theme:e})=>e.v2.colors.silver[700]};
1195
- `,Jg=({namespace:e})=>{const o=v();return t(Kg,{children:t(ue,{size:he.XXS,nowrap:!0,color:o.v2.colors.grey[300],children:e})})},Zg=({namespace:o})=>{const n=v();return e(Yg,{children:[t(qg,{}),t(ue,{size:he.XXS,nowrap:!0,color:n.v2.colors.grey[300],children:o}),t(qg,{})]})},Qg={[Et.InstrumentationRule]:et.NO_DATA_INSTRUMENTATION_RULES,[Et.Source]:et.NO_DATA_SOURCES,[Et.Action]:et.NO_DATA_ACTIONS,[Et.Destination]:et.NO_DATA_DESTINATIONS},ef=b.div`
1206
+ `,af=({namespace:e})=>{const o=v();return t(tf,{children:t(pe,{size:he.XXS,nowrap:!0,color:o.v2.colors.grey[300],children:e})})},lf=({namespace:o})=>{const n=v();return e(of,{children:[t(nf,{}),t(pe,{size:he.XXS,nowrap:!0,color:n.v2.colors.grey[300],children:o}),t(nf,{})]})},rf={[Et.InstrumentationRule]:et.NO_DATA_INSTRUMENTATION_RULES,[Et.Source]:et.NO_DATA_SOURCES,[Et.Action]:et.NO_DATA_ACTIONS,[Et.Destination]:et.NO_DATA_DESTINATIONS},sf=b.div`
1196
1207
  display: flex;
1197
1208
  flex-direction: column;
1198
1209
  flex: 1 0 0;
1199
1210
  min-width: 0;
1200
- `,tf=b.div`
1211
+ `,cf=b.div`
1201
1212
  display: flex;
1202
1213
  flex-direction: column;
1203
1214
  align-items: stretch;
@@ -1207,7 +1218,7 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import n,{useEff
1207
1218
  border-radius: 0 0 16px 16px;
1208
1219
  background-color: ${({theme:e})=>e.v2.colors.silver[800]};
1209
1220
  overflow: hidden;
1210
- `,of=b.div`
1221
+ `,df=b.div`
1211
1222
  position: relative;
1212
1223
  display: flex;
1213
1224
  flex-direction: column;
@@ -1219,7 +1230,7 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import n,{useEff
1219
1230
  background-color: ${({theme:e})=>e.v2.colors.silver[900]};
1220
1231
  height: ${({$height:e})=>e}px;
1221
1232
  overflow: hidden;
1222
- `,nf=({entityType:o,entities:n,unfilteredCount:l,metrics:c,loading:d,maxHeight:u,refetch:p})=>{const h=o===Et.Source,m=n.length!==l,g=Ot(e=>h?e.progress[Dt.Instrumenting]?.percentage:void 0),f=Ot(e=>h?e.progress[Dt.Uninstrumenting]?.percentage:void 0),b=!h||void 0===g&&void 0===f?void 0:g||f||0,{selectedSources:v,setSelectedSources:y}=Vi(),C=a(()=>h?Object.values(v).reduce((e,t)=>e+t.length,0):0,[h,v]),S=a(()=>{if(!c)return;const e=new Map,t=o===Et.Source?c.sources:o===Et.Destination?c.destinations:void 0;if(t)for(const o of t)e.set(ji(o),o.throughput);return e},[c,o]),x=a(()=>n.map(e=>((e,t,o)=>{const n=zt(e);if(!n)return null;const i=t===Et.Source;let a,l,r=!1,s=e;if(i){const t=(e=>{const t=e.workloadOdigosHealthStatus?.status;switch(t){case oo.Failure:return{status:Fe.Error,faded:!1,tooltip:e.workloadOdigosHealthStatus?.message,displaySource:e};case oo.Notice:return{status:Fe.Warning,faded:!1,tooltip:e.workloadOdigosHealthStatus?.message,displaySource:e};case oo.Pending:case oo.Waiting:return{status:void 0,faded:!1,displaySource:Gg(e)};case oo.Unsupported:case oo.Disabled:return{status:void 0,faded:!0,tooltip:e.workloadOdigosHealthStatus?.message,displaySource:e};default:return{status:void 0,faded:!1,displaySource:Wg(e)}}})(e);a=t.status,r=t.faded,l=t.tooltip,s=t.displaySource}else{const{priorotizedStatus:t,hasDisableds:o}=Gi(e.conditions);a=t,r=o}const c=Wi(e,t,{extended:i,prioritizeDisplayName:!i});let d,u,p,h,m;switch(t){case Et.Source:{d=fo(e),u=Yi(Et.Source);const t=o?.get(Ki(n));h=So(t);break}case Et.Destination:{const t=wt(e.destinationType.type);u=t.icon,p=t.iconSrc;const i=o?.get(Ki(n));h=So(i),m=!e.disabled;break}case Et.Action:u=Vt(e.type),m=!e.disabled;break;case Et.InstrumentationRule:u=Zt(e.type),m=!e.disabled}return{key:Ki(n),entityId:n,namespace:i?e.id.namespace:void 0,raw:s,itemProps:{entityId:n,entityType:t,title:c,status:a,faded:r,tooltip:l,throughput:h,icon:u,icons:d,iconSrc:p,isActive:m,raw:s}}})(e,o,S)).filter(Boolean),[n,o,S]),[w,T]=s(""),{elements:k,indexToNamespace:E,multipleNs:I,dividerCount:N}=a(()=>{const e=[],o=[],n=new Set(x.map(e=>e.namespace).filter(Boolean)).size>1;n&&(o.push(""),e.push(t("div",{style:{height:24}},"ns-spacer")));let i=0,a="";for(const n of x)h&&n.namespace&&n.namespace!==a&&(""!==a&&(o.push(n.namespace),e.push(t(Zg,{namespace:n.namespace},`ns-divider-${n.namespace}`)),i+=1),a=n.namespace),o.push(n.namespace||""),e.push(t(jg,{...n.itemProps},n.key));return{elements:e,indexToNamespace:o,multipleNs:n,dividerCount:i}},[x,h]);i(()=>{if(h&&E.length&&!w){const e=E.find(Boolean);e&&T(e)}},[h,E]);const $=r(e=>{if(!E.length)return;const t=E[Math.min(e,E.length-1)];t&&t!==w&&T(t)},[E,w]),O=58*x.length+(I?28:0)+32*N,A=Math.max(0,u-52-16),R=Math.min(A,O)+8,D="number"==typeof b?`${b}%`:m?`${n.length}/${l}`:l;return e(ef,{children:[t(Bg,{entityType:o,badge:D,badgeTooltip:m?et.FILTERED_COUNT_TOOLTIP:void 0,isLoading:d,refetch:p,partiallySelected:C>0&&n?.length!==C,allSelected:C>0&&n?.length===C,onSelectAll:h?e=>{if(h)if(e){const e={};n?.forEach(t=>{const{namespace:o}=t.id;e[o]?e[o].push(t):e[o]=[t]}),y(e)}else y({})}:void 0,progressPercent:b}),t(tf,{children:n.length?e(of,{$height:R,children:[I&&w&&t(Jg,{namespace:w}),t(po,{gap:4,elements:k,onTopIndexChange:I?$:void 0})]}):d?t(gt,{size:3}):t(Ug,{entityType:o,description:Qg[o]??et.TO_COLLECT_OTEL_DATA})})]})},af=b.div`
1233
+ `,pf=({entityType:o,entities:n,unfilteredCount:l,metrics:c,loading:d,maxHeight:p,refetch:u})=>{const h=o===Et.Source,m=n.length!==l,g=Ot(e=>h?e.progress[Dt.Instrumenting]?.percentage:void 0),f=Ot(e=>h?e.progress[Dt.Uninstrumenting]?.percentage:void 0),b=!h||void 0===g&&void 0===f?void 0:g||f||0,{selectedSources:v,setSelectedSources:y}=Hi(),C=a(()=>h?Object.values(v).reduce((e,t)=>e+t.length,0):0,[h,v]),S=a(()=>{if(!c)return;const e=new Map,t=o===Et.Source?c.sources:o===Et.Destination?c.destinations:void 0;if(t)for(const o of t)e.set(Gi(o),o.throughput);return e},[c,o]),x=a(()=>n.map(e=>((e,t,o)=>{const n=zt(e);if(!n)return null;const i=t===Et.Source;let a,l,r=!1,s=e;if(i){const t=(e=>{const t=e.workloadOdigosHealthStatus?.status;switch(t){case oo.Failure:return{status:Fe.Error,faded:!1,tooltip:e.workloadOdigosHealthStatus?.message,displaySource:e};case oo.Notice:return{status:Fe.Warning,faded:!1,tooltip:e.workloadOdigosHealthStatus?.message,displaySource:e};case oo.Pending:case oo.Waiting:return{status:void 0,faded:!1,displaySource:Qg(e)};case oo.Unsupported:case oo.Disabled:return{status:void 0,faded:!0,tooltip:e.workloadOdigosHealthStatus?.message,displaySource:e};default:return{status:void 0,faded:!1,displaySource:ef(e)}}})(e);a=t.status,r=t.faded,l=t.tooltip,s=t.displaySource}else{const{priorotizedStatus:t,hasDisableds:o}=Wi(e.conditions);a=t,r=o}const c=Ki(e,t,{extended:i,prioritizeDisplayName:!i});let d,p,u,h,m;switch(t){case Et.Source:{d=fo(e),p=qi(Et.Source);const t=o?.get(Yi(n));h=So(t);break}case Et.Destination:{const t=wt(e.destinationType.type);p=t.icon,u=t.iconSrc;const i=o?.get(Yi(n));h=So(i),m=!e.disabled;break}case Et.Action:p=Vt(e.type),m=!e.disabled;break;case Et.InstrumentationRule:p=Zt(e.type),m=!e.disabled}return{key:Yi(n),entityId:n,namespace:i?e.id.namespace:void 0,raw:s,itemProps:{entityId:n,entityType:t,title:c,status:a,faded:r,tooltip:l,throughput:h,icon:p,icons:d,iconSrc:u,isActive:m,raw:s}}})(e,o,S)).filter(Boolean),[n,o,S]),[w,T]=s(""),{elements:k,indexToNamespace:E,multipleNs:I,dividerCount:N}=a(()=>{const e=[],o=[],n=new Set(x.map(e=>e.namespace).filter(Boolean)).size>1;n&&(o.push(""),e.push(t("div",{style:{height:24}},"ns-spacer")));let i=0,a="";for(const n of x)h&&n.namespace&&n.namespace!==a&&(""!==a&&(o.push(n.namespace),e.push(t(lf,{namespace:n.namespace},`ns-divider-${n.namespace}`)),i+=1),a=n.namespace),o.push(n.namespace||""),e.push(t(Zg,{...n.itemProps},n.key));return{elements:e,indexToNamespace:o,multipleNs:n,dividerCount:i}},[x,h]);i(()=>{if(h&&E.length&&!w){const e=E.find(Boolean);e&&T(e)}},[h,E]);const $=r(e=>{if(!E.length)return;const t=E[Math.min(e,E.length-1)];t&&t!==w&&T(t)},[E,w]),O=58*x.length+(I?28:0)+32*N,A=Math.max(0,p-52-16),R=Math.min(A,O)+8,D="number"==typeof b?`${b}%`:m?`${n.length}/${l}`:l;return e(sf,{children:[t(Wg,{entityType:o,badge:D,badgeTooltip:m?et.FILTERED_COUNT_TOOLTIP:void 0,isLoading:d,refetch:u,partiallySelected:C>0&&n?.length!==C,allSelected:C>0&&n?.length===C,onSelectAll:h?e=>{if(h)if(e){const e={};n?.forEach(t=>{const{namespace:o}=t.id;e[o]?e[o].push(t):e[o]=[t]}),y(e)}else y({})}:void 0,progressPercent:b}),t(cf,{children:n.length?e(df,{$height:R,children:[I&&w&&t(af,{namespace:w}),t(uo,{gap:4,elements:k,onTopIndexChange:I?$:void 0})]}):d?t(gt,{size:3}):t(Yg,{entityType:o,description:rf[o]??et.TO_COLLECT_OTEL_DATA})})]})},uf=b.div`
1223
1234
  width: 100%;
1224
1235
  flex: 1;
1225
1236
  min-height: 0;
@@ -1227,10 +1238,10 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import n,{useEff
1227
1238
  display: flex;
1228
1239
  align-items: stretch;
1229
1240
  gap: 16px;
1230
- `,lf={sources:[],destinations:[]},rf=()=>{const o=Li(),{selectedStreamName:n}=tt(),{containerRef:i,containerHeight:l}=qi(),{sourcesApi:r,destinationsApi:s,actionsApi:c,instrumentationRulesApi:d,metricsApi:u}=Pl(),{items:p,loading:h}=r.useSources(),{items:m,loading:g}=s.useDestinations(),{items:f,loading:b}=c.useActions(),{items:v,loading:y}=d.useRules(),C=ho(e=>e.drawerType),{data:S}=u.useMetrics({skip:!p.length||!m.length||!!C,pollInterval:1e4,fetchPolicy:"network-only"}),x=S?.getOverviewMetrics??lf,w=a(()=>Fi(p,n),[p,n]),T=a(()=>Gt(m,n),[m,n]),k=a(()=>Ji(w,o),[w,o]),E=a(()=>Zi(T,o),[T,o]),I=a(()=>Qi(f,o),[f,o]);return e(af,{ref:i,children:[t(nf,{entityType:Et.InstrumentationRule,entities:v,unfilteredCount:v.length,loading:y,maxHeight:l,refetch:d.fetchAll}),t(nf,{entityType:Et.Source,entities:k,unfilteredCount:w.length,metrics:x,loading:h,maxHeight:l,refetch:r.fetchAll}),t(nf,{entityType:Et.Action,entities:I,unfilteredCount:f.length,loading:b,maxHeight:l,refetch:c.fetchAll}),t(nf,{entityType:Et.Destination,entities:E,unfilteredCount:T.length,metrics:x,loading:g,maxHeight:l,refetch:s.fetchAll})]})},sf="40vw",cf=b.div`
1241
+ `,hf={sources:[],destinations:[]},mf=()=>{const o=Fi(),{selectedStreamName:n}=tt(),{containerRef:i,containerHeight:l}=Ji(),{sourcesApi:r,destinationsApi:s,actionsApi:c,instrumentationRulesApi:d,metricsApi:p}=Ll(),{items:u,loading:h}=r.useSources(),{items:m,loading:g}=s.useDestinations(),{items:f,loading:b}=c.useActions(),{items:v,loading:y}=d.useRules(),C=ho(e=>e.drawerType),{data:S}=p.useMetrics({skip:!u.length||!m.length||!!C,pollInterval:1e4,fetchPolicy:"network-only"}),x=S?.getOverviewMetrics??hf,w=a(()=>Mi(u,n),[u,n]),T=a(()=>Gt(m,n),[m,n]),k=a(()=>Zi(w,o),[w,o]),E=a(()=>Qi(T,o),[T,o]),I=a(()=>ea(f,o),[f,o]);return e(uf,{ref:i,children:[t(pf,{entityType:Et.InstrumentationRule,entities:v,unfilteredCount:v.length,loading:y,maxHeight:l,refetch:d.fetchAll}),t(pf,{entityType:Et.Source,entities:k,unfilteredCount:w.length,metrics:x,loading:h,maxHeight:l,refetch:r.fetchAll}),t(pf,{entityType:Et.Action,entities:I,unfilteredCount:f.length,loading:b,maxHeight:l,refetch:c.fetchAll}),t(pf,{entityType:Et.Destination,entities:E,unfilteredCount:T.length,metrics:x,loading:g,maxHeight:l,refetch:s.fetchAll})]})},gf="40vw",ff=b.div`
1231
1242
  position: relative;
1232
- width: ${sf};
1233
- `,df=b.div`
1243
+ width: ${gf};
1244
+ `,bf=b.div`
1234
1245
  position: absolute;
1235
1246
  top: calc(100% + 8px);
1236
1247
  left: 0;
@@ -1239,23 +1250,23 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import n,{useEff
1239
1250
  flex-direction: column;
1240
1251
  gap: 8px;
1241
1252
  padding: 8px;
1242
- width: calc(${sf} - 16px);
1253
+ width: calc(${gf} - 16px);
1243
1254
  border-radius: 12px;
1244
1255
  background-color: ${({theme:e})=>e.v2.colors.silver[900]};
1245
1256
  box-shadow: 0 12px 24px 24px rgba(0, 0, 0, 0.5);
1246
- `,uf=b.div`
1257
+ `,vf=b.div`
1247
1258
  display: flex;
1248
1259
  align-items: center;
1249
1260
  overflow-x: auto;
1250
- `,pf=b.div`
1261
+ `,yf=b.div`
1251
1262
  display: flex;
1252
1263
  flex-direction: column;
1253
1264
  gap: 0;
1254
1265
  max-height: 60vh;
1255
1266
  overflow-y: auto;
1256
- `,hf=b.div`
1267
+ `,Cf=b.div`
1257
1268
  padding: 8px 12px 4px 12px;
1258
- `,mf=b.div`
1269
+ `,Sf=b.div`
1259
1270
  display: flex;
1260
1271
  align-items: center;
1261
1272
  gap: 8px;
@@ -1265,12 +1276,12 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import n,{useEff
1265
1276
  &:hover {
1266
1277
  background-color: ${({theme:e})=>e.v2.colors.silver[700]};
1267
1278
  }
1268
- `,gf=b.div`
1279
+ `,xf=b.div`
1269
1280
  padding: 16px 8px;
1270
- `,ff=({preventPopup:o=!1})=>{const n=v(),{selectedStreamName:i}=tt(),{searchText:r,setSearchText:d}=Li(),{setDrawerType:u,setDrawerEntityId:p}=ho(),{sourcesApi:h,destinationsApi:m,actionsApi:g,instrumentationRulesApi:f}=Pl(),b=h.useSources().items,y=m.useDestinations().items,C=g.useActions().items,S=f.useRules().items,x=l(null),[w,T]=s(!1),[k,E]=s("all"),I=!o&&(!!r||w),N=()=>{d(""),T(!1),E("all")};wo(x,()=>N()),on({key:"Escape",active:I},N);const{categories:$,searchResults:O}=a(()=>(({instrumentationRules:e,sources:t,actions:o,destinations:n,searchText:i,selectedCategory:a})=>{const l=i?e.filter(e=>e.type?.toLowerCase().includes(i)||e.ruleName?.toLowerCase().includes(i)):e,r=i?t.filter(e=>e.id.name?.toLowerCase().includes(i)||e.serviceName?.toLowerCase().includes(i)||e.id.namespace?.toLowerCase().includes(i)):t,s=i?o.filter(e=>e.type?.toLowerCase().includes(i)||e.name?.toLowerCase().includes(i)):o,c=i?n.filter(e=>e.destinationType.displayName?.toLowerCase().includes(i)||e.name?.toLowerCase().includes(i)):n,d=[{category:Et.Source,label:"Sources",count:r.length,entities:[]},{category:Et.Action,label:"Actions",count:s.length,entities:[]},{category:Et.Destination,label:"Destinations",count:c.length,entities:[]},{category:Et.InstrumentationRule,label:"Instrumentation Rules",count:l.length,entities:[]}];d.unshift({category:"all",label:"All",count:l.length+r.length+s.length+c.length,entities:[]});const u=d.filter(({count:e,category:t})=>!!e&&"all"!==t&&["all",t].includes(a)).map(e=>({...e,entities:e.category===Et.InstrumentationRule?l:e.category===Et.Source?r:e.category===Et.Action?s:e.category===Et.Destination?c:[]}));return{categories:d,searchResults:u}})({instrumentationRules:S,sources:Fi(b,i),actions:C,destinations:Gt(y,i),searchText:r,selectedCategory:k}),[S,b,C,y,i,r,k]),A=a(()=>$.filter(({count:e,category:t})=>!!e||"all"===t).map(({category:e,label:t,count:o})=>({value:e,label:o?`${t} (${o})`:t})),[$]),R=O.some(({entities:e})=>e.length>0);return e(cf,{ref:x,children:[t(uo,{value:r,onChange:e=>d(e.toLowerCase()),onFocus:()=>T(!0),width:sf}),I&&e(df,{children:[A.length>1&&t(uf,{children:t(ve,{options:A,selected:k,setSelected:E})}),R?t(pf,{children:O.map(({category:o,label:i,entities:a},l)=>{if(!a.length)return null;const r=Yi(o);return e(c,{children:[t(hf,{children:t(ue,{size:he.XXS,color:pe.Secondary,children:i})}),a.map((i,a)=>e(mf,{onClick:()=>{const e=zt(i);e&&(u(vo(o)),p(e),N())},children:[r&&t(r,{size:16,fill:n.v2.colors.white[500]}),t(ue,{size:he.XS,nowrap:!0,children:Wi(i,o,{extended:!0})})]},`entity-${l}-${a}`))]},`category-list-${o}`)})}):t(gf,{children:t(Re,{hideIcon:!0,title:"No results",subTitle:r?`No matches for "${r}"`:"Start typing to search"})})]})]})},bf=({onRedirectToSampling:n})=>{const{sourcesApi:i}=Pl(),{items:l}=i.useSources(),{drawerType:r,drawerEntityId:s,setDrawerType:c,setDrawerEntityId:d}=ho(),u=()=>{c(null),d(null)},p=a(()=>l.map(({id:e})=>({id:`${e.namespace}/${e.kind}/${e.name}`,label:e.name,badge:e.kind,secondaryLabel:e.namespace})),[l]),h=a(()=>Array.from(new Set(l.map(({id:e})=>e.namespace))).sort().map(e=>({id:e,label:e})),[l]);return e(o,{children:[t(um,{}),r===dn.AddSource&&t(ql,{children:t(Pc,{onClose:u,withOverlay:!0})}),r===dn.AddDestination&&t(Jl,{children:t(Cc,{onClose:u,withOverlay:!0})}),r===dn.AddInstrumentationRule&&t(Ql,{sourceOptions:p,namespaceOptions:h,children:t(Sc,{onClose:u,withOverlay:!0})}),r===dn.AddAction&&t(Zl,{children:t(dc,{onClose:u,withOverlay:!0})}),r===dn.EditSource&&t(tr,{children:t(zh,{onClose:u,sourceId:s,onRedirectToSampling:n})}),r===dn.EditDestination&&t(Jl,{children:t(xu,{onClose:u,destinationId:s})}),r===dn.EditInstrumentationRule&&t(Ql,{sourceOptions:p,namespaceOptions:h,children:t(Tu,{onClose:u,ruleId:s})}),r===dn.EditAction&&t(Zl,{children:t(yu,{onClose:u,actionId:s})})]})},vf=b.div`
1281
+ `,wf=({preventPopup:o=!1})=>{const n=v(),{selectedStreamName:i}=tt(),{searchText:r,setSearchText:d}=Fi(),{setDrawerType:p,setDrawerEntityId:u}=ho(),{sourcesApi:h,destinationsApi:m,actionsApi:g,instrumentationRulesApi:f}=Ll(),b=h.useSources().items,y=m.useDestinations().items,C=g.useActions().items,S=f.useRules().items,x=l(null),[w,T]=s(!1),[k,E]=s("all"),I=!o&&(!!r||w),N=()=>{d(""),T(!1),E("all")};To(x,()=>N()),nn({key:"Escape",active:I},N);const{categories:$,searchResults:O}=a(()=>(({instrumentationRules:e,sources:t,actions:o,destinations:n,searchText:i,selectedCategory:a})=>{const l=i?e.filter(e=>e.type?.toLowerCase().includes(i)||e.ruleName?.toLowerCase().includes(i)):e,r=i?t.filter(e=>e.id.name?.toLowerCase().includes(i)||e.serviceName?.toLowerCase().includes(i)||e.id.namespace?.toLowerCase().includes(i)):t,s=i?o.filter(e=>e.type?.toLowerCase().includes(i)||e.name?.toLowerCase().includes(i)):o,c=i?n.filter(e=>e.destinationType.displayName?.toLowerCase().includes(i)||e.name?.toLowerCase().includes(i)):n,d=[{category:Et.Source,label:"Sources",count:r.length,entities:[]},{category:Et.Action,label:"Actions",count:s.length,entities:[]},{category:Et.Destination,label:"Destinations",count:c.length,entities:[]},{category:Et.InstrumentationRule,label:"Instrumentation Rules",count:l.length,entities:[]}];d.unshift({category:"all",label:"All",count:l.length+r.length+s.length+c.length,entities:[]});const p=d.filter(({count:e,category:t})=>!!e&&"all"!==t&&["all",t].includes(a)).map(e=>({...e,entities:e.category===Et.InstrumentationRule?l:e.category===Et.Source?r:e.category===Et.Action?s:e.category===Et.Destination?c:[]}));return{categories:d,searchResults:p}})({instrumentationRules:S,sources:Mi(b,i),actions:C,destinations:Gt(y,i),searchText:r,selectedCategory:k}),[S,b,C,y,i,r,k]),A=a(()=>$.filter(({count:e,category:t})=>!!e||"all"===t).map(({category:e,label:t,count:o})=>({value:e,label:o?`${t} (${o})`:t})),[$]),R=O.some(({entities:e})=>e.length>0);return e(ff,{ref:x,children:[t(po,{value:r,onChange:e=>d(e.toLowerCase()),onFocus:()=>T(!0),width:gf}),I&&e(bf,{children:[A.length>1&&t(vf,{children:t(ve,{options:A,selected:k,setSelected:E})}),R?t(yf,{children:O.map(({category:o,label:i,entities:a},l)=>{if(!a.length)return null;const r=qi(o);return e(c,{children:[t(Cf,{children:t(pe,{size:he.XXS,color:ue.Secondary,children:i})}),a.map((i,a)=>e(Sf,{onClick:()=>{const e=zt(i);e&&(p(vo(o)),u(e),N())},children:[r&&t(r,{size:16,fill:n.v2.colors.white[500]}),t(pe,{size:he.XS,nowrap:!0,children:Ki(i,o,{extended:!0})})]},`entity-${l}-${a}`))]},`category-list-${o}`)})}):t(xf,{children:t(Re,{hideIcon:!0,title:"No results",subTitle:r?`No matches for "${r}"`:"Start typing to search"})})]})]})},Tf=({onRedirectToSampling:n})=>{const{sourcesApi:i}=Ll(),{items:l}=i.useSources(),{drawerType:r,drawerEntityId:s,setDrawerType:c,setDrawerEntityId:d}=ho(),p=()=>{c(null),d(null)},u=a(()=>l.map(({id:e})=>({id:`${e.namespace}/${e.kind}/${e.name}`,label:e.name,badge:e.kind,secondaryLabel:e.namespace})),[l]),h=a(()=>Array.from(new Set(l.map(({id:e})=>e.namespace))).sort().map(e=>({id:e,label:e})),[l]);return e(o,{children:[t(vm,{}),r===pn.AddSource&&t(Jl,{children:t(Lc,{onClose:p,withOverlay:!0})}),r===pn.AddDestination&&t(Zl,{children:t(Sc,{onClose:p,withOverlay:!0})}),r===pn.AddInstrumentationRule&&t(er,{sourceOptions:u,namespaceOptions:h,children:t(xc,{onClose:p,withOverlay:!0})}),r===pn.AddAction&&t(Ql,{children:t(pc,{onClose:p,withOverlay:!0})}),r===pn.EditSource&&t(or,{children:t(Gh,{onClose:p,sourceId:s,onRedirectToSampling:n})}),r===pn.EditDestination&&t(Zl,{children:t(wp,{onClose:p,destinationId:s})}),r===pn.EditInstrumentationRule&&t(er,{sourceOptions:u,namespaceOptions:h,children:t(kp,{onClose:p,ruleId:s})}),r===pn.EditAction&&t(Ql,{children:t(Cp,{onClose:p,actionId:s})})]})},kf=b.div`
1271
1282
  position: relative;
1272
1283
  display: inline-flex;
1273
- `,yf=b.div`
1284
+ `,Ef=b.div`
1274
1285
  display: inline-flex;
1275
1286
  align-items: center;
1276
1287
  gap: 6px;
@@ -1281,7 +1292,7 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import n,{useEff
1281
1292
  &:hover {
1282
1293
  background-color: ${({theme:e})=>e.v2.colors.silver[800]};
1283
1294
  }
1284
- `,Cf=b.div`
1295
+ `,If=b.div`
1285
1296
  position: absolute;
1286
1297
  top: calc(100% + 8px);
1287
1298
  left: 0;
@@ -1295,18 +1306,18 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import n,{useEff
1295
1306
  border-radius: 12px;
1296
1307
  background-color: ${({theme:e})=>e.v2.colors.silver[900]};
1297
1308
  box-shadow: 0 0 24px 0 rgba(0, 0, 0, 0.3);
1298
- `,Sf=b.div`
1309
+ `,Nf=b.div`
1299
1310
  display: flex;
1300
1311
  align-items: center;
1301
1312
  gap: 8px;
1302
1313
  width: 100%;
1303
- `,xf=b.div`
1314
+ `,$f=b.div`
1304
1315
  display: flex;
1305
1316
  flex-direction: column;
1306
1317
  gap: 0;
1307
1318
  max-height: 240px;
1308
1319
  overflow-y: auto;
1309
- `,wf=b.div`
1320
+ `,Of=b.div`
1310
1321
  display: flex;
1311
1322
  align-items: center;
1312
1323
  gap: 8px;
@@ -1317,29 +1328,29 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import n,{useEff
1317
1328
  &:hover {
1318
1329
  background-color: ${({$selected:e,theme:t})=>e?t.v2.colors.silver[600]:t.v2.colors.silver[700]};
1319
1330
  }
1320
- `,Tf=b.div`
1331
+ `,Af=b.div`
1321
1332
  flex: 1;
1322
1333
  min-width: 0;
1323
1334
  overflow: hidden;
1324
1335
  text-overflow: ellipsis;
1325
1336
  white-space: nowrap;
1326
- `,kf=b.div`
1337
+ `,Rf=b.div`
1327
1338
  display: flex;
1328
1339
  align-items: center;
1329
1340
  gap: 2px;
1330
1341
  flex-shrink: 0;
1331
- `,Ef=b.div`
1342
+ `,Df=b.div`
1332
1343
  display: flex;
1333
1344
  padding-top: 4px;
1334
1345
  border-top: 1px solid ${({theme:e})=>e.v2.colors.silver[700]};
1335
- `,If=()=>{const n=v(),{isVm:r}=S(),{clearStore:c}=ea(),{dataStreamsApi:d}=Pl();d.useDataStreams();const{dataStreams:u,selectedStreamName:p,setSelectedStreamName:h}=tt(),m=l(null),[g,f]=s(!1),[b,y]=s(""),[C,x]=s(""),[w,T]=s(!1),[k,E]=s(!1),[I,N]=s(!1),[$,O]=s(""),[A,R]=s(!1);wo(m,()=>f(!1)),i(()=>{g||y("")},[g]);const D=a(()=>{if(!b)return u;const e=b.toLowerCase();return u.filter(({name:t})=>t.toLowerCase().includes(e))},[u,b]),_=g?za:Ba;return r?null:e(o,{children:[e(vf,{ref:m,children:[e(yf,{"data-id":"data-stream-select",$isOpen:g,onClick:()=>f(e=>!e),children:[t(El,{size:24}),t(ue,{size:he.S,weight:500,nowrap:!0,children:(P=p,`Data Stream: ${P}`)}),t(qe,{label:u.length,status:Fe.Unknown,textSize:he.XXXS}),t(_,{size:20,fill:n.v2.colors.silver[200]})]}),g&&e(Cf,{children:[t(Sf,{children:t(uo,{value:b,onChange:y,placeholder:"Search streams...",width:"100%"})}),t(xf,{children:0===D.length?t(wf,{children:t(ue,{size:he.XS,color:pe.Secondary,children:"No streams match"})}):D.map(({name:o})=>{const n=o===ta;return e(wf,{"data-id":`stream-row-${o}`,$selected:o===p,onClick:()=>(e=>{e!==p&&(c(),h(e)),f(!1)})(o),children:[t(Tf,{children:t(ue,{size:he.XS,nowrap:!0,children:o})}),e(kf,{children:[t(yt,{"data-id":`stream-edit-${o}`,icon:Da,size:Ct.XS,onClick:e=>{e.stopPropagation(),f(!1),x(o),T(!0)}}),!n&&t(yt,{"data-id":`stream-delete-${o}`,icon:Ea,size:Ct.XS,onClick:e=>{e.stopPropagation(),f(!1),O(o),R(!0)}})]})]},`stream-${o}`)})}),t(Ef,{children:t(ge,{"data-id":"add-stream-trigger",variant:be.Secondary,size:fe.S,leftIcon:Ia,label:`${Ft.NEW} ${et.STREAM_NAME}`,fullWidth:!0,onClick:()=>{f(!1),c(),N(!0),E(!0)}})})]})]}),I&&t(or,{defaultExcludeName:p,children:t(rm,{isOpen:k,onClose:()=>E(!1),onCloseEnd:()=>N(!1)})}),C&&t(or,{children:t(sm,{isOpen:w,dataStreamName:C,onClose:()=>T(!1),onCloseEnd:()=>x("")})}),t(yr,{target:`${et.STREAM_NAME.toLowerCase()} "${$}"`,isOpen:A,onClose:()=>R(!1),onApprove:async()=>{$&&await d.remove($)}})]});var P},Nf=()=>{const{selectedStreamName:n}=tt(),{selectedSources:l,setSelectedSources:c}=Vi(),{sourcesApi:d}=Pl(),[u,p]=s(!1),[h,m]=s(!1),g=a(()=>Object.values(l).reduce((e,t)=>e+t.length,0),[l]),f=r(()=>{c({})},[c]),b=r(()=>p(!1),[]),v=r(()=>m(!1),[]);i(()=>{f()},[n,f]);const y=r(()=>{d.restartWorkloads(Object.values(l).flat().filter(e=>e.id.kind!==yo.StaticPod).map(mo)),f()},[d,l,f]),C=r(()=>{d.persistV2(Object.fromEntries(Object.entries(l).map(([e,t])=>[e,t.map(({id:e})=>({namespace:e.namespace,name:e.name,kind:e.kind||void 0,region:e.region,selected:!1,currentStreamName:n}))]))),f()},[d,l,n,f]),S=a(()=>[{id:"multi-source-deselect",type:co.Button,buttonProps:{variant:be.Text,size:fe.S,label:"Deselect",onClick:f}},{id:"multi-source-restart",type:co.Button,buttonProps:{variant:be.Secondary,size:fe.S,label:"Restart",leftIcon:fl,onClick:()=>p(!0)}},{id:"multi-source-uninstrument",type:co.Button,buttonProps:{variant:be.Primary,size:fe.S,label:"Uninstrument",leftIcon:Ea,onClick:()=>m(!0)}}],[f]);return e(o,{children:[t(Ro,{isOpen:g>0,richTitle:{icon:Ha,title:"Selected sources",badge:{label:g}},actions:S}),t(Qe,{isOpen:u,title:"Rollout Restart Workloads",description:"Are you sure you want to rollout restart these workloads?",onClose:b,denyButton:{label:"Go Back",variant:be.Secondary,onClick:b},approveButton:{label:"Confirm",variant:be.Primary,onClick:()=>{y(),b()}}}),t(yr,{isOpen:h,action:"uninstrument",target:`${g} source${1===g?"":"s"}`,onClose:v,onDeny:v,onApprove:C})]})},$f=C`
1346
+ `,_f=()=>{const n=v(),{isVm:r}=S(),{clearStore:c}=ta(),{dataStreamsApi:d}=Ll();d.useDataStreams();const{dataStreams:p,selectedStreamName:u,setSelectedStreamName:h}=tt(),m=l(null),[g,f]=s(!1),[b,y]=s(""),[C,x]=s(""),[w,T]=s(!1),[k,E]=s(!1),[I,N]=s(!1),[$,O]=s(""),[A,R]=s(!1);To(m,()=>f(!1)),i(()=>{g||y("")},[g]);const D=a(()=>{if(!b)return p;const e=b.toLowerCase();return p.filter(({name:t})=>t.toLowerCase().includes(e))},[p,b]),_=g?Ba:Xa;return r?null:e(o,{children:[e(kf,{ref:m,children:[e(Ef,{"data-id":"data-stream-select",$isOpen:g,onClick:()=>f(e=>!e),children:[t(Il,{size:24}),t(pe,{size:he.S,weight:500,nowrap:!0,children:(P=u,`Data Stream: ${P}`)}),t(qe,{label:p.length,status:Fe.Unknown,textSize:he.XXXS}),t(_,{size:20,fill:n.v2.colors.silver[200]})]}),g&&e(If,{children:[t(Nf,{children:t(po,{value:b,onChange:y,placeholder:"Search streams...",width:"100%"})}),t($f,{children:0===D.length?t(Of,{children:t(pe,{size:he.XS,color:ue.Secondary,children:"No streams match"})}):D.map(({name:o})=>{const n=o===oa;return e(Of,{"data-id":`stream-row-${o}`,$selected:o===u,onClick:()=>(e=>{e!==u&&(c(),h(e)),f(!1)})(o),children:[t(Af,{children:t(pe,{size:he.XS,nowrap:!0,children:o})}),e(Rf,{children:[t(yt,{"data-id":`stream-edit-${o}`,icon:_a,size:Ct.XS,onClick:e=>{e.stopPropagation(),f(!1),x(o),T(!0)}}),!n&&t(yt,{"data-id":`stream-delete-${o}`,icon:Ia,size:Ct.XS,onClick:e=>{e.stopPropagation(),f(!1),O(o),R(!0)}})]})]},`stream-${o}`)})}),t(Df,{children:t(ge,{"data-id":"add-stream-trigger",variant:be.Secondary,size:fe.S,leftIcon:Na,label:`${Ft.NEW} ${et.STREAM_NAME}`,fullWidth:!0,onClick:()=>{f(!1),c(),N(!0),E(!0)}})})]})]}),I&&t(nr,{defaultExcludeName:u,children:t(mm,{isOpen:k,onClose:()=>E(!1),onCloseEnd:()=>N(!1)})}),C&&t(nr,{children:t(gm,{isOpen:w,dataStreamName:C,onClose:()=>T(!1),onCloseEnd:()=>x("")})}),t(Cr,{target:`${et.STREAM_NAME.toLowerCase()} "${$}"`,isOpen:A,onClose:()=>R(!1),onApprove:async()=>{$&&await d.remove($)}})]});var P},Pf=()=>{const{selectedStreamName:n}=tt(),{selectedSources:l,setSelectedSources:c}=Hi(),{sourcesApi:d}=Ll(),[p,u]=s(!1),[h,m]=s(!1),g=a(()=>Object.values(l).reduce((e,t)=>e+t.length,0),[l]),f=r(()=>{c({})},[c]),b=r(()=>u(!1),[]),v=r(()=>m(!1),[]);i(()=>{f()},[n,f]);const y=r(()=>{d.restartWorkloads(Object.values(l).flat().filter(e=>e.id.kind!==yo.StaticPod).map(mo)),f()},[d,l,f]),C=r(()=>{d.persistV2(Object.fromEntries(Object.entries(l).map(([e,t])=>[e,t.map(({id:e})=>({namespace:e.namespace,name:e.name,kind:e.kind||void 0,region:e.region,selected:!1,currentStreamName:n}))]))),f()},[d,l,n,f]),S=a(()=>[{id:"multi-source-deselect",type:co.Button,buttonProps:{variant:be.Text,size:fe.S,label:"Deselect",onClick:f}},{id:"multi-source-restart",type:co.Button,buttonProps:{variant:be.Secondary,size:fe.S,label:"Restart",leftIcon:dl,onClick:()=>u(!0)}},{id:"multi-source-uninstrument",type:co.Button,buttonProps:{variant:be.Primary,size:fe.S,label:"Uninstrument",leftIcon:Ia,onClick:()=>m(!0)}}],[f]);return e(o,{children:[t(Do,{isOpen:g>0,richTitle:{icon:ja,title:"Selected sources",badge:{label:g}},actions:S}),t(Qe,{isOpen:p,title:"Rollout Restart Workloads",description:"Are you sure you want to rollout restart these workloads?",onClose:b,denyButton:{label:"Go Back",variant:be.Secondary,onClick:b},approveButton:{label:"Confirm",variant:be.Primary,onClick:()=>{y(),b()}}}),t(Cr,{isOpen:h,action:"uninstrument",target:`${g} source${1===g?"":"s"}`,onClose:v,onDeny:v,onApprove:C})]})},Lf=C`
1336
1347
  0% {
1337
1348
  background-position: 200% 50%;
1338
1349
  }
1339
1350
  100% {
1340
1351
  background-position: 0% 50%;
1341
1352
  }
1342
- `,Of=b.div`
1353
+ `,Ff=b.div`
1343
1354
  display: flex;
1344
1355
  align-items: center;
1345
1356
  justify-content: space-evenly;
@@ -1350,43 +1361,43 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import n,{useEff
1350
1361
 
1351
1362
  background: ${({theme:e})=>`linear-gradient(90deg, ${e.v2.colors.pink[500]} 0%, ${e.v2.colors.purple[400]} 25%, ${e.v2.colors.green[500]} 50%, ${e.v2.colors.purple[400]} 75%, ${e.v2.colors.pink[500]} 100%)`};
1352
1363
  background-size: 200% 100%;
1353
- animation: ${$f} 15s linear infinite;
1354
- `,Af=[Va,Ha,Fa,Ma],Rf=({onRedirectToSampling:o})=>{const n=v();return e(_i,{children:[e(dt,{fullHeight:!0,customTitle:t(If,{}),customSearch:t(ff,{}),filters:t(Fg,{}),children:[t(Of,{children:Af.map((o,i)=>e(c,{children:[t(o,{size:24}),i<Af.length-1&&t(La,{fill:n.v2.colors.white[500]+pt["020"],size:24})]},o.name))}),t(rf,{})]}),t(bf,{onRedirectToSampling:o}),t(Nf,{})]})};var Df;(e=>{e.Gateway="gateway",e.Node="node"})(Df||(Df={}));const _f=({onClickDownloadDiagnose:o,onClickRefresh:n,loading:i,disabled:l})=>{const r=a(()=>{const e=[];return o&&e.push({id:sn(),type:co.Button,buttonProps:{label:"Download Diagnose",leftIcon:gl,size:fe.S,variant:be.Text,onClick:o,disabled:l}}),n&&e.push({id:sn(),type:co.Button,buttonProps:{label:"Refresh",leftIcon:Za,size:fe.S,variant:be.Text,onClick:n,disabled:l,loading:i}}),e},[o,n,l,i]);return e(me,{$alignItems:"center",$justifyContent:"space-between",children:[t(oa,{icon:Il,title:"Collectors Pipeline"}),t(na,{actions:r})]})},Pf=({pod:o,onClose:n})=>{const{formatTimeAgo:i}=Qt(),{collectorsApi:l}=Pl(),{data:r}=l.usePodInfo(o?{namespace:o.namespace,name:o.name}:void 0,{skip:!o}),s=a(()=>[{id:sn(),title:"Node",label:r?.node??"-",withCopy:!0},{id:sn(),title:"Status",badge:{status:ia(r?.status),label:r?.status??"-"}}],[r]),c=a(()=>r?.containers?.map(e=>({id:sn(),items:[{id:sn(),title:"Container",label:e.name??"-"},{id:sn(),title:"Status",label:e.startedAt?`${e.status} (since ${i(e.startedAt)})`:e.status},{id:sn(),title:"Ready",badge:{status:e.ready?Fe.Success:Fe.Error,leftIcon:e.ready?$a:Oa,label:e.ready?"True":"False",invertColors:!0}},{id:sn(),title:"Started",badge:{status:e.started?Fe.Success:Fe.Error,leftIcon:e.started?$a:Oa,label:e.started?"True":"False",invertColors:!0}},{id:sn(),title:"Image Version",label:e.image?.split(":")?.[1]??"-"},{id:sn(),title:"Image Repository",label:e.image?.split(":")?.[0]??"-"},{id:sn(),title:et.RESTARTS,label:e.restarts.toString()},{id:sn(),title:"State Reason",label:e.stateReason??"-"},{id:sn(),title:"Resource Requests",label:`CPU ${e.resources.requests.cpu} • Memory ${e.resources.requests.memory}`},{id:sn(),title:"Resource Limits",label:`CPU ${e.resources.limits.cpu} • Memory ${e.resources.limits.memory}`}]}))||[],[r]);return t(ce,{isOpen:!!o,header:{icon:el,title:"Pod Information",onClose:n},children:r?e(Xt,{bgTint:"1000",richTitle:{icon:el,title:r.name,withCopy:!0},children:[t(Xt,{bgTint:"900",cellsPerRow:2,items:s}),e(Xt,{bgTint:"900",richTitle:{icon:sl,title:et.DEBUG_COMMANDS},withCollapse:!0,collapseIsDefaultOpen:!0,children:[t(so,{value:`kubectl get pod ${r.name} -n ${r.namespace} -o yaml`}),t(so,{value:`kubectl describe pod ${r.name} -n ${r.namespace}`}),t(so,{value:`kubectl logs ${r.name} -n ${r.namespace}`})]}),t(Xt,{bgTint:"900",richTitle:{title:"Containers Overview"},withCollapse:!0,collapseIsDefaultOpen:!0,children:c.length?c.map(({id:e,items:o})=>t(Xt,{bgTint:"800",cellsPerRow:2,items:o},e)):t(Re,{title:"No containers",subTitle:"Pod has no containers"})}),t(Cr,{bgTint:"900",yaml:r.manifestYAML,defaultOpen:!0})]}):t(ft,{$height:"50vh",children:t(St,{withSpinner:!0})})})};var Lf;(e=>{e.PodName="podName",e.Status="status",e.Restarts="restarts",e.NodeName="nodeName",e.SpanDropRate="spanDropRate",e.Age="age",e.DockerImage="dockerImage"})(Lf||(Lf={}));const Ff=e=>{const t=[{key:Lf.PodName,label:"Pod Name"},{key:Lf.Status,label:"Status"},{key:Lf.Restarts,label:et.RESTARTS},{key:Lf.NodeName,label:"Node Name"},{key:Lf.Age,label:"Age"},{key:Lf.DockerImage,label:"Collector Version"}];return e&&t.splice(4,0,{key:Lf.SpanDropRate,label:"Span Drop Rate",noSort:!0,noFilter:!0}),t},Mf=({isLoading:o,pods:n,withSpanDropRate:i})=>{const l=v(),{formatTimeAgo:r}=Qt(),[c,d]=s(null),u=a(()=>n.map(o=>({onClick:()=>d(o),cells:[{key:Lf.PodName,rawValue:o.name},{key:Lf.Status,rawValue:o.status,component:()=>{return e=o.status,t(qe,{status:ia(e),label:e});var e}},{key:Lf.Restarts,rawValue:o.restartsCount.toString()},{key:Lf.NodeName,rawValue:o.nodeName},{key:Lf.SpanDropRate,rawValue:0,component:()=>{const{collectorMetrics:n}=o;if(!n)return t(ue,{children:"-"});const i=(n?.metricsAcceptedRps??0)+(n?.metricsDroppedRps??0),a=i>0?Math.round((n?.metricsDroppedRps??0)/i*100):0,l=a>0?Fe.Error:Fe.Success,r=(n?.exporterSuccessRps??0)+(n?.exporterFailedRps??0),s=r>0?Math.round((n?.exporterFailedRps??0)/r*100):0,c=s>0?Fe.Error:Fe.Success;return e(me,{$gap:4,children:[t($e,{text:`Accepted: ${n.metricsAcceptedRps.toLocaleString()} spans/s\nDropped: ${n.metricsDroppedRps.toLocaleString()} spans/s`,children:t(qe,{status:l,label:`Receiver ${a}%`,leftIcon:l===Fe.Error?Nl:$l,useSecondaryTone:!0,invertColors:!0})}),t($e,{text:`Success: ${n.exporterSuccessRps.toLocaleString()} spans/s\nFailed: ${n.exporterFailedRps.toLocaleString()} spans/s`,children:t(qe,{status:c,label:`Exporter ${s}%`,leftIcon:c===Fe.Error?Nl:$l,useSecondaryTone:!0,invertColors:!0})})]})}},{key:Lf.Age,rawValue:r(o.creationTimestamp)},{key:Lf.DockerImage,rawValue:o.image}]})),[n,l]);return e(Xt,{fullHeight:!0,bgTint:"1000",moreSpacing:!0,richTitle:{icon:el,title:"Pods"},children:[t(Oo,{variant:Ao.Data,isLoading:o,columns:Ff(i),rows:u}),t(Pf,{pod:c,onClose:()=>d(null)})]})},zf=({isOpen:e,onClose:o,title:n,yaml:i})=>t(ce,{isOpen:e,header:{icon:Ol,title:n,onClose:o},children:t(Cr,{yaml:i,defaultOpen:!0})}),Bf=e=>{switch(e){case aa.Healthy:return"All desired replicas are updated, available, and ready";case aa.Updating:return"Workload is progressing towards desired state (e.g., updating pods)";case aa.Degraded:return"Progressing but with availability issues (e.g., not enough available replicas)";case aa.Failed:return"Progress deadline exceeded or an unrecoverable error occurred";case aa.Down:return"No available replicas";case aa.Unknown:return"Status cannot be determined from current signals";default:return"Status unknown"}};var Xf;(e=>{e.ManifestYaml="manifest-yaml",e.ConfigMapYaml="configmap-yaml"})(Xf||(Xf={}));const Uf=b.div`
1364
+ animation: ${Lf} 15s linear infinite;
1365
+ `,Mf=[Ha,ja,Ma,za],zf=({onRedirectToSampling:o})=>{const n=v();return e(Pi,{children:[e(dt,{fullHeight:!0,customTitle:t(_f,{}),customSearch:t(wf,{}),filters:t(Hg,{}),children:[t(Ff,{children:Mf.map((o,i)=>e(c,{children:[t(o,{size:24}),i<Mf.length-1&&t(Fa,{fill:n.v2.colors.white[500]+ut["020"],size:24})]},o.name))}),t(mf,{})]}),t(Tf,{onRedirectToSampling:o}),t(Pf,{})]})};var Bf;(e=>{e.Gateway="gateway",e.Node="node"})(Bf||(Bf={}));const Xf=({onClickDownloadDiagnose:o,onClickRefresh:n,loading:i,disabled:l})=>{const r=a(()=>{const e=[];return o&&e.push({id:cn(),type:co.Button,buttonProps:{label:"Download Diagnose",leftIcon:bl,size:fe.S,variant:be.Text,onClick:o,disabled:l}}),n&&e.push({id:cn(),type:co.Button,buttonProps:{label:"Refresh",leftIcon:Qa,size:fe.S,variant:be.Text,onClick:n,disabled:l,loading:i}}),e},[o,n,l,i]);return e(me,{$alignItems:"center",$justifyContent:"space-between",children:[t(na,{icon:Nl,title:"Collectors Pipeline"}),t(ia,{actions:r})]})},Uf=({pod:o,onClose:n})=>{const{formatTimeAgo:i}=Qt(),{collectorsApi:l}=Ll(),{data:r}=l.usePodInfo(o?{namespace:o.namespace,name:o.name}:void 0,{skip:!o}),s=a(()=>[{id:cn(),title:"Node",label:r?.node??"-",withCopy:!0},{id:cn(),title:"Status",badge:{status:aa(r?.status),label:r?.status??"-"}}],[r]),c=a(()=>r?.containers?.map(e=>({id:cn(),items:[{id:cn(),title:"Container",label:e.name??"-"},{id:cn(),title:"Status",label:e.startedAt?`${e.status} (since ${i(e.startedAt)})`:e.status},{id:cn(),title:"Ready",badge:{status:e.ready?Fe.Success:Fe.Error,leftIcon:e.ready?Oa:Aa,label:e.ready?"True":"False",invertColors:!0}},{id:cn(),title:"Started",badge:{status:e.started?Fe.Success:Fe.Error,leftIcon:e.started?Oa:Aa,label:e.started?"True":"False",invertColors:!0}},{id:cn(),title:"Image Version",label:e.image?.split(":")?.[1]??"-"},{id:cn(),title:"Image Repository",label:e.image?.split(":")?.[0]??"-"},{id:cn(),title:et.RESTARTS,label:e.restarts.toString()},{id:cn(),title:"State Reason",label:e.stateReason??"-"},{id:cn(),title:"Resource Requests",label:`CPU ${e.resources.requests.cpu} • Memory ${e.resources.requests.memory}`},{id:cn(),title:"Resource Limits",label:`CPU ${e.resources.limits.cpu} • Memory ${e.resources.limits.memory}`}]}))||[],[r]);return t(ce,{isOpen:!!o,header:{icon:tl,title:"Pod Information",onClose:n},children:r?e(Xt,{bgTint:"1000",richTitle:{icon:tl,title:r.name,withCopy:!0},children:[t(Xt,{bgTint:"900",cellsPerRow:2,items:s}),e(Xt,{bgTint:"900",richTitle:{icon:cl,title:et.DEBUG_COMMANDS},withCollapse:!0,collapseIsDefaultOpen:!0,children:[t(so,{value:`kubectl get pod ${r.name} -n ${r.namespace} -o yaml`}),t(so,{value:`kubectl describe pod ${r.name} -n ${r.namespace}`}),t(so,{value:`kubectl logs ${r.name} -n ${r.namespace}`})]}),t(Xt,{bgTint:"900",richTitle:{title:"Containers Overview"},withCollapse:!0,collapseIsDefaultOpen:!0,children:c.length?c.map(({id:e,items:o})=>t(Xt,{bgTint:"800",cellsPerRow:2,items:o},e)):t(Re,{title:"No containers",subTitle:"Pod has no containers"})}),t(Sr,{bgTint:"900",yaml:r.manifestYAML,defaultOpen:!0})]}):t(ft,{$height:"50vh",children:t(St,{withSpinner:!0})})})};var Vf;(e=>{e.PodName="podName",e.Status="status",e.Restarts="restarts",e.NodeName="nodeName",e.SpanDropRate="spanDropRate",e.Age="age",e.DockerImage="dockerImage"})(Vf||(Vf={}));const Hf=e=>{const t=[{key:Vf.PodName,label:"Pod Name"},{key:Vf.Status,label:"Status"},{key:Vf.Restarts,label:et.RESTARTS},{key:Vf.NodeName,label:"Node Name"},{key:Vf.Age,label:"Age"},{key:Vf.DockerImage,label:"Collector Version"}];return e&&t.splice(4,0,{key:Vf.SpanDropRate,label:"Span Drop Rate",noSort:!0,noFilter:!0}),t},jf=({isLoading:o,pods:n,withSpanDropRate:i})=>{const l=v(),{formatTimeAgo:r}=Qt(),[c,d]=s(null),p=a(()=>n.map(o=>({onClick:()=>d(o),cells:[{key:Vf.PodName,rawValue:o.name},{key:Vf.Status,rawValue:o.status,component:()=>{return e=o.status,t(qe,{status:aa(e),label:e});var e}},{key:Vf.Restarts,rawValue:o.restartsCount.toString()},{key:Vf.NodeName,rawValue:o.nodeName},{key:Vf.SpanDropRate,rawValue:0,component:()=>{const{collectorMetrics:n}=o;if(!n)return t(pe,{children:"-"});const i=(n?.metricsAcceptedRps??0)+(n?.metricsDroppedRps??0),a=i>0?Math.round((n?.metricsDroppedRps??0)/i*100):0,l=a>0?Fe.Error:Fe.Success,r=(n?.exporterSuccessRps??0)+(n?.exporterFailedRps??0),s=r>0?Math.round((n?.exporterFailedRps??0)/r*100):0,c=s>0?Fe.Error:Fe.Success;return e(me,{$gap:4,children:[t($e,{text:`Accepted: ${n.metricsAcceptedRps.toLocaleString()} spans/s\nDropped: ${n.metricsDroppedRps.toLocaleString()} spans/s`,children:t(qe,{status:l,label:`Receiver ${a}%`,leftIcon:l===Fe.Error?$l:Ol,useSecondaryTone:!0,invertColors:!0})}),t($e,{text:`Success: ${n.exporterSuccessRps.toLocaleString()} spans/s\nFailed: ${n.exporterFailedRps.toLocaleString()} spans/s`,children:t(qe,{status:c,label:`Exporter ${s}%`,leftIcon:c===Fe.Error?$l:Ol,useSecondaryTone:!0,invertColors:!0})})]})}},{key:Vf.Age,rawValue:r(o.creationTimestamp)},{key:Vf.DockerImage,rawValue:o.image}]})),[n,l]);return e(Xt,{fullHeight:!0,bgTint:"1000",moreSpacing:!0,richTitle:{icon:tl,title:"Pods"},children:[t(Ao,{variant:Ro.Data,isLoading:o,columns:Hf(i),rows:p}),t(Uf,{pod:c,onClose:()=>d(null)})]})},Gf=({isOpen:e,onClose:o,title:n,yaml:i})=>t(ce,{isOpen:e,header:{icon:Al,title:n,onClose:o},children:t(Sr,{yaml:i,defaultOpen:!0})}),Wf=e=>{switch(e){case la.Healthy:return"All desired replicas are updated, available, and ready";case la.Updating:return"Workload is progressing towards desired state (e.g., updating pods)";case la.Degraded:return"Progressing but with availability issues (e.g., not enough available replicas)";case la.Failed:return"Progress deadline exceeded or an unrecoverable error occurred";case la.Down:return"No available replicas";case la.Unknown:return"Status cannot be determined from current signals";default:return"Status unknown"}};var Kf;(e=>{e.ManifestYaml="manifest-yaml",e.ConfigMapYaml="configmap-yaml"})(Kf||(Kf={}));const Yf=b.div`
1355
1366
  flex: 0.5;
1356
1367
  padding: 12px;
1357
1368
  border-radius: 12px;
1358
1369
  background-color: ${({theme:e})=>e.v2.colors.silver[800]};
1359
- `,Vf=({selectedTab:o,gatewayInfo:n,nodeCollectorInfo:i,isLoading:l})=>{const{formatTimeAgo:r}=Qt(),[c,d]=s(null),u=a(()=>(e=>{switch(e){case Df.Gateway:return"Deployment";case Df.Node:return"DaemonSet";default:return"Pipeline Collectors"}})(o),[o]),p=a(()=>((e,t,o,n)=>{const i={status:Fe.Disabled,label:"No rollouts yet"};let a=!1,l=null;switch(e){case Df.Gateway:a=t?.rolloutInProgress??!1,l=t?.lastRolloutAt??null;break;case Df.Node:a=o?.rolloutInProgress??!1,l=o?.lastRolloutAt??null;break;default:return i}return a?{status:Fe.Info,label:"Rollout in progress",rightIcon:Za,useSecondaryTone:!0}:l?{status:Fe.Disabled,label:`Last Rollout: ${n(l)}`}:i})(o,n,i,r),[n,i,o,r]),h=a(()=>((e,t,o,n)=>{let i=n?Fe.Info:Fe.Unknown,a=n?"Loading":aa.Unknown,l=n?"Fetching data...":Bf(aa.Unknown);switch(e){case Df.Gateway:i=t?.status?ia(t?.status):i,a=t?.status??a,l=t?.status?Bf(t.status):l;break;case Df.Node:i=o?.status?ia(o?.status):i,a=o?.status??a,l=o?.status?Bf(o.status):l}return{status:i,title:a,description:l}})(o,n,i,l),[n,i,o,l]),m=a(()=>((e,t,o)=>{switch(e){case Df.Gateway:return[{gaugeWidth:128,min:0,max:t?.hpa?.max??0,current:t?.hpa?.current??0,title:"HPA Spec",primaryLabel:"Current replicas",secondaryLabel:"Max replicas"}];case Df.Node:return[{gaugeWidth:128,min:0,max:o?.nodes?.desired??0,current:o?.nodes?.ready??0,title:"Nodes",primaryLabel:"Ready nodes",secondaryLabel:"Desired nodes"}];default:return[]}})(o,n,i),[n,i,o]),g=a(()=>((e,t,o,n)=>{switch(e){case Df.Gateway:return[{title:"Resources (request/limit)",cells:[{label:"CPU",value:`${t?.resources?.requests.cpu}/${t?.resources?.limits.cpu}`,isLoading:n},{label:"Memory",value:`${t?.resources?.requests.memory}/${t?.resources?.limits.memory}`,isLoading:n}]}];case Df.Node:return[{title:"Resources (request/limit)",cells:[{label:"CPU",value:`${o?.resources?.requests.cpu}/${o?.resources?.limits.cpu}`,isLoading:n},{label:"Memory",value:`${o?.resources?.requests.memory}/${o?.resources?.limits.memory}`,isLoading:n}]}];default:return[]}})(o,n,i,l),[n,i,o,l]),f=a(()=>(o===Df.Gateway?n?.manifestYAML:i?.manifestYAML)??"",[n,i,o]),b=a(()=>(o===Df.Gateway?n?.configMapYAML:i?.configMapYAML)??"",[n,i,o]);return e(Xt,{bgTint:"1000",moreSpacing:!0,richTitle:{icon:Ol,title:u,badge:p},actions:[{id:sn(),type:co.ButtonDropData,buttonProps:{variant:be.Secondary,size:fe.S,label:"View YAML",onClick:e=>d(e)},dropDataProps:{items:[{id:Xf.ManifestYaml,label:u,icon:Al},{id:Xf.ConfigMapYaml,label:"ConfigMap",icon:Al}]}}],children:[e(me,{$gap:16,children:[t("div",{children:t(la,{...h})}),m.map(e=>t(Uf,{children:t("div",{children:t(ra,{...e})})},e.title)),g.map(e=>t(sa,{...e},e.title))]}),t(zf,{isOpen:c===Xf.ManifestYaml,onClose:()=>d(null),title:u,yaml:f}),t(zf,{isOpen:c===Xf.ConfigMapYaml,onClose:()=>d(null),title:"ConfigMap",yaml:b})]})},Hf=[{value:Df.Gateway,label:"Gateway"},{value:Df.Node,label:"Node Collector"}],jf=({minSupportedVersion:o})=>{const{isVersionSupported:n,version:i,minSupportedVersion:l}=S(o),[c,d]=s(Df.Gateway),u=c===Df.Gateway,p=c===Df.Node,{collectorsApi:h,configApi:m}=Pl(),{data:g}=m.useEffectiveConfig(),{data:f,loading:b,refetch:v}=h.useGatewayInfo({skip:!u}),{data:y=[],loading:C,refetch:x}=h.useGatewayPods({skip:!u}),{data:w,loading:T,refetch:k}=h.useNodeCollectorInfo({skip:!p}),{data:E=[],loading:I,refetch:N}=h.useNodeCollectorPods({skip:!p}),$=u&&(b||C)||p&&(T||I),O=r(()=>{u?(v(),x()):p&&(k(),N())},[u,p,v,x,k,N]),A=a(()=>u?y:E,[y,E,u]);return e(_i,{children:[t(_f,{disabled:!n,loading:$,onClickDownloadDiagnose:void 0,onClickRefresh:O}),e(ca,{children:[e(ee,{children:[t(ve,{variant:$o.Underline,size:_e.L,options:Hf,selected:c,setSelected:d}),t(Vf,{selectedTab:c,gatewayInfo:f??null,nodeCollectorInfo:w??null,isLoading:$})]}),t(Mf,{isLoading:$,pods:A,withSpanDropRate:!1===g?.odigosOwnTelemetryStore?.metricsStoreDisabled}),!n&&t(wr,{minSupportedVersion:l,currentVersion:i||""})]})]})},Gf=b.div`
1370
+ `,qf=({selectedTab:o,gatewayInfo:n,nodeCollectorInfo:i,isLoading:l})=>{const{formatTimeAgo:r}=Qt(),[c,d]=s(null),p=a(()=>(e=>{switch(e){case Bf.Gateway:return"Deployment";case Bf.Node:return"DaemonSet";default:return"Pipeline Collectors"}})(o),[o]),u=a(()=>((e,t,o,n)=>{const i={status:Fe.Disabled,label:"No rollouts yet"};let a=!1,l=null;switch(e){case Bf.Gateway:a=t?.rolloutInProgress??!1,l=t?.lastRolloutAt??null;break;case Bf.Node:a=o?.rolloutInProgress??!1,l=o?.lastRolloutAt??null;break;default:return i}return a?{status:Fe.Info,label:"Rollout in progress",rightIcon:Qa,useSecondaryTone:!0}:l?{status:Fe.Disabled,label:`Last Rollout: ${n(l)}`}:i})(o,n,i,r),[n,i,o,r]),h=a(()=>((e,t,o,n)=>{let i=n?Fe.Info:Fe.Unknown,a=n?"Loading":la.Unknown,l=n?"Fetching data...":Wf(la.Unknown);switch(e){case Bf.Gateway:i=t?.status?aa(t?.status):i,a=t?.status??a,l=t?.status?Wf(t.status):l;break;case Bf.Node:i=o?.status?aa(o?.status):i,a=o?.status??a,l=o?.status?Wf(o.status):l}return{status:i,title:a,description:l}})(o,n,i,l),[n,i,o,l]),m=a(()=>((e,t,o)=>{switch(e){case Bf.Gateway:return[{gaugeWidth:128,min:0,max:t?.hpa?.max??0,current:t?.hpa?.current??0,title:"HPA Spec",primaryLabel:"Current replicas",secondaryLabel:"Max replicas"}];case Bf.Node:return[{gaugeWidth:128,min:0,max:o?.nodes?.desired??0,current:o?.nodes?.ready??0,title:"Nodes",primaryLabel:"Ready nodes",secondaryLabel:"Desired nodes"}];default:return[]}})(o,n,i),[n,i,o]),g=a(()=>((e,t,o,n)=>{switch(e){case Bf.Gateway:return[{title:"Resources (request/limit)",cells:[{label:"CPU",value:`${t?.resources?.requests.cpu}/${t?.resources?.limits.cpu}`,isLoading:n},{label:"Memory",value:`${t?.resources?.requests.memory}/${t?.resources?.limits.memory}`,isLoading:n}]}];case Bf.Node:return[{title:"Resources (request/limit)",cells:[{label:"CPU",value:`${o?.resources?.requests.cpu}/${o?.resources?.limits.cpu}`,isLoading:n},{label:"Memory",value:`${o?.resources?.requests.memory}/${o?.resources?.limits.memory}`,isLoading:n}]}];default:return[]}})(o,n,i,l),[n,i,o,l]),f=a(()=>(o===Bf.Gateway?n?.manifestYAML:i?.manifestYAML)??"",[n,i,o]),b=a(()=>(o===Bf.Gateway?n?.configMapYAML:i?.configMapYAML)??"",[n,i,o]);return e(Xt,{bgTint:"1000",moreSpacing:!0,richTitle:{icon:Al,title:p,badge:u},actions:[{id:cn(),type:co.ButtonDropData,buttonProps:{variant:be.Secondary,size:fe.S,label:"View YAML",onClick:e=>d(e)},dropDataProps:{items:[{id:Kf.ManifestYaml,label:p,icon:Rl},{id:Kf.ConfigMapYaml,label:"ConfigMap",icon:Rl}]}}],children:[e(me,{$gap:16,children:[t("div",{children:t(ra,{...h})}),m.map(e=>t(Yf,{children:t("div",{children:t(sa,{...e})})},e.title)),g.map(e=>t(ca,{...e},e.title))]}),t(Gf,{isOpen:c===Kf.ManifestYaml,onClose:()=>d(null),title:p,yaml:f}),t(Gf,{isOpen:c===Kf.ConfigMapYaml,onClose:()=>d(null),title:"ConfigMap",yaml:b})]})},Jf=[{value:Bf.Gateway,label:"Gateway"},{value:Bf.Node,label:"Node Collector"}],Zf=({minSupportedVersion:o})=>{const{isVersionSupported:n,version:i,minSupportedVersion:l}=S(o),[c,d]=s(Bf.Gateway),p=c===Bf.Gateway,u=c===Bf.Node,{collectorsApi:h,configApi:m}=Ll(),{data:g}=m.useEffectiveConfig(),{data:f,loading:b,refetch:v}=h.useGatewayInfo({skip:!p}),{data:y=[],loading:C,refetch:x}=h.useGatewayPods({skip:!p}),{data:w,loading:T,refetch:k}=h.useNodeCollectorInfo({skip:!u}),{data:E=[],loading:I,refetch:N}=h.useNodeCollectorPods({skip:!u}),$=p&&(b||C)||u&&(T||I),O=r(()=>{p?(v(),x()):u&&(k(),N())},[p,u,v,x,k,N]),A=a(()=>p?y:E,[y,E,p]);return e(Pi,{children:[t(Xf,{disabled:!n,loading:$,onClickDownloadDiagnose:void 0,onClickRefresh:O}),e(da,{children:[e(ee,{children:[t(ve,{variant:Oo.Underline,size:_e.L,options:Jf,selected:c,setSelected:d}),t(qf,{selectedTab:c,gatewayInfo:f??null,nodeCollectorInfo:w??null,isLoading:$})]}),t(jf,{isLoading:$,pods:A,withSpanDropRate:!1===g?.odigosOwnTelemetryStore?.metricsStoreDisabled}),!n&&t(Tr,{minSupportedVersion:l,currentVersion:i||""})]})]})},Qf=b.div`
1360
1371
  display: inline-flex;
1361
1372
  align-items: center;
1362
1373
  min-width: 0;
1363
1374
  overflow: hidden;
1364
1375
  white-space: pre;
1365
1376
  text-overflow: ellipsis;
1366
- `,Wf=b.div`
1377
+ `,eb=b.div`
1367
1378
  display: flex;
1368
1379
  flex-direction: column;
1369
1380
  gap: 4px;
1370
1381
  min-width: 0;
1371
1382
  flex: 1;
1372
1383
  opacity: ${({$disabled:e})=>e?.4:1};
1373
- `,Kf=b(me)`
1384
+ `,tb=b(me)`
1374
1385
  flex-shrink: 0;
1375
1386
  gap: 6px;
1376
1387
  align-items: center;
1377
1388
  min-height: 22px;
1378
- `,Yf=[{key:"content",label:"Content",noSort:!0,noFilter:!0,flex:1},{key:"badges",label:"Type",noSort:!0,noFilter:!0,flex:"0 0 128px"}],qf=[{value:"all",label:da},{value:"Relevance",label:"Relevance"},{value:"Duration",label:"Duration"},{value:"Error",label:"Error"}],Jf=({title:o,items:n,isLoading:i,showTypeFilter:l,onRuleClick:c,onCreateRule:d,onEditRule:u,onDeleteRule:p})=>{const h=v(),[m,g]=s(""),[f,b]=s("all"),y=a(()=>{let e=((e,t,o)=>o&&"all"!==t?e.filter(e=>e.typeBadge===t):e)(n,f,l);return e=((e,t)=>{if(!t.trim())return e;const o=t.toLowerCase();return e.filter(e=>{const t=e.name?.toLowerCase().includes(o),n=e.summary.map(e=>e.text).join("").toLowerCase();return t||n.includes(o)})})(e,m),e},[n,f,l,m]),C=a(()=>y.map(o=>{const n=o.typeBadge?((e,t)=>{const o=e.v2.colors;switch(t){case"Relevance":return{bg:o.blue[700],text:o.white[500]};case"Duration":return{bg:o.purple[700],text:o.white[500]};case"Error":return{bg:o.red[500],text:o.black[500]}}})(h,o.typeBadge):void 0;return{cells:[{key:"content",rawValue:o.summary.map(e=>e.text).join(""),component:()=>e(Wf,{$disabled:o.disabled,children:[t(Gf,{children:t(w,{parts:o.summary})}),o.name&&t(ue,{size:he.XXS,color:pe.Secondary,nowrap:!0,children:o.name})]})},{key:"badges",rawValue:o.typeBadge||"",component:()=>e(Kf,{children:[o.disabled&&t(qe,{label:Do,textSize:he.XXXS,backgroundColor:h.v2.colors.grey[700],textColor:h.v2.colors.grey[300]}),o.typeBadge&&n&&t(qe,{label:o.typeBadge,textSize:he.XXXS,backgroundColor:n.bg,textColor:n.text})]})}],onClick:()=>c(o)}}),[y,h,c]),S=a(()=>{const e=e=>t(Ra,{...e,fill:h.v2.colors.red[500]});return e.displayName="RedDeleteIcon",e},[h]),x=r(e=>{const t=C.indexOf(e);if(t<0)return[];const o=y[t];return o?[{id:"edit","data-id":"sampling-rule-action-edit",label:Mo,leftIcon:Da,onClick:()=>u(o.ruleId,o.samplingId)},{id:"delete","data-id":"sampling-rule-action-delete",label:"",leftIcon:S,onClick:()=>p(o.ruleId,o.samplingId)}]:[]},[C,y,u,p,S]);return t(dt,{fullHeight:!0,richTitle:{icon:vl,title:o,badge:{label:n.length,backgroundColor:h.v2.colors.silver[600],textColor:h.v2.colors.white[500]}},search:{"data-id":"sampling-search-rules",value:m,onChange:g,placeholder:"Search..",width:"500px",...l?{segment:{"data-id":"sampling-segment-type-filter",options:qf,selected:f,setSelected:b}}:{}},children:t(Oo,{variant:Ao.Pretty,hideHeader:!0,isLoading:i,noDataProps:m.trim()?{hideIcon:!0,title:ua,subTitle:ma(m)}:{hideIcon:!0,title:ha,button:{label:pa,onClick:d}},columns:Yf,rows:C,getRowActions:x})})},Zf=({docsUrl:o})=>{const{samplingApi:n,sourcesApi:c}=Pl(),{items:d}=c.useSources(),u=a(()=>d.map(e=>({id:e.id})),[d]),{items:p,loading:h,k8sHealthProbesConfig:m,refetch:g}=n.useSamplingRules(),f=r((e,t)=>n.createNoisy?.({samplingId:e,rule:t}),[n]),b=r((e,t,o)=>n.updateNoisy?.(t,{samplingId:e,rule:o}),[n]),v=r((e,t)=>n.createHighlyRelevant?.({samplingId:e,rule:t}),[n]),y=r((e,t,o)=>n.updateHighlyRelevant?.(t,{samplingId:e,rule:o}),[n]),C=r((e,t)=>n.createCostReduction?.({samplingId:e,rule:t}),[n]),S=r((e,t,o)=>n.updateCostReduction?.(t,{samplingId:e,rule:o}),[n]),x=r((e,t,o)=>"noisy"===o?n.deleteNoisy?.(t,e):"highlyRelevant"===o?n.deleteHighlyRelevant?.(t,e):"costReduction"===o?n.deleteCostReduction?.(t,e):void 0,[n]),w=r((e,t)=>n.updateK8sHealthProbesConfig?.({enabled:e,keepPercentage:t}),[n]),T=a(()=>u.map(({id:e})=>({id:`${e.namespace}/${e.kind}/${e.name}`,label:e.name,badge:e.kind,secondaryLabel:e.namespace})),[u]),k=a(()=>Array.from(new Set(u.map(({id:e})=>e.namespace))).sort().map(e=>({id:e,label:e})),[u]),[E,I]=s(P.Noisy),[N,$]=s(null),[O,D]=s(!1),[_,Q]=s(!1),[te,oe]=s(null),[ne,ie]=s(!1),[ae,le]=s(!1),[re,se]=s(!1),[ce,de]=s(!1);l(!1),i(()=>{},[h,p]);const{pendingViewSamplingRule:ue,setPendingViewSamplingRule:pe}=ho();i(()=>{if(!ue)return;if(h||0===p.length)return;pe(null);const e=L(p,ue.ruleId,ue.category);e&&(I(F[ue.category]),D(!1),$(e))},[h,p,ue,pe]);const he=a(()=>A(m),[m]),ye=a(()=>M(p),[p]),Ce=a(()=>R(ye?.rule??null),[ye]),Se=a(()=>z(p),[p]),xe=a(()=>B(Se?.rule??null),[Se]),we=l(N);we.current=N,i(()=>{const e=we.current;if(!e)return;const t=X(p,e);t?$(t):($(null),D(!1))},[p]);const Te=a(()=>{const e=new Set;return ye&&e.add(ye.rule.ruleId),Se&&e.add(Se.rule.ruleId),e},[ye,Se]),ke=a(()=>U(p,E,Te),[p,E,Te]),Ee=r(()=>Q(!0),[]),Ie=r(()=>Q(!1),[]);r(()=>de(!1),[]);const Ne=r(async e=>{const t=p[0]?.id??"default";switch(K[E]){case"noisy":await f(t,j(e));break;case"highlyRelevant":await v(t,H(e));break;case"costReduction":await C(t,V(e))}Q(!1)},[p,E,f,v,C]),$e=r(e=>{const t=G(p,e);t&&(D(!1),$(t))},[p]),Oe=r(()=>{$(null),D(!1)},[]),Ae=r((e,t)=>{const o=N;if(o&&o.rule.ruleId===e&&o.samplingId===t)D(!0),$({...o});else for(const o of p){if(o.id!==t)continue;const n=[...o.noisyOperations.map(e=>({category:"noisy",rule:e})),...o.highlyRelevantOperations.map(e=>({category:"highlyRelevant",rule:e})),...o.costReductionRules.map(e=>({category:"costReduction",rule:e}))].find(t=>t.rule.ruleId===e);if(n)return D(!0),void $({category:n.category,rule:n.rule,samplingId:t,summary:W(n.category,n.rule)})}},[N,p]),Re=r(async(e,t,o)=>{const n=N?.category;if(n){switch(n){case"noisy":await b(o,t,j(e));break;case"highlyRelevant":await y(o,t,H(e));break;case"costReduction":await S(o,t,V(e))}D(!1)}},[N,b,y,S]),De=r((e,t)=>{oe({ruleId:e,samplingId:t})},[]),Pe=r(async()=>{if(!te)return;const{ruleId:e,samplingId:t}=te,o=N?.category||K[E];await x(t,e,o),$(null),D(!1),oe(null)},[te,N,E,x]),Me=r(()=>oe(null),[]),ze=r(async(e,t)=>{await w(e,t),ie(!1)},[w]),Be=r(async e=>{const t=p[0]?.id??"default",o=ye;o?await y(o.samplingId,o.rule.ruleId,{name:o.rule.name,disabled:!e,error:!0,sourceScopes:null,operation:null,percentageAtLeast:null,notes:o.rule.notes}):e&&await v(t,{name:"Auto - Keep All Error Traces",disabled:!1,error:!0,sourceScopes:null,operation:null,percentageAtLeast:null}),le(!1)},[p,ye,v,y]),Xe=r(async(e,t)=>{const o=p[0]?.id??"default",n=Se;n?await S(n.samplingId,n.rule.ruleId,{name:n.rule.name,disabled:!e,sourceScopes:null,operation:null,percentageAtMost:t,notes:n.rule.notes}):e&&await C(o,{name:"Auto - Drop Traces Cluster-Wide",disabled:!1,sourceScopes:null,operation:null,percentageAtMost:t}),se(!1)},[p,Se,C,S]),Ue=r(e=>{const t=K[E];let o=null;switch(t){case"noisy":{const n=j(e);o=Y(p,t,{sourceScopes:n.sourceScopes,operation:n.operation});break}case"highlyRelevant":{const n=H(e);o=Y(p,t,{sourceScopes:n.sourceScopes,operation:n.operation,error:n.error??!1,durationAtLeastMs:n.durationAtLeastMs});break}case"costReduction":{const n=V(e);o=Y(p,t,{sourceScopes:n.sourceScopes,operation:n.operation});break}}return o?{message:ga,ruleId:o}:null},[p,E]),Ve=r(e=>{const t=N?.category,o=N?.rule.ruleId;if(!t)return null;let n=null;switch(t){case"noisy":{const i=j(e);n=Y(p,t,{sourceScopes:i.sourceScopes,operation:i.operation},o);break}case"highlyRelevant":{const i=H(e);n=Y(p,t,{sourceScopes:i.sourceScopes,operation:i.operation,error:i.error??!1,durationAtLeastMs:i.durationAtLeastMs},o);break}case"costReduction":{const i=V(e);n=Y(p,t,{sourceScopes:i.sourceScopes,operation:i.operation},o);break}}return n?{message:ga,ruleId:n}:null},[p,N]),He=r(e=>{Q(!1);for(const t of p){const o=[...t.noisyOperations.map(e=>({category:"noisy",rule:e})),...t.highlyRelevantOperations.map(e=>({category:"highlyRelevant",rule:e})),...t.costReductionRules.map(e=>({category:"costReduction",rule:e}))].find(t=>t.rule.ruleId===e);if(o)return D(!0),void $({category:o.category,rule:o.rule,samplingId:t.id,summary:W(o.category,o.rule)})}},[p]),je=a(()=>{const e=[];return o&&e.push({id:sn(),type:co.Button,buttonProps:{"data-id":"sampling-btn-docs",label:fa,leftIcon:Aa,size:fe.S,variant:be.Text,onClick:()=>window.open(o,"_blank")}}),e.push({id:sn(),type:co.Button,buttonProps:{"data-id":"sampling-btn-refresh",label:ba,leftIcon:Za,size:fe.S,variant:be.Text,onClick:g,loading:h}}),e.push({id:sn(),type:co.Button,buttonProps:{"data-id":"sampling-btn-create-rule",label:va,rightIcon:Ia,size:fe.S,variant:be.Primary,onClick:Ee}}),e},[o,g,h,Ee]);return e(_i,{children:[e(me,{$gap:12,$justifyContent:"space-between",children:[t(oa,{icon:vl,title:Ca,subTitle:ya}),t(na,{actions:je})]}),e(ee,{$gap:12,$fullHeight:!0,children:[t(ve,{variant:$o.Underline,size:_e.L,options:q,selected:E,setSelected:I}),e(me,{$justifyContent:"space-between",children:[t(Le,{status:Fe.Default,message:J[E]}),o&&t(ge,{"data-id":"sampling-btn-docs-banner",label:"Docs",leftIcon:Aa,size:fe.S,variant:be.Text,onClick:()=>window.open(o,"_blank")})]}),E===P.Noisy?t(rr,{title:rt,summary:he,onEdit:()=>ie(!0)}):E===P.HighlyRelevant?t(rr,{title:ot,summary:Ce,onEdit:()=>le(!0)}):E===P.CostReduction?t(rr,{title:at,summary:xe,onEdit:()=>se(!0)}):null,t(Jf,{title:Z[E],items:ke,isLoading:h,showTypeFilter:E===P.HighlyRelevant,onRuleClick:$e,onCreateRule:Ee,onEditRule:Ae,onDeleteRule:De})]}),t(Jh,{formType:Xl.View,data:N,defaultEditMode:O,onClose:Oe,onDelete:De,onSaveEdit:Re,sourceOptions:T,namespaceOptions:k,validateForm:Ve,onNavigateToDuplicate:He}),t(Jh,{formType:Xl.Create,isOpen:_,category:K[E],onClose:Ie,onSubmit:Ne,sourceOptions:T,namespaceOptions:k,validateForm:Ue,onNavigateToDuplicate:He}),t(Jh,{formType:Xl.EditAutoNoisy,isOpen:ne,enabled:m?.enabled??!1,keepPercentage:m?.keepPercentage??0,onClose:()=>ie(!1),onSave:ze}),t(Jh,{formType:Xl.EditAutoHighlyRelevant,isOpen:ae,enabled:!!ye&&!ye.rule.disabled,onClose:()=>le(!1),onSave:Be}),t(Jh,{formType:Xl.EditAutoCostReduction,isOpen:re,enabled:!!Se&&!Se.rule.disabled,dropPercentage:Se?.rule.percentageAtMost??25,onClose:()=>se(!1),onSave:Xe}),t(Qe,{title:Ta,description:wa,isOpen:!!te,onClose:Me,denyButton:{label:xa,variant:be.Secondary,onClick:Me},approveButton:{label:Sa,variant:be.Primary,onClick:()=>{Pe(),Me()}}}),!1]})},Qf=b.div`
1389
+ `,ob=[{key:"content",label:"Content",noSort:!0,noFilter:!0,flex:1},{key:"badges",label:"Type",noSort:!0,noFilter:!0,flex:"0 0 128px"}],nb=[{value:"all",label:pa},{value:"Relevance",label:"Relevance"},{value:"Duration",label:"Duration"},{value:"Error",label:"Error"}],ib=({title:o,items:n,isLoading:i,showTypeFilter:l,onRuleClick:c,onCreateRule:d,onEditRule:p,onDeleteRule:u})=>{const h=v(),[m,g]=s(""),[f,b]=s("all"),y=a(()=>{let e=((e,t,o)=>o&&"all"!==t?e.filter(e=>e.typeBadge===t):e)(n,f,l);return e=((e,t)=>{if(!t.trim())return e;const o=t.toLowerCase();return e.filter(e=>{const t=e.name?.toLowerCase().includes(o),n=e.summary.map(e=>e.text).join("").toLowerCase();return t||n.includes(o)})})(e,m),e},[n,f,l,m]),C=a(()=>y.map(o=>{const n=o.typeBadge?((e,t)=>{const o=e.v2.colors;switch(t){case"Relevance":return{bg:o.blue[700],text:o.white[500]};case"Duration":return{bg:o.purple[700],text:o.white[500]};case"Error":return{bg:o.red[500],text:o.black[500]}}})(h,o.typeBadge):void 0;return{cells:[{key:"content",rawValue:o.summary.map(e=>e.text).join(""),component:()=>e(eb,{$disabled:o.disabled,children:[t(Qf,{children:t(w,{parts:o.summary})}),o.name&&t(pe,{size:he.XXS,color:ue.Secondary,nowrap:!0,children:o.name})]})},{key:"badges",rawValue:o.typeBadge||"",component:()=>e(tb,{children:[o.disabled&&t(qe,{label:_o,textSize:he.XXXS,backgroundColor:h.v2.colors.grey[700],textColor:h.v2.colors.grey[300]}),o.typeBadge&&n&&t(qe,{label:o.typeBadge,textSize:he.XXXS,backgroundColor:n.bg,textColor:n.text})]})}],onClick:()=>c(o)}}),[y,h,c]),S=a(()=>{const e=e=>t(Da,{...e,fill:h.v2.colors.red[500]});return e.displayName="RedDeleteIcon",e},[h]),x=r(e=>{const t=C.indexOf(e);if(t<0)return[];const o=y[t];return o?[{id:"edit","data-id":"sampling-rule-action-edit",label:zo,leftIcon:_a,onClick:()=>p(o.ruleId,o.samplingId)},{id:"delete","data-id":"sampling-rule-action-delete",label:"",leftIcon:S,onClick:()=>u(o.ruleId,o.samplingId)}]:[]},[C,y,p,u,S]);return t(dt,{fullHeight:!0,richTitle:{icon:yl,title:o,badge:{label:n.length,backgroundColor:h.v2.colors.silver[600],textColor:h.v2.colors.white[500]}},search:{"data-id":"sampling-search-rules",value:m,onChange:g,placeholder:"Search..",width:"500px",...l?{segment:{"data-id":"sampling-segment-type-filter",options:nb,selected:f,setSelected:b}}:{}},children:t(Ao,{variant:Ro.Pretty,hideHeader:!0,isLoading:i,noDataProps:m.trim()?{hideIcon:!0,title:ua,subTitle:ga(m)}:{hideIcon:!0,title:ma,button:{label:ha,onClick:d}},columns:ob,rows:C,getRowActions:x})})},ab=({docsUrl:o})=>{const{samplingApi:n,sourcesApi:c}=Ll(),{items:d}=c.useSources(),p=a(()=>d.map(e=>({id:e.id})),[d]),{items:u,loading:h,k8sHealthProbesConfig:m,refetch:g}=n.useSamplingRules(),f=r((e,t)=>n.createNoisy?.({samplingId:e,rule:t}),[n]),b=r((e,t,o)=>n.updateNoisy?.(t,{samplingId:e,rule:o}),[n]),v=r((e,t)=>n.createHighlyRelevant?.({samplingId:e,rule:t}),[n]),y=r((e,t,o)=>n.updateHighlyRelevant?.(t,{samplingId:e,rule:o}),[n]),C=r((e,t)=>n.createCostReduction?.({samplingId:e,rule:t}),[n]),S=r((e,t,o)=>n.updateCostReduction?.(t,{samplingId:e,rule:o}),[n]),x=r((e,t,o)=>"noisy"===o?n.deleteNoisy?.(t,e):"highlyRelevant"===o?n.deleteHighlyRelevant?.(t,e):"costReduction"===o?n.deleteCostReduction?.(t,e):void 0,[n]),w=r((e,t)=>n.updateK8sHealthProbesConfig?.({enabled:e,keepPercentage:t}),[n]),T=a(()=>p.map(({id:e})=>({id:`${e.namespace}/${e.kind}/${e.name}`,label:e.name,badge:e.kind,secondaryLabel:e.namespace})),[p]),k=a(()=>Array.from(new Set(p.map(({id:e})=>e.namespace))).sort().map(e=>({id:e,label:e})),[p]),[E,I]=s(P.Noisy),[N,$]=s(null),[O,D]=s(!1),[_,Q]=s(!1),[te,oe]=s(null),[ne,ie]=s(!1),[ae,le]=s(!1),[re,se]=s(!1),[ce,de]=s(!1);l(!1),i(()=>{},[h,u]);const{pendingViewSamplingRule:pe,setPendingViewSamplingRule:ue}=ho();i(()=>{if(!pe)return;if(h||0===u.length)return;ue(null);const e=L(u,pe.ruleId,pe.category);e&&(I(F[pe.category]),D(!1),$(e))},[h,u,pe,ue]);const he=a(()=>A(m),[m]),ye=a(()=>M(u),[u]),Ce=a(()=>R(ye?.rule??null),[ye]),Se=a(()=>z(u),[u]),xe=a(()=>B(Se?.rule??null),[Se]),we=l(N);we.current=N,i(()=>{const e=we.current;if(!e)return;const t=X(u,e);t?$(t):($(null),D(!1))},[u]);const Te=a(()=>{const e=new Set;return ye&&e.add(ye.rule.ruleId),Se&&e.add(Se.rule.ruleId),e},[ye,Se]),ke=a(()=>U(u,E,Te),[u,E,Te]),Ee=r(()=>Q(!0),[]),Ie=r(()=>Q(!1),[]);r(()=>de(!1),[]);const Ne=r(async e=>{const t=u[0]?.id??"default";switch(K[E]){case"noisy":await f(t,j(e));break;case"highlyRelevant":await v(t,H(e));break;case"costReduction":await C(t,V(e))}Q(!1)},[u,E,f,v,C]),$e=r(e=>{const t=G(u,e);t&&(D(!1),$(t))},[u]),Oe=r(()=>{$(null),D(!1)},[]),Ae=r((e,t)=>{const o=N;if(o&&o.rule.ruleId===e&&o.samplingId===t)D(!0),$({...o});else for(const o of u){if(o.id!==t)continue;const n=[...o.noisyOperations.map(e=>({category:"noisy",rule:e})),...o.highlyRelevantOperations.map(e=>({category:"highlyRelevant",rule:e})),...o.costReductionRules.map(e=>({category:"costReduction",rule:e}))].find(t=>t.rule.ruleId===e);if(n)return D(!0),void $({category:n.category,rule:n.rule,samplingId:t,summary:W(n.category,n.rule)})}},[N,u]),Re=r(async(e,t,o)=>{const n=N?.category;if(n){switch(n){case"noisy":await b(o,t,j(e));break;case"highlyRelevant":await y(o,t,H(e));break;case"costReduction":await S(o,t,V(e))}D(!1)}},[N,b,y,S]),De=r((e,t)=>{oe({ruleId:e,samplingId:t})},[]),Pe=r(async()=>{if(!te)return;const{ruleId:e,samplingId:t}=te,o=N?.category||K[E];await x(t,e,o),$(null),D(!1),oe(null)},[te,N,E,x]),Me=r(()=>oe(null),[]),ze=r(async(e,t)=>{await w(e,t),ie(!1)},[w]),Be=r(async e=>{const t=u[0]?.id??"default",o=ye;o?await y(o.samplingId,o.rule.ruleId,{name:o.rule.name,disabled:!e,error:!0,sourceScopes:null,operation:null,percentageAtLeast:null,notes:o.rule.notes}):e&&await v(t,{name:"Auto - Keep All Error Traces",disabled:!1,error:!0,sourceScopes:null,operation:null,percentageAtLeast:null}),le(!1)},[u,ye,v,y]),Xe=r(async(e,t)=>{const o=u[0]?.id??"default",n=Se;n?await S(n.samplingId,n.rule.ruleId,{name:n.rule.name,disabled:!e,sourceScopes:null,operation:null,percentageAtMost:t,notes:n.rule.notes}):e&&await C(o,{name:"Auto - Drop Traces Cluster-Wide",disabled:!1,sourceScopes:null,operation:null,percentageAtMost:t}),se(!1)},[u,Se,C,S]),Ue=r(e=>{const t=K[E];let o=null;switch(t){case"noisy":{const n=j(e);o=Y(u,t,{sourceScopes:n.sourceScopes,operation:n.operation});break}case"highlyRelevant":{const n=H(e);o=Y(u,t,{sourceScopes:n.sourceScopes,operation:n.operation,error:n.error??!1,durationAtLeastMs:n.durationAtLeastMs});break}case"costReduction":{const n=V(e);o=Y(u,t,{sourceScopes:n.sourceScopes,operation:n.operation});break}}return o?{message:fa,ruleId:o}:null},[u,E]),Ve=r(e=>{const t=N?.category,o=N?.rule.ruleId;if(!t)return null;let n=null;switch(t){case"noisy":{const i=j(e);n=Y(u,t,{sourceScopes:i.sourceScopes,operation:i.operation},o);break}case"highlyRelevant":{const i=H(e);n=Y(u,t,{sourceScopes:i.sourceScopes,operation:i.operation,error:i.error??!1,durationAtLeastMs:i.durationAtLeastMs},o);break}case"costReduction":{const i=V(e);n=Y(u,t,{sourceScopes:i.sourceScopes,operation:i.operation},o);break}}return n?{message:fa,ruleId:n}:null},[u,N]),He=r(e=>{Q(!1);for(const t of u){const o=[...t.noisyOperations.map(e=>({category:"noisy",rule:e})),...t.highlyRelevantOperations.map(e=>({category:"highlyRelevant",rule:e})),...t.costReductionRules.map(e=>({category:"costReduction",rule:e}))].find(t=>t.rule.ruleId===e);if(o)return D(!0),void $({category:o.category,rule:o.rule,samplingId:t.id,summary:W(o.category,o.rule)})}},[u]),je=a(()=>{const e=[];return o&&e.push({id:cn(),type:co.Button,buttonProps:{"data-id":"sampling-btn-docs",label:ba,leftIcon:Ra,size:fe.S,variant:be.Text,onClick:()=>window.open(o,"_blank")}}),e.push({id:cn(),type:co.Button,buttonProps:{"data-id":"sampling-btn-refresh",label:va,leftIcon:Qa,size:fe.S,variant:be.Text,onClick:g,loading:h}}),e.push({id:cn(),type:co.Button,buttonProps:{"data-id":"sampling-btn-create-rule",label:ya,rightIcon:Na,size:fe.S,variant:be.Primary,onClick:Ee}}),e},[o,g,h,Ee]);return e(Pi,{children:[e(me,{$gap:12,$justifyContent:"space-between",children:[t(na,{icon:yl,title:Sa,subTitle:Ca}),t(ia,{actions:je})]}),e(ee,{$gap:12,$fullHeight:!0,children:[t(ve,{variant:Oo.Underline,size:_e.L,options:q,selected:E,setSelected:I}),e(me,{$justifyContent:"space-between",children:[t(Le,{status:Fe.Default,message:J[E]}),o&&t(ge,{"data-id":"sampling-btn-docs-banner",label:"Docs",leftIcon:Ra,size:fe.S,variant:be.Text,onClick:()=>window.open(o,"_blank")})]}),E===P.Noisy?t(sr,{title:rt,summary:he,onEdit:()=>ie(!0)}):E===P.HighlyRelevant?t(sr,{title:ot,summary:Ce,onEdit:()=>le(!0)}):E===P.CostReduction?t(sr,{title:at,summary:xe,onEdit:()=>se(!0)}):null,t(ib,{title:Z[E],items:ke,isLoading:h,showTypeFilter:E===P.HighlyRelevant,onRuleClick:$e,onCreateRule:Ee,onEditRule:Ae,onDeleteRule:De})]}),t(im,{formType:Ul.View,data:N,defaultEditMode:O,onClose:Oe,onDelete:De,onSaveEdit:Re,sourceOptions:T,namespaceOptions:k,validateForm:Ve,onNavigateToDuplicate:He}),t(im,{formType:Ul.Create,isOpen:_,category:K[E],onClose:Ie,onSubmit:Ne,sourceOptions:T,namespaceOptions:k,validateForm:Ue,onNavigateToDuplicate:He}),t(im,{formType:Ul.EditAutoNoisy,isOpen:ne,enabled:m?.enabled??!1,keepPercentage:m?.keepPercentage??0,onClose:()=>ie(!1),onSave:ze}),t(im,{formType:Ul.EditAutoHighlyRelevant,isOpen:ae,enabled:!!ye&&!ye.rule.disabled,onClose:()=>le(!1),onSave:Be}),t(im,{formType:Ul.EditAutoCostReduction,isOpen:re,enabled:!!Se&&!Se.rule.disabled,dropPercentage:Se?.rule.percentageAtMost??25,onClose:()=>se(!1),onSave:Xe}),t(Qe,{title:ka,description:Ta,isOpen:!!te,onClose:Me,denyButton:{label:wa,variant:be.Secondary,onClick:Me},approveButton:{label:xa,variant:be.Primary,onClick:()=>{Pe(),Me()}}}),!1]})},lb=b.div`
1379
1390
  padding: 12px;
1380
1391
  border-radius: 12px;
1381
1392
  background-color: ${({theme:e})=>e.v2.colors.silver[750]};
1382
- `,eb=f(({id:e,data:o})=>t(Qf,{"data-id":e,children:t(Re,{...o})}));var tb,ob;eb.displayName=eb.name,(e=>{e.MapItem="map-item",e.NoData="no-data"})(tb||(tb={})),(e=>{e.AnimatedTraffic="animated-traffic"})(ob||(ob={}));const nb=(e,t,o)=>{if(o)return{icons:[rl],aggService:e,selected:!0};const n=e.isVirtual,i=n?[go(e)]:t?fo(t):[Rl],{priorotizedStatus:a}=n?{priorotizedStatus:void 0}:Gi(t?.conditions||[]);return{icons:i,status:a,isVirtual:n,aggService:e,selected:!0}},ib=e=>!(!e||e.serviceName!==Gu||e.id.namespace||e.id.name||e.id.kind),ab=new zr,lb={"elk.algorithm":"layered","elk.direction":"RIGHT","elk.layered.spacing.nodeNodeBetweenLayers":"150","elk.spacing.nodeNode":"120","elk.layered.nodePlacement.strategy":"NETWORK_SIMPLEX","elk.layered.spacing.edgeEdgeBetweenLayers":"30","elk.layered.spacing.edgeNodeBetweenLayers":"40"},rb=e=>{const t=e.lastIndexOf("|");return-1===t?{graphKey:e,detail:""}:{graphKey:e.substring(0,t),detail:e.substring(t+1)}},sb={id:{namespace:"",name:"",kind:""},serviceName:Gu,markedForInstrumentation:{markedForInstrumentation:!0}},cb=h(null),db=()=>{const e=m(cb);if(!e)throw new Error("useServiceMapContext must be used within a ServiceMapProvider");return e},ub=({serviceMap:e,children:o})=>{const n=v(),{sourcesApi:l}=Pl(),{items:c}=l.useSources(),[d,u,p]=Er([]),[h,m,g]=Ir([]),[f,b]=s(0),y=r(()=>b(e=>e+1),[]),[C,S]=s(""),[x,w]=s(null),[T,k]=s(null),E=r(e=>k(t=>t===e?null:e),[]),I=r(()=>k(null),[]),N=r((e,t)=>{const o=new Set(e);u(e=>e.map(e=>e.type===tb.MapItem&&o.has(e.id)?{...e,data:{...e.data,selected:t}}:e))},[u]);i(()=>{let t=!1;const o=(e=>{const t=new Map,o=new Set,n=(e,o,n=!1)=>{let i=t.get(e);return i||(i={serviceName:o,isVirtual:n,attributes:{},connectionMap:new Map},t.set(e,i)),i},i=(e,t)=>{if(t)for(const{key:o,value:n}of t)o in e||(e[o]=n)};for(const t of e){const{graphKey:e}=rb(t.nodeId),a=n(e,t.serviceName);a.isVirtual=!1;for(const e of t.services){const{graphKey:t,detail:l}=rb(e?.nodeId??"");e.isVirtual&&(o.add(t),i(n(t,e.serviceName,!0).attributes,e.nodeAttributes));let r=a.connectionMap.get(t);if(r||(r={targetGraphKey:t,targetServiceName:e.serviceName,totalRequests:0,lastDateTime:e.dateTime,details:[]},a.connectionMap.set(t,r)),r.totalRequests+=e.requests,e.dateTime>r.lastDateTime&&(r.lastDateTime=e.dateTime),l){const t=r.details.find(e=>e.value===l);t?(t.requests+=e.requests,e.dateTime>t.dateTime&&(t.dateTime=e.dateTime)):r.details.push({value:l,requests:e.requests,dateTime:e.dateTime})}}}const a=[...t.entries()];for(const[,{connectionMap:e}]of a)for(const[i,a]of e)t.has(i)||n(i,a.targetServiceName,o.has(i));const l=[];for(const[e,{serviceName:o,isVirtual:n,attributes:i,connectionMap:a}]of t){const t=[...a.values()];t.sort((e,t)=>e.targetGraphKey.localeCompare(t.targetGraphKey)),l.push({graphKey:e,serviceName:o,isVirtual:n,connections:t,attributes:i})}return l.sort((e,t)=>e.graphKey.localeCompare(t.graphKey)),l})(e),i=(({sources:e,aggregatedServiceMap:t})=>{const o=[],n={x:0,y:0};if(t.length&&e.length)for(const i of t){const t=e.find(e=>i.serviceName===e.serviceName||i.serviceName===e.id.name),a=ib(t);o.push({id:i.graphKey,type:tb.MapItem,position:n,data:nb(i,t,a),measured:{width:80,height:80}})}else o.push({id:tb.NoData,type:tb.NoData,position:n,data:{subTitle:et.ARE_SERVICES_INSTRUMENTED_AND_PRODUCING_TRAFFIC}});return o})({aggregatedServiceMap:o,sources:[sb].concat(c)});if(1===i.length&&i[0].id===tb.NoData)return u(i),m([]),S(""),void y();const a=(({theme:e,nodes:t,aggregatedServiceMap:o})=>{const n=[],i=new Map(t.map(e=>[e.id,e]));for(const t of o){const o=t.graphKey,a=i.get(o);if(!a)continue;const l=a.data?.status===Fe.Error;for(const a of t.connections){const r=a.targetGraphKey;i.has(r)&&n.push({id:`${o}-to-${r}`,type:"smoothstep",source:o,target:r,data:{sourceGraphKey:t.graphKey,targetGraphKey:a.targetGraphKey},markerEnd:{type:kr.ArrowClosed},style:{stroke:l?e?.colors.dark_red:e?.colors.border}})}}return n})({theme:n,nodes:i,aggregatedServiceMap:o});m(a);const l=i.map(e=>e.id).sort().join("|");if(l!==C)return(async(e,t,o={})=>{const n={id:"root",layoutOptions:{...lb,...o},children:e.map(e=>({id:e.id,width:80,height:80,...e.id===Gu?{layoutOptions:{"elk.layered.layering.layerConstraint":"FIRST","elk.alignment":"CENTER"}}:{}})),edges:t.map(e=>({id:e.id,sources:[e.source],targets:[e.target]}))},i=await ab.layout(n),a=new Map;return i.children?.forEach(e=>{a.set(e.id,{x:e.x??0,y:e.y??0})}),{nodes:e.map(e=>({...e,position:a.get(e.id)??e.position})),edges:t}})(i,a).then(({nodes:e})=>{t||(u(e),S(l),y())}),()=>{t=!0};u(e=>{const t=new Map(e.map(e=>[e.id,e]));return i.map(e=>{const o=t.get(e.id);return o?e.type===tb.MapItem&&o.type===tb.MapItem?{...e,position:o.position,data:{...e.data,selected:o.data.selected}}:{...e,position:o.position}:e})})},[n,e,c,C]);const $=a(()=>x||T?h.map(e=>{if(e.source===x||e.target===x||e.source===T||e.target===T)return{...e,type:ob.AnimatedTraffic};const t={opacity:.3};return{...e,style:{...e.style,...t},labelStyle:{...e.labelStyle,...t},labelBgStyle:{...e.labelBgStyle,...t}}}):h,[h,x,T]),O=a(()=>({nodes:d,edges:$,onNodesChange:p,onEdgesChange:g,setNodesSelected:N,fitViewTrigger:f,hoveredNodeId:x,setHoveredNodeId:w,activeNodeId:T,toggleActiveNode:E,resetActiveNode:I}),[d,$,p,g,N,f,x,T,E,I]);return t(cb.Provider,{value:O,children:o})},pb=b.div`
1393
+ `,rb=f(({id:e,data:o})=>t(lb,{"data-id":e,children:t(Re,{...o})}));var sb,cb;rb.displayName=rb.name,(e=>{e.MapItem="map-item",e.NoData="no-data"})(sb||(sb={})),(e=>{e.AnimatedTraffic="animated-traffic"})(cb||(cb={}));const db=(e,t,o)=>{if(o)return{icons:[sl],aggService:e,selected:!0};const n=e.isVirtual,i=n?[go(e)]:t?fo(t):[Dl],{priorotizedStatus:a}=n?{priorotizedStatus:void 0}:Wi(t?.conditions||[]);return{icons:i,status:a,isVirtual:n,aggService:e,selected:!0}},pb=e=>!(!e||e.serviceName!==Wp||e.id.namespace||e.id.name||e.id.kind),ub=new Br,hb={"elk.algorithm":"layered","elk.direction":"RIGHT","elk.layered.spacing.nodeNodeBetweenLayers":"150","elk.spacing.nodeNode":"120","elk.layered.nodePlacement.strategy":"NETWORK_SIMPLEX","elk.layered.spacing.edgeEdgeBetweenLayers":"30","elk.layered.spacing.edgeNodeBetweenLayers":"40"},mb=e=>{const t=e.lastIndexOf("|");return-1===t?{graphKey:e,detail:""}:{graphKey:e.substring(0,t),detail:e.substring(t+1)}},gb={id:{namespace:"",name:"",kind:""},serviceName:Wp,markedForInstrumentation:{markedForInstrumentation:!0}},fb=h(null),bb=()=>{const e=m(fb);if(!e)throw new Error("useServiceMapContext must be used within a ServiceMapProvider");return e},vb=({serviceMap:e,children:o})=>{const n=v(),{sourcesApi:l}=Ll(),{items:c}=l.useSources(),[d,p,u]=Ir([]),[h,m,g]=Nr([]),[f,b]=s(0),y=r(()=>b(e=>e+1),[]),[C,S]=s(""),[x,w]=s(null),[T,k]=s(null),E=r(e=>k(t=>t===e?null:e),[]),I=r(()=>k(null),[]),N=r((e,t)=>{const o=new Set(e);p(e=>e.map(e=>e.type===sb.MapItem&&o.has(e.id)?{...e,data:{...e.data,selected:t}}:e))},[p]);i(()=>{let t=!1;const o=(e=>{const t=new Map,o=new Set,n=(e,o,n=!1)=>{let i=t.get(e);return i||(i={serviceName:o,isVirtual:n,attributes:{},connectionMap:new Map},t.set(e,i)),i},i=(e,t)=>{if(t)for(const{key:o,value:n}of t)o in e||(e[o]=n)};for(const t of e){const{graphKey:e}=mb(t.nodeId),a=n(e,t.serviceName);a.isVirtual=!1;for(const e of t.services){const{graphKey:t,detail:l}=mb(e?.nodeId??"");e.isVirtual&&(o.add(t),i(n(t,e.serviceName,!0).attributes,e.nodeAttributes));let r=a.connectionMap.get(t);if(r||(r={targetGraphKey:t,targetServiceName:e.serviceName,totalRequests:0,lastDateTime:e.dateTime,details:[]},a.connectionMap.set(t,r)),r.totalRequests+=e.requests,e.dateTime>r.lastDateTime&&(r.lastDateTime=e.dateTime),l){const t=r.details.find(e=>e.value===l);t?(t.requests+=e.requests,e.dateTime>t.dateTime&&(t.dateTime=e.dateTime)):r.details.push({value:l,requests:e.requests,dateTime:e.dateTime})}}}const a=[...t.entries()];for(const[,{connectionMap:e}]of a)for(const[i,a]of e)t.has(i)||n(i,a.targetServiceName,o.has(i));const l=[];for(const[e,{serviceName:o,isVirtual:n,attributes:i,connectionMap:a}]of t){const t=[...a.values()];t.sort((e,t)=>e.targetGraphKey.localeCompare(t.targetGraphKey)),l.push({graphKey:e,serviceName:o,isVirtual:n,connections:t,attributes:i})}return l.sort((e,t)=>e.graphKey.localeCompare(t.graphKey)),l})(e),i=(({sources:e,aggregatedServiceMap:t})=>{const o=[],n={x:0,y:0};if(t.length&&e.length)for(const i of t){const t=e.find(e=>i.serviceName===e.serviceName||i.serviceName===e.id.name),a=pb(t);o.push({id:i.graphKey,type:sb.MapItem,position:n,data:db(i,t,a),measured:{width:80,height:80}})}else o.push({id:sb.NoData,type:sb.NoData,position:n,data:{subTitle:et.ARE_SERVICES_INSTRUMENTED_AND_PRODUCING_TRAFFIC}});return o})({aggregatedServiceMap:o,sources:[gb].concat(c)});if(1===i.length&&i[0].id===sb.NoData)return p(i),m([]),S(""),void y();const a=(({theme:e,nodes:t,aggregatedServiceMap:o})=>{const n=[],i=new Map(t.map(e=>[e.id,e]));for(const t of o){const o=t.graphKey,a=i.get(o);if(!a)continue;const l=a.data?.status===Fe.Error;for(const a of t.connections){const r=a.targetGraphKey;i.has(r)&&n.push({id:`${o}-to-${r}`,type:"smoothstep",source:o,target:r,data:{sourceGraphKey:t.graphKey,targetGraphKey:a.targetGraphKey},markerEnd:{type:Er.ArrowClosed},style:{stroke:l?e?.colors.dark_red:e?.colors.border}})}}return n})({theme:n,nodes:i,aggregatedServiceMap:o});m(a);const l=i.map(e=>e.id).sort().join("|");if(l!==C)return(async(e,t,o={})=>{const n={id:"root",layoutOptions:{...hb,...o},children:e.map(e=>({id:e.id,width:80,height:80,...e.id===Wp?{layoutOptions:{"elk.layered.layering.layerConstraint":"FIRST","elk.alignment":"CENTER"}}:{}})),edges:t.map(e=>({id:e.id,sources:[e.source],targets:[e.target]}))},i=await ub.layout(n),a=new Map;return i.children?.forEach(e=>{a.set(e.id,{x:e.x??0,y:e.y??0})}),{nodes:e.map(e=>({...e,position:a.get(e.id)??e.position})),edges:t}})(i,a).then(({nodes:e})=>{t||(p(e),S(l),y())}),()=>{t=!0};p(e=>{const t=new Map(e.map(e=>[e.id,e]));return i.map(e=>{const o=t.get(e.id);return o?e.type===sb.MapItem&&o.type===sb.MapItem?{...e,position:o.position,data:{...e.data,selected:o.data.selected}}:{...e,position:o.position}:e})})},[n,e,c,C]);const $=a(()=>x||T?h.map(e=>{if(e.source===x||e.target===x||e.source===T||e.target===T)return{...e,type:cb.AnimatedTraffic};const t={opacity:.3};return{...e,style:{...e.style,...t},labelStyle:{...e.labelStyle,...t},labelBgStyle:{...e.labelBgStyle,...t}}}):h,[h,x,T]),O=a(()=>({nodes:d,edges:$,onNodesChange:u,onEdgesChange:g,setNodesSelected:N,fitViewTrigger:f,hoveredNodeId:x,setHoveredNodeId:w,activeNodeId:T,toggleActiveNode:E,resetActiveNode:I}),[d,$,u,g,N,f,x,T,E,I]);return t(fb.Provider,{value:O,children:o})},yb=b.div`
1383
1394
  border: 1px ${({theme:e,$isSelected:t,$isVirtual:o})=>t?`solid ${e.v2.colors.blue[300]}`:o?`dashed ${e.v2.colors.silver[300]}`:"solid transparent"};
1384
1395
  border-radius: 8px;
1385
1396
  cursor: pointer;
1386
1397
  opacity: ${({$isVirtual:e})=>e?.8:1};
1387
- `,hb=b.div`
1398
+ `,Cb=b.div`
1388
1399
  position: relative;
1389
- `,mb=b.div`
1400
+ `,Sb=b.div`
1390
1401
  position: absolute;
1391
1402
  top: 100%;
1392
1403
  left: 50%;
@@ -1395,7 +1406,7 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import n,{useEff
1395
1406
  align-items: center;
1396
1407
  gap: 4px;
1397
1408
  margin-top: 4px;
1398
- `,gb=f(({id:n,data:i})=>{const{icons:l,status:r,isVirtual:s}=i,c=v(),{activeNodeId:d,hoveredNodeId:u}=db(),{isUserSource:p,isNodeSelected:h,isHovered:m}=a(()=>({isUserSource:n===Gu,isNodeSelected:d===n,isHovered:u===n}),[n,d,u,n]),{isSelected:g,isHighlighted:f}=a(()=>({isSelected:h||p,isHighlighted:h||m||p}),[h,m,p]),b=r?Hi(r,c):null;return e(o,{children:[t(Nr,{type:"source",position:$r.Right,style:{visibility:"hidden"}}),t(Nr,{type:"target",position:$r.Left,style:{visibility:"hidden"}}),e(hb,{"data-id":n,children:[t(pb,{$isSelected:g,$isVirtual:s,children:t(bo,{padding:12,icons:l,status:f?Fe.Info:r})}),e(mb,{children:[b&&t(b,{}),t(ue,{size:he.XXS,nowrap:!0,children:n})]})]})]})});gb.displayName=gb.name;const fb=b.div`
1409
+ `,xb=f(({id:n,data:i})=>{const{icons:l,status:r,isVirtual:s}=i,c=v(),{activeNodeId:d,hoveredNodeId:p}=bb(),{isUserSource:u,isNodeSelected:h,isHovered:m}=a(()=>({isUserSource:n===Wp,isNodeSelected:d===n,isHovered:p===n}),[n,d,p,n]),{isSelected:g,isHighlighted:f}=a(()=>({isSelected:h||u,isHighlighted:h||m||u}),[h,m,u]),b=r?ji(r,c):null;return e(o,{children:[t($r,{type:"source",position:Or.Right,style:{visibility:"hidden"}}),t($r,{type:"target",position:Or.Left,style:{visibility:"hidden"}}),e(Cb,{"data-id":n,children:[t(yb,{$isSelected:g,$isVirtual:s,children:t(bo,{padding:12,icons:l,status:f?Fe.Info:r})}),e(Sb,{children:[b&&t(b,{}),t(pe,{size:he.XXS,nowrap:!0,children:n})]})]})]})});xb.displayName=xb.name;const wb=b.div`
1399
1410
  display: flex;
1400
1411
  flex-direction: column;
1401
1412
  gap: 12px;
@@ -1408,10 +1419,10 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import n,{useEff
1408
1419
  top: 16px;
1409
1420
  left: 8px;
1410
1421
  z-index: ${({theme:e})=>e.v2.zIndex.drawer};
1411
- `,bb=({children:e})=>t(fb,{children:e});var vb,yb;(e=>{e.All="All",e.Inbound="Inbound",e.Outbound="Outbound"})(vb||(vb={})),(e=>{e.Inbound="Inbound",e.Outbound="Outbound"})(yb||(yb={}));const Cb=b.div`
1422
+ `,Tb=({children:e})=>t(wb,{children:e});var kb,Eb;(e=>{e.All="All",e.Inbound="Inbound",e.Outbound="Outbound"})(kb||(kb={})),(e=>{e.Inbound="Inbound",e.Outbound="Outbound"})(Eb||(Eb={}));const Ib=b.div`
1412
1423
  flex: 1 1 auto;
1413
1424
  min-height: 0;
1414
- `,Sb=()=>{const{nodes:o,activeNodeId:n,resetActiveNode:i}=db(),[l,r]=s(vb.All),c=a(()=>{const e=new Map;for(const t of o)t.type===tb.MapItem&&e.set(t.id,t);return e},[o]),d=a(()=>c.get(n??""),[c,n]),{inbound:u,outbound:p}=a(()=>{const e=[],t=[];if(!d)return{inbound:e,outbound:t};for(const e of d.data.aggService?.connections??[])t.push({peerId:e.targetGraphKey,direction:yb.Outbound,totalRequests:e.totalRequests});for(const t of c.values())if(t.id!==d.id)for(const o of t.data.aggService?.connections??[])o.targetGraphKey===d.id&&e.push({peerId:t.id,direction:yb.Inbound,totalRequests:o.totalRequests});return e.sort((e,t)=>e.peerId.localeCompare(t.peerId)),t.sort((e,t)=>e.peerId.localeCompare(t.peerId)),{inbound:e,outbound:t}},[d,c]);if(!d)return null;const h=[vb.All,vb.Inbound].includes(l)&&u.length>0,m=[vb.All,vb.Outbound].includes(l)&&p.length>0;return e(bb,{children:[e(me,{$width:"100%",$gap:8,children:[t(ge,{variant:be.Text,size:fe.S,leftIcon:qa,onClick:i}),t(bo,{icons:d.data.icons}),t(ue,{size:he.XS,children:d.id})]}),t(ve,{fullWidth:!0,options:[{label:`${vb.All}`,value:vb.All,badge:{label:`${u.length+p.length}`}},{label:`${vb.Inbound}`,value:vb.Inbound,badge:{label:`${u.length}`}},{label:`${vb.Outbound}`,value:vb.Outbound,badge:{label:`${p.length}`}}],selected:l,setSelected:r}),h&&t(wb,{halfHeight:m,title:"Inbound",icon:al,connections:u,mapNodesById:c}),m&&t(wb,{halfHeight:h,title:"Outbound",icon:ll,connections:p,mapNodesById:c})]})},xb=b.div`
1425
+ `,Nb=()=>{const{nodes:o,activeNodeId:n,resetActiveNode:i}=bb(),[l,r]=s(kb.All),c=a(()=>{const e=new Map;for(const t of o)t.type===sb.MapItem&&e.set(t.id,t);return e},[o]),d=a(()=>c.get(n??""),[c,n]),{inbound:p,outbound:u}=a(()=>{const e=[],t=[];if(!d)return{inbound:e,outbound:t};for(const e of d.data.aggService?.connections??[])t.push({peerId:e.targetGraphKey,direction:Eb.Outbound,totalRequests:e.totalRequests});for(const t of c.values())if(t.id!==d.id)for(const o of t.data.aggService?.connections??[])o.targetGraphKey===d.id&&e.push({peerId:t.id,direction:Eb.Inbound,totalRequests:o.totalRequests});return e.sort((e,t)=>e.peerId.localeCompare(t.peerId)),t.sort((e,t)=>e.peerId.localeCompare(t.peerId)),{inbound:e,outbound:t}},[d,c]);if(!d)return null;const h=[kb.All,kb.Inbound].includes(l)&&p.length>0,m=[kb.All,kb.Outbound].includes(l)&&u.length>0;return e(Tb,{children:[e(me,{$width:"100%",$gap:8,children:[t(ge,{variant:be.Text,size:fe.S,leftIcon:Ja,onClick:i}),t(bo,{icons:d.data.icons}),t(pe,{size:he.XS,children:d.id})]}),t(ve,{fullWidth:!0,options:[{label:`${kb.All}`,value:kb.All,badge:{label:`${p.length+u.length}`}},{label:`${kb.Inbound}`,value:kb.Inbound,badge:{label:`${p.length}`}},{label:`${kb.Outbound}`,value:kb.Outbound,badge:{label:`${u.length}`}}],selected:l,setSelected:r}),h&&t(Ob,{halfHeight:m,title:"Inbound",icon:ll,connections:p,mapNodesById:c}),m&&t(Ob,{halfHeight:h,title:"Outbound",icon:rl,connections:u,mapNodesById:c})]})},$b=b.div`
1415
1426
  display: flex;
1416
1427
  flex-direction: column;
1417
1428
  gap: 8px;
@@ -1419,17 +1430,17 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import n,{useEff
1419
1430
  border-radius: 12px;
1420
1431
  background-color: ${({theme:e})=>e.v2.colors.silver[900]};
1421
1432
  height: ${({$halfHeight:e})=>e?"48%":"100%"};
1422
- `,wb=({halfHeight:o,title:n,icon:i,connections:a,mapNodesById:l})=>{const r=v();return e(xb,{$halfHeight:o,children:[e(me,{children:[t(i,{size:16,fill:r.v2.colors.grey[300]}),t(ue,{size:he.XXS,color:pe.Secondary,children:n})]}),t(Cb,{children:t(po,{gap:4,elements:a.map(e=>t(kb,{connection:e,peerNode:l.get(e.peerId)},`${e.direction}-${e.peerId}`))})})]})},Tb=b.div`
1433
+ `,Ob=({halfHeight:o,title:n,icon:i,connections:a,mapNodesById:l})=>{const r=v();return e($b,{$halfHeight:o,children:[e(me,{children:[t(i,{size:16,fill:r.v2.colors.grey[300]}),t(pe,{size:he.XXS,color:ue.Secondary,children:n})]}),t(Ib,{children:t(uo,{gap:4,elements:a.map(e=>t(Rb,{connection:e,peerNode:l.get(e.peerId)},`${e.direction}-${e.peerId}`))})})]})},Ab=b.div`
1423
1434
  display: flex;
1424
1435
  align-items: center;
1425
1436
  gap: 8px;
1426
1437
  padding: 8px;
1427
1438
  border-radius: 8px;
1428
1439
  background-color: ${({theme:e})=>e.v2.colors.silver[900]};
1429
- `,kb=({connection:o,peerNode:n})=>e(Tb,{children:[n&&t(bo,{icons:n.data.icons}),e(me,{$gap:4,$width:"100%",$justifyContent:"space-between",children:[t(ue,{size:he.XXS,children:o.peerId}),t(qe,{label:o.totalRequests,tooltip:"Total requests"})]})]}),Eb="0;0.5;1",Ib=f(({id:n,sourceX:i,sourceY:a,targetX:l,targetY:r,sourcePosition:s,targetPosition:c,markerEnd:d})=>{const u=v(),[p]=Or({sourceX:i,sourceY:a,targetX:l,targetY:r,sourcePosition:s,targetPosition:c}),h=`${n}__animated-traffic-motion`,m=u.v2.colors.blue[700],g=u.v2.colors.blue[900],f=u.v2.colors.blue[500],b="4s";return e(o,{children:[t(Ar,{id:n,path:p,markerEnd:d,style:{stroke:m,strokeWidth:1}}),t(Rr,{children:e("svg",{style:{position:"absolute",top:0,left:0,width:"100%",height:"100%",overflow:"visible",pointerEvents:"none"},children:[t("path",{id:h,d:p,fill:"none",stroke:"none"}),Array.from({length:5}).map((o,n)=>{const i=`-${(.8*n).toFixed(3)}s`;return e("circle",{r:0,fill:g,children:[t("animateMotion",{dur:b,begin:i,repeatCount:"indefinite",children:t("mpath",{href:`#${h}`})}),t("animate",{attributeName:"r",dur:b,begin:i,repeatCount:"indefinite",keyTimes:Eb,values:"0;3.5;3.5"}),t("animate",{attributeName:"fill",dur:b,begin:i,repeatCount:"indefinite",keyTimes:Eb,values:`${g};${f};${f}`})]},n)})]})})]})});Ib.displayName=Ib.name;const Nb=b.div`
1440
+ `,Rb=({connection:o,peerNode:n})=>e(Ab,{children:[n&&t(bo,{icons:n.data.icons}),e(me,{$gap:4,$width:"100%",$justifyContent:"space-between",children:[t(pe,{size:he.XXS,children:o.peerId}),t(qe,{label:o.totalRequests,tooltip:"Total requests"})]})]}),Db="0;0.5;1",_b=f(({id:n,sourceX:i,sourceY:a,targetX:l,targetY:r,sourcePosition:s,targetPosition:c,markerEnd:d})=>{const p=v(),[u]=Ar({sourceX:i,sourceY:a,targetX:l,targetY:r,sourcePosition:s,targetPosition:c}),h=`${n}__animated-traffic-motion`,m=p.v2.colors.blue[700],g=p.v2.colors.blue[900],f=p.v2.colors.blue[500],b="4s";return e(o,{children:[t(Rr,{id:n,path:u,markerEnd:d,style:{stroke:m,strokeWidth:1}}),t(Dr,{children:e("svg",{style:{position:"absolute",top:0,left:0,width:"100%",height:"100%",overflow:"visible",pointerEvents:"none"},children:[t("path",{id:h,d:u,fill:"none",stroke:"none"}),Array.from({length:5}).map((o,n)=>{const i=`-${(.8*n).toFixed(3)}s`;return e("circle",{r:0,fill:g,children:[t("animateMotion",{dur:b,begin:i,repeatCount:"indefinite",children:t("mpath",{href:`#${h}`})}),t("animate",{attributeName:"r",dur:b,begin:i,repeatCount:"indefinite",keyTimes:Db,values:"0;3.5;3.5"}),t("animate",{attributeName:"fill",dur:b,begin:i,repeatCount:"indefinite",keyTimes:Db,values:`${g};${f};${f}`})]},n)})]})})]})});_b.displayName=_b.name;const Pb=b.div`
1430
1441
  flex: 1 1 auto;
1431
1442
  min-height: 0;
1432
- `,$b=({})=>{const{nodes:o,setNodesSelected:n,resetActiveNode:i}=db(),[l,c]=s(""),d=a(()=>o.filter(e=>e.type===tb.MapItem).sort((e,t)=>e.id.localeCompare(t.id)),[o]),u=a(()=>d.filter(e=>e.data.selected),[d]),p=a(()=>d.filter(e=>e.id.toLowerCase().includes(l.toLowerCase())),[d,l]),h=a(()=>p.every(e=>e.data.selected),[p]),m=r(()=>{const e=!h;n(p.map(e=>e.id),e),e||i()},[p,h,n,i]);return d.length?e(bb,{children:[e(me,{$width:"100%",$gap:8,children:[t(ue,{size:he.XS,children:"Services"}),t(qe,{label:d.length})]}),t(uo,{width:"100%",value:l,onChange:c}),e(me,{$width:"100%",$justifyContent:"space-between",children:[t(ue,{size:he.XXXS,children:`Showing ${u.length} out of ${d.length}`}),t(ue,{"data-id":"namespaces-select-all",onClick:m,disabled:!p.length,size:he.XS,children:h?et.UNSELECT_ALL:et.SELECT_ALL})]}),t(Nb,{children:t(po,{gap:4,elements:p.map(e=>t(Ab,{node:e},e.id))})})]}):null},Ob=b.div`
1443
+ `,Lb=({})=>{const{nodes:o,setNodesSelected:n,resetActiveNode:i}=bb(),[l,c]=s(""),d=a(()=>o.filter(e=>e.type===sb.MapItem).sort((e,t)=>e.id.localeCompare(t.id)),[o]),p=a(()=>d.filter(e=>e.data.selected),[d]),u=a(()=>d.filter(e=>e.id.toLowerCase().includes(l.toLowerCase())),[d,l]),h=a(()=>u.every(e=>e.data.selected),[u]),m=r(()=>{const e=!h;n(u.map(e=>e.id),e),e||i()},[u,h,n,i]);return d.length?e(Tb,{children:[e(me,{$width:"100%",$gap:8,children:[t(pe,{size:he.XS,children:"Services"}),t(qe,{label:d.length})]}),t(po,{width:"100%",value:l,onChange:c}),e(me,{$width:"100%",$justifyContent:"space-between",children:[t(pe,{size:he.XXXS,children:`Showing ${p.length} out of ${d.length}`}),t(pe,{"data-id":"namespaces-select-all",onClick:m,disabled:!u.length,size:he.XS,children:h?et.UNSELECT_ALL:et.SELECT_ALL})]}),t(Pb,{children:t(uo,{gap:4,elements:u.map(e=>t(Mb,{node:e},e.id))})})]}):null},Fb=b.div`
1433
1444
  display: flex;
1434
1445
  align-items: center;
1435
1446
  gap: 8px;
@@ -1437,7 +1448,7 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import n,{useEff
1437
1448
  border-radius: 8px;
1438
1449
  background-color: ${({theme:e})=>e.v2.colors.silver[900]};
1439
1450
  cursor: pointer;
1440
- `,Ab=({node:o})=>{const{setNodesSelected:n,activeNodeId:i,resetActiveNode:a}=db(),l=r(()=>{const e=!o.data.selected,t=i===o.id;n([o.id],e),!e&&t&&a()},[o,i,n,a]);return e(Ob,{onClick:l,children:[t(oe,{value:o.data.selected||!1,onChange:l}),t(bo,{icons:o.data.icons}),t(ue,{size:he.XXS,children:o.id})]},o.id)},Rb=b.div`
1451
+ `,Mb=({node:o})=>{const{setNodesSelected:n,activeNodeId:i,resetActiveNode:a}=bb(),l=r(()=>{const e=!o.data.selected,t=i===o.id;n([o.id],e),!e&&t&&a()},[o,i,n,a]);return e(Fb,{onClick:l,children:[t(oe,{value:o.data.selected||!1,onChange:l}),t(bo,{icons:o.data.icons}),t(pe,{size:he.XXS,children:o.id})]},o.id)},zb=b.div`
1441
1452
  position: relative;
1442
1453
  height: 100%;
1443
1454
  .react-flow__attribution {
@@ -1446,7 +1457,7 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import n,{useEff
1446
1457
  * {
1447
1458
  transition: none;
1448
1459
  }
1449
- `,Db=b.div`
1460
+ `,Bb=b.div`
1450
1461
  .react-flow__controls {
1451
1462
  display: flex;
1452
1463
  align-items: center;
@@ -1472,33 +1483,33 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import n,{useEff
1472
1483
  }
1473
1484
  }
1474
1485
  }
1475
- `,_b={[tb.MapItem]:gb,[tb.NoData]:eb},Pb={[ob.AnimatedTraffic]:Ib},Lb={duration:300,padding:.1,includeHiddenNodes:!0,maxZoom:1},Fb=({trigger:e})=>{const{fitView:t}=Mr(),o=l(!0);return i(()=>{o.current?o.current=!1:e>0&&requestAnimationFrame(()=>t(Lb))},[e,t]),null},Mb=({onRefresh:o})=>{const{nodes:n,edges:i,fitViewTrigger:l,onNodesChange:r,onEdgesChange:s,setHoveredNodeId:c,toggleActiveNode:d}=db(),u=a(()=>{const e=new Set(n.filter(e=>e.type===tb.MapItem&&e.data.selected).map(e=>e.id)),t=new Set;for(const o of i)e.has(o.source)&&t.add(o.target),e.has(o.target)&&t.add(o.source);return n.filter(e=>e.type!==tb.MapItem||e.data.selected||t.has(e.id))},[n,i]);return e(_r,{zoomOnScroll:!0,nodes:u,nodeTypes:_b,edges:i,edgeTypes:Pb,onNodeClick:(e,t)=>d(t.id),onNodeMouseEnter:(e,t)=>c(t.id),onNodeMouseLeave:()=>c(null),onNodesChange:r,onEdgesChange:s,children:[t(Pr,{}),t(Fb,{trigger:l}),t(Db,{children:t(Lr,{position:"top-right",orientation:"horizontal",showInteractive:!1,showZoom:!0,showFitView:!0,fitViewOptions:Lb,children:t(Fr,{onClick:o,children:t(Za,{})})})})]})},zb=o=>t(Dr,{children:e(Rb,{children:[t(Mb,{...o}),t($b,{}),t(Sb,{})]})}),Bb=b.div`
1486
+ `,Xb={[sb.MapItem]:xb,[sb.NoData]:rb},Ub={[cb.AnimatedTraffic]:_b},Vb={duration:300,padding:.1,includeHiddenNodes:!0,maxZoom:1},Hb=({trigger:e})=>{const{fitView:t}=zr(),o=l(!0);return i(()=>{o.current?o.current=!1:e>0&&requestAnimationFrame(()=>t(Vb))},[e,t]),null},jb=({onRefresh:o})=>{const{nodes:n,edges:i,fitViewTrigger:l,onNodesChange:r,onEdgesChange:s,setHoveredNodeId:c,toggleActiveNode:d}=bb(),p=a(()=>{const e=new Set(n.filter(e=>e.type===sb.MapItem&&e.data.selected).map(e=>e.id)),t=new Set;for(const o of i)e.has(o.source)&&t.add(o.target),e.has(o.target)&&t.add(o.source);return n.filter(e=>e.type!==sb.MapItem||e.data.selected||t.has(e.id))},[n,i]);return e(Pr,{zoomOnScroll:!0,nodes:p,nodeTypes:Xb,edges:i,edgeTypes:Ub,onNodeClick:(e,t)=>d(t.id),onNodeMouseEnter:(e,t)=>c(t.id),onNodeMouseLeave:()=>c(null),onNodesChange:r,onEdgesChange:s,children:[t(Lr,{}),t(Hb,{trigger:l}),t(Bb,{children:t(Fr,{position:"top-right",orientation:"horizontal",showInteractive:!1,showZoom:!0,showFitView:!0,fitViewOptions:Vb,children:t(Mr,{onClick:o,children:t(Qa,{})})})})]})},Gb=o=>t(_r,{children:e(zb,{children:[t(jb,{...o}),t(Lb,{}),t(Nb,{})]})}),Wb=b.div`
1476
1487
  width: 100%;
1477
1488
  flex: 1;
1478
1489
  align-self: stretch;
1479
1490
  min-height: 0;
1480
1491
  height: 100%;
1481
1492
  position: relative;
1482
- `,Xb=()=>{const{serviceMapApi:e}=Pl(),{data:o,refetch:n}=e.useServiceMap({pollInterval:5e3,fetchPolicy:"cache-and-network"});return t(ub,{serviceMap:o?.serviceMap??[],children:t(Bb,{children:t(zb,{onRefresh:n})})})},Ub=b.div`
1493
+ `,Kb=()=>{const{serviceMapApi:e}=Ll(),{data:o,refetch:n}=e.useServiceMap({pollInterval:5e3,fetchPolicy:"cache-and-network"});return t(vb,{serviceMap:o?.serviceMap??[],children:t(Wb,{children:t(Gb,{onRefresh:n})})})},Yb=b.div`
1483
1494
  display: flex;
1484
1495
  align-items: center;
1485
1496
  justify-content: space-between;
1486
1497
  padding: 0 12px;
1487
- `,Vb=b.div`
1498
+ `,qb=b.div`
1488
1499
  display: flex;
1489
1500
  align-items: center;
1490
1501
  gap: 8px;
1491
- `,Hb=b.div`
1502
+ `,Jb=b.div`
1492
1503
  width: 1px;
1493
1504
  height: 20px;
1494
1505
  background-color: ${({theme:e})=>e.v2.colors.silver[500]};
1495
- `,jb=({disabled:o,loading:n,onClickShowYaml:i,onClickReset:l,onClickRefresh:r})=>{const c=v(),[d,u]=s(!1),p=a(()=>i?[{id:sn(),type:co.Button,buttonProps:{label:"Show Config YAML",leftIcon:Al,size:fe.S,variant:be.Secondary,onClick:i,disabled:o}}]:[],[i,o]),h=a(()=>{const e=[];return r&&e.push({id:sn(),type:co.Button,buttonProps:{leftIcon:Za,tooltip:"Refresh",hideTooltipIcon:!0,size:fe.S,variant:be.Text,onClick:r,disabled:o,loading:n}}),l&&e.push({id:sn(),type:co.Button,buttonProps:{leftIcon:Ea,tooltip:"Reset to defaults",hideTooltipIcon:!0,size:fe.S,variant:be.Text,textColor:c.v2.colors.red[500],onClick:()=>u(!0),disabled:o}}),e},[o,n,l,r,c]),m=p.length>0,g=h.length>0;return e(Ub,{children:[t(oa,{icon:Qa,title:"Odigos Settings"}),e(Vb,{children:[m&&t(na,{actions:p}),m&&g&&t(Hb,{}),g&&t(na,{actions:h})]}),t(Qe,{isOpen:d,onClose:()=>u(!1),title:"Reset Settings",description:"Are you sure you want to reset the settings? This will clear the odigos-local-ui-config and reset the settings to the default values.",denyButton:{label:"Deny",variant:be.Secondary,onClick:()=>u(!1)},approveButton:{label:"Approve",variant:be.Primary,onClick:()=>{l?.(),u(!1)}}})]})},Gb=b(ee)`
1506
+ `,Zb=({disabled:o,loading:n,onClickShowYaml:i,onClickReset:l,onClickRefresh:r})=>{const c=v(),[d,p]=s(!1),u=a(()=>i?[{id:cn(),type:co.Button,buttonProps:{label:"Show Config YAML",leftIcon:Rl,size:fe.S,variant:be.Secondary,onClick:i,disabled:o}}]:[],[i,o]),h=a(()=>{const e=[];return r&&e.push({id:cn(),type:co.Button,buttonProps:{leftIcon:Qa,tooltip:"Refresh",hideTooltipIcon:!0,size:fe.S,variant:be.Text,onClick:r,disabled:o,loading:n}}),l&&e.push({id:cn(),type:co.Button,buttonProps:{leftIcon:Ia,tooltip:"Reset to defaults",hideTooltipIcon:!0,size:fe.S,variant:be.Text,textColor:c.v2.colors.red[500],onClick:()=>p(!0),disabled:o}}),e},[o,n,l,r,c]),m=u.length>0,g=h.length>0;return e(Yb,{children:[t(na,{icon:el,title:"Odigos Settings"}),e(qb,{children:[m&&t(ia,{actions:u}),m&&g&&t(Jb,{}),g&&t(ia,{actions:h})]}),t(Qe,{isOpen:d,onClose:()=>p(!1),title:"Reset Settings",description:"Are you sure you want to reset the settings? This will clear the odigos-local-ui-config and reset the settings to the default values.",denyButton:{label:"Deny",variant:be.Secondary,onClick:()=>p(!1)},approveButton:{label:"Approve",variant:be.Primary,onClick:()=>{l?.(),p(!1)}}})]})},Qb=b(ee)`
1496
1507
  width: 220px;
1497
1508
  flex-shrink: 0;
1498
1509
  height: 100%;
1499
1510
  gap: 4px;
1500
1511
  overflow-y: auto;
1501
- `,Wb=({options:e,selected:o,setSelected:n,disabled:i})=>t(Gb,{children:e.map(e=>t(cc,{dataId:`settings-nav-${e.id}`,title:e.label,isSelected:o===e.id,disabled:i,onClick:()=>n(e.id)},e.id))}),Kb=b(ee)`
1512
+ `,ev=({options:e,selected:o,setSelected:n,disabled:i})=>t(Qb,{children:e.map(e=>t(dc,{dataId:`settings-nav-${e.id}`,title:e.label,isSelected:o===e.id,disabled:i,onClick:()=>n(e.id)},e.id))}),tv=b(ee)`
1502
1513
  width: 100%;
1503
1514
  /* side menu (220) + gap (24) + form (600) = 844, so content fills exactly with no dead space */
1504
1515
  max-width: 844px;
@@ -1508,25 +1519,25 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import n,{useEff
1508
1519
  gap: 24px;
1509
1520
  flex: 1;
1510
1521
  min-height: 0;
1511
- `,Yb=b(me)`
1522
+ `,ov=b(me)`
1512
1523
  flex: 1;
1513
1524
  min-height: 0;
1514
1525
  width: 100%;
1515
1526
  align-self: stretch;
1516
- `,qb=b(ee)`
1527
+ `,nv=b(ee)`
1517
1528
  flex: 1;
1518
1529
  min-height: 0;
1519
1530
  height: 100%;
1520
1531
  max-width: 600px;
1521
1532
  overflow-y: auto;
1522
- `,Jb=b(me)`
1533
+ `,iv=b(me)`
1523
1534
  gap: 8px;
1524
1535
  width: 100%;
1525
1536
  align-items: center;
1526
- `,Zb=b.div`
1537
+ `,av=b.div`
1527
1538
  flex: 1;
1528
1539
  min-width: 0;
1529
- `,Qb=e=>"general"===e.name?0:"advanced"===e.name?2:1,ev=({minSupportedVersion:n})=>{const{isVersionSupported:l,version:r,isEnterprise:c,minSupportedVersion:d}=S(n),{configApi:u}=Pl(),{data:p,loading:h}=u.useConfigYamls(),{data:m,loading:g,refetch:f}=u.useEffectiveConfig(),b=p?.configYamls??[],[v,y]=s(!1),C=a(()=>{if(!m)return{};const{manifestYAML:e,provenance:t,...o}=m;return o},[m]),{formData:x,handleFormChange:w,getNestedValue:T,getFormDiff:k,isFormDirty:E}=Ht(C);i(()=>{"{}"!==JSON.stringify(C)&&"{}"===JSON.stringify(x)&&w(void 0,void 0,C)},[C,x]);const I=a(()=>[...b].sort((e,t)=>Qb(e)-Qb(t)),[b]),N=a(()=>(e=>{if(!e)return{};const t={};for(const o of e)t[o.helmPath]=o.reconciledFrom;return t})(m?.provenance),[m?.provenance]),$=a(()=>{const e=new Set;for(const t of b)for(const o of t.fields)o.componentType===Ee.Dropdown&&e.add(o.helmValuePath);return e},[b]),O=a(()=>b.flatMap(e=>e.fields.map(e=>({name:e.helmValuePath,value:T("formData",e.helmValuePath)}))),[b,x,T]),[A,R]=s(!1),[D,_]=s(!1),P=a(()=>[{id:sn(),type:co.Button,buttonProps:{"data-id":"settings-save",variant:be.Primary,size:fe.S,label:"Save Changes",leftIcon:Xa,loading:v,onClick:()=>R(!0)}},{id:sn(),type:co.Button,buttonProps:{"data-id":"settings-cancel",variant:be.Secondary,size:fe.S,label:"Cancel",leftIcon:Ua,onClick:()=>w(void 0,void 0,C)}}],[v,k,C,x,w]),L=a(()=>I.map(e=>({id:e.name,label:e.displayName})),[I]),F=a(()=>I.map(e=>e.name),[I]),{selectedSection:M,setSelectedSection:z,setSectionRef:B,setScrollContainerRef:X}=ka({sectionNames:F});return t(_i,{$gap:24,children:e(Kb,{children:[t(jb,{disabled:!l,loading:h||g,onClickShowYaml:()=>_(!0),onClickReset:async()=>{await(async()=>{u.resetLocalUiConfigToDefaults&&await u.resetLocalUiConfigToDefaults()})(),await(f?.()),w(void 0,void 0,{})},onClickRefresh:f?()=>f():void 0}),e(ca,{children:[!l&&t(wr,{minSupportedVersion:d,currentVersion:r||""}),t(Ro,{isOpen:E,richTitle:{icon:Qa,title:"Config Settings"},actions:P}),t(Qe,{isOpen:A,title:"Save Changes via UI?",description:"We recommend updating via your Helm values.yaml to ensure changes are version-controlled and go through a proper review process.",onClose:()=>R(!1),denyButton:{label:"Keep editing",variant:be.Secondary,onClick:()=>R(!1)},approveButton:{label:"Save changes",variant:be.Primary,onClick:()=>{(async()=>{const e=((e,t)=>{const o=(e,t,o)=>{for(let o=0;o<t.length-1;o++){const n=t[o];n in e&&"object"==typeof e[n]&&null!==e[n]||(e[n]={}),e=e[n]}e[t[t.length-1]]=o},n=JSON.parse(JSON.stringify(e));for(const e of t){const t=e.split(".");let i=n;for(const e of t){if(null==i||"object"!=typeof i){i=void 0;break}i=i[e]}"string"==typeof i&&o(n,t,i.replaceAll("-","_"))}return n})(k(C,x),$);await(async e=>{u.updateLocalUiConfig&&(y(!0),await u.updateLocalUiConfig(e),y(!1),await f())})(e),w(void 0,void 0,{})})(),R(!1)}}}),e(Yb,{$gap:24,$alignItems:"stretch",children:[!!b.length&&t(Wb,{options:L,selected:M,setSelected:z,disabled:!l}),t(qb,{ref:X,$gap:24,$width:"100%",children:b.length?I.map(n=>t(dt,{id:n.name,bordered:!0,ref:e=>B(n.name,e),customTitle:t(ue,{size:he.M,weight:500,color:pe.Primary,children:n.displayName}),children:t(ee,{$gap:24,children:n.fields.map(n=>{if(n.isEnterpriseOnly&&!c)return null;if(n.renderCondition&&!Ie(n.renderCondition,[],O))return null;const i=Ne(n.componentProps||"{}",{}),a=N[n.helmValuePath],l=n.componentType===Ee.Toggle,r=t(ue,{size:he.XS,weight:500,color:pe.Primary,children:n.displayName}),s=(e=>{if(e)return"odigos-local-ui-config"===e?{status:Fe.Warning,label:"Edited in UI",tooltip:`Reconciled from ${e}`}:"odigos-configuration"===e?{status:Fe.Unknown,useSecondaryTone:!0,label:"Cluster config",tooltip:`Reconciled from ${e}`}:{status:Fe.Unknown,useSecondaryTone:!0,label:e,tooltip:`Reconciled from ${e}`}})(a),d=s?t(qe,{...s}):null,u=n.description?t(ue,{size:he.XXS,color:pe.Secondary,children:n.description}):null,p=e(ee,{$gap:4,children:[e(me,{$gap:8,$alignItems:"center",children:[r,d]}),u]}),h=t(nr,{componentType:n.componentType,inputType:i.type,name:n.helmValuePath,disabled:n.isHelmOnly||v,value:T("formData",n.helmValuePath),setValue:e=>w(n.helmValuePath,e),dropdownOptions:i.options?.map(e=>({id:e,label:e})),dropdownNoSearch:!0,dropdownNoCheckbox:!0,toggleSize:Nt.S},n.helmValuePath),m=n.isHelmOnly?t($e,{text:"This field can only be updated via the Helm values.yaml file",children:t(Dl,{})}):null;return t(ee,{$gap:8,children:l?e(me,{$gap:12,$justifyContent:"space-between",$alignItems:"flex-start",children:[p,e(me,{$gap:8,$alignItems:"center",children:[m,h]})]}):e(o,{children:[p,e(Jb,{children:[t(Zb,{children:h}),m]})]})},n.helmValuePath)})})},n.name)):h?t(ft,{$height:"30vh",children:t(St,{withSpinner:!0})}):t(dt,{richTitle:{icon:Qa,title:"Config Settings"},children:t(Re,{title:"YAML not found",subTitle:"The YAML for this resource is not available"})})})]}),t(ce,{isOpen:D,width:"40vw",minWidth:"480px",header:{icon:Al,title:"Effective Config YAML",onClose:()=>_(!1)},children:g&&!m?.manifestYAML?t(ft,{$height:"30vh",children:t(St,{withSpinner:!0})}):t(Cr,{yaml:m?.manifestYAML?.replaceAll(" |",""),defaultOpen:!0,fullHeight:!0})})]})]})})},tv=b.div`
1540
+ `,lv=e=>"general"===e.name?0:"advanced"===e.name?2:1,rv=({minSupportedVersion:n})=>{const{isVersionSupported:l,version:r,isEnterprise:c,minSupportedVersion:d}=S(n),{configApi:p}=Ll(),{data:u,loading:h}=p.useConfigYamls(),{data:m,loading:g,refetch:f}=p.useEffectiveConfig(),b=u?.configYamls??[],[v,y]=s(!1),C=a(()=>{if(!m)return{};const{manifestYAML:e,provenance:t,...o}=m;return o},[m]),{formData:x,handleFormChange:w,getNestedValue:T,getFormDiff:k,isFormDirty:E}=Ht(C);i(()=>{"{}"!==JSON.stringify(C)&&"{}"===JSON.stringify(x)&&w(void 0,void 0,C)},[C,x]);const I=a(()=>[...b].sort((e,t)=>lv(e)-lv(t)),[b]),N=a(()=>(e=>{if(!e)return{};const t={};for(const o of e)t[o.helmPath]=o.reconciledFrom;return t})(m?.provenance),[m?.provenance]),$=a(()=>{const e=new Set;for(const t of b)for(const o of t.fields)o.componentType===Ee.Dropdown&&e.add(o.helmValuePath);return e},[b]),O=a(()=>b.flatMap(e=>e.fields.map(e=>({name:e.helmValuePath,value:T("formData",e.helmValuePath)}))),[b,x,T]),[A,R]=s(!1),[D,_]=s(!1),P=a(()=>[{id:cn(),type:co.Button,buttonProps:{"data-id":"settings-save",variant:be.Primary,size:fe.S,label:"Save Changes",leftIcon:Ua,loading:v,onClick:()=>R(!0)}},{id:cn(),type:co.Button,buttonProps:{"data-id":"settings-cancel",variant:be.Secondary,size:fe.S,label:"Cancel",leftIcon:Va,onClick:()=>w(void 0,void 0,C)}}],[v,k,C,x,w]),L=a(()=>I.map(e=>({id:e.name,label:e.displayName})),[I]),F=a(()=>I.map(e=>e.name),[I]),{selectedSection:M,setSelectedSection:z,setSectionRef:B,setScrollContainerRef:X}=Ea({sectionNames:F});return t(Pi,{$gap:24,children:e(tv,{children:[t(Zb,{disabled:!l,loading:h||g,onClickShowYaml:()=>_(!0),onClickReset:async()=>{await(async()=>{p.resetLocalUiConfigToDefaults&&await p.resetLocalUiConfigToDefaults()})(),await(f?.()),w(void 0,void 0,{})},onClickRefresh:f?()=>f():void 0}),e(da,{children:[!l&&t(Tr,{minSupportedVersion:d,currentVersion:r||""}),t(Do,{isOpen:E,richTitle:{icon:el,title:"Config Settings"},actions:P}),t(Qe,{isOpen:A,title:"Save Changes via UI?",description:"We recommend updating via your Helm values.yaml to ensure changes are version-controlled and go through a proper review process.",onClose:()=>R(!1),denyButton:{label:"Keep editing",variant:be.Secondary,onClick:()=>R(!1)},approveButton:{label:"Save changes",variant:be.Primary,onClick:()=>{(async()=>{const e=((e,t)=>{const o=(e,t,o)=>{for(let o=0;o<t.length-1;o++){const n=t[o];n in e&&"object"==typeof e[n]&&null!==e[n]||(e[n]={}),e=e[n]}e[t[t.length-1]]=o},n=JSON.parse(JSON.stringify(e));for(const e of t){const t=e.split(".");let i=n;for(const e of t){if(null==i||"object"!=typeof i){i=void 0;break}i=i[e]}"string"==typeof i&&o(n,t,i.replaceAll("-","_"))}return n})(k(C,x),$);await(async e=>{p.updateLocalUiConfig&&(y(!0),await p.updateLocalUiConfig(e),y(!1),await f())})(e),w(void 0,void 0,{})})(),R(!1)}}}),e(ov,{$gap:24,$alignItems:"stretch",children:[!!b.length&&t(ev,{options:L,selected:M,setSelected:z,disabled:!l}),t(nv,{ref:X,$gap:24,$width:"100%",children:b.length?I.map(n=>t(dt,{id:n.name,bordered:!0,ref:e=>B(n.name,e),customTitle:t(pe,{size:he.M,weight:500,color:ue.Primary,children:n.displayName}),children:t(ee,{$gap:24,children:n.fields.map(n=>{if(n.isEnterpriseOnly&&!c)return null;if(n.renderCondition&&!Ie(n.renderCondition,[],O))return null;const i=Ne(n.componentProps||"{}",{}),a=N[n.helmValuePath],l=n.componentType===Ee.Toggle,r=t(pe,{size:he.XS,weight:500,color:ue.Primary,children:n.displayName}),s=(e=>{if(e)return"odigos-local-ui-config"===e?{status:Fe.Warning,label:"Edited in UI",tooltip:`Reconciled from ${e}`}:"odigos-configuration"===e?{status:Fe.Unknown,useSecondaryTone:!0,label:"Cluster config",tooltip:`Reconciled from ${e}`}:{status:Fe.Unknown,useSecondaryTone:!0,label:e,tooltip:`Reconciled from ${e}`}})(a),d=s?t(qe,{...s}):null,p=n.description?t(pe,{size:he.XXS,color:ue.Secondary,children:n.description}):null,u=e(ee,{$gap:4,children:[e(me,{$gap:8,$alignItems:"center",children:[r,d]}),p]}),h=t(ir,{componentType:n.componentType,inputType:i.type,name:n.helmValuePath,disabled:n.isHelmOnly||v,value:T("formData",n.helmValuePath),setValue:e=>w(n.helmValuePath,e),dropdownOptions:i.options?.map(e=>({id:e,label:e})),dropdownNoSearch:!0,dropdownNoCheckbox:!0,toggleSize:Nt.S},n.helmValuePath),m=n.isHelmOnly?t($e,{text:"This field can only be updated via the Helm values.yaml file",children:t(_l,{})}):null;return t(ee,{$gap:8,children:l?e(me,{$gap:12,$justifyContent:"space-between",$alignItems:"flex-start",children:[u,e(me,{$gap:8,$alignItems:"center",children:[m,h]})]}):e(o,{children:[u,e(iv,{children:[t(av,{children:h}),m]})]})},n.helmValuePath)})})},n.name)):h?t(ft,{$height:"30vh",children:t(St,{withSpinner:!0})}):t(dt,{richTitle:{icon:el,title:"Config Settings"},children:t(Re,{title:"YAML not found",subTitle:"The YAML for this resource is not available"})})})]}),t(ce,{isOpen:D,width:"40vw",minWidth:"480px",header:{icon:Rl,title:"Effective Config YAML",onClose:()=>_(!1)},children:g&&!m?.manifestYAML?t(ft,{$height:"30vh",children:t(St,{withSpinner:!0})}):t(Sr,{yaml:m?.manifestYAML?.replaceAll(" |",""),defaultOpen:!0,fullHeight:!0})})]})]})})},sv=b.div`
1530
1541
  position: fixed;
1531
1542
  bottom: 12px;
1532
1543
  left: 12px;
@@ -1535,4 +1546,4 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import n,{useEff
1535
1546
  flex-direction: column-reverse;
1536
1547
  gap: 6px;
1537
1548
  max-width: 600px;
1538
- `,ov=()=>{const{notifications:e,markAsDismissed:o,markAsSeen:n}=Yt(),i=e.filter(({dismissed:e})=>!e);return t(tv,{children:i.map(({id:e,type:a,title:l,message:r},s)=>{const c=r||l;if(!c)return null;const d=i.length-s;return t(Le,{status:a,message:c,onClose:({asSeen:t})=>(({id:e,asSeen:t})=>{o(e),t&&n(e)})({id:e,asSeen:t}),zIndex:d},`toast-${e}`)})})};export{dc as AddActionDrawer,Fs as AddActionForm,rm as AddDataStreamModal,Cc as AddDestinationDrawer,Bs as AddDestinationForm,Sc as AddRuleDrawer,Ks as AddRuleForm,Pc as AddSourceDrawer,mg as CentralConnections,mu as CloudConnectorStep,bu as CreateCloudConnectorDrawer,rg as CreateNewType,qs as DataStreamForm,Ys as DataStreamMergeWarning,yu as EditActionDrawer,Cu as EditConfigDrawer,sm as EditDataStreamModal,xu as EditDestinationDrawer,Tu as EditRuleDrawer,zh as EditSourceDrawer,Js as EditSourceForm,Ng as Onboarding,um as OnboardingDone,Rf as Overview,jf as PipelineCollectors,ss as RegexTesterDrawer,ag as SamplingOnboardingModal,Jh as SamplingRuleDrawer,nc as SamplingRuleForm,Zf as SamplingRules,Xb as ServiceMap,ev as Settings,lm as SystemDrawer,Hf as TABS,ov as ToastList};
1549
+ `,cv=()=>{const{notifications:e,markAsDismissed:o,markAsSeen:n}=Yt(),i=e.filter(({dismissed:e})=>!e);return t(sv,{children:i.map(({id:e,type:a,title:l,message:r},s)=>{const c=r||l;if(!c)return null;const d=i.length-s;return t(Le,{status:a,message:c,onClose:({asSeen:t})=>(({id:e,asSeen:t})=>{o(e),t&&n(e)})({id:e,asSeen:t}),zIndex:d},`toast-${e}`)})})};export{pc as AddActionDrawer,Ms as AddActionForm,mm as AddDataStreamModal,Sc as AddDestinationDrawer,Xs as AddDestinationForm,xc as AddRuleDrawer,Ys as AddRuleForm,Lc as AddSourceDrawer,Sg as CentralConnections,gp as CloudConnectorStep,vp as CreateCloudConnectorDrawer,mg as CreateNewType,Js as DataStreamForm,qs as DataStreamMergeWarning,Cp as EditActionDrawer,Sp as EditConfigDrawer,gm as EditDataStreamModal,wp as EditDestinationDrawer,kp as EditRuleDrawer,Gh as EditSourceDrawer,Zs as EditSourceForm,Pg as Onboarding,vm as OnboardingDone,zf as Overview,Zf as PipelineCollectors,cs as RegexTesterDrawer,ug as SamplingOnboardingModal,im as SamplingRuleDrawer,ic as SamplingRuleForm,ab as SamplingRules,Kb as ServiceMap,rv as Settings,hm as SystemDrawer,Jf as TABS,cv as ToastList};