@miravo/cli-linux-arm64-musl 0.7.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +199 -0
- package/README.md +5 -0
- package/console-dist/assets/AnimatePresence-DOKfbxUr.js +9 -0
- package/console-dist/assets/activity-CHJbwIn_.js +1 -0
- package/console-dist/assets/api-DUOCKS6t.js +1 -0
- package/console-dist/assets/arrow-right-DzTjpAuX.js +1 -0
- package/console-dist/assets/arrow-up-down-Dpy1cI5X.js +1 -0
- package/console-dist/assets/auth-screen-backdrop-UsGua6Zt.js +1 -0
- package/console-dist/assets/badge-Dl0qmCnt.js +1 -0
- package/console-dist/assets/catalog-CJE-3rom.js +1 -0
- package/console-dist/assets/catalog-D7hkpcg7.js +1 -0
- package/console-dist/assets/catalog-source-m5FRUDDK.js +1 -0
- package/console-dist/assets/catalog-template-icons-MOd-xD7l.js +1 -0
- package/console-dist/assets/checkbox-_saaQAja.js +1 -0
- package/console-dist/assets/chunk-OE4NN4TA-m2UhO8Q2.js +3 -0
- package/console-dist/assets/circle-question-mark-BwjC8Yj-.js +1 -0
- package/console-dist/assets/combobox-BqGaRFom.js +1 -0
- package/console-dist/assets/control-C3s_d_cd.js +1 -0
- package/console-dist/assets/control-CVg7wZ1b.js +1 -0
- package/console-dist/assets/copy-button-BYq-qqmM.js +1 -0
- package/console-dist/assets/dist-jROhexoH.js +2 -0
- package/console-dist/assets/download-BP5RD-RZ.js +1 -0
- package/console-dist/assets/dropdown-menu-6JrsGi7P.js +1 -0
- package/console-dist/assets/engine-store-BXfht5ME.js +1 -0
- package/console-dist/assets/events-PFkU6dri.js +1 -0
- package/console-dist/assets/events-uH2B0ni-.js +1 -0
- package/console-dist/assets/fira-code-cyrillic-ext-wght-normal-DhYMMuQd.woff2 +0 -0
- package/console-dist/assets/fira-code-cyrillic-wght-normal-Y3u8pIsh.woff2 +0 -0
- package/console-dist/assets/fira-code-greek-ext-wght-normal-wWus70Ix.woff2 +0 -0
- package/console-dist/assets/fira-code-greek-wght-normal-B2SviObF.woff2 +0 -0
- package/console-dist/assets/fira-code-latin-ext-wght-normal-Dvfvaomy.woff2 +0 -0
- package/console-dist/assets/fira-code-latin-wght-normal-CHoedHDv.woff2 +0 -0
- package/console-dist/assets/fira-code-symbols2-wght-normal-CE6EOz_n.woff2 +0 -0
- package/console-dist/assets/fleet-B1apknqo.js +1 -0
- package/console-dist/assets/fleet-CdoQJU1v.js +1 -0
- package/console-dist/assets/format-B243kebG.js +1 -0
- package/console-dist/assets/get-error-message-CCNo4ZY0.js +1 -0
- package/console-dist/assets/index-CTIFAVGZ.js +12 -0
- package/console-dist/assets/index-DUzq1mEZ.css +2 -0
- package/console-dist/assets/instance-detail-BH62ZPtN.js +1 -0
- package/console-dist/assets/label-CM_MIru8.js +1 -0
- package/console-dist/assets/layers-Cg3yeSqL.js +1 -0
- package/console-dist/assets/login-DG5yhrqi.js +136 -0
- package/console-dist/assets/models-CZEVv1PS.js +1 -0
- package/console-dist/assets/models-S3NJFuma.js +1 -0
- package/console-dist/assets/not-found-49MUUPk7.js +1 -0
- package/console-dist/assets/platform-targets-DkU1GIU_.js +1 -0
- package/console-dist/assets/platforms-Czbg-aTO.js +1 -0
- package/console-dist/assets/platforms-DbF8XkYf.js +1 -0
- package/console-dist/assets/proxy-Dd7NWn5E.js +1 -0
- package/console-dist/assets/query-fetch-error-B2TVF0yM.js +1 -0
- package/console-dist/assets/rolldown-runtime-COnpUsM8.js +1 -0
- package/console-dist/assets/route-preload-iLKZvgav.js +2 -0
- package/console-dist/assets/runtime-link-ocutSVA8.js +1 -0
- package/console-dist/assets/schibsted-grotesk-latin-ext-wght-normal-hsMS0n0O.woff2 +0 -0
- package/console-dist/assets/schibsted-grotesk-latin-wght-normal-Bb8VGrTG.woff2 +0 -0
- package/console-dist/assets/select-TsdpHrOx.js +1 -0
- package/console-dist/assets/select-display-items-C6R8SaIm.js +1 -0
- package/console-dist/assets/shallow-ODRQsuRf.js +1 -0
- package/console-dist/assets/skeleton-BK5ydi_g.js +1 -0
- package/console-dist/assets/tabs-CrmZxWmX.js +1 -0
- package/console-dist/assets/tags-Burz8TZx.js +4 -0
- package/console-dist/assets/tags-zlkQYLKu.js +1 -0
- package/console-dist/assets/tooltip-5y0snV5M.js +1 -0
- package/console-dist/assets/transition-nav-link-rkgf5kGR.js +1 -0
- package/console-dist/assets/transition-types-BNgNegH3.js +1 -0
- package/console-dist/assets/triangle-alert-B7bgkvtE.js +1 -0
- package/console-dist/assets/use-engine-command-mutation-BHd8IkoT.js +1 -0
- package/console-dist/assets/use-platform-stream-EUBU4hC1.js +2 -0
- package/console-dist/assets/use-transition-navigate-BQAQi11k.js +1 -0
- package/console-dist/assets/utils-CH98NBUe.js +1 -0
- package/console-dist/assets/validation-CEcQWBjy.js +1 -0
- package/console-dist/assets/vendor-charts-CAZdaPlq.js +60 -0
- package/console-dist/assets/vendor-table-CymGcez5.js +4 -0
- package/console-dist/assets/vendor-ui-BcvPjvmT.js +1 -0
- package/console-dist/icon.png +0 -0
- package/console-dist/index.html +82 -0
- package/console-dist/miravo-logo.webp +0 -0
- package/miravo +0 -0
- package/nodesets/.ignore +1 -0
- package/nodesets/1.02/FTNIR.NodeSet2.xml +819 -0
- package/nodesets/1.02/Opc.Ua.Adi.NodeSet2.xml +8301 -0
- package/nodesets/1.02/Opc.Ua.Di.NodeSet2.xml +1785 -0
- package/nodesets/Opc.ISA95.NodeSet2.xml +3589 -0
- package/nodesets/Opc.Ua.AMB.NodeSet2.xml +1395 -0
- package/nodesets/Opc.Ua.Adi.NodeSet2.xml +8301 -0
- package/nodesets/Opc.Ua.Adi.Types.xsd +104 -0
- package/nodesets/Opc.Ua.AutoID.NodeSet2.xml +6062 -0
- package/nodesets/Opc.Ua.CNC.NodeSet.xml +15875 -0
- package/nodesets/Opc.Ua.CommercialKitchenEquipment.NodeSet2.xml +12096 -0
- package/nodesets/Opc.Ua.Di.NodeSet2.xml +6042 -0
- package/nodesets/Opc.Ua.Di.Types.xsd +161 -0
- package/nodesets/Opc.Ua.Eumabois.Nodeset2.xml +2483 -0
- package/nodesets/Opc.Ua.Gds.NodeSet2.xml +8282 -0
- package/nodesets/Opc.Ua.Glass.NodeSet2.xml +5100 -0
- package/nodesets/Opc.Ua.IA.NodeSet2.xml +1782 -0
- package/nodesets/Opc.Ua.IOLink.NodeSet2.xml +4374 -0
- package/nodesets/Opc.Ua.IOLinkIODD.NodeSet2.xml +139 -0
- package/nodesets/Opc.Ua.IRDI.NodeSet2.xml +2243 -0
- package/nodesets/Opc.Ua.Ijt.Base.NodeSet2.xml +19459 -0
- package/nodesets/Opc.Ua.Ijt.Tightening.NodeSet2.xml +883 -0
- package/nodesets/Opc.Ua.LADS.NodeSet2.xml +7086 -0
- package/nodesets/Opc.Ua.MachineTool.NodeSet2.xml +7884 -0
- package/nodesets/Opc.Ua.MachineVision.NodeSet2.xml +17324 -0
- package/nodesets/Opc.Ua.Machinery.Jobs.Nodeset2.xml +1249 -0
- package/nodesets/Opc.Ua.Machinery.NodeSet2.xml +2099 -0
- package/nodesets/Opc.Ua.Machinery.ProcessValues.NodeSet2.xml +1858 -0
- package/nodesets/Opc.Ua.Machinery_Result.NodeSet2.xml +2640 -0
- package/nodesets/Opc.Ua.MetalForming.NodeSet2.xml +1577 -0
- package/nodesets/Opc.Ua.NodeSet2.xml +81975 -0
- package/nodesets/Opc.Ua.PADIM.NodeSet2.xml +14131 -0
- package/nodesets/Opc.Ua.PackML.NodeSet2.xml +3030 -0
- package/nodesets/Opc.Ua.Robotics.NodeSet2.xml +7409 -0
- package/nodesets/Opc.Ua.Scales.NodeSet2.xml +15817 -0
- package/nodesets/Opc.Ua.Types.bsd +3499 -0
- package/nodesets/Opc.Ua.Weihenstephan.NodeSet2.xml +821 -0
- package/nodesets/Opc.Ua.Woodworking.NodeSet2.xml +17831 -0
- package/nodesets/UANodeSet.xsd +497 -0
- package/nodesets/opc.ua.isa95-jobcontrol.nodeset2.xml +4594 -0
- package/package.json +34 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{n as e}from"./utils-CH98NBUe.js";var t=e(`layers`,[[`path`,{d:`M12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83z`,key:`zw3jo`}],[`path`,{d:`M2 12a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 12`,key:`1wduqc`}],[`path`,{d:`M2 17a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 17`,key:`kqbvx6`}]]);export{t};
|
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
import{a as e}from"./rolldown-runtime-COnpUsM8.js";import{s as t}from"./vendor-charts-CAZdaPlq.js";import{at as n}from"./vendor-ui-BcvPjvmT.js";import{i as r,l as i,x as a}from"./api-DUOCKS6t.js";import{t as o}from"./use-transition-navigate-BQAQi11k.js";import{t as s}from"./transition-nav-link-rkgf5kGR.js";import{t as c}from"./get-error-message-CCNo4ZY0.js";var l=e(t(),1),u=n(),d=`
|
|
2
|
+
@keyframes readout-appear {
|
|
3
|
+
from { opacity: 0; transform: translateY(8px) scale(0.95); }
|
|
4
|
+
to { opacity: 1; transform: translateY(0) scale(1); }
|
|
5
|
+
}
|
|
6
|
+
@keyframes dot-pulse {
|
|
7
|
+
0%, 100% { opacity: 1; }
|
|
8
|
+
50% { opacity: 0.3; }
|
|
9
|
+
}
|
|
10
|
+
@keyframes login-glow-pulse {
|
|
11
|
+
0% { opacity: 0.75; transform: translate(-50%, -50%) scale(1); }
|
|
12
|
+
100% { opacity: 0.9; transform: translate(-50%, -50%) scale(1.03); }
|
|
13
|
+
}
|
|
14
|
+
@keyframes live-dot {
|
|
15
|
+
0%, 100% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--primary) 20%, transparent); }
|
|
16
|
+
50% { box-shadow: 0 0 0 2px transparent; }
|
|
17
|
+
}
|
|
18
|
+
@keyframes terminal-appear {
|
|
19
|
+
from { opacity: 0; transform: translate(-50%, -50%) scale(0.96); }
|
|
20
|
+
to { opacity: 1; transform: translate(-50%, -50%) scale(1); }
|
|
21
|
+
}
|
|
22
|
+
@keyframes terminal-line {
|
|
23
|
+
from { opacity: 0; transform: translateY(4px); }
|
|
24
|
+
to { opacity: 1; transform: translateY(0); }
|
|
25
|
+
}
|
|
26
|
+
@keyframes cursor-blink {
|
|
27
|
+
0%, 49% { opacity: 0.8; }
|
|
28
|
+
50%, 100% { opacity: 0; }
|
|
29
|
+
}
|
|
30
|
+
@keyframes tree-line {
|
|
31
|
+
from { opacity: 0; transform: translateX(-6px); }
|
|
32
|
+
to { opacity: 1; transform: translateX(0); }
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
/* ── Layout ───────────────────────────────── */
|
|
36
|
+
.login-page {
|
|
37
|
+
display: grid;
|
|
38
|
+
min-height: 100svh;
|
|
39
|
+
grid-template-columns: 1.2fr 1fr;
|
|
40
|
+
}
|
|
41
|
+
.login-left { display: block; order: -1; }
|
|
42
|
+
|
|
43
|
+
@media (max-width: 1023px) {
|
|
44
|
+
.login-page { grid-template-columns: 1fr; }
|
|
45
|
+
.login-left { display: none !important; }
|
|
46
|
+
}
|
|
47
|
+
@media (max-width: 640px) {
|
|
48
|
+
.login-card { padding: 1.75rem !important; }
|
|
49
|
+
.login-form-area { padding: 2rem 1.25rem !important; }
|
|
50
|
+
.login-header { padding: 1rem 1.25rem !important; }
|
|
51
|
+
.login-footer { padding: 0.75rem 1.25rem !important; }
|
|
52
|
+
}
|
|
53
|
+
@media (max-width: 400px) {
|
|
54
|
+
.login-card { padding: 1.5rem !important; }
|
|
55
|
+
.login-form-area { padding: 1.5rem 1rem !important; }
|
|
56
|
+
.login-header { padding: 0.85rem 1rem !important; }
|
|
57
|
+
.login-footer { padding: 0.65rem 1rem !important; }
|
|
58
|
+
.miravo-input { padding: 0.8rem 0.9rem !important; font-size: 1rem !important; }
|
|
59
|
+
.miravo-btn { padding: 0.9rem !important; font-size: 0.95rem !important; }
|
|
60
|
+
}
|
|
61
|
+
@media (max-width: 1023px) {
|
|
62
|
+
.login-form-panel {
|
|
63
|
+
background-image:
|
|
64
|
+
radial-gradient(ellipse 90% 50% at 50% 45%, color-mix(in srgb, var(--primary) 5%, transparent) 0%, transparent 65%),
|
|
65
|
+
radial-gradient(circle, color-mix(in srgb, var(--primary) 6%, transparent) 1px, transparent 1px);
|
|
66
|
+
background-size: auto, 70px 70px;
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
/* ── Form elements ────────────────────────── */
|
|
71
|
+
.miravo-input {
|
|
72
|
+
width: 100%;
|
|
73
|
+
padding: 0.7rem 0.9rem;
|
|
74
|
+
background: var(--secondary);
|
|
75
|
+
border: 1px solid color-mix(in srgb, var(--tooltip-border) 45%, transparent);
|
|
76
|
+
border-radius: 4px;
|
|
77
|
+
color: var(--foreground);
|
|
78
|
+
font-family: var(--font-body);
|
|
79
|
+
font-size: 0.88rem;
|
|
80
|
+
outline: none;
|
|
81
|
+
transition: border-color 0.2s, box-shadow 0.2s;
|
|
82
|
+
box-sizing: border-box;
|
|
83
|
+
}
|
|
84
|
+
.miravo-input:focus {
|
|
85
|
+
border-color: color-mix(in srgb, var(--ring) 55%, transparent);
|
|
86
|
+
box-shadow: 0 0 0 3px color-mix(in srgb, var(--ring) 15%, transparent);
|
|
87
|
+
}
|
|
88
|
+
.miravo-input::placeholder {
|
|
89
|
+
color: color-mix(in srgb, var(--tooltip-border) 70%, transparent);
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
.miravo-btn {
|
|
93
|
+
width: 100%;
|
|
94
|
+
padding: 0.78rem;
|
|
95
|
+
background: var(--primary);
|
|
96
|
+
border: none;
|
|
97
|
+
border-radius: var(--miravo-radius-pill);
|
|
98
|
+
color: var(--primary-foreground);
|
|
99
|
+
font-family: var(--font-heading);
|
|
100
|
+
font-size: 0.88rem;
|
|
101
|
+
font-weight: 700;
|
|
102
|
+
cursor: pointer;
|
|
103
|
+
letter-spacing: -0.01em;
|
|
104
|
+
box-shadow:
|
|
105
|
+
0 0 20px color-mix(in srgb, var(--primary) 15%, transparent),
|
|
106
|
+
0 1px 3px color-mix(in srgb, var(--background) 30%, transparent);
|
|
107
|
+
transition: filter 0.2s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.2s cubic-bezier(0.22, 1, 0.36, 1), transform 0.15s cubic-bezier(0.22, 1, 0.36, 1);
|
|
108
|
+
}
|
|
109
|
+
.miravo-btn:hover:not(:disabled) {
|
|
110
|
+
filter: brightness(1.1);
|
|
111
|
+
box-shadow:
|
|
112
|
+
0 0 30px color-mix(in srgb, var(--primary) 22%, transparent),
|
|
113
|
+
0 2px 8px color-mix(in srgb, var(--background) 40%, transparent);
|
|
114
|
+
transform: translateY(-1px);
|
|
115
|
+
}
|
|
116
|
+
.miravo-btn:active:not(:disabled) { transform: translateY(0); }
|
|
117
|
+
.miravo-btn:disabled { opacity: 0.5; cursor: not-allowed; }
|
|
118
|
+
|
|
119
|
+
.miravo-btn-ghost {
|
|
120
|
+
background: transparent;
|
|
121
|
+
border: none;
|
|
122
|
+
font-family: var(--font-body);
|
|
123
|
+
font-size: 0.78rem;
|
|
124
|
+
color: var(--muted-foreground);
|
|
125
|
+
cursor: pointer;
|
|
126
|
+
transition: color 0.2s;
|
|
127
|
+
padding: 0;
|
|
128
|
+
text-decoration: underline;
|
|
129
|
+
text-underline-offset: 3px;
|
|
130
|
+
text-decoration-color: transparent;
|
|
131
|
+
}
|
|
132
|
+
.miravo-btn-ghost:hover {
|
|
133
|
+
color: var(--foreground);
|
|
134
|
+
text-decoration-color: var(--tooltip-border);
|
|
135
|
+
}
|
|
136
|
+
`;function f({label:e,forId:t,children:n}){return(0,u.jsxs)(`div`,{children:[(0,u.jsx)(`label`,{htmlFor:t,style:{fontFamily:`var(--font-mono)`,fontSize:`0.72rem`,letterSpacing:`0.03em`,color:`var(--muted-foreground)`,display:`block`,marginBottom:`0.5rem`},children:e}),n]})}function p({message:e}){return(0,u.jsx)(`p`,{role:`alert`,style:{fontSize:`0.82rem`,color:`var(--destructive)`,textAlign:`center`,padding:`0.55rem 0.9rem`,background:`color-mix(in srgb, var(--destructive) 6%, transparent)`,border:`1px solid color-mix(in srgb, var(--destructive) 12%, transparent)`,borderRadius:4,margin:`0 0 1rem`},children:e})}function m({onChangePassword:e}){let t=o(),[n,r]=(0,l.useState)(``),[s,d]=(0,l.useState)(``),[m,h]=(0,l.useState)(``),[g,_]=(0,l.useState)(!1);async function v(r){r.preventDefault(),h(``),_(!0);try{(await i(n,s)).changePassword?e(n):(a.removeQueries({queryKey:[`bootstrap`]}),t(`/`,{replace:!0}))}catch(e){h(c(e,`Login failed`))}finally{_(!1)}}return(0,u.jsxs)(`form`,{onSubmit:v,children:[(0,u.jsx)(`div`,{style:{marginBottom:`2rem`},children:(0,u.jsx)(`h1`,{style:{fontFamily:`var(--font-heading)`,fontSize:`1.5rem`,fontWeight:800,color:`var(--foreground)`,letterSpacing:`-0.035em`,lineHeight:1.15,margin:0},children:`Log in`})}),m&&(0,u.jsx)(p,{message:m}),(0,u.jsxs)(`div`,{style:{display:`flex`,flexDirection:`column`,gap:`1.15rem`},children:[(0,u.jsx)(f,{label:`Username`,forId:`username`,children:(0,u.jsx)(`input`,{id:`username`,type:`text`,className:`miravo-input`,autoComplete:`username`,required:!0,value:n,onChange:e=>r(e.target.value)})}),(0,u.jsx)(f,{label:`Password`,forId:`password`,children:(0,u.jsx)(`input`,{id:`password`,type:`password`,className:`miravo-input`,autoComplete:`current-password`,required:!0,value:s,onChange:e=>d(e.target.value)})}),(0,u.jsx)(`button`,{type:`submit`,className:`miravo-btn`,disabled:g,style:{marginTop:`0.5rem`},children:g?`Logging in…`:`Log in`})]})]})}function h({username:e}){let t=o(),[n,i]=(0,l.useState)(``),[s,d]=(0,l.useState)(``),[m,h]=(0,l.useState)(``),[g,_]=(0,l.useState)(!1);async function v(i){if(i.preventDefault(),h(``),n!==s){h(`Passwords do not match`);return}if(n.length<6){h(`Password must be at least 6 characters`);return}_(!0);try{await r(e,n),a.removeQueries({queryKey:[`bootstrap`]}),t(`/`,{replace:!0})}catch(e){h(c(e,`Password change failed`))}finally{_(!1)}}return(0,u.jsxs)(`form`,{onSubmit:v,children:[(0,u.jsxs)(`div`,{style:{marginBottom:`2rem`},children:[(0,u.jsx)(`h1`,{style:{fontFamily:`var(--font-heading)`,fontSize:`1.5rem`,fontWeight:800,color:`var(--foreground)`,letterSpacing:`-0.035em`,lineHeight:1.15,margin:0},children:`Update password`}),(0,u.jsxs)(`p`,{style:{fontSize:`0.82rem`,color:`var(--muted-foreground)`,marginTop:`0.4rem`,lineHeight:1.5},children:[`Default password detected.`,` `,(0,u.jsx)(`span`,{style:{color:`var(--warning)`},children:`Please set a new one.`})]})]}),m&&(0,u.jsx)(p,{message:m}),(0,u.jsxs)(`div`,{style:{display:`flex`,flexDirection:`column`,gap:`1.1rem`},children:[(0,u.jsx)(f,{label:`New password`,forId:`new-password`,children:(0,u.jsx)(`input`,{id:`new-password`,type:`password`,className:`miravo-input`,autoComplete:`new-password`,required:!0,minLength:6,value:n,onChange:e=>i(e.target.value)})}),(0,u.jsx)(f,{label:`Confirm password`,forId:`confirm-password`,children:(0,u.jsx)(`input`,{id:`confirm-password`,type:`password`,className:`miravo-input`,autoComplete:`new-password`,required:!0,minLength:6,value:s,onChange:e=>d(e.target.value)})}),(0,u.jsx)(`button`,{type:`submit`,className:`miravo-btn`,disabled:g,style:{marginTop:`0.4rem`},children:g?`Setting password…`:`Set password`}),(0,u.jsx)(`div`,{style:{textAlign:`center`,marginTop:`0.15rem`},children:(0,u.jsx)(`button`,{type:`button`,className:`miravo-btn-ghost`,onClick:()=>{a.removeQueries({queryKey:[`bootstrap`]}),t(`/`,{replace:!0})},children:`Skip for now`})})]})]})}function g(){let e=(0,l.useRef)(null);return(0,l.useEffect)(()=>{let t=e.current;if(!t)return;let n=t.getContext(`2d`);if(!n)return;let r=t,i=n,a=getComputedStyle(document.documentElement).getPropertyValue(`--primary`).trim(),o=window.devicePixelRatio||1,s=0,c=0,l=0,u=0,d=[],f=[],p=[];function m(){d=[],f=[],p=[];let e=Math.max(15,Math.floor(s*c/35e3));for(let t=0;t<e;t++)d.push({x:0,y:0,bx:25+Math.random()*(s-50),by:25+Math.random()*(c-50),r:1+Math.random()*1.2,phase:Math.random()*Math.PI*2});for(let e=0;e<d.length;e++)for(let t=e+1;t<d.length;t++){let n=d[e],r=d[t];!n||!r||Math.hypot(n.bx-r.bx,n.by-r.by)<160&&Math.random()>.5&&f.push({from:e,to:t})}}function h(){s=r.offsetWidth,c=r.offsetHeight,r.width=s*o,r.height=c*o,i.setTransform(o,0,0,o,0,0),m()}function g(){l+=.016,i.clearRect(0,0,s,c);for(let e of d)e.x=e.bx+Math.sin(l*.15+e.phase)*5,e.y=e.by+Math.cos(l*.1+e.phase*1.3)*4;let e=new Set;for(let t of p)e.add(t.conn.from*256+t.conn.to);i.strokeStyle=a,i.lineWidth=.5;for(let t of f){let n=d[t.from],r=d[t.to];!n||!r||(i.globalAlpha=e.has(t.from*256+t.to)?.04:.012,i.beginPath(),i.moveTo(n.x,n.y),i.lineTo(r.x,r.y),i.stroke())}i.fillStyle=a;for(let e of d)i.globalAlpha=.08*(.6+Math.sin(l*.4+e.phase)*.4),i.beginPath(),i.arc(e.x,e.y,e.r,0,Math.PI*2),i.fill();if(Math.random()<.03&&f.length&&p.length<10){let e=f[Math.floor(Math.random()*f.length)];e&&p.push({conn:e,t:0,speed:.002+Math.random()*.003,alpha:.25+Math.random()*.35,size:1+Math.random()*1})}i.fillStyle=a;for(let e=p.length-1;e>=0;e--){let t=p[e];if(!t)continue;if(t.t+=t.speed,t.t>=1){p.splice(e,1);continue}let n=d[t.conn.from],r=d[t.conn.to];if(!n||!r)continue;let a=n.x+(r.x-n.x)*t.t,o=n.y+(r.y-n.y)*t.t;i.globalAlpha=t.alpha*.35,i.beginPath(),i.arc(a,o,t.size,0,Math.PI*2),i.fill()}i.globalAlpha=1,u=requestAnimationFrame(g)}let _=()=>{document.hidden?cancelAnimationFrame(u):u=requestAnimationFrame(g)},v,y=()=>{window.clearTimeout(v),v=window.setTimeout(h,250)};if(!window.matchMedia(`(prefers-reduced-motion: reduce)`).matches)return document.addEventListener(`visibilitychange`,_),window.addEventListener(`resize`,y),h(),g(),()=>{cancelAnimationFrame(u),window.clearTimeout(v),document.removeEventListener(`visibilitychange`,_),window.removeEventListener(`resize`,y)}},[]),(0,u.jsx)(`canvas`,{ref:e,style:{position:`absolute`,inset:0,width:`100%`,height:`100%`}})}var _=[{path:`pump-001/temp`,base:87.3,range:5,decimals:1,unit:`°C`,style:{left:`6%`,top:`18%`},delay:`1.4s`},{path:`comp/pressure`,base:4.21,range:.5,decimals:2,unit:`bar`,style:{right:`5%`,top:`12%`},delay:`1.7s`},{path:`motor/vibration`,base:2.14,range:.3,decimals:2,unit:`mm/s`,style:{left:`4%`,bottom:`18%`},delay:`2.0s`},{path:`gen/power`,base:482,range:20,decimals:0,unit:`kW`,style:{right:`4%`,bottom:`17%`},delay:`2.3s`},{path:`boiler/temp`,base:312,range:8,decimals:0,unit:`°C`,style:{left:`22%`,top:`8%`},delay:`2.6s`},{path:`turb/rpm`,base:1480,range:30,decimals:0,unit:`rpm`,style:{left:0,right:0,marginLeft:`auto`,marginRight:`auto`,width:`max-content`,bottom:`10%`},delay:`2.9s`}];function v(){let[e,t]=(0,l.useState)(()=>_.map(e=>({...e,displayValue:(e.base+(Math.random()-.5)*e.range).toFixed(e.decimals),flash:!1})));return(0,l.useEffect)(()=>{let e;function n(){document.hidden||(t(e=>e.map(e=>({...e,displayValue:(e.base+(Math.random()-.5)*e.range).toFixed(e.decimals),flash:!0}))),window.clearTimeout(e),e=window.setTimeout(()=>{t(e=>e.map(e=>({...e,flash:!1})))},400))}let r=window.setInterval(n,2200);return()=>{window.clearInterval(r),window.clearTimeout(e)}},[]),(0,u.jsx)(`div`,{style:{position:`absolute`,inset:0,zIndex:3,pointerEvents:`none`},children:e.map(e=>(0,u.jsxs)(`div`,{style:{position:`absolute`,...e.style,display:`flex`,alignItems:`center`,gap:`0.45rem`,padding:`0.32rem 0.7rem`,background:`color-mix(in srgb, var(--background) 70%, transparent)`,backdropFilter:`blur(6px)`,WebkitBackdropFilter:`blur(6px)`,border:`1px solid color-mix(in srgb, var(--primary) 8%, transparent)`,borderRadius:4,fontFamily:`var(--font-mono)`,fontSize:`0.61rem`,letterSpacing:`0.02em`,opacity:0,animation:`readout-appear 0.6s cubic-bezier(0.22,1,0.36,1) ${e.delay} forwards`},children:[(0,u.jsx)(`span`,{style:{width:4,height:4,borderRadius:`50%`,background:`var(--primary)`,boxShadow:`0 0 3px color-mix(in srgb, var(--primary) 18%, transparent)`,animation:`dot-pulse 2.5s ease-in-out infinite`,flexShrink:0,display:`block`}}),(0,u.jsx)(`span`,{style:{color:`var(--tooltip-border)`},children:e.path}),(0,u.jsx)(`span`,{style:{color:e.flash?`var(--warning)`:`var(--primary)`,fontWeight:600,minWidth:`3em`,textAlign:`right`,transition:`color 0.4s`},children:e.displayValue}),(0,u.jsx)(`span`,{style:{color:`var(--tooltip-border)`,fontSize:`0.54rem`},children:e.unit})]},e.path))})}var y=`miravo start --template smart-factory`,b=6,x=[{id:`sf`,indent:``,label:`site`,text:`smart-factory`},{id:`l1`,indent:` `,label:`area`,text:`line-1`},{id:`p001`,indent:` `,label:`cell`,text:`pump-001`},{id:`p001-t`,indent:` `,text:`temperature`,value:{base:87.3,range:5,decimals:1,unit:`°C`},protocol:`mqtt`},{id:`p001-p`,indent:` `,text:`pressure`,value:{base:4.21,range:.5,decimals:2,unit:`bar`},protocol:`opcua`},{id:`p001-v`,indent:` `,text:`vibration`,value:{base:2.14,range:.3,decimals:2,unit:`mm/s`},protocol:`modbus`},{id:`b002`,indent:` `,label:`cell`,text:`boiler-002`},{id:`b002-t`,indent:` `,text:`temperature`,value:{base:312,range:8,decimals:0,unit:`°C`},protocol:`mqtt`},{id:`c003`,indent:` `,label:`cell`,text:`comp-003`},{id:`c003-r`,indent:` `,text:`rpm`,value:{base:1480,range:30,decimals:0,unit:`rpm`},protocol:`modbus`},{id:`l2`,indent:` `,label:`area`,text:`line-2`},{id:`t004`,indent:` `,label:`cell`,text:`tank-004`},{id:`t004-l`,indent:` `,text:`level`,value:{base:72.1,range:5,decimals:1,unit:`%`},protocol:`mqtt`},{id:`m005`,indent:` `,label:`cell`,text:`motor-005`},{id:`m005-c`,indent:` `,text:`current`,value:{base:12.4,range:1.5,decimals:1,unit:`A`},protocol:`opcua`}],S=14,C=x.flatMap((e,t)=>e.value?[t]:[]),w=4+x.length,T=.66,E=1.85,D=2.1+w*T*E+1.15*T,O=[{assetId:`p001`,name:`cavitation`,event:`fault:cavitation on pump-001: pressure drop`,resolve:`fault:resolved on pump-001: nominal`,overrides:[{tagId:`p001-t`,base:95.2,range:3},{tagId:`p001-p`,base:1.83,range:.3},{tagId:`p001-v`,base:8.71,range:1.5}]},{assetId:`c003`,name:`bearing-wear`,event:`lifecycle:degraded on comp-003: rpm declining`,resolve:`lifecycle:restored on comp-003: nominal`,overrides:[{tagId:`c003-r`,base:924,range:40}]},{assetId:`m005`,name:`overcurrent`,event:`fault:overcurrent on motor-005: current spike`,resolve:`fault:resolved on motor-005: nominal`,overrides:[{tagId:`m005-c`,base:24.8,range:3}]}],k=new Map(x.map((e,t)=>[e.id,t]));function A(){let[e,t]=(0,l.useState)(0),[n,r]=(0,l.useState)(0),[i,a]=(0,l.useState)(()=>x.map(e=>e.value?(e.value.base+(Math.random()-.5)*e.value.range).toFixed(e.value.decimals):``)),[o,s]=(0,l.useState)(new Set),[c,d]=(0,l.useState)(null),[f,p]=(0,l.useState)(`+231 tags streaming`),m=(0,l.useRef)(new Set);(0,l.useEffect)(()=>{let e={timers:[],typeInt:0,liveInt:0,flashT:0},n=(t,n)=>{e.timers.push(window.setTimeout(t,n))},i=0;return n(()=>{e.typeInt=window.setInterval(()=>{if(i++,t(i),i>=37){window.clearInterval(e.typeInt),n(()=>r(1),400),n(()=>r(2),750),n(()=>r(3),1150);for(let e=0;e<x.length;e++)n(()=>r(4+e),1300+e*110);let t=1300+x.length*110+250;n(()=>r(w),t),n(()=>{e.liveInt=window.setInterval(()=>{let t=2+Math.floor(Math.random()*2),n=[...C.filter(e=>!m.current.has(e))].sort(()=>Math.random()-.5).slice(0,t),r=new Set(n);a(e=>{let t=[...e];for(let e of r){let n=x[e]?.value;n&&(t[e]=(n.base+(Math.random()-.5)*n.range).toFixed(n.decimals))}return t}),s(r),window.clearTimeout(e.flashT),e.flashT=window.setTimeout(()=>s(new Set),350)},1600);let t=0,r=()=>{let e=O[t%O.length];if(!e)return;let i=new Set(e.overrides.map(e=>k.get(e.tagId)).filter(e=>e!==void 0));m.current=i,d({assetId:e.assetId,name:e.name,indices:i}),p(e.event),a(t=>{let n=[...t];for(let t of e.overrides){let e=k.get(t.tagId);if(e!==void 0){let r=x[e];n[e]=(t.base+(Math.random()-.5)*t.range).toFixed(r?.value?.decimals??1)}}return n}),n(()=>{m.current=new Set,d(null),p(e.resolve),a(t=>{let n=[...t];for(let t of e.overrides){let e=k.get(t.tagId);if(e!==void 0){let t=x[e];t?.value&&(n[e]=(t.value.base+(Math.random()-.5)*t.value.range).toFixed(t.value.decimals))}}return n}),n(()=>{p(`+231 tags streaming`),t++,n(r,8e3)},4e3)},1e4)};n(r,8e3)},t+500)}},32)},200),()=>{for(let t of e.timers)window.clearTimeout(t);window.clearInterval(e.typeInt),window.clearInterval(e.liveInt),window.clearTimeout(e.flashT)}},[]);let h=y.slice(0,Math.min(e,b)),g=e>b?y.slice(b,e):``;return(0,u.jsx)(`div`,{style:{position:`absolute`,top:`50%`,left:`50%`,transform:`translate(-50%, -50%)`,zIndex:5,pointerEvents:`none`},children:(0,u.jsxs)(`div`,{style:{border:`1px solid color-mix(in srgb, var(--primary) 10%, transparent)`,borderRadius:4,boxShadow:`none`,overflow:`hidden`,width:540},children:[(0,u.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:6,padding:`0.5rem 0.85rem`,background:`color-mix(in srgb, var(--sidebar) 50%, transparent)`,backdropFilter:`blur(8px)`,WebkitBackdropFilter:`blur(8px)`,borderBottom:`1px solid color-mix(in srgb, var(--primary) 6%, transparent)`},children:[(0,u.jsx)(`span`,{style:{width:7,height:7,borderRadius:`50%`,background:`#ff5f57`,opacity:.5}}),(0,u.jsx)(`span`,{style:{width:7,height:7,borderRadius:`50%`,background:`#febc2e`,opacity:.5}}),(0,u.jsx)(`span`,{style:{width:7,height:7,borderRadius:`50%`,background:`#28c840`,opacity:.5}}),(0,u.jsx)(`span`,{style:{fontFamily:`var(--font-mono)`,fontSize:`0.5rem`,color:`var(--tooltip-foreground)`,marginLeft:`auto`,letterSpacing:`0.04em`,opacity:.5},children:`Build realistic industrial environments`})]}),(0,u.jsxs)(`div`,{style:{height:`min(${D}rem, calc(100vh - 11rem))`,overflowY:`auto`,overflowX:`hidden`,background:`color-mix(in srgb, var(--card) 60%, transparent)`,padding:`1rem 1.25rem 1.1rem`,fontFamily:`var(--font-mono)`,fontSize:`${T}rem`,lineHeight:E,whiteSpace:`pre`},children:[(0,u.jsxs)(`div`,{children:[(0,u.jsx)(`span`,{style:{color:`var(--muted-foreground)`},children:`$ `}),(0,u.jsx)(`span`,{style:{color:`var(--primary)`},children:h}),(0,u.jsx)(`span`,{style:{color:`var(--foreground)`,opacity:.9},children:g}),e>0&&e<37&&(0,u.jsx)(`span`,{style:{display:`inline-block`,width:5,height:10,background:`var(--primary)`,verticalAlign:`text-bottom`,marginLeft:1,animation:`cursor-blink 1s step-end infinite`}})]}),n>=1&&(0,u.jsxs)(`div`,{style:{opacity:0,animation:`terminal-line 0.4s ease forwards`},children:[(0,u.jsx)(`span`,{style:{color:`var(--primary)`},children:`✓`}),(0,u.jsx)(`span`,{style:{color:`var(--tooltip-foreground)`},children:` Loaded `}),(0,u.jsx)(`span`,{style:{color:`var(--primary)`},children:`smart-factory`}),(0,u.jsx)(`span`,{style:{color:`var(--muted-foreground)`},children:` · 10 assets · 240 tags`})]}),n>=2&&(0,u.jsxs)(`div`,{style:{opacity:0,animation:`terminal-line 0.4s ease 0.05s forwards`},children:[(0,u.jsx)(`span`,{style:{color:`var(--primary)`},children:`✓`}),(0,u.jsx)(`span`,{style:{color:`var(--tooltip-foreground)`},children:` Protocols `}),(0,u.jsx)(`span`,{style:{color:`var(--muted-foreground)`},children:`mqtt :1883 · opcua :4840 · modbus :1502`})]}),n>=3&&(0,u.jsx)(`div`,{style:{opacity:0,animation:`terminal-line 0.3s ease forwards`,marginTop:`0.6em`}}),x.map((e,t)=>{if(n<4+t)return null;let r=!!e.value;return(0,u.jsxs)(`div`,{style:{opacity:0,animation:`tree-line 0.3s ease forwards`},children:[(0,u.jsx)(`span`,{style:{color:`var(--tooltip-border)`},children:e.indent}),r&&e.value?(0,u.jsxs)(u.Fragment,{children:[(0,u.jsx)(`span`,{style:{color:`var(--muted-foreground)`},children:e.text.padEnd(S)}),(0,u.jsx)(`span`,{style:{color:c?.indices.has(t)?`var(--destructive)`:o.has(t)?`var(--primary)`:`var(--foreground)`,transition:`color 0.3s`},children:(i[t]??``).padStart(7)}),(0,u.jsx)(`span`,{style:{color:`var(--tooltip-border)`},children:` ${e.value.unit.padEnd(5)}`}),e.protocol&&(0,u.jsx)(`span`,{style:{color:`var(--tooltip-border)`},children:e.protocol})]}):(0,u.jsxs)(u.Fragment,{children:[e.label&&(0,u.jsx)(`span`,{style:{color:`var(--tooltip-border)`},children:`${e.label}: `}),(0,u.jsx)(`span`,{style:{color:`var(--tooltip-foreground)`},children:e.text}),e.label===`cell`&&c?.assetId===e.id&&(0,u.jsxs)(`span`,{style:{marginLeft:`0.8em`,color:`var(--destructive)`,fontSize:`0.9em`},children:[`: `,c.name]})]})]},e.id)}),n>=w&&(0,u.jsx)(`div`,{style:{opacity:0,animation:`terminal-line 0.4s ease forwards`,marginTop:`0.55em`,textAlign:`right`},children:(0,u.jsx)(`span`,{style:{color:f.includes(`resolved`)||f.includes(`restored`)||f.includes(`fault:`)||f.includes(`lifecycle:`)?`var(--muted-foreground)`:`var(--tooltip-border)`,transition:`color 0.4s`},children:f})})]})]})})}function j(){let[e,t]=(0,l.useState)(!1),[n,r]=(0,l.useState)(``);return(0,u.jsxs)(u.Fragment,{children:[(0,u.jsx)(`style`,{children:d}),(0,u.jsxs)(`div`,{className:`login-page`,children:[(0,u.jsxs)(`div`,{className:`login-form-panel`,style:{background:`var(--background)`,backgroundImage:`radial-gradient(circle, color-mix(in srgb, var(--primary) 2.2%, transparent) 1px, transparent 1px)`,backgroundSize:`70px 70px`,display:`flex`,flexDirection:`column`,position:`relative`,overflow:`hidden`},children:[(0,u.jsx)(`div`,{style:{position:`absolute`,bottom:-80,right:-80,width:400,height:400,background:`radial-gradient(circle, color-mix(in srgb, var(--primary) 3.5%, transparent) 0%, transparent 65%)`,pointerEvents:`none`}}),(0,u.jsx)(`div`,{className:`login-header`,style:{padding:`1.25rem 2rem`,borderBottom:`1px solid var(--secondary)`,zIndex:1,display:`flex`,alignItems:`center`,justifyContent:`space-between`},children:(0,u.jsxs)(s,{to:`/`,style:{display:`inline-flex`,alignItems:`center`,gap:`0.5rem`,textDecoration:`none`},children:[(0,u.jsx)(`span`,{style:{display:`flex`,width:32,height:32,flexShrink:0,alignItems:`center`,justifyContent:`center`},children:(0,u.jsx)(`img`,{src:`/miravo-logo.webp`,alt:``,width:28,height:28,loading:`eager`,decoding:`async`,style:{display:`block`,width:`100%`,height:`100%`,objectFit:`contain`,transform:`translateY(1.5px)`}})}),(0,u.jsx)(`span`,{style:{fontFamily:`var(--font-heading)`,fontSize:`1.25rem`,fontWeight:600,color:`var(--foreground)`,letterSpacing:`-0.025em`,lineHeight:1},children:`Miravo`}),(0,u.jsx)(`span`,{style:{fontFamily:`var(--font-mono)`,fontSize:`0.52rem`,fontWeight:600,color:`var(--primary)`,background:`color-mix(in srgb, var(--primary) 6%, transparent)`,border:`1px solid color-mix(in srgb, var(--primary) 14%, transparent)`,padding:`0.2rem 0.5rem`,borderRadius:4,lineHeight:1,display:`inline-flex`,alignItems:`center`,alignSelf:`center`},children:`Console`})]})}),(0,u.jsx)(`div`,{className:`login-form-area`,style:{flex:1,display:`flex`,alignItems:`center`,justifyContent:`center`,padding:`2.5rem 2rem`,zIndex:1},children:(0,u.jsx)(`div`,{style:{width:`100%`,maxWidth:370},children:(0,u.jsxs)(`div`,{className:`login-card`,style:{position:`relative`,background:`var(--card)`,border:`1px solid color-mix(in srgb, var(--secondary) 80%, transparent)`,borderRadius:4,overflow:`hidden`,padding:`2.25rem`},children:[(0,u.jsx)(`div`,{style:{position:`absolute`,top:0,left:14,right:14,height:1,background:`linear-gradient(90deg, transparent, color-mix(in srgb, var(--primary) 35%, transparent) 20%, color-mix(in srgb, var(--primary) 35%, transparent) 80%, transparent)`}}),e?(0,u.jsx)(h,{username:n}):(0,u.jsx)(m,{onChangePassword:e=>{r(e),t(!0)}})]})})}),(0,u.jsxs)(`div`,{className:`login-footer`,style:{padding:`0.9rem 2rem`,borderTop:`1px solid var(--secondary)`,display:`flex`,justifyContent:`space-between`,alignItems:`center`,zIndex:1},children:[(0,u.jsx)(`span`,{style:{fontFamily:`var(--font-mono)`,fontSize:`0.6rem`,color:`var(--tooltip-border)`,letterSpacing:`0.04em`},children:`Miravo Console`}),(0,u.jsx)(`span`,{style:{fontFamily:`var(--font-mono)`,fontSize:`0.6rem`,color:`var(--tooltip-border)`,letterSpacing:`0.04em`},children:`© 2026`})]})]}),(0,u.jsxs)(`div`,{className:`login-left`,style:{position:`relative`,background:`var(--background)`,overflow:`hidden`,borderRight:`1px solid color-mix(in srgb, var(--primary) 8%, transparent)`},children:[(0,u.jsx)(`div`,{style:{position:`absolute`,inset:0,zIndex:4,pointerEvents:`none`,opacity:.025,backgroundImage:`url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E")`,backgroundSize:`200px 200px`}}),(0,u.jsx)(g,{}),(0,u.jsx)(`div`,{style:{position:`absolute`,inset:0,zIndex:1,background:`radial-gradient(ellipse 75% 70% at 50% 50%, transparent 40%, color-mix(in srgb, var(--background) 55%, transparent) 100%)`,pointerEvents:`none`}}),(0,u.jsx)(`div`,{style:{position:`absolute`,top:`50%`,left:`50%`,transform:`translate(-50%, -50%)`,width:700,height:500,background:`radial-gradient(ellipse at center, color-mix(in srgb, var(--primary) 1.8%, transparent) 0%, transparent 65%)`,pointerEvents:`none`,zIndex:2,animation:`login-glow-pulse 8s ease-in-out infinite alternate`}}),(0,u.jsx)(v,{}),(0,u.jsx)(A,{})]})]})]})}export{j as LoginPage};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as e}from"./rolldown-runtime-COnpUsM8.js";import{s as t}from"./vendor-charts-CAZdaPlq.js";import{at as n}from"./vendor-ui-BcvPjvmT.js";import{S as r,b as i,o as a}from"./api-DUOCKS6t.js";import{i as o,t as s}from"./query-fetch-error-B2TVF0yM.js";import{t as c}from"./proxy-Dd7NWn5E.js";import{t as l}from"./AnimatePresence-DOKfbxUr.js";import{a as u,i as d,n as f,o as p,r as m,s as h}from"./copy-button-BYq-qqmM.js";import{S as g,g as _,l as v,s as y,u as b,x}from"./format-B243kebG.js";import{n as S,t as C}from"./utils-CH98NBUe.js";import{t as w}from"./activity-CHJbwIn_.js";import{C as ee,E as T,n as E,t as D,w as O}from"./use-platform-stream-EUBU4hC1.js";import{l as k}from"./select-TsdpHrOx.js";import{i as A,n as j,r as M,t as N}from"./tabs-CrmZxWmX.js";import{r as te}from"./checkbox-_saaQAja.js";import{a as P,c as F,d as I,i as L,l as ne,n as R,o as z,r as B,s as V,t as H,u as U}from"./catalog-source-m5FRUDDK.js";import{c as W,n as re,r as ie,s as ae,t as oe}from"./use-engine-command-mutation-BHd8IkoT.js";import{t as se}from"./triangle-alert-B7bgkvtE.js";import{t as G}from"./badge-Dl0qmCnt.js";import{t as K}from"./get-error-message-CCNo4ZY0.js";var q=S(`box`,[[`path`,{d:`M21 8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16Z`,key:`hh9hay`}],[`path`,{d:`m3.3 7 8.7 5 8.7-5`,key:`g66t2b`}],[`path`,{d:`M12 22V12`,key:`d0xqtd`}]]),ce=S(`cog`,[[`path`,{d:`M11 10.27 7 3.34`,key:`16pf9h`}],[`path`,{d:`m11 13.73-4 6.93`,key:`794ttg`}],[`path`,{d:`M12 22v-2`,key:`1osdcq`}],[`path`,{d:`M12 2v2`,key:`tus03m`}],[`path`,{d:`M14 12h8`,key:`4f43i9`}],[`path`,{d:`m17 20.66-1-1.73`,key:`eq3orb`}],[`path`,{d:`m17 3.34-1 1.73`,key:`2wel8s`}],[`path`,{d:`M2 12h2`,key:`1t8f8n`}],[`path`,{d:`m20.66 17-1.73-1`,key:`sg0v6f`}],[`path`,{d:`m20.66 7-1.73 1`,key:`1ow05n`}],[`path`,{d:`m3.34 17 1.73-1`,key:`nuk764`}],[`path`,{d:`m3.34 7 1.73 1`,key:`1ulond`}],[`circle`,{cx:`12`,cy:`12`,r:`2`,key:`1c9p78`}],[`circle`,{cx:`12`,cy:`12`,r:`8`,key:`46899m`}]]),le=S(`heart-pulse`,[[`path`,{d:`M2 9.5a5.5 5.5 0 0 1 9.591-3.676.56.56 0 0 0 .818 0A5.49 5.49 0 0 1 22 9.5c0 2.29-1.5 4-3 5.5l-5.492 5.313a2 2 0 0 1-3 .019L5 15c-1.5-1.5-3-3.2-3-5.5`,key:`mvr1a0`}],[`path`,{d:`M3.22 13H9.5l.5-1 2 4.5 2-7 1.5 3.5h5.27`,key:`auskq0`}]]),ue=S(`terminal`,[[`path`,{d:`M12 19h8`,key:`baeox8`}],[`path`,{d:`m4 17 6-6-6-6`,key:`1yngyt`}]]),de=S(`wrench`,[[`path`,{d:`M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.106-3.105c.32-.322.863-.22.983.218a6 6 0 0 1-8.259 7.057l-7.91 7.91a1 1 0 0 1-2.999-3l7.91-7.91a6 6 0 0 1 7.057-8.259c.438.12.54.662.219.984z`,key:`1ngwbx`}]]),J=e(t(),1),Y=n(),fe=new Set([`fault_active`,`fault_count`,`active_fault_code`,`lifecycle_stage`,`health_state`,`availability_state`]);function pe(e){let t=[],n=[],r=[],i=[];for(let[a,o]of Object.entries(e)){let e={name:a,kind:o.kind,dataType:o.dataType,access:o.access,unit:o.unit,euRange:o.euRange};fe.has(a)?i.push(e):o.kind===`property`?t.push(e):o.access===`readwrite`?n.push(e):r.push(e)}let a=[];return t.length>0&&a.push({key:`nameplate`,label:`Nameplate`,icon:(0,Y.jsx)(U,{className:`size-3`}),members:t,accentClass:`text-muted-foreground`}),n.length>0&&a.push({key:`commands`,label:`Commands`,icon:(0,Y.jsx)(ue,{className:`size-3`}),members:n,accentClass:`text-info`}),r.length>0&&a.push({key:`process`,label:`Process Tags`,icon:(0,Y.jsx)(w,{className:`size-3`}),members:r,accentClass:`text-primary`}),i.length>0&&a.push({key:`health`,label:`Health & Status`,icon:(0,Y.jsx)(le,{className:`size-3`}),members:i,accentClass:`text-success`}),a}function me({modelName:e,onClose:t}){let[n,l]=(0,J.useState)(new Set([`nameplate`,`process`])),u=o({queryKey:i.catalog.modelSchema(e??``),queryFn:()=>a(`/catalog/models/${e}`,r.catalogModelDetail),enabled:e!==null}),d=u.data,f=u.isPending&&!d,p=u.isError,m=K(u.error,`Failed to load model.`);(0,J.useEffect)(()=>{e&&l(new Set([`nameplate`,`process`]))},[e]);let h=(0,J.useMemo)(()=>d?pe(d.members):[],[d]),g=(0,J.useCallback)(e=>{l(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})},[]),v=D(),y=d?Object.keys(d.members).length:0,x=d?Object.keys(d.methods).length:0;return(0,Y.jsx)(P,{open:e!==null,onOpenChange:e=>{e||(v.reset(),t())},children:(0,Y.jsx)(z,{side:`right`,className:`flex w-full flex-col gap-4 touch-manipulation`,children:f?null:p&&!d?(0,Y.jsx)(`div`,{className:`flex flex-1 flex-col justify-center px-2`,children:(0,Y.jsx)(s,{message:m,onRetry:()=>void u.refetch(),isRetrying:u.isFetching})}):d?(0,Y.jsxs)(c.div,{initial:{opacity:0},animate:{opacity:1},transition:{duration:.18},className:`flex min-h-0 flex-1 flex-col gap-4`,children:[(0,Y.jsxs)(F,{className:`gap-1 pb-0 pe-12`,children:[(0,Y.jsx)(ne,{className:`font-heading text-base uppercase tracking-wide`,children:b(d.name)}),d.description&&(0,Y.jsx)(V,{className:`text-xs leading-relaxed text-foreground/88`,children:d.description}),(0,Y.jsxs)(`div`,{className:`mt-2 flex flex-wrap items-center gap-2`,children:[(0,Y.jsxs)(G,{variant:`outline`,className:`font-mono text-xs`,children:[y,` members`]}),(0,Y.jsxs)(G,{variant:`outline`,className:`font-mono text-xs`,children:[x,` methods`]}),(0,Y.jsxs)(G,{variant:`outline`,className:`font-mono text-xs`,children:[d.faults.length,` faults`]}),d.lifecycle&&(0,Y.jsxs)(G,{variant:`outline`,className:`font-mono text-xs text-primary`,children:[d.lifecycle.stages.length,`-stage lifecycle`]}),(0,Y.jsx)(E,{stream:v})]})]}),(0,Y.jsxs)(N,{defaultValue:`overview`,className:`flex min-h-0 flex-1 flex-col gap-1 pt-0`,children:[(0,Y.jsxs)(M,{variant:`line`,className:`h-8! shrink-0 gap-0.5 border-b-border/60 px-2 py-0.5`,children:[(0,Y.jsx)(A,{value:`overview`,className:`min-h-10 px-2 py-1 text-xs text-foreground/82 after:bottom-[-3px] data-active:text-foreground sm:min-h-0 sm:px-2.5 sm:py-1`,children:`Overview`}),(0,Y.jsx)(A,{value:`deploy`,className:`min-h-10 px-2 py-1 text-xs text-foreground/82 after:bottom-[-3px] data-active:text-foreground sm:min-h-0 sm:px-2.5 sm:py-1`,children:`Deploy`})]}),(0,Y.jsx)(j,{value:`overview`,keepMounted:!0,className:`flex min-h-0 flex-1 flex-col`,children:(0,Y.jsx)(`div`,{className:`flex min-h-0 flex-1 flex-col px-3 pt-0`,children:(0,Y.jsx)(`div`,{className:`min-h-0 flex-1 overflow-y-auto pr-2`,children:(0,Y.jsxs)(`div`,{className:`flex flex-col gap-1.5 pb-1 pt-0.5`,children:[h.map(e=>(0,Y.jsx)(X,{sectionKey:e.key,label:e.label,count:e.members.length,icon:e.icon,accentClass:e.accentClass,expanded:n.has(e.key),onToggle:g,children:(0,Y.jsx)(`div`,{className:`flex flex-col gap-1`,children:e.members.map(e=>(0,Y.jsx)(he,{member:e},e.name))})},e.key)),d.faults.length>0&&(0,Y.jsx)(X,{sectionKey:`faults`,label:`Faults`,count:d.faults.length,icon:(0,Y.jsx)(se,{className:`size-3`}),accentClass:`text-warning`,expanded:n.has(`faults`),onToggle:g,children:(0,Y.jsx)(`div`,{className:`flex flex-wrap gap-1.5`,children:d.faults.map(e=>(0,Y.jsx)(G,{variant:`secondary`,className:`text-[10px] text-warning`,children:_(e)},e))})}),d.lifecycle&&(0,Y.jsx)(X,{sectionKey:`lifecycle`,label:`Lifecycle`,count:d.lifecycle.stages.length,icon:(0,Y.jsx)(ce,{className:`size-3`}),accentClass:`text-primary`,expanded:n.has(`lifecycle`),onToggle:g,children:(0,Y.jsx)(ge,{lifecycle:d.lifecycle})}),x>0&&(0,Y.jsx)(X,{sectionKey:`methods`,label:`Methods`,count:x,icon:(0,Y.jsx)(de,{className:`size-3`}),accentClass:`text-info`,expanded:n.has(`methods`),onToggle:g,children:(0,Y.jsx)(`div`,{className:`flex flex-col gap-1.5`,children:Object.entries(d.methods).map(([e,t])=>(0,Y.jsx)(_e,{name:e,method:t},e))})})]})})})}),(0,Y.jsx)(j,{value:`deploy`,keepMounted:!0,className:`flex min-h-0 flex-1 flex-col`,children:(0,Y.jsx)(`div`,{className:`flex min-h-0 flex-1 flex-col px-3 pt-0`,children:(0,Y.jsx)(L,{kind:`model`,id:d.name,displayName:b(d.name),yamlPath:`/catalog/models/${d.name}/yaml`,yamlFilename:`${d.name}.twin.yaml`,stream:v})})})]})]},d.name):(0,Y.jsx)(`div`,{className:`flex flex-1 items-center justify-center text-sm text-muted-foreground`,children:`Model not found`})})})}function X({sectionKey:e,label:t,count:n,icon:r,accentClass:i,expanded:a,onToggle:o,children:s}){return(0,Y.jsxs)(`div`,{className:`rounded-[var(--miravo-radius-tight)] border border-border/50`,children:[(0,Y.jsxs)(`button`,{type:`button`,className:`flex w-full items-center gap-1.5 px-2.5 py-1.5 text-left text-xs font-medium transition-colors hover:bg-muted/30`,onClick:()=>o(e),children:[(0,Y.jsx)(`span`,{className:i,children:r}),(0,Y.jsx)(`span`,{className:`uppercase tracking-wider`,children:t}),(0,Y.jsx)(G,{variant:`secondary`,className:`ml-auto text-[10px]`,children:n}),(0,Y.jsx)(k,{className:`size-3 text-muted-foreground transition-transform ${a?`rotate-180`:``}`})]}),(0,Y.jsx)(l,{initial:!1,children:a&&(0,Y.jsx)(c.div,{initial:{height:0,opacity:0},animate:{height:`auto`,opacity:1},exit:{height:0,opacity:0},transition:{duration:.2,ease:`easeOut`},className:`overflow-hidden`,children:(0,Y.jsx)(`div`,{className:`border-t px-2.5 py-1.5`,children:s})},`content`)})]})}function he({member:e}){return(0,Y.jsxs)(`div`,{className:`flex flex-wrap items-center gap-x-2 gap-y-0.5 py-0.5 text-xs`,children:[(0,Y.jsx)(`span`,{title:e.name,className:`min-w-0 truncate font-mono text-foreground`,children:y(e.name)}),(0,Y.jsx)(`span`,{className:`text-muted-foreground`,children:e.dataType}),e.unit&&(0,Y.jsx)(G,{variant:`outline`,className:`px-1 py-0 text-[10px]`,children:e.unit}),e.euRange&&(0,Y.jsxs)(`span`,{className:`ml-auto font-mono text-xs text-muted-foreground`,children:[`[`,e.euRange[0],`–`,e.euRange[1],`]`]})]})}var Z={healthy:`bg-success`,normal:`bg-success`,degraded:`bg-warning`,critical:`bg-destructive`,failed:`bg-destructive`};function ge({lifecycle:e}){let t=e.stages.length;return(0,Y.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,Y.jsx)(`div`,{className:`flex h-2.5 w-full overflow-hidden rounded-full bg-muted`,children:e.stages.map((e,n)=>(0,Y.jsx)(`div`,{className:`transition-[background-color] ${Z[e]??`bg-chart-1`} ${n===0?`rounded-l-full`:``} ${n===t-1?`rounded-r-full`:``}`,style:{width:`${100/t}%`}},`${e}-${n}`))}),(0,Y.jsx)(`div`,{className:`flex items-center gap-3`,children:e.stages.map((e,t)=>(0,Y.jsxs)(`div`,{className:`flex items-center gap-1.5 text-xs`,children:[(0,Y.jsx)(`span`,{className:`size-2 rounded-full ${Z[e]??`bg-chart-1`}`}),(0,Y.jsx)(`span`,{className:`text-muted-foreground`,children:_(e)})]},`${e}-${t}`))}),(0,Y.jsxs)(`span`,{className:`font-mono text-xs text-muted-foreground`,children:[`~`,v(e.totalHours),` total hours`]})]})}function _e({name:e,method:t}){return(0,Y.jsxs)(`div`,{className:`flex flex-col gap-0.5`,children:[(0,Y.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,Y.jsx)(`span`,{className:`font-mono text-xs text-foreground`,children:e}),t.inputArguments.length>0&&(0,Y.jsxs)(`span`,{className:`text-xs text-muted-foreground`,children:[`(`,t.inputArguments.map(e=>`${e.name}: ${e.dataType}`).join(`, `),`)`]})]}),t.description&&(0,Y.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:t.description})]})}var Q=[`builtin`,`personal`];function ve(){let[e,t]=(0,J.useState)(``),[n,_]=(0,J.useState)(`all`),[v,y]=(0,J.useState)({}),[S,w]=(0,J.useState)(null),[T,E]=(0,J.useState)(null),[D,O]=(0,J.useState)(null),k=(0,J.useRef)(null),A=oe();(0,J.useEffect)(()=>{let e=e=>{if(e.key!==`/`||e.metaKey||e.ctrlKey||e.altKey)return;let t=e.target.tagName;t===`INPUT`||t===`TEXTAREA`||t===`SELECT`||(e.preventDefault(),k.current?.focus())};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[]);let j=o({queryKey:i.catalog.models(),queryFn:()=>a(`/catalog/models`,r.catalogModels)}),M=j.data??[],N=j.isPending&&!j.data,P=j.isError&&!j.data,F=j.isError&&!!j.data,I=K(j.error,`Failed to load models.`),L=e=>v[e]??1,ne=(0,J.useCallback)((e,t)=>{y(n=>({...n,[e]:Math.max(1,Math.min(10,t))}))},[]),R=(0,J.useCallback)(e=>{O(e)},[]),z=(0,J.useCallback)(e=>{E(e)},[]),V=async e=>{w(e);try{return await A.mutateAsync({type:`spawn`,model:e,count:L(e)}),!0}catch{return!1}finally{w(null)}},H=(0,J.useMemo)(()=>{let e={all:M.length};for(let t of Q)e[t]=0;for(let t of M){let n=B(t.source);e[n]=(e[n]??0)+1}return e},[M]),U=e.toLowerCase(),W=M.filter(e=>n===`all`||B(e.source)===n).filter(e=>U?e.name.toLowerCase().includes(U)||(e.description?.toLowerCase().includes(U)??!1):!0);return(0,Y.jsxs)(`div`,{className:`@container/models mx-auto flex w-full max-w-screen-2xl flex-col gap-5 p-4 sm:gap-6 sm:p-6`,children:[(0,Y.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,Y.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,Y.jsx)(`h1`,{className:`font-heading text-2xl font-semibold tracking-tight`,children:`Asset Model Library`}),(0,Y.jsx)(G,{variant:`outline`,className:`text-xs`,children:P?(0,Y.jsx)(`span`,{className:`text-destructive`,children:`Unavailable`}):N&&M.length===0?(0,Y.jsx)(Y.Fragment,{children:`Loading...`}):(0,Y.jsxs)(Y.Fragment,{children:[M.length,` models`]})})]}),(0,Y.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`Canonical twin models with realistic physics, lifecycle degradation, and fault modes. Inspect to explore schema, copy YAML, or export.`})]}),P&&(0,Y.jsx)(s,{message:I,onRetry:()=>void j.refetch(),isRetrying:j.isFetching}),F&&(0,Y.jsx)(s,{message:`${I} Showing cached models.`,onRetry:()=>void j.refetch(),isRetrying:j.isFetching}),!P&&(0,Y.jsxs)(`div`,{className:`flex flex-wrap items-center gap-3`,children:[(0,Y.jsxs)(`div`,{className:`relative max-w-xs flex-1 min-w-[14rem]`,children:[(0,Y.jsx)(ee,{className:`absolute left-2.5 top-2.5 size-4 text-muted-foreground`}),(0,Y.jsx)(x,{ref:k,placeholder:`Filter models...`,value:e,onChange:e=>t(e.target.value),className:`pl-9 pr-7`}),!e&&(0,Y.jsx)(`kbd`,{className:`pointer-events-none absolute top-1/2 right-2 -translate-y-1/2 rounded-[var(--miravo-radius-tight)] border border-border bg-muted px-1 font-mono text-[10px] text-muted-foreground`,children:`/`})]}),(0,Y.jsx)(be,{value:n,counts:H,onChange:_})]}),(0,Y.jsx)(`div`,{className:`grid grid-cols-1 gap-4 @[720px]/models:grid-cols-2 @[1120px]/models:grid-cols-3`,"aria-busy":N&&!P,children:P?null:(0,Y.jsxs)(Y.Fragment,{children:[N&&M.length===0&&(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(`div`,{className:`h-44 animate-pulse rounded-[var(--miravo-radius-stadium-sm)] border border-border/50 bg-card/30`}),(0,Y.jsx)(`div`,{className:`h-44 animate-pulse rounded-[var(--miravo-radius-stadium-sm)] border border-border/50 bg-card/30`}),(0,Y.jsx)(`div`,{className:`h-44 animate-pulse rounded-[var(--miravo-radius-stadium-sm)] border border-border/50 bg-card/30`}),(0,Y.jsx)(`div`,{className:`h-44 animate-pulse rounded-[var(--miravo-radius-stadium-sm)] border border-border/50 bg-card/30`}),(0,Y.jsx)(`div`,{className:`h-44 animate-pulse rounded-[var(--miravo-radius-stadium-sm)] border border-border/50 bg-card/30`}),(0,Y.jsx)(`div`,{className:`h-44 animate-pulse rounded-[var(--miravo-radius-stadium-sm)] border border-border/50 bg-card/30`})]}),(0,Y.jsx)(l,{children:W.map((e,t)=>(0,Y.jsx)(c.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},exit:{opacity:0,scale:.96,transition:{duration:.15}},transition:{type:`spring`,stiffness:380,damping:30,delay:t*.04},className:`grid`,children:(0,Y.jsx)(ye,{model:e,count:L(e.name),spawning:S===e.name,onCountChange:ne,onInspect:R,onSpawn:z})},e.name))}),W.length===0&&M.length>0&&(0,Y.jsx)(`p`,{className:`col-span-full py-8 text-center text-sm text-muted-foreground`,children:`No models match the current filters.`})]})}),M.length>0&&(0,Y.jsx)(`div`,{className:C(ie,`p-0`),children:(0,Y.jsx)(`div`,{className:`community-teaser relative overflow-hidden rounded-[inherit]`,children:(0,Y.jsx)(`div`,{className:`relative z-10 mx-auto max-w-3xl px-5 py-10 sm:px-10 sm:py-12`,children:(0,Y.jsxs)(`div`,{className:`grid items-center gap-10 lg:grid-cols-[minmax(0,1fr)_minmax(0,17rem)]`,children:[(0,Y.jsxs)(`div`,{className:`order-2 flex min-w-0 flex-col gap-4 lg:order-1`,children:[(0,Y.jsxs)(`div`,{className:`flex flex-wrap items-baseline gap-x-3 gap-y-1`,children:[(0,Y.jsx)(`p`,{className:`blueprint-title text-primary`,children:`Future channel`}),(0,Y.jsx)(`span`,{className:`blueprint-stat text-[10px] text-muted-foreground`,children:`MIRAVO_REGISTRY · NOT_CONNECTED`})]}),(0,Y.jsx)(`h2`,{className:`font-heading text-xl font-semibold tracking-tight sm:text-2xl`,children:`Community Models`}),(0,Y.jsx)(`p`,{className:`max-w-xl text-sm leading-relaxed text-muted-foreground`,children:`Publish your custom twin models to the Miravo registry. Discover equipment models from other engineers, fork them, and adapt parameters for your use case.`}),(0,Y.jsx)(`div`,{children:(0,Y.jsx)(G,{variant:`outline`,className:`community-teaser-soon border-primary/35 bg-primary/5 text-[10px] text-primary`,children:`Coming Soon`})})]}),(0,Y.jsx)(`div`,{className:`order-1 flex justify-center lg:order-2 lg:justify-end`,children:(0,Y.jsxs)(`div`,{className:`community-teaser-module relative flex w-full max-w-[14rem] flex-col items-center justify-center gap-3 border border-primary/15 bg-muted/15 py-8 sm:max-w-[15.5rem] sm:py-10`,"aria-hidden":!0,children:[(0,Y.jsx)(`div`,{className:`community-teaser-icon-ring relative z-[1] flex size-[4.25rem] items-center justify-center rounded-[var(--miravo-radius-tight)] border border-primary/35 bg-gradient-to-br from-primary/18 to-primary/5`,children:(0,Y.jsx)(te,{className:`size-9 text-primary`,"aria-hidden":!0})}),(0,Y.jsx)(`span`,{className:`blueprint-stat relative z-[1] text-[9px] tracking-[0.18em] text-muted-foreground`,children:`AWAITING SIGNAL`}),(0,Y.jsx)(`span`,{className:`blueprint-stat relative z-[1] text-[9px] text-muted-foreground`,children:`Uplink idle`})]})})]})})})}),(0,Y.jsx)(f,{open:T!==null,onOpenChange:e=>{e||E(null)},children:(0,Y.jsxs)(m,{children:[(0,Y.jsxs)(p,{children:[(0,Y.jsx)(h,{children:`Spawn instances?`}),(0,Y.jsx)(d,{children:T!==null&&(0,Y.jsxs)(Y.Fragment,{children:[`This spawns `,L(T),` instance`,L(T)===1?``:`s`,` of`,` `,(0,Y.jsx)(`span`,{className:`font-medium text-foreground`,children:b(T)}),` `,`into the running environment.`]})})]}),(0,Y.jsxs)(u,{children:[(0,Y.jsx)(g,{variant:`outline`,disabled:S!==null,onClick:()=>E(null),children:`Cancel`}),(0,Y.jsx)(g,{disabled:S!==null||T===null,onClick:async()=>{T!==null&&await V(T)&&E(null)},children:S===T?`Spawning...`:`Spawn`})]})]})}),(0,Y.jsx)(me,{modelName:D,onClose:()=>O(null)})]})}var ye=(0,J.memo)(function({model:e,count:t,spawning:n,onCountChange:r,onInspect:i,onSpawn:a}){return(0,Y.jsxs)(`div`,{className:C(ae,`flex flex-col gap-4 p-5`),children:[(0,Y.jsxs)(`div`,{className:`flex items-start gap-3`,children:[(0,Y.jsx)(`div`,{className:`flex size-9 shrink-0 items-center justify-center rounded-[var(--miravo-radius-stadium-sm)] bg-primary/10 text-primary`,children:(0,Y.jsx)(q,{className:`size-4`})}),(0,Y.jsxs)(`div`,{className:`min-w-0 flex flex-col gap-0.5`,children:[(0,Y.jsx)(`span`,{className:`font-heading text-sm font-semibold uppercase tracking-wide`,children:b(e.name)}),e.description&&(0,Y.jsx)(`span`,{className:`line-clamp-2 text-xs leading-relaxed text-muted-foreground`,children:e.description})]})]}),(0,Y.jsxs)(`div`,{className:`flex flex-wrap items-center gap-x-3 gap-y-1 font-mono text-[11px] text-muted-foreground`,children:[(0,Y.jsx)($,{label:`mbr`,value:e.memberCount}),(0,Y.jsx)($,{label:`mth`,value:e.methodCount}),(0,Y.jsx)($,{label:`flt`,value:e.faultCount}),e.hasLifecycle&&(0,Y.jsxs)(`span`,{className:`flex items-center gap-1 text-primary`,children:[(0,Y.jsx)(`span`,{className:`text-[10px]`,children:`◈`}),(0,Y.jsxs)(`span`,{children:[e.lifecycleStageCount,`-stage`]})]}),(0,Y.jsx)(G,{variant:`outline`,className:C(`ml-auto shrink-0 font-sans text-[10px] font-medium uppercase tracking-wide`,H(e.source)),children:R(e.source)})]}),(0,Y.jsxs)(`div`,{className:`mt-auto flex items-center gap-2 border-t border-border/30 pt-3`,children:[(0,Y.jsxs)(`div`,{className:`flex items-center rounded-[var(--miravo-radius-tight)] border bg-muted/30`,children:[(0,Y.jsx)(g,{variant:`ghost`,size:`icon`,className:`size-7 rounded-none rounded-l-md`,disabled:t<=1,"aria-label":`Decrease count`,onClick:n=>{n.stopPropagation(),r(e.name,t-1)},children:(0,Y.jsx)(I,{className:`size-3`})}),(0,Y.jsx)(`span`,{className:`flex size-7 items-center justify-center border-x font-mono text-xs`,children:t}),(0,Y.jsx)(g,{variant:`ghost`,size:`icon`,className:`size-7 rounded-none rounded-r-md`,disabled:t>=10,"aria-label":`Increase count`,onClick:n=>{n.stopPropagation(),r(e.name,t+1)},children:(0,Y.jsx)(O,{className:`size-3`})})]}),(0,Y.jsxs)(g,{type:`button`,variant:`outline`,size:`sm`,onClick:()=>i(e.name),className:re,children:[(0,Y.jsx)(T,{className:`size-3.5`,"aria-hidden":!0}),`Inspect`]}),(0,Y.jsxs)(g,{size:`sm`,className:`ml-auto`,disabled:n,onClick:()=>a(e.name),children:[(0,Y.jsx)(W,{className:`mr-1 size-3`}),n?`...`:`Spawn`]})]})]})});function $({label:e,value:t}){return(0,Y.jsxs)(`span`,{children:[(0,Y.jsx)(`span`,{className:`text-foreground`,children:t}),` `,(0,Y.jsx)(`span`,{className:`text-muted-foreground`,children:e})]})}function be({value:e,counts:t,onChange:n}){return(0,Y.jsx)(`div`,{className:`flex flex-wrap items-center gap-1.5`,role:`radiogroup`,"aria-label":`Filter by source`,children:[{id:`all`,label:`All`},...Q.map(e=>({id:e,label:R(e)}))].map(r=>{let i=e===r.id,a=t[r.id]??0,o=r.id!==`all`&&a===0;return(0,Y.jsxs)(`label`,{className:C(`inline-flex h-7 items-center gap-1.5 rounded-[var(--miravo-radius-pill)] border px-3 text-xs font-medium transition-colors`,i?`border-primary/60 bg-primary/15 text-primary`:`border-border/60 bg-card/30 text-muted-foreground hover:border-border hover:bg-muted/40 hover:text-foreground`,o?`cursor-not-allowed opacity-40 hover:border-border/60 hover:bg-card/30 hover:text-muted-foreground`:`cursor-pointer`),children:[(0,Y.jsx)(`input`,{type:`radio`,name:`models-source-filter`,value:r.id,checked:i,disabled:o,onChange:()=>n(r.id),className:`sr-only`}),(0,Y.jsx)(`span`,{children:r.label}),(0,Y.jsx)(`span`,{className:`font-mono text-[10px] text-foreground`,children:a})]},r.id)})})}export{q as n,ve as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{t as e}from"./models-CZEVv1PS.js";export{e as ModelsPage};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{at as e}from"./vendor-ui-BcvPjvmT.js";import{n as t,s as n}from"./chunk-OE4NN4TA-m2UhO8Q2.js";import{n as r}from"./utils-CH98NBUe.js";import{t as i}from"./triangle-alert-B7bgkvtE.js";import{n as a}from"./auth-screen-backdrop-UsGua6Zt.js";var o=r(`arrow-up-right`,[[`path`,{d:`M7 7h10v10`,key:`1tivn9`}],[`path`,{d:`M7 17 17 7`,key:`1vkiza`}]]),s=r(`house`,[[`path`,{d:`M15 21v-8a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1v8`,key:`5wwlr5`}],[`path`,{d:`M3 10a2 2 0 0 1 .709-1.528l7-6a2 2 0 0 1 2.582 0l7 6A2 2 0 0 1 21 10v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z`,key:`r6nss1`}]]),c=e();function l(){let e=n();return(0,c.jsx)(a,{className:`min-h-full px-6 py-8 md:px-8`,children:(0,c.jsx)(`div`,{className:`mx-auto flex min-h-[calc(100svh-9rem)] max-w-3xl items-center justify-center`,children:(0,c.jsx)(`section`,{className:`relative w-full overflow-hidden rounded-[var(--miravo-radius-stadium-lg)] border border-primary/20 bg-transparent p-8 md:p-10`,children:(0,c.jsxs)(`div`,{className:`relative space-y-8`,children:[(0,c.jsxs)(`div`,{className:`space-y-4`,children:[(0,c.jsx)(`p`,{className:`font-mono text-xs uppercase tracking-[0.4em] text-muted-foreground`,children:`Fault code 404`}),(0,c.jsxs)(`div`,{className:`flex items-end gap-4`,children:[(0,c.jsx)(`span`,{className:`font-heading text-7xl font-black leading-none tracking-[-0.08em] text-transparent [-webkit-text-stroke:1px_color-mix(in_srgb,var(--primary)_55%,transparent)] md:text-9xl`,children:`404`}),(0,c.jsx)(`div`,{className:`mb-2 h-px flex-1 bg-linear-to-r from-primary/60 to-transparent`})]}),(0,c.jsxs)(`div`,{className:`max-w-2xl space-y-3`,children:[(0,c.jsx)(`h1`,{className:`text-4xl font-semibold tracking-[-0.04em] text-foreground md:text-5xl`,children:`Route not found in the control surface`}),(0,c.jsx)(`p`,{className:`max-w-xl text-base text-muted-foreground md:text-lg`,children:`This address does not map to an active console view.`})]})]}),(0,c.jsxs)(`div`,{className:`rounded-[var(--miravo-radius-stadium-sm)] border border-border/80 bg-background/55 p-5 backdrop-blur-sm`,children:[(0,c.jsxs)(`div`,{className:`mb-3 flex items-center gap-2 font-mono text-[0.7rem] uppercase tracking-[0.28em] text-muted-foreground`,children:[(0,c.jsx)(i,{className:`size-3.5 text-primary`}),`Requested path`]}),(0,c.jsx)(`code`,{className:`block overflow-x-auto rounded-[var(--miravo-radius-stadium-sm)] border border-primary/15 bg-background/30 px-4 py-3 font-mono text-sm text-primary`,children:e.pathname})]}),(0,c.jsxs)(`div`,{className:`flex flex-wrap gap-3`,children:[(0,c.jsxs)(t,{to:`/`,className:`inline-flex items-center gap-2 rounded-[var(--miravo-radius-pill)] border border-foreground/15 bg-foreground px-4 py-2.5 font-medium text-background transition hover:bg-foreground/90`,children:[(0,c.jsx)(s,{className:`size-4`}),`Return to Fleet`]}),(0,c.jsxs)(t,{to:`/catalog`,className:`group inline-flex items-center gap-3 rounded-[var(--miravo-radius-pill)] border border-foreground/8 bg-background/20 px-3 py-2.5 text-foreground shadow-[inset_0_1px_0_color-mix(in_srgb,var(--foreground)_4%,transparent)] backdrop-blur-sm transition hover:border-primary/30 hover:bg-primary/8 hover:text-primary`,children:[(0,c.jsx)(`span`,{className:`inline-flex size-8 items-center justify-center rounded-[var(--miravo-radius-tight)] border border-foreground/8 bg-foreground/4 text-muted-foreground transition group-hover:border-primary/25 group-hover:bg-primary/12 group-hover:text-primary`,children:(0,c.jsx)(o,{className:`size-4`})}),(0,c.jsx)(`span`,{className:`font-medium tracking-[-0.01em]`,children:`Open Catalog`})]})]})]})})})})}export{l as NotFoundPage};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{n as e}from"./utils-CH98NBUe.js";var t=e(`chevron-right`,[[`path`,{d:`m9 18 6-6-6-6`,key:`mthhwq`}]]),n=[{id:`litmus-edge`,label:`Litmus Edge`,exportLabel:`Litmus Edge`,shortCode:`LE`,status:`available`},{id:`azure-dtdl`,label:`Azure Digital Twins (DTDL)`,exportLabel:`Azure Digital Twins (DTDL)`,shortCode:`AZ`,status:`coming-soon`},{id:`aws-sitewise`,label:`AWS IoT SiteWise`,exportLabel:`AWS IoT SiteWise`,shortCode:`AWS`,status:`coming-soon`},{id:`ignition-udt`,label:`Ignition UDT`,exportLabel:`Ignition UDT`,shortCode:`IGN`,status:`coming-soon`}],r=n.filter(e=>e.status===`available`),i=n.filter(e=>e.status===`coming-soon`),a=r[0]??n[0];export{t as a,n as i,i as n,a as r,r as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as e}from"./rolldown-runtime-COnpUsM8.js";import{s as t}from"./vendor-charts-CAZdaPlq.js";import{at as n}from"./vendor-ui-BcvPjvmT.js";import{J as r,S as i,Y as a,b as o,o as s,q as c,x as l}from"./api-DUOCKS6t.js";import{a as u,c as d,i as f,r as p,t as m}from"./query-fetch-error-B2TVF0yM.js";import{t as h}from"./proxy-Dd7NWn5E.js";import{t as g}from"./AnimatePresence-DOKfbxUr.js";import{i as _,r as v}from"./dist-jROhexoH.js";import{n as y}from"./chunk-OE4NN4TA-m2UhO8Q2.js";import{a as b,i as x,l as S,n as C,o as w,r as ee,s as T,t as E}from"./copy-button-BYq-qqmM.js";import{C as D,S as O,m as k,o as A,u as j,w as M,x as N}from"./format-B243kebG.js";import{n as P,t as F}from"./utils-CH98NBUe.js";import{t as I}from"./activity-CHJbwIn_.js";import{t as L}from"./arrow-right-DzTjpAuX.js";import{C as R,O as z,S as B,T as te,_ as ne,a as V,c as H,d as re,f as ie,h as ae,i as oe,l as se,m as ce,n as le,o as U,p as ue,r as de,s as fe,t as pe,u as me,v as he,w as ge,x as _e,y as ve}from"./use-platform-stream-EUBU4hC1.js";import{n as ye,t as be}from"./catalog-template-icons-MOd-xD7l.js";import{c as xe,i as W,l as Se,n as Ce,s as we,t as Te}from"./select-TsdpHrOx.js";import{a as Ee,i as De,r as G}from"./platform-targets-DkU1GIU_.js";import{c as Oe,i as ke,n as Ae,o as je,r as Me,s as Ne,t as Pe}from"./tabs-CrmZxWmX.js";import{i as Fe,n as Ie,r as Le,t as Re}from"./checkbox-_saaQAja.js";import{t as ze}from"./layers-Cg3yeSqL.js";import{t as Be}from"./triangle-alert-B7bgkvtE.js";import{t as K}from"./skeleton-BK5ydi_g.js";import{i as Ve,n as He,t as Ue}from"./tooltip-5y0snV5M.js";import{t as We}from"./badge-Dl0qmCnt.js";import{a as Ge,i as Ke,n as qe,o as Je,r as Ye,s as Xe,t as Ze}from"./dropdown-menu-6JrsGi7P.js";import{t as Qe}from"./label-CM_MIru8.js";import{t as q}from"./get-error-message-CCNo4ZY0.js";var $e=class extends d{constructor(e,t){super(e,t)}bindMethods(){super.bindMethods(),this.fetchNextPage=this.fetchNextPage.bind(this),this.fetchPreviousPage=this.fetchPreviousPage.bind(this)}setOptions(e){super.setOptions({...e,behavior:a()})}getOptimisticResult(e){return e.behavior=a(),super.getOptimisticResult(e)}fetchNextPage(e){return this.fetch({...e,meta:{fetchMore:{direction:`forward`}}})}fetchPreviousPage(e){return this.fetch({...e,meta:{fetchMore:{direction:`backward`}}})}createResult(e,t){let{state:n}=e,i=super.createResult(e,t),{isFetching:a,isRefetching:o,isError:s,isRefetchError:l}=i,u=n.fetchMeta?.fetchMore?.direction,d=s&&u===`forward`,f=a&&u===`forward`,p=s&&u===`backward`,m=a&&u===`backward`;return{...i,fetchNextPage:this.fetchNextPage,fetchPreviousPage:this.fetchPreviousPage,hasNextPage:c(t,n.data),hasPreviousPage:r(t,n.data),isFetchNextPageError:d,isFetchingNextPage:f,isFetchPreviousPageError:p,isFetchingPreviousPage:m,isRefetchError:l&&!d&&!p,isRefetching:o&&!f&&!m}}};function et(e,t){return u(e,$e,t)}var tt=P(`clipboard-list`,[[`rect`,{width:`8`,height:`4`,x:`8`,y:`2`,rx:`1`,ry:`1`,key:`tgr4d6`}],[`path`,{d:`M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2`,key:`116196`}],[`path`,{d:`M12 11h4`,key:`1jrz19`}],[`path`,{d:`M12 16h4`,key:`n85exb`}],[`path`,{d:`M8 11h.01`,key:`1dfujw`}],[`path`,{d:`M8 16h.01`,key:`18s6g9`}]]),nt=P(`clock-3`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M12 6v6h4`,key:`135r8i`}]]),rt=P(`ellipsis`,[[`circle`,{cx:`12`,cy:`12`,r:`1`,key:`41hilf`}],[`circle`,{cx:`19`,cy:`12`,r:`1`,key:`1wjl8i`}],[`circle`,{cx:`5`,cy:`12`,r:`1`,key:`1pcz8c`}]]),it=P(`pencil`,[[`path`,{d:`M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z`,key:`1a8usu`}],[`path`,{d:`m15 5 4 4`,key:`1mk7zo`}]]),at=P(`upload`,[[`path`,{d:`M12 3v12`,key:`1x0j5s`}],[`path`,{d:`m17 8-5-5-5 5`,key:`7q97r8`}],[`path`,{d:`M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4`,key:`ih7n3h`}]]),J=e(t(),1),Y=n(),ot=`rounded-(--miravo-radius-stadium-sm) border border-dashed border-border/55 bg-muted/10`;function st(){return(0,Y.jsx)(`p`,{className:`mt-2 text-pretty text-sm leading-relaxed text-muted-foreground`,children:`Add a target to get started.`})}function ct({onClick:e}){return(0,Y.jsxs)(O,{type:`button`,size:`sm`,className:`h-7 shrink-0 gap-1.5 text-xs`,onClick:e,children:[(0,Y.jsx)(ge,{className:`size-3.5`,"aria-hidden":!0}),`Add Target`]})}function lt({titleId:e,frameIcon:t,description:n,children:r}){return(0,Y.jsx)(`section`,{"aria-labelledby":e,className:ot,children:(0,Y.jsxs)(`div`,{className:`flex flex-col items-center gap-4 px-4 py-10 text-center`,children:[(0,Y.jsx)(`div`,{className:`flex size-12 items-center justify-center rounded-(--miravo-radius-stadium-sm) border border-dashed border-border/50`,children:t}),(0,Y.jsxs)(`div`,{className:`max-w-sm`,children:[(0,Y.jsx)(`h2`,{id:e,className:`font-heading text-sm font-semibold tracking-tight text-foreground`,children:`No targets yet`}),n]}),r]})})}function ut({stream:e,onReset:t,catalogTemplates:n}){if(!e.operation&&e.status!==`running`)return null;let{title:r,subtitle:i}=oe(e),a=e.status===`complete`,o=e.status===`error`,s=e.status===`running`,c=a||o,l=e.cancelRequested;async function u(){await e.cancel().catch(()=>{})}return(0,Y.jsx)(ce,{title:r,subtitle:i,footerAction:s&&e.operation?.operationId?(0,Y.jsx)(`div`,{className:`ml-auto shrink-0`,children:(0,Y.jsx)(`button`,{type:`button`,onClick:u,disabled:l,"aria-busy":l,className:F(D({variant:`outline`,size:`sm`}),`group h-8 gap-1.5 px-3 text-xs`,l?`cursor-not-allowed`:`hover:bg-destructive/12 hover:text-destructive hover:border-destructive/35`),children:l?(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(je,{className:`size-3.5 shrink-0 animate-spin text-muted-foreground`,"aria-hidden":!0}),(0,Y.jsx)(h.span,{animate:{opacity:[1,.72,1]},transition:{duration:1.25,repeat:1/0,ease:`easeInOut`},className:`font-medium text-foreground`,children:`Cancelling…`})]}):(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(M,{className:`size-3.5 shrink-0 text-foreground/65 group-hover:text-destructive`,"aria-hidden":!0}),(0,Y.jsx)(h.span,{animate:{opacity:[1,.88,1]},transition:{duration:2.2,repeat:1/0,ease:`easeInOut`},children:`Cancel`})]})})}):c?(0,Y.jsxs)(`div`,{className:`flex w-full flex-col gap-1.5`,children:[(0,Y.jsxs)(`div`,{className:`flex min-w-0 w-full flex-1 flex-wrap items-center justify-between gap-x-3 gap-y-1`,children:[(0,Y.jsxs)(y,{to:`/platforms?tab=activity`,className:F(D({variant:`ghost`,size:`xs`}),`group inline-flex h-6 shrink-0 items-center gap-1.5 px-2 text-[11px] font-medium text-foreground/80`,`hover:bg-primary/12 hover:text-primary`),children:[(0,Y.jsx)(I,{className:`size-3 shrink-0 text-foreground/70 group-hover:text-primary`,"aria-hidden":!0}),`View full activity`,(0,Y.jsx)(Ee,{className:`size-2.5 shrink-0 text-foreground/50 group-hover:text-primary`,"aria-hidden":!0})]}),(0,Y.jsx)(`div`,{className:`flex shrink-0 items-center`,children:(0,Y.jsx)(O,{type:`button`,variant:`secondary`,size:`xs`,className:`h-6 px-2.5 text-[11px] font-medium`,onClick:t,children:`Close`})})]}),e.operation?.status===`cancelled`||o&&e.operation?(0,Y.jsx)(he,{type:e.operation.type,errorMessage:e.operation.error,className:`mt-2.5 w-full min-w-0`}):null]}):void 0,onDismiss:t,children:e.operation?(0,Y.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-2`,children:[(0,Y.jsx)(ne,{operation:e.operation,catalogTemplates:n}),e.logs.length>0?(0,Y.jsx)(`div`,{className:`flex min-w-0 flex-col gap-1.5 px-2 pb-2`,children:e.logs.map(e=>(0,Y.jsxs)(`div`,{className:F(`flex min-w-0 items-start gap-2 rounded-[var(--miravo-radius-tight)] border px-2.5 py-2 text-xs`,e.level===`error`?`border-destructive/35 bg-destructive/12 text-destructive`:e.level===`warn`?`border-warning/35 bg-warning/12 text-warning`:`border-primary/25 bg-primary/8 text-foreground/82`),children:[e.level===`info`?(0,Y.jsx)(Fe,{className:`mt-0.5 size-3.5 shrink-0 text-primary`,"aria-hidden":!0}):(0,Y.jsx)(z,{className:`mt-0.5 size-3.5 shrink-0`,"aria-hidden":!0}),(0,Y.jsx)(`span`,{className:`min-w-0 wrap-anywhere`,children:e.message})]},e.id))}):null]}):(0,Y.jsxs)(`div`,{className:`flex flex-col gap-2 py-1`,children:[(0,Y.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,Y.jsx)(je,{className:`size-3.5 animate-spin text-primary`,"aria-hidden":!0}),(0,Y.jsx)(`span`,{className:`text-xs text-foreground/78`,children:`Connecting to Litmus Edge…`})]}),(0,Y.jsx)(`div`,{className:`h-1 w-full overflow-hidden rounded-full bg-muted/55`,children:(0,Y.jsx)(h.div,{className:`h-full w-2/5 rounded-full bg-primary`,animate:{x:[`-100%`,`250%`]},transition:{duration:1.2,repeat:1/0,ease:`easeInOut`}})})]})})}var dt=`miravo:platforms:recent-template-ids`,ft=8,pt=`miravo:platforms:last-target-id`;function X(){if(typeof window>`u`)return[];try{let e=window.localStorage.getItem(dt),t=e?JSON.parse(e):[];return Array.isArray(t)?t.filter(e=>typeof e==`string`):[]}catch{return[]}}function mt(e){if(typeof window>`u`)return;let t=[e,...X().filter(t=>t!==e)].slice(0,ft);try{window.localStorage.setItem(dt,JSON.stringify(t))}catch{}}function ht(){if(!(typeof window>`u`))try{return window.localStorage.getItem(pt)??void 0}catch{return}}function gt(e){if(!(typeof window>`u`))try{window.localStorage.setItem(pt,e)}catch{}}function _t(e){return e instanceof DOMException&&e.name===`AbortError`||e instanceof Error&&e.name===`AbortError`}function vt(e){return e.map(e=>e.length===0?e:e.charAt(0).toUpperCase()+e.slice(1)).join(`, `)}function yt({onCloseTable:e,planKind:t=`apply`}){return(0,Y.jsx)(`div`,{className:`border-b border-border/40 px-3 py-3 sm:px-4`,children:(0,Y.jsxs)(`div`,{className:`flex gap-3`,children:[(0,Y.jsx)(`div`,{className:`flex size-10 shrink-0 items-center justify-center rounded-[var(--miravo-radius-stadium-sm)] border border-border/50 bg-muted/15`,children:(0,Y.jsx)(tt,{className:`size-4 text-muted-foreground`,"aria-hidden":!0})}),(0,Y.jsxs)(`div`,{className:`flex min-w-0 flex-1 items-start gap-1 pt-0.5 sm:gap-2`,children:[(0,Y.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,Y.jsxs)(`div`,{className:`flex flex-wrap items-baseline gap-2`,children:[(0,Y.jsx)(`p`,{className:`font-heading text-[11px] font-semibold uppercase tracking-[0.14em] text-foreground`,children:t===`cleanup`?`Expected removals`:`Expected changes`}),(0,Y.jsx)(`span`,{className:`rounded-[var(--miravo-radius-tight)] border border-primary/25 bg-primary/5 px-1.5 py-px font-mono text-[9px] uppercase tracking-wider text-primary/90`,children:`Draft`})]}),(0,Y.jsx)(`p`,{className:`mt-1.5 max-w-prose text-[10px] leading-relaxed text-muted-foreground`,children:t===`cleanup`?`Preview only — nothing runs until you confirm cleanup.`:`Preview only — nothing runs until you confirm deploy.`})]}),e&&(0,Y.jsx)(O,{type:`button`,variant:`ghost`,size:`icon`,className:`size-8 shrink-0 text-muted-foreground hover:text-foreground`,onClick:e,"aria-label":`Close table`,children:(0,Y.jsx)(M,{className:`size-4`,"aria-hidden":!0})})]})]})})}var bt={create:`border-success/30 bg-success/12 text-success`,update:`border-info/30 bg-info/12 text-info`,replace:`border-chart-2/30 bg-chart-2/12 text-chart-2`,delete:`border-destructive/30 bg-destructive/12 text-destructive`,blocked:`border-warning/30 bg-warning/12 text-warning`};function xt({plan:e,planKind:t}){let n=t===`apply`&&e.sourceHostname!=null&&e.sourceHostname!==``;return(0,Y.jsx)(`div`,{className:`border-b border-border/35 bg-muted/10 px-3 py-2 sm:px-4`,children:(0,Y.jsxs)(`div`,{className:`flex flex-col gap-1.5 text-[10px] leading-snug sm:flex-row sm:flex-wrap sm:items-baseline sm:gap-x-4 sm:gap-y-1`,children:[(0,Y.jsxs)(`div`,{className:`flex min-w-0 flex-wrap items-baseline gap-x-2 gap-y-0.5`,children:[(0,Y.jsx)(`span`,{className:`shrink-0 font-mono text-[9px] uppercase tracking-wider text-muted-foreground/85`,children:`Target LE`}),(0,Y.jsx)(`span`,{className:`font-mono text-foreground/90 wrap-anywhere`,children:e.targetHost})]}),n?(0,Y.jsxs)(`div`,{className:`flex min-w-0 flex-wrap items-baseline gap-x-2 gap-y-0.5 sm:border-l sm:border-border/50 sm:pl-4`,children:[(0,Y.jsx)(`span`,{className:`shrink-0 font-mono text-[9px] uppercase tracking-wider text-muted-foreground/85`,children:_e}),(0,Y.jsx)(`span`,{className:`font-mono text-foreground/90 wrap-anywhere`,children:e.sourceHostname})]}):null]})})}function St({entries:e}){let t=e.reduce((e,t)=>(e[t.action]++,e),{create:0,update:0,replace:0,delete:0,blocked:0});return(0,Y.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2 border-b border-border/35 px-3 py-2.5 sm:px-4`,children:[(0,Y.jsx)(`span`,{className:`sr-only`,children:`Summary of planned actions`}),(0,Y.jsx)(`span`,{className:`font-mono text-[9px] uppercase tracking-[0.18em] text-muted-foreground`,children:`Manifest`}),(0,Y.jsx)(`span`,{className:`hidden h-3 w-px bg-border/60 sm:block`,"aria-hidden":!0}),(0,Y.jsxs)(`div`,{className:`flex min-w-0 flex-1 flex-wrap items-center gap-2`,children:[t.create>0&&(0,Y.jsxs)(`span`,{className:`inline-flex items-center rounded-[var(--miravo-radius-tight)] border border-success/25 bg-success/10 px-2 py-0.5 font-mono text-[10px] tabular-nums text-success`,children:[`+`,t.create,` new`]}),t.update>0&&(0,Y.jsxs)(`span`,{className:`inline-flex items-center rounded-[var(--miravo-radius-tight)] border border-info/25 bg-info/10 px-2 py-0.5 font-mono text-[10px] tabular-nums text-info`,children:[`~`,t.update,` update`]}),t.replace>0&&(0,Y.jsxs)(`span`,{className:`inline-flex items-center rounded-[var(--miravo-radius-tight)] border border-chart-2/25 bg-chart-2/10 px-2 py-0.5 font-mono text-[10px] tabular-nums text-chart-2`,children:[`↺`,t.replace,` replace`]}),t.delete>0&&(0,Y.jsxs)(`span`,{className:`inline-flex items-center rounded-[var(--miravo-radius-tight)] border border-destructive/25 bg-destructive/10 px-2 py-0.5 font-mono text-[10px] tabular-nums text-destructive`,children:[`−`,t.delete,` remove`]}),t.blocked>0&&(0,Y.jsxs)(`span`,{className:`inline-flex items-center rounded-[var(--miravo-radius-tight)] border border-warning/25 bg-warning/10 px-2 py-0.5 font-mono text-[10px] tabular-nums text-warning`,children:[t.blocked,` skipped`]})]})]})}function Ct({plan:e,onCloseTable:t,planKind:n=`apply`}){return e.entries.length===0?(0,Y.jsxs)(`div`,{className:`overflow-hidden rounded-[var(--miravo-radius-stadium-sm)] border border-dashed border-border/55`,children:[(0,Y.jsx)(yt,{onCloseTable:t,planKind:n}),(0,Y.jsx)(xt,{plan:e,planKind:n}),(0,Y.jsxs)(`div`,{className:`flex flex-col items-center gap-3 px-4 py-10 text-center`,children:[(0,Y.jsx)(`div`,{className:`flex size-12 items-center justify-center rounded-[var(--miravo-radius-stadium-sm)] border border-border/50`,children:(0,Y.jsx)(tt,{className:`size-6 text-muted-foreground/45`,"aria-hidden":!0})}),(0,Y.jsxs)(`div`,{children:[(0,Y.jsx)(`p`,{className:`font-heading text-sm font-semibold tracking-tight text-foreground`,children:n===`cleanup`?`Nothing to remove`:`Nothing to change`}),(0,Y.jsx)(`p`,{className:`mx-auto mt-2 max-w-sm text-[11px] leading-relaxed text-muted-foreground`,children:n===`cleanup`?`No Miravo-managed resources matched this cleanup scope on the environment — nothing would be deleted.`:`This environment already matches what is on the target — no create or update steps.`})]})]})]}):(0,Y.jsxs)(`div`,{className:`overflow-hidden rounded-[var(--miravo-radius-stadium-sm)] border border-border/45`,children:[(0,Y.jsx)(yt,{onCloseTable:t,planKind:n}),(0,Y.jsx)(xt,{plan:e,planKind:n}),(0,Y.jsx)(St,{entries:e.entries}),(0,Y.jsx)(`div`,{className:`overflow-x-auto`,children:(0,Y.jsxs)(`table`,{className:`w-full min-w-lg text-xs`,children:[(0,Y.jsx)(`caption`,{className:`sr-only`,children:n===`cleanup`?`Detailed list of planned cleanup actions in deletion order`:`Detailed list of create, update, and delete actions in deployment order`}),(0,Y.jsx)(`thead`,{children:(0,Y.jsxs)(`tr`,{className:`border-b border-border/45`,children:[(0,Y.jsx)(`th`,{scope:`col`,className:`sticky top-0 z-10 bg-background px-3 py-2 text-left font-heading text-[9px] font-semibold uppercase tracking-[0.14em] text-muted-foreground sm:px-3.5`,children:`Action`}),(0,Y.jsx)(`th`,{scope:`col`,className:`sticky top-0 z-10 bg-background px-3 py-2 text-left font-heading text-[9px] font-semibold uppercase tracking-[0.14em] text-muted-foreground sm:px-3.5`,children:`Type`}),(0,Y.jsx)(`th`,{scope:`col`,className:`sticky top-0 z-10 bg-background px-3 py-2 text-left font-heading text-[9px] font-semibold uppercase tracking-[0.14em] text-muted-foreground sm:px-3.5`,children:`Name`}),(0,Y.jsx)(`th`,{scope:`col`,className:`sticky top-0 z-10 hidden bg-background px-3 py-2 text-left font-heading text-[9px] font-semibold uppercase tracking-[0.14em] text-muted-foreground sm:table-cell sm:px-3.5`,children:`Protocol`}),(0,Y.jsx)(`th`,{scope:`col`,className:`sticky top-0 z-10 hidden bg-background px-3 py-2 text-left font-heading text-[9px] font-semibold uppercase tracking-[0.14em] text-muted-foreground md:table-cell md:px-3.5`,children:`Detail`})]})}),(0,Y.jsx)(`tbody`,{children:e.entries.map((e,t)=>(0,Y.jsxs)(`tr`,{className:F(`border-b border-border/25 transition-colors`,t%2==1?`bg-muted/35`:`bg-transparent`,`hover:bg-primary/4`),children:[(0,Y.jsx)(`td`,{className:`px-3 py-2 align-middle sm:px-3.5`,children:(0,Y.jsx)(We,{variant:`outline`,className:F(`border px-1.5 py-0 font-mono text-[10px] uppercase tracking-wide`,bt[e.action]),children:e.action})}),(0,Y.jsx)(`td`,{className:`px-3 py-2 align-middle font-mono text-[11px] text-foreground sm:px-3.5`,children:e.resourceType}),(0,Y.jsx)(`td`,{className:`max-w-[min(16rem,28vw)] truncate px-3 py-2 align-middle font-mono text-[11px] text-foreground sm:max-w-xs sm:px-3.5`,children:e.name}),(0,Y.jsx)(`td`,{className:`hidden px-3 py-2 align-middle font-mono text-[11px] text-muted-foreground sm:table-cell sm:px-3.5`,children:e.protocol??`—`}),(0,Y.jsx)(`td`,{className:`hidden max-w-xs truncate px-3 py-2 align-middle text-[11px] text-muted-foreground md:table-cell md:px-3.5`,children:e.blockReason??e.detail??`—`})]},`${e.action}-${e.resourceType}-${e.name}-${e.protocol??``}-${e.detail??e.blockReason??``}`))})]})}),(0,Y.jsxs)(`div`,{className:`flex flex-col gap-2 border-t border-border/40 px-3 py-3 text-[10px] text-muted-foreground sm:flex-row sm:items-center sm:justify-between sm:gap-4 sm:px-4`,children:[(0,Y.jsxs)(`span`,{children:[(0,Y.jsx)(`span`,{className:`font-mono tabular-nums text-foreground/90`,children:e.entries.length}),` `,(0,Y.jsxs)(`span`,{className:`text-muted-foreground/90`,children:[e.entries.length===1?`action`:`actions`,` queued`]})]}),(0,Y.jsxs)(`div`,{className:`flex min-w-0 flex-wrap items-center gap-x-2 gap-y-1 font-mono text-[10px] wrap-anywhere`,children:[(0,Y.jsx)(`span`,{className:`shrink-0 text-[9px] uppercase tracking-wider text-muted-foreground/80`,children:`Scope`}),(0,Y.jsx)(`span`,{className:`min-w-0 text-foreground/90`,children:vt(e.scope)})]})]})]})}var wt=[`s1`,`s2`,`s3`,`s4`];function Tt(){return(0,Y.jsxs)(`div`,{className:`overflow-hidden rounded-[var(--miravo-radius-stadium-sm)] border border-border/45`,role:`status`,"aria-busy":`true`,"aria-live":`polite`,children:[(0,Y.jsx)(`span`,{className:`sr-only`,children:`Loading plan preview`}),(0,Y.jsx)(`div`,{className:`border-b border-border/40 px-3 py-3 sm:px-4`,children:(0,Y.jsxs)(`div`,{className:`flex gap-3`,children:[(0,Y.jsx)(K,{className:`size-10 shrink-0 rounded-[var(--miravo-radius-stadium-sm)]`}),(0,Y.jsx)(`div`,{className:`flex min-w-0 flex-1 items-start gap-1 pt-0.5 sm:gap-2`,children:(0,Y.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,Y.jsxs)(`div`,{className:`flex flex-wrap items-baseline gap-2`,children:[(0,Y.jsx)(K,{className:`h-3.5 w-40`}),(0,Y.jsx)(K,{className:`h-4 w-11 rounded-[var(--miravo-radius-tight)] border`})]}),(0,Y.jsx)(K,{className:`mt-1.5 h-3 max-w-prose`})]})})]})}),(0,Y.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2 border-b border-border/35 px-3 py-2.5 sm:px-4`,children:[(0,Y.jsx)(K,{className:`h-2.5 w-14`}),(0,Y.jsx)(K,{className:`hidden h-3 w-px shrink-0 sm:block`}),(0,Y.jsxs)(`div`,{className:`flex min-w-0 flex-1 flex-wrap items-center gap-2`,children:[(0,Y.jsx)(K,{className:`h-5 w-18 rounded-[var(--miravo-radius-tight)]`}),(0,Y.jsx)(K,{className:`h-5 w-24 rounded-[var(--miravo-radius-tight)]`}),(0,Y.jsx)(K,{className:`h-5 w-20 rounded-[var(--miravo-radius-tight)]`})]})]}),(0,Y.jsx)(`div`,{className:`overflow-x-auto`,children:(0,Y.jsxs)(`table`,{className:`w-full min-w-lg text-xs`,"aria-hidden":!0,children:[(0,Y.jsx)(`thead`,{children:(0,Y.jsxs)(`tr`,{className:`border-b border-border/45`,children:[(0,Y.jsx)(`th`,{scope:`col`,className:`sticky top-0 z-10 bg-background px-3 py-2 text-left sm:px-3.5`,children:(0,Y.jsx)(K,{className:`h-2.5 w-12`})}),(0,Y.jsx)(`th`,{scope:`col`,className:`sticky top-0 z-10 bg-background px-3 py-2 text-left sm:px-3.5`,children:(0,Y.jsx)(K,{className:`h-2.5 w-9`})}),(0,Y.jsx)(`th`,{scope:`col`,className:`sticky top-0 z-10 bg-background px-3 py-2 text-left sm:px-3.5`,children:(0,Y.jsx)(K,{className:`h-2.5 w-10`})}),(0,Y.jsx)(`th`,{scope:`col`,className:`sticky top-0 z-10 hidden bg-background px-3 py-2 text-left sm:table-cell sm:px-3.5`,children:(0,Y.jsx)(K,{className:`h-2.5 w-14`})}),(0,Y.jsx)(`th`,{scope:`col`,className:`sticky top-0 z-10 hidden bg-background px-3 py-2 text-left md:table-cell md:px-3.5`,children:(0,Y.jsx)(K,{className:`h-2.5 w-11`})})]})}),(0,Y.jsx)(`tbody`,{children:wt.map((e,t)=>(0,Y.jsxs)(`tr`,{className:F(`border-b border-border/25 transition-colors`,t%2==1?`bg-muted/35`:`bg-transparent`,`hover:bg-primary/4`),children:[(0,Y.jsx)(`td`,{className:`px-3 py-2 align-middle sm:px-3.5`,children:(0,Y.jsx)(K,{className:`h-5 w-13 rounded-[var(--miravo-radius-tight)]`})}),(0,Y.jsx)(`td`,{className:`px-3 py-2 align-middle sm:px-3.5`,children:(0,Y.jsx)(K,{className:`h-3.5 w-16 font-mono`})}),(0,Y.jsx)(`td`,{className:`max-w-[min(16rem,28vw)] px-3 py-2 align-middle sm:max-w-xs sm:px-3.5`,children:(0,Y.jsx)(K,{className:`h-3.5 w-full max-w-48 font-mono`})}),(0,Y.jsx)(`td`,{className:`hidden px-3 py-2 align-middle sm:table-cell sm:px-3.5`,children:(0,Y.jsx)(K,{className:`h-3.5 w-10 font-mono`})}),(0,Y.jsx)(`td`,{className:`hidden max-w-xs px-3 py-2 align-middle md:table-cell md:px-3.5`,children:(0,Y.jsx)(K,{className:`h-3.5 w-full max-w-40`})})]},e))})]})}),(0,Y.jsxs)(`div`,{className:`flex flex-col gap-2 border-t border-border/40 px-3 py-3 text-[10px] text-muted-foreground sm:flex-row sm:items-center sm:justify-between sm:gap-4 sm:px-4`,children:[(0,Y.jsxs)(`span`,{className:`inline-flex items-center gap-1`,children:[(0,Y.jsx)(K,{className:`inline-block h-3 w-6 rounded-[var(--miravo-radius-tight)]`}),(0,Y.jsx)(K,{className:`inline-block h-3 w-28`})]}),(0,Y.jsxs)(`div`,{className:`flex min-w-0 flex-wrap items-center gap-x-2 gap-y-1 font-mono text-[10px] wrap-anywhere`,children:[(0,Y.jsx)(K,{className:`h-2.5 w-8 shrink-0`}),(0,Y.jsx)(K,{className:`h-6 min-w-32 rounded-[var(--miravo-radius-tight)] border border-border/50 px-2 py-0.5`}),(0,Y.jsx)(K,{className:`h-1 w-1 shrink-0 rounded-full`}),(0,Y.jsx)(K,{className:`h-2.5 w-10 shrink-0`}),(0,Y.jsx)(K,{className:`h-3 min-w-16 max-w-56 flex-1`})]})]})]})}var Et=50;function Dt({open:e,type:t,targetLabel:n,targetHostname:r,templates:i,templatesLoading:a,templatesError:o,onRetryTemplates:s,onOpenChange:c,onSelect:l}){let[u,d]=(0,J.useState)(``),[f,p]=(0,J.useState)(X),m=(0,J.useDeferredValue)(u);(0,J.useEffect)(()=>{e&&(d(``),p(X()))},[e]);let h=(0,J.useMemo)(()=>{let e=m.trim().toLowerCase(),t=new Map(f.map((e,t)=>[e,t])),n=[],r=new Set;for(let t of i){if(r.has(t.id))continue;r.add(t.id);let i=[t.name,t.id,t.category,t.description??``,t.models.join(` `)].join(` `).toLowerCase();e!==``&&!i.includes(e)||n.push(t)}return n.sort((e,n)=>{let r=t.get(e.id)??1/0,i=t.get(n.id)??1/0;return r===i?e.name.localeCompare(n.name):r-i}),{items:n.slice(0,Et),total:n.length,recentRank:t}},[i,m,f]),g=t===`apply`?`Apply environment`:`Cleanup environment`,_=e=>{mt(e.id),l(e)};return(0,Y.jsx)(C,{open:e,onOpenChange:c,children:(0,Y.jsxs)(ee,{className:`flex max-h-[82vh] min-h-0 flex-col gap-0 overflow-hidden p-0 sm:max-w-xl`,children:[(0,Y.jsxs)(`div`,{className:`shrink-0 border-b border-border/60 px-5 pb-3 pt-5`,children:[(0,Y.jsx)(T,{className:`text-sm font-semibold`,children:g}),(0,Y.jsxs)(x,{className:`mt-1 text-xs`,children:[n,` / `,r]})]}),(0,Y.jsx)(`div`,{className:`shrink-0 border-b border-border/45 px-5 py-3`,children:(0,Y.jsxs)(`div`,{className:`relative`,children:[(0,Y.jsx)(R,{className:`pointer-events-none absolute left-2.5 top-1/2 size-3.5 -translate-y-1/2 text-muted-foreground`,"aria-hidden":!0}),(0,Y.jsx)(N,{value:u,onChange:e=>d(e.currentTarget.value),className:`h-9 pl-8`,placeholder:`Search environments`,autoFocus:!0})]})}),(0,Y.jsx)(`div`,{className:`min-h-0 flex-1 overflow-y-auto px-3 py-3`,children:a&&i.length===0?(0,Y.jsx)(`div`,{className:`rounded-[var(--miravo-radius-tight)] border border-border/50 px-3 py-2 text-xs text-muted-foreground`,children:`Loading environments...`}):o&&i.length===0?(0,Y.jsxs)(`div`,{className:`flex items-center justify-between gap-3 rounded-[var(--miravo-radius-tight)] border border-warning/25 bg-warning/5 px-3 py-2 text-xs text-warning`,children:[(0,Y.jsx)(`span`,{children:`Could not load environments.`}),(0,Y.jsx)(O,{type:`button`,variant:`ghost`,size:`sm`,className:`h-7 text-warning hover:text-warning`,onClick:s,children:`Retry`})]}):h.items.length===0?(0,Y.jsx)(`div`,{className:`rounded-[var(--miravo-radius-tight)] border border-border/50 px-3 py-2 text-xs text-muted-foreground`,children:`No matching environments.`}):(0,Y.jsx)(`div`,{className:`flex flex-col gap-1`,children:h.items.map(e=>{let t=h.recentRank.has(e.id);return(0,Y.jsxs)(`button`,{type:`button`,className:`flex min-h-12 w-full min-w-0 items-center gap-2 rounded-[var(--miravo-radius-tight)] px-2 py-2 text-left text-xs transition-colors hover:bg-muted/45 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/70`,onClick:()=>_(e),children:[(0,Y.jsx)(`span`,{className:`flex size-8 shrink-0 items-center justify-center rounded-[var(--miravo-radius-tight)] border border-border/35 bg-muted/25 text-primary`,children:(0,Y.jsx)(be,{id:e.id,className:`size-3.5`})}),(0,Y.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[(0,Y.jsxs)(`span`,{className:`flex min-w-0 items-center gap-2`,children:[(0,Y.jsx)(`span`,{className:`truncate font-medium text-foreground`,children:e.name}),t?(0,Y.jsx)(`span`,{className:`shrink-0 rounded-[var(--miravo-radius-tight)] border border-primary/25 bg-primary/8 px-1.5 py-px font-mono text-[9px] uppercase tracking-wider text-primary`,children:`Recent`}):null]}),(0,Y.jsxs)(`span`,{className:`mt-0.5 block truncate font-mono text-[11px] text-muted-foreground`,children:[e.id,` / `,e.instanceCount,` instances`]})]})]},e.id)})})}),h.total>h.items.length?(0,Y.jsxs)(`div`,{className:`shrink-0 border-t border-border/45 px-5 py-2 text-[11px] text-muted-foreground`,children:[`Showing `,h.items.length,` of `,h.total,`. Refine search.`]}):null]})})}function Ot({targets:e,stream:t}){let[n,r]=(0,J.useState)(`apply`),[a,c]=(0,J.useState)(``),[l,u]=(0,J.useState)(``),[d,p]=(0,J.useState)(!1),[g,_]=(0,J.useState)(null),[v,y]=(0,J.useState)(!1),[b,x]=(0,J.useState)(!1),[C,w]=(0,J.useState)(!1),[ee]=(0,J.useState)(ht),T=(0,J.useRef)(0),E=(0,J.useRef)(null),D=t.status===`running`,k=n===`apply`,A=f({queryKey:o.catalog.templates(),queryFn:()=>s(`/catalog/templates`,i.catalogTemplates)}),j=A.data??[],N=j.find(e=>e.id===l),P=e.find(e=>e.id===a),I=k?!!a&&!!l:!!a&&(d||!!l),L=(0,J.useCallback)(()=>{T.current+=1,E.current?.abort(),E.current=null,y(!1),_(null)},[]);(0,J.useEffect)(()=>{if(!(l||j.length===0||d))for(let e of X()){let t=j.find(t=>t.id===e);if(t){u(t.id);return}}},[l,j,d]);let R=(0,J.useCallback)(()=>{L(),S.message(`Preview cancelled`)},[L]),z=e=>{D||(r(e),L(),p(!1))},te=(0,J.useCallback)(async e=>{if(e===`apply`){if(!a||!l)return}else if(!a||!d&&!l)return;t.operation&&t.status!==`running`&&t.reset(),E.current?.abort(),T.current+=1;let n=T.current,r=new AbortController;E.current=r,y(!0),_(null);try{let t=e===`apply`?await me({targetId:a,template:l},{signal:r.signal}):await se({targetId:a,...d?{allManaged:!0}:{template:l}},{signal:r.signal});if(n!==T.current)return;_(t.plan)}catch(t){if(n!==T.current||_t(t))return;S.error(q(t,e===`apply`?`Plan failed`:`Cleanup plan failed`))}finally{n===T.current&&y(!1)}},[a,l,d,t]),ne=(0,J.useCallback)(e=>{x(!1),L();let{scope:r,ifUnmanaged:i}=e;gt(a),l&&mt(l),n===`apply`?t.startApply({targetId:a,template:l,scope:r,ifUnmanaged:i}):t.startCleanup({targetId:a,...d?{allManaged:!0}:{template:l},scope:r})},[n,a,l,d,t,L]),V=!k&&d,H=I&&!D,re=k?Le:B,oe=`Awaiting selection`;H&&(oe=k?`Commit apply`:`Commit cleanup`);let ce=V?`All managed resources`:N?.name??`Select environment`,U=(0,Y.jsx)(ze,{className:`size-3.5`,"aria-hidden":!0});V?U=(0,Y.jsx)(B,{className:`size-3.5`,"aria-hidden":!0}):N&&(U=(0,Y.jsx)(be,{id:N.id,className:`size-3.5`}));let ue=k?`Provisions devices, tags, and Digital Twin models from the selected environment on the selected target.`:`Removes Miravo-managed resources for this environment from the selected target.`;V&&(ue=`Removes all Miravo-managed resources from the target (ignores environment scope).`);let de=P?`${P.label} / ${ce}`:`Select target and environment`;return(0,Y.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[(0,Y.jsxs)(`div`,{className:`flex flex-wrap items-center gap-3`,children:[(0,Y.jsxs)(`div`,{role:`toolbar`,"aria-label":`Operation mode`,className:`inline-flex items-center gap-0.5 rounded-[var(--miravo-radius-pill)] border border-border/50 bg-muted/15 p-0.5`,children:[(0,Y.jsxs)(`button`,{type:`button`,"aria-pressed":k,className:F(`relative flex items-center gap-1.5 rounded-[var(--miravo-radius-pill)] px-4 py-1.5 text-xs font-medium transition-colors`,k?`text-primary`:`text-muted-foreground hover:text-foreground`),onClick:()=>z(`apply`),disabled:D,children:[k&&(0,Y.jsx)(h.span,{layoutId:`mode-pill`,className:`absolute inset-0 rounded-[var(--miravo-radius-pill)] bg-primary/15 shadow-sm`,transition:{type:`spring`,stiffness:500,damping:40}}),(0,Y.jsx)(at,{className:`relative z-10 size-3.5`}),(0,Y.jsx)(`span`,{className:`relative z-10`,children:`Apply`})]}),(0,Y.jsxs)(`button`,{type:`button`,"aria-pressed":!k,className:F(`relative flex items-center gap-1.5 rounded-[var(--miravo-radius-pill)] px-4 py-1.5 text-xs font-medium transition-colors`,k?`text-muted-foreground hover:text-foreground`:`text-destructive`),onClick:()=>z(`cleanup`),disabled:D,children:[!k&&(0,Y.jsx)(h.span,{layoutId:`mode-pill`,className:`absolute inset-0 rounded-[var(--miravo-radius-pill)] bg-destructive/15 shadow-sm`,transition:{type:`spring`,stiffness:500,damping:40}}),(0,Y.jsx)(B,{className:`relative z-10 size-3.5`}),(0,Y.jsx)(`span`,{className:`relative z-10`,children:`Cleanup`})]})]}),(0,Y.jsx)(le,{stream:t})]}),(0,Y.jsx)(ae,{children:(0,Y.jsxs)(`div`,{className:`flex flex-col gap-3.5`,children:[(0,Y.jsxs)(`div`,{className:`flex items-start gap-3 border-b border-border/25 pb-3`,children:[(0,Y.jsx)(`div`,{className:`flex size-9 shrink-0 items-center justify-center rounded-[var(--miravo-radius-stadium-sm)] border border-primary/25 bg-primary/9 shadow-[inset_0_1px_0_0_var(--miravo-inset-highlight)]`,children:(0,Y.jsx)(ze,{className:`size-4 text-primary`,"aria-hidden":!0})}),(0,Y.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,Y.jsx)(`p`,{className:`font-heading text-[11px] font-semibold uppercase tracking-[0.12em] text-foreground`,children:`Litmus Edge`}),(0,Y.jsx)(`p`,{className:`mt-0.5 text-[11px] leading-relaxed text-muted-foreground`,children:ue})]})]}),(0,Y.jsxs)(`div`,{className:`grid grid-cols-1 gap-3 sm:grid-cols-2`,children:[(0,Y.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,Y.jsx)(Qe,{className:`font-heading text-[11px] font-medium uppercase tracking-[0.14em] text-muted-foreground`,children:`Target`}),(0,Y.jsx)(ie,{targets:e,value:a,onValueChange:e=>{c(e),gt(e),L()},preferredTargetId:ee,disabled:D,size:`sm`,className:`min-w-0 w-full text-xs`})]}),(0,Y.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,Y.jsx)(Qe,{className:`font-heading text-[11px] font-medium uppercase tracking-[0.14em] text-muted-foreground`,children:`Environment`}),A.isError&&!A.data&&(0,Y.jsx)(m,{message:q(A.error,`Failed to load environments.`),onRetry:()=>void A.refetch(),isRetrying:A.isFetching&&!A.isPending}),(0,Y.jsxs)(`button`,{type:`button`,disabled:V||D||!P,onClick:()=>w(!0),className:F(`flex h-9 min-h-9 w-full min-w-0 items-center justify-between gap-1.5 rounded-[var(--miravo-radius-stadium-sm)] border border-input bg-input/30 px-2.5 py-0 text-left text-xs outline-none transition-colors select-none`,`hover:bg-input/50 focus-visible:border-primary/35 focus-visible:ring-2 focus-visible:ring-primary/22`,`disabled:pointer-events-none disabled:cursor-not-allowed disabled:bg-input/50 disabled:opacity-50`),"aria-label":`Environment`,children:[(0,Y.jsxs)(`span`,{className:`flex min-w-0 items-center gap-2`,children:[(0,Y.jsx)(`span`,{className:`flex size-7 shrink-0 items-center justify-center rounded-[var(--miravo-radius-stadium-sm)] border border-border/35 bg-muted/25 text-primary`,children:U}),(0,Y.jsx)(`span`,{className:`min-w-0 flex-1 truncate font-medium text-foreground`,children:ce})]}),(0,Y.jsx)(Se,{className:`pointer-events-none size-4 shrink-0 text-muted-foreground`,"aria-hidden":!0})]})]})]}),(0,Y.jsxs)(`button`,{type:`button`,disabled:!H||v,onClick:()=>x(!0),className:F(`group flex w-full min-h-14 min-w-0 items-stretch overflow-hidden rounded-[var(--miravo-radius-stadium-lg)] text-left outline-none`,`transition-[border-color,box-shadow,background-color] duration-200 ease-out`,`focus-visible:ring-2 focus-visible:ring-ring/70 focus-visible:ring-offset-2 focus-visible:ring-offset-background`,`disabled:pointer-events-none disabled:opacity-55`,H?[`border-2 border-primary/40 bg-background`,`bg-linear-to-r from-primary/12 via-background to-background`,`shadow-[inset_0_1px_0_0_rgba(255,255,255,0.025)]`,`hover:border-primary/56 hover:shadow-[inset_0_1px_0_0_rgba(255,255,255,0.025),0_0_14px_-8px_color-mix(in_srgb,var(--primary)_18%,transparent),0_0_22px_-12px_color-mix(in_srgb,var(--primary)_8%,transparent)]`]:[`border border-dashed border-border/65 bg-muted/15`,`hover:bg-muted/22`]),children:[(0,Y.jsx)(`span`,{className:`relative flex w-18 shrink-0 items-center justify-center bg-transparent`,"aria-hidden":!0,children:(0,Y.jsx)(re,{className:F(`relative size-5`,H?`text-primary`:`text-muted-foreground`)})}),(0,Y.jsxs)(`span`,{className:`flex min-w-0 flex-1 flex-col justify-center gap-0.5 overflow-hidden px-3 py-2.5 sm:px-4`,children:[(0,Y.jsx)(`span`,{className:F(`font-heading text-[11px] font-semibold uppercase tracking-[0.18em]`,H?`text-primary`:`text-muted-foreground`),children:oe}),(0,Y.jsx)(`span`,{className:F(`truncate font-mono text-[13px] leading-tight tracking-tight`,H?`text-foreground`:`text-muted-foreground`),children:de})]}),(0,Y.jsx)(`span`,{className:F(`flex shrink-0 items-center pr-2.5 sm:pr-3`,H&&`pl-1`),children:(0,Y.jsx)(`span`,{className:F(`flex size-9 items-center justify-center rounded-[var(--miravo-radius-stadium-sm)] border bg-transparent transition-[border-color,color] duration-200`,H?`border-primary/40 text-primary group-hover:border-primary/55`:`border-border/45 text-muted-foreground`),"aria-hidden":!0,children:(0,Y.jsx)(Ee,{className:`size-4`,strokeWidth:2.25})})})]}),!k&&(0,Y.jsx)(`div`,{className:`flex w-full min-w-0 flex-wrap items-center justify-end gap-2`,children:(0,Y.jsxs)(Qe,{id:`all-managed-label`,htmlFor:`all-managed`,"aria-disabled":D,className:F(`inline-flex h-8 w-fit max-w-full cursor-pointer items-center gap-2 text-xs font-medium leading-none`,D&&`pointer-events-none opacity-40`),children:[(0,Y.jsx)(Re,{id:`all-managed`,checked:d,onCheckedChange:e=>{p(e===!0),L()},disabled:D}),(0,Y.jsx)(`span`,{className:`shrink-0`,children:`Remove all Miravo managed resources`})]})})]})}),(v||g)&&!D&&(0,Y.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[v&&(0,Y.jsx)(`div`,{className:`flex w-full min-w-0 flex-wrap items-center justify-end gap-2`,children:(0,Y.jsxs)(O,{type:`button`,variant:`ghost`,size:`sm`,className:`h-8 shrink-0 gap-1.5 px-2 text-xs text-muted-foreground hover:text-foreground`,onClick:R,children:[(0,Y.jsx)(M,{className:`size-3.5`,"aria-hidden":!0}),`Cancel preview`]})}),v&&(0,Y.jsx)(Tt,{}),g&&!v&&(0,Y.jsx)(Ct,{plan:g,planKind:k?`apply`:`cleanup`,onCloseTable:L})]}),P&&C?(0,Y.jsx)(Dt,{open:!0,type:n,targetLabel:P.label,targetHostname:P.hostname,templates:j,templatesLoading:A.isPending&&A.data===void 0,templatesError:A.isError&&j.length===0,onRetryTemplates:()=>void A.refetch(),onOpenChange:w,onSelect:e=>{u(e.id),mt(e.id),p(!1),L(),k&&t.reset(),w(!1)}}):null,P&&(0,Y.jsx)(ve,{open:b,onOpenChange:x,type:n,label:V?`All managed resources`:N?.name??l,targetLabel:P.label,hostname:P.hostname,sourceHostname:P.sourceHostname,onConfirm:ne,applyPreview:k?{onPreview:()=>void te(`apply`),planLoading:v,disabled:!a||!l||D}:void 0,cleanupPreview:k?void 0:{onPreview:()=>void te(`cleanup`),planLoading:v,disabled:!a||!d&&!l||D}})]})}function kt(){return(0,Y.jsx)(`section`,{"aria-labelledby":`platforms-operation-log-empty-title`,className:ot,children:(0,Y.jsxs)(`div`,{className:`flex flex-col items-center gap-4 px-4 py-8 text-center sm:py-10`,children:[(0,Y.jsx)(`div`,{className:`flex size-12 items-center justify-center rounded-(--miravo-radius-stadium-sm) border border-dashed border-border/50`,children:(0,Y.jsx)(I,{className:`size-6 text-muted-foreground/45`,"aria-hidden":!0})}),(0,Y.jsxs)(`div`,{className:`max-w-sm`,children:[(0,Y.jsx)(`h2`,{id:`platforms-operation-log-empty-title`,className:`font-heading text-sm font-semibold tracking-tight text-foreground`,children:`No operations yet`}),(0,Y.jsx)(`p`,{className:`mt-2 text-pretty text-sm leading-relaxed text-muted-foreground`,children:`Run apply or cleanup from the Operations tab. Finished runs show up here with full detail.`})]})]})})}function At(e){let t=new Date(e),n=new Date,r=new Date(n);return r.setDate(n.getDate()-1),t.toDateString()===n.toDateString()?`Today`:t.toDateString()===r.toDateString()?`Yesterday`:t.toLocaleDateString(`en-US`,{weekday:`short`,month:`short`,day:`numeric`})}function jt(e){let t=new Map;for(let n of e){let e=new Date(n.completedAt).toDateString(),r=t.get(e);r?r.push(n):t.set(e,[n])}return Array.from(t.entries()).map(([,e])=>({label:At(e[0]?.completedAt??Date.now()),ops:e}))}function Z(e,t){return e===`device`?t.operationType===`apply`?`Tag/register writes per device step—not a device count.`:`One count per device removed from DeviceHub.`:e===`model`?`One count per model in this run.`:e===`instance`?`One count per twin instance in this run.`:`Sets the device parameter to the bound DeviceHub device.`}var Mt={devices:`Devices`,models:`DT models`,instances:`DT instances`},Q={create:`inline-flex items-center rounded-[var(--miravo-radius-tight)] border border-success/35 bg-success/12 px-1.5 py-0.5 font-mono text-[10px] tabular-nums text-success`,update:`inline-flex items-center rounded-[var(--miravo-radius-tight)] border border-primary/35 bg-primary/12 px-1.5 py-0.5 font-mono text-[10px] tabular-nums text-primary`,replace:`inline-flex items-center rounded-[var(--miravo-radius-tight)] border border-chart-2/35 bg-chart-2/12 px-1.5 py-0.5 font-mono text-[10px] tabular-nums text-chart-2`,delete:`inline-flex items-center rounded-[var(--miravo-radius-tight)] border border-destructive/35 bg-destructive/12 px-1.5 py-0.5 font-mono text-[10px] tabular-nums text-destructive`,failed:`inline-flex items-center rounded-[var(--miravo-radius-tight)] border border-destructive/40 bg-destructive/18 px-1.5 py-0.5 font-mono text-[10px] font-semibold tabular-nums text-destructive`};function Nt(e){return[{key:`device`,title:`DeviceHub — protocol tags`,subtitle:Z(`device`,e),counts:e.resourceCounts.device},{key:`model`,title:`Digital Twin models`,subtitle:Z(`model`,e),counts:e.resourceCounts.model},{key:`instance`,title:`Twin instances`,subtitle:Z(`instance`,e),counts:e.resourceCounts.instance},{key:`param-sync`,title:`Parameter sync`,subtitle:Z(`param-sync`,e),counts:e.resourceCounts[`param-sync`]}].filter(e=>e.counts.total>0||e.counts.failed>0)}function Pt(e){return e.length===0?`Default (devices, models, instances)`:e.map(e=>Mt[e]??e).join(` · `)}function Ft(e){let t=[];return e.filters.area&&t.push(`Area ${e.filters.area}`),e.filters.line&&t.push(`Line ${e.filters.line}`),e.filters.instance&&t.push(`Instance ${e.filters.instance}`),t.length>0?t.join(` · `):null}function $(e,t,n){if(e===`device`)switch(t){case`create`:return`+${n} tags (new device)`;case`update`:return`${n} tags rewritten`;case`replace`:return`↻${n} tags (device replaced)`;case`delete`:return`−${n} removed`}switch(t){case`create`:return`+${n} created`;case`update`:return`${n} updated`;case`replace`:return`↻${n} replaced`;case`delete`:return`−${n} removed`}}function It({row:e}){let{key:t,counts:n}=e;return(0,Y.jsxs)(`div`,{className:`flex min-w-0 flex-1 flex-wrap items-center gap-1.5`,children:[n.create>0&&(0,Y.jsx)(`span`,{className:Q.create,children:$(t,`create`,n.create)}),n.update>0&&(0,Y.jsx)(`span`,{className:Q.update,children:$(t,`update`,n.update)}),n.replace>0&&(0,Y.jsx)(`span`,{className:Q.replace,children:$(t,`replace`,n.replace)}),n.delete>0&&(0,Y.jsx)(`span`,{className:Q.delete,children:$(t,`delete`,n.delete)}),n.failed>0&&(0,Y.jsx)(`span`,{className:Q.failed,children:`${n.failed} failed`})]})}function Lt({op:e}){let t=Ft(e);return(0,Y.jsxs)(`div`,{className:`rounded-[var(--miravo-radius-tight)] border border-border/50 bg-muted/25 px-3 py-2.5`,children:[(0,Y.jsx)(`p`,{className:`font-mono text-[10px] uppercase tracking-[0.16em] text-foreground/72`,children:`Run context`}),(0,Y.jsxs)(`dl`,{className:`mt-2 grid grid-cols-[minmax(0,7.5rem)_1fr] gap-x-3 gap-y-1.5 text-xs sm:grid-cols-[9rem_1fr]`,children:[(0,Y.jsx)(`dt`,{className:`text-foreground/70`,children:`Operation`}),(0,Y.jsx)(`dd`,{className:`font-medium capitalize text-foreground`,children:e.operationType}),(0,Y.jsx)(`dt`,{className:`text-foreground/70`,children:`Target host`}),(0,Y.jsx)(`dd`,{className:`break-all font-mono text-[11px] text-foreground`,children:e.hostname}),(0,Y.jsx)(`dt`,{className:`text-foreground/70`,children:`Scope`}),(0,Y.jsx)(`dd`,{className:`text-foreground`,children:Pt(e.scope)}),t&&(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(`dt`,{className:`text-foreground/70`,children:`Filters`}),(0,Y.jsx)(`dd`,{className:`text-foreground`,children:t})]}),(0,Y.jsx)(`dt`,{className:`text-foreground/70`,children:`Duration`}),(0,Y.jsxs)(`dd`,{className:`tabular-nums text-foreground`,children:[(e.durationMs/1e3).toFixed(1),`s`]}),(0,Y.jsx)(`dt`,{className:`text-foreground/70`,children:`Outcome`}),(0,Y.jsxs)(`dd`,{className:`text-foreground`,children:[(0,Y.jsx)(`span`,{className:`tabular-nums`,children:e.successCount}),` steps succeeded`,e.failedCount>0&&(0,Y.jsxs)(`span`,{className:`text-destructive`,children:[` `,`· `,(0,Y.jsx)(`span`,{className:`tabular-nums`,children:e.failedCount}),` failed`]}),e.blockedCount>0&&(0,Y.jsxs)(`span`,{className:`text-warning`,children:[` `,`· `,(0,Y.jsx)(`span`,{className:`tabular-nums`,children:e.blockedCount}),` blocked in plan`]})]})]})]})}function Rt({status:e}){switch(e){case`success`:return(0,Y.jsx)(Oe,{className:`mt-px size-4 shrink-0 text-success`});case`failed`:return(0,Y.jsx)(Ne,{className:`mt-px size-4 shrink-0 text-destructive`});case`partial`:case`blocked`:return(0,Y.jsx)(Be,{className:`mt-px size-4 shrink-0 text-warning`});case`noop`:return(0,Y.jsx)(nt,{className:`mt-px size-4 shrink-0 text-foreground/55`})}}function zt(e){let t=e.operationType===`apply`?`Applied`:`Cleaned up`,n=`${(e.durationMs/1e3).toFixed(1)}s`,r=[];return e.successCount>0&&r.push(`${e.successCount} resources`),e.failedCount>0&&r.push(`${e.failedCount} failed`),e.blockedCount>0&&r.push(`${e.blockedCount} blocked`),r.length===0?`${t} · no changes · ${n}`:`${t} · ${r.join(`, `)} · ${n}`}function Bt(e){return e.operationType===`cleanup`&&e.successCount===0&&e.failedCount===0&&e.blockedCount===0?`No Miravo-managed resources were found to clean up.`:e.failedCount>0&&e.blockedCount>0?`No per-phase counts — failures and blocked plan entries.`:e.failedCount>0?`No per-phase counts — run failed.`:e.blockedCount>0?`No per-phase counts — blocked plan entries.`:`No per-phase counts recorded.`}function Vt({op:e}){let t=Nt(e);return t.length===0?(0,Y.jsx)(`p`,{className:`py-1 text-sm text-foreground/75`,children:Bt(e)}):(0,Y.jsxs)(`div`,{className:`space-y-3 pt-1`,children:[(0,Y.jsx)(`div`,{className:`flex flex-col divide-y divide-border/45 rounded-[var(--miravo-radius-tight)] border border-border/50`,children:t.map(e=>(0,Y.jsxs)(`div`,{className:`flex flex-col gap-2 px-3 py-2.5 sm:flex-row sm:items-start sm:gap-4`,children:[(0,Y.jsxs)(`div`,{className:`min-w-0 shrink-0 sm:w-[11.5rem]`,children:[(0,Y.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,Y.jsx)(`span`,{className:`text-xs font-medium leading-snug text-foreground`,children:e.title}),(0,Y.jsxs)(Ue,{children:[(0,Y.jsx)(Ve,{type:`button`,className:`inline-flex shrink-0 items-center justify-center rounded-[var(--miravo-radius-tight)] p-0.5 text-foreground/60 hover:bg-muted/50 hover:text-foreground`,"aria-label":`About ${e.title}`,children:(0,Y.jsx)(Fe,{className:`size-3.5`,"aria-hidden":!0})}),(0,Y.jsx)(He,{side:`top`,className:`max-w-xs text-left`,children:e.subtitle})]})]}),(0,Y.jsx)(`p`,{className:`mt-0.5 text-[11px] leading-snug text-foreground/72 sm:hidden`,children:e.subtitle})]}),(0,Y.jsx)(It,{row:e})]},e.key))}),e.blockedCount>0&&(0,Y.jsxs)(`p`,{className:`rounded-[var(--miravo-radius-tight)] border border-warning/20 bg-warning/5 px-2.5 py-1.5 text-[11px] text-warning`,children:[(0,Y.jsx)(`span`,{className:`font-medium`,children:e.blockedCount}),` plan entries were blocked (skipped). Open a `,(0,Y.jsx)(`span`,{className:`font-medium`,children:`deploy preview`}),` before running to see block reasons.`]})]})}function Ht({operation:e}){let[t,n]=(0,J.useState)(!1),r=e.targetLabel;return(0,Y.jsxs)(`div`,{className:F(`overflow-hidden rounded-[var(--miravo-radius-stadium-sm)] border border-border/55`,`transition-colors duration-150`),children:[(0,Y.jsxs)(`button`,{type:`button`,"aria-expanded":t,onClick:()=>n(e=>!e),className:F(`flex w-full items-start gap-3 p-3.5 text-left`,`transition-colors duration-100`,`hover:bg-muted/25`,t&&`bg-muted/18`),children:[(0,Y.jsx)(Rt,{status:e.status}),(0,Y.jsxs)(`div`,{className:`flex min-w-0 flex-1 flex-col gap-1`,children:[(0,Y.jsxs)(`div`,{className:`flex items-start justify-between gap-4`,children:[(0,Y.jsxs)(`p`,{className:`min-w-0 truncate text-sm`,children:[(0,Y.jsx)(`span`,{className:`font-medium text-foreground`,children:j(e.templateId)}),(0,Y.jsx)(`span`,{className:`mx-1.5 text-foreground/50`,children:`→`}),(0,Y.jsx)(`span`,{className:`text-foreground/82`,children:r})]}),(0,Y.jsx)(`time`,{dateTime:new Date(e.completedAt).toISOString(),title:A(e.completedAt),className:`shrink-0 text-xs text-foreground/75`,children:k(e.completedAt)})]}),(0,Y.jsx)(`p`,{className:`text-xs text-foreground/78`,children:zt(e)}),(e.failedCount>0||e.status===`failed`)&&(0,Y.jsx)(`p`,{className:`text-[11px] leading-snug text-foreground/72`,children:`Temporary edge issue? Run apply again from Operations — Miravo usually succeeds on retry.`})]}),(0,Y.jsx)(Se,{className:F(`mt-0.5 size-3.5 shrink-0 text-foreground/55 transition-transform duration-150`,t&&`rotate-180`)})]}),(0,Y.jsx)(g,{initial:!1,children:t&&(0,Y.jsx)(h.div,{initial:{opacity:0,height:0},animate:{opacity:1,height:`auto`},exit:{opacity:0,height:0},transition:{duration:.2,ease:`easeOut`},className:`overflow-hidden`,children:(0,Y.jsxs)(`div`,{className:`space-y-3 border-t border-border/45 px-4 pb-3 pt-3`,children:[(0,Y.jsx)(Lt,{op:e}),e.error&&(0,Y.jsxs)(`div`,{className:`relative rounded-[var(--miravo-radius-tight)] border border-destructive/40 bg-destructive/15 px-3 py-2 pr-10 text-xs font-medium`,children:[(0,Y.jsx)(`div`,{className:`absolute top-1.5 right-1.5 z-10`,children:(0,Y.jsx)(E,{value:e.error,label:`Copy error`,className:`text-destructive hover:bg-destructive/25 hover:text-foreground`})}),(0,Y.jsx)(`p`,{className:`whitespace-normal break-words text-destructive [overflow-wrap:anywhere]`,children:e.error}),(0,Y.jsx)(`p`,{className:`mt-2 text-[11px] font-normal leading-snug text-foreground/78 [overflow-wrap:anywhere]`,children:`Retry apply if the edge was slow or unreachable.`})]}),(0,Y.jsx)(Vt,{op:e})]})})})]})}function Ut({label:e}){return(0,Y.jsxs)(`div`,{className:`flex items-center gap-3 py-1`,children:[(0,Y.jsx)(`div`,{className:`h-px flex-1 bg-border/65`}),(0,Y.jsx)(`span`,{className:`text-xs font-medium text-foreground/78`,children:e}),(0,Y.jsx)(`div`,{className:`h-px flex-1 bg-border/65`})]})}var Wt={type:``,status:``,target:``,search:``},Gt={_all:`All types`,apply:`Apply`,cleanup:`Cleanup`},Kt={_all:`All statuses`,success:`Success`,partial:`Partial`,failed:`Failed`,blocked:`Blocked`,noop:`No-op`},qt=`h-7 min-h-7 gap-1.5 border-border/50 bg-transparent px-2 text-xs hover:bg-muted/30 focus:ring-0`;function Jt({filters:e,targetOptions:t,hasFilters:n,searchRef:r,onTypeChange:i,onStatusChange:a,onTargetChange:o,onSearchChange:s,onClear:c}){return(0,Y.jsxs)(`div`,{className:`flex flex-wrap items-center gap-1.5 border-b border-border/50 px-3 py-2`,children:[(0,Y.jsxs)(Te,{value:e.type||`_all`,onValueChange:e=>e&&i(e===`_all`?``:e),children:[(0,Y.jsx)(we,{size:`sm`,className:qt,"aria-label":`Operation type`,children:(0,Y.jsx)(xe,{children:e=>Gt[e??`_all`]??Gt._all})}),(0,Y.jsxs)(Ce,{children:[(0,Y.jsx)(W,{value:`_all`,children:`All types`}),(0,Y.jsx)(W,{value:`apply`,children:`Apply`}),(0,Y.jsx)(W,{value:`cleanup`,children:`Cleanup`})]})]}),(0,Y.jsxs)(Te,{value:e.status||`_all`,onValueChange:e=>e&&a(e===`_all`?``:e),children:[(0,Y.jsx)(we,{size:`sm`,className:qt,"aria-label":`Operation status`,children:(0,Y.jsx)(xe,{children:e=>Kt[e??`_all`]??Kt._all})}),(0,Y.jsxs)(Ce,{children:[(0,Y.jsx)(W,{value:`_all`,children:`All statuses`}),(0,Y.jsx)(W,{value:`success`,children:`Success`}),(0,Y.jsx)(W,{value:`partial`,children:`Partial`}),(0,Y.jsx)(W,{value:`failed`,children:`Failed`}),(0,Y.jsx)(W,{value:`blocked`,children:`Blocked`}),(0,Y.jsx)(W,{value:`noop`,children:`No-op`})]})]}),t.length>1&&(0,Y.jsxs)(Te,{value:e.target||`_all`,onValueChange:e=>e&&o(e===`_all`?``:e),children:[(0,Y.jsx)(we,{size:`sm`,className:qt,"aria-label":`Target filter`,children:(0,Y.jsx)(xe,{children:e=>!e||e===`_all`?`All targets`:e})}),(0,Y.jsxs)(Ce,{children:[(0,Y.jsx)(W,{value:`_all`,children:`All targets`}),t.map(e=>(0,Y.jsx)(W,{value:e,children:e},e))]})]}),(0,Y.jsxs)(`div`,{className:`relative flex min-w-[140px] flex-1 items-center`,children:[(0,Y.jsx)(`input`,{ref:r,type:`search`,value:e.search,onChange:e=>s(e.target.value),placeholder:`Search environment or target…`,"aria-describedby":`ops-search-shortcut`,className:F(`h-7 w-full rounded-[var(--miravo-radius-tight)] border border-border/50 bg-transparent pl-2 pr-7 text-xs`,`placeholder:text-foreground/60 focus:outline-none focus:ring-1 focus:ring-ring/40`,e.search&&`pr-2`)}),(0,Y.jsx)(`span`,{id:`ops-search-shortcut`,className:`sr-only`,children:`Press slash to focus search`}),!e.search&&(0,Y.jsx)(`kbd`,{"aria-hidden":!0,className:`pointer-events-none absolute right-2 flex h-4 items-center rounded-[var(--miravo-radius-tight)] border border-border/60 bg-muted/50 px-1 font-mono text-[10px] text-foreground/65`,children:`/`})]}),n&&(0,Y.jsxs)(`button`,{type:`button`,onClick:c,className:`flex h-7 items-center gap-1 rounded-[var(--miravo-radius-tight)] px-2 text-xs text-foreground/72 transition-colors hover:bg-muted/40 hover:text-foreground`,children:[(0,Y.jsx)(M,{className:`size-3`}),`Clear`]})]})}function Yt({operations:e,totalKnown:t,isLoading:n,error:r,onRefresh:i,hasNextPage:a=!1,isFetchingNextPage:o=!1,loadMoreError:s=null,onRetryLoadMore:c,onLoadMore:l}){let[u,d]=(0,J.useState)(!1),[f,m]=(0,J.useState)(Wt),_=(0,J.useRef)(null);(0,J.useEffect)(()=>{let e=e=>{if(e.key!==`/`||e.metaKey||e.ctrlKey||e.altKey)return;let t=e.target.tagName;t===`INPUT`||t===`TEXTAREA`||t===`SELECT`||(e.preventDefault(),_.current?.focus())};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[]);let v=()=>{d(!0),i(),S.success(`Operations refreshed`),setTimeout(()=>d(!1),600)},y=(0,J.useMemo)(()=>{let t=new Set;for(let n of e){let e=n.targetLabel;t.add(e)}return[...t].sort()},[e]),b=(0,J.useMemo)(()=>{let t=e;if(f.type&&(t=t.filter(e=>e.operationType===f.type)),f.status&&(t=t.filter(e=>e.status===f.status)),f.target&&(t=t.filter(e=>e.targetLabel===f.target)),f.search){let e=f.search.toLowerCase();t=t.filter(t=>{let n=t.targetLabel;return t.templateId.toLowerCase().includes(e)||j(t.templateId).toLowerCase().includes(e)||n.toLowerCase().includes(e)})}return t},[e,f]),x=f.type!==``||f.status!==``||f.target!==``||f.search!==``,C=(0,J.useMemo)(()=>jt(b),[b]);return(0,Y.jsxs)(`div`,{className:`flex h-full flex-col rounded-[var(--miravo-radius-stadium-sm)] border border-border/55`,children:[(0,Y.jsxs)(`div`,{className:`flex items-center justify-between border-b border-border/50 px-3.5 py-2.5`,children:[(0,Y.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,Y.jsx)(`span`,{className:`text-sm font-medium text-foreground`,children:`Operation log`}),e.length>0&&(0,Y.jsx)(`span`,{className:`font-mono text-xs tabular-nums text-foreground/75`,children:typeof t==`number`&&t>0&&e.length<t?`${e.length} / ${t}`:String(e.length)})]}),(0,Y.jsx)(`button`,{type:`button`,onClick:v,disabled:u,"aria-label":`Refresh operation list`,className:`relative rounded-[var(--miravo-radius-tight)] p-1 text-foreground/70 transition-colors before:absolute before:inset-[-10px] before:content-[''] hover:bg-muted/50 hover:text-foreground disabled:pointer-events-none`,children:(0,Y.jsx)(p,{className:F(`size-3.5`,u&&`animate-spin`),"aria-hidden":!0})})]}),(0,Y.jsx)(Jt,{filters:f,targetOptions:y,hasFilters:x,searchRef:_,onTypeChange:e=>m(t=>({...t,type:e})),onStatusChange:e=>m(t=>({...t,status:e})),onTargetChange:e=>m(t=>({...t,target:e})),onSearchChange:e=>m(t=>({...t,search:e})),onClear:()=>m(Wt)}),(0,Y.jsxs)(`div`,{className:`flex flex-1 min-h-0 flex-col gap-2 overflow-y-auto overscroll-y-contain p-3`,children:[r&&(0,Y.jsxs)(`p`,{className:`py-2 text-xs text-destructive`,children:[`✕ `,r.message]}),n&&e.length===0&&!r&&(0,Y.jsx)(`p`,{className:`py-4 text-sm text-foreground/75`,children:`Loading…`}),!n&&e.length===0&&!r&&(0,Y.jsx)(kt,{}),!n&&e.length>0&&b.length===0&&(0,Y.jsxs)(`p`,{className:`py-6 text-center text-sm text-foreground/75`,children:[`No operations match your filters.`,` `,(0,Y.jsx)(`button`,{type:`button`,onClick:()=>m(Wt),className:`text-primary hover:underline`,children:`Clear filters`})]}),x&&b.length>0&&b.length!==e.length&&(0,Y.jsxs)(`p`,{className:`text-xs text-foreground/75`,children:[`Showing`,` `,(0,Y.jsx)(`span`,{className:`font-medium tabular-nums text-foreground`,children:b.length}),` of`,` `,(0,Y.jsx)(`span`,{className:`tabular-nums`,children:e.length}),` loaded`]}),!x&&typeof t==`number`&&t>0&&e.length<t&&(0,Y.jsxs)(`p`,{className:`text-xs text-foreground/75`,children:[`Showing`,` `,(0,Y.jsx)(`span`,{className:`font-medium tabular-nums text-foreground`,children:e.length}),` `,`of `,(0,Y.jsx)(`span`,{className:`tabular-nums`,children:t}),`. Load more for older entries.`]}),(0,Y.jsx)(g,{initial:!1,children:C.map(e=>(0,Y.jsxs)(h.div,{className:`flex flex-col gap-2`,children:[(0,Y.jsx)(Ut,{label:e.label}),(0,Y.jsx)(g,{initial:!1,children:e.ops.map(e=>(0,Y.jsx)(h.div,{initial:b.length>40?!1:{opacity:0,x:-6},animate:{opacity:1,x:0},transition:{type:`spring`,stiffness:400,damping:35},children:(0,Y.jsx)(Ht,{operation:e})},`${e.operationId}-${e.completedAt}`))})]},e.label))}),s?(0,Y.jsxs)(`div`,{role:`alert`,className:`flex shrink-0 flex-col items-center gap-2 border-t border-border/50 pt-3 pb-1 text-center`,children:[(0,Y.jsxs)(`p`,{className:`text-xs text-destructive`,children:[`Could not load older entries: `,s.message]}),c?(0,Y.jsx)(O,{type:`button`,variant:`outline`,size:`sm`,onClick:c,children:`Retry`}):null]}):a&&l?(0,Y.jsx)(`div`,{className:`flex shrink-0 justify-center border-t border-border/50 pt-3 pb-1`,children:(0,Y.jsx)(O,{type:`button`,variant:`outline`,size:`sm`,className:`min-w-[7rem]`,disabled:o,"aria-busy":o,"aria-label":o?`Loading older operations`:`Load older operations`,onClick:l,children:o?`Loading…`:`Load more`})}):null]})]})}function Xt({target:e,templates:t,templatesLoading:n,templatesError:r,isStreaming:i,onRetryTemplates:a,onSelect:o}){let s=t.length===0&&!n&&!r,[c,l]=(0,J.useState)(null);return(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(`div`,{className:`absolute right-3 top-3 z-20`,children:(0,Y.jsxs)(Ze,{children:[(0,Y.jsx)(Xe,{render:(0,Y.jsx)(O,{type:`button`,variant:`ghost`,size:`icon-sm`,disabled:i,className:`border border-border/45 bg-background/70 text-muted-foreground shadow-[inset_0_1px_0_0_var(--miravo-inset-highlight)] hover:border-primary/30 hover:bg-muted/55 hover:text-foreground`,"aria-label":`Open quick actions for ${e.label}`}),children:(0,Y.jsx)(rt,{className:`size-3.5`,"aria-hidden":!0})}),(0,Y.jsx)(qe,{align:`end`,sideOffset:6,className:`min-w-56`,children:(0,Y.jsxs)(Ye,{children:[(0,Y.jsx)(Ge,{className:`text-[10px] uppercase tracking-[0.14em]`,children:`Quick actions`}),(0,Y.jsx)(Je,{className:`bg-border/60`}),(0,Y.jsxs)(Ke,{disabled:s,className:`h-9 gap-2 text-xs`,onClick:()=>l(`apply`),children:[(0,Y.jsx)(Le,{className:`size-3.5 shrink-0 text-primary`,"aria-hidden":!0}),(0,Y.jsx)(`span`,{className:`min-w-0 truncate`,children:`Apply environment...`})]}),(0,Y.jsxs)(Ke,{disabled:s,className:`h-9 gap-2 text-xs`,onClick:()=>l(`cleanup`),children:[(0,Y.jsx)(B,{className:`size-3.5 shrink-0 text-muted-foreground`,"aria-hidden":!0}),(0,Y.jsx)(`span`,{className:`min-w-0 truncate`,children:`Cleanup environment...`})]}),(0,Y.jsx)(Je,{className:`bg-border/60`}),(0,Y.jsxs)(Ke,{variant:`destructive`,className:`h-9 gap-2 text-xs`,onClick:()=>o({type:`cleanup`,target:e,allManaged:!0}),children:[(0,Y.jsx)(B,{className:`size-3.5 shrink-0`,"aria-hidden":!0}),(0,Y.jsx)(`span`,{className:`min-w-0 truncate`,children:`Cleanup all managed`})]})]})})]})}),c?(0,Y.jsx)(Dt,{open:!0,type:c,targetLabel:e.label,targetHostname:e.hostname,templates:t,templatesLoading:n,templatesError:r,onRetryTemplates:a,onOpenChange:e=>{e||l(null)},onSelect:t=>{o({type:c,target:e,templateId:t.id}),l(null)}},c):null]})}function Zt({selection:e,templates:t,stream:n,onSelectionChange:r}){let[i,a]=(0,J.useState)(!1),[o,s]=(0,J.useState)(null),[c,l]=(0,J.useState)(!1),u=(0,J.useRef)(0),d=(0,J.useRef)(null),f=(0,J.useRef)(!1),p=n.status===`running`,m=(0,J.useCallback)(()=>{u.current+=1,f.current=!1,d.current?.abort(),d.current=null,l(!1),s(null)},[]);(0,J.useEffect)(()=>{e&&(m(),a(!0))},[e,m]),(0,J.useEffect)(()=>()=>{u.current+=1,f.current=!1,d.current?.abort(),d.current=null},[]);let h=e?.templateId==null?void 0:t.find(t=>t.id===e.templateId)?.name??e.templateId,g=e?.type===`cleanup`&&e.allManaged?`All managed resources`:h??``,_=(0,J.useCallback)(async()=>{if(!e||e.type===`apply`&&!e.templateId||e.type===`cleanup`&&!e.allManaged&&!e.templateId)return;n.operation&&n.status!==`running`&&n.reset(),f.current=!0,d.current?.abort(),u.current+=1;let t=u.current,r=new AbortController;d.current=r,l(!0),s(null);try{let n=e.type===`apply`?await me({targetId:e.target.id,template:e.templateId},{signal:r.signal}):await se({targetId:e.target.id,...e.allManaged?{allManaged:!0}:{template:e.templateId}},{signal:r.signal});if(t!==u.current)return;s(n.plan)}catch(n){if(t!==u.current||_t(n))return;S.error(q(n,e.type===`apply`?`Plan failed`:`Cleanup plan failed`))}finally{t===u.current&&(l(!1),f.current=!1)}},[e,n]),v=(0,J.useCallback)(t=>{if(e){if(a(!1),m(),r(null),e.type===`apply`){n.startApply({targetId:e.target.id,template:e.templateId,scope:t.scope,ifUnmanaged:t.ifUnmanaged,...t.deviceName?{deviceName:t.deviceName}:{}});return}n.startCleanup({targetId:e.target.id,...e.allManaged?{allManaged:!0}:{template:e.templateId},scope:t.scope})}},[e,n,m,r]),y=e=>{a(e),!(e||f.current)&&(m(),r(null))},b=()=>{m(),r(null)};return(0,Y.jsxs)(Y.Fragment,{children:[e&&(0,Y.jsx)(ve,{open:i,onOpenChange:y,type:e.type,label:g,targetLabel:e.target.label,hostname:e.target.hostname,sourceHostname:e.target.sourceHostname,onConfirm:v,applyPreview:e.type===`apply`?{onPreview:()=>void _(),planLoading:c,disabled:!e.templateId||p}:void 0,cleanupPreview:e.type===`cleanup`?{onPreview:()=>void _(),planLoading:c,disabled:!e.allManaged&&!e.templateId||p}:void 0}),(c||o)&&!p&&e?(0,Y.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,Y.jsxs)(`div`,{className:`flex w-full min-w-0 flex-wrap items-center justify-between gap-2`,children:[(0,Y.jsxs)(`div`,{className:`flex min-w-0 items-center gap-1.5 text-[11px] text-muted-foreground`,children:[(0,Y.jsx)(te,{className:`size-3.5 shrink-0 text-primary`,"aria-hidden":!0}),(0,Y.jsxs)(`span`,{className:`truncate`,children:[`Preview for `,e.target.label,`: `,g]})]}),(0,Y.jsxs)(O,{type:`button`,variant:`ghost`,size:`sm`,className:`h-8 shrink-0 gap-1.5 px-2 text-xs text-muted-foreground hover:text-foreground`,onClick:b,children:[(0,Y.jsx)(M,{className:`size-3.5`,"aria-hidden":!0}),`Close preview`]})]}),c?(0,Y.jsx)(Tt,{}):o?(0,Y.jsx)(Ct,{plan:o,planKind:e.type,onCloseTable:b}):null]}):null]})}function Qt(e){return De.find(t=>t.id===e)?.label??e}function $t(e){if(!e)return`var(--tooltip-border)`;switch(e.status){case`success`:return`var(--success)`;case`partial`:case`blocked`:return`var(--warning)`;case`noop`:return`var(--muted-foreground)`;case`failed`:return`var(--destructive)`}}function en({status:e}){switch(e){case`success`:return(0,Y.jsx)(Oe,{className:`size-3 text-success`});case`partial`:case`blocked`:return(0,Y.jsx)(Be,{className:`size-3 text-warning`});case`noop`:return(0,Y.jsx)(nt,{className:`size-3 text-muted-foreground`});case`failed`:return(0,Y.jsx)(Ne,{className:`size-3 text-destructive`})}}function tn({target:e,lastOp:t,onEdit:n,onDelete:r,quickActions:i}){return(0,Y.jsxs)(`div`,{className:`env-orbital relative overflow-hidden border`,style:{"--_status":$t(t)},children:[i,(0,Y.jsx)(`div`,{className:`relative z-10 px-4 pt-3.5 pb-3 pr-12`,children:(0,Y.jsx)(`p`,{className:`font-heading text-[13px] font-semibold leading-tight tracking-tight text-foreground`,children:e.label})}),(0,Y.jsx)(`div`,{className:`relative z-10 px-4 py-0.5`,children:(0,Y.jsx)(`p`,{className:`font-mono text-xs tracking-tight text-muted-foreground`,children:e.hostname})}),(0,Y.jsxs)(`div`,{className:`relative z-10 mx-4 mb-3 flex items-center gap-2`,children:[(0,Y.jsx)(`span`,{className:`min-w-0 truncate font-mono text-[11px] text-muted-foreground`,children:e.sourceHostname}),(0,Y.jsx)(`div`,{className:`env-orbital-path min-w-6 flex-1`}),(0,Y.jsx)(L,{className:`size-3 shrink-0 text-muted-foreground`})]}),(0,Y.jsxs)(`div`,{className:`relative z-10 flex items-center gap-2 border-t border-border/30 px-3 py-1.5`,children:[(0,Y.jsxs)(`span`,{className:`flex shrink-0 items-center gap-1.5 rounded-full border border-border/40 px-2 py-0.5`,children:[(0,Y.jsx)(`span`,{className:`protocol-card-live-dot size-[5px]`}),(0,Y.jsx)(`span`,{className:`text-[11px] font-medium tracking-wide text-muted-foreground`,children:Qt(e.platformId)})]}),t&&(0,Y.jsxs)(`span`,{className:`flex min-w-0 items-center gap-1 truncate text-[11px] text-muted-foreground`,children:[(0,Y.jsx)(en,{status:t.status}),t.operationType===`apply`?`Applied`:`Cleaned`,` `,(0,Y.jsx)(`time`,{dateTime:new Date(t.completedAt).toISOString(),title:A(t.completedAt),children:k(t.completedAt)})]}),(0,Y.jsxs)(`div`,{className:`ml-auto flex shrink-0 items-center gap-0.5`,children:[(0,Y.jsx)(O,{variant:`ghost`,size:`icon-sm`,"aria-label":`Edit target`,onClick:n,children:(0,Y.jsx)(it,{className:`size-3`})}),(0,Y.jsx)(O,{variant:`ghost`,size:`icon-sm`,className:`text-destructive hover:text-destructive`,"aria-label":`Delete target`,onClick:r,children:(0,Y.jsx)(B,{className:`size-3`})})]})]})]})}function nn({onClick:e}){return(0,Y.jsxs)(`button`,{type:`button`,onClick:e,className:`env-orbital group h-full w-full flex flex-col items-center justify-center gap-2 border border-dashed py-10 text-muted-foreground transition-colors hover:border-primary/30 hover:text-primary`,style:{"--_status":`var(--tooltip-border)`},children:[(0,Y.jsx)(ge,{className:`size-5 transition-transform group-hover:scale-110`}),(0,Y.jsx)(`span`,{className:`text-xs`,children:`Add Target`})]})}function rn({targets:e,onMutate:t,lastOpByTarget:n,templates:r,templatesLoading:i,templatesError:a,onRetryTemplates:o,stream:s}){let[c,l]=(0,J.useState)(!1),[u,d]=(0,J.useState)(null),[f,p]=(0,J.useState)(G.id),[m,_]=(0,J.useState)({label:``,hostname:``,apiToken:``,sourceHostname:``}),[v,y]=(0,J.useState)(!1),[E,D]=(0,J.useState)(!1),{testing:k,runTest:A,cancelInFlight:j}=de(),[M,N]=(0,J.useState)(null),[P,F]=(0,J.useState)(null),I=s.status===`running`,L=f===G.id&&m.hostname.trim().length>0&&m.sourceHostname.trim().length>0&&(u!==null||m.apiToken.trim().length>0),R=()=>{d(null),p(G.id),_({label:``,hostname:``,apiToken:``,sourceHostname:``}),D(!1),l(!0)},z=e=>{d(e.id),p(De.some(t=>t.id===e.platformId)?e.platformId:G.id),_({label:e.label,hostname:e.hostname,apiToken:``,sourceHostname:e.sourceHostname}),D(!1),l(!0)},B=async()=>{if(f!==G.id){S.error(`${Qt(f)} target setup is coming soon.`);return}if(!m.label||!m.hostname||!m.sourceHostname){S.error(`Label, hostname, and source host are required.`);return}if(!u&&!m.apiToken){S.error(`API token is required for new targets.`);return}y(!0);try{u?(await re(u,{platformId:f,label:m.label,hostname:m.hostname,sourceHostname:m.sourceHostname,...m.apiToken?{apiToken:m.apiToken}:{}}),S.success(`Target updated.`)):(await V({...m,platformId:f}),S.success(`Target added.`)),l(!1),t()}catch(e){S.error(q(e,`Failed to save target.`))}finally{y(!1)}};return(0,Y.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[(0,Y.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,Y.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[(0,Y.jsx)(`h2`,{className:`flex h-5 items-center text-xs font-medium leading-none uppercase tracking-wider text-muted-foreground`,children:`Platform Targets`}),e.length>0?(0,Y.jsx)(We,{variant:`secondary`,className:`relative -top-px h-5 shrink-0 px-1.5 py-0 font-mono text-[10px] leading-none tabular-nums`,children:e.length}):null]}),(0,Y.jsxs)(O,{size:`sm`,className:`h-7 shrink-0 gap-1.5 text-xs`,onClick:R,children:[(0,Y.jsx)(ge,{className:`size-3.5`}),` Add Target`]})]}),e.length===0?(0,Y.jsx)(lt,{titleId:`platforms-targets-empty-title`,frameIcon:(0,Y.jsx)(Ie,{className:`size-6 text-muted-foreground/45`,"aria-hidden":!0}),description:(0,Y.jsx)(st,{}),children:(0,Y.jsx)(ct,{onClick:R})}):(0,Y.jsx)(`div`,{className:`grid grid-cols-1 gap-3 @2xl/main:grid-cols-2 @5xl/main:grid-cols-3`,children:(0,Y.jsxs)(g,{children:[e.map((e,t)=>(0,Y.jsx)(h.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},exit:{opacity:0,scale:.96,transition:{duration:.15}},transition:{type:`spring`,stiffness:380,damping:30,delay:t*.04},children:(0,Y.jsx)(tn,{target:e,lastOp:n.get(e.id),onEdit:()=>z(e),onDelete:()=>N(e),quickActions:(0,Y.jsx)(Xt,{target:e,templates:r,templatesLoading:i,templatesError:a,isStreaming:I,onRetryTemplates:o,onSelect:F})})},e.id)),(0,Y.jsx)(h.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},transition:{type:`spring`,stiffness:380,damping:30,delay:e.length*.04},children:(0,Y.jsx)(nn,{onClick:R})},`add-card`)]})}),(0,Y.jsx)(Zt,{selection:P,templates:r,stream:s,onSelectionChange:F}),(0,Y.jsx)(ue,{open:c,editing:u!==null,platformId:f,form:m,showToken:E,saving:v,testing:k,canTestConnection:L,onOpenChange:l,onPlatformChange:p,onFormChange:_,onShowTokenChange:D,onSave:()=>void B(),onTestConnection:()=>{L&&A({...u?{targetId:u}:{},hostname:m.hostname.trim(),sourceHostname:m.sourceHostname.trim(),...m.apiToken.trim()?{apiToken:m.apiToken.trim()}:{}})},onCancelInFlight:j}),(0,Y.jsx)(C,{open:M!==null,onOpenChange:e=>!e&&N(null),children:(0,Y.jsxs)(ee,{children:[(0,Y.jsxs)(w,{children:[(0,Y.jsx)(T,{children:`Remove Target`}),(0,Y.jsxs)(x,{children:[`Remove “`,M?.label,`”? This only deletes the saved credentials — it does not affect resources on the target platform.`]})]}),(0,Y.jsxs)(b,{children:[(0,Y.jsx)(O,{variant:`outline`,onClick:()=>N(null),children:`Cancel`}),(0,Y.jsx)(O,{variant:`destructive`,onClick:async()=>{if(!M)return;let e=M.id;N(null);try{await U(e),S.success(`Target removed.`),t()}catch(e){S.error(q(e,`Failed to remove target.`))}},children:`Remove`})]})]})})]})}var an=25;function on({status:e}){switch(e){case`success`:return(0,Y.jsx)(Oe,{className:`size-3 text-success`});case`partial`:case`blocked`:return(0,Y.jsx)(Be,{className:`size-3 text-warning`});case`noop`:return(0,Y.jsx)(nt,{className:`size-3 text-muted-foreground`});case`failed`:return(0,Y.jsx)(Ne,{className:`size-3 text-destructive`})}}function sn({targetCount:e,opCount:t,lastOp:n}){return(0,Y.jsxs)(`div`,{className:`flex flex-wrap items-center gap-x-3 gap-y-1 text-xs text-muted-foreground`,children:[(0,Y.jsxs)(`span`,{className:`flex items-center gap-1.5`,children:[(0,Y.jsx)(Ie,{className:`size-3`}),(0,Y.jsx)(`span`,{className:`font-mono`,children:e}),` target`,e===1?``:`s`]}),(0,Y.jsx)(`span`,{className:`hidden h-3 w-px bg-border/40 sm:inline-block`}),(0,Y.jsxs)(`span`,{className:`flex items-center gap-1`,children:[(0,Y.jsx)(g,{mode:`popLayout`,initial:!1,children:(0,Y.jsx)(h.span,{initial:{opacity:0,y:-6},animate:{opacity:1,y:0},exit:{opacity:0,y:6},transition:{type:`spring`,stiffness:500,damping:35},className:`font-mono tabular-nums`,children:t},t)}),` `,`operation`,t===1?``:`s`]}),n&&(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(`span`,{className:`hidden h-3 w-px bg-border/40 sm:inline-block`}),(0,Y.jsxs)(`span`,{className:`flex items-center gap-1.5`,children:[(0,Y.jsx)(on,{status:n.status}),(0,Y.jsxs)(`span`,{children:[n.operationType===`apply`?`Applied`:`Cleaned`,` `,(0,Y.jsx)(`time`,{dateTime:new Date(n.completedAt).toISOString(),title:A(n.completedAt),children:k(n.completedAt)})]})]})]})]})}function cn(){let e=f({queryKey:o.platforms.targets(),queryFn:()=>H()}),t=e.data??[],n=et({queryKey:o.platforms.operationsList(),queryFn:({pageParam:e})=>fe({limit:an,offset:e}),initialPageParam:0,getNextPageParam:(e,t,n)=>e.hasMore&&e.operations.length>0?n+an:void 0}),r=(0,J.useMemo)(()=>n.data?.pages.flatMap(e=>e.operations)??[],[n.data]),a=n.data?.pages[0]?.total??0,c=f({queryKey:o.catalog.templates(),queryFn:()=>s(`/catalog/templates`,i.catalogTemplates)}),u=c.data??[],d=pe(),p=(0,J.useRef)(d.status);(0,J.useEffect)(()=>{let e=p.current;p.current=d.status,e===`running`&&d.status===`complete`&&l.invalidateQueries({queryKey:o.platforms.operationsList()})},[d.status]);let y=(0,J.useMemo)(()=>{let e=new Map;for(let t of r)e.has(t.targetId)||e.set(t.targetId,t);return e},[r]),[b,x]=_(`tab`,v([`targets`,`operations`,`activity`]).withDefault(`targets`)),S;return S=e.isPending&&e.data===void 0?(0,Y.jsxs)(`div`,{role:`status`,"aria-busy":`true`,className:ot,children:[(0,Y.jsx)(`span`,{className:`sr-only`,children:`Loading targets`}),(0,Y.jsxs)(`div`,{className:`mx-auto flex max-w-md flex-col items-center gap-4 px-4 py-10`,children:[(0,Y.jsx)(K,{className:`h-5 w-48`}),(0,Y.jsx)(K,{className:`h-4 w-full max-w-sm`}),(0,Y.jsx)(K,{className:`h-9 w-40 rounded-(--miravo-radius-stadium-sm)`})]})]}):e.isError&&e.data===void 0?(0,Y.jsx)(m,{message:q(e.error,`Could not load targets.`),onRetry:()=>void e.refetch(),isRetrying:e.isFetching&&!e.isPending}):t.length===0?(0,Y.jsx)(lt,{titleId:`platforms-operations-empty-title`,frameIcon:(0,Y.jsx)(Ie,{className:`size-6 text-muted-foreground/45`,"aria-hidden":!0}),description:(0,Y.jsx)(st,{}),children:(0,Y.jsx)(ct,{onClick:()=>void x(`targets`)})}):(0,Y.jsx)(Ot,{targets:t,stream:d}),(0,Y.jsxs)(`div`,{className:`mx-auto flex h-full w-full min-w-0 max-w-screen-2xl flex-col gap-5 p-4 sm:gap-6 sm:p-6`,children:[(0,Y.jsxs)(`div`,{className:`flex shrink-0 flex-col gap-2`,children:[(0,Y.jsx)(`h1`,{className:`font-heading text-2xl font-semibold tracking-tight`,children:`Platforms`}),(0,Y.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`Connect Platforms as targets, then apply templates or run cleanup from Operations.`}),(0,Y.jsx)(sn,{targetCount:t.length,opCount:a,lastOp:r[0]})]}),(0,Y.jsxs)(Pe,{value:b,onValueChange:e=>{x(e)},className:`flex-1 min-h-0`,children:[(0,Y.jsx)(`div`,{className:`shrink-0 overflow-x-auto`,children:(0,Y.jsxs)(Me,{variant:`line`,className:`h-10! gap-0.5 min-w-max`,children:[(0,Y.jsxs)(ke,{value:`targets`,className:`gap-1.5 px-3 text-sm`,children:[(0,Y.jsx)(Ie,{className:`size-3.5 shrink-0`}),`Targets`]}),(0,Y.jsxs)(ke,{value:`operations`,className:`gap-1.5 px-3 text-sm`,children:[(0,Y.jsx)(ye,{className:`size-3.5 shrink-0`}),`Operations`]}),(0,Y.jsxs)(ke,{value:`activity`,className:`gap-1.5 px-3 text-sm`,children:[(0,Y.jsx)(I,{className:`size-3.5 shrink-0`}),`Activity`]})]})}),(0,Y.jsx)(Ae,{value:`targets`,className:`flex-1 py-2`,children:(0,Y.jsx)(h.div,{initial:{opacity:0,y:6},animate:{opacity:1,y:0},transition:{duration:.15,ease:`easeOut`},children:e.isError&&e.data===void 0?(0,Y.jsx)(m,{message:q(e.error,`Failed to load targets.`),onRetry:()=>void e.refetch(),isRetrying:e.isFetching&&!e.isPending}):(0,Y.jsx)(rn,{targets:t,onMutate:()=>void e.refetch(),lastOpByTarget:y,templates:u,templatesLoading:c.isPending&&c.data===void 0,templatesError:c.isError&&u.length===0,onRetryTemplates:()=>void c.refetch(),stream:d})},`targets`)}),(0,Y.jsx)(Ae,{value:`operations`,className:`flex-1 py-2`,children:(0,Y.jsx)(h.div,{initial:{opacity:0,y:6},animate:{opacity:1,y:0},transition:{duration:.15,ease:`easeOut`},children:S},`operations`)}),(0,Y.jsx)(Ae,{value:`activity`,className:`flex flex-col flex-1 min-h-0 py-2`,children:(0,Y.jsx)(h.div,{initial:{opacity:0,y:6},animate:{opacity:1,y:0},transition:{duration:.15,ease:`easeOut`},className:`flex flex-col flex-1 min-h-0`,children:(0,Y.jsx)(Yt,{operations:r,totalKnown:a,isLoading:n.isPending&&!n.data,error:n.error,onRefresh:()=>void l.invalidateQueries({queryKey:o.platforms.operationsList()}),hasNextPage:n.hasNextPage,isFetchingNextPage:n.isFetchingNextPage,loadMoreError:n.isFetchNextPageError&&n.error instanceof Error?n.error:null,onRetryLoadMore:()=>void n.fetchNextPage(),onLoadMore:()=>void n.fetchNextPage()})},`activity`)})]}),(0,Y.jsx)(g,{children:d.operation||d.status===`running`?(0,Y.jsx)(ut,{stream:d,onReset:d.reset,catalogTemplates:u}):null})]})}export{cn as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{t as e}from"./platforms-Czbg-aTO.js";export{e as PlatformsPage};
|