@odigos/ui-kit 0.0.296 → 0.0.298
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/CHANGELOG.md +14 -0
- package/lib/chunks/{helpers-BV_MHw06.js → helpers-DIbaWh5d.js} +1 -1
- package/lib/chunks/index-BbgCENJM.js +358 -0
- package/lib/chunks/{source-instrument-form-context-CWv4NCRf.js → source-instrument-form-context-Be_f9jmB.js} +2 -2
- package/lib/chunks/ui-components-mqa1Nv5H.js +2163 -0
- package/lib/components/_cards/data-card/index.d.ts +3 -0
- package/lib/components/fullscreen/index.d.ts +21 -0
- package/lib/components/index.d.ts +1 -0
- package/lib/components/info-row/index.d.ts +4 -0
- package/lib/components/ping/index.d.ts +2 -1
- package/lib/components/trace-view/index.d.ts +1 -1
- package/lib/components/trace-view/styled.d.ts +12 -5
- package/lib/components/trace-view/types.d.ts +7 -3
- package/lib/components.js +1 -1
- package/lib/constants/insights/system.d.ts +2 -2
- package/lib/constants/sources/index.d.ts +1 -0
- package/lib/constants.js +1 -1
- package/lib/containers/_drawers/edit-source-drawer/profiling/flame-graph-canvas.d.ts +1 -1
- package/lib/containers/_drawers/edit-source-drawer/profiling/index.d.ts +0 -2
- package/lib/containers/insights/findings/drawer/anomaly/anomaly-trace-compare/helpers.d.ts +8 -0
- package/lib/containers/insights/findings/drawer/index.d.ts +2 -2
- package/lib/containers/insights/insights-context.d.ts +11 -6
- package/lib/containers.js +380 -380
- package/lib/contexts.js +1 -1
- package/lib/functions.js +1 -1
- package/lib/hooks/index.d.ts +1 -0
- package/lib/hooks/useFullscreen.d.ts +14 -0
- package/lib/hooks.js +1 -1
- package/lib/icons/programming-languages/browser-logo/index.d.ts +2 -0
- package/lib/icons/programming-languages/index.d.ts +1 -0
- package/lib/icons.js +1 -1
- package/lib/snippets/graph-flow/types.d.ts +4 -0
- package/lib/snippets.js +1 -1
- package/lib/store.js +1 -1
- package/lib/theme/palettes/index.d.ts +1 -0
- package/lib/theme.js +1 -1
- package/lib/types/common/index.d.ts +1 -0
- package/lib/types/enum/index.d.ts +1 -0
- package/lib/types.js +1 -1
- package/lib/visuals.js +1 -1
- package/package.json +2 -2
- package/lib/chunks/index-vZsC8Ggg.js +0 -353
- package/lib/chunks/ui-components-BlmdA--F.js +0 -2115
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,19 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [0.0.298](https://github.com/odigos-io/ui-kit/compare/ui-kit-v0.0.297...ui-kit-v0.0.298) (2026-09-09)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Features
|
|
7
|
+
|
|
8
|
+
* bump @babel/core from 7.29.7 to 8.0.0 ([#1059](https://github.com/odigos-io/ui-kit/issues/1059)) ([273ff21](https://github.com/odigos-io/ui-kit/commit/273ff21c82c0b1edad0c09586e73e64a2e793e99))
|
|
9
|
+
|
|
10
|
+
## [0.0.297](https://github.com/odigos-io/ui-kit/compare/ui-kit-v0.0.296...ui-kit-v0.0.297) (2026-09-08)
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
### Bug Fixes
|
|
14
|
+
|
|
15
|
+
* more feedback on insights ([#1295](https://github.com/odigos-io/ui-kit/issues/1295)) ([318e4c2](https://github.com/odigos-io/ui-kit/commit/318e4c240b2435563049cf97b4c85ae89b92882e))
|
|
16
|
+
|
|
3
17
|
## [0.0.296](https://github.com/odigos-io/ui-kit/compare/ui-kit-v0.0.295...ui-kit-v0.0.296) (2026-09-07)
|
|
4
18
|
|
|
5
19
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{jsx as e,Fragment as t,jsxs as r}from"react/jsx-runtime";import{Fragment as n,useMemo as o,useContext as a,createContext as s}from"react";import{T as i,t as u,b as l,P as c}from"./ui-components-
|
|
1
|
+
import{jsx as e,Fragment as t,jsxs as r}from"react/jsx-runtime";import{Fragment as n,useMemo as o,useContext as a,createContext as s}from"react";import{T as i,t as u,b as l,P as c}from"./ui-components-mqa1Nv5H.js";import p from"styled-components";var d;(e=>{e.Default="default",e.Action="action",e.Endpoint="endpoint",e.Scope="scope",e.Duration="duration"})(d||(d={}));const f=[d.Action,d.Endpoint,d.Scope,d.Duration],h=p.span`
|
|
2
2
|
font-family: ${({theme:e,$isMono:t})=>t?e.font_family.secondary:e.font_family.primary};
|
|
3
3
|
font-size: ${({theme:e})=>e.v2.text.size.xxs}px;
|
|
4
4
|
line-height: 20px;
|
|
@@ -0,0 +1,358 @@
|
|
|
1
|
+
import{jsx as e,jsxs as t,Fragment as a}from"react/jsx-runtime";import r,{css as l,useTheme as n}from"styled-components";import i from"elkjs/lib/elk.bundled.js";import o,{useMemo as s,useRef as c,useCallback as d,useState as p,memo as u,useEffect as h,Fragment as g,forwardRef as m,useImperativeHandle as v}from"react";import{Handle as f,Position as b,useReactFlow as y,ReactFlowProvider as x,ReactFlow as $,Background as C,getSmoothStepPath as k,BaseEdge as S,EdgeLabelRenderer as w,MarkerType as T}from"@xyflow/react";import{D as M,c as L,F as A,d as P,e as O,f as E,g as N,h as I,B as R,i as V,j as X,k as z,u as D,l as _,m as H,C as B,N as j,n as F,W as q,o as U,p as G,V as W,q as K,r as Y,s as Z,v as J,w as Q,x as ee,y as te,z as ae,I as re,E as le,G as ne,H as ie,J as oe,K as se,L as ce,M as de,S as pe,O as ue,Q as he,U as ge,X as me,Y as ve,Z as fe,_ as be,$ as ye,a0 as xe,a1 as $e,a2 as Ce,a3 as ke,a4 as Se,a5 as we,a6 as Te,a7 as Me,a8 as Le,a9 as Ae,aa as Pe,T as Oe,ab as Ee,ac as Ne,ad as Ie,ae as Re,af as Ve,ag as Xe,ah as ze,ai as De,aj as _e,ak as He,al as Be,am as je,an as Fe,b as qe,ao as Ue,ap as Ge,aq as We,ar as Ke,as as Ye,at as Ze,au as Je,av as Qe,aw as et,ax as tt,ay as at,az as rt,aA as lt,aB as nt,aC as it,aD as ot,aE as st,aF as ct,aG as dt,aH as pt,aI as ut,aJ as ht,aK as gt,aL as mt,aM as vt,aN as ft,aO as bt,aP as yt,aQ as xt,aR as $t,aS as Ct,aT as kt,aU as St,aV as wt,aW as Tt,aX as Mt,aY as Lt,aZ as At,a_ as Pt,a$ as Ot,b0 as Et,b1 as Nt,b2 as It,b3 as Rt,b4 as Vt,b5 as Xt,b6 as zt,R as Dt,b7 as _t,b8 as Ht,A as Bt,b9 as jt,ba as Ft}from"./ui-components-mqa1Nv5H.js";import{UserIcon as qt,DestinationIcon as Ut,HomeIcon as Gt,VIcon as Wt,TrashIcon as Kt,PlusIcon as Yt,VSquareIcon as Zt,XSquareIcon as Jt,EditIcon as Qt,OdigosLogoTextCentral as ea,OdigosLogoTextEnterprise as ta,OdigosLogoTextCommunity as aa,OdigosLogoTextColoredCentral as ra,OdigosLogoTextColoredEnterprise as la,OdigosLogoTextColoredCommunity as na,ArrowLeftIcon as ia,ArrowRightIcon as oa,CopyIcon as sa,YamlIcon as ca}from"../icons.js";import"@xyflow/react/dist/style.css";import{i as da,m as pa,u as ua,n as ha,a as ga,C as ma,b as va,d as fa,e as ba,f as ya,g as xa,h as $a,j as Ca,k as ka}from"./helpers-DIbaWh5d.js";const Sa=/^[a-zA-Z]$/,wa=new Set(["*","+","?"]),Ta=new Set(["^","$"]),Ma={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"},La=r.div`
|
|
2
|
+
padding: 8px 16px;
|
|
3
|
+
border-radius: 6px;
|
|
4
|
+
border: 1px solid ${({theme:e})=>e.v2.colors.silver[500]};
|
|
5
|
+
background: ${({theme:e})=>e.v2.colors.black[500]};
|
|
6
|
+
font-family: ${({theme:e})=>e.font_family.code};
|
|
7
|
+
font-size: 12px;
|
|
8
|
+
line-height: 20px;
|
|
9
|
+
color: ${({theme:e})=>e.v2.colors.white[500]};
|
|
10
|
+
word-break: break-all;
|
|
11
|
+
white-space: pre-wrap;
|
|
12
|
+
user-select: text;
|
|
13
|
+
|
|
14
|
+
/* Wraps the background tightly to each visual fragment when a colored
|
|
15
|
+
token gets split across two visual lines. Without this the highlight
|
|
16
|
+
stretches all the way to the right edge of the container. */
|
|
17
|
+
& > span {
|
|
18
|
+
box-decoration-break: clone;
|
|
19
|
+
-webkit-box-decoration-break: clone;
|
|
20
|
+
}
|
|
21
|
+
`,Aa=r.span`
|
|
22
|
+
background: ${({$kind:e})=>Ma[e]};
|
|
23
|
+
`,Pa=({pattern:t,"data-id":a})=>{const r=s(()=>(e=>{const t=[];let a=0,r=!1;const l=(e,a)=>{const r=t[t.length-1];r&&r.kind===a?r.text+=e:t.push({text:e,kind:a})};for(;a<e.length;){const t=e[a];if(r){if("]"===t){l("]","class-bracket"),r=!1,a++;continue}if("\\"===t&&a+1<e.length){l(e.slice(a,a+2),"class-content"),a+=2;continue}l(t,"class-content"),a++}else{if("("===t&&"?"===e[a+1]){let t=2;const r=e[a+2];if(":"===r||"="===r||"!"===r)t=3;else if("<"===r){const r=e[a+3];if("="===r||"!"===r)t=4;else{const r=e.indexOf(">",a+2);-1!==r&&(t=r-a+1)}}l(e.slice(a,a+t),"group"),a+=t;continue}if("("!==t&&")"!==t)if("["!==t)if(wa.has(t)||Ta.has(t))l(t,"anchor-quantifier"),a++;else{if("{"===t){const t=e.indexOf("}",a);if(t>a&&/^\{\d+,?\d*\}$/.test(e.slice(a,t+1))){l(e.slice(a,t+1),"anchor-quantifier"),a=t+1;continue}}if("\\"===t&&a+1<e.length){const t=e[a+1];Sa.test(t)?l(e.slice(a,a+2),"anchor-quantifier"):l(e.slice(a,a+2),"literal"),a+=2;continue}"|"!==t?(l(t,"literal"),a++):(l("|","alternation"),a++)}else"^"===e[a+1]?(l("[^","class-bracket"),a+=2):(l("[","class-bracket"),a++),r=!0;else l(t,"group"),a++}}return t})(t),[t]);return e(La,t?{"data-id":a,children:r.map((t,a)=>e(Aa,{$kind:t.kind,children:t.text},a))}:{"data-id":a,children:" "})},Oa="rgba(102, 191, 255, 0.5)",Ea=l`
|
|
24
|
+
font-family: ${({theme:e})=>e.font_family.code};
|
|
25
|
+
font-size: 12px;
|
|
26
|
+
line-height: 20px;
|
|
27
|
+
letter-spacing: 0;
|
|
28
|
+
white-space: pre-wrap;
|
|
29
|
+
word-wrap: break-word;
|
|
30
|
+
overflow-wrap: break-word;
|
|
31
|
+
/* tab-size keeps tabs visually consistent across the two layers — some
|
|
32
|
+
browsers default to 8 on a textarea but 4 on a div. */
|
|
33
|
+
-moz-tab-size: 4;
|
|
34
|
+
tab-size: 4;
|
|
35
|
+
margin: 0;
|
|
36
|
+
`,Na=r.div`
|
|
37
|
+
position: relative;
|
|
38
|
+
width: 100%;
|
|
39
|
+
min-height: ${({$minHeight:e})=>e}px;
|
|
40
|
+
border-radius: 6px;
|
|
41
|
+
border: 1px solid ${({theme:e})=>e.v2.colors.silver[500]};
|
|
42
|
+
background: ${({theme:e})=>e.v2.colors.black[500]};
|
|
43
|
+
|
|
44
|
+
&:hover,
|
|
45
|
+
&:focus-within {
|
|
46
|
+
border-color: ${({theme:e})=>e.v2.colors.silver[300]};
|
|
47
|
+
}
|
|
48
|
+
`,Ia=r.div`
|
|
49
|
+
${Ea}
|
|
50
|
+
position: absolute;
|
|
51
|
+
inset: 0;
|
|
52
|
+
padding: 12px;
|
|
53
|
+
pointer-events: none;
|
|
54
|
+
color: transparent;
|
|
55
|
+
overflow: hidden;
|
|
56
|
+
|
|
57
|
+
/* Mandatory for backgrounds that wrap across visual lines. */
|
|
58
|
+
& > span {
|
|
59
|
+
box-decoration-break: clone;
|
|
60
|
+
-webkit-box-decoration-break: clone;
|
|
61
|
+
}
|
|
62
|
+
`,Ra=r.textarea`
|
|
63
|
+
${Ea}
|
|
64
|
+
position: relative;
|
|
65
|
+
z-index: 1;
|
|
66
|
+
display: block;
|
|
67
|
+
width: 100%;
|
|
68
|
+
min-height: ${({$minHeight:e})=>e}px;
|
|
69
|
+
padding: 12px;
|
|
70
|
+
border: 0;
|
|
71
|
+
background: transparent;
|
|
72
|
+
outline: none;
|
|
73
|
+
resize: vertical;
|
|
74
|
+
color: ${({theme:e})=>e.v2.colors.white[500]};
|
|
75
|
+
caret-color: ${({theme:e})=>e.v2.colors.white[500]};
|
|
76
|
+
box-sizing: border-box;
|
|
77
|
+
|
|
78
|
+
&::placeholder {
|
|
79
|
+
color: ${({theme:e})=>e.v2.colors.silver[600]};
|
|
80
|
+
}
|
|
81
|
+
`,Va=e=>({before:e,matchPre:"",capture:"",matchPost:"",after:""}),Xa=({regex:a,value:r,onChange:l,minHeight:n=240,...i})=>{const o=c(null),p=c(null),u=s(()=>((e,t)=>{if(!e||!t)return Va(t);let a;try{a=new RegExp(e)}catch{return Va(t)}const r=a.exec(t);if(!r)return Va(t);const l=r.index,n=r.index+r[0].length;if(r.length<2||null==r[1])return{before:t.slice(0,l),matchPre:"",capture:t.slice(l,n),matchPost:"",after:t.slice(n)};const i=r[0].indexOf(r[1]),o=i>=0?l+i:l,s=o+r[1].length;return{before:t.slice(0,l),matchPre:t.slice(l,o),capture:t.slice(o,s),matchPost:t.slice(s,n),after:t.slice(n)}})(a,r),[a,r]),h=d(()=>{o.current&&p.current&&(o.current.scrollTop=p.current.scrollTop,o.current.scrollLeft=p.current.scrollLeft)},[]);return t(Na,{$minHeight:n,children:[t(Ia,{ref:o,"aria-hidden":!0,children:[u.before,e("span",{style:{background:Oa},children:u.matchPre}),e("span",{style:{background:"rgba(102, 242, 102, 0.5)"},children:u.capture}),e("span",{style:{background:Oa},children:u.matchPost}),u.after,r.endsWith("\n")?" ":""]}),e(Ra,{ref:p,$minHeight:n,value:r,onChange:e=>l(e.target.value),onScroll:h,spellCheck:!1,...i})]})},za=r.div`
|
|
82
|
+
flex: 1;
|
|
83
|
+
min-height: 0;
|
|
84
|
+
overflow-y: auto;
|
|
85
|
+
`,Da=r.div`
|
|
86
|
+
background: ${({theme:e})=>e.v2.colors.silver[900]};
|
|
87
|
+
border-radius: 8px;
|
|
88
|
+
padding: 8px;
|
|
89
|
+
display: flex;
|
|
90
|
+
flex-direction: column;
|
|
91
|
+
gap: 12px;
|
|
92
|
+
`,_a=r.div`
|
|
93
|
+
padding: 8px 16px;
|
|
94
|
+
border-radius: 8px;
|
|
95
|
+
background: ${({theme:e})=>e.v2.colors.silver[800]};
|
|
96
|
+
font-family: ${({theme:e})=>e.font_family.code};
|
|
97
|
+
font-size: 12px;
|
|
98
|
+
line-height: 20px;
|
|
99
|
+
color: ${({theme:e,$tone:t})=>"error"===t?e.v2.colors.red[500]:"match"===t?e.v2.colors.white[500]:e.v2.colors.silver[200]};
|
|
100
|
+
word-break: break-all;
|
|
101
|
+
white-space: pre-wrap;
|
|
102
|
+
user-select: text;
|
|
103
|
+
`,Ha=({isOpen:a,regex:r,onClose:l,initialTestString:n=""})=>{const[i,o]=p(n),c=s(()=>((e,t)=>{if(!e)return{ok:!0,isMatch:!1,message:L.RESULT_EMPTY_REGEX};if(!t)return{ok:!0,isMatch:!1,message:L.RESULT_EMPTY_INPUT};let a;try{a=new RegExp(e)}catch(e){return{ok:!1,message:e instanceof Error?e.message:L.RESULT_INVALID_REGEX_FALLBACK}}const r=a.exec(t);return r?{ok:!0,isMatch:!0,message:r.length>1?r[1]:r[0]}:{ok:!0,isMatch:!1,message:L.RESULT_NO_MATCH}})(r,i),[r,i]),d=c.ok?c.isMatch?"match":"neutral":"error";return e(M,{isOpen:a,header:{title:L.TITLE,onClose:()=>{o(""),l()}},children:e(za,{children:t(Da,{children:[t(A,{$gap:6,children:[e(P,{label:L.REGEX_LABEL}),e(Pa,{pattern:r,"data-id":"regex-tester-regex"}),!r&&e(O,{size:N.XXS,color:E.Secondary,children:L.REGEX_EMPTY_HINT})]}),t(A,{$gap:6,children:[t(I,{$width:"100%",$justifyContent:"space-between",$alignItems:"center",children:[e(P,{label:L.TEST_STRING_LABEL}),e(R,{"data-id":"regex-tester-unescape",label:L.UNESCAPE_LABEL,tooltip:L.UNESCAPE_TOOLTIP,variant:X.Secondary,size:V.S,onClick:()=>o(e=>(e=>{let t="";for(let a=0;a<e.length;a++){if("\\"===e[a]&&a+1<e.length){const r=e[a+1],l="n"===r?"\n":"t"===r?"\t":"r"===r?"\r":'"'===r?'"':"'"===r?"'":"\\"===r?"\\":null;if(null!=l){t+=l,a++;continue}}t+=e[a]}return t})(e)),disabled:(u=i,!/\\["'\\nrt]/.test(u))})]}),e(Xa,{name:"regex-tester-test-string","data-id":"regex-tester-test-string",placeholder:L.TEST_STRING_PLACEHOLDER,regex:r,value:i,onChange:o,minHeight:240}),e(z,{helpMessage:L.TEST_STRING_HELP})]}),t(A,{$gap:8,children:[e(P,{label:L.RESULT_LABEL}),e(_a,{$tone:d,"data-id":"regex-tester-result",children:c.message}),c.ok&&c.isMatch&&e(O,{size:N.XXS,color:E.Secondary,children:L.RESULT_CAPTURE_HINT})]})]})})});var u},Ba=r.div`
|
|
104
|
+
display: grid;
|
|
105
|
+
grid-template-rows: ${({$open:e})=>e?"1fr":"0fr"};
|
|
106
|
+
opacity: ${({$open:e})=>e?1:0};
|
|
107
|
+
margin-bottom: ${({$open:e,$gapCancelPx:t})=>e?"0":`-${t}px`};
|
|
108
|
+
transition:
|
|
109
|
+
grid-template-rows ${220}ms ease,
|
|
110
|
+
opacity ${220}ms ease ${({$open:e,$delayInMs:t})=>e?`${t}ms`:"0ms"},
|
|
111
|
+
margin-bottom ${220}ms ease;
|
|
112
|
+
pointer-events: ${({$open:e})=>e?"auto":"none"};
|
|
113
|
+
|
|
114
|
+
> .animated-collapse-inner {
|
|
115
|
+
overflow: hidden;
|
|
116
|
+
min-height: 0;
|
|
117
|
+
}
|
|
118
|
+
`,ja=({open:t,children:a,delayInMs:r=0,gapCancelPx:l=0})=>e(Ba,{$open:t,$delayInMs:r,$gapCancelPx:l,"aria-hidden":!t,children:e("div",{className:"animated-collapse-inner",children:a})}),Fa=r.div`
|
|
119
|
+
box-sizing: border-box;
|
|
120
|
+
min-width: 109px;
|
|
121
|
+
max-width: 160px;
|
|
122
|
+
padding: 12px;
|
|
123
|
+
border-radius: 8px;
|
|
124
|
+
display: flex;
|
|
125
|
+
flex-direction: column;
|
|
126
|
+
gap: 8px;
|
|
127
|
+
background-color: ${({theme:e})=>e.v2.colors.silver[1e3]};
|
|
128
|
+
border: 1px
|
|
129
|
+
${({$accent:e,$isVirtual:t})=>t?`dashed ${e}`:`solid ${e}`};
|
|
130
|
+
`,qa=r.div`
|
|
131
|
+
display: flex;
|
|
132
|
+
align-items: center;
|
|
133
|
+
gap: 4px;
|
|
134
|
+
min-width: 0;
|
|
135
|
+
`,Ua=r.div`
|
|
136
|
+
flex-shrink: 0;
|
|
137
|
+
width: 16px;
|
|
138
|
+
height: 16px;
|
|
139
|
+
display: flex;
|
|
140
|
+
align-items: center;
|
|
141
|
+
justify-content: center;
|
|
142
|
+
`,Ga={visibility:"hidden"},Wa=u(({data:r})=>{const l=n(),{service:i,namespace:o,isVirtual:s,isRoot:c,isUser:d}=r,p=((e,t)=>"user"===e?qt:t?Ut:Gt)(i,s),u=o?`${o}/${i}`:i,h=s?"virtual":"-",g=c?l.v2.colors.purple[300]:s?l.v2.colors.pink[500]:l.v2.colors.silver[200];return t(a,{children:[e(f,d?{type:"source",position:b.Bottom,style:Ga}:{type:"source",position:b.Top,style:Ga}),e(f,d?{type:"target",position:b.Right,style:Ga}:{type:"target",position:b.Left,style:Ga}),t(Fa,{$accent:g,$isVirtual:s,children:[t(qa,{children:[e(Ua,{children:e(p,{size:16,fill:g})}),e(O,{size:N.XXXS,color:g,nowrap:!0,children:u})]}),e(O,{size:N.XXXS,color:g,nowrap:!0,children:h})]})]})});Wa.displayName=Wa.name;const Ka={duration:300,padding:.2,includeHiddenNodes:!0,maxZoom:1},Ya=({trigger:e,options:t=Ka})=>{const{fitView:a}=y(),r=c(!0);return h(()=>{r.current?r.current=!1:e>0&&requestAnimationFrame(()=>a(t))},[e,a,t]),null},Za=r.div`
|
|
143
|
+
position: relative;
|
|
144
|
+
width: 100%;
|
|
145
|
+
height: ${({$height:e})=>e};
|
|
146
|
+
border-radius: 8px;
|
|
147
|
+
overflow: hidden;
|
|
148
|
+
background-color: ${({theme:e})=>e.v2.colors.silver[1e3]};
|
|
149
|
+
|
|
150
|
+
.react-flow__attribution {
|
|
151
|
+
visibility: hidden;
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
${({$lockPointerEvents:e})=>e?"\n .react-flow__node {\n cursor: default;\n pointer-events: none;\n }\n ":""}
|
|
155
|
+
|
|
156
|
+
${({$suppressFocus:e})=>e?"\n .react-flow__node:focus,\n .react-flow__node:focus-visible,\n .react-flow__node.selected {\n outline: none;\n box-shadow: none;\n }\n ":""}
|
|
157
|
+
|
|
158
|
+
* {
|
|
159
|
+
transition: none;
|
|
160
|
+
}
|
|
161
|
+
`,Ja=r(H)`
|
|
162
|
+
position: absolute;
|
|
163
|
+
top: 12px;
|
|
164
|
+
right: 12px;
|
|
165
|
+
z-index: ${({theme:e})=>e.v2.zIndex.island};
|
|
166
|
+
`;function Qa({nodes:a,edges:r,nodeTypes:l,edgeTypes:i,height:o=420,interactive:d=!1,minZoom:u=.2,maxZoom:g=1.5,fitViewPadding:m=.2,fitViewTrigger:v=0,showBackground:f=!0,suppressNodeFocusStyle:b,withFullscreen:y=!0,onFullscreenChange:x,onNodesChange:k,onEdgesChange:S,onNodeClick:w,onNodeMouseEnter:T,onNodeMouseLeave:M,className:L,style:A,children:P}){const O=n(),{isFullscreen:E,toggle:N}=D({onChange:x}),[I,R]=p(0),V=c(!0),X=!d,z=b??X,H=(e=>"number"==typeof e?`${e}px`:e)(o),B=v+I,j=s(()=>({...Ka,padding:m,maxZoom:Math.min(Ka.maxZoom??1,g)}),[m,g]);h(()=>{if(V.current)return void(V.current=!1);const e=requestAnimationFrame(()=>{R(e=>e+1)});return()=>cancelAnimationFrame(e)},[E]);const F=t(Za,{className:L,style:A,$height:E?"calc(100vh - 32px)":H,$lockPointerEvents:X,$suppressFocus:z,children:[t($,{nodes:a,edges:r,nodeTypes:l,edgeTypes:i,onNodesChange:k,onEdgesChange:S,onNodeClick:w,onNodeMouseEnter:T,onNodeMouseLeave:M,nodesDraggable:!1,nodesConnectable:!1,elementsSelectable:!1,nodesFocusable:!X,edgesFocusable:!1,panOnDrag:!0,zoomOnScroll:!0,minZoom:u,maxZoom:g,proOptions:{hideAttribution:!0},children:[f&&e(C,{color:O.v2.colors.silver[600],gap:17,size:1}),e(Ya,{trigger:B,options:j}),P]}),y&&e(Ja,{isFullscreen:E,onToggle:N})]});return y?e(_,{isFullscreen:E,spacerHeight:H,children:F}):F}function er(t){return e(x,{children:e(Qa,{...t})})}const tr=t=>e(er,{...t}),ar=({sourceX:e,sourceY:t,targetX:a,targetY:r,sourcePosition:l=b.Right,targetPosition:n=b.Left,isSelfLoop:i,selfLoopNodeHeight:o})=>i?(({sourceX:e,sourceY:t,targetX:a,targetY:r,selfLoopNodeHeight:l=80})=>{const n=(e+a)/2,i=l/2+40,o=Math.min(t,r)-i;return[`M ${e},${t} C ${e+28},${t} ${e+28},${o} ${n},${o} C ${a-28},${o} ${a-28},${r} ${a},${r}`,n,o,0,0]})({sourceX:e,sourceY:t,targetX:a,targetY:r,selfLoopNodeHeight:o}):k({sourceX:e,sourceY:t,targetX:a,targetY:r,sourcePosition:l,targetPosition:n}),rr=new i,lr=async(e,t,a)=>{const{nodeWidth:r,nodeHeight:l,rootIds:n=[],rootLayerConstraint:i="FIRST",rootAlignCenter:o="FIRST"===i,spacing:s,direction:c,extraOptions:d}=a,p=new Set(n),u=(({direction:e="RIGHT",spacing:t,extraOptions:a})=>({"elk.algorithm":"layered","elk.direction":e,"elk.layered.nodePlacement.strategy":"NETWORK_SIMPLEX","elk.layered.spacing.nodeNodeBetweenLayers":String(t?.betweenLayers??120),"elk.spacing.nodeNode":String(t?.nodeNode??24),"elk.layered.spacing.edgeEdgeBetweenLayers":String(t?.edgeEdge??24),"elk.layered.spacing.edgeNodeBetweenLayers":String(t?.edgeNode??32),...a}))({direction:c,spacing:s,extraOptions:d}),h={id:"root",layoutOptions:u,children:e.map(e=>({id:e.id,width:r,height:l,...p.has(e.id)?{layoutOptions:{"elk.layered.layering.layerConstraint":i,...o?{"elk.alignment":"CENTER"}:{}}}:{}})),edges:t.map(e=>({id:e.id,sources:[e.source],targets:[e.target]}))},g=await rr.layout(h),m=new Map;return g.children?.forEach(e=>{m.set(e.id,{x:e.x??0,y:e.y??0})}),{nodes:e.map(e=>({...e,position:m.get(e.id)??e.position})),edges:t}},nr="0;0.5;1",ir=u(({id:r,source:l,target:i,sourceX:o,sourceY:c,targetX:d,targetY:p,sourcePosition:u,targetPosition:h,markerEnd:g,style:m,data:v})=>{const f=n(),b=v?.mode??"fixed",y=l===i||Boolean(v?.isSelfLoop),[x]=ar({sourceX:o,sourceY:c,targetX:d,targetY:p,sourcePosition:u,targetPosition:h,isSelfLoop:y,selfLoopNodeHeight:v?.selfLoopNodeHeight}),$=`${r}__graph-flow-motion`,C=v?.trackColor??("string"==typeof m?.stroke?m.stroke:"path-length"===b?f.v2.colors.silver[400]:f.v2.colors.blue[700]),k=v?.ballColorSmall??("path-length"===b?f.v2.colors.silver[600]:f.v2.colors.blue[900]),T=v?.ballColorLarge??("path-length"===b?f.v2.colors.silver[200]:f.v2.colors.blue[500]),{travelDuration:M,ballCount:L}=s(()=>{if("fixed"===b)return{travelDuration:4,ballCount:5};const e=Math.hypot(d-o,p-c),t=((e,t)=>{if("undefined"==typeof document)return t;const a=document.createElementNS("http://www.w3.org/2000/svg","path");return a.setAttribute("d",e),a.getTotalLength()||t})(x,e);return{travelDuration:Math.max(1.2,t/100),ballCount:Math.min(10,Math.max(3,Math.round(t/72)))}},[b,x,o,c,d,p]),A=`${M.toFixed(3)}s`;return t(a,{children:[e(S,{id:r,path:x,markerEnd:g,style:{...m,stroke:C,strokeWidth:1}}),e(w,{children:t("svg",{style:{position:"absolute",top:0,left:0,width:"100%",height:"100%",overflow:"visible",pointerEvents:"none"},children:[e("path",{id:$,d:x,fill:"none",stroke:"none"}),Array.from({length:L}).map((a,r)=>{const l=`-${(M/L*r).toFixed(3)}s`;return t("circle",{r:0,fill:k,children:[e("animateMotion",{dur:A,begin:l,repeatCount:"indefinite",children:e("mpath",{href:`#${$}`})}),e("animate",{attributeName:"r",dur:A,begin:l,repeatCount:"indefinite",keyTimes:nr,values:"0;3.5;3.5"}),e("animate",{attributeName:"fill",dur:A,begin:l,repeatCount:"indefinite",keyTimes:nr,values:`${k};${T};${T}`})]},r)})]})})]})});ir.displayName=ir.name;const or="graph-flow-animated";var sr,cr;(e=>{e.Service="blast-radius-service"})(sr||(sr={})),(e=>{e.Animated="blast-radius-animated"})(cr||(cr={}));const dr=(e,t)=>{const a=(e||"").trim();return a?`${a}/${t}`:t},pr=e=>dr(e.namespace,e.service),ur=(e,t,a)=>{const r=new Set(e),l=[...e];for(;l.length;){const e=l.shift();for(const n of a.get(e)??[])n===t||r.has(n)||(r.add(n),l.push(n))}return r},hr=(e,t,a)=>{const r=new Map;if(!e.length)return r;const l=[];for(let t=0;t<e.length;t+=6)l.push(e.slice(t,t+6));const n=-72*(l.length-1)/2;return l.forEach((e,l)=>{const i=n+72*l;e.forEach((e,l)=>{const n=t+a*(l+1)*160;r.set(e,{x:n,y:i})})}),r},gr=(e,t,a)=>{const r=t.map(e=>a.get(e)).filter(e=>!!e);if(!r.length)return{x:0,y:72};const l={x:r.reduce((e,t)=>e+t.x,0)/r.length,y:r.reduce((e,t)=>e+t.y,0)/r.length+72},n=new Set([...a.entries()].filter(([t])=>t!==e).map(([,e])=>`${e.x},${e.y}`));let i=l;for(;n.has(`${i.x},${i.y}`);)i={x:i.x,y:i.y+72};return i},mr={[sr.Service]:Wa},vr={[cr.Animated]:ir,[or]:ir},fr=r.div`
|
|
167
|
+
display: flex;
|
|
168
|
+
flex-direction: column;
|
|
169
|
+
gap: 8px;
|
|
170
|
+
padding: 12px;
|
|
171
|
+
width: fit-content;
|
|
172
|
+
border-radius: 8px;
|
|
173
|
+
background-color: ${({theme:e})=>e.v2.colors.silver[800]};
|
|
174
|
+
position: absolute;
|
|
175
|
+
top: 12px;
|
|
176
|
+
left: 12px;
|
|
177
|
+
z-index: ${({theme:e})=>e.v2.zIndex.island};
|
|
178
|
+
`,br=({subgraph:a})=>{const r=n(),[l,i]=p([]),[o,c]=p([]),[d,u]=p(0),[g,m]=p(null),v=s(()=>{const e=a.nodes.map(e=>`${e.namespace||""}/${e.service}:${e.isVirtual?1:0}`).join("|"),t=a.edges.map(e=>`${e.clientNamespace||""}/${e.clientService}->${e.serverNamespace||""}/${e.serverService}`).join("|");return`${(e=>`${e.root.namespace||""}/${e.root.service}`)(a)}::${e}::${t}`},[a]);h(()=>{const e=(e=>{const t=pr(e.root);return e.nodes.map(e=>{const a=pr(e);return{id:a,type:sr.Service,position:{x:0,y:0},data:{service:e.service,namespace:e.namespace||"",isVirtual:e.isVirtual,isRoot:a===t,isUser:"user"===e.service},measured:{width:120,height:58}}})})(a),t=new Set(e.map(e=>e.id)),l=((e,t,a)=>e.edges.flatMap(e=>{const r=(e=>dr(e.clientNamespace,e.clientService))(e),l=(e=>dr(e.serverNamespace,e.serverService))(e);if(!a.has(r)||!a.has(l))return[];const n=t.v2.colors.silver[400];return[{id:`${r}->${l}`,type:"smoothstep",source:r,target:l,markerEnd:{type:T.ArrowClosed,color:n,width:16,height:16},style:{stroke:n,strokeWidth:1}}]}))(a,r,t),n=((e,t)=>{if(!e.length)return{nodes:e,edges:t};const a=(e.find(e=>e.data.isRoot)??e[0]).id,r=e.find(e=>e.data.isUser)?.id??null,l=new Map,n=new Map,i=new Map;for(const t of e)l.set(t.id,[]),n.set(t.id,[]),i.set(t.id,[]);for(const e of t)l.get(e.source)?.push(e.target),n.get(e.target)?.push(e.source),i.get(e.source)?.push(e.target),i.get(e.target)?.push(e.source);const o=ur((n.get(a)??[]).filter(e=>e!==r),a,i),s=ur((l.get(a)??[]).filter(e=>e!==r&&!o.has(e)),a,i);r&&(o.delete(r),s.delete(r));const c=((e,t)=>{const a=new Map([[e,0]]),r=[e];for(;r.length;){const e=r.shift(),l=(a.get(e)??0)+1;for(const n of t.get(e)??[])a.has(n)||(a.set(n,l),r.push(n))}return a})(a,i),d=[...o].sort((e,t)=>{const a=(c.get(t)??0)-(c.get(e)??0);return 0!==a?a:e.localeCompare(t)}),p=[...s].filter(e=>!o.has(e)).sort((e,t)=>{const a=(c.get(e)??0)-(c.get(t)??0);return 0!==a?a:e.localeCompare(t)});for(const t of e)t.id===a||t.id===r||o.has(t.id)||s.has(t.id)||d.push(t.id);const u=new Map([[a,{x:0,y:0}]]);for(const[e,t]of hr(d,0,-1))u.set(e,t);for(const[e,t]of hr(p,0,1))u.set(e,t);return r&&u.set(r,gr(r,i.get(r)??[],u)),{nodes:e.map(e=>({...e,position:u.get(e.id)??e.position})),edges:t}})(e,l);i(n.nodes),c(n.edges),m(null),u(e=>e+1)},[v,a,r]);const f=s(()=>g?o.map(e=>{if(e.source===g||e.target===g)return{...e,type:cr.Animated,data:{...e.data,mode:"path-length"}};const t={opacity:.3};return{...e,style:{...e.style,...t},labelStyle:{...e.labelStyle,...t},labelBgStyle:{...e.labelBgStyle,...t}}}):o,[o,g]);return e(er,{height:286,interactive:!0,nodeTypes:mr,edgeTypes:vr,nodes:l,edges:f,fitViewTrigger:d,fitViewPadding:.2,minZoom:.4,maxZoom:1.5,onNodeMouseEnter:(e,t)=>m(t.id),onNodeMouseLeave:()=>m(null),children:t(fr,{children:[t(I,{$gap:4,children:[e(F,{color:r.v2.colors.purple[400]}),e(O,{size:N.XXXS,children:"This Service"})]}),t(I,{$gap:4,children:[e(F,{color:r.v2.colors.pink[500]}),e(O,{size:N.XXXS,children:"Non-Instrumented Service"})]}),t(I,{$gap:4,children:[e(F,{color:r.v2.colors.silver[200]}),e(O,{size:N.XXXS,children:"Instrumented Service"})]})]})})},yr=({blastRadius:t})=>t?.nodes?.length?e(br,{subgraph:t}):e(B,{children:e(j,{subTitle:"No blast-radius neighborhood for this service yet."})}),xr=({isOpen:t,onClose:a,onDeny:r,onApprove:l})=>e(q,{title:"Discard changes?",description:"You have unsaved changes.\nIf you cancel now, your changes won't be saved.",isOpen:t,onClose:a,denyButton:{label:"Keep editing",variant:X.Secondary,onClick:()=>{r?.(),a()}},approveButton:{label:"Discard changes",variant:X.Primary,onClick:()=>{l?.(),a()}}}),$r=({isOpen:t,onClose:a,onViewConnector:r})=>e(q,{isOpen:t,onClose:a,visual:()=>e(W,{scale:1.2,icon:Wt}),title:G.CLOUD_CONNECTOR_CREATED_MODAL_TITLE,description:G.CLOUD_CONNECTOR_CREATED_MODAL_DESC,denyButton:{label:U.STAY_ON_CONNECTIONS,variant:X.Secondary,onClick:a},approveButton:{label:U.GO_TO_CONNECTOR_OVERVIEW,variant:X.Primary,onClick:r??a}}),Cr=({isOpen:t,onClose:a,onDeny:r,onApprove:l,action:n="delete",target:i,description:o,overrideApproveButtonLabel:s,overrideDenyButtonLabel:c})=>{const d=n.charAt(0).toUpperCase()+n.substring(1),p=i?.endsWith("s")?"these":"this";return e(q,{title:`${d}${i?` ${i}`:""}?`,description:o??`Are you sure you want to ${n}${i?` ${p} ${i}`:""}?`,isOpen:t,onClose:a,denyButton:{label:c??"Go back",variant:X.Secondary,onClick:()=>{r?.(),a()}},approveButton:{label:s??d,variant:X.Primary,onClick:()=>{l?.(),a()}}})},kr=({componentType:t,inputType:a,name:r,label:l,tooltip:n,badge:i,placeholder:o,required:s,disabled:c,value:d,setValue:p,errorMessage:u,warnMessage:h,helpMessage:g,dropdownOptions:m,dropdownNoSearch:v,dropdownNoCheckbox:f,timeUnits:b,timeDefaultUnit:y,toggleSize:x=J.L,keyLabel:$,valueLabel:C})=>{switch(t){case K.Input:return e(ie,{name:r,type:a,label:l,tooltip:n,badge:i,placeholder:o,required:s,disabled:c,value:d??"",onChange:e=>{const t=e.target.value;p(a===oe.Number?""===t?null:Number(t):t)},errorMessage:u,warnMessage:h,helpMessage:g},r);case K.MultiInput:return e(ne,{name:r,label:l,tooltip:n,badge:i,placeholder:o,required:s,disabled:c,values:Array.isArray(d)?d:le(d,[]),setValues:e=>p(e),errorMessage:u,warnMessage:h,helpMessage:g,plain:!0},r);case K.KeyValuePair:return e(re,{name:r,label:l,tooltip:n,badge:i,required:s,disabled:c,limitFieldsPerRow:2,columns:[{keyName:"key",label:$||"Key",placeholder:$||"Key"},{keyName:"value",label:C||"Value",placeholder:C||"Value"}],values:Array.isArray(d)?d:le(d,[]),setValues:e=>p(e),errorMessage:u,warnMessage:h,helpMessage:g},r);case K.TextArea:return e(ae,{name:r,label:l,tooltip:n,badge:i,required:s,disabled:c,placeholder:o,value:d??"",onChange:e=>p(e.target.value),errorMessage:u,warnMessage:h,helpMessage:g},r);case K.Dropdown:return e(te,{name:r,label:l,tooltip:n,badge:i,placeholder:o,required:s,disabled:c,withSearch:!v,options:m?.map(e=>({id:e.id||"",label:e.label||"",withCheckbox:!f}))||[],values:d?[String(d)]:[],setValues:e=>p(e[0]),errorMessage:u,warnMessage:h,helpMessage:g},r);case K.Checkbox:return e(ee,{name:r,label:l,tooltip:n,badge:i,value:!0===d||"true"===d,onChange:e=>p(e),disabled:c,errorMessage:u,warnMessage:h,helpMessage:g},r);case K.Time:return e(Q,{name:r,label:l,tooltip:n,badge:i,placeholder:o,required:s,disabled:c,value:d??"",setValue:e=>p(e),units:b,defaultUnit:y,errorMessage:u,warnMessage:h,helpMessage:g},r);case K.Toggle:return e(Y,{name:r,size:x,labelAlign:Z.Right,label:l,tooltip:n,badge:i,value:!0===d||"true"===d,onChange:e=>p(e),disabled:c,errorMessage:u,warnMessage:h,helpMessage:g},r);default:return null}},Sr=r.div`
|
|
179
|
+
display: flex;
|
|
180
|
+
flex-wrap: wrap;
|
|
181
|
+
gap: 8px;
|
|
182
|
+
`,wr=r.div`
|
|
183
|
+
display: flex;
|
|
184
|
+
align-items: center;
|
|
185
|
+
gap: 8px;
|
|
186
|
+
padding: 8px 12px;
|
|
187
|
+
border-radius: 8px;
|
|
188
|
+
cursor: pointer;
|
|
189
|
+
background: ${({theme:e,$selected:t})=>t?e.v2.colors.silver[700]:e.v2.colors.silver[800]};
|
|
190
|
+
border: 1px solid ${({theme:e,$selected:t})=>t?e.v2.colors.silver[500]:e.v2.colors.silver[750]};
|
|
191
|
+
|
|
192
|
+
&:hover {
|
|
193
|
+
background: ${({theme:e})=>e.v2.colors.silver[700]};
|
|
194
|
+
}
|
|
195
|
+
`,Tr=r.div`
|
|
196
|
+
display: flex;
|
|
197
|
+
width: 32px;
|
|
198
|
+
height: 32px;
|
|
199
|
+
justify-content: center;
|
|
200
|
+
align-items: center;
|
|
201
|
+
flex-shrink: 0;
|
|
202
|
+
`,Mr=r.div`
|
|
203
|
+
display: flex;
|
|
204
|
+
flex-direction: column;
|
|
205
|
+
gap: 12px;
|
|
206
|
+
`,Lr=r.div`
|
|
207
|
+
display: flex;
|
|
208
|
+
flex-wrap: wrap;
|
|
209
|
+
gap: 6px;
|
|
210
|
+
`,Ar=r.div`
|
|
211
|
+
display: flex;
|
|
212
|
+
align-items: center;
|
|
213
|
+
gap: 8px;
|
|
214
|
+
&::before,
|
|
215
|
+
&::after {
|
|
216
|
+
content: '';
|
|
217
|
+
flex: 1;
|
|
218
|
+
height: 1px;
|
|
219
|
+
background-color: ${({theme:e})=>e.v2.colors.silver[700]};
|
|
220
|
+
}
|
|
221
|
+
`,Pr=r.div`
|
|
222
|
+
padding: 2px 10px;
|
|
223
|
+
border-radius: 999px;
|
|
224
|
+
background-color: ${({theme:e})=>e.v2.colors.silver[700]};
|
|
225
|
+
border: 1px solid ${({theme:e})=>e.v2.colors.silver[600]};
|
|
226
|
+
`,Or={[be.JavaScript]:"Node.js",[be.DotNet]:".NET",[be.Php]:"PHP",[be.Java]:"Java",[be.Go]:"Go",[be.Python]:"Python",[be.Ruby]:"Ruby",[be.Rust]:"Rust"},Er=[be.Python,be.Java,be.JavaScript,be.DotNet,be.Php,be.Ruby,be.Go],Nr=[{value:"all",label:"Entire Cluster"},{value:"source",label:"Specific Source"},{value:"namespace",label:"Specific Namespace"},{value:"language",label:"Specific Programming Language"}];function Ir(e){return Or[e]||e.charAt(0).toUpperCase()+e.slice(1)}function Rr(e){return null!=e?`${e}. ${Le}`:Le}const Vr=({readOnly:t,...a})=>e(t?Dr:Hr,{...a}),Xr=({title:a,count:r,children:l})=>t(A,{$gap:6,children:[t(I,{$gap:8,$alignItems:"center",children:[e(O,{size:N.XS,color:E.Primary,nowrap:!0,children:a}),r>1&&e(O,{size:N.XXS,color:E.Secondary,nowrap:!0,children:`(${Te})`})]}),e(Lr,{children:l})]}),zr=()=>{const t=n();return e(Ar,{children:e(Pr,{children:e(O,{size:N.XXS,color:t.v2.colors.white[500],nowrap:!0,children:Me})})})},Dr=({scopes:a,titleNumber:r,title:l,subTitle:n,icon:i,bgTint:s="900",entireClusterWarningMessage:c})=>{const d=l??Rr(r),p={icon:i,title:d,subTitle:n,alignItems:n||i?"flex-start":void 0};if(da(a))return e(se,{bgTint:s,richTitle:p,withCollapse:!0,collapseIsDefaultOpen:!0,children:t(A,{$gap:8,children:[e(ce,{status:pe.Default,message:de,fullWidth:!0}),c&&e(ce,{status:pe.Warning,message:c,fullWidth:!0,smallIcon:!0})]})});const u=a.sources??[],h=a.namespaces??[],g=a.languages??[],m=[];u.length&&m.push({kind:"sources",node:e(Xr,{title:ue,count:u.length,children:u.map((t,a)=>{const r=[t.namespace,t.kind,t.name].filter(Boolean),l=r.length?r.join(" / "):ge;return e(he,{label:l},`src-${a}-${l}`)})})}),h.length&&m.push({kind:"namespaces",node:e(Xr,{title:me,count:h.length,children:h.map((t,a)=>e(he,{label:t},`ns-${a}-${t}`))})}),g.length&&m.push({kind:"languages",node:e(Xr,{title:ve,count:g.length,children:g.map((t,a)=>{const r=ye(t);return e(he,{label:Ir(t),leftIcon:r},`lang-${a}-${t}`)})})});const v=n??(m.length>1?fe:void 0);return e(se,{bgTint:s,richTitle:{icon:i,title:d,subTitle:v,alignItems:v||i?"flex-start":void 0},withCollapse:!0,collapseIsDefaultOpen:!0,children:e(se,{bgTint:"800",children:e(Mr,{children:m.map((a,r)=>t(o.Fragment,{children:[r>0&&e(zr,{}),a.node]},a.kind))})})})},_r=(e,t="all")=>e.sources.length>0?"source":e.namespaces.length>0?"namespace":e.languages.length>0?"language":t,Hr=({scopes:r,onChange:l,sourceOptions:n=[],namespaceOptions:i=[],supportedLanguages:o,titleNumber:c,title:u,subTitle:g,icon:m,dataIdPrefix:v="source-scope",slim:f,disabled:b,hideLogicNote:y,hideEntireClusterNote:x,entireClusterWarningMessage:$,defaultScopeTab:C="all"})=>{const k=r??pa(),[S,w]=p(()=>_r(k,C)),{sources:T,namespaces:M,languages:L}=k,P=T.length>0||M.length>0||L.length>0;h(()=>{P&&"all"===S&&w(_r(k,C))},[C,P,S,k]);const I=s(()=>Nr.map(e=>"language"===e.value&&0===o?.length?null:{...e,disabled:"all"===e.value&&P}).filter(Boolean),[P]),R=s(()=>T.map(e=>`${e.namespace}/${e.kind}/${e.name}`),[T]),V=s(()=>[...M],[M]),X=s(()=>new Set(L),[L]),z=d(e=>{w(e)},[]),D=d(e=>{const t=e.map(e=>(e=>{const t=e.split("/");return 3!==t.length?null:{namespace:t[0],kind:t[1],name:t[2]}})(e)).filter(e=>null!=e).map(e=>({namespace:e.namespace,kind:e.kind,name:e.name}));l({...k,sources:t})},[k,l]),_=d(e=>{l({...k,namespaces:e})},[k,l]),H=d(e=>{const t=k.languages,a=t.includes(e)?t.filter(t=>t!==e):[...t,e];l({...k,languages:a})},[k,l]),B=!P&&"all"===S,j=(o||Er).map(e=>({id:e,label:Or[e]??e.charAt(0).toUpperCase()+e.slice(1),Icon:ye(e)})),F=u??Rr(c),q=g??$e;return e(xe,{richTitle:f?{icon:m,title:F,titleSize:N.XS,titleColor:E.Secondary,tooltip:q,alignItems:m?"flex-start":void 0}:{icon:m,title:F,subTitle:q,subTitleWrap:!0,alignItems:m||q?"flex-start":void 0},backgroundColor:f?"transparent":void 0,padding:f?0:void 0,children:t(A,{$gap:16,children:[B?t(a,{children:[!x&&e(ce,{status:pe.Default,message:de,fullWidth:!0,smallIcon:!0}),$&&e(ce,{status:pe.Warning,message:$,fullWidth:!0,smallIcon:!0})]}):!y&&e(ce,{status:pe.Info,message:fe,fullWidth:!0,smallIcon:!0}),e(A,{$alignItems:"flex-start",children:e(Ce,{options:I,selected:S,setSelected:z,disabled:b})}),"source"===S&&e(ke,{multiple:!0,"data-id":`${v}-autocomplete-source`,options:n,value:R,onSelect:D,placeholder:Se,disabled:b}),"namespace"===S&&e(ke,{multiple:!0,"data-id":`${v}-autocomplete-namespace`,options:i,value:V,onSelect:_,placeholder:"Search namespace",disabled:b}),"language"===S&&j.length>0&&e(Sr,{children:j.map(({id:a,label:r,Icon:l})=>{const n=X.has(a);return t(wr,{$selected:n,onClick:()=>H(a),children:[e(ee,{name:`${v}-lang-${a}`,size:we.S,value:n,onChange:()=>H(a),disabled:b}),e(Tr,{children:e(l,{size:20})}),e(O,{size:N.XS,nowrap:!0,children:r})]},a)})})]})})},Br=e=>{if(null!=e){if(!Array.isArray(e)&&"object"==typeof e)return Object.entries(e).map(([e,t])=>({id:e,label:null==t?e:String(t)}));if(Array.isArray(e))return e.map(e=>"string"==typeof e?{id:e,label:e}:e)}},jr=e=>{if(!Array.isArray(e)||e.length<3)return;const[t,a,r]=e;return e=>{const l=null==e?.[t]?"":String(e[t]);switch(a){case"=":case"==":case"===":return l===r;case"!=":case"!==":return l!==r;default:return!0}}},Fr=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:Br(t.options??t.values),fullRow:t.fullRow,defaultValue:t.defaultValue,withRegexTester:t.withRegexTester,separator:t.separator,copyByColumn:t.copyByColumn,renderCondition:jr(t.renderCondition)}})},qr=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(Ur):void 0}})},Ur=e=>{const t="string"==typeof e.componentProperties?le(e.componentProperties,{}):e.componentProps||{};return{name:e.name,componentType:e.componentType,inputType:e.inputType??t.inputType??t.type,title:e.displayName,tooltip:t.tooltip,placeholder:t.placeholder,helpMessage:t.helpMessage,required:t.required,initialValue:e.initialValue,renderCondition:e.renderCondition,options:Br(t.options??t.values),itemWrapperKey:t.itemWrapperKey,columns:Fr(t.columns),limitFieldsPerRow:t.limitFieldsPerRow,variant:t.variant,wrapKey:t.wrapKey,checkboxOptions:qr(t.options??t.values),checkedValue:t.checkedValue??"true",valueMode:t.valueMode??"object",fields:Array.isArray(t.fields)?t.fields.map(Ur):void 0,addLabel:t.addLabel,itemLabel:t.itemLabel,keyLabel:t.titleKey??t.keyLabel,valueLabel:t.titleValue??t.valueLabel,persistAs:t.persistAs}},Gr=e=>{const t=e.initialValue;if(void 0!==t&&""!==t)return e.componentType===K.CheckboxList?"array"===e.valueMode?le(t,[]):le(t,{}):e.componentType!==K.MultiInput&&e.componentType!==K.MultiTabledInput||!e.wrapKey?e.componentType===K.MultiInput||e.componentType===K.MultiTabledInput?le(t,[]):e.componentType===K.SourceScopes?"null"===t||"{}"===t?pa():ha(le(t,null)):e.componentType===K.Toggle||e.componentType===K.Checkbox?"true"===t:t:{[e.wrapKey]:le(t,[])}},Wr=e=>"object"==typeof e&&null!==e&&!Array.isArray(e),Kr=e=>Array.isArray(e)?e:[],Yr=e=>{const t={};return e.forEach(e=>{t[String(e.key??"")]=String(e.value??"")}),t},Zr=e=>Wr(e)?Object.entries(e).map(([e,t])=>({key:e,value:String(t??"")})):[],Jr=({field:t,value:a,setValue:r,errorMessage:l,disabled:n})=>{const[i,o]=p(()=>Zr(a));return h(()=>{const e=Wr(a)?a:{};((e,t)=>{const a=Object.keys(e),r=Object.keys(t);return a.length===r.length&&a.every(a=>Object.prototype.hasOwnProperty.call(t,a)&&t[a]===e[a])})(Yr(i),e)||o(Zr(a))},[a]),e(re,{name:t.name,label:t.title,tooltip:t.tooltip,helpMessage:t.helpMessage,required:t.required,disabled:n,limitFieldsPerRow:2,columns:[{keyName:"key",label:t.keyLabel||"Key",placeholder:t.keyLabel||"Key"},{keyName:"value",label:t.valueLabel||"Value",placeholder:t.valueLabel||"Value"}],values:i,setValues:e=>{o(e),r(Yr(e))},errorMessage:l})},Qr=({field:r,value:l,setValue:n,errorMessage:i,disabled:o,keyValuePersistAs:s,sourceOptions:c,namespaceOptions:d})=>{const{name:u,componentType:h,inputType:g,title:m,tooltip:v,placeholder:f,helpMessage:b,required:y,initialValue:x,options:$,itemWrapperKey:C,columns:k,limitFieldsPerRow:S,variant:w,wrapKey:T,checkboxOptions:M}=r,[L,I]=p({open:!1,value:""});if(h===K.SourceScopes)return e(Vr,{scopes:ha(l),onChange:e=>n(e),sourceOptions:c,namespaceOptions:d,dataIdPrefix:`dynamic-field-${u}`,slim:!0});if(h===K.CheckboxList&&"array"===r.valueMode){const a=Kr(l),r=(e,t)=>n(t?[...a.filter(t=>t!==e),e]:a.filter(t=>t!==e));return t(A,{$gap:12,children:[m&&e(P,{label:m,tooltip:v,required:y}),e(A,{$gap:8,children:(M||[]).map(t=>{const l=e(ee,{name:t.id,label:t.label,value:a.includes(t.id),disabled:o,onChange:e=>r(t.id,e)},t.id);return t.tooltip?e(Oe,{text:t.tooltip,withIcon:!0,children:l},t.id):l})}),e(z,{errorMessage:i,helpMessage:b})]})}if(h===K.CheckboxList){const a=Wr(l)?l:{},c=(e=>"emptyObject"!==e.checkedValue||{})(r),d=e=>"emptyObject"===r.checkedValue?Wr(e):!!e;return t(A,{$gap:12,children:[m&&e(O,{size:N.XS,color:E.Secondary,nowrap:!0,children:m}),e(A,{$gap:12,children:(M||[]).map(r=>{const l=a[r.id],i=d(l),p=Wr(l)?l:{},h=e(ee,{label:r.label,value:i,disabled:o,onChange:e=>n({...a,[r.id]:e?Wr(l)?l:c:null})}),g=r.tooltip?e(Oe,{text:r.tooltip,withIcon:!0,children:h}):h,m=i&&r.fields?.length?e(A,{$gap:12,$padding:"0 0 0 24px",children:r.fields.map(t=>e(Qr,{field:t,value:p[t.name],setValue:e=>n({...a,[r.id]:{...p,[t.name]:e}}),disabled:o,keyValuePersistAs:s},`${u}-${r.id}-${t.name}`))}):null;return t(A,{$gap:12,children:[g,m]},r.id)})}),e(z,{errorMessage:i,helpMessage:b})]})}if(h===K.MultiTabledInput){const r=Kr(T?l?.[T]:l),s=e=>n(T?{...Wr(l)?l:{},[T]:e}:e),c=(k||[]).some(e=>e.withRegexTester);return t(a,{children:[e("cards"===w?Ee:re,{name:u,label:m,tooltip:v,helpMessage:b,required:y,disabled:o,columns:k||[],limitFieldsPerRow:S,values:r,setValues:s,errorMessage:i,onTestRegex:c?e=>I({open:!0,value:e}):void 0}),c&&e(Ha,{isOpen:L.open,regex:L.value,onClose:()=>I({open:!1,value:""})})]})}if(h===K.MultiInput&&T){const t=Kr(l?.[T]);return e(ne,{name:u,label:m,tooltip:v,helpMessage:b,required:y,disabled:o,placeholder:f,values:t,setValues:e=>n({...Wr(l)?l:{},[T]:e}),errorMessage:i})}if(h===K.MultiInput&&C){const t=Kr(l).map(e=>String(e?.[C]??""));return e(ne,{name:u,label:m,tooltip:v,helpMessage:b,required:y,disabled:o,placeholder:f,values:t,setValues:e=>n(e.map(e=>({[C]:e}))),errorMessage:i})}return h===K.KeyValuePair?"map"===(r.persistAs??s)?e(Jr,{field:r,value:l,setValue:n,errorMessage:i,disabled:o}):e(kr,{componentType:h,name:u,label:m,tooltip:v,helpMessage:b,disabled:o,required:y,errorMessage:i,keyLabel:r.keyLabel,valueLabel:r.valueLabel,value:l??[],setValue:n}):e(kr,{componentType:h,inputType:g,name:u,label:m,tooltip:v,helpMessage:b,disabled:o,required:y,placeholder:f,errorMessage:i,dropdownOptions:$,value:(null==l?x:l)??"",setValue:n})},el=({field:r,value:l,setValue:i,disabled:o,keyValuePersistAs:s,sourceOptions:c,namespaceOptions:d})=>{const p=n(),u=Kr(l),h=u.length?u:[{}],m=r.fields||[],v=e=>i(e);return t(a,{children:[h.map((a,l)=>t(g,{children:[e(Pe,{}),t(A,{$gap:12,children:[t(I,{$justifyContent:"space-between",$alignItems:"center",children:[e(P,{label:`${r.itemLabel||r.title||"Item"} ${l+1}`}),e(R,{leftIcon:()=>e(Kt,{fill:p.v2.colors.red[500]}),variant:X.Secondary,size:V.S,onClick:()=>(e=>{const t=h.filter((t,a)=>a!==e);v(t)})(l),disabled:o||1===h.length})]}),m.map(t=>e(Qr,{field:t,value:a[t.name],setValue:e=>((e,t,a)=>v(h.map((r,l)=>l===e?{...r,[t]:a}:r)))(l,t.name,e),disabled:o,keyValuePersistAs:s,sourceOptions:c,namespaceOptions:d},`${r.name}-group-${l}-${t.name}`))]})]},`${r.name}-group-${l}`)),e(R,{variant:X.Secondary,label:r.addLabel||"Add",leftIcon:Yt,onClick:()=>v([...h,{}]),disabled:o}),e(Pe,{})]})},tl=({field:a,value:r,setValue:l,errorMessage:n,disabled:i})=>t(A,{$gap:12,children:[a.title&&e(P,{label:a.title,tooltip:a.tooltip,required:a.required}),e(A,{$gap:8,children:(a.checkboxOptions||[]).map(t=>{const a=e(ee,{name:t.id,label:t.label,value:!0===r?.[t.id],disabled:i,onChange:e=>l(t.id,e)},t.id);return t.tooltip?e(Oe,{text:t.tooltip,withIcon:!0,children:a},t.id):a})}),e(z,{errorMessage:n,helpMessage:a.helpMessage})]}),al=({signals:t,fields:r,value:l,setValue:n,formErrors:i,disabled:o,seedInitialValues:s,keyValuePersistAs:c="map",sourceOptions:d,namespaceOptions:p})=>{const{isK8s:u}=ua(),g=(r||[]).filter(e=>!!e).map(e=>Ur(e));return h(()=>{if(!s)return;const e=l||{},t={};g.forEach(a=>{if(a.componentType===K.SourceScopes&&!u)return;const r=a.componentType===K.SourceScopes?Gr(a)??pa():Gr(a);if(void 0===r)return;if(a.componentType===K.CheckboxList&&"flatFields"===a.valueMode&&Wr(r))return void Object.entries(r).forEach(([a,r])=>{void 0!==e[a]&&null!==e[a]||(t[a]=r)});const l=e[a.name];if(a.componentType===K.SourceScopes){if(void 0!==l)return}else if(null!=l)return;t[a.name]=Wr(r)&&Wr(t[a.name])?{...t[a.name],...r}:r}),Object.entries(t).forEach(([e,t])=>n(e,t))},[]),e(a,{children:g.map((a,r)=>{const s=Object.entries(l||{}).map(([e,t])=>({name:e,key:e,value:t}));if(a.renderCondition&&!Ae(a.renderCondition,t,s))return null;if(a.componentType===K.SourceScopes&&!u)return null;const h=l?.[a.name],g=`${a.name}-${r}`;if(a.componentType===K.FieldGroup)return e(el,{field:a,value:h,setValue:e=>n(a.name,e),disabled:o,keyValuePersistAs:c,sourceOptions:d,namespaceOptions:p},g);if(a.componentType===K.CheckboxList&&"flatFields"===a.valueMode){const t=a.checkboxOptions?.map(e=>i[e.id]).find(Boolean);return e(tl,{field:a,value:l||{},setValue:n,errorMessage:t,disabled:o},g)}return e(Qr,{field:a,value:h,setValue:e=>n(a.name,e),errorMessage:i[a.name],disabled:o,keyValuePersistAs:c,sourceOptions:d,namespaceOptions:p},g)})})},rl=al,ll=({isEnabled:t,setIsEnabled:a,fieldDisabled:r})=>{const l=n();return e(Ce,{options:[{icon:Zt,label:"Enable",value:!0,selectedBgColor:l.v2.colors.green[1e3],selectedBorderColor:l.v2.colors.green[400],selectedTextColor:l.v2.colors.green[400]},{icon:Jt,label:"Disable",value:!1,selectedBgColor:l.v2.colors.red[1e3],selectedBorderColor:l.v2.colors.red[500],selectedTextColor:l.v2.colors.red[400]}],size:Ne.S,selected:t,setSelected:a,disabled:r})},nl=r.div`
|
|
227
|
+
display: flex;
|
|
228
|
+
align-items: center;
|
|
229
|
+
gap: 24px;
|
|
230
|
+
padding: 8px 16px;
|
|
231
|
+
border-radius: 12px;
|
|
232
|
+
background-color: ${({theme:e})=>e.v2.colors.silver[800]};
|
|
233
|
+
`,il=r.div`
|
|
234
|
+
flex: 1;
|
|
235
|
+
min-width: 0;
|
|
236
|
+
white-space: pre;
|
|
237
|
+
overflow-x: auto;
|
|
238
|
+
`,ol=({title:a,summary:r,onEdit:l,renderAction:n})=>{const i=s(()=>{const e=[];return a&&(e.push({text:a,variant:ga.Default}),e.push({text:" - ",variant:ga.Default})),e.push(...r),e},[a,r]);return t(nl,{children:[e(il,{children:e(ma,{parts:i})}),n&&n(),l&&e(R,{"data-id":"sampling-btn-edit-auto-rule",label:Ie,rightIcon:Qt,variant:X.Text,size:V.S,onClick:l})]})},sl={[Be.HttpRequest]:"HTTP request",[Be.HttpResponse]:"HTTP response",[Be.DbQuery]:"DB query",[Be.Messaging]:"messaging"};function cl(e,t,a){return 1===e?t:a??`${t}s`}function dl(e,t){const a=[],r=e.slice(0,3),l=e.slice(3);return r.forEach((e,r)=>{r>0&&a.push({text:", ",variant:ga.Default}),a.push({text:e,variant:t})}),l.length>0&&a.push({text:` + ${l.length} more`,variant:ga.Default,tooltipItems:l}),a}const pl=({option:t,formState:a,renderAction:r})=>{const l=s(()=>{const e=function(e,t){switch(e){case Ve.CodeAttributes:return(e=>{const t=Object.values(je).filter(t=>!!e.codeAttributes?.[t]).map(e=>Fe(e).toLowerCase());return t.length?[{text:"Collect",variant:ga.Action},{text:" ",variant:ga.Default},...dl(t,ga.Endpoint)]:null})(t);case Ve.PayloadCollection:return(e=>{const t=Object.values(Be).filter(t=>null!=e.payloadCollection?.[t]).map(e=>sl[e]);return t.length?[{text:"Collect",variant:ga.Action},{text:" ",variant:ga.Default},...dl(t,ga.Endpoint)]:null})(t);case Ve.HeadersCollection:return(e=>{const t=(e.headersCollection?.[He.HeaderKeys]??[]).map(e=>e.trim()).filter(e=>e.length>0);if(!t.length)return null;const a=cl(t.length,"HTTP header");return[{text:`Collect ${t.length} ${a}`,variant:ga.Action},{text:"",variant:ga.Default,tooltipItems:t}]})(t);case Ve.CustomInstrumentation:return(e=>{const t=(e.customInstrumentations?.[Xe.Java]??[]).map(e=>new ze(e.className,e.methodName)).filter(e=>e.Verify()),a=(e.customInstrumentations?.[Xe.Golang]??[]).map(e=>new De(e.packageName,e.functionName,e.receiverName,e.receiverMethodName)).filter(e=>e.Verify()),r=(e.customInstrumentations?.[Xe.Php]??[]).map(e=>new _e(e.className,e.functionName)).filter(e=>e.Verify());if(!(t.length+a.length+r.length))return null;const l=[];t.length&&l.push(`${t.length} Java ${cl(t.length,"probe")}`),a.length&&l.push(`${a.length} Go ${cl(a.length,"probe")}`),r.length&&l.push(`${r.length} PHP ${cl(r.length,"probe")}`);const n=[...t.map(e=>`Java: ${e.toString()}`),...a.map(e=>`Go: ${e.toString()}`),...r.map(e=>`PHP: ${e.toString()}`)];return[{text:`Apply ${l.join(" + ")}`,variant:ga.Action},{text:"",variant:ga.Default,tooltipItems:n}]})(t);case Ve.NetworkMetrics:return[{text:"Collect",variant:ga.Action},{text:" ",variant:ga.Default},{text:"network flow and TCP stats metrics",variant:ga.Endpoint}];default:return null}}(t?.type,a);return e?[...e,...va(a.sourceScopes)]:[]},[t?.type,a]),n=0===l.length;return e(ol,{title:n?Re:"Instrumentation Rule Preview",summary:l,renderAction:r})},ul=({size:t=200,central:a=!1,useInline:r=!1})=>{const{tier:l}=ua();if(r){if(a)return e(ea,{size:t});switch(l){case qe.Community:return e(aa,{size:t});case qe.Onprem:return e(ta,{size:t});default:return null}}if(a)return e(ra,{size:t});switch(l){case qe.Community:return e(na,{size:t});case qe.Onprem:return e(la,{size:t});default:return null}},hl=[{value:"50",label:"50%"},{value:"25",label:"25%"},{value:"10",label:"10%"},{value:"1",label:"1%"},{value:"custom",label:"Custom"}],gl=[{value:"10",label:"10%"},{value:"1",label:"1%"},{value:"0.5",label:"0.5%"},{value:"0.1",label:"0.1%"},{value:"custom",label:"Custom"}],ml=[{value:"5000",label:"5s"},{value:"1000",label:"1s"},{value:"500",label:"500ms"},{value:"100",label:"100ms"},{value:"50",label:"50ms"},{value:"custom",label:"Custom"}],vl=({description:a,options:r,selected:l,onSelect:n,customName:i,customLabel:o,customPlaceholder:s,customValue:c,onCustomChange:d,customInputType:p=oe.Number,customMin:u,customMax:h})=>t(A,{$gap:6,children:[e(P,{label:a}),t(I,{$gap:8,$alignItems:"flex-end",children:[e(Ce,{options:r,selected:l,setSelected:n}),"custom"===l&&e(ie,{name:i,label:o,placeholder:s,type:p,value:c,onChange:d,width:160,min:u,max:h})]})]}),fl=()=>{},bl=t=>t.readOnly?e(yl,{rule:t.rule}):e(xl,{ruleType:t.ruleType,formState:t.formState,onChange:t.onChange}),yl=({rule:a})=>{const r=null!=a.durationAtLeastMs;return a.error?e(xe,{richTitle:{title:Ue},children:e(Y,{name:"sampling-view-toggle-keep-errors",onChange:fl,value:!0,size:J.S,label:Ge,labelAlign:Z.Right})}):r?e(xe,{richTitle:{title:We},children:t("div",{children:[e(O,{size:N.XXXS,color:E.Secondary,children:Ke}),e(O,{size:N.XS,children:`${a.durationAtLeastMs}ms`})]})}):null},xl=({ruleType:t,formState:a,onChange:r})=>{const l=d(e=>r({durationPreset:e}),[r]),n=d(e=>r({customDurationMs:e.target.value}),[r]);return"Duration"===t?e(xe,{richTitle:{title:We,subTitle:Ye},children:e(vl,{description:Ke,options:ml,selected:a.durationPreset,onSelect:l,customName:"sampling-input-custom-duration",customLabel:Ze,customPlaceholder:"200ms",customValue:a.customDurationMs,onCustomChange:n})}):null},$l=r.div`
|
|
239
|
+
display: flex;
|
|
240
|
+
gap: 32px;
|
|
241
|
+
`,Cl=r.div`
|
|
242
|
+
display: flex;
|
|
243
|
+
flex-direction: column;
|
|
244
|
+
gap: 4px;
|
|
245
|
+
`,kl=r.div`
|
|
246
|
+
display: flex;
|
|
247
|
+
flex-wrap: wrap;
|
|
248
|
+
align-items: flex-end;
|
|
249
|
+
gap: 16px;
|
|
250
|
+
`,Sl=r.div`
|
|
251
|
+
display: flex;
|
|
252
|
+
align-items: flex-end;
|
|
253
|
+
gap: 16px;
|
|
254
|
+
padding: 12px 16px;
|
|
255
|
+
border-radius: 8px;
|
|
256
|
+
background-color: ${({theme:e})=>e.v2.colors.black[500]};
|
|
257
|
+
`,wl=r.div`
|
|
258
|
+
display: flex;
|
|
259
|
+
align-items: flex-end;
|
|
260
|
+
gap: 10px;
|
|
261
|
+
flex: 1;
|
|
262
|
+
`,Tl=r.div`
|
|
263
|
+
display: flex;
|
|
264
|
+
align-items: center;
|
|
265
|
+
height: 32px;
|
|
266
|
+
`,Ml=r.div`
|
|
267
|
+
display: flex;
|
|
268
|
+
align-items: flex-end;
|
|
269
|
+
gap: 16px;
|
|
270
|
+
margin-bottom: 12px;
|
|
271
|
+
`,Ll="Any",Al="Kafka topic",Pl=()=>e("div",{style:{marginBottom:"8px"},children:e(O,{size:N.XS,weight:500,children:"And"})}),Ol=[{value:"all",label:"All Operations"},{value:"httpServer",label:"HTTP Server"},{value:"httpClient",label:"HTTP Client"}],El=[{value:"all",label:"All Operations"},{value:"httpServer",label:"HTTP Server"},{value:"kafkaConsumer",label:"Kafka Consumer"},{value:"kafkaProducer",label:"Kafka Producer"}],Nl=[{id:"",label:Ll},{id:"GET",label:"GET"},{id:"POST",label:"POST"},{id:"PUT",label:"PUT"},{id:"DELETE",label:"DELETE"},{id:"PATCH",label:"PATCH"}],Il=t=>t.readOnly?e(Rl,{data:t.data}):e(Vl,{category:t.category,formState:t.formState,onChange:t.onChange}),Rl=({data:a})=>{const r=s(()=>(e=>{if("noisy"===e.category){const t=e.rule.operation;if(t?.httpServer)return[{id:"type",title:ut,value:pt},{id:"route",title:nt,value:t.httpServer.route||t.httpServer.routePrefix||ht},{id:"method",title:ct,value:t.httpServer.method||Ll}];if(t?.httpClient){const e=[{id:"type",title:ut,value:gt}];return t.httpClient.serverAddress&&e.push({id:"serverAddress",title:"Server address",value:t.httpClient.serverAddress}),e.push({id:"route",title:nt,value:t.httpClient.templatedPath||t.httpClient.templatedPathPrefix||ht}),e.push({id:"method",title:ct,value:t.httpClient.method||Ll}),e}return[{id:"type",title:ut,value:mt}]}const t=e.rule.operation;return t?.httpServer?[{id:"type",title:ut,value:pt},{id:"route",title:nt,value:t.httpServer.route||t.httpServer.routePrefix||ht},{id:"method",title:ct,value:t.httpServer.method||Ll}]:t?.kafkaConsumer?[{id:"type",title:ut,value:vt},{id:"topic",title:Al,value:t.kafkaConsumer.kafkaTopic||ht}]:t?.kafkaProducer?[{id:"type",title:ut,value:ft},{id:"topic",title:Al,value:t.kafkaProducer.kafkaTopic||ht}]:[{id:"type",title:ut,value:mt}]})(a),[a]);return e(xe,{richTitle:{title:Je},children:e($l,{children:r.map(({id:a,title:r,value:l})=>t(Cl,{children:[e(O,{size:N.XXXS,color:E.Secondary,nowrap:!0,children:r}),e(O,{size:N.XS,nowrap:!0,children:l})]},a))})})},Vl=({category:a,formState:r,onChange:l})=>{const n=s(()=>"noisy"===a?Ol:El,[a]),i=d(e=>l({operationType:e,route:"",serverAddress:"",method:"",kafkaTopic:""}),[l]),o=d(e=>t=>{t&&l({routeType:e,route:""})},[l]),c=d(e=>l({route:e.target.value}),[l]),p=d(e=>l({serverAddress:e.target.value}),[l]),u=d(e=>l({method:e[0]||""}),[l]),h=d(e=>l({kafkaTopic:e.target.value}),[l]),g="httpServer"===r.operationType||"httpClient"===r.operationType,m="kafkaConsumer"===r.operationType||"kafkaProducer"===r.operationType,v="httpClient"===r.operationType?lt:nt,f="httpClient"===r.operationType?it:ot;return t(xe,{richTitle:{title:`2. ${Je}`,subTitle:Qe},children:[e(A,{$alignItems:"flex-start",children:e(Ce,{options:n,selected:r.operationType,setSelected:i})}),g&&t(kl,{children:["httpClient"===r.operationType&&t(Ml,{children:[e(ie,{name:"sampling-input-server-address",label:tt,placeholder:et,value:r.serverAddress,onChange:p}),e(Pl,{})]}),t(Sl,{children:[t(wl,{children:[e(Tl,{children:e(at,{"data-id":"sampling-radio-route",value:"route"===r.routeType,onChange:o("route")})}),e(ie,{name:"sampling-input-route",label:v,placeholder:rt,value:"route"===r.routeType?r.route:"",onChange:c,disabled:"route"!==r.routeType})]}),t(wl,{children:[e(Tl,{children:e(at,{"data-id":"sampling-radio-route-prefix",value:"routePrefix"===r.routeType,onChange:o("routePrefix")})}),e(ie,{name:"sampling-input-route-prefix",label:f,placeholder:rt,value:"routePrefix"===r.routeType?r.route:"",onChange:c,disabled:"routePrefix"!==r.routeType})]})]}),t(Ml,{children:[e(Pl,{}),e(st,{label:ct,items:Nl,selectedIds:[r.method||""],setSelectedIds:e=>u(e),buttonProps:{"data-id":"sampling-btn-method",label:Nl.find(e=>e.id===r.method)?.label||Ll,size:V.S,variant:X.Secondary}})]})]}),m&&e(ie,{name:"sampling-input-kafka-topic",label:dt,placeholder:"Type kafka topic",value:r.kafkaTopic,onChange:h,width:"320px"})]})},Xl=[{value:"all",label:"Drop All"},{value:"sample",label:"Sample"}],zl=[{value:"all",label:"Keep All"},{value:"sample",label:"Sample"}],Dl=t=>t.readOnly?e(_l,{data:t.data}):e(Hl,{category:t.category,formState:t.formState,onChange:t.onChange}),_l=({data:a})=>{const r=s(()=>(e=>{switch(e.category){case"highlyRelevant":return null!=e.rule.percentageAtLeast?{title:yt,method:Ct,description:xt,value:`${e.rule.percentageAtLeast}%`}:{title:yt,method:St,description:null,value:null};case"noisy":return fa(e.rule.percentageAtMost)?{title:yt,method:kt,description:null,value:null}:{title:yt,method:Ct,description:$t,value:`${e.rule.percentageAtMost}%`};case"costReduction":return{title:yt,method:Ct,description:$t,value:`${e.rule.percentageAtMost}%`}}})(a),[a]),l=[{id:"method",title:ct,value:r.method},...null!=r.description?[{id:"value",title:r.description,value:r.value}]:[]];return e(xe,{richTitle:{title:r.title},children:e($l,{children:l.map(({id:a,title:r,value:l})=>t(Cl,{children:[e(O,{size:N.XXXS,color:E.Secondary,nowrap:!0,children:r}),e(O,{size:N.XS,nowrap:!0,children:l})]},a))})})},Hl=({category:a,formState:r,onChange:l})=>{const n="highlyRelevant"===a,i=n?zl:Xl,o=`${n?4:3}. ${yt}`,s=bt[a],c=n?xt:$t,p="noisy"===a?gl:hl,u=d(e=>l({percentageMode:e}),[l]),h=d(e=>l({percentagePreset:e}),[l]),g=d(e=>l({customPercentage:e.target.value}),[l]);return t(xe,{richTitle:{title:o,subTitle:s},children:["costReduction"!==a&&e(A,{$alignItems:"flex-start",children:e(Ce,{options:i,selected:r.percentageMode,setSelected:u})}),("costReduction"===a||"sample"===r.percentageMode)&&e(vl,{description:c,options:p,selected:r.percentagePreset,onSelect:h,customName:"sampling-input-custom-percentage",customPlaceholder:"5%",customValue:r.customPercentage,onCustomChange:g,customInputType:oe.Decimal,customMin:0,customMax:100})]})},Bl=r.div`
|
|
272
|
+
display: flex;
|
|
273
|
+
align-items: flex-end;
|
|
274
|
+
gap: 16px;
|
|
275
|
+
`,jl=r.div`
|
|
276
|
+
width: 280px;
|
|
277
|
+
flex-shrink: 0;
|
|
278
|
+
`,Fl=r.div`
|
|
279
|
+
flex: 1;
|
|
280
|
+
min-width: 0;
|
|
281
|
+
`;function ql(e){return"highlyRelevant"===e.category?e.rule.error?"Error":null!=e.rule.durationAtLeastMs?"Duration":"Relevance":Et[e.category]}const Ul=t=>t.readOnly?e(Gl,{data:t.data}):e(Wl,{formState:t.formState,onChange:t.onChange}),Gl=({data:a})=>{const r=s(()=>[{id:"name",title:Tt,value:a.rule.name||wt},{id:"type",title:Mt,value:ql(a)}],[a]),l=a.rule.notes||ht;return t(xe,{children:[e($l,{children:r.map(({id:a,title:r,value:l})=>t(Cl,{children:[e(O,{size:N.XXXS,color:E.Secondary,nowrap:!0,children:r}),e(O,{size:N.XS,nowrap:!0,children:l})]},a))}),t(Cl,{children:[e(O,{size:N.XXXS,color:E.Secondary,children:Lt}),e(O,{size:N.XS,children:l})]})]})},Wl=({formState:a,onChange:r})=>{const l=d(e=>r({name:e.target.value}),[r]),n=d(e=>r({notes:e.target.value}),[r]);return e(xe,{children:t(Bl,{children:[e(jl,{children:e(ie,{name:"sampling-input-rule-name",label:Tt,tooltip:"Optional. Give this rule a name for easier identification.",placeholder:At,value:a.name,onChange:l})}),e(Fl,{children:e(ie,{name:"sampling-input-note",label:Lt,tooltip:Ot,placeholder:Pt,value:a.notes,onChange:n})})]})})},Kl=[{value:"Relevance",label:"Relevance"},{value:"Error",label:"Error"},{value:"Duration",label:"Duration"}],Yl=({formState:t,onChange:a})=>{const r=d(e=>a({ruleType:e,keepErrors:"Error"===e}),[a]);return e(xe,{richTitle:{title:`3. ${Mt}`,subTitle:Nt},children:e(A,{$alignItems:"flex-start",children:e(Ce,{options:Kl,selected:t.ruleType,setSelected:r})})})},Zl=t=>{const a=s(()=>{if(t.readOnly)return t.summary;switch(t.category){case"noisy":return xa(ka(t.formState));case"highlyRelevant":return ya(Ca(t.formState));case"costReduction":return ba($a(t.formState))}},[t]);if(t.readOnly)return e(ol,{title:It,summary:a,renderAction:t.renderAction});const r=1===a.length&&"default"===a[0].variant;return e(ol,{title:r?Re:It,summary:r?[]:a,renderAction:t.renderAction})},Jl=(e,t)=>!t?.length||!!t?.find(t=>t===e),Ql=({title:a="Signals",required:r,errorMessage:l,allowedSignals:n,selectedSignals:i,setSelectedSignals:o,disabled:s})=>{const[d,u]=p(1===i.length),g=c(JSON.stringify(i));return h(()=>{let e=Rt(i).filter(e=>Jl(e,n));e.length||(e=Vt.filter(({id:e})=>Jl(e,n)).map(({id:e})=>e));const t=JSON.stringify(e);g.current!==t&&(g.current=t,o(e),u(1===e.length))},[n,i]),t(A,{$gap:12,children:[e(P,{label:a,required:r}),e(I,{$gap:12,children:Vt.map(t=>{const a=Jl(t.id,n),r=((e,t)=>!!t?.find(t=>t===e))(t.id,i);return a?e(ee,{label:t.value,disabled:s||!a||d&&r,value:r,onChange:e=>((e,t)=>{const a=e,r=t?[...i,a]:i.filter(e=>e!==a);o(r),u(1===r.length)})(t.id,e)},t.id):null})}),e(z,{errorMessage:l})]})},en=({minSupportedVersion:t,currentVersion:a})=>e(q,{isOpen:!0,onClose:()=>{},relativeToParent:!0,visual:()=>e(W,{scale:2.4,icon:()=>e("svg",{xmlns:"http://www.w3.org/2000/svg",width:"22",height:"21",viewBox:"0 0 22 21",fill:"none",children:e("path",{fill:"#151618",d:"M9.4844 0.730003C9.99694 -0.243259 11.4076 -0.24341 11.92 0.730003L11.9685 0.831353L14.3039 6.22012L20.153 6.77755C21.3553 6.89211 21.841 8.38683 20.9358 9.18621L16.5314 13.0731L17.8091 18.8079C18.0716 19.9868 16.8005 20.9109 15.7605 20.2969L10.7017 17.3093L5.64282 20.2969C4.60289 20.9104 3.33173 19.9866 3.59427 18.8079L4.87192 13.0741L0.468608 9.18621C-0.43662 8.38693 0.0482932 6.8924 1.25029 6.77755L7.09837 6.22012L9.43588 0.831353L9.4844 0.730003ZM8.55284 7.02876C8.35287 7.48992 7.9179 7.80589 7.41751 7.85357L2.03952 8.36571L6.09027 11.941C6.46691 12.2737 6.63296 12.7852 6.5237 13.2758L5.34956 18.5459L10.0008 15.8009L10.1669 15.7179C10.5087 15.574 10.8945 15.5741 11.2364 15.7179L11.4036 15.8009L16.0538 18.5459L14.8807 13.2758C14.7714 12.7851 14.9374 12.2737 15.3141 11.941L19.3627 8.36571L13.9858 7.85357C13.4855 7.80587 13.0505 7.4899 12.8505 7.02876L10.7017 2.07342L8.55284 7.02876Z"})})}),title:G.UPGRADE_REQUIRED,description:`${G.UPGRADE_TO_USE_FEATURE(t)}\n${G.CURRENT_VERSION(a)}`}),tn=r.div`
|
|
282
|
+
display: flex;
|
|
283
|
+
flex-direction: column;
|
|
284
|
+
justify-content: flex-end;
|
|
285
|
+
width: ${({$width:e})=>e};
|
|
286
|
+
gap: ${({$columnHasHeader:e})=>e?"0":"12px"};
|
|
287
|
+
`,an=r.div`
|
|
288
|
+
display: flex;
|
|
289
|
+
align-items: center;
|
|
290
|
+
min-height: 24px;
|
|
291
|
+
padding: 12px;
|
|
292
|
+
border-radius: 16px 16px 0 0;
|
|
293
|
+
background-color: ${({theme:e})=>e.v2.colors.silver[800]};
|
|
294
|
+
`,rn=r.div`
|
|
295
|
+
display: flex;
|
|
296
|
+
flex-direction: column;
|
|
297
|
+
gap: ${({$gap:e})=>e}px;
|
|
298
|
+
padding: 12px 12px 0 12px;
|
|
299
|
+
width: 100%;
|
|
300
|
+
height: ${({$heightOffset:e,$columnHasHeader:t})=>`calc(100vh - 180px - ${e}px ${t?"- 48px":""})`};
|
|
301
|
+
border-radius: ${({$columnHasHeader:e,$isLeft:t,$isRight:a})=>e?t?"0 0 0 16px":a?"0 16px 0 0":"0":t?"16px 0 0 16px":a?"0 16px 16px 0":"16px"};
|
|
302
|
+
background-color: ${({theme:e})=>e.v2.colors.silver[900]};
|
|
303
|
+
overflow-y: auto;
|
|
304
|
+
overflow-x: hidden;
|
|
305
|
+
`,ln=({isLeft:r,isRight:l,heightOffset:n=0,width:i,header:o,list:s})=>t(tn,{$width:i,$columnHasHeader:!!o,children:[o&&e(an,{children:o}),e(rn,{$gap:8,$isLeft:r,$isRight:l,$heightOffset:n,$columnHasHeader:!!o,children:s.length?s.length>1?e(Xt,{gap:8,elements:s}):e(a,{children:s[0]}):e(B,{$height:"100%",children:e(j,{})})})]}),nn="75vw",on=r.div`
|
|
306
|
+
display: flex;
|
|
307
|
+
flex-direction: column;
|
|
308
|
+
border-radius: 16px;
|
|
309
|
+
background-color: ${({theme:e})=>e.v2.colors.silver[1e3]};
|
|
310
|
+
overflow: hidden;
|
|
311
|
+
`,sn=r.div`
|
|
312
|
+
display: flex;
|
|
313
|
+
gap: 12px;
|
|
314
|
+
padding: 16px 16px 0 16px;
|
|
315
|
+
background-color: ${({theme:e})=>e.v2.colors.silver[1e3]};
|
|
316
|
+
position: sticky;
|
|
317
|
+
top: 0;
|
|
318
|
+
`,cn=r.div`
|
|
319
|
+
padding: 12px 12px 0 12px;
|
|
320
|
+
`,dn=r.div`
|
|
321
|
+
display: flex;
|
|
322
|
+
gap: 12px;
|
|
323
|
+
padding: 16px;
|
|
324
|
+
`,pn=r.div`
|
|
325
|
+
padding: 5vh 10vw;
|
|
326
|
+
border-radius: 12px;
|
|
327
|
+
background-color: ${({theme:e})=>e.v2.colors.silver[800]};
|
|
328
|
+
`,un=m(({isOpen:a,withOverlay:r,disableAnimation:l,onClose:n,onBack:i,onNext:o,nextIsSkip:c,onSave:u,disableSave:h,connectionIds:g,header:m,subHeader:f,leftColumn:b,rightColumn:y,search:x,filters:$,errorMessage:C,isFormDirty:k,allowSaveWhenPristine:S,hideDirtyNote:w,forcedNote:T,isFetching:L,progress:A},P)=>{const[O,E]=p(!1),[I,R]=p(!1),[V,z]=p(void 0);v(P,()=>({clearErrors:()=>z(void 0)}));const D=I,_=d(()=>{k&&!O?E(!0):(E(!1),n?.())},[k,O,n]),H=h||I||!S&&"boolean"==typeof k&&!k,j=d(async()=>{R(!0);const e=await u();R(!1),!1!==e&&(e?.error?z(e.error):(g?.setValue([]),n?.()))},[u,g,n]),F=!!x||!!g||!!$,U=!!f,G=(F?48:0)+(U?50:0),W=s(()=>T||(L?{status:pe.Info,message:"Fetching Data..."}:I&&!A?{status:pe.Info,message:"Saving Changes..."}:V||C?{status:pe.Error,message:V||C}:"boolean"!=typeof k||w?void 0:k?{status:pe.Info,message:'The values don\'t reflect the current configurations of the selected clusters.\n"Save" will override the current configurations.'}:{status:pe.Success,message:"The values reflect the current configuration of the selected cluster."}),[L,I,A,V,C,k,w,T]),K=s(()=>i?{label:"Back",leftIcon:ia,variant:X.Secondary,onClick:i}:{label:"Cancel",variant:X.Secondary,onClick:_,disabled:D},[i,_,D]),[Y,Z]=p(!1),J=s(()=>o?c?{"data-id":"wide-drawer-skip",label:"Skip",rightIcon:oa,variant:X.Secondary,onClick:()=>Z(!0)}:{"data-id":"wide-drawer-next",label:"Next",rightIcon:oa,variant:X.Primary,onClick:o}:{"data-id":"wide-drawer-save",label:"Save",variant:X.Primary,onClick:j,disabled:H},[o,c,j,H]);return t(M,{width:nn,isOpen:a,disableAnimation:l,hideOverlay:!I&&!r,header:{...m,onClose:n?_:void 0,onCloseDisabled:D},footer:{note:W,actions:[K,J]},children:[I?e(B,{$height:"calc(100vh - 136px)",children:e(pn,{children:e(zt,{titleSize:N.S,subTitleSize:N.XXXS,withGradient:!0,withSpinner:!0,...A})})}):t(on,{children:[F&&t(sn,{children:[g&&e(Dt,{icon:Zt,title:"Selected Clusters",badge:{label:g.value.length}}),x&&e(_t,{...x,width:x.width??"100%"}),$]}),U&&e(cn,{children:e(Dt,{icon:f.icon,title:f.title,subTitle:f.description,badge:f.badge})}),t(dn,{children:[e(ln,{isLeft:!0,heightOffset:G,...b}),e(ln,{isRight:!0,heightOffset:G,...y})]})]}),e(xr,{isOpen:O,onClose:()=>E(!1),onApprove:_}),e(q,{title:"Skip setup?",description:"Without completing setup, Odigos won't be able to collect and send your telemetry data. This may interrupt your data flow and limit the platform's ability to provide value.",isOpen:Y,onClose:()=>Z(!1),denyButton:{label:"Go Back",variant:X.Secondary,onClick:()=>Z(!1)},approveButton:{label:"Skip",variant:X.Primary,onClick:()=>{o?.(),Z(!1)}}})]})});un.displayName=un.name;const hn=r.div`
|
|
329
|
+
padding: 0 24px;
|
|
330
|
+
border-radius: 12px;
|
|
331
|
+
background-color: ${({$codeBgColor:e})=>e||"transparent"};
|
|
332
|
+
`,gn=r.div`
|
|
333
|
+
display: flex;
|
|
334
|
+
flex-direction: column;
|
|
335
|
+
gap: 8px;
|
|
336
|
+
width: 100%;
|
|
337
|
+
padding: 8px;
|
|
338
|
+
border: 1px solid ${({theme:e})=>e.v2.colors.silver[700]};
|
|
339
|
+
border-radius: 12px;
|
|
340
|
+
background-color: ${({theme:e})=>e.v2.colors.silver[900]};
|
|
341
|
+
`,mn=r.div`
|
|
342
|
+
display: flex;
|
|
343
|
+
align-items: center;
|
|
344
|
+
gap: 4px;
|
|
345
|
+
width: 100%;
|
|
346
|
+
`,vn=r.div`
|
|
347
|
+
flex: 1;
|
|
348
|
+
min-width: 0;
|
|
349
|
+
`,fn=r.div`
|
|
350
|
+
width: 100%;
|
|
351
|
+
max-height: 180px;
|
|
352
|
+
overflow: auto;
|
|
353
|
+
padding: 0 12px;
|
|
354
|
+
|
|
355
|
+
pre {
|
|
356
|
+
margin: 0;
|
|
357
|
+
}
|
|
358
|
+
`,bn=({title:a="YAML",yaml:r,defaultOpen:l,fullHeight:n,bgTint:i="1000",codeBgColor:o,compact:c})=>{const{clickCopy:d,isCopied:p,CopyButton:u}=Ht(),h=s(()=>r?[{id:jt(),type:Bt.Button,buttonProps:{variant:X.Text,size:V.S,leftIcon:p?Wt:sa,onClick:()=>d(r||""),disabled:p}}]:[],[r,p]);return c?t(gn,{children:[t(mn,{children:[e(ca,{size:16}),e(vn,{children:e(O,{size:N.XXS,color:E.Primary,children:a})}),r&&e(u,{value:r})]}),r?e(fn,{children:e(Ft,{code:r,language:"yaml",theme:"duotoneDark"})}):e(j,{title:"YAML not found",subTitle:"The YAML for this resource is not available"})]}):e(se,{bgTint:i,richTitle:{icon:ca,title:a},actions:h,withCollapse:!0,collapseIsDefaultOpen:l,fullHeight:n,children:e(hn,{$codeBgColor:o,children:r?e(Ft,{code:r,language:"yaml",theme:"duotoneDark"}):e(B,{children:e(j,{title:"YAML not found",subTitle:"The YAML for this resource is not available"})})})})};export{ja as A,yr as B,xr as C,Ka as D,ll as E,or as G,pl as I,gl as N,ul as O,hl as P,Ul as R,Zl as S,en as U,nn as W,bn as Y,ir as a,Ya as b,$r as c,ml as d,Cr as e,bl as f,rl as g,kr as h,al as i,er as j,tr as k,Il as l,Dl as m,vl as n,Yl as o,Ql as p,Vr as q,un as r,lr as s,ar as t,Ha as u,ol as v};
|