@miravo/cli-linux-x64 0.10.0 → 0.12.0
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/console-dist/assets/{AnimatePresence-BZCmb1bq.js → AnimatePresence-BSSlw02V.js} +3 -3
- package/console-dist/assets/{activity-Cn48I9qe.js → activity-Cy_niK56.js} +1 -1
- package/console-dist/assets/api-Dw9ti2cu.js +1 -0
- package/console-dist/assets/{api-kPM52mb-.js → api-tM5PSXjr.js} +1 -1
- package/console-dist/assets/arrow-up-right-CwPw_2U1.js +1 -0
- package/console-dist/assets/asset-detail-C4zF_8rm.js +1 -0
- package/console-dist/assets/asset-detail-actions-Dv9g2Z9t.js +1 -0
- package/console-dist/assets/{auth-screen-backdrop-hcEYy3K4.js → auth-screen-backdrop-CEykEbfF.js} +1 -1
- package/console-dist/assets/backup-power-CAc85zvh.js +1 -0
- package/console-dist/assets/badge-Bk1DaL6C.js +1 -0
- package/console-dist/assets/boiler-BQwqgoVY.js +1 -0
- package/console-dist/assets/by-path-DmADo_qX.js +1 -0
- package/console-dist/assets/catalog-BMLSbdye.js +1 -0
- package/console-dist/assets/catalog-Ccubt-hm.js +1 -0
- package/console-dist/assets/{catalog-source-2aT9qob-.js → catalog-source-B4L5N-a1.js} +1 -1
- package/console-dist/assets/catalog-template-icons-DGyxSm-F.js +1 -0
- package/console-dist/assets/check-B-yvIfMj.js +1 -0
- package/console-dist/assets/checkbox-DEAkDfFr.js +1 -0
- package/console-dist/assets/chevron-down-x70Pto6j.js +1 -0
- package/console-dist/assets/chevron-right-CrNKVFcI.js +1 -0
- package/console-dist/assets/chiller-Jug0vRg-.js +1 -0
- package/console-dist/assets/{circle-x-CGcRflg7.js → circle-x-6JtFdy1_.js} +1 -1
- package/console-dist/assets/combobox-B8h0-NHs.js +1 -0
- package/console-dist/assets/commercial-building-CINKWcQV.js +1 -0
- package/console-dist/assets/compressor-BkWNdwvy.js +1 -0
- package/console-dist/assets/console-panel-Cg2sBJcN.js +1 -0
- package/console-dist/assets/control-B-TcWj5c.js +1 -0
- package/console-dist/assets/control-DXA-_1Gu.js +1 -0
- package/console-dist/assets/copy-button-CSUP1VjU.js +1 -0
- package/console-dist/assets/{dialog-Di9Bs0FH.js → dialog-B5PqrKVw.js} +1 -1
- package/console-dist/assets/district-heating-DqGtrEKq.js +1 -0
- package/console-dist/assets/dom-CQuChC3G.js +1 -0
- package/console-dist/assets/{download-B9e1wNK4.js → download-i8CTJ7oi.js} +1 -1
- package/console-dist/assets/{local-flag-CPAqDO-L.js → dropdown-menu-B_MMNbTy.js} +1 -1
- package/console-dist/assets/events-Dz_zsLGE.js +1 -0
- package/console-dist/assets/events-format-C5HTkIsC.js +1 -0
- package/console-dist/assets/events-iYGC0JpW.js +1 -0
- package/console-dist/assets/export-tab-BS4GlLBV.js +1 -0
- package/console-dist/assets/factory-BCPLmUx4.js +1 -0
- package/console-dist/assets/factory-CBXx3oBo.js +1 -0
- package/console-dist/assets/floor-page-BOlkyLaW.js +1 -0
- package/console-dist/assets/floor-page-E-0txA4z.css +1 -0
- package/console-dist/assets/format-Bx7DF-TB.js +1 -0
- package/console-dist/assets/genset-DBpkUT9p.js +1 -0
- package/console-dist/assets/{get-error-message-eGdenTLv.js → get-error-message-CEvauOXv.js} +1 -1
- package/console-dist/assets/index-B7ZG1VO6.js +12 -0
- package/console-dist/assets/index-CrLa65Ur.css +2 -0
- package/console-dist/assets/{integration-api-Bg7D1eQc.js → integration-api-iM6SWQ6d.js} +1 -1
- package/console-dist/assets/integrations-Bw0jY-xH.js +1 -0
- package/console-dist/assets/integrations-NcPRP3je.js +1 -0
- package/console-dist/assets/{label-DWyy9MeT.js → label-2sIXTEUK.js} +1 -1
- package/console-dist/assets/loader-circle-DjgHgHHl.js +1 -0
- package/console-dist/assets/{login-BZKYK0yZ.js → login-snbitj6V.js} +1 -1
- package/console-dist/assets/minus-CaT9UaQx.js +1 -0
- package/console-dist/assets/models-CsdLFBfC.js +1 -0
- package/console-dist/assets/models-Dy_JFNac.js +1 -0
- package/console-dist/assets/not-found-Cc35S-lZ.js +1 -0
- package/console-dist/assets/pause-CqW7v5Dc.js +1 -0
- package/console-dist/assets/pharma-cleanroom-CBgNUnIv.js +1 -0
- package/console-dist/assets/plus-Cl4Ay5Ry.js +1 -0
- package/console-dist/assets/protocol-card-Cp8O59cX.js +1 -0
- package/console-dist/assets/proxy-CWZabK8f.js +1 -0
- package/console-dist/assets/query-fetch-error-CWLZA2L5.js +1 -0
- package/console-dist/assets/{radio-DRkzblxj.js → radio-BxpVYiyS.js} +1 -1
- package/console-dist/assets/registry-Kj-oMlVm.js +2 -0
- package/console-dist/assets/{rocket-807Pf7C1.js → rocket-KZ5oHK1G.js} +1 -1
- package/console-dist/assets/rtu-BR4DhLbE.js +1 -0
- package/console-dist/assets/select-BWlrSYlA.js +1 -0
- package/console-dist/assets/{select-display-items-D-L3PesO.js → select-display-items-DN2G8DNG.js} +1 -1
- package/console-dist/assets/{server-CS2Tw__K.js → server-BVem_egD.js} +1 -1
- package/console-dist/assets/shallow-Cin0mLuv.js +1 -0
- package/console-dist/assets/sliders-horizontal-BNKmYQgd.js +1 -0
- package/console-dist/assets/smart-factory-DozakG3N.js +1 -0
- package/console-dist/assets/{source-host-miravo-D_AecPVc.js → source-host-miravo-B8eM2IHw.js} +1 -1
- package/console-dist/assets/stages-C0cErwSQ.js +1 -0
- package/console-dist/assets/status-DNfdEhTs.js +1 -0
- package/console-dist/assets/status-kit-BLG7OeIE.js +1 -0
- package/console-dist/assets/tabs-Ch_VG8_S.js +1 -0
- package/console-dist/assets/tags-BRYVC9vb.js +1 -0
- package/console-dist/assets/tags-bloWH2Qa.js +4 -0
- package/console-dist/assets/tank-xgQfMS2d.js +1 -0
- package/console-dist/assets/tooltip-B3vOB1Vu.js +1 -0
- package/console-dist/assets/{transition-nav-link-cn4KZD6W.js → transition-nav-link-CBN2nulP.js} +1 -1
- package/console-dist/assets/{trash-2-BJ-1df0F.js → trash-2-BH9HDsZv.js} +1 -1
- package/console-dist/assets/{triangle-alert-D1AraFcP.js → triangle-alert-DoAwrRgk.js} +1 -1
- package/console-dist/assets/use-engine-command-mutation-oLQW2r4F.js +1 -0
- package/console-dist/assets/use-transition-navigate-BDkvJJsk.js +2 -0
- package/console-dist/assets/useQuery-smgfSdOx.js +1 -0
- package/console-dist/assets/validation-BOdAwXQ_.js +1 -0
- package/console-dist/assets/water-treatment-BJXMtYlP.js +1 -0
- package/console-dist/index.html +68 -54
- package/miravo +2 -2
- package/package.json +1 -1
- package/console-dist/assets/api-DybIIqOe.js +0 -1
- package/console-dist/assets/asset-detail-tmOrYE8x.js +0 -1
- package/console-dist/assets/badge-D4jktT8T.js +0 -1
- package/console-dist/assets/catalog-DN-klsod.js +0 -1
- package/console-dist/assets/catalog-M-k7Y9Sp.js +0 -1
- package/console-dist/assets/catalog-template-icons-C7KJdJJX.js +0 -1
- package/console-dist/assets/checkbox-AaJhjtZk.js +0 -1
- package/console-dist/assets/chevron-down-CAk5w9Wt.js +0 -1
- package/console-dist/assets/chevron-right-BfZjrUWh.js +0 -1
- package/console-dist/assets/combobox-BFEY6lgO.js +0 -1
- package/console-dist/assets/control-CD9UoTvu.js +0 -1
- package/console-dist/assets/control-DHa2-a2v.js +0 -1
- package/console-dist/assets/copy-button-DHm7RGJ5.js +0 -1
- package/console-dist/assets/events-D19CzgoQ.js +0 -1
- package/console-dist/assets/events-DmftG8n5.js +0 -1
- package/console-dist/assets/export-tab-ouFgYEU_.js +0 -1
- package/console-dist/assets/factory-CT2VYi0n.js +0 -1
- package/console-dist/assets/factory-DSrBtcG2.js +0 -1
- package/console-dist/assets/format-OUFL_tef.js +0 -1
- package/console-dist/assets/index-DuJJSpJp.js +0 -12
- package/console-dist/assets/index-iEV9hU2I.css +0 -2
- package/console-dist/assets/integrations-DWW9HjH0.js +0 -1
- package/console-dist/assets/integrations-DoXNrzD5.js +0 -1
- package/console-dist/assets/models-CrDBHBV5.js +0 -1
- package/console-dist/assets/models-jBVcY8Xd.js +0 -1
- package/console-dist/assets/not-found-BqVny4Md.js +0 -1
- package/console-dist/assets/play-TTg_EXSa.js +0 -1
- package/console-dist/assets/plus-BbVbvFTe.js +0 -1
- package/console-dist/assets/protocol-card-B2SpAJKe.js +0 -1
- package/console-dist/assets/query-fetch-error-C2Ec4RQS.js +0 -1
- package/console-dist/assets/select-Bg6PPro0.js +0 -1
- package/console-dist/assets/tabs-bI9sskHy.js +0 -1
- package/console-dist/assets/tags-B7e7VYVW.js +0 -1
- package/console-dist/assets/tags-DJJKQRZZ.js +0 -4
- package/console-dist/assets/use-engine-command-mutation-DMkQxmt9.js +0 -1
- package/console-dist/assets/use-transition-navigate-BiV2QCcA.js +0 -2
- package/console-dist/assets/validation-q38DYDwu.js +0 -1
- /package/console-dist/assets/{chunk-OE4NN4TA-Q4iNR9l9.js → chunk-OE4NN4TA-DBWZidbW.js} +0 -0
- /package/console-dist/assets/{dist-CtuJWBnP.js → dist-xY0pK9Wy.js} +0 -0
- /package/console-dist/assets/{integration-targets-BehiqWyT.js → integration-targets-Byvdd3Or.js} +0 -0
- /package/console-dist/assets/{runtime-link-ChF8TM68.js → runtime-link-BRnaEnOm.js} +0 -0
- /package/console-dist/assets/{transition-types-049V0Kr0.js → transition-types-BKZuWApE.js} +0 -0
- /package/console-dist/assets/{utils-BO2u-wC_.js → utils-XFKvwlFT.js} +0 -0
- /package/console-dist/assets/{vendor-table-Br-cHaxY.js → vendor-table-BQAIXM34.js} +0 -0
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as e}from"./rolldown-runtime-COnpUsM8.js";import{c as t}from"./vendor-charts-95ykyDlI.js";import{ot as n}from"./vendor-ui-D8j69UH4.js";import{ct as r,lt as i,ut as a,v as o,y as s}from"./api-kPM52mb-.js";import{a as c,g as l,i as u,r as d,t as f}from"./query-fetch-error-C2Ec4RQS.js";import{n as p,t as m}from"./badge-D4jktT8T.js";import{t as h}from"./AnimatePresence-BZCmb1bq.js";import{i as g,r as _}from"./dist-CtuJWBnP.js";import{n as v}from"./chunk-OE4NN4TA-Q4iNR9l9.js";import{a as y,c as b,i as x,n as S,o as C,r as ee,t as te}from"./dialog-Di9Bs0FH.js";import{C as w,S as T,T as ne,m as E,o as D,u as O}from"./format-OUFL_tef.js";import{n as k,t as A}from"./utils-BO2u-wC_.js";import{t as j}from"./activity-Cn48I9qe.js";import{n as re,r as ie,t as M}from"./server-CS2Tw__K.js";import{t as ae}from"./chevron-down-CAk5w9Wt.js";import{n as oe,t as se}from"./circle-x-CGcRflg7.js";import{a as ce,d as le,f as ue,n as de,o as fe,p as pe,r as me}from"./integration-api-Bg7D1eQc.js";import{a as N,n as P,r as F,t as he}from"./copy-button-DHm7RGJ5.js";import{n as ge,r as _e,t as ve}from"./source-host-miravo-D_AecPVc.js";import{a as ye,i as be,n as xe,r as Se,t as Ce}from"./tabs-bI9sskHy.js";import{t as I}from"./plus-BbVbvFTe.js";import{t as we}from"./trash-2-BJ-1df0F.js";import{t as L}from"./triangle-alert-D1AraFcP.js";import{t as Te}from"./label-DWyy9MeT.js";import{n as R}from"./get-error-message-eGdenTLv.js";import{a as Ee,c as z,i as B,n as V,o as De,r as Oe,s as H,t as U}from"./select-Bg6PPro0.js";import{i as W,n as ke,r as G,t as Ae}from"./integration-targets-BehiqWyT.js";var je=class extends l{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,a=super.createResult(e,t),{isFetching:o,isRefetching:s,isError:c,isRefetchError:l}=a,u=n.fetchMeta?.fetchMore?.direction,d=c&&u===`forward`,f=o&&u===`forward`,p=c&&u===`backward`,m=o&&u===`backward`;return{...a,fetchNextPage:this.fetchNextPage,fetchPreviousPage:this.fetchPreviousPage,hasNextPage:r(t,n.data),hasPreviousPage:i(t,n.data),isFetchNextPageError:d,isFetchingNextPage:f,isFetchPreviousPageError:p,isFetchingPreviousPage:m,isRefetchError:l&&!d&&!p,isRefetching:s&&!f&&!m}}};function Me(e,t){return c(e,je,t)}var K=k(`clock-3`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M12 6v6h4`,key:`135r8i`}]]),Ne=k(`eye-off`,[[`path`,{d:`M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49`,key:`ct8e1f`}],[`path`,{d:`M14.084 14.158a3 3 0 0 1-4.242-4.242`,key:`151rxh`}],[`path`,{d:`M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143`,key:`13bj9a`}],[`path`,{d:`m2 2 20 20`,key:`1ooewy`}]]),Pe=k(`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`}]]),q=e(t(),1),J=n(),Fe=`rounded-(--miravo-radius-stadium-sm) border border-dashed border-border/55 bg-muted/10`;function Ie(){return(0,J.jsx)(`p`,{className:`mt-2 text-pretty text-sm leading-relaxed text-muted-foreground`,children:`Add a target to get started.`})}function Le({onClick:e}){return(0,J.jsxs)(w,{type:`button`,size:`sm`,className:`h-7 shrink-0 gap-1.5 text-xs`,onClick:e,children:[(0,J.jsx)(I,{className:`size-3.5`,"aria-hidden":!0}),`Add Target`]})}function Re({titleId:e,frameIcon:t,description:n,children:r}){return(0,J.jsx)(`section`,{"aria-labelledby":e,className:Fe,children:(0,J.jsxs)(`div`,{className:`flex flex-col items-center gap-4 px-4 py-10 text-center`,children:[(0,J.jsx)(`div`,{className:`flex size-12 items-center justify-center rounded-(--miravo-radius-stadium-sm) border border-dashed border-border/50`,children:t}),(0,J.jsxs)(`div`,{className:`max-w-sm`,children:[(0,J.jsx)(`h2`,{id:e,className:`font-heading text-sm font-semibold tracking-tight text-foreground`,children:`No targets yet`}),n]}),r]})})}function ze(){return(0,J.jsx)(`section`,{"aria-labelledby":`integrations-operation-log-empty-title`,className:Fe,children:(0,J.jsxs)(`div`,{className:`flex flex-col items-center gap-4 px-4 py-8 text-center sm:py-10`,children:[(0,J.jsx)(`div`,{className:`flex size-12 items-center justify-center rounded-(--miravo-radius-stadium-sm) border border-dashed border-border/50`,children:(0,J.jsx)(j,{className:`size-6 text-muted-foreground/45`,"aria-hidden":!0})}),(0,J.jsxs)(`div`,{className:`max-w-sm`,children:[(0,J.jsx)(`h2`,{id:`integrations-operation-log-empty-title`,className:`font-heading text-sm font-semibold tracking-tight text-foreground`,children:`No operations yet`}),(0,J.jsx)(`p`,{className:`mt-2 text-pretty text-sm leading-relaxed text-muted-foreground`,children:`Apply from the Factory page, or clean up from a target. Finished runs show up here with full detail.`})]})]})})}function Be(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 Ve(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:Be(e[0]?.completedAt??Date.now()),ops:e}))}function Y(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===`asset`?`One count per asset in this run.`:`Sets the device parameter to the bound DeviceHub device.`}var He={devices:`Devices`,models:`DT models`,assets:`Digital Twin instances`},X={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`,noop:`inline-flex items-center rounded-[var(--miravo-radius-tight)] border border-border/55 bg-muted/55 px-1.5 py-0.5 font-mono text-[10px] tabular-nums text-foreground/78`,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 Ue(e){return[{key:`device`,title:`DeviceHub — protocol tags`,subtitle:Y(`device`,e),counts:e.resourceCounts.device},{key:`model`,title:`Digital Twin models`,subtitle:Y(`model`,e),counts:e.resourceCounts.model},{key:`asset`,title:`Assets`,subtitle:Y(`asset`,e),counts:e.resourceCounts.asset},{key:`param-sync`,title:`Parameter sync`,subtitle:Y(`param-sync`,e),counts:e.resourceCounts[`param-sync`]}].filter(e=>e.counts.total>0||e.counts.failed>0)}function We(e){return e.length===0?`Default (devices, models, assets)`:e.map(e=>He[e]??e).join(` · `)}function Z(e){return e.templateId??e.assetId??``}function Q(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`;case`noop`:return`=${n} unchanged`}switch(t){case`create`:return`+${n} created`;case`update`:return`${n} updated`;case`replace`:return`↻${n} replaced`;case`delete`:return`−${n} removed`;case`noop`:return`=${n} unchanged`}}function Ge({row:e}){let{key:t,counts:n}=e;return(0,J.jsxs)(`div`,{className:`flex min-w-0 flex-1 flex-wrap items-center gap-1.5`,children:[n.create>0&&(0,J.jsx)(`span`,{className:X.create,children:Q(t,`create`,n.create)}),n.update>0&&(0,J.jsx)(`span`,{className:X.update,children:Q(t,`update`,n.update)}),n.replace>0&&(0,J.jsx)(`span`,{className:X.replace,children:Q(t,`replace`,n.replace)}),n.delete>0&&(0,J.jsx)(`span`,{className:X.delete,children:Q(t,`delete`,n.delete)}),n.noop>0&&(0,J.jsx)(`span`,{className:X.noop,children:Q(t,`noop`,n.noop)}),n.failed>0&&(0,J.jsx)(`span`,{className:X.failed,children:`${n.failed} failed`})]})}function Ke(e){return e.resourceCounts.device.noop+e.resourceCounts.model.noop+e.resourceCounts.asset.noop+e.resourceCounts[`param-sync`].noop}function qe({op:e}){let t=Ke(e);return(0,J.jsxs)(`div`,{className:`rounded-[var(--miravo-radius-tight)] border border-border/50 bg-muted/25 px-3 py-2.5`,children:[(0,J.jsx)(`p`,{className:`font-mono text-[10px] uppercase tracking-[0.16em] text-foreground/72`,children:`Run context`}),(0,J.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,J.jsx)(`dt`,{className:`text-foreground/70`,children:`Operation`}),(0,J.jsx)(`dd`,{className:`font-medium capitalize text-foreground`,children:e.operationType}),(0,J.jsx)(`dt`,{className:`text-foreground/70`,children:`Factory`}),(0,J.jsx)(`dd`,{className:`font-mono text-[11px] text-foreground`,children:e.factoryName}),(0,J.jsx)(`dt`,{className:`text-foreground/70`,children:e.assetId===void 0?`Template`:`Asset`}),(0,J.jsx)(`dd`,{className:`font-mono text-[11px] text-foreground`,children:Z(e)}),(0,J.jsx)(`dt`,{className:`text-foreground/70`,children:`Target host`}),(0,J.jsx)(`dd`,{className:`break-all font-mono text-[11px] text-foreground`,children:e.hostname}),(0,J.jsx)(`dt`,{className:`text-foreground/70`,children:`Scope`}),(0,J.jsx)(`dd`,{className:`text-foreground`,children:We(e.scope)}),(0,J.jsx)(`dt`,{className:`text-foreground/70`,children:`Duration`}),(0,J.jsxs)(`dd`,{className:`tabular-nums text-foreground`,children:[(e.durationMs/1e3).toFixed(1),`s`]}),(0,J.jsx)(`dt`,{className:`text-foreground/70`,children:`Outcome`}),(0,J.jsxs)(`dd`,{className:`text-foreground`,children:[(0,J.jsx)(`span`,{className:`tabular-nums`,children:e.successCount}),` steps succeeded`,t>0&&(0,J.jsxs)(`span`,{className:`text-foreground/72`,children:[` `,`· `,(0,J.jsx)(`span`,{className:`tabular-nums`,children:t}),` unchanged`]}),e.failedCount>0&&(0,J.jsxs)(`span`,{className:`text-destructive`,children:[` `,`· `,(0,J.jsx)(`span`,{className:`tabular-nums`,children:e.failedCount}),` failed`]}),e.blockedCount>0&&(0,J.jsxs)(`span`,{className:`text-warning`,children:[` `,`· `,(0,J.jsx)(`span`,{className:`tabular-nums`,children:e.blockedCount}),` blocked in plan`]})]})]})]})}function Je({status:e}){switch(e){case`success`:return(0,J.jsx)(oe,{className:`mt-px size-4 shrink-0 text-success`});case`failed`:return(0,J.jsx)(se,{className:`mt-px size-4 shrink-0 text-destructive`});case`partial`:case`blocked`:return(0,J.jsx)(L,{className:`mt-px size-4 shrink-0 text-warning`});case`noop`:return(0,J.jsx)(K,{className:`mt-px size-4 shrink-0 text-foreground/55`})}}function Ye(e){let t=e.operationType===`apply`?`Applied`:`Cleaned up`,n=`${(e.durationMs/1e3).toFixed(1)}s`,r=[];e.successCount>0&&r.push(`${e.successCount} resources`);let i=Ke(e);return i>0&&r.push(`${i} unchanged`),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 Xe(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.`:Ke(e)>0?`No resources were mutated. Existing managed resources already matched the desired state.`:`No per-phase counts recorded.`}function Ze({op:e}){let t=Ue(e);return t.length===0?(0,J.jsx)(`p`,{className:`py-1 text-sm text-foreground/75`,children:Xe(e)}):(0,J.jsxs)(`div`,{className:`space-y-3 pt-1`,children:[(0,J.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,J.jsxs)(`div`,{className:`flex flex-col gap-2 px-3 py-2.5 sm:flex-row sm:items-start sm:gap-4`,children:[(0,J.jsxs)(`div`,{className:`min-w-0 shrink-0 sm:w-[11.5rem]`,children:[(0,J.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,J.jsx)(`span`,{className:`text-xs font-medium leading-snug text-foreground`,children:e.title}),(0,J.jsxs)(P,{children:[(0,J.jsx)(N,{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,J.jsx)(re,{className:`size-3.5`,"aria-hidden":!0})}),(0,J.jsx)(F,{side:`top`,className:`max-w-xs text-left`,children:e.subtitle})]})]}),(0,J.jsx)(`p`,{className:`mt-0.5 text-[11px] leading-snug text-foreground/72 sm:hidden`,children:e.subtitle})]}),(0,J.jsx)(Ge,{row:e})]},e.key))}),e.blockedCount>0&&(0,J.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,J.jsx)(`span`,{className:`font-medium`,children:e.blockedCount}),` plan entries were blocked (skipped). Open a `,(0,J.jsx)(`span`,{className:`font-medium`,children:`deploy preview`}),` before running to see block reasons.`]})]})}function Qe({operation:e}){let[t,n]=(0,q.useState)(!1);return(0,J.jsxs)(`div`,{className:A(`overflow-hidden rounded-[var(--miravo-radius-stadium-sm)] border border-border/55`,`transition-colors duration-150`),children:[(0,J.jsxs)(`button`,{type:`button`,"aria-expanded":t,onClick:()=>n(e=>!e),className:A(`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,J.jsx)(Je,{status:e.status}),(0,J.jsxs)(`div`,{className:`flex min-w-0 flex-1 flex-col gap-1`,children:[(0,J.jsxs)(`div`,{className:`flex items-start justify-between gap-4`,children:[(0,J.jsxs)(`p`,{className:`min-w-0 truncate text-sm`,children:[(0,J.jsx)(`span`,{className:`font-medium text-foreground`,children:O(Z(e))}),(0,J.jsx)(`span`,{className:`mx-1.5 text-foreground/50`,children:`→`}),(0,J.jsx)(`span`,{className:`text-foreground/82`,children:e.targetLabel})]}),(0,J.jsx)(`time`,{dateTime:new Date(e.completedAt).toISOString(),title:D(e.completedAt),className:`shrink-0 text-xs text-foreground/75`,children:E(e.completedAt)})]}),(0,J.jsx)(`p`,{className:`text-xs text-foreground/78`,children:Ye(e)}),(e.failedCount>0||e.status===`failed`)&&(0,J.jsx)(`p`,{className:`text-[11px] leading-snug text-foreground/72`,children:e.error??`The operation ended with an error.`})]}),(0,J.jsx)(ae,{className:A(`mt-0.5 size-3.5 shrink-0 text-foreground/55 transition-transform duration-150`,t&&`rotate-180`)})]}),(0,J.jsx)(h,{initial:!1,children:t&&(0,J.jsx)(p.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,J.jsxs)(`div`,{className:`space-y-3 border-t border-border/45 px-4 pb-3 pt-3`,children:[(0,J.jsx)(qe,{op:e}),e.error&&(0,J.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,J.jsx)(`div`,{className:`absolute top-1.5 right-1.5 z-10`,children:(0,J.jsx)(he,{value:e.error,label:`Copy error`,className:`text-destructive hover:bg-destructive/25 hover:text-foreground`})}),(0,J.jsx)(`p`,{className:`whitespace-normal break-words text-destructive [overflow-wrap:anywhere]`,children:e.error})]}),(0,J.jsx)(Ze,{op:e})]})})})]})}function $e({label:e}){return(0,J.jsxs)(`div`,{className:`flex items-center gap-3 py-1`,children:[(0,J.jsx)(`div`,{className:`h-px flex-1 bg-border/65`}),(0,J.jsx)(`span`,{className:`text-xs font-medium text-foreground/78`,children:e}),(0,J.jsx)(`div`,{className:`h-px flex-1 bg-border/65`})]})}var et={type:``,status:``,target:``,search:``},tt={_all:`All types`,apply:`Apply`,cleanup:`Cleanup`},nt={_all:`All statuses`,success:`Success`,partial:`Partial`,failed:`Failed`,blocked:`Blocked`,noop:`No-op`},rt=`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 it({filters:e,targetOptions:t,hasFilters:n,searchRef:r,onTypeChange:i,onStatusChange:a,onTargetChange:o,onSearchChange:s,onClear:c}){return(0,J.jsxs)(`div`,{className:`flex flex-wrap items-center gap-1.5 border-b border-border/50 px-3 py-2`,children:[(0,J.jsxs)(U,{value:e.type||`_all`,onValueChange:e=>e&&i(e===`_all`?``:e),children:[(0,J.jsx)(H,{size:`sm`,className:rt,"aria-label":`Operation type`,children:(0,J.jsx)(z,{children:e=>tt[e??`_all`]??tt._all})}),(0,J.jsxs)(V,{children:[(0,J.jsx)(B,{value:`_all`,children:`All types`}),(0,J.jsx)(B,{value:`apply`,children:`Apply`}),(0,J.jsx)(B,{value:`cleanup`,children:`Cleanup`})]})]}),(0,J.jsxs)(U,{value:e.status||`_all`,onValueChange:e=>e&&a(e===`_all`?``:e),children:[(0,J.jsx)(H,{size:`sm`,className:rt,"aria-label":`Operation status`,children:(0,J.jsx)(z,{children:e=>nt[e??`_all`]??nt._all})}),(0,J.jsxs)(V,{children:[(0,J.jsx)(B,{value:`_all`,children:`All statuses`}),(0,J.jsx)(B,{value:`success`,children:`Success`}),(0,J.jsx)(B,{value:`partial`,children:`Partial`}),(0,J.jsx)(B,{value:`failed`,children:`Failed`}),(0,J.jsx)(B,{value:`blocked`,children:`Blocked`}),(0,J.jsx)(B,{value:`noop`,children:`No-op`})]})]}),t.length>1&&(0,J.jsxs)(U,{value:e.target||`_all`,onValueChange:e=>e&&o(e===`_all`?``:e),children:[(0,J.jsx)(H,{size:`sm`,className:rt,"aria-label":`Target filter`,children:(0,J.jsx)(z,{children:e=>!e||e===`_all`?`All targets`:e})}),(0,J.jsxs)(V,{children:[(0,J.jsx)(B,{value:`_all`,children:`All targets`}),t.map(e=>(0,J.jsx)(B,{value:e,children:e},e))]})]}),(0,J.jsxs)(`div`,{className:`relative flex min-w-[140px] flex-1 items-center`,children:[(0,J.jsx)(`input`,{ref:r,type:`search`,value:e.search,onChange:e=>s(e.target.value),placeholder:`Search template or target…`,"aria-describedby":`ops-search-shortcut`,className:A(`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,J.jsx)(`span`,{id:`ops-search-shortcut`,className:`sr-only`,children:`Press slash to focus search`}),!e.search&&(0,J.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,J.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,J.jsx)(ne,{className:`size-3`}),`Clear`]})]})}function at({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,f]=(0,q.useState)(!1),[m,g]=(0,q.useState)(et),_=(0,q.useRef)(null);(0,q.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=()=>{f(!0),i(),b.success(`Operations refreshed`),setTimeout(()=>f(!1),600)},y=(0,q.useMemo)(()=>{let t=new Set;for(let n of e){let e=n.targetLabel;t.add(e)}return[...t].sort()},[e]),x=(0,q.useMemo)(()=>{let t=e;if(m.type&&(t=t.filter(e=>e.operationType===m.type)),m.status&&(t=t.filter(e=>e.status===m.status)),m.target&&(t=t.filter(e=>e.targetLabel===m.target)),m.search){let e=m.search.toLowerCase();t=t.filter(t=>{let n=t.targetLabel;return Z(t).toLowerCase().includes(e)||O(Z(t)).toLowerCase().includes(e)||t.factoryName.toLowerCase().includes(e)||n.toLowerCase().includes(e)})}return t},[e,m]),S=m.type!==``||m.status!==``||m.target!==``||m.search!==``,C=(0,q.useMemo)(()=>Ve(x),[x]);return(0,J.jsxs)(`div`,{className:`flex h-full flex-col rounded-[var(--miravo-radius-stadium-sm)] border border-border/55`,children:[(0,J.jsxs)(`div`,{className:`flex items-center justify-between border-b border-border/50 px-3.5 py-2.5`,children:[(0,J.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,J.jsx)(`span`,{className:`text-sm font-medium text-foreground`,children:`Operation log`}),e.length>0&&(0,J.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,J.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,J.jsx)(d,{className:A(`size-3.5`,u&&`animate-spin`),"aria-hidden":!0})})]}),(0,J.jsx)(it,{filters:m,targetOptions:y,hasFilters:S,searchRef:_,onTypeChange:e=>g(t=>({...t,type:e})),onStatusChange:e=>g(t=>({...t,status:e})),onTargetChange:e=>g(t=>({...t,target:e})),onSearchChange:e=>g(t=>({...t,search:e})),onClear:()=>g(et)}),(0,J.jsxs)(`div`,{className:`flex flex-1 min-h-0 flex-col gap-2 overflow-y-auto overscroll-y-contain p-3`,children:[r&&(0,J.jsxs)(`p`,{className:`py-2 text-xs text-destructive`,children:[`✕ `,r.message]}),n&&e.length===0&&!r&&(0,J.jsx)(`p`,{className:`py-4 text-sm text-foreground/75`,children:`Loading…`}),!n&&e.length===0&&!r&&(0,J.jsx)(ze,{}),!n&&e.length>0&&x.length===0&&(0,J.jsxs)(`p`,{className:`py-6 text-center text-sm text-foreground/75`,children:[`No operations match your filters.`,` `,(0,J.jsx)(`button`,{type:`button`,onClick:()=>g(et),className:`text-primary hover:underline`,children:`Clear filters`})]}),S&&x.length>0&&x.length!==e.length&&(0,J.jsxs)(`p`,{className:`text-xs text-foreground/75`,children:[`Showing`,` `,(0,J.jsx)(`span`,{className:`font-medium tabular-nums text-foreground`,children:x.length}),` of`,` `,(0,J.jsx)(`span`,{className:`tabular-nums`,children:e.length}),` loaded`]}),!S&&typeof t==`number`&&t>0&&e.length<t&&(0,J.jsxs)(`p`,{className:`text-xs text-foreground/75`,children:[`Showing`,` `,(0,J.jsx)(`span`,{className:`font-medium tabular-nums text-foreground`,children:e.length}),` `,`of `,(0,J.jsx)(`span`,{className:`tabular-nums`,children:t}),`. Load more for older entries.`]}),(0,J.jsx)(h,{initial:!1,children:C.map(e=>(0,J.jsxs)(p.div,{className:`flex flex-col gap-2`,children:[(0,J.jsx)($e,{label:e.label}),(0,J.jsx)(h,{initial:!1,children:e.ops.map(e=>(0,J.jsx)(p.div,{initial:x.length>40?!1:{opacity:0,x:-6},animate:{opacity:1,x:0},transition:{type:`spring`,stiffness:400,damping:35},children:(0,J.jsx)(Qe,{operation:e})},`${e.operationId}-${e.completedAt}`))})]},e.label))}),s?(0,J.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,J.jsxs)(`p`,{className:`text-xs text-destructive`,children:[`Could not load older entries: `,s.message]}),c?(0,J.jsx)(w,{type:`button`,variant:`outline`,size:`sm`,onClick:c,children:`Retry`}):null]}):a&&l?(0,J.jsx)(`div`,{className:`flex shrink-0 justify-center border-t border-border/50 pt-3 pb-1`,children:(0,J.jsx)(w,{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]})]})}var ot={...Object.fromEntries(W.map(e=>[e.id,e.exportLabel])),"source-yaml":`Source YAML`};function st(e){return e==null||e===``?`Select integration`:typeof e==`string`?ot[e]??e:`Select integration`}function ct(e){return W.find(t=>t.id===e)?.label??e}function $({id:e,label:t,hint:n,className:r,labelAdornment:i,children:a}){return(0,J.jsxs)(`div`,{className:A(`flex flex-col gap-2`,r),children:[(0,J.jsxs)(`div`,{className:`space-y-1`,children:[(0,J.jsxs)(`span`,{className:`inline-flex max-w-full items-center gap-1`,children:[(0,J.jsx)(Te,{htmlFor:e,className:`text-[11px] font-medium text-foreground`,children:t}),i]}),n?(0,J.jsx)(`p`,{className:`text-[11px] leading-relaxed text-muted-foreground`,children:n}):null]}),a]})}function lt({open:e,editing:t,integrationId:n,form:r,showToken:i,saving:a,testing:o,canTestConnection:s,onOpenChange:c,onIntegrationChange:l,onFormChange:u,onShowTokenChange:d,onSave:f,onTestConnection:p,onCancelInFlight:m}){let h=n===G.id,g=t?`Edit Target`:`Add Target`,_=t?`Update the deployment connection.`:`Add the target used for integration deploys.`,v=t?`Leave empty to keep the current token.`:`Required for the first save and connection test.`;return(0,J.jsx)(te,{open:e,onOpenChange:e=>{e||m(),c(e)},children:(0,J.jsxs)(S,{showCloseButton:!0,className:`flex max-h-[min(84vh,38rem)] min-h-0 flex-col gap-0 overflow-hidden p-0 sm:max-w-[38rem]`,children:[(0,J.jsxs)(y,{className:`shrink-0 border-b border-border/60 px-4 pb-3.5 pt-4 pr-12 sm:px-5 sm:pr-14`,children:[(0,J.jsx)(C,{className:`text-base tracking-tight`,children:g}),(0,J.jsx)(ee,{className:`max-w-xl text-sm leading-relaxed`,children:_})]}),(0,J.jsx)(`div`,{className:`min-h-0 flex-1 overflow-y-auto overscroll-contain px-4 py-4 sm:px-5`,style:{scrollbarGutter:`stable`},children:(0,J.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[t?(0,J.jsx)($,{label:`Integration`,children:(0,J.jsx)(`div`,{className:`flex h-9 items-center rounded-[var(--miravo-radius-stadium-sm)] border border-input bg-input/30 px-3 text-sm text-foreground`,children:ct(n)})}):(0,J.jsx)($,{label:`Integration`,children:(0,J.jsxs)(U,{value:n,onValueChange:e=>l(e),children:[(0,J.jsx)(H,{className:`h-9 w-full text-sm data-placeholder:text-muted-foreground/55`,"aria-label":`Integration type`,children:(0,J.jsx)(z,{placeholder:`Select integration`,children:e=>st(e)})}),(0,J.jsxs)(V,{children:[(0,J.jsxs)(Oe,{children:[(0,J.jsx)(Ee,{children:`Available`}),Ae.map(e=>(0,J.jsx)(B,{value:e.id,children:e.label},e.id))]}),(0,J.jsx)(De,{}),(0,J.jsxs)(Oe,{children:[(0,J.jsx)(Ee,{children:`Coming soon`}),ke.map(e=>(0,J.jsx)(B,{value:e.id,children:e.label},e.id))]})]})]})}),h?(0,J.jsxs)(J.Fragment,{children:[(0,J.jsx)($,{id:`env-label`,label:`Label`,children:(0,J.jsx)(T,{id:`env-label`,placeholder:`Production`,value:r.label,onChange:e=>u({...r,label:e.currentTarget.value}),autoComplete:`off`,className:`h-9 placeholder:text-muted-foreground/55`})}),(0,J.jsx)($,{id:`env-hostname`,label:`Hostname`,children:(0,J.jsx)(T,{id:`env-hostname`,placeholder:`192.168.1.100`,value:r.hostname,onChange:e=>u({...r,hostname:e.currentTarget.value}),autoCapitalize:`none`,autoComplete:`off`,spellCheck:!1,className:`h-9 font-mono text-[13px] placeholder:text-muted-foreground/55`})}),(0,J.jsx)($,{id:`env-source`,label:ge,labelAdornment:(0,J.jsxs)(P,{children:[(0,J.jsx)(N,{type:`button`,className:`inline-flex size-5 shrink-0 items-center justify-center rounded-[var(--miravo-radius-tight)] text-muted-foreground hover:bg-muted hover:text-foreground`,"aria-label":`About ${ge}`,children:(0,J.jsx)(pe,{className:`size-3`,"aria-hidden":!0})}),(0,J.jsx)(F,{side:`top`,align:`start`,className:`max-w-xs text-left`,children:ve})]}),children:(0,J.jsx)(T,{id:`env-source`,placeholder:`host.docker.internal`,value:r.sourceHostname,onChange:e=>u({...r,sourceHostname:e.currentTarget.value}),autoCapitalize:`none`,autoComplete:`off`,spellCheck:!1,className:`h-9 font-mono text-[13px] placeholder:text-muted-foreground/55`})}),(0,J.jsx)($,{id:`env-token`,label:`API token`,labelAdornment:(0,J.jsxs)(P,{children:[(0,J.jsx)(N,{type:`button`,className:`inline-flex size-5 shrink-0 items-center justify-center rounded-[var(--miravo-radius-tight)] text-muted-foreground hover:bg-muted hover:text-foreground`,"aria-label":`About API token`,children:(0,J.jsx)(pe,{className:`size-3`,"aria-hidden":!0})}),(0,J.jsx)(F,{side:`top`,align:`start`,className:`max-w-xs text-left`,children:v})]}),children:(0,J.jsxs)(`div`,{className:`relative`,children:[(0,J.jsx)(T,{id:`env-token`,type:i?`text`:`password`,placeholder:t?`••••••••`:`Enter API token`,value:r.apiToken,onChange:e=>u({...r,apiToken:e.currentTarget.value}),autoCapitalize:`none`,autoComplete:`off`,spellCheck:!1,className:`h-9 pr-11 font-mono text-[13px] placeholder:text-muted-foreground/55`}),(0,J.jsx)(`button`,{type:`button`,onClick:()=>d(!i),"aria-label":i?`Hide token`:`Show token`,"aria-pressed":i,className:`absolute inset-y-0 right-0 flex w-11 items-center justify-center rounded-r-[var(--miravo-radius-stadium-sm)] text-muted-foreground transition-colors hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/50`,children:i?(0,J.jsx)(Ne,{className:`size-3.5`,"aria-hidden":!0}):(0,J.jsx)(_e,{className:`size-3.5`,"aria-hidden":!0})})]})})]}):(0,J.jsxs)(`div`,{className:`rounded-[var(--miravo-radius-stadium-sm)] border border-dashed border-border/70 px-4 py-3 text-sm text-muted-foreground`,children:[ct(n),` setup is not available yet. Switch back to Litmus Edge to finish target setup now.`]})]})}),(0,J.jsx)(`span`,{className:`sr-only`,role:`status`,"aria-live":`polite`,children:o&&h?`Checking connection to Litmus Edge…`:``}),(0,J.jsxs)(x,{className:`mx-0 mb-0 shrink-0 flex-col gap-2 border-t border-border/60 bg-background px-4 py-3 sm:flex-row sm:justify-end sm:px-5`,children:[(0,J.jsx)(w,{type:`button`,variant:`outline`,size:`lg`,className:`w-full justify-center sm:mr-auto sm:w-auto`,disabled:a||o||!s,"aria-busy":o,onClick:p,children:o?(0,J.jsxs)(J.Fragment,{children:[(0,J.jsx)(ye,{className:`size-3.5 animate-spin`,"aria-hidden":!0}),`Testing connection`]}):`Test connection`}),(0,J.jsxs)(`div`,{className:`flex w-full flex-col gap-2 sm:w-auto sm:flex-row`,children:[(0,J.jsx)(w,{variant:`outline`,size:`lg`,className:`w-full sm:w-auto`,onClick:()=>{m(),c(!1)},disabled:a,children:`Cancel`}),(0,J.jsx)(w,{size:`lg`,className:`w-full sm:w-auto`,onClick:f,disabled:a||!h,children:a?`Saving...`:t?`Save Target`:`Add Target`})]})]})]})})}function ut(e){let t=e.trim();if(t.length===0)return{message:`Connection test failed with no details from the server.`};let n=t.toLowerCase();if(t.includes(`timed out`))return{message:`Litmus Edge did not respond in time.`,description:`Check the hostname, VPN or firewall, and that the device is online.`};if(/\b401\b/.test(t)||/\b403\b/.test(t)||n.includes(`unauthorized`))return{message:`The API token was rejected.`,description:`Create or copy a valid token in Litmus Edge and paste it into the API token field.`};if(/\b404\b/.test(t)&&(n.includes(`sysinfo`)||n.includes(`/sysinfo/`)))return{message:`This Litmus Edge host or version does not expose the system info API.`,description:`Confirm the hostname and that Litmus Edge is running a build with GET /sysinfo/devinfo.`};if(n.includes(`econnrefused`)||n.includes(`connection refused`)||n.includes(`enotfound`)||n.includes(`getaddrinfo`)||n.includes(`failed`)&&n.includes(`fetch`))return{message:`Could not reach the Litmus Edge host.`,description:`Check the hostname or IP, TLS, and that this computer can reach the edge network.`};if(t.includes(`Session expired`))return{message:`Your session expired. Sign in again, then retry the connection test.`};if(n.includes(`factory not found`))return{message:`That target was removed. Close the dialog and refresh the list.`};if(n.includes(`unsupported integration`)&&n.includes(`connection`))return{message:`This integration type does not support connection tests yet.`,description:`Use Litmus Edge for remote apply and connection testing.`};if(n.includes(`invalid request body`)||n.includes(`api token is required`))return{message:`Some required fields are missing or invalid.`,description:`Fill in hostname, source host (Miravo), and API token (for new targets).`};let r=t.replace(/^LE\s+\S+\s+/i,``).trim();return{message:`Could not verify the connection to Litmus Edge.`,description:r.length>0&&r.length<=220?r:dt(t,200)}}function dt(e,t){let n=e.replace(/\s+/g,` `).trim();return n.length<=t?n:`${n.slice(0,t-1)}…`}function ft(e){if(e.connected){let t=e.litmusEdgeVersion?` Litmus Edge v${e.litmusEdgeVersion}.`:``;if(e.warning){b.warning(`Connected to ${e.hostname}.${t}`,{description:e.warning});return}b.success(`Connected to ${e.hostname}.${t}`);return}let{message:t,description:n}=ut(e.error);b.error(t,n?{description:n}:void 0)}function pt(e){let{message:t,description:n}=ut(e instanceof Error?e.message:String(e));b.error(t,n?{description:n}:void 0)}function mt(e){return!!(typeof DOMException<`u`&&e instanceof DOMException&&e.name===`AbortError`||e instanceof Error&&(e.name===`AbortError`||/aborted/i.test(e.message)))}function ht(){let[e,t]=(0,q.useState)(!1),n=(0,q.useRef)(null),r=(0,q.useCallback)(()=>{n.current?.abort()},[]);return{testing:e,runTest:(0,q.useCallback)(async e=>{let r=new AbortController;n.current=r,t(!0);try{ft(await le(e,{signal:r.signal}))}catch(e){if(mt(e))return;pt(e)}finally{n.current===r&&(n.current=null),t(!1)}},[]),cancelInFlight:r}}function gt(e){return W.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 vt({status:e}){switch(e){case`success`:return(0,J.jsx)(oe,{className:`size-3 text-success`});case`partial`:case`blocked`:return(0,J.jsx)(L,{className:`size-3 text-warning`});case`noop`:return(0,J.jsx)(K,{className:`size-3 text-muted-foreground`});case`failed`:return(0,J.jsx)(se,{className:`size-3 text-destructive`})}}function yt({target:e,lastOp:t,onEdit:n,onDelete:r}){return(0,J.jsxs)(`div`,{className:`env-orbital relative overflow-hidden border`,style:{"--_status":_t(t)},children:[(0,J.jsx)(`div`,{className:`relative z-10 px-4 pt-3.5 pb-3`,children:(0,J.jsx)(`p`,{className:`font-heading text-[13px] font-semibold leading-tight tracking-tight text-foreground`,children:e.label})}),(0,J.jsx)(`div`,{className:`relative z-10 px-4 py-0.5`,children:(0,J.jsx)(`p`,{className:`font-mono text-xs tracking-tight text-muted-foreground`,children:e.hostname})}),(0,J.jsxs)(`div`,{className:`relative z-10 mx-4 mb-3 flex items-center gap-2`,children:[(0,J.jsx)(`span`,{className:`min-w-0 truncate font-mono text-[11px] text-muted-foreground`,children:e.sourceHostname}),(0,J.jsx)(`div`,{className:`env-orbital-path min-w-6 flex-1`}),(0,J.jsx)(ie,{className:`size-3 shrink-0 text-muted-foreground`})]}),(0,J.jsxs)(`div`,{className:`relative z-10 flex items-center gap-2 border-t border-border/30 px-3 py-1.5`,children:[(0,J.jsxs)(`span`,{className:`flex shrink-0 items-center gap-1.5 rounded-full border border-border/40 px-2 py-0.5`,children:[(0,J.jsx)(`span`,{className:`protocol-card-live-dot size-[5px]`}),(0,J.jsx)(`span`,{className:`text-[11px] font-medium tracking-wide text-muted-foreground`,children:gt(e.integrationId)})]}),t&&(0,J.jsxs)(`span`,{className:`flex min-w-0 items-center gap-1 truncate text-[11px] text-muted-foreground`,children:[(0,J.jsx)(vt,{status:t.status}),t.operationType===`apply`?`Applied`:`Cleaned`,` `,(0,J.jsx)(`time`,{dateTime:new Date(t.completedAt).toISOString(),title:D(t.completedAt),children:E(t.completedAt)})]}),(0,J.jsxs)(`div`,{className:`ml-auto flex shrink-0 items-center gap-0.5`,children:[(0,J.jsx)(w,{variant:`ghost`,size:`icon-sm`,"aria-label":`Edit target`,onClick:n,children:(0,J.jsx)(Pe,{className:`size-3`})}),(0,J.jsx)(w,{variant:`ghost`,size:`icon-sm`,className:`text-destructive hover:text-destructive`,"aria-label":`Delete target`,onClick:r,children:(0,J.jsx)(we,{className:`size-3`})})]})]})]})}function bt({onClick:e}){return(0,J.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,J.jsx)(I,{className:`size-5 transition-transform group-hover:scale-110`}),(0,J.jsx)(`span`,{className:`text-xs`,children:`Add Target`})]})}function xt({targets:e,onMutate:t,lastOpByTarget:n}){let[r,i]=(0,q.useState)(!1),[a,o]=(0,q.useState)(null),[s,c]=(0,q.useState)(G.id),[l,u]=(0,q.useState)({label:``,hostname:``,apiToken:``,sourceHostname:``}),[d,f]=(0,q.useState)(!1),[g,_]=(0,q.useState)(!1),{testing:v,runTest:T,cancelInFlight:ne}=ht(),[E,D]=(0,q.useState)(null),O=s===G.id&&l.hostname.trim().length>0&&l.sourceHostname.trim().length>0&&(a!==null||l.apiToken.trim().length>0),k=()=>{o(null),c(G.id),u({label:``,hostname:``,apiToken:``,sourceHostname:``}),_(!1),i(!0)},A=e=>{o(e.id),c(W.some(t=>t.id===e.integrationId)?e.integrationId:G.id),u({label:e.label,hostname:e.hostname,apiToken:``,sourceHostname:e.sourceHostname}),_(!1),i(!0)},j=async()=>{if(s!==G.id){b.error(`${gt(s)} target setup is coming soon.`);return}if(!l.label||!l.hostname||!l.sourceHostname){b.error(`Label, hostname, and source host are required.`);return}if(!a&&!l.apiToken){b.error(`API token is required for new targets.`);return}f(!0);try{a?(await ue(a,{integrationId:s,label:l.label,hostname:l.hostname,sourceHostname:l.sourceHostname,...l.apiToken?{apiToken:l.apiToken}:{}}),b.success(`Target updated.`)):(await de({...l,integrationId:s}),b.success(`Target added.`)),i(!1),t()}catch(e){b.error(R(e,`Failed to save target.`))}finally{f(!1)}};return(0,J.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[(0,J.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,J.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[(0,J.jsx)(`h2`,{className:`flex h-5 items-center text-xs font-medium leading-none uppercase tracking-wider text-muted-foreground`,children:`Integration Targets`}),e.length>0?(0,J.jsx)(m,{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,J.jsxs)(w,{size:`sm`,className:`h-7 shrink-0 gap-1.5 text-xs`,onClick:k,children:[(0,J.jsx)(I,{className:`size-3.5`}),` Add Target`]})]}),e.length===0?(0,J.jsx)(Re,{titleId:`integrations-targets-empty-title`,frameIcon:(0,J.jsx)(M,{className:`size-6 text-muted-foreground/45`,"aria-hidden":!0}),description:(0,J.jsx)(Ie,{}),children:(0,J.jsx)(Le,{onClick:k})}):(0,J.jsx)(`div`,{className:`grid grid-cols-1 gap-3 @2xl/main:grid-cols-2 @5xl/main:grid-cols-3`,children:(0,J.jsxs)(h,{children:[e.map((e,t)=>(0,J.jsx)(p.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,J.jsx)(yt,{target:e,lastOp:n.get(e.id),onEdit:()=>A(e),onDelete:()=>D(e)})},e.id)),(0,J.jsx)(p.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},transition:{type:`spring`,stiffness:380,damping:30,delay:e.length*.04},children:(0,J.jsx)(bt,{onClick:k})},`add-card`)]})}),(0,J.jsx)(lt,{open:r,editing:a!==null,integrationId:s,form:l,showToken:g,saving:d,testing:v,canTestConnection:O,onOpenChange:i,onIntegrationChange:c,onFormChange:u,onShowTokenChange:_,onSave:()=>void j(),onTestConnection:()=>{O&&T({...a?{targetId:a}:{},hostname:l.hostname.trim(),sourceHostname:l.sourceHostname.trim(),...l.apiToken.trim()?{apiToken:l.apiToken.trim()}:{}})},onCancelInFlight:ne}),(0,J.jsx)(te,{open:E!==null,onOpenChange:e=>!e&&D(null),children:(0,J.jsxs)(S,{children:[(0,J.jsxs)(y,{children:[(0,J.jsx)(C,{children:`Remove Target`}),(0,J.jsxs)(ee,{children:[`Remove “`,E?.label,`”? This only deletes the saved credentials — it does not affect resources on the target integration.`]})]}),(0,J.jsxs)(x,{children:[(0,J.jsx)(w,{variant:`outline`,onClick:()=>D(null),children:`Cancel`}),(0,J.jsx)(w,{variant:`destructive`,onClick:async()=>{if(!E)return;let e=E.id;D(null);try{await me(e),b.success(`Target removed.`),t()}catch(e){b.error(R(e,`Failed to remove target.`))}},children:`Remove`})]})]})})]})}var St=25;function Ct({status:e}){switch(e){case`success`:return(0,J.jsx)(oe,{className:`size-3 text-success`});case`partial`:case`blocked`:return(0,J.jsx)(L,{className:`size-3 text-warning`});case`noop`:return(0,J.jsx)(K,{className:`size-3 text-muted-foreground`});case`failed`:return(0,J.jsx)(se,{className:`size-3 text-destructive`})}}function wt({targetCount:e,opCount:t,lastOp:n}){return(0,J.jsxs)(`div`,{className:`flex flex-wrap items-center gap-x-3 gap-y-1 text-xs text-muted-foreground`,children:[(0,J.jsxs)(`span`,{className:`flex items-center gap-1.5`,children:[(0,J.jsx)(M,{className:`size-3`}),(0,J.jsx)(`span`,{className:`font-mono`,children:e}),` target`,e===1?``:`s`]}),(0,J.jsx)(`span`,{className:`hidden h-3 w-px bg-border/40 sm:inline-block`}),(0,J.jsxs)(`span`,{className:`flex items-center gap-1`,children:[(0,J.jsx)(h,{mode:`popLayout`,initial:!1,children:(0,J.jsx)(p.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,J.jsxs)(J.Fragment,{children:[(0,J.jsx)(`span`,{className:`hidden h-3 w-px bg-border/40 sm:inline-block`}),(0,J.jsxs)(`span`,{className:`flex items-center gap-1.5`,children:[(0,J.jsx)(Ct,{status:n.status}),(0,J.jsxs)(`span`,{children:[n.operationType===`apply`?`Applied`:`Cleaned`,` `,(0,J.jsx)(`time`,{dateTime:new Date(n.completedAt).toISOString(),title:D(n.completedAt),children:E(n.completedAt)})]})]})]})]})}function Tt(){let e=u({queryKey:o.integrations.targets(),queryFn:()=>fe()}),t=e.data??[],n=Me({queryKey:o.integrations.operationsList(),queryFn:({pageParam:e})=>ce({limit:St,offset:e}),initialPageParam:0,getNextPageParam:(e,t,n)=>e.hasMore&&e.operations.length>0?n+St:void 0}),r=(0,q.useMemo)(()=>n.data?.pages.flatMap(e=>e.operations)??[],[n.data]),i=n.data?.pages[0]?.total??0,a=(0,q.useMemo)(()=>{let e=new Map;for(let t of r)e.has(t.targetId)||e.set(t.targetId,t);return e},[r]),[c,l]=g(`tab`,_([`targets`,`activity`]).withDefault(`targets`));return(0,J.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,J.jsxs)(`div`,{className:`flex shrink-0 flex-col gap-2`,children:[(0,J.jsx)(`h1`,{className:`font-heading text-2xl font-semibold tracking-tight`,children:`Integrations`}),(0,J.jsxs)(`p`,{className:`text-sm text-muted-foreground`,children:[`Connect Litmus Edge targets here and review activity. Apply and clean up from the`,` `,(0,J.jsx)(v,{to:`/?tab=integrations`,className:`text-foreground underline underline-offset-2`,children:`Factory page`}),`.`]}),(0,J.jsx)(wt,{targetCount:t.length,opCount:i,lastOp:r[0]})]}),(0,J.jsxs)(Ce,{value:c,onValueChange:e=>{l(e)},className:`flex-1 min-h-0`,children:[(0,J.jsx)(`div`,{className:`shrink-0 overflow-x-auto`,children:(0,J.jsxs)(Se,{variant:`line`,className:`h-10! gap-0.5 min-w-max`,children:[(0,J.jsxs)(be,{value:`targets`,className:`gap-1.5 px-3 text-sm`,children:[(0,J.jsx)(M,{className:`size-3.5 shrink-0`}),`Targets`]}),(0,J.jsxs)(be,{value:`activity`,className:`gap-1.5 px-3 text-sm`,children:[(0,J.jsx)(j,{className:`size-3.5 shrink-0`}),`Activity`]})]})}),(0,J.jsx)(xe,{value:`targets`,className:`flex-1 py-2`,children:(0,J.jsx)(p.div,{initial:{opacity:0,y:6},animate:{opacity:1,y:0},transition:{duration:.15,ease:`easeOut`},children:e.isError&&e.data===void 0?(0,J.jsx)(f,{message:R(e.error,`Failed to load targets.`),onRetry:()=>void e.refetch(),isRetrying:e.isFetching&&!e.isPending}):(0,J.jsx)(xt,{targets:t,onMutate:()=>void e.refetch(),lastOpByTarget:a})},`targets`)}),(0,J.jsx)(xe,{value:`activity`,className:`flex flex-col flex-1 min-h-0 py-2`,children:(0,J.jsx)(p.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,J.jsx)(at,{operations:r,totalKnown:i,isLoading:n.isPending&&!n.data,error:n.error,onRefresh:()=>void s.invalidateQueries({queryKey:o.integrations.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`)})]})]})}export{Tt as t};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{t as e}from"./models-jBVcY8Xd.js";export{e as ModelsPage};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as e}from"./rolldown-runtime-COnpUsM8.js";import{c as t}from"./vendor-charts-95ykyDlI.js";import{ot as n}from"./vendor-ui-D8j69UH4.js";import{A as r,M as i,S as a,d as o,n as s,o as c,ot as l,v as u}from"./api-kPM52mb-.js";import{h as d,i as f,t as p}from"./query-fetch-error-C2Ec4RQS.js";import{n as m,t as h}from"./badge-D4jktT8T.js";import{t as g}from"./AnimatePresence-BZCmb1bq.js";import{a as _,i as v,n as y,o as b,r as x,t as S}from"./dialog-Di9Bs0FH.js";import{C,S as w,c as T,g as E,l as D,u as O,x as k}from"./format-OUFL_tef.js";import{n as A,t as j}from"./utils-BO2u-wC_.js";import{t as M}from"./activity-Cn48I9qe.js";import{t as N}from"./chevron-down-CAk5w9Wt.js";import{r as P}from"./source-host-miravo-D_AecPVc.js";import{i as F,n as I,r as ee,t as te}from"./tabs-bI9sskHy.js";import{t as L}from"./play-TTg_EXSa.js";import{t as ne}from"./plus-BbVbvFTe.js";import{t as re}from"./rocket-807Pf7C1.js";import{i as ie,n as R,r as z,t as ae}from"./catalog-source-2aT9qob-.js";import{c as oe,d as se,f as ce,l as le,s as ue,t as de,u as B}from"./export-tab-ouFgYEU_.js";import{t as V}from"./triangle-alert-D1AraFcP.js";import{t as H}from"./label-DWyy9MeT.js";import{n as U}from"./get-error-message-eGdenTLv.js";import{a as fe,i as pe,s as me,t as he}from"./use-engine-command-mutation-DMkQxmt9.js";import{t as ge}from"./checkbox-AaJhjtZk.js";var W=A(`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`}]]),_e=A(`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`}]]),ve=A(`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`}]]),ye=A(`minus`,[[`path`,{d:`M5 12h14`,key:`1ays0h`}]]),be=A(`terminal`,[[`path`,{d:`M12 19h8`,key:`baeox8`}],[`path`,{d:`m4 17 6-6-6-6`,key:`1yngyt`}]]),xe=A(`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`}]]),G=e(t(),1),K=n(),Se=new Set([`fault_active`,`fault_count`,`active_fault_code`,`lifecycle_stage`,`health_state`,`availability_state`]);function Ce(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};Se.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,K.jsx)(ce,{className:`size-3`}),members:t,accentClass:`text-muted-foreground`}),n.length>0&&a.push({key:`commands`,label:`Commands`,icon:(0,K.jsx)(be,{className:`size-3`}),members:n,accentClass:`text-info`}),r.length>0&&a.push({key:`process`,label:`Process Tags`,icon:(0,K.jsx)(M,{className:`size-3`}),members:r,accentClass:`text-primary`}),i.length>0&&a.push({key:`health`,label:`Health & Status`,icon:(0,K.jsx)(ve,{className:`size-3`}),members:i,accentClass:`text-success`}),a}function we({modelName:e,onClose:t}){let[n,r]=(0,G.useState)(new Set([`nameplate`,`process`])),i=f({queryKey:u.catalog.modelSchema(e??``),queryFn:()=>c(`/catalog/models/${e}`,a.catalogModelDetail),enabled:e!==null}),o=i.data,s=i.isPending&&!o,l=i.isError,d=U(i.error,`Failed to load model.`);(0,G.useEffect)(()=>{e&&r(new Set([`nameplate`,`process`]))},[e]);let g=(0,G.useMemo)(()=>o?Ce(o.members):[],[o]),_=(0,G.useCallback)(e=>{r(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})},[]),v=o?Object.keys(o.members).length:0,y=o?Object.keys(o.methods).length:0;return(0,K.jsx)(ue,{open:e!==null,onOpenChange:e=>{e||t()},children:(0,K.jsx)(oe,{side:`right`,className:`flex w-full flex-col gap-4 touch-manipulation`,children:s?null:l&&!o?(0,K.jsx)(`div`,{className:`flex flex-1 flex-col justify-center px-2`,children:(0,K.jsx)(p,{message:d,onRetry:()=>void i.refetch(),isRetrying:i.isFetching})}):o?(0,K.jsxs)(m.div,{initial:{opacity:0},animate:{opacity:1},transition:{duration:.18},className:`flex min-h-0 flex-1 flex-col gap-4`,children:[(0,K.jsxs)(B,{className:`gap-1 pb-0 pe-12`,children:[(0,K.jsx)(se,{className:`font-heading text-base uppercase tracking-wide`,children:O(o.name)}),o.description&&(0,K.jsx)(le,{className:`text-xs leading-relaxed text-foreground/88`,children:o.description}),(0,K.jsxs)(`div`,{className:`mt-2 flex flex-wrap items-center gap-2`,children:[(0,K.jsxs)(h,{variant:`outline`,className:`font-mono text-xs`,children:[v,` members`]}),(0,K.jsxs)(h,{variant:`outline`,className:`font-mono text-xs`,children:[y,` methods`]}),(0,K.jsxs)(h,{variant:`outline`,className:`font-mono text-xs`,children:[o.faults.length,` faults`]}),o.lifecycle&&(0,K.jsxs)(h,{variant:`outline`,className:`font-mono text-xs text-primary`,children:[o.lifecycle.stages.length,`-stage lifecycle`]})]})]}),(0,K.jsxs)(te,{defaultValue:`overview`,className:`flex min-h-0 flex-1 flex-col gap-1 pt-0`,children:[(0,K.jsxs)(ee,{variant:`line`,className:`h-8! shrink-0 gap-0.5 border-b-border/60 px-2 py-0.5`,children:[(0,K.jsx)(F,{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,K.jsx)(F,{value:`export`,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:`Export`})]}),(0,K.jsx)(I,{value:`overview`,keepMounted:!0,className:`flex min-h-0 flex-1 flex-col`,children:(0,K.jsx)(`div`,{className:`flex min-h-0 flex-1 flex-col px-3 pt-0`,children:(0,K.jsx)(`div`,{className:`min-h-0 flex-1 overflow-y-auto pr-2`,children:(0,K.jsxs)(`div`,{className:`flex flex-col gap-1.5 pb-1 pt-0.5`,children:[g.map(e=>(0,K.jsx)(q,{sectionKey:e.key,label:e.label,count:e.members.length,icon:e.icon,accentClass:e.accentClass,expanded:n.has(e.key),onToggle:_,children:(0,K.jsx)(`div`,{className:`flex flex-col gap-1`,children:e.members.map(e=>(0,K.jsx)(Te,{member:e},e.name))})},e.key)),o.faults.length>0&&(0,K.jsx)(q,{sectionKey:`faults`,label:`Faults`,count:o.faults.length,icon:(0,K.jsx)(V,{className:`size-3`}),accentClass:`text-warning`,expanded:n.has(`faults`),onToggle:_,children:(0,K.jsx)(`div`,{className:`flex flex-wrap gap-1.5`,children:o.faults.map(e=>(0,K.jsx)(h,{variant:`secondary`,className:`text-[10px] text-warning`,children:E(e)},e))})}),o.lifecycle&&(0,K.jsx)(q,{sectionKey:`lifecycle`,label:`Lifecycle`,count:o.lifecycle.stages.length,icon:(0,K.jsx)(_e,{className:`size-3`}),accentClass:`text-primary`,expanded:n.has(`lifecycle`),onToggle:_,children:(0,K.jsx)(Ee,{lifecycle:o.lifecycle})}),y>0&&(0,K.jsx)(q,{sectionKey:`methods`,label:`Methods`,count:y,icon:(0,K.jsx)(xe,{className:`size-3`}),accentClass:`text-info`,expanded:n.has(`methods`),onToggle:_,children:(0,K.jsx)(`div`,{className:`flex flex-col gap-1.5`,children:Object.entries(o.methods).map(([e,t])=>(0,K.jsx)(De,{name:e,method:t},e))})})]})})})}),(0,K.jsx)(I,{value:`export`,keepMounted:!0,className:`flex min-h-0 flex-1 flex-col`,children:(0,K.jsx)(`div`,{className:`flex min-h-0 flex-1 flex-col px-3 pt-0`,children:(0,K.jsx)(de,{kind:`model`,id:o.name,yamlPath:`/catalog/models/${o.name}/yaml`,yamlFilename:`${o.name}.asset.yaml`})})})]})]},o.name):(0,K.jsx)(`div`,{className:`flex flex-1 items-center justify-center text-sm text-muted-foreground`,children:`Model not found`})})})}function q({sectionKey:e,label:t,count:n,icon:r,accentClass:i,expanded:a,onToggle:o,children:s}){return(0,K.jsxs)(`div`,{className:`rounded-[var(--miravo-radius-tight)] border border-border/50`,children:[(0,K.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,K.jsx)(`span`,{className:i,children:r}),(0,K.jsx)(`span`,{className:`uppercase tracking-wider`,children:t}),(0,K.jsx)(h,{variant:`secondary`,className:`ml-auto text-[10px]`,children:n}),(0,K.jsx)(N,{className:`size-3 text-muted-foreground transition-transform ${a?`rotate-180`:``}`})]}),(0,K.jsx)(g,{initial:!1,children:a&&(0,K.jsx)(m.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,K.jsx)(`div`,{className:`border-t px-2.5 py-1.5`,children:s})},`content`)})]})}function Te({member:e}){return(0,K.jsxs)(`div`,{className:`flex flex-wrap items-center gap-x-2 gap-y-0.5 py-0.5 text-xs`,children:[(0,K.jsx)(`span`,{title:e.name,className:`min-w-0 truncate font-mono text-foreground`,children:T(e.name)}),(0,K.jsx)(`span`,{className:`text-muted-foreground`,children:e.dataType}),e.unit&&(0,K.jsx)(h,{variant:`outline`,className:`px-1 py-0 text-[10px]`,children:e.unit}),e.euRange&&(0,K.jsxs)(`span`,{className:`ml-auto font-mono text-xs text-muted-foreground`,children:[`[`,e.euRange[0],`–`,e.euRange[1],`]`]})]})}var J={healthy:`bg-success`,normal:`bg-success`,degraded:`bg-warning`,critical:`bg-destructive`,failed:`bg-destructive`};function Ee({lifecycle:e}){let t=e.stages.length;return(0,K.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,K.jsx)(`div`,{className:`flex h-2.5 w-full overflow-hidden rounded-full bg-muted`,children:e.stages.map((e,n)=>(0,K.jsx)(`div`,{className:`transition-[background-color] ${J[e]??`bg-chart-1`} ${n===0?`rounded-l-full`:``} ${n===t-1?`rounded-r-full`:``}`,style:{width:`${100/t}%`}},`${e}-${n}`))}),(0,K.jsx)(`div`,{className:`flex items-center gap-3`,children:e.stages.map((e,t)=>(0,K.jsxs)(`div`,{className:`flex items-center gap-1.5 text-xs`,children:[(0,K.jsx)(`span`,{className:`size-2 rounded-full ${J[e]??`bg-chart-1`}`}),(0,K.jsx)(`span`,{className:`text-muted-foreground`,children:E(e)})]},`${e}-${t}`))}),(0,K.jsxs)(`span`,{className:`font-mono text-xs text-muted-foreground`,children:[`~`,D(e.totalHours),` total hours`]})]})}function De({name:e,method:t}){return(0,K.jsxs)(`div`,{className:`flex flex-col gap-0.5`,children:[(0,K.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,K.jsx)(`span`,{className:`font-mono text-xs text-foreground`,children:e}),t.inputArguments.length>0&&(0,K.jsxs)(`span`,{className:`text-xs text-muted-foreground`,children:[`(`,t.inputArguments.map(e=>`${e.name}: ${e.dataType}`).join(`, `),`)`]})]}),t.description&&(0,K.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:t.description})]})}var Y=[{value:`mqtt`,label:`MQTT`},{value:`opcua`,label:`OPC UA`},{value:`modbus`,label:`Modbus`}];function Oe({value:e,onChange:t,className:n}){let r=(0,G.useId)(),i=new Set(e),a=l(e=>e.availableAdapters),o=Y.filter(e=>i.has(e.value)&&a.some(t=>t.name===e.value&&!t.enabled));return(0,K.jsxs)(`fieldset`,{className:j(`min-w-0`,n),children:[(0,K.jsx)(`legend`,{className:`mb-2 text-xs font-medium text-foreground`,children:`Protocol exposure`}),(0,K.jsx)(`div`,{className:`grid min-w-0 gap-2 sm:grid-cols-3`,children:Y.map(n=>(0,K.jsxs)(H,{htmlFor:`${r}-${n.value}`,className:`min-w-0 rounded-[var(--miravo-radius-tight)] border border-border/80 px-2.5 py-2 text-xs`,children:[(0,K.jsx)(ge,{id:`${r}-${n.value}`,checked:i.has(n.value),onCheckedChange:r=>{let i=e.filter(e=>e!==n.value);r===!0&&i.push(n.value),t(i)}}),(0,K.jsx)(`span`,{children:n.label})]},n.value))}),(0,K.jsx)(`p`,{className:`mt-2 text-[11px] text-muted-foreground`,children:e.length>0?`${e.length} selected`:`Default: enabled adapters`}),o.length>0&&(0,K.jsxs)(`p`,{role:`status`,className:`mt-1 text-[11px] text-warning`,children:[`Spawning will also enable the `,o.map(e=>e.label).join(`, `),` `,o.length===1?`adapter`:`adapters`,` and open`,` `,o.length===1?`its port`:`their ports`,`.`]})]})}function ke(e,t){let[n,r]=(0,G.useState)(e);return(0,G.useEffect)(()=>{let n=setTimeout(()=>r(e),t);return()=>clearTimeout(n)},[e,t]),n}function X(e){let t=e.trim();return t===``?{}:r(t)===null?{assetPrefix:t}:{assetName:t}}function Ae(e){return e.settled&&e.isSuccess&&!e.isFetching?e.data??null:null}var je=300;function Me(e){return e instanceof s?e.result.error?`${e.result.message} ${e.result.error}`:e.message:e instanceof Error?e.message:`Could not preview the spawn.`}function Z({modelName:e,count:t,onClose:n}){let[r,a]=(0,G.useState)(``),[s,c]=(0,G.useState)([]),[p,m]=(0,G.useState)(!1),h=he(),g=l(e=>e.assets.map(e=>e.id).join(`,`)),T=d();(0,G.useEffect)(()=>{T.invalidateQueries({queryKey:u.spawnPreviewAll})},[g,T]),(0,G.useEffect)(()=>{e!==null&&(a(``),c([]))},[e]);let E=i(r),D=ke(r,je),A=X(D),M=D===r,N=f({queryKey:u.spawnPreview(e??``,t,D.trim(),s.join(`,`)),queryFn:async()=>{let n=await o({type:`spawn`,model:e??``,count:t,dryRun:!0,...A,...s.length>0?{protocolScope:s}:{}});return Array.isArray(n.data)?n.data:[]},enabled:e!==null&&i(D)===null,retry:!1,gcTime:0,staleTime:0}),P=E??(M&&N.isError?Me(N.error):null),F=Ae({settled:M,...N}),I=async()=>{if(e===null)return;let i=X(r);m(!0);try{await h.mutateAsync({type:`spawn`,model:e,count:t,...i,...s.length>0?{protocolScope:s}:{}}),n()}catch{}finally{m(!1)}};return(0,K.jsx)(S,{open:e!==null,onOpenChange:e=>{e||n()},children:(0,K.jsxs)(y,{className:`min-w-0 sm:max-w-md`,children:[(0,K.jsxs)(_,{children:[(0,K.jsx)(b,{children:`Spawn assets?`}),(0,K.jsx)(x,{children:e!==null&&(0,K.jsxs)(K.Fragment,{children:[`This spawns `,t,` asset`,t===1?``:`s`,` of`,` `,(0,K.jsx)(`span`,{className:`font-medium text-foreground`,children:O(e)}),` `,`into the running factory.`]})})]}),(0,K.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-3`,children:[(0,K.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-2`,children:[(0,K.jsx)(H,{htmlFor:`spawn-asset-target`,className:`text-xs font-medium text-foreground`,children:`ID or prefix`}),(0,K.jsx)(w,{id:`spawn-asset-target`,value:r,maxLength:120,onChange:e=>a(e.target.value),placeholder:`Default`,className:j(`min-w-0 font-mono text-xs`,P&&`border-destructive`),"aria-invalid":P!=null,"aria-describedby":`spawn-asset-target-hint spawn-asset-target-preview`}),(0,K.jsx)(`p`,{id:`spawn-asset-target-hint`,className:`min-w-0 wrap-break-word text-[11px] text-muted-foreground`,children:`A name ending in a number (pump-007) is an exact ID and needs a count of 1. Anything else is a prefix (pump gives pump-001, pump-002).`}),(0,K.jsx)(`p`,{id:`spawn-asset-target-preview`,role:`status`,className:j(`min-w-0 wrap-break-word text-[11px]`,P?`text-destructive`:`text-muted-foreground`),children:P??(F===null?`Checking IDs...`:(0,K.jsxs)(K.Fragment,{children:[`Will likely create`,` `,(0,K.jsx)(`span`,{className:`break-all font-mono text-foreground`,children:k(F)})]}))})]}),(0,K.jsx)(Oe,{value:s,onChange:c})]}),(0,K.jsxs)(v,{children:[(0,K.jsx)(C,{variant:`outline`,disabled:p,onClick:n,children:`Cancel`}),(0,K.jsx)(C,{disabled:p||e===null||E!=null||F===null,onClick:()=>void I(),children:p?`Spawning...`:`Spawn`})]})]})})}var Q=[`builtin`,`personal`];function Ne(){let[e,t]=(0,G.useState)(``),[n,r]=(0,G.useState)(`all`),[i,o]=(0,G.useState)({}),[s,l]=(0,G.useState)(null),[d,_]=(0,G.useState)(null),v=(0,G.useRef)(null);(0,G.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(),v.current?.focus())};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[]);let y=f({queryKey:u.catalog.models(),queryFn:()=>c(`/catalog/models`,a.catalogModels)}),b=y.data??[],x=y.isPending&&!y.data,S=y.isError&&!y.data,C=y.isError&&!!y.data,T=U(y.error,`Failed to load models.`),E=e=>i[e]??1,D=(0,G.useCallback)((e,t)=>{o(n=>({...n,[e]:Math.max(1,Math.min(10,t))}))},[]),O=(0,G.useCallback)(e=>{_(e)},[]),k=(0,G.useCallback)(e=>{l(e)},[]),A=(0,G.useMemo)(()=>{let e={all:b.length};for(let t of Q)e[t]=0;for(let t of b){let n=z(t.source);e[n]=(e[n]??0)+1}return e},[b]),M=e.toLowerCase(),N=b.filter(e=>n===`all`||z(e.source)===n).filter(e=>M?e.name.toLowerCase().includes(M)||(e.description?.toLowerCase().includes(M)??!1):!0);return(0,K.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,K.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,K.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,K.jsx)(`h1`,{className:`font-heading text-2xl font-semibold tracking-tight`,children:`Asset Model Library`}),(0,K.jsx)(h,{variant:`outline`,className:`text-xs`,children:S?(0,K.jsx)(`span`,{className:`text-destructive`,children:`Unavailable`}):x&&b.length===0?(0,K.jsx)(K.Fragment,{children:`Loading...`}):(0,K.jsxs)(K.Fragment,{children:[b.length,` models`]})})]}),(0,K.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`Canonical asset models with realistic physics, lifecycle degradation, and fault modes. Inspect to explore schema, copy YAML, or export.`})]}),S&&(0,K.jsx)(p,{message:T,onRetry:()=>void y.refetch(),isRetrying:y.isFetching}),C&&(0,K.jsx)(p,{message:`${T} Showing cached models.`,onRetry:()=>void y.refetch(),isRetrying:y.isFetching}),!S&&(0,K.jsxs)(`div`,{className:`flex flex-wrap items-center gap-3`,children:[(0,K.jsxs)(`div`,{className:`relative max-w-xs flex-1 min-w-[14rem]`,children:[(0,K.jsx)(ie,{className:`absolute left-2.5 top-2.5 size-4 text-muted-foreground`}),(0,K.jsx)(w,{ref:v,placeholder:`Filter models...`,value:e,onChange:e=>t(e.target.value),className:`pl-9 pr-7`}),!e&&(0,K.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,K.jsx)(Fe,{value:n,counts:A,onChange:r})]}),(0,K.jsx)(`div`,{className:`grid grid-cols-1 gap-4 @[720px]/models:grid-cols-2 @[1120px]/models:grid-cols-3`,"aria-busy":x&&!S,children:S?null:(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(g,{children:N.map((e,t)=>(0,K.jsx)(m.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,K.jsx)(Pe,{model:e,count:E(e.name),onCountChange:D,onInspect:O,onSpawn:k})},e.name))}),N.length===0&&b.length>0&&(0,K.jsx)(`p`,{className:`col-span-full py-8 text-center text-sm text-muted-foreground`,children:`No models match the current filters.`})]})}),b.length>0&&(0,K.jsx)(`div`,{className:j(fe,`p-0`),children:(0,K.jsx)(`div`,{className:`community-teaser relative overflow-hidden rounded-[inherit]`,children:(0,K.jsx)(`div`,{className:`relative z-10 mx-auto max-w-3xl px-5 py-10 sm:px-10 sm:py-12`,children:(0,K.jsxs)(`div`,{className:`grid items-center gap-10 lg:grid-cols-[minmax(0,1fr)_minmax(0,17rem)]`,children:[(0,K.jsxs)(`div`,{className:`order-2 flex min-w-0 flex-col gap-4 lg:order-1`,children:[(0,K.jsxs)(`div`,{className:`flex flex-wrap items-baseline gap-x-3 gap-y-1`,children:[(0,K.jsx)(`p`,{className:`blueprint-title text-primary`,children:`Future channel`}),(0,K.jsx)(`span`,{className:`blueprint-stat text-[10px] text-muted-foreground`,children:`MIRAVO_REGISTRY · NOT_CONNECTED`})]}),(0,K.jsx)(`h2`,{className:`font-heading text-xl font-semibold tracking-tight sm:text-2xl`,children:`Community Models`}),(0,K.jsx)(`p`,{className:`max-w-xl text-sm leading-relaxed text-muted-foreground`,children:`Publish your custom asset models to the Miravo registry. Discover equipment models from other engineers, fork them, and adapt parameters for your use case.`}),(0,K.jsx)(`div`,{children:(0,K.jsx)(h,{variant:`outline`,className:`community-teaser-soon border-primary/35 bg-primary/5 text-[10px] text-primary`,children:`Coming Soon`})})]}),(0,K.jsx)(`div`,{className:`order-1 flex justify-center lg:order-2 lg:justify-end`,children:(0,K.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,K.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,K.jsx)(re,{className:`size-9 text-primary`,"aria-hidden":!0})}),(0,K.jsx)(`span`,{className:`blueprint-stat relative z-[1] text-[9px] tracking-[0.18em] text-muted-foreground`,children:`AWAITING SIGNAL`}),(0,K.jsx)(`span`,{className:`blueprint-stat relative z-[1] text-[9px] text-muted-foreground`,children:`Uplink idle`})]})})]})})})}),(0,K.jsx)(Z,{modelName:s,count:s===null?1:E(s),onClose:()=>l(null)}),(0,K.jsx)(we,{modelName:d,onClose:()=>_(null)})]})}var Pe=(0,G.memo)(function({model:e,count:t,onCountChange:n,onInspect:r,onSpawn:i}){return(0,K.jsxs)(`div`,{className:j(me,`flex flex-col gap-4 p-5`),children:[(0,K.jsxs)(`div`,{className:`flex items-start gap-3`,children:[(0,K.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,K.jsx)(W,{className:`size-4`})}),(0,K.jsxs)(`div`,{className:`min-w-0 flex flex-col gap-0.5`,children:[(0,K.jsx)(`span`,{className:`font-heading text-sm font-semibold uppercase tracking-wide`,children:O(e.name)}),e.description&&(0,K.jsx)(`span`,{className:`line-clamp-2 text-xs leading-relaxed text-muted-foreground`,children:e.description})]})]}),(0,K.jsxs)(`div`,{className:`flex flex-wrap items-center gap-x-3 gap-y-1 font-mono text-[11px] text-muted-foreground`,children:[(0,K.jsx)($,{label:`mbr`,value:e.memberCount}),(0,K.jsx)($,{label:`mth`,value:e.methodCount}),(0,K.jsx)($,{label:`flt`,value:e.faultCount}),e.hasLifecycle&&(0,K.jsxs)(`span`,{className:`flex items-center gap-1 text-primary`,children:[(0,K.jsx)(`span`,{className:`text-[10px]`,children:`◈`}),(0,K.jsxs)(`span`,{children:[e.lifecycleStageCount,`-stage`]})]}),(0,K.jsx)(h,{variant:`outline`,className:j(`ml-auto shrink-0 font-sans text-[10px] font-medium uppercase tracking-wide`,ae(e.source)),children:R(e.source)})]}),(0,K.jsxs)(`div`,{className:`mt-auto flex items-center gap-2 border-t border-border/30 pt-3`,children:[(0,K.jsxs)(`div`,{className:`flex items-center rounded-[var(--miravo-radius-tight)] border bg-muted/30`,children:[(0,K.jsx)(C,{variant:`ghost`,size:`icon`,className:`size-7 rounded-none rounded-l-md`,disabled:t<=1,"aria-label":`Decrease count`,onClick:r=>{r.stopPropagation(),n(e.name,t-1)},children:(0,K.jsx)(ye,{className:`size-3`})}),(0,K.jsx)(`span`,{className:`flex size-7 items-center justify-center border-x font-mono text-xs`,children:t}),(0,K.jsx)(C,{variant:`ghost`,size:`icon`,className:`size-7 rounded-none rounded-r-md`,disabled:t>=10,"aria-label":`Increase count`,onClick:r=>{r.stopPropagation(),n(e.name,t+1)},children:(0,K.jsx)(ne,{className:`size-3`})})]}),(0,K.jsxs)(C,{type:`button`,variant:`outline`,size:`sm`,onClick:()=>r(e.name),className:pe,children:[(0,K.jsx)(P,{className:`size-3.5`,"aria-hidden":!0}),`Inspect`]}),(0,K.jsxs)(C,{size:`sm`,className:`ml-auto`,onClick:()=>i(e.name),children:[(0,K.jsx)(L,{className:`mr-1 size-3`}),`Spawn`]})]})]})});function $({label:e,value:t}){return(0,K.jsxs)(`span`,{children:[(0,K.jsx)(`span`,{className:`text-foreground`,children:t}),` `,(0,K.jsx)(`span`,{className:`text-muted-foreground`,children:e})]})}function Fe({value:e,counts:t,onChange:n}){return(0,K.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,K.jsxs)(`label`,{className:j(`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,K.jsx)(`input`,{type:`radio`,name:`models-source-filter`,value:r.id,checked:i,disabled:o,onChange:()=>n(r.id),className:`sr-only`}),(0,K.jsx)(`span`,{children:r.label}),(0,K.jsx)(`span`,{className:`font-mono text-[10px] text-foreground`,children:a})]},r.id)})})}export{W as n,Ne as t};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{ot as e}from"./vendor-ui-D8j69UH4.js";import{n as t,s as n}from"./chunk-OE4NN4TA-Q4iNR9l9.js";import{n as r}from"./utils-BO2u-wC_.js";import{t as i}from"./triangle-alert-D1AraFcP.js";import{n as a}from"./auth-screen-backdrop-hcEYy3K4.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 Factory`]}),(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};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{n as e}from"./utils-BO2u-wC_.js";var t=e(`play`,[[`path`,{d:`M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z`,key:`10ikf1`}]]);export{t};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{n as e}from"./utils-BO2u-wC_.js";var t=e(`plus`,[[`path`,{d:`M5 12h14`,key:`1ays0h`}],[`path`,{d:`M12 5v14`,key:`s699le`}]]);export{t};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as e}from"./rolldown-runtime-COnpUsM8.js";import{c as t}from"./vendor-charts-95ykyDlI.js";import{ot as n}from"./vendor-ui-D8j69UH4.js";import{F as r,I as i,P as a}from"./api-kPM52mb-.js";import{n as o,t as s}from"./badge-D4jktT8T.js";import{t as c}from"./AnimatePresence-BZCmb1bq.js";import{C as l,S as u,l as d}from"./format-OUFL_tef.js";import{n as f,t as p}from"./utils-BO2u-wC_.js";import{t as m}from"./activity-Cn48I9qe.js";import{r as h,t as g}from"./server-CS2Tw__K.js";import{t as _}from"./chevron-down-CAk5w9Wt.js";import{n as v,t as y}from"./circle-x-CGcRflg7.js";import{t as b}from"./copy-button-DHm7RGJ5.js";import{a as x}from"./tabs-bI9sskHy.js";import{t as S}from"./radio-DRkzblxj.js";import{t as C}from"./triangle-alert-D1AraFcP.js";import{t as w}from"./transition-nav-link-cn4KZD6W.js";import{t as T}from"./label-DWyy9MeT.js";import{a as E,t as D}from"./use-engine-command-mutation-DMkQxmt9.js";var O=e(t(),1),k=e=>Symbol.iterator in e,A=e=>`entries`in e,j=(e,t)=>{let n=e instanceof Map?e:new Map(e.entries()),r=t instanceof Map?t:new Map(t.entries());if(n.size!==r.size)return!1;for(let[e,t]of n)if(!r.has(e)||!Object.is(t,r.get(e)))return!1;return!0},M=(e,t)=>{let n=e[Symbol.iterator](),r=t[Symbol.iterator](),i=n.next(),a=r.next();for(;!i.done&&!a.done;){if(!Object.is(i.value,a.value))return!1;i=n.next(),a=r.next()}return!!i.done&&!!a.done};function N(e,t){return Object.is(e,t)?!0:typeof e!=`object`||!e||typeof t!=`object`||!t||Object.getPrototypeOf(e)!==Object.getPrototypeOf(t)?!1:k(e)&&k(t)?A(e)&&A(t)?j(e,t):M(e,t):j({entries:()=>Object.entries(e)},{entries:()=>Object.entries(t)})}function P(e){let t=O.useRef(void 0);return n=>{let r=e(n);return N(t.current,r)?t.current:t.current=r}}var F=f(`circle`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}]]),I=f(`cpu`,[[`path`,{d:`M12 20v2`,key:`1lh1kg`}],[`path`,{d:`M12 2v2`,key:`tus03m`}],[`path`,{d:`M17 20v2`,key:`1rnc9c`}],[`path`,{d:`M17 2v2`,key:`11trls`}],[`path`,{d:`M2 12h2`,key:`1t8f8n`}],[`path`,{d:`M2 17h2`,key:`7oei6x`}],[`path`,{d:`M2 7h2`,key:`asdhe0`}],[`path`,{d:`M20 12h2`,key:`1q8mjw`}],[`path`,{d:`M20 17h2`,key:`1fpfkl`}],[`path`,{d:`M20 7h2`,key:`1o8tra`}],[`path`,{d:`M7 20v2`,key:`4gnj0m`}],[`path`,{d:`M7 2v2`,key:`1i4yhu`}],[`rect`,{x:`4`,y:`4`,width:`16`,height:`16`,rx:`2`,key:`1vbyd7`}],[`rect`,{x:`8`,y:`8`,width:`8`,height:`8`,rx:`1`,key:`z9xiuo`}]]),L=f(`power-off`,[[`path`,{d:`M18.36 6.64A9 9 0 0 1 20.77 15`,key:`dxknvb`}],[`path`,{d:`M6.16 6.16a9 9 0 1 0 12.68 12.68`,key:`1x7qb5`}],[`path`,{d:`M12 2v4`,key:`3427ic`}],[`path`,{d:`m2 2 20 20`,key:`1ooewy`}]]),R=f(`power`,[[`path`,{d:`M12 2v10`,key:`mnfbl`}],[`path`,{d:`M18.4 6.6a9 9 0 1 1-12.77.04`,key:`obofu9`}]]),z=n(),B=`inline-flex items-center gap-1 rounded-[var(--miravo-radius-tight)] outline-none transition-colors hover:text-foreground focus-visible:ring-2 focus-visible:ring-ring`,V={live:`bg-success shadow-[0_0_0_1px_color-mix(in_srgb,var(--success)_50%,transparent),0_0_12px_color-mix(in_srgb,var(--success)_42%,transparent)]`,idle:`bg-warning/85 shadow-[0_0_0_1px_color-mix(in_srgb,var(--warning)_50%,transparent),0_0_12px_color-mix(in_srgb,var(--warning)_38%,transparent)]`,fault:`bg-destructive shadow-[0_0_0_1px_color-mix(in_srgb,var(--destructive)_50%,transparent),0_0_12px_color-mix(in_srgb,var(--destructive)_38%,transparent)]`,off:`bg-muted-foreground/55`};function H({tone:e,children:t,className:n}){return(0,z.jsxs)(`div`,{className:p(`flex shrink-0 items-center gap-2 rounded-[var(--miravo-radius-pill)] border border-border/60 bg-background/60 px-2.5 py-1 backdrop-blur-sm`,n),children:[(0,z.jsxs)(`span`,{className:`relative flex size-1.5 items-center justify-center`,children:[(0,z.jsx)(`span`,{className:p(`size-1.5 rounded-full`,V[e])}),e===`live`&&(0,z.jsx)(`span`,{className:`absolute inset-0 animate-ping rounded-full bg-success/60`})]}),(0,z.jsx)(`span`,{className:`text-[11px] leading-none text-muted-foreground`,children:t})]})}function U({children:e}){return(0,z.jsx)(`span`,{className:`text-[10px] uppercase tracking-[0.14em]`,children:e})}function W({icon:e,title:t,description:n,aside:r,footer:i,children:a,id:o,className:s,bodyClassName:c}){return(0,z.jsxs)(`section`,{id:o,tabIndex:o?-1:void 0,"aria-label":typeof t==`string`?t:void 0,className:p(E,`flex min-w-0 scroll-mt-4 flex-col outline-none hover:border-border`,s),children:[(0,z.jsxs)(`header`,{className:`flex items-start justify-between gap-3 border-b border-border/60 px-4 py-3`,children:[(0,z.jsxs)(`div`,{className:`flex min-w-0 items-start gap-3`,children:[(0,z.jsx)(`div`,{className:`mt-0.5 flex size-7 shrink-0 items-center justify-center rounded-[var(--miravo-radius-tight)] border border-border/60 bg-background/70 text-muted-foreground`,"aria-hidden":!0,children:(0,z.jsx)(e,{className:`size-3.5`})}),(0,z.jsxs)(`div`,{className:`min-w-0`,children:[(0,z.jsx)(`h2`,{className:`font-heading text-sm font-semibold tracking-tight text-foreground`,children:t}),n?(0,z.jsx)(`p`,{className:`mt-0.5 text-pretty text-xs text-muted-foreground`,children:n}):null]})]}),r?(0,z.jsx)(`div`,{className:`flex shrink-0 items-center gap-2`,children:r}):null]}),a===void 0?null:(0,z.jsx)(`div`,{className:p(`flex min-w-0 flex-col px-4 py-4`,c),children:a}),i?(0,z.jsx)(`div`,{className:`mt-auto flex min-w-0 flex-wrap items-center gap-x-4 gap-y-2 border-t border-border/60 bg-background/40 px-4 py-2.5 text-xs text-muted-foreground`,children:i}):null]})}var G={mqtt:S,opcua:g,modbus:I},K={mqtt:`MQTT`,opcua:`OPC UA`,modbus:`Modbus TCP`},q={mqtt:r,opcua:i,modbus:a};function J({adapter:e}){let t=e.pending?`pending`:e.enabled?`enabled`:`disabled`;return(0,z.jsx)(c,{mode:`wait`,initial:!1,children:(0,z.jsx)(o.div,{initial:{opacity:0,scale:.8},animate:{opacity:1,scale:1},exit:{opacity:0,scale:.8},transition:{type:`spring`,stiffness:500,damping:30},children:e.pending?(0,z.jsxs)(s,{className:`gap-1 bg-info/20 text-info hover:bg-info/20`,children:[(0,z.jsx)(x,{className:`size-3 animate-spin`}),e.enabled?`Disabling...`:`Enabling...`]}):e.enabled?(0,z.jsxs)(s,{className:`gap-1 bg-success/20 text-success hover:bg-success/20`,children:[(0,z.jsx)(v,{className:`size-3`}),`Enabled`]}):(0,z.jsxs)(s,{variant:`outline`,className:`gap-1 text-muted-foreground`,children:[(0,z.jsx)(F,{className:`size-2`}),`Disabled`]})},t)})}function Y({metrics:e}){return e?e.connected?null:(0,z.jsxs)(s,{variant:`destructive`,className:`gap-1`,children:[(0,z.jsx)(y,{className:`size-3`}),`Disconnected`]}):null}function X({health:e}){if(!e)return null;let t={healthy:`bg-success/20 text-success hover:bg-success/20`,busy:`bg-warning/20 text-warning hover:bg-warning/20`,saturated:`bg-destructive/20 text-destructive hover:bg-destructive/20`},n=e.state,r=`size-3 shrink-0`,i=n===`healthy`?(0,z.jsx)(v,{className:r,"aria-hidden":!0}):n===`busy`?(0,z.jsx)(m,{className:r,"aria-hidden":!0}):n===`saturated`?(0,z.jsx)(C,{className:r,"aria-hidden":!0}):null;return(0,z.jsxs)(s,{className:p(`gap-1`,t[n]??``),children:[i,n]})}function Z({label:e,value:t,valueClassName:n}){return(0,z.jsxs)(`div`,{className:`flex min-h-[3.35rem] flex-col justify-center rounded-[var(--miravo-radius-stadium-sm)] border border-border/55 px-3 py-2 transition-colors hover:border-muted-foreground/25`,children:[(0,z.jsx)(`span`,{className:`blueprint-title text-[10px] leading-tight text-muted-foreground`,children:e}),(0,z.jsx)(`span`,{className:p(`mt-1.5 font-mono text-[13px] leading-none tabular-nums tracking-tight text-foreground`,n),children:t})]})}function Q({metrics:e}){return(0,z.jsxs)(`div`,{className:`grid grid-cols-2 gap-2 sm:grid-cols-3`,children:[(0,z.jsx)(Z,{label:`Messages sent`,value:d(e.messagesPublished)}),(0,z.jsx)(Z,{label:`Attempted`,value:d(e.messagesAttempted)}),(0,z.jsx)(Z,{label:`Skipped (unchanged)`,value:d(e.messagesFiltered)}),(0,z.jsx)(Z,{label:`Errors`,value:d(e.errorsCount),valueClassName:e.errorsCount>0?`text-destructive`:void 0}),(0,z.jsx)(Z,{label:`Publish latency`,value:`${e.lastPublishMs.toFixed(1)} ms`}),e.health?(0,z.jsx)(Z,{label:`Queued messages`,value:String(e.health.pendingWorkCount)}):null]})}function $({port:e}){return(0,z.jsxs)(`div`,{className:`flex gap-2 rounded-[var(--miravo-radius-stadium-sm)] border border-warning/30 bg-warning/10 p-3 text-sm text-warning`,children:[(0,z.jsx)(C,{className:`mt-0.5 size-4 shrink-0`}),(0,z.jsxs)(`div`,{children:[(0,z.jsx)(`p`,{className:`font-medium`,children:`Before enabling`}),(0,z.jsxs)(`p`,{className:`mt-1 text-warning`,children:[`Ensure port `,(0,z.jsx)(`code`,{className:`font-mono font-bold`,children:e}),` is available on the host.`]}),(0,z.jsxs)(`ul`,{className:`mt-1 list-inside list-disc space-y-0.5 text-warning`,children:[(0,z.jsxs)(`li`,{children:[(0,z.jsx)(`strong`,{children:`Docker:`}),` Restart with`,` `,(0,z.jsxs)(`code`,{className:`font-mono`,children:[`-p `,e,`:`,e]}),` `,`to expose the port.`]}),(0,z.jsxs)(`li`,{children:[(0,z.jsx)(`strong`,{children:`Bare metal:`}),` Run `,(0,z.jsxs)(`code`,{className:`font-mono`,children:[`lsof -i :`,e]}),` to check availability.`]})]})]})]})}function ee({adapter:e,metrics:t}){let[n,r]=(0,O.useState)(!1),[i,a]=(0,O.useState)(``),[f,p]=(0,O.useState)(!1),m=D(),y=G[e.name]??g,S=K[e.name]??e.name,C=q[e.name]??0,E=f||e.pending===!0,k=(0,O.useMemo)(()=>{let t=e.config?.port;return typeof t==`number`?t:C},[e.config,C]);return(0,z.jsxs)(`div`,{className:`protocol-card-art min-w-0 border`,children:[(0,z.jsxs)(`div`,{className:`relative z-2`,children:[(0,z.jsxs)(`button`,{type:`button`,"aria-expanded":n,className:`group/row flex w-full min-w-0 cursor-pointer gap-3 px-4 py-3 text-left transition-colors duration-[var(--miravo-duration-base)] ease-[var(--miravo-ease)] hover:bg-muted/35`,onClick:()=>r(!n),children:[(0,z.jsx)(y,{className:`mt-0.5 size-5 shrink-0 text-muted-foreground transition-[transform,color] duration-[var(--miravo-duration-base)] ease-[var(--miravo-ease)] group-hover/row:-rotate-[8deg] group-hover/row:scale-[1.08] group-hover/row:text-primary motion-reduce:transition-none motion-reduce:group-hover/row:rotate-0 motion-reduce:group-hover/row:scale-100`,"aria-hidden":!0}),(0,z.jsx)(`div`,{className:`flex min-w-0 flex-1 flex-col gap-1.5`,children:(0,z.jsxs)(`div`,{className:`flex w-full min-w-0 flex-wrap items-start justify-between gap-x-3 gap-y-2`,children:[(0,z.jsxs)(`div`,{className:`flex min-w-0 flex-wrap items-center gap-2`,children:[e.enabled&&!e.pending&&(0,z.jsx)(`span`,{className:`protocol-card-live-dot`,"aria-hidden":!0}),(0,z.jsx)(`span`,{className:`whitespace-nowrap font-medium tracking-tight`,children:S}),(0,z.jsx)(J,{adapter:e}),e.enabled&&!e.pending&&t&&(0,z.jsxs)(z.Fragment,{children:[(0,z.jsx)(Y,{metrics:t}),t.health?(0,z.jsx)(X,{health:t.health}):(0,z.jsxs)(s,{className:`gap-1 bg-success/20 text-success hover:bg-success/20`,children:[(0,z.jsx)(v,{className:`size-3 shrink-0`,"aria-hidden":!0}),`healthy`]})]})]}),(0,z.jsxs)(`div`,{className:`flex shrink-0 items-center gap-2`,children:[e.enabled&&t&&!e.pending&&(0,z.jsxs)(`span`,{className:`protocol-card-metric-readout text-muted-foreground`,children:[(0,z.jsx)(`span`,{className:`text-[10px] font-normal uppercase tracking-[0.12em] text-muted-foreground`,children:`out`}),` `,(0,z.jsx)(`span`,{className:`text-foreground`,children:d(t.messagesPublished)}),(0,z.jsx)(`span`,{className:`text-muted-foreground`,children:` msgs`}),t.errorsCount>0&&(0,z.jsxs)(`span`,{className:`ml-1.5 text-destructive`,children:[t.errorsCount,` err`]})]}),(0,z.jsx)(_,{className:`size-4 shrink-0 text-muted-foreground transition-[transform,color] duration-[var(--miravo-duration-base)] ease-[var(--miravo-ease)] group-hover/row:translate-y-0.5 group-hover/row:text-primary motion-reduce:transition-none motion-reduce:group-hover/row:translate-y-0 ${n?`rotate-180`:``}`})]})]})})]}),e.enabled&&!e.pending&&e.endpoint&&(0,z.jsxs)(`div`,{className:`flex min-w-0 items-center gap-1 px-4 pb-2 pl-11`,children:[(0,z.jsx)(`code`,{className:`min-w-0 truncate font-mono text-xs text-muted-foreground`,children:e.endpoint}),(0,z.jsx)(b,{value:e.endpoint,label:`Copy endpoint URL`})]})]}),(0,z.jsx)(c,{initial:!1,children:n&&(0,z.jsx)(o.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,z.jsx)(`div`,{className:`protocol-card-art-body border-t`,children:e.enabled&&t?(0,z.jsxs)(z.Fragment,{children:[(0,z.jsxs)(`section`,{className:`px-4 pb-4 pt-4`,"aria-labelledby":`protocol-telemetry-${e.name}`,children:[(0,z.jsxs)(`div`,{className:`mb-3 flex flex-col gap-2 sm:flex-row sm:items-center sm:justify-between sm:gap-3`,children:[(0,z.jsx)(`h4`,{id:`protocol-telemetry-${e.name}`,className:`blueprint-title shrink-0 text-muted-foreground`,children:`Telemetry`}),(0,z.jsxs)(w,{to:`/tags?protocol=${e.name}`,className:`group/footer-link inline-flex w-full min-h-8 min-w-0 max-w-full shrink-0 items-center justify-start gap-1.5 rounded-[var(--miravo-radius-pill)] border border-primary/25 bg-primary/5 px-2.5 py-1.5 text-xs font-medium leading-tight text-primary transition-colors hover:border-primary/40 hover:bg-primary/10 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background sm:w-fit`,children:[(0,z.jsx)(`span`,{className:`whitespace-nowrap`,children:`Browse Tags`}),(0,z.jsx)(h,{className:`size-3 shrink-0 text-primary transition-transform group-hover/footer-link:translate-x-0.5`})]})]}),(0,z.jsx)(Q,{metrics:t})]}),(0,z.jsx)(`footer`,{className:`protocol-card-art-footer flex flex-col gap-4 border-t border-border/80 px-4 pb-4 pt-4`,children:(0,z.jsxs)(`div`,{className:`flex flex-wrap items-center gap-3`,children:[(0,z.jsxs)(l,{variant:`destructive`,size:`sm`,className:`gap-1.5`,disabled:E,onClick:async()=>{p(!0);try{await m.mutateAsync({type:`disableAdapter`,adapter:e.name})}catch{}finally{p(!1)}},children:[E?(0,z.jsx)(x,{className:`size-3.5 animate-spin`}):(0,z.jsx)(L,{className:`size-3.5`}),E?`Disabling...`:`Disable ${S}`]}),!E&&(0,z.jsx)(`span`,{className:`text-xs leading-snug text-muted-foreground`,children:`Active connections will be dropped.`})]})})]}):(0,z.jsxs)(`div`,{className:`flex flex-col gap-4 px-4 py-4`,children:[!E&&(0,z.jsx)($,{port:i&&Number(i)||k}),(0,z.jsxs)(`div`,{className:`flex flex-wrap items-end gap-3`,children:[(0,z.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,z.jsx)(T,{htmlFor:`port-${e.name}`,className:`text-xs`,children:`Port`}),(0,z.jsx)(u,{id:`port-${e.name}`,type:`number`,placeholder:String(k),value:i,onChange:e=>a(e.target.value),className:`w-28`,disabled:E})]}),(0,z.jsxs)(l,{size:`sm`,className:`gap-1.5`,disabled:E,onClick:async()=>{p(!0);try{let t=i?Number(i):void 0,n={};t&&Number.isFinite(t)&&(n.port=t),await m.mutateAsync({type:`enableAdapter`,adapter:e.name,...Object.keys(n).length>0?{config:n}:{}})}catch{}finally{p(!1)}},children:[E?(0,z.jsx)(x,{className:`size-3.5 animate-spin`}):(0,z.jsx)(R,{className:`size-3.5`}),E?`Enabling...`:`Enable ${S}`]})]})]})})},`panel`)})]})}export{U as a,B as i,ee as n,H as o,W as r,P as s,K as t};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as e}from"./rolldown-runtime-COnpUsM8.js";import{c as t}from"./vendor-charts-95ykyDlI.js";import{ot as n}from"./vendor-ui-D8j69UH4.js";import{Ct as r,Dt as i,Et as a,St as o,Tt as s,_t as c,bt as l,dt as u,ft as d,ht as f,mt as p,pt as m,vt as h,wt as g,xt as _}from"./api-kPM52mb-.js";import{C as v}from"./format-OUFL_tef.js";import{n as y,t as b}from"./utils-BO2u-wC_.js";var x=class extends i{constructor(e,t){super(),this.options=t,this.#e=e,this.#s=null,this.#o=m(),this.bindMethods(),this.setOptions(t)}#e;#t=void 0;#n=void 0;#r=void 0;#i;#a;#o;#s;#c;#l;#u;#d;#f;#p;#m=new Set;bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(this.#t.addObserver(this),C(this.#t,this.options)?this.#h():this.updateResult(),this.#y())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return w(this.#t,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return w(this.#t,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.#b(),this.#x(),this.#t.removeObserver(this)}setOptions(e){let t=this.options,n=this.#t;if(this.options=this.#e.defaultQueryOptions(e),this.options.enabled!==void 0&&typeof this.options.enabled!=`boolean`&&typeof this.options.enabled!=`function`&&typeof l(this.options.enabled,this.#t)!=`boolean`)throw Error(`Expected enabled to be a boolean or a callback that returns a boolean`);this.#S(),this.#t.setOptions(this.options),t._defaulted&&!o(this.options,t)&&this.#e.getQueryCache().notify({type:`observerOptionsUpdated`,query:this.#t,observer:this});let r=this.hasListeners();r&&T(this.#t,n,this.options,t)&&this.#h(),this.updateResult(),r&&(this.#t!==n||l(this.options.enabled,this.#t)!==l(t.enabled,this.#t)||_(this.options.staleTime,this.#t)!==_(t.staleTime,this.#t))&&this.#g();let i=this.#_();r&&(this.#t!==n||l(this.options.enabled,this.#t)!==l(t.enabled,this.#t)||i!==this.#p)&&this.#v(i)}getOptimisticResult(e){let t=this.#e.getQueryCache().build(this.#e,e),n=this.createResult(t,e);return D(this,n)&&(this.#r=n,this.#a=this.options,this.#i=this.#t.state),n}getCurrentResult(){return this.#r}trackResult(e,t){return new Proxy(e,{get:(e,n)=>(this.trackProp(n),t?.(n),n===`promise`&&(this.trackProp(`data`),!this.options.experimental_prefetchInRender&&this.#o.status===`pending`&&this.#o.reject(Error(`experimental_prefetchInRender feature flag is not enabled`))),Reflect.get(e,n))})}trackProp(e){this.#m.add(e)}getCurrentQuery(){return this.#t}refetch({...e}={}){return this.fetch({...e})}fetchOptimistic(e){let t=this.#e.defaultQueryOptions(e),n=this.#e.getQueryCache().build(this.#e,t);return n.fetch().then(()=>this.createResult(n,t))}fetch(e){return this.#h({...e,cancelRefetch:e.cancelRefetch??!0}).then(()=>(this.updateResult(),this.#r))}#h(e){this.#S();let t=this.#t.fetch(this.options,e);return e?.throwOnError||(t=t.catch(c)),t}#g(){this.#b();let e=_(this.options.staleTime,this.#t);if(p.isServer()||this.#r.isStale||!f(e))return;let t=g(this.#r.dataUpdatedAt,e)+1;this.#d=s.setTimeout(()=>{this.#r.isStale||this.updateResult()},t)}#_(){return(typeof this.options.refetchInterval==`function`?this.options.refetchInterval(this.#t):this.options.refetchInterval)??!1}#v(e){this.#x(),this.#p=e,!(p.isServer()||l(this.options.enabled,this.#t)===!1||!f(this.#p)||this.#p===0)&&(this.#f=s.setInterval(()=>{(this.options.refetchIntervalInBackground||a.isFocused())&&this.#h()},this.#p))}#y(){this.#g(),this.#v(this.#_())}#b(){this.#d!==void 0&&(s.clearTimeout(this.#d),this.#d=void 0)}#x(){this.#f!==void 0&&(s.clearInterval(this.#f),this.#f=void 0)}createResult(e,t){let n=this.#t,r=this.options,i=this.#r,a=this.#i,o=this.#a,s=e===n?this.#n:e.state,{state:c}=e,d={...c},f=!1,p;if(t._optimisticResults){let i=this.hasListeners(),a=!i&&C(e,t),o=i&&T(e,n,t,r);(a||o)&&(d={...d,...u(c.data,e.options)}),t._optimisticResults===`isRestoring`&&(d.fetchStatus=`idle`)}let{error:g,errorUpdatedAt:_,status:v}=d;p=d.data;let y=!1;if(t.placeholderData!==void 0&&p===void 0&&v===`pending`){let e;i?.isPlaceholderData&&t.placeholderData===o?.placeholderData?(e=i.data,y=!0):e=typeof t.placeholderData==`function`?t.placeholderData(this.#u?.state.data,this.#u):t.placeholderData,e!==void 0&&(v=`success`,p=h(i?.data,e,t),f=!0)}if(t.select&&p!==void 0&&!y)if(i&&p===a?.data&&t.select===this.#c)p=this.#l;else try{this.#c=t.select,p=t.select(p),p=h(i?.data,p,t),this.#l=p,this.#s=null}catch(e){this.#s=e}this.#s&&(g=this.#s,p=this.#l,_=Date.now(),v=`error`);let b=d.fetchStatus===`fetching`,x=v===`pending`,S=v===`error`,w=x&&b,D=p!==void 0,O={status:v,fetchStatus:d.fetchStatus,isPending:x,isSuccess:v===`success`,isError:S,isInitialLoading:w,isLoading:w,data:p,dataUpdatedAt:d.dataUpdatedAt,error:g,errorUpdatedAt:_,failureCount:d.fetchFailureCount,failureReason:d.fetchFailureReason,errorUpdateCount:d.errorUpdateCount,isFetched:e.isFetched(),isFetchedAfterMount:d.dataUpdateCount>s.dataUpdateCount||d.errorUpdateCount>s.errorUpdateCount,isFetching:b,isRefetching:b&&!x,isLoadingError:S&&!D,isPaused:d.fetchStatus===`paused`,isPlaceholderData:f,isRefetchError:S&&D,isStale:E(e,t),refetch:this.refetch,promise:this.#o,isEnabled:l(t.enabled,e)!==!1};if(this.options.experimental_prefetchInRender){let t=O.data!==void 0,r=O.status===`error`&&!t,i=e=>{r?e.reject(O.error):t&&e.resolve(O.data)},a=()=>{i(this.#o=O.promise=m())},o=this.#o;switch(o.status){case`pending`:e.queryHash===n.queryHash&&i(o);break;case`fulfilled`:(r||O.data!==o.value)&&a();break;case`rejected`:(!r||O.error!==o.reason)&&a();break}}return O}updateResult(){let e=this.#r,t=this.createResult(this.#t,this.options);this.#i=this.#t.state,this.#a=this.options,this.#i.data!==void 0&&(this.#u=this.#t),!o(t,e)&&(this.#r=t,this.#C({listeners:(()=>{if(!e)return!0;let{notifyOnChangeProps:t}=this.options,n=typeof t==`function`?t():t;if(n===`all`||!n&&!this.#m.size)return!0;let r=new Set(n??this.#m);return this.options.throwOnError&&r.add(`error`),Object.keys(this.#r).some(t=>{let n=t;return this.#r[n]!==e[n]&&r.has(n)})})()}))}#S(){let e=this.#e.getQueryCache().build(this.#e,this.options);if(e===this.#t)return;let t=this.#t;this.#t=e,this.#n=e.state,this.hasListeners()&&(t?.removeObserver(this),e.addObserver(this))}onQueryUpdate(){this.updateResult(),this.hasListeners()&&this.#y()}#C(e){d.batch(()=>{e.listeners&&this.listeners.forEach(e=>{e(this.#r)}),this.#e.getQueryCache().notify({query:this.#t,type:`observerResultsUpdated`})})}};function S(e,t){return l(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status===`error`&&t.retryOnMount===!1)}function C(e,t){return S(e,t)||e.state.data!==void 0&&w(e,t,t.refetchOnMount)}function w(e,t,n){if(l(t.enabled,e)!==!1&&_(t.staleTime,e)!==`static`){let r=typeof n==`function`?n(e):n;return r===`always`||r!==!1&&E(e,t)}return!1}function T(e,t,n,r){return(e!==t||l(r.enabled,e)===!1)&&(!n.suspense||e.state.status!==`error`)&&E(e,n)}function E(e,t){return l(t.enabled,e)!==!1&&e.isStaleByTime(_(t.staleTime,e))}function D(e,t){return!o(e.getCurrentResult(),t)}var O=e(t(),1),k=n(),A=O.createContext(void 0),j=e=>{let t=O.useContext(A);if(e)return e;if(!t)throw Error(`No QueryClient set, use QueryClientProvider to set one`);return t},M=({client:e,children:t})=>(O.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),(0,k.jsx)(A.Provider,{value:e,children:t})),N=O.createContext(!1),P=()=>O.useContext(N);N.Provider;function F(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var I=O.createContext(F()),L=()=>O.useContext(I),R=(e,t,n)=>{let i=n?.state.error&&typeof e.throwOnError==`function`?r(e.throwOnError,[n.state.error,n]):e.throwOnError;(e.suspense||e.experimental_prefetchInRender||i)&&(t.isReset()||(e.retryOnMount=!1))},z=e=>{O.useEffect(()=>{e.clearReset()},[e])},B=({result:e,errorResetBoundary:t,throwOnError:n,query:i,suspense:a})=>e.isError&&!t.isReset()&&!e.isFetching&&i&&(a&&e.data===void 0||r(n,[e.error,i])),V=e=>{if(e.suspense){let t=1e3,n=e=>e===`static`?e:Math.max(e??t,t),r=e.staleTime;e.staleTime=typeof r==`function`?(...e)=>n(r(...e)):n(r),typeof e.gcTime==`number`&&(e.gcTime=Math.max(e.gcTime,t))}},H=(e,t)=>e.isLoading&&e.isFetching&&!t,U=(e,t)=>e?.suspense&&t.isPending,W=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function G(e,t,n){let r=P(),i=L(),a=j(n),o=a.defaultQueryOptions(e);a.getDefaultOptions().queries?._experimental_beforeQuery?.(o);let s=a.getQueryCache().get(o.queryHash);o._optimisticResults=r?`isRestoring`:`optimistic`,V(o),R(o,i,s),z(i);let l=!a.getQueryCache().get(o.queryHash),[u]=O.useState(()=>new t(a,o)),f=u.getOptimisticResult(o),m=!r&&e.subscribed!==!1;if(O.useSyncExternalStore(O.useCallback(e=>{let t=m?u.subscribe(d.batchCalls(e)):c;return u.updateResult(),t},[u,m]),()=>u.getCurrentResult(),()=>u.getCurrentResult()),O.useEffect(()=>{u.setOptions(o)},[o,u]),U(o,f))throw W(o,u,i);if(B({result:f,errorResetBoundary:i,throwOnError:o.throwOnError,query:s,suspense:o.suspense}))throw f.error;return a.getDefaultOptions().queries?._experimental_afterQuery?.(o,f),o.experimental_prefetchInRender&&!p.isServer()&&H(f,r)&&(l?W(o,u,i):s?.promise)?.catch(c).finally(()=>{u.updateResult()}),o.notifyOnChangeProps?f:u.trackResult(f)}function K(e,t){return G(e,x,t)}var q=y(`refresh-cw`,[[`path`,{d:`M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8`,key:`v9h5vc`}],[`path`,{d:`M21 3v5h-5`,key:`1q7to0`}],[`path`,{d:`M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16`,key:`3uifl3`}],[`path`,{d:`M8 16H3v5`,key:`1cv678`}]]);function J({role:e=`status`,"aria-live":t=`polite`,"aria-atomic":n=!0,className:r,eyebrow:i,stamp:a,title:o,children:s,detailLabel:c=`Technical detail`,detail:l,primaryLabel:u,onPrimary:d,primaryIcon:f,primaryDisabled:p,primaryBusy:m,secondaryLabel:h,onSecondary:g}){return(0,k.jsx)(`div`,{role:e,"aria-live":t,"aria-atomic":n,className:b(`relative overflow-hidden rounded-[var(--miravo-radius-stadium-lg)] border border-primary/20 bg-transparent`,r),children:(0,k.jsx)(`div`,{className:`p-5 sm:p-6`,children:(0,k.jsxs)(`div`,{className:`min-w-0 space-y-4`,children:[(0,k.jsxs)(`div`,{className:`space-y-3`,children:[(0,k.jsx)(`p`,{className:`font-mono text-[0.65rem] uppercase tracking-[0.38em] text-muted-foreground`,children:i}),(0,k.jsxs)(`div`,{className:`flex items-end gap-3`,children:[(0,k.jsx)(`span`,{className:`font-heading text-3xl font-black leading-none tracking-[-0.06em] text-transparent [-webkit-text-stroke:1px_color-mix(in_srgb,var(--primary)_50%,transparent)] sm:text-4xl`,"aria-hidden":!0,children:a}),(0,k.jsx)(`div`,{className:`mb-1.5 h-px min-w-8 flex-1 bg-linear-to-r from-primary/55 to-transparent`})]}),(0,k.jsx)(`h2`,{className:`text-lg font-semibold tracking-[-0.03em] text-foreground sm:text-xl`,children:o}),s?(0,k.jsx)(`div`,{className:`space-y-2 text-sm leading-relaxed text-muted-foreground`,children:s}):null]}),(0,k.jsxs)(`div`,{className:`rounded-[var(--miravo-radius-stadium-sm)] border border-border/80 bg-background/55 p-4 backdrop-blur-sm`,children:[(0,k.jsx)(`div`,{className:`mb-2 font-mono text-[0.65rem] uppercase tracking-[0.28em] text-muted-foreground`,children:c}),(0,k.jsx)(`p`,{className:`wrap-break-word font-mono text-sm leading-relaxed text-primary`,children:l})]}),(0,k.jsxs)(`div`,{className:`flex flex-col gap-2 sm:flex-row sm:flex-wrap`,children:[(0,k.jsxs)(v,{type:`button`,onClick:d,disabled:!!(p||m),"aria-busy":m,className:b(`inline-flex w-full items-center justify-center gap-2 rounded-[var(--miravo-radius-stadium-sm)] border border-foreground/15 bg-foreground px-4 py-2.5 font-medium text-background shadow-none transition hover:bg-foreground/90 sm:w-auto`,m&&`pointer-events-none opacity-90`),children:[f,u]}),h&&g?(0,k.jsx)(v,{type:`button`,variant:`ghost`,size:`sm`,className:`sm:self-center`,onClick:g,children:h}):null]})]})})})}function Y({message:e,onRetry:t,isRetrying:n}){return(0,k.jsxs)(J,{role:`alert`,eyebrow:`Data link fault`,stamp:`ERR`,title:`Couldn't reach Miravo`,detail:e,primaryLabel:`Retry request`,onPrimary:t,primaryBusy:!!n,primaryIcon:(0,k.jsx)(q,{className:b(`size-4 shrink-0`,n&&`animate-spin`),"aria-hidden":!0}),children:[(0,k.jsxs)(`p`,{children:[(0,k.jsx)(`span`,{className:`text-foreground`,children:`Most often:`}),` the Miravo admin server isn't running, or this browser can't reach it (wrong host, port, or firewall).`]}),(0,k.jsx)(`p`,{children:`Start or restart Miravo if needed, use the correct link to the Miravo Console, then try again.`})]})}export{G as a,U as c,z as d,L as f,x as g,j as h,K as i,R as l,M as m,J as n,V as o,P as p,q as r,W as s,Y as t,B as u};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as e,c as t,d as n,f as r,i,l as a,m as o,n as s,o as c,ot as l,p as u,r as d,s as f,t as p,u as m}from"./vendor-ui-D8j69UH4.js";import{E as h}from"./format-OUFL_tef.js";import{t as g}from"./utils-BO2u-wC_.js";import{t as _}from"./chevron-down-CAk5w9Wt.js";var v=l(),y=o;function b({className:e,...t}){return(0,v.jsx)(d,{"data-slot":`select-group`,className:g(`scroll-my-1 p-1`,e),...t})}function x({className:e,...t}){return(0,v.jsx)(r,{"data-slot":`select-value`,className:g(`flex flex-1 text-left`,e),...t})}function S({className:e,size:t=`default`,children:r,...i}){return(0,v.jsxs)(u,{"data-slot":`select-trigger`,"data-size":t,className:g(`flex w-fit 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 text-xs whitespace-nowrap transition-colors outline-none select-none hover:bg-input/50 focus-visible:border-primary/35 focus-visible:ring-2 focus-visible:ring-primary/22 disabled:cursor-not-allowed disabled:bg-input/50 disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 data-placeholder:text-muted-foreground data-[size=default]:h-8 data-[size=sm]:h-7 data-[size=sm]:rounded-[var(--miravo-radius-stadium-sm)] *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-1.5 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4`,e),...i,children:[r,(0,v.jsx)(n,{render:(0,v.jsx)(_,{className:`pointer-events-none size-4 text-muted-foreground`})})]})}function C({className:e,children:n,side:r=`bottom`,sideOffset:i=6,align:o=`center`,alignOffset:s=0,alignItemWithTrigger:c=!1,...l}){return(0,v.jsx)(m,{children:(0,v.jsx)(a,{side:r,sideOffset:i,align:o,alignOffset:s,alignItemWithTrigger:c,className:`isolate z-50`,children:(0,v.jsx)(t,{"data-slot":`select-content`,"data-align-trigger":c,className:g(`relative isolate z-50 max-h-(--available-height) w-(--anchor-width) min-w-36 origin-(--transform-origin) overflow-x-hidden overflow-y-auto rounded-[var(--miravo-radius-tight)] bg-popover text-popover-foreground shadow-md ring-1 ring-foreground/10 duration-100 data-[align-trigger=true]:animate-none data-[side=bottom]:slide-in-from-top-2 data-[side=inline-end]:slide-in-from-left-2 data-[side=inline-start]:slide-in-from-right-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95 motion-reduce:data-open:animate-none motion-reduce:data-closed:animate-none motion-reduce:data-open:duration-0 motion-reduce:data-closed:duration-0`,e),...l,children:(0,v.jsx)(f,{children:n})})})})}function w({className:e,...t}){return(0,v.jsx)(s,{"data-slot":`select-label`,className:g(`px-2 py-1.5 text-xs text-muted-foreground`,e),...t})}var T=`relative flex w-full cursor-pointer items-center gap-1.5 rounded-[var(--miravo-radius-tight)] py-1 pr-8 pl-1.5 text-xs text-muted-foreground outline-hidden select-none data-[highlighted]:bg-sidebar-accent data-[highlighted]:text-sidebar-accent-foreground not-data-[variant=destructive]:data-[highlighted]:**:text-sidebar-accent-foreground data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2`;function E({className:t,children:n,...r}){return(0,v.jsxs)(c,{"data-slot":`select-item`,className:g(T,t),...r,children:[(0,v.jsx)(i,{"data-slot":`select-item-text`,className:`flex min-w-0 flex-1 gap-2 whitespace-nowrap`,children:n}),(0,v.jsx)(e,{render:(0,v.jsx)(`span`,{className:`pointer-events-none absolute right-2 flex size-4 items-center justify-center`}),children:(0,v.jsx)(h,{className:`pointer-events-none`})})]})}function D({className:e,...t}){return(0,v.jsx)(p,{"data-slot":`select-separator`,className:g(`pointer-events-none -mx-1 my-1 h-px bg-border`,e),...t})}export{w as a,x as c,E as i,C as n,D as o,b as r,S as s,y as t};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{A as e,D as t,O as n,k as r,ot as i}from"./vendor-ui-D8j69UH4.js";import{D as a}from"./format-OUFL_tef.js";import{n as o,t as s}from"./utils-BO2u-wC_.js";var c=o(`loader-circle`,[[`path`,{d:`M21 12a9 9 0 1 1-6.219-8.56`,key:`13zald`}]]),l=i();function u({className:t,orientation:n=`horizontal`,...r}){return(0,l.jsx)(e,{"data-slot":`tabs`,"data-orientation":n,className:s(`group/tabs flex gap-2 data-horizontal:flex-col`,t),...r})}var d=a(`group/tabs-list inline-flex w-fit items-center justify-center rounded-[var(--miravo-radius-stadium-sm)] p-[3px] text-muted-foreground group-data-horizontal/tabs:h-8 group-data-vertical/tabs:h-fit group-data-vertical/tabs:flex-col data-[variant=line]:rounded-none`,{variants:{variant:{default:`bg-muted`,line:`gap-0 border-b border-border/50 bg-transparent p-0 shadow-none group-data-horizontal/tabs:h-auto group-data-horizontal/tabs:min-h-8`}},defaultVariants:{variant:`default`}});function f({className:e,variant:n=`default`,...r}){return(0,l.jsx)(t,{"data-slot":`tabs-list`,"data-variant":n,className:s(d({variant:n}),e),...r})}function p({className:e,...t}){return(0,l.jsx)(r,{"data-slot":`tabs-trigger`,className:s(`relative inline-flex h-[calc(100%-1px)] flex-1 items-center justify-center gap-1.5 rounded-[var(--miravo-radius-tight)] border border-transparent px-1.5 py-0.5 text-sm font-medium whitespace-nowrap text-muted-foreground transition-[color,box-shadow,transform] duration-200 ease-out group-data-vertical/tabs:w-full group-data-vertical/tabs:justify-start hover:text-foreground focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 focus-visible:outline-1 focus-visible:outline-ring disabled:pointer-events-none disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:opacity-50 group-data-[variant=default]/tabs-list:data-active:shadow-sm group-data-[variant=line]/tabs-list:data-active:shadow-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4`,`group-data-[variant=line]/tabs-list:font-heading group-data-[variant=line]/tabs-list:tracking-tight group-data-[variant=line]/tabs-list:text-sm group-data-[variant=line]/tabs-list:text-muted-foreground group-data-[variant=line]/tabs-list:hover:text-foreground group-data-[variant=line]/tabs-list:data-active:font-semibold group-data-[variant=line]/tabs-list:data-active:text-foreground`,`group-data-[variant=line]/tabs-list:bg-transparent group-data-[variant=line]/tabs-list:data-active:bg-transparent group-data-[variant=line]/tabs-list:data-active:border-transparent group-data-[variant=line]/tabs-list:data-active:bg-transparent`,`group-data-[variant=line]/tabs-list:rounded-none group-data-[variant=line]/tabs-list:px-3 group-data-[variant=line]/tabs-list:py-2`,`data-active:bg-background data-active:text-foreground data-active:border-input data-active:bg-input/30 data-active:text-foreground`,`after:pointer-events-none after:absolute after:bg-foreground after:opacity-0 after:transition-[opacity,transform] after:duration-300 after:ease-out group-data-horizontal/tabs:after:inset-x-0 group-data-horizontal/tabs:after:bottom-[-5px] group-data-horizontal/tabs:after:h-0.5 group-data-vertical/tabs:after:inset-y-0 group-data-vertical/tabs:after:-right-1 group-data-vertical/tabs:after:w-0.5`,`group-data-[variant=line]/tabs-list:after:bg-primary group-data-horizontal/tabs:group-data-[variant=line]/tabs-list:after:bottom-0 group-data-horizontal/tabs:group-data-[variant=line]/tabs-list:after:h-[2px] group-data-horizontal/tabs:group-data-[variant=line]/tabs-list:after:rounded-sm group-data-[variant=line]/tabs-list:data-active:after:opacity-100 group-data-horizontal/tabs:group-data-[variant=line]/tabs-list:data-active:after:shadow-[0_0_14px_-3px_color-mix(in_srgb,var(--primary)_50%,transparent)]`,e),...t})}function m({className:e,...t}){return(0,l.jsx)(n,{"data-slot":`tabs-content`,className:s(`flex-1 text-sm outline-none py-2`,e),...t})}export{c as a,p as i,m as n,f as r,u as t};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{t as e}from"./tags-DJJKQRZZ.js";export{e as TagsPage};
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import{a as e}from"./rolldown-runtime-COnpUsM8.js";import{c as t}from"./vendor-charts-95ykyDlI.js";import{ot as n}from"./vendor-ui-D8j69UH4.js";import{S as r,gt as i,o as a,ot as o,v as s}from"./api-kPM52mb-.js";import{i as c,t as l}from"./query-fetch-error-C2Ec4RQS.js";import{i as u,n as d,t as f}from"./dist-CtuJWBnP.js";import{n as p}from"./chunk-OE4NN4TA-Q4iNR9l9.js";import{a as m,i as h,n as g,o as _,r as v,t as y}from"./dialog-Di9Bs0FH.js";import{C as b,S as x,T as S,s as C,u as w,v as ee,y as te}from"./format-OUFL_tef.js";import{n as T,t as ne}from"./utils-BO2u-wC_.js";import{a as re,c as ie,d as ae,i as oe,l as se,o as ce,r as le,s as ue,t as de,u as fe}from"./local-flag-CPAqDO-L.js";import{t as pe}from"./chevron-down-CAk5w9Wt.js";import{t as me}from"./chevron-right-BfZjrUWh.js";import{a as E,n as D,r as O,t as he}from"./copy-button-DHm7RGJ5.js";import{t as ge}from"./download-B9e1wNK4.js";import{n as _e}from"./auth-screen-backdrop-hcEYy3K4.js";import{t as k}from"./label-DWyy9MeT.js";import{n as ve}from"./get-error-message-eGdenTLv.js";import{a as A,i as j,n as M,o as ye,r as N,s as be,t as P}from"./combobox-BFEY6lgO.js";import{c as F,i as I,n as L,s as R,t as z}from"./select-Bg6PPro0.js";import{n as B,r as V}from"./integration-targets-BehiqWyT.js";import{a as xe,i as Se,n as Ce,o as we,r as Te,t as Ee}from"./vendor-table-Br-cHaxY.js";var De=T(`arrow-down`,[[`path`,{d:`M12 5v14`,key:`s699le`}],[`path`,{d:`m19 12-7 7-7-7`,key:`1idqje`}]]),Oe=T(`arrow-up`,[[`path`,{d:`m5 12 7-7 7 7`,key:`hav0vg`}],[`path`,{d:`M12 19V5`,key:`x0mq9r`}]]),ke=T(`braces`,[[`path`,{d:`M8 3H7a2 2 0 0 0-2 2v5a2 2 0 0 1-2 2 2 2 0 0 1 2 2v5c0 1.1.9 2 2 2h1`,key:`ezmyqa`}],[`path`,{d:`M16 21h1a2 2 0 0 0 2-2v-5c0-1.1.9-2 2-2a2 2 0 0 1-2-2V5a2 2 0 0 0-2-2h-1`,key:`e1hn23`}]]),Ae=T(`chevron-left`,[[`path`,{d:`m15 18-6-6 6-6`,key:`1wnfg3`}]]),je=T(`database`,[[`ellipse`,{cx:`12`,cy:`5`,rx:`9`,ry:`3`,key:`msslwz`}],[`path`,{d:`M3 5V19A9 3 0 0 0 21 19V5`,key:`1wlel7`}],[`path`,{d:`M3 12A9 3 0 0 0 21 12`,key:`mv7ke4`}]]),Me=T(`external-link`,[[`path`,{d:`M15 3h6v6`,key:`1q9fwt`}],[`path`,{d:`M10 14 21 3`,key:`gplh6r`}],[`path`,{d:`M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6`,key:`a6xqqp`}]]),Ne=T(`table-2`,[[`path`,{d:`M9 3H5a2 2 0 0 0-2 2v4m6-6h10a2 2 0 0 1 2 2v4M9 3v18m0 0h10a2 2 0 0 0 2-2V9M9 21H5a2 2 0 0 1-2-2V9m0 0h18`,key:`gugj83`}]]),H=e(t(),1),Pe={mqtt:`MQTT Client`,opcua:`OPC UA Client Advanced`,modbus:`Modbus TCP`},U={Boolean:`bool`,Int32:`int32`,UInt16:`uint16`,UInt32:`uint32`,Float:`float32`,Double:`float64`,String:`string`},W={float32:`float32`,int32:`int32`,uint32:`uint32`,uint16:`word`,boolean:`word`},Fe=`deviceId,deviceName,driverName,name,tagName,description,valueType,registerId,publishCoV,tagFormula,metaData,Retain,Qos,address,count,pollingInterval,endianness`;function Ie(e,t,n){let r=[Fe];for(let i of n){let n=Pe[i]??i;for(let a of e){let e=a.protocols[i];e&&r.push(G(i,{deviceName:t,driverName:n,memberName:a.member,browsePath:a.browsePath,dataType:a.dataType,protocolData:e,unit:a.unit,euRange:a.euRange,model:a.model,asset:a.asset,access:a.access}))}}return`${r.join(`
|
|
2
|
-
`)}\n`}function G(e,t){switch(e){case`mqtt`:return K(t);case`opcua`:return Le(t);case`modbus`:return Re(t);default:throw Error(`Unsupported LE export protocol: "${e}"`)}}function K(e){let t=typeof e.protocolData?.topic==`string`?e.protocolData.topic:`${e.browsePath}/${e.memberName}`;return[``,q(e.deviceName),q(e.driverName),q(t),q(e.memberName),``,`string`,``,`false`,``,J(e),`Disable`,`0`,``,``,``,``].join(`,`)}function Le(e){let t=typeof e.protocolData?.nodeId==`string`?e.protocolData.nodeId:`ns=1;s=${e.browsePath}/${e.memberName}`,n=U[e.dataType]??`string`;return[``,q(e.deviceName),q(e.driverName),q(t),q(e.memberName),``,n,``,`false`,``,J(e),``,``,``,``,``,``].join(`,`)}function Re(e){let t=W[String(e.protocolData?.registerType??``)]??ze(e.dataType),n=e.protocolData?.address;return[``,q(e.deviceName),q(e.driverName),`H`,q(e.memberName),``,t,``,`false`,``,J(e),``,``,typeof n==`number`?String(n):`0`,`1`,`1.0000000000`,`AB CD`].join(`,`)}function ze(e){switch(e){case`Double`:case`Float`:return`float32`;case`Int32`:return`int32`;case`UInt32`:return`uint32`;case`Boolean`:case`UInt16`:return`word`;default:return`float32`}}function q(e){return e.includes(`,`)||e.includes(`"`)||e.includes(`
|
|
3
|
-
`)?`"${e.replace(/"/g,`""`)}"`:e}function J(e){let t={uns_path:e.browsePath?`${e.browsePath}/${e.memberName}`:e.memberName,model:e.model,asset:e.asset,access:e.access};return e.unit!=null&&(t.unit=e.unit),e.euRange!=null&&(t.eu_range_min=String(e.euRange[0]),t.eu_range_max=String(e.euRange[1])),q(JSON.stringify(t))}var Y=n(),Be={mqtt:`MQTT`,opcua:`OPC UA`,modbus:`Modbus`},Ve=[{id:V.id,label:V.label}];function He({open:e,onOpenChange:t,tags:n,totalTags:r,enabledProtocols:i,selectedAsset:a}){let[o,s]=(0,H.useState)(`litmus-edge`),[c,l]=(0,H.useState)(``),[u,d]=(0,H.useState)(``),f=(0,H.useRef)(null),p=(0,H.useRef)(!1);(0,H.useEffect)(()=>{e&&!p.current&&(s(V.id),l(a??``),d(i[0]??``),setTimeout(()=>f.current?.focus(),80)),p.current=e},[e,i,a]);let S=c.trim()!==``&&u!==``,C=o===V.id?S:!1,w=(0,H.useCallback)(()=>{if(o===V.id){let e=Ie(n,c.trim(),[u]),r=new Blob([e],{type:`text/csv`}),i=URL.createObjectURL(r),a=document.createElement(`a`);a.href=i,a.download=`${c.trim()}-litmus-edge-tags.csv`,a.click(),URL.revokeObjectURL(i),t(!1)}},[o,c,n,u,t]),ee=n.length<r,te=(0,H.useMemo)(()=>[...Ve.map(e=>({value:e.id,label:e.label})),...B.map(e=>({value:e.id,label:e.label}))],[]),T=(0,H.useMemo)(()=>i.map(e=>({value:e,label:Be[e]??e.toUpperCase()})),[i]);return(0,Y.jsx)(y,{open:e,onOpenChange:t,children:(0,Y.jsxs)(g,{className:`sm:max-w-lg`,children:[(0,Y.jsxs)(m,{children:[(0,Y.jsx)(_,{children:`Export for Integration`}),(0,Y.jsx)(v,{children:ee?`Exporting ${n.length} of ${r} tags based on current table filters.`:`Exporting all ${n.length} tags. Use table filters to narrow scope.`})]}),(0,Y.jsxs)(`div`,{className:`flex flex-col gap-4 py-1`,children:[(0,Y.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,Y.jsx)(k,{className:`text-sm`,children:`Integration`}),(0,Y.jsxs)(z,{value:o,onValueChange:e=>e&&s(e),items:te,children:[(0,Y.jsx)(R,{className:`w-full text-sm`,children:(0,Y.jsx)(F,{placeholder:`Select integration`})}),(0,Y.jsxs)(L,{children:[Ve.map(e=>(0,Y.jsx)(I,{value:e.id,children:e.label},e.id)),B.map(e=>(0,Y.jsx)(I,{value:e.id,disabled:!0,children:e.label},e.id))]})]})]}),o===V.id&&(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,Y.jsxs)(k,{htmlFor:`device-name`,className:`text-sm`,children:[`Device name `,(0,Y.jsx)(`span`,{className:`text-destructive`,children:`*`})]}),(0,Y.jsx)(x,{id:`device-name`,ref:f,placeholder:`e.g. smart_factory_cnc_001`,value:c,onChange:e=>l(e.target.value),onKeyDown:e=>e.key===`Enter`&&C&&w(),className:`font-mono text-sm`})]}),(0,Y.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,Y.jsx)(k,{className:`text-sm`,children:`Protocol`}),(0,Y.jsxs)(z,{value:u||void 0,onValueChange:e=>e&&d(e),items:T,children:[(0,Y.jsx)(R,{className:`w-full text-sm`,children:(0,Y.jsx)(F,{placeholder:`Select a protocol`})}),(0,Y.jsx)(L,{children:i.map(e=>(0,Y.jsx)(I,{value:e,children:Be[e]??e.toUpperCase()},e))})]})]})]})]}),(0,Y.jsxs)(h,{children:[(0,Y.jsx)(b,{variant:`outline`,size:`sm`,onClick:()=>t(!1),children:`Cancel`}),(0,Y.jsxs)(b,{size:`sm`,className:`gap-1.5`,disabled:!C,onClick:w,children:[(0,Y.jsx)(ge,{className:`size-3.5`}),`Download CSV`]})]})]})})}var Ue=`border-border/70 bg-popover/98 font-body text-sm shadow-xl ring-1 ring-foreground/12 backdrop-blur-sm supports-backdrop-filter:bg-popover/90 p-1.5`,We=`px-2 pb-1 font-heading text-[9px] font-semibold tracking-[0.14em] text-muted-foreground uppercase`,Ge=`h-8 gap-1.5 border-border/80 bg-background/80 text-xs font-medium shadow-sm transition-colors hover:border-primary/35 hover:bg-accent/40`,Ke=`gap-2.5 rounded-[var(--miravo-radius-tight)] py-2 pl-2 pr-2 text-[13px] data-[highlighted]:bg-sidebar-accent data-[highlighted]:text-sidebar-accent-foreground`;function qe({protocol:e,asset:t,model:n,member:r,enabledProtocols:i,hasFilters:a,memberSearchRef:o,onProtocolChange:s,onAssetChange:c,onModelChange:l,onMemberChange:u,onClearFilters:d,onAssetSearch:f,onModelSearch:p,filteredAssetOptions:m,filteredModelOptions:h}){let g=(0,H.useMemo)(()=>[{value:`all`,label:`All protocols`},...i.map(e=>({value:e,label:e.toUpperCase()}))],[i]);return(0,Y.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,Y.jsxs)(z,{value:e||`all`,onValueChange:e=>s(!e||e===`all`?``:e),items:g,children:[(0,Y.jsx)(R,{className:`h-8 w-[140px]`,"aria-label":`Protocol filter`,children:(0,Y.jsx)(F,{placeholder:`All protocols`})}),(0,Y.jsxs)(L,{alignItemWithTrigger:!1,align:`start`,children:[(0,Y.jsx)(I,{value:`all`,children:`All protocols`}),i.map(e=>(0,Y.jsx)(I,{value:e,children:e.toUpperCase()},e))]})]}),(0,Y.jsxs)(P,{value:t?{value:t,label:C(t)}:null,onValueChange:e=>c(e?.value??``),isItemEqualToValue:(e,t)=>e?.value===t?.value,onInputValueChange:f,children:[(0,Y.jsx)(N,{placeholder:`All assets`,className:`h-8 w-[200px]`,showClear:!!t}),(0,Y.jsx)(M,{children:(0,Y.jsxs)(A,{children:[m.map(([e,t])=>(0,Y.jsxs)(j,{value:{value:e,label:C(e)},children:[(0,Y.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,title:`${C(e)} (${e})`,children:C(e)}),(0,Y.jsxs)(`span`,{className:`shrink-0 tabular-nums text-muted-foreground`,children:[`(`,t,`)`]})]},e)),m.length===0&&(0,Y.jsx)(`p`,{className:`py-2 text-center text-xs text-muted-foreground`,children:`No assets found`})]})})]}),(0,Y.jsxs)(P,{value:n?{value:n,label:w(n)}:null,onValueChange:e=>l(e?.value??``),isItemEqualToValue:(e,t)=>e?.value===t?.value,onInputValueChange:p,children:[(0,Y.jsx)(N,{placeholder:`All models`,className:`h-8 w-[200px]`,showClear:!!n}),(0,Y.jsx)(M,{children:(0,Y.jsxs)(A,{children:[h.map(([e,t])=>(0,Y.jsxs)(j,{value:{value:e,label:w(e)},children:[(0,Y.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,children:w(e)}),(0,Y.jsxs)(`span`,{className:`shrink-0 tabular-nums text-muted-foreground`,children:[`(`,t,`)`]})]},e)),h.length===0&&(0,Y.jsx)(`p`,{className:`py-2 text-center text-xs text-muted-foreground`,children:`No models found`})]})})]}),(0,Y.jsxs)(`div`,{className:`relative`,children:[(0,Y.jsx)(x,{ref:o,placeholder:`Search member…`,className:`h-8 w-[160px] pr-7`,value:r,onChange:e=>u(e.target.value)}),!r&&(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:`/`})]}),a&&(0,Y.jsxs)(b,{variant:`ghost`,size:`sm`,className:`h-8 gap-1 text-xs`,onClick:d,children:[(0,Y.jsx)(S,{className:`size-3`}),`Clear`]})]})}function X({sorted:e}){return e===`asc`?(0,Y.jsx)(Oe,{className:`ml-1 inline size-3`}):e===`desc`?(0,Y.jsx)(De,{className:`ml-1 inline size-3`}):(0,Y.jsx)(ae,{className:`ml-1 inline size-3 opacity-30`})}function Je(e,t=1,n=2){let r=e.split(`/`);return r.length<=t+n+1?e:[...r.slice(0,t),`...`,...r.slice(-n)].join(`/`)}function Z({label:e,value:t,collapsible:n}){let r=n?Je(t):t;return(0,Y.jsxs)(`div`,{className:`min-w-0`,children:[(0,Y.jsx)(`p`,{className:`text-[10px] uppercase tracking-wider text-muted-foreground`,children:e}),(0,Y.jsx)(he,{value:t,label:`Copy ${e}`,tooltipSide:`top`,render:({icon:e})=>(0,Y.jsxs)(`button`,{type:`button`,className:`mt-0.5 flex items-start gap-1 font-mono text-xs hover:text-foreground`,children:[n?(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(`span`,{className:`break-all lg:hidden`,children:r}),(0,Y.jsx)(`span`,{className:`hidden break-all lg:inline`,children:t})]}):(0,Y.jsx)(`span`,{className:`break-all`,children:t}),(0,Y.jsx)(`span`,{className:`mt-0.5 shrink-0 text-muted-foreground`,children:e})]})})]})}function Ye({tag:e,enabledProtocols:t}){let n=`${e.browsePath}/${e.member}`,r=e.protocols.opcua,i=e.protocols.modbus,a=e.access===`readwrite`?`rw`:e.access;return(0,Y.jsxs)(`div`,{className:`flex flex-col gap-3 text-xs`,children:[(0,Y.jsxs)(`div`,{className:`flex flex-wrap gap-x-10 gap-y-2.5`,children:[(0,Y.jsx)(Z,{label:`Topic / UNS`,value:n,collapsible:!0}),t.includes(`opcua`)&&typeof r?.nodeId==`string`&&(0,Y.jsx)(Z,{label:`OPC UA NodeId`,value:r.nodeId,collapsible:!0}),t.includes(`modbus`)&&i?.address!=null&&(0,Y.jsxs)(`div`,{className:`min-w-0`,children:[(0,Y.jsx)(`p`,{className:`text-[10px] uppercase tracking-wider text-muted-foreground`,children:`Modbus`}),(0,Y.jsxs)(`p`,{className:`mt-0.5 font-mono`,children:[`addr=`,String(i.address),` regs=`,String(i.count),` `,String(i.registerType)]})]})]}),(0,Y.jsxs)(`div`,{className:`flex flex-wrap items-center gap-x-4 gap-y-1 text-muted-foreground`,children:[(0,Y.jsxs)(D,{children:[(0,Y.jsx)(E,{className:`font-mono`,render:(0,Y.jsx)(`span`,{}),children:e.dataType}),(0,Y.jsx)(O,{side:`top`,children:`Data type`})]}),e.unit&&(0,Y.jsxs)(D,{children:[(0,Y.jsx)(E,{className:`font-mono`,render:(0,Y.jsx)(`span`,{}),children:e.unit}),(0,Y.jsx)(O,{side:`top`,children:`Unit`})]}),(0,Y.jsxs)(D,{children:[(0,Y.jsx)(E,{className:`font-mono`,render:(0,Y.jsx)(`span`,{}),children:a}),(0,Y.jsx)(O,{side:`top`,children:`Access: r / w / rw`})]}),e.euRange&&(0,Y.jsxs)(D,{children:[(0,Y.jsxs)(E,{className:`font-mono`,render:(0,Y.jsx)(`span`,{}),children:[`[`,e.euRange[0],`, `,e.euRange[1],`]`]}),(0,Y.jsx)(O,{side:`top`,children:`EU range (min, max)`})]}),(0,Y.jsxs)(D,{children:[(0,Y.jsxs)(E,{render:(0,Y.jsx)(p,{to:`/asset/${e.asset}`,className:`inline-flex items-center gap-1 text-primary underline-offset-4 hover:underline`,"aria-label":`Open asset`}),children:[`View asset`,(0,Y.jsx)(Me,{className:`size-3`})]}),(0,Y.jsx)(O,{side:`top`,children:`Open asset`})]})]})]})}var Xe=[{id:`expand`,meta:{cellClass:`!pl-2 !pr-0 w-0`},header:()=>(0,Y.jsx)(`span`,{className:`sr-only`,children:`Expand row`}),enableSorting:!1,cell:({row:e})=>(0,Y.jsx)(`button`,{type:`button`,className:`inline-flex size-5 items-center justify-center rounded-[var(--miravo-radius-tight)] text-muted-foreground hover:text-foreground`,"aria-label":e.getIsExpanded()?`Collapse row`:`Expand row`,"aria-expanded":e.getIsExpanded(),onClick:t=>{t.stopPropagation(),e.toggleExpanded()},children:(0,Y.jsx)(pe,{className:`size-3.5 transition-transform ${e.getIsExpanded()?`rotate-0`:`-rotate-90`}`})})},{accessorKey:`asset`,header:({column:e})=>(0,Y.jsxs)(`button`,{type:`button`,className:`inline-flex items-center`,onClick:e.getToggleSortingHandler(),children:[`Asset`,(0,Y.jsx)(X,{sorted:e.getIsSorted()})]}),cell:({getValue:e})=>(0,Y.jsx)(`span`,{className:`block max-w-[18rem] truncate font-mono text-xs`,title:e(),children:e()})},{accessorKey:`member`,header:({column:e})=>(0,Y.jsxs)(`button`,{type:`button`,className:`inline-flex items-center`,onClick:e.getToggleSortingHandler(),children:[`Member`,(0,Y.jsx)(X,{sorted:e.getIsSorted()})]}),cell:({getValue:e})=>(0,Y.jsx)(`span`,{className:`block max-w-[20rem] truncate font-mono text-xs`,title:e(),children:e()})},{accessorKey:`model`,header:({column:e})=>(0,Y.jsxs)(`button`,{type:`button`,className:`inline-flex items-center`,onClick:e.getToggleSortingHandler(),children:[`Model`,(0,Y.jsx)(X,{sorted:e.getIsSorted()})]}),cell:({getValue:e})=>(0,Y.jsx)(`span`,{className:`block max-w-[18rem] truncate text-xs`,title:e(),children:e()})},{accessorKey:`dataType`,meta:{hideClass:`hidden lg:table-cell`},header:({column:e})=>(0,Y.jsxs)(`button`,{type:`button`,className:`inline-flex items-center`,onClick:e.getToggleSortingHandler(),children:[`Type`,(0,Y.jsx)(X,{sorted:e.getIsSorted()})]}),cell:({getValue:e})=>(0,Y.jsx)(`span`,{className:`font-mono text-xs`,children:e()})},{accessorKey:`unit`,meta:{hideClass:`hidden lg:table-cell`},header:`Unit`,enableSorting:!1,cell:({getValue:e})=>(0,Y.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:e()??`—`})},{accessorKey:`access`,meta:{hideClass:`hidden lg:table-cell`},header:`Access`,enableSorting:!1,cell:({getValue:e})=>{let t=e();return(0,Y.jsx)(`span`,{className:`font-mono text-xs`,children:t===`readwrite`?`rw`:t})}}];function Ze(e,t){let n=new Blob([e],{type:`text/csv`}),r=URL.createObjectURL(n),i=document.createElement(`a`);i.href=r,i.download=t,i.click(),URL.revokeObjectURL(r)}var Qe=[10,15,25,50,100],$e=15,et=100;function tt(e){return Qe.includes(e)?e:$e}function nt(e){return/[",\r\n]/.test(e)?`"${e.replaceAll(`"`,`""`)}"`:e}function Q(){let[e,t]=(0,H.useState)(!1);(0,H.useEffect)(()=>le(de),[]);let n=(0,H.useRef)(null);(0,H.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(),n.current?.focus())};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[]);let[m,h]=u(`protocol`,d.withDefault(``)),[g,_]=u(`asset`,d.withDefault(``)),[v,y]=u(`model`,d.withDefault(``)),[x,S]=u(`member`,d.withDefault(``)),[C,w]=u(`perPage`,f.withDefault($e)),T=tt(C),ae=o(e=>e.assetCount),E=c({queryKey:s.tags.manifest(ae),queryFn:()=>a(`/manifest`,r.manifest),placeholderData:i}),D=E.data??null,O=E.isError,he=E.isPending&&!D&&!O,k=ve(E.error,`Failed to fetch manifest.`),A=D?.tags??[],j=D?.summary?.enabledProtocols??[],M=(0,H.useDeferredValue)(x),N=(0,H.useMemo)(()=>A.filter(e=>e.kind===`variable`),[A]),P=(0,H.useMemo)(()=>{let e=new Map;for(let t of N)e.set(t.asset,(e.get(t.asset)??0)+1);return[...e.entries()].sort((e,t)=>e[0].localeCompare(t[0]))},[N]),B=(0,H.useMemo)(()=>{let e=new Map;for(let t of N)e.set(t.model,(e.get(t.model)??0)+1);return[...e.entries()].sort((e,t)=>e[0].localeCompare(t[0]))},[N]),V=(0,H.useMemo)(()=>{let e=M.trim().toLowerCase();if(!m&&!g&&!v&&!e)return N;let t=[];for(let n of N)m&&n.protocols[m]==null||g&&n.asset!==g||v&&n.model!==v||e&&!n.member.toLowerCase().includes(e)||t.push(n);return t},[N,m,g,v,M]),[De,Oe]=(0,H.useState)([]),[Me,Pe]=(0,H.useState)({}),[U,W]=(0,H.useState)(0),Fe=m!==``||g!==``||v!==``||x!==``,Ie=(0,H.useCallback)(()=>{h(``),_(``),y(``),S(``),W(0)},[h,_,y,S]),G=Ce({data:V,columns:Xe,getCoreRowModel:Te(),getSortedRowModel:we(),getExpandedRowModel:Se(),getRowCanExpand:()=>!0,getPaginationRowModel:xe(),onSortingChange:Oe,onExpandedChange:Pe,onPaginationChange:e=>{let t=typeof e==`function`?e({pageIndex:U,pageSize:T}):e;W(t.pageIndex),w(t.pageSize)},state:{sorting:De,expanded:Me,pagination:{pageIndex:U,pageSize:T}}}),K=Math.ceil(V.length/T);(0,H.useEffect)(()=>{C!==T&&w(T)},[T,C,w]),(0,H.useEffect)(()=>{K>0&&U>=K&&W(K-1)},[K,U]);let Le=(0,H.useCallback)(e=>{W(0),w(e)},[w]),Re=(0,H.useCallback)(e=>{W(0),h(e)},[h]),ze=(0,H.useCallback)(e=>{W(0),_(e)},[_]),q=(0,H.useCallback)(e=>{W(0),y(e)},[y]),J=(0,H.useCallback)(e=>{W(0),S(e)},[S]),[Be,Ve]=(0,H.useState)(``),[X,Je]=(0,H.useState)(``),Z=(0,H.useDeferredValue)(Be),Q=(0,H.useDeferredValue)(X),rt=(0,H.useMemo)(()=>(Z?P.filter(([e])=>ee(e,Z)):P).slice(0,et),[P,Z]),it=(0,H.useMemo)(()=>(Q?B.filter(([e])=>te(e,Q)):B).slice(0,et),[B,Q]),at=G.getRowModel().rows,$=at.length,ot=$===0||V.length===0?0:U*T+1,st=$===0||V.length===0?0:U*T+$,ct=K,lt=V.length===0||ct===0?0:U+1,ut=(0,H.useCallback)(()=>{let e=m?[m]:j,t=[`asset`,`member`,`model`,`dataType`,`unit`,`access`,`browsePath`,...e.includes(`mqtt`)?[`mqtt_topic`]:[],...e.includes(`opcua`)?[`opcua_nodeId`]:[],...e.includes(`modbus`)?[`modbus_address`,`modbus_count`,`modbus_encoding`]:[]],n=V.map(t=>{let n=t.protocols.mqtt,r=t.protocols.opcua,i=t.protocols.modbus;return[t.asset,t.member,t.model,t.dataType,t.unit??``,t.access,t.browsePath,...e.includes(`mqtt`)?[String(n?.topic??``)]:[],...e.includes(`opcua`)?[String(r?.nodeId??``)]:[],...e.includes(`modbus`)?[String(i?.address??``),String(i?.count??``),String(i?.registerType??``)]:[]]});Ze([t.map(nt).join(`,`),...n.map(e=>e.map(nt).join(`,`))].join(`
|
|
4
|
-
`),`miravo-tags.csv`)},[V,m,j]);return O&&!D?(0,Y.jsx)(_e,{className:`min-h-full`,children:(0,Y.jsx)(`div`,{className:`flex min-h-[40vh] flex-col items-center justify-center p-6 sm:p-12`,children:(0,Y.jsx)(`div`,{className:`w-full max-w-md`,children:(0,Y.jsx)(l,{message:k,onRetry:()=>void E.refetch(),isRetrying:E.isFetching})})})}):(0,Y.jsxs)(`div`,{className:`mx-auto flex w-full max-w-screen-2xl flex-col gap-5 p-4 sm:gap-6 sm:p-6`,children:[O&&D?(0,Y.jsx)(l,{message:`${k} Showing cached tags.`,onRetry:()=>void E.refetch(),isRetrying:E.isFetching}):null,(0,Y.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,Y.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,Y.jsx)(`h1`,{className:`font-heading text-2xl font-semibold tracking-tight`,children:`Tag Explorer`}),(0,Y.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:he?`Loading tag manifest...`:`${D?.summary?.totalAssets??0} assets · ${j.length} protocols`})]}),(0,Y.jsxs)(oe,{children:[(0,Y.jsxs)(fe,{render:(0,Y.jsx)(b,{variant:`outline`,size:`sm`,className:ne(Ge,`px-3`)}),children:[(0,Y.jsx)(ge,{className:`size-3.5 opacity-90`,"aria-hidden":!0}),`Export`,(0,Y.jsx)(pe,{className:`size-3 opacity-60`,"aria-hidden":!0})]}),(0,Y.jsx)(re,{align:`end`,sideOffset:6,className:ne(`min-w-[13.5rem]`,Ue),children:(0,Y.jsxs)(ce,{children:[(0,Y.jsx)(ie,{className:We,children:`Export`}),(0,Y.jsx)(se,{className:`bg-border/60`}),(0,Y.jsxs)(ue,{onClick:ut,className:Ke,children:[(0,Y.jsx)(Ne,{className:`size-3.5 shrink-0 text-primary`,"aria-hidden":!0}),`Download CSV`]}),(0,Y.jsxs)(ue,{onClick:()=>t(!0),className:Ke,children:[(0,Y.jsx)(ke,{className:`size-3.5 shrink-0 text-primary`,"aria-hidden":!0}),`Export for Integration…`]})]})})]})]}),(0,Y.jsx)(qe,{protocol:m,asset:g,model:v,member:x,enabledProtocols:j,hasFilters:Fe,memberSearchRef:n,onProtocolChange:Re,onAssetChange:ze,onModelChange:q,onMemberChange:J,onClearFilters:Ie,onAssetSearch:Ve,onModelSearch:Je,filteredAssetOptions:rt,filteredModelOptions:it}),V.length!==N.length&&N.length>0&&(0,Y.jsxs)(`p`,{className:`text-xs text-muted-foreground`,children:[`Showing`,` `,(0,Y.jsx)(`span`,{className:`font-medium tabular-nums text-foreground`,children:V.length}),` of`,` `,(0,Y.jsx)(`span`,{className:`tabular-nums`,children:N.length}),` tags`]}),(0,Y.jsx)(ye,{className:`min-w-0 py-0`,children:(0,Y.jsx)(be,{className:`p-0`,children:(0,Y.jsx)(`div`,{className:`min-w-0 overflow-auto`,children:(0,Y.jsxs)(`table`,{className:`w-full caption-bottom text-sm`,children:[(0,Y.jsx)(`thead`,{className:`sticky top-0 z-10 border-b bg-background [&_tr]:border-b`,children:G.getHeaderGroups().map(e=>(0,Y.jsx)(`tr`,{className:`border-b transition-colors hover:bg-sidebar-accent hover:text-sidebar-accent-foreground`,children:e.headers.map(e=>{let t=e.column.columnDef.meta;return(0,Y.jsx)(`th`,{className:`h-10 whitespace-nowrap px-1.5 text-left text-xs font-medium text-muted-foreground sm:px-4 ${t?.hideClass??``} ${t?.cellClass??``}`,children:e.isPlaceholder?null:Ee(e.column.columnDef.header,e.getContext())},e.id)})},e.id))}),(0,Y.jsx)(`tbody`,{className:`[&_tr:last-child]:border-0`,children:he?null:at.length>0?at.map(e=>{let t=e.getIsExpanded(),n=e.getVisibleCells();return(0,Y.jsxs)(H.Fragment,{children:[(0,Y.jsx)(`tr`,{tabIndex:0,className:`cursor-pointer border-b transition-colors hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:bg-sidebar-accent focus-visible:outline-none`,onClick:()=>e.toggleExpanded(),onKeyDown:t=>{t.key!==`Enter`&&t.key!==` `||(t.preventDefault(),e.toggleExpanded())},children:n.map(e=>{let t=e.column.columnDef.meta;return(0,Y.jsx)(`td`,{className:`whitespace-nowrap px-1.5 py-1.5 text-left sm:px-4 ${t?.hideClass??``} ${t?.cellClass??``}`,children:Ee(e.column.columnDef.cell,e.getContext())},e.id)})}),t&&(0,Y.jsx)(`tr`,{children:(0,Y.jsx)(`td`,{colSpan:n.length,className:`p-0`,children:(0,Y.jsx)(`div`,{className:`border-b`,children:(0,Y.jsx)(`div`,{className:`px-1.5 py-3 pl-6 sm:px-4 sm:pl-10`,children:(0,Y.jsx)(Ye,{tag:e.original,enabledProtocols:j})})})})})]},e.id)}):(0,Y.jsx)(`tr`,{children:(0,Y.jsx)(`td`,{colSpan:Xe.length,className:`h-32 px-2 text-center sm:px-4`,children:N.length===0?(0,Y.jsxs)(`div`,{className:`flex flex-col items-center gap-2`,children:[(0,Y.jsx)(je,{className:`size-8 text-muted-foreground`}),(0,Y.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`No tags available`}),(0,Y.jsx)(p,{to:`/catalog`,className:`text-xs text-primary underline-offset-4 hover:underline`,children:`Start a factory from the Catalog to generate tags`})]}):(0,Y.jsxs)(`p`,{className:`text-sm text-muted-foreground`,children:[`No matching tags.`,` `,(0,Y.jsx)(`span`,{className:`text-xs`,children:`Try adjusting your filters.`})]})})})})]})})})}),(0,Y.jsx)(`div`,{className:`px-3 py-2 text-xs text-muted-foreground`,children:(0,Y.jsxs)(`div`,{className:`flex flex-col gap-2 sm:flex-row sm:items-center sm:justify-between sm:gap-4`,children:[(0,Y.jsxs)(`div`,{className:`flex items-center justify-between gap-3 sm:justify-start sm:gap-5`,children:[(0,Y.jsxs)(`p`,{className:`min-w-0 leading-tight`,children:[(0,Y.jsx)(`span`,{className:`font-medium tabular-nums text-foreground`,children:ot===0?`0`:`${ot}\u2013${st}`}),` `,(0,Y.jsxs)(`span`,{className:`text-muted-foreground`,children:[`of `,V.length,` tags`]})]}),(0,Y.jsxs)(`div`,{className:`flex shrink-0 items-center gap-1.5 whitespace-nowrap`,children:[(0,Y.jsxs)(z,{value:String(T),onValueChange:e=>e&&Le(Number(e)),children:[(0,Y.jsx)(R,{className:`h-8 w-[4.25rem]`,"aria-label":`Rows per page`,children:(0,Y.jsx)(F,{})}),(0,Y.jsx)(L,{children:Qe.map(e=>(0,Y.jsx)(I,{value:String(e),children:e},e))})]}),(0,Y.jsx)(`span`,{className:`hidden text-muted-foreground sm:inline`,children:`per page`})]})]}),(0,Y.jsxs)(`nav`,{className:`flex items-center justify-center gap-2 border-border/60 border-t pt-2 sm:justify-end sm:border-0 sm:pt-0`,"aria-label":`Table pages`,children:[(0,Y.jsx)(b,{variant:`outline`,size:`sm`,className:`h-8 w-8 shrink-0 p-0`,disabled:!G.getCanPreviousPage(),onClick:()=>G.previousPage(),"aria-label":`Previous page`,children:(0,Y.jsx)(Ae,{className:`size-3.5`})}),(0,Y.jsxs)(`span`,{className:`min-w-[5ch] text-center text-sm font-medium tabular-nums whitespace-nowrap text-foreground`,children:[lt,` / `,ct]}),(0,Y.jsx)(b,{variant:`outline`,size:`sm`,className:`h-8 w-8 shrink-0 p-0`,disabled:!G.getCanNextPage(),onClick:()=>G.nextPage(),"aria-label":`Next page`,children:(0,Y.jsx)(me,{className:`size-3.5`})})]})]})}),(0,Y.jsx)(He,{open:e,onOpenChange:t,tags:V,totalTags:A.length,enabledProtocols:j,selectedAsset:g||void 0})]})}export{Q as t};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as e}from"./rolldown-runtime-COnpUsM8.js";import{c as t}from"./vendor-charts-95ykyDlI.js";import{$ as n,C as r,D as i,G as a,J as o,K as s,O as c,Q as l,R as u,U as d,V as f,W as p,X as m,Y as h,Z as g,c as ee,d as te,et as _,n as ne,nt as re,ot as v,q as y,rt as b,tt as x,y as ie}from"./api-kPM52mb-.js";import{c as S}from"./dialog-Di9Bs0FH.js";import{x as ae}from"./format-OUFL_tef.js";import{n as oe,r as se,t as ce}from"./runtime-link-ChF8TM68.js";var C=class extends d{column;constructor(e,t,n,r){super(`Invalid expression "${e}" at column ${t}: ${n}`,r),this.name=`ExpressionSyntaxError`,this.column=t}},w={min:{min:2,max:1/0,usage:`min(a, b, ...) takes at least 2 arguments`},max:{min:2,max:1/0,usage:`max(a, b, ...) takes at least 2 arguments`},clamp:{min:3,max:3,usage:`clamp(x, lo, hi) takes exactly 3 arguments`}},le=[`param`,`port`,`prev`],ue=/[A-Za-z_]/,T=/[A-Za-z0-9_]/,E=/[0-9]/,de=new Set([`+`,`-`,`*`,`/`,`(`,`)`,`,`]);function fe(e){return Object.hasOwn(w,e)}function D(e,t,n){let r=t;for(;r<e.length&&n.test(e.charAt(r));)r++;return r}function pe(e){let t=[],n=0;for(;n<e.length;){let r=e.charAt(n),i=n+1;if(/\s/.test(r))n++;else if(E.test(r)||r===`.`&&E.test(e.charAt(n+1))){let r=D(e,n,E);e.charAt(r)===`.`&&(r=D(e,r+1,E)),t.push({type:`number`,value:Number(e.slice(n,r)),column:i}),n=r}else if(ue.test(r)){let r=D(e,n,T);t.push({type:`ident`,value:e.slice(n,r),column:i}),n=r}else if(r===`$`){let r=D(e,n+1,T),a=e.slice(n+1,r);if(!le.includes(a))throw new C(e,i,`unknown reference prefix "$${a}".`,`Use $param.NAME, $port.NAME or $prev.NAME, or a bare member name for the current tick.`);let o=r+1;if(e.charAt(r)!==`.`||!ue.test(e.charAt(o)))throw new C(e,i,`"$${a}" must be followed by ".NAME".`,`Write $${a}.NAME with a name of letters, digits and underscores, e.g. $${a}.rated_rpm.`);let s=D(e,o,T);t.push({type:`ref`,prefix:a,value:e.slice(o,s),column:i}),n=s}else if(de.has(r))t.push({type:`punct`,value:r,column:i}),n++;else throw new C(e,i,`unexpected character "${r}".`,`Use only numbers, + - * /, parentheses, min/max/clamp, and references ($param.X, $port.X, $prev.X, or a member name).`)}return t.push({type:`end`,column:e.length+1}),t}var me=class{pos=0;source;tokens;constructor(e,t){this.source=e,this.tokens=t}parse(){let e=this.parseExpr(),t=this.peek();if(t.type!==`end`)throw this.error(t,`unexpected ${he(t)} after a complete expression.`,`Remove the trailing input, or join the parts with an operator (+ - * /).`);return e}peek(){return this.tokens[this.pos]}next(){let e=this.peek();return e.type!==`end`&&this.pos++,e}isPunct(e){let t=this.peek();return t.type===`punct`&&t.value===e}error(e,t,n){return new C(this.source,e.column,t,n)}expect(e,t){let n=this.peek();if(n.type===`punct`&&n.value===e){this.pos++;return}throw this.error(n,`expected "${e}" but found ${he(n)}.`,t)}parseExpr(){let e=this.parseTerm();for(;this.isPunct(`+`)||this.isPunct(`-`);)e={kind:`binary`,op:this.next().value,left:e,right:this.parseTerm()};return e}parseTerm(){let e=this.parseUnary();for(;this.isPunct(`*`)||this.isPunct(`/`);)e={kind:`binary`,op:this.next().value,left:e,right:this.parseUnary()};return e}parseUnary(){return this.isPunct(`-`)||this.isPunct(`+`)?{kind:`unary`,op:this.next().value,operand:this.parseUnary()}:this.parsePrimary()}parsePrimary(){let e=this.next();switch(e.type){case`number`:return{kind:`number`,value:e.value};case`ref`:return this.referenceNode(e.prefix,e.value);case`ident`:return this.isPunct(`(`)?this.parseCall(e):{kind:`member`,name:e.value};case`punct`:if(e.value===`(`){let e=this.parseExpr();return this.expect(`)`,`Add the missing closing parenthesis.`),e}throw this.error(e,`unexpected "${e.value}" where a value was expected.`,`Put a number, a reference, a function call or a parenthesized expression here.`);case`end`:throw this.error(e,`expression ended where a value was expected.`,`Complete the expression, e.g. remove the trailing operator.`);default:return e}}referenceNode(e,t){switch(e){case`param`:return{kind:`param`,name:t};case`port`:return{kind:`port`,name:t};default:return{kind:`previous`,name:t}}}parseCall(e){let t=e.value;if(!fe(t))throw this.error(e,`unknown function "${t}".`,`Supported functions: ${Object.keys(w).join(`, `)}. A member name cannot be followed by "(".`);this.next();let n=[this.parseExpr()];for(;this.isPunct(`,`);)this.next(),n.push(this.parseExpr());this.expect(`)`,`Close the ${t}(...) call with ")" and separate arguments with ",".`);let r=w[t];if(n.length<r.min||n.length>r.max)throw this.error(e,`${t}() called with ${n.length} argument${n.length===1?``:`s`}.`,`${r.usage}.`);return{kind:`call`,fn:t,args:n}}};function he(e){switch(e.type){case`number`:return`number ${e.value}`;case`ident`:return`name "${e.value}"`;case`ref`:return`reference "$${e.prefix}.${e.value}"`;case`punct`:return`"${e.value}"`;case`end`:return`end of expression`;default:return String(e)}}function O(e){return new me(e,pe(e)).parse()}function ge(e){let t=new Set,n=new Set,r=new Set,i=new Set,a=e=>{switch(e.kind){case`number`:return;case`member`:t.add(e.name);return;case`previous`:n.add(e.name);return;case`param`:r.add(e.name);return;case`port`:i.add(e.name);return;case`unary`:a(e.operand);return;case`binary`:a(e.left),a(e.right);return;case`call`:for(let t of e.args)a(t);return;default:}};return a(e),{members:t,previousMembers:n,params:r,ports:i}}var _e=`%.ACH.A.Hz.L.L/h.L/min.L/s.N.Pa.V.bar.cfm.count.count/m3.degC.h.kN.kVA.kW.kWh.m.m/s.m3.m3/h.min.mm.mm/min.mm/s.ppm.pu.rpm.s`.split(`.`),k=y(_e);new Set(_e);function A(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function ve(e){if(typeof e==`string`)return f.exec(e)?.[1]}function ye(e){try{let t=ge(O(e)),n=[...t.members,...[...t.previousMembers].map(e=>`$prev.${e}`),...[...t.ports].map(e=>`$port.${e}`)];return n.length>0?`"${e}" references ${n.join(`, `)}, but coefficient fields are evaluated once per asset and may only use numbers and $param.X. Fix: use the "expression" generator for member, $prev or $port references, or replace them with $param.X.`:void 0}catch(e){if(e instanceof C)return`${e.message} Fix: ${e.fix}`;throw e}}function be(e,t,n){if(!A(e)||e.type!==`weighted-sum`)return;let r=e.terms;if(Array.isArray(r))for(let e=0;e<r.length;e++){let i=r[e];A(i)&&n(i,[...t,`terms`,e])}}function xe(e,t,n){if(!A(e))return;let r=[...t,`member`],i=[...t,`previous_member`],a=[...t,`param`],o=[...t,`port`],s=[...t,`generator`];typeof e.member==`string`&&n.onMember?.(e.member,r),typeof e.previous_member==`string`&&n.onPreviousMember?.(e.previous_member,i),typeof e.param==`string`&&n.onParam?.(e.param,a),typeof e.port==`string`&&n.onPort?.(e.port,o),`generator`in e&&n.onGenerator?.(e.generator,s)}function Se(e,t,n,r,i){return{onMember:e,onPreviousMember:t,onParam:n,onPort:r,onGenerator:i}}function Ce(e,t,n,r,i,a,o){xe(e,t,Se(n,r,i,a,o))}var j=`Must be 1-64 chars and contain only letters, numbers, underscores, or hyphens.`;y([`float`,`int`,`string`,`bool`]);var we=s(`type`,[g({type:h(`float`),default:m().finite(),min:m().finite().optional(),max:m().finite().optional(),unit:k.optional()}),g({type:h(`int`),default:m().int().safe(),min:m().int().safe().optional(),max:m().int().safe().optional(),unit:k.optional()}),g({type:h(`string`),default:n(),unit:k.optional()}),g({type:h(`bool`),default:a(),unit:k.optional()})]),Te=g({default:m().finite(),unit:k.optional(),description:n().optional()}).strict(),M=x([g({member:n()}).strict(),g({previous_member:n()}).strict(),g({param:n()}).strict(),g({port:n()}).strict(),g({generator:o(()=>Ye)}).strict()]),N=n().superRefine((e,t)=>{let n=ye(e);n!==void 0&&t.addIssue({code:b.custom,message:n})}),P=x([m(),N]),Ee=x([m().finite(),N]),De={initial_value:P.default(0),gain:P.default(1),bias:P.default(0),min:m().nullable().default(null),max:m().nullable().default(null),input:M},F=g({type:h(`sine`),center:P,amplitude:m().positive(),period:m().positive()}).strict(),Oe=g({type:h(`random-walk`),min:m(),max:m(),step:m().positive()}).strict(),ke=g({type:h(`noise`),center:P,stddev:m().positive()}).strict(),Ae=g({type:h(`step`),values:p(m()).min(1),interval:m().positive()}).strict(),je=g({type:h(`correlated`),source:n().regex(u,j),factor:Ee,offset:Ee,power:m().int().positive().optional()}).strict(),Me=g({from:n(),to:n(),rate_per_hour:m().finite().nonnegative().optional(),on:n().optional()}).strict(),I=g({type:h(`state-machine`),states:p(n()).min(1),initial:n(),transitions:p(Me).min(1)}).strict();function L(e,t){let n=new Set(e.states);n.has(e.initial)||t.addIssue({code:b.custom,path:[`initial`],message:`State machine initial state "${e.initial}" is not in states. Fix: Set initial to one of: ${e.states.join(`, `)}.`});for(let r=0;r<e.transitions.length;r++){let i=e.transitions[r];i&&(n.has(i.from)||t.addIssue({code:b.custom,path:[`transitions`,r,`from`],message:`State machine transition from "${i.from}" references a state that is not in states. Fix: Add "${i.from}" to states or change transition.from to one of: ${e.states.join(`, `)}.`}),n.has(i.to)||t.addIssue({code:b.custom,path:[`transitions`,r,`to`],message:`State machine transition to "${i.to}" references a state that is not in states. Fix: Add "${i.to}" to states or change transition.to to one of: ${e.states.join(`, `)}.`}))}}I.superRefine(L);var Ne=g({type:h(`ramp`),start_value:m().default(0),rate:m(),duration:m().nonnegative(),start_time:m().default(0),min:m().nullable().default(null),max:m().nullable().default(null)}).strict(),R=g({type:h(`mean-reverting-noise`),mean:P,tau:m().positive(),sigma:m().positive(),initial_value:m().optional(),min:m().nullable().default(null),max:m().nullable().default(null)}).strict(),Pe=g({time:m().nonnegative(),value:m()}),z=g({type:h(`timetable`),points:p(Pe).min(2),repeat:a().default(!1),interpolation:y([`linear`,`step`]).default(`linear`)}).strict(),Fe=g({type:h(`waveform`),shape:y([`sawtooth`,`triangle`,`square`,`pulse`]),center:P,amplitude:m().positive(),period:m().positive(),duty_cycle:m().min(0).max(1).default(.5)}).strict(),Ie=g({type:h(`chirp`),center:P,amplitude:m().positive(),start_freq_hz:m().positive(),end_freq_hz:m().positive(),sweep_duration:m().positive(),sweep:y([`linear`,`exponential`]).default(`linear`),repeat:a().default(!0)}).strict(),B=g({type:h(`impulse`),baseline:m().default(0),amplitude:m(),rate_per_hour:m().finite().nonnegative().optional(),interval:m().positive().optional(),decay:m().min(0).max(1).optional(),duration_s:m().finite().positive().default(1)}).strict();function V(e,t){e.rate_per_hour===void 0&&e.interval===void 0&&t.addIssue({code:b.custom,path:[`rate_per_hour`],message:`Impulse generator requires either rate_per_hour or interval. Fix: Add rate_per_hour: 36 or interval: 60 (simulated seconds between triggers).`}),e.rate_per_hour!==void 0&&e.interval!==void 0&&t.addIssue({code:b.custom,path:[`interval`],message:`Impulse generator cannot have both rate_per_hour and interval. Fix: Remove one: use rate_per_hour for random triggers, or interval for periodic triggers.`})}B.superRefine(V);var Le=g({type:h(`first-order-lag`),tau:m().positive(),...De}).strict(),Re=g({type:h(`integrator`),initial_value:P.default(0),gain:P.default(1),bias_rate:m().default(0),min:m().default(-1/0),max:m().default(1/0),wrap:a().default(!1),wrap_at:m().nullable().default(null),input:M}).strict(),ze=g({type:h(`transport-delay`),delay:x([m().nonnegative(),N]),initial_value:m().optional(),interpolation:y([`linear`,`zoh`]).default(`linear`),input:M}).strict(),Be=g({type:h(`slew-rate-limiter`),rate_up:m().positive(),rate_down:m().positive().optional(),initial_value:P.default(0),min:m().nullable().default(null),max:m().nullable().default(null),input:M}).strict(),Ve=g({type:h(`second-order`),natural_freq_hz:m().positive(),damping_ratio:m().positive(),initial_velocity:m().default(0),...De,min:P.nullable().default(null),max:P.nullable().default(null)}).strict(),He=g({type:h(`hysteresis-relay`),on_threshold:P,off_threshold:P,output_on:x([m(),n()]).default(1),output_off:x([m(),n()]).default(0),initial_state:y([`on`,`off`]).default(`off`),mode:y([`rising`,`falling`]).default(`rising`),input:M}).strict(),Ue=g({weight:P.default(1),input:M}),We=g({type:h(`weighted-sum`),bias:P.default(0),terms:p(Ue).min(1),min:P.nullable().default(null),max:P.nullable().default(null)}).strict(),Ge=g({type:h(`expression`),expression:n().min(1),min:P.nullable().default(null),max:P.nullable().default(null)}).strict();function Ke(e,t){try{O(e.expression)}catch(e){if(!(e instanceof C))throw e;t.addIssue({code:b.custom,path:[`expression`],message:`${e.message} Fix: ${e.fix}`})}}var qe=g({type:h(`gate`),enabled_member:n().regex(u,j),input:M,disabled_value:x([m(),n(),a()])}).strict(),Je=s(`type`,[F,Oe,ke,Ae,je,I,Ne,R,z,Fe,Ie,B]).superRefine((e,t)=>{e.type===`state-machine`&&L(e,t),e.type===`impulse`&&V(e,t)}),Ye=s(`type`,[F,Oe,ke,Ae,je,I,Ne,R,z,Fe,Ie,B,g({type:h(`health-dependent`),stages:l(n(),Je)}).strict(),Le,Re,ze,Be,Ve,He,We,Ge,qe]).superRefine((e,t)=>{e.type===`state-machine`&&L(e,t),e.type===`impulse`&&V(e,t),e.type===`expression`&&Ke(e,t)}),Xe=g({multiplier:m().finite().optional(),offset:m().finite().optional()}).strict(),Ze=g({scrap_rate_add:m().finite().nonnegative().optional(),name:n().min(1),duration_hours:_([m().nonnegative(),m().nonnegative()]).refine(([e,t])=>e<=t,{message:`duration_hours max must be greater than or equal to min.`}),effects:l(n(),Xe)}),Qe=g({interval_hours:m().finite().positive(),restores_to:n().optional()}).strict(),$e=g({running_member:n().optional(),stages:p(Ze).min(1),maintenance:Qe.optional()}).superRefine((e,t)=>{let n=new Set;for(let r=0;r<e.stages.length;r++){let i=e.stages[r];i&&(n.has(i.name)&&t.addIssue({code:b.custom,path:[`stages`,r,`name`],message:`Lifecycle stage names must be unique. Duplicate "${i.name}". Fix: Rename one stage so each lifecycle stage has a unique name.`}),n.add(i.name))}let r=e.maintenance?.restores_to;r!==void 0&&!n.has(r)&&t.addIssue({code:b.custom,path:[`maintenance`,`restores_to`],message:`Lifecycle maintenance restores_to "${r}" is not a lifecycle stage. Fix: use one of [${[...n].join(`, `)}].`})}),et=g({multiplier:m().finite().optional(),offset:m().finite().optional(),spike:m().finite().optional(),quality:y([`uncertain`,`bad`]).optional(),duration_s:m().finite().positive().optional(),onset_s:m().finite().positive().optional(),recovery_s:m().finite().positive().optional()}).strict(),tt=g({condition:n().optional(),lifecycle_stage:n().optional(),rate_per_hour:m().finite().nonnegative()}).strict(),nt=g({duration_s:m().finite().positive(),effects:l(n(),g({multiplier:m().finite().optional(),offset:m().finite().optional()}).strict()).refine(e=>Object.keys(e).length>0,{message:`Precursor effects must target at least one member.`})}).strict(),rt=g({production_effect:x([h(`stop`),g({derate:m().finite().positive().max(1)}).strict(),g({scrap:m().finite().min(0).max(1)}).strict()]).optional(),name:n().regex(u,j),trigger:tt,effects:l(n(),x([et,n()])),precursor:nt.optional()}).strict();g({path:n().min(1),name:n().min(1),description:n().optional(),memberCount:m().int().nonnegative(),methodCount:m().int().nonnegative(),faultCount:m().int().nonnegative(),hasLifecycle:a(),lifecycleStageCount:m().int().nonnegative()}),g({path:n().min(1),id:n().min(1),name:n().min(1),description:n().optional(),areaCount:m().int().nonnegative(),assetAssignmentCount:m().int().nonnegative(),uniqueModelCount:m().int().nonnegative(),modelNames:p(n().min(1)),totalAssetCount:m().int().nonnegative()});var it=g({severity:y([`error`,`warning`]),message:n(),fix:n(),file:n().optional(),line:m().int().positive().optional()});g({valid:a(),templatePath:n(),issues:p(it)});var at=n().min(1).max(128).regex(/^[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$/),H=y([`Boolean`,`Int32`,`UInt16`,`UInt32`,`Double`,`Float`,`String`]);y([`variable`,`property`]);var ot=y([`read`,`readwrite`,`write`]),st=y([`>`,`>=`,`<`,`<=`,`==`,`!=`]),ct=`Must be 1-64 chars and contain only letters, numbers, underscores, or hyphens.`,lt=s(`type`,[g({type:h(`threshold`),member:n().regex(u,ct),operator:st,threshold:m().finite()}).strict(),g({type:h(`lifecycle-stage`)}).strict(),g({type:h(`health-state`)}).strict(),g({type:h(`fault-active`)}).strict(),g({type:h(`fault-count`)}).strict(),g({type:h(`active-fault-code`),fallback:n().default(``)}).strict(),g({type:h(`availability-state`),member:n().regex(u,ct),operator:st.default(`>`),threshold:m().finite().default(0),running_state:n().default(`running`),stopped_state:n().default(`stopped`),faulted_state:n().default(`faulted`)}).strict()]),U=`Must be 1-64 chars and contain only letters, numbers, underscores, or hyphens.`,W=p(n().min(1)).min(1),ut=g({data_type:H,unit:k.optional(),description:n().optional(),enum_values:W.optional()}).strict(),dt=x([g({member:n().regex(u,U),value:x([m(),n(),a()])}).strict(),g({member:n().regex(u,U),argument:n().regex(u,U)}).strict()]),ft=g({type:h(`set-members`),writes:p(dt).min(1)}).strict(),pt=x([g({parameter:n().regex(u,U),value:m().finite()}).strict(),g({parameter:n().regex(u,U),argument:n().regex(u,U)}).strict()]),mt=s(`type`,[ft,g({type:h(`set-parameters`),writes:p(pt).min(1)}).strict(),g({type:h(`clear-faults`)}).strict(),g({type:h(`reset-lifecycle`),stage:n().min(1).optional(),clear_faults:a().optional()}).strict()]),ht=g({description:n().optional(),input_arguments:l(n().regex(u,U),ut).optional(),output_arguments:l(n().regex(u,U),ut).optional(),runtime:mt.optional()}).strict(),gt=l(n().regex(u,U),ht);function G(e){return e===`Double`||e===`Float`||e===`Int32`||e===`UInt16`||e===`UInt32`}function _t(e){return e===`Int32`||e===`UInt16`||e===`UInt32`}function K(e,t){switch(t){case`Boolean`:return typeof e==`boolean`;case`String`:return typeof e==`string`;case`Double`:case`Float`:return typeof e==`number`&&Number.isFinite(e);case`Int32`:return typeof e==`number`&&Number.isSafeInteger(e)&&e>=-2147483648&&e<=2147483647;case`UInt16`:return typeof e==`number`&&Number.isSafeInteger(e)&&e>=0&&e<=65535;case`UInt32`:return typeof e==`number`&&Number.isSafeInteger(e)&&e>=0&&e<=4294967295;default:return!1}}function vt(e,t,n){e.unit!==void 0&&(e.data_type===`Boolean`||e.data_type===`String`)&&t.addIssue({code:b.custom,path:[...n,`unit`],message:`Members with data_type "${e.data_type}" must not declare engineering units. Fix: remove the unit or use a numeric data_type.`}),e.enum_values&&e.data_type!==`String`&&t.addIssue({code:b.custom,path:[...n,`enum_values`],message:`enum_values is only valid for String members. Fix: remove enum_values or change data_type to "String".`})}function q(e,t,n,r,i){if(A(e)&&typeof e.type==`string`)switch(e.type){case`correlated`:typeof e.source==`string`&&n.push({member:e.source,path:[...t,`source`],previousTick:!1}),Y(e.factor,[...t,`factor`],r),Y(e.offset,[...t,`offset`],r);return;case`sine`:case`noise`:case`waveform`:case`chirp`:Y(e.center,[...t,`center`],r);return;case`mean-reverting-noise`:Y(e.mean,[...t,`mean`],r);return;case`second-order`:Y(e.initial_value,[...t,`initial_value`],r),Y(e.min,[...t,`min`],r),Y(e.max,[...t,`max`],r),Y(e.gain,[...t,`gain`],r),Y(e.bias,[...t,`bias`],r),J(e.input,[...t,`input`],n,r,i);return;case`first-order-lag`:Y(e.initial_value,[...t,`initial_value`],r),Y(e.gain,[...t,`gain`],r),Y(e.bias,[...t,`bias`],r),J(e.input,[...t,`input`],n,r,i);return;case`transport-delay`:Y(e.delay,[...t,`delay`],r),J(e.input,[...t,`input`],n,r,i);return;case`integrator`:Y(e.initial_value,[...t,`initial_value`],r),Y(e.gain,[...t,`gain`],r),J(e.input,[...t,`input`],n,r,i);return;case`slew-rate-limiter`:Y(e.initial_value,[...t,`initial_value`],r),J(e.input,[...t,`input`],n,r,i);return;case`hysteresis-relay`:Y(e.on_threshold,[...t,`on_threshold`],r),Y(e.off_threshold,[...t,`off_threshold`],r),J(e.input,[...t,`input`],n,r,i);return;case`weighted-sum`:Y(e.bias,[...t,`bias`],r),Y(e.min,[...t,`min`],r),Y(e.max,[...t,`max`],r),be(e,t,(e,t)=>{Y(e.weight,[...t,`weight`],r),J(e.input,[...t,`input`],n,r,i)});return;case`expression`:{Y(e.min,[...t,`min`],r),Y(e.max,[...t,`max`],r);let a=typeof e.expression==`string`?yt(e.expression):void 0;if(!a)return;let o=[...t,`expression`];for(let e of a.members)n.push({member:e,path:o,previousTick:!1});for(let e of a.previousMembers)n.push({member:e,path:o,previousTick:!0});for(let e of a.params)r.push({param:e,path:o});for(let e of a.ports)i.push({port:e,path:o});return}case`gate`:n.push({member:String(e.enabled_member),path:[...t,`enabled_member`],previousTick:!1}),J(e.input,[...t,`input`],n,r,i);return;case`health-dependent`:{let a=e.stages;if(!A(a))return;for(let[e,o]of Object.entries(a))q(o,[...t,`stages`,e],n,r,i);return}default:return}}function J(e,t,n,r,i){Ce(e,t,(e,t)=>n.push({member:e,path:t,previousTick:!1}),(e,t)=>n.push({member:e,path:t,previousTick:!0}),(e,t)=>r.push({param:e,path:t}),(e,t)=>i.push({port:e,path:t}),(e,t)=>q(e,t,n,r,i))}function Y(e,t,n){if(typeof e!=`string`)return;let r=yt(e);if(r)for(let e of r.params)n.push({param:e,path:t})}function yt(e){try{return ge(O(e))}catch(e){if(e instanceof C)return;throw e}}function bt(e,t,n){if(!A(e))return;let r=e.type;(r===`threshold`||r===`availability-state`)&&typeof e.member==`string`&&n.push({member:e.member,path:[...t,`member`],previousTick:!1})}function X(e,t,n){if(!A(e))return;let r=e.type;if(typeof r!=`string`)return;if(r===`integrator`&&e.wrap===!0&&(typeof e.wrap_at!=`number`||!Number.isFinite(e.wrap_at)||e.wrap_at<=0)&&n.addIssue({code:b.custom,path:[...t,`wrap_at`],message:`wrap_at must be a finite number greater than 0 when wrap is true. Fix: Set wrap_at to a positive number, or set wrap to false.`}),r===`health-dependent`){let r=e.stages;if(A(r))for(let[e,i]of Object.entries(r))X(i,[...t,`stages`,e],n)}function i(e,t){!A(e)||!(`generator`in e)||X(e.generator,[...t,`generator`],n)}i(e.input,[...t,`input`]),be(e,t,(e,t)=>{i(e.input,[...t,`input`])})}function xt(e){switch(e){case`Boolean`:return!1;case`String`:return``;case`Double`:case`Float`:case`Int32`:case`UInt16`:case`UInt32`:return 0;default:return 0}}var St=p(s(`type`,[g({type:h(`white_noise`),strength:m().min(0).max(1),scale:m().positive().optional()}).strict(),g({type:h(`drift`),tau:m().positive(),sigma:m().min(0).max(1),scale:m().positive().optional()}).strict(),g({type:h(`outlier`),probability:m().min(0).max(1),magnitude:m().positive(),scale:m().positive().optional()}).strict(),g({type:h(`gap`),probability:m().min(0).max(1),duration:m().int().positive().default(10)}).strict(),g({type:h(`noise_burst`),probability:m().min(0).max(1),duration:m().int().positive().default(5),strength:m().min(0).max(1),scale:m().positive().optional()}).strict(),g({type:h(`quantize`),resolution:m().positive().optional(),bits:m().int().min(8).max(24).optional()}).strict(),g({type:h(`deadband`),absolute:m().positive().optional(),percent:m().positive().max(100).optional()}).strict(),g({type:h(`stuck`),probability:m().min(0).max(1),duration_s:x([m().positive(),_([m().positive(),m().positive()])]),quality:y([`good`,`uncertain`]).default(`good`)}).strict()])).min(1).optional(),Ct={white_noise:0,drift:0,outlier:0,noise_burst:0,quantize:1,deadband:2,stuck:2};function wt(e,t,n){let r=[],i=0,a=``;return e.forEach((e,o)=>{let s=e=>{r.push({index:o,message:e})};e.type===`quantize`?(e.resolution===void 0==(e.bits===void 0)&&s(`Member "${n}" quantize needs exactly one of resolution or bits. Fix: use "quantize: { resolution: 0.1 }" or "quantize: { bits: 12 }".`),e.bits!==void 0&&!t&&s(`Member "${n}" quantize uses bits but has no eu_range. Fix: add eu_range: [min, max] to the member, or use resolution: <number>.`)):e.type===`deadband`?(e.absolute===void 0==(e.percent===void 0)&&s(`Member "${n}" deadband needs exactly one of absolute or percent. Fix: use "deadband: { absolute: 0.5 }" or "deadband: { percent: 1 }".`),e.percent!==void 0&&!t&&s(`Member "${n}" deadband uses percent but has no eu_range. Fix: add eu_range: [min, max] to the member, or use absolute: <number>.`)):e.type===`stuck`&&Array.isArray(e.duration_s)&&e.duration_s[0]>e.duration_s[1]&&s(`Member "${n}" stuck duration_s [${e.duration_s[0]}, ${e.duration_s[1]}] has min > max. Fix: swap the values.`);let c=Ct[e.type];c!==void 0&&(c<i?s(`Member "${n}" declares "${e.type}" after "${a}". Fix: order effects as white_noise/drift/outlier/noise_burst, then quantize, then deadband/stuck.`):c>i&&(i=c,a=e.type))}),r}var Z=`Must be 1-64 chars and contain only letters, numbers, underscores, or hyphens.`,Tt=new Set([`enterprise`,`site`,`area`,`line`,`prefix`]),Et=n().regex(f,`Must be a $param.X parameter reference`),Dt=x([m(),n(),a()]),Ot=g({name:n().regex(u,Z),description:n().optional(),namespace:n().optional()}).strict(),kt=s(`kind`,[g({kind:h(`variable`),data_type:H,access:ot,unit:k.optional(),enum_values:W.optional(),eu_range:_([m(),m()]).refine(([e,t])=>e<=t,{message:`eu_range[0] (min) must be <= eu_range[1] (max).`}).optional(),generator:Ye.optional(),binding:lt.optional(),default:Dt.optional(),observation_effects:St}).strict(),g({kind:h(`property`),data_type:H,access:ot,unit:k.optional(),enum_values:W.optional(),default:x([Dt,Et]).optional()}).strict()]);function At(e){return l(n().regex(u,Z),kt).refine(e=>Object.keys(e).length>=1,{message:`Members map must have at least 1 member.`}).refine(t=>Object.keys(t).length<=e,{message:`Members map must have at most ${e} members.`}).refine(e=>!Object.keys(e).some(e=>Tt.has(e)),{message:`Member names cannot use reserved env keys: enterprise/site/area/line/prefix`})}function jt(e={}){let t=At(e.maxMembersPerModel??1e3);return g({schema_version:h(`2`),model:Ot,parameters:l(n(),we).optional(),inputs:l(n().regex(u,Z),Te).optional(),members:t,methods:gt.optional(),lifecycle:$e.optional(),faults:p(rt).optional()}).strict().superRefine((e,t)=>{let n=Object.keys(e.members),r=new Map;for(let e=0;e<n.length;e++){let t=n[e];t!==void 0&&r.set(t,e)}let i=e.lifecycle?.running_member;i!==void 0&&e.members[i]?.data_type!==`Boolean`&&t.addIssue({code:b.custom,path:[`lifecycle`,`running_member`],message:`Lifecycle running_member "${i}" must name a Boolean member of this model. Fix: define that Boolean member or change running_member.`});let a=new Set(Object.keys(e.parameters??{})),o=new Set(Object.entries(e.parameters??{}).filter(([,e])=>e.type===`float`||e.type===`int`).map(([e])=>e)),s=new Set(Object.keys(e.inputs??{}));for(let e of s){let n;if(r.has(e))n=`member`;else if(a.has(e))n=`parameter`;else continue;t.addIssue({code:b.custom,path:[`inputs`,e],message:`Input port "${e}" has the same name as a ${n}. Fix: Rename the port (for example "${e}_in") so port, member and parameter names stay distinct.`})}for(let i=0;i<n.length;i++){let c=n[i];if(c===void 0)continue;let l=e.members[c];if(!l||(vt(l,t,[`members`,c]),l.kind===`variable`&&l.generator!==void 0&&l.binding!==void 0&&t.addIssue({code:b.custom,path:[`members`,c,`binding`],message:`Variable members cannot define both "generator" and "binding". Fix: keep one source of value generation.`}),l.kind===`variable`&&l.binding!==void 0&&l.access!==`read`&&t.addIssue({code:b.custom,path:[`members`,c,`access`],message:`Variable members with a "binding" must use access "read". Fix: change access to "read" or remove the binding.`}),l.kind!==`variable`||!l.generator&&!l.binding))continue;let u=[],d=[],f=[],p=[`members`,c,`generator`];if(l.generator&&q(l.generator,p,u,d,f),l.binding&&bt(l.binding,[`members`,c,`binding`],u),l.generator&&(X(l.generator,p,t),l.generator.type===`gate`)){let n=e.members[l.generator.enabled_member];n&&n.data_type!==`Boolean`&&t.addIssue({code:b.custom,path:[`members`,c,`generator`,`enabled_member`],message:`Gate generator for "${c}" references "${l.generator.enabled_member}", but "${l.generator.enabled_member}" is not Boolean. Fix: use a Boolean command/state member for enabled_member.`}),K(l.generator.disabled_value,l.data_type)||t.addIssue({code:b.custom,path:[`members`,c,`generator`,`disabled_value`],message:`Gate generator disabled_value for "${c}" does not match data_type "${l.data_type}". Fix: use a compatible disabled_value literal.`})}for(let e of u){let n=r.get(e.member);if(n===void 0){t.addIssue({code:b.custom,path:[...e.path],message:`Member "${c}" references member "${e.member}", but "${e.member}" is not defined. Fix: Define "${e.member}" in members, or change the reference to a parameter.`});continue}!e.previousTick&&n>=i&&t.addIssue({code:b.custom,path:[...e.path],message:`Member "${c}" references member "${e.member}" which is defined later (or is itself). Members are evaluated in declaration order. Fix: Move "${e.member}" above "${c}".`})}for(let e of f)s.has(e.port)||t.addIssue({code:b.custom,path:[...e.path],message:`Member "${c}" reads input port "${e.port}", but "${e.port}" is not declared. Fix: Declare it under inputs (for example inputs: { ${e.port}: { default: 0 } }), or use { member: ... } / { param: ... }.`});for(let n of d)a.has(n.param)?o.has(n.param)||t.addIssue({code:b.custom,path:[...n.path],message:`Member "${c}" references parameter "${n.param}" in a numeric position, but "${n.param}" has type "${e.parameters?.[n.param]?.type}". Only float and int parameters can be used as generator coefficients or inputs. Fix: Change "${n.param}" to type "float" or "int".`}):t.addIssue({code:b.custom,path:[...n.path],message:`Member "${c}" references parameter "${n.param}", but "${n.param}" is not defined. Fix: Define "${n.param}" under parameters, or replace "$param.${n.param}" with a literal value.`});if(l.binding)switch(l.binding.type){case`threshold`:l.data_type!==`Boolean`&&t.addIssue({code:b.custom,path:[`members`,c,`data_type`],message:`Members using binding.type "threshold" must use data_type "Boolean". Fix: change data_type to "Boolean".`}),Mt(c,l.binding.member,e,t,[`members`,c,`binding`,`member`]);break;case`availability-state`:l.data_type!==`String`&&t.addIssue({code:b.custom,path:[`members`,c,`data_type`],message:`Members using binding.type "availability-state" must use data_type "String". Fix: change data_type to "String".`}),Mt(c,l.binding.member,e,t,[`members`,c,`binding`,`member`]);break;case`lifecycle-stage`:case`health-state`:case`active-fault-code`:l.data_type!==`String`&&t.addIssue({code:b.custom,path:[`members`,c,`data_type`],message:`Members using binding.type "${l.binding.type}" must use data_type "String". Fix: change data_type to "String".`});break;case`fault-active`:l.data_type!==`Boolean`&&t.addIssue({code:b.custom,path:[`members`,c,`data_type`],message:`Members using binding.type "fault-active" must use data_type "Boolean". Fix: change data_type to "Boolean".`});break;case`fault-count`:l.data_type!==`Int32`&&l.data_type!==`UInt16`&&l.data_type!==`UInt32`&&t.addIssue({code:b.custom,path:[`members`,c,`data_type`],message:`Members using binding.type "fault-count" must use an integer data_type (Int32, UInt16, or UInt32). Fix: change data_type to an integer type.`});break;default:l.binding}if(l.kind===`variable`&&l.observation_effects){G(l.data_type)||t.addIssue({code:b.custom,path:[`members`,c,`observation_effects`],message:`Observation effects on "${c}" require a numeric data_type (Double, Float, Int32, UInt16, or UInt32). Member has data_type "${l.data_type}", which cannot be degraded by noise, gaps, or drift. Fix: remove observation_effects, or change data_type to a numeric type.`}),l.access!==`read`&&t.addIssue({code:b.custom,path:[`members`,c,`observation_effects`],message:`Observation effects on "${c}" require access "read". Observation effects corrupt values — they must not be applied to command targets or setpoints. Fix: change access to "read" or remove observation_effects.`});for(let e=0;e<l.observation_effects.length;e++){let n=l.observation_effects[e];n&&(n.type===`white_noise`||n.type===`drift`||n.type===`outlier`||n.type===`noise_burst`)&&!(`scale`in n&&n.scale!==void 0)&&!l.eu_range&&t.addIssue({code:b.custom,path:[`members`,c,`observation_effects`,e],message:`Member "${c}" uses relative observation effect "${n.type}" but has no eu_range and no explicit scale. Fix: add eu_range: [min, max] to the member, or add scale: <number> to the effect.`})}for(let e of wt(l.observation_effects,l.eu_range,c))t.addIssue({code:b.custom,path:[`members`,c,`observation_effects`,e.index],message:e.message})}}function c(n,i,a){if(!r.has(n)){t.addIssue({code:b.custom,path:[...i],message:`${a} has effect on "${n}", but "${n}" is not a defined member. Fix: Change "${n}" to a valid member name.`});return}let o=e.members[n];o&&o.kind!==`variable`&&t.addIssue({code:b.custom,path:[...i],message:`${a} has effect on "${n}", but "${n}" is a property (kind: "property"). Effects can only target variable members.`})}if(e.lifecycle){let t=[`lifecycle`,`stages`];for(let n of e.lifecycle.stages)for(let e of Object.keys(n.effects))c(e,t,`Lifecycle stage "${n.name}"`)}if(e.faults){let n=new Set;for(let r=0;r<e.faults.length;r++){let i=e.faults[r];if(!i)continue;n.has(i.name)&&t.addIssue({code:b.custom,path:[`faults`,r,`name`],message:`Fault names must be unique. Duplicate "${i.name}". Fix: Rename one fault so each fault has a unique name.`}),n.add(i.name);let a=[`faults`,r,`effects`];for(let e of Object.keys(i.effects))c(e,a,`Fault "${i.name}"`);for(let e of Object.keys(i.precursor?.effects??{}))c(e,[`faults`,r,`precursor`,`effects`],`Fault "${i.name}" precursor`)}}for(let r of n){let n=e.members[r];if(!n||n.kind!==`property`||typeof n.default!=`string`)continue;let i=ve(n.default);i!==void 0&&!a.has(i)&&t.addIssue({code:b.custom,path:[`members`,r,`default`],message:`Property "${r}" default references parameter "${i}", but "${i}" is not defined. Fix: Define "${i}" under parameters, or use a literal value.`})}if(e.methods)for(let[n,r]of Object.entries(e.methods))Nt(n,r.input_arguments,t,[`methods`,n,`input_arguments`]),Nt(n,r.output_arguments,t,[`methods`,n,`output_arguments`]),Pt(n,r,e,t,[`methods`,n,`runtime`])})}function Mt(e,t,n,r,i){let a=n.members[t];a&&(G(a.data_type)||r.addIssue({code:b.custom,path:[...i],message:`Member "${e}" binding references "${t}", but "${t}" is not numeric. Fix: bind to a numeric member or change the source member data_type.`}))}function Nt(e,t,n,r){if(t)for(let[i,a]of Object.entries(t))a.unit!==void 0&&(a.data_type===`Boolean`||a.data_type===`String`)&&n.addIssue({code:b.custom,path:[...r,i,`unit`],message:`Method "${e}" argument "${i}" uses data_type "${a.data_type}" and must not declare an engineering unit. Fix: remove the unit or use a numeric data_type.`}),a.enum_values&&a.data_type!==`String`&&n.addIssue({code:b.custom,path:[...r,i,`enum_values`],message:`Method "${e}" argument "${i}" can only use enum_values with data_type "String". Fix: remove enum_values or change the data_type.`})}function Pt(e,t,n,r,i){let a=t.runtime;if(a)switch(a.type){case`clear-faults`:return;case`reset-lifecycle`:{if(!n.lifecycle){r.addIssue({code:b.custom,path:[...i],message:`Method "${e}" uses runtime "reset-lifecycle" but the model has no lifecycle. Fix: add a lifecycle block or remove the method.`});return}let t=n.lifecycle.stages.map(e=>e.name);a.stage!==void 0&&!t.includes(a.stage)&&r.addIssue({code:b.custom,path:[...i,`stage`],message:`Method "${e}" stage "${a.stage}" is not a lifecycle stage. Fix: use one of [${t.join(`, `)}].`});return}case`set-parameters`:for(let o=0;o<a.writes.length;o++){let s=a.writes[o];if(!s)continue;let c=[...i,`writes`,o],l=n.parameters?.[s.parameter];if(!l){r.addIssue({code:b.custom,path:[...c,`parameter`],message:`Method "${e}" runtime targets parameter "${s.parameter}", but "${s.parameter}" is not defined. Fix: target a declared parameter.`});continue}if(l.type!==`float`&&l.type!==`int`){r.addIssue({code:b.custom,path:[...c,`parameter`],message:`Method "${e}" runtime targets parameter "${s.parameter}" of type "${l.type}". Fix: use set-parameters only with float or int parameters.`});continue}if(`argument`in s){let n=t.input_arguments?.[s.argument];if(!n){r.addIssue({code:b.custom,path:[...c,`argument`],message:`Method "${e}" runtime references input argument "${s.argument}", but that argument is not defined. Fix: declare the input argument or use a literal value.`});continue}G(n.data_type)||r.addIssue({code:b.custom,path:[...c,`argument`],message:`Method "${e}" runtime argument "${s.argument}" must be numeric to write parameter "${s.parameter}". Fix: use Double, Float, Int32, UInt16, or UInt32.`}),l.type===`int`&&!_t(n.data_type)&&r.addIssue({code:b.custom,path:[...c,`argument`],message:`Method "${e}" runtime argument "${s.argument}" uses data_type "${n.data_type}" but parameter "${s.parameter}" is type "int". Fix: use Int32, UInt16, or UInt32 so runtime writes stay integer-safe.`});continue}l.type===`int`&&!Number.isSafeInteger(s.value)&&r.addIssue({code:b.custom,path:[...c,`value`],message:`Method "${e}" runtime literal for integer parameter "${s.parameter}" must be a safe integer. Fix: use a whole-number literal.`})}return;case`set-members`:for(let o=0;o<a.writes.length;o++){let s=a.writes[o];if(!s)continue;let c=[...i,`writes`,o],l=n.members[s.member];if(!l){r.addIssue({code:b.custom,path:[...c,`member`],message:`Method "${e}" runtime targets member "${s.member}", but "${s.member}" is not defined. Fix: target a declared member.`});continue}if(l.kind!==`variable`&&r.addIssue({code:b.custom,path:[...c,`member`],message:`Method "${e}" runtime targets "${s.member}", but "${s.member}" is a property. Fix: target a writable variable member.`}),l.access!==`readwrite`&&l.access!==`write`&&r.addIssue({code:b.custom,path:[...c,`member`],message:`Method "${e}" runtime targets "${s.member}", but "${s.member}" is not writable. Fix: set access to "readwrite" or "write".`}),l.kind===`variable`&&l.binding&&r.addIssue({code:b.custom,path:[...c,`member`],message:`Method "${e}" runtime targets "${s.member}", but bound members are computed at runtime. Fix: write to a command/setpoint member without a binding.`}),`argument`in s){let n=t.input_arguments?.[s.argument];if(!n){r.addIssue({code:b.custom,path:[...c,`argument`],message:`Method "${e}" runtime references input argument "${s.argument}", but that argument is not defined. Fix: declare the input argument or use a literal value.`});continue}if(K(xt(n.data_type),l.data_type)||r.addIssue({code:b.custom,path:[...c,`argument`],message:`Method "${e}" runtime argument "${s.argument}" uses data_type "${n.data_type}" which does not match target member "${s.member}" data_type "${l.data_type}". Fix: align the argument and target member data types.`}),n.enum_values&&l.enum_values){let t=n.enum_values.filter(e=>!l.enum_values?.includes(e));t.length>0&&r.addIssue({code:b.custom,path:[...c,`argument`],message:`Method "${e}" runtime argument "${s.argument}" allows values [${t.join(`, `)}] that are not valid for target member "${s.member}". Fix: align enum_values between the argument and target member.`})}continue}K(s.value,l.data_type)||r.addIssue({code:b.custom,path:[...c,`value`],message:`Method "${e}" runtime literal for "${s.member}" does not match data_type "${l.data_type}". Fix: use a compatible literal value.`}),l.enum_values&&typeof s.value==`string`&&!l.enum_values.includes(s.value)&&r.addIssue({code:b.custom,path:[...c,`value`],message:`Method "${e}" runtime literal "${s.value}" is not allowed for member "${s.member}". Fix: use one of [${l.enum_values.join(`, `)}].`})}return;default:}}jt();var Ft=x([m().finite(),n(),a()]),It=n().regex(/^[a-f0-9]{64}$/),Lt=g({id:n().min(1),model:n().min(1),browsePath:p(n().min(1)).min(1),parameters:l(n(),Ft),lifecycleStage:n().min(1),operatingHours:m().finite().nonnegative(),activeFaults:p(n().min(1)),templateId:n().min(1).optional(),protocolScope:p(c).min(1).optional(),inputBindings:l(n(),i).optional(),observationState:l(n(),l(n(),re())).optional().default({}),lifecycleState:g({stageStartHours:m().finite().nonnegative().optional(),lastMaintenanceHours:m().finite().nonnegative().optional()}).optional(),faultState:l(n(),g({remaining:m().finite(),pendingSample:a(),elapsed:m().finite(),recovering:a(),recoveryElapsed:m().finite(),recoverySeconds:m().finite(),precursor:a().optional(),precursorElapsed:m().finite().optional()})).optional().default({})}),Rt=g({templateId:n().min(1),templateName:n().min(1),templatePath:n().min(1),entryHash:It,idFloors:l(n(),m().int().nonnegative()).default({})}),zt=g({name:n().min(1),enabled:a(),config:l(n(),re()),secretPaths:p(p(n())).optional()});g({version:h(3),savedAt:n().min(1),factoryName:at,models:p(n().min(1)),assets:p(Lt),templates:p(Rt),adapters:p(zt).default([]).refine(e=>new Set(e.map(e=>e.name)).size===e.length,{message:`Duplicate adapter names. Keep one entry per adapter name in 'adapters', or delete the state file to start fresh.`})});var Bt=`group relative border border-solid border-border transition-colors hover:border-muted-foreground/25`,Vt=`group relative border border-solid border-border`,Ht=`blueprint-card ${Bt} overflow-hidden rounded-[var(--miravo-radius-stadium-sm)]`,Ut=`${Vt} w-full min-w-0 overflow-hidden rounded-[var(--miravo-radius-stadium-sm)] bg-transparent`,Wt=`${Vt} w-full min-w-0 overflow-hidden rounded-[var(--miravo-radius-stadium-sm)] bg-transparent`,Gt=`blueprint-card catalog-card-frame group relative border border-solid overflow-hidden rounded-[var(--miravo-radius-stadium-sm)]`,Kt=Gt,qt=`border-border bg-muted/40 text-primary shadow-none hover:border-muted-foreground/30 hover:bg-muted/60 hover:text-primary focus-visible:border-ring border-border bg-muted/30 hover:border-muted-foreground/35 hover:bg-muted/45 [&_svg]:text-primary`,Q=e(t(),1),Jt=new Set([`spawn`,`removeAsset`,`loadTemplate`,`unloadTemplate`,`resetFactory`,`enableAdapter`,`disableAdapter`]);function Yt(e,t){let n=e.type===`spawn`&&Array.isArray(t.data)?ae(t.data):void 0;S.success(t.message,n?{description:`Created ${n}`}:void 0)}function $(e){if(e instanceof ce){S.error(`Command not sent`,{description:e.detail});return}if(e instanceof ne){S.error(e.result.message,{description:e.result.error});return}if(r.is(e)){S.error(e.message,{description:e.hint});return}if(e instanceof TypeError){if(typeof navigator<`u`&&navigator.onLine===!1){S.error(`Command not sent`,{description:`This browser is offline — reconnect to the network and try again.`});return}let{connectionState:e}=v.getState(),t=se(e);if(t){S.error(`Command not sent`,{description:t});return}S.error(`Command failed`,{description:`Could not reach the Miravo server — it may have stopped or restarted.`});return}S.error(`Command failed`,{description:e instanceof Error?e.message:`Unknown error.`})}async function Xt(){try{let e=await ee();ie.setQueryData([`bootstrap`],e),e.authenticated?v.getState().replaceRuntime(e.runtime,{allowSameRevision:!0,allowRevisionRewind:!0}):v.getState().markUnauthenticated()}catch{}finally{ie.invalidateQueries({queryKey:[`bootstrap`]})}}function Zt(){let[e,t]=(0,Q.useState)(!1);return{mutate:(0,Q.useCallback)(e=>{try{oe(v.getState().connectionState)}catch(e){$(e);return}t(!0),te(e).then(t=>{if(Yt(e,t),Jt.has(e.type))return Xt()}).catch($).finally(()=>{t(!1)})},[]),mutateAsync:(0,Q.useCallback)(async e=>{try{oe(v.getState().connectionState)}catch(e){throw $(e),e}t(!0);try{let t=await te(e);return Yt(e,t),Jt.has(e.type)&&await Xt(),t}catch(e){throw $(e),e}finally{t(!1)}},[]),isPending:e}}export{Ht as a,qt as i,Wt as n,Gt as o,Ut as r,Kt as s,Zt as t};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/factory-CT2VYi0n.js","assets/factory-DSrBtcG2.js","assets/rolldown-runtime-COnpUsM8.js","assets/chunk-OE4NN4TA-Q4iNR9l9.js","assets/vendor-charts-95ykyDlI.js","assets/api-kPM52mb-.js","assets/vendor-ui-D8j69UH4.js","assets/query-fetch-error-C2Ec4RQS.js","assets/format-OUFL_tef.js","assets/utils-BO2u-wC_.js","assets/AnimatePresence-BZCmb1bq.js","assets/badge-D4jktT8T.js","assets/activity-Cn48I9qe.js","assets/server-CS2Tw__K.js","assets/local-flag-CPAqDO-L.js","assets/catalog-template-icons-C7KJdJJX.js","assets/chevron-down-CAk5w9Wt.js","assets/chevron-right-BfZjrUWh.js","assets/copy-button-DHm7RGJ5.js","assets/dialog-Di9Bs0FH.js","assets/tabs-bI9sskHy.js","assets/export-tab-ouFgYEU_.js","assets/download-B9e1wNK4.js","assets/source-host-miravo-D_AecPVc.js","assets/label-DWyy9MeT.js","assets/use-engine-command-mutation-DMkQxmt9.js","assets/runtime-link-ChF8TM68.js","assets/get-error-message-eGdenTLv.js","assets/circle-x-CGcRflg7.js","assets/integration-api-Bg7D1eQc.js","assets/protocol-card-B2SpAJKe.js","assets/radio-DRkzblxj.js","assets/triangle-alert-D1AraFcP.js","assets/transition-nav-link-cn4KZD6W.js","assets/plus-BbVbvFTe.js","assets/rocket-807Pf7C1.js","assets/trash-2-BJ-1df0F.js","assets/dist-CtuJWBnP.js","assets/combobox-BFEY6lgO.js","assets/checkbox-AaJhjtZk.js","assets/select-Bg6PPro0.js","assets/select-display-items-D-L3PesO.js","assets/integration-targets-BehiqWyT.js","assets/transition-types-049V0Kr0.js","assets/catalog-DN-klsod.js","assets/catalog-M-k7Y9Sp.js","assets/play-TTg_EXSa.js","assets/catalog-source-2aT9qob-.js","assets/models-CrDBHBV5.js","assets/models-jBVcY8Xd.js","assets/events-DmftG8n5.js","assets/events-D19CzgoQ.js","assets/auth-screen-backdrop-hcEYy3K4.js","assets/control-DHa2-a2v.js","assets/control-CD9UoTvu.js","assets/validation-q38DYDwu.js","assets/tags-B7e7VYVW.js","assets/tags-DJJKQRZZ.js","assets/vendor-table-Br-cHaxY.js","assets/integrations-DWW9HjH0.js","assets/integrations-DoXNrzD5.js","assets/asset-detail-tmOrYE8x.js","assets/login-BZKYK0yZ.js"])))=>i.map(i=>d[i]);
|
|
2
|
-
import{a as e}from"./rolldown-runtime-COnpUsM8.js";import{c as t}from"./vendor-charts-95ykyDlI.js";import{c as n,d as r}from"./chunk-OE4NN4TA-Q4iNR9l9.js";var i=e(t(),1),a=[{test:e=>e===`/`,load:()=>r(()=>import(`./factory-CT2VYi0n.js`),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43]))},{test:e=>e===`/catalog`,load:()=>r(()=>import(`./catalog-DN-klsod.js`),__vite__mapDeps([44,45,2,3,4,5,6,7,8,9,10,11,15,16,17,18,19,20,21,22,23,24,25,26,27,46,35,47]))},{test:e=>e===`/models`,load:()=>r(()=>import(`./models-CrDBHBV5.js`),__vite__mapDeps([48,49,2,5,4,6,7,8,9,10,11,12,16,23,20,46,34,35,47,21,22,19,24,25,26,32,39,27]))},{test:e=>e===`/events`,load:()=>r(()=>import(`./events-DmftG8n5.js`),__vite__mapDeps([50,51,2,3,4,5,6,7,8,9,10,11,52,38,16,40,41,27,26,43]))},{test:e=>e===`/control`,load:()=>r(()=>import(`./control-DHa2-a2v.js`),__vite__mapDeps([53,54,2,5,4,6,8,9,10,11,13,28,30,12,16,18,19,20,31,32,33,3,24,25,26,55,46,35,37,38,40]))},{test:e=>e===`/tags`,load:()=>r(()=>import(`./tags-B7e7VYVW.js`),__vite__mapDeps([56,57,2,3,4,5,6,7,8,9,58,14,16,17,18,19,22,37,52,38,24,40,27,42]))},{test:e=>e===`/integrations`,load:()=>r(()=>import(`./integrations-DWW9HjH0.js`),__vite__mapDeps([59,60,2,3,4,5,6,7,8,9,10,11,12,13,16,28,29,18,19,23,20,34,36,32,37,24,40,27,42]))},{test:e=>e.startsWith(`/asset/`),load:()=>r(()=>import(`./asset-detail-tmOrYE8x.js`),__vite__mapDeps([61,2,3,4,5,6,7,8,9,11,12,28,18,19,55,25,26,20,46,31,36,32,37,52,27,43]))},{test:e=>e===`/login`,load:()=>r(()=>import(`./login-BZKYK0yZ.js`),__vite__mapDeps([62,2,5,4,6,33,3,27]))}],o=new Set;function s(e){if(!e.startsWith(`/`))return null;let t=e.indexOf(`?`),n=e.indexOf(`#`),r=t===-1?n===-1?e.length:n:n===-1?t:Math.min(t,n);return e.slice(0,r)}function c(e){let t=s(e);if(!t||o.has(t))return;let n=a.find(e=>e.test(t));n&&(o.add(t),n.load().catch(()=>{o.delete(t)}))}function l(){let e=n();return(0,i.useCallback)((t,n)=>{n?.preload!==!1&&c(t),(0,i.startTransition)(()=>{n?.transitionType&&(0,i.addTransitionType)(n.transitionType),e(t,{replace:n?.replace})})},[e])}export{c as n,l as t};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{ot as e,tt as t}from"./vendor-ui-D8j69UH4.js";import{$ as n,G as r,X as i,Z as a,j as o,k as s}from"./api-kPM52mb-.js";import{c}from"./dialog-Di9Bs0FH.js";import{n as l,t as u}from"./utils-BO2u-wC_.js";import"./use-engine-command-mutation-DMkQxmt9.js";var d=l(`gauge`,[[`path`,{d:`m12 14 4-4`,key:`9kzdfg`}],[`path`,{d:`M3.34 19a10 10 0 1 1 17.32 0`,key:`19p75a`}]]),f=l(`sliders-horizontal`,[[`path`,{d:`M10 5H3`,key:`1qgfaw`}],[`path`,{d:`M12 19H3`,key:`yhmn1j`}],[`path`,{d:`M14 3v4`,key:`1sua03`}],[`path`,{d:`M16 17v4`,key:`1q0r14`}],[`path`,{d:`M21 12h-9`,key:`1o4lsq`}],[`path`,{d:`M21 19h-5`,key:`1rlt1p`}],[`path`,{d:`M21 5h-7`,key:`1oszz2`}],[`path`,{d:`M8 10v4`,key:`tgpxqk`}],[`path`,{d:`M8 12H3`,key:`a7s4jb`}]]),p=e();function m({className:e,orientation:n=`horizontal`,...r}){return(0,p.jsx)(t,{"data-slot":`separator`,orientation:n,className:u(`shrink-0 bg-border data-horizontal:h-px data-horizontal:w-full data-vertical:w-px data-vertical:self-stretch`,e),...r})}function h(){return n().trim().optional().refine(e=>e===void 0||e===``||e.length<=120,{message:`Use at most 120 characters.`}).refine(e=>e===void 0||e===``||o(e)===null,{message:`Use letters, numbers, underscores, and hyphens only.`})}var g=a({multiplier:i({message:`Speed multiplier must be a number.`}).positive(`Speed multiplier must be positive.`).finite(`Speed multiplier must be finite.`).max(1e3,`Speed multiplier cannot exceed 1000.`)});a({model:n().min(1,`Model is required.`),count:i({message:`Count must be a number.`}).int(`Count must be a whole number.`).positive(`Count must be at least 1.`).max(100,`Count cannot exceed 100.`),assetName:h(),assetPrefix:h(),protocolScope:s.optional(),dryRun:r().optional()});var _=a({assetId:n().min(1,`Asset is required.`),fault:n().min(1,`Fault name is required.`)});function v(e,t,n){if(!t.trim())return c.error(`Argument "${e}" is required.`),null;switch(n){case`Double`:case`Float`:{let n=Number(t);return Number.isFinite(n)?{value:n}:(c.error(`"${e}" must be a valid number.`),null)}case`Int32`:case`UInt16`:case`UInt32`:{let r=Number(t);return!Number.isFinite(r)||!Number.isSafeInteger(r)?(c.error(`"${e}" must be a valid integer.`),null):(n===`UInt16`||n===`UInt32`)&&r<0?(c.error(`"${e}" must be non-negative.`),null):{value:r}}case`Boolean`:return t!==`true`&&t!==`false`?(c.error(`"${e}" must be "true" or "false".`),null):{value:t===`true`};case`String`:return{value:t};default:return{value:t}}}function y(e,t){let n=e.safeParse(t);return n.success?n.data:(c.error(n.error.issues[0]?.message??`Validation error.`),null)}export{m as a,v as i,g as n,f as o,y as r,d as s,_ as t};
|
|
File without changes
|
|
File without changes
|
/package/console-dist/assets/{integration-targets-BehiqWyT.js → integration-targets-Byvdd3Or.js}
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|