@odigos/ui-kit 0.0.287 → 0.0.288

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (45) hide show
  1. package/.cursor/rules/frontend-workflow.mdc +27 -0
  2. package/.cursor/rules/ui-feedback-tables-forms.mdc +40 -0
  3. package/.cursor/rules/ui-implementation.mdc +21 -0
  4. package/.cursor/rules/ui-pages-and-drawers.mdc +34 -0
  5. package/.cursor/rules/ui-visual-language.mdc +27 -0
  6. package/CHANGELOG.md +15 -0
  7. package/lib/chunks/{helpers-CtkwQ3Wc.js → helpers-BCSEuuKh.js} +1 -1
  8. package/lib/chunks/index-Cy84opXf.js +351 -0
  9. package/lib/chunks/source-instrument-form-context-D6pVu22G.js +5 -0
  10. package/lib/chunks/{ui-components-CjgsN17j.js → ui-components-D8rTJS7r.js} +82 -82
  11. package/lib/components.js +1 -1
  12. package/lib/constants/strings/index.d.ts +6 -0
  13. package/lib/constants.js +1 -1
  14. package/lib/containers/_drawers/edit-source-drawer/overview/instructions-card.d.ts +21 -0
  15. package/lib/containers/insights/settings-and-configurations/panels/guardrails/constants.d.ts +6 -1
  16. package/lib/containers/insights/settings-and-configurations/panels/guardrails/facet-section.d.ts +1 -0
  17. package/lib/containers/insights/settings-and-configurations/panels/guardrails/mappers.d.ts +2 -0
  18. package/lib/containers/insights/settings-and-configurations/panels/system/constants.d.ts +3 -1
  19. package/lib/containers/insights/transactions/helpers.d.ts +2 -1
  20. package/lib/containers.js +516 -469
  21. package/lib/contexts/odigos-api/capabilities.d.ts +2 -0
  22. package/lib/contexts/odigos-api/hooks/use-insights-api.d.ts +7 -1
  23. package/lib/contexts/odigos-api/hooks/use-sources-api.d.ts +10 -1
  24. package/lib/contexts/odigos-api/index.d.ts +1 -1
  25. package/lib/contexts/odigos-api/types.d.ts +24 -1
  26. package/lib/contexts.js +1 -1
  27. package/lib/functions.js +1 -1
  28. package/lib/hooks.js +1 -1
  29. package/lib/{containers/insights/findings/drawer/anomaly/anomaly-blast-radius → snippets/blast-radius}/helpers.d.ts +7 -6
  30. package/lib/snippets/blast-radius/index.d.ts +7 -0
  31. package/lib/snippets/index.d.ts +1 -0
  32. package/lib/snippets.js +1 -1
  33. package/lib/store.js +1 -1
  34. package/lib/theme.js +1 -1
  35. package/lib/types/insights/index.d.ts +11 -11
  36. package/lib/types/workload/index.d.ts +61 -0
  37. package/lib/types.js +1 -1
  38. package/lib/visuals.js +1 -1
  39. package/package.json +1 -1
  40. package/lib/chunks/index-BlYPxLja.js +0 -311
  41. package/lib/chunks/source-instrument-form-context-Bg6JzU76.js +0 -5
  42. package/lib/containers/insights/findings/drawer/anomaly/anomaly-blast-radius/index.d.ts +0 -7
  43. /package/lib/{containers/insights/findings/drawer/anomaly/anomaly-blast-radius → snippets/blast-radius}/animated-edge.d.ts +0 -0
  44. /package/lib/{containers/insights/findings/drawer/anomaly/anomaly-blast-radius → snippets/blast-radius}/blast-radius-node.d.ts +0 -0
  45. /package/lib/{containers/insights/findings/drawer/anomaly/anomaly-blast-radius → snippets/blast-radius}/types.d.ts +0 -0
@@ -0,0 +1,27 @@
1
+ ---
2
+ description: Frontend implementation without a dedicated designer — reuse existing Odigos UI, do not block on Figma
3
+ alwaysApply: true
4
+ ---
5
+
6
+ # Odigos frontend workflow
7
+
8
+ The frontend team is two developers. Alon owns technical direction and UX decisions. There is no dedicated designer and no Figma requirement before implementation.
9
+
10
+ Apply this only to frontend/UI work in this design-system repo.
11
+
12
+ ## How to implement
13
+
14
+ - Do not treat Figma as a hard dependency. Start from the product requirement plus existing screens, shared components, and similar flows.
15
+ - Search the repo for an existing implementation before proposing a new pattern, layout, or interaction.
16
+ - Prefer existing ui-kit components, layouts, and already-shipped Odigos screens over new visual conventions.
17
+ - Consistency with the current product matters more than novelty. Do not invent design debt to move faster.
18
+ - A first implementation can start from a clear product/UX spec. Visual polish comes after review and iteration.
19
+
20
+ ## When something is ambiguous
21
+
22
+ - If the decision can be derived from an existing Odigos screen or component, follow that.
23
+ - If it cannot, surface the UX decision explicitly and treat Alon as the design owner. Do not silently invent a new pattern.
24
+
25
+ ## Encoding design knowledge
26
+
27
+ When a UI pattern is reused or decided, prefer capturing it in shared components, examples, or a Cursor rule over leaving it as tribal knowledge.
@@ -0,0 +1,40 @@
1
+ ---
2
+ description: Odigos feedback, tables, and forms — Badge, Note, Table, NoData, shared fields
3
+ globs: **/*.{ts,tsx}
4
+ alwaysApply: false
5
+ ---
6
+
7
+ # Feedback, tables, and forms
8
+
9
+ **Status and feedback**
10
+
11
+ - Pill/status: `Badge` + `StatusType`
12
+ - Inline or in-page banner: `Note`
13
+ - Global toast: `ToastList` via the notification store
14
+ - Empty: `NoData` (icon, title, subtitle, optional CTA)
15
+ - Loading: `Loader` or table `SkeletonLoader`
16
+ - Conditions/health: `Condition` / `Conditions` / `StatusCard`
17
+ - There is no `Alert` or `Snackbar` component
18
+
19
+ **Tables**
20
+
21
+ - Use `Table` (`TableVariant.Data` or `Pretty`)
22
+ - Loading: `isLoading`
23
+ - Empty: `noDataProps` → `NoData`
24
+ - Row actions: `getRowActions` / `HoverAction`
25
+ - Wrap with `SectionCard` + `Search` like `CentralConnections` or `RulesTable`
26
+
27
+ **Forms**
28
+
29
+ - Fields: `Input`, `Textarea`, `Checkbox`, `Toggle`, `DropDown`, `Autocomplete`, `InputList`, `InputTable`, `FieldTitle`, `FieldMessage`
30
+ - Catalog/YAML-driven fields: `DynamicField`
31
+ - Drawer forms: save/cancel in `WideDrawer` footer; dirty close → `CancelModal`
32
+ - Settings forms: save/cancel on `Island`
33
+ - Labels/validation: `BUTTON_TEXTS`, `FORM_ALERTS`
34
+
35
+ @src/components/badge/index.tsx
36
+ @src/components/note/index.tsx
37
+ @src/components/no-data/index.tsx
38
+ @src/components/table/index.tsx
39
+ @src/components/input/index.tsx
40
+ @src/containers/toast-list/index.tsx
@@ -0,0 +1,21 @@
1
+ ---
2
+ description: Frontend/UI work — search existing Odigos patterns before inventing new UI
3
+ alwaysApply: true
4
+ ---
5
+
6
+ # UI implementation
7
+
8
+ There is no dedicated designer. Infer the first implementation from the product requirement and existing Odigos UI. Alon owns UX decisions that cannot be derived from the product.
9
+
10
+ Before creating a new UI pattern:
11
+
12
+ 1. Search ui-kit (`src/components`, `src/containers`, `src/snippets`) and shipped screens for a similar implementation.
13
+ 2. Prefer existing shared components over new ones.
14
+ 3. Do not invent new colors, type sizes, or visual conventions. Use `theme.v2` and existing component styles.
15
+ 4. Side-panel create/edit/detail flows use `Drawer` or `WideDrawer`, not a new page.
16
+ 5. Status uses `Badge` + `StatusType`. Inline/page feedback uses `Note`. Toasts use `ToastList`. There is no `Alert` or `Snackbar`.
17
+ 6. Tables use `Table` with `isLoading` (`SkeletonLoader`) and `noDataProps` (`NoData`).
18
+ 7. New pages follow an existing container structure (Overview, table page, Settings, or graph). Do not invent a generic List/Detail/Settings page type.
19
+ 8. If no suitable pattern exists, flag it explicitly before inventing a new one. Do not silently create design debt.
20
+
21
+ Canonical examples live in Storybook container stories and `src/containers/*/story.stories.tsx`.
@@ -0,0 +1,34 @@
1
+ ---
2
+ description: Odigos page layouts and drawer flows — Overview, table pages, Settings, Drawer, WideDrawer
3
+ globs: **/*.{ts,tsx}
4
+ alwaysApply: false
5
+ ---
6
+
7
+ # Pages and drawers
8
+
9
+ There are no generic `ListPage`, `DetailPage`, or `SettingsPage` abstractions. Compose from existing containers.
10
+
11
+ **Page chrome:** `PageContent` → `SectionCard` (title / search / filters / actions + body). App shell is `Header` + `Navbar`. Bulk/dirty actions use bottom `Island`.
12
+
13
+ **Use an existing page shape:**
14
+
15
+ - Entity board: `Overview` — filters in `SectionCard`, columns, drawers, `Island`
16
+ - Table page: `CentralConnections` or `SamplingRules` — `SectionCard` + `Table` + search + create action + `Island`
17
+ - Settings: `Settings` — side menu + stacked `SectionCard`s + dirty `Island` + YAML `Drawer`
18
+ - Graph: `ServiceMap` only when the page is a canvas
19
+
20
+ **Detail is a drawer, not a route.** Create/edit/detail of an entity opens a drawer.
21
+
22
+ - Two-column create/pick flows: `WideDrawer` (list + form, Cancel/Save or Back/Next, dirty `CancelModal`)
23
+ - Tabbed detail: `Drawer` + `Segment` (see `EditSourceDrawer`)
24
+ - Stepped wizard: `Drawer` + step state (see `CreateCloudConnectorDrawer`)
25
+ - Confirm discard/delete: `CancelModal` / `DeleteModal` / `WarningModal`
26
+ - Do not use `Modal` as a substitute for these side-panel workflows
27
+
28
+ @src/components/styled.ts
29
+ @src/components/_cards/section-card/index.tsx
30
+ @src/components/drawer/index.tsx
31
+ @src/snippets/wide-drawer/index.tsx
32
+ @src/containers/overview/index.tsx
33
+ @src/containers/central-connections/index.tsx
34
+ @src/containers/settings/index.tsx
@@ -0,0 +1,27 @@
1
+ ---
2
+ description: Odigos visual language — theme.v2 colors, type sizes, and existing radii
3
+ globs: **/*.{ts,tsx}
4
+ alwaysApply: false
5
+ ---
6
+
7
+ # Visual language
8
+
9
+ Use the styled-components theme. Do not introduce new hex colors, type sizes, or one-off visual scales.
10
+
11
+ - Colors: `theme.v2.colors.{family}.{weight}` from `@/theme/palettes`.
12
+ - Type sizes: `theme.v2.text.size` or `Typography` + `TypographySize` (`xxxs` 10 through `xxxl` 48).
13
+ - Status color: `StatusType` + `getStatusColor`, never hardcoded status hex.
14
+ - Fonts: `theme.font_family` — Inter, Kode Mono, IBM Plex Mono.
15
+ - z-index: `theme.v2.zIndex` (drawer/modal `1000`, dropdown `1100`, tooltip `1200`).
16
+
17
+ There is no spacing or shadow token scale. Reuse the values already used by primitives:
18
+
19
+ - Gaps/padding: `2, 4, 8, 12, 16, 24, 32` via `PageContent`, `FlexRow`, `FlexColumn`, `Padding`
20
+ - Radii already in use: inputs/buttons `6px`, `SectionCard` `16px`, drawer/modal `20px`, `Badge` pill `100px`
21
+
22
+ Copy comes from `@/constants/strings` (`DISPLAY_TITLES`, `BUTTON_TEXTS`, `FORM_ALERTS`) or the domain constants next to the feature. Do not invent button labels when a shared string exists.
23
+
24
+ @src/theme/palettes/index.ts
25
+ @src/components/typography/index.tsx
26
+ @src/functions/get-status-color/index.ts
27
+ @src/constants/strings/index.ts
package/CHANGELOG.md CHANGED
@@ -1,5 +1,20 @@
1
1
  # Changelog
2
2
 
3
+ ## [0.0.288](https://github.com/odigos-io/ui-kit/compare/ui-kit-v0.0.287...ui-kit-v0.0.288) (2026-08-24)
4
+
5
+
6
+ ### Features
7
+
8
+ * add auto-guardrail for transaction services ([#1232](https://github.com/odigos-io/ui-kit/issues/1232)) ([c4bf356](https://github.com/odigos-io/ui-kit/commit/c4bf356ef7c553b1943f07666e5ae4d5f488ec30))
9
+ * Add required artifacts to show instrumentation steps on the source ([#1246](https://github.com/odigos-io/ui-kit/issues/1246)) ([9e96967](https://github.com/odigos-io/ui-kit/commit/9e9696700857ac8a9b806b8fb014ee8b2c6e4c8a))
10
+ * add transactions as a Guardrails facet (PLAT-1441) ([#1238](https://github.com/odigos-io/ui-kit/issues/1238)) ([718cde7](https://github.com/odigos-io/ui-kit/commit/718cde7d15bd5d60b0d4ae792bdfd3bd79aeaabc))
11
+ * implement Blast Radius for Findings of type `Violation` ([#1234](https://github.com/odigos-io/ui-kit/issues/1234)) ([6e71908](https://github.com/odigos-io/ui-kit/commit/6e71908826ca5631d210e577d60ceec8e47723af))
12
+
13
+
14
+ ### Bug Fixes
15
+
16
+ * clean up unused insights findings lookback settings ([#1236](https://github.com/odigos-io/ui-kit/issues/1236)) ([367fe90](https://github.com/odigos-io/ui-kit/commit/367fe9095806c3156955fa1c1370cc3fc014133d))
17
+
3
18
  ## [0.0.287](https://github.com/odigos-io/ui-kit/compare/ui-kit-v0.0.286...ui-kit-v0.0.287) (2026-08-23)
4
19
 
5
20
 
@@ -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-CjgsN17j.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`
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-D8rTJS7r.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,351 @@
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,{useMemo as o,useRef as s,useCallback as c,useState as d,memo as p,useEffect as u,Fragment as h,forwardRef as g,useImperativeHandle as m}from"react";import"@xyflow/react/dist/style.css";import{Handle as v,Position as f,getSmoothStepPath as b,BaseEdge as y,EdgeLabelRenderer as x,MarkerType as $,ReactFlowProvider as C,useNodesState as k,useEdgesState as w,ReactFlow as S,Background as T,useReactFlow as M}from"@xyflow/react";import{D as A,c as P,F as O,d as L,e as E,f as I,g as N,h as R,B as V,i as z,j as D,k as X,C as _,N as H,W as B,u as j,M as q,I as U,l as G,m as K,n as F,o as W,p as Y,V as J,q as Z,r as Q,s as ee,v as te,w as ae,x as re,y as le,z as ne,E as ie,G as oe,H as se,J as ce,K as de,L as pe,O as ue,S as he,Q as ge,U as me,X as ve,Y as fe,Z as be,_ as ye,$ as xe,a0 as $e,a1 as Ce,a2 as ke,a3 as we,a4 as Se,a5 as Te,a6 as Me,a7 as Ae,a8 as Pe,a9 as Oe,aa as Le,ab as Ee,T as Ie,ac as Ne,ad as Re,ae as Ve,af as ze,ag as De,ah as Xe,ai as _e,aj as He,ak as Be,al as je,am as qe,an as Ue,ao as Ge,b as Ke,ap as Fe,aq as We,ar as Ye,as as Je,at as Ze,au as Qe,av as et,aw as tt,ax as at,ay as rt,az as lt,aA as nt,aB as it,aC as ot,aD as st,aE as ct,aF as dt,aG as pt,aH as ut,aI as ht,aJ as gt,aK as mt,aL as vt,aM as ft,aN as bt,aO as yt,aP as xt,aQ as $t,aR as Ct,aS as kt,aT as wt,aU as St,aV as Tt,aW as Mt,aX as At,aY as Pt,aZ as Ot,a_ as Lt,a$ as Et,b0 as It,b1 as Nt,b2 as Rt,b3 as Vt,b4 as zt,b5 as Dt,b6 as Xt,b7 as _t,R as Ht,b8 as Bt,A as jt,b9 as qt}from"./ui-components-D8rTJS7r.js";import{UserIcon as Ut,DestinationIcon as Gt,HomeIcon as Kt,XIcon as Ft,VIcon as Wt,TrashIcon as Yt,PlusIcon as Jt,VSquareIcon as Zt,XSquareIcon as Qt,EditIcon as ea,OdigosLogoTextCentral as ta,OdigosLogoTextEnterprise as aa,OdigosLogoTextCommunity as ra,OdigosLogoTextColoredCentral as la,OdigosLogoTextColoredEnterprise as na,OdigosLogoTextColoredCommunity as ia,ArrowLeftIcon as oa,ArrowRightIcon as sa,CopyIcon as ca,YamlIcon as da}from"../icons.js";import{i as pa,m as ua,u as ha,n as ga,a as ma,C as va,b as fa,d as ba,e as ya,f as xa,g as $a,h as Ca,j as ka,k as wa}from"./helpers-BCSEuuKh.js";const Sa=/^[a-zA-Z]$/,Ta=new Set(["*","+","?"]),Ma=new Set(["^","$"]),Aa={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"},Pa=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
+ `,Oa=r.span`
22
+ background: ${({$kind:e})=>Aa[e]};
23
+ `,La=({pattern:t,"data-id":a})=>{const r=o(()=>(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(Ta.has(t)||Ma.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(Pa,t?{"data-id":a,children:r.map((t,a)=>e(Oa,{$kind:t.kind,children:t.text},a))}:{"data-id":a,children:" "})},Ea="rgba(102, 191, 255, 0.5)",Ia=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
+ `,Ra=r.div`
49
+ ${Ia}
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
+ `,Va=r.textarea`
63
+ ${Ia}
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
+ `,za=e=>({before:e,matchPre:"",capture:"",matchPost:"",after:""}),Da=({regex:a,value:r,onChange:l,minHeight:n=240,...i})=>{const d=s(null),p=s(null),u=o(()=>((e,t)=>{if(!e||!t)return za(t);let a;try{a=new RegExp(e)}catch{return za(t)}const r=a.exec(t);if(!r)return za(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=c(()=>{d.current&&p.current&&(d.current.scrollTop=p.current.scrollTop,d.current.scrollLeft=p.current.scrollLeft)},[]);return t(Na,{$minHeight:n,children:[t(Ra,{ref:d,"aria-hidden":!0,children:[u.before,e("span",{style:{background:Ea},children:u.matchPre}),e("span",{style:{background:"rgba(102, 242, 102, 0.5)"},children:u.capture}),e("span",{style:{background:Ea},children:u.matchPost}),u.after,r.endsWith("\n")?" ":""]}),e(Va,{ref:p,$minHeight:n,value:r,onChange:e=>l(e.target.value),onScroll:h,spellCheck:!1,...i})]})},Xa=r.div`
82
+ flex: 1;
83
+ min-height: 0;
84
+ overflow-y: auto;
85
+ `,_a=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
+ `,Ha=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
+ `,Ba=({isOpen:a,regex:r,onClose:l,initialTestString:n=""})=>{const[i,s]=d(n),c=o(()=>((e,t)=>{if(!e)return{ok:!0,isMatch:!1,message:P.RESULT_EMPTY_REGEX};if(!t)return{ok:!0,isMatch:!1,message:P.RESULT_EMPTY_INPUT};let a;try{a=new RegExp(e)}catch(e){return{ok:!1,message:e instanceof Error?e.message:P.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:P.RESULT_NO_MATCH}})(r,i),[r,i]),p=c.ok?c.isMatch?"match":"neutral":"error";return e(A,{isOpen:a,header:{title:P.TITLE,onClose:()=>{s(""),l()}},children:e(Xa,{children:t(_a,{children:[t(O,{$gap:6,children:[e(L,{label:P.REGEX_LABEL}),e(La,{pattern:r,"data-id":"regex-tester-regex"}),!r&&e(E,{size:N.XXS,color:I.Secondary,children:P.REGEX_EMPTY_HINT})]}),t(O,{$gap:6,children:[t(R,{$width:"100%",$justifyContent:"space-between",$alignItems:"center",children:[e(L,{label:P.TEST_STRING_LABEL}),e(V,{"data-id":"regex-tester-unescape",label:P.UNESCAPE_LABEL,tooltip:P.UNESCAPE_TOOLTIP,variant:D.Secondary,size:z.S,onClick:()=>s(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(Da,{name:"regex-tester-test-string","data-id":"regex-tester-test-string",placeholder:P.TEST_STRING_PLACEHOLDER,regex:r,value:i,onChange:s,minHeight:240}),e(X,{helpMessage:P.TEST_STRING_HELP})]}),t(O,{$gap:8,children:[e(L,{label:P.RESULT_LABEL}),e(Ha,{$tone:p,"data-id":"regex-tester-result",children:c.message}),c.ok&&c.isMatch&&e(E,{size:N.XXS,color:I.Secondary,children:P.RESULT_CAPTURE_HINT})]})]})})});var u},ja=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
+ `,qa=({open:t,children:a,delayInMs:r=0,gapCancelPx:l=0})=>e(ja,{$open:t,$delayInMs:r,$gapCancelPx:l,"aria-hidden":!t,children:e("div",{className:"animated-collapse-inner",children:a})}),Ua=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
+ ${({theme:e,$isRoot:t,$isVirtual:a})=>t?`solid ${e.v2.colors.purple[400]}`:a?`dashed ${e.v2.colors.silver[300]}`:`solid ${e.v2.colors.silver[200]}`};
130
+ opacity: ${({$isVirtual:e,$isRoot:t})=>e&&!t?.85:1};
131
+ `,Ga=r.div`
132
+ display: flex;
133
+ align-items: center;
134
+ gap: 4px;
135
+ min-width: 0;
136
+ `,Ka=r.div`
137
+ flex-shrink: 0;
138
+ width: 16px;
139
+ height: 16px;
140
+ display: flex;
141
+ align-items: center;
142
+ justify-content: center;
143
+ `,Fa={visibility:"hidden"},Wa=p(({data:r})=>{const l=n(),{service:i,namespace:o,isVirtual:s,isRoot:c,isAttacker:d,isUser:p}=r,u=((e,t)=>"user"===e?Ut:t?Gt:Kt)(i,s),h=c?l.v2.colors.purple[400]:l.v2.colors.silver[200],g=c?I.Link:I.Secondary,m=o?`${o}/${i}`:i,b=s?"virtual":"-";return t(a,{children:[e(v,d||p?{type:"source",position:f.Bottom,style:Fa}:{type:"source",position:f.Top,style:Fa}),e(v,d||p?{type:"target",position:f.Right,style:Fa}:{type:"target",position:f.Left,style:Fa}),t(Ua,{$isRoot:c,$isVirtual:s,children:[t(Ga,{children:[e(Ka,{children:e(u,{size:16,fill:h})}),e(E,{size:N.XXXS,color:g,nowrap:!0,children:m})]}),e(E,{size:N.XXXS,color:g,nowrap:!0,children:b})]})]})});Wa.displayName=Wa.name;const Ya="0;0.5;1",Ja=p(({id:r,sourceX:l,sourceY:i,targetX:s,targetY:c,sourcePosition:d,targetPosition:p,markerEnd:u,style:h,data:g})=>{const m=n(),[v]=b({sourceX:l,sourceY:i,targetX:s,targetY:c,sourcePosition:d,targetPosition:p}),f=`${r}__blast-radius-motion`,$=!!g?.isAttacker,C="string"==typeof h?.stroke?h.stroke:$?m.v2.colors.red[500]:m.v2.colors.silver[400],k=$?m.v2.colors.red[700]:m.v2.colors.silver[600],w=$?m.v2.colors.red[400]:m.v2.colors.silver[200],{travelDuration:S,ballCount:T}=o(()=>{const e=Math.hypot(s-l,c-i),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})(v,e);return{travelDuration:Math.max(1.2,t/100),ballCount:Math.min(10,Math.max(3,Math.round(t/72)))}},[v,l,i,s,c]),M=`${S.toFixed(3)}s`;return t(a,{children:[e(y,{id:r,path:v,markerEnd:u,style:{...h,stroke:C,strokeWidth:1}}),e(x,{children:t("svg",{style:{position:"absolute",top:0,left:0,width:"100%",height:"100%",overflow:"visible",pointerEvents:"none"},children:[e("path",{id:f,d:v,fill:"none",stroke:"none"}),Array.from({length:T}).map((a,r)=>{const l=`-${(S/T*r).toFixed(3)}s`;return t("circle",{r:0,fill:k,children:[e("animateMotion",{dur:M,begin:l,repeatCount:"indefinite",children:e("mpath",{href:`#${f}`})}),e("animate",{attributeName:"r",dur:M,begin:l,repeatCount:"indefinite",keyTimes:Ya,values:"0;3.5;3.5"}),e("animate",{attributeName:"fill",dur:M,begin:l,repeatCount:"indefinite",keyTimes:Ya,values:`${k};${w};${w}`})]},r)})]})})]})});var Za,Qa;Ja.displayName=Ja.name,(e=>{e.Service="blast-radius-service"})(Za||(Za={})),(e=>{e.Animated="blast-radius-animated"})(Qa||(Qa={}));const er=(e,t)=>{const a=(e||"").trim();return a?`${a}/${t}`:t},tr=e=>er(e.namespace,e.service),ar="user",rr=(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},lr=(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},nr=(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},ir=r.div`
144
+ position: relative;
145
+ width: 100%;
146
+ height: 286px;
147
+ border-radius: 8px;
148
+ overflow: hidden;
149
+ background-color: ${({theme:e})=>e.v2.colors.silver[1e3]};
150
+
151
+ .react-flow__attribution {
152
+ visibility: hidden;
153
+ }
154
+
155
+ * {
156
+ transition: none;
157
+ }
158
+ `,or={[Za.Service]:Wa},sr={[Qa.Animated]:Ja},cr={duration:300,padding:.2,includeHiddenNodes:!0,maxZoom:1},dr=({trigger:e})=>{const{fitView:t}=M(),a=s(!0);return u(()=>{a.current?a.current=!1:e>0&&requestAnimationFrame(()=>t(cr))},[e,t]),null},pr=({subgraph:a})=>{const r=n(),[l,i,s]=k([]),[c,p,h]=w([]),[g,m]=d(0),[v,f]=d(null),b=o(()=>{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]);u(()=>{const e=((e,t)=>{const a=t.find(t=>t.service===ar&&t.id!==e);return a?.id??null})(tr(a.root),a.nodes.map(e=>({id:tr(e),service:e.service}))),t=((e,t)=>{const a=tr(e.root);return e.nodes.map(e=>{const r=tr(e);return{id:r,type:Za.Service,position:{x:0,y:0},data:{service:e.service,namespace:e.namespace||"",isVirtual:e.isVirtual,isRoot:r===a,isAttacker:r===t,isUser:e.service===ar},measured:{width:120,height:58}}})})(a,e),l=new Set(t.map(e=>e.id)),n=((e,t,a,r)=>{const l=t.v2.colors.silver[400],n=t.v2.colors.red[500],i=tr(e.root);return e.edges.flatMap(e=>{const t=(e=>er(e.clientNamespace,e.clientService))(e),o=(e=>er(e.serverNamespace,e.serverService))(e);if(!a.has(t)||!a.has(o))return[];const s=!!r&&(t===r&&o===i||t===i&&o===r),c=s?n:l;return[{id:`${t}->${o}`,type:"smoothstep",source:t,target:o,data:{isAttacker:s},markerEnd:{type:$.ArrowClosed,color:c,width:16,height:16},style:{stroke:c,strokeWidth:1}}]})})(a,r,l,e),o=((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.isAttacker)?.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=rr((n.get(a)??[]).filter(e=>e!==r),a,i),s=rr((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 lr(d,0,-1))u.set(e,t);for(const[e,t]of lr(p,0,1))u.set(e,t);return r&&u.set(r,nr(r,i.get(r)??[],u)),{nodes:e.map(e=>({...e,position:u.get(e.id)??e.position})),edges:t}})(t,n);i(o.nodes),p(o.edges),f(null),m(e=>e+1)},[b,a,r,i,p]);const y=o(()=>v?c.map(e=>{if(e.source===v||e.target===v)return{...e,type:Qa.Animated};const t={opacity:.3};return{...e,style:{...e.style,...t},labelStyle:{...e.labelStyle,...t},labelBgStyle:{...e.labelBgStyle,...t}}}):c,[c,v]);return e(ir,{children:t(S,{nodes:l,edges:y,nodeTypes:or,edgeTypes:sr,onNodesChange:s,onEdgesChange:h,onNodeMouseEnter:(e,t)=>f(t.id),onNodeMouseLeave:()=>f(null),nodesDraggable:!1,nodesConnectable:!1,elementsSelectable:!1,panOnDrag:!0,zoomOnScroll:!0,minZoom:.4,maxZoom:1.5,proOptions:{hideAttribution:!0},children:[e(T,{color:r.v2.colors.silver[600],gap:17,size:1}),e(dr,{trigger:g})]})})},ur=({blastRadius:t})=>t?.nodes?.length?e(C,{children:e(pr,{subgraph:t})}):e(_,{children:e(H,{subTitle:"No blast-radius neighborhood for this service yet."})}),hr=({isOpen:t,onClose:a,onDeny:r,onApprove:l})=>e(B,{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:D.Secondary,onClick:()=>{r?.(),a()}},approveButton:{label:"Discard changes",variant:D.Primary,onClick:()=>{l?.(),a()}}}),gr=r.div`
159
+ display: flex;
160
+ flex-direction: column;
161
+ gap: 12px;
162
+ width: 70vw;
163
+ height: 70vh;
164
+ padding: 12px;
165
+ overflow: auto;
166
+ `,mr=r.div`
167
+ display: flex;
168
+ align-items: center;
169
+ justify-content: space-between;
170
+ width: 100%;
171
+ `,vr=({isOpen:a,onClose:r,language:l,code:n,...i})=>{const{CopyButton:o}=j();return e(q,{isOpen:a,onClose:r,children:t(gr,{children:[t(mr,{children:[e(E,{size:N.XS,children:"JSON view"}),e(U,{icon:t=>e(Ft,{...t}),size:G.L,onClick:r})]}),l&&n?e(K,{fullHeight:!0,overflow:"auto",children:t(R,{$width:"100%",$alignItems:"flex-start",$justifyContent:"space-between",children:[e(F,{language:l,code:n,...i}),e(o,{value:n})]})}):e(H,{})]})})},fr=({isOpen:t,onClose:a,onViewConnector:r})=>e(B,{isOpen:t,onClose:a,visual:()=>e(J,{scale:1.2,icon:Wt}),title:Y.CLOUD_CONNECTOR_CREATED_MODAL_TITLE,description:Y.CLOUD_CONNECTOR_CREATED_MODAL_DESC,denyButton:{label:W.STAY_ON_CONNECTIONS,variant:D.Secondary,onClick:a},approveButton:{label:W.GO_TO_CONNECTOR_OVERVIEW,variant:D.Primary,onClick:r??a}}),br=({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(B,{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:D.Secondary,onClick:()=>{r?.(),a()}},approveButton:{label:s??d,variant:D.Primary,onClick:()=>{l?.(),a()}}})},yr=({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=te.L,keyLabel:$,valueLabel:C})=>{switch(t){case Z.Input:return e(ce,{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===de.Number?""===t?null:Number(t):t)},errorMessage:u,warnMessage:h,helpMessage:g},r);case Z.MultiInput:return e(se,{name:r,label:l,tooltip:n,badge:i,placeholder:o,required:s,disabled:c,values:Array.isArray(d)?d:oe(d,[]),setValues:e=>p(e),errorMessage:u,warnMessage:h,helpMessage:g,plain:!0},r);case Z.KeyValuePair:return e(ie,{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:oe(d,[]),setValues:e=>p(e),errorMessage:u,warnMessage:h,helpMessage:g},r);case Z.TextArea:return e(ne,{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 Z.Dropdown:return e(le,{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 Z.Checkbox:return e(re,{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 Z.Time:return e(ae,{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 Z.Toggle:return e(Q,{name:r,size:x,labelAlign:ee.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}},xr=r.div`
172
+ display: flex;
173
+ flex-wrap: wrap;
174
+ gap: 8px;
175
+ `,$r=r.div`
176
+ display: flex;
177
+ align-items: center;
178
+ gap: 8px;
179
+ padding: 8px 12px;
180
+ border-radius: 8px;
181
+ cursor: pointer;
182
+ background: ${({theme:e,$selected:t})=>t?e.v2.colors.silver[700]:e.v2.colors.silver[800]};
183
+ border: 1px solid ${({theme:e,$selected:t})=>t?e.v2.colors.silver[500]:e.v2.colors.silver[750]};
184
+
185
+ &:hover {
186
+ background: ${({theme:e})=>e.v2.colors.silver[700]};
187
+ }
188
+ `,Cr=r.div`
189
+ display: flex;
190
+ width: 32px;
191
+ height: 32px;
192
+ justify-content: center;
193
+ align-items: center;
194
+ flex-shrink: 0;
195
+ `,kr=r.div`
196
+ display: flex;
197
+ flex-direction: column;
198
+ gap: 12px;
199
+ `,wr=r.div`
200
+ display: flex;
201
+ flex-wrap: wrap;
202
+ gap: 6px;
203
+ `,Sr=r.div`
204
+ display: flex;
205
+ align-items: center;
206
+ gap: 8px;
207
+ &::before,
208
+ &::after {
209
+ content: '';
210
+ flex: 1;
211
+ height: 1px;
212
+ background-color: ${({theme:e})=>e.v2.colors.silver[700]};
213
+ }
214
+ `,Tr=r.div`
215
+ padding: 2px 10px;
216
+ border-radius: 999px;
217
+ background-color: ${({theme:e})=>e.v2.colors.silver[700]};
218
+ border: 1px solid ${({theme:e})=>e.v2.colors.silver[600]};
219
+ `,Mr={[xe.JavaScript]:"Node.js",[xe.DotNet]:".NET",[xe.Php]:"PHP",[xe.Java]:"Java",[xe.Go]:"Go",[xe.Python]:"Python",[xe.Ruby]:"Ruby",[xe.Rust]:"Rust"},Ar=[xe.Python,xe.Java,xe.JavaScript,xe.DotNet,xe.Php,xe.Ruby,xe.Go],Pr=[{value:"all",label:"Entire Cluster"},{value:"source",label:"Specific Source"},{value:"namespace",label:"Specific Namespace"},{value:"language",label:"Specific Programming Language"}];function Or(e){return Mr[e]||e.charAt(0).toUpperCase()+e.slice(1)}function Lr(e){return null!=e?`${e}. ${Oe}`:Oe}const Er=({readOnly:t,...a})=>e(t?Rr:zr,{...a}),Ir=({title:a,count:r,children:l})=>t(O,{$gap:6,children:[t(R,{$gap:8,$alignItems:"center",children:[e(E,{size:N.XS,color:I.Primary,nowrap:!0,children:a}),r>1&&e(E,{size:N.XXS,color:I.Secondary,nowrap:!0,children:`(${Ae})`})]}),e(wr,{children:l})]}),Nr=()=>{const t=n();return e(Sr,{children:e(Tr,{children:e(E,{size:N.XXS,color:t.v2.colors.white[500],nowrap:!0,children:Pe})})})},Rr=({scopes:a,titleNumber:r})=>{const l=Lr(r);if(pa(a))return e(K,{bgTint:"900",richTitle:{title:l},withCollapse:!0,collapseIsDefaultOpen:!0,children:e(pe,{status:he.Default,message:ue,fullWidth:!0})});const n=a.sources??[],o=a.namespaces??[],s=a.languages??[],c=[];return n.length&&c.push({kind:"sources",node:e(Ir,{title:ge,count:n.length,children:n.map((t,a)=>{const r=[t.namespace,t.kind,t.name].filter(Boolean),l=r.length?r.join(" / "):ve;return e(me,{label:l},`src-${a}-${l}`)})})}),o.length&&c.push({kind:"namespaces",node:e(Ir,{title:fe,count:o.length,children:o.map((t,a)=>e(me,{label:t},`ns-${a}-${t}`))})}),s.length&&c.push({kind:"languages",node:e(Ir,{title:be,count:s.length,children:s.map((t,a)=>{const r=$e(t);return e(me,{label:Or(t),leftIcon:r},`lang-${a}-${t}`)})})}),e(K,{bgTint:"900",richTitle:{title:l,subTitle:c.length>1?ye:void 0},withCollapse:!0,collapseIsDefaultOpen:!0,children:e(K,{bgTint:"800",children:e(kr,{children:c.map((a,r)=>t(i.Fragment,{children:[r>0&&e(Nr,{}),a.node]},a.kind))})})})},Vr=e=>e.sources.length>0?"source":e.namespaces.length>0?"namespace":e.languages.length>0?"language":"all",zr=({scopes:a,onChange:r,sourceOptions:l=[],namespaceOptions:n=[],supportedLanguages:i,titleNumber:s,dataIdPrefix:p="source-scope",slim:h,disabled:g})=>{const m=a??ua(),[v,f]=d(()=>Vr(m)),{sources:b,namespaces:y,languages:x}=m,$=b.length>0||y.length>0||x.length>0;u(()=>{$&&"all"===v&&f(Vr(m))},[$,v]);const C=o(()=>Pr.map(e=>"language"===e.value&&0===i?.length?null:{...e,disabled:"all"===e.value&&$}).filter(Boolean),[$]),k=o(()=>b.map(e=>`${e.namespace}/${e.kind}/${e.name}`),[b]),w=o(()=>[...y],[y]),S=o(()=>new Set(x),[x]),T=c(e=>{f(e)},[]),M=c(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}));r({...m,sources:t})},[m,r]),A=c(e=>{r({...m,namespaces:e})},[m,r]),P=c(e=>{const t=m.languages,a=t.includes(e)?t.filter(t=>t!==e):[...t,e];r({...m,languages:a})},[m,r]),L=!$&&"all"===v,R=(i||Ar).map(e=>({id:e,label:Mr[e]??e.charAt(0).toUpperCase()+e.slice(1),Icon:$e(e)}));return t(Ce,{richTitle:h?{title:Lr(s),titleSize:N.XS,titleColor:I.Secondary,tooltip:ke}:{title:Lr(s),subTitle:ke,subTitleWrap:!0},backgroundColor:h?"transparent":void 0,padding:h?0:void 0,children:[e(pe,L?{status:he.Default,message:ue,fullWidth:!0,smallIcon:!0}:{status:he.Info,message:ye,fullWidth:!0,smallIcon:!0}),e(O,{$alignItems:"flex-start",children:e(we,{options:C,selected:v,setSelected:T,disabled:g})}),"source"===v&&e(Se,{multiple:!0,"data-id":`${p}-autocomplete-source`,options:l,value:k,onSelect:M,placeholder:Te,disabled:g}),"namespace"===v&&e(Se,{multiple:!0,"data-id":`${p}-autocomplete-namespace`,options:n,value:w,onSelect:A,placeholder:"Search namespace",disabled:g}),"language"===v&&R.length>0&&e(xr,{children:R.map(({id:a,label:r,Icon:l})=>{const n=S.has(a);return t($r,{$selected:n,onClick:()=>P(a),children:[e(re,{name:`${p}-lang-${a}`,size:Me.S,value:n,onChange:()=>P(a),disabled:g}),e(Cr,{children:e(l,{size:20})}),e(E,{size:N.XS,nowrap:!0,children:r})]},a)})})]})},Dr=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)}},Xr=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}}},_r=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:Dr(t.options??t.values),fullRow:t.fullRow,defaultValue:t.defaultValue,withRegexTester:t.withRegexTester,separator:t.separator,copyByColumn:t.copyByColumn,renderCondition:Xr(t.renderCondition)}})},Hr=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(Br):void 0}})},Br=e=>{const t="string"==typeof e.componentProperties?oe(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:Dr(t.options??t.values),itemWrapperKey:t.itemWrapperKey,columns:_r(t.columns),limitFieldsPerRow:t.limitFieldsPerRow,variant:t.variant,wrapKey:t.wrapKey,checkboxOptions:Hr(t.options??t.values),checkedValue:t.checkedValue??"true",valueMode:t.valueMode??"object",fields:Array.isArray(t.fields)?t.fields.map(Br):void 0,addLabel:t.addLabel,itemLabel:t.itemLabel,keyLabel:t.titleKey??t.keyLabel,valueLabel:t.titleValue??t.valueLabel,persistAs:t.persistAs}},jr=e=>{const t=e.initialValue;if(void 0!==t&&""!==t)return e.componentType===Z.CheckboxList?"array"===e.valueMode?oe(t,[]):oe(t,{}):e.componentType!==Z.MultiInput&&e.componentType!==Z.MultiTabledInput||!e.wrapKey?e.componentType===Z.MultiInput||e.componentType===Z.MultiTabledInput?oe(t,[]):e.componentType===Z.SourceScopes?"null"===t||"{}"===t?ua():ga(oe(t,null)):e.componentType===Z.Toggle||e.componentType===Z.Checkbox?"true"===t:t:{[e.wrapKey]:oe(t,[])}},qr=e=>"object"==typeof e&&null!==e&&!Array.isArray(e),Ur=e=>Array.isArray(e)?e:[],Gr=e=>{const t={};return e.forEach(e=>{t[String(e.key??"")]=String(e.value??"")}),t},Kr=e=>qr(e)?Object.entries(e).map(([e,t])=>({key:e,value:String(t??"")})):[],Fr=({field:t,value:a,setValue:r,errorMessage:l,disabled:n})=>{const[i,o]=d(()=>Kr(a));return u(()=>{const e=qr(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])})(Gr(i),e)||o(Kr(a))},[a]),e(ie,{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(Gr(e))},errorMessage:l})},Wr=({field:r,value:l,setValue:n,errorMessage:i,disabled:o,keyValuePersistAs:s,sourceOptions:c,namespaceOptions:p})=>{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:w,variant:S,wrapKey:T,checkboxOptions:M}=r,[A,P]=d({open:!1,value:""});if(h===Z.SourceScopes)return e(Er,{scopes:ga(l),onChange:e=>n(e),sourceOptions:c,namespaceOptions:p,dataIdPrefix:`dynamic-field-${u}`,slim:!0});if(h===Z.CheckboxList&&"array"===r.valueMode){const a=Ur(l),r=(e,t)=>n(t?[...a.filter(t=>t!==e),e]:a.filter(t=>t!==e));return t(O,{$gap:12,children:[m&&e(L,{label:m,tooltip:v,required:y}),e(O,{$gap:8,children:(M||[]).map(t=>{const l=e(re,{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(Ie,{text:t.tooltip,withIcon:!0,children:l},t.id):l})}),e(X,{errorMessage:i,helpMessage:b})]})}if(h===Z.CheckboxList){const a=qr(l)?l:{},c=(e=>"emptyObject"!==e.checkedValue||{})(r),d=e=>"emptyObject"===r.checkedValue?qr(e):!!e;return t(O,{$gap:12,children:[m&&e(E,{size:N.XS,color:I.Secondary,nowrap:!0,children:m}),e(O,{$gap:12,children:(M||[]).map(r=>{const l=a[r.id],i=d(l),p=qr(l)?l:{},h=e(re,{label:r.label,value:i,disabled:o,onChange:e=>n({...a,[r.id]:e?qr(l)?l:c:null})}),g=r.tooltip?e(Ie,{text:r.tooltip,withIcon:!0,children:h}):h,m=i&&r.fields?.length?e(O,{$gap:12,$padding:"0 0 0 24px",children:r.fields.map(t=>e(Wr,{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(O,{$gap:12,children:[g,m]},r.id)})}),e(X,{errorMessage:i,helpMessage:b})]})}if(h===Z.MultiTabledInput){const r=Ur(T?l?.[T]:l),s=e=>n(T?{...qr(l)?l:{},[T]:e}:e),c=(k||[]).some(e=>e.withRegexTester);return t(a,{children:[e("cards"===S?Ne:ie,{name:u,label:m,tooltip:v,helpMessage:b,required:y,disabled:o,columns:k||[],limitFieldsPerRow:w,values:r,setValues:s,errorMessage:i,onTestRegex:c?e=>P({open:!0,value:e}):void 0}),c&&e(Ba,{isOpen:A.open,regex:A.value,onClose:()=>P({open:!1,value:""})})]})}if(h===Z.MultiInput&&T){const t=Ur(l?.[T]);return e(se,{name:u,label:m,tooltip:v,helpMessage:b,required:y,disabled:o,placeholder:f,values:t,setValues:e=>n({...qr(l)?l:{},[T]:e}),errorMessage:i})}if(h===Z.MultiInput&&C){const t=Ur(l).map(e=>String(e?.[C]??""));return e(se,{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===Z.KeyValuePair?"map"===(r.persistAs??s)?e(Fr,{field:r,value:l,setValue:n,errorMessage:i,disabled:o}):e(yr,{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(yr,{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})},Yr=({field:r,value:l,setValue:i,disabled:o,keyValuePersistAs:s,sourceOptions:c,namespaceOptions:d})=>{const p=n(),u=Ur(l),g=u.length?u:[{}],m=r.fields||[],v=e=>i(e);return t(a,{children:[g.map((a,l)=>t(h,{children:[e(Ee,{}),t(O,{$gap:12,children:[t(R,{$justifyContent:"space-between",$alignItems:"center",children:[e(L,{label:`${r.itemLabel||r.title||"Item"} ${l+1}`}),e(V,{leftIcon:()=>e(Yt,{fill:p.v2.colors.red[500]}),variant:D.Secondary,size:z.S,onClick:()=>(e=>{const t=g.filter((t,a)=>a!==e);v(t)})(l),disabled:o||1===g.length})]}),m.map(t=>e(Wr,{field:t,value:a[t.name],setValue:e=>((e,t,a)=>v(g.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(V,{variant:D.Secondary,label:r.addLabel||"Add",leftIcon:Jt,onClick:()=>v([...g,{}]),disabled:o}),e(Ee,{})]})},Jr=({field:a,value:r,setValue:l,errorMessage:n,disabled:i})=>t(O,{$gap:12,children:[a.title&&e(L,{label:a.title,tooltip:a.tooltip,required:a.required}),e(O,{$gap:8,children:(a.checkboxOptions||[]).map(t=>{const a=e(re,{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(Ie,{text:t.tooltip,withIcon:!0,children:a},t.id):a})}),e(X,{errorMessage:n,helpMessage:a.helpMessage})]}),Zr=({signals:t,fields:r,value:l,setValue:n,formErrors:i,disabled:o,seedInitialValues:s,keyValuePersistAs:c="map",sourceOptions:d,namespaceOptions:p})=>{const{isK8s:h}=ha(),g=(r||[]).filter(e=>!!e).map(e=>Br(e));return u(()=>{if(!s)return;const e=l||{},t={};g.forEach(a=>{if(a.componentType===Z.SourceScopes&&!h)return;const r=a.componentType===Z.SourceScopes?jr(a)??ua():jr(a);if(void 0===r)return;if(a.componentType===Z.CheckboxList&&"flatFields"===a.valueMode&&qr(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===Z.SourceScopes){if(void 0!==l)return}else if(null!=l)return;t[a.name]=qr(r)&&qr(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&&!Le(a.renderCondition,t,s))return null;if(a.componentType===Z.SourceScopes&&!h)return null;const u=l?.[a.name],g=`${a.name}-${r}`;if(a.componentType===Z.FieldGroup)return e(Yr,{field:a,value:u,setValue:e=>n(a.name,e),disabled:o,keyValuePersistAs:c,sourceOptions:d,namespaceOptions:p},g);if(a.componentType===Z.CheckboxList&&"flatFields"===a.valueMode){const t=a.checkboxOptions?.map(e=>i[e.id]).find(Boolean);return e(Jr,{field:a,value:l||{},setValue:n,errorMessage:t,disabled:o},g)}return e(Wr,{field:a,value:u,setValue:e=>n(a.name,e),errorMessage:i[a.name],disabled:o,keyValuePersistAs:c,sourceOptions:d,namespaceOptions:p},g)})})},Qr=Zr,el=({isEnabled:t,setIsEnabled:a,fieldDisabled:r})=>{const l=n();return e(we,{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:Qt,label:"Disable",value:!1,selectedBgColor:l.v2.colors.red[1e3],selectedBorderColor:l.v2.colors.red[500],selectedTextColor:l.v2.colors.red[400]}],size:Re.S,selected:t,setSelected:a,disabled:r})},tl=r.div`
220
+ display: flex;
221
+ align-items: center;
222
+ gap: 24px;
223
+ padding: 8px 16px;
224
+ border-radius: 12px;
225
+ background-color: ${({theme:e})=>e.v2.colors.silver[800]};
226
+ `,al=r.div`
227
+ flex: 1;
228
+ min-width: 0;
229
+ white-space: pre;
230
+ overflow-x: auto;
231
+ `,rl=({title:a,summary:r,onEdit:l,renderAction:n})=>{const i=o(()=>{const e=[];return a&&(e.push({text:a,variant:ma.Default}),e.push({text:" - ",variant:ma.Default})),e.push(...r),e},[a,r]);return t(tl,{children:[e(al,{children:e(va,{parts:i})}),n&&n(),l&&e(V,{"data-id":"sampling-btn-edit-auto-rule",label:Ve,rightIcon:ea,variant:D.Text,size:z.S,onClick:l})]})},ll={[qe.HttpRequest]:"HTTP request",[qe.HttpResponse]:"HTTP response",[qe.DbQuery]:"DB query",[qe.Messaging]:"messaging"};function nl(e,t,a){return 1===e?t:a??`${t}s`}function il(e,t){const a=[],r=e.slice(0,3),l=e.slice(3);return r.forEach((e,r)=>{r>0&&a.push({text:", ",variant:ma.Default}),a.push({text:e,variant:t})}),l.length>0&&a.push({text:` + ${l.length} more`,variant:ma.Default,tooltipItems:l}),a}const ol=({option:t,formState:a,renderAction:r})=>{const l=o(()=>{const e=function(e,t){switch(e){case De.CodeAttributes:return(e=>{const t=Object.values(Ue).filter(t=>!!e.codeAttributes?.[t]).map(e=>Ge(e).toLowerCase());return t.length?[{text:"Collect",variant:ma.Action},{text:" ",variant:ma.Default},...il(t,ma.Endpoint)]:null})(t);case De.PayloadCollection:return(e=>{const t=Object.values(qe).filter(t=>null!=e.payloadCollection?.[t]).map(e=>ll[e]);return t.length?[{text:"Collect",variant:ma.Action},{text:" ",variant:ma.Default},...il(t,ma.Endpoint)]:null})(t);case De.HeadersCollection:return(e=>{const t=(e.headersCollection?.[je.HeaderKeys]??[]).map(e=>e.trim()).filter(e=>e.length>0);if(!t.length)return null;const a=nl(t.length,"HTTP header");return[{text:`Collect ${t.length} ${a}`,variant:ma.Action},{text:"",variant:ma.Default,tooltipItems:t}]})(t);case De.CustomInstrumentation:return(e=>{const t=(e.customInstrumentations?.[Xe.Java]??[]).map(e=>new _e(e.className,e.methodName)).filter(e=>e.Verify()),a=(e.customInstrumentations?.[Xe.Golang]??[]).map(e=>new He(e.packageName,e.functionName,e.receiverName,e.receiverMethodName)).filter(e=>e.Verify()),r=(e.customInstrumentations?.[Xe.Php]??[]).map(e=>new Be(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 ${nl(t.length,"probe")}`),a.length&&l.push(`${a.length} Go ${nl(a.length,"probe")}`),r.length&&l.push(`${r.length} PHP ${nl(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:ma.Action},{text:"",variant:ma.Default,tooltipItems:n}]})(t);case De.NetworkMetrics:return[{text:"Collect",variant:ma.Action},{text:" ",variant:ma.Default},{text:"network flow and TCP stats metrics",variant:ma.Endpoint}];default:return null}}(t?.type,a);return e?[...e,...fa(a.sourceScopes)]:[]},[t?.type,a]),n=0===l.length;return e(rl,{title:n?ze:"Instrumentation Rule Preview",summary:l,renderAction:r})},sl=({size:t=200,central:a=!1,useInline:r=!1})=>{const{tier:l}=ha();if(r){if(a)return e(ta,{size:t});switch(l){case Ke.Community:return e(ra,{size:t});case Ke.Onprem:return e(aa,{size:t});default:return null}}if(a)return e(la,{size:t});switch(l){case Ke.Community:return e(ia,{size:t});case Ke.Onprem:return e(na,{size:t});default:return null}},cl=[{value:"50",label:"50%"},{value:"25",label:"25%"},{value:"10",label:"10%"},{value:"1",label:"1%"},{value:"custom",label:"Custom"}],dl=[{value:"10",label:"10%"},{value:"1",label:"1%"},{value:"0.5",label:"0.5%"},{value:"0.1",label:"0.1%"},{value:"custom",label:"Custom"}],pl=[{value:"5000",label:"5s"},{value:"1000",label:"1s"},{value:"500",label:"500ms"},{value:"100",label:"100ms"},{value:"50",label:"50ms"},{value:"custom",label:"Custom"}],ul=({description:a,options:r,selected:l,onSelect:n,customName:i,customLabel:o,customPlaceholder:s,customValue:c,onCustomChange:d,customInputType:p=de.Number,customMin:u,customMax:h})=>t(O,{$gap:6,children:[e(L,{label:a}),t(R,{$gap:8,$alignItems:"flex-end",children:[e(we,{options:r,selected:l,setSelected:n}),"custom"===l&&e(ce,{name:i,label:o,placeholder:s,type:p,value:c,onChange:d,width:160,min:u,max:h})]})]}),hl=()=>{},gl=t=>t.readOnly?e(ml,{rule:t.rule}):e(vl,{ruleType:t.ruleType,formState:t.formState,onChange:t.onChange}),ml=({rule:a})=>{const r=null!=a.durationAtLeastMs;return a.error?e(Ce,{richTitle:{title:Fe},children:e(Q,{name:"sampling-view-toggle-keep-errors",onChange:hl,value:!0,size:te.S,label:We,labelAlign:ee.Right})}):r?e(Ce,{richTitle:{title:Ye},children:t("div",{children:[e(E,{size:N.XXXS,color:I.Secondary,children:Je}),e(E,{size:N.XS,children:`${a.durationAtLeastMs}ms`})]})}):null},vl=({ruleType:t,formState:a,onChange:r})=>{const l=c(e=>r({durationPreset:e}),[r]),n=c(e=>r({customDurationMs:e.target.value}),[r]);return"Duration"===t?e(Ce,{richTitle:{title:Ye,subTitle:Ze},children:e(ul,{description:Je,options:pl,selected:a.durationPreset,onSelect:l,customName:"sampling-input-custom-duration",customLabel:Qe,customPlaceholder:"200ms",customValue:a.customDurationMs,onCustomChange:n})}):null},fl=r.div`
232
+ display: flex;
233
+ gap: 32px;
234
+ `,bl=r.div`
235
+ display: flex;
236
+ flex-direction: column;
237
+ gap: 4px;
238
+ `,yl=r.div`
239
+ display: flex;
240
+ flex-wrap: wrap;
241
+ align-items: flex-end;
242
+ gap: 16px;
243
+ `,xl=r.div`
244
+ display: flex;
245
+ align-items: flex-end;
246
+ gap: 16px;
247
+ padding: 12px 16px;
248
+ border-radius: 8px;
249
+ background-color: ${({theme:e})=>e.v2.colors.black[500]};
250
+ `,$l=r.div`
251
+ display: flex;
252
+ align-items: flex-end;
253
+ gap: 10px;
254
+ flex: 1;
255
+ `,Cl=r.div`
256
+ display: flex;
257
+ align-items: center;
258
+ height: 32px;
259
+ `,kl=r.div`
260
+ display: flex;
261
+ align-items: flex-end;
262
+ gap: 16px;
263
+ margin-bottom: 12px;
264
+ `,wl="Any",Sl="Kafka topic",Tl=()=>e("div",{style:{marginBottom:"8px"},children:e(E,{size:N.XS,weight:500,children:"And"})}),Ml=[{value:"all",label:"All Operations"},{value:"httpServer",label:"HTTP Server"},{value:"httpClient",label:"HTTP Client"}],Al=[{value:"all",label:"All Operations"},{value:"httpServer",label:"HTTP Server"},{value:"kafkaConsumer",label:"Kafka Consumer"},{value:"kafkaProducer",label:"Kafka Producer"}],Pl=[{id:"",label:wl},{id:"GET",label:"GET"},{id:"POST",label:"POST"},{id:"PUT",label:"PUT"},{id:"DELETE",label:"DELETE"},{id:"PATCH",label:"PATCH"}],Ol=t=>t.readOnly?e(Ll,{data:t.data}):e(El,{category:t.category,formState:t.formState,onChange:t.onChange}),Ll=({data:a})=>{const r=o(()=>(e=>{if("noisy"===e.category){const t=e.rule.operation;if(t?.httpServer)return[{id:"type",title:gt,value:ht},{id:"route",title:ot,value:t.httpServer.route||t.httpServer.routePrefix||mt},{id:"method",title:pt,value:t.httpServer.method||wl}];if(t?.httpClient){const e=[{id:"type",title:gt,value:vt}];return t.httpClient.serverAddress&&e.push({id:"serverAddress",title:"Server address",value:t.httpClient.serverAddress}),e.push({id:"route",title:ot,value:t.httpClient.templatedPath||t.httpClient.templatedPathPrefix||mt}),e.push({id:"method",title:pt,value:t.httpClient.method||wl}),e}return[{id:"type",title:gt,value:ft}]}const t=e.rule.operation;return t?.httpServer?[{id:"type",title:gt,value:ht},{id:"route",title:ot,value:t.httpServer.route||t.httpServer.routePrefix||mt},{id:"method",title:pt,value:t.httpServer.method||wl}]:t?.kafkaConsumer?[{id:"type",title:gt,value:bt},{id:"topic",title:Sl,value:t.kafkaConsumer.kafkaTopic||mt}]:t?.kafkaProducer?[{id:"type",title:gt,value:yt},{id:"topic",title:Sl,value:t.kafkaProducer.kafkaTopic||mt}]:[{id:"type",title:gt,value:ft}]})(a),[a]);return e(Ce,{richTitle:{title:et},children:e(fl,{children:r.map(({id:a,title:r,value:l})=>t(bl,{children:[e(E,{size:N.XXXS,color:I.Secondary,nowrap:!0,children:r}),e(E,{size:N.XS,nowrap:!0,children:l})]},a))})})},El=({category:a,formState:r,onChange:l})=>{const n=o(()=>"noisy"===a?Ml:Al,[a]),i=c(e=>l({operationType:e,route:"",serverAddress:"",method:"",kafkaTopic:""}),[l]),s=c(e=>t=>{t&&l({routeType:e,route:""})},[l]),d=c(e=>l({route:e.target.value}),[l]),p=c(e=>l({serverAddress:e.target.value}),[l]),u=c(e=>l({method:e[0]||""}),[l]),h=c(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?it:ot,f="httpClient"===r.operationType?st:ct;return t(Ce,{richTitle:{title:`2. ${et}`,subTitle:tt},children:[e(O,{$alignItems:"flex-start",children:e(we,{options:n,selected:r.operationType,setSelected:i})}),g&&t(yl,{children:["httpClient"===r.operationType&&t(kl,{children:[e(ce,{name:"sampling-input-server-address",label:rt,placeholder:at,value:r.serverAddress,onChange:p}),e(Tl,{})]}),t(xl,{children:[t($l,{children:[e(Cl,{children:e(lt,{"data-id":"sampling-radio-route",value:"route"===r.routeType,onChange:s("route")})}),e(ce,{name:"sampling-input-route",label:v,placeholder:nt,value:"route"===r.routeType?r.route:"",onChange:d,disabled:"route"!==r.routeType})]}),t($l,{children:[e(Cl,{children:e(lt,{"data-id":"sampling-radio-route-prefix",value:"routePrefix"===r.routeType,onChange:s("routePrefix")})}),e(ce,{name:"sampling-input-route-prefix",label:f,placeholder:nt,value:"routePrefix"===r.routeType?r.route:"",onChange:d,disabled:"routePrefix"!==r.routeType})]})]}),t(kl,{children:[e(Tl,{}),e(dt,{label:pt,items:Pl,selectedIds:[r.method||""],setSelectedIds:e=>u(e),buttonProps:{"data-id":"sampling-btn-method",label:Pl.find(e=>e.id===r.method)?.label||wl,size:z.S,variant:D.Secondary}})]})]}),m&&e(ce,{name:"sampling-input-kafka-topic",label:ut,placeholder:"Type kafka topic",value:r.kafkaTopic,onChange:h,width:"320px"})]})},Il=[{value:"all",label:"Drop All"},{value:"sample",label:"Sample"}],Nl=[{value:"all",label:"Keep All"},{value:"sample",label:"Sample"}],Rl=t=>t.readOnly?e(Vl,{data:t.data}):e(zl,{category:t.category,formState:t.formState,onChange:t.onChange}),Vl=({data:a})=>{const r=o(()=>(e=>{switch(e.category){case"highlyRelevant":return null!=e.rule.percentageAtLeast?{title:$t,method:wt,description:Ct,value:`${e.rule.percentageAtLeast}%`}:{title:$t,method:Tt,description:null,value:null};case"noisy":return ba(e.rule.percentageAtMost)?{title:$t,method:St,description:null,value:null}:{title:$t,method:wt,description:kt,value:`${e.rule.percentageAtMost}%`};case"costReduction":return{title:$t,method:wt,description:kt,value:`${e.rule.percentageAtMost}%`}}})(a),[a]),l=[{id:"method",title:pt,value:r.method},...null!=r.description?[{id:"value",title:r.description,value:r.value}]:[]];return e(Ce,{richTitle:{title:r.title},children:e(fl,{children:l.map(({id:a,title:r,value:l})=>t(bl,{children:[e(E,{size:N.XXXS,color:I.Secondary,nowrap:!0,children:r}),e(E,{size:N.XS,nowrap:!0,children:l})]},a))})})},zl=({category:a,formState:r,onChange:l})=>{const n="highlyRelevant"===a,i=n?Nl:Il,o=`${n?4:3}. ${$t}`,s=xt[a],d=n?Ct:kt,p="noisy"===a?dl:cl,u=c(e=>l({percentageMode:e}),[l]),h=c(e=>l({percentagePreset:e}),[l]),g=c(e=>l({customPercentage:e.target.value}),[l]);return t(Ce,{richTitle:{title:o,subTitle:s},children:["costReduction"!==a&&e(O,{$alignItems:"flex-start",children:e(we,{options:i,selected:r.percentageMode,setSelected:u})}),("costReduction"===a||"sample"===r.percentageMode)&&e(ul,{description:d,options:p,selected:r.percentagePreset,onSelect:h,customName:"sampling-input-custom-percentage",customPlaceholder:"5%",customValue:r.customPercentage,onCustomChange:g,customInputType:de.Decimal,customMin:0,customMax:100})]})},Dl=r.div`
265
+ display: flex;
266
+ align-items: flex-end;
267
+ gap: 16px;
268
+ `,Xl=r.div`
269
+ width: 280px;
270
+ flex-shrink: 0;
271
+ `,_l=r.div`
272
+ flex: 1;
273
+ min-width: 0;
274
+ `;function Hl(e){return"highlyRelevant"===e.category?e.rule.error?"Error":null!=e.rule.durationAtLeastMs?"Duration":"Relevance":Nt[e.category]}const Bl=t=>t.readOnly?e(jl,{data:t.data}):e(ql,{formState:t.formState,onChange:t.onChange}),jl=({data:a})=>{const r=o(()=>[{id:"name",title:At,value:a.rule.name||Mt},{id:"type",title:Pt,value:Hl(a)}],[a]),l=a.rule.notes||mt;return t(Ce,{children:[e(fl,{children:r.map(({id:a,title:r,value:l})=>t(bl,{children:[e(E,{size:N.XXXS,color:I.Secondary,nowrap:!0,children:r}),e(E,{size:N.XS,nowrap:!0,children:l})]},a))}),t(bl,{children:[e(E,{size:N.XXXS,color:I.Secondary,children:Ot}),e(E,{size:N.XS,children:l})]})]})},ql=({formState:a,onChange:r})=>{const l=c(e=>r({name:e.target.value}),[r]),n=c(e=>r({notes:e.target.value}),[r]);return e(Ce,{children:t(Dl,{children:[e(Xl,{children:e(ce,{name:"sampling-input-rule-name",label:At,tooltip:"Optional. Give this rule a name for easier identification.",placeholder:Lt,value:a.name,onChange:l})}),e(_l,{children:e(ce,{name:"sampling-input-note",label:Ot,tooltip:It,placeholder:Et,value:a.notes,onChange:n})})]})})},Ul=[{value:"Relevance",label:"Relevance"},{value:"Error",label:"Error"},{value:"Duration",label:"Duration"}],Gl=({formState:t,onChange:a})=>{const r=c(e=>a({ruleType:e,keepErrors:"Error"===e}),[a]);return e(Ce,{richTitle:{title:`3. ${Pt}`,subTitle:Rt},children:e(O,{$alignItems:"flex-start",children:e(we,{options:Ul,selected:t.ruleType,setSelected:r})})})},Kl=t=>{const a=o(()=>{if(t.readOnly)return t.summary;switch(t.category){case"noisy":return $a(wa(t.formState));case"highlyRelevant":return xa(ka(t.formState));case"costReduction":return ya(Ca(t.formState))}},[t]);if(t.readOnly)return e(rl,{title:Vt,summary:a,renderAction:t.renderAction});const r=1===a.length&&"default"===a[0].variant;return e(rl,{title:r?ze:Vt,summary:r?[]:a,renderAction:t.renderAction})},Fl=(e,t)=>!t?.length||!!t?.find(t=>t===e),Wl=({title:a="Signals",required:r,errorMessage:l,allowedSignals:n,selectedSignals:i,setSelectedSignals:o,disabled:c})=>{const[p,h]=d(1===i.length),g=s(JSON.stringify(i));return u(()=>{let e=zt(i).filter(e=>Fl(e,n));e.length||(e=Dt.filter(({id:e})=>Fl(e,n)).map(({id:e})=>e));const t=JSON.stringify(e);g.current!==t&&(g.current=t,o(e),h(1===e.length))},[n,i]),t(O,{$gap:12,children:[e(L,{label:a,required:r}),e(R,{$gap:12,children:Dt.map(t=>{const a=Fl(t.id,n),r=((e,t)=>!!t?.find(t=>t===e))(t.id,i);return a?e(re,{label:t.value,disabled:c||!a||p&&r,value:r,onChange:e=>((e,t)=>{const a=e,r=t?[...i,a]:i.filter(e=>e!==a);o(r),h(1===r.length)})(t.id,e)},t.id):null})}),e(X,{errorMessage:l})]})},Yl=({minSupportedVersion:t,currentVersion:a})=>e(B,{isOpen:!0,onClose:()=>{},relativeToParent:!0,visual:()=>e(J,{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:Y.UPGRADE_REQUIRED,description:`${Y.UPGRADE_TO_USE_FEATURE(t)}\n${Y.CURRENT_VERSION(a)}`}),Jl=r.div`
275
+ display: flex;
276
+ flex-direction: column;
277
+ justify-content: flex-end;
278
+ width: ${({$width:e})=>e};
279
+ gap: ${({$columnHasHeader:e})=>e?"0":"12px"};
280
+ `,Zl=r.div`
281
+ display: flex;
282
+ align-items: center;
283
+ min-height: 24px;
284
+ padding: 12px;
285
+ border-radius: 16px 16px 0 0;
286
+ background-color: ${({theme:e})=>e.v2.colors.silver[800]};
287
+ `,Ql=r.div`
288
+ display: flex;
289
+ flex-direction: column;
290
+ gap: ${({$gap:e})=>e}px;
291
+ padding: 12px 12px 0 12px;
292
+ width: 100%;
293
+ height: ${({$heightOffset:e,$columnHasHeader:t})=>`calc(100vh - 180px - ${e}px ${t?"- 48px":""})`};
294
+ 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"};
295
+ background-color: ${({theme:e})=>e.v2.colors.silver[900]};
296
+ overflow-y: auto;
297
+ overflow-x: hidden;
298
+ `,en=({isLeft:r,isRight:l,heightOffset:n=0,width:i,header:o,list:s})=>t(Jl,{$width:i,$columnHasHeader:!!o,children:[o&&e(Zl,{children:o}),e(Ql,{$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(_,{$height:"100%",children:e(H,{})})})]}),tn="75vw",an=r.div`
299
+ display: flex;
300
+ flex-direction: column;
301
+ border-radius: 16px;
302
+ background-color: ${({theme:e})=>e.v2.colors.silver[1e3]};
303
+ overflow: hidden;
304
+ `,rn=r.div`
305
+ display: flex;
306
+ gap: 12px;
307
+ padding: 16px 16px 0 16px;
308
+ background-color: ${({theme:e})=>e.v2.colors.silver[1e3]};
309
+ position: sticky;
310
+ top: 0;
311
+ `,ln=r.div`
312
+ padding: 12px 12px 0 12px;
313
+ `,nn=r.div`
314
+ display: flex;
315
+ gap: 12px;
316
+ padding: 16px;
317
+ `,on=r.div`
318
+ padding: 5vh 10vw;
319
+ border-radius: 12px;
320
+ background-color: ${({theme:e})=>e.v2.colors.silver[800]};
321
+ `,sn=g(({isOpen:a,withOverlay:r,disableAnimation:l,onClose:n,onBack:i,onNext:s,nextIsSkip:p,onSave:u,disableSave:h,connectionIds:g,header:v,subHeader:f,leftColumn:b,rightColumn:y,search:x,filters:$,errorMessage:C,isFormDirty:k,allowSaveWhenPristine:w,hideDirtyNote:S,forcedNote:T,isFetching:M,progress:P},O)=>{const[L,E]=d(!1),[I,R]=d(!1),[V,z]=d(void 0);m(O,()=>({clearErrors:()=>z(void 0)}));const X=I,H=c(()=>{k&&!L?E(!0):(E(!1),n?.())},[k,L,n]),j=h||I||!w&&"boolean"==typeof k&&!k,q=c(async()=>{R(!0);const e=await u();R(!1),!1!==e&&(e?.error?z(e.error):(g?.setValue([]),n?.()))},[u,g,n]),U=!!x||!!g||!!$,G=!!f,K=(U?48:0)+(G?50:0),F=o(()=>T||(M?{status:he.Info,message:"Fetching Data..."}:I&&!P?{status:he.Info,message:"Saving Changes..."}:V||C?{status:he.Error,message:V||C}:"boolean"!=typeof k||S?void 0:k?{status:he.Info,message:'The values don\'t reflect the current configurations of the selected clusters.\n"Save" will override the current configurations.'}:{status:he.Success,message:"The values reflect the current configuration of the selected cluster."}),[M,I,P,V,C,k,S,T]),W=o(()=>i?{label:"Back",leftIcon:oa,variant:D.Secondary,onClick:i}:{label:"Cancel",variant:D.Secondary,onClick:H,disabled:X},[i,H,X]),[Y,J]=d(!1),Z=o(()=>s?p?{"data-id":"wide-drawer-skip",label:"Skip",rightIcon:sa,variant:D.Secondary,onClick:()=>J(!0)}:{"data-id":"wide-drawer-next",label:"Next",rightIcon:sa,variant:D.Primary,onClick:s}:{"data-id":"wide-drawer-save",label:"Save",variant:D.Primary,onClick:q,disabled:j},[s,p,q,j]);return t(A,{width:tn,isOpen:a,disableAnimation:l,hideOverlay:!I&&!r,header:{...v,onClose:n?H:void 0,onCloseDisabled:X},footer:{note:F,actions:[W,Z]},children:[I?e(_,{$height:"calc(100vh - 136px)",children:e(on,{children:e(_t,{titleSize:N.S,subTitleSize:N.XXXS,withGradient:!0,withSpinner:!0,...P})})}):t(an,{children:[U&&t(rn,{children:[g&&e(Ht,{icon:Zt,title:"Selected Clusters",badge:{label:g.value.length}}),x&&e(Bt,{...x,width:x.width??"100%"}),$]}),G&&e(ln,{children:e(Ht,{icon:f.icon,title:f.title,subTitle:f.description,badge:f.badge})}),t(nn,{children:[e(en,{isLeft:!0,heightOffset:K,...b}),e(en,{isRight:!0,heightOffset:K,...y})]})]}),e(hr,{isOpen:L,onClose:()=>E(!1),onApprove:H}),e(B,{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:()=>J(!1),denyButton:{label:"Go Back",variant:D.Secondary,onClick:()=>J(!1)},approveButton:{label:"Skip",variant:D.Primary,onClick:()=>{s?.(),J(!1)}}})]})});sn.displayName=sn.name;const cn=r.div`
322
+ padding: 0 24px;
323
+ border-radius: 12px;
324
+ background-color: ${({$codeBgColor:e})=>e||"transparent"};
325
+ `,dn=r.div`
326
+ display: flex;
327
+ flex-direction: column;
328
+ gap: 8px;
329
+ width: 100%;
330
+ padding: 8px;
331
+ border: 1px solid ${({theme:e})=>e.v2.colors.silver[700]};
332
+ border-radius: 12px;
333
+ background-color: ${({theme:e})=>e.v2.colors.silver[900]};
334
+ `,pn=r.div`
335
+ display: flex;
336
+ align-items: center;
337
+ gap: 4px;
338
+ width: 100%;
339
+ `,un=r.div`
340
+ flex: 1;
341
+ min-width: 0;
342
+ `,hn=r.div`
343
+ width: 100%;
344
+ max-height: 180px;
345
+ overflow: auto;
346
+ padding: 0 12px;
347
+
348
+ pre {
349
+ margin: 0;
350
+ }
351
+ `,gn=({title:a="YAML",yaml:r,defaultOpen:l,fullHeight:n,bgTint:i="1000",codeBgColor:s,compact:c})=>{const{clickCopy:d,isCopied:p,CopyButton:u}=j(),h=o(()=>r?[{id:qt(),type:jt.Button,buttonProps:{variant:D.Text,size:z.S,leftIcon:p?Wt:ca,onClick:()=>d(r||""),disabled:p}}]:[],[r,p]);return c?t(dn,{children:[t(pn,{children:[e(da,{size:16}),e(un,{children:e(E,{size:N.XXS,color:I.Primary,children:a})}),r&&e(u,{value:r})]}),r?e(hn,{children:e(F,{code:r,language:"yaml",theme:"duotoneDark"})}):e(H,{title:"YAML not found",subTitle:"The YAML for this resource is not available"})]}):e(K,{bgTint:i,richTitle:{icon:da,title:a},actions:h,withCollapse:!0,collapseIsDefaultOpen:l,fullHeight:n,children:e(cn,{$codeBgColor:s,children:r?e(F,{code:r,language:"yaml",theme:"duotoneDark"}):e(_,{children:e(H,{title:"YAML not found",subTitle:"The YAML for this resource is not available"})})})})};export{qa as A,ur as B,hr as C,pl as D,el as E,ol as I,dl as N,sl as O,cl as P,Bl as R,Kl as S,Yl as U,tn as W,gn as Y,vr as a,fr as b,br as c,gl as d,Qr as e,yr as f,Zr as g,Ol as h,Rl as i,ul as j,Gl as k,Wl as l,Er as m,sn as n,Ba as o,rl as p};