@miravo/cli-linux-x64 0.7.10 → 0.8.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/console-dist/assets/{api-2XqCNjt9.js → api-5BZroqlO.js} +1 -1
- package/console-dist/assets/api-BwgmLQCC.js +1 -0
- package/console-dist/assets/{catalog-rF7BRyRf.js → catalog-B477tO5a.js} +1 -1
- package/console-dist/assets/catalog-BRYmHbXV.js +1 -0
- package/console-dist/assets/{catalog-source-wSZa7UAP.js → catalog-source-DL6GXE84.js} +1 -1
- package/console-dist/assets/control-Dc6xLiUf.js +1 -0
- package/console-dist/assets/control-HqgjVMLG.js +1 -0
- package/console-dist/assets/events-BvwhACji.js +1 -0
- package/console-dist/assets/{events-B8fp1TQW.js → events-przfMV9x.js} +1 -1
- package/console-dist/assets/{fleet-CHhiI7Fk.js → fleet-C2Ipwzu5.js} +1 -1
- package/console-dist/assets/fleet-D3Y6h1O_.js +1 -0
- package/console-dist/assets/{get-error-message-BanmV5rD.js → get-error-message-CFs0lSQP.js} +1 -1
- package/console-dist/assets/index-AfBFCD9D.js +12 -0
- package/console-dist/assets/{instance-detail-CKgv3XYh.js → instance-detail-CQ6RO9hI.js} +1 -1
- package/console-dist/assets/{login-BaheB47i.js → login-CtfweHfy.js} +1 -1
- package/console-dist/assets/models-C57soXUz.js +1 -0
- package/console-dist/assets/models-CX3jQBRk.js +1 -0
- package/console-dist/assets/platforms-DMUEIKyH.js +1 -0
- package/console-dist/assets/{platforms-BXHQU4vT.js → platforms-nMtu3Mg5.js} +1 -1
- package/console-dist/assets/{query-fetch-error-xB4By0m0.js → query-fetch-error-2yqCNP9X.js} +1 -1
- package/console-dist/assets/spawn-protocol-scope-picker-DUXJ8giB.js +1 -0
- package/console-dist/assets/tabs-D64chVAn.js +1 -0
- package/console-dist/assets/tags-BbNGPS4O.js +1 -0
- package/console-dist/assets/{tags-CeGPTgMJ.js → tags-Cl6Nj2-E.js} +2 -2
- package/console-dist/assets/{transition-nav-link-BtuFK_Y8.js → transition-nav-link-CDSeWWsP.js} +1 -1
- package/console-dist/assets/{use-engine-command-mutation-Ct9NCDug.js → use-engine-command-mutation-CIly3RgV.js} +1 -1
- package/console-dist/assets/{use-platform-stream-BzqGhuJn.js → use-platform-stream-BBDJCrNY.js} +2 -2
- package/console-dist/assets/use-transition-navigate-Bxh77tVE.js +2 -0
- package/console-dist/assets/validation-Bt4EQDja.js +1 -0
- package/console-dist/index.html +21 -20
- package/miravo +0 -0
- package/package.json +1 -1
- package/console-dist/assets/api-DlgMZi_j.js +0 -1
- package/console-dist/assets/catalog-B1GRab9-.js +0 -1
- package/console-dist/assets/control-BOmPym_s.js +0 -1
- package/console-dist/assets/control-RK2dbhks.js +0 -1
- package/console-dist/assets/events-CVYbXGE4.js +0 -1
- package/console-dist/assets/fleet-DxLj0dPT.js +0 -1
- package/console-dist/assets/index-MRs9-toM.js +0 -12
- package/console-dist/assets/models-BygeZ9lv.js +0 -1
- package/console-dist/assets/models-CTVXBFYW.js +0 -1
- package/console-dist/assets/platforms-BHZA9Eg3.js +0 -1
- package/console-dist/assets/tabs-CDS57-lB.js +0 -1
- package/console-dist/assets/tags-CmPY4kaf.js +0 -1
- package/console-dist/assets/use-transition-navigate-D3JSD38W.js +0 -2
- package/console-dist/assets/validation-CCE5LmjQ.js +0 -1
- /package/console-dist/assets/{not-found-BbQLiHmm.js → not-found-Dw4OTZHH.js} +0 -0
- /package/console-dist/assets/{select-display-items-y2L7MHmk.js → select-display-items-Bqb6Sbg6.js} +0 -0
- /package/console-dist/assets/{vendor-table-SVvT6QrW.js → vendor-table-BAHQgdwg.js} +0 -0
|
@@ -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,St as i,_t as a,bt as o,ct as s,dt as c,ft as l,gt as u,ht as d,lt as f,mt as p,ut as m,vt as h,xt as g,yt as _}from"./api-2XqCNjt9.js";import{C as v}from"./format-B9CcV2dj.js";import{n as y,t as b}from"./utils-XFKvwlFT.js";var x=class extends r{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 u(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&&!h(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||u(this.options.enabled,this.#t)!==u(t.enabled,this.#t)||a(this.options.staleTime,this.#t)!==a(t.staleTime,this.#t))&&this.#g();let i=this.#_();r&&(this.#t!==n||u(this.options.enabled,this.#t)!==u(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(p)),t}#g(){this.#b();let e=a(this.options.staleTime,this.#t);if(c.isServer()||this.#r.isStale||!l(e))return;let t=o(this.#r.dataUpdatedAt,e)+1;this.#d=g.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,!(c.isServer()||u(this.options.enabled,this.#t)===!1||!l(this.#p)||this.#p===0)&&(this.#f=g.setInterval(()=>{(this.options.refetchIntervalInBackground||i.isFocused())&&this.#h()},this.#p))}#y(){this.#g(),this.#v(this.#_())}#b(){this.#d!==void 0&&(g.clearTimeout(this.#d),this.#d=void 0)}#x(){this.#f!==void 0&&(g.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,c=e===n?this.#n:e.state,{state:l}=e,f={...l},p=!1,h;if(t._optimisticResults){let i=this.hasListeners(),a=!i&&C(e,t),o=i&&T(e,n,t,r);(a||o)&&(f={...f,...s(l.data,e.options)}),t._optimisticResults===`isRestoring`&&(f.fetchStatus=`idle`)}let{error:g,errorUpdatedAt:_,status:v}=f;h=f.data;let y=!1;if(t.placeholderData!==void 0&&h===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`,h=d(i?.data,e,t),p=!0)}if(t.select&&h!==void 0&&!y)if(i&&h===a?.data&&t.select===this.#c)h=this.#l;else try{this.#c=t.select,h=t.select(h),h=d(i?.data,h,t),this.#l=h,this.#s=null}catch(e){this.#s=e}this.#s&&(g=this.#s,h=this.#l,_=Date.now(),v=`error`);let b=f.fetchStatus===`fetching`,x=v===`pending`,S=v===`error`,w=x&&b,D=h!==void 0,O={status:v,fetchStatus:f.fetchStatus,isPending:x,isSuccess:v===`success`,isError:S,isInitialLoading:w,isLoading:w,data:h,dataUpdatedAt:f.dataUpdatedAt,error:g,errorUpdatedAt:_,failureCount:f.fetchFailureCount,failureReason:f.fetchFailureReason,errorUpdateCount:f.errorUpdateCount,isFetched:e.isFetched(),isFetchedAfterMount:f.dataUpdateCount>c.dataUpdateCount||f.errorUpdateCount>c.errorUpdateCount,isFetching:b,isRefetching:b&&!x,isLoadingError:S&&!D,isPaused:f.fetchStatus===`paused`,isPlaceholderData:p,isRefetchError:S&&D,isStale:E(e,t),refetch:this.refetch,promise:this.#o,isEnabled:u(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),!h(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){f.batch(()=>{e.listeners&&this.listeners.forEach(e=>{e(this.#r)}),this.#e.getQueryCache().notify({query:this.#t,type:`observerResultsUpdated`})})}};function S(e,t){return u(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(u(t.enabled,e)!==!1&&a(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||u(r.enabled,e)===!1)&&(!n.suspense||e.state.status!==`error`)&&E(e,n)}function E(e,t){return u(t.enabled,e)!==!1&&e.isStaleByTime(a(t.staleTime,e))}function D(e,t){return!h(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`?_(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||_(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 l=!a.getQueryCache().get(o.queryHash),[u]=O.useState(()=>new t(a,o)),d=u.getOptimisticResult(o),m=!r&&e.subscribed!==!1;if(O.useSyncExternalStore(O.useCallback(e=>{let t=m?u.subscribe(f.batchCalls(e)):p;return u.updateResult(),t},[u,m]),()=>u.getCurrentResult(),()=>u.getCurrentResult()),O.useEffect(()=>{u.setOptions(o)},[o,u]),U(o,d))throw W(o,u,i);if(B({result:d,errorResetBoundary:i,throwOnError:o.throwOnError,query:s,suspense:o.suspense}))throw d.error;return a.getDefaultOptions().queries?._experimental_afterQuery?.(o,d),o.experimental_prefetchInRender&&!c.isServer()&&H(d,r)&&(l?W(o,u,i):s?.promise)?.catch(p).finally(()=>{u.updateResult()}),o.notifyOnChangeProps?d:u.trackResult(d)}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{at as n}from"./vendor-ui-CWUk2ulb.js";import{Ct as r,St as i,_t as a,bt as o,dt as s,ft as c,gt as l,ht as u,lt as d,pt as f,ut as p,vt as m,wt as h,xt as g,yt as _}from"./api-5BZroqlO.js";import{C as v}from"./format-B9CcV2dj.js";import{n as y,t as b}from"./utils-XFKvwlFT.js";var x=class extends h{constructor(e,t){super(),this.options=t,this.#e=e,this.#s=null,this.#o=s(),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 a(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&&!_(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||a(this.options.enabled,this.#t)!==a(t.enabled,this.#t)||m(this.options.staleTime,this.#t)!==m(t.staleTime,this.#t))&&this.#g();let i=this.#_();r&&(this.#t!==n||a(this.options.enabled,this.#t)!==a(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(u)),t}#g(){this.#b();let e=m(this.options.staleTime,this.#t);if(c.isServer()||this.#r.isStale||!f(e))return;let t=g(this.#r.dataUpdatedAt,e)+1;this.#d=i.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,!(c.isServer()||a(this.options.enabled,this.#t)===!1||!f(this.#p)||this.#p===0)&&(this.#f=i.setInterval(()=>{(this.options.refetchIntervalInBackground||r.isFocused())&&this.#h()},this.#p))}#y(){this.#g(),this.#v(this.#_())}#b(){this.#d!==void 0&&(i.clearTimeout(this.#d),this.#d=void 0)}#x(){this.#f!==void 0&&(i.clearInterval(this.#f),this.#f=void 0)}createResult(e,t){let n=this.#t,r=this.options,i=this.#r,o=this.#i,c=this.#a,u=e===n?this.#n:e.state,{state:f}=e,p={...f},m=!1,h;if(t._optimisticResults){let i=this.hasListeners(),a=!i&&C(e,t),o=i&&T(e,n,t,r);(a||o)&&(p={...p,...d(f.data,e.options)}),t._optimisticResults===`isRestoring`&&(p.fetchStatus=`idle`)}let{error:g,errorUpdatedAt:_,status:v}=p;h=p.data;let y=!1;if(t.placeholderData!==void 0&&h===void 0&&v===`pending`){let e;i?.isPlaceholderData&&t.placeholderData===c?.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`,h=l(i?.data,e,t),m=!0)}if(t.select&&h!==void 0&&!y)if(i&&h===o?.data&&t.select===this.#c)h=this.#l;else try{this.#c=t.select,h=t.select(h),h=l(i?.data,h,t),this.#l=h,this.#s=null}catch(e){this.#s=e}this.#s&&(g=this.#s,h=this.#l,_=Date.now(),v=`error`);let b=p.fetchStatus===`fetching`,x=v===`pending`,S=v===`error`,w=x&&b,D=h!==void 0,O={status:v,fetchStatus:p.fetchStatus,isPending:x,isSuccess:v===`success`,isError:S,isInitialLoading:w,isLoading:w,data:h,dataUpdatedAt:p.dataUpdatedAt,error:g,errorUpdatedAt:_,failureCount:p.fetchFailureCount,failureReason:p.fetchFailureReason,errorUpdateCount:p.errorUpdateCount,isFetched:e.isFetched(),isFetchedAfterMount:p.dataUpdateCount>u.dataUpdateCount||p.errorUpdateCount>u.errorUpdateCount,isFetching:b,isRefetching:b&&!x,isLoadingError:S&&!D,isPaused:p.fetchStatus===`paused`,isPlaceholderData:m,isRefetchError:S&&D,isStale:E(e,t),refetch:this.refetch,promise:this.#o,isEnabled:a(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=s())},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),!_(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 a(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(a(t.enabled,e)!==!1&&m(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||a(r.enabled,e)===!1)&&(!n.suspense||e.state.status!==`error`)&&E(e,n)}function E(e,t){return a(t.enabled,e)!==!1&&e.isStaleByTime(m(t.staleTime,e))}function D(e,t){return!_(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`?o(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||o(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 l=!a.getQueryCache().get(o.queryHash),[d]=O.useState(()=>new t(a,o)),f=d.getOptimisticResult(o),m=!r&&e.subscribed!==!1;if(O.useSyncExternalStore(O.useCallback(e=>{let t=m?d.subscribe(p.batchCalls(e)):u;return d.updateResult(),t},[d,m]),()=>d.getCurrentResult(),()=>d.getCurrentResult()),O.useEffect(()=>{d.setOptions(o)},[o,d]),U(o,f))throw W(o,d,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&&!c.isServer()&&H(f,r)&&(l?W(o,d,i):s?.promise)?.catch(u).finally(()=>{d.updateResult()}),o.notifyOnChangeProps?f:d.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,x as c,K as i,J as n,M as o,q as r,j as s,Y as t};
|
|
@@ -0,0 +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{t as r}from"./utils-XFKvwlFT.js";import{t as i}from"./checkbox-C84IyqEB.js";import{t as a}from"./label-DTHSKF2S.js";var o=e(t(),1),s=n(),c=[{value:`mqtt`,label:`MQTT`},{value:`opcua`,label:`OPC UA`},{value:`modbus`,label:`Modbus`}];function l({value:e,onChange:t,className:n}){let l=(0,o.useId)(),u=new Set(e);return(0,s.jsxs)(`fieldset`,{className:r(`min-w-0`,n),children:[(0,s.jsx)(`legend`,{className:`mb-2 text-xs font-medium text-foreground`,children:`Protocol exposure`}),(0,s.jsx)(`div`,{className:`grid min-w-0 gap-2 sm:grid-cols-3`,children:c.map(n=>(0,s.jsxs)(a,{htmlFor:`${l}-${n.value}`,className:`min-w-0 rounded-[var(--miravo-radius-tight)] border border-border/80 px-2.5 py-2 text-xs`,children:[(0,s.jsx)(i,{id:`${l}-${n.value}`,checked:u.has(n.value),onCheckedChange:r=>{let i=e.filter(e=>e!==n.value);r===!0&&i.push(n.value),t(i)}}),(0,s.jsx)(`span`,{children:n.label})]},n.value))}),(0,s.jsx)(`p`,{className:`mt-2 text-[11px] text-muted-foreground`,children:e.length>0?`${e.length} selected`:`Default: enabled adapters`})]})}export{l as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{at as e,d as t,f as n,m as r,p as i}from"./vendor-ui-CWUk2ulb.js";import{$ as a,D as o,G as s,H as c,J as l,K as u,Q as d,R as f,U as p,V as m,W as h,X as g,Y as _,Z as v,et as y,q as b,tt as x}from"./api-5BZroqlO.js";import{D as ee}from"./format-B9CcV2dj.js";import{n as S,t as C}from"./utils-XFKvwlFT.js";var te=S(`circle-check`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`m9 12 2 2 4-4`,key:`dzmm74`}]]),ne=S(`circle-x`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`m15 9-6 6`,key:`1uzhvr`}],[`path`,{d:`m9 9 6 6`,key:`z0biqf`}]]),re=S(`loader-circle`,[[`path`,{d:`M21 12a9 9 0 1 1-6.219-8.56`,key:`13zald`}]]),ie=S(`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`}]]);_({path:v().min(1),name:v().min(1),description:v().optional(),memberCount:l().int().nonnegative(),methodCount:l().int().nonnegative(),faultCount:l().int().nonnegative(),hasLifecycle:p(),lifecycleStageCount:l().int().nonnegative()}),_({path:v().min(1),id:v().min(1),name:v().min(1),description:v().optional(),areaCount:l().int().nonnegative(),twinAssignmentCount:l().int().nonnegative(),uniqueModelCount:l().int().nonnegative(),modelNames:c(v().min(1)),totalTwinCount:l().int().nonnegative()});var ae=_({severity:s([`error`,`warning`]),message:v(),fix:v()});_({valid:p(),templatePath:v(),issues:c(ae)});var w=`%.A.Hz.L.L/h.L/min.L/s.N.V.bar.cfm.count.degC.h.kN.kVA.kW.kWh.m.m/s.m3.m3/h.mm.mm/min.mm/s.ppm.pu.rpm.s`.split(`.`),T=s(w);new Set(w);var oe=v().min(1).max(128).regex(/^[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$/),E=s([`Boolean`,`Int32`,`UInt16`,`UInt32`,`Double`,`Float`,`String`]);s([`variable`,`property`]);var D=s([`read`,`readwrite`,`write`]),O=s([`>`,`>=`,`<`,`<=`,`==`,`!=`]),k=`Must be 1-64 chars and contain only letters, numbers, underscores, or hyphens.`,se=h(`type`,[_({type:b(`threshold`),member:v().regex(f,k),operator:O,threshold:l().finite()}).strict(),_({type:b(`lifecycle-stage`)}).strict(),_({type:b(`health-state`)}).strict(),_({type:b(`fault-active`)}).strict(),_({type:b(`fault-count`)}).strict(),_({type:b(`active-fault-code`),fallback:v().default(``)}).strict(),_({type:b(`availability-state`),member:v().regex(f,k),operator:O.default(`>`),threshold:l().finite().default(0),running_state:v().default(`running`),stopped_state:v().default(`stopped`),faulted_state:v().default(`faulted`)}).strict()]),A=`Must be 1-64 chars and contain only letters, numbers, underscores, or hyphens.`,j=c(v().min(1)).min(1),ce=_({data_type:E,unit:T.optional(),description:v().optional(),enum_values:j.optional()}).strict(),le=a([_({member:v().regex(f,A),value:a([l(),v(),p()])}).strict(),_({member:v().regex(f,A),argument:v().regex(f,A)}).strict()]),ue=_({type:b(`set-members`),writes:c(le).min(1)}).strict(),de=a([_({parameter:v().regex(f,A),value:l().finite()}).strict(),_({parameter:v().regex(f,A),argument:v().regex(f,A)}).strict()]),fe=h(`type`,[ue,_({type:b(`set-parameters`),writes:c(de).min(1)}).strict(),_({type:b(`clear-faults`)}).strict()]),pe=_({description:v().optional(),input_arguments:g(v().regex(f,A),ce).optional(),output_arguments:g(v().regex(f,A),ce).optional(),runtime:fe.optional()}).strict(),me=g(v().regex(f,A),pe);function M(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function N(e){if(typeof e==`string`)return m.exec(e)?.[1]}function P(e,t,n){if(!M(e)||e.type!==`weighted-sum`)return;let r=e.terms;if(Array.isArray(r))for(let e=0;e<r.length;e++){let i=r[e];M(i)&&n(i,[...t,`terms`,e])}}function he(e,t,n){if(!M(e))return;let r=[...t,`member`],i=[...t,`previous_member`],a=[...t,`param`],o=[...t,`generator`];typeof e.member==`string`&&n.onMember?.(e.member,r),typeof e.previous_member==`string`&&n.onPreviousMember?.(e.previous_member,i),typeof e.param==`string`&&n.onParam?.(e.param,a),`generator`in e&&n.onGenerator?.(e.generator,o)}function ge(e,t,n,r){return{onMember:e,onPreviousMember:t,onParam:n,onGenerator:r}}function _e(e,t,n,r,i,a){he(e,t,ge(n,r,i,a))}function F(e){return e===`Double`||e===`Float`||e===`Int32`||e===`UInt16`||e===`UInt32`}function ve(e){return e===`Int32`||e===`UInt16`||e===`UInt32`}function I(e,t){switch(t){case`Boolean`:return typeof e==`boolean`;case`String`:return typeof e==`string`;case`Double`:case`Float`:return typeof e==`number`&&Number.isFinite(e);case`Int32`:return typeof e==`number`&&Number.isSafeInteger(e)&&e>=-2147483648&&e<=2147483647;case`UInt16`:return typeof e==`number`&&Number.isSafeInteger(e)&&e>=0&&e<=65535;case`UInt32`:return typeof e==`number`&&Number.isSafeInteger(e)&&e>=0&&e<=4294967295;default:return!1}}function ye(e,t,n){e.unit!==void 0&&(e.data_type===`Boolean`||e.data_type===`String`)&&t.addIssue({code:x.custom,path:[...n,`unit`],message:`Members with data_type "${e.data_type}" must not declare engineering units. Fix: remove the unit or use a numeric data_type.`}),e.enum_values&&e.data_type!==`String`&&t.addIssue({code:x.custom,path:[...n,`enum_values`],message:`enum_values is only valid for String members. Fix: remove enum_values or change data_type to "String".`})}function L(e,t,n,r){if(M(e)&&typeof e.type==`string`)switch(e.type){case`correlated`:typeof e.source==`string`&&n.push({member:e.source,path:[...t,`source`],previousTick:!1}),z(e.factor,[...t,`factor`],r),z(e.offset,[...t,`offset`],r);return;case`sine`:case`noise`:case`waveform`:case`chirp`:z(e.center,[...t,`center`],r);return;case`mean-reverting-noise`:z(e.mean,[...t,`mean`],r);return;case`first-order-lag`:case`second-order`:z(e.gain,[...t,`gain`],r),z(e.bias,[...t,`bias`],r),R(e.input,[...t,`input`],n,r);return;case`transport-delay`:z(e.delay,[...t,`delay`],r),R(e.input,[...t,`input`],n,r);return;case`slew-rate-limiter`:case`integrator`:R(e.input,[...t,`input`],n,r);return;case`hysteresis-relay`:z(e.on_threshold,[...t,`on_threshold`],r),z(e.off_threshold,[...t,`off_threshold`],r),R(e.input,[...t,`input`],n,r);return;case`weighted-sum`:z(e.bias,[...t,`bias`],r),P(e,t,(e,t)=>{z(e.weight,[...t,`weight`],r),R(e.input,[...t,`input`],n,r)});return;case`gate`:n.push({member:String(e.enabled_member),path:[...t,`enabled_member`],previousTick:!1}),R(e.input,[...t,`input`],n,r);return;case`health-dependent`:{let i=e.stages;if(!M(i))return;for(let[e,a]of Object.entries(i))L(a,[...t,`stages`,e],n,r);return}default:return}}function R(e,t,n,r){_e(e,t,(e,t)=>n.push({member:e,path:t,previousTick:!1}),(e,t)=>n.push({member:e,path:t,previousTick:!0}),(e,t)=>r.push({param:e,path:t}),(e,t)=>L(e,t,n,r))}function z(e,t,n){let r=N(e);r!==void 0&&n.push({param:r,path:t})}function be(e,t,n){if(!M(e))return;let r=e.type;(r===`threshold`||r===`availability-state`)&&typeof e.member==`string`&&n.push({member:e.member,path:[...t,`member`],previousTick:!1})}function B(e,t,n){if(!M(e))return;let r=e.type;if(typeof r!=`string`)return;if(r===`integrator`&&e.wrap===!0&&(typeof e.wrap_at!=`number`||!Number.isFinite(e.wrap_at)||e.wrap_at<=0)&&n.addIssue({code:x.custom,path:[...t,`wrap_at`],message:`wrap_at must be a finite number greater than 0 when wrap is true. Fix: Set wrap_at to a positive number, or set wrap to false.`}),r===`health-dependent`){let r=e.stages;if(M(r))for(let[e,i]of Object.entries(r))B(i,[...t,`stages`,e],n)}function i(e,t){!M(e)||!(`generator`in e)||B(e.generator,[...t,`generator`],n)}i(e.input,[...t,`input`]),P(e,t,(e,t)=>{i(e.input,[...t,`input`])})}function xe(e){switch(e){case`Boolean`:return!1;case`String`:return``;case`Double`:case`Float`:case`Int32`:case`UInt16`:case`UInt32`:return 0;default:return 0}}var Se=c(h(`type`,[_({type:b(`white_noise`),strength:l().min(0).max(1),scale:l().positive().optional()}).strict(),_({type:b(`drift`),tau:l().positive(),sigma:l().min(0).max(1),scale:l().positive().optional()}).strict(),_({type:b(`outlier`),probability:l().min(0).max(1),magnitude:l().positive(),scale:l().positive().optional()}).strict(),_({type:b(`gap`),probability:l().min(0).max(1),duration:l().int().positive().default(10)}).strict(),_({type:b(`noise_burst`),probability:l().min(0).max(1),duration:l().int().positive().default(5),strength:l().min(0).max(1),scale:l().positive().optional()}).strict()])).min(1).optional(),V=`Must be 1-64 chars and contain only letters, numbers, underscores, or hyphens.`;s([`float`,`int`,`string`,`bool`]);var Ce=h(`type`,[_({type:b(`float`),default:l().finite(),min:l().finite().optional(),max:l().finite().optional(),unit:T.optional()}),_({type:b(`int`),default:l().int().safe(),min:l().int().safe().optional(),max:l().int().safe().optional(),unit:T.optional()}),_({type:b(`string`),default:v(),unit:T.optional()}),_({type:b(`bool`),default:p(),unit:T.optional()})]),H=a([_({member:v()}).strict(),_({previous_member:v()}).strict(),_({param:v()}).strict(),_({generator:u(()=>Ge)}).strict()]),U=v().regex(m,`Must be a $param.X parameter reference`),W=a([l(),U]),G=a([l().finite(),U]),K={initial_value:l().default(0),gain:W.default(1),bias:W.default(0),min:l().nullable().default(null),max:l().nullable().default(null),input:H},q=_({type:b(`sine`),center:W,amplitude:l().positive(),period:l().positive()}).strict(),we=_({type:b(`random-walk`),min:l(),max:l(),step:l().positive()}).strict(),Te=_({type:b(`noise`),center:W,stddev:l().positive()}).strict(),Ee=_({type:b(`step`),values:c(l()).min(1),interval:l().positive()}).strict(),De=_({type:b(`correlated`),source:v().regex(f,V),factor:G,offset:G,power:l().int().positive().optional()}).strict(),Oe=_({from:v(),to:v(),probability:l().min(0).max(1).optional(),on:v().optional()}).strict(),J=_({type:b(`state-machine`),states:c(v()).min(1),initial:v(),transitions:c(Oe).min(1)}).strict();function Y(e,t){let n=new Set(e.states);n.has(e.initial)||t.addIssue({code:x.custom,path:[`initial`],message:`State machine initial state "${e.initial}" is not in states. Fix: Set initial to one of: ${e.states.join(`, `)}.`});for(let r=0;r<e.transitions.length;r++){let i=e.transitions[r];i&&(n.has(i.from)||t.addIssue({code:x.custom,path:[`transitions`,r,`from`],message:`State machine transition from "${i.from}" references a state that is not in states. Fix: Add "${i.from}" to states or change transition.from to one of: ${e.states.join(`, `)}.`}),n.has(i.to)||t.addIssue({code:x.custom,path:[`transitions`,r,`to`],message:`State machine transition to "${i.to}" references a state that is not in states. Fix: Add "${i.to}" to states or change transition.to to one of: ${e.states.join(`, `)}.`}))}}J.superRefine(Y);var ke=_({type:b(`ramp`),start_value:l().default(0),rate:l(),duration:l().nonnegative(),start_time:l().default(0),min:l().nullable().default(null),max:l().nullable().default(null)}).strict(),Ae=_({type:b(`mean-reverting-noise`),mean:W,tau:l().positive(),sigma:l().positive(),initial_value:l().optional(),min:l().nullable().default(null),max:l().nullable().default(null)}).strict(),je=_({time:l().nonnegative(),value:l()}),Me=_({type:b(`timetable`),points:c(je).min(2),repeat:p().default(!1),interpolation:s([`linear`,`step`]).default(`linear`)}).strict(),Ne=_({type:b(`waveform`),shape:s([`sawtooth`,`triangle`,`square`,`pulse`]),center:W,amplitude:l().positive(),period:l().positive(),duty_cycle:l().min(0).max(1).default(.5)}).strict(),Pe=_({type:b(`chirp`),center:W,amplitude:l().positive(),start_freq_hz:l().positive(),end_freq_hz:l().positive(),sweep_duration:l().positive(),sweep:s([`linear`,`exponential`]).default(`linear`),repeat:p().default(!0)}).strict(),X=_({type:b(`impulse`),baseline:l().default(0),amplitude:l(),probability:l().min(0).max(1).optional(),interval:l().positive().optional(),decay:l().min(0).max(1).optional(),duration:l().int().positive().default(1)}).strict();function Z(e,t){e.probability===void 0&&e.interval===void 0&&t.addIssue({code:x.custom,path:[`probability`],message:`Impulse generator requires either probability or interval. Fix: Add probability: 0.01 (per-tick chance) or interval: 60 (seconds between triggers).`}),e.probability!==void 0&&e.interval!==void 0&&t.addIssue({code:x.custom,path:[`interval`],message:`Impulse generator cannot have both probability and interval. Fix: Remove one: use probability for random triggers, or interval for periodic triggers.`})}X.superRefine(Z);var Fe=_({type:b(`first-order-lag`),tau:l().positive(),...K}).strict(),Ie=_({type:b(`integrator`),initial_value:l().default(0),gain:l().default(1),bias_rate:l().default(0),min:l().default(-1/0),max:l().default(1/0),wrap:p().default(!1),wrap_at:l().nullable().default(null),input:H}).strict(),Le=_({type:b(`transport-delay`),delay:a([l().nonnegative(),U]),initial_value:l().default(0),interpolation:s([`linear`,`zoh`]).default(`linear`),input:H}).strict(),Re=_({type:b(`slew-rate-limiter`),rate_up:l().positive(),rate_down:l().positive().optional(),initial_value:l().default(0),min:l().nullable().default(null),max:l().nullable().default(null),input:H}).strict(),ze=_({type:b(`second-order`),natural_freq_hz:l().positive(),damping_ratio:l().positive(),initial_velocity:l().default(0),...K}).strict(),Be=_({type:b(`hysteresis-relay`),on_threshold:W,off_threshold:W,output_on:a([l(),v()]).default(1),output_off:a([l(),v()]).default(0),initial_state:s([`on`,`off`]).default(`off`),mode:s([`rising`,`falling`]).default(`rising`),input:H}).strict(),Ve=_({weight:W.default(1),input:H}),He=_({type:b(`weighted-sum`),bias:W.default(0),terms:c(Ve).min(1),min:l().nullable().default(null),max:l().nullable().default(null)}).strict(),Ue=_({type:b(`gate`),enabled_member:v().regex(f,V),input:H,disabled_value:a([l(),v(),p()])}).strict(),We=h(`type`,[q,we,Te,Ee,De,J,ke,Ae,Me,Ne,Pe,X]).superRefine((e,t)=>{e.type===`state-machine`&&Y(e,t),e.type===`impulse`&&Z(e,t)}),Ge=h(`type`,[q,we,Te,Ee,De,J,ke,Ae,Me,Ne,Pe,X,_({type:b(`health-dependent`),stages:g(v(),We)}).strict(),Fe,Ie,Le,Re,ze,Be,He,Ue]).superRefine((e,t)=>{e.type===`state-machine`&&Y(e,t),e.type===`impulse`&&Z(e,t)}),Ke=_({multiplier:l().finite().optional(),offset:l().finite().optional()}).strict(),qe=_({stages:c(_({name:v().min(1),duration_hours:d([l().nonnegative(),l().nonnegative()]).refine(([e,t])=>e<=t,{message:`duration_hours max must be greater than or equal to min.`}),effects:g(v(),Ke)})).min(1)}).superRefine((e,t)=>{let n=new Set;for(let r=0;r<e.stages.length;r++){let i=e.stages[r];i&&(n.has(i.name)&&t.addIssue({code:x.custom,path:[`stages`,r,`name`],message:`Lifecycle stage names must be unique. Duplicate "${i.name}". Fix: Rename one stage so each lifecycle stage has a unique name.`}),n.add(i.name))}}),Je=_({multiplier:l().finite().optional(),offset:l().finite().optional(),spike:l().finite().optional(),duration_ticks:l().int().positive().optional(),onset_ticks:l().int().positive().optional(),recovery_ticks:l().int().positive().optional()}).strict(),Ye=_({condition:v().optional(),lifecycle_stage:v().optional(),probability:l().min(0).max(1)}),Xe=_({name:v().regex(f,V),trigger:Ye,effects:g(v(),a([Je,v()]))}),Ze=`Must be 1-64 chars and contain only letters, numbers, underscores, or hyphens.`,Qe=new Set([`enterprise`,`site`,`area`,`line`,`prefix`]),$e=v().regex(m,`Must be a $param.X parameter reference`),et=a([l(),v(),p()]),tt=_({name:v().regex(f,Ze),description:v().optional(),namespace:v().optional()}).strict(),nt=h(`kind`,[_({kind:b(`variable`),data_type:E,access:D,unit:T.optional(),enum_values:j.optional(),eu_range:d([l(),l()]).refine(([e,t])=>e<=t,{message:`eu_range[0] (min) must be <= eu_range[1] (max).`}).optional(),generator:Ge.optional(),binding:se.optional(),default:et.optional(),observation_effects:Se}).strict(),_({kind:b(`property`),data_type:E,access:D,unit:T.optional(),enum_values:j.optional(),default:a([et,$e]).optional()}).strict()]);function rt(e){return g(v().regex(f,Ze),nt).refine(e=>Object.keys(e).length>=1,{message:`Members map must have at least 1 member.`}).refine(t=>Object.keys(t).length<=e,{message:`Members map must have at most ${e} members.`}).refine(e=>!Object.keys(e).some(e=>Qe.has(e)),{message:`Member names cannot use reserved env keys: enterprise/site/area/line/prefix`})}function it(e={}){let t=rt(e.maxMembersPerModel??1e3);return _({schema_version:b(`2`),model:tt,parameters:g(v(),Ce).optional(),members:t,methods:me.optional(),lifecycle:qe.optional(),faults:c(Xe).optional()}).strict().superRefine((e,t)=>{let n=Object.keys(e.members),r=new Map;for(let e=0;e<n.length;e++){let t=n[e];t!==void 0&&r.set(t,e)}let i=new Set(Object.keys(e.parameters??{})),a=new Set(Object.entries(e.parameters??{}).filter(([,e])=>e.type===`float`||e.type===`int`).map(([e])=>e));for(let o=0;o<n.length;o++){let s=n[o];if(s===void 0)continue;let c=e.members[s];if(!c||(ye(c,t,[`members`,s]),c.kind===`variable`&&c.generator!==void 0&&c.binding!==void 0&&t.addIssue({code:x.custom,path:[`members`,s,`binding`],message:`Variable members cannot define both "generator" and "binding". Fix: keep one source of value generation.`}),c.kind===`variable`&&c.binding!==void 0&&c.access!==`read`&&t.addIssue({code:x.custom,path:[`members`,s,`access`],message:`Variable members with a "binding" must use access "read". Fix: change access to "read" or remove the binding.`}),c.kind!==`variable`||!c.generator&&!c.binding))continue;let l=[],u=[],d=[`members`,s,`generator`];if(c.generator&&L(c.generator,d,l,u),c.binding&&be(c.binding,[`members`,s,`binding`],l),c.generator&&(B(c.generator,d,t),c.generator.type===`gate`)){let n=e.members[c.generator.enabled_member];n&&n.data_type!==`Boolean`&&t.addIssue({code:x.custom,path:[`members`,s,`generator`,`enabled_member`],message:`Gate generator for "${s}" references "${c.generator.enabled_member}", but "${c.generator.enabled_member}" is not Boolean. Fix: use a Boolean command/state member for enabled_member.`}),I(c.generator.disabled_value,c.data_type)||t.addIssue({code:x.custom,path:[`members`,s,`generator`,`disabled_value`],message:`Gate generator disabled_value for "${s}" does not match data_type "${c.data_type}". Fix: use a compatible disabled_value literal.`})}for(let e of l){let n=r.get(e.member);if(n===void 0){t.addIssue({code:x.custom,path:[...e.path],message:`Member "${s}" references member "${e.member}", but "${e.member}" is not defined. Fix: Define "${e.member}" in members, or change the reference to a parameter.`});continue}!e.previousTick&&n>=o&&t.addIssue({code:x.custom,path:[...e.path],message:`Member "${s}" references member "${e.member}" which is defined later (or is itself). Members are evaluated in declaration order. Fix: Move "${e.member}" above "${s}".`})}for(let n of u)i.has(n.param)?a.has(n.param)||t.addIssue({code:x.custom,path:[...n.path],message:`Member "${s}" references parameter "${n.param}" in a numeric position, but "${n.param}" has type "${e.parameters?.[n.param]?.type}". Only float and int parameters can be used as generator coefficients or inputs. Fix: Change "${n.param}" to type "float" or "int".`}):t.addIssue({code:x.custom,path:[...n.path],message:`Member "${s}" references parameter "${n.param}", but "${n.param}" is not defined. Fix: Define "${n.param}" under parameters, or replace "$param.${n.param}" with a literal value.`});if(c.binding)switch(c.binding.type){case`threshold`:c.data_type!==`Boolean`&&t.addIssue({code:x.custom,path:[`members`,s,`data_type`],message:`Members using binding.type "threshold" must use data_type "Boolean". Fix: change data_type to "Boolean".`}),at(s,c.binding.member,e,t,[`members`,s,`binding`,`member`]);break;case`availability-state`:c.data_type!==`String`&&t.addIssue({code:x.custom,path:[`members`,s,`data_type`],message:`Members using binding.type "availability-state" must use data_type "String". Fix: change data_type to "String".`}),at(s,c.binding.member,e,t,[`members`,s,`binding`,`member`]);break;case`lifecycle-stage`:case`health-state`:case`active-fault-code`:c.data_type!==`String`&&t.addIssue({code:x.custom,path:[`members`,s,`data_type`],message:`Members using binding.type "${c.binding.type}" must use data_type "String". Fix: change data_type to "String".`});break;case`fault-active`:c.data_type!==`Boolean`&&t.addIssue({code:x.custom,path:[`members`,s,`data_type`],message:`Members using binding.type "fault-active" must use data_type "Boolean". Fix: change data_type to "Boolean".`});break;case`fault-count`:c.data_type!==`Int32`&&c.data_type!==`UInt16`&&c.data_type!==`UInt32`&&t.addIssue({code:x.custom,path:[`members`,s,`data_type`],message:`Members using binding.type "fault-count" must use an integer data_type (Int32, UInt16, or UInt32). Fix: change data_type to an integer type.`});break;default:c.binding}if(c.kind===`variable`&&c.observation_effects){F(c.data_type)||t.addIssue({code:x.custom,path:[`members`,s,`observation_effects`],message:`Observation effects on "${s}" require a numeric data_type (Double, Float, Int32, UInt16, or UInt32). Member has data_type "${c.data_type}", which cannot be degraded by noise, gaps, or drift. Fix: remove observation_effects, or change data_type to a numeric type.`}),c.access!==`read`&&t.addIssue({code:x.custom,path:[`members`,s,`observation_effects`],message:`Observation effects on "${s}" require access "read". Observation effects corrupt values — they must not be applied to command targets or setpoints. Fix: change access to "read" or remove observation_effects.`});for(let e=0;e<c.observation_effects.length;e++){let n=c.observation_effects[e];n&&(n.type===`white_noise`||n.type===`drift`||n.type===`outlier`||n.type===`noise_burst`)&&!(`scale`in n&&n.scale!==void 0)&&!c.eu_range&&t.addIssue({code:x.custom,path:[`members`,s,`observation_effects`,e],message:`Member "${s}" uses relative observation effect "${n.type}" but has no eu_range and no explicit scale. Fix: add eu_range: [min, max] to the member, or add scale: <number> to the effect.`})}}}function o(n,i,a){if(!r.has(n)){t.addIssue({code:x.custom,path:[...i],message:`${a} has effect on "${n}", but "${n}" is not a defined member. Fix: Change "${n}" to a valid member name.`});return}let o=e.members[n];o&&o.kind!==`variable`&&t.addIssue({code:x.custom,path:[...i],message:`${a} has effect on "${n}", but "${n}" is a property (kind: "property"). Effects can only target variable members.`})}if(e.lifecycle){let t=[`lifecycle`,`stages`];for(let n of e.lifecycle.stages)for(let e of Object.keys(n.effects))o(e,t,`Lifecycle stage "${n.name}"`)}if(e.faults){let n=new Set;for(let r=0;r<e.faults.length;r++){let i=e.faults[r];if(!i)continue;n.has(i.name)&&t.addIssue({code:x.custom,path:[`faults`,r,`name`],message:`Fault names must be unique. Duplicate "${i.name}". Fix: Rename one fault so each fault has a unique name.`}),n.add(i.name);let a=[`faults`,r,`effects`];for(let e of Object.keys(i.effects))o(e,a,`Fault "${i.name}"`)}}for(let r of n){let n=e.members[r];if(!n||n.kind!==`property`||typeof n.default!=`string`)continue;let a=N(n.default);a!==void 0&&!i.has(a)&&t.addIssue({code:x.custom,path:[`members`,r,`default`],message:`Property "${r}" default references parameter "${a}", but "${a}" is not defined. Fix: Define "${a}" under parameters, or use a literal value.`})}if(e.methods)for(let[n,r]of Object.entries(e.methods))Q(n,r.input_arguments,t,[`methods`,n,`input_arguments`]),Q(n,r.output_arguments,t,[`methods`,n,`output_arguments`]),ot(n,r,e,t,[`methods`,n,`runtime`])})}function at(e,t,n,r,i){let a=n.members[t];a&&(F(a.data_type)||r.addIssue({code:x.custom,path:[...i],message:`Member "${e}" binding references "${t}", but "${t}" is not numeric. Fix: bind to a numeric member or change the source member data_type.`}))}function Q(e,t,n,r){if(t)for(let[i,a]of Object.entries(t))a.unit!==void 0&&(a.data_type===`Boolean`||a.data_type===`String`)&&n.addIssue({code:x.custom,path:[...r,i,`unit`],message:`Method "${e}" argument "${i}" uses data_type "${a.data_type}" and must not declare an engineering unit. Fix: remove the unit or use a numeric data_type.`}),a.enum_values&&a.data_type!==`String`&&n.addIssue({code:x.custom,path:[...r,i,`enum_values`],message:`Method "${e}" argument "${i}" can only use enum_values with data_type "String". Fix: remove enum_values or change the data_type.`})}function ot(e,t,n,r,i){let a=t.runtime;if(a)switch(a.type){case`clear-faults`:return;case`set-parameters`:for(let o=0;o<a.writes.length;o++){let s=a.writes[o];if(!s)continue;let c=[...i,`writes`,o],l=n.parameters?.[s.parameter];if(!l){r.addIssue({code:x.custom,path:[...c,`parameter`],message:`Method "${e}" runtime targets parameter "${s.parameter}", but "${s.parameter}" is not defined. Fix: target a declared parameter.`});continue}if(l.type!==`float`&&l.type!==`int`){r.addIssue({code:x.custom,path:[...c,`parameter`],message:`Method "${e}" runtime targets parameter "${s.parameter}" of type "${l.type}". Fix: use set-parameters only with float or int parameters.`});continue}if(`argument`in s){let n=t.input_arguments?.[s.argument];if(!n){r.addIssue({code:x.custom,path:[...c,`argument`],message:`Method "${e}" runtime references input argument "${s.argument}", but that argument is not defined. Fix: declare the input argument or use a literal value.`});continue}F(n.data_type)||r.addIssue({code:x.custom,path:[...c,`argument`],message:`Method "${e}" runtime argument "${s.argument}" must be numeric to write parameter "${s.parameter}". Fix: use Double, Float, Int32, UInt16, or UInt32.`}),l.type===`int`&&!ve(n.data_type)&&r.addIssue({code:x.custom,path:[...c,`argument`],message:`Method "${e}" runtime argument "${s.argument}" uses data_type "${n.data_type}" but parameter "${s.parameter}" is type "int". Fix: use Int32, UInt16, or UInt32 so runtime writes stay integer-safe.`});continue}l.type===`int`&&!Number.isSafeInteger(s.value)&&r.addIssue({code:x.custom,path:[...c,`value`],message:`Method "${e}" runtime literal for integer parameter "${s.parameter}" must be a safe integer. Fix: use a whole-number literal.`})}return;case`set-members`:for(let o=0;o<a.writes.length;o++){let s=a.writes[o];if(!s)continue;let c=[...i,`writes`,o],l=n.members[s.member];if(!l){r.addIssue({code:x.custom,path:[...c,`member`],message:`Method "${e}" runtime targets member "${s.member}", but "${s.member}" is not defined. Fix: target a declared member.`});continue}if(l.kind!==`variable`&&r.addIssue({code:x.custom,path:[...c,`member`],message:`Method "${e}" runtime targets "${s.member}", but "${s.member}" is a property. Fix: target a writable variable member.`}),l.access!==`readwrite`&&l.access!==`write`&&r.addIssue({code:x.custom,path:[...c,`member`],message:`Method "${e}" runtime targets "${s.member}", but "${s.member}" is not writable. Fix: set access to "readwrite" or "write".`}),l.kind===`variable`&&l.binding&&r.addIssue({code:x.custom,path:[...c,`member`],message:`Method "${e}" runtime targets "${s.member}", but bound members are computed at runtime. Fix: write to a command/setpoint member without a binding.`}),`argument`in s){let n=t.input_arguments?.[s.argument];if(!n){r.addIssue({code:x.custom,path:[...c,`argument`],message:`Method "${e}" runtime references input argument "${s.argument}", but that argument is not defined. Fix: declare the input argument or use a literal value.`});continue}if(I(xe(n.data_type),l.data_type)||r.addIssue({code:x.custom,path:[...c,`argument`],message:`Method "${e}" runtime argument "${s.argument}" uses data_type "${n.data_type}" which does not match target member "${s.member}" data_type "${l.data_type}". Fix: align the argument and target member data types.`}),n.enum_values&&l.enum_values){let t=n.enum_values.filter(e=>!l.enum_values?.includes(e));t.length>0&&r.addIssue({code:x.custom,path:[...c,`argument`],message:`Method "${e}" runtime argument "${s.argument}" allows values [${t.join(`, `)}] that are not valid for target member "${s.member}". Fix: align enum_values between the argument and target member.`})}continue}I(s.value,l.data_type)||r.addIssue({code:x.custom,path:[...c,`value`],message:`Method "${e}" runtime literal for "${s.member}" does not match data_type "${l.data_type}". Fix: use a compatible literal value.`}),l.enum_values&&typeof s.value==`string`&&!l.enum_values.includes(s.value)&&r.addIssue({code:x.custom,path:[...c,`value`],message:`Method "${e}" runtime literal "${s.value}" is not allowed for member "${s.member}". Fix: use one of [${l.enum_values.join(`, `)}].`})}return;default:}}it();var st=a([l().finite(),v(),p()]),ct=v().regex(/^[a-f0-9]{64}$/),lt=_({id:v().min(1),model:v().min(1),browsePath:c(v().min(1)).min(1),parameters:g(v(),st),lifecycleStage:v().min(1),operatingHours:l().finite().nonnegative(),activeFaults:c(v().min(1)),templateRunId:l().int().positive().optional(),protocolScope:c(o).min(1).optional(),observationState:g(v(),g(v(),y())).optional().default({}),faultState:g(v(),_({remaining:l().int(),elapsed:l().int(),recovering:p(),recoveryElapsed:l().int(),recoveryTicks:l().int()})).optional().default({})}),ut=_({templateRunId:l().int().positive(),templateName:v().min(1),templatePath:v(),entryHash:ct.optional()}),dt=_({name:v().min(1),enabled:p(),config:g(v(),y())});_({version:b(2),savedAt:v().min(1),environmentName:oe,models:c(v().min(1)),instances:c(lt),templateRuns:c(ut),adapters:c(dt).default([])});var $=e();function ft({className:e,orientation:t=`horizontal`,...n}){return(0,$.jsx)(r,{"data-slot":`tabs`,"data-orientation":t,className:C(`group/tabs flex gap-2 data-horizontal:flex-col`,e),...n})}var pt=ee(`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 mt({className:e,variant:n=`default`,...r}){return(0,$.jsx)(t,{"data-slot":`tabs-list`,"data-variant":n,className:C(pt({variant:n}),e),...r})}function ht({className:e,...t}){return(0,$.jsx)(i,{"data-slot":`tabs-trigger`,className:C(`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 gt({className:e,...t}){return(0,$.jsx)(n,{"data-slot":`tabs-content`,className:C(`flex-1 text-sm outline-none py-2`,e),...t})}export{ie as a,te as c,ht as i,gt as n,re as o,mt as r,ne as s,ft as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{t as e}from"./tags-Cl6Nj2-E.js";export{e as TagsPage};
|
|
@@ -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{S as r,
|
|
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{S as r,it as i,mt as a,o,v as s}from"./api-5BZroqlO.js";import{i as c,t as l}from"./query-fetch-error-2yqCNP9X.js";import{i as u,n as d,t as f}from"./dist-xY0pK9Wy.js";import{n as p}from"./chunk-OE4NN4TA-DBWZidbW.js";import{a as m,i as h,n as g,o as _,r as v,s as y,t as b}from"./copy-button-DnGsXbVV.js";import{C as x,S,T as C,b as ee,d as w,l as T,s as E,y as te}from"./format-B9CcV2dj.js";import{n as D,t as ne}from"./utils-XFKvwlFT.js";import{t as O}from"./arrow-up-down-C1oJAmrw.js";import{c as re,i as k,l as ie,n as A,s as j,t as M}from"./select-CMOnuEoT.js";import{a as ae,n as N,r as P}from"./platform-targets-BIQ1lKOg.js";import{t as oe}from"./download-DmUZKo9N.js";import{i as F,n as I,t as L}from"./tooltip-D1ydB4g3.js";import{n as se}from"./auth-screen-backdrop-CgwRhIbi.js";import{a as ce,i as le,n as ue,o as de,r as fe,s as pe,t as me}from"./dropdown-menu-82O7jPU6.js";import{t as R}from"./label-DTHSKF2S.js";import{n as he}from"./get-error-message-CFs0lSQP.js";import{a as z,i as B,n as V,o as ge,r as H,s as _e,t as ve}from"./combobox-BJecIYHE.js";import{a as ye,i as be,n as xe,o as Se,r as Ce,t as we}from"./vendor-table-BAHQgdwg.js";var Te=D(`arrow-down`,[[`path`,{d:`M12 5v14`,key:`s699le`}],[`path`,{d:`m19 12-7 7-7-7`,key:`1idqje`}]]),Ee=D(`arrow-up`,[[`path`,{d:`m5 12 7-7 7 7`,key:`hav0vg`}],[`path`,{d:`M12 19V5`,key:`x0mq9r`}]]),De=D(`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`}]]),Oe=D(`chevron-left`,[[`path`,{d:`m15 18-6-6 6-6`,key:`1wnfg3`}]]),ke=D(`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`}]]),Ae=D(`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`}]]),je=D(`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`}]]),U=e(t(),1),W={mqtt:`MQTT Client`,opcua:`OPC UA Client Advanced`,modbus:`Modbus TCP`},G={Boolean:`bool`,Int32:`int32`,UInt16:`uint16`,UInt32:`uint32`,Float:`float32`,Double:`float64`,String:`string`},Me={float32:`float32`,int32:`int32`,uint32:`uint32`,uint16:`word`,boolean:`word`},Ne=`deviceId,deviceName,driverName,name,tagName,description,valueType,registerId,publishCoV,tagFormula,metaData,Retain,Qos,address,count,pollingInterval,endianness`;function K(e,t,n){let r=[Ne];for(let i of n){let n=W[i]??i;for(let a of e){let e=a.protocols[i];e&&r.push(q(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,instance:a.instance,access:a.access}))}}return`${r.join(`
|
|
2
2
|
`)}\n`}function q(e,t){switch(e){case`mqtt`:return Pe(t);case`opcua`:return Fe(t);case`modbus`:return Ie(t);default:throw Error(`Unsupported LE export protocol: "${e}"`)}}function Pe(e){let t=typeof e.protocolData?.topic==`string`?e.protocolData.topic:`${e.browsePath}/${e.memberName}`;return[``,J(e.deviceName),J(e.driverName),J(t),J(e.memberName),``,`string`,``,`false`,``,Y(e),`Disable`,`0`,``,``,``,``].join(`,`)}function Fe(e){let t=typeof e.protocolData?.nodeId==`string`?e.protocolData.nodeId:`ns=1;s=${e.browsePath}/${e.memberName}`,n=G[e.dataType]??`string`;return[``,J(e.deviceName),J(e.driverName),J(t),J(e.memberName),``,n,``,`false`,``,Y(e),``,``,``,``,``,``].join(`,`)}function Ie(e){let t=Me[String(e.protocolData?.registerType??``)]??Le(e.dataType),n=e.protocolData?.address;return[``,J(e.deviceName),J(e.driverName),`H`,J(e.memberName),``,t,``,`false`,``,Y(e),``,``,typeof n==`number`?String(n):`0`,`1`,`1.0000000000`,`AB CD`].join(`,`)}function Le(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 J(e){return e.includes(`,`)||e.includes(`"`)||e.includes(`
|
|
3
|
-
`)?`"${e.replace(/"/g,`""`)}"`:e}function Y(e){let t={uns_path:e.browsePath?`${e.browsePath}/${e.memberName}`:e.memberName,model:e.model,instance:e.instance,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])),J(JSON.stringify(t))}var X=n(),Re={mqtt:`MQTT`,opcua:`OPC UA`,modbus:`Modbus`},ze=[{id:P.id,label:P.label}];function Be({open:e,onOpenChange:t,tags:n,totalTags:r,enabledProtocols:i,selectedInstance:a}){let[o,s]=(0,U.useState)(`litmus-edge`),[c,l]=(0,U.useState)(``),[u,d]=(0,U.useState)(``),f=(0,U.useRef)(null),p=(0,U.useRef)(!1);(0,U.useEffect)(()=>{e&&!p.current&&(s(P.id),l(a??``),d(i[0]??``),setTimeout(()=>f.current?.focus(),80)),p.current=e},[e,i,a]);let b=c.trim()!==``&&u!==``,C=o===P.id?b:!1,ee=(0,U.useCallback)(()=>{if(o===P.id){let e=K(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]),w=n.length<r,T=(0,U.useMemo)(()=>[...ze.map(e=>({value:e.id,label:e.label})),...N.map(e=>({value:e.id,label:e.label}))],[]),E=(0,U.useMemo)(()=>i.map(e=>({value:e,label:Re[e]??e.toUpperCase()})),[i]);return(0,X.jsx)(g,{open:e,onOpenChange:t,children:(0,X.jsxs)(v,{className:`sm:max-w-lg`,children:[(0,X.jsxs)(_,{children:[(0,X.jsx)(y,{children:`Export for Platform`}),(0,X.jsx)(h,{children:w?`Exporting ${n.length} of ${r} tags based on current table filters.`:`Exporting all ${n.length} tags. Use table filters to narrow scope.`})]}),(0,X.jsxs)(`div`,{className:`flex flex-col gap-4 py-1`,children:[(0,X.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,X.jsx)(R,{className:`text-sm`,children:`Platform`}),(0,X.jsxs)(M,{value:o,onValueChange:e=>e&&s(e),items:T,children:[(0,X.jsx)(j,{className:`w-full text-sm`,children:(0,X.jsx)(re,{placeholder:`Select platform`})}),(0,X.jsxs)(A,{children:[ze.map(e=>(0,X.jsx)(k,{value:e.id,children:e.label},e.id)),N.map(e=>(0,X.jsx)(k,{value:e.id,disabled:!0,children:e.label},e.id))]})]})]}),o===P.id&&(0,X.jsxs)(X.Fragment,{children:[(0,X.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,X.jsxs)(R,{htmlFor:`device-name`,className:`text-sm`,children:[`Device name `,(0,X.jsx)(`span`,{className:`text-destructive`,children:`*`})]}),(0,X.jsx)(S,{id:`device-name`,ref:f,placeholder:`e.g. DTW-FAB-PLC`,value:c,onChange:e=>l(e.target.value),onKeyDown:e=>e.key===`Enter`&&C&&ee(),className:`font-mono text-sm`})]}),(0,X.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,X.jsx)(R,{className:`text-sm`,children:`Protocol`}),(0,X.jsxs)(M,{value:u||void 0,onValueChange:e=>e&&d(e),items:E,children:[(0,X.jsx)(j,{className:`w-full text-sm`,children:(0,X.jsx)(re,{placeholder:`Select a protocol`})}),(0,X.jsx)(A,{children:i.map(e=>(0,X.jsx)(k,{value:e,children:Re[e]??e.toUpperCase()},e))})]})]})]})]}),(0,X.jsxs)(m,{children:[(0,X.jsx)(x,{variant:`outline`,size:`sm`,onClick:()=>t(!1),children:`Cancel`}),(0,X.jsxs)(x,{size:`sm`,className:`gap-1.5`,disabled:!C,onClick:ee,children:[(0,X.jsx)(oe,{className:`size-3.5`}),`Download CSV`]})]})]})})}var Ve=`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`,He=`px-2 pb-1 font-heading text-[9px] font-semibold tracking-[0.14em] text-muted-foreground uppercase`,Ue=`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`,We=`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 Ge({protocol:e,instance:t,model:n,member:r,enabledProtocols:i,hasFilters:a,memberSearchRef:o,onProtocolChange:s,onInstanceChange:c,onModelChange:l,onMemberChange:u,onClearFilters:d,onInstanceSearch:f,onModelSearch:p,filteredInstanceOptions:m,filteredModelOptions:h}){let g=(0,U.useMemo)(()=>[{value:`all`,label:`All protocols`},...i.map(e=>({value:e,label:e.toUpperCase()}))],[i]);return(0,X.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,X.jsxs)(M,{value:e||`all`,onValueChange:e=>s(!e||e===`all`?``:e),items:g,children:[(0,X.jsx)(j,{className:`h-8 w-[140px]`,"aria-label":`Protocol filter`,children:(0,X.jsx)(re,{placeholder:`All protocols`})}),(0,X.jsxs)(A,{alignItemWithTrigger:!1,align:`start`,children:[(0,X.jsx)(k,{value:`all`,children:`All protocols`}),i.map(e=>(0,X.jsx)(k,{value:e,children:e.toUpperCase()},e))]})]}),(0,X.jsxs)(ve,{value:t?{value:t,label:E(t)}:null,onValueChange:e=>c(e?.value??``),isItemEqualToValue:(e,t)=>e?.value===t?.value,onInputValueChange:f,children:[(0,X.jsx)(H,{placeholder:`All instances`,className:`h-8 w-[200px]`,showClear:!!t}),(0,X.jsx)(V,{children:(0,X.jsxs)(z,{children:[m.map(([e,t])=>(0,X.jsxs)(B,{value:{value:e,label:E(e)},children:[(0,X.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,title:`${T(e)} (${e})`,children:E(e)}),(0,X.jsxs)(`span`,{className:`shrink-0 tabular-nums text-muted-foreground`,children:[`(`,t,`)`]})]},e)),m.length===0&&(0,X.jsx)(`p`,{className:`py-2 text-center text-xs text-muted-foreground`,children:`No instances found`})]})})]}),(0,X.jsxs)(ve,{value:n?{value:n,label:w(n)}:null,onValueChange:e=>l(e?.value??``),isItemEqualToValue:(e,t)=>e?.value===t?.value,onInputValueChange:p,children:[(0,X.jsx)(H,{placeholder:`All models`,className:`h-8 w-[200px]`,showClear:!!n}),(0,X.jsx)(V,{children:(0,X.jsxs)(z,{children:[h.map(([e,t])=>(0,X.jsxs)(B,{value:{value:e,label:w(e)},children:[(0,X.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,children:w(e)}),(0,X.jsxs)(`span`,{className:`shrink-0 tabular-nums text-muted-foreground`,children:[`(`,t,`)`]})]},e)),h.length===0&&(0,X.jsx)(`p`,{className:`py-2 text-center text-xs text-muted-foreground`,children:`No models found`})]})})]}),(0,X.jsxs)(`div`,{className:`relative`,children:[(0,X.jsx)(S,{ref:o,placeholder:`Search member…`,className:`h-8 w-[160px] pr-7`,value:r,onChange:e=>u(e.target.value)}),!r&&(0,X.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,X.jsxs)(x,{variant:`ghost`,size:`sm`,className:`h-8 gap-1 text-xs`,onClick:d,children:[(0,X.jsx)(C,{className:`size-3`}),`Clear`]})]})}function Z({sorted:e}){return e===`asc`?(0,X.jsx)(Ee,{className:`ml-1 inline size-3`}):e===`desc`?(0,X.jsx)(Te,{className:`ml-1 inline size-3`}):(0,X.jsx)(O,{className:`ml-1 inline size-3 opacity-30`})}function Q(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 $({label:e,value:t,collapsible:n}){let r=n?Q(t):t;return(0,X.jsxs)(`div`,{className:`min-w-0`,children:[(0,X.jsx)(`p`,{className:`text-[10px] uppercase tracking-wider text-muted-foreground`,children:e}),(0,X.jsx)(b,{value:t,label:`Copy ${e}`,tooltipSide:`top`,render:({icon:e})=>(0,X.jsxs)(`button`,{type:`button`,className:`mt-0.5 flex items-start gap-1 font-mono text-xs hover:text-foreground`,children:[n?(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(`span`,{className:`break-all lg:hidden`,children:r}),(0,X.jsx)(`span`,{className:`hidden break-all lg:inline`,children:t})]}):(0,X.jsx)(`span`,{className:`break-all`,children:t}),(0,X.jsx)(`span`,{className:`mt-0.5 shrink-0 text-muted-foreground`,children:e})]})})]})}function Ke({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,X.jsxs)(`div`,{className:`flex flex-col gap-3 text-xs`,children:[(0,X.jsxs)(`div`,{className:`flex flex-wrap gap-x-10 gap-y-2.5`,children:[(0,X.jsx)($,{label:`Topic / UNS`,value:n,collapsible:!0}),t.includes(`opcua`)&&typeof r?.nodeId==`string`&&(0,X.jsx)($,{label:`OPC UA NodeId`,value:r.nodeId,collapsible:!0}),t.includes(`modbus`)&&i?.address!=null&&(0,X.jsxs)(`div`,{className:`min-w-0`,children:[(0,X.jsx)(`p`,{className:`text-[10px] uppercase tracking-wider text-muted-foreground`,children:`Modbus`}),(0,X.jsxs)(`p`,{className:`mt-0.5 font-mono`,children:[`addr=`,String(i.address),` regs=`,String(i.count),` `,String(i.registerType)]})]})]}),(0,X.jsxs)(`div`,{className:`flex flex-wrap items-center gap-x-4 gap-y-1 text-muted-foreground`,children:[(0,X.jsxs)(L,{children:[(0,X.jsx)(F,{className:`font-mono`,render:(0,X.jsx)(`span`,{}),children:e.dataType}),(0,X.jsx)(I,{side:`top`,children:`Data type`})]}),e.unit&&(0,X.jsxs)(L,{children:[(0,X.jsx)(F,{className:`font-mono`,render:(0,X.jsx)(`span`,{}),children:e.unit}),(0,X.jsx)(I,{side:`top`,children:`Unit`})]}),(0,X.jsxs)(L,{children:[(0,X.jsx)(F,{className:`font-mono`,render:(0,X.jsx)(`span`,{}),children:a}),(0,X.jsx)(I,{side:`top`,children:`Access: r / w / rw`})]}),e.euRange&&(0,X.jsxs)(L,{children:[(0,X.jsxs)(F,{className:`font-mono`,render:(0,X.jsx)(`span`,{}),children:[`[`,e.euRange[0],`, `,e.euRange[1],`]`]}),(0,X.jsx)(I,{side:`top`,children:`EU range (min, max)`})]}),(0,X.jsxs)(L,{children:[(0,X.jsxs)(F,{render:(0,X.jsx)(p,{to:`/instance/${e.instance}`,className:`inline-flex items-center gap-1 text-primary underline-offset-4 hover:underline`,"aria-label":`Open instance`}),children:[`View instance`,(0,X.jsx)(Ae,{className:`size-3`})]}),(0,X.jsx)(I,{side:`top`,children:`Open instance`})]})]})]})}var qe=[{id:`expand`,meta:{cellClass:`!pl-2 !pr-0 w-0`},header:()=>(0,X.jsx)(`span`,{className:`sr-only`,children:`Expand row`}),enableSorting:!1,cell:({row:e})=>(0,X.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,X.jsx)(ie,{className:`size-3.5 transition-transform ${e.getIsExpanded()?`rotate-0`:`-rotate-90`}`})})},{accessorKey:`instance`,header:({column:e})=>(0,X.jsxs)(`button`,{type:`button`,className:`inline-flex items-center`,onClick:e.getToggleSortingHandler(),children:[`Instance`,(0,X.jsx)(Z,{sorted:e.getIsSorted()})]}),cell:({getValue:e})=>(0,X.jsx)(`span`,{className:`block max-w-[18rem] truncate font-mono text-xs`,title:e(),children:e()})},{accessorKey:`member`,header:({column:e})=>(0,X.jsxs)(`button`,{type:`button`,className:`inline-flex items-center`,onClick:e.getToggleSortingHandler(),children:[`Member`,(0,X.jsx)(Z,{sorted:e.getIsSorted()})]}),cell:({getValue:e})=>(0,X.jsx)(`span`,{className:`block max-w-[20rem] truncate font-mono text-xs`,title:e(),children:e()})},{accessorKey:`model`,header:({column:e})=>(0,X.jsxs)(`button`,{type:`button`,className:`inline-flex items-center`,onClick:e.getToggleSortingHandler(),children:[`Model`,(0,X.jsx)(Z,{sorted:e.getIsSorted()})]}),cell:({getValue:e})=>(0,X.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,X.jsxs)(`button`,{type:`button`,className:`inline-flex items-center`,onClick:e.getToggleSortingHandler(),children:[`Type`,(0,X.jsx)(Z,{sorted:e.getIsSorted()})]}),cell:({getValue:e})=>(0,X.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,X.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,X.jsx)(`span`,{className:`font-mono text-xs`,children:t===`readwrite`?`rw`:t})}}];function Je(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 Ye=[10,15,25,50,100],Xe=15,Ze=100;function Qe(e){return Ye.includes(e)?e:Xe}function $e(e){return/[",\r\n]/.test(e)?`"${e.replaceAll(`"`,`""`)}"`:e}function et(){let[e,t]=(0,U.useState)(!1),n=(0,U.useRef)(null);(0,U.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(`instance`,d.withDefault(``)),[v,y]=u(`model`,d.withDefault(``)),[b,S]=u(`member`,d.withDefault(``)),[C,w]=u(`perPage`,f.withDefault(Xe)),T=Qe(C),E=o(e=>e.instanceCount),D=c({queryKey:s.tags.manifest(E),queryFn:()=>i(`/manifest`,r.manifest),placeholderData:a}),O=D.data??null,N=D.isError,P=D.isPending&&!O&&!N,F=he(D.error,`Failed to fetch manifest.`),I=O?.tags??[],L=O?.summary?.enabledProtocols??[],R=(0,U.useDeferredValue)(b),z=(0,U.useMemo)(()=>I.filter(e=>e.kind===`variable`),[I]),B=(0,U.useMemo)(()=>{let e=new Map;for(let t of z)e.set(t.instance,(e.get(t.instance)??0)+1);return[...e.entries()].sort((e,t)=>e[0].localeCompare(t[0]))},[z]),V=(0,U.useMemo)(()=>{let e=new Map;for(let t of z)e.set(t.model,(e.get(t.model)??0)+1);return[...e.entries()].sort((e,t)=>e[0].localeCompare(t[0]))},[z]),H=(0,U.useMemo)(()=>{let e=R.trim().toLowerCase();if(!m&&!g&&!v&&!e)return z;let t=[];for(let n of z)m&&n.protocols[m]==null||g&&n.instance!==g||v&&n.model!==v||e&&!n.member.toLowerCase().includes(e)||t.push(n);return t},[z,m,g,v,R]),[ve,Te]=(0,U.useState)([]),[Ee,Ae]=(0,U.useState)({}),[W,G]=(0,U.useState)(0),Me=m!==``||g!==``||v!==``||b!==``,Ne=(0,U.useCallback)(()=>{h(``),_(``),y(``),S(``),G(0)},[h,_,y,S]),K=xe({data:H,columns:qe,getCoreRowModel:Ce(),getSortedRowModel:Se(),getExpandedRowModel:be(),getRowCanExpand:()=>!0,getPaginationRowModel:ye(),onSortingChange:Te,onExpandedChange:Ae,onPaginationChange:e=>{let t=typeof e==`function`?e({pageIndex:W,pageSize:T}):e;G(t.pageIndex),w(t.pageSize)},state:{sorting:ve,expanded:Ee,pagination:{pageIndex:W,pageSize:T}}}),q=Math.ceil(H.length/T);(0,U.useEffect)(()=>{C!==T&&w(T)},[T,C,w]),(0,U.useEffect)(()=>{q>0&&W>=q&&G(q-1)},[q,W]);let Pe=(0,U.useCallback)(e=>{G(0),w(e)},[w]),Fe=(0,U.useCallback)(e=>{G(0),h(e)},[h]),Ie=(0,U.useCallback)(e=>{G(0),_(e)},[_]),Le=(0,U.useCallback)(e=>{G(0),y(e)},[y]),J=(0,U.useCallback)(e=>{G(0),S(e)},[S]),[Y,Re]=(0,U.useState)(``),[ze,Z]=(0,U.useState)(``),Q=(0,U.useDeferredValue)(Y),$=(0,U.useDeferredValue)(ze),et=(0,U.useMemo)(()=>(Q?B.filter(([e])=>te(e,Q)):B).slice(0,Ze),[B,Q]),tt=(0,U.useMemo)(()=>($?V.filter(([e])=>ee(e,$)):V).slice(0,Ze),[V,$]),nt=K.getRowModel().rows,rt=nt.length,it=rt===0||H.length===0?0:W*T+1,at=rt===0||H.length===0?0:W*T+rt,ot=q,st=H.length===0||ot===0?0:W+1,ct=(0,U.useCallback)(()=>{let e=m?[m]:L,t=[`instance`,`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=H.map(t=>{let n=t.protocols.mqtt,r=t.protocols.opcua,i=t.protocols.modbus;return[t.instance,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??``)]:[]]});Je([t.map($e).join(`,`),...n.map(e=>e.map($e).join(`,`))].join(`
|
|
3
|
+
`)?`"${e.replace(/"/g,`""`)}"`:e}function Y(e){let t={uns_path:e.browsePath?`${e.browsePath}/${e.memberName}`:e.memberName,model:e.model,instance:e.instance,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])),J(JSON.stringify(t))}var X=n(),Re={mqtt:`MQTT`,opcua:`OPC UA`,modbus:`Modbus`},ze=[{id:P.id,label:P.label}];function Be({open:e,onOpenChange:t,tags:n,totalTags:r,enabledProtocols:i,selectedInstance:a}){let[o,s]=(0,U.useState)(`litmus-edge`),[c,l]=(0,U.useState)(``),[u,d]=(0,U.useState)(``),f=(0,U.useRef)(null),p=(0,U.useRef)(!1);(0,U.useEffect)(()=>{e&&!p.current&&(s(P.id),l(a??``),d(i[0]??``),setTimeout(()=>f.current?.focus(),80)),p.current=e},[e,i,a]);let b=c.trim()!==``&&u!==``,C=o===P.id?b:!1,ee=(0,U.useCallback)(()=>{if(o===P.id){let e=K(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]),w=n.length<r,T=(0,U.useMemo)(()=>[...ze.map(e=>({value:e.id,label:e.label})),...N.map(e=>({value:e.id,label:e.label}))],[]),E=(0,U.useMemo)(()=>i.map(e=>({value:e,label:Re[e]??e.toUpperCase()})),[i]);return(0,X.jsx)(g,{open:e,onOpenChange:t,children:(0,X.jsxs)(v,{className:`sm:max-w-lg`,children:[(0,X.jsxs)(_,{children:[(0,X.jsx)(y,{children:`Export for Platform`}),(0,X.jsx)(h,{children:w?`Exporting ${n.length} of ${r} tags based on current table filters.`:`Exporting all ${n.length} tags. Use table filters to narrow scope.`})]}),(0,X.jsxs)(`div`,{className:`flex flex-col gap-4 py-1`,children:[(0,X.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,X.jsx)(R,{className:`text-sm`,children:`Platform`}),(0,X.jsxs)(M,{value:o,onValueChange:e=>e&&s(e),items:T,children:[(0,X.jsx)(j,{className:`w-full text-sm`,children:(0,X.jsx)(re,{placeholder:`Select platform`})}),(0,X.jsxs)(A,{children:[ze.map(e=>(0,X.jsx)(k,{value:e.id,children:e.label},e.id)),N.map(e=>(0,X.jsx)(k,{value:e.id,disabled:!0,children:e.label},e.id))]})]})]}),o===P.id&&(0,X.jsxs)(X.Fragment,{children:[(0,X.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,X.jsxs)(R,{htmlFor:`device-name`,className:`text-sm`,children:[`Device name `,(0,X.jsx)(`span`,{className:`text-destructive`,children:`*`})]}),(0,X.jsx)(S,{id:`device-name`,ref:f,placeholder:`e.g. DTW-FAB-PLC`,value:c,onChange:e=>l(e.target.value),onKeyDown:e=>e.key===`Enter`&&C&&ee(),className:`font-mono text-sm`})]}),(0,X.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,X.jsx)(R,{className:`text-sm`,children:`Protocol`}),(0,X.jsxs)(M,{value:u||void 0,onValueChange:e=>e&&d(e),items:E,children:[(0,X.jsx)(j,{className:`w-full text-sm`,children:(0,X.jsx)(re,{placeholder:`Select a protocol`})}),(0,X.jsx)(A,{children:i.map(e=>(0,X.jsx)(k,{value:e,children:Re[e]??e.toUpperCase()},e))})]})]})]})]}),(0,X.jsxs)(m,{children:[(0,X.jsx)(x,{variant:`outline`,size:`sm`,onClick:()=>t(!1),children:`Cancel`}),(0,X.jsxs)(x,{size:`sm`,className:`gap-1.5`,disabled:!C,onClick:ee,children:[(0,X.jsx)(oe,{className:`size-3.5`}),`Download CSV`]})]})]})})}var Ve=`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`,He=`px-2 pb-1 font-heading text-[9px] font-semibold tracking-[0.14em] text-muted-foreground uppercase`,Ue=`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`,We=`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 Ge({protocol:e,instance:t,model:n,member:r,enabledProtocols:i,hasFilters:a,memberSearchRef:o,onProtocolChange:s,onInstanceChange:c,onModelChange:l,onMemberChange:u,onClearFilters:d,onInstanceSearch:f,onModelSearch:p,filteredInstanceOptions:m,filteredModelOptions:h}){let g=(0,U.useMemo)(()=>[{value:`all`,label:`All protocols`},...i.map(e=>({value:e,label:e.toUpperCase()}))],[i]);return(0,X.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,X.jsxs)(M,{value:e||`all`,onValueChange:e=>s(!e||e===`all`?``:e),items:g,children:[(0,X.jsx)(j,{className:`h-8 w-[140px]`,"aria-label":`Protocol filter`,children:(0,X.jsx)(re,{placeholder:`All protocols`})}),(0,X.jsxs)(A,{alignItemWithTrigger:!1,align:`start`,children:[(0,X.jsx)(k,{value:`all`,children:`All protocols`}),i.map(e=>(0,X.jsx)(k,{value:e,children:e.toUpperCase()},e))]})]}),(0,X.jsxs)(ve,{value:t?{value:t,label:E(t)}:null,onValueChange:e=>c(e?.value??``),isItemEqualToValue:(e,t)=>e?.value===t?.value,onInputValueChange:f,children:[(0,X.jsx)(H,{placeholder:`All instances`,className:`h-8 w-[200px]`,showClear:!!t}),(0,X.jsx)(V,{children:(0,X.jsxs)(z,{children:[m.map(([e,t])=>(0,X.jsxs)(B,{value:{value:e,label:E(e)},children:[(0,X.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,title:`${T(e)} (${e})`,children:E(e)}),(0,X.jsxs)(`span`,{className:`shrink-0 tabular-nums text-muted-foreground`,children:[`(`,t,`)`]})]},e)),m.length===0&&(0,X.jsx)(`p`,{className:`py-2 text-center text-xs text-muted-foreground`,children:`No instances found`})]})})]}),(0,X.jsxs)(ve,{value:n?{value:n,label:w(n)}:null,onValueChange:e=>l(e?.value??``),isItemEqualToValue:(e,t)=>e?.value===t?.value,onInputValueChange:p,children:[(0,X.jsx)(H,{placeholder:`All models`,className:`h-8 w-[200px]`,showClear:!!n}),(0,X.jsx)(V,{children:(0,X.jsxs)(z,{children:[h.map(([e,t])=>(0,X.jsxs)(B,{value:{value:e,label:w(e)},children:[(0,X.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,children:w(e)}),(0,X.jsxs)(`span`,{className:`shrink-0 tabular-nums text-muted-foreground`,children:[`(`,t,`)`]})]},e)),h.length===0&&(0,X.jsx)(`p`,{className:`py-2 text-center text-xs text-muted-foreground`,children:`No models found`})]})})]}),(0,X.jsxs)(`div`,{className:`relative`,children:[(0,X.jsx)(S,{ref:o,placeholder:`Search member…`,className:`h-8 w-[160px] pr-7`,value:r,onChange:e=>u(e.target.value)}),!r&&(0,X.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,X.jsxs)(x,{variant:`ghost`,size:`sm`,className:`h-8 gap-1 text-xs`,onClick:d,children:[(0,X.jsx)(C,{className:`size-3`}),`Clear`]})]})}function Z({sorted:e}){return e===`asc`?(0,X.jsx)(Ee,{className:`ml-1 inline size-3`}):e===`desc`?(0,X.jsx)(Te,{className:`ml-1 inline size-3`}):(0,X.jsx)(O,{className:`ml-1 inline size-3 opacity-30`})}function Q(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 $({label:e,value:t,collapsible:n}){let r=n?Q(t):t;return(0,X.jsxs)(`div`,{className:`min-w-0`,children:[(0,X.jsx)(`p`,{className:`text-[10px] uppercase tracking-wider text-muted-foreground`,children:e}),(0,X.jsx)(b,{value:t,label:`Copy ${e}`,tooltipSide:`top`,render:({icon:e})=>(0,X.jsxs)(`button`,{type:`button`,className:`mt-0.5 flex items-start gap-1 font-mono text-xs hover:text-foreground`,children:[n?(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(`span`,{className:`break-all lg:hidden`,children:r}),(0,X.jsx)(`span`,{className:`hidden break-all lg:inline`,children:t})]}):(0,X.jsx)(`span`,{className:`break-all`,children:t}),(0,X.jsx)(`span`,{className:`mt-0.5 shrink-0 text-muted-foreground`,children:e})]})})]})}function Ke({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,X.jsxs)(`div`,{className:`flex flex-col gap-3 text-xs`,children:[(0,X.jsxs)(`div`,{className:`flex flex-wrap gap-x-10 gap-y-2.5`,children:[(0,X.jsx)($,{label:`Topic / UNS`,value:n,collapsible:!0}),t.includes(`opcua`)&&typeof r?.nodeId==`string`&&(0,X.jsx)($,{label:`OPC UA NodeId`,value:r.nodeId,collapsible:!0}),t.includes(`modbus`)&&i?.address!=null&&(0,X.jsxs)(`div`,{className:`min-w-0`,children:[(0,X.jsx)(`p`,{className:`text-[10px] uppercase tracking-wider text-muted-foreground`,children:`Modbus`}),(0,X.jsxs)(`p`,{className:`mt-0.5 font-mono`,children:[`addr=`,String(i.address),` regs=`,String(i.count),` `,String(i.registerType)]})]})]}),(0,X.jsxs)(`div`,{className:`flex flex-wrap items-center gap-x-4 gap-y-1 text-muted-foreground`,children:[(0,X.jsxs)(L,{children:[(0,X.jsx)(F,{className:`font-mono`,render:(0,X.jsx)(`span`,{}),children:e.dataType}),(0,X.jsx)(I,{side:`top`,children:`Data type`})]}),e.unit&&(0,X.jsxs)(L,{children:[(0,X.jsx)(F,{className:`font-mono`,render:(0,X.jsx)(`span`,{}),children:e.unit}),(0,X.jsx)(I,{side:`top`,children:`Unit`})]}),(0,X.jsxs)(L,{children:[(0,X.jsx)(F,{className:`font-mono`,render:(0,X.jsx)(`span`,{}),children:a}),(0,X.jsx)(I,{side:`top`,children:`Access: r / w / rw`})]}),e.euRange&&(0,X.jsxs)(L,{children:[(0,X.jsxs)(F,{className:`font-mono`,render:(0,X.jsx)(`span`,{}),children:[`[`,e.euRange[0],`, `,e.euRange[1],`]`]}),(0,X.jsx)(I,{side:`top`,children:`EU range (min, max)`})]}),(0,X.jsxs)(L,{children:[(0,X.jsxs)(F,{render:(0,X.jsx)(p,{to:`/instance/${e.instance}`,className:`inline-flex items-center gap-1 text-primary underline-offset-4 hover:underline`,"aria-label":`Open instance`}),children:[`View instance`,(0,X.jsx)(Ae,{className:`size-3`})]}),(0,X.jsx)(I,{side:`top`,children:`Open instance`})]})]})]})}var qe=[{id:`expand`,meta:{cellClass:`!pl-2 !pr-0 w-0`},header:()=>(0,X.jsx)(`span`,{className:`sr-only`,children:`Expand row`}),enableSorting:!1,cell:({row:e})=>(0,X.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,X.jsx)(ie,{className:`size-3.5 transition-transform ${e.getIsExpanded()?`rotate-0`:`-rotate-90`}`})})},{accessorKey:`instance`,header:({column:e})=>(0,X.jsxs)(`button`,{type:`button`,className:`inline-flex items-center`,onClick:e.getToggleSortingHandler(),children:[`Instance`,(0,X.jsx)(Z,{sorted:e.getIsSorted()})]}),cell:({getValue:e})=>(0,X.jsx)(`span`,{className:`block max-w-[18rem] truncate font-mono text-xs`,title:e(),children:e()})},{accessorKey:`member`,header:({column:e})=>(0,X.jsxs)(`button`,{type:`button`,className:`inline-flex items-center`,onClick:e.getToggleSortingHandler(),children:[`Member`,(0,X.jsx)(Z,{sorted:e.getIsSorted()})]}),cell:({getValue:e})=>(0,X.jsx)(`span`,{className:`block max-w-[20rem] truncate font-mono text-xs`,title:e(),children:e()})},{accessorKey:`model`,header:({column:e})=>(0,X.jsxs)(`button`,{type:`button`,className:`inline-flex items-center`,onClick:e.getToggleSortingHandler(),children:[`Model`,(0,X.jsx)(Z,{sorted:e.getIsSorted()})]}),cell:({getValue:e})=>(0,X.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,X.jsxs)(`button`,{type:`button`,className:`inline-flex items-center`,onClick:e.getToggleSortingHandler(),children:[`Type`,(0,X.jsx)(Z,{sorted:e.getIsSorted()})]}),cell:({getValue:e})=>(0,X.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,X.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,X.jsx)(`span`,{className:`font-mono text-xs`,children:t===`readwrite`?`rw`:t})}}];function Je(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 Ye=[10,15,25,50,100],Xe=15,Ze=100;function Qe(e){return Ye.includes(e)?e:Xe}function $e(e){return/[",\r\n]/.test(e)?`"${e.replaceAll(`"`,`""`)}"`:e}function et(){let[e,t]=(0,U.useState)(!1),n=(0,U.useRef)(null);(0,U.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(`instance`,d.withDefault(``)),[v,y]=u(`model`,d.withDefault(``)),[b,S]=u(`member`,d.withDefault(``)),[C,w]=u(`perPage`,f.withDefault(Xe)),T=Qe(C),E=i(e=>e.instanceCount),D=c({queryKey:s.tags.manifest(E),queryFn:()=>o(`/manifest`,r.manifest),placeholderData:a}),O=D.data??null,N=D.isError,P=D.isPending&&!O&&!N,F=he(D.error,`Failed to fetch manifest.`),I=O?.tags??[],L=O?.summary?.enabledProtocols??[],R=(0,U.useDeferredValue)(b),z=(0,U.useMemo)(()=>I.filter(e=>e.kind===`variable`),[I]),B=(0,U.useMemo)(()=>{let e=new Map;for(let t of z)e.set(t.instance,(e.get(t.instance)??0)+1);return[...e.entries()].sort((e,t)=>e[0].localeCompare(t[0]))},[z]),V=(0,U.useMemo)(()=>{let e=new Map;for(let t of z)e.set(t.model,(e.get(t.model)??0)+1);return[...e.entries()].sort((e,t)=>e[0].localeCompare(t[0]))},[z]),H=(0,U.useMemo)(()=>{let e=R.trim().toLowerCase();if(!m&&!g&&!v&&!e)return z;let t=[];for(let n of z)m&&n.protocols[m]==null||g&&n.instance!==g||v&&n.model!==v||e&&!n.member.toLowerCase().includes(e)||t.push(n);return t},[z,m,g,v,R]),[ve,Te]=(0,U.useState)([]),[Ee,Ae]=(0,U.useState)({}),[W,G]=(0,U.useState)(0),Me=m!==``||g!==``||v!==``||b!==``,Ne=(0,U.useCallback)(()=>{h(``),_(``),y(``),S(``),G(0)},[h,_,y,S]),K=xe({data:H,columns:qe,getCoreRowModel:Ce(),getSortedRowModel:Se(),getExpandedRowModel:be(),getRowCanExpand:()=>!0,getPaginationRowModel:ye(),onSortingChange:Te,onExpandedChange:Ae,onPaginationChange:e=>{let t=typeof e==`function`?e({pageIndex:W,pageSize:T}):e;G(t.pageIndex),w(t.pageSize)},state:{sorting:ve,expanded:Ee,pagination:{pageIndex:W,pageSize:T}}}),q=Math.ceil(H.length/T);(0,U.useEffect)(()=>{C!==T&&w(T)},[T,C,w]),(0,U.useEffect)(()=>{q>0&&W>=q&&G(q-1)},[q,W]);let Pe=(0,U.useCallback)(e=>{G(0),w(e)},[w]),Fe=(0,U.useCallback)(e=>{G(0),h(e)},[h]),Ie=(0,U.useCallback)(e=>{G(0),_(e)},[_]),Le=(0,U.useCallback)(e=>{G(0),y(e)},[y]),J=(0,U.useCallback)(e=>{G(0),S(e)},[S]),[Y,Re]=(0,U.useState)(``),[ze,Z]=(0,U.useState)(``),Q=(0,U.useDeferredValue)(Y),$=(0,U.useDeferredValue)(ze),et=(0,U.useMemo)(()=>(Q?B.filter(([e])=>te(e,Q)):B).slice(0,Ze),[B,Q]),tt=(0,U.useMemo)(()=>($?V.filter(([e])=>ee(e,$)):V).slice(0,Ze),[V,$]),nt=K.getRowModel().rows,rt=nt.length,it=rt===0||H.length===0?0:W*T+1,at=rt===0||H.length===0?0:W*T+rt,ot=q,st=H.length===0||ot===0?0:W+1,ct=(0,U.useCallback)(()=>{let e=m?[m]:L,t=[`instance`,`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=H.map(t=>{let n=t.protocols.mqtt,r=t.protocols.opcua,i=t.protocols.modbus;return[t.instance,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??``)]:[]]});Je([t.map($e).join(`,`),...n.map(e=>e.map($e).join(`,`))].join(`
|
|
4
4
|
`),`miravo-tags.csv`)},[H,m,L]);return N&&!O?(0,X.jsx)(se,{className:`min-h-full`,children:(0,X.jsx)(`div`,{className:`flex min-h-[40vh] flex-col items-center justify-center p-6 sm:p-12`,children:(0,X.jsx)(`div`,{className:`w-full max-w-md`,children:(0,X.jsx)(l,{message:F,onRetry:()=>void D.refetch(),isRetrying:D.isFetching})})})}):(0,X.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:[N&&O?(0,X.jsx)(l,{message:`${F} Showing cached tags.`,onRetry:()=>void D.refetch(),isRetrying:D.isFetching}):null,(0,X.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,X.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,X.jsx)(`h1`,{className:`font-heading text-2xl font-semibold tracking-tight`,children:`Tag Explorer`}),(0,X.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:P?`Loading tag manifest...`:`${O?.summary?.totalInstances??0} instances · ${L.length} protocols`})]}),(0,X.jsxs)(me,{children:[(0,X.jsxs)(pe,{render:(0,X.jsx)(x,{variant:`outline`,size:`sm`,className:ne(Ue,`px-3`)}),children:[(0,X.jsx)(oe,{className:`size-3.5 opacity-90`,"aria-hidden":!0}),`Export`,(0,X.jsx)(ie,{className:`size-3 opacity-60`,"aria-hidden":!0})]}),(0,X.jsx)(ue,{align:`end`,sideOffset:6,className:ne(`min-w-[13.5rem]`,Ve),children:(0,X.jsxs)(fe,{children:[(0,X.jsx)(ce,{className:He,children:`Export`}),(0,X.jsx)(de,{className:`bg-border/60`}),(0,X.jsxs)(le,{onClick:ct,className:We,children:[(0,X.jsx)(je,{className:`size-3.5 shrink-0 text-primary`,"aria-hidden":!0}),`Download CSV`]}),(0,X.jsxs)(le,{onClick:()=>t(!0),className:We,children:[(0,X.jsx)(De,{className:`size-3.5 shrink-0 text-primary`,"aria-hidden":!0}),`Export for Platform…`]})]})})]})]}),(0,X.jsx)(Ge,{protocol:m,instance:g,model:v,member:b,enabledProtocols:L,hasFilters:Me,memberSearchRef:n,onProtocolChange:Fe,onInstanceChange:Ie,onModelChange:Le,onMemberChange:J,onClearFilters:Ne,onInstanceSearch:Re,onModelSearch:Z,filteredInstanceOptions:et,filteredModelOptions:tt}),H.length!==z.length&&z.length>0&&(0,X.jsxs)(`p`,{className:`text-xs text-muted-foreground`,children:[`Showing`,` `,(0,X.jsx)(`span`,{className:`font-medium tabular-nums text-foreground`,children:H.length}),` of`,` `,(0,X.jsx)(`span`,{className:`tabular-nums`,children:z.length}),` tags`]}),(0,X.jsx)(ge,{className:`min-w-0 py-0`,children:(0,X.jsx)(_e,{className:`p-0`,children:(0,X.jsx)(`div`,{className:`min-w-0 overflow-auto`,children:(0,X.jsxs)(`table`,{className:`w-full caption-bottom text-sm`,children:[(0,X.jsx)(`thead`,{className:`sticky top-0 z-10 border-b bg-background [&_tr]:border-b`,children:K.getHeaderGroups().map(e=>(0,X.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,X.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:we(e.column.columnDef.header,e.getContext())},e.id)})},e.id))}),(0,X.jsx)(`tbody`,{className:`[&_tr:last-child]:border-0`,children:P?null:nt.length>0?nt.map(e=>{let t=e.getIsExpanded(),n=e.getVisibleCells();return(0,X.jsxs)(U.Fragment,{children:[(0,X.jsx)(`tr`,{"aria-expanded":t,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,X.jsx)(`td`,{className:`whitespace-nowrap px-1.5 py-1.5 text-left sm:px-4 ${t?.hideClass??``} ${t?.cellClass??``}`,children:we(e.column.columnDef.cell,e.getContext())},e.id)})}),t&&(0,X.jsx)(`tr`,{children:(0,X.jsx)(`td`,{colSpan:n.length,className:`p-0`,children:(0,X.jsx)(`div`,{className:`border-b`,children:(0,X.jsx)(`div`,{className:`px-1.5 py-3 pl-6 sm:px-4 sm:pl-10`,children:(0,X.jsx)(Ke,{tag:e.original,enabledProtocols:L})})})})})]},e.id)}):(0,X.jsx)(`tr`,{children:(0,X.jsx)(`td`,{colSpan:qe.length,className:`h-32 px-2 text-center sm:px-4`,children:z.length===0?(0,X.jsxs)(`div`,{className:`flex flex-col items-center gap-2`,children:[(0,X.jsx)(ke,{className:`size-8 text-muted-foreground`}),(0,X.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`No tags available`}),(0,X.jsx)(p,{to:`/catalog`,className:`text-xs text-primary underline-offset-4 hover:underline`,children:`Start an environment from the Catalog to generate tags`})]}):(0,X.jsxs)(`p`,{className:`text-sm text-muted-foreground`,children:[`No matching tags.`,` `,(0,X.jsx)(`span`,{className:`text-xs`,children:`Try adjusting your filters.`})]})})})})]})})})}),(0,X.jsx)(`div`,{className:`px-3 py-2 text-xs text-muted-foreground`,children:(0,X.jsxs)(`div`,{className:`flex flex-col gap-2 sm:flex-row sm:items-center sm:justify-between sm:gap-4`,children:[(0,X.jsxs)(`div`,{className:`flex items-center justify-between gap-3 sm:justify-start sm:gap-5`,children:[(0,X.jsxs)(`p`,{className:`min-w-0 leading-tight`,children:[(0,X.jsx)(`span`,{className:`font-medium tabular-nums text-foreground`,children:it===0?`0`:`${it}\u2013${at}`}),` `,(0,X.jsxs)(`span`,{className:`text-muted-foreground`,children:[`of `,H.length,` tags`]})]}),(0,X.jsxs)(`div`,{className:`flex shrink-0 items-center gap-1.5 whitespace-nowrap`,children:[(0,X.jsxs)(M,{value:String(T),onValueChange:e=>e&&Pe(Number(e)),children:[(0,X.jsx)(j,{className:`h-8 w-[4.25rem]`,"aria-label":`Rows per page`,children:(0,X.jsx)(re,{})}),(0,X.jsx)(A,{children:Ye.map(e=>(0,X.jsx)(k,{value:String(e),children:e},e))})]}),(0,X.jsx)(`span`,{className:`hidden text-muted-foreground sm:inline`,children:`per page`})]})]}),(0,X.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,X.jsx)(x,{variant:`outline`,size:`sm`,className:`h-8 w-8 shrink-0 p-0`,disabled:!K.getCanPreviousPage(),onClick:()=>K.previousPage(),"aria-label":`Previous page`,children:(0,X.jsx)(Oe,{className:`size-3.5`})}),(0,X.jsxs)(`span`,{className:`min-w-[5ch] text-center text-sm font-medium tabular-nums whitespace-nowrap text-foreground`,children:[st,` / `,ot]}),(0,X.jsx)(x,{variant:`outline`,size:`sm`,className:`h-8 w-8 shrink-0 p-0`,disabled:!K.getCanNextPage(),onClick:()=>K.nextPage(),"aria-label":`Next page`,children:(0,X.jsx)(ae,{className:`size-3.5`})})]})]})}),(0,X.jsx)(Be,{open:e,onOpenChange:t,tags:H,totalTags:I.length,enabledProtocols:L,selectedInstance:g||void 0})]})}export{et as t};
|
package/console-dist/assets/{transition-nav-link-BtuFK_Y8.js → transition-nav-link-CDSeWWsP.js}
RENAMED
|
@@ -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-
|
|
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-Bxh77tVE.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 +1 @@
|
|
|
1
|
-
import{a as e}from"./rolldown-runtime-COnpUsM8.js";import{c as t}from"./vendor-charts-95ykyDlI.js";import{C as n,c as r,d as i,
|
|
1
|
+
import{a as e}from"./rolldown-runtime-COnpUsM8.js";import{c as t}from"./vendor-charts-95ykyDlI.js";import{C as n,c as r,d as i,it as a,n as o,y as s}from"./api-5BZroqlO.js";import{l as c}from"./copy-button-DnGsXbVV.js";import{n as l}from"./utils-XFKvwlFT.js";import{n as u,r as d,t as f}from"./runtime-link-D-uJbw97.js";var p=l(`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`}]]),m=`group relative border border-solid border-border transition-colors hover:border-muted-foreground/25`,h=`group relative border border-solid border-border`,g=`blueprint-card ${m} overflow-hidden rounded-[var(--miravo-radius-stadium-sm)]`,_=`${h} w-full min-w-0 overflow-hidden rounded-[var(--miravo-radius-stadium-sm)] bg-transparent`,v=`${h} w-full min-w-0 overflow-hidden rounded-[var(--miravo-radius-stadium-sm)] bg-transparent`,y=`blueprint-card catalog-card-frame group relative border border-solid overflow-hidden rounded-[var(--miravo-radius-stadium-sm)]`,b=y,x=`border-border bg-muted/40 text-primary shadow-none hover:border-muted-foreground/30 hover:bg-muted/60 hover:text-primary focus-visible:border-ring border-border bg-muted/30 hover:border-muted-foreground/35 hover:bg-muted/45 [&_svg]:text-primary`,S=e(t(),1),C=new Set([`spawn`,`removeInstance`,`loadTemplate`,`unloadTemplateRun`,`resetEnvironment`,`enableAdapter`,`disableAdapter`]);function w(e){if(e instanceof f){c.error(`Command not sent`,{description:e.detail});return}if(e instanceof o){c.error(e.result.message,{description:e.result.error});return}if(n.is(e)){c.error(e.message,{description:e.hint});return}if(e instanceof TypeError){if(typeof navigator<`u`&&navigator.onLine===!1){c.error(`Command not sent`,{description:`This browser is offline — reconnect to the network and try again.`});return}let{connectionState:e}=a.getState(),t=d(e);if(t){c.error(`Command not sent`,{description:t});return}c.error(`Command failed`,{description:`Could not reach the Miravo server — it may have stopped or restarted.`});return}c.error(`Command failed`,{description:e instanceof Error?e.message:`Unknown error.`})}async function T(){try{let e=await r();s.setQueryData([`bootstrap`],e),e.authenticated?a.getState().replaceRuntime(e.runtime,{allowSameRevision:!0,allowRevisionRewind:!0}):a.getState().markUnauthenticated()}catch{}finally{s.invalidateQueries({queryKey:[`bootstrap`]})}}function E(){let[e,t]=(0,S.useState)(!1);return{mutate:(0,S.useCallback)(e=>{try{u(a.getState().connectionState)}catch(e){w(e);return}t(!0),i(e).then(t=>{if(c.success(t.message),C.has(e.type))return T()}).catch(w).finally(()=>{t(!1)})},[]),mutateAsync:(0,S.useCallback)(async e=>{try{u(a.getState().connectionState)}catch(e){throw w(e),e}t(!0);try{let t=await i(e);return c.success(t.message),C.has(e.type)&&await T(),t}catch(e){throw w(e),e}finally{t(!1)}},[]),isPending:e}}export{v as a,p as c,y as i,x as n,_ as o,g as r,b as s,E as t};
|