@odigos/ui-kit 0.0.226 → 0.0.228

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (44) hide show
  1. package/CHANGELOG.md +26 -0
  2. package/lib/chunks/index-DJZLguZq.js +3 -0
  3. package/lib/chunks/{index-BWi3du_1.js → index-hLSQkKAv.js} +9 -9
  4. package/lib/chunks/ui-components-B4xHrszQ.js +2659 -0
  5. package/lib/components/_v2/cards/data-card/index.d.ts +2 -1
  6. package/lib/components/_v2/charts/gauge-chart/index.d.ts +18 -0
  7. package/lib/components/_v2/charts/index.d.ts +1 -0
  8. package/lib/components/_v2/index.d.ts +2 -0
  9. package/lib/components/_v2/typography/index.d.ts +2 -2
  10. package/lib/components/_v2/typography-truncatable/index.d.ts +21 -0
  11. package/lib/components/v2.js +1 -1
  12. package/lib/components.js +1 -1
  13. package/lib/constants.js +1 -1
  14. package/lib/containers/_v2/_drawers/add-destination-drawer/helpers.d.ts +4 -3
  15. package/lib/containers/_v2/_drawers/add-destination-drawer/lists-column/index.d.ts +2 -3
  16. package/lib/containers/_v2/_drawers/edit-destination-drawer/helpers.d.ts +30 -3
  17. package/lib/containers/_v2/pipeline-collectors/enum.d.ts +4 -0
  18. package/lib/containers/_v2/pipeline-collectors/{helpers → general-info/helpers}/get-general-badge.d.ts +1 -1
  19. package/lib/containers/_v2/pipeline-collectors/general-info/helpers/get-general-gauge-cards.d.ts +4 -0
  20. package/lib/containers/_v2/pipeline-collectors/{helpers → general-info/helpers}/get-general-status-card.d.ts +1 -1
  21. package/lib/containers/_v2/pipeline-collectors/{helpers → general-info/helpers}/get-general-text-cards.d.ts +1 -1
  22. package/lib/containers/_v2/pipeline-collectors/{helpers → general-info/helpers}/get-general-title.d.ts +1 -1
  23. package/lib/containers/_v2/pipeline-collectors/{helpers → general-info/helpers}/index.d.ts +2 -1
  24. package/lib/containers/_v2/pipeline-collectors/general-info/index.d.ts +7 -6
  25. package/lib/containers/_v2/pipeline-collectors/index.d.ts +5 -0
  26. package/lib/containers/_v2/pipeline-collectors/toolbar/index.d.ts +1 -11
  27. package/lib/containers/source-drawer/index.d.ts +1 -0
  28. package/lib/containers/source-drawer/profiling/flamebearer.d.ts +5 -0
  29. package/lib/containers/v2.js +32 -45
  30. package/lib/containers.js +5 -5
  31. package/lib/contexts.js +1 -1
  32. package/lib/functions.js +1 -1
  33. package/lib/hooks.js +1 -1
  34. package/lib/snippets/_v2/yaml-section-card/index.d.ts +2 -0
  35. package/lib/snippets/v2.js +1 -1
  36. package/lib/snippets.js +1 -1
  37. package/lib/store.js +1 -1
  38. package/lib/theme.js +1 -1
  39. package/lib/types/common/index.d.ts +42 -0
  40. package/lib/types.js +1 -1
  41. package/lib/visuals.js +1 -1
  42. package/package.json +1 -1
  43. package/lib/chunks/index-BYYemmZD.js +0 -3
  44. package/lib/chunks/ui-components-B4LvruCJ.js +0 -2620
package/CHANGELOG.md CHANGED
@@ -1,5 +1,31 @@
1
1
  # Changelog
2
2
 
3
+ ## [0.0.228](https://github.com/odigos-io/ui-kit/compare/ui-kit-v0.0.227...ui-kit-v0.0.228) (2026-05-04)
4
+
5
+
6
+ ### Features
7
+
8
+ * **source-drawer:** add profilingEnabled prop and hide profiling tab in accordance ([#847](https://github.com/odigos-io/ui-kit/issues/847)) ([788daec](https://github.com/odigos-io/ui-kit/commit/788daeca699085f4a8f549e7b527077f01bd1982))
9
+
10
+
11
+ ### Bug Fixes
12
+
13
+ * bug list in new v2 drawers ([#843](https://github.com/odigos-io/ui-kit/issues/843)) ([6a86b43](https://github.com/odigos-io/ui-kit/commit/6a86b43fa5e36be602f041853939a206bbcf3909))
14
+
15
+ ## [0.0.227](https://github.com/odigos-io/ui-kit/compare/ui-kit-v0.0.226...ui-kit-v0.0.227) (2026-05-03)
16
+
17
+
18
+ ### Features
19
+
20
+ * **profling:** minor improvements to the Source Drawer Profiling tab ([#835](https://github.com/odigos-io/ui-kit/issues/835)) ([6606137](https://github.com/odigos-io/ui-kit/commit/6606137233a79262173b90cbd0f1aea372eb4a21))
21
+
22
+
23
+ ### Bug Fixes
24
+
25
+ * close rollout warning-modal after restarting workloads in MultiSourceControl ([#837](https://github.com/odigos-io/ui-kit/issues/837)) ([6063194](https://github.com/odigos-io/ui-kit/commit/60631944e6e9628b2879bbb7caffb8ec939ee016))
26
+ * **pipeline-collectors:** design based on feedback ([#831](https://github.com/odigos-io/ui-kit/issues/831)) ([0ca640e](https://github.com/odigos-io/ui-kit/commit/0ca640e5f5553ee4ec6cce112353b249c540d820))
27
+ * **settings:** add missing fields to EffectiveConfig query ([#840](https://github.com/odigos-io/ui-kit/issues/840)) ([300aca0](https://github.com/odigos-io/ui-kit/commit/300aca069ea12c55b701ddcefd6d6709932e4009))
28
+
3
29
  ## [0.0.226](https://github.com/odigos-io/ui-kit/compare/ui-kit-v0.0.225...ui-kit-v0.0.226) (2026-04-30)
4
30
 
5
31
 
@@ -0,0 +1,3 @@
1
+ import{jsx as t}from"react/jsx-runtime";import{useMemo as e}from"react";import i from"styled-components";import{u as o,B as s,a,A as n,g as l,D as r,C as c,b as p,N as m}from"./ui-components-B4xHrszQ.js";import{VIcon as d,CopyIcon as u,YamlIcon as f}from"../icons.js";const h=i.div`
2
+ padding: 0 12px;
3
+ `,g=({title:i="YAML",yaml:g,defaultOpen:b,fullHeight:T,bgTint:y="1000"})=>{const{clickCopy:C,isCopied:x}=o(),A=e(()=>g?[{id:l(),type:n.Button,buttonProps:{variant:a.Text,size:s.S,leftIcon:x?d:u,onClick:()=>C(g||""),disabled:x}}]:[],[g,x]);return t(r,{bgTint:y,richTitle:{icon:f,title:i},actions:A,withCollapse:!0,collapseIsDefaultOpen:b,fullHeight:T,children:t(h,{children:g?t(c,{code:g,language:"yaml",theme:"duotoneDark"}):t(p,{children:t(m,{title:"YAML not found",subTitle:"The YAML for this resource is not available"})})})})};export{g as Y};
@@ -1,16 +1,16 @@
1
- import{c6 as e,o as a,T as l,k as t,e9 as r,e as s,al as o,w as i,j as n,ao as d,l as c,I as p,h as u,ar as h,av as g,m,F as v,d as f,v as b,am as y,S as x,ea as S,eb as w,aw as C,ec as k,r as T,ed as $,s as L,ee as P,ef as A,eg as M,eh as O,ei as N,ej as z,ek as D,el as R,em as X,en as I,eo as E,ep as H,eq as V,bj as K,a as j,B as U,er as q,es as G,et as J,eu as B,ev as F,ew as W,ex as Z,ey as Y,ez as _,a7 as Q,a3 as ee,eA as ae,eB as le,aa as te,a6 as re,eC as se,eD as oe,eE as ie,eF as ne,b2 as de,eG as ce,eH as pe,eI as ue,eJ as he,eK as ge,eL as me,eM as ve,eN as fe,bG as be,n as ye,eO as xe,eP as Se,eQ as we,eR as Ce,eS as ke,eT as Te,eU as $e,eV as Le,eW as Pe,eX as Ae,z as Me,eY as Oe,E as Ne,eZ as ze,e_ as De,e$ as Re,f0 as Xe,f1 as Ie,dO as Ee,_ as He,an as Ve,dm as Ke,f as je,f2 as Ue,d7 as qe,b as Ge,N as Je,aH as Be,ai as Fe,bA as We,dP as Ze}from"./ui-components-B4LvruCJ.js";import{jsx as Ye,jsxs as _e,Fragment as Qe}from"react/jsx-runtime";import{OdigosLogoTextEnterprise as ea,OdigosLogoTextCommunity as aa,EditIcon as la,ArrowLeftIcon as ta,ArrowRightIcon as ra,VSquareIcon as sa}from"../icons.js";import{useCallback as oa,useMemo as ia,useState as na,useRef as da,useEffect as ca,forwardRef as pa,useImperativeHandle as ua}from"react";import ha,{useTheme as ga}from"styled-components";import"./index-BYYemmZD.js";const ma=({isOpen:a,onClose:l,onDeny:t,onApprove:r})=>Ye(e,{title:"Discard changes?",description:"You have unsaved changes.\nIf you cancel now, your changes won't be saved.",isOpen:a,onClose:l,onDeny:t,denyLabel:"Keep editing",onApprove:r,approveLabel:"Discard changes"}),va=({isOpen:a,onClose:l,onDeny:t,onApprove:r,action:s="delete",target:o})=>{const i=s.charAt(0).toUpperCase()+s.substring(1),n=o?.endsWith("s")?"these":"this";return Ye(e,{title:`${i}${o?` ${o}`:""}?`,description:`Are you sure you want to ${s}${o?` ${n} ${o}`:""}?`,isOpen:a,onClose:l,onDeny:t,denyLabel:"Go back",onApprove:r,approveLabel:i})},fa=({componentType:e,inputType:h,name:g,label:m,tooltip:v,badge:f,placeholder:b,required:y,disabled:x,value:S,setValue:w,errorMessage:C,warnMessage:k,helpMessage:T,dropdownOptions:$,dropdownNoSearch:L,dropdownNoCheckbox:P,timeUnits:A,timeDefaultUnit:M})=>{switch(e){case a.Input:return Ye(p,{name:g,type:h,label:m,tooltip:v,badge:f,placeholder:b,required:y,disabled:x,value:S??"",onChange:e=>{const a=e.target.value;w(h===u.Number?""===a?null:Number(a):a)},errorMessage:C,warnMessage:k,helpMessage:T},g);case a.MultiInput:return Ye(c,{name:g,label:m,tooltip:v,badge:f,placeholder:b,required:y,disabled:x,values:Array.isArray(S)?S:d(S,[]),setValues:e=>w(e),errorMessage:C,warnMessage:k,helpMessage:T},g);case a.KeyValuePair:return Ye(n,{name:g,label:m,tooltip:v,badge:f,required:y,disabled:x,limitFieldsPerRow:2,columns:[{keyName:"key",label:"Key"},{keyName:"value",label:"Value"}],values:Array.isArray(S)?S:d(S,[]),setValues:e=>w(e),errorMessage:C,warnMessage:k,helpMessage:T},g);case a.TextArea:return Ye(i,{name:g,label:m,tooltip:v,badge:f,required:y,disabled:x,placeholder:b,value:S??"",onChange:e=>w(e.target.value),errorMessage:C,warnMessage:k,helpMessage:T},g);case a.Dropdown:return Ye(o,{name:g,label:m,tooltip:v,badge:f,placeholder:b,required:y,disabled:x,withSearch:!L,options:$?.map(e=>({id:e.id||"",label:e.value||"",withCheckbox:!P}))||[],values:S?[String(S)]:[],setValues:e=>w(e[0]),errorMessage:C,warnMessage:k,helpMessage:T},g);case a.Checkbox:return Ye(s,{name:g,label:m,tooltip:v,badge:f,value:!0===S||"true"===S,onChange:e=>w(e),disabled:x,errorMessage:C,warnMessage:k,helpMessage:T},g);case a.Time:return Ye(r,{name:g,label:m,tooltip:v,badge:f,placeholder:b,required:y,disabled:x,value:S??"",setValue:e=>w(e),units:A,defaultUnit:M,errorMessage:C,warnMessage:k,helpMessage:T},g);case a.Toggle:return Ye(l,{name:g,labelAlign:t.Right,label:m,tooltip:v,badge:f,value:!0===S||"true"===S,onChange:e=>w(e),disabled:x,errorMessage:C,warnMessage:k,helpMessage:T},g);default:return null}},ba=({size:e=200})=>{const{tier:a}=h();return a===g.Onprem?Ye(ea,{size:e}):Ye(aa,{size:e})},ya=[{value:"50",label:"50%"},{value:"25",label:"25%"},{value:"10",label:"10%"},{value:"1",label:"1%"},{value:"0",label:"0%"},{value:"custom",label:"Custom"}],xa=[{value:"10",label:"10%"},{value:"1",label:"1%"},{value:"0.5",label:"0.5%"},{value:"0.1",label:"0.1%"},{value:"0",label:"0%"},{value:"custom",label:"Custom"}],Sa=[{value:"5000",label:"5s"},{value:"1000",label:"1s"},{value:"500",label:"500ms"},{value:"100",label:"100ms"},{value:"50",label:"50ms"},{value:"custom",label:"Custom"}],wa=({description:e,options:a,selected:l,onSelect:t,customName:r,customLabel:s,customPlaceholder:o,customValue:i,onCustomChange:n})=>_e(m,{$gap:16,$alignItems:"flex-end",children:[_e(v,{$gap:6,children:[Ye(f,{label:e}),Ye(b,{size:y.S,options:a,selected:l,setSelected:t})]}),"custom"===l&&Ye(p,{name:r,label:s,placeholder:o,type:u.Number,value:i,onChange:n,width:160})]}),Ca=()=>{},ka=e=>e.readOnly?Ye(Ta,{rule:e.rule}):Ye($a,{ruleType:e.ruleType,formState:e.formState,onChange:e.onChange}),Ta=({rule:e})=>{const a=ga(),r=null!=e.durationAtLeastMs;return e.error?Ye(x,{richTitle:{title:S},children:Ye(l,{name:"sampling-view-toggle-keep-errors",onChange:Ca,value:!0,size:C.S,label:w,labelAlign:t.Right})}):r?Ye(x,{richTitle:{title:k},children:_e("div",{children:[Ye(T,{size:L.XXXS,color:a.v2.colors.silver[200],children:$}),Ye(T,{size:L.XS,children:`${e.durationAtLeastMs}ms`})]})}):null},$a=({ruleType:e,formState:a,onChange:r})=>{const s=oa(e=>r({durationPreset:e}),[r]),o=oa(e=>r({customDurationMs:e.target.value}),[r]);return"Error"===e?Ye(x,{richTitle:{title:S,subTitle:P},children:Ye(l,{name:"sampling-toggle-keep-errors",value:!0,onChange:Ca,size:C.S,label:w,labelAlign:t.Right})}):"Duration"===e?Ye(x,{richTitle:{title:k,subTitle:A},children:Ye(wa,{description:$,options:Sa,selected:a.durationPreset,onSelect:s,customName:"sampling-input-custom-duration",customLabel:M,customPlaceholder:"200ms",customValue:a.customDurationMs,onCustomChange:o})}):null},La=ha.div`
1
+ import{c5 as e,p as a,T as l,k as t,e9 as r,e as s,am as o,w as i,j as n,ap as d,l as c,I as p,h as u,as as h,aw as g,n as m,F as v,d as f,S as b,an as y,aa as x,ea as S,eb as w,ax as C,ec as k,s as T,ed as $,t as L,ee as P,ef as M,eg as A,eh as O,ei as N,ej as z,ek as D,el as R,em as X,en as I,eo as E,ep as H,eq as V,bj as j,a as K,B as U,er as q,es as G,et as J,eu as B,ev as F,ew as W,ex as Z,ey as Y,ez as _,a7 as Q,a3 as ee,eA as ae,eB as le,ab as te,a6 as re,eC as se,eD as oe,eE as ie,eF as ne,b2 as de,eG as ce,eH as pe,eI as ue,eJ as he,eK as ge,eL as me,eM as ve,eN as fe,bG as be,o as ye,eO as xe,eP as Se,eQ as we,eR as Ce,eS as ke,eT as Te,eU as $e,eV as Le,eW as Pe,eX as Me,z as Ae,eY as Oe,E as Ne,eZ as ze,e_ as De,e$ as Re,f0 as Xe,f1 as Ie,dO as Ee,_ as He,ao as Ve,dm as je,f as Ke,f2 as Ue,d7 as qe,b as Ge,N as Je,aI as Be,aj as Fe,bw as We,dP as Ze}from"./ui-components-B4xHrszQ.js";import{jsx as Ye,jsxs as _e,Fragment as Qe}from"react/jsx-runtime";import{OdigosLogoTextEnterprise as ea,OdigosLogoTextCommunity as aa,EditIcon as la,ArrowLeftIcon as ta,ArrowRightIcon as ra,VSquareIcon as sa}from"../icons.js";import{useCallback as oa,useMemo as ia,useState as na,useRef as da,useEffect as ca,forwardRef as pa,useImperativeHandle as ua}from"react";import ha,{useTheme as ga}from"styled-components";import"./index-DJZLguZq.js";const ma=({isOpen:a,onClose:l,onDeny:t,onApprove:r})=>Ye(e,{title:"Discard changes?",description:"You have unsaved changes.\nIf you cancel now, your changes won't be saved.",isOpen:a,onClose:l,onDeny:t,denyLabel:"Keep editing",onApprove:r,approveLabel:"Discard changes"}),va=({isOpen:a,onClose:l,onDeny:t,onApprove:r,action:s="delete",target:o})=>{const i=s.charAt(0).toUpperCase()+s.substring(1),n=o?.endsWith("s")?"these":"this";return Ye(e,{title:`${i}${o?` ${o}`:""}?`,description:`Are you sure you want to ${s}${o?` ${n} ${o}`:""}?`,isOpen:a,onClose:l,onDeny:t,denyLabel:"Go back",onApprove:r,approveLabel:i})},fa=({componentType:e,inputType:h,name:g,label:m,tooltip:v,badge:f,placeholder:b,required:y,disabled:x,value:S,setValue:w,errorMessage:C,warnMessage:k,helpMessage:T,dropdownOptions:$,dropdownNoSearch:L,dropdownNoCheckbox:P,timeUnits:M,timeDefaultUnit:A})=>{switch(e){case a.Input:return Ye(p,{name:g,type:h,label:m,tooltip:v,badge:f,placeholder:b,required:y,disabled:x,value:S??"",onChange:e=>{const a=e.target.value;w(h===u.Number?""===a?null:Number(a):a)},errorMessage:C,warnMessage:k,helpMessage:T},g);case a.MultiInput:return Ye(c,{name:g,label:m,tooltip:v,badge:f,placeholder:b,required:y,disabled:x,values:Array.isArray(S)?S:d(S,[]),setValues:e=>w(e),errorMessage:C,warnMessage:k,helpMessage:T},g);case a.KeyValuePair:return Ye(n,{name:g,label:m,tooltip:v,badge:f,required:y,disabled:x,limitFieldsPerRow:2,columns:[{keyName:"key",label:"Key"},{keyName:"value",label:"Value"}],values:Array.isArray(S)?S:d(S,[]),setValues:e=>w(e),errorMessage:C,warnMessage:k,helpMessage:T},g);case a.TextArea:return Ye(i,{name:g,label:m,tooltip:v,badge:f,required:y,disabled:x,placeholder:b,value:S??"",onChange:e=>w(e.target.value),errorMessage:C,warnMessage:k,helpMessage:T},g);case a.Dropdown:return Ye(o,{name:g,label:m,tooltip:v,badge:f,placeholder:b,required:y,disabled:x,withSearch:!L,options:$?.map(e=>({id:e.id||"",label:e.value||"",withCheckbox:!P}))||[],values:S?[String(S)]:[],setValues:e=>w(e[0]),errorMessage:C,warnMessage:k,helpMessage:T},g);case a.Checkbox:return Ye(s,{name:g,label:m,tooltip:v,badge:f,value:!0===S||"true"===S,onChange:e=>w(String(e)),disabled:x,errorMessage:C,warnMessage:k,helpMessage:T},g);case a.Time:return Ye(r,{name:g,label:m,tooltip:v,badge:f,placeholder:b,required:y,disabled:x,value:S??"",setValue:e=>w(e),units:M,defaultUnit:A,errorMessage:C,warnMessage:k,helpMessage:T},g);case a.Toggle:return Ye(l,{name:g,labelAlign:t.Right,label:m,tooltip:v,badge:f,value:!0===S||"true"===S,onChange:e=>w(String(e)),disabled:x,errorMessage:C,warnMessage:k,helpMessage:T},g);default:return null}},ba=({size:e=200})=>{const{tier:a}=h();return a===g.Onprem?Ye(ea,{size:e}):Ye(aa,{size:e})},ya=[{value:"50",label:"50%"},{value:"25",label:"25%"},{value:"10",label:"10%"},{value:"1",label:"1%"},{value:"0",label:"0%"},{value:"custom",label:"Custom"}],xa=[{value:"10",label:"10%"},{value:"1",label:"1%"},{value:"0.5",label:"0.5%"},{value:"0.1",label:"0.1%"},{value:"0",label:"0%"},{value:"custom",label:"Custom"}],Sa=[{value:"5000",label:"5s"},{value:"1000",label:"1s"},{value:"500",label:"500ms"},{value:"100",label:"100ms"},{value:"50",label:"50ms"},{value:"custom",label:"Custom"}],wa=({description:e,options:a,selected:l,onSelect:t,customName:r,customLabel:s,customPlaceholder:o,customValue:i,onCustomChange:n})=>_e(m,{$gap:16,$alignItems:"flex-end",children:[_e(v,{$gap:6,children:[Ye(f,{label:e}),Ye(b,{size:y.S,options:a,selected:l,setSelected:t})]}),"custom"===l&&Ye(p,{name:r,label:s,placeholder:o,type:u.Number,value:i,onChange:n,width:160})]}),Ca=()=>{},ka=e=>e.readOnly?Ye(Ta,{rule:e.rule}):Ye($a,{ruleType:e.ruleType,formState:e.formState,onChange:e.onChange}),Ta=({rule:e})=>{const a=ga(),r=null!=e.durationAtLeastMs;return e.error?Ye(x,{richTitle:{title:S},children:Ye(l,{name:"sampling-view-toggle-keep-errors",onChange:Ca,value:!0,size:C.S,label:w,labelAlign:t.Right})}):r?Ye(x,{richTitle:{title:k},children:_e("div",{children:[Ye(T,{size:L.XXXS,color:a.v2.colors.silver[200],children:$}),Ye(T,{size:L.XS,children:`${e.durationAtLeastMs}ms`})]})}):null},$a=({ruleType:e,formState:a,onChange:r})=>{const s=oa(e=>r({durationPreset:e}),[r]),o=oa(e=>r({customDurationMs:e.target.value}),[r]);return"Error"===e?Ye(x,{richTitle:{title:S,subTitle:P},children:Ye(l,{name:"sampling-toggle-keep-errors",value:!0,onChange:Ca,size:C.S,label:w,labelAlign:t.Right})}):"Duration"===e?Ye(x,{richTitle:{title:k,subTitle:M},children:Ye(wa,{description:$,options:Sa,selected:a.durationPreset,onSelect:s,customName:"sampling-input-custom-duration",customLabel:A,customPlaceholder:"200ms",customValue:a.customDurationMs,onCustomChange:o})}):null},La=ha.div`
2
2
  display: flex;
3
3
  gap: 32px;
4
4
  `,Pa=ha.div`
5
5
  display: flex;
6
6
  flex-direction: column;
7
7
  gap: 4px;
8
- `,Aa=ha.div`
8
+ `,Ma=ha.div`
9
9
  display: flex;
10
10
  flex-wrap: wrap;
11
11
  align-items: flex-end;
12
12
  gap: 16px;
13
- `,Ma=ha.div`
13
+ `,Aa=ha.div`
14
14
  display: flex;
15
15
  align-items: flex-end;
16
16
  gap: 16px;
@@ -31,7 +31,7 @@ import{c6 as e,o as a,T as l,k as t,e9 as r,e as s,al as o,w as i,j as n,ao as d
31
31
  align-items: flex-end;
32
32
  gap: 16px;
33
33
  margin-bottom: 12px;
34
- `,Da="Any",Ra="Kafka topic",Xa=()=>Ye("div",{style:{marginBottom:"8px"},children:Ye(T,{size:L.XS,weight:500,children:"And"})}),Ia=[{value:"all",label:"All Operations"},{value:"httpServer",label:"HTTP Server"},{value:"httpClient",label:"HTTP Client"}],Ea=[{value:"all",label:"All Operations"},{value:"httpServer",label:"HTTP Server"},{value:"kafkaConsumer",label:"Kafka Consumer"},{value:"kafkaProducer",label:"Kafka Producer"}],Ha=[{id:"",label:Da},{id:"GET",label:"GET"},{id:"POST",label:"POST"},{id:"PUT",label:"PUT"},{id:"DELETE",label:"DELETE"},{id:"PATCH",label:"PATCH"}];const Va=e=>e.readOnly?Ye(Ka,{data:e.data}):Ye(ja,{category:e.category,formState:e.formState,onChange:e.onChange}),Ka=({data:e})=>{const a=ga(),l=ia(()=>function(e){if("noisy"===e.category){const a=e.rule.operation;if(a?.httpServer)return[{id:"type",title:B,value:J},{id:"route",title:E,value:a.httpServer.route||a.httpServer.routePrefix||F},{id:"method",title:q,value:a.httpServer.method||Da}];if(a?.httpClient){const e=[{id:"type",title:B,value:W}];return a.httpClient.serverAddress&&e.push({id:"serverAddress",title:"Server address",value:a.httpClient.serverAddress}),e.push({id:"route",title:E,value:a.httpClient.templatedPath||a.httpClient.templatedPathPrefix||F}),e.push({id:"method",title:q,value:a.httpClient.method||Da}),e}return[{id:"type",title:B,value:Z}]}const a=e.rule.operation;return a?.httpServer?[{id:"type",title:B,value:J},{id:"route",title:E,value:a.httpServer.route||a.httpServer.routePrefix||F},{id:"method",title:q,value:a.httpServer.method||Da}]:a?.kafkaConsumer?[{id:"type",title:B,value:Y},{id:"topic",title:Ra,value:a.kafkaConsumer.kafkaTopic||F}]:a?.kafkaProducer?[{id:"type",title:B,value:_},{id:"topic",title:Ra,value:a.kafkaProducer.kafkaTopic||F}]:[{id:"type",title:B,value:Z}]}(e),[e]);return Ye(x,{richTitle:{title:O},children:Ye(La,{children:l.map(({id:e,title:l,value:t})=>_e(Pa,{children:[Ye(T,{size:L.XXXS,color:a.v2.colors.silver[200],nowrap:!0,children:l}),Ye(T,{size:L.XS,nowrap:!0,children:t})]},e))})})},ja=({category:e,formState:a,onChange:l})=>{const t=ia(()=>"noisy"===e?Ia:Ea,[e]),r=oa(e=>l({operationType:e,route:"",serverAddress:"",method:"",kafkaTopic:""}),[l]),s=oa(e=>a=>{a&&l({routeType:e,route:""})},[l]),o=oa(e=>l({route:e.target.value}),[l]),i=oa(e=>l({serverAddress:e.target.value}),[l]),n=oa(e=>l({method:e[0]||""}),[l]),d=oa(e=>l({kafkaTopic:e.target.value}),[l]),c="httpServer"===a.operationType||"httpClient"===a.operationType,u="kafkaConsumer"===a.operationType||"kafkaProducer"===a.operationType,h="httpClient"===a.operationType?I:E,g="httpClient"===a.operationType?H:V;return _e(x,{richTitle:{title:`2. ${O}`,subTitle:N},children:[Ye(v,{$alignItems:"flex-start",children:Ye(b,{size:y.S,options:t,selected:a.operationType,setSelected:r})}),c&&_e(Aa,{children:["httpClient"===a.operationType&&_e(za,{children:[Ye(p,{name:"sampling-input-server-address",label:D,placeholder:z,value:a.serverAddress,onChange:i}),Ye(Xa,{})]}),_e(Ma,{children:[_e(Oa,{children:[Ye(Na,{children:Ye(R,{"data-id":"sampling-radio-route",value:"route"===a.routeType,onChange:s("route")})}),Ye(p,{name:"sampling-input-route",label:h,placeholder:X,value:"route"===a.routeType?a.route:"",onChange:o,disabled:"route"!==a.routeType})]}),_e(Oa,{children:[Ye(Na,{children:Ye(R,{"data-id":"sampling-radio-route-prefix",value:"routePrefix"===a.routeType,onChange:s("routePrefix")})}),Ye(p,{name:"sampling-input-route-prefix",label:g,placeholder:X,value:"routePrefix"===a.routeType?a.route:"",onChange:o,disabled:"routePrefix"!==a.routeType})]})]}),_e(za,{children:[Ye(Xa,{}),Ye(K,{label:q,items:Ha,selectedIds:[a.method||""],setSelectedIds:e=>n(e),buttonProps:{"data-id":"sampling-btn-method",label:Ha.find(e=>e.id===a.method)?.label||Da,size:U.S,variant:j.Secondary}})]})]}),u&&Ye(p,{name:"sampling-input-kafka-topic",label:G,placeholder:"Type kafka topic",value:a.kafkaTopic,onChange:d,width:"320px"})]})},Ua=[{value:"all",label:"Drop All"},{value:"sample",label:"Sample"}],qa=[{value:"all",label:"Keep All"},{value:"sample",label:"Sample"}];const Ga=e=>e.readOnly?Ye(Ja,{data:e.data}):Ye(Ba,{category:e.category,formState:e.formState,onChange:e.onChange}),Ja=({data:e})=>{const a=ga(),l=ia(()=>function(e){switch(e.category){case"highlyRelevant":return null!=e.rule.percentageAtLeast?{title:ae,method:oe,description:re,value:`${e.rule.percentageAtLeast}%`}:{title:ae,method:ne,description:null,value:null};case"noisy":return null!=e.rule.percentageAtMost?{title:le,method:oe,description:se,value:`${e.rule.percentageAtMost}%`}:{title:le,method:ie,description:null,value:null};case"costReduction":return{title:le,method:oe,description:se,value:`${e.rule.percentageAtMost}%`}}}(e),[e]),t=[{id:"method",title:q,value:l.method},...null!=l.description?[{id:"value",title:l.description,value:l.value}]:[]];return Ye(x,{richTitle:{title:l.title},children:Ye(La,{children:t.map(({id:e,title:l,value:t})=>_e(Pa,{children:[Ye(T,{size:L.XXXS,color:a.v2.colors.silver[200],nowrap:!0,children:l}),Ye(T,{size:L.XS,nowrap:!0,children:t})]},e))})})},Ba=({category:e,formState:a,onChange:l})=>{const t="highlyRelevant"===e,r=t?qa:Ua,s=`3. ${t?ae:le}`,o=t?Q:ee,i=t?re:se,n="noisy"===e?xa:ya,d=oa(e=>l({percentageMode:e}),[l]),c=oa(e=>l({percentagePreset:e}),[l]),p=oa(e=>l({customPercentage:e.target.value}),[l]);return _e(x,{richTitle:{title:s,subTitle:o},children:["costReduction"!==e&&Ye(v,{$alignItems:"flex-start",children:Ye(b,{size:y.S,options:r,selected:a.percentageMode,setSelected:d})}),("costReduction"===e||"sample"===a.percentageMode)&&Ye(wa,{description:i,options:n,selected:a.percentagePreset,onSelect:c,customName:"sampling-input-custom-percentage",customLabel:te,customPlaceholder:"5%",customValue:a.customPercentage,onCustomChange:p})]})},Fa=ha.div`
34
+ `,Da="Any",Ra="Kafka topic",Xa=()=>Ye("div",{style:{marginBottom:"8px"},children:Ye(T,{size:L.XS,weight:500,children:"And"})}),Ia=[{value:"all",label:"All Operations"},{value:"httpServer",label:"HTTP Server"},{value:"httpClient",label:"HTTP Client"}],Ea=[{value:"all",label:"All Operations"},{value:"httpServer",label:"HTTP Server"},{value:"kafkaConsumer",label:"Kafka Consumer"},{value:"kafkaProducer",label:"Kafka Producer"}],Ha=[{id:"",label:Da},{id:"GET",label:"GET"},{id:"POST",label:"POST"},{id:"PUT",label:"PUT"},{id:"DELETE",label:"DELETE"},{id:"PATCH",label:"PATCH"}];const Va=e=>e.readOnly?Ye(ja,{data:e.data}):Ye(Ka,{category:e.category,formState:e.formState,onChange:e.onChange}),ja=({data:e})=>{const a=ga(),l=ia(()=>function(e){if("noisy"===e.category){const a=e.rule.operation;if(a?.httpServer)return[{id:"type",title:B,value:J},{id:"route",title:E,value:a.httpServer.route||a.httpServer.routePrefix||F},{id:"method",title:q,value:a.httpServer.method||Da}];if(a?.httpClient){const e=[{id:"type",title:B,value:W}];return a.httpClient.serverAddress&&e.push({id:"serverAddress",title:"Server address",value:a.httpClient.serverAddress}),e.push({id:"route",title:E,value:a.httpClient.templatedPath||a.httpClient.templatedPathPrefix||F}),e.push({id:"method",title:q,value:a.httpClient.method||Da}),e}return[{id:"type",title:B,value:Z}]}const a=e.rule.operation;return a?.httpServer?[{id:"type",title:B,value:J},{id:"route",title:E,value:a.httpServer.route||a.httpServer.routePrefix||F},{id:"method",title:q,value:a.httpServer.method||Da}]:a?.kafkaConsumer?[{id:"type",title:B,value:Y},{id:"topic",title:Ra,value:a.kafkaConsumer.kafkaTopic||F}]:a?.kafkaProducer?[{id:"type",title:B,value:_},{id:"topic",title:Ra,value:a.kafkaProducer.kafkaTopic||F}]:[{id:"type",title:B,value:Z}]}(e),[e]);return Ye(x,{richTitle:{title:O},children:Ye(La,{children:l.map(({id:e,title:l,value:t})=>_e(Pa,{children:[Ye(T,{size:L.XXXS,color:a.v2.colors.silver[200],nowrap:!0,children:l}),Ye(T,{size:L.XS,nowrap:!0,children:t})]},e))})})},Ka=({category:e,formState:a,onChange:l})=>{const t=ia(()=>"noisy"===e?Ia:Ea,[e]),r=oa(e=>l({operationType:e,route:"",serverAddress:"",method:"",kafkaTopic:""}),[l]),s=oa(e=>a=>{a&&l({routeType:e,route:""})},[l]),o=oa(e=>l({route:e.target.value}),[l]),i=oa(e=>l({serverAddress:e.target.value}),[l]),n=oa(e=>l({method:e[0]||""}),[l]),d=oa(e=>l({kafkaTopic:e.target.value}),[l]),c="httpServer"===a.operationType||"httpClient"===a.operationType,u="kafkaConsumer"===a.operationType||"kafkaProducer"===a.operationType,h="httpClient"===a.operationType?I:E,g="httpClient"===a.operationType?H:V;return _e(x,{richTitle:{title:`2. ${O}`,subTitle:N},children:[Ye(v,{$alignItems:"flex-start",children:Ye(b,{size:y.S,options:t,selected:a.operationType,setSelected:r})}),c&&_e(Ma,{children:["httpClient"===a.operationType&&_e(za,{children:[Ye(p,{name:"sampling-input-server-address",label:D,placeholder:z,value:a.serverAddress,onChange:i}),Ye(Xa,{})]}),_e(Aa,{children:[_e(Oa,{children:[Ye(Na,{children:Ye(R,{"data-id":"sampling-radio-route",value:"route"===a.routeType,onChange:s("route")})}),Ye(p,{name:"sampling-input-route",label:h,placeholder:X,value:"route"===a.routeType?a.route:"",onChange:o,disabled:"route"!==a.routeType})]}),_e(Oa,{children:[Ye(Na,{children:Ye(R,{"data-id":"sampling-radio-route-prefix",value:"routePrefix"===a.routeType,onChange:s("routePrefix")})}),Ye(p,{name:"sampling-input-route-prefix",label:g,placeholder:X,value:"routePrefix"===a.routeType?a.route:"",onChange:o,disabled:"routePrefix"!==a.routeType})]})]}),_e(za,{children:[Ye(Xa,{}),Ye(j,{label:q,items:Ha,selectedIds:[a.method||""],setSelectedIds:e=>n(e),buttonProps:{"data-id":"sampling-btn-method",label:Ha.find(e=>e.id===a.method)?.label||Da,size:U.S,variant:K.Secondary}})]})]}),u&&Ye(p,{name:"sampling-input-kafka-topic",label:G,placeholder:"Type kafka topic",value:a.kafkaTopic,onChange:d,width:"320px"})]})},Ua=[{value:"all",label:"Drop All"},{value:"sample",label:"Sample"}],qa=[{value:"all",label:"Keep All"},{value:"sample",label:"Sample"}];const Ga=e=>e.readOnly?Ye(Ja,{data:e.data}):Ye(Ba,{category:e.category,formState:e.formState,onChange:e.onChange}),Ja=({data:e})=>{const a=ga(),l=ia(()=>function(e){switch(e.category){case"highlyRelevant":return null!=e.rule.percentageAtLeast?{title:ae,method:oe,description:re,value:`${e.rule.percentageAtLeast}%`}:{title:ae,method:ne,description:null,value:null};case"noisy":return null!=e.rule.percentageAtMost?{title:le,method:oe,description:se,value:`${e.rule.percentageAtMost}%`}:{title:le,method:ie,description:null,value:null};case"costReduction":return{title:le,method:oe,description:se,value:`${e.rule.percentageAtMost}%`}}}(e),[e]),t=[{id:"method",title:q,value:l.method},...null!=l.description?[{id:"value",title:l.description,value:l.value}]:[]];return Ye(x,{richTitle:{title:l.title},children:Ye(La,{children:t.map(({id:e,title:l,value:t})=>_e(Pa,{children:[Ye(T,{size:L.XXXS,color:a.v2.colors.silver[200],nowrap:!0,children:l}),Ye(T,{size:L.XS,nowrap:!0,children:t})]},e))})})},Ba=({category:e,formState:a,onChange:l})=>{const t="highlyRelevant"===e,r=t?qa:Ua,s=`3. ${t?ae:le}`,o=t?Q:ee,i=t?re:se,n="noisy"===e?xa:ya,d=oa(e=>l({percentageMode:e}),[l]),c=oa(e=>l({percentagePreset:e}),[l]),p=oa(e=>l({customPercentage:e.target.value}),[l]);return _e(x,{richTitle:{title:s,subTitle:o},children:["costReduction"!==e&&Ye(v,{$alignItems:"flex-start",children:Ye(b,{size:y.S,options:r,selected:a.percentageMode,setSelected:d})}),("costReduction"===e||"sample"===a.percentageMode)&&Ye(wa,{description:i,options:n,selected:a.percentagePreset,onSelect:c,customName:"sampling-input-custom-percentage",customLabel:te,customPlaceholder:"5%",customValue:a.customPercentage,onCustomChange:p})]})},Fa=ha.div`
35
35
  display: flex;
36
36
  align-items: flex-end;
37
37
  gap: 16px;
@@ -57,7 +57,7 @@ import{c6 as e,o as a,T as l,k as t,e9 as r,e as s,al as o,w as i,j as n,ao as d
57
57
  min-width: 0;
58
58
  white-space: pre;
59
59
  overflow-x: auto;
60
- `,sl=({title:e,summary:a,onEdit:l,renderAction:t})=>{const r=ia(()=>{const l=[];return e&&(l.push({text:e,variant:fe.Default}),l.push({text:" - ",variant:fe.Default})),l.push(...a),l},[e,a]);return _e(tl,{children:[Ye(rl,{children:Ye(be,{parts:r})}),t&&t(),l&&Ye(ye,{"data-id":"sampling-btn-edit-auto-rule",label:xe,rightIcon:la,variant:j.Text,size:U.S,onClick:l})]})},ol=e=>{const a=ia(()=>{if(e.readOnly)return e.summary;switch(e.category){case"noisy":return Te($e(e.formState));case"highlyRelevant":return Ce(ke(e.formState));case"costReduction":return Se(we(e.formState))}},[e]);if(e.readOnly)return Ye(sl,{title:Le,summary:a});const l=1===a.length&&"default"===a[0].variant;return Ye(sl,{title:l?Pe:Le,summary:l?[]:a})},il=ha.div`
60
+ `,sl=({title:e,summary:a,onEdit:l,renderAction:t})=>{const r=ia(()=>{const l=[];return e&&(l.push({text:e,variant:fe.Default}),l.push({text:" - ",variant:fe.Default})),l.push(...a),l},[e,a]);return _e(tl,{children:[Ye(rl,{children:Ye(be,{parts:r})}),t&&t(),l&&Ye(ye,{"data-id":"sampling-btn-edit-auto-rule",label:xe,rightIcon:la,variant:K.Text,size:U.S,onClick:l})]})},ol=e=>{const a=ia(()=>{if(e.readOnly)return e.summary;switch(e.category){case"noisy":return Te($e(e.formState));case"highlyRelevant":return Ce(ke(e.formState));case"costReduction":return Se(we(e.formState))}},[e]);if(e.readOnly)return Ye(sl,{title:Le,summary:a});const l=1===a.length&&"default"===a[0].variant;return Ye(sl,{title:l?Pe:Le,summary:l?[]:a})},il=ha.div`
61
61
  display: flex;
62
62
  flex-wrap: wrap;
63
63
  gap: 8px;
@@ -99,7 +99,7 @@ import{c6 as e,o as a,T as l,k as t,e9 as r,e as s,al as o,w as i,j as n,ao as d
99
99
  justify-content: center;
100
100
  align-items: center;
101
101
  flex-shrink: 0;
102
- `,hl={[Ee.JavaScript]:"Node.js",[Ee.DotNet]:".NET",[Ee.Php]:"PHP",[Ee.Java]:"Java",[Ee.Go]:"Go",[Ee.Python]:"Python",[Ee.Ruby]:"Ruby",[Ee.Rust]:"Rust"},gl=[Ee.Python,Ee.Java,Ee.JavaScript,Ee.DotNet,Ee.Php,Ee.Ruby,Ee.Go].map(e=>({id:e,label:hl[e]??e.charAt(0).toUpperCase()+e.slice(1),Icon:He(e)})),ml=[{value:"all",label:"Entire Cluster"},{value:"source",label:"Specific Source"},{value:"namespace",label:"Specific Namespace"},{value:"language",label:"Specific Programming Language"}];function vl(e){const a=hl[e];return a||e.charAt(0).toUpperCase()+e.slice(1)}const fl=e=>e.readOnly?Ye(bl,{scopes:e.scopes}):Ye(yl,{formState:e.formState,onChange:e.onChange,sourceOptions:e.sourceOptions,namespaceOptions:e.namespaceOptions}),bl=({scopes:e})=>{const a=ga();return Ye(x,{richTitle:{title:Ae},children:e.length?Ye(cl,{children:e.map((e,l)=>((e,l)=>{if(e.workloadLanguage){const t=He(e.workloadLanguage);return _e(pl,{children:[t&&Ye(ul,{children:Ye(t,{size:18})}),Ye(T,{size:L.XS,color:a.v2.colors.white[500],children:vl(e.workloadLanguage)})]},l)}const t=[e.workloadNamespace,e.workloadKind,e.workloadName].filter(Boolean),r=t.length?t.join(" / "):"Unknown scope";return Ye(pl,{children:Ye(T,{size:L.XS,color:a.v2.colors.white[500],children:r})},l)})(e,l))}):Ye(Me,{status:Ne.Default,message:Oe,fullWidth:!0})})},yl=({formState:e,onChange:a,sourceOptions:l=[],namespaceOptions:t=[]})=>{const[r,o]=na("all"),i=e.sourceScopes.length>0,n=ia(()=>ml.map(e=>({...e,disabled:"all"===e.value&&i})),[i]),d=ia(()=>e.sourceScopes.filter(e=>"source"===e.scopeType).map(e=>{return a=e.workloadNamespace,l=e.workloadKind,t=e.workloadName,`${a}/${l}/${t}`;var a,l,t}),[e.sourceScopes]),c=ia(()=>e.sourceScopes.filter(e=>"namespace"===e.scopeType).map(e=>e.workloadNamespace),[e.sourceScopes]),p=ia(()=>new Set(e.sourceScopes.filter(e=>"language"===e.scopeType).map(e=>e.workloadLanguage)),[e.sourceScopes]),u=oa(e=>{o(e)},[]),h=oa(l=>{const t=e.sourceScopes.filter(e=>"source"!==e.scopeType),r=l.map(e=>function(e){const a=e.split("/");return 3!==a.length?null:{namespace:a[0],kind:a[1],name:a[2]}}(e)).filter(e=>null!==e).map(e=>({scopeType:"source",workloadName:e.name,workloadKind:e.kind,workloadNamespace:e.namespace,workloadLanguage:""}));a({sourceScopes:[...t,...r]})},[e.sourceScopes,a]),g=oa(l=>{const t=e.sourceScopes.filter(e=>"namespace"!==e.scopeType),r=l.map(e=>({scopeType:"namespace",workloadName:"",workloadKind:"",workloadNamespace:e,workloadLanguage:""}));a({sourceScopes:[...t,...r]})},[e.sourceScopes,a]),m=oa(l=>{if(e.sourceScopes.some(e=>"language"===e.scopeType&&e.workloadLanguage===l))a({sourceScopes:e.sourceScopes.filter(e=>!("language"===e.scopeType&&e.workloadLanguage===l))});else{const t={scopeType:"language",workloadName:"",workloadKind:"",workloadNamespace:"",workloadLanguage:l};a({sourceScopes:[...e.sourceScopes,t]})}},[e.sourceScopes,a]);return _e(x,{richTitle:{title:`1. ${Ae}`,subTitle:ze},children:[Ye(Me,!i&&"all"===r?{status:Ne.Default,message:Oe,fullWidth:!0,smallIcon:!0}:{status:Ne.Info,message:De,fullWidth:!0,smallIcon:!0}),Ye(v,{$alignItems:"flex-start",children:Ye(b,{size:y.S,options:n,selected:r,setSelected:u})}),"source"===r&&Ye(Re,{multiple:!0,"data-id":"sampling-autocomplete-source",options:l,value:d,onSelect:h,placeholder:Xe}),"namespace"===r&&Ye(Re,{multiple:!0,"data-id":"sampling-autocomplete-namespace",options:t,value:c,onSelect:g,placeholder:"Search namespace"}),"language"===r&&Ye(il,{children:gl.map(({id:e,label:a,Icon:l})=>{const t=p.has(e);return _e(nl,{$selected:t,onClick:()=>m(e),children:[Ye(s,{name:`sampling-scope-lang-${e}`,size:Ie.S,value:t,onChange:()=>m(e)}),Ye(dl,{children:Ye(l,{size:20})}),Ye(T,{size:L.XS,nowrap:!0,children:a})]},e)})})]})},xl=(e,a)=>!a?.length||!!a?.find(a=>a===e),Sl=({title:e="Signals",required:a,errorMessage:l,allowedSignals:t,selectedSignals:r,setSelectedSignals:o,disabled:i})=>{const[n,d]=na(1===r.length),c=da(JSON.stringify(r));ca(()=>{const e=Ve(r);e.length||Ke.forEach(({id:a})=>{xl(a,t)&&e.push(a)});const a=JSON.stringify(e);c.current!==a&&(c.current=a,o(e),d(1===e.length))},[t,r]);return _e(v,{$gap:12,children:[Ye(f,{label:e,required:a}),Ye(m,{$gap:12,children:Ke.map(e=>{const a=xl(e.id,t),l=((e,a)=>!!a?.find(a=>a===e))(e.id,r);return a?Ye(s,{label:e.value,disabled:i||!a||n&&l,value:l,onChange:a=>((e,a)=>{const l=e,t=a?[...r,l]:r.filter(e=>e!==l);o(t),d(1===t.length)})(e.id,a)},e.id):null})}),Ye(je,{errorMessage:l})]})},wl=({minSupportedVersion:a,currentVersion:l})=>Ye(e,{isOpen:!0,onClose:()=>{},relativeToParent:!0,visual:()=>Ye(Ue,{scale:2.4,icon:()=>Ye("svg",{xmlns:"http://www.w3.org/2000/svg",width:"22",height:"21",viewBox:"0 0 22 21",fill:"none",children:Ye("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:"Upgrade Required",description:`To use this feature, please upgrade to Odigos v${a} or later.\nCurrent version: ${l}.`}),Cl=ha.div`
102
+ `,hl={[Ee.JavaScript]:"Node.js",[Ee.DotNet]:".NET",[Ee.Php]:"PHP",[Ee.Java]:"Java",[Ee.Go]:"Go",[Ee.Python]:"Python",[Ee.Ruby]:"Ruby",[Ee.Rust]:"Rust"},gl=[Ee.Python,Ee.Java,Ee.JavaScript,Ee.DotNet,Ee.Php,Ee.Ruby,Ee.Go].map(e=>({id:e,label:hl[e]??e.charAt(0).toUpperCase()+e.slice(1),Icon:He(e)})),ml=[{value:"all",label:"Entire Cluster"},{value:"source",label:"Specific Source"},{value:"namespace",label:"Specific Namespace"},{value:"language",label:"Specific Programming Language"}];function vl(e){const a=hl[e];return a||e.charAt(0).toUpperCase()+e.slice(1)}const fl=e=>e.readOnly?Ye(bl,{scopes:e.scopes}):Ye(yl,{formState:e.formState,onChange:e.onChange,sourceOptions:e.sourceOptions,namespaceOptions:e.namespaceOptions}),bl=({scopes:e})=>{const a=ga();return Ye(x,{richTitle:{title:Me},children:e.length?Ye(cl,{children:e.map((e,l)=>((e,l)=>{if(e.workloadLanguage){const t=He(e.workloadLanguage);return _e(pl,{children:[t&&Ye(ul,{children:Ye(t,{size:18})}),Ye(T,{size:L.XS,color:a.v2.colors.white[500],children:vl(e.workloadLanguage)})]},l)}const t=[e.workloadNamespace,e.workloadKind,e.workloadName].filter(Boolean),r=t.length?t.join(" / "):"Unknown scope";return Ye(pl,{children:Ye(T,{size:L.XS,color:a.v2.colors.white[500],children:r})},l)})(e,l))}):Ye(Ae,{status:Ne.Default,message:Oe,fullWidth:!0})})},yl=({formState:e,onChange:a,sourceOptions:l=[],namespaceOptions:t=[]})=>{const[r,o]=na("all"),i=e.sourceScopes.length>0,n=ia(()=>ml.map(e=>({...e,disabled:"all"===e.value&&i})),[i]),d=ia(()=>e.sourceScopes.filter(e=>"source"===e.scopeType).map(e=>{return a=e.workloadNamespace,l=e.workloadKind,t=e.workloadName,`${a}/${l}/${t}`;var a,l,t}),[e.sourceScopes]),c=ia(()=>e.sourceScopes.filter(e=>"namespace"===e.scopeType).map(e=>e.workloadNamespace),[e.sourceScopes]),p=ia(()=>new Set(e.sourceScopes.filter(e=>"language"===e.scopeType).map(e=>e.workloadLanguage)),[e.sourceScopes]),u=oa(e=>{o(e)},[]),h=oa(l=>{const t=e.sourceScopes.filter(e=>"source"!==e.scopeType),r=l.map(e=>function(e){const a=e.split("/");return 3!==a.length?null:{namespace:a[0],kind:a[1],name:a[2]}}(e)).filter(e=>null!==e).map(e=>({scopeType:"source",workloadName:e.name,workloadKind:e.kind,workloadNamespace:e.namespace,workloadLanguage:""}));a({sourceScopes:[...t,...r]})},[e.sourceScopes,a]),g=oa(l=>{const t=e.sourceScopes.filter(e=>"namespace"!==e.scopeType),r=l.map(e=>({scopeType:"namespace",workloadName:"",workloadKind:"",workloadNamespace:e,workloadLanguage:""}));a({sourceScopes:[...t,...r]})},[e.sourceScopes,a]),m=oa(l=>{if(e.sourceScopes.some(e=>"language"===e.scopeType&&e.workloadLanguage===l))a({sourceScopes:e.sourceScopes.filter(e=>!("language"===e.scopeType&&e.workloadLanguage===l))});else{const t={scopeType:"language",workloadName:"",workloadKind:"",workloadNamespace:"",workloadLanguage:l};a({sourceScopes:[...e.sourceScopes,t]})}},[e.sourceScopes,a]);return _e(x,{richTitle:{title:`1. ${Me}`,subTitle:ze},children:[Ye(Ae,!i&&"all"===r?{status:Ne.Default,message:Oe,fullWidth:!0,smallIcon:!0}:{status:Ne.Info,message:De,fullWidth:!0,smallIcon:!0}),Ye(v,{$alignItems:"flex-start",children:Ye(b,{size:y.S,options:n,selected:r,setSelected:u})}),"source"===r&&Ye(Re,{multiple:!0,"data-id":"sampling-autocomplete-source",options:l,value:d,onSelect:h,placeholder:Xe}),"namespace"===r&&Ye(Re,{multiple:!0,"data-id":"sampling-autocomplete-namespace",options:t,value:c,onSelect:g,placeholder:"Search namespace"}),"language"===r&&Ye(il,{children:gl.map(({id:e,label:a,Icon:l})=>{const t=p.has(e);return _e(nl,{$selected:t,onClick:()=>m(e),children:[Ye(s,{name:`sampling-scope-lang-${e}`,size:Ie.S,value:t,onChange:()=>m(e)}),Ye(dl,{children:Ye(l,{size:20})}),Ye(T,{size:L.XS,nowrap:!0,children:a})]},e)})})]})},xl=(e,a)=>!a?.length||!!a?.find(a=>a===e),Sl=({title:e="Signals",required:a,errorMessage:l,allowedSignals:t,selectedSignals:r,setSelectedSignals:o,disabled:i})=>{const[n,d]=na(1===r.length),c=da(JSON.stringify(r));ca(()=>{const e=Ve(r);e.length||je.forEach(({id:a})=>{xl(a,t)&&e.push(a)});const a=JSON.stringify(e);c.current!==a&&(c.current=a,o(e),d(1===e.length))},[t,r]);return _e(v,{$gap:12,children:[Ye(f,{label:e,required:a}),Ye(m,{$gap:12,children:je.map(e=>{const a=xl(e.id,t),l=((e,a)=>!!a?.find(a=>a===e))(e.id,r);return a?Ye(s,{label:e.value,disabled:i||!a||n&&l,value:l,onChange:a=>((e,a)=>{const l=e,t=a?[...r,l]:r.filter(e=>e!==l);o(t),d(1===t.length)})(e.id,a)},e.id):null})}),Ye(Ke,{errorMessage:l})]})},wl=({minSupportedVersion:a,currentVersion:l})=>Ye(e,{isOpen:!0,onClose:()=>{},relativeToParent:!0,visual:()=>Ye(Ue,{scale:2.4,icon:()=>Ye("svg",{xmlns:"http://www.w3.org/2000/svg",width:"22",height:"21",viewBox:"0 0 22 21",fill:"none",children:Ye("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:"Upgrade Required",description:`To use this feature, please upgrade to Odigos v${a} or later.\nCurrent version: ${l}.`}),Cl=ha.div`
103
103
  display: flex;
104
104
  flex-direction: column;
105
105
  justify-content: flex-end;
@@ -129,14 +129,14 @@ import{c6 as e,o as a,T as l,k as t,e9 as r,e as s,al as o,w as i,j as n,ao as d
129
129
  border-radius: 16px;
130
130
  background-color: ${({theme:e})=>e.v2.colors.silver[1e3]};
131
131
  overflow: hidden;
132
- `,Al=ha.div`
132
+ `,Ml=ha.div`
133
133
  display: flex;
134
134
  gap: 12px;
135
135
  padding: 16px 16px 0 16px;
136
136
  background-color: ${({theme:e})=>e.v2.colors.silver[1e3]};
137
137
  position: sticky;
138
138
  top: 0;
139
- `,Ml=ha.div`
139
+ `,Al=ha.div`
140
140
  padding: 12px 12px 0 12px;
141
141
  `,Ol=ha.div`
142
142
  display: flex;
@@ -146,4 +146,4 @@ import{c6 as e,o as a,T as l,k as t,e9 as r,e as s,al as o,w as i,j as n,ao as d
146
146
  padding: 5vh 10vw;
147
147
  border-radius: 12px;
148
148
  background-color: ${({theme:e})=>e.v2.colors.silver[800]};
149
- `,zl=pa(({isOpen:e,withOverlay:a,disableAnimation:l,onClose:t,onBack:r,onNext:s,nextIsSkip:o,onSave:i,disableSave:n,connectionIds:d,header:c,subHeader:p,leftColumn:u,rightColumn:h,search:g,filters:m,errorMessage:v,isFormDirty:f,hideDirtyNote:b,isFetching:y,progress:x},S)=>{const[w,C]=na(!1),[k,T]=na(!1),[$,P]=na(void 0);ua(S,()=>({clearErrors:()=>P(void 0)}));const A=k,M=oa(()=>{f&&!w?C(!0):(C(!1),t?.())},[f,w,t]),O=n||k||"boolean"==typeof f&&!f,N=oa(async()=>{T(!0);const e=await i();T(!1),e?.error?P(e.error):(d?.setValue([]),t?.())},[i,d,t]),z=!!g||!!d||!!m,D=!!p,R=(z?48:0)+(D?50:0),X=ia(()=>y?{status:Ne.Info,message:"Fetching Data..."}:k&&!x?{status:Ne.Info,message:"Saving Changes..."}:$||v?{status:Ne.Error,message:$||v}:"boolean"==typeof f&&f&&!b?{status:Ne.Info,message:'The values don\'t reflect the current configurations of the selected clusters.\n"Save" will override the current configurations.'}:"boolean"!=typeof f||f||b?void 0:{status:Ne.Success,message:"The values reflect the current configuration of the selected cluster."},[y,k,x,$,v,f,b]),I=ia(()=>r?{label:"Back",leftIcon:ta,variant:j.Secondary,onClick:r}:{label:"Cancel",variant:j.Secondary,onClick:M,disabled:A},[r,M,A]),E=ia(()=>s?o?{"data-id":"wide-drawer-skip",label:"Skip",rightIcon:ra,variant:j.Secondary,onClick:s}:{"data-id":"wide-drawer-next",label:"Next",rightIcon:ra,variant:j.Primary,onClick:s}:{"data-id":"wide-drawer-save",label:"Save",variant:j.Primary,onClick:N,disabled:O},[s,o,N,O]);return _e(Be,{width:Ll,isOpen:e,disableAnimation:l,hideOverlay:!k&&!a,header:{...c,onClose:t?M:void 0,onCloseDisabled:A},footer:{note:X,actions:[I,E]},children:[k?Ye(Ge,{$height:"calc(100vh - 136px)",children:Ye(Nl,{children:Ye(Fe,{titleSize:L.S,subTitleSize:L.XXXS,withGradient:!0,withSpinner:!0,...x})})}):_e(Pl,{children:[z&&_e(Al,{children:[d&&Ye(We,{icon:sa,title:"Selected Clusters",badge:{label:d.value.length}}),g&&Ye(Ze,{width:"100%",...g}),m]}),D&&Ye(Ml,{children:Ye(We,{icon:p.icon,title:p.title,subTitle:p.description,badge:p.badge})}),_e(Ol,{children:[Ye($l,{isLeft:!0,heightOffset:R,...u}),Ye($l,{isRight:!0,heightOffset:R,...h})]})]}),Ye(ma,{isOpen:w,onClose:()=>C(!1),onApprove:M})]})});zl.displayName=zl.name;export{sl as A,ma as C,fa as D,xa as N,Va as O,wa as P,el as R,Sl as S,wl as U,zl as W,ya as a,ol as b,fl as c,Ga as d,ka as e,va as f,Ll as g,ba as h,Sa as i};
149
+ `,zl=pa(({isOpen:e,withOverlay:a,disableAnimation:l,onClose:t,onBack:r,onNext:s,nextIsSkip:o,onSave:i,disableSave:n,connectionIds:d,header:c,subHeader:p,leftColumn:u,rightColumn:h,search:g,filters:m,errorMessage:v,isFormDirty:f,hideDirtyNote:b,isFetching:y,progress:x},S)=>{const[w,C]=na(!1),[k,T]=na(!1),[$,P]=na(void 0);ua(S,()=>({clearErrors:()=>P(void 0)}));const M=k,A=oa(()=>{f&&!w?C(!0):(C(!1),t?.())},[f,w,t]),O=n||k||"boolean"==typeof f&&!f,N=oa(async()=>{T(!0);const e=await i();T(!1),e?.error?P(e.error):(d?.setValue([]),t?.())},[i,d,t]),z=!!g||!!d||!!m,D=!!p,R=(z?48:0)+(D?50:0),X=ia(()=>y?{status:Ne.Info,message:"Fetching Data..."}:k&&!x?{status:Ne.Info,message:"Saving Changes..."}:$||v?{status:Ne.Error,message:$||v}:"boolean"==typeof f&&f&&!b?{status:Ne.Info,message:'The values don\'t reflect the current configurations of the selected clusters.\n"Save" will override the current configurations.'}:"boolean"!=typeof f||f||b?void 0:{status:Ne.Success,message:"The values reflect the current configuration of the selected cluster."},[y,k,x,$,v,f,b]),I=ia(()=>r?{label:"Back",leftIcon:ta,variant:K.Secondary,onClick:r}:{label:"Cancel",variant:K.Secondary,onClick:A,disabled:M},[r,A,M]),E=ia(()=>s?o?{"data-id":"wide-drawer-skip",label:"Skip",rightIcon:ra,variant:K.Secondary,onClick:s}:{"data-id":"wide-drawer-next",label:"Next",rightIcon:ra,variant:K.Primary,onClick:s}:{"data-id":"wide-drawer-save",label:"Save",variant:K.Primary,onClick:N,disabled:O},[s,o,N,O]);return _e(Be,{width:Ll,isOpen:e,disableAnimation:l,hideOverlay:!k&&!a,header:{...c,onClose:t?A:void 0,onCloseDisabled:M},footer:{note:X,actions:[I,E]},children:[k?Ye(Ge,{$height:"calc(100vh - 136px)",children:Ye(Nl,{children:Ye(Fe,{titleSize:L.S,subTitleSize:L.XXXS,withGradient:!0,withSpinner:!0,...x})})}):_e(Pl,{children:[z&&_e(Ml,{children:[d&&Ye(We,{icon:sa,title:"Selected Clusters",badge:{label:d.value.length}}),g&&Ye(Ze,{width:"100%",...g}),m]}),D&&Ye(Al,{children:Ye(We,{icon:p.icon,title:p.title,subTitle:p.description,badge:p.badge})}),_e(Ol,{children:[Ye($l,{isLeft:!0,heightOffset:R,...u}),Ye($l,{isRight:!0,heightOffset:R,...h})]})]}),Ye(ma,{isOpen:w,onClose:()=>C(!1),onApprove:A})]})});zl.displayName=zl.name;export{sl as A,ma as C,fa as D,xa as N,Va as O,wa as P,el as R,Sl as S,wl as U,zl as W,ya as a,ol as b,fl as c,Ga as d,ka as e,va as f,Ll as g,ba as h,Sa as i};