@miravo/cli-linux-arm64-musl 0.7.2 → 0.7.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/console-dist/assets/{AnimatePresence-DOKfbxUr.js → AnimatePresence-CPmH1DMY.js} +1 -1
- package/console-dist/assets/{activity-CHJbwIn_.js → activity-Cy_niK56.js} +1 -1
- package/console-dist/assets/{api-DUOCKS6t.js → api-B8Cqrm2G.js} +1 -1
- package/console-dist/assets/arrow-right-BjBb4z7g.js +1 -0
- package/console-dist/assets/{arrow-up-down-Dpy1cI5X.js → arrow-up-down-C1oJAmrw.js} +1 -1
- package/console-dist/assets/{auth-screen-backdrop-UsGua6Zt.js → auth-screen-backdrop-Cr8qBSXP.js} +1 -1
- package/console-dist/assets/{badge-Dl0qmCnt.js → badge-eIn_7YrK.js} +1 -1
- package/console-dist/assets/catalog-C4iFSXl0.js +1 -0
- package/console-dist/assets/catalog-CvtaOpMA.js +1 -0
- package/console-dist/assets/{catalog-source-m5FRUDDK.js → catalog-source-B_3_Upeh.js} +1 -1
- package/console-dist/assets/{catalog-template-icons-MOd-xD7l.js → catalog-template-icons-3S8RvUxD.js} +1 -1
- package/console-dist/assets/{checkbox-_saaQAja.js → checkbox-C_4HRnS_.js} +1 -1
- package/console-dist/assets/{chunk-OE4NN4TA-m2UhO8Q2.js → chunk-OE4NN4TA-DBWZidbW.js} +1 -1
- package/console-dist/assets/{circle-question-mark-BwjC8Yj-.js → circle-question-mark-CJvcT6V6.js} +1 -1
- package/console-dist/assets/{combobox-BqGaRFom.js → combobox-BCaV1Wbo.js} +1 -1
- package/console-dist/assets/control-CvQvIf00.js +1 -0
- package/console-dist/assets/control-DL1KRHz-.js +1 -0
- package/console-dist/assets/{copy-button-BYq-qqmM.js → copy-button-BvU3RDZa.js} +1 -1
- package/console-dist/assets/{dist-jROhexoH.js → dist-xY0pK9Wy.js} +1 -1
- package/console-dist/assets/{download-BP5RD-RZ.js → download-DmUZKo9N.js} +1 -1
- package/console-dist/assets/{dropdown-menu-6JrsGi7P.js → dropdown-menu-CrPXVXpG.js} +1 -1
- package/console-dist/assets/{engine-store-BXfht5ME.js → engine-store-DMULdR_V.js} +1 -1
- package/console-dist/assets/events-BZaBqF9J.js +1 -0
- package/console-dist/assets/events-BdFbWiaW.js +1 -0
- package/console-dist/assets/fleet-B7pD7lbL.js +1 -0
- package/console-dist/assets/fleet-efugggyV.js +1 -0
- package/console-dist/assets/{format-B243kebG.js → format-CshN6yEB.js} +1 -1
- package/console-dist/assets/index-D1lU9Fg9.css +2 -0
- package/console-dist/assets/index-DWUbVyod.js +12 -0
- package/console-dist/assets/instance-detail-CmF_Rznd.js +1 -0
- package/console-dist/assets/{label-CM_MIru8.js → label-CMBWxUhA.js} +1 -1
- package/console-dist/assets/{layers-Cg3yeSqL.js → layers-1figUpjG.js} +1 -1
- package/console-dist/assets/{login-DG5yhrqi.js → login-KqoOCjoH.js} +1 -1
- package/console-dist/assets/{models-CZEVv1PS.js → models-Dn9__adB.js} +1 -1
- package/console-dist/assets/models-IiGAU-LZ.js +1 -0
- package/console-dist/assets/{not-found-49MUUPk7.js → not-found-D0nX2nrf.js} +1 -1
- package/console-dist/assets/{platform-targets-DkU1GIU_.js → platform-targets-BIQ1lKOg.js} +1 -1
- package/console-dist/assets/platforms-B52boh2S.js +1 -0
- package/console-dist/assets/platforms-CleAbZI5.js +1 -0
- package/console-dist/assets/{proxy-Dd7NWn5E.js → proxy-Be4WzmcS.js} +1 -1
- package/console-dist/assets/query-fetch-error-B6y_Rlj9.js +1 -0
- package/console-dist/assets/route-preload-BOrx0jh2.js +2 -0
- package/console-dist/assets/{select-TsdpHrOx.js → select-CmlY1M1a.js} +1 -1
- package/console-dist/assets/{select-display-items-C6R8SaIm.js → select-display-items-Bqb6Sbg6.js} +1 -1
- package/console-dist/assets/{shallow-ODRQsuRf.js → shallow-Cin0mLuv.js} +1 -1
- package/console-dist/assets/{tabs-CrmZxWmX.js → tabs-4SeH2unv.js} +1 -1
- package/console-dist/assets/tags-C6UILCQv.js +4 -0
- package/console-dist/assets/tags-CFcLbtJE.js +1 -0
- package/console-dist/assets/{tooltip-5y0snV5M.js → tooltip-D1ydB4g3.js} +1 -1
- package/console-dist/assets/{transition-nav-link-rkgf5kGR.js → transition-nav-link-LpMCFklr.js} +1 -1
- package/console-dist/assets/{triangle-alert-B7bgkvtE.js → triangle-alert-BXrJNk3g.js} +1 -1
- package/console-dist/assets/{use-engine-command-mutation-BHd8IkoT.js → use-engine-command-mutation-dw_B-1qa.js} +1 -1
- package/console-dist/assets/use-platform-stream-DAr3QTPE.js +2 -0
- package/console-dist/assets/use-transition-navigate-Fgz_LNAd.js +1 -0
- package/console-dist/assets/{utils-CH98NBUe.js → utils-XFKvwlFT.js} +1 -1
- package/console-dist/assets/{validation-CEcQWBjy.js → validation-eLNuMo9E.js} +1 -1
- package/console-dist/assets/{vendor-charts-CAZdaPlq.js → vendor-charts-95ykyDlI.js} +1 -1
- package/console-dist/assets/{vendor-table-CymGcez5.js → vendor-table-BAHQgdwg.js} +1 -1
- package/console-dist/assets/{vendor-ui-BcvPjvmT.js → vendor-ui-CWUk2ulb.js} +1 -1
- package/console-dist/index.html +52 -53
- package/miravo +0 -0
- package/package.json +1 -1
- package/console-dist/assets/arrow-right-DzTjpAuX.js +0 -1
- package/console-dist/assets/catalog-CJE-3rom.js +0 -1
- package/console-dist/assets/catalog-D7hkpcg7.js +0 -1
- package/console-dist/assets/control-C3s_d_cd.js +0 -1
- package/console-dist/assets/control-CVg7wZ1b.js +0 -1
- package/console-dist/assets/events-PFkU6dri.js +0 -1
- package/console-dist/assets/events-uH2B0ni-.js +0 -1
- package/console-dist/assets/fleet-B1apknqo.js +0 -1
- package/console-dist/assets/fleet-CdoQJU1v.js +0 -1
- package/console-dist/assets/index-CTIFAVGZ.js +0 -12
- package/console-dist/assets/index-DUzq1mEZ.css +0 -2
- package/console-dist/assets/instance-detail-BH62ZPtN.js +0 -1
- package/console-dist/assets/models-S3NJFuma.js +0 -1
- package/console-dist/assets/platforms-Czbg-aTO.js +0 -1
- package/console-dist/assets/platforms-DbF8XkYf.js +0 -1
- package/console-dist/assets/query-fetch-error-B2TVF0yM.js +0 -1
- package/console-dist/assets/route-preload-iLKZvgav.js +0 -2
- package/console-dist/assets/skeleton-BK5ydi_g.js +0 -1
- package/console-dist/assets/tags-Burz8TZx.js +0 -4
- package/console-dist/assets/tags-zlkQYLKu.js +0 -1
- package/console-dist/assets/use-platform-stream-EUBU4hC1.js +0 -2
- package/console-dist/assets/use-transition-navigate-BQAQi11k.js +0 -1
- /package/console-dist/assets/{get-error-message-CCNo4ZY0.js → get-error-message-Dk8elqEP.js} +0 -0
- /package/console-dist/assets/{runtime-link-ocutSVA8.js → runtime-link-PMxeHxd6.js} +0 -0
- /package/console-dist/assets/{transition-types-BNgNegH3.js → transition-types-2i1blGlR.js} +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
import{n as e}from"./utils-
|
|
1
|
+
import{n as e}from"./utils-XFKvwlFT.js";var t=e(`arrow-up-down`,[[`path`,{d:`m21 16-4 4-4-4`,key:`f6ql7i`}],[`path`,{d:`M17 20V4`,key:`1ejh1v`}],[`path`,{d:`m3 8 4-4 4 4`,key:`11wl7u`}],[`path`,{d:`M7 4v16`,key:`1glfcx`}]]);export{t};
|
package/console-dist/assets/{auth-screen-backdrop-UsGua6Zt.js → auth-screen-backdrop-Cr8qBSXP.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{at as e}from"./vendor-ui-
|
|
1
|
+
import{at as e}from"./vendor-ui-CWUk2ulb.js";import{t}from"./utils-XFKvwlFT.js";var n=e();function r(){return(0,n.jsxs)(`div`,{className:`pointer-events-none absolute inset-0 overflow-hidden`,"aria-hidden":!0,children:[(0,n.jsx)(`div`,{className:`auth-screen-loader__glow auth-screen-loader__glow--amber`}),(0,n.jsx)(`div`,{className:`auth-screen-loader__glow auth-screen-loader__glow--cyan`}),(0,n.jsx)(`div`,{className:`auth-screen-loader__grid`}),(0,n.jsx)(`div`,{className:`auth-screen-loader__vignette`})]})}function i({className:e,children:i}){return(0,n.jsxs)(`div`,{className:t(`relative w-full overflow-hidden bg-background`,e),children:[(0,n.jsx)(r,{}),(0,n.jsx)(`div`,{className:`relative z-10 min-h-0`,children:i})]})}export{i as n,r as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{it as e,rt as t}from"./vendor-ui-
|
|
1
|
+
import{it as e,rt as t}from"./vendor-ui-CWUk2ulb.js";import{E as n}from"./format-CshN6yEB.js";import{t as r}from"./utils-XFKvwlFT.js";var i=n(`group/badge inline-flex h-5 w-fit shrink-0 items-center justify-center gap-1 overflow-hidden rounded-[var(--miravo-radius-pill)] border border-transparent px-2 py-0.5 text-xs font-medium whitespace-nowrap transition-[background-color,border-color,color] focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 aria-invalid:border-destructive aria-invalid:ring-destructive/20 aria-invalid:ring-destructive/40 [&>svg]:pointer-events-none [&>svg]:size-3!`,{variants:{variant:{default:`bg-primary text-primary-foreground [a]:hover:bg-primary/80`,secondary:`bg-secondary text-secondary-foreground [a]:hover:bg-secondary/80`,destructive:`bg-destructive/10 text-destructive focus-visible:ring-destructive/20 bg-destructive/20 focus-visible:ring-destructive/40 [a]:hover:bg-destructive/20`,outline:`border-border text-foreground [a]:hover:bg-muted [a]:hover:text-muted-foreground`,ghost:`hover:bg-muted hover:text-muted-foreground hover:bg-muted/50`,link:`text-primary underline-offset-4 hover:underline`}},defaultVariants:{variant:`default`}});function a({className:n,variant:a=`default`,render:o,...s}){return t({defaultTagName:`span`,props:e({className:r(i({variant:a}),n)},s),render:o,state:{slot:`badge`,variant:a}})}export{a 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{S as r,b as i,o as a}from"./api-B8Cqrm2G.js";import{i as o,t as s}from"./query-fetch-error-B6y_Rlj9.js";import{t as c}from"./proxy-Be4WzmcS.js";import{t as l}from"./AnimatePresence-CPmH1DMY.js";import{a as u,i as d,n as f,o as p,r as m,s as h,t as g}from"./copy-button-BvU3RDZa.js";import{S as _,c as v,h as y,s as b,u as x,x as ee}from"./format-CshN6yEB.js";import{n as S,t as C}from"./utils-XFKvwlFT.js";import{D as w,T,n as E,t as D,w as te}from"./use-platform-stream-DAr3QTPE.js";import{t as O}from"./catalog-template-icons-3S8RvUxD.js";import{l as k}from"./select-CmlY1M1a.js";import{a as A}from"./platform-targets-BIQ1lKOg.js";import{i as j,n as M,r as N,t as P}from"./tabs-4SeH2unv.js";import{r as ne}from"./checkbox-C_4HRnS_.js";import{a as F,c as I,d as L,i as R,l as z,n as B,o as V,r as H,s as re,t as U,u as W}from"./catalog-source-B_3_Upeh.js";import{c as ie,i as ae,n as oe,r as G,t as se}from"./use-engine-command-mutation-dw_B-1qa.js";import{t as K}from"./badge-eIn_7YrK.js";import{t as q}from"./get-error-message-Dk8elqEP.js";var ce=S(`folder`,[[`path`,{d:`M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z`,key:`1kt360`}]]),le=S(`layout-grid`,[[`rect`,{width:`7`,height:`7`,x:`3`,y:`3`,rx:`1`,key:`1g98yp`}],[`rect`,{width:`7`,height:`7`,x:`14`,y:`3`,rx:`1`,key:`6d4xhi`}],[`rect`,{width:`7`,height:`7`,x:`14`,y:`14`,rx:`1`,key:`nxv5o0`}],[`rect`,{width:`7`,height:`7`,x:`3`,y:`14`,rx:`1`,key:`1bb6yr`}]]),ue=S(`list`,[[`path`,{d:`M3 5h.01`,key:`18ugdj`}],[`path`,{d:`M3 12h.01`,key:`nlz23k`}],[`path`,{d:`M3 19h.01`,key:`noohij`}],[`path`,{d:`M8 5h13`,key:`1pao27`}],[`path`,{d:`M8 12h13`,key:`1za7za`}],[`path`,{d:`M8 19h13`,key:`m83p4d`}]]),J=e(t(),1),Y=n(),X=20,de=14,Z=`flex w-3.5 shrink-0 items-center justify-center`;function fe({instance:e,depth:t,area:n,line:r,detail:i}){let[a,o]=(0,J.useState)(!1),[s,c]=(0,J.useState)(!1),l=a?e.tags:e.tags.slice(0,10),u=e.tags.length-10;return(0,Y.jsxs)(Y.Fragment,{children:[l.map(a=>(0,Y.jsx)(Q,{member:a,depth:t,area:n,line:r,instanceId:e.id,detail:i},a.name)),!a&&u>0&&(0,Y.jsxs)(`button`,{type:`button`,className:`flex min-h-11 w-full items-center gap-1.5 border-t border-border/30 py-2 text-left font-mono text-xs text-muted-foreground hover:bg-muted/40 touch-manipulation sm:min-h-0 sm:py-1.5`,style:{paddingLeft:`${t*14+X}px`},onClick:()=>o(!0),children:[(0,Y.jsx)(`span`,{className:Z,"aria-hidden":!0}),(0,Y.jsxs)(`span`,{children:[`+`,u,` more tags`]})]}),e.properties.length>0&&(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsxs)(`button`,{type:`button`,className:`flex min-h-11 w-full items-center gap-1.5 border-t border-border/30 py-2 text-left font-mono text-xs text-muted-foreground hover:bg-muted/40 touch-manipulation sm:min-h-0 sm:py-1.5`,style:{paddingLeft:`${t*14+X}px`},onClick:()=>c(e=>!e),children:[(0,Y.jsx)(`span`,{className:Z,"aria-hidden":!0,children:s?(0,Y.jsx)(k,{className:`size-3.5 opacity-60`,"aria-hidden":!0}):(0,Y.jsx)(A,{className:`size-3.5 opacity-60`,"aria-hidden":!0})}),(0,Y.jsxs)(`span`,{children:[e.properties.length,` properties`]})]}),s&&e.properties.map(a=>(0,Y.jsx)(Q,{member:a,depth:t,area:n,line:r,instanceId:e.id,detail:i},a.name))]})]})}function Q({member:e,depth:t,area:n,line:r,instanceId:i,detail:a}){let o=e.kind===`property`,s=t*14+X+(o?de:0),c=a.namespace,l=[c?.enterprise?`${c.enterprise}/${c.site??``}`:c?.prefix??``,n,r,i,e.name].filter(Boolean).join(`/`);return(0,Y.jsx)(g,{value:l,label:`Copy UNS path`,successMessage:`UNS path copied`,successDescription:l,tooltipSide:`top`,render:()=>(0,Y.jsxs)(`button`,{type:`button`,className:C(`flex w-full cursor-pointer flex-col gap-1 border-t border-border/25 py-2 text-left font-mono text-xs hover:bg-muted/35 touch-manipulation sm:min-h-0 sm:flex-row sm:items-center sm:gap-1.5 sm:py-1.5`,o&&`opacity-65`),style:{paddingLeft:`${s}px`},children:[(0,Y.jsxs)(`div`,{className:`flex min-w-0 items-center gap-1.5`,children:[(0,Y.jsx)(`span`,{className:Z,"aria-hidden":!0,children:(0,Y.jsx)(`span`,{className:C(`size-1 rounded-full ring-1 ring-border/50`,o?`bg-muted-foreground/25`:`bg-primary/50`)})}),(0,Y.jsx)(`span`,{title:e.name,className:C(`min-w-0 truncate`,o?`text-muted-foreground`:`text-foreground`),children:b(e.name)}),o&&(0,Y.jsx)(`span`,{className:`shrink-0 rounded-[var(--miravo-radius-tight)] bg-muted/60 px-1 py-px text-[10px] text-muted-foreground`,children:`PROP`})]}),(0,Y.jsxs)(`div`,{className:`flex min-w-0 flex-wrap items-center gap-x-2 gap-y-0.5 pl-0 sm:ml-auto sm:flex-1 sm:justify-end sm:pl-0 sm:pr-1`,children:[(0,Y.jsx)(`span`,{className:`shrink-0 text-muted-foreground`,children:e.dataType}),e.unit&&(0,Y.jsx)(`span`,{className:`shrink-0 text-muted-foreground`,children:e.unit}),e.euRange&&(0,Y.jsxs)(`span`,{className:`ml-auto shrink-0 tabular-nums text-muted-foreground`,children:[`[`,e.euRange[0],`–`,e.euRange[1],`]`]})]})]})})}function $({depth:e,label:t,labelTitle:n,tag:r,tagKind:i,subtitle:a,subtitleTitle:o,count:s,expanded:c,onToggle:l,hasChildren:u}){let d=c?k:A,f=i===`area`?`text-primary`:`text-foreground`;return(0,Y.jsxs)(`button`,{type:`button`,className:`flex min-h-11 w-full flex-col gap-1 border-t border-border/35 py-2 pr-2 text-left text-xs transition-colors touch-manipulation first:border-t-0 hover:bg-muted/40 sm:min-h-0 sm:flex-row sm:flex-wrap sm:items-center sm:gap-1.5 sm:gap-y-0 sm:py-1.5`,style:{paddingLeft:`${12+e*14}px`},onClick:l,children:[(0,Y.jsxs)(`div`,{className:`flex min-w-0 w-full items-center gap-1.5 sm:w-auto sm:flex-1 sm:flex-wrap sm:items-center`,children:[u?(0,Y.jsx)(d,{className:`size-3.5 shrink-0 text-muted-foreground`,"aria-hidden":!0}):(0,Y.jsx)(`span`,{className:`size-3.5 shrink-0`,"aria-hidden":!0}),(0,Y.jsx)(`span`,{title:n??void 0,className:C(`min-w-0 flex-1 truncate font-medium`,f),children:t}),(0,Y.jsx)(`span`,{className:`shrink-0 text-[10px] tracking-wide text-muted-foreground uppercase`,children:r}),a&&(0,Y.jsx)(`span`,{title:o??void 0,className:`hidden min-w-0 max-w-[min(11rem,38vw)] shrink truncate font-mono text-xs text-muted-foreground sm:inline`,children:a}),s!==void 0&&(0,Y.jsx)(`span`,{className:`ml-auto shrink-0 tabular-nums text-xs text-muted-foreground`,children:s})]}),a&&(0,Y.jsx)(`span`,{title:o??void 0,className:`min-w-0 truncate pl-7 font-mono text-xs text-muted-foreground sm:hidden`,children:a})]})}function pe(e){let t=e.split(/[-_]/).filter(e=>e.length>0);return t[t.length-1]??e}function me(e,t,n){let r=[];for(let i of e){let e=pe(i.model),a=t.get(i.model),o=[],s=[];if(a)for(let[e,t]of Object.entries(a.members)){let n={name:e,kind:t.kind,dataType:t.dataType,unit:t.unit,euRange:t.euRange};t.kind===`property`?s.push(n):o.push(n)}for(let t=0;t<i.count;t++){let t=(n.get(i.model)??0)+1;n.set(i.model,t),r.push({id:`${e}-${String(t).padStart(3,`0`)}`,model:i.model,tags:o,properties:s})}}return r}function he({detail:e}){let[t,n]=(0,J.useState)(new Set),c=(0,J.useRef)(null),l=(0,J.useMemo)(()=>[...new Set(e.models)],[e.models]),u=l.join(`,`),d=o({queryKey:i.catalog.modelSchemasBatch(u),queryFn:async()=>Promise.all(l.map(e=>a(`/catalog/models/${e}`,r.catalogModelDetail)))}),f=d.isPending&&!d.data,p=(0,J.useMemo)(()=>{let e=new Map;if(!d.data)return e;for(let[t,n]of d.data.entries())e.set(l[t],n);return e},[d.data,l]),m=(0,J.useMemo)(()=>{let t=new Map,n=new Map;for(let r of e.topology)for(let e of r.lines)n.set(`${r.name}/${e.name}`,me(e.twins,p,t));return n},[e.topology,p]);(0,J.useEffect)(()=>{if(f)return;let t=e.name;if(c.current===t)return;let r=new Set;for(let t of e.topology){r.add(`area:${t.name}`);for(let e of t.lines)r.add(`line:${t.name}/${e.name}`)}outer:for(let t of e.topology)for(let e of t.lines){let n=(m.get(`${t.name}/${e.name}`)??[])[0];if(n){r.add(`inst:${t.name}/${e.name}/${n.id}`);break outer}}n(r),c.current=t},[f,e.name,e.topology,m]);let h=(0,J.useCallback)(e=>{n(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})},[]);return f?null:d.isError&&!d.data?(0,Y.jsx)(s,{message:q(d.error,`Failed to load model schemas.`),onRetry:()=>void d.refetch(),isRetrying:d.isFetching&&!d.isPending}):(0,Y.jsx)(`div`,{className:`overflow-hidden rounded-[var(--miravo-radius-stadium-sm)] border border-border/50 py-2 pl-1 pr-2 touch-manipulation sm:py-2.5 sm:pl-1.5 sm:pr-2.5`,children:e.topology.map(n=>{let r=`area:${n.name}`,i=t.has(r);return(0,Y.jsxs)(`div`,{children:[(0,Y.jsx)($,{depth:0,label:y(n.name),labelTitle:n.name,tag:`AREA`,tagKind:`area`,expanded:i,onToggle:()=>h(r),hasChildren:!0}),i&&n.lines.map(r=>{let i=`line:${n.name}/${r.name}`,a=t.has(i),o=m.get(`${n.name}/${r.name}`)??[];return(0,Y.jsxs)(`div`,{children:[(0,Y.jsx)($,{depth:1,label:y(r.name),labelTitle:r.name,tag:`LINE`,tagKind:`line`,count:o.length,expanded:a,onToggle:()=>h(i),hasChildren:!0}),a&&o.map(i=>{let a=`inst:${n.name}/${r.name}/${i.id}`,o=t.has(a);return(0,Y.jsxs)(`div`,{children:[(0,Y.jsx)($,{depth:2,label:v(i.id),labelTitle:i.id,tag:`INST`,tagKind:`inst`,subtitle:y(i.model),subtitleTitle:i.model,count:i.tags.length+i.properties.length,expanded:o,onToggle:()=>h(a),hasChildren:i.tags.length+i.properties.length>0}),o&&(0,Y.jsx)(fe,{instance:i,depth:3,area:n.name,line:r.name,detail:e})]},i.id)})]},r.name)})]},n.name)})})}function ge(e){return e.lines.reduce((e,t)=>e+t.twins.reduce((e,t)=>e+t.count,0),0)}function _e(e){return Object.values(e.members).filter(e=>e.kind!==`property`).length}function ve(e,t){let n=0;for(let r of e.topology)for(let e of r.lines)for(let r of e.twins){let e=t.get(r.model),i=e?_e(e):0;n+=r.count*i}return n}function ye({template:e,onClose:t}){let[n,l]=(0,J.useState)(new Set),u=o({queryKey:i.catalog.templateDetail(e?.id??``),queryFn:()=>a(`/catalog/templates/${e?.id}`,r.catalogTemplateDetail),enabled:e!==null}),d=u.data,f=u.isPending&&!d,p=u.isError,m=q(u.error,`Failed to load environment.`),h=d?.models?.join(`,`)??``,g=o({queryKey:i.catalog.modelSchemasBatch(h),queryFn:async()=>{let e=d?.models??[];return e.length===0?[]:Promise.all(e.map(e=>a(`/catalog/models/${e}`,r.catalogModelDetail)))},enabled:d!==null}),_=(0,J.useMemo)(()=>{if(!d||!g.data)return null;let e=new Map;for(let[t,n]of g.data.entries())e.set(d.models[t],n);return ve(d,e)},[d,g.data]);(0,J.useEffect)(()=>{e&&d&&l(new Set(d.topology.map(e=>e.name)))},[e,d]);let v=(0,J.useCallback)(e=>{l(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})},[]),y=D();return(0,Y.jsx)(F,{open:e!==null,onOpenChange:e=>{e||(y.reset(),t())},children:(0,Y.jsx)(V,{side:`right`,className:`flex w-full flex-col gap-4 touch-manipulation`,children:f?null:p&&!d?(0,Y.jsx)(`div`,{className:`flex flex-1 flex-col justify-center px-2`,children:(0,Y.jsx)(s,{message:m,onRetry:()=>void u.refetch(),isRetrying:u.isFetching})}):d?(0,Y.jsxs)(c.div,{initial:{opacity:0},animate:{opacity:1},transition:{duration:.18},className:`flex min-h-0 flex-1 flex-col gap-4`,children:[(0,Y.jsxs)(I,{className:`gap-1 pb-0 pe-12`,children:[(0,Y.jsx)(z,{className:`font-heading text-base uppercase tracking-wide`,children:d.name}),d.description&&(0,Y.jsx)(re,{className:`text-xs leading-relaxed text-foreground/88`,children:d.description})]}),(0,Y.jsxs)(P,{defaultValue:`overview`,className:`flex min-h-0 flex-1 flex-col gap-1 pt-0`,children:[(0,Y.jsxs)(N,{variant:`line`,className:`h-8! shrink-0 gap-0.5 border-b-border/60 px-2 py-0.5`,children:[(0,Y.jsx)(j,{value:`overview`,className:`min-h-10 px-2 py-1 text-xs text-foreground/82 after:bottom-[-3px] data-active:text-foreground sm:min-h-0 sm:px-2.5 sm:py-1`,children:`Overview`}),(0,Y.jsx)(j,{value:`uns`,className:`min-h-10 px-2 py-1 text-xs text-foreground/82 after:bottom-[-3px] data-active:text-foreground sm:min-h-0 sm:px-2.5 sm:py-1`,children:`UNS`}),(0,Y.jsx)(j,{value:`deploy`,className:`min-h-10 px-2 py-1 text-xs text-foreground/82 after:bottom-[-3px] data-active:text-foreground sm:min-h-0 sm:px-2.5 sm:py-1`,children:`Deploy`})]}),(0,Y.jsx)(M,{value:`overview`,keepMounted:!0,className:`flex min-h-0 flex-1 flex-col`,children:(0,Y.jsx)(`div`,{className:`flex min-h-0 flex-1 flex-col px-3 pt-0`,children:(0,Y.jsx)(`div`,{className:`min-h-0 flex-1 overflow-y-auto pr-2`,children:(0,Y.jsxs)(`div`,{className:`flex flex-col gap-2 pb-1 pt-0.5`,children:[(0,Y.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,Y.jsxs)(K,{variant:`outline`,className:`font-mono text-xs`,children:[d.topology.length,` areas`]}),(0,Y.jsxs)(K,{variant:`outline`,className:`font-mono text-xs`,children:[d.instanceCount,` twins`]}),(0,Y.jsxs)(K,{variant:`outline`,className:`font-mono text-xs`,children:[d.models.length,` models`]}),_!==null&&(0,Y.jsxs)(K,{variant:`outline`,className:`font-mono text-xs`,children:[_,` tags`]}),d.settings?.tickIntervalMs&&(0,Y.jsxs)(K,{variant:`outline`,className:`font-mono text-xs`,children:[`tick `,d.settings.tickIntervalMs,`ms`]}),d.settings?.timeMultiplier&&d.settings.timeMultiplier!==1&&(0,Y.jsxs)(K,{variant:`outline`,className:`font-mono text-xs`,children:[d.settings.timeMultiplier,`× speed`]}),(0,Y.jsx)(E,{stream:y})]}),d.namespace&&(d.namespace.enterprise||d.namespace.site||d.namespace.prefix)&&(0,Y.jsxs)(`div`,{className:`min-w-0 overflow-hidden rounded-[var(--miravo-radius-tight)] border border-border/60 px-2.5 py-2`,children:[(0,Y.jsx)(`h3`,{className:`font-heading text-xs font-semibold uppercase tracking-[0.12em] text-primary`,children:`Namespace`}),(0,Y.jsxs)(`dl`,{className:`mt-1 grid grid-cols-1 gap-x-4 gap-y-1.5 sm:grid-cols-2`,children:[d.namespace.enterprise&&(0,Y.jsxs)(`div`,{className:`min-w-0 sm:max-w-[min(100%,16rem)]`,children:[(0,Y.jsx)(`dt`,{className:`font-heading text-xs font-medium uppercase tracking-[0.12em] text-muted-foreground`,children:`Enterprise`}),(0,Y.jsx)(`dd`,{className:`mt-1 font-mono text-xs leading-snug text-foreground [overflow-wrap:anywhere] break-words`,children:d.namespace.enterprise})]}),d.namespace.site&&(0,Y.jsxs)(`div`,{className:`min-w-0 sm:max-w-[min(100%,16rem)]`,children:[(0,Y.jsx)(`dt`,{className:`font-heading text-xs font-medium uppercase tracking-[0.12em] text-muted-foreground`,children:`Site`}),(0,Y.jsx)(`dd`,{className:`mt-1 font-mono text-xs leading-snug text-foreground [overflow-wrap:anywhere] break-words`,children:d.namespace.site})]}),d.namespace.prefix&&(0,Y.jsxs)(`div`,{className:`min-w-0 sm:col-span-2`,children:[(0,Y.jsx)(`dt`,{className:`font-heading text-xs font-medium uppercase tracking-[0.12em] text-muted-foreground`,children:`Prefix`}),(0,Y.jsx)(`dd`,{className:`mt-1 font-mono text-xs leading-snug text-foreground [overflow-wrap:anywhere] break-words`,children:d.namespace.prefix})]})]})]}),d.topology.map(e=>(0,Y.jsx)(be,{area:e,expanded:n.has(e.name),onToggle:()=>v(e.name)},e.name)),d.settings&&(0,Y.jsxs)(`div`,{className:`rounded-[var(--miravo-radius-tight)] border border-border/50 p-2`,children:[(0,Y.jsxs)(`div`,{className:`mb-1.5 flex items-center gap-1.5 font-heading text-xs font-semibold uppercase tracking-[0.12em] text-warning`,children:[(0,Y.jsx)(W,{className:`size-3.5`,"aria-hidden":!0}),(0,Y.jsx)(`span`,{children:`Settings`})]}),(0,Y.jsxs)(`div`,{className:`grid grid-cols-1 gap-1.5 font-mono text-xs sm:grid-cols-2`,children:[(0,Y.jsxs)(`div`,{className:`flex flex-col`,children:[(0,Y.jsx)(`span`,{className:`text-muted-foreground`,children:`tick interval`}),(0,Y.jsxs)(`span`,{className:`text-foreground`,children:[d.settings.tickIntervalMs??1e3,`ms`]})]}),(0,Y.jsxs)(`div`,{className:`flex flex-col`,children:[(0,Y.jsx)(`span`,{className:`text-muted-foreground`,children:`time multiplier`}),(0,Y.jsxs)(`span`,{className:`text-foreground`,children:[d.settings.timeMultiplier??1,`×`]})]})]})]})]})})})}),(0,Y.jsx)(M,{value:`uns`,keepMounted:!0,className:`flex min-h-0 flex-1 flex-col`,children:(0,Y.jsx)(`div`,{className:`flex min-h-0 flex-1 flex-col px-3 pt-0`,children:(0,Y.jsx)(`div`,{className:`min-h-0 flex-1 overflow-y-auto pr-2`,children:(0,Y.jsx)(`div`,{className:`pb-1 pt-0.5`,children:(0,Y.jsx)(he,{detail:d})})})})}),(0,Y.jsx)(M,{value:`deploy`,keepMounted:!0,className:`flex min-h-0 flex-1 flex-col`,children:(0,Y.jsx)(`div`,{className:`flex min-h-0 flex-1 flex-col px-3 pt-0`,children:(0,Y.jsx)(R,{kind:`template`,id:d.id,displayName:d.name,yamlPath:`/catalog/templates/${d.id}/yaml`,yamlFilename:`${d.id}.miravo.yaml`,stream:y})})})]})]},d.id):(0,Y.jsx)(`div`,{className:`flex flex-1 items-center justify-center text-sm text-muted-foreground`,children:`Environment not found`})})})}function be({area:e,expanded:t,onToggle:n}){let r=ge(e);return(0,Y.jsxs)(`div`,{className:G,children:[(0,Y.jsxs)(`button`,{type:`button`,className:`flex min-h-11 w-full items-center gap-1.5 px-2.5 py-2 text-left text-xs font-medium transition-colors hover:bg-muted/30 touch-manipulation sm:min-h-0 sm:py-1.5`,onClick:n,children:[(0,Y.jsx)(ce,{className:`size-3.5 text-primary`}),(0,Y.jsx)(`span`,{className:`uppercase tracking-wider text-primary`,children:y(e.name)}),(0,Y.jsxs)(`div`,{className:`ml-auto flex items-center gap-1.5`,children:[(0,Y.jsxs)(K,{variant:`secondary`,className:`text-xs`,children:[r,` twins`]}),(0,Y.jsxs)(K,{variant:`secondary`,className:`text-xs`,children:[e.lines.length,` lines`]}),(0,Y.jsx)(k,{className:`size-3 text-muted-foreground transition-transform ${t?`rotate-180`:``}`})]})]}),(0,Y.jsx)(l,{initial:!1,children:t&&(0,Y.jsx)(c.div,{initial:{height:0,opacity:0},animate:{height:`auto`,opacity:1},exit:{height:0,opacity:0},transition:{duration:.2,ease:`easeOut`},className:`overflow-hidden`,children:(0,Y.jsx)(`div`,{className:`flex flex-col gap-1.5 border-t border-border p-2`,children:e.lines.map(e=>(0,Y.jsx)(xe,{line:e},e.name))})},`content`)})]})}function xe({line:e}){return(0,Y.jsxs)(`div`,{className:`rounded-[var(--miravo-radius-tight)] border border-border/60 bg-muted/10 p-2`,children:[(0,Y.jsxs)(`div`,{className:`mb-1.5 flex items-center gap-1.5 text-xs font-medium text-muted-foreground`,children:[(0,Y.jsx)(ue,{className:`size-3.5`}),(0,Y.jsx)(`span`,{title:e.name,children:y(e.name)}),(0,Y.jsx)(le,{className:`ml-auto size-3.5 text-muted-foreground`}),(0,Y.jsxs)(`span`,{className:`text-muted-foreground`,children:[e.twins.reduce((e,t)=>e+t.count,0),` twins`]})]}),(0,Y.jsx)(`div`,{className:`flex flex-col gap-1.5`,children:e.twins.map(e=>(0,Y.jsx)(Se,{twin:e},`${e.model}-${e.count}`))})]})}function Se({twin:e}){let t=e.parameters&&Object.keys(e.parameters).length>0;return(0,Y.jsxs)(`div`,{className:`rounded-[var(--miravo-radius-tight)] border border-border/30 bg-background/50 px-2.5 py-1.5`,children:[(0,Y.jsxs)(`div`,{className:`flex items-center gap-1.5 text-xs`,children:[(0,Y.jsx)(`span`,{className:`font-mono font-medium text-primary`,title:e.model,children:y(e.model)}),(0,Y.jsxs)(K,{variant:`secondary`,className:`shrink-0 px-1 py-0 text-xs`,children:[`×`,e.count]}),e.variation>0&&(0,Y.jsxs)(`span`,{className:`text-muted-foreground`,children:[`±`,(e.variation*100).toFixed(0),`% variation`]})]}),t&&e.parameters&&(0,Y.jsx)(`div`,{className:`mt-1.5 flex flex-wrap gap-x-4 gap-y-1 border-t border-border/20 pt-1.5 font-mono text-xs`,children:Object.entries(e.parameters).map(([e,t])=>(0,Y.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,Y.jsx)(`span`,{className:`text-muted-foreground`,children:e}),(0,Y.jsx)(`span`,{className:`text-foreground`,children:t})]},e))})]})}var Ce=[`builtin`,`personal`];function we(){let[e,t]=(0,J.useState)(``),[n,g]=(0,J.useState)(`all`),[v,y]=(0,J.useState)({}),[b,S]=(0,J.useState)(null),[w,T]=(0,J.useState)(null),[E,D]=(0,J.useState)(null),O=(0,J.useRef)(null),k=se();(0,J.useEffect)(()=>{let e=e=>{if(e.key!==`/`||e.metaKey||e.ctrlKey||e.altKey)return;let t=e.target.tagName;t===`INPUT`||t===`TEXTAREA`||t===`SELECT`||(e.preventDefault(),O.current?.focus())};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[]);let A=o({queryKey:i.catalog.templates(),queryFn:()=>a(`/catalog/templates`,r.catalogTemplates)}),j=A.data??[],M=w===null?null:j.find(e=>e.id===w)??null,N=A.isPending&&!A.data,P=A.isError&&!A.data,F=A.isError&&!!A.data,I=q(A.error,`Failed to load environments.`),L=e=>v[e]??1,R=(0,J.useCallback)((e,t)=>{y(n=>({...n,[e]:Math.max(1,Math.min(10,t))}))},[]),z=(0,J.useCallback)(e=>{D(e)},[]),B=(0,J.useCallback)(e=>{T(e)},[]),V=async e=>{S(e);try{return await k.mutateAsync({type:`loadTemplate`,templatePath:e,count:L(e)}),!0}catch{return!1}finally{S(null)}},re=(0,J.useMemo)(()=>{let e={all:j.length};for(let t of Ce)e[t]=0;for(let t of j){let n=H(t.source);e[n]=(e[n]??0)+1}return e},[j]),U=e.toLowerCase(),W=j.filter(e=>n===`all`||H(e.source)===n).filter(e=>U?e.name.toLowerCase().includes(U)||e.id.toLowerCase().includes(U)||(e.description?.toLowerCase().includes(U)??!1):!0);return(0,Y.jsxs)(`div`,{className:`@container/templates mx-auto flex w-full max-w-screen-2xl flex-col gap-5 p-4 sm:gap-6 sm:p-6`,children:[(0,Y.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,Y.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,Y.jsx)(`h1`,{className:`font-heading text-2xl font-semibold tracking-tight`,children:`Environment Catalog`}),(0,Y.jsx)(K,{variant:`outline`,className:`text-xs`,children:P?(0,Y.jsx)(`span`,{className:`text-destructive`,children:`Unavailable`}):N&&j.length===0?(0,Y.jsx)(Y.Fragment,{children:`Loading...`}):(0,Y.jsxs)(Y.Fragment,{children:[new Set(j.map(e=>e.id)).size,` environments`]})})]}),(0,Y.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`Choose an environment to launch a realistic industrial system. Each environment includes pre-configured asset models with realistic physics, lifecycle degradation, and fault modes.`})]}),P&&(0,Y.jsx)(s,{message:I,onRetry:()=>void A.refetch(),isRetrying:A.isFetching}),F&&(0,Y.jsx)(s,{message:`${I} Showing cached environments.`,onRetry:()=>void A.refetch(),isRetrying:A.isFetching}),!P&&(0,Y.jsxs)(`div`,{className:`flex flex-wrap items-center gap-3`,children:[(0,Y.jsxs)(`div`,{className:`relative max-w-xs flex-1 min-w-[14rem]`,children:[(0,Y.jsx)(te,{className:`absolute left-2.5 top-2.5 size-4 text-muted-foreground`}),(0,Y.jsx)(ee,{ref:O,placeholder:`Filter environments...`,value:e,onChange:e=>t(e.target.value),className:`pl-9 pr-7`}),!e&&(0,Y.jsx)(`kbd`,{className:`pointer-events-none absolute top-1/2 right-2 -translate-y-1/2 rounded-[var(--miravo-radius-tight)] border border-border bg-muted px-1 font-mono text-[10px] text-muted-foreground`,children:`/`})]}),(0,Y.jsx)(De,{value:n,counts:re,onChange:g})]}),(0,Y.jsx)(`div`,{className:`grid grid-cols-1 gap-4 @[720px]/templates:grid-cols-2`,"aria-busy":N&&!P,children:P?null:(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(l,{children:W.map((e,t)=>(0,Y.jsx)(c.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},exit:{opacity:0,scale:.96,transition:{duration:.15}},transition:{type:`spring`,stiffness:380,damping:30,delay:t*.04},className:`grid`,children:(0,Y.jsx)(Te,{template:e,count:L(e.id),launching:b===e.id,onCountChange:R,onInspect:z,onLaunch:B})},`${e.source}:${e.id}`))}),W.length===0&&j.length>0&&(0,Y.jsx)(`p`,{className:`col-span-full py-8 text-center text-sm text-muted-foreground`,children:`No environments match the current filters.`})]})}),j.length>0&&(0,Y.jsx)(`div`,{className:C(G,`p-0`),children:(0,Y.jsx)(`div`,{className:`community-teaser relative overflow-hidden rounded-[inherit]`,children:(0,Y.jsx)(`div`,{className:`relative z-10 mx-auto max-w-3xl px-5 py-10 sm:px-10 sm:py-12`,children:(0,Y.jsxs)(`div`,{className:`grid items-center gap-10 lg:grid-cols-[minmax(0,1fr)_minmax(0,17rem)]`,children:[(0,Y.jsxs)(`div`,{className:`order-2 flex min-w-0 flex-col gap-4 lg:order-1`,children:[(0,Y.jsxs)(`div`,{className:`flex flex-wrap items-baseline gap-x-3 gap-y-1`,children:[(0,Y.jsx)(`p`,{className:`blueprint-title text-primary`,children:`Future channel`}),(0,Y.jsx)(`span`,{className:`blueprint-stat text-[10px] text-muted-foreground`,children:`MIRAVO_REGISTRY · NOT_CONNECTED`})]}),(0,Y.jsx)(`h2`,{className:`font-heading text-xl font-semibold tracking-tight sm:text-2xl`,children:`Community Environments`}),(0,Y.jsx)(`p`,{className:`max-w-xl text-sm leading-relaxed text-muted-foreground`,children:`Share your industrial environments with the Miravo community. Publish custom environments, discover configurations from other engineers, and fork them as your starting point.`}),(0,Y.jsx)(`div`,{children:(0,Y.jsx)(K,{variant:`outline`,className:`community-teaser-soon border-primary/35 bg-primary/5 text-[10px] text-primary`,children:`Coming Soon`})})]}),(0,Y.jsx)(`div`,{className:`order-1 flex justify-center lg:order-2 lg:justify-end`,children:(0,Y.jsxs)(`div`,{className:`community-teaser-module relative flex w-full max-w-[14rem] flex-col items-center justify-center gap-3 border border-primary/15 bg-muted/15 py-8 sm:max-w-[15.5rem] sm:py-10`,"aria-hidden":!0,children:[(0,Y.jsx)(`div`,{className:`community-teaser-icon-ring relative z-[1] flex size-[4.25rem] items-center justify-center rounded-[var(--miravo-radius-tight)] border border-primary/35 bg-gradient-to-br from-primary/18 to-primary/5`,children:(0,Y.jsx)(ne,{className:`size-9 text-primary`,"aria-hidden":!0})}),(0,Y.jsx)(`span`,{className:`blueprint-stat relative z-[1] text-[9px] tracking-[0.18em] text-muted-foreground`,children:`AWAITING SIGNAL`}),(0,Y.jsx)(`span`,{className:`blueprint-stat relative z-[1] text-[9px] text-muted-foreground`,children:`Uplink idle`})]})})]})})})}),(0,Y.jsx)(f,{open:w!==null,onOpenChange:e=>{e||T(null)},children:(0,Y.jsxs)(m,{children:[(0,Y.jsxs)(p,{children:[(0,Y.jsx)(h,{children:`Launch environment?`}),(0,Y.jsx)(d,{children:M!==null&&(0,Y.jsxs)(Y.Fragment,{children:[`This adds `,L(M.id),` instance`,L(M.id)===1?``:`s`,` of`,` `,(0,Y.jsx)(`span`,{className:`font-medium text-foreground`,children:x(M.name)}),` `,`to the running environment.`]})})]}),(0,Y.jsxs)(u,{children:[(0,Y.jsx)(_,{variant:`outline`,disabled:b!==null,onClick:()=>T(null),children:`Cancel`}),(0,Y.jsx)(_,{disabled:b!==null||M===null,onClick:async()=>{M!==null&&await V(M.id)&&T(null)},children:b===M?.id?`Launching...`:`Launch`})]})]})}),(0,Y.jsx)(ye,{template:E,onClose:()=>D(null)})]})}var Te=(0,J.memo)(function({template:e,count:t,launching:n,onCountChange:r,onInspect:i,onLaunch:a}){return(0,Y.jsxs)(`div`,{className:C(ae,`flex flex-col gap-4 p-5`),children:[(0,Y.jsxs)(`div`,{className:`flex items-start gap-3`,children:[(0,Y.jsx)(`div`,{className:`flex size-10 shrink-0 items-center justify-center rounded-[var(--miravo-radius-stadium-sm)] bg-primary/10 text-primary`,children:(0,Y.jsx)(O,{id:e.id,className:`size-5`})}),(0,Y.jsxs)(`div`,{className:`min-w-0 flex flex-col gap-1`,children:[(0,Y.jsx)(`span`,{className:`font-heading text-sm font-semibold uppercase tracking-wide`,children:x(e.name)}),(0,Y.jsx)(`p`,{className:`line-clamp-3 text-xs leading-relaxed text-foreground/75`,children:e.description??`Industrial environment.`}),(0,Y.jsx)(`span`,{className:`font-mono text-[10px] text-muted-foreground`,children:e.id})]})]}),(0,Y.jsx)(`div`,{className:`px-3 py-2`,children:(0,Y.jsx)(`div`,{className:`flex flex-wrap gap-1.5`,children:e.models.map(e=>(0,Y.jsx)(K,{variant:`outline`,className:`h-auto min-h-5 rounded-[var(--miravo-radius-tight)] px-1.5 py-0 font-mono text-[10px] font-normal text-primary`,children:e},e))})}),(0,Y.jsxs)(`div`,{className:`mt-auto flex flex-wrap items-center gap-4 font-mono text-[11px] text-muted-foreground`,children:[(0,Y.jsxs)(`span`,{children:[(0,Y.jsx)(`span`,{className:`text-foreground`,children:e.instanceCount}),` instances`]}),(0,Y.jsxs)(`span`,{children:[(0,Y.jsx)(`span`,{className:`text-foreground`,children:e.models.length}),` models`]}),e.memberCount>0&&(0,Y.jsxs)(`span`,{children:[`~`,(0,Y.jsx)(`span`,{className:`text-foreground`,children:Ee(e.memberCount)}),` tags/cycle`]}),(0,Y.jsx)(K,{variant:`outline`,className:C(`ml-auto shrink-0 font-sans text-[10px] font-medium uppercase tracking-wide`,U(e.source)),children:B(e.source)})]}),(0,Y.jsxs)(`div`,{className:`flex items-center gap-2 border-t border-border/30 pt-3`,children:[(0,Y.jsxs)(`div`,{className:`flex items-center rounded-[var(--miravo-radius-tight)] border bg-muted/30`,children:[(0,Y.jsx)(_,{variant:`ghost`,size:`icon`,className:`size-7 rounded-none rounded-l-md`,disabled:t<=1,"aria-label":`Decrease count`,onClick:n=>{n.stopPropagation(),r(e.id,t-1)},children:(0,Y.jsx)(L,{className:`size-3`})}),(0,Y.jsx)(`span`,{className:`flex size-7 items-center justify-center border-x font-mono text-xs`,children:t}),(0,Y.jsx)(_,{variant:`ghost`,size:`icon`,className:`size-7 rounded-none rounded-r-md`,disabled:t>=10,"aria-label":`Increase count`,onClick:n=>{n.stopPropagation(),r(e.id,t+1)},children:(0,Y.jsx)(T,{className:`size-3`})})]}),(0,Y.jsxs)(_,{type:`button`,variant:`outline`,size:`sm`,onClick:()=>i(e),className:oe,children:[(0,Y.jsx)(w,{className:`size-3.5`,"aria-hidden":!0}),`Inspect`]}),(0,Y.jsxs)(_,{size:`sm`,className:`ml-auto`,disabled:n,onClick:()=>a(e.id),children:[(0,Y.jsx)(ie,{className:`mr-1 size-3`}),n?`...`:`Launch`]})]})]})});function Ee(e){return e>=1e3?`${(e/1e3).toFixed(1)}k`:String(e)}function De({value:e,counts:t,onChange:n}){return(0,Y.jsx)(`div`,{className:`flex flex-wrap items-center gap-1.5`,role:`radiogroup`,"aria-label":`Filter by source`,children:[{id:`all`,label:`All`},...Ce.map(e=>({id:e,label:B(e)}))].map(r=>{let i=e===r.id,a=t[r.id]??0,o=r.id!==`all`&&a===0;return(0,Y.jsxs)(`label`,{className:C(`inline-flex h-7 items-center gap-1.5 rounded-[var(--miravo-radius-pill)] border px-3 text-xs font-medium transition-colors`,i?`border-primary/60 bg-primary/15 text-primary`:`border-border/60 bg-card/30 text-muted-foreground hover:border-border hover:bg-muted/40 hover:text-foreground`,o?`cursor-not-allowed opacity-40 hover:border-border/60 hover:bg-card/30 hover:text-muted-foreground`:`cursor-pointer`),children:[(0,Y.jsx)(`input`,{type:`radio`,name:`catalog-source-filter`,value:r.id,checked:i,disabled:o,onChange:()=>n(r.id),className:`sr-only`}),(0,Y.jsx)(`span`,{children:r.label}),(0,Y.jsx)(`span`,{className:`font-mono text-[10px] opacity-70`,children:a})]},r.id)})})}export{we as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{t as e}from"./catalog-C4iFSXl0.js";export{e as CatalogPage};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as e}from"./rolldown-runtime-COnpUsM8.js";import{s as t}from"./vendor-charts-CAZdaPlq.js";import{$ as n,J as r,Q as i,X as a,Y as o,Z as s,at as c,q as l}from"./vendor-ui-BcvPjvmT.js";import{S as u,a as d,b as ee,o as f,s as te}from"./api-DUOCKS6t.js";import{i as ne,s as re,t as ie}from"./query-fetch-error-B2TVF0yM.js";import{t as p}from"./proxy-Dd7NWn5E.js";import{t as ae}from"./AnimatePresence-DOKfbxUr.js";import{a as oe,i as se,l as m,n as ce,o as le,r as ue,s as de}from"./copy-button-BYq-qqmM.js";import{S as h,w as fe,x as pe}from"./format-B243kebG.js";import{n as g,t as _}from"./utils-CH98NBUe.js";import{_ as me,a as he,b as ge,c as _e,f as ve,g as ye,i as be,m as xe,p as Se,r as Ce,x as we,y as Te}from"./use-platform-stream-EUBU4hC1.js";import{a as v,c as Ee,i as y,n as De,o as Oe,r as b,s as ke,t as Ae}from"./select-TsdpHrOx.js";import{a as je,i as x,n as Me,r as S,t as Ne}from"./platform-targets-DkU1GIU_.js";import{a as C,o as w}from"./tabs-CrmZxWmX.js";import{t as Pe}from"./download-BP5RD-RZ.js";import{r as Fe}from"./checkbox-_saaQAja.js";import{t as Ie}from"./badge-Dl0qmCnt.js";import{t as T}from"./label-CM_MIru8.js";import{t as E}from"./get-error-message-CCNo4ZY0.js";var Le=g(`minus`,[[`path`,{d:`M5 12h14`,key:`1ays0h`}]]),Re=g(`settings`,[[`path`,{d:`M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915`,key:`1i5ecw`}],[`circle`,{cx:`12`,cy:`12`,r:`3`,key:`1v7zrd`}]]),D=c();function O({...e}){return(0,D.jsx)(r,{"data-slot":`sheet`,...e})}function k({...e}){return(0,D.jsx)(o,{"data-slot":`sheet-portal`,...e})}function A({className:e,...t}){return(0,D.jsx)(n,{"data-slot":`sheet-overlay`,className:_(`fixed inset-0 z-50 bg-black/10 transition-opacity duration-150 data-ending-style:opacity-0 data-starting-style:opacity-0 supports-backdrop-filter:backdrop-blur-xs`,e),...t})}function j({className:e,children:t,side:n=`right`,showCloseButton:r=!0,...o}){return(0,D.jsxs)(k,{children:[(0,D.jsx)(A,{}),(0,D.jsxs)(a,{"data-slot":`sheet-content`,"data-side":n,className:_(`fixed z-50 flex flex-col gap-4 bg-background bg-clip-padding text-sm shadow-lg transition duration-200 ease-in-out data-ending-style:opacity-0 data-starting-style:opacity-0 data-[side=bottom]:inset-x-0 data-[side=bottom]:bottom-0 data-[side=bottom]:h-auto data-[side=bottom]:border-t data-[side=bottom]:data-ending-style:translate-y-[2.5rem] data-[side=bottom]:data-starting-style:translate-y-[2.5rem] data-[side=left]:inset-y-0 data-[side=left]:left-0 data-[side=left]:h-full data-[side=left]:w-[calc(100vw-1rem)] data-[side=left]:max-w-md data-[side=left]:border-r data-[side=left]:data-ending-style:translate-x-[-2.5rem] data-[side=left]:data-starting-style:translate-x-[-2.5rem] data-[side=right]:inset-y-0 data-[side=right]:right-0 data-[side=right]:h-full data-[side=right]:w-[calc(100vw-1rem)] data-[side=right]:max-w-xl data-[side=right]:border-l data-[side=right]:pl-1 data-[side=right]:data-ending-style:translate-x-[2.5rem] data-[side=right]:data-starting-style:translate-x-[2.5rem] data-[side=top]:inset-x-0 data-[side=top]:top-0 data-[side=top]:h-auto data-[side=top]:border-b data-[side=top]:data-ending-style:translate-y-[-2.5rem] data-[side=top]:data-starting-style:translate-y-[-2.5rem]`,e),...o,children:[t,r&&(0,D.jsxs)(i,{"data-slot":`sheet-close`,render:(0,D.jsx)(h,{variant:`ghost`,className:`absolute top-3 right-3`,size:`icon-sm`}),children:[(0,D.jsx)(fe,{}),(0,D.jsx)(`span`,{className:`sr-only`,children:`Close`})]})]})]})}function M({className:e,...t}){return(0,D.jsx)(`div`,{"data-slot":`sheet-header`,className:_(`flex flex-col gap-0.5 p-2`,e),...t})}function N({className:e,...t}){return(0,D.jsx)(l,{"data-slot":`sheet-title`,className:_(`text-base font-medium text-foreground`,e),...t})}function P({className:e,...t}){return(0,D.jsx)(s,{"data-slot":`sheet-description`,className:_(`text-sm text-muted-foreground`,e),...t})}var F=e(t(),1),ze=[{value:`opcua`,label:`OPC UA`},{value:`mqtt`,label:`MQTT`},{value:`modbus`,label:`Modbus`}];function Be({value:e,onValueChange:t,labelledBy:n}){return(0,D.jsx)(`fieldset`,{"aria-labelledby":n,className:`min-w-0 border-0 p-0`,children:(0,D.jsx)(`div`,{className:`flex gap-1.5`,children:ze.map(n=>{let r=e===n.value;return(0,D.jsx)(`button`,{type:`button`,"aria-pressed":r,onClick:()=>t(n.value),className:_(`flex flex-1 items-center justify-center rounded-[var(--miravo-radius-pill)] border py-1.5 text-center transition-[background-color,border-color,color,box-shadow] duration-200`,`focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/80 focus-visible:ring-offset-2 focus-visible:ring-offset-background`,r?`border-primary/45 bg-primary/10 text-primary shadow-[inset_0_1px_0_0_rgba(255,255,255,0.06),0_0_0_1px_color-mix(in_srgb,var(--primary)_25%,transparent)]`:`border-border/75 bg-background/55 text-foreground/82 hover:border-border/90 hover:bg-background/70 hover:text-foreground/92`),children:(0,D.jsxs)(`span`,{className:`inline-flex items-center justify-center gap-1.5 font-mono text-[11px] font-medium leading-none tracking-wide`,children:[(0,D.jsx)(C,{className:`size-2.5 shrink-0 -translate-y-px opacity-80`,"aria-hidden":!0}),(0,D.jsx)(`span`,{children:n.label})]})},n.value)})})})}var I=`172.17.0.1`;async function Ve(e){let t=await f(`/catalog/models/${encodeURIComponent(e)}/le-dt.json`,u.catalogModelLeDt);return JSON.stringify(t,null,2)}async function He(e,t={host:I}){let n=u.catalogTemplateLeTemplateJson.query;if(!n)throw Error(`Missing query schema for ${u.catalogTemplateLeTemplateJson.method} ${u.catalogTemplateLeTemplateJson.path}`);let r=n.safeParse(t);if(!r.success)throw Error(`Invalid request for ${u.catalogTemplateLeTemplateJson.method} ${u.catalogTemplateLeTemplateJson.path}: ${r.error.message}`);return d(`/catalog/templates/${encodeURIComponent(e)}/le-template.json${L(r.data)}`,u.catalogTemplateLeTemplateJson)}function L(e){let t=new URLSearchParams;return e.host&&t.set(`host`,e.host),e.protocol&&t.set(`protocol`,e.protocol),t.size>0?`?${t.toString()}`:``}function Ue(e){let t=e.split(/[-_]/).filter(e=>e.length>0);return t[t.length-1]??e}function We(e){return`${Ue(e)}-001`}function Ge(e,t){return[t,...e?.filter(e=>e.id!==t.id)??[]]}async function Ke(e){let t=await e.create();e.onCreated(t);try{await e.refresh()}catch(t){e.onRefreshFailed(t)}}function qe(e){return x.find(t=>t.id===e)?.label??e}function Je(e){return e===`template`?`Litmus Edge Template`:`Litmus Edge`}function R({kind:e,id:t,displayName:n,yamlPath:r,yamlFilename:i,stream:a}){let o=re(),s=ne({queryKey:ee.platforms.targets(),queryFn:()=>_e()}),c=s.data??[],[l,d]=(0,F.useState)(``),[f,g]=(0,F.useState)(`opcua`),[C,Le]=(0,F.useState)(`litmus-edge`),[Re,O]=(0,F.useState)(!1),[k,A]=(0,F.useState)(!1),[j,M]=(0,F.useState)(S.id),[N,P]=(0,F.useState)({label:``,hostname:``,apiToken:``,sourceHostname:``}),[ze,L]=(0,F.useState)(!1),[Ue,R]=(0,F.useState)(!1),{testing:Ye,runTest:z,cancelInFlight:Xe}=Ce(),[B,V]=(0,F.useState)(!1),[H,U]=(0,F.useState)(I),[W,Ze]=(0,F.useState)(!1),Qe=(0,F.useId)();(0,F.useEffect)(()=>{k&&(M(S.id),P({label:``,hostname:``,apiToken:``,sourceHostname:``}),L(!1))},[k]);let G=j===S.id&&N.hostname.trim().length>0&&N.sourceHostname.trim().length>0&&N.apiToken.trim().length>0,K=c.find(e=>e.id===l),$e=(0,F.useCallback)(n=>{O(!1),l&&(e===`model`?a.startApply({targetId:l,model:t,protocol:f,scope:n.scope,deviceName:n.deviceName,ifUnmanaged:n.ifUnmanaged}):a.startApply({targetId:l,template:t,scope:n.scope,ifUnmanaged:n.ifUnmanaged}))},[l,t,e,f,a]),et=(0,F.useCallback)(async()=>{if(j!==S.id){m.error(`${qe(j)} target setup is coming soon.`);return}if(!N.label||!N.hostname||!N.sourceHostname){m.error(`Label, hostname, and source host are required.`);return}if(!N.apiToken){m.error(`API token is required for new targets.`);return}R(!0);try{await Ke({create:()=>he({...N,platformId:j}),onCreated:e=>{o.setQueryData(ee.platforms.targets(),t=>Ge(t,e)),d(e.id),A(!1),m.success(`Target added.`)},refresh:async()=>{let e=await s.refetch();if(e.error)throw e.error},onRefreshFailed:e=>{m.error(`Target added, but target list refresh failed.`,{description:`${E(e,`Target list refresh failed.`)} Reload targets before retrying another add.`})}})}catch(e){m.error(E(e,`Failed to add target.`))}finally{R(!1)}},[j,N,s,o]),tt=(0,F.useCallback)(()=>{G&&z({hostname:N.hostname.trim(),sourceHostname:N.sourceHostname.trim(),apiToken:N.apiToken.trim()})},[G,N,z]),q=C===`source-yaml`,J=C===`litmus-edge`||q,Y=(0,F.useCallback)(async n=>{if(q){try{let t=await te(r,e===`model`?u.catalogModelYaml:u.catalogTemplateYaml),n=new Blob([t],{type:`text/yaml`}),a=URL.createObjectURL(n),o=document.createElement(`a`);o.href=a,o.download=i,o.click(),URL.revokeObjectURL(a),m.success(`Exported ${i}`)}catch{m.error(`Failed to export YAML`)}return}if(C===`litmus-edge`)try{if(e===`model`){let e=await Ve(t),n=new Blob([e],{type:`application/json`}),r=URL.createObjectURL(n),i=document.createElement(`a`);i.href=r,i.download=`${t}.le-dt.json`,i.click(),URL.revokeObjectURL(r),m.success(`Exported ${t}.le-dt.json`)}else{let e=n?.templateHost?.trim()??``,r=e.length>0?e:I,i=`${t}.le-template.json`,a=await He(t,{host:r,protocol:f}),o=URL.createObjectURL(a),s=document.createElement(`a`);s.href=o,s.download=i,s.click(),URL.revokeObjectURL(o),m.success(`Exported ${i}`)}}catch{m.error(`Failed to export platform format`)}},[C,q,e,t,r,i,f]),nt=(0,F.useCallback)(()=>{if(J){if(C===`litmus-edge`&&e===`template`){U(I),V(!0);return}Y()}},[J,C,e,Y]),rt=(0,F.useCallback)(async()=>{Ze(!0);try{await Y({templateHost:H}),V(!1)}finally{Ze(!1)}},[H,Y]),X=a.status===`running`,Z=a.cancelRequested,Q=!!l&&!X,it=!!a.operation||X,$=it?be(a):null;return(0,D.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col gap-6 px-1 py-2`,children:[(0,D.jsx)(`div`,{className:`min-h-0 flex-1 overflow-y-auto pr-2`,children:(0,D.jsxs)(`div`,{className:`flex flex-col gap-5`,children:[(0,D.jsx)(`p`,{className:`font-heading text-[11px] font-semibold uppercase tracking-[0.2em] text-foreground`,children:`Deploy`}),(0,D.jsxs)(`div`,{className:`space-y-2`,children:[(0,D.jsx)(T,{className:`font-heading text-[11px] font-medium uppercase tracking-[0.14em] text-foreground/78`,children:`Target`}),s.isError&&s.data===void 0&&(0,D.jsx)(ie,{message:E(s.error,`Failed to load targets.`),onRetry:()=>void s.refetch(),isRetrying:s.isFetching&&!s.isPending}),(0,D.jsx)(ve,{targets:c,value:l,onValueChange:d,size:`sm`,className:`min-w-0 w-full border-border/65 bg-background/55 text-xs text-foreground`,onAddNew:()=>A(!0)})]}),e===`model`&&c.length>0&&(0,D.jsxs)(`div`,{className:`space-y-2`,children:[(0,D.jsx)(T,{id:Qe,className:`font-heading text-[11px] font-medium uppercase tracking-[0.14em] text-foreground/78`,children:`Protocol binding`}),(0,D.jsx)(Be,{value:f,onValueChange:g,labelledBy:Qe})]}),c.length>0&&(0,D.jsxs)(`button`,{type:`button`,disabled:!Q,onClick:()=>O(!0),className:_(`group flex w-full min-h-14 min-w-0 items-stretch overflow-hidden rounded-[var(--miravo-radius-stadium-lg)] text-left outline-none`,`transition-[border-color,box-shadow,background-color] duration-200 ease-out`,`focus-visible:ring-2 focus-visible:ring-ring/70 focus-visible:ring-offset-2 focus-visible:ring-offset-background`,`disabled:pointer-events-none disabled:opacity-55`,Q?[`border-2 border-primary/40 bg-background`,`bg-linear-to-r from-primary/12 via-background to-background`,`shadow-[inset_0_1px_0_0_rgba(255,255,255,0.025)]`,`hover:border-primary/56 hover:shadow-[inset_0_1px_0_0_rgba(255,255,255,0.025),0_0_14px_-8px_color-mix(in_srgb,var(--primary)_18%,transparent),0_0_22px_-12px_color-mix(in_srgb,var(--primary)_8%,transparent)]`]:[`border border-dashed border-border/65 bg-muted/15`,`hover:bg-muted/22`]),children:[(0,D.jsxs)(`span`,{className:`relative flex w-18 shrink-0 items-center justify-center bg-transparent`,"aria-hidden":!0,children:[(0,D.jsx)(`span`,{className:_(`absolute inset-y-2 -right-px w-px bg-linear-to-b from-transparent via-primary/30 to-transparent opacity-70`,!Q&&`via-border/80`)}),(0,D.jsx)(Fe,{className:_(`relative size-5`,Q?`text-primary`:`text-foreground/75`)})]}),(0,D.jsxs)(`span`,{className:`flex min-w-0 flex-1 flex-col justify-center gap-0.5 overflow-hidden px-3 py-2.5 sm:px-4`,children:[(0,D.jsx)(`span`,{className:_(`font-heading text-[11px] font-semibold uppercase tracking-[0.16em]`,Q?`text-primary`:`text-foreground/78`),children:Q?`Commit deploy`:X?`Deploy in progress…`:`Awaiting target`}),(0,D.jsx)(`span`,{className:_(`truncate font-mono text-[13px] leading-tight tracking-tight`,Q?`text-foreground`:`text-foreground/80`),children:K?.label??`Select a target above`})]}),(0,D.jsx)(`span`,{className:_(`flex shrink-0 items-center pr-2.5 sm:pr-3`,Q&&`pl-1`),children:(0,D.jsx)(`span`,{className:_(`flex size-9 items-center justify-center rounded-[var(--miravo-radius-stadium-sm)] border bg-transparent transition-[border-color,color] duration-200`,Q?`border-primary/40 text-primary group-hover:border-primary/55`:`border-border/75 text-foreground/75`),"aria-hidden":!0,children:(0,D.jsx)(je,{className:`size-4`,strokeWidth:2.25})})})]})]})}),(0,D.jsx)(ae,{children:it&&$?(0,D.jsx)(xe,{title:$.title,subtitle:$.subtitle,footerAction:X&&a.operation?.operationId?(0,D.jsx)(h,{variant:`outline`,size:`sm`,disabled:Z,"aria-busy":Z,className:_(`ml-auto group h-8 gap-1.5 px-3 text-xs`,Z?`cursor-not-allowed`:`hover:bg-destructive/12 hover:text-destructive hover:border-destructive/35`),onClick:()=>{a.cancel().catch(()=>{})},children:Z?(0,D.jsxs)(D.Fragment,{children:[(0,D.jsx)(w,{className:`size-3.5 shrink-0 animate-spin text-muted-foreground`,"aria-hidden":!0}),(0,D.jsx)(p.span,{animate:{opacity:[1,.72,1]},transition:{duration:1.25,repeat:1/0,ease:`easeInOut`},className:`font-medium text-foreground`,children:`Cancelling…`})]}):(0,D.jsxs)(D.Fragment,{children:[(0,D.jsx)(fe,{className:`size-3.5 shrink-0 text-foreground/65 group-hover:text-destructive`,"aria-hidden":!0}),(0,D.jsx)(p.span,{animate:{opacity:[1,.88,1]},transition:{duration:2.2,repeat:1/0,ease:`easeInOut`},children:`Cancel`})]})}):(0,D.jsx)(`div`,{className:`ml-auto shrink-0 flex items-center`,children:(0,D.jsx)(h,{type:`button`,variant:`secondary`,size:`xs`,className:`h-7 px-3 text-[10px] font-medium`,onClick:a.reset,children:`Close`})}),onDismiss:a.reset,children:a.operation?(0,D.jsx)(me,{operation:a.operation,catalogTemplates:[{id:t,name:n}]}):(0,D.jsxs)(`div`,{className:`flex flex-col gap-2 py-1`,children:[(0,D.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,D.jsx)(w,{className:`size-3.5 animate-spin text-primary`,"aria-hidden":!0}),(0,D.jsx)(`span`,{className:`text-xs text-foreground/88`,children:`Connecting to Litmus Edge…`})]}),(0,D.jsx)(`div`,{className:`h-1 w-full overflow-hidden rounded-full bg-muted/40`,children:(0,D.jsx)(p.div,{className:`h-full w-2/5 rounded-full bg-primary`,animate:{x:[`-100%`,`250%`]},transition:{duration:1.2,repeat:1/0,ease:`easeInOut`}})})]})},`deploy-stream`):null}),(0,D.jsxs)(`div`,{className:`flex flex-col gap-4 border-t border-border/40 pt-5`,children:[(0,D.jsx)(`p`,{className:`font-heading text-[11px] font-semibold uppercase tracking-[0.2em] text-foreground`,children:`Export`}),(0,D.jsxs)(`div`,{className:`space-y-2`,children:[(0,D.jsx)(T,{className:`font-heading text-[11px] font-medium uppercase tracking-[0.14em] text-foreground/78`,children:`Format`}),(0,D.jsxs)(`div`,{className:`flex flex-col gap-2 sm:flex-row sm:items-center`,children:[(0,D.jsxs)(Ae,{value:C,onValueChange:e=>{e&&Le(e)},children:[(0,D.jsx)(ke,{size:`sm`,className:`h-9! min-h-9 min-w-0 flex-1 border-border/65 bg-background/55 py-0 text-xs text-foreground`,children:(0,D.jsx)(Ee,{placeholder:`Select format`,children:t=>{if(t===`source-yaml`)return`Source YAML`;let n=x.find(e=>e.id===t);return n?.id===`litmus-edge`?Je(e):n?.exportLabel??`Select format`}})}),(0,D.jsxs)(De,{children:[(0,D.jsxs)(b,{children:[(0,D.jsx)(v,{children:`Platform`}),Ne.map(t=>(0,D.jsx)(y,{value:t.id,children:t.id===`litmus-edge`?Je(e):t.exportLabel},t.id)),Me.map(e=>(0,D.jsx)(y,{value:e.id,disabled:!0,children:(0,D.jsxs)(`span`,{className:`flex items-center gap-2`,children:[e.exportLabel,(0,D.jsx)(Ie,{variant:`outline`,className:`px-1 py-0 text-[10px] text-foreground/72`,children:`Coming Soon`})]})},e.id))]}),(0,D.jsx)(Oe,{}),(0,D.jsxs)(b,{children:[(0,D.jsx)(v,{children:`Source`}),(0,D.jsxs)(y,{value:`source-yaml`,children:[`Source YAML`,` `,(0,D.jsx)(`span`,{className:`text-foreground/72`,children:e===`model`?`.twin.yaml`:`.miravo.yaml`})]})]})]})]}),(0,D.jsxs)(h,{variant:`outline`,size:`sm`,className:`h-9 min-h-9 shrink-0 gap-1.5 border-border/70 bg-background/50 px-4 text-xs font-medium text-foreground sm:w-auto`,disabled:!J,onClick:nt,children:[(0,D.jsx)(Pe,{className:`size-3.5`}),`Download`]})]})]}),(0,D.jsx)(`p`,{className:`text-[11px] leading-snug text-foreground/70`,children:(0,D.jsx)(ye,{format:C,kind:e})})]}),K&&(0,D.jsx)(Te,{open:Re,onOpenChange:O,type:`apply`,label:n,targetLabel:K.label,hostname:K.hostname,sourceHostname:K.sourceHostname,onConfirm:$e,defaultDeviceName:e===`model`?We(t):void 0}),(0,D.jsx)(Se,{open:k,editing:!1,platformId:j,form:N,showToken:ze,saving:Ue,testing:Ye,canTestConnection:G,onOpenChange:A,onPlatformChange:M,onFormChange:P,onShowTokenChange:L,onSave:()=>void et(),onTestConnection:tt,onCancelInFlight:Xe}),(0,D.jsx)(ce,{open:B,onOpenChange:e=>{V(e),e||U(I)},children:(0,D.jsxs)(ue,{className:`sm:max-w-md`,children:[(0,D.jsxs)(le,{children:[(0,D.jsx)(de,{children:`Download Litmus Edge Template`}),(0,D.jsx)(se,{children:ge})]}),(0,D.jsxs)(`div`,{className:`space-y-2 py-1`,children:[(0,D.jsx)(T,{htmlFor:`deploy-export-source-host`,children:we}),(0,D.jsx)(pe,{id:`deploy-export-source-host`,value:H,onChange:e=>U(e.target.value),placeholder:I,autoComplete:`off`,className:`font-mono text-sm`}),(0,D.jsxs)(`p`,{className:`text-[11px] leading-snug text-muted-foreground`,children:[`Use an IP or hostname reachable from Litmus Edge (e.g.`,` `,(0,D.jsx)(`span`,{className:`font-mono`,children:I}),` for Docker bridge).`]})]}),(0,D.jsxs)(oe,{className:`gap-2 sm:gap-0`,children:[(0,D.jsx)(h,{type:`button`,variant:`outline`,onClick:()=>V(!1),disabled:W,children:`Cancel`}),(0,D.jsxs)(h,{type:`button`,className:`gap-1.5`,onClick:()=>void rt(),disabled:W,"aria-busy":W,children:[W?(0,D.jsx)(w,{className:`size-3.5 animate-spin`,"aria-hidden":!0}):(0,D.jsx)(Pe,{className:`size-3.5`,"aria-hidden":!0}),`Download`]})]})]})})]})}var Ye={builtin:`Built-in`,personal:`Personal`,community:`Community`},z=`border-border/60 bg-muted/40 text-muted-foreground`,Xe={builtin:z,personal:`border-primary/40 bg-primary/10 text-primary`,community:`border-accent/40 bg-accent/10 text-accent`};function B(e){return e===`cwd`||e===`namespace`?`personal`:e}function V(e){return Ye[B(e)]??e}function H(e){return Xe[B(e)]??z}export{O as a,M as c,Le as d,R as i,N as l,V as n,j as o,B as r,P as s,H as t,Re as u};
|
|
1
|
+
import{a as e}from"./rolldown-runtime-COnpUsM8.js";import{c as t}from"./vendor-charts-95ykyDlI.js";import{$ as n,J as r,Q as i,X as a,Y as o,Z as s,at as c,q as l}from"./vendor-ui-CWUk2ulb.js";import{S as u,a as d,b as ee,o as f,s as te}from"./api-B8Cqrm2G.js";import{i as ne,s as re,t as ie}from"./query-fetch-error-B6y_Rlj9.js";import{t as p}from"./proxy-Be4WzmcS.js";import{t as ae}from"./AnimatePresence-CPmH1DMY.js";import{a as oe,i as se,l as m,n as ce,o as le,r as ue,s as de}from"./copy-button-BvU3RDZa.js";import{S as h,w as fe,x as pe}from"./format-CshN6yEB.js";import{n as g,t as _}from"./utils-XFKvwlFT.js";import{S as me,b as he,d as ge,f as _e,g as ve,h as ye,i as be,p as xe,r as Se,s as Ce,x as we,y as Te}from"./use-platform-stream-DAr3QTPE.js";import{a as v,c as Ee,i as y,n as De,o as Oe,r as b,s as ke,t as Ae}from"./select-CmlY1M1a.js";import{a as je,i as x,n as Me,r as S,t as Ne}from"./platform-targets-BIQ1lKOg.js";import{a as C,o as w}from"./tabs-4SeH2unv.js";import{t as Pe}from"./download-DmUZKo9N.js";import{r as Fe}from"./checkbox-C_4HRnS_.js";import{t as Ie}from"./badge-eIn_7YrK.js";import{t as T}from"./label-CMBWxUhA.js";import{t as E}from"./get-error-message-Dk8elqEP.js";var Le=g(`minus`,[[`path`,{d:`M5 12h14`,key:`1ays0h`}]]),Re=g(`settings`,[[`path`,{d:`M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915`,key:`1i5ecw`}],[`circle`,{cx:`12`,cy:`12`,r:`3`,key:`1v7zrd`}]]),D=c();function O({...e}){return(0,D.jsx)(r,{"data-slot":`sheet`,...e})}function k({...e}){return(0,D.jsx)(o,{"data-slot":`sheet-portal`,...e})}function A({className:e,...t}){return(0,D.jsx)(n,{"data-slot":`sheet-overlay`,className:_(`fixed inset-0 z-50 bg-black/10 transition-opacity duration-150 data-ending-style:opacity-0 data-starting-style:opacity-0 supports-backdrop-filter:backdrop-blur-xs`,e),...t})}function j({className:e,children:t,side:n=`right`,showCloseButton:r=!0,...o}){return(0,D.jsxs)(k,{children:[(0,D.jsx)(A,{}),(0,D.jsxs)(a,{"data-slot":`sheet-content`,"data-side":n,className:_(`fixed z-50 flex flex-col gap-4 bg-background bg-clip-padding text-sm shadow-lg transition duration-200 ease-in-out data-ending-style:opacity-0 data-starting-style:opacity-0 data-[side=bottom]:inset-x-0 data-[side=bottom]:bottom-0 data-[side=bottom]:h-auto data-[side=bottom]:border-t data-[side=bottom]:data-ending-style:translate-y-[2.5rem] data-[side=bottom]:data-starting-style:translate-y-[2.5rem] data-[side=left]:inset-y-0 data-[side=left]:left-0 data-[side=left]:h-full data-[side=left]:w-[calc(100vw-1rem)] data-[side=left]:max-w-md data-[side=left]:border-r data-[side=left]:data-ending-style:translate-x-[-2.5rem] data-[side=left]:data-starting-style:translate-x-[-2.5rem] data-[side=right]:inset-y-0 data-[side=right]:right-0 data-[side=right]:h-full data-[side=right]:w-[calc(100vw-1rem)] data-[side=right]:max-w-xl data-[side=right]:border-l data-[side=right]:pl-1 data-[side=right]:data-ending-style:translate-x-[2.5rem] data-[side=right]:data-starting-style:translate-x-[2.5rem] data-[side=top]:inset-x-0 data-[side=top]:top-0 data-[side=top]:h-auto data-[side=top]:border-b data-[side=top]:data-ending-style:translate-y-[-2.5rem] data-[side=top]:data-starting-style:translate-y-[-2.5rem]`,e),...o,children:[t,r&&(0,D.jsxs)(i,{"data-slot":`sheet-close`,render:(0,D.jsx)(h,{variant:`ghost`,className:`absolute top-3 right-3`,size:`icon-sm`}),children:[(0,D.jsx)(fe,{}),(0,D.jsx)(`span`,{className:`sr-only`,children:`Close`})]})]})]})}function M({className:e,...t}){return(0,D.jsx)(`div`,{"data-slot":`sheet-header`,className:_(`flex flex-col gap-0.5 p-2`,e),...t})}function N({className:e,...t}){return(0,D.jsx)(l,{"data-slot":`sheet-title`,className:_(`text-base font-medium text-foreground`,e),...t})}function P({className:e,...t}){return(0,D.jsx)(s,{"data-slot":`sheet-description`,className:_(`text-sm text-muted-foreground`,e),...t})}var F=e(t(),1),ze=[{value:`opcua`,label:`OPC UA`},{value:`mqtt`,label:`MQTT`},{value:`modbus`,label:`Modbus`}];function Be({value:e,onValueChange:t,labelledBy:n}){return(0,D.jsx)(`fieldset`,{"aria-labelledby":n,className:`min-w-0 border-0 p-0`,children:(0,D.jsx)(`div`,{className:`flex gap-1.5`,children:ze.map(n=>{let r=e===n.value;return(0,D.jsx)(`button`,{type:`button`,"aria-pressed":r,onClick:()=>t(n.value),className:_(`flex flex-1 items-center justify-center rounded-[var(--miravo-radius-pill)] border py-1.5 text-center transition-[background-color,border-color,color,box-shadow] duration-200`,`focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/80 focus-visible:ring-offset-2 focus-visible:ring-offset-background`,r?`border-primary/45 bg-primary/10 text-primary shadow-[inset_0_1px_0_0_rgba(255,255,255,0.06),0_0_0_1px_color-mix(in_srgb,var(--primary)_25%,transparent)]`:`border-border/75 bg-background/55 text-foreground/82 hover:border-border/90 hover:bg-background/70 hover:text-foreground/92`),children:(0,D.jsxs)(`span`,{className:`inline-flex items-center justify-center gap-1.5 font-mono text-[11px] font-medium leading-none tracking-wide`,children:[(0,D.jsx)(C,{className:`size-2.5 shrink-0 -translate-y-px opacity-80`,"aria-hidden":!0}),(0,D.jsx)(`span`,{children:n.label})]})},n.value)})})})}var I=`172.17.0.1`;async function Ve(e){let t=await f(`/catalog/models/${encodeURIComponent(e)}/le-dt.json`,u.catalogModelLeDt);return JSON.stringify(t,null,2)}async function He(e,t={host:I}){let n=u.catalogTemplateLeTemplateJson.query;if(!n)throw Error(`Missing query schema for ${u.catalogTemplateLeTemplateJson.method} ${u.catalogTemplateLeTemplateJson.path}`);let r=n.safeParse(t);if(!r.success)throw Error(`Invalid request for ${u.catalogTemplateLeTemplateJson.method} ${u.catalogTemplateLeTemplateJson.path}: ${r.error.message}`);return d(`/catalog/templates/${encodeURIComponent(e)}/le-template.json${L(r.data)}`,u.catalogTemplateLeTemplateJson)}function L(e){let t=new URLSearchParams;return e.host&&t.set(`host`,e.host),e.protocol&&t.set(`protocol`,e.protocol),t.size>0?`?${t.toString()}`:``}function Ue(e){let t=e.split(/[-_]/).filter(e=>e.length>0);return t[t.length-1]??e}function We(e){return`${Ue(e)}-001`}function Ge(e,t){return[t,...e?.filter(e=>e.id!==t.id)??[]]}async function Ke(e){let t=await e.create();e.onCreated(t);try{await e.refresh()}catch(t){e.onRefreshFailed(t)}}function qe(e){return x.find(t=>t.id===e)?.label??e}function Je(e){return e===`template`?`Litmus Edge Template`:`Litmus Edge`}function R({kind:e,id:t,displayName:n,yamlPath:r,yamlFilename:i,stream:a}){let o=re(),s=ne({queryKey:ee.platforms.targets(),queryFn:()=>Ce()}),c=s.data??[],[l,d]=(0,F.useState)(``),[f,g]=(0,F.useState)(`opcua`),[C,Le]=(0,F.useState)(`litmus-edge`),[Re,O]=(0,F.useState)(!1),[k,A]=(0,F.useState)(!1),[j,M]=(0,F.useState)(S.id),[N,P]=(0,F.useState)({label:``,hostname:``,apiToken:``,sourceHostname:``}),[ze,L]=(0,F.useState)(!1),[Ue,R]=(0,F.useState)(!1),{testing:Ye,runTest:z,cancelInFlight:Xe}=Se(),[B,V]=(0,F.useState)(!1),[H,U]=(0,F.useState)(I),[W,Ze]=(0,F.useState)(!1),Qe=(0,F.useId)();(0,F.useEffect)(()=>{k&&(M(S.id),P({label:``,hostname:``,apiToken:``,sourceHostname:``}),L(!1))},[k]);let G=j===S.id&&N.hostname.trim().length>0&&N.sourceHostname.trim().length>0&&N.apiToken.trim().length>0,K=c.find(e=>e.id===l),$e=(0,F.useCallback)(n=>{O(!1),l&&(e===`model`?a.startApply({targetId:l,model:t,protocol:f,scope:n.scope,deviceName:n.deviceName,ifUnmanaged:n.ifUnmanaged}):a.startApply({targetId:l,template:t,scope:n.scope,ifUnmanaged:n.ifUnmanaged}))},[l,t,e,f,a]),et=(0,F.useCallback)(async()=>{if(j!==S.id){m.error(`${qe(j)} target setup is coming soon.`);return}if(!N.label||!N.hostname||!N.sourceHostname){m.error(`Label, hostname, and source host are required.`);return}if(!N.apiToken){m.error(`API token is required for new targets.`);return}R(!0);try{await Ke({create:()=>be({...N,platformId:j}),onCreated:e=>{o.setQueryData(ee.platforms.targets(),t=>Ge(t,e)),d(e.id),A(!1),m.success(`Target added.`)},refresh:async()=>{let e=await s.refetch();if(e.error)throw e.error},onRefreshFailed:e=>{m.error(`Target added, but target list refresh failed.`,{description:`${E(e,`Target list refresh failed.`)} Reload targets before retrying another add.`})}})}catch(e){m.error(E(e,`Failed to add target.`))}finally{R(!1)}},[j,N,s,o]),tt=(0,F.useCallback)(()=>{G&&z({hostname:N.hostname.trim(),sourceHostname:N.sourceHostname.trim(),apiToken:N.apiToken.trim()})},[G,N,z]),q=C===`source-yaml`,J=C===`litmus-edge`||q,Y=(0,F.useCallback)(async n=>{if(q){try{let t=await te(r,e===`model`?u.catalogModelYaml:u.catalogTemplateYaml),n=new Blob([t],{type:`text/yaml`}),a=URL.createObjectURL(n),o=document.createElement(`a`);o.href=a,o.download=i,o.click(),URL.revokeObjectURL(a),m.success(`Exported ${i}`)}catch{m.error(`Failed to export YAML`)}return}if(C===`litmus-edge`)try{if(e===`model`){let e=await Ve(t),n=new Blob([e],{type:`application/json`}),r=URL.createObjectURL(n),i=document.createElement(`a`);i.href=r,i.download=`${t}.le-dt.json`,i.click(),URL.revokeObjectURL(r),m.success(`Exported ${t}.le-dt.json`)}else{let e=n?.templateHost?.trim()??``,r=e.length>0?e:I,i=`${t}.le-template.json`,a=await He(t,{host:r,protocol:f}),o=URL.createObjectURL(a),s=document.createElement(`a`);s.href=o,s.download=i,s.click(),URL.revokeObjectURL(o),m.success(`Exported ${i}`)}}catch{m.error(`Failed to export platform format`)}},[C,q,e,t,r,i,f]),nt=(0,F.useCallback)(()=>{if(J){if(C===`litmus-edge`&&e===`template`){U(I),V(!0);return}Y()}},[J,C,e,Y]),rt=(0,F.useCallback)(async()=>{Ze(!0);try{await Y({templateHost:H}),V(!1)}finally{Ze(!1)}},[H,Y]),X=a.status===`running`,Z=a.cancelRequested,Q=!!l&&!X,it=!!a.operation||X,$=it?Te(a):null;return(0,D.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col gap-6 px-1 py-2`,children:[(0,D.jsx)(`div`,{className:`min-h-0 flex-1 overflow-y-auto pr-2`,children:(0,D.jsxs)(`div`,{className:`flex flex-col gap-5`,children:[(0,D.jsx)(`p`,{className:`font-heading text-[11px] font-semibold uppercase tracking-[0.2em] text-foreground`,children:`Deploy`}),(0,D.jsxs)(`div`,{className:`space-y-2`,children:[(0,D.jsx)(T,{className:`font-heading text-[11px] font-medium uppercase tracking-[0.14em] text-foreground/78`,children:`Target`}),s.isError&&s.data===void 0&&(0,D.jsx)(ie,{message:E(s.error,`Failed to load targets.`),onRetry:()=>void s.refetch(),isRetrying:s.isFetching&&!s.isPending}),(0,D.jsx)(ge,{targets:c,value:l,onValueChange:d,size:`sm`,className:`min-w-0 w-full border-border/65 bg-background/55 text-xs text-foreground`,onAddNew:()=>A(!0)})]}),e===`model`&&c.length>0&&(0,D.jsxs)(`div`,{className:`space-y-2`,children:[(0,D.jsx)(T,{id:Qe,className:`font-heading text-[11px] font-medium uppercase tracking-[0.14em] text-foreground/78`,children:`Protocol binding`}),(0,D.jsx)(Be,{value:f,onValueChange:g,labelledBy:Qe})]}),c.length>0&&(0,D.jsxs)(`button`,{type:`button`,disabled:!Q,onClick:()=>O(!0),className:_(`group flex w-full min-h-14 min-w-0 items-stretch overflow-hidden rounded-[var(--miravo-radius-stadium-lg)] text-left outline-none`,`transition-[border-color,box-shadow,background-color] duration-200 ease-out`,`focus-visible:ring-2 focus-visible:ring-ring/70 focus-visible:ring-offset-2 focus-visible:ring-offset-background`,`disabled:pointer-events-none disabled:opacity-55`,Q?[`border-2 border-primary/40 bg-background`,`bg-linear-to-r from-primary/12 via-background to-background`,`shadow-[inset_0_1px_0_0_rgba(255,255,255,0.025)]`,`hover:border-primary/56 hover:shadow-[inset_0_1px_0_0_rgba(255,255,255,0.025),0_0_14px_-8px_color-mix(in_srgb,var(--primary)_18%,transparent),0_0_22px_-12px_color-mix(in_srgb,var(--primary)_8%,transparent)]`]:[`border border-dashed border-border/65 bg-muted/15`,`hover:bg-muted/22`]),children:[(0,D.jsxs)(`span`,{className:`relative flex w-18 shrink-0 items-center justify-center bg-transparent`,"aria-hidden":!0,children:[(0,D.jsx)(`span`,{className:_(`absolute inset-y-2 -right-px w-px bg-linear-to-b from-transparent via-primary/30 to-transparent opacity-70`,!Q&&`via-border/80`)}),(0,D.jsx)(Fe,{className:_(`relative size-5`,Q?`text-primary`:`text-foreground/75`)})]}),(0,D.jsxs)(`span`,{className:`flex min-w-0 flex-1 flex-col justify-center gap-0.5 overflow-hidden px-3 py-2.5 sm:px-4`,children:[(0,D.jsx)(`span`,{className:_(`font-heading text-[11px] font-semibold uppercase tracking-[0.16em]`,Q?`text-primary`:`text-foreground/78`),children:Q?`Commit deploy`:X?`Deploy in progress…`:`Awaiting target`}),(0,D.jsx)(`span`,{className:_(`truncate font-mono text-[13px] leading-tight tracking-tight`,Q?`text-foreground`:`text-foreground/80`),children:K?.label??`Select a target above`})]}),(0,D.jsx)(`span`,{className:_(`flex shrink-0 items-center pr-2.5 sm:pr-3`,Q&&`pl-1`),children:(0,D.jsx)(`span`,{className:_(`flex size-9 items-center justify-center rounded-[var(--miravo-radius-stadium-sm)] border bg-transparent transition-[border-color,color] duration-200`,Q?`border-primary/40 text-primary group-hover:border-primary/55`:`border-border/75 text-foreground/75`),"aria-hidden":!0,children:(0,D.jsx)(je,{className:`size-4`,strokeWidth:2.25})})})]})]})}),(0,D.jsx)(ae,{children:it&&$?(0,D.jsx)(xe,{title:$.title,subtitle:$.subtitle,footerAction:X&&a.operation?.operationId?(0,D.jsx)(h,{variant:`outline`,size:`sm`,disabled:Z,"aria-busy":Z,className:_(`ml-auto group h-8 gap-1.5 px-3 text-xs`,Z?`cursor-not-allowed`:`hover:bg-destructive/12 hover:text-destructive hover:border-destructive/35`),onClick:()=>{a.cancel().catch(()=>{})},children:Z?(0,D.jsxs)(D.Fragment,{children:[(0,D.jsx)(w,{className:`size-3.5 shrink-0 animate-spin text-muted-foreground`,"aria-hidden":!0}),(0,D.jsx)(p.span,{animate:{opacity:[1,.72,1]},transition:{duration:1.25,repeat:1/0,ease:`easeInOut`},className:`font-medium text-foreground`,children:`Cancelling…`})]}):(0,D.jsxs)(D.Fragment,{children:[(0,D.jsx)(fe,{className:`size-3.5 shrink-0 text-foreground/65 group-hover:text-destructive`,"aria-hidden":!0}),(0,D.jsx)(p.span,{animate:{opacity:[1,.88,1]},transition:{duration:2.2,repeat:1/0,ease:`easeInOut`},children:`Cancel`})]})}):(0,D.jsx)(`div`,{className:`ml-auto shrink-0 flex items-center`,children:(0,D.jsx)(h,{type:`button`,variant:`secondary`,size:`xs`,className:`h-7 px-3 text-[10px] font-medium`,onClick:a.reset,children:`Close`})}),onDismiss:a.reset,children:a.operation?(0,D.jsx)(ve,{operation:a.operation,catalogTemplates:[{id:t,name:n}],logs:a.logs}):(0,D.jsxs)(`div`,{className:`flex flex-col gap-2 py-1`,children:[(0,D.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,D.jsx)(w,{className:`size-3.5 animate-spin text-primary`,"aria-hidden":!0}),(0,D.jsx)(`span`,{className:`text-xs text-foreground/88`,children:`Connecting to Litmus Edge…`})]}),(0,D.jsx)(`div`,{className:`h-1 w-full overflow-hidden rounded-full bg-muted/40`,children:(0,D.jsx)(p.div,{className:`h-full w-2/5 rounded-full bg-primary`,animate:{x:[`-100%`,`250%`]},transition:{duration:1.2,repeat:1/0,ease:`easeInOut`}})})]})},`deploy-stream`):null}),(0,D.jsxs)(`div`,{className:`flex flex-col gap-4 border-t border-border/40 pt-5`,children:[(0,D.jsx)(`p`,{className:`font-heading text-[11px] font-semibold uppercase tracking-[0.2em] text-foreground`,children:`Export`}),(0,D.jsxs)(`div`,{className:`space-y-2`,children:[(0,D.jsx)(T,{className:`font-heading text-[11px] font-medium uppercase tracking-[0.14em] text-foreground/78`,children:`Format`}),(0,D.jsxs)(`div`,{className:`flex flex-col gap-2 sm:flex-row sm:items-center`,children:[(0,D.jsxs)(Ae,{value:C,onValueChange:e=>{e&&Le(e)},children:[(0,D.jsx)(ke,{size:`sm`,className:`h-9! min-h-9 min-w-0 flex-1 border-border/65 bg-background/55 py-0 text-xs text-foreground`,children:(0,D.jsx)(Ee,{placeholder:`Select format`,children:t=>{if(t===`source-yaml`)return`Source YAML`;let n=x.find(e=>e.id===t);return n?.id===`litmus-edge`?Je(e):n?.exportLabel??`Select format`}})}),(0,D.jsxs)(De,{children:[(0,D.jsxs)(b,{children:[(0,D.jsx)(v,{children:`Platform`}),Ne.map(t=>(0,D.jsx)(y,{value:t.id,children:t.id===`litmus-edge`?Je(e):t.exportLabel},t.id)),Me.map(e=>(0,D.jsx)(y,{value:e.id,disabled:!0,children:(0,D.jsxs)(`span`,{className:`flex items-center gap-2`,children:[e.exportLabel,(0,D.jsx)(Ie,{variant:`outline`,className:`px-1 py-0 text-[10px] text-foreground/72`,children:`Coming Soon`})]})},e.id))]}),(0,D.jsx)(Oe,{}),(0,D.jsxs)(b,{children:[(0,D.jsx)(v,{children:`Source`}),(0,D.jsxs)(y,{value:`source-yaml`,children:[`Source YAML`,` `,(0,D.jsx)(`span`,{className:`text-foreground/72`,children:e===`model`?`.twin.yaml`:`.miravo.yaml`})]})]})]})]}),(0,D.jsxs)(h,{variant:`outline`,size:`sm`,className:`h-9 min-h-9 shrink-0 gap-1.5 border-border/70 bg-background/50 px-4 text-xs font-medium text-foreground sm:w-auto`,disabled:!J,onClick:nt,children:[(0,D.jsx)(Pe,{className:`size-3.5`}),`Download`]})]})]}),(0,D.jsx)(`p`,{className:`text-[11px] leading-snug text-foreground/70`,children:(0,D.jsx)(ye,{format:C,kind:e})})]}),K&&(0,D.jsx)(he,{open:Re,onOpenChange:O,type:`apply`,label:n,targetLabel:K.label,hostname:K.hostname,sourceHostname:K.sourceHostname,onConfirm:$e,defaultDeviceName:e===`model`?We(t):void 0}),(0,D.jsx)(_e,{open:k,editing:!1,platformId:j,form:N,showToken:ze,saving:Ue,testing:Ye,canTestConnection:G,onOpenChange:A,onPlatformChange:M,onFormChange:P,onShowTokenChange:L,onSave:()=>void et(),onTestConnection:tt,onCancelInFlight:Xe}),(0,D.jsx)(ce,{open:B,onOpenChange:e=>{V(e),e||U(I)},children:(0,D.jsxs)(ue,{className:`sm:max-w-md`,children:[(0,D.jsxs)(le,{children:[(0,D.jsx)(de,{children:`Download Litmus Edge Template`}),(0,D.jsx)(se,{children:we})]}),(0,D.jsxs)(`div`,{className:`space-y-2 py-1`,children:[(0,D.jsx)(T,{htmlFor:`deploy-export-source-host`,children:me}),(0,D.jsx)(pe,{id:`deploy-export-source-host`,value:H,onChange:e=>U(e.target.value),placeholder:I,autoComplete:`off`,className:`font-mono text-sm`}),(0,D.jsxs)(`p`,{className:`text-[11px] leading-snug text-muted-foreground`,children:[`Use an IP or hostname reachable from Litmus Edge (e.g.`,` `,(0,D.jsx)(`span`,{className:`font-mono`,children:I}),` for Docker bridge).`]})]}),(0,D.jsxs)(oe,{className:`gap-2 sm:gap-0`,children:[(0,D.jsx)(h,{type:`button`,variant:`outline`,onClick:()=>V(!1),disabled:W,children:`Cancel`}),(0,D.jsxs)(h,{type:`button`,className:`gap-1.5`,onClick:()=>void rt(),disabled:W,"aria-busy":W,children:[W?(0,D.jsx)(w,{className:`size-3.5 animate-spin`,"aria-hidden":!0}):(0,D.jsx)(Pe,{className:`size-3.5`,"aria-hidden":!0}),`Download`]})]})]})})]})}var Ye={builtin:`Built-in`,personal:`Personal`,community:`Community`},z=`border-border/60 bg-muted/40 text-muted-foreground`,Xe={builtin:z,personal:`border-primary/40 bg-primary/10 text-primary`,community:`border-accent/40 bg-accent/10 text-accent`};function B(e){return e===`cwd`||e===`namespace`?`personal`:e}function V(e){return Ye[B(e)]??e}function H(e){return Xe[B(e)]??z}export{O as a,M as c,Le as d,R as i,N as l,V as n,j as o,B as r,P as s,H as t,Re as u};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{at as e}from"./vendor-ui-
|
|
1
|
+
import{at as e}from"./vendor-ui-CWUk2ulb.js";import{n as t,t as n}from"./utils-XFKvwlFT.js";var r=t(`building`,[[`path`,{d:`M12 10h.01`,key:`1nrarc`}],[`path`,{d:`M12 14h.01`,key:`1etili`}],[`path`,{d:`M12 6h.01`,key:`1vi96p`}],[`path`,{d:`M16 10h.01`,key:`1m94wz`}],[`path`,{d:`M16 14h.01`,key:`1gbofw`}],[`path`,{d:`M16 6h.01`,key:`1x0f13`}],[`path`,{d:`M8 10h.01`,key:`19clt8`}],[`path`,{d:`M8 14h.01`,key:`6423bh`}],[`path`,{d:`M8 6h.01`,key:`1dz90k`}],[`path`,{d:`M9 22v-3a1 1 0 0 1 1-1h4a1 1 0 0 1 1 1v3`,key:`cabbwy`}],[`rect`,{x:`4`,y:`2`,width:`16`,height:`20`,rx:`2`,key:`1uxh74`}]]),i=t(`droplet`,[[`path`,{d:`M12 22a7 7 0 0 0 7-7c0-2-1-3.9-3-5.5s-3.5-4-4-6.5c-.5 2.5-2 4.9-4 6.5C6 11.1 5 13 5 15a7 7 0 0 0 7 7z`,key:`c7niix`}]]),a=t(`factory`,[[`path`,{d:`M12 16h.01`,key:`1drbdi`}],[`path`,{d:`M16 16h.01`,key:`1f9h7w`}],[`path`,{d:`M3 19a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2V8.5a.5.5 0 0 0-.769-.422l-4.462 2.844A.5.5 0 0 1 15 10.5v-2a.5.5 0 0 0-.769-.422L9.77 10.922A.5.5 0 0 1 9 10.5V5a2 2 0 0 0-2-2H5a2 2 0 0 0-2 2z`,key:`1iv0i2`}],[`path`,{d:`M8 16h.01`,key:`18s6g9`}]]),o=t(`layout-template`,[[`rect`,{width:`18`,height:`7`,x:`3`,y:`3`,rx:`1`,key:`f1a2em`}],[`rect`,{width:`9`,height:`7`,x:`3`,y:`14`,rx:`1`,key:`jqznyg`}],[`rect`,{width:`5`,height:`7`,x:`16`,y:`14`,rx:`1`,key:`q5h2i8`}]]),s=t(`zap`,[[`path`,{d:`M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z`,key:`1xq2db`}]]),c=e();function l({id:e,className:t}){let l=n(`shrink-0 text-primary`,t);switch(e){case`smart-factory`:return(0,c.jsx)(a,{className:l,"aria-hidden":!0});case`water-treatment`:return(0,c.jsx)(i,{className:l,"aria-hidden":!0});case`commercial-building`:return(0,c.jsx)(r,{className:l,"aria-hidden":!0});case`backup-power`:return(0,c.jsx)(s,{className:l,"aria-hidden":!0});default:return(0,c.jsx)(o,{className:l,"aria-hidden":!0})}}export{s as n,l as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{O as e,at as t,k as n}from"./vendor-ui-
|
|
1
|
+
import{O as e,at as t,k as n}from"./vendor-ui-CWUk2ulb.js";import{T as r}from"./format-CshN6yEB.js";import{n as i,t as a}from"./utils-XFKvwlFT.js";var o=i(`info`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M12 16v-4`,key:`1dtifu`}],[`path`,{d:`M12 8h.01`,key:`e9boi3`}]]),s=i(`rocket`,[[`path`,{d:`M12 15v5s3.03-.55 4-2c1.08-1.62 0-5 0-5`,key:`qeys4`}],[`path`,{d:`M4.5 16.5c-1.5 1.26-2 5-2 5s3.74-.5 5-2c.71-.84.7-2.13-.09-2.91a2.18 2.18 0 0 0-2.91-.09`,key:`u4xsad`}],[`path`,{d:`M9 12a22 22 0 0 1 2-3.95A12.88 12.88 0 0 1 22 2c0 2.72-.78 7.5-6 11a22.4 22.4 0 0 1-4 2z`,key:`676m9`}],[`path`,{d:`M9 12H4s.55-3.03 2-4c1.62-1.08 5 .05 5 .05`,key:`92ym6u`}]]),c=i(`server`,[[`rect`,{width:`20`,height:`8`,x:`2`,y:`2`,rx:`2`,ry:`2`,key:`ngkwjq`}],[`rect`,{width:`20`,height:`8`,x:`2`,y:`14`,rx:`2`,ry:`2`,key:`iecqi9`}],[`line`,{x1:`6`,x2:`6.01`,y1:`6`,y2:`6`,key:`16zg32`}],[`line`,{x1:`6`,x2:`6.01`,y1:`18`,y2:`18`,key:`nzw8ys`}]]),l=t();function u({className:t,...i}){return(0,l.jsx)(n,{"data-slot":`checkbox`,className:a(`peer relative flex size-4 shrink-0 items-center justify-center rounded-[4px] border border-input transition-colors outline-none group-has-disabled/field:opacity-50 after:absolute after:-inset-x-3 after:-inset-y-2 focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 aria-invalid:aria-checked:border-primary bg-input/30 aria-invalid:border-destructive/50 aria-invalid:ring-destructive/40 data-checked:border-primary data-checked:bg-primary data-checked:text-primary-foreground data-checked:bg-primary`,t),...i,children:(0,l.jsx)(e,{"data-slot":`checkbox-indicator`,className:`grid place-content-center text-current transition-none [&>svg]:size-3.5`,children:(0,l.jsx)(r,{})})})}export{o as i,c as n,s as r,u as t};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{a as e}from"./rolldown-runtime-COnpUsM8.js";import{s as t}from"./vendor-charts-CAZdaPlq.js";var n=e(t(),1),r=`modulepreload`,i=function(e){return`/`+e},a={},o=function(e,t,n){let o=Promise.resolve();if(t&&t.length>0){let e=document.getElementsByTagName(`link`),s=document.querySelector(`meta[property=csp-nonce]`),c=s?.nonce||s?.getAttribute(`nonce`);function l(e){return Promise.all(e.map(e=>Promise.resolve(e).then(e=>({status:`fulfilled`,value:e}),e=>({status:`rejected`,reason:e}))))}o=l(t.map(t=>{if(t=i(t,n),t in a)return;a[t]=!0;let o=t.endsWith(`.css`),s=o?`[rel="stylesheet"]`:``;if(n)for(let n=e.length-1;n>=0;n--){let r=e[n];if(r.href===t&&(!o||r.rel===`stylesheet`))return}else if(document.querySelector(`link[href="${t}"]${s}`))return;let l=document.createElement(`link`);if(l.rel=o?`stylesheet`:r,o||(l.as=`script`),l.crossOrigin=``,l.href=t,c&&l.setAttribute(`nonce`,c),document.head.appendChild(l),o)return new Promise((e,n)=>{l.addEventListener(`load`,e),l.addEventListener(`error`,()=>n(Error(`Unable to preload CSS for ${t}`)))})}))}function s(e){let t=new Event(`vite:preloadError`,{cancelable:!0});if(t.payload=e,window.dispatchEvent(t),!t.defaultPrevented)throw e}return o.then(t=>{for(let e of t||[])e.status===`rejected`&&s(e.reason);return e().catch(s)})},s=`popstate`;function c(e){return typeof e==`object`&&!!e&&`pathname`in e&&`search`in e&&`hash`in e&&`state`in e&&`key`in e}function l(e={}){function t(e,t){let n=t.state?.masked,{pathname:r,search:i,hash:a}=n||e.location;return m(``,{pathname:r,search:i,hash:a},t.state&&t.state.usr||null,t.state&&t.state.key||`default`,n?{pathname:e.location.pathname,search:e.location.search,hash:e.location.hash}:void 0)}function n(e,t){return typeof t==`string`?t:h(t)}return _(t,n,null,e)}function u(e,t){if(e===!1||e==null)throw Error(t)}function d(e,t){if(!e){typeof console<`u`&&console.warn(t);try{throw Error(t)}catch{}}}function f(){return Math.random().toString(36).substring(2,10)}function p(e,t){return{usr:e.state,key:e.key,idx:t,masked:e.unstable_mask?{pathname:e.pathname,search:e.search,hash:e.hash}:void 0}}function m(e,t,n=null,r,i){return{pathname:typeof e==`string`?e:e.pathname,search:``,hash:``,...typeof t==`string`?g(t):t,state:n,key:t&&t.key||r||f(),unstable_mask:i}}function h({pathname:e=`/`,search:t=``,hash:n=``}){return t&&t!==`?`&&(e+=t.charAt(0)===`?`?t:`?`+t),n&&n!==`#`&&(e+=n.charAt(0)===`#`?n:`#`+n),e}function g(e){let t={};if(e){let n=e.indexOf(`#`);n>=0&&(t.hash=e.substring(n),e=e.substring(0,n));let r=e.indexOf(`?`);r>=0&&(t.search=e.substring(r),e=e.substring(0,r)),e&&(t.pathname=e)}return t}function _(e,t,n,r={}){let{window:i=document.defaultView,v5Compat:a=!1}=r,o=i.history,l=`POP`,u=null,d=f();d??(d=0,o.replaceState({...o.state,idx:d},``));function f(){return(o.state||{idx:null}).idx}function h(){l=`POP`;let e=f(),t=e==null?null:e-d;d=e,u&&u({action:l,location:b.location,delta:t})}function g(e,t){l=`PUSH`;let r=c(e)?e:m(b.location,e,t);n&&n(r,e),d=f()+1;let s=p(r,d),h=b.createHref(r.unstable_mask||r);try{o.pushState(s,``,h)}catch(e){if(e instanceof DOMException&&e.name===`DataCloneError`)throw e;i.location.assign(h)}a&&u&&u({action:l,location:b.location,delta:1})}function _(e,t){l=`REPLACE`;let r=c(e)?e:m(b.location,e,t);n&&n(r,e),d=f();let i=p(r,d),s=b.createHref(r.unstable_mask||r);o.replaceState(i,``,s),a&&u&&u({action:l,location:b.location,delta:0})}function y(e){return v(e)}let b={get action(){return l},get location(){return e(i,o)},listen(e){if(u)throw Error(`A history only accepts one active listener`);return i.addEventListener(s,h),u=e,()=>{i.removeEventListener(s,h),u=null}},createHref(e){return t(i,e)},createURL:y,encodeLocation(e){let t=y(e);return{pathname:t.pathname,search:t.search,hash:t.hash}},push:g,replace:_,go(e){return o.go(e)}};return b}function v(e,t=!1){let n=`http://localhost`;typeof window<`u`&&(n=window.location.origin===`null`?window.location.href:window.location.origin),u(n,`No window.location.(origin|href) available to create URL`);let r=typeof e==`string`?e:h(e);return r=r.replace(/ $/,`%20`),!t&&r.startsWith(`//`)&&(r=n+r),new URL(r,n)}function y(e,t,n=`/`){return b(e,t,n,!1)}function b(e,t,n,r){let i=k((typeof t==`string`?g(t):t).pathname||`/`,n);if(i==null)return null;let a=S(e);w(a);let o=null;for(let e=0;o==null&&e<a.length;++e){let t=ce(i);o=oe(a[e],t,r)}return o}function x(e,t){let{route:n,pathname:r,params:i}=e;return{id:n.id,pathname:r,params:i,data:t[n.id],loaderData:t[n.id],handle:n.handle}}function S(e,t=[],n=[],r=``,i=!1){let a=(e,a,o=i,s)=>{let c={relativePath:s===void 0?e.path||``:s,caseSensitive:e.caseSensitive===!0,childrenIndex:a,route:e};if(c.relativePath.startsWith(`/`)){if(!c.relativePath.startsWith(r)&&o)return;u(c.relativePath.startsWith(r),`Absolute route path "${c.relativePath}" nested under path "${r}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),c.relativePath=c.relativePath.slice(r.length)}let l=N([r,c.relativePath]),d=n.concat(c);e.children&&e.children.length>0&&(u(e.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${l}".`),S(e.children,t,d,l,o)),!(e.path==null&&!e.index)&&t.push({path:l,score:ie(l,e.index),routesMeta:d})};return e.forEach((e,t)=>{if(e.path===``||!e.path?.includes(`?`))a(e,t);else for(let n of C(e.path))a(e,t,!0,n)}),t}function C(e){let t=e.split(`/`);if(t.length===0)return[];let[n,...r]=t,i=n.endsWith(`?`),a=n.replace(/\?$/,``);if(r.length===0)return i?[a,``]:[a];let o=C(r.join(`/`)),s=[];return s.push(...o.map(e=>e===``?a:[a,e].join(`/`))),i&&s.push(...o),s.map(t=>e.startsWith(`/`)&&t===``?`/`:t)}function w(e){e.sort((e,t)=>e.score===t.score?ae(e.routesMeta.map(e=>e.childrenIndex),t.routesMeta.map(e=>e.childrenIndex)):t.score-e.score)}var T=/^:[\w-]+$/,ee=3,te=2,ne=1,E=10,D=-2,re=e=>e===`*`;function ie(e,t){let n=e.split(`/`),r=n.length;return n.some(re)&&(r+=D),t&&(r+=te),n.filter(e=>!re(e)).reduce((e,t)=>e+(T.test(t)?ee:t===``?ne:E),r)}function ae(e,t){return e.length===t.length&&e.slice(0,-1).every((e,n)=>e===t[n])?e[e.length-1]-t[t.length-1]:0}function oe(e,t,n=!1){let{routesMeta:r}=e,i={},a=`/`,o=[];for(let e=0;e<r.length;++e){let s=r[e],c=e===r.length-1,l=a===`/`?t:t.slice(a.length)||`/`,u=O({path:s.relativePath,caseSensitive:s.caseSensitive,end:c},l),d=s.route;if(!u&&c&&n&&!r[r.length-1].route.index&&(u=O({path:s.relativePath,caseSensitive:s.caseSensitive,end:!1},l)),!u)return null;Object.assign(i,u.params),o.push({params:i,pathname:N([a,u.pathname]),pathnameBase:me(N([a,u.pathnameBase])),route:d}),u.pathnameBase!==`/`&&(a=N([a,u.pathnameBase]))}return o}function O(e,t){typeof e==`string`&&(e={path:e,caseSensitive:!1,end:!0});let[n,r]=se(e.path,e.caseSensitive,e.end),i=t.match(n);if(!i)return null;let a=i[0],o=a.replace(/(.)\/+$/,`$1`),s=i.slice(1);return{params:r.reduce((e,{paramName:t,isOptional:n},r)=>{if(t===`*`){let e=s[r]||``;o=a.slice(0,a.length-e.length).replace(/(.)\/+$/,`$1`)}let i=s[r];return n&&!i?e[t]=void 0:e[t]=(i||``).replace(/%2F/g,`/`),e},{}),pathname:a,pathnameBase:o,pattern:e}}function se(e,t=!1,n=!0){d(e===`*`||!e.endsWith(`*`)||e.endsWith(`/*`),`Route path "${e}" will be treated as if it were "${e.replace(/\*$/,`/*`)}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${e.replace(/\*$/,`/*`)}".`);let r=[],i=`^`+e.replace(/\/*\*?$/,``).replace(/^\/*/,`/`).replace(/[\\.*+^${}|()[\]]/g,`\\$&`).replace(/\/:([\w-]+)(\?)?/g,(e,t,n,i,a)=>{if(r.push({paramName:t,isOptional:n!=null}),n){let t=a.charAt(i+e.length);return t&&t!==`/`?`/([^\\/]*)`:`(?:/([^\\/]*))?`}return`/([^\\/]+)`}).replace(/\/([\w-]+)\?(\/|$)/g,`(/$1)?$2`);return e.endsWith(`*`)?(r.push({paramName:`*`}),i+=e===`*`||e===`/*`?`(.*)$`:`(?:\\/(.+)|\\/*)$`):n?i+=`\\/*$`:e!==``&&e!==`/`&&(i+=`(?:(?=\\/|$))`),[new RegExp(i,t?void 0:`i`),r]}function ce(e){try{return e.split(`/`).map(e=>decodeURIComponent(e).replace(/\//g,`%2F`)).join(`/`)}catch(t){return d(!1,`The URL path "${e}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${t}).`),e}}function k(e,t){if(t===`/`)return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let n=t.endsWith(`/`)?t.length-1:t.length,r=e.charAt(n);return r&&r!==`/`?null:e.slice(n)||`/`}var le=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i;function ue(e,t=`/`){let{pathname:n,search:r=``,hash:i=``}=typeof e==`string`?g(e):e,a;return n?(n=pe(n),a=n.startsWith(`/`)?de(n.substring(1),`/`):de(n,t)):a=t,{pathname:a,search:he(r),hash:ge(i)}}function de(e,t){let n=P(t).split(`/`);return e.split(`/`).forEach(e=>{e===`..`?n.length>1&&n.pop():e!==`.`&&n.push(e)}),n.length>1?n.join(`/`):`/`}function A(e,t,n,r){return`Cannot include a '${e}' character in a manually specified \`to.${t}\` field [${JSON.stringify(r)}]. Please separate it out to the \`to.${n}\` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.`}function fe(e){return e.filter((e,t)=>t===0||e.route.path&&e.route.path.length>0)}function j(e){let t=fe(e);return t.map((e,n)=>n===t.length-1?e.pathname:e.pathnameBase)}function M(e,t,n,r=!1){let i;typeof e==`string`?i=g(e):(i={...e},u(!i.pathname||!i.pathname.includes(`?`),A(`?`,`pathname`,`search`,i)),u(!i.pathname||!i.pathname.includes(`#`),A(`#`,`pathname`,`hash`,i)),u(!i.search||!i.search.includes(`#`),A(`#`,`search`,`hash`,i)));let a=e===``||i.pathname===``,o=a?`/`:i.pathname,s;if(o==null)s=n;else{let e=t.length-1;if(!r&&o.startsWith(`..`)){let t=o.split(`/`);for(;t[0]===`..`;)t.shift(),--e;i.pathname=t.join(`/`)}s=e>=0?t[e]:`/`}let c=ue(i,s),l=o&&o!==`/`&&o.endsWith(`/`),d=(a||o===`.`)&&n.endsWith(`/`);return!c.pathname.endsWith(`/`)&&(l||d)&&(c.pathname+=`/`),c}var pe=e=>e.replace(/\/\/+/g,`/`),N=e=>pe(e.join(`/`)),P=e=>e.replace(/\/+$/,``),me=e=>P(e).replace(/^\/*/,`/`),he=e=>!e||e===`?`?``:e.startsWith(`?`)?e:`?`+e,ge=e=>!e||e===`#`?``:e.startsWith(`#`)?e:`#`+e,_e=class{constructor(e,t,n,r=!1){this.status=e,this.statusText=t||``,this.internal=r,n instanceof Error?(this.data=n.toString(),this.error=n):this.data=n}};function ve(e){return e!=null&&typeof e.status==`number`&&typeof e.statusText==`string`&&typeof e.internal==`boolean`&&`data`in e}function ye(e){return N(e.map(e=>e.route.path).filter(Boolean))||`/`}var be=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0;function xe(e,t){let n=e;if(typeof n!=`string`||!le.test(n))return{absoluteURL:void 0,isExternal:!1,to:n};let r=n,i=!1;if(be)try{let e=new URL(window.location.href),r=n.startsWith(`//`)?new URL(e.protocol+n):new URL(n),a=k(r.pathname,t);r.origin===e.origin&&a!=null?n=a+r.search+r.hash:i=!0}catch{d(!1,`<Link to="${n}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}return{absoluteURL:r,isExternal:i,to:n}}Object.getOwnPropertyNames(Object.prototype).sort().join(`\0`);var Se=[`POST`,`PUT`,`PATCH`,`DELETE`];new Set(Se);var Ce=[`GET`,...Se];new Set(Ce);var F=n.createContext(null);F.displayName=`DataRouter`;var I=n.createContext(null);I.displayName=`DataRouterState`;var we=n.createContext(!1);function Te(){return n.useContext(we)}var Ee=n.createContext({isTransitioning:!1});Ee.displayName=`ViewTransition`;var De=n.createContext(new Map);De.displayName=`Fetchers`;var Oe=n.createContext(null);Oe.displayName=`Await`;var L=n.createContext(null);L.displayName=`Navigation`;var R=n.createContext(null);R.displayName=`Location`;var z=n.createContext({outlet:null,matches:[],isDataRoute:!1});z.displayName=`Route`;var B=n.createContext(null);B.displayName=`RouteError`;var ke=`REACT_ROUTER_ERROR`,Ae=`REDIRECT`,je=`ROUTE_ERROR_RESPONSE`;function Me(e){if(e.startsWith(`${ke}:${Ae}:{`))try{let t=JSON.parse(e.slice(28));if(typeof t==`object`&&t&&typeof t.status==`number`&&typeof t.statusText==`string`&&typeof t.location==`string`&&typeof t.reloadDocument==`boolean`&&typeof t.replace==`boolean`)return t}catch{}}function Ne(e){if(e.startsWith(`${ke}:${je}:{`))try{let t=JSON.parse(e.slice(40));if(typeof t==`object`&&t&&typeof t.status==`number`&&typeof t.statusText==`string`)return new _e(t.status,t.statusText,t.data)}catch{}}function Pe(e,{relative:t}={}){u(V(),`useHref() may be used only in the context of a <Router> component.`);let{basename:r,navigator:i}=n.useContext(L),{hash:a,pathname:o,search:s}=W(e,{relative:t}),c=o;return r!==`/`&&(c=o===`/`?r:N([r,o])),i.createHref({pathname:c,search:s,hash:a})}function V(){return n.useContext(R)!=null}function H(){return u(V(),`useLocation() may be used only in the context of a <Router> component.`),n.useContext(R).location}var Fe=`You should call navigate() in a React.useEffect(), not when your component is first rendered.`;function Ie(e){n.useContext(L).static||n.useLayoutEffect(e)}function U(){let{isDataRoute:e}=n.useContext(z);return e?nt():Le()}function Le(){u(V(),`useNavigate() may be used only in the context of a <Router> component.`);let e=n.useContext(F),{basename:t,navigator:r}=n.useContext(L),{matches:i}=n.useContext(z),{pathname:a}=H(),o=JSON.stringify(j(i)),s=n.useRef(!1);return Ie(()=>{s.current=!0}),n.useCallback((n,i={})=>{if(d(s.current,Fe),!s.current)return;if(typeof n==`number`){r.go(n);return}let c=M(n,JSON.parse(o),a,i.relative===`path`);e==null&&t!==`/`&&(c.pathname=c.pathname===`/`?t:N([t,c.pathname])),(i.replace?r.replace:r.push)(c,i.state,i)},[t,r,o,a,e])}n.createContext(null);function Re(){let{matches:e}=n.useContext(z),t=e[e.length-1];return t?t.params:{}}function W(e,{relative:t}={}){let{matches:r}=n.useContext(z),{pathname:i}=H(),a=JSON.stringify(j(r));return n.useMemo(()=>M(e,JSON.parse(a),i,t===`path`),[e,a,i,t])}function ze(e,t){return Be(e,t)}function Be(e,t,r){u(V(),`useRoutes() may be used only in the context of a <Router> component.`);let{navigator:i}=n.useContext(L),{matches:a}=n.useContext(z),o=a[a.length-1],s=o?o.params:{},c=o?o.pathname:`/`,l=o?o.pathnameBase:`/`,f=o&&o.route;{let e=f&&f.path||``;it(c,!f||e.endsWith(`*`)||e.endsWith(`*?`),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${c}" (under <Route path="${e}">) but the parent route path has no trailing "*". This means if you navigate deeper, the parent won't match anymore and therefore the child routes will never render.
|
|
1
|
+
import{a as e}from"./rolldown-runtime-COnpUsM8.js";import{c as t}from"./vendor-charts-95ykyDlI.js";var n=e(t(),1),r=`modulepreload`,i=function(e){return`/`+e},a={},o=function(e,t,n){let o=Promise.resolve();if(t&&t.length>0){let e=document.getElementsByTagName(`link`),s=document.querySelector(`meta[property=csp-nonce]`),c=s?.nonce||s?.getAttribute(`nonce`);function l(e){return Promise.all(e.map(e=>Promise.resolve(e).then(e=>({status:`fulfilled`,value:e}),e=>({status:`rejected`,reason:e}))))}o=l(t.map(t=>{if(t=i(t,n),t in a)return;a[t]=!0;let o=t.endsWith(`.css`),s=o?`[rel="stylesheet"]`:``;if(n)for(let n=e.length-1;n>=0;n--){let r=e[n];if(r.href===t&&(!o||r.rel===`stylesheet`))return}else if(document.querySelector(`link[href="${t}"]${s}`))return;let l=document.createElement(`link`);if(l.rel=o?`stylesheet`:r,o||(l.as=`script`),l.crossOrigin=``,l.href=t,c&&l.setAttribute(`nonce`,c),document.head.appendChild(l),o)return new Promise((e,n)=>{l.addEventListener(`load`,e),l.addEventListener(`error`,()=>n(Error(`Unable to preload CSS for ${t}`)))})}))}function s(e){let t=new Event(`vite:preloadError`,{cancelable:!0});if(t.payload=e,window.dispatchEvent(t),!t.defaultPrevented)throw e}return o.then(t=>{for(let e of t||[])e.status===`rejected`&&s(e.reason);return e().catch(s)})},s=`popstate`;function c(e){return typeof e==`object`&&!!e&&`pathname`in e&&`search`in e&&`hash`in e&&`state`in e&&`key`in e}function l(e={}){function t(e,t){let n=t.state?.masked,{pathname:r,search:i,hash:a}=n||e.location;return m(``,{pathname:r,search:i,hash:a},t.state&&t.state.usr||null,t.state&&t.state.key||`default`,n?{pathname:e.location.pathname,search:e.location.search,hash:e.location.hash}:void 0)}function n(e,t){return typeof t==`string`?t:h(t)}return _(t,n,null,e)}function u(e,t){if(e===!1||e==null)throw Error(t)}function d(e,t){if(!e){typeof console<`u`&&console.warn(t);try{throw Error(t)}catch{}}}function f(){return Math.random().toString(36).substring(2,10)}function p(e,t){return{usr:e.state,key:e.key,idx:t,masked:e.unstable_mask?{pathname:e.pathname,search:e.search,hash:e.hash}:void 0}}function m(e,t,n=null,r,i){return{pathname:typeof e==`string`?e:e.pathname,search:``,hash:``,...typeof t==`string`?g(t):t,state:n,key:t&&t.key||r||f(),unstable_mask:i}}function h({pathname:e=`/`,search:t=``,hash:n=``}){return t&&t!==`?`&&(e+=t.charAt(0)===`?`?t:`?`+t),n&&n!==`#`&&(e+=n.charAt(0)===`#`?n:`#`+n),e}function g(e){let t={};if(e){let n=e.indexOf(`#`);n>=0&&(t.hash=e.substring(n),e=e.substring(0,n));let r=e.indexOf(`?`);r>=0&&(t.search=e.substring(r),e=e.substring(0,r)),e&&(t.pathname=e)}return t}function _(e,t,n,r={}){let{window:i=document.defaultView,v5Compat:a=!1}=r,o=i.history,l=`POP`,u=null,d=f();d??(d=0,o.replaceState({...o.state,idx:d},``));function f(){return(o.state||{idx:null}).idx}function h(){l=`POP`;let e=f(),t=e==null?null:e-d;d=e,u&&u({action:l,location:b.location,delta:t})}function g(e,t){l=`PUSH`;let r=c(e)?e:m(b.location,e,t);n&&n(r,e),d=f()+1;let s=p(r,d),h=b.createHref(r.unstable_mask||r);try{o.pushState(s,``,h)}catch(e){if(e instanceof DOMException&&e.name===`DataCloneError`)throw e;i.location.assign(h)}a&&u&&u({action:l,location:b.location,delta:1})}function _(e,t){l=`REPLACE`;let r=c(e)?e:m(b.location,e,t);n&&n(r,e),d=f();let i=p(r,d),s=b.createHref(r.unstable_mask||r);o.replaceState(i,``,s),a&&u&&u({action:l,location:b.location,delta:0})}function y(e){return v(e)}let b={get action(){return l},get location(){return e(i,o)},listen(e){if(u)throw Error(`A history only accepts one active listener`);return i.addEventListener(s,h),u=e,()=>{i.removeEventListener(s,h),u=null}},createHref(e){return t(i,e)},createURL:y,encodeLocation(e){let t=y(e);return{pathname:t.pathname,search:t.search,hash:t.hash}},push:g,replace:_,go(e){return o.go(e)}};return b}function v(e,t=!1){let n=`http://localhost`;typeof window<`u`&&(n=window.location.origin===`null`?window.location.href:window.location.origin),u(n,`No window.location.(origin|href) available to create URL`);let r=typeof e==`string`?e:h(e);return r=r.replace(/ $/,`%20`),!t&&r.startsWith(`//`)&&(r=n+r),new URL(r,n)}function y(e,t,n=`/`){return b(e,t,n,!1)}function b(e,t,n,r){let i=k((typeof t==`string`?g(t):t).pathname||`/`,n);if(i==null)return null;let a=S(e);w(a);let o=null;for(let e=0;o==null&&e<a.length;++e){let t=ce(i);o=oe(a[e],t,r)}return o}function x(e,t){let{route:n,pathname:r,params:i}=e;return{id:n.id,pathname:r,params:i,data:t[n.id],loaderData:t[n.id],handle:n.handle}}function S(e,t=[],n=[],r=``,i=!1){let a=(e,a,o=i,s)=>{let c={relativePath:s===void 0?e.path||``:s,caseSensitive:e.caseSensitive===!0,childrenIndex:a,route:e};if(c.relativePath.startsWith(`/`)){if(!c.relativePath.startsWith(r)&&o)return;u(c.relativePath.startsWith(r),`Absolute route path "${c.relativePath}" nested under path "${r}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),c.relativePath=c.relativePath.slice(r.length)}let l=N([r,c.relativePath]),d=n.concat(c);e.children&&e.children.length>0&&(u(e.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${l}".`),S(e.children,t,d,l,o)),!(e.path==null&&!e.index)&&t.push({path:l,score:ie(l,e.index),routesMeta:d})};return e.forEach((e,t)=>{if(e.path===``||!e.path?.includes(`?`))a(e,t);else for(let n of C(e.path))a(e,t,!0,n)}),t}function C(e){let t=e.split(`/`);if(t.length===0)return[];let[n,...r]=t,i=n.endsWith(`?`),a=n.replace(/\?$/,``);if(r.length===0)return i?[a,``]:[a];let o=C(r.join(`/`)),s=[];return s.push(...o.map(e=>e===``?a:[a,e].join(`/`))),i&&s.push(...o),s.map(t=>e.startsWith(`/`)&&t===``?`/`:t)}function w(e){e.sort((e,t)=>e.score===t.score?ae(e.routesMeta.map(e=>e.childrenIndex),t.routesMeta.map(e=>e.childrenIndex)):t.score-e.score)}var T=/^:[\w-]+$/,ee=3,te=2,ne=1,E=10,D=-2,re=e=>e===`*`;function ie(e,t){let n=e.split(`/`),r=n.length;return n.some(re)&&(r+=D),t&&(r+=te),n.filter(e=>!re(e)).reduce((e,t)=>e+(T.test(t)?ee:t===``?ne:E),r)}function ae(e,t){return e.length===t.length&&e.slice(0,-1).every((e,n)=>e===t[n])?e[e.length-1]-t[t.length-1]:0}function oe(e,t,n=!1){let{routesMeta:r}=e,i={},a=`/`,o=[];for(let e=0;e<r.length;++e){let s=r[e],c=e===r.length-1,l=a===`/`?t:t.slice(a.length)||`/`,u=O({path:s.relativePath,caseSensitive:s.caseSensitive,end:c},l),d=s.route;if(!u&&c&&n&&!r[r.length-1].route.index&&(u=O({path:s.relativePath,caseSensitive:s.caseSensitive,end:!1},l)),!u)return null;Object.assign(i,u.params),o.push({params:i,pathname:N([a,u.pathname]),pathnameBase:me(N([a,u.pathnameBase])),route:d}),u.pathnameBase!==`/`&&(a=N([a,u.pathnameBase]))}return o}function O(e,t){typeof e==`string`&&(e={path:e,caseSensitive:!1,end:!0});let[n,r]=se(e.path,e.caseSensitive,e.end),i=t.match(n);if(!i)return null;let a=i[0],o=a.replace(/(.)\/+$/,`$1`),s=i.slice(1);return{params:r.reduce((e,{paramName:t,isOptional:n},r)=>{if(t===`*`){let e=s[r]||``;o=a.slice(0,a.length-e.length).replace(/(.)\/+$/,`$1`)}let i=s[r];return n&&!i?e[t]=void 0:e[t]=(i||``).replace(/%2F/g,`/`),e},{}),pathname:a,pathnameBase:o,pattern:e}}function se(e,t=!1,n=!0){d(e===`*`||!e.endsWith(`*`)||e.endsWith(`/*`),`Route path "${e}" will be treated as if it were "${e.replace(/\*$/,`/*`)}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${e.replace(/\*$/,`/*`)}".`);let r=[],i=`^`+e.replace(/\/*\*?$/,``).replace(/^\/*/,`/`).replace(/[\\.*+^${}|()[\]]/g,`\\$&`).replace(/\/:([\w-]+)(\?)?/g,(e,t,n,i,a)=>{if(r.push({paramName:t,isOptional:n!=null}),n){let t=a.charAt(i+e.length);return t&&t!==`/`?`/([^\\/]*)`:`(?:/([^\\/]*))?`}return`/([^\\/]+)`}).replace(/\/([\w-]+)\?(\/|$)/g,`(/$1)?$2`);return e.endsWith(`*`)?(r.push({paramName:`*`}),i+=e===`*`||e===`/*`?`(.*)$`:`(?:\\/(.+)|\\/*)$`):n?i+=`\\/*$`:e!==``&&e!==`/`&&(i+=`(?:(?=\\/|$))`),[new RegExp(i,t?void 0:`i`),r]}function ce(e){try{return e.split(`/`).map(e=>decodeURIComponent(e).replace(/\//g,`%2F`)).join(`/`)}catch(t){return d(!1,`The URL path "${e}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${t}).`),e}}function k(e,t){if(t===`/`)return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let n=t.endsWith(`/`)?t.length-1:t.length,r=e.charAt(n);return r&&r!==`/`?null:e.slice(n)||`/`}var le=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i;function ue(e,t=`/`){let{pathname:n,search:r=``,hash:i=``}=typeof e==`string`?g(e):e,a;return n?(n=pe(n),a=n.startsWith(`/`)?de(n.substring(1),`/`):de(n,t)):a=t,{pathname:a,search:he(r),hash:ge(i)}}function de(e,t){let n=P(t).split(`/`);return e.split(`/`).forEach(e=>{e===`..`?n.length>1&&n.pop():e!==`.`&&n.push(e)}),n.length>1?n.join(`/`):`/`}function A(e,t,n,r){return`Cannot include a '${e}' character in a manually specified \`to.${t}\` field [${JSON.stringify(r)}]. Please separate it out to the \`to.${n}\` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.`}function fe(e){return e.filter((e,t)=>t===0||e.route.path&&e.route.path.length>0)}function j(e){let t=fe(e);return t.map((e,n)=>n===t.length-1?e.pathname:e.pathnameBase)}function M(e,t,n,r=!1){let i;typeof e==`string`?i=g(e):(i={...e},u(!i.pathname||!i.pathname.includes(`?`),A(`?`,`pathname`,`search`,i)),u(!i.pathname||!i.pathname.includes(`#`),A(`#`,`pathname`,`hash`,i)),u(!i.search||!i.search.includes(`#`),A(`#`,`search`,`hash`,i)));let a=e===``||i.pathname===``,o=a?`/`:i.pathname,s;if(o==null)s=n;else{let e=t.length-1;if(!r&&o.startsWith(`..`)){let t=o.split(`/`);for(;t[0]===`..`;)t.shift(),--e;i.pathname=t.join(`/`)}s=e>=0?t[e]:`/`}let c=ue(i,s),l=o&&o!==`/`&&o.endsWith(`/`),d=(a||o===`.`)&&n.endsWith(`/`);return!c.pathname.endsWith(`/`)&&(l||d)&&(c.pathname+=`/`),c}var pe=e=>e.replace(/\/\/+/g,`/`),N=e=>pe(e.join(`/`)),P=e=>e.replace(/\/+$/,``),me=e=>P(e).replace(/^\/*/,`/`),he=e=>!e||e===`?`?``:e.startsWith(`?`)?e:`?`+e,ge=e=>!e||e===`#`?``:e.startsWith(`#`)?e:`#`+e,_e=class{constructor(e,t,n,r=!1){this.status=e,this.statusText=t||``,this.internal=r,n instanceof Error?(this.data=n.toString(),this.error=n):this.data=n}};function ve(e){return e!=null&&typeof e.status==`number`&&typeof e.statusText==`string`&&typeof e.internal==`boolean`&&`data`in e}function ye(e){return N(e.map(e=>e.route.path).filter(Boolean))||`/`}var be=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0;function xe(e,t){let n=e;if(typeof n!=`string`||!le.test(n))return{absoluteURL:void 0,isExternal:!1,to:n};let r=n,i=!1;if(be)try{let e=new URL(window.location.href),r=n.startsWith(`//`)?new URL(e.protocol+n):new URL(n),a=k(r.pathname,t);r.origin===e.origin&&a!=null?n=a+r.search+r.hash:i=!0}catch{d(!1,`<Link to="${n}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}return{absoluteURL:r,isExternal:i,to:n}}Object.getOwnPropertyNames(Object.prototype).sort().join(`\0`);var Se=[`POST`,`PUT`,`PATCH`,`DELETE`];new Set(Se);var Ce=[`GET`,...Se];new Set(Ce);var F=n.createContext(null);F.displayName=`DataRouter`;var I=n.createContext(null);I.displayName=`DataRouterState`;var we=n.createContext(!1);function Te(){return n.useContext(we)}var Ee=n.createContext({isTransitioning:!1});Ee.displayName=`ViewTransition`;var De=n.createContext(new Map);De.displayName=`Fetchers`;var Oe=n.createContext(null);Oe.displayName=`Await`;var L=n.createContext(null);L.displayName=`Navigation`;var R=n.createContext(null);R.displayName=`Location`;var z=n.createContext({outlet:null,matches:[],isDataRoute:!1});z.displayName=`Route`;var B=n.createContext(null);B.displayName=`RouteError`;var ke=`REACT_ROUTER_ERROR`,Ae=`REDIRECT`,je=`ROUTE_ERROR_RESPONSE`;function Me(e){if(e.startsWith(`${ke}:${Ae}:{`))try{let t=JSON.parse(e.slice(28));if(typeof t==`object`&&t&&typeof t.status==`number`&&typeof t.statusText==`string`&&typeof t.location==`string`&&typeof t.reloadDocument==`boolean`&&typeof t.replace==`boolean`)return t}catch{}}function Ne(e){if(e.startsWith(`${ke}:${je}:{`))try{let t=JSON.parse(e.slice(40));if(typeof t==`object`&&t&&typeof t.status==`number`&&typeof t.statusText==`string`)return new _e(t.status,t.statusText,t.data)}catch{}}function Pe(e,{relative:t}={}){u(V(),`useHref() may be used only in the context of a <Router> component.`);let{basename:r,navigator:i}=n.useContext(L),{hash:a,pathname:o,search:s}=W(e,{relative:t}),c=o;return r!==`/`&&(c=o===`/`?r:N([r,o])),i.createHref({pathname:c,search:s,hash:a})}function V(){return n.useContext(R)!=null}function H(){return u(V(),`useLocation() may be used only in the context of a <Router> component.`),n.useContext(R).location}var Fe=`You should call navigate() in a React.useEffect(), not when your component is first rendered.`;function Ie(e){n.useContext(L).static||n.useLayoutEffect(e)}function U(){let{isDataRoute:e}=n.useContext(z);return e?nt():Le()}function Le(){u(V(),`useNavigate() may be used only in the context of a <Router> component.`);let e=n.useContext(F),{basename:t,navigator:r}=n.useContext(L),{matches:i}=n.useContext(z),{pathname:a}=H(),o=JSON.stringify(j(i)),s=n.useRef(!1);return Ie(()=>{s.current=!0}),n.useCallback((n,i={})=>{if(d(s.current,Fe),!s.current)return;if(typeof n==`number`){r.go(n);return}let c=M(n,JSON.parse(o),a,i.relative===`path`);e==null&&t!==`/`&&(c.pathname=c.pathname===`/`?t:N([t,c.pathname])),(i.replace?r.replace:r.push)(c,i.state,i)},[t,r,o,a,e])}n.createContext(null);function Re(){let{matches:e}=n.useContext(z),t=e[e.length-1];return t?t.params:{}}function W(e,{relative:t}={}){let{matches:r}=n.useContext(z),{pathname:i}=H(),a=JSON.stringify(j(r));return n.useMemo(()=>M(e,JSON.parse(a),i,t===`path`),[e,a,i,t])}function ze(e,t){return Be(e,t)}function Be(e,t,r){u(V(),`useRoutes() may be used only in the context of a <Router> component.`);let{navigator:i}=n.useContext(L),{matches:a}=n.useContext(z),o=a[a.length-1],s=o?o.params:{},c=o?o.pathname:`/`,l=o?o.pathnameBase:`/`,f=o&&o.route;{let e=f&&f.path||``;it(c,!f||e.endsWith(`*`)||e.endsWith(`*?`),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${c}" (under <Route path="${e}">) but the parent route path has no trailing "*". This means if you navigate deeper, the parent won't match anymore and therefore the child routes will never render.
|
|
2
2
|
|
|
3
3
|
Please change the parent <Route path="${e}"> to <Route path="${e===`/`?`*`:`${e}/*`}">.`)}let p=H(),m;if(t){let e=typeof t==`string`?g(t):t;u(l===`/`||e.pathname?.startsWith(l),`When overriding the location using \`<Routes location>\` or \`useRoutes(routes, location)\`, the location pathname must begin with the portion of the URL pathname that was matched by all parent routes. The current pathname base is "${l}" but pathname "${e.pathname}" was given in the \`location\` prop.`),m=e}else m=p;let h=m.pathname||`/`,_=h;if(l!==`/`){let e=l.replace(/^\//,``).split(`/`);_=`/`+h.replace(/^\//,``).split(`/`).slice(e.length).join(`/`)}let v=y(e,{pathname:_});d(f||v!=null,`No routes matched location "${m.pathname}${m.search}${m.hash}" `),d(v==null||v[v.length-1].route.element!==void 0||v[v.length-1].route.Component!==void 0||v[v.length-1].route.lazy!==void 0,`Matched leaf route at location "${m.pathname}${m.search}${m.hash}" does not have an element or Component. This means it will render an <Outlet /> with a null value by default resulting in an "empty" page.`);let b=Ke(v&&v.map(e=>Object.assign({},e,{params:Object.assign({},s,e.params),pathname:N([l,i.encodeLocation?i.encodeLocation(e.pathname.replace(/%/g,`%25`).replace(/\?/g,`%3F`).replace(/#/g,`%23`)).pathname:e.pathname]),pathnameBase:e.pathnameBase===`/`?l:N([l,i.encodeLocation?i.encodeLocation(e.pathnameBase.replace(/%/g,`%25`).replace(/\?/g,`%3F`).replace(/#/g,`%23`)).pathname:e.pathnameBase])})),a,r);return t&&b?n.createElement(R.Provider,{value:{location:{pathname:`/`,search:``,hash:``,state:null,key:`default`,unstable_mask:void 0,...m},navigationType:`POP`}},b):b}function Ve(){let e=tt(),t=ve(e)?`${e.status} ${e.statusText}`:e instanceof Error?e.message:JSON.stringify(e),r=e instanceof Error?e.stack:null,i=`rgba(200,200,200, 0.5)`,a={padding:`0.5rem`,backgroundColor:i},o={padding:`2px 4px`,backgroundColor:i},s=null;return console.error(`Error handled by React Router default ErrorBoundary:`,e),s=n.createElement(n.Fragment,null,n.createElement(`p`,null,`💿 Hey developer 👋`),n.createElement(`p`,null,`You can provide a way better UX than this when your app throws errors by providing your own `,n.createElement(`code`,{style:o},`ErrorBoundary`),` or`,` `,n.createElement(`code`,{style:o},`errorElement`),` prop on your route.`)),n.createElement(n.Fragment,null,n.createElement(`h2`,null,`Unexpected Application Error!`),n.createElement(`h3`,{style:{fontStyle:`italic`}},t),r?n.createElement(`pre`,{style:a},r):null,s)}var He=n.createElement(Ve,null),Ue=class extends n.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,t){return t.location!==e.location||t.revalidation!==`idle`&&e.revalidation===`idle`?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:e.error===void 0?t.error:e.error,location:t.location,revalidation:e.revalidation||t.revalidation}}componentDidCatch(e,t){this.props.onError?this.props.onError(e,t):console.error(`React Router caught the following error during render`,e)}render(){let e=this.state.error;if(this.context&&typeof e==`object`&&e&&`digest`in e&&typeof e.digest==`string`){let t=Ne(e.digest);t&&(e=t)}let t=e===void 0?this.props.children:n.createElement(z.Provider,{value:this.props.routeContext},n.createElement(B.Provider,{value:e,children:this.props.component}));return this.context?n.createElement(We,{error:e},t):t}};Ue.contextType=we;var G=new WeakMap;function We({children:e,error:t}){let{basename:r}=n.useContext(L);if(typeof t==`object`&&t&&`digest`in t&&typeof t.digest==`string`){let e=Me(t.digest);if(e){let i=G.get(t);if(i)throw i;let a=xe(e.location,r);if(be&&!G.get(t))if(a.isExternal||e.reloadDocument)window.location.href=a.absoluteURL||a.to;else{let n=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(a.to,{replace:e.replace}));throw G.set(t,n),n}return n.createElement(`meta`,{httpEquiv:`refresh`,content:`0;url=${a.absoluteURL||a.to}`})}}return e}function Ge({routeContext:e,match:t,children:r}){let i=n.useContext(F);return i&&i.static&&i.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(i.staticContext._deepestRenderedBoundaryId=t.route.id),n.createElement(z.Provider,{value:e},r)}function Ke(e,t=[],r){let i=r?.state;if(e==null){if(!i)return null;if(i.errors)e=i.matches;else if(t.length===0&&!i.initialized&&i.matches.length>0)e=i.matches;else return null}let a=e,o=i?.errors;if(o!=null){let e=a.findIndex(e=>e.route.id&&o?.[e.route.id]!==void 0);u(e>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(o).join(`,`)}`),a=a.slice(0,Math.min(a.length,e+1))}let s=!1,c=-1;if(r&&i){s=i.renderFallback;for(let e=0;e<a.length;e++){let t=a[e];if((t.route.HydrateFallback||t.route.hydrateFallbackElement)&&(c=e),t.route.id){let{loaderData:e,errors:n}=i,o=t.route.loader&&!e.hasOwnProperty(t.route.id)&&(!n||n[t.route.id]===void 0);if(t.route.lazy||o){r.isStatic&&(s=!0),a=c>=0?a.slice(0,c+1):[a[0]];break}}}}let l=r?.onError,d=i&&l?(e,t)=>{l(e,{location:i.location,params:i.matches?.[0]?.params??{},unstable_pattern:ye(i.matches),errorInfo:t})}:void 0;return a.reduceRight((e,r,l)=>{let u,f=!1,p=null,m=null;i&&(u=o&&r.route.id?o[r.route.id]:void 0,p=r.route.errorElement||He,s&&(c<0&&l===0?(it(`route-fallback`,!1,"No `HydrateFallback` element provided to render during initial hydration"),f=!0,m=null):c===l&&(f=!0,m=r.route.hydrateFallbackElement||null)));let h=t.concat(a.slice(0,l+1)),g=()=>{let t;return t=u?p:f?m:r.route.Component?n.createElement(r.route.Component,null):r.route.element?r.route.element:e,n.createElement(Ge,{match:r,routeContext:{outlet:e,matches:h,isDataRoute:i!=null},children:t})};return i&&(r.route.ErrorBoundary||r.route.errorElement||l===0)?n.createElement(Ue,{location:i.location,revalidation:i.revalidation,component:p,error:u,children:g(),routeContext:{outlet:null,matches:h,isDataRoute:!0},onError:d}):g()},null)}function qe(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function Je(e){let t=n.useContext(F);return u(t,qe(e)),t}function Ye(e){let t=n.useContext(I);return u(t,qe(e)),t}function Xe(e){let t=n.useContext(z);return u(t,qe(e)),t}function Ze(e){let t=Xe(e),n=t.matches[t.matches.length-1];return u(n.route.id,`${e} can only be used on routes that contain a unique "id"`),n.route.id}function Qe(){return Ze(`useRouteId`)}function $e(){return Ye(`useNavigation`).navigation}function et(){let{matches:e,loaderData:t}=Ye(`useMatches`);return n.useMemo(()=>e.map(e=>x(e,t)),[e,t])}function tt(){let e=n.useContext(B),t=Ye(`useRouteError`),r=Ze(`useRouteError`);return e===void 0?t.errors?.[r]:e}function nt(){let{router:e}=Je(`useNavigate`),t=Ze(`useNavigate`),r=n.useRef(!1);return Ie(()=>{r.current=!0}),n.useCallback(async(n,i={})=>{d(r.current,Fe),r.current&&(typeof n==`number`?await e.navigate(n):await e.navigate(n,{fromRouteId:t,...i}))},[e,t])}var rt={};function it(e,t,n){!t&&!rt[e]&&(rt[e]=!0,d(!1,n))}n.useOptimistic,n.memo(at);function at({routes:e,future:t,state:n,isStatic:r,onError:i}){return Be(e,void 0,{state:n,isStatic:r,onError:i,future:t})}function ot({to:e,replace:t,state:r,relative:i}){u(V(),`<Navigate> may be used only in the context of a <Router> component.`);let{static:a}=n.useContext(L);d(!a,`<Navigate> must not be used on the initial render in a <StaticRouter>. This is a no-op, but you should modify your code so the <Navigate> is only ever rendered in response to some user interaction or state change.`);let{matches:o}=n.useContext(z),{pathname:s}=H(),c=U(),l=M(e,j(o),s,i===`path`),f=JSON.stringify(l);return n.useEffect(()=>{c(JSON.parse(f),{replace:t,state:r,relative:i})},[c,f,i,t,r]),null}function st(e){u(!1,`A <Route> is only ever to be used as the child of <Routes> element, never rendered directly. Please wrap your <Route> in a <Routes>.`)}function ct({basename:e=`/`,children:t=null,location:r,navigationType:i=`POP`,navigator:a,static:o=!1,unstable_useTransitions:s}){u(!V(),`You cannot render a <Router> inside another <Router>. You should never have more than one in your app.`);let c=e.replace(/^\/*/,`/`),l=n.useMemo(()=>({basename:c,navigator:a,static:o,unstable_useTransitions:s,future:{}}),[c,a,o,s]);typeof r==`string`&&(r=g(r));let{pathname:f=`/`,search:p=``,hash:m=``,state:h=null,key:_=`default`,unstable_mask:v}=r,y=n.useMemo(()=>{let e=k(f,c);return e==null?null:{location:{pathname:e,search:p,hash:m,state:h,key:_,unstable_mask:v},navigationType:i}},[c,f,p,m,h,_,i,v]);return d(y!=null,`<Router basename="${c}"> is not able to match the URL "${f}${p}${m}" because it does not start with the basename, so the <Router> won't render anything.`),y==null?null:n.createElement(L.Provider,{value:l},n.createElement(R.Provider,{children:t,value:y}))}function lt({children:e,location:t}){return ze(ut(e),t)}n.Component;function ut(e,t=[]){let r=[];return n.Children.forEach(e,(e,i)=>{if(!n.isValidElement(e))return;let a=[...t,i];if(e.type===n.Fragment){r.push.apply(r,ut(e.props.children,a));return}u(e.type===st,`[${typeof e.type==`string`?e.type:e.type.name}] is not a <Route> component. All component children of <Routes> must be a <Route> or <React.Fragment>`),u(!e.props.index||!e.props.children,`An index route cannot have child routes.`);let o={id:e.props.id||a.join(`-`),caseSensitive:e.props.caseSensitive,element:e.props.element,Component:e.props.Component,index:e.props.index,path:e.props.path,middleware:e.props.middleware,loader:e.props.loader,action:e.props.action,hydrateFallbackElement:e.props.hydrateFallbackElement,HydrateFallback:e.props.HydrateFallback,errorElement:e.props.errorElement,ErrorBoundary:e.props.ErrorBoundary,hasErrorBoundary:e.props.hasErrorBoundary===!0||e.props.ErrorBoundary!=null||e.props.errorElement!=null,shouldRevalidate:e.props.shouldRevalidate,handle:e.props.handle,lazy:e.props.lazy};e.props.children&&(o.children=ut(e.props.children,a)),r.push(o)}),r}var K=`get`,q=`application/x-www-form-urlencoded`;function J(e){return typeof HTMLElement<`u`&&e instanceof HTMLElement}function dt(e){return J(e)&&e.tagName.toLowerCase()===`button`}function ft(e){return J(e)&&e.tagName.toLowerCase()===`form`}function pt(e){return J(e)&&e.tagName.toLowerCase()===`input`}function mt(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function ht(e,t){return e.button===0&&(!t||t===`_self`)&&!mt(e)}function gt(e=``){return new URLSearchParams(typeof e==`string`||Array.isArray(e)||e instanceof URLSearchParams?e:Object.keys(e).reduce((t,n)=>{let r=e[n];return t.concat(Array.isArray(r)?r.map(e=>[n,e]):[[n,r]])},[]))}function _t(e,t){let n=gt(e);return t&&t.forEach((e,r)=>{n.has(r)||t.getAll(r).forEach(e=>{n.append(r,e)})}),n}var Y=null;function vt(){if(Y===null)try{new FormData(document.createElement(`form`),0),Y=!1}catch{Y=!0}return Y}var yt=new Set([`application/x-www-form-urlencoded`,`multipart/form-data`,`text/plain`]);function bt(e){return e!=null&&!yt.has(e)?(d(!1,`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${q}"`),null):e}function xt(e,t){let n,r,i,a,o;if(ft(e)){let o=e.getAttribute(`action`);r=o?k(o,t):null,n=e.getAttribute(`method`)||K,i=bt(e.getAttribute(`enctype`))||q,a=new FormData(e)}else if(dt(e)||pt(e)&&(e.type===`submit`||e.type===`image`)){let o=e.form;if(o==null)throw Error(`Cannot submit a <button> or <input type="submit"> without a <form>`);let s=e.getAttribute(`formaction`)||o.getAttribute(`action`);if(r=s?k(s,t):null,n=e.getAttribute(`formmethod`)||o.getAttribute(`method`)||K,i=bt(e.getAttribute(`formenctype`))||bt(o.getAttribute(`enctype`))||q,a=new FormData(o,e),!vt()){let{name:t,type:n,value:r}=e;if(n===`image`){let e=t?`${t}.`:``;a.append(`${e}x`,`0`),a.append(`${e}y`,`0`)}else t&&a.append(t,r)}}else if(J(e))throw Error(`Cannot submit element that is not <form>, <button>, or <input type="submit|image">`);else n=K,r=null,i=q,o=e;return a&&i===`text/plain`&&(o=a,a=void 0),{action:r,method:n.toLowerCase(),encType:i,formData:a,body:o}}Object.getOwnPropertyNames(Object.prototype).sort().join(`\0`);var St={"&":`\\u0026`,">":`\\u003e`,"<":`\\u003c`,"\u2028":`\\u2028`,"\u2029":`\\u2029`},Ct=/[&><\u2028\u2029]/g;function wt(e){return e.replace(Ct,e=>St[e])}function Tt(e,t){if(e===!1||e==null)throw Error(t)}function Et(e,t,n,r){let i=typeof e==`string`?new URL(e,typeof window>`u`?`server://singlefetch/`:window.location.origin):e;return n?i.pathname.endsWith(`/`)?i.pathname=`${i.pathname}_.${r}`:i.pathname=`${i.pathname}.${r}`:i.pathname===`/`?i.pathname=`_root.${r}`:t&&k(i.pathname,t)===`/`?i.pathname=`${P(t)}/_root.${r}`:i.pathname=`${P(i.pathname)}.${r}`,i}async function Dt(e,t){if(e.id in t)return t[e.id];try{let n=await o(()=>import(e.module),[]);return t[e.id]=n,n}catch(t){return console.error(`Error loading route module \`${e.module}\`, reloading page...`),console.error(t),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function Ot(e){return e!=null&&typeof e.page==`string`}function kt(e){return e==null?!1:e.href==null?e.rel===`preload`&&typeof e.imageSrcSet==`string`&&typeof e.imageSizes==`string`:typeof e.rel==`string`&&typeof e.href==`string`}async function At(e,t,n){return Ft((await Promise.all(e.map(async e=>{let r=t.routes[e.route.id];if(r){let e=await Dt(r,n);return e.links?e.links():[]}return[]}))).flat(1).filter(kt).filter(e=>e.rel===`stylesheet`||e.rel===`preload`).map(e=>e.rel===`stylesheet`?{...e,rel:`prefetch`,as:`style`}:{...e,rel:`prefetch`}))}function jt(e,t,n,r,i,a){let o=(e,t)=>n[t]?e.route.id!==n[t].route.id:!0,s=(e,t)=>n[t].pathname!==e.pathname||n[t].route.path?.endsWith(`*`)&&n[t].params[`*`]!==e.params[`*`];return a===`assets`?t.filter((e,t)=>o(e,t)||s(e,t)):a===`data`?t.filter((t,a)=>{let c=r.routes[t.route.id];if(!c||!c.hasLoader)return!1;if(o(t,a)||s(t,a))return!0;if(t.route.shouldRevalidate){let r=t.route.shouldRevalidate({currentUrl:new URL(i.pathname+i.search+i.hash,window.origin),currentParams:n[0]?.params||{},nextUrl:new URL(e,window.origin),nextParams:t.params,defaultShouldRevalidate:!0});if(typeof r==`boolean`)return r}return!0}):[]}function Mt(e,t,{includeHydrateFallback:n}={}){return Nt(e.map(e=>{let r=t.routes[e.route.id];if(!r)return[];let i=[r.module];return r.clientActionModule&&(i=i.concat(r.clientActionModule)),r.clientLoaderModule&&(i=i.concat(r.clientLoaderModule)),n&&r.hydrateFallbackModule&&(i=i.concat(r.hydrateFallbackModule)),r.imports&&(i=i.concat(r.imports)),i}).flat(1))}function Nt(e){return[...new Set(e)]}function Pt(e){let t={},n=Object.keys(e).sort();for(let r of n)t[r]=e[r];return t}function Ft(e,t){let n=new Set,r=new Set(t);return e.reduce((e,i)=>{if(t&&!Ot(i)&&i.as===`script`&&i.href&&r.has(i.href))return e;let a=JSON.stringify(Pt(i));return n.has(a)||(n.add(a),e.push({key:a,link:i})),e},[])}function It(){let e=n.useContext(F);return Tt(e,`You must render this element inside a <DataRouterContext.Provider> element`),e}function Lt(){let e=n.useContext(I);return Tt(e,`You must render this element inside a <DataRouterStateContext.Provider> element`),e}var X=n.createContext(void 0);X.displayName=`FrameworkContext`;function Rt(){let e=n.useContext(X);return Tt(e,`You must render this element inside a <HydratedRouter> element`),e}function zt(e,t){let r=n.useContext(X),[i,a]=n.useState(!1),[o,s]=n.useState(!1),{onFocus:c,onBlur:l,onMouseEnter:u,onMouseLeave:d,onTouchStart:f}=t,p=n.useRef(null);n.useEffect(()=>{if(e===`render`&&s(!0),e===`viewport`){let e=new IntersectionObserver(e=>{e.forEach(e=>{s(e.isIntersecting)})},{threshold:.5});return p.current&&e.observe(p.current),()=>{e.disconnect()}}},[e]),n.useEffect(()=>{if(i){let e=setTimeout(()=>{s(!0)},100);return()=>{clearTimeout(e)}}},[i]);let m=()=>{a(!0)},h=()=>{a(!1),s(!1)};return r?e===`intent`?[o,p,{onFocus:Z(c,m),onBlur:Z(l,h),onMouseEnter:Z(u,m),onMouseLeave:Z(d,h),onTouchStart:Z(f,m)}]:[o,p,{}]:[!1,p,{}]}function Z(e,t){return n=>{e&&e(n),n.defaultPrevented||t(n)}}function Bt({page:e,...t}){let r=Te(),{router:i}=It(),a=n.useMemo(()=>y(i.routes,e,i.basename),[i.routes,e,i.basename]);return a?r?n.createElement(Ht,{page:e,matches:a,...t}):n.createElement(Ut,{page:e,matches:a,...t}):null}function Vt(e){let{manifest:t,routeModules:r}=Rt(),[i,a]=n.useState([]);return n.useEffect(()=>{let n=!1;return At(e,t,r).then(e=>{n||a(e)}),()=>{n=!0}},[e,t,r]),i}function Ht({page:e,matches:t,...r}){let i=H(),{future:a}=Rt(),{basename:o}=It(),s=n.useMemo(()=>{if(e===i.pathname+i.search+i.hash)return[];let n=Et(e,o,a.unstable_trailingSlashAwareDataRequests,`rsc`),r=!1,s=[];for(let e of t)typeof e.route.shouldRevalidate==`function`?r=!0:s.push(e.route.id);return r&&s.length>0&&n.searchParams.set(`_routes`,s.join(`,`)),[n.pathname+n.search]},[o,a.unstable_trailingSlashAwareDataRequests,e,i,t]);return n.createElement(n.Fragment,null,s.map(e=>n.createElement(`link`,{key:e,rel:`prefetch`,as:`fetch`,href:e,...r})))}function Ut({page:e,matches:t,...r}){let i=H(),{future:a,manifest:o,routeModules:s}=Rt(),{basename:c}=It(),{loaderData:l,matches:u}=Lt(),d=n.useMemo(()=>jt(e,t,u,o,i,`data`),[e,t,u,o,i]),f=n.useMemo(()=>jt(e,t,u,o,i,`assets`),[e,t,u,o,i]),p=n.useMemo(()=>{if(e===i.pathname+i.search+i.hash)return[];let n=new Set,r=!1;if(t.forEach(e=>{let t=o.routes[e.route.id];!t||!t.hasLoader||(!d.some(t=>t.route.id===e.route.id)&&e.route.id in l&&s[e.route.id]?.shouldRevalidate||t.hasClientLoader?r=!0:n.add(e.route.id))}),n.size===0)return[];let u=Et(e,c,a.unstable_trailingSlashAwareDataRequests,`data`);return r&&n.size>0&&u.searchParams.set(`_routes`,t.filter(e=>n.has(e.route.id)).map(e=>e.route.id).join(`,`)),[u.pathname+u.search]},[c,a.unstable_trailingSlashAwareDataRequests,l,i,o,d,t,e,s]),m=n.useMemo(()=>Mt(f,o),[f,o]),h=Vt(f);return n.createElement(n.Fragment,null,p.map(e=>n.createElement(`link`,{key:e,rel:`prefetch`,as:`fetch`,href:e,...r})),m.map(e=>n.createElement(`link`,{key:e,rel:`modulepreload`,href:e,...r})),h.map(({key:e,link:t})=>n.createElement(`link`,{key:e,nonce:r.nonce,...t,crossOrigin:t.crossOrigin??r.crossOrigin})))}function Wt(...e){return t=>{e.forEach(e=>{typeof e==`function`?e(t):e!=null&&(e.current=t)})}}n.Component;var Gt=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0;try{Gt&&(window.__reactRouterVersion=`7.14.1`)}catch{}function Kt({basename:e,children:t,unstable_useTransitions:r,window:i}){let a=n.useRef();a.current??=l({window:i,v5Compat:!0});let o=a.current,[s,c]=n.useState({action:o.action,location:o.location}),u=n.useCallback(e=>{r===!1?c(e):n.startTransition(()=>c(e))},[r]);return n.useLayoutEffect(()=>o.listen(u),[o,u]),n.createElement(ct,{basename:e,children:t,location:s.location,navigationType:s.action,navigator:o,unstable_useTransitions:r})}function qt({basename:e,children:t,history:r,unstable_useTransitions:i}){let[a,o]=n.useState({action:r.action,location:r.location}),s=n.useCallback(e=>{i===!1?o(e):n.startTransition(()=>o(e))},[i]);return n.useLayoutEffect(()=>r.listen(s),[r,s]),n.createElement(ct,{basename:e,children:t,location:a.location,navigationType:a.action,navigator:r,unstable_useTransitions:i})}qt.displayName=`unstable_HistoryRouter`;var Jt=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Yt=n.forwardRef(function({onClick:e,discover:t=`render`,prefetch:r=`none`,relative:i,reloadDocument:a,replace:o,unstable_mask:s,state:c,target:l,to:u,preventScrollReset:d,viewTransition:f,unstable_defaultShouldRevalidate:p,...m},h){let{basename:g,navigator:_,unstable_useTransitions:v}=n.useContext(L),y=typeof u==`string`&&Jt.test(u),b=xe(u,g);u=b.to;let x=Pe(u,{relative:i}),S=H(),C=null;if(s){let e=M(s,[],S.unstable_mask?S.unstable_mask.pathname:`/`,!0);g!==`/`&&(e.pathname=e.pathname===`/`?g:N([g,e.pathname])),C=_.createHref(e)}let[w,T,ee]=zt(r,m),te=nn(u,{replace:o,unstable_mask:s,state:c,target:l,preventScrollReset:d,relative:i,viewTransition:f,unstable_defaultShouldRevalidate:p,unstable_useTransitions:v});function ne(t){e&&e(t),t.defaultPrevented||te(t)}let E=!(b.isExternal||a),D=n.createElement(`a`,{...m,...ee,href:(E?C:void 0)||b.absoluteURL||x,onClick:E?ne:e,ref:Wt(h,T),target:l,"data-discover":!y&&t===`render`?`true`:void 0});return w&&!y?n.createElement(n.Fragment,null,D,n.createElement(Bt,{page:x})):D});Yt.displayName=`Link`;var Xt=n.forwardRef(function({"aria-current":e=`page`,caseSensitive:t=!1,className:r=``,end:i=!1,style:a,to:o,viewTransition:s,children:c,...l},u){let d=W(o,{relative:l.relative}),f=H(),p=n.useContext(I),{navigator:m,basename:h}=n.useContext(L),g=p!=null&&fn(d)&&s===!0,_=m.encodeLocation?m.encodeLocation(d).pathname:d.pathname,v=f.pathname,y=p&&p.navigation&&p.navigation.location?p.navigation.location.pathname:null;t||(v=v.toLowerCase(),y=y?y.toLowerCase():null,_=_.toLowerCase()),y&&h&&(y=k(y,h)||y);let b=_!==`/`&&_.endsWith(`/`)?_.length-1:_.length,x=v===_||!i&&v.startsWith(_)&&v.charAt(b)===`/`,S=y!=null&&(y===_||!i&&y.startsWith(_)&&y.charAt(_.length)===`/`),C={isActive:x,isPending:S,isTransitioning:g},w=x?e:void 0,T;T=typeof r==`function`?r(C):[r,x?`active`:null,S?`pending`:null,g?`transitioning`:null].filter(Boolean).join(` `);let ee=typeof a==`function`?a(C):a;return n.createElement(Yt,{...l,"aria-current":w,className:T,ref:u,style:ee,to:o,viewTransition:s},typeof c==`function`?c(C):c)});Xt.displayName=`NavLink`;var Zt=n.forwardRef(({discover:e=`render`,fetcherKey:t,navigate:r,reloadDocument:i,replace:a,state:o,method:s=K,action:c,onSubmit:l,relative:u,preventScrollReset:d,viewTransition:f,unstable_defaultShouldRevalidate:p,...m},h)=>{let{unstable_useTransitions:g}=n.useContext(L),_=sn(),v=cn(c,{relative:u}),y=s.toLowerCase()===`get`?`get`:`post`,b=typeof c==`string`&&Jt.test(c);return n.createElement(`form`,{ref:h,method:y,action:v,onSubmit:i?l:e=>{if(l&&l(e),e.defaultPrevented)return;e.preventDefault();let i=e.nativeEvent.submitter,c=i?.getAttribute(`formmethod`)||s,m=()=>_(i||e.currentTarget,{fetcherKey:t,method:c,navigate:r,replace:a,state:o,relative:u,preventScrollReset:d,viewTransition:f,unstable_defaultShouldRevalidate:p});g&&r!==!1?n.startTransition(()=>m()):m()},...m,"data-discover":!b&&e===`render`?`true`:void 0})});Zt.displayName=`Form`;function Qt({getKey:e,storageKey:t,...r}){let i=n.useContext(X),{basename:a}=n.useContext(L),o=H(),s=et();un({getKey:e,storageKey:t});let c=n.useMemo(()=>{if(!i||!e)return null;let t=$(o,s,a,e);return t===o.key?null:t},[]);if(!i||i.isSpaMode)return null;let l=((e,t)=>{if(!window.history.state||!window.history.state.key){let e=Math.random().toString(32).slice(2);window.history.replaceState({key:e},``)}try{let n=JSON.parse(sessionStorage.getItem(e)||`{}`)[t||window.history.state.key];typeof n==`number`&&window.scrollTo(0,n)}catch(t){console.error(t),sessionStorage.removeItem(e)}}).toString();return n.createElement(`script`,{...r,suppressHydrationWarning:!0,dangerouslySetInnerHTML:{__html:`(${l})(${wt(JSON.stringify(t||ln))}, ${wt(JSON.stringify(c))})`}})}Qt.displayName=`ScrollRestoration`;function $t(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function en(e){let t=n.useContext(F);return u(t,$t(e)),t}function tn(e){let t=n.useContext(I);return u(t,$t(e)),t}function nn(e,{target:t,replace:r,unstable_mask:i,state:a,preventScrollReset:o,relative:s,viewTransition:c,unstable_defaultShouldRevalidate:l,unstable_useTransitions:u}={}){let d=U(),f=H(),p=W(e,{relative:s});return n.useCallback(m=>{if(ht(m,t)){m.preventDefault();let t=r===void 0?h(f)===h(p):r,g=()=>d(e,{replace:t,unstable_mask:i,state:a,preventScrollReset:o,relative:s,viewTransition:c,unstable_defaultShouldRevalidate:l});u?n.startTransition(()=>g()):g()}},[f,d,p,r,i,a,t,e,o,s,c,l,u])}function rn(e){d(typeof URLSearchParams<`u`,"You cannot use the `useSearchParams` hook in a browser that does not support the URLSearchParams API. If you need to support Internet Explorer 11, we recommend you load a polyfill such as https://github.com/ungap/url-search-params.");let t=n.useRef(gt(e)),r=n.useRef(!1),i=H(),a=n.useMemo(()=>_t(i.search,r.current?null:t.current),[i.search]),o=U();return[a,n.useCallback((e,t)=>{let n=gt(typeof e==`function`?e(new URLSearchParams(a)):e);r.current=!0,o(`?`+n,t)},[o,a])]}var an=0,on=()=>`__${String(++an)}__`;function sn(){let{router:e}=en(`useSubmit`),{basename:t}=n.useContext(L),r=Qe(),i=e.fetch,a=e.navigate;return n.useCallback(async(e,n={})=>{let{action:o,method:s,encType:c,formData:l,body:u}=xt(e,t);n.navigate===!1?await i(n.fetcherKey||on(),r,n.action||o,{unstable_defaultShouldRevalidate:n.unstable_defaultShouldRevalidate,preventScrollReset:n.preventScrollReset,formData:l,body:u,formMethod:n.method||s,formEncType:n.encType||c,flushSync:n.flushSync}):await a(n.action||o,{unstable_defaultShouldRevalidate:n.unstable_defaultShouldRevalidate,preventScrollReset:n.preventScrollReset,formData:l,body:u,formMethod:n.method||s,formEncType:n.encType||c,replace:n.replace,state:n.state,fromRouteId:r,flushSync:n.flushSync,viewTransition:n.viewTransition})},[i,a,t,r])}function cn(e,{relative:t}={}){let{basename:r}=n.useContext(L),i=n.useContext(z);u(i,`useFormAction must be used inside a RouteContext`);let[a]=i.matches.slice(-1),o={...W(e||`.`,{relative:t})},s=H();if(e==null){o.search=s.search;let e=new URLSearchParams(o.search),t=e.getAll(`index`);if(t.some(e=>e===``)){e.delete(`index`),t.filter(e=>e).forEach(t=>e.append(`index`,t));let n=e.toString();o.search=n?`?${n}`:``}}return(!e||e===`.`)&&a.route.index&&(o.search=o.search?o.search.replace(/^\?/,`?index&`):`?index`),r!==`/`&&(o.pathname=o.pathname===`/`?r:N([r,o.pathname])),h(o)}var ln=`react-router-scroll-positions`,Q={};function $(e,t,n,r){let i=null;return r&&(i=r(n===`/`?e:{...e,pathname:k(e.pathname,n)||e.pathname},t)),i??=e.key,i}function un({getKey:e,storageKey:t}={}){let{router:r}=en(`useScrollRestoration`),{restoreScrollPosition:i,preventScrollReset:a}=tn(`useScrollRestoration`),{basename:o}=n.useContext(L),s=H(),c=et(),l=$e();n.useEffect(()=>(window.history.scrollRestoration=`manual`,()=>{window.history.scrollRestoration=`auto`}),[]),dn(n.useCallback(()=>{if(l.state===`idle`){let t=$(s,c,o,e);Q[t]=window.scrollY}try{sessionStorage.setItem(t||ln,JSON.stringify(Q))}catch(e){d(!1,`Failed to save scroll positions in sessionStorage, <ScrollRestoration /> will not work properly (${e}).`)}window.history.scrollRestoration=`auto`},[l.state,e,o,s,c,t])),typeof document<`u`&&(n.useLayoutEffect(()=>{try{let e=sessionStorage.getItem(t||ln);e&&(Q=JSON.parse(e))}catch{}},[t]),n.useLayoutEffect(()=>{let t=r?.enableScrollRestoration(Q,()=>window.scrollY,e?(t,n)=>$(t,n,o,e):void 0);return()=>t&&t()},[r,o,e]),n.useLayoutEffect(()=>{if(i!==!1){if(typeof i==`number`){window.scrollTo(0,i);return}try{if(s.hash){let e=document.getElementById(decodeURIComponent(s.hash.slice(1)));if(e){e.scrollIntoView();return}}}catch{d(!1,`"${s.hash.slice(1)}" is not a decodable element ID. The view will not scroll to it.`)}a!==!0&&window.scrollTo(0,0)}},[s,i,a]))}function dn(e,t){let{capture:r}=t||{};n.useEffect(()=>{let t=r==null?void 0:{capture:r};return window.addEventListener(`pagehide`,e,t),()=>{window.removeEventListener(`pagehide`,e,t)}},[e,r])}function fn(e,{relative:t}={}){let r=n.useContext(Ee);u(r!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:i}=en(`useViewTransitionState`),a=W(e,{relative:t});if(!r.isTransitioning)return!1;let o=k(r.currentLocation.pathname,i)||r.currentLocation.pathname,s=k(r.nextLocation.pathname,i)||r.nextLocation.pathname;return O(a.pathname,s)!=null||O(a.pathname,o)!=null}export{st as a,U as c,o as d,ot as i,Re as l,Yt as n,lt as o,Xt as r,H as s,Kt as t,rn as u};
|
package/console-dist/assets/{circle-question-mark-BwjC8Yj-.js → circle-question-mark-CJvcT6V6.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{n as e}from"./utils-
|
|
1
|
+
import{n as e}from"./utils-XFKvwlFT.js";var t=e(`circle-question-mark`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3`,key:`1u773s`}],[`path`,{d:`M12 17h.01`,key:`p32p05`}]]);export{t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./rolldown-runtime-COnpUsM8.js";import{
|
|
1
|
+
import"./rolldown-runtime-COnpUsM8.js";import{c as e}from"./vendor-charts-95ykyDlI.js";import{a as t,at as n,c as r,i,l as a,n as o,o as s,r as c,s as l,t as u,u as d}from"./vendor-ui-CWUk2ulb.js";import{E as f,S as p,T as m,w as h,x as g}from"./format-CshN6yEB.js";import{t as _}from"./utils-XFKvwlFT.js";import{l as v}from"./select-CmlY1M1a.js";var y=n();function b({className:e,size:t=`default`,...n}){return(0,y.jsx)(`div`,{"data-slot":`card`,"data-size":t,className:_(`group/card flex flex-col gap-4 overflow-hidden rounded-[var(--miravo-radius-stadium-sm)] border bg-card py-4 text-sm text-card-foreground has-data-[slot=card-footer]:pb-0 has-[>img:first-child]:pt-0 data-[size=sm]:gap-3 data-[size=sm]:py-3 data-[size=sm]:has-data-[slot=card-footer]:pb-0 *:[img:first-child]:rounded-t-[var(--miravo-radius-stadium-sm)] *:[img:last-child]:rounded-b-[var(--miravo-radius-stadium-sm)]`,e),...n})}function x({className:e,...t}){return(0,y.jsx)(`div`,{"data-slot":`card-header`,className:_(`group/card-header @container/card-header grid auto-rows-min items-start gap-1 rounded-t-[var(--miravo-radius-stadium-sm)] px-4 group-data-[size=sm]/card:px-3 has-data-[slot=card-action]:grid-cols-[1fr_auto] has-data-[slot=card-description]:grid-rows-[auto_auto] [.border-b]:pb-4 group-data-[size=sm]/card:[.border-b]:pb-3`,e),...t})}function S({className:e,...t}){return(0,y.jsx)(`div`,{"data-slot":`card-title`,className:_(`text-base leading-snug font-medium group-data-[size=sm]/card:text-sm`,e),...t})}function C({className:e,...t}){return(0,y.jsx)(`div`,{"data-slot":`card-content`,className:_(`px-4 group-data-[size=sm]/card:px-3`,e),...t})}e();function w({className:e,...t}){return(0,y.jsx)(`div`,{"data-slot":`input-group`,role:`group`,className:_(`group/input-group relative flex h-8 w-full min-w-0 items-center gap-1.5 rounded-[var(--miravo-radius-stadium-sm)] border border-input bg-input/30 transition-colors outline-none in-data-[slot=combobox-content]:focus-within:border-inherit in-data-[slot=combobox-content]:focus-within:ring-0 hover:bg-input/50 has-disabled:bg-input/50 has-disabled:opacity-50 has-[[data-slot=input-group-control]:focus-visible]:border-primary/35 has-[[data-slot=input-group-control]:focus-visible]:ring-2 has-[[data-slot=input-group-control]:focus-visible]:ring-primary/22 has-[[data-slot][aria-invalid=true]]:border-destructive has-[[data-slot][aria-invalid=true]]:ring-3 has-[[data-slot][aria-invalid=true]]:ring-destructive/20 has-[>[data-align=block-end]]:h-auto has-[>[data-align=block-end]]:flex-col has-[>[data-align=block-start]]:h-auto has-[>[data-align=block-start]]:flex-col has-[>textarea]:h-auto dark:has-[[data-slot][aria-invalid=true]]:ring-destructive/40 has-[>[data-align=block-end]]:[&>input]:pt-3 has-[>[data-align=block-start]]:[&>input]:pb-3 has-[>[data-align=inline-end]]:[&>input]:pr-1.5 has-[>[data-align=inline-start]]:[&>input]:pl-1.5`,e),...t})}var T=f(`flex h-auto cursor-text items-center justify-center gap-2 py-1.5 text-xs font-medium text-muted-foreground select-none group-data-[disabled=true]/input-group:opacity-50 [&>kbd]:rounded-[calc(var(--radius)-5px)] [&>svg:not([class*='size-'])]:size-4`,{variants:{align:{"inline-start":`order-first pl-2 has-[>button]:ml-[-0.3rem] has-[>kbd]:ml-[-0.15rem]`,"inline-end":`order-last pr-2 has-[>button]:mr-[-0.3rem] has-[>kbd]:mr-[-0.15rem]`,"block-start":`order-first w-full justify-start px-2.5 pt-2 group-has-[>input]/input-group:pt-2 [.border-b]:pb-2`,"block-end":`order-last w-full justify-start px-2.5 pb-2 group-has-[>input]/input-group:pb-2 [.border-t]:pt-2`}},defaultVariants:{align:`inline-start`}});function E({className:e,align:t=`inline-start`,...n}){return(0,y.jsx)(`div`,{role:`group`,"data-slot":`input-group-addon`,"data-align":t,className:_(T({align:t}),e),onClick:e=>{e.target.closest(`button`)||e.currentTarget.parentElement?.querySelector(`input`)?.focus()},...n})}var D=f(`flex items-center gap-2 text-xs shadow-none`,{variants:{size:{xs:`h-6 gap-1 rounded-[var(--miravo-radius-stadium-sm)] px-1.5 [&>svg:not([class*='size-'])]:size-3.5`,sm:``,"icon-xs":`size-6 rounded-[var(--miravo-radius-stadium-sm)] p-0 has-[>svg]:p-0`,"icon-sm":`size-8 p-0 has-[>svg]:p-0`}},defaultVariants:{size:`xs`}});function O({className:e,type:t=`button`,variant:n=`ghost`,size:r=`xs`,...i}){return(0,y.jsx)(p,{type:t,"data-size":r,variant:n,className:_(D({size:r}),e),...i})}function k({className:e,...t}){return(0,y.jsx)(g,{"data-slot":`input-group-control`,className:_(`min-w-0 flex-1 rounded-none border-0 bg-transparent shadow-none ring-0 focus-visible:ring-0 hover:bg-transparent disabled:bg-transparent aria-invalid:ring-0 dark:hover:bg-transparent dark:disabled:bg-transparent`,e),...t})}var A=o;function j({className:e,children:t,...n}){return(0,y.jsxs)(d,{"data-slot":`combobox-trigger`,className:_(`[&_svg:not([class*='size-'])]:size-4`,e),...n,children:[t,(0,y.jsx)(v,{className:`pointer-events-none size-4 text-muted-foreground`})]})}function M({className:e,...t}){return(0,y.jsx)(r,{"data-slot":`combobox-clear`,render:(0,y.jsx)(O,{variant:`ghost`,size:`icon-xs`,"aria-label":`Clear selection`}),className:_(e),...t,children:(0,y.jsx)(h,{className:`pointer-events-none`})})}function N({className:e,children:t,disabled:n=!1,showTrigger:r=!0,showClear:i=!1,...o}){return(0,y.jsxs)(w,{className:_(`w-auto`,e),children:[(0,y.jsx)(a,{render:(0,y.jsx)(k,{disabled:n}),...o}),(0,y.jsxs)(E,{align:`inline-end`,children:[r&&(0,y.jsx)(O,{size:`icon-xs`,variant:`ghost`,render:(0,y.jsx)(j,{}),"data-slot":`input-group-button`,className:`group-has-data-[slot=combobox-clear]/input-group:hidden data-pressed:bg-transparent`,disabled:n,"aria-label":`Toggle options`}),i&&(0,y.jsx)(M,{disabled:n})]}),t]})}function P({className:e,side:n=`bottom`,sideOffset:r=6,align:a=`start`,alignOffset:o=0,anchor:c,...l}){return(0,y.jsx)(s,{children:(0,y.jsx)(t,{side:n,sideOffset:r,align:a,alignOffset:o,anchor:c,className:`isolate z-50`,children:(0,y.jsx)(i,{"data-slot":`combobox-content`,"data-chips":!!c,className:_(`group/combobox-content relative max-h-(--available-height) w-(--anchor-width) max-w-(--available-width) min-w-[calc(var(--anchor-width)+--spacing(7))] origin-(--transform-origin) overflow-hidden rounded-[var(--miravo-radius-tight)] bg-popover text-popover-foreground shadow-md ring-1 ring-foreground/10 duration-100 data-[chips=true]:min-w-(--anchor-width) data-[side=bottom]:slide-in-from-top-2 data-[side=inline-end]:slide-in-from-left-2 data-[side=inline-start]:slide-in-from-right-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 *:data-[slot=input-group]:m-1 *:data-[slot=input-group]:mb-0 *:data-[slot=input-group]:h-8 *:data-[slot=input-group]:border-input/30 *:data-[slot=input-group]:bg-input/30 *:data-[slot=input-group]:shadow-none data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95 motion-reduce:data-open:animate-none motion-reduce:data-closed:animate-none motion-reduce:data-open:duration-0 motion-reduce:data-closed:duration-0`,e),...l})})})}function F({className:e,...t}){return(0,y.jsx)(l,{"data-slot":`combobox-list`,className:_(`no-scrollbar max-h-[min(calc(--spacing(72)---spacing(9)),calc(var(--available-height)---spacing(9)))] scroll-py-1 overflow-y-auto overscroll-contain p-1 data-empty:p-0`,e),...t})}function I({className:e,children:t,...n}){return(0,y.jsxs)(c,{"data-slot":`combobox-item`,className:_(`relative flex w-full cursor-pointer items-center gap-1.5 rounded-[var(--miravo-radius-tight)] py-1 pr-8 pl-1.5 text-xs outline-hidden select-none data-[highlighted]:bg-sidebar-accent data-[highlighted]:text-sidebar-accent-foreground not-data-[variant=destructive]:data-[highlighted]:**:text-sidebar-accent-foreground data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4`,e),...n,children:[t,(0,y.jsx)(u,{render:(0,y.jsx)(`span`,{className:`pointer-events-none absolute right-2 flex size-4 items-center justify-center`}),children:(0,y.jsx)(m,{className:`pointer-events-none`})})]})}export{F as a,x as c,I as i,S as l,P as n,b as o,N as r,C as s,A as t};
|