@miravo/cli-linux-x64 0.9.0 → 0.10.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.
Files changed (112) hide show
  1. package/console-dist/assets/AnimatePresence-BZCmb1bq.js +9 -0
  2. package/console-dist/assets/{activity-Cy_niK56.js → activity-Cn48I9qe.js} +1 -1
  3. package/console-dist/assets/api-DybIIqOe.js +1 -0
  4. package/console-dist/assets/api-kPM52mb-.js +1 -0
  5. package/console-dist/assets/asset-detail-tmOrYE8x.js +1 -0
  6. package/console-dist/assets/{auth-screen-backdrop-CgwRhIbi.js → auth-screen-backdrop-hcEYy3K4.js} +1 -1
  7. package/console-dist/assets/badge-D4jktT8T.js +1 -0
  8. package/console-dist/assets/catalog-DN-klsod.js +1 -0
  9. package/console-dist/assets/catalog-M-k7Y9Sp.js +1 -0
  10. package/console-dist/assets/catalog-source-2aT9qob-.js +1 -0
  11. package/console-dist/assets/catalog-template-icons-C7KJdJJX.js +1 -0
  12. package/console-dist/assets/checkbox-AaJhjtZk.js +1 -0
  13. package/console-dist/assets/chevron-down-CAk5w9Wt.js +1 -0
  14. package/console-dist/assets/chevron-right-BfZjrUWh.js +1 -0
  15. package/console-dist/assets/circle-x-CGcRflg7.js +1 -0
  16. package/console-dist/assets/combobox-BFEY6lgO.js +1 -0
  17. package/console-dist/assets/control-CD9UoTvu.js +1 -0
  18. package/console-dist/assets/control-DHa2-a2v.js +1 -0
  19. package/console-dist/assets/copy-button-DHm7RGJ5.js +1 -0
  20. package/console-dist/assets/dialog-Di9Bs0FH.js +1 -0
  21. package/console-dist/assets/{download-DmUZKo9N.js → download-B9e1wNK4.js} +1 -1
  22. package/console-dist/assets/events-D19CzgoQ.js +1 -0
  23. package/console-dist/assets/events-DmftG8n5.js +1 -0
  24. package/console-dist/assets/export-tab-ouFgYEU_.js +1 -0
  25. package/console-dist/assets/factory-CT2VYi0n.js +1 -0
  26. package/console-dist/assets/factory-DSrBtcG2.js +1 -0
  27. package/console-dist/assets/{format-6q8Tnwmn.js → format-OUFL_tef.js} +1 -1
  28. package/console-dist/assets/{get-error-message-BowDodwy.js → get-error-message-eGdenTLv.js} +1 -1
  29. package/console-dist/assets/index-DuJJSpJp.js +12 -0
  30. package/console-dist/assets/index-iEV9hU2I.css +2 -0
  31. package/console-dist/assets/integration-api-Bg7D1eQc.js +2 -0
  32. package/console-dist/assets/integration-targets-BehiqWyT.js +1 -0
  33. package/console-dist/assets/integrations-DWW9HjH0.js +1 -0
  34. package/console-dist/assets/integrations-DoXNrzD5.js +1 -0
  35. package/console-dist/assets/{label-DTHSKF2S.js → label-DWyy9MeT.js} +1 -1
  36. package/console-dist/assets/local-flag-CPAqDO-L.js +1 -0
  37. package/console-dist/assets/{login-O9dnrHI9.js → login-BZKYK0yZ.js} +1 -1
  38. package/console-dist/assets/models-CrDBHBV5.js +1 -0
  39. package/console-dist/assets/models-jBVcY8Xd.js +1 -0
  40. package/console-dist/assets/{not-found-Dw4OTZHH.js → not-found-BqVny4Md.js} +1 -1
  41. package/console-dist/assets/play-TTg_EXSa.js +1 -0
  42. package/console-dist/assets/plus-BbVbvFTe.js +1 -0
  43. package/console-dist/assets/protocol-card-B2SpAJKe.js +1 -0
  44. package/console-dist/assets/{query-fetch-error-ytmF7SP9.js → query-fetch-error-C2Ec4RQS.js} +1 -1
  45. package/console-dist/assets/radio-DRkzblxj.js +1 -0
  46. package/console-dist/assets/rocket-807Pf7C1.js +1 -0
  47. package/console-dist/assets/select-Bg6PPro0.js +1 -0
  48. package/console-dist/assets/{select-display-items-BEVMAho-.js → select-display-items-D-L3PesO.js} +1 -1
  49. package/console-dist/assets/server-CS2Tw__K.js +1 -0
  50. package/console-dist/assets/source-host-miravo-D_AecPVc.js +1 -0
  51. package/console-dist/assets/tabs-bI9sskHy.js +1 -0
  52. package/console-dist/assets/tags-B7e7VYVW.js +1 -0
  53. package/console-dist/assets/tags-DJJKQRZZ.js +4 -0
  54. package/console-dist/assets/{transition-nav-link-Crj9XTbK.js → transition-nav-link-cn4KZD6W.js} +1 -1
  55. package/console-dist/assets/trash-2-BJ-1df0F.js +1 -0
  56. package/console-dist/assets/{triangle-alert-BXrJNk3g.js → triangle-alert-D1AraFcP.js} +1 -1
  57. package/console-dist/assets/use-engine-command-mutation-DMkQxmt9.js +1 -0
  58. package/console-dist/assets/use-transition-navigate-BiV2QCcA.js +2 -0
  59. package/console-dist/assets/validation-q38DYDwu.js +1 -0
  60. package/console-dist/assets/vendor-ui-D8j69UH4.js +1 -0
  61. package/console-dist/index.html +55 -50
  62. package/miravo +2 -2
  63. package/package.json +1 -1
  64. package/console-dist/assets/AnimatePresence-CPmH1DMY.js +0 -9
  65. package/console-dist/assets/api-0DOQsu1W.js +0 -1
  66. package/console-dist/assets/api-DdyA1QMC.js +0 -1
  67. package/console-dist/assets/arrow-right-BjBb4z7g.js +0 -1
  68. package/console-dist/assets/arrow-up-down-C1oJAmrw.js +0 -1
  69. package/console-dist/assets/asset-detail-D-coMgED.js +0 -1
  70. package/console-dist/assets/badge-DuuEINVl.js +0 -1
  71. package/console-dist/assets/catalog-Ca9rhNLN.js +0 -1
  72. package/console-dist/assets/catalog-CdbAE0Ki.js +0 -1
  73. package/console-dist/assets/catalog-source-CPFWtBJF.js +0 -1
  74. package/console-dist/assets/catalog-template-icons-aec8m5-A.js +0 -1
  75. package/console-dist/assets/checkbox-BL44aFel.js +0 -1
  76. package/console-dist/assets/circle-question-mark-CJvcT6V6.js +0 -1
  77. package/console-dist/assets/combobox-B5iFVe7N.js +0 -1
  78. package/console-dist/assets/control-CtvncuAA.js +0 -1
  79. package/console-dist/assets/control-DYdEZmP0.js +0 -1
  80. package/console-dist/assets/copy-button-RVCJ3aqM.js +0 -1
  81. package/console-dist/assets/dropdown-menu-82O7jPU6.js +0 -1
  82. package/console-dist/assets/events-Bp3BqWYo.js +0 -1
  83. package/console-dist/assets/events-D5uZ2cwr.js +0 -1
  84. package/console-dist/assets/fleet-CBXZ0Xts.js +0 -1
  85. package/console-dist/assets/fleet-CRB8-QDg.js +0 -1
  86. package/console-dist/assets/index-BPmjm3uU.css +0 -2
  87. package/console-dist/assets/index-Chh5Cd8X.js +0 -12
  88. package/console-dist/assets/integration-targets-ChYQ8POe.js +0 -1
  89. package/console-dist/assets/integrations-BrZWbG5Q.js +0 -1
  90. package/console-dist/assets/integrations-D4x6ee5M.js +0 -1
  91. package/console-dist/assets/layers-1figUpjG.js +0 -1
  92. package/console-dist/assets/models-BDeOqKQk.js +0 -1
  93. package/console-dist/assets/models-CgWCVmnx.js +0 -1
  94. package/console-dist/assets/proxy-Be4WzmcS.js +0 -1
  95. package/console-dist/assets/select-Cg2u0NQI.js +0 -1
  96. package/console-dist/assets/shallow-Cin0mLuv.js +0 -1
  97. package/console-dist/assets/spawn-protocol-scope-picker-DDi-hZwj.js +0 -1
  98. package/console-dist/assets/tabs-BJs5Kci7.js +0 -1
  99. package/console-dist/assets/tags-CcmWc8Xj.js +0 -1
  100. package/console-dist/assets/tags-DnyhyxDB.js +0 -4
  101. package/console-dist/assets/tooltip-D1ydB4g3.js +0 -1
  102. package/console-dist/assets/use-engine-command-mutation-OZ8_Roso.js +0 -1
  103. package/console-dist/assets/use-integration-stream-CFkuEB9r.js +0 -2
  104. package/console-dist/assets/use-transition-navigate-BBXUEW59.js +0 -2
  105. package/console-dist/assets/validation-BvXCKp12.js +0 -1
  106. package/console-dist/assets/vendor-ui-CWUk2ulb.js +0 -1
  107. /package/console-dist/assets/{chunk-OE4NN4TA-DBWZidbW.js → chunk-OE4NN4TA-Q4iNR9l9.js} +0 -0
  108. /package/console-dist/assets/{dist-xY0pK9Wy.js → dist-CtuJWBnP.js} +0 -0
  109. /package/console-dist/assets/{runtime-link-D-uJbw97.js → runtime-link-ChF8TM68.js} +0 -0
  110. /package/console-dist/assets/{transition-types-CPlGtM8w.js → transition-types-049V0Kr0.js} +0 -0
  111. /package/console-dist/assets/{utils-XFKvwlFT.js → utils-BO2u-wC_.js} +0 -0
  112. /package/console-dist/assets/{vendor-table-BAHQgdwg.js → vendor-table-Br-cHaxY.js} +0 -0
@@ -0,0 +1 @@
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 +1 @@
1
- import{at as e}from"./vendor-ui-CWUk2ulb.js";import{t}from"./utils-XFKvwlFT.js";var n=e();function r({className:e,...r}){return(0,n.jsx)(`label`,{"data-slot":`label`,className:t(`flex items-center gap-2 text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50`,e),...r})}export{r as t};
1
+ import{ot as e}from"./vendor-ui-D8j69UH4.js";import{t}from"./utils-BO2u-wC_.js";var n=e();function r({className:e,...r}){return(0,n.jsx)(`label`,{"data-slot":`label`,className:t(`flex items-center gap-2 text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50`,e),...r})}export{r as t};
@@ -0,0 +1 @@
1
+ import{F as e,I as t,L as n,M as r,N as i,P as a,R as o,j as s,ot as c,tt as l}from"./vendor-ui-D8j69UH4.js";import{n as u,t as d}from"./utils-BO2u-wC_.js";var f=u(`arrow-up-down`,[[`path`,{d:`m21 16-4 4-4-4`,key:`f6ql7i`}],[`path`,{d:`M17 20V4`,key:`1ejh1v`}],[`path`,{d:`m3 8 4-4 4 4`,key:`11wl7u`}],[`path`,{d:`M7 4v16`,key:`1glfcx`}]]),p=c();function m({...e}){return(0,p.jsx)(r,{"data-slot":`dropdown-menu`,...e})}function h({...e}){return(0,p.jsx)(s,{"data-slot":`dropdown-menu-trigger`,...e})}function g({align:t=`start`,alignOffset:n=0,side:r=`bottom`,sideOffset:o=4,className:s,...c}){return(0,p.jsx)(a,{children:(0,p.jsx)(i,{className:`isolate z-50 outline-none`,align:t,alignOffset:n,side:r,sideOffset:o,children:(0,p.jsx)(e,{"data-slot":`dropdown-menu-content`,className:d(`z-50 max-h-(--available-height) w-(--anchor-width) min-w-32 origin-(--transform-origin) overflow-x-hidden overflow-y-auto rounded-[var(--miravo-radius-stadium-sm)] bg-popover p-1 text-popover-foreground shadow-md ring-1 ring-foreground/10 duration-100 outline-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:overflow-hidden data-closed:fade-out-0 data-closed:zoom-out-95`,s),...c})})})}function _({...e}){return(0,p.jsx)(o,{"data-slot":`dropdown-menu-group`,...e})}function v({className:e,inset:t,...r}){return(0,p.jsx)(n,{"data-slot":`dropdown-menu-label`,"data-inset":t,className:d(`px-1.5 py-1 text-xs font-medium text-muted-foreground data-inset:pl-7`,e),...r})}function y({className:e,inset:n,variant:r=`default`,...i}){return(0,p.jsx)(t,{"data-slot":`dropdown-menu-item`,"data-inset":n,"data-variant":r,className:d(`group/dropdown-menu-item relative flex cursor-pointer items-center gap-1.5 rounded-[var(--miravo-radius-tight)] px-1.5 py-1 text-sm 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-inset:pl-7 data-[variant=destructive]:text-destructive data-[variant=destructive]:data-[highlighted]:bg-destructive/10 data-[variant=destructive]:data-[highlighted]:text-destructive data-[variant=destructive]:data-[highlighted]:bg-destructive/20 data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 data-[variant=destructive]:*:[svg]:text-destructive`,e),...i})}function b({className:e,...t}){return(0,p.jsx)(l,{"data-slot":`dropdown-menu-separator`,className:d(`-mx-1 my-1 h-px bg-border`,e),...t})}var x=`miravo:factory-getting-started:tags-visited`;function S(e){try{return localStorage.getItem(e)===`1`}catch{return!1}}function C(e){try{localStorage.setItem(e,`1`)}catch{}}export{g as a,v as c,f as d,m as i,b as l,S as n,_ as o,C as r,y as s,x as t,h as u};
@@ -1,4 +1,4 @@
1
- import{a as e}from"./rolldown-runtime-COnpUsM8.js";import{c as t}from"./vendor-charts-95ykyDlI.js";import{at as n}from"./vendor-ui-CWUk2ulb.js";import{l as r,r as i,y as a}from"./api-DdyA1QMC.js";import{t as o}from"./use-transition-navigate-BBXUEW59.js";import{t as s}from"./transition-nav-link-Crj9XTbK.js";import{n as c}from"./get-error-message-BowDodwy.js";var l=e(t(),1),u=n(),d=`
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{l as r,r as i,y as a}from"./api-kPM52mb-.js";import{t as o}from"./use-transition-navigate-BiV2QCcA.js";import{t as s}from"./transition-nav-link-cn4KZD6W.js";import{n as c}from"./get-error-message-eGdenTLv.js";var l=e(t(),1),u=n(),d=`
2
2
  @keyframes readout-appear {
3
3
  from { opacity: 0; transform: translateY(8px) scale(0.95); }
4
4
  to { opacity: 1; transform: translateY(0) scale(1); }
@@ -0,0 +1 @@
1
+ import{t as e}from"./models-jBVcY8Xd.js";export{e as ModelsPage};
@@ -0,0 +1 @@
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 +1 @@
1
- import{at as e}from"./vendor-ui-CWUk2ulb.js";import{n as t,s as n}from"./chunk-OE4NN4TA-DBWZidbW.js";import{n as r}from"./utils-XFKvwlFT.js";import{t as i}from"./triangle-alert-BXrJNk3g.js";import{n as a}from"./auth-screen-backdrop-CgwRhIbi.js";var o=r(`arrow-up-right`,[[`path`,{d:`M7 7h10v10`,key:`1tivn9`}],[`path`,{d:`M7 17 17 7`,key:`1vkiza`}]]),s=r(`house`,[[`path`,{d:`M15 21v-8a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1v8`,key:`5wwlr5`}],[`path`,{d:`M3 10a2 2 0 0 1 .709-1.528l7-6a2 2 0 0 1 2.582 0l7 6A2 2 0 0 1 21 10v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z`,key:`r6nss1`}]]),c=e();function l(){let e=n();return(0,c.jsx)(a,{className:`min-h-full px-6 py-8 md:px-8`,children:(0,c.jsx)(`div`,{className:`mx-auto flex min-h-[calc(100svh-9rem)] max-w-3xl items-center justify-center`,children:(0,c.jsx)(`section`,{className:`relative w-full overflow-hidden rounded-[var(--miravo-radius-stadium-lg)] border border-primary/20 bg-transparent p-8 md:p-10`,children:(0,c.jsxs)(`div`,{className:`relative space-y-8`,children:[(0,c.jsxs)(`div`,{className:`space-y-4`,children:[(0,c.jsx)(`p`,{className:`font-mono text-xs uppercase tracking-[0.4em] text-muted-foreground`,children:`Fault code 404`}),(0,c.jsxs)(`div`,{className:`flex items-end gap-4`,children:[(0,c.jsx)(`span`,{className:`font-heading text-7xl font-black leading-none tracking-[-0.08em] text-transparent [-webkit-text-stroke:1px_color-mix(in_srgb,var(--primary)_55%,transparent)] md:text-9xl`,children:`404`}),(0,c.jsx)(`div`,{className:`mb-2 h-px flex-1 bg-linear-to-r from-primary/60 to-transparent`})]}),(0,c.jsxs)(`div`,{className:`max-w-2xl space-y-3`,children:[(0,c.jsx)(`h1`,{className:`text-4xl font-semibold tracking-[-0.04em] text-foreground md:text-5xl`,children:`Route not found in the control surface`}),(0,c.jsx)(`p`,{className:`max-w-xl text-base text-muted-foreground md:text-lg`,children:`This address does not map to an active console view.`})]})]}),(0,c.jsxs)(`div`,{className:`rounded-[var(--miravo-radius-stadium-sm)] border border-border/80 bg-background/55 p-5 backdrop-blur-sm`,children:[(0,c.jsxs)(`div`,{className:`mb-3 flex items-center gap-2 font-mono text-[0.7rem] uppercase tracking-[0.28em] text-muted-foreground`,children:[(0,c.jsx)(i,{className:`size-3.5 text-primary`}),`Requested path`]}),(0,c.jsx)(`code`,{className:`block overflow-x-auto rounded-[var(--miravo-radius-stadium-sm)] border border-primary/15 bg-background/30 px-4 py-3 font-mono text-sm text-primary`,children:e.pathname})]}),(0,c.jsxs)(`div`,{className:`flex flex-wrap gap-3`,children:[(0,c.jsxs)(t,{to:`/`,className:`inline-flex items-center gap-2 rounded-[var(--miravo-radius-pill)] border border-foreground/15 bg-foreground px-4 py-2.5 font-medium text-background transition hover:bg-foreground/90`,children:[(0,c.jsx)(s,{className:`size-4`}),`Return to Fleet`]}),(0,c.jsxs)(t,{to:`/catalog`,className:`group inline-flex items-center gap-3 rounded-[var(--miravo-radius-pill)] border border-foreground/8 bg-background/20 px-3 py-2.5 text-foreground shadow-[inset_0_1px_0_color-mix(in_srgb,var(--foreground)_4%,transparent)] backdrop-blur-sm transition hover:border-primary/30 hover:bg-primary/8 hover:text-primary`,children:[(0,c.jsx)(`span`,{className:`inline-flex size-8 items-center justify-center rounded-[var(--miravo-radius-tight)] border border-foreground/8 bg-foreground/4 text-muted-foreground transition group-hover:border-primary/25 group-hover:bg-primary/12 group-hover:text-primary`,children:(0,c.jsx)(o,{className:`size-4`})}),(0,c.jsx)(`span`,{className:`font-medium tracking-[-0.01em]`,children:`Open Catalog`})]})]})]})})})})}export{l as NotFoundPage};
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};
@@ -0,0 +1 @@
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};
@@ -0,0 +1 @@
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};
@@ -0,0 +1 @@
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 +1 @@
1
- import{a as e}from"./rolldown-runtime-COnpUsM8.js";import{c as t}from"./vendor-charts-95ykyDlI.js";import{at as n}from"./vendor-ui-CWUk2ulb.js";import{Ct as r,Dt as i,Et as a,Ot as o,St as s,Tt as c,_t as l,bt as u,gt as d,ht as f,mt as p,pt as m,wt as h,xt as g,yt as _}from"./api-DdyA1QMC.js";import{C as v}from"./format-6q8Tnwmn.js";import{n as y,t as b}from"./utils-XFKvwlFT.js";var x=class extends o{constructor(e,t){super(),this.options=t,this.#e=e,this.#s=null,this.#o=f(),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 g(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&&!r(this.options,t)&&this.#e.getQueryCache().notify({type:`observerOptionsUpdated`,query:this.#t,observer:this});let i=this.hasListeners();i&&T(this.#t,n,this.options,t)&&this.#h(),this.updateResult(),i&&(this.#t!==n||g(this.options.enabled,this.#t)!==g(t.enabled,this.#t)||s(this.options.staleTime,this.#t)!==s(t.staleTime,this.#t))&&this.#g();let a=this.#_();i&&(this.#t!==n||g(this.options.enabled,this.#t)!==g(t.enabled,this.#t)||a!==this.#p)&&this.#v(a)}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(_)),t}#g(){this.#b();let e=s(this.options.staleTime,this.#t);if(d.isServer()||this.#r.isStale||!l(e))return;let t=c(this.#r.dataUpdatedAt,e)+1;this.#d=a.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,!(d.isServer()||g(this.options.enabled,this.#t)===!1||!l(this.#p)||this.#p===0)&&(this.#f=a.setInterval(()=>{(this.options.refetchIntervalInBackground||i.isFocused())&&this.#h()},this.#p))}#y(){this.#g(),this.#v(this.#_())}#b(){this.#d!==void 0&&(a.clearTimeout(this.#d),this.#d=void 0)}#x(){this.#f!==void 0&&(a.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,l={...c},d=!1,p;if(t._optimisticResults){let i=this.hasListeners(),a=!i&&C(e,t),o=i&&T(e,n,t,r);(a||o)&&(l={...l,...m(c.data,e.options)}),t._optimisticResults===`isRestoring`&&(l.fetchStatus=`idle`)}let{error:h,errorUpdatedAt:_,status:v}=l;p=l.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=u(i?.data,e,t),d=!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=u(i?.data,p,t),this.#l=p,this.#s=null}catch(e){this.#s=e}this.#s&&(h=this.#s,p=this.#l,_=Date.now(),v=`error`);let b=l.fetchStatus===`fetching`,x=v===`pending`,S=v===`error`,w=x&&b,D=p!==void 0,O={status:v,fetchStatus:l.fetchStatus,isPending:x,isSuccess:v===`success`,isError:S,isInitialLoading:w,isLoading:w,data:p,dataUpdatedAt:l.dataUpdatedAt,error:h,errorUpdatedAt:_,failureCount:l.fetchFailureCount,failureReason:l.fetchFailureReason,errorUpdateCount:l.errorUpdateCount,isFetched:e.isFetched(),isFetchedAfterMount:l.dataUpdateCount>s.dataUpdateCount||l.errorUpdateCount>s.errorUpdateCount,isFetching:b,isRefetching:b&&!x,isLoadingError:S&&!D,isPaused:l.fetchStatus===`paused`,isPlaceholderData:d,isRefetchError:S&&D,isStale:E(e,t),refetch:this.refetch,promise:this.#o,isEnabled:g(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=f())},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),!r(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){p.batch(()=>{e.listeners&&this.listeners.forEach(e=>{e(this.#r)}),this.#e.getQueryCache().notify({query:this.#t,type:`observerResultsUpdated`})})}};function S(e,t){return g(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(g(t.enabled,e)!==!1&&s(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||g(r.enabled,e)===!1)&&(!n.suspense||e.state.status!==`error`)&&E(e,n)}function E(e,t){return g(t.enabled,e)!==!1&&e.isStaleByTime(s(t.staleTime,e))}function D(e,t){return!r(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 r=n?.state.error&&typeof e.throwOnError==`function`?h(e.throwOnError,[n.state.error,n]):e.throwOnError;(e.suspense||e.experimental_prefetchInRender||r)&&(t.isReset()||(e.retryOnMount=!1))},z=e=>{O.useEffect(()=>{e.clearReset()},[e])},B=({result:e,errorResetBoundary:t,throwOnError:n,query:r,suspense:i})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&(i&&e.data===void 0||h(n,[e.error,r])),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 c=!a.getQueryCache().get(o.queryHash),[l]=O.useState(()=>new t(a,o)),u=l.getOptimisticResult(o),f=!r&&e.subscribed!==!1;if(O.useSyncExternalStore(O.useCallback(e=>{let t=f?l.subscribe(p.batchCalls(e)):_;return l.updateResult(),t},[l,f]),()=>l.getCurrentResult(),()=>l.getCurrentResult()),O.useEffect(()=>{l.setOptions(o)},[o,l]),U(o,u))throw W(o,l,i);if(B({result:u,errorResetBoundary:i,throwOnError:o.throwOnError,query:s,suspense:o.suspense}))throw u.error;return a.getDefaultOptions().queries?._experimental_afterQuery?.(o,u),o.experimental_prefetchInRender&&!d.isServer()&&H(u,r)&&(c?W(o,l,i):s?.promise)?.catch(_).finally(()=>{l.updateResult()}),o.notifyOnChangeProps?u:l.trackResult(u)}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,x as c,K as i,J as n,M as o,q as r,j as s,Y as t};
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};
@@ -0,0 +1 @@
1
+ import{n as e}from"./utils-BO2u-wC_.js";var t=e(`radio`,[[`path`,{d:`M16.247 7.761a6 6 0 0 1 0 8.478`,key:`1fwjs5`}],[`path`,{d:`M19.075 4.933a10 10 0 0 1 0 14.134`,key:`ehdyv1`}],[`path`,{d:`M4.925 19.067a10 10 0 0 1 0-14.134`,key:`1q22gi`}],[`path`,{d:`M7.753 16.239a6 6 0 0 1 0-8.478`,key:`r2q7qm`}],[`circle`,{cx:`12`,cy:`12`,r:`2`,key:`1c9p78`}]]);export{t};
@@ -0,0 +1 @@
1
+ import{n as e}from"./utils-BO2u-wC_.js";var t=e(`rocket`,[[`path`,{d:`M12 15v5s3.03-.55 4-2c1.08-1.62 0-5 0-5`,key:`qeys4`}],[`path`,{d:`M4.5 16.5c-1.5 1.26-2 5-2 5s3.74-.5 5-2c.71-.84.7-2.13-.09-2.91a2.18 2.18 0 0 0-2.91-.09`,key:`u4xsad`}],[`path`,{d:`M9 12a22 22 0 0 1 2-3.95A12.88 12.88 0 0 1 22 2c0 2.72-.78 7.5-6 11a22.4 22.4 0 0 1-4 2z`,key:`676m9`}],[`path`,{d:`M9 12H4s.55-3.03 2-4c1.62-1.08 5 .05 5 .05`,key:`92ym6u`}]]);export{t};
@@ -0,0 +1 @@
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 +1 @@
1
- import{at as e}from"./vendor-ui-CWUk2ulb.js";import{t}from"./utils-XFKvwlFT.js";var n=e();function r({className:e,...r}){return(0,n.jsx)(`div`,{className:`relative w-full overflow-x-auto`,children:(0,n.jsx)(`table`,{"data-slot":`table`,className:t(`min-w-full caption-bottom text-sm`,e),...r})})}function i({className:e,...r}){return(0,n.jsx)(`thead`,{"data-slot":`table-header`,className:t(`[&_tr]:border-b`,e),...r})}function a({className:e,...r}){return(0,n.jsx)(`tbody`,{"data-slot":`table-body`,className:t(`[&_tr:last-child]:border-0`,e),...r})}function o({className:e,...r}){return(0,n.jsx)(`tr`,{"data-slot":`table-row`,className:t(`border-b transition-colors hover:bg-sidebar-accent hover:text-sidebar-accent-foreground data-[state=selected]:bg-sidebar-accent data-[state=selected]:text-sidebar-accent-foreground`,e),...r})}function s({className:e,...r}){return(0,n.jsx)(`th`,{"data-slot":`table-head`,className:t(`h-10 px-1.5 text-left align-middle font-medium whitespace-nowrap text-foreground sm:px-2 [&:has([role=checkbox])]:pr-0`,e),...r})}function c({className:e,...r}){return(0,n.jsx)(`td`,{"data-slot":`table-cell`,className:t(`p-1.5 align-middle whitespace-nowrap sm:p-2 [&:has([role=checkbox])]:pr-0`,e),...r})}var l=[{value:`all`,label:`All events`},{value:`fault:triggered`,label:`Fault Triggered`},{value:`fault:cleared`,label:`Fault Cleared`},{value:`lifecycle:changed`,label:`Lifecycle Changed`},{value:`asset:maintenance`,label:`Maintenance`},{value:`asset:created`,label:`Asset Created`},{value:`asset:removed`,label:`Asset Removed`},{value:`engine:state-changed`,label:`Engine State`},{value:`integration:resource`,label:`Integration Resource`},{value:`integration:operation`,label:`Integration Operation`}],u=[{value:`all`,label:`All status`},{value:`healthy`,label:`Healthy`},{value:`faulted`,label:`Faulted`},{value:`quarantined`,label:`Quarantined`}];export{c as a,o as c,a as i,u as n,s as o,r,i as s,l as t};
1
+ import{ot as e}from"./vendor-ui-D8j69UH4.js";import{t}from"./utils-BO2u-wC_.js";var n=e();function r({className:e,...r}){return(0,n.jsx)(`div`,{className:`relative w-full overflow-x-auto`,children:(0,n.jsx)(`table`,{"data-slot":`table`,className:t(`min-w-full caption-bottom text-sm`,e),...r})})}function i({className:e,...r}){return(0,n.jsx)(`thead`,{"data-slot":`table-header`,className:t(`[&_tr]:border-b`,e),...r})}function a({className:e,...r}){return(0,n.jsx)(`tbody`,{"data-slot":`table-body`,className:t(`[&_tr:last-child]:border-0`,e),...r})}function o({className:e,...r}){return(0,n.jsx)(`tr`,{"data-slot":`table-row`,className:t(`border-b transition-colors hover:bg-sidebar-accent hover:text-sidebar-accent-foreground data-[state=selected]:bg-sidebar-accent data-[state=selected]:text-sidebar-accent-foreground`,e),...r})}function s({className:e,...r}){return(0,n.jsx)(`th`,{"data-slot":`table-head`,className:t(`h-10 px-1.5 text-left align-middle font-medium whitespace-nowrap text-foreground sm:px-2 [&:has([role=checkbox])]:pr-0`,e),...r})}function c({className:e,...r}){return(0,n.jsx)(`td`,{"data-slot":`table-cell`,className:t(`p-1.5 align-middle whitespace-nowrap sm:p-2 [&:has([role=checkbox])]:pr-0`,e),...r})}var l=[{value:`all`,label:`All events`},{value:`fault:triggered`,label:`Fault Triggered`},{value:`fault:cleared`,label:`Fault Cleared`},{value:`lifecycle:changed`,label:`Lifecycle Changed`},{value:`asset:maintenance`,label:`Maintenance`},{value:`asset:created`,label:`Asset Created`},{value:`asset:removed`,label:`Asset Removed`},{value:`engine:state-changed`,label:`Engine State`}],u=[{value:`all`,label:`All status`},{value:`healthy`,label:`Healthy`},{value:`faulted`,label:`Faulted`},{value:`quarantined`,label:`Quarantined`}];export{c as a,o as c,a as i,u as n,s as o,r,i as s,l as t};
@@ -0,0 +1 @@
1
+ import{n as e}from"./utils-BO2u-wC_.js";var t=e(`arrow-right`,[[`path`,{d:`M5 12h14`,key:`1ays0h`}],[`path`,{d:`m12 5 7 7-7 7`,key:`xquz4c`}]]),n=e(`info`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M12 16v-4`,key:`1dtifu`}],[`path`,{d:`M12 8h.01`,key:`e9boi3`}]]),r=e(`server`,[[`rect`,{width:`20`,height:`8`,x:`2`,y:`2`,rx:`2`,ry:`2`,key:`ngkwjq`}],[`rect`,{width:`20`,height:`8`,x:`2`,y:`14`,rx:`2`,ry:`2`,key:`iecqi9`}],[`line`,{x1:`6`,x2:`6.01`,y1:`6`,y2:`6`,key:`16zg32`}],[`line`,{x1:`6`,x2:`6.01`,y1:`18`,y2:`18`,key:`nzw8ys`}]]);export{n,t as r,r as t};
@@ -0,0 +1 @@
1
+ import{n as e}from"./utils-BO2u-wC_.js";var t=e(`eye`,[[`path`,{d:`M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0`,key:`1nclc0`}],[`circle`,{cx:`12`,cy:`12`,r:`3`,key:`1v7zrd`}]]),n=`Source host (Miravo)`,r=`Address Litmus Edge uses to reach your running Miravo factory.`;export{n,t as r,r as t};
@@ -0,0 +1 @@
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};
@@ -0,0 +1 @@
1
+ import{t as e}from"./tags-DJJKQRZZ.js";export{e as TagsPage};
@@ -0,0 +1,4 @@
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 +1 @@
1
- import{at as e}from"./vendor-ui-CWUk2ulb.js";import{r as t}from"./chunk-OE4NN4TA-DBWZidbW.js";import{n,t as r}from"./use-transition-navigate-BBXUEW59.js";var i=e();function a(e){return e.button===0&&!e.metaKey&&!e.altKey&&!e.ctrlKey&&!e.shiftKey}function o({to:e,transitionType:o,preloadOnIntent:s=!0,onClick:c,...l}){let u=r();return(0,i.jsx)(t,{...l,to:e,onMouseEnter:t=>{l.onMouseEnter?.(t),s&&n(e)},onFocus:t=>{l.onFocus?.(t),s&&n(e)},onClick:t=>{c?.(t),!t.defaultPrevented&&(l.reloadDocument||l.target&&l.target!==`_self`||l.download||a(t)&&(t.preventDefault(),u(e,{transitionType:o})))}})}export{o as t};
1
+ import{ot as e}from"./vendor-ui-D8j69UH4.js";import{r as t}from"./chunk-OE4NN4TA-Q4iNR9l9.js";import{n,t as r}from"./use-transition-navigate-BiV2QCcA.js";var i=e();function a(e){return e.button===0&&!e.metaKey&&!e.altKey&&!e.ctrlKey&&!e.shiftKey}function o({to:e,transitionType:o,preloadOnIntent:s=!0,onClick:c,...l}){let u=r();return(0,i.jsx)(t,{...l,to:e,onMouseEnter:t=>{l.onMouseEnter?.(t),s&&n(e)},onFocus:t=>{l.onFocus?.(t),s&&n(e)},onClick:t=>{c?.(t),!t.defaultPrevented&&(l.reloadDocument||l.target&&l.target!==`_self`||l.download||a(t)&&(t.preventDefault(),u(e,{transitionType:o})))}})}export{o as t};
@@ -0,0 +1 @@
1
+ import{n as e}from"./utils-BO2u-wC_.js";var t=e(`trash-2`,[[`path`,{d:`M10 11v6`,key:`nco0om`}],[`path`,{d:`M14 11v6`,key:`outv1u`}],[`path`,{d:`M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6`,key:`miytrc`}],[`path`,{d:`M3 6h18`,key:`d0wm0j`}],[`path`,{d:`M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2`,key:`e791ji`}]]);export{t};
@@ -1 +1 @@
1
- import{n as e}from"./utils-XFKvwlFT.js";var t=e(`triangle-alert`,[[`path`,{d:`m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3`,key:`wmoenq`}],[`path`,{d:`M12 9v4`,key:`juzpu7`}],[`path`,{d:`M12 17h.01`,key:`p32p05`}]]);export{t};
1
+ import{n as e}from"./utils-BO2u-wC_.js";var t=e(`triangle-alert`,[[`path`,{d:`m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3`,key:`wmoenq`}],[`path`,{d:`M12 9v4`,key:`juzpu7`}],[`path`,{d:`M12 17h.01`,key:`p32p05`}]]);export{t};