@memoarchitect/architect 0.8.27 → 0.11.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (44) hide show
  1. package/README.md +1 -1
  2. package/dist/assets/{AiWorkspace-Dp5oBDww.js → AiWorkspace-GFHs046m.js} +2 -2
  3. package/dist/assets/{AnalysisWorkspace-CNHTkSRD.js → AnalysisWorkspace-BfZ4GYza.js} +1 -1
  4. package/dist/assets/{ComplianceWizard-CAJDtLdv.js → ComplianceWizard-CYBizPbC.js} +1 -1
  5. package/dist/assets/DSMView-BsjhUbpW.js +5 -0
  6. package/dist/assets/{Dashboard-BnOwnA1R.js → Dashboard-rdbfFJYx.js} +1 -1
  7. package/dist/assets/{DhfDashboard-CQpiYHtW.js → DhfDashboard-BdhBA4OL.js} +1 -1
  8. package/dist/assets/{DhfWorkbench-DHxWuiiL.js → DhfWorkbench-tnIpEFmu.js} +3 -3
  9. package/dist/assets/DiagramCanvas-BmVByLcM.js +4 -0
  10. package/dist/assets/DiagramEditor-icnDwdxM.js +4 -0
  11. package/dist/assets/{ElementDetailView-BQsWfbPD.js → ElementDetailView-Crpltlrz.js} +2 -2
  12. package/dist/assets/ExplorerTreeRow-DG8T31JS.js +3 -0
  13. package/dist/assets/{ImportView-YFBlvgF_.js → ImportView-1vrZ1CGB.js} +1 -1
  14. package/dist/assets/{LayerGrid-KXyuibWY.js → LayerGrid-DnP2smgG.js} +1 -1
  15. package/dist/assets/{LayerTable-CGsFJsKs.js → LayerTable-97qPfMD3.js} +1 -1
  16. package/dist/assets/{MaxGraphCanvas-BNn0Jxr6.js → MaxGraphCanvas-BJss9LYp.js} +1 -1
  17. package/dist/assets/{ModelDiff-CJCXuz_h.js → ModelDiff-H5nxOavB.js} +1 -1
  18. package/dist/assets/OntologyDecompositionDiagram-D0G3A7-R.js +1 -0
  19. package/dist/assets/{OntologyViewer-DxIWCcJM.js → OntologyViewer-0BJ2jMZ8.js} +2 -2
  20. package/dist/assets/{ReviewDashboard-Qyj8RRFp.js → ReviewDashboard-Dl-YTC4_.js} +1 -1
  21. package/dist/assets/{ScenarioEditor-BIAh6tLX.js → ScenarioEditor-CiHaTvVY.js} +1 -1
  22. package/dist/assets/{StatisticsDashboard-CtI1hlfO.js → StatisticsDashboard-w2dtCD94.js} +1 -1
  23. package/dist/assets/{TabularView-DXxpRshk.js → TabularView-CFy0PK1L.js} +1 -1
  24. package/dist/assets/TraceabilityMatrix-DDoHYsCP.js +3 -0
  25. package/dist/assets/UiScreensWorkspace-DOxjCMG9.js +1 -0
  26. package/dist/assets/{WorkflowWizard-BjtGPRsS.js → WorkflowWizard-Br1zPSLC.js} +1 -1
  27. package/dist/assets/index-BVySIRo1.css +1 -0
  28. package/dist/assets/index-DEVvBtNh.js +4067 -0
  29. package/dist/assets/{index.es-BwDQ0kmQ.js → index.es-D0WykKwq.js} +1 -1
  30. package/dist/assets/{jspdf.es.min-KfOikWO5.js → jspdf.es.min-DZ4wvU_9.js} +3 -3
  31. package/dist/assets/notation-scene-HbscVJH5.js +1 -0
  32. package/dist/index.html +2 -2
  33. package/dist-standalone/index.html +211 -211
  34. package/package.json +3 -3
  35. package/dist/assets/DSMView-Bv9j1Vk_.js +0 -5
  36. package/dist/assets/DiagramCanvas-DtLlTvJf.js +0 -4
  37. package/dist/assets/DiagramEditor-DP_PiI7K.js +0 -4
  38. package/dist/assets/ExplorerTreeRow-CmGPHRI8.js +0 -3
  39. package/dist/assets/OntologyDecompositionDiagram-5JWUI_PB.js +0 -1
  40. package/dist/assets/TraceabilityMatrix-qEKmDy8z.js +0 -3
  41. package/dist/assets/UiScreensWorkspace-BHhs5tcY.js +0 -1
  42. package/dist/assets/index-Cdkjp-H4.css +0 -1
  43. package/dist/assets/index-a2rpMs5Y.js +0 -4067
  44. package/dist/assets/notation-scene-CxT28i2i.js +0 -1
@@ -1,3 +1,3 @@
1
- import{j as e}from"./reactflow-C9OlmOYw.js";import{a as x}from"./zustand-CrhqMOHB.js";import{u as A,k as he,m as fe,C as f,F as C,h as E,E as O,n as Z,M as ge,o as ye,D as je}from"./index-a2rpMs5Y.js";function ke(d){const r=d.diagramType.toLowerCase(),b=["afd","ofd","ffd"].includes(r)?ye(d):r;return je[b]}function ee({expanded:d,color:r=f.muted}){return e.jsx("svg",{width:"14",height:"14",viewBox:"0 0 16 16",fill:"none",style:{transform:d?"rotate(90deg)":void 0,transition:"transform 150ms ease",flexShrink:0},children:e.jsx("path",{d:"M6 4L10 8L6 12",stroke:r,strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}function te({open:d,color:r}){return e.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",style:{flexShrink:0},children:[e.jsx("path",{d:"M1.5 3.5h4.8l1.2 1.5H14.5v8H1.5z",fill:r,opacity:"0.15",stroke:r,strokeWidth:"1",strokeLinejoin:"round"}),d&&e.jsx("path",{d:"M1.5 5h13v8H1.5z",fill:r,opacity:"0.08"})]})}function be({color:d}){return e.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 16 16",fill:"none",style:{flexShrink:0},children:[e.jsx("rect",{x:"2",y:"1.5",width:"12",height:"13",rx:"1.5",fill:d,opacity:"0.1",stroke:d,strokeWidth:"1"}),e.jsx("line",{x1:"5",y1:"5.5",x2:"11",y2:"5.5",stroke:d,strokeWidth:"0.8",opacity:"0.5"}),e.jsx("line",{x1:"5",y1:"8",x2:"11",y2:"8",stroke:d,strokeWidth:"0.8",opacity:"0.5"})]})}function se(d){return d?d.split(`
1
+ import{j as e}from"./reactflow-C9OlmOYw.js";import{a as x}from"./zustand-CrhqMOHB.js";import{u as A,p as he,q as fe,C as f,F as C,h as E,E as O,t as Z,M as ge,v as ye,D as je}from"./index-DEVvBtNh.js";function ke(d){const r=d.diagramType.toLowerCase(),b=["afd","ofd","ffd"].includes(r)?ye(d):r;return je[b]}function ee({expanded:d,color:r=f.muted}){return e.jsx("svg",{width:"14",height:"14",viewBox:"0 0 16 16",fill:"none",style:{transform:d?"rotate(90deg)":void 0,transition:"transform 150ms ease",flexShrink:0},children:e.jsx("path",{d:"M6 4L10 8L6 12",stroke:r,strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}function te({open:d,color:r}){return e.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",style:{flexShrink:0},children:[e.jsx("path",{d:"M1.5 3.5h4.8l1.2 1.5H14.5v8H1.5z",fill:r,opacity:"0.15",stroke:r,strokeWidth:"1",strokeLinejoin:"round"}),d&&e.jsx("path",{d:"M1.5 5h13v8H1.5z",fill:r,opacity:"0.08"})]})}function be({color:d}){return e.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 16 16",fill:"none",style:{flexShrink:0},children:[e.jsx("rect",{x:"2",y:"1.5",width:"12",height:"13",rx:"1.5",fill:d,opacity:"0.1",stroke:d,strokeWidth:"1"}),e.jsx("line",{x1:"5",y1:"5.5",x2:"11",y2:"5.5",stroke:d,strokeWidth:"0.8",opacity:"0.5"}),e.jsx("line",{x1:"5",y1:"8",x2:"11",y2:"8",stroke:d,strokeWidth:"0.8",opacity:"0.5"})]})}function se(d){return d?d.split(`
2
2
  `).filter(b=>b.trim()).map((b,W)=>{const I=b.match(/^\d+\.\s*(.*)/);return{index:W,text:I?I[1]:b}}):[]}function ve(d){return d.map((r,b)=>`${b+1}. ${r.text}`).join(`
3
3
  `)}function Ce({explorerOnly:d=!1}){const r=A(t=>t.model),b=A(t=>t.createRelationship),W=A(t=>t.inspectElement),I=A(t=>t.setActiveView),G=A(t=>t.setActiveMode),S=A(t=>t.selectedElementId),[D,ne]=x.useState(""),[i,F]=x.useState(null),[L,P]=x.useState(""),[z,_]=x.useState(null),[T,H]=x.useState(""),R=x.useMemo(()=>{if(!r)return[];const t=Object.values(r.elements),n=r.elements,o=(...s)=>{const y=new Set(s.map(j=>j.toLowerCase()));return r.relationships.filter(j=>y.has(j.type.toLowerCase()))},c=(s,y)=>{var j;return typeof s=="string"&&((j=s.split("::").at(-1))==null?void 0:j.trim())===y},h=t.filter(s=>s.kind.endsWith("UseCase")),w=new Set(h.map(s=>s.id)),u=new Map,a=new Set;for(const s of o("Includes")){if(!w.has(s.sourceId)||!w.has(s.targetId))continue;const y=u.get(s.sourceId)??[];y.push(s.targetId),u.set(s.sourceId,y),a.add(s.targetId)}const v=new Map,g=[],m=(s,y)=>{if(!v.has(s)){v.set(s,y),g.push(s);for(const j of u.get(s)??[])m(j,y+1)}};for(const s of h)a.has(s.id)||m(s.id,0);for(const s of h)m(s.id,0);const M=g.map(s=>n[s]).filter(s=>!!s),$=s=>!D||s.name.toLowerCase().includes(D.toLowerCase())||s.kind.toLowerCase().includes(D.toLowerCase());return M.map(s=>{var Q;const y=o("Supports","supportsUseCase").filter(l=>l.targetId===s.id).map(l=>n[l.sourceId]).filter(l=>!!l&&l.kind==="OperationalWorkflow"),j=t.filter(l=>l.kind.endsWith("Scenario")).filter(l=>c(l.attributes.parentUseCase,s.id)||o("Realizes","scenarioRealizesUseCase").some(N=>N.sourceId===l.id&&N.targetId===s.id)),U=j.map(l=>t.find(N=>c(l.attributes.parentWorkflow,N.id))).filter(l=>!!l),pe=[...new Map([...y,...U].map(l=>[l.id,l])).values()],ue=j.map(l=>{const N=(r.diagrams??[]).filter(me=>{var X;return(X=me.scenarioIds)==null?void 0:X.includes(l.id)});return{scenario:l,views:N}}),xe=pe.map(l=>({workflow:l,scenarios:ue.filter(({scenario:N})=>c(N.attributes.parentWorkflow,l.id))}));return{useCase:s,workflows:xe,depth:v.get(s.id)??0,hasChildren:(((Q=u.get(s.id))==null?void 0:Q.length)??0)>0}}).filter(s=>$(s.useCase)||s.workflows.some(({workflow:y,scenarios:j})=>$(y)||j.some(({scenario:U})=>$(U))))},[r,D]),p=S&&r?r.elements[S]:null,K=x.useMemo(()=>he(r,S||""),[r,S]),k=x.useMemo(()=>i||(p?se(p.doc||""):[]),[p,i]),oe=x.useCallback(()=>{p&&F(se(p.doc||""))},[p]),re=x.useCallback(()=>{if(!p||!i)return;const t=ve(i);fe({...p,doc:t}),F(null)},[p,i]),V=x.useCallback(()=>{if(!L.trim())return;const t=[...i||k,{index:k.length,text:L.trim()}];F(t),P("")},[L,i,k]),le=x.useCallback(t=>{const n=(i||k).filter((o,c)=>c!==t);F(n)},[i,k]),Y=x.useCallback((t,n)=>{const o=[...i||k],c=t+n;c<0||c>=o.length||([o[t],o[c]]=[o[c],o[t]],F(o))},[i,k]),ae=x.useCallback((t,n)=>{const o=[...i||k];o[t]={...o[t],text:n},F(o)},[i,k]),ce=x.useMemo(()=>{if(!r||!T)return[];const t=T.toLowerCase();return Object.values(r.elements).filter(n=>n.id!==S&&n.name.toLowerCase().includes(t)).slice(0,10)},[r,T,S]),[q,ie]=x.useState(new Set),J=t=>{ie(n=>{const o=new Set(n);return o.has(t)?o.delete(t):o.add(t),o})},B=t=>{F(null),G("scenario"),W(t),I({type:"element-detail",elementId:t})},de=({workflow:t,scenarios:n})=>{const o=`workflow:${t.id}`,c=q.has(o),h=()=>J(o),w=a=>{G("scenario"),I({type:"diagram",diagramId:a.id})},u=(a,v)=>{const g=S===a.id;return e.jsxs("button",{type:"button",onClick:()=>B(a.id),className:"flex w-full items-center gap-1.5 px-2 py-1 text-left",style:{borderRadius:"4px",margin:"0 4px",marginLeft:`${v+4}px`,width:`calc(100% - ${v+8}px)`,background:g?`${f.accent}18`:"transparent"},onMouseEnter:m=>{g||(m.currentTarget.style.background="#F0F0ED")},onMouseLeave:m=>{m.currentTarget.style.background=g?`${f.accent}18`:"transparent"},children:[e.jsx(be,{color:E[a.layer]||f.muted}),e.jsx(O,{element:a,selected:g})]},a.id)};return e.jsxs("div",{className:"mb-0.5",children:[e.jsxs("div",{className:"flex items-center gap-1.5 px-2 py-1 cursor-pointer select-none",style:{borderRadius:"4px",margin:"0 4px"},onMouseEnter:a=>a.currentTarget.style.background="#F0F0ED",onMouseLeave:a=>a.currentTarget.style.background="transparent",onClick:()=>B(t.id),children:[e.jsx("button",{type:"button","aria-label":`${c?"Collapse":"Expand"} ${t.name}`,onClick:a=>{a.stopPropagation(),h()},children:e.jsx(ee,{expanded:c,color:f.muted})}),e.jsx(te,{open:c,color:E.operational}),e.jsx(O,{element:t,fontSize:C.explorer.kind,fontWeight:600}),e.jsx(Z,{count:n.length,color:E.operational,title:`${n.length} scenarios`})]}),c&&n.map(({scenario:a,views:v})=>e.jsxs("div",{style:{marginLeft:"16px"},children:[u(a,0),e.jsx("div",{style:{marginLeft:"20px"},children:v.length>0&&e.jsx("div",{className:"pt-1",children:v.map(g=>{const m=ke(g);return e.jsxs("button",{type:"button",onClick:()=>w(g),className:"flex w-full items-center gap-2 px-2 py-1 text-left",style:{borderRadius:"4px",margin:"0 4px",width:"calc(100% - 8px)"},onMouseEnter:M=>M.currentTarget.style.background="#F0F0ED",onMouseLeave:M=>M.currentTarget.style.background="transparent",title:m==null?void 0:m.fullName,children:[m&&e.jsx("span",{className:"px-1.5 py-0.5 rounded font-semibold",style:{background:m.color+"20",color:m.color,fontSize:C.badge},children:m.code}),e.jsxs("span",{className:"flex-1",style:{minWidth:0},children:[e.jsx("span",{className:"truncate block",style:{color:f.primary,fontSize:C.explorer.item},children:g.name}),e.jsx("span",{className:"truncate block font-mono",style:{color:f.faint,fontSize:"9px",marginTop:1},children:g.id})]})]},g.id)})})})]},a.id)),c&&n.length===0&&e.jsx("div",{className:"px-2 py-1",style:{color:f.faint,fontSize:C.explorer.count,marginLeft:"20px"},children:"No scenarios"})]})};return e.jsxs("div",{className:"flex flex-1 overflow-hidden",children:[d&&e.jsxs("div",{className:"flex-1 flex flex-col overflow-hidden",style:{background:f.surface},children:[e.jsx("div",{className:"px-3 py-2",style:{borderBottom:"1px solid #E5E5E0"},children:e.jsx("input",{type:"text",placeholder:"Search "+R.length+" use cases...",value:D,onChange:t=>ne(t.target.value),className:"w-full px-3 py-2 rounded-lg focus:outline-none",style:{background:f.surfaceAlt,border:`1px solid ${f.border}`,color:f.primary,fontSize:C.explorer.search}})}),e.jsxs("div",{className:"flex-1 overflow-y-auto py-1",style:{fontSize:C.explorer.item},children:[R.map(({useCase:t,workflows:n,depth:o})=>{const c="use-case:"+t.id,h=q.has(c),w=n.reduce((u,{scenarios:a})=>u+a.length,0);return e.jsxs("div",{className:"mb-0.5",children:[e.jsxs("div",{className:"flex items-center gap-1.5 px-2 py-1.5 cursor-pointer select-none",style:{borderRadius:"4px",margin:"0 4px",marginLeft:4+o*16},onMouseEnter:u=>u.currentTarget.style.background="#F0F0ED",onMouseLeave:u=>u.currentTarget.style.background="transparent",onClick:()=>B(t.id),children:[e.jsx("button",{type:"button","aria-label":`${h?"Collapse":"Expand"} ${t.name}`,onClick:u=>{u.stopPropagation(),J(c)},children:e.jsx(ee,{expanded:h,color:E.functional})}),e.jsx(te,{open:h,color:E.functional}),e.jsx(O,{element:t,fontSize:C.explorer.group,fontWeight:600}),e.jsx(Z,{count:w,color:E.functional,title:`${w} scenarios`})]}),h&&e.jsxs("div",{style:{marginLeft:16+o*16},children:[n.map(({workflow:u,scenarios:a})=>e.jsx(de,{workflow:u,scenarios:a},u.id)),n.length===0&&e.jsx("div",{className:"px-2 py-1",style:{color:f.faint,fontSize:C.explorer.kind},children:"No workflows"})]})]},t.id)}),R.length===0&&e.jsx("div",{className:"px-4 py-8 text-center",style:{color:f.faint},children:"No use-case scenario chains found."})]})]}),!d&&e.jsx("div",{className:"flex-1 overflow-y-auto p-6",style:{background:"#F7F7F5"},children:e.jsxs(e.Fragment,{children:[!p&&e.jsx("div",{className:"flex items-center justify-center h-full",style:{color:"#9CA3AF"},children:e.jsxs("div",{className:"text-center",children:[e.jsx("div",{style:{display:"flex",justifyContent:"center",marginBottom:2},children:e.jsx(ge,{size:180})}),e.jsx("div",{className:"text-sm",children:"Select a scenario to edit steps and link elements"})]})}),p&&e.jsxs("div",{className:"max-w-2xl",children:[e.jsxs("div",{className:"flex items-center gap-3 mb-4",children:[e.jsx("h2",{className:"text-lg font-semibold",style:{color:"#1a1a1a"},children:p.name}),e.jsx("span",{className:"px-2 py-0.5 text-xs rounded-md font-medium",style:{background:"#E67E2218",color:"#E67E22"},children:p.kind})]}),e.jsxs("div",{className:"mb-4",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[e.jsx("h3",{className:"text-xs font-semibold uppercase tracking-wider",style:{color:"#6B7280"},children:"Steps"}),!i&&e.jsx("button",{onClick:oe,className:"px-2 py-0.5 text-xs rounded",style:{background:"#2DD4A815",color:"#1B3A4B",border:"1px solid #2DD4A840"},children:"Edit"}),i&&e.jsxs("div",{className:"flex gap-1",children:[e.jsx("button",{onClick:re,className:"px-2 py-0.5 text-xs rounded font-medium",style:{background:"#2DD4A8",color:"#FFFFFF"},children:"Save"}),e.jsx("button",{onClick:()=>F(null),className:"px-2 py-0.5 text-xs rounded",style:{background:"#F3F4F6",color:"#6B7280"},children:"Cancel"})]})]}),e.jsx("div",{className:"space-y-1",children:k.map((t,n)=>e.jsxs("div",{className:"flex items-start gap-2 p-2 rounded-lg",style:{background:"#FFFFFF",border:"1px solid #E5E5E0"},children:[e.jsx("span",{className:"flex-shrink-0 w-6 h-6 rounded-full flex items-center justify-center text-xs font-medium",style:{background:"#2DD4A815",color:"#1B3A4B"},children:n+1}),i?e.jsx("input",{type:"text",value:t.text,onChange:o=>ae(n,o.target.value),className:"flex-1 text-sm px-2 py-1 rounded focus:outline-none",style:{border:"1px solid #E5E5E0",color:"#374151"}}):e.jsx("span",{className:"flex-1 text-sm",style:{color:"#374151"},children:t.text}),i&&e.jsxs("div",{className:"flex gap-0.5",children:[e.jsx("button",{onClick:()=>Y(n,-1),className:"px-1 text-xs",style:{color:"#9CA3AF"},title:"Move up",children:"▲"}),e.jsx("button",{onClick:()=>Y(n,1),className:"px-1 text-xs",style:{color:"#9CA3AF"},title:"Move down",children:"▼"}),e.jsx("button",{onClick:()=>le(n),className:"px-1 text-xs",style:{color:"#E74C3C"},title:"Remove",children:"✕"})]})]},n))}),i&&e.jsxs("div",{className:"flex gap-2 mt-2",children:[e.jsx("input",{type:"text",value:L,onChange:t=>P(t.target.value),onKeyDown:t=>t.key==="Enter"&&V(),placeholder:"Add a step...",className:"flex-1 text-sm px-3 py-2 rounded-lg focus:outline-none",style:{background:"#FFFFFF",border:"1px solid #E5E5E0",color:"#374151"}}),e.jsx("button",{onClick:V,className:"px-3 py-2 text-xs rounded-lg font-medium",style:{background:"#2DD4A815",color:"#1B3A4B",border:"1px solid #2DD4A840"},children:"+ Add"})]}),k.length===0&&!i&&e.jsx("div",{className:"text-xs p-3 rounded-lg",style:{background:"#F3F4F6",color:"#9CA3AF"},children:"No steps defined. Click Edit to add scenario steps."})]}),e.jsxs("div",{className:"mb-4",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[e.jsxs("h3",{className:"text-xs font-semibold uppercase tracking-wider",style:{color:"#6B7280"},children:["Linked Elements (",K.length,")"]}),e.jsx("button",{onClick:()=>_(z===null?0:null),className:"px-2 py-0.5 text-xs rounded",style:{background:"#4A90D915",color:"#4A90D9",border:"1px solid #4A90D940"},children:z!==null?"Done":"+ Link"})]}),z!==null&&e.jsxs("div",{className:"mb-2 p-2 rounded-lg",style:{background:"#FFFFFF",border:"1px solid #4A90D940"},children:[e.jsx("input",{type:"text",value:T,onChange:t=>H(t.target.value),placeholder:"Search elements to link...",className:"w-full text-sm px-2 py-1 rounded focus:outline-none mb-1",style:{border:"1px solid #E5E5E0",color:"#374151"}}),ce.map(t=>e.jsxs("div",{className:"flex items-center gap-2 px-2 py-1 text-xs rounded cursor-pointer",onMouseEnter:n=>n.currentTarget.style.background="#F0F0ED",onMouseLeave:n=>n.currentTarget.style.background="transparent",onClick:()=>{b({type:"traceTo",sourceId:p.id,targetId:t.id,direction:"outgoing",selectedElementId:p.id}),H(""),_(null)},children:[e.jsx("span",{className:"w-2 h-2 rounded-full",style:{background:E[t.layer]||"#95A5A6"}}),e.jsx("span",{style:{color:"#374151"},children:t.name}),e.jsx("span",{style:{color:"#9CA3AF"},children:t.kind})]},t.id))]}),e.jsx("div",{className:"space-y-1",children:K.map(t=>{const n=t.sourceId===p.id?t.targetId:t.sourceId,o=r.elements[n],c=t.sourceId===p.id?"→":"←";return e.jsxs("div",{className:"flex items-center gap-2 px-3 py-1.5 text-xs rounded-lg cursor-pointer",style:{background:"#FFFFFF",border:"1px solid #E5E5E0"},onMouseEnter:h=>h.currentTarget.style.background="#F0F0ED",onMouseLeave:h=>h.currentTarget.style.background="#FFFFFF",onClick:()=>B(n),children:[e.jsx("span",{style:{color:"#9CA3AF"},children:c}),e.jsx("span",{className:"font-medium",style:{color:"#2563EB"},children:t.type}),e.jsx("span",{style:{color:"#374151"},children:(o==null?void 0:o.name)||n}),o&&e.jsx("span",{className:"ml-auto px-1.5 py-0.5 rounded text-xs",style:{background:(E[o.layer]||"#95A5A6")+"18",color:E[o.layer]||"#95A5A6"},children:o.kind})]},t.id)})})]}),e.jsx("div",{className:"text-xs",style:{color:"#D1D5DB"},children:p.file})]})]})})]})}export{Ce as ScenarioEditor};
@@ -1 +1 @@
1
- import{j as e}from"./reactflow-C9OlmOYw.js";import{a as A}from"./zustand-CrhqMOHB.js";import{u as f,L as y,h as u,f as b}from"./index-a2rpMs5Y.js";function w(a){var F;const c=Object.values(a.elements),n=c.length,t=a.relationships.length,i=((F=a.diagrams)==null?void 0:F.length)??0,d=new Map;for(const s of c){const o=d.get(s.layer)||{count:0,kinds:new Map};o.count++,o.kinds.set(s.kind,(o.kinds.get(s.kind)||0)+1),d.set(s.layer,o)}const m=y.filter(s=>d.has(s)).map(s=>({layer:s,label:b[s]||s,color:u[s]||"#95A5A6",count:d.get(s).count,kinds:d.get(s).kinds}));for(const[s,o]of d)y.includes(s)||m.push({layer:s,label:b[s]||s,color:u[s]||"#95A5A6",count:o.count,kinds:o.kinds});const l=new Map;for(const s of c){const o=l.get(s.kind)||{count:0,layer:s.layer};o.count++,l.set(s.kind,o)}const r=[...l.entries()].map(([s,{count:o,layer:C}])=>({kind:s,count:o,layer:C})).sort((s,o)=>o.count-s.count).slice(0,15),x=new Map;for(const s of a.relationships)x.set(s.type,(x.get(s.type)||0)+1);const j=[...x.entries()].map(([s,o])=>({type:s,count:o})).sort((s,o)=>o.count-s.count),p=new Set;for(const s of a.relationships)p.add(s.sourceId),p.add(s.targetId);const N=c.filter(s=>!p.has(s.id)).length;Math.max(...m.map(s=>s.count),1);const v=m.map(s=>({layer:s.layer,label:s.label,color:s.color,percent:Math.round(s.count/n*100)})),E=n>0?t/n:0,k=n>0?t/n:0;return{totalElements:n,totalRelationships:t,totalDiagrams:i,layers:m,topKinds:r,relTypes:j,avgRelsPerElement:Math.round(k*10)/10,orphanCount:N,coverage:v,density:Math.round(E*100)/100}}function B(){var d,m;const a=f(l=>l.model),c=f(l=>l.validation),n=f(l=>l.completeness),t=A.useMemo(()=>a?w(a):null,[a]);if(!t)return e.jsx("div",{className:"flex-1 flex items-center justify-center",style:{background:"#F7F7F5",color:"#9CA3AF"},children:e.jsx("div",{className:"text-sm",children:"No model data"})});const i=((d=c==null?void 0:c.violations)==null?void 0:d.length)??0;return e.jsx("div",{className:"flex-1 overflow-y-auto p-6",style:{background:"#F7F7F5"},children:e.jsxs("div",{className:"max-w-5xl mx-auto",children:[e.jsx("h2",{className:"text-lg font-semibold mb-1",style:{color:"#374151"},children:"Model Statistics"}),e.jsx("p",{className:"text-xs mb-6",style:{color:"#9CA3AF"},children:"Quick health check for your model"}),e.jsxs("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-3 mb-6",children:[e.jsx(h,{label:"Elements",value:t.totalElements,color:"#1B3A4B"}),e.jsx(h,{label:"Relationships",value:t.totalRelationships,color:"#4A90D9"}),e.jsx(h,{label:"Diagrams",value:t.totalDiagrams,color:"#7B68EE"}),e.jsx(h,{label:"Violations",value:i,color:i>0?"#E74C3C":"#2ECC71"})]}),e.jsxs("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-3 mb-6",children:[e.jsx(g,{label:"Rel. Density",value:`${t.avgRelsPerElement}`,unit:"per element",status:t.avgRelsPerElement>=1.5?"good":t.avgRelsPerElement>=.5?"ok":"low"}),e.jsx(g,{label:"Orphans",value:`${t.orphanCount}`,unit:"unlinked",status:t.orphanCount===0?"good":t.orphanCount<=5?"ok":"low"}),e.jsx(g,{label:"Layers Used",value:`${t.layers.length}`,unit:`of ${y.length}`,status:t.layers.length>=6?"good":t.layers.length>=3?"ok":"low"}),e.jsx(g,{label:"Kinds Used",value:`${t.topKinds.length}`,unit:"types",status:t.topKinds.length>=8?"good":t.topKinds.length>=4?"ok":"low"})]}),e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[e.jsxs("div",{className:"p-4 rounded-lg",style:{background:"#FFFFFF",border:"1px solid #E5E5E0"},children:[e.jsx("h3",{className:"text-xs font-semibold uppercase tracking-wider mb-3",style:{color:"#6B7280"},children:"Elements by Layer"}),e.jsx("div",{className:"space-y-2",children:t.layers.map((l,r)=>e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"w-20 text-xs truncate",style:{color:"#374151"},children:l.label}),e.jsx("div",{className:"flex-1 h-4 rounded-full overflow-hidden",style:{background:"#F3F4F6"},children:e.jsx("div",{className:"h-full rounded-full transition-all",style:{width:`${Math.max(l.count/t.totalElements*100,2)}%`,background:l.color,opacity:.8}})}),e.jsx("span",{className:"w-8 text-right text-xs font-medium",style:{color:"#374151"},children:l.count})]},`${l.layer}-${r}`))})]}),e.jsxs("div",{className:"p-4 rounded-lg",style:{background:"#FFFFFF",border:"1px solid #E5E5E0"},children:[e.jsx("h3",{className:"text-xs font-semibold uppercase tracking-wider mb-3",style:{color:"#6B7280"},children:"Layer Coverage"}),e.jsx("div",{className:"grid grid-cols-3 gap-2",children:y.map(l=>{const r=t.coverage.find(p=>p.layer===l),x=(r==null?void 0:r.percent)??0,j=x>0?Math.max(.15,x/100):.05;return e.jsxs("div",{className:"p-2 rounded-lg text-center",style:{background:`${u[l]||"#95A5A6"}${Math.round(j*255).toString(16).padStart(2,"0")}`,border:`1px solid ${u[l]||"#95A5A6"}30`},children:[e.jsx("div",{className:"text-xs font-medium truncate",style:{color:"#374151"},children:b[l]||l}),e.jsxs("div",{className:"text-lg font-bold",style:{color:u[l]||"#95A5A6"},children:[x,"%"]})]},l)})})]}),e.jsxs("div",{className:"p-4 rounded-lg",style:{background:"#FFFFFF",border:"1px solid #E5E5E0"},children:[e.jsx("h3",{className:"text-xs font-semibold uppercase tracking-wider mb-3",style:{color:"#6B7280"},children:"Top Element Types"}),e.jsx("div",{className:"space-y-1",children:t.topKinds.map((l,r)=>e.jsxs("div",{className:"flex items-center gap-2 text-xs",children:[e.jsx("span",{className:"w-2 h-2 rounded-full",style:{background:u[l.layer]||"#95A5A6"}}),e.jsx("span",{className:"flex-1 truncate",style:{color:"#374151"},children:l.kind}),e.jsx("span",{className:"font-medium",style:{color:"#6B7280"},children:l.count})]},`${l.kind}-${r}`))})]}),e.jsxs("div",{className:"p-4 rounded-lg",style:{background:"#FFFFFF",border:"1px solid #E5E5E0"},children:[e.jsx("h3",{className:"text-xs font-semibold uppercase tracking-wider mb-3",style:{color:"#6B7280"},children:"Relationship Types"}),e.jsxs("div",{className:"space-y-1",children:[t.relTypes.map((l,r)=>e.jsxs("div",{className:"flex items-center gap-2 text-xs",children:[e.jsx("span",{className:"w-2 h-2 rounded-full",style:{background:"#4A90D9"}}),e.jsx("span",{className:"flex-1 truncate",style:{color:"#374151"},children:l.type}),e.jsx("span",{className:"font-medium",style:{color:"#6B7280"},children:l.count})]},`${l.type}-${r}`)),t.relTypes.length===0&&e.jsx("div",{className:"text-xs",style:{color:"#9CA3AF"},children:"No relationships"})]})]})]}),n&&e.jsxs("div",{className:"mt-4 p-4 rounded-lg",style:{background:"#FFFFFF",border:"1px solid #E5E5E0"},children:[e.jsx("h3",{className:"text-xs font-semibold uppercase tracking-wider mb-3",style:{color:"#6B7280"},children:"Completeness by Layer"}),e.jsx("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-2",children:(m=n.layers)==null?void 0:m.map((l,r)=>e.jsxs("div",{className:"flex items-center gap-2 text-xs",children:[e.jsx("span",{className:"w-2 h-2 rounded-full",style:{background:u[l.layer]||"#95A5A6"}}),e.jsx("span",{className:"flex-1 truncate",style:{color:"#374151"},children:l.layer}),e.jsxs("span",{className:"font-medium",style:{color:l.completeness>=80?"#2ECC71":l.completeness>=50?"#F39C12":"#E74C3C"},children:[Math.round(l.completeness),"%"]})]},`${l.layer}-${r}`))})]})]})})}function h({label:a,value:c,color:n}){return e.jsxs("div",{className:"p-4 rounded-lg",style:{background:"#FFFFFF",border:"1px solid #E5E5E0"},children:[e.jsx("div",{className:"text-2xl font-bold",style:{color:n},children:c.toLocaleString()}),e.jsx("div",{className:"text-xs mt-0.5",style:{color:"#9CA3AF"},children:a})]})}function g({label:a,value:c,unit:n,status:t}){const i=t==="good"?"#2ECC71":t==="ok"?"#F39C12":"#E74C3C";return e.jsxs("div",{className:"p-4 rounded-lg",style:{background:"#FFFFFF",border:`1px solid ${i}30`},children:[e.jsxs("div",{className:"flex items-baseline gap-1",children:[e.jsx("span",{className:"text-lg font-bold",style:{color:i},children:c}),e.jsx("span",{className:"text-xs",style:{color:"#9CA3AF"},children:n})]}),e.jsx("div",{className:"text-xs mt-0.5",style:{color:"#6B7280"},children:a})]})}export{B as StatisticsDashboard};
1
+ import{j as e}from"./reactflow-C9OlmOYw.js";import{a as A}from"./zustand-CrhqMOHB.js";import{u as f,L as y,h as u,f as b}from"./index-DEVvBtNh.js";function w(a){var F;const c=Object.values(a.elements),n=c.length,t=a.relationships.length,i=((F=a.diagrams)==null?void 0:F.length)??0,d=new Map;for(const s of c){const o=d.get(s.layer)||{count:0,kinds:new Map};o.count++,o.kinds.set(s.kind,(o.kinds.get(s.kind)||0)+1),d.set(s.layer,o)}const m=y.filter(s=>d.has(s)).map(s=>({layer:s,label:b[s]||s,color:u[s]||"#95A5A6",count:d.get(s).count,kinds:d.get(s).kinds}));for(const[s,o]of d)y.includes(s)||m.push({layer:s,label:b[s]||s,color:u[s]||"#95A5A6",count:o.count,kinds:o.kinds});const l=new Map;for(const s of c){const o=l.get(s.kind)||{count:0,layer:s.layer};o.count++,l.set(s.kind,o)}const r=[...l.entries()].map(([s,{count:o,layer:C}])=>({kind:s,count:o,layer:C})).sort((s,o)=>o.count-s.count).slice(0,15),x=new Map;for(const s of a.relationships)x.set(s.type,(x.get(s.type)||0)+1);const j=[...x.entries()].map(([s,o])=>({type:s,count:o})).sort((s,o)=>o.count-s.count),p=new Set;for(const s of a.relationships)p.add(s.sourceId),p.add(s.targetId);const N=c.filter(s=>!p.has(s.id)).length;Math.max(...m.map(s=>s.count),1);const v=m.map(s=>({layer:s.layer,label:s.label,color:s.color,percent:Math.round(s.count/n*100)})),E=n>0?t/n:0,k=n>0?t/n:0;return{totalElements:n,totalRelationships:t,totalDiagrams:i,layers:m,topKinds:r,relTypes:j,avgRelsPerElement:Math.round(k*10)/10,orphanCount:N,coverage:v,density:Math.round(E*100)/100}}function B(){var d,m;const a=f(l=>l.model),c=f(l=>l.validation),n=f(l=>l.completeness),t=A.useMemo(()=>a?w(a):null,[a]);if(!t)return e.jsx("div",{className:"flex-1 flex items-center justify-center",style:{background:"#F7F7F5",color:"#9CA3AF"},children:e.jsx("div",{className:"text-sm",children:"No model data"})});const i=((d=c==null?void 0:c.violations)==null?void 0:d.length)??0;return e.jsx("div",{className:"flex-1 overflow-y-auto p-6",style:{background:"#F7F7F5"},children:e.jsxs("div",{className:"max-w-5xl mx-auto",children:[e.jsx("h2",{className:"text-lg font-semibold mb-1",style:{color:"#374151"},children:"Model Statistics"}),e.jsx("p",{className:"text-xs mb-6",style:{color:"#9CA3AF"},children:"Quick health check for your model"}),e.jsxs("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-3 mb-6",children:[e.jsx(h,{label:"Elements",value:t.totalElements,color:"#1B3A4B"}),e.jsx(h,{label:"Relationships",value:t.totalRelationships,color:"#4A90D9"}),e.jsx(h,{label:"Diagrams",value:t.totalDiagrams,color:"#7B68EE"}),e.jsx(h,{label:"Violations",value:i,color:i>0?"#E74C3C":"#2ECC71"})]}),e.jsxs("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-3 mb-6",children:[e.jsx(g,{label:"Rel. Density",value:`${t.avgRelsPerElement}`,unit:"per element",status:t.avgRelsPerElement>=1.5?"good":t.avgRelsPerElement>=.5?"ok":"low"}),e.jsx(g,{label:"Orphans",value:`${t.orphanCount}`,unit:"unlinked",status:t.orphanCount===0?"good":t.orphanCount<=5?"ok":"low"}),e.jsx(g,{label:"Layers Used",value:`${t.layers.length}`,unit:`of ${y.length}`,status:t.layers.length>=6?"good":t.layers.length>=3?"ok":"low"}),e.jsx(g,{label:"Kinds Used",value:`${t.topKinds.length}`,unit:"types",status:t.topKinds.length>=8?"good":t.topKinds.length>=4?"ok":"low"})]}),e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[e.jsxs("div",{className:"p-4 rounded-lg",style:{background:"#FFFFFF",border:"1px solid #E5E5E0"},children:[e.jsx("h3",{className:"text-xs font-semibold uppercase tracking-wider mb-3",style:{color:"#6B7280"},children:"Elements by Layer"}),e.jsx("div",{className:"space-y-2",children:t.layers.map((l,r)=>e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"w-20 text-xs truncate",style:{color:"#374151"},children:l.label}),e.jsx("div",{className:"flex-1 h-4 rounded-full overflow-hidden",style:{background:"#F3F4F6"},children:e.jsx("div",{className:"h-full rounded-full transition-all",style:{width:`${Math.max(l.count/t.totalElements*100,2)}%`,background:l.color,opacity:.8}})}),e.jsx("span",{className:"w-8 text-right text-xs font-medium",style:{color:"#374151"},children:l.count})]},`${l.layer}-${r}`))})]}),e.jsxs("div",{className:"p-4 rounded-lg",style:{background:"#FFFFFF",border:"1px solid #E5E5E0"},children:[e.jsx("h3",{className:"text-xs font-semibold uppercase tracking-wider mb-3",style:{color:"#6B7280"},children:"Layer Coverage"}),e.jsx("div",{className:"grid grid-cols-3 gap-2",children:y.map(l=>{const r=t.coverage.find(p=>p.layer===l),x=(r==null?void 0:r.percent)??0,j=x>0?Math.max(.15,x/100):.05;return e.jsxs("div",{className:"p-2 rounded-lg text-center",style:{background:`${u[l]||"#95A5A6"}${Math.round(j*255).toString(16).padStart(2,"0")}`,border:`1px solid ${u[l]||"#95A5A6"}30`},children:[e.jsx("div",{className:"text-xs font-medium truncate",style:{color:"#374151"},children:b[l]||l}),e.jsxs("div",{className:"text-lg font-bold",style:{color:u[l]||"#95A5A6"},children:[x,"%"]})]},l)})})]}),e.jsxs("div",{className:"p-4 rounded-lg",style:{background:"#FFFFFF",border:"1px solid #E5E5E0"},children:[e.jsx("h3",{className:"text-xs font-semibold uppercase tracking-wider mb-3",style:{color:"#6B7280"},children:"Top Element Types"}),e.jsx("div",{className:"space-y-1",children:t.topKinds.map((l,r)=>e.jsxs("div",{className:"flex items-center gap-2 text-xs",children:[e.jsx("span",{className:"w-2 h-2 rounded-full",style:{background:u[l.layer]||"#95A5A6"}}),e.jsx("span",{className:"flex-1 truncate",style:{color:"#374151"},children:l.kind}),e.jsx("span",{className:"font-medium",style:{color:"#6B7280"},children:l.count})]},`${l.kind}-${r}`))})]}),e.jsxs("div",{className:"p-4 rounded-lg",style:{background:"#FFFFFF",border:"1px solid #E5E5E0"},children:[e.jsx("h3",{className:"text-xs font-semibold uppercase tracking-wider mb-3",style:{color:"#6B7280"},children:"Relationship Types"}),e.jsxs("div",{className:"space-y-1",children:[t.relTypes.map((l,r)=>e.jsxs("div",{className:"flex items-center gap-2 text-xs",children:[e.jsx("span",{className:"w-2 h-2 rounded-full",style:{background:"#4A90D9"}}),e.jsx("span",{className:"flex-1 truncate",style:{color:"#374151"},children:l.type}),e.jsx("span",{className:"font-medium",style:{color:"#6B7280"},children:l.count})]},`${l.type}-${r}`)),t.relTypes.length===0&&e.jsx("div",{className:"text-xs",style:{color:"#9CA3AF"},children:"No relationships"})]})]})]}),n&&e.jsxs("div",{className:"mt-4 p-4 rounded-lg",style:{background:"#FFFFFF",border:"1px solid #E5E5E0"},children:[e.jsx("h3",{className:"text-xs font-semibold uppercase tracking-wider mb-3",style:{color:"#6B7280"},children:"Completeness by Layer"}),e.jsx("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-2",children:(m=n.layers)==null?void 0:m.map((l,r)=>e.jsxs("div",{className:"flex items-center gap-2 text-xs",children:[e.jsx("span",{className:"w-2 h-2 rounded-full",style:{background:u[l.layer]||"#95A5A6"}}),e.jsx("span",{className:"flex-1 truncate",style:{color:"#374151"},children:l.layer}),e.jsxs("span",{className:"font-medium",style:{color:l.completeness>=80?"#2ECC71":l.completeness>=50?"#F39C12":"#E74C3C"},children:[Math.round(l.completeness),"%"]})]},`${l.layer}-${r}`))})]})]})})}function h({label:a,value:c,color:n}){return e.jsxs("div",{className:"p-4 rounded-lg",style:{background:"#FFFFFF",border:"1px solid #E5E5E0"},children:[e.jsx("div",{className:"text-2xl font-bold",style:{color:n},children:c.toLocaleString()}),e.jsx("div",{className:"text-xs mt-0.5",style:{color:"#9CA3AF"},children:a})]})}function g({label:a,value:c,unit:n,status:t}){const i=t==="good"?"#2ECC71":t==="ok"?"#F39C12":"#E74C3C";return e.jsxs("div",{className:"p-4 rounded-lg",style:{background:"#FFFFFF",border:`1px solid ${i}30`},children:[e.jsxs("div",{className:"flex items-baseline gap-1",children:[e.jsx("span",{className:"text-lg font-bold",style:{color:i},children:c}),e.jsx("span",{className:"text-xs",style:{color:"#9CA3AF"},children:n})]}),e.jsx("div",{className:"text-xs mt-0.5",style:{color:"#6B7280"},children:a})]})}export{B as StatisticsDashboard};
@@ -1 +1 @@
1
- import{j as t}from"./reactflow-C9OlmOYw.js";import{a as x}from"./zustand-CrhqMOHB.js";import{u as w,F as j,f as L,h as T}from"./index-a2rpMs5Y.js";function R({element:l}){var f;const i=!!((f=l.attributes.description)!=null&&f.trim()),d=Object.keys(l.attributes).length,S=i&&d>=1,v=i||d>=1,p=S?"#2DD4A8":v?"#F39C12":"#E5E5E0",A=S?"Complete":v?"Partial":"Empty";return t.jsx("span",{className:"inline-block rounded-full flex-shrink-0",style:{width:8,height:8,backgroundColor:p,cursor:"default"},title:A})}function Y({col:l,sortKey:i,sortDir:d}){return l!==i?t.jsx("span",{style:{color:"#D1D5DB",fontSize:"10px",marginLeft:3},children:"⇅"}):t.jsx("span",{style:{color:"#1B3A4B",fontSize:"10px",marginLeft:3},children:d==="asc"?"↑":"↓"})}function P(){const l=w(e=>e.model),i=w(e=>e.activeView),d=w(e=>e.selectedViewpointId),S=w(e=>e.selectElement),v=w(e=>e.selectedElementId),[p,A]=x.useState("name"),[f,C]=x.useState("asc"),[E,B]=x.useState(""),[b,I]=x.useState(""),[g,M]=x.useState(""),h=x.useMemo(()=>{var n,s,o,c,r;if(!l)return[];const e=Object.values(l.elements);if(i.type==="tabular"&&i.diagramId){const a=(n=l.diagrams)==null?void 0:n.find(u=>u.id===i.diagramId);if((s=a==null?void 0:a.elementIds)!=null&&s.length){const u=new Set(a.elementIds);return e.filter(m=>u.has(m.id))}}if(d){const a=(o=l.viewpoints)==null?void 0:o.find(u=>u.id===d);if(a){const u=(c=a.visibleLayers)!=null&&c.length?new Set(a.visibleLayers):null,m=(r=a.visibleKinds)!=null&&r.length?new Set(a.visibleKinds):null;return e.filter(F=>(!u||u.has(F.layer))&&(!m||m.has(F.kind)))}}return e},[l,i,d]),k=x.useMemo(()=>{const e=new Map;for(const s of h)for(const o of Object.keys(s.attributes))o==="description"||o==="shortDescription"||e.set(o,(e.get(o)??0)+1);const n=Math.max(1,h.length*.1);return[...e.entries()].filter(([,s])=>s>=n).sort((s,o)=>o[1]-s[1]).slice(0,4).map(([s])=>s)},[h]),O=x.useMemo(()=>[...new Set(h.map(e=>e.layer))].sort(),[h]),V=x.useMemo(()=>[...new Set(h.map(e=>e.kind))].sort(),[h]),N=x.useMemo(()=>{const e=E.toLowerCase();let n=h.filter(s=>!(e&&!s.name.toLowerCase().includes(e)&&!s.kind.toLowerCase().includes(e)||b&&s.layer!==b||g&&s.kind!==g));return n.sort((s,o)=>{let c="",r="";if(p==="name")c=s.name,r=o.name;else if(p==="kind")c=s.kind,r=o.kind;else if(p==="layer")c=s.layer,r=o.layer;else if(p==="status"){const u=m=>{var z;const F=!!((z=m.attributes.description)!=null&&z.trim()),D=Object.keys(m.attributes).length>=1;return F&&D?2:F||D?1:0};c=String(u(s)),r=String(u(o))}else c=s.attributes[p]??"",r=o.attributes[p]??"";const a=c.localeCompare(r,void 0,{numeric:!0});return f==="asc"?a:-a}),n},[h,E,b,g,p,f]);function K(e){p===e?C(n=>n==="asc"?"desc":"asc"):(A(e),C("asc"))}const W=x.useMemo(()=>{var e,n;if(!l)return"";if(i.type==="tabular"&&i.diagramId){const s=(e=l.diagrams)==null?void 0:e.find(o=>o.id===i.diagramId);return s?`Diagram: ${s.name}`:"Diagram"}if(d){const s=(n=l.viewpoints)==null?void 0:n.find(o=>o.id===d);return s?`Viewpoint: ${s.label}`:"Viewpoint"}return"All Elements"},[l,i,d]),y=({col:e,label:n,width:s})=>t.jsxs("th",{onClick:()=>K(e),className:"px-3 py-2 text-left cursor-pointer select-none",style:{fontSize:"11px",fontWeight:600,color:"#374151",background:"#F7F7F5",borderBottom:"1px solid #E5E5E0",whiteSpace:"nowrap",width:s,position:"sticky",top:0,zIndex:1},children:[n,t.jsx(Y,{col:e,sortKey:p,sortDir:f})]});return t.jsxs("div",{className:"flex flex-col h-full overflow-hidden",style:{background:"#FFFFFF"},children:[t.jsxs("div",{className:"flex items-center gap-3 px-4 py-3 flex-shrink-0",style:{borderBottom:"1px solid #E5E5E0",background:"#FAFAF8"},children:[t.jsxs("div",{children:[t.jsx("div",{style:{fontSize:"13px",fontWeight:700,color:"#1B3A4B"},children:"Tabular View"}),t.jsx("div",{style:{fontSize:"11px",color:"#9CA3AF"},children:W})]}),t.jsx("div",{className:"flex-1"}),t.jsx("input",{type:"text",placeholder:"Search elements…",value:E,onChange:e=>B(e.target.value),className:"px-3 py-1.5 rounded-lg focus:outline-none",style:{width:220,fontSize:j.xs,color:"#1a1a1a",border:"1px solid #E5E5E0",background:"#FFFFFF"}}),t.jsxs("select",{value:b,onChange:e=>I(e.target.value),className:"px-2 py-1.5 rounded-lg focus:outline-none",style:{fontSize:j.xs,color:"#374151",border:"1px solid #E5E5E0",background:"#FFFFFF",cursor:"pointer"},children:[t.jsx("option",{value:"",children:"All layers"}),O.map(e=>t.jsx("option",{value:e,children:L[e]??e},e))]}),t.jsxs("select",{value:g,onChange:e=>M(e.target.value),className:"px-2 py-1.5 rounded-lg focus:outline-none",style:{fontSize:j.xs,color:"#374151",border:"1px solid #E5E5E0",background:"#FFFFFF",cursor:"pointer"},children:[t.jsx("option",{value:"",children:"All kinds"}),V.map(e=>t.jsx("option",{value:e,children:e},e))]}),t.jsxs("div",{style:{fontSize:"11px",color:"#9CA3AF",whiteSpace:"nowrap"},children:[N.length," / ",h.length," elements"]})]}),t.jsx("div",{className:"flex-1 overflow-auto",children:t.jsxs("table",{className:"w-full border-collapse",style:{tableLayout:"fixed"},children:[t.jsxs("colgroup",{children:[t.jsx("col",{style:{width:28}}),t.jsx("col",{style:{width:"30%"}}),t.jsx("col",{style:{width:"13%"}}),t.jsx("col",{style:{width:"13%"}}),t.jsx("col",{style:{width:40}}),t.jsx("col",{style:{width:"20%"}}),k.map(e=>t.jsx("col",{style:{width:"10%"}},e))]}),t.jsx("thead",{children:t.jsxs("tr",{children:[t.jsx("th",{style:{background:"#F7F7F5",borderBottom:"1px solid #E5E5E0",position:"sticky",top:0,zIndex:1}}),t.jsx(y,{col:"name",label:"Name"}),t.jsx(y,{col:"kind",label:"Kind"}),t.jsx(y,{col:"layer",label:"Layer"}),t.jsx(y,{col:"status",label:"",width:40}),t.jsx(y,{col:"shortDescription",label:"Short description"}),k.map(e=>t.jsx(y,{col:e,label:e},e))]})}),t.jsxs("tbody",{children:[N.length===0&&t.jsx("tr",{children:t.jsx("td",{colSpan:6+k.length,className:"py-16 text-center",style:{fontSize:"13px",color:"#9CA3AF"},children:E||b||g?"No elements match the current filters":"No elements in scope"})}),N.map(e=>{var c;const n=e.id===v,s=T[e.layer]??"#9CA3AF",o=((c=e.attributes.shortDescription)==null?void 0:c.trim())??"";return t.jsxs("tr",{onClick:()=>S(e.id),className:"cursor-pointer",style:{background:n?"#2DD4A812":"transparent",borderBottom:"1px solid #F0F0ED"},onMouseEnter:r=>{n||(r.currentTarget.style.background="#F7F7F5")},onMouseLeave:r=>{n||(r.currentTarget.style.background="transparent")},children:[t.jsx("td",{className:"px-2",children:n&&t.jsx("span",{style:{color:"#2DD4A8",fontSize:"10px"},children:"▶"})}),t.jsxs("td",{className:"px-3 py-2",children:[t.jsx("div",{style:{fontSize:j.xs,fontWeight:500,color:"#1B3A4B",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:e.name}),e.shortId&&t.jsx("div",{style:{fontSize:"10px",color:"#9CA3AF",fontFamily:"monospace"},children:e.shortId})]}),t.jsx("td",{className:"px-3 py-2",children:t.jsx("span",{style:{fontSize:"10px",fontWeight:600,color:"#374151"},children:e.kind})}),t.jsx("td",{className:"px-3 py-2",children:t.jsx("span",{className:"px-1.5 py-0.5 rounded",style:{fontSize:"10px",fontWeight:600,background:s+"1A",color:s,whiteSpace:"nowrap"},children:L[e.layer]??e.layer})}),t.jsx("td",{className:"px-3 py-2 text-center",children:t.jsx(R,{element:e})}),t.jsx("td",{className:"px-3 py-2",children:t.jsx("span",{style:{fontSize:j.xs,color:"#6B7280",display:"-webkit-box",WebkitLineClamp:2,WebkitBoxOrient:"vertical",overflow:"hidden"},children:o})}),k.map(r=>t.jsx("td",{className:"px-3 py-2",children:t.jsx("span",{style:{fontSize:j.xs,color:"#374151",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",display:"block"},children:e.attributes[r]??""})},r))]},e.id)})]})]})})]})}export{P as TabularView};
1
+ import{j as t}from"./reactflow-C9OlmOYw.js";import{a as x}from"./zustand-CrhqMOHB.js";import{u as w,F as j,f as L,h as T}from"./index-DEVvBtNh.js";function R({element:l}){var f;const i=!!((f=l.attributes.description)!=null&&f.trim()),d=Object.keys(l.attributes).length,S=i&&d>=1,v=i||d>=1,p=S?"#2DD4A8":v?"#F39C12":"#E5E5E0",A=S?"Complete":v?"Partial":"Empty";return t.jsx("span",{className:"inline-block rounded-full flex-shrink-0",style:{width:8,height:8,backgroundColor:p,cursor:"default"},title:A})}function Y({col:l,sortKey:i,sortDir:d}){return l!==i?t.jsx("span",{style:{color:"#D1D5DB",fontSize:"10px",marginLeft:3},children:"⇅"}):t.jsx("span",{style:{color:"#1B3A4B",fontSize:"10px",marginLeft:3},children:d==="asc"?"↑":"↓"})}function P(){const l=w(e=>e.model),i=w(e=>e.activeView),d=w(e=>e.selectedViewpointId),S=w(e=>e.selectElement),v=w(e=>e.selectedElementId),[p,A]=x.useState("name"),[f,C]=x.useState("asc"),[E,B]=x.useState(""),[b,I]=x.useState(""),[g,M]=x.useState(""),h=x.useMemo(()=>{var n,s,o,c,r;if(!l)return[];const e=Object.values(l.elements);if(i.type==="tabular"&&i.diagramId){const a=(n=l.diagrams)==null?void 0:n.find(u=>u.id===i.diagramId);if((s=a==null?void 0:a.elementIds)!=null&&s.length){const u=new Set(a.elementIds);return e.filter(m=>u.has(m.id))}}if(d){const a=(o=l.viewpoints)==null?void 0:o.find(u=>u.id===d);if(a){const u=(c=a.visibleLayers)!=null&&c.length?new Set(a.visibleLayers):null,m=(r=a.visibleKinds)!=null&&r.length?new Set(a.visibleKinds):null;return e.filter(F=>(!u||u.has(F.layer))&&(!m||m.has(F.kind)))}}return e},[l,i,d]),k=x.useMemo(()=>{const e=new Map;for(const s of h)for(const o of Object.keys(s.attributes))o==="description"||o==="shortDescription"||e.set(o,(e.get(o)??0)+1);const n=Math.max(1,h.length*.1);return[...e.entries()].filter(([,s])=>s>=n).sort((s,o)=>o[1]-s[1]).slice(0,4).map(([s])=>s)},[h]),O=x.useMemo(()=>[...new Set(h.map(e=>e.layer))].sort(),[h]),V=x.useMemo(()=>[...new Set(h.map(e=>e.kind))].sort(),[h]),N=x.useMemo(()=>{const e=E.toLowerCase();let n=h.filter(s=>!(e&&!s.name.toLowerCase().includes(e)&&!s.kind.toLowerCase().includes(e)||b&&s.layer!==b||g&&s.kind!==g));return n.sort((s,o)=>{let c="",r="";if(p==="name")c=s.name,r=o.name;else if(p==="kind")c=s.kind,r=o.kind;else if(p==="layer")c=s.layer,r=o.layer;else if(p==="status"){const u=m=>{var z;const F=!!((z=m.attributes.description)!=null&&z.trim()),D=Object.keys(m.attributes).length>=1;return F&&D?2:F||D?1:0};c=String(u(s)),r=String(u(o))}else c=s.attributes[p]??"",r=o.attributes[p]??"";const a=c.localeCompare(r,void 0,{numeric:!0});return f==="asc"?a:-a}),n},[h,E,b,g,p,f]);function K(e){p===e?C(n=>n==="asc"?"desc":"asc"):(A(e),C("asc"))}const W=x.useMemo(()=>{var e,n;if(!l)return"";if(i.type==="tabular"&&i.diagramId){const s=(e=l.diagrams)==null?void 0:e.find(o=>o.id===i.diagramId);return s?`Diagram: ${s.name}`:"Diagram"}if(d){const s=(n=l.viewpoints)==null?void 0:n.find(o=>o.id===d);return s?`Viewpoint: ${s.label}`:"Viewpoint"}return"All Elements"},[l,i,d]),y=({col:e,label:n,width:s})=>t.jsxs("th",{onClick:()=>K(e),className:"px-3 py-2 text-left cursor-pointer select-none",style:{fontSize:"11px",fontWeight:600,color:"#374151",background:"#F7F7F5",borderBottom:"1px solid #E5E5E0",whiteSpace:"nowrap",width:s,position:"sticky",top:0,zIndex:1},children:[n,t.jsx(Y,{col:e,sortKey:p,sortDir:f})]});return t.jsxs("div",{className:"flex flex-col h-full overflow-hidden",style:{background:"#FFFFFF"},children:[t.jsxs("div",{className:"flex items-center gap-3 px-4 py-3 flex-shrink-0",style:{borderBottom:"1px solid #E5E5E0",background:"#FAFAF8"},children:[t.jsxs("div",{children:[t.jsx("div",{style:{fontSize:"13px",fontWeight:700,color:"#1B3A4B"},children:"Tabular View"}),t.jsx("div",{style:{fontSize:"11px",color:"#9CA3AF"},children:W})]}),t.jsx("div",{className:"flex-1"}),t.jsx("input",{type:"text",placeholder:"Search elements…",value:E,onChange:e=>B(e.target.value),className:"px-3 py-1.5 rounded-lg focus:outline-none",style:{width:220,fontSize:j.xs,color:"#1a1a1a",border:"1px solid #E5E5E0",background:"#FFFFFF"}}),t.jsxs("select",{value:b,onChange:e=>I(e.target.value),className:"px-2 py-1.5 rounded-lg focus:outline-none",style:{fontSize:j.xs,color:"#374151",border:"1px solid #E5E5E0",background:"#FFFFFF",cursor:"pointer"},children:[t.jsx("option",{value:"",children:"All layers"}),O.map(e=>t.jsx("option",{value:e,children:L[e]??e},e))]}),t.jsxs("select",{value:g,onChange:e=>M(e.target.value),className:"px-2 py-1.5 rounded-lg focus:outline-none",style:{fontSize:j.xs,color:"#374151",border:"1px solid #E5E5E0",background:"#FFFFFF",cursor:"pointer"},children:[t.jsx("option",{value:"",children:"All kinds"}),V.map(e=>t.jsx("option",{value:e,children:e},e))]}),t.jsxs("div",{style:{fontSize:"11px",color:"#9CA3AF",whiteSpace:"nowrap"},children:[N.length," / ",h.length," elements"]})]}),t.jsx("div",{className:"flex-1 overflow-auto",children:t.jsxs("table",{className:"w-full border-collapse",style:{tableLayout:"fixed"},children:[t.jsxs("colgroup",{children:[t.jsx("col",{style:{width:28}}),t.jsx("col",{style:{width:"30%"}}),t.jsx("col",{style:{width:"13%"}}),t.jsx("col",{style:{width:"13%"}}),t.jsx("col",{style:{width:40}}),t.jsx("col",{style:{width:"20%"}}),k.map(e=>t.jsx("col",{style:{width:"10%"}},e))]}),t.jsx("thead",{children:t.jsxs("tr",{children:[t.jsx("th",{style:{background:"#F7F7F5",borderBottom:"1px solid #E5E5E0",position:"sticky",top:0,zIndex:1}}),t.jsx(y,{col:"name",label:"Name"}),t.jsx(y,{col:"kind",label:"Kind"}),t.jsx(y,{col:"layer",label:"Layer"}),t.jsx(y,{col:"status",label:"",width:40}),t.jsx(y,{col:"shortDescription",label:"Short description"}),k.map(e=>t.jsx(y,{col:e,label:e},e))]})}),t.jsxs("tbody",{children:[N.length===0&&t.jsx("tr",{children:t.jsx("td",{colSpan:6+k.length,className:"py-16 text-center",style:{fontSize:"13px",color:"#9CA3AF"},children:E||b||g?"No elements match the current filters":"No elements in scope"})}),N.map(e=>{var c;const n=e.id===v,s=T[e.layer]??"#9CA3AF",o=((c=e.attributes.shortDescription)==null?void 0:c.trim())??"";return t.jsxs("tr",{onClick:()=>S(e.id),className:"cursor-pointer",style:{background:n?"#2DD4A812":"transparent",borderBottom:"1px solid #F0F0ED"},onMouseEnter:r=>{n||(r.currentTarget.style.background="#F7F7F5")},onMouseLeave:r=>{n||(r.currentTarget.style.background="transparent")},children:[t.jsx("td",{className:"px-2",children:n&&t.jsx("span",{style:{color:"#2DD4A8",fontSize:"10px"},children:"▶"})}),t.jsxs("td",{className:"px-3 py-2",children:[t.jsx("div",{style:{fontSize:j.xs,fontWeight:500,color:"#1B3A4B",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:e.name}),e.shortId&&t.jsx("div",{style:{fontSize:"10px",color:"#9CA3AF",fontFamily:"monospace"},children:e.shortId})]}),t.jsx("td",{className:"px-3 py-2",children:t.jsx("span",{style:{fontSize:"10px",fontWeight:600,color:"#374151"},children:e.kind})}),t.jsx("td",{className:"px-3 py-2",children:t.jsx("span",{className:"px-1.5 py-0.5 rounded",style:{fontSize:"10px",fontWeight:600,background:s+"1A",color:s,whiteSpace:"nowrap"},children:L[e.layer]??e.layer})}),t.jsx("td",{className:"px-3 py-2 text-center",children:t.jsx(R,{element:e})}),t.jsx("td",{className:"px-3 py-2",children:t.jsx("span",{style:{fontSize:j.xs,color:"#6B7280",display:"-webkit-box",WebkitLineClamp:2,WebkitBoxOrient:"vertical",overflow:"hidden"},children:o})}),k.map(r=>t.jsx("td",{className:"px-3 py-2",children:t.jsx("span",{style:{fontSize:j.xs,color:"#374151",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",display:"block"},children:e.attributes[r]??""})},r))]},e.id)})]})]})})]})}export{P as TabularView};
@@ -0,0 +1,3 @@
1
+ import{j as s}from"./reactflow-C9OlmOYw.js";import{a as i}from"./zustand-CrhqMOHB.js";import{u as k,i as We,k as He,j as ne,r as ke,F as R,C as r,T as Ge}from"./index-DEVvBtNh.js";import{l as Qe,e as Ce,s as ve,c as Ue,a as Ve,b as je,r as Ye,A as Te,T as Re,H as Ze}from"./DSMView-BsjhUbpW.js";import{a as Je,I as oe}from"./DiagramToolbarControls-XMGLx08e.js";const Xe=[{id:"risk-control",label:"ISO 14971: Risk → Control",description:"Hazards and hazardous situations traced to risk controls",rowKinds:["Hazard","HazardousSituation"],columnKinds:["RiskControlMeasure","SafetyGoal"],linkTypes:["mitigates","tracesRisk","causes","leadsTo"]},{id:"req-test",label:"IEC 62304: Requirement → Test",description:"Software requirements traced to verification tests",rowKinds:["Requirement","SoftwareRequirement","SystemRequirement"],columnKinds:["Test","TestCase","VerificationCase","VerificationActivity"],linkTypes:["verifiedBy","satisfiedBy","validates"]},{id:"req-function",label:"Requirement → Function",description:"Requirements traced to the functions that satisfy them",rowKinds:["Requirement","SystemRequirement"],columnKinds:["Function","SystemFunction","ComponentFunction"],linkTypes:["satisfiedBy","derivesFrom"]},{id:"function-component",label:"Function → Component",description:"Functions allocated to logical and physical components",rowKinds:["Function","SystemFunction","ComponentFunction"],columnKinds:["LogicalComponent","SoftwareModule","MechanicalPart","Component"],linkTypes:["allocatedTo","realizes"]},{id:"everything",label:"Everything",description:"Every element against every element, every relationship",rowKinds:[],columnKinds:[],linkTypes:[]}];function it(){var Se;const o=k(e=>e.model),f=k(e=>e.connected),v=k(e=>e.selectElement),Fe=k(e=>e.selectedElementId),se=k(e=>e.selectedDiagramId),ie=k(e=>e.createRelationship),re=k(e=>e.deleteRelationship),[b,O]=i.useState({}),[w,z]=i.useState({}),[E,W]=i.useState([]),[F,H]=i.useState([]),[x,G]=i.useState([]),[Q,Ie]=i.useState("natural"),[U,Me]=i.useState("natural"),[ae,le]=i.useState(null),[Oe,ze]=i.useState("top"),[h,$e]=i.useState(!1),[de,Ae]=i.useState(39),[Le,_e]=i.useState(!0),[ce,V]=i.useState(new Set),[pe,Y]=i.useState(new Set),[l,$]=i.useState(null),[A,j]=i.useState(null),[L,ue]=i.useState(""),[D,K]=i.useState(!1),S=i.useMemo(()=>We(o),[o]),me=i.useMemo(()=>o?Qe(o):[],[o]),fe=k(e=>e.availableOntologies),g=i.useMemo(()=>He(fe),[fe]),Z=i.useMemo(()=>Ce(o,b,g),[o,b,g]),J=i.useMemo(()=>Ce(o,w,g),[o,w,g]),N=i.useMemo(()=>ve(b,o,g),[b,o,g]),B=i.useMemo(()=>ve(w,o,g),[w,o,g]),X=i.useMemo(()=>{if(!o||!S)return[];const e=(a,m,C,y)=>(!m.layer||a.layer===m.layer)&&(C.length===0||C.includes(a.kind))&&(y.length===0||y.includes(a.id)),t=Object.values(o.elements).filter(a=>e(a,b,N,E)),n=Object.values(o.elements).filter(a=>e(a,w,B,F)),d=new Set;for(const a of t)for(const m of n)if(a.id!==m.id)for(const C of ne(a,m,S))d.add(C.definition.name);const p=new Map;for(const a of o.relationships)p.set(a.type,(p.get(a.type)??0)+1);return[...d].sort().map(a=>({value:a,hint:String(p.get(a)??0),color:ke(a)}))},[o,S,b,w,N,B,E,F]);i.useEffect(()=>{const e=new Set(Z.map(t=>t.value));W(t=>t.every(n=>e.has(n))?t:t.filter(n=>e.has(n)))},[Z]),i.useEffect(()=>{const e=new Set(J.map(t=>t.value));H(t=>t.every(n=>e.has(n))?t:t.filter(n=>e.has(n)))},[J]),i.useEffect(()=>{const e=new Set(X.map(t=>t.value));G(t=>t.every(n=>e.has(n))?t:t.filter(n=>e.has(n)))},[X]);const c=i.useMemo(()=>o?Ue(o,{rows:{layer:b.layer,kinds:N,elementIds:E,expanded:ce,ordering:Q},columns:{layer:w.layer,kinds:B,elementIds:F,expanded:pe,ordering:U},dependencyTypes:x,symmetric:!0}):null,[o,b,w,N,B,E,F,x,Q,U,ce,pe]),[P,De]=i.useState(!1);i.useEffect(()=>{if(P||!o)return;const e=Ve(o);e.rows&&(O({layer:e.rows}),z({layer:e.columns}),De(!0))},[o,P]);const[xe,Ke]=i.useState(!1);i.useEffect(()=>{if(xe||!P||!c)return;const e=c.rowRoots.filter(n=>n.children.length>0).map(n=>n.id),t=c.columnRoots.filter(n=>n.children.length>0).map(n=>n.id);e.length===0&&t.length===0||(V(new Set(e)),Y(new Set(t)),Ke(!0))},[c,P,xe]);const T=i.useCallback((e,t)=>{e==="rows"?V(t):Y(t)},[]),he=i.useCallback(e=>{c&&T(e,new Set(je(e==="rows"?c.rowRoots:c.columnRoots)))},[c,T]),ge=i.useCallback(e=>T(e,new Set),[T]),ye=i.useCallback((e,t)=>{c&&T(e,new Set(je(e==="rows"?c.rowRoots:c.columnRoots,t)))},[c,T]),_=i.useCallback(e=>{if(!o)return null;for(const t of e){const n=Object.values(o.elements).find(d=>d.kind===t);if(n)return{layer:n.layer,kind:t}}return null},[o]),Ne=i.useCallback(e=>{const t=new Set(o?Ye(o):[]),n=_(e.rowKinds),d=_(e.columnKinds);e.id==="everything"?(O({}),z({})):(n&&O(n),d&&z(d)),G(e.linkTypes.filter(p=>t.has(p))),W([]),H([]),$(null)},[o,_]),be=i.useMemo(()=>{var p;if(!o||!l)return[];const e=l.row.node.id,t=l.column.node.id;if(l.row.node.children.length===0&&l.column.node.children.length===0){const a=new Set(x);return o.relationships.filter(m=>(a.size===0||a.has(m.type))&&(m.sourceId===e&&m.targetId===t||m.sourceId===t&&m.targetId===e))}const d=new Set(((p=l.cell)==null?void 0:p.relationshipIds)??[]);return o.relationships.filter(a=>d.has(a.id))},[o,l,x]),I=i.useMemo(()=>{if(!o||!l||!S)return[];const e=o.elements[l.row.node.id],t=o.elements[l.column.node.id];return!e||!t||e.id===t.id?[]:ne(e,t,S)},[o,l,S]),q=i.useMemo(()=>{const e=new Set;for(const t of x)e.add(t),e.add(t.charAt(0).toUpperCase()+t.slice(1));return e},[x]),we=i.useMemo(()=>{const e=L.trim().toLowerCase();return I.filter(t=>!e||t.definition.name.toLowerCase().includes(e)).sort((t,n)=>{const d=Number(q.has(n.definition.name))-Number(q.has(t.definition.name));return d!==0?d:t.definition.name.localeCompare(n.definition.name)})},[I,L,q]),Be=!!(l&&l.row.node.isElement&&l.column.node.isElement&&!l.row.expanded&&!l.column.expanded&&l.row.node.children.length===0&&l.column.node.children.length===0),ee=i.useCallback(async e=>{K(!0),j(null);const t=await ie({type:e.definition.name,sourceId:e.sourceId,targetId:e.targetId,direction:e.direction,diagramId:se??void 0});K(!1),j(t.success?{kind:"ok",message:`Trace written to ${t.sourceFile??"the model"}.`}:{kind:"error",message:t.error??"The trace could not be created."})},[ie,se]),te=i.useCallback(async e=>{K(!0),j(null);const t=await re(e);K(!1),j(t.success?{kind:"ok",message:`Trace removed from ${t.sourceFile??"the model"}.`}:{kind:"error",message:t.error??"The trace could not be removed."})},[re]),Pe=i.useCallback(async(e,t,n)=>{if(!h||!f||!o||!S||!e.node.isElement||!t.node.isElement||e.node.children.length>0||t.node.children.length>0||e.node.id===t.node.id||x.length!==1)return;const d=x[0],p=o.relationships.find(y=>y.type===d&&(y.sourceId===e.node.id&&y.targetId===t.node.id||y.sourceId===t.node.id&&y.targetId===e.node.id));if(p){if(p.named===!1){j({kind:"error",message:"This trace has no declared name, so it cannot be removed until it is named in SysML."});return}await te(p.id);return}const a=o.elements[e.node.id],m=o.elements[t.node.id];if(!a||!m)return;const C=ne(a,m,S).find(y=>y.definition.name===d);if(!C){j({kind:"error",message:`${d} is not legal between these element types.`});return}await ee(C)},[h,f,o,S,x,ee,te]),qe=i.useCallback((e,t,n)=>{if(e!=null&&e.diagonal)return{};if(e){const p="#65A30D",a=Math.min(.14+e.strength*.13,.55);return{text:e.strength===1?"✓":String(e.strength),color:p,background:`${p}${Math.round(a*255).toString(16).padStart(2,"0")}`,title:`${t.node.name} ↔ ${n.node.name}
2
+ ${e.types.join(", ")}${h?`
3
+ Click to inspect or remove`:""}`}}return h?t.node.isElement&&n.node.isElement&&t.node.children.length===0&&n.node.children.length===0&&t.node.id!==n.node.id?{actionable:!0,title:`Click to trace ${t.node.name} → ${n.node.name}`}:{}:{}},[h]),M=i.useMemo(()=>{if(!c)return{traced:0,total:0};const e=c.rows.filter(n=>n.node.children.length===0);return{traced:e.filter(n=>{const d=c.rows.indexOf(n);return c.matrix[d].some(p=>p&&!p.diagonal)}).length,total:e.length}},[c]);if(!o||!c)return s.jsx("div",{className:"flex-1 flex items-center justify-center",style:{color:r.faint,fontSize:R.sm},children:"No model loaded"});const u=Oe==="left";return s.jsxs("div",{className:"flex-1 flex flex-col overflow-hidden",style:{background:"#FAFAF8",position:"relative"},children:[s.jsxs("div",{style:u?{position:"absolute",inset:"0 auto 0 0",width:"250px",zIndex:30,overflow:"auto",borderRight:`1px solid ${r.border}`,background:r.surface}:{borderBottom:`1px solid ${r.border}`,background:r.surface,position:"relative"},children:[s.jsxs("div",{className:"flex items-center gap-3 px-4 py-2",style:u?{flexDirection:"column",alignItems:"stretch",position:"relative",paddingTop:"54px"}:{flexWrap:"wrap",position:"relative",paddingRight:"52px"},children:[s.jsx("span",{style:{position:"absolute",top:"9px",right:"12px"},children:s.jsx(Je,{icon:u?s.jsx(oe.arrowUp,{}):s.jsx(oe.panelCollapse,{}),onClick:()=>ze(e=>e==="top"?"left":"top"),title:u?"Move toolbar to top":"Move toolbar to left"})}),s.jsx(Te,{axis:"rows",layers:me,scope:b,onScopeChange:O,elements:E,onElementsChange:W,elementOptions:Z,ordering:Q,onOrderingChange:Ie,onExpandAll:he,onCollapseAll:ge,onExpandToDepth:ye,leftDock:u,filterOpen:ae==="rows",onFilterOpenChange:e=>le(e?"rows":null),parentOf:new Map,kindParents:g}),s.jsx(Te,{axis:"columns",layers:me,scope:w,onScopeChange:z,elements:F,onElementsChange:H,elementOptions:J,ordering:U,onOrderingChange:Me,onExpandAll:he,onCollapseAll:ge,onExpandToDepth:ye,leftDock:u,filterOpen:ae==="columns",onFilterOpenChange:e=>le(e?"columns":null),parentOf:new Map,kindParents:g}),s.jsxs("div",{style:{display:"grid",gridTemplateColumns:u?"1fr":"max-content max-content max-content",gridTemplateRows:"auto auto",alignItems:"center",columnGap:"10px",rowGap:"5px",padding:"6px 8px",border:`1px solid ${r.border}`,borderRadius:"9px",background:"#FAFBFC"},children:[s.jsx(Re,{label:s.jsxs(s.Fragment,{children:[s.jsx(oe.filter,{})," Relations"]}),ariaLabel:"Filter trace relationships",title:"Relationships counted as trace",width:u?210:260,fullWidth:u,children:s.jsx(Ge,{label:"Trace relationships",allLabel:"Any relationship",options:X,selected:x,onChange:G,title:"Relationships counted as trace"})}),s.jsx(Re,{label:"Presets",ariaLabel:"Traceability presets",title:"Choose a traceability starting point",width:u?210:270,fullWidth:u,children:Xe.map(e=>s.jsx("button",{onClick:()=>Ne(e),title:e.description,style:{padding:"6px 7px",border:"none",borderRadius:"5px",background:"transparent",cursor:"pointer",fontSize:R.xs,color:r.primary,textAlign:"left"},children:e.label},e.id))}),s.jsxs("label",{title:f?"Click cells to add or remove trace links. Only leaf-to-leaf cells can be edited.":"The dev server is unreachable, so nothing can be written to the model.",style:{display:"flex",alignItems:"center",gap:"6px",fontSize:R.xs,width:u?"100%":void 0,boxSizing:"border-box",padding:"3px 9px",borderRadius:"5px",border:`1px solid ${h?r.accent:r.border}`,background:h?"#E8F8F3":r.surface,color:f?r.primary:r.faint,cursor:f?"pointer":"not-allowed",fontWeight:600},children:[s.jsx("input",{type:"checkbox",checked:h,disabled:!f,onChange:e=>{$e(e.target.checked),$(null)},style:{accentColor:r.accent}}),"Edit trace"]}),s.jsxs("label",{style:{gridColumn:"1 / -1",display:"flex",alignItems:"center",gap:"5px",fontSize:R.xs,color:r.muted,justifyContent:u?"center":void 0},title:"Cell size",children:["Zoom",s.jsx("input",{type:"range",min:14,max:44,step:2,value:de,onChange:e=>Ae(Number(e.target.value)),style:{width:"80px",accentColor:r.accent}})]})]})]}),A&&s.jsx("div",{style:{padding:"5px 16px",fontSize:"11px",color:A.kind==="ok"?"#0F766E":"#B91C1C",background:A.kind==="ok"?"#ECFDF5":"#FEF2F2",borderTop:`1px solid ${r.borderLight}`},children:A.message})]}),s.jsx("div",{style:{display:"flex",flex:1,minHeight:0,minWidth:0,marginLeft:u?"250px":0,width:u?"calc(100% - 250px)":void 0},children:s.jsx(Ze,{result:c,onToggleRow:e=>V(t=>Ee(t,e)),onToggleColumn:e=>Y(t=>Ee(t,e)),onSelectElement:v,selectedElementId:Fe,renderCell:qe,onCellClick:(e,t,n)=>{$({row:e,column:t,cell:n}),ue("")},onCellDoubleClick:(e,t,n)=>{Pe(e,t,n)},cellSize:de,showColumnNames:Le,cornerHeader:s.jsxs("div",{style:{display:"flex",flexDirection:"column",justifyContent:"flex-end",height:"100%"},children:[s.jsx("span",{style:{fontSize:R.sm,fontWeight:600,color:r.primary},children:"Traceability Matrix"}),s.jsxs("span",{style:{fontSize:"11px",color:r.faint,marginTop:"2px"},children:[c.totalDependencies," link",c.totalDependencies===1?"":"s"," shown",M.total>0&&` · ${M.traced}/${M.total} rows traced (${Math.round(M.traced/M.total*100)}%)`]})]})})}),l&&s.jsxs("div",{style:{position:"fixed",bottom:"76px",right:"20px",zIndex:100,width:"330px",maxHeight:"52vh",overflowY:"auto",padding:"12px 14px",borderRadius:"9px",background:r.surface,border:`1px solid ${r.border}`,boxShadow:"0 6px 22px rgba(0,0,0,0.14)",fontSize:R.xs},children:[s.jsxs("div",{className:"flex items-start justify-between gap-2",children:[s.jsxs("div",{style:{fontWeight:600,color:r.primary},children:[l.row.node.name," ","↔"," ",l.column.node.name]}),s.jsx("button",{onClick:()=>$(null),style:{color:r.faint,background:"none",border:"none",cursor:"pointer"},children:"✕"})]}),be.length>0?s.jsx("div",{style:{marginTop:"9px",display:"flex",flexDirection:"column",gap:"5px"},children:be.map(e=>{var t,n;return s.jsxs("div",{className:"flex items-center justify-between gap-2",style:{padding:"4px 6px",borderRadius:"5px",background:r.surfaceAlt},children:[s.jsx("span",{style:{color:ke(e.type),fontWeight:500},children:e.type}),s.jsxs("span",{style:{flex:1,color:r.faint,fontSize:"10px",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:[((t=o.elements[e.sourceId])==null?void 0:t.name)??e.sourceId," ","→"," ",((n=o.elements[e.targetId])==null?void 0:n.name)??e.targetId]}),h&&s.jsx("button",{disabled:D||e.named===!1,onClick:()=>void te(e.id),title:e.named===!1?"This connection has no declared name, so it cannot be addressed for deletion. Name it in the source first.":"Remove this trace link",style:{fontSize:"10px",padding:"1px 6px",borderRadius:"4px",border:"1px solid #FCA5A5",background:"#FEF2F2",color:"#B91C1C",cursor:D||e.named===!1?"not-allowed":"pointer",opacity:e.named===!1?.5:1},children:"Remove"})]},e.id)})}):s.jsx("div",{style:{marginTop:"8px",color:r.muted},children:"No trace between these two."}),((Se=l.cell)==null?void 0:Se.aggregated)&&s.jsx("div",{style:{marginTop:"8px",fontSize:"11px",color:r.faint},children:"This mark sums a collapsed subsystem. Expand both sides to edit individual links."}),h&&s.jsxs("div",{style:{marginTop:"11px",borderTop:`1px solid ${r.borderLight}`,paddingTop:"9px"},children:[s.jsx("div",{style:{fontSize:"11px",color:r.muted,marginBottom:"6px"},children:"Add a trace link"}),Be?I.length===0?s.jsxs("div",{style:{fontSize:"11px",color:r.faint},children:["The ontology allows no relationship between ",l.row.node.kind," and ",l.column.node.kind,"."]}):s.jsxs(s.Fragment,{children:[I.length>8&&s.jsx("input",{value:L,onChange:e=>ue(e.target.value),placeholder:`Filter ${I.length} legal types…`,"aria-label":"Filter link types",style:{width:"100%",marginBottom:"7px",padding:"4px 7px",border:`1px solid ${r.border}`,borderRadius:"5px",fontSize:"11px",outline:"none",color:r.primary}}),s.jsxs("div",{style:{display:"flex",flexWrap:"wrap",gap:"5px"},children:[we.map(e=>{var n,d;const t=q.has(e.definition.name);return s.jsxs("button",{disabled:D,onClick:()=>void ee(e),title:`${((n=o.elements[e.sourceId])==null?void 0:n.name)??e.sourceId} → ${((d=o.elements[e.targetId])==null?void 0:d.name)??e.targetId}`,style:{fontSize:"11px",padding:"3px 8px",borderRadius:"5px",border:`1px solid ${t?r.accent:r.border}`,background:t?"#E8F8F3":r.surface,color:r.primary,cursor:D?"wait":"pointer",fontWeight:t?600:400},children:[e.definition.name,s.jsx("span",{style:{color:r.faint,marginLeft:"4px"},children:e.direction==="outgoing"?"→":"←"})]},`${e.definition.name}-${e.direction}`)}),we.length===0&&s.jsxs("span",{style:{fontSize:"11px",color:r.faint},children:["No legal type matches ","“",L,"”","."]})]})]}):s.jsx("div",{style:{fontSize:"11px",color:r.faint},children:"Both sides must be individual elements. Expand the subsystems first."})]})]})]})}function Ee(o,f){const v=new Set(o);return v.has(f)?v.delete(f):v.add(f),v}export{it as TraceabilityMatrix};
@@ -0,0 +1 @@
1
+ import{j as n}from"./reactflow-C9OlmOYw.js";import{a as f}from"./zustand-CrhqMOHB.js";import{u as v,E as Ee,F as We,M as Ke,O as He,Q as je,U as Ce,V as Oe}from"./index-DEVvBtNh.js";import{l as Ge,c as Xe,a as Ie,E as pe,S as Ye,b as qe}from"./ExplorerTreeRow-DG8T31JS.js";import{b as se,I as D,T as Ve,c as Je,a as ke}from"./DiagramToolbarControls-XMGLx08e.js";const Qe=(r,s,a=.006)=>s.x>=r.x-a&&s.y>=r.y-a&&s.x+s.width<=r.x+r.width+a&&s.y+s.height<=r.y+r.height+a;function Ze(r){const{data:s,width:a,height:d}=r;if(a<8||d<8||s.length<a*d*4)return[];const u=new Uint8Array(a*d);for(let h=0;h<u.length;h++){const p=h*4;u[h]=Math.round(s[p]*.299+s[p+1]*.587+s[p+2]*.114)}const c=new Uint8Array(a*d);for(let h=1;h<d-1;h++)for(let p=1;p<a-1;p++){const g=h*a+p,j=Math.abs(u[g+1]-u[g-1]),F=Math.abs(u[g+a]-u[g-a]);if(j+F>=42)for(let E=-1;E<=1;E++)for(let k=-1;k<=1;k++)c[g+E*a+k]=1}const m=new Uint8Array(a*d),C=[],$=[];for(let h=0;h<c.length;h++){if(!c[h]||m[h])continue;m[h]=1,$.push(h);let p=a,g=d,j=0,F=0,E=0;for(;$.length;){const V=$.pop(),W=V%a,B=Math.floor(V/a);p=Math.min(p,W),j=Math.max(j,W),g=Math.min(g,B),F=Math.max(F,B),E++;for(let A=-1;A<=1;A++)for(let R=-1;R<=1;R++){if(!R&&!A)continue;const U=W+R,J=B+A;if(U<0||J<0||U>=a||J>=d)continue;const I=J*a+U;c[I]&&!m[I]&&(m[I]=1,$.push(I))}}const k=j-p+1,G=F-g+1,w={x:p/a,y:g/d,width:k/a,height:G/d},X=w.width*w.height;if(w.width<.07||w.height<.035||X<.004||X>.93)continue;const Y=Math.max(1,2*k+2*G),q=Math.max(.45,Math.min(.96,E/Y));C.push({rect:w,confidence:q})}const T=[];for(const h of C.sort((p,g)=>g.confidence-p.confidence||g.rect.width*g.rect.height-p.rect.width*p.rect.height))if(T.some(g=>{const j=Math.abs(g.rect.x-h.rect.x),F=Math.abs(g.rect.y-h.rect.y),E=Math.abs(g.rect.width-h.rect.width),k=Math.abs(g.rect.height-h.rect.height);return j+F+E+k<.035})||T.push(h),T.length>=24)break;const N=T.sort((h,p)=>p.rect.width*p.rect.height-h.rect.width*h.rect.height);return N.map((h,p)=>{let g,j=1/0;for(let F=0;F<N.length;F++){if(F===p||!Qe(N[F].rect,h.rect))continue;const E=N[F].rect.width*N[F].rect.height,k=h.rect.width*h.rect.height;E>k*1.08&&E<j&&(g=F,j=E)}return{bounds:h.rect,confidence:h.confidence,parentIndex:g}})}async function et(r){const s=new Image;s.decoding="async",s.src=r,await s.decode();const a=Math.min(1,640/Math.max(s.naturalWidth,s.naturalHeight)),d=Math.max(1,Math.round(s.naturalWidth*a)),u=Math.max(1,Math.round(s.naturalHeight*a)),c=document.createElement("canvas");c.width=d,c.height=u;const m=c.getContext("2d",{willReadFrequently:!0});return m?(m.drawImage(s,0,0,d,u),Ze(m.getImageData(0,0,d,u))):[]}const De="memo-uiscreens-width",ae=250,ce=200,de=600;function tt(){if(typeof window>"u")return ae;try{const r=Number.parseInt(localStorage.getItem(De)??"",10);return Number.isFinite(r)?Math.min(de,Math.max(ce,r)):ae}catch{return ae}}function nt(r){var d;const s=[],a=[];for(const u of r){const c=(d=u.attributes)==null?void 0:d.elementPackage;if(!c){a.push(u);continue}const m=s.find(C=>C.name===c);m?m.members.push(u):s.push({name:c,members:[u]})}return{groups:s,ungrouped:a}}const Me=r=>({"bounds.x":String(Number(r.x.toFixed(5))),"bounds.y":String(Number(r.y.toFixed(5))),"bounds.width":String(Number(r.width.toFixed(5))),"bounds.height":String(Number(r.height.toFixed(5)))}),rt=(r,s)=>({x:(r.x-s.x)/s.width,y:(r.y-s.y)/s.height,width:r.width/s.width,height:r.height/s.height}),it=r=>r?r.startsWith("/")||/^[a-z][a-z0-9+.-]*:/i.test(r)?r:`/${r}`:"";function ot(r){return new Promise((s,a)=>{const d=new FileReader;d.onerror=()=>a(d.error??new Error("Could not read the image.")),d.onload=()=>{const u=String(d.result),c=new Image;c.onerror=()=>a(new Error("The selected file is not a readable image.")),c.onload=()=>s({base64:u.slice(u.indexOf(",")+1),width:c.naturalWidth,height:c.naturalHeight}),c.src=u},d.readAsDataURL(r)})}function me(r){const s=r.reduce((a,d)=>{const u=[d.id,d.shortId,d.attributes.id].map(c=>/^UIE-(\d+)$/i.exec(c??"")).filter(c=>!!c).map(c=>Number(c[1]));return Math.max(a,...u)},0);return`UIE-${String(s+1).padStart(3,"0")}`}function st(r){const s=r.reduce((a,d)=>{const u=[d.id,d.shortId,d.attributes.id].map(c=>/^UIA-(\d+)$/i.exec(c??"")).filter(c=>!!c).map(c=>Number(c[1]));return Math.max(a,...u)},0);return`UIA-${String(s+1).padStart(3,"0")}`}function ge(r,s,a){var C;const d=((C=r.match(/(\d+)$/))==null?void 0:C[1])??"1",u=`${s}${Number(d)}`,c=new Set(a.map($=>$.id));if(!c.has(u))return u;let m=2;for(;c.has(`${u}_${m}`);)m++;return`${u}_${m}`}function Ae(r,s){const a=s.find(c=>c.id===r.id);if(a)return a;const d=s.find(c=>{var m,C;return(((m=c.attributes)==null?void 0:m.providedId)??((C=c.attributes)==null?void 0:C.id)??c.shortId)===r.id});if(d)return d;const u=r.name.toLowerCase().replace(/region layout|screen layout|[^a-z0-9]/g,"");return s.find(c=>{const m=c.name.toLowerCase().replace(/[^a-z0-9]/g,"");return m.length>0&&(u.includes(m)||m.includes(u))})}async function fe(r,s){var d;const a=Date.now()+1e4;for(;Date.now()<a;){const u=(d=v.getState().model)==null?void 0:d.elements[r];if(u&&u!==s)return;await new Promise(c=>setTimeout(c,100))}throw new Error("The new element was saved, but the rebuilt model did not arrive.")}async function at(r,s,a){var u;const d=Date.now()+1e4;for(;Date.now()<d;){if((u=v.getState().model)==null?void 0:u.relationships.find(m=>m.type.toLowerCase()===r.toLowerCase()&&m.sourceId===s&&m.targetId===a))return!0;await new Promise(m=>setTimeout(m,100))}return!1}const ct=(r,s,a)=>{var d;return!!((d=v.getState().model)!=null&&d.relationships.some(u=>u.type.toLowerCase()===r.toLowerCase()&&u.sourceId===s&&u.targetId===a))};function mt(){const r=v(e=>e.model),s=v(e=>e.createModelElement),a=v(e=>e.persistElementAttributes),d=v(e=>e.createRelationship),u=v(e=>e.createDiagram),c=v(e=>e.inspectElement),m=v(e=>e.selectedElementId),C=v(e=>e.deleteModelElement),$=v(e=>e.createPackage),T=v(e=>e.moveElementToPackage),[N,h]=f.useState(),[p,g]=f.useState(),[j,F]=f.useState(!1),[E,k]=f.useState(""),[G,w]=f.useState(""),[X,Y]=f.useState(!1),[q,V]=f.useState("NewUIScreen"),[W,B]=f.useState(!1),[A,R]=f.useState([]),[U,J]=f.useState(new Set),[I,Ne]=f.useState(tt),K=f.useRef(null),_=f.useCallback(e=>{Ne(Math.max(ce,Math.min(de,e)))},[]),ee=f.useCallback(()=>{var e;(e=K.current)==null||e.call(K),K.current=null},[]),Ue=f.useCallback(e=>{if(e.button!==0)return;e.preventDefault(),ee();const t=e.clientX,i=I,o=document.body.style.cursor,l=document.body.style.userSelect;document.body.style.cursor="col-resize",document.body.style.userSelect="none";const x=y=>{_(i+y.clientX-t)},b=()=>{window.removeEventListener("pointermove",x),window.removeEventListener("pointerup",b),window.removeEventListener("pointercancel",b),document.body.style.cursor=o,document.body.style.userSelect=l,K.current=null};K.current=b,window.addEventListener("pointermove",x),window.addEventListener("pointerup",b),window.addEventListener("pointercancel",b)},[_,I,ee]);f.useEffect(()=>{try{localStorage.setItem(De,String(Math.round(I)))}catch{}},[I]),f.useEffect(()=>()=>ee(),[ee]);const te=f.useRef(new Map),le=f.useRef(null),H=f.useMemo(()=>((r==null?void 0:r.diagrams)??[]).filter(e=>e.viewKind==="geometry"),[r]),O=f.useMemo(()=>r?Ge(r):[],[r]),ne=f.useMemo(()=>r?Object.values(r.elements).filter(e=>{var t;return e.kind==="UIElement"&&((t=e.attributes.formKind)==null?void 0:t.endsWith("screen"))}):[],[r]),z=f.useMemo(()=>H.find(e=>e.id===N),[H,N]),re=f.useMemo(()=>z?Ae(z,ne):void 0,[z,ne]),ie=f.useMemo(()=>{const e=new Map;for(const t of(r==null?void 0:r.relationships)??[])t.type.toLowerCase()==="capturesscreen"&&e.set(t.sourceId,t.targetId);return e},[r]),Q=f.useMemo(()=>re?O.filter(e=>ie.get(e.id)===re.id):[],[ie,O,re]);if(f.useEffect(()=>{var e;H.some(t=>t.id===N)||h((e=H[0])==null?void 0:e.id)},[H,N]),f.useEffect(()=>{var e;Q.some(t=>t.id===p)||g(((e=Q[0])==null?void 0:e.id)??"__none__")},[p,Q]),f.useEffect(()=>{R([]),te.current.clear()},[p]),!r)return null;const Z=Xe(r,{captureId:p}),L=Object.values(r.elements).filter(e=>e.kind==="UIElement"),S=re??Z.screen,Be=new Map(L.map(e=>[e.id,e])),P=new Map;for(const e of r.relationships){if(e.type.toLowerCase()!=="composes")continue;const t=Be.get(e.targetId);t&&P.set(e.sourceId,[...P.get(e.sourceId)??[],t])}const xe=(e,t,i)=>{h(e);const o=t&&i?qe(r,t.id,i.id):t?Ie(r,t.id):void 0;o&&g(o.id),i&&c(i.id)},ue=e=>J(t=>{const i=new Set(t);return i.has(e)?i.delete(e):i.add(e),i}),be=async e=>{const t=await e;t.success||window.alert(t.error??"The package could not be written.")},Re=async e=>{const t=Ce(r,e),i=window.prompt(t?`Name the group inside ${t.split("::").pop()}`:"Name the group");if(!(i!=null&&i.trim()))return;const o=await $(i.trim(),t);if(!o.success){window.alert(o.error??"The package could not be created.");return}const l=`${t}::${i.trim()}`;await Oe(l),await be(T(e.id,l))},$e=async e=>{var l;const t=Ce(r,e),i=je(r,e),o=window.prompt(i.length?`Move into which group? (${i.join(", ")})`:"Move into which group?",((l=e.attributes)==null?void 0:l.elementPackage)??i[0]??"");o!=null&&o.trim()&&await be(T(e.id,`${t}::${o.trim()}`))},ze=e=>[{label:"Group in new package…",onSelect:()=>{Re(e)}},...je(r,e).length>0?[{label:"Move into group…",onSelect:()=>{$e(e)}}]:[]],we=(e,t,i,o)=>{const{groups:l,ungrouped:x}=nt(e),b=x.map(y=>ye(y,t,i,o));return n.jsxs(n.Fragment,{children:[l.map(y=>{const M=`group:${i.id}:${y.name}`;return n.jsxs("div",{role:"none",children:[n.jsx(pe,{id:M,label:y.name,depth:o,hasChildren:!0,expanded:!U.has(M),selected:!1,badge:"PKG",badgeColor:"#6B7280",count:y.members.length,title:`Grouping package — ${y.members.length} UI elements. The package groups; the screen still owns them.`,onClick:()=>ue(M)}),!U.has(M)&&n.jsx("div",{role:"group",children:y.members.map(oe=>ye(oe,t,i,o+1))})]},M)}),b]})},ye=(e,t,i,o)=>n.jsxs("div",{role:"none",children:[n.jsx(pe,{id:`element:${e.id}`,label:n.jsx(Ee,{element:e}),depth:o,hasChildren:(P.get(e.id)??[]).length>0,expanded:!U.has(`element:${e.id}`),selected:e.id===m,badge:"UIE",badgeColor:"#0F766E",count:(P.get(e.id)??[]).length||void 0,title:`${e.name} · ${e.attributes.formKind??"UIElement"}`,onClick:()=>{(P.get(e.id)??[]).length&&ue(`element:${e.id}`),xe(t,i,e)},onDelete:()=>C(e.id),actions:ze(e)}),!U.has(`element:${e.id}`)&&we(P.get(e.id)??[],t,i,o+1)]},e.id),he=async(e,t,i)=>{let o="";for(let l=0;l<3;l++){if(ct(e,t,i))return;const x=await d({type:e,sourceId:t,targetId:i,direction:"outgoing",selectedElementId:t});if(x.success&&await at(e,t,i))return;o=x.success?"The relationship was written but did not appear in the rebuilt model.":x.error??"The relationship could not be created.",await new Promise(b=>setTimeout(b,250*(l+1)))}throw new Error(o||`Could not connect ${i} beneath ${t}.`)},Fe=async()=>{var t,i,o;const e=q.trim();if(e){w("Creating UI screen…");try{const l=me(L),x=ge(l,"uiElement",L),b=s({id:x,name:e,kind:"UIElement",construct:"part",layer:"implementation",file:"model/generated.sysml",doc:"",attributes:{id:l,description:`Root user-interface screen ${e}.`,formKind:"UIElementFormKind::screen",disclosureKind:"UIDisclosureKind::inline",detectionMethod:"BoundsDetectionKind::manual","bounds.x":"0","bounds.y":"0","bounds.width":"1","bounds.height":"1"}});await fe(b,(t=v.getState().model)==null?void 0:t.elements[b]);const y=((o=(i=r.viewpoints)==null?void 0:i.find(M=>M.label.toLowerCase().includes("ui layout")))==null?void 0:o.id)??"__model";u({id:l,name:`${e} — Region Layout`,diagramType:"bdd",viewKind:"geometry",viewpointId:y,elementIds:[x],activate:!1}),h(l),g("__none__"),c(x),Y(!1),V("NewUIScreen"),w("UI screen created. Choose a capture asset or upload one.")}catch(l){w(l instanceof Error?l.message:String(l))}}},Te=async e=>{if(!S)return w("Create or select a UI screen first.");const t=ie.get(e.id);if(t&&t!==S.id){const i=Object.values(r.elements).find(o=>o.id===t);return w(`“${e.name}” already depicts ${(i==null?void 0:i.name)??t}; duplicate the asset before reassigning it.`)}try{t||await he("CapturesScreen",e.id,S.id),g(e.id),B(!1),w(`Using capture asset “${e.name}”.`)}catch(i){w(i instanceof Error?i.message:String(i))}},Se=async(e,t={})=>{var i,o;if(!S){w("Add or capture a screen before drawing regions.");return}w("Saving region…");try{const l=me(L),x=ge(l,"uiElement",L);return s({id:x,name:((i=t.name)==null?void 0:i.trim())||`Region ${l}`,kind:"UIElement",construct:"part",layer:S.layer,file:S.file||"model/generated.sysml",doc:"",attributes:{id:l,...Me(e),formKind:"UIElementFormKind::panel",disclosureKind:"UIDisclosureKind::inline",detectionMethod:t.automatic?"BoundsDetectionKind::automaticConfirmed":"BoundsDetectionKind::manual",...t.confidence!==void 0?{detectionConfidence:String(Number(t.confidence.toFixed(3)))}:{},...t.automatic?{confirmedBy:"currentReviewer",confirmedAt:new Date().toISOString()}:{},boundaryColor:"#14B8A6",boundaryOpacity:"0.12"}}),await fe(x,(o=v.getState().model)==null?void 0:o.elements[x]),await he("Composes",t.parentElementId??S.id,x),F(!1),w("Region saved."),x}catch(l){w(l instanceof Error?l.message:String(l));return}},_e=async e=>{var t,i;if(!z||!S)return w("Choose a geometry view with a screen before uploading.");w("Saving capture…");try{const o=await ot(e),l=e.name.toLowerCase().split(".").pop(),x=e.type||(l==="png"?"image/png":l==="webp"?"image/webp":l==="jpg"||l==="jpeg"?"image/jpeg":"");if(!x)throw new Error("Choose a PNG, JPEG, or WebP capture.");const b=await He({viewName:z.name,fileName:e.name,base64:o.base64,mediaType:x});if(!b.success||!b.imageUri||!b.imageHash)throw new Error(b.error||"Capture upload failed.");const y=st(O),M=s({id:ge(y,"uiAsset",O),name:`${S.name} capture`,kind:"ScreenCapture",construct:"part",layer:S.layer,file:S.file||"model/generated.sysml",doc:"",attributes:{id:y,imageUri:b.imageUri,imageHash:b.imageHash,pixelWidth:String(o.width),pixelHeight:String(o.height),capturedBuild:E.trim(),captureContext:z.name}});await fe(M,(t=v.getState().model)==null?void 0:t.elements[M]),await he("CapturesScreen",M,S.id);for(const oe of L)(i=oe.attributes.detectionMethod)!=null&&i.endsWith("automatic")&&a(oe.id,{confirmedBy:"",confirmedAt:""});g(M),w("Capture saved; automatic regions require confirmation.")}catch(o){w(o instanceof Error?o.message:String(o))}},Le=async()=>{if(!Z.imageUri)return w("Attach a screen-capture asset before detecting regions.");w("Detecting nested boundaries…");try{const t=(await et(Z.imageUri)).map((i,o)=>({id:`proposal-${o+1}`,bounds:i.bounds,confidence:i.confidence,parentId:i.parentIndex!==void 0?`proposal-${i.parentIndex+1}`:void 0,status:"pending"}));te.current.clear(),R(t),w(t.length?`${t.length} boundary proposal${t.length===1?"":"s"} found. Accept or reject each box.`:"No strong rectangular boundaries were detected; draw regions manually.")}catch(e){w(e instanceof Error?e.message:String(e))}},ve=async e=>{const t=te.current.get(e);if(t)return t;const i=A.find(b=>b.id===e);if(!i||i.status==="rejected")return;let o,l=i.bounds;if(i.parentId){const b=A.find(y=>y.id===i.parentId);b&&b.status!=="rejected"&&(o=await ve(b.id),o&&(l=rt(i.bounds,b.bounds)))}const x=await Se(l,{parentElementId:o,automatic:!0,confidence:i.confidence});return x&&(te.current.set(e,x),R(b=>b.map(y=>y.id===e?{...y,status:"accepted"}:y))),x},Pe=e=>{const t=new Set([e]);let i=!0;for(;i;){i=!1;for(const o of A)o.parentId&&t.has(o.parentId)&&!t.has(o.id)&&(t.add(o.id),i=!0)}R(o=>o.map(l=>t.has(l.id)?{...l,status:"rejected"}:l)),w(`Rejected ${t.size} proposal${t.size===1?"":"s"}.`)};return n.jsxs("div",{className:"flex flex-1 min-h-0 relative",style:{background:"#F7F7F5"},children:[n.jsxs("aside",{style:{width:I,position:"relative",flexShrink:0,borderRight:"1px solid #E5E5E0",background:"#FFFFFF",padding:"16px 12px",overflowY:"auto"},children:[n.jsxs("div",{className:"flex items-center",style:{margin:"0 8px 4px"},children:[n.jsx("h1",{style:{margin:0,flex:1,color:"#1B3A4B",fontSize:18,fontWeight:700},children:"UI Screens"}),n.jsx(se,{icon:n.jsx(D.plus,{}),ariaLabel:"Add UI element",title:"Create a root UIElement screen",onClick:()=>Y(e=>!e),active:X})]}),n.jsx("p",{style:{margin:"0 8px 16px",color:"#6B7280",fontSize:12},children:"Capture, mark up, and trace screen regions."}),X&&n.jsxs("div",{style:{margin:"0 4px 12px",padding:10,background:"#F7F7F5",border:"1px solid #E5E5E0",borderRadius:8},children:[n.jsx("label",{style:{display:"block",color:"#6B7280",fontSize:10,fontWeight:600,marginBottom:4},children:"UI ELEMENT NAME"}),n.jsx("input",{"aria-label":"New UI screen name",value:q,onChange:e=>V(e.target.value),onKeyDown:e=>{e.key==="Enter"&&Fe()},style:{width:"100%",border:"1px solid #D8D8D2",borderRadius:6,padding:"6px 8px",fontSize:12}}),n.jsxs("div",{className:"flex gap-2",style:{marginTop:8},children:[n.jsx("button",{onClick:()=>void Fe(),disabled:!q.trim(),style:{flex:1,border:0,borderRadius:6,padding:"5px 8px",background:"#1B3A4B",color:"#FFFFFF",fontSize:11,cursor:"pointer"},children:"Create screen"}),n.jsx("button",{onClick:()=>Y(!1),style:{border:"1px solid #D8D8D2",borderRadius:6,padding:"5px 8px",background:"#FFFFFF",color:"#4B5563",fontSize:11,cursor:"pointer"},children:"Cancel"})]})]}),n.jsx("div",{role:"tree","aria-label":"UI screen hierarchy",children:H.map(e=>{const t=Ae(e,ne)??ne.find(l=>{var x;return((x=Ie(r,l.id))==null?void 0:x.attributes.captureContext)===e.name});if(!t)return null;const i=`screen:${t.id}`,o=P.get(t.id)??[];return n.jsxs("div",{role:"none",style:{marginBottom:4},children:[n.jsx(pe,{id:i,label:n.jsx(Ee,{element:t}),depth:0,hasChildren:o.length>0,expanded:!U.has(i),selected:t.id===m,badge:"UIE",badgeColor:"#0F766E",title:"Root UIElement screen",onClick:()=>{o.length&&ue(i),xe(e.id,t,t)},onDelete:()=>C(t.id)}),!U.has(i)&&n.jsx("div",{role:"group",children:we(o,e.id,t,1)})]},i)})}),n.jsx("div",{className:"memo-explorer-resizer",role:"separator","aria-label":"Resize UI Screens Explorer","aria-orientation":"vertical","aria-valuemin":ce,"aria-valuemax":de,"aria-valuenow":Math.round(I),tabIndex:0,title:"Drag to resize · Double-click to reset",onPointerDown:Ue,onDoubleClick:()=>_(ae),onKeyDown:e=>{e.key==="ArrowLeft"?(e.preventDefault(),_(I-20)):e.key==="ArrowRight"?(e.preventDefault(),_(I+20)):e.key==="Home"?(e.preventDefault(),_(ce)):e.key==="End"&&(e.preventDefault(),_(de))}})]}),n.jsx("main",{className:"flex-1 flex flex-col min-w-0 relative",children:z?n.jsxs(n.Fragment,{children:[n.jsx("div",{className:"flex items-center px-3 py-2",style:{minHeight:48,background:"#F7F7F5",borderBottom:"1px solid #E5E5E0"},children:n.jsxs("div",{className:"flex items-center gap-2 px-3 py-1.5 rounded-lg",style:{width:"fit-content",maxWidth:"100%",background:"#FFFFFF",border:"1px solid #E5E5E0",boxShadow:"0 1px 4px rgba(0,0,0,0.06)"},children:[n.jsx("span",{title:"Choose the independent capture asset used as the canvas backdrop",children:n.jsx(D.capture,{})}),n.jsxs("select",{"aria-label":"Attached screen capture",value:p??"__none__",onChange:e=>g(e.target.value),className:"text-xs font-semibold rounded-lg px-2 py-1",style:{color:"#5B6470",background:"#FFFFFF",border:"1px solid #E2E1DB",maxWidth:220},children:[Q.length===0&&n.jsx("option",{value:"__none__",children:"No capture attached"}),Q.map(e=>n.jsx("option",{value:e.id,children:e.name},e.id))]}),n.jsx(se,{icon:n.jsx(D.info,{}),onClick:()=>Z.capture&&c(Z.capture.id),ariaLabel:"Inspect capture asset",title:"Open this ScreenCapture asset in Properties"}),n.jsx(se,{icon:n.jsx(D.library,{}),label:"Assets",active:W,onClick:()=>B(e=>!e),title:"Choose a ScreenCapture from the asset library"}),n.jsx("input",{"aria-label":"New capture asset build",value:E,onChange:e=>k(e.target.value),placeholder:"Asset build",title:"Software build that produced the new capture asset",className:"text-xs rounded-lg px-2 py-1",style:{width:112,color:"#5B6470",background:"#FFFFFF",border:"1px solid #E2E1DB"}}),n.jsx(Ve,{children:n.jsx(se,{icon:n.jsx(D.upload,{}),label:"Add capture",onClick:()=>{var e;return(e=le.current)==null?void 0:e.click()},title:"Create a ScreenCapture asset from a PNG, JPEG, or WebP image"})}),n.jsx("input",{ref:le,type:"file",accept:"image/png,image/jpeg,image/webp",hidden:!0,onChange:e=>{var t;return((t=e.target.files)==null?void 0:t[0])&&_e(e.target.files[0])}}),n.jsx(Je,{}),n.jsx(ke,{icon:n.jsx(D.rectangle,{}),label:j?"Cancel drawing":"Add region",active:j,onClick:()=>F(e=>!e),title:"Drag a rectangle, then edit the region in Properties"}),n.jsx(ke,{icon:n.jsx(D.detect,{}),label:"Detect",active:A.some(e=>e.status==="pending"),badge:A.filter(e=>e.status==="pending").length||void 0,onClick:()=>void Le(),title:"Propose nested regions from detected image boundaries"}),G&&n.jsx("span",{role:"status",className:"truncate",style:{marginLeft:"auto",fontSize:We.xs,color:"#6B7280",maxWidth:180},children:G})]})}),p==="__none__"?n.jsx("div",{className:"flex-1 flex items-center justify-center p-8",style:{background:"#F7F7F5"},children:n.jsxs("div",{style:{width:"min(560px, 100%)",padding:28,textAlign:"center",background:"#FFFFFF",border:"1px solid #E5E5E0",borderRadius:14,boxShadow:"0 4px 18px rgba(15,23,42,0.06)"},children:[n.jsx("div",{style:{display:"inline-flex",padding:12,borderRadius:12,background:"#E1F5EE",color:"#0F766E"},children:n.jsx(D.capture,{size:28})}),n.jsxs("h2",{style:{margin:"14px 0 6px",color:"#1B3A4B",fontSize:18,fontWeight:700},children:["Add a visual asset to ",S==null?void 0:S.name]}),n.jsx("p",{style:{margin:"0 auto 18px",maxWidth:430,color:"#6B7280",fontSize:12,lineHeight:1.5},children:"Upload a new screen capture or link an existing ScreenCapture from the asset library. The asset remains independent and is connected through CapturesScreen."}),n.jsxs("div",{className:"flex justify-center gap-2",children:[n.jsxs("button",{onClick:()=>{var e;return(e=le.current)==null?void 0:e.click()},className:"flex items-center gap-2",style:{padding:"8px 13px",border:0,borderRadius:8,background:"#1B3A4B",color:"#FFFFFF",cursor:"pointer",fontSize:12,fontWeight:600},children:[n.jsx(D.upload,{})," Upload screen capture"]}),n.jsxs("button",{onClick:()=>B(!0),className:"flex items-center gap-2",style:{padding:"8px 13px",border:"1px solid #D8D8D2",borderRadius:8,background:"#FFFFFF",color:"#374151",cursor:"pointer",fontSize:12,fontWeight:600},children:[n.jsx(D.library,{})," Choose from asset library"]})]}),n.jsx("p",{style:{margin:"14px 0 0",color:"#9CA3AF",fontSize:10},children:"You can also create the CapturesScreen relationship later in Properties."})]})}):n.jsx(Ye,{diagram:z,model:r,captureId:p,editable:!0,drawMode:j,newElementDefaultName:`Region ${me(L)}`,proposals:A,onAcceptProposal:e=>void ve(e),onRejectProposal:Pe,onCreateBounds:(e,t)=>void Se(e,{name:t}),onBoundsChange:(e,t)=>a(e,Me(t))}),W&&n.jsx("div",{className:"absolute inset-0 flex items-start justify-center",onMouseDown:e=>{e.target===e.currentTarget&&B(!1)},style:{zIndex:50,paddingTop:70,background:"#0F172A33",backdropFilter:"blur(1px)"},children:n.jsxs("div",{role:"dialog","aria-label":"ScreenCapture asset library",style:{width:"min(720px, calc(100% - 40px))",maxHeight:"calc(100% - 100px)",overflowY:"auto",background:"#FFFFFF",border:"1px solid #D1D5DB",borderRadius:12,boxShadow:"0 18px 50px rgba(15,23,42,0.22)"},children:[n.jsxs("div",{className:"flex items-center",style:{position:"sticky",top:0,zIndex:2,padding:"12px 14px",background:"#FFFFFF",borderBottom:"1px solid #E5E5E0"},children:[n.jsxs("div",{style:{flex:1},children:[n.jsx("strong",{style:{color:"#1B3A4B",fontSize:14},children:"ScreenCapture asset library"}),n.jsx("div",{style:{color:"#6B7280",fontSize:10},children:"Choose an unassigned asset or one already linked to this screen."})]}),n.jsx("button",{"aria-label":"Close asset library",onClick:()=>B(!1),style:{width:28,height:28,border:0,borderRadius:6,background:"#F0F0ED",color:"#4B5563",cursor:"pointer"},children:"×"})]}),n.jsxs("div",{style:{display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(205px, 1fr))",gap:10,padding:12},children:[O.length===0&&n.jsx("div",{style:{gridColumn:"1 / -1",padding:28,textAlign:"center",color:"#9CA3AF",fontSize:12},children:"No capture assets yet. Upload the first capture."}),O.map(e=>{const t=ie.get(e.id),i=t?Object.values(r.elements).find(l=>l.id===t):void 0,o=!t||t===(S==null?void 0:S.id);return n.jsxs("button",{disabled:!o,onClick:()=>void Te(e),style:{display:"block",minWidth:0,padding:0,overflow:"hidden",textAlign:"left",border:`1px solid ${e.id===p?"#2DD4A8":"#E5E5E0"}`,borderRadius:9,background:e.id===p?"#F0FDFA":"#FFFFFF",color:o?"#374151":"#9CA3AF",cursor:o?"pointer":"not-allowed",opacity:o?1:.58},children:[n.jsx("div",{style:{height:118,background:"#F3F4F6",borderBottom:"1px solid #E5E5E0"},children:e.attributes.imageUri?n.jsx("img",{src:it(e.attributes.imageUri),alt:"",style:{width:"100%",height:"100%",objectFit:"contain"}}):n.jsx("div",{className:"flex items-center justify-center h-full",children:n.jsx(D.capture,{size:28})})}),n.jsxs("div",{style:{padding:"8px 9px"},children:[n.jsx("div",{className:"truncate",style:{fontSize:11,fontWeight:650},children:e.name}),n.jsx("div",{className:"truncate",style:{fontSize:10,marginTop:3},children:i?`Depicts ${i.name}`:"Unassigned asset"}),e.attributes.capturedBuild&&n.jsx("div",{className:"truncate",style:{fontSize:9,color:"#9CA3AF",marginTop:2},children:e.attributes.capturedBuild})]})]},e.id)})]})]})})]}):n.jsx("div",{className:"flex-1 flex items-center justify-center",style:{color:"#6B7280",textAlign:"center"},children:n.jsxs("div",{children:[n.jsx("div",{style:{display:"flex",justifyContent:"center",marginBottom:4},children:n.jsx(Ke,{size:190})}),n.jsx("h2",{style:{color:"#374151",fontSize:18},children:"No screen-layout views"}),n.jsx("p",{children:"Add a MemoScreenLayoutView to begin."})]})})})]})}export{mt as UiScreensWorkspace,nt as groupUiChildren,st as nextUiAssetId,me as nextUiElementId,Ae as screenForLayout,ge as usageIdentifier};
@@ -1 +1 @@
1
- import{j as t}from"./reactflow-C9OlmOYw.js";import{a as x}from"./zustand-CrhqMOHB.js";import{u as p}from"./index-a2rpMs5Y.js";const l=[{id:"setup",icon:"🎯",title:"Set Up Your Device",description:"Define who your device is for, what it does, and who uses it. Start with actors and intended use.",standard:"IEC 62366 · ISO 14971 §4",getCount:e=>Object.values(e.elements).filter(s=>["actor","stakeholder","usecase","goal"].includes(s.kind.toLowerCase())).length,getTarget:()=>3,actionLabel:"Browse Model",actionView:"model",getDetails:e=>{const s=Object.values(e.elements).filter(n=>n.kind.toLowerCase()==="actor").length,i=Object.values(e.elements).filter(n=>n.kind.toLowerCase()==="usecase").length;return`${s} actor(s) · ${i} use case(s)`}},{id:"requirements",icon:"📋",title:"Define Requirements",description:"Capture user needs and system requirements. These form the basis of your V&V plan.",standard:"IEC 62304 §5.2 · 21 CFR 820.30(c)",getCount:e=>Object.values(e.elements).filter(s=>["systemrequirement","requirement","userneed"].includes(s.kind.toLowerCase())).length,getTarget:()=>5,actionLabel:"View Catalog",actionView:"catalog",getDetails:e=>{const s=Object.values(e.elements).filter(n=>n.kind.toLowerCase()==="userneed").length,i=Object.values(e.elements).filter(n=>["systemrequirement","requirement"].includes(n.kind.toLowerCase())).length;return`${s} user need(s) · ${i} system requirement(s)`}},{id:"hazards",icon:"⚠️",title:"Identify Hazards",description:"List all hazards your device could cause. Add hazardous situations and potential harms.",standard:"ISO 14971 §5–6",getCount:e=>Object.values(e.elements).filter(s=>["hazard","hazardoussituation","harm"].includes(s.kind.toLowerCase())).length,getTarget:()=>3,actionLabel:"Browse Risk Layer",actionView:"model",getDetails:e=>{const s=Object.values(e.elements).filter(n=>n.kind.toLowerCase()==="hazard").length,i=Object.values(e.elements).filter(n=>n.kind.toLowerCase()==="harm").length;return`${s} hazard(s) · ${i} harm(s)`}},{id:"risk-controls",icon:"🔗",title:"Connect Risk Chain",description:"Add risk controls and connect them to hazards with Mitigates relationships. Verify the ISO 14971 chain.",standard:"ISO 14971 §7–8",getCount:e=>e.relationships.filter(s=>s.type.toLowerCase()==="mitigates").length,getTarget:()=>2,actionLabel:"Traceability Matrix",actionView:"traceability",getDetails:e=>{const s=Object.values(e.elements).filter(n=>n.kind.toLowerCase()==="riskcontrol").length,i=e.relationships.filter(n=>n.type.toLowerCase()==="mitigates").length;return`${s} risk control(s) · ${i} mitigates link(s)`}},{id:"architecture",icon:"🏗️",title:"Define Architecture",description:"Add system and subsystem elements. This grounds requirements to real components.",standard:"IEC 62304 §5.3 · ISO 14971 §9",getCount:e=>Object.values(e.elements).filter(s=>["system","subsystem","logicalcomponent","softwarecomponent"].includes(s.kind.toLowerCase())).length,getTarget:()=>3,actionLabel:"Browse Model",actionView:"model",getDetails:e=>{const s=Object.values(e.elements).filter(n=>["system","subsystem"].includes(n.kind.toLowerCase())).length,i=Object.values(e.elements).filter(n=>n.kind.toLowerCase()==="softwarecomponent").length;return`${s} system/subsystem · ${i} software component(s)`}},{id:"verification",icon:"🧪",title:"Link Verification",description:"Add tests and link them to requirements. This closes the V&V loop and prepares your design review package.",standard:"IEC 62304 §5.7–5.8 · 21 CFR 820.30(g)",getCount:e=>Object.values(e.elements).filter(s=>s.kind.toLowerCase()==="test").length,getTarget:()=>3,actionLabel:"Traceability Matrix",actionView:"traceability",getDetails:e=>{const s=Object.values(e.elements).filter(n=>n.kind.toLowerCase()==="test").length,i=e.relationships.filter(n=>["satisfies","refines","traces","verifies"].includes(n.type.toLowerCase())).length;return`${s} test(s) · ${i} traceability link(s)`}}];function m({step:e,index:s,isActive:i,model:n,onSelect:d,onAction:c}){const r=e.getCount(n),o=e.getTarget(),a=r>=o,u=Math.min(100,Math.round(r/o*100)),h=e.getDetails(n),g=a?"#2ECC71":r>0?"#F39C12":"#E5E5E0";return t.jsxs("button",{onClick:d,style:{textAlign:"left",background:i?"#FFFFFF":"transparent",border:`1px solid ${i?"#1B3A4B20":"transparent"}`,borderRadius:"10px",padding:"14px 16px",cursor:"pointer",width:"100%",transition:"all 0.15s",boxShadow:i?"0 2px 8px rgba(0,0,0,0.06)":"none"},children:[t.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"10px"},children:[t.jsx("div",{style:{width:"28px",height:"28px",borderRadius:"50%",flexShrink:0,background:a?"#2ECC71":i?"#1B3A4B":"#F3F4F6",color:a||i?"#FFFFFF":"#6B7280",display:"flex",alignItems:"center",justifyContent:"center",fontSize:a?"14px":"12px",fontWeight:700},children:a?"✓":s+1}),t.jsxs("div",{style:{flex:1,minWidth:0},children:[t.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"6px"},children:[t.jsxs("span",{style:{fontSize:"13px",fontWeight:700,color:i?"#1B3A4B":"#374151"},children:[e.icon," ",e.title]}),r>0&&t.jsx("span",{style:{fontSize:"10px",fontWeight:600,padding:"1px 6px",borderRadius:"999px",background:g+"20",color:g},children:r})]}),h&&t.jsx("div",{style:{fontSize:"11px",color:"#9CA3AF",marginTop:"2px"},children:h})]}),t.jsxs("div",{style:{width:"40px",textAlign:"right",fontSize:"10px",color:"#9CA3AF",flexShrink:0},children:[u,"%"]})]}),t.jsx("div",{style:{marginTop:"8px",height:"3px",background:"#F3F4F6",borderRadius:"2px",marginLeft:"38px"},children:t.jsx("div",{style:{height:"100%",borderRadius:"2px",background:g,width:`${u}%`,transition:"width 0.4s ease"}})})]})}function f({step:e,model:s,onAction:i}){const n=e.getCount(s),d=e.getTarget(),c=n>=d;return t.jsxs("div",{style:{background:"#FFFFFF",border:"1px solid #E5E5E0",borderRadius:"12px",padding:"24px"},children:[t.jsx("div",{style:{fontSize:"32px",marginBottom:"12px"},children:e.icon}),t.jsx("h2",{style:{fontSize:"18px",fontWeight:800,color:"#1B3A4B",margin:"0 0 6px 0"},children:e.title}),t.jsx("div",{style:{fontSize:"11px",fontWeight:600,color:"#9CA3AF",marginBottom:"12px",fontFamily:"monospace"},children:e.standard}),t.jsx("p",{style:{fontSize:"13px",color:"#4B6E80",lineHeight:"1.7",margin:"0 0 20px 0"},children:e.description}),t.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"12px",padding:"14px 16px",borderRadius:"8px",background:c?"#2ECC7110":n>0?"#F39C1210":"#F3F4F6",marginBottom:"20px"},children:[t.jsx("div",{style:{fontSize:"24px",fontWeight:800,color:c?"#2ECC71":n>0?"#F39C12":"#9CA3AF"},children:n}),t.jsxs("div",{children:[t.jsx("div",{style:{fontSize:"13px",fontWeight:600,color:"#374151"},children:c?`✓ Target reached (${d}+ recommended)`:`${d-n} more recommended`}),t.jsx("div",{style:{fontSize:"11px",color:"#9CA3AF"},children:e.getDetails(s)})]})]}),t.jsxs("button",{onClick:()=>i(e.actionView),style:{width:"100%",padding:"12px",borderRadius:"8px",background:"#1B3A4B",color:"#FFFFFF",border:"none",fontSize:"13px",fontWeight:600,cursor:"pointer",transition:"background 0.15s"},onMouseEnter:r=>r.currentTarget.style.background="#244D63",onMouseLeave:r=>r.currentTarget.style.background="#1B3A4B",children:[e.actionLabel," →"]})]})}function y({model:e}){const s=l.filter(n=>n.getCount(e)>=n.getTarget()).length,i=Math.round(s/l.length*100);return t.jsxs("div",{style:{padding:"16px 20px",background:"#FFFFFF",borderRadius:"12px",border:"1px solid #E5E5E0",marginBottom:"16px"},children:[t.jsxs("div",{style:{display:"flex",justifyContent:"space-between",marginBottom:"8px"},children:[t.jsx("span",{style:{fontSize:"13px",fontWeight:700,color:"#1B3A4B"},children:"Golden Path Progress"}),t.jsxs("span",{style:{fontSize:"13px",fontWeight:700,color:"#1B3A4B"},children:[s,"/",l.length," steps"]})]}),t.jsx("div",{style:{height:"6px",background:"#F3F4F6",borderRadius:"3px"},children:t.jsx("div",{style:{height:"100%",borderRadius:"3px",background:i>=100?"#2ECC71":"#2DD4A8",width:`${i}%`,transition:"width 0.4s ease"}})})]})}function j(){const e=p(o=>o.model),s=p(o=>o.setActiveView),i=p(o=>o.setExplorerTab),n=x.useMemo(()=>{if(!e)return 0;for(let o=0;o<l.length;o++)if(l[o].getCount(e)<l[o].getTarget())return o;return l.length-1},[e]),[d,c]=x.useState(n);if(!e)return t.jsx("div",{style:{flex:1,display:"flex",alignItems:"center",justifyContent:"center",background:"#F7F7F5"},children:t.jsx("div",{style:{fontSize:"13px",color:"#9CA3AF"},children:"No model data"})});function r(o){switch(o){case"model":i("model"),s({type:"dashboard"});break;case"traceability":s({type:"traceability"});break;case"statistics":s({type:"statistics"});break;case"catalog":i("model"),s({type:"dashboard"});break}}return t.jsx("div",{style:{flex:1,overflowY:"auto",background:"#F7F7F5",padding:"28px 40px"},children:t.jsxs("div",{style:{maxWidth:"960px",margin:"0 auto"},children:[t.jsxs("div",{style:{display:"flex",alignItems:"flex-start",justifyContent:"space-between",marginBottom:"20px"},children:[t.jsxs("div",{children:[t.jsx("h1",{style:{fontSize:"20px",fontWeight:800,color:"#1B3A4B",margin:"0 0 4px 0"},children:"Workflow Wizard"}),t.jsx("p",{style:{fontSize:"12px",color:"#6B7280",margin:0},children:"Follow the golden path to a complete, review-ready device model"})]}),t.jsx("button",{onClick:()=>s({type:"dashboard"}),style:{fontSize:"12px",color:"#6B7280",background:"#F3F4F6",border:"1px solid #E5E5E0",borderRadius:"6px",padding:"6px 12px",cursor:"pointer",fontWeight:500},children:"← Back to Dashboard"})]}),t.jsx(y,{model:e}),t.jsxs("div",{style:{display:"grid",gridTemplateColumns:"380px 1fr",gap:"16px"},children:[t.jsx("div",{style:{background:"#F9FAFB",border:"1px solid #E5E5E0",borderRadius:"12px",padding:"8px",display:"flex",flexDirection:"column",gap:"2px"},children:l.map((o,a)=>t.jsx(m,{step:o,index:a,isActive:a===d,model:e,onSelect:()=>c(a),onAction:r},o.id))}),t.jsx(f,{step:l[d],model:e,onAction:r})]})]})})}export{j as WorkflowWizard};
1
+ import{j as t}from"./reactflow-C9OlmOYw.js";import{a as x}from"./zustand-CrhqMOHB.js";import{u as p}from"./index-DEVvBtNh.js";const l=[{id:"setup",icon:"🎯",title:"Set Up Your Device",description:"Define who your device is for, what it does, and who uses it. Start with actors and intended use.",standard:"IEC 62366 · ISO 14971 §4",getCount:e=>Object.values(e.elements).filter(s=>["actor","stakeholder","usecase","goal"].includes(s.kind.toLowerCase())).length,getTarget:()=>3,actionLabel:"Browse Model",actionView:"model",getDetails:e=>{const s=Object.values(e.elements).filter(n=>n.kind.toLowerCase()==="actor").length,i=Object.values(e.elements).filter(n=>n.kind.toLowerCase()==="usecase").length;return`${s} actor(s) · ${i} use case(s)`}},{id:"requirements",icon:"📋",title:"Define Requirements",description:"Capture user needs and system requirements. These form the basis of your V&V plan.",standard:"IEC 62304 §5.2 · 21 CFR 820.30(c)",getCount:e=>Object.values(e.elements).filter(s=>["systemrequirement","requirement","userneed"].includes(s.kind.toLowerCase())).length,getTarget:()=>5,actionLabel:"View Catalog",actionView:"catalog",getDetails:e=>{const s=Object.values(e.elements).filter(n=>n.kind.toLowerCase()==="userneed").length,i=Object.values(e.elements).filter(n=>["systemrequirement","requirement"].includes(n.kind.toLowerCase())).length;return`${s} user need(s) · ${i} system requirement(s)`}},{id:"hazards",icon:"⚠️",title:"Identify Hazards",description:"List all hazards your device could cause. Add hazardous situations and potential harms.",standard:"ISO 14971 §5–6",getCount:e=>Object.values(e.elements).filter(s=>["hazard","hazardoussituation","harm"].includes(s.kind.toLowerCase())).length,getTarget:()=>3,actionLabel:"Browse Risk Layer",actionView:"model",getDetails:e=>{const s=Object.values(e.elements).filter(n=>n.kind.toLowerCase()==="hazard").length,i=Object.values(e.elements).filter(n=>n.kind.toLowerCase()==="harm").length;return`${s} hazard(s) · ${i} harm(s)`}},{id:"risk-controls",icon:"🔗",title:"Connect Risk Chain",description:"Add risk controls and connect them to hazards with Mitigates relationships. Verify the ISO 14971 chain.",standard:"ISO 14971 §7–8",getCount:e=>e.relationships.filter(s=>s.type.toLowerCase()==="mitigates").length,getTarget:()=>2,actionLabel:"Traceability Matrix",actionView:"traceability",getDetails:e=>{const s=Object.values(e.elements).filter(n=>n.kind.toLowerCase()==="riskcontrol").length,i=e.relationships.filter(n=>n.type.toLowerCase()==="mitigates").length;return`${s} risk control(s) · ${i} mitigates link(s)`}},{id:"architecture",icon:"🏗️",title:"Define Architecture",description:"Add system and subsystem elements. This grounds requirements to real components.",standard:"IEC 62304 §5.3 · ISO 14971 §9",getCount:e=>Object.values(e.elements).filter(s=>["system","subsystem","logicalcomponent","softwarecomponent"].includes(s.kind.toLowerCase())).length,getTarget:()=>3,actionLabel:"Browse Model",actionView:"model",getDetails:e=>{const s=Object.values(e.elements).filter(n=>["system","subsystem"].includes(n.kind.toLowerCase())).length,i=Object.values(e.elements).filter(n=>n.kind.toLowerCase()==="softwarecomponent").length;return`${s} system/subsystem · ${i} software component(s)`}},{id:"verification",icon:"🧪",title:"Link Verification",description:"Add tests and link them to requirements. This closes the V&V loop and prepares your design review package.",standard:"IEC 62304 §5.7–5.8 · 21 CFR 820.30(g)",getCount:e=>Object.values(e.elements).filter(s=>s.kind.toLowerCase()==="test").length,getTarget:()=>3,actionLabel:"Traceability Matrix",actionView:"traceability",getDetails:e=>{const s=Object.values(e.elements).filter(n=>n.kind.toLowerCase()==="test").length,i=e.relationships.filter(n=>["satisfies","refines","traces","verifies"].includes(n.type.toLowerCase())).length;return`${s} test(s) · ${i} traceability link(s)`}}];function m({step:e,index:s,isActive:i,model:n,onSelect:d,onAction:c}){const r=e.getCount(n),o=e.getTarget(),a=r>=o,u=Math.min(100,Math.round(r/o*100)),h=e.getDetails(n),g=a?"#2ECC71":r>0?"#F39C12":"#E5E5E0";return t.jsxs("button",{onClick:d,style:{textAlign:"left",background:i?"#FFFFFF":"transparent",border:`1px solid ${i?"#1B3A4B20":"transparent"}`,borderRadius:"10px",padding:"14px 16px",cursor:"pointer",width:"100%",transition:"all 0.15s",boxShadow:i?"0 2px 8px rgba(0,0,0,0.06)":"none"},children:[t.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"10px"},children:[t.jsx("div",{style:{width:"28px",height:"28px",borderRadius:"50%",flexShrink:0,background:a?"#2ECC71":i?"#1B3A4B":"#F3F4F6",color:a||i?"#FFFFFF":"#6B7280",display:"flex",alignItems:"center",justifyContent:"center",fontSize:a?"14px":"12px",fontWeight:700},children:a?"✓":s+1}),t.jsxs("div",{style:{flex:1,minWidth:0},children:[t.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"6px"},children:[t.jsxs("span",{style:{fontSize:"13px",fontWeight:700,color:i?"#1B3A4B":"#374151"},children:[e.icon," ",e.title]}),r>0&&t.jsx("span",{style:{fontSize:"10px",fontWeight:600,padding:"1px 6px",borderRadius:"999px",background:g+"20",color:g},children:r})]}),h&&t.jsx("div",{style:{fontSize:"11px",color:"#9CA3AF",marginTop:"2px"},children:h})]}),t.jsxs("div",{style:{width:"40px",textAlign:"right",fontSize:"10px",color:"#9CA3AF",flexShrink:0},children:[u,"%"]})]}),t.jsx("div",{style:{marginTop:"8px",height:"3px",background:"#F3F4F6",borderRadius:"2px",marginLeft:"38px"},children:t.jsx("div",{style:{height:"100%",borderRadius:"2px",background:g,width:`${u}%`,transition:"width 0.4s ease"}})})]})}function f({step:e,model:s,onAction:i}){const n=e.getCount(s),d=e.getTarget(),c=n>=d;return t.jsxs("div",{style:{background:"#FFFFFF",border:"1px solid #E5E5E0",borderRadius:"12px",padding:"24px"},children:[t.jsx("div",{style:{fontSize:"32px",marginBottom:"12px"},children:e.icon}),t.jsx("h2",{style:{fontSize:"18px",fontWeight:800,color:"#1B3A4B",margin:"0 0 6px 0"},children:e.title}),t.jsx("div",{style:{fontSize:"11px",fontWeight:600,color:"#9CA3AF",marginBottom:"12px",fontFamily:"monospace"},children:e.standard}),t.jsx("p",{style:{fontSize:"13px",color:"#4B6E80",lineHeight:"1.7",margin:"0 0 20px 0"},children:e.description}),t.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"12px",padding:"14px 16px",borderRadius:"8px",background:c?"#2ECC7110":n>0?"#F39C1210":"#F3F4F6",marginBottom:"20px"},children:[t.jsx("div",{style:{fontSize:"24px",fontWeight:800,color:c?"#2ECC71":n>0?"#F39C12":"#9CA3AF"},children:n}),t.jsxs("div",{children:[t.jsx("div",{style:{fontSize:"13px",fontWeight:600,color:"#374151"},children:c?`✓ Target reached (${d}+ recommended)`:`${d-n} more recommended`}),t.jsx("div",{style:{fontSize:"11px",color:"#9CA3AF"},children:e.getDetails(s)})]})]}),t.jsxs("button",{onClick:()=>i(e.actionView),style:{width:"100%",padding:"12px",borderRadius:"8px",background:"#1B3A4B",color:"#FFFFFF",border:"none",fontSize:"13px",fontWeight:600,cursor:"pointer",transition:"background 0.15s"},onMouseEnter:r=>r.currentTarget.style.background="#244D63",onMouseLeave:r=>r.currentTarget.style.background="#1B3A4B",children:[e.actionLabel," →"]})]})}function y({model:e}){const s=l.filter(n=>n.getCount(e)>=n.getTarget()).length,i=Math.round(s/l.length*100);return t.jsxs("div",{style:{padding:"16px 20px",background:"#FFFFFF",borderRadius:"12px",border:"1px solid #E5E5E0",marginBottom:"16px"},children:[t.jsxs("div",{style:{display:"flex",justifyContent:"space-between",marginBottom:"8px"},children:[t.jsx("span",{style:{fontSize:"13px",fontWeight:700,color:"#1B3A4B"},children:"Golden Path Progress"}),t.jsxs("span",{style:{fontSize:"13px",fontWeight:700,color:"#1B3A4B"},children:[s,"/",l.length," steps"]})]}),t.jsx("div",{style:{height:"6px",background:"#F3F4F6",borderRadius:"3px"},children:t.jsx("div",{style:{height:"100%",borderRadius:"3px",background:i>=100?"#2ECC71":"#2DD4A8",width:`${i}%`,transition:"width 0.4s ease"}})})]})}function j(){const e=p(o=>o.model),s=p(o=>o.setActiveView),i=p(o=>o.setExplorerTab),n=x.useMemo(()=>{if(!e)return 0;for(let o=0;o<l.length;o++)if(l[o].getCount(e)<l[o].getTarget())return o;return l.length-1},[e]),[d,c]=x.useState(n);if(!e)return t.jsx("div",{style:{flex:1,display:"flex",alignItems:"center",justifyContent:"center",background:"#F7F7F5"},children:t.jsx("div",{style:{fontSize:"13px",color:"#9CA3AF"},children:"No model data"})});function r(o){switch(o){case"model":i("model"),s({type:"dashboard"});break;case"traceability":s({type:"traceability"});break;case"statistics":s({type:"statistics"});break;case"catalog":i("model"),s({type:"dashboard"});break}}return t.jsx("div",{style:{flex:1,overflowY:"auto",background:"#F7F7F5",padding:"28px 40px"},children:t.jsxs("div",{style:{maxWidth:"960px",margin:"0 auto"},children:[t.jsxs("div",{style:{display:"flex",alignItems:"flex-start",justifyContent:"space-between",marginBottom:"20px"},children:[t.jsxs("div",{children:[t.jsx("h1",{style:{fontSize:"20px",fontWeight:800,color:"#1B3A4B",margin:"0 0 4px 0"},children:"Workflow Wizard"}),t.jsx("p",{style:{fontSize:"12px",color:"#6B7280",margin:0},children:"Follow the golden path to a complete, review-ready device model"})]}),t.jsx("button",{onClick:()=>s({type:"dashboard"}),style:{fontSize:"12px",color:"#6B7280",background:"#F3F4F6",border:"1px solid #E5E5E0",borderRadius:"6px",padding:"6px 12px",cursor:"pointer",fontWeight:500},children:"← Back to Dashboard"})]}),t.jsx(y,{model:e}),t.jsxs("div",{style:{display:"grid",gridTemplateColumns:"380px 1fr",gap:"16px"},children:[t.jsx("div",{style:{background:"#F9FAFB",border:"1px solid #E5E5E0",borderRadius:"12px",padding:"8px",display:"flex",flexDirection:"column",gap:"2px"},children:l.map((o,a)=>t.jsx(m,{step:o,index:a,isActive:a===d,model:e,onSelect:()=>c(a),onAction:r},o.id))}),t.jsx(f,{step:l[d],model:e,onAction:r})]})]})})}export{j as WorkflowWizard};
@@ -0,0 +1 @@
1
+ /*! tailwindcss v4.2.1 | MIT License | https://tailwindcss.com */@layer properties{@supports (((-webkit-hyphens:none)) and (not (margin-trim:inline))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-translate-x:0;--tw-translate-y:0;--tw-translate-z:0;--tw-rotate-x:initial;--tw-rotate-y:initial;--tw-rotate-z:initial;--tw-skew-x:initial;--tw-skew-y:initial;--tw-space-y-reverse:0;--tw-border-style:solid;--tw-leading:initial;--tw-font-weight:initial;--tw-tracking:initial;--tw-shadow:0 0 #0000;--tw-shadow-color:initial;--tw-shadow-alpha:100%;--tw-inset-shadow:0 0 #0000;--tw-inset-shadow-color:initial;--tw-inset-shadow-alpha:100%;--tw-ring-color:initial;--tw-ring-shadow:0 0 #0000;--tw-inset-ring-color:initial;--tw-inset-ring-shadow:0 0 #0000;--tw-ring-inset:initial;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-offset-shadow:0 0 #0000;--tw-outline-style:solid;--tw-blur:initial;--tw-brightness:initial;--tw-contrast:initial;--tw-grayscale:initial;--tw-hue-rotate:initial;--tw-invert:initial;--tw-opacity:initial;--tw-saturate:initial;--tw-sepia:initial;--tw-drop-shadow:initial;--tw-drop-shadow-color:initial;--tw-drop-shadow-alpha:100%;--tw-drop-shadow-size:initial;--tw-backdrop-blur:initial;--tw-backdrop-brightness:initial;--tw-backdrop-contrast:initial;--tw-backdrop-grayscale:initial;--tw-backdrop-hue-rotate:initial;--tw-backdrop-invert:initial;--tw-backdrop-opacity:initial;--tw-backdrop-saturate:initial;--tw-backdrop-sepia:initial;--tw-duration:initial;--tw-ease:initial}}}@layer theme{:root,:host{--font-sans:ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";--font-mono:ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;--color-red-50:oklch(97.1% .013 17.38);--color-red-500:oklch(63.7% .237 25.331);--color-red-600:oklch(57.7% .245 27.325);--color-teal-100:oklch(95.3% .051 180.801);--color-teal-700:oklch(51.1% .096 186.391);--color-blue-100:oklch(93.2% .032 255.585);--color-blue-700:oklch(48.8% .243 264.376);--color-purple-100:oklch(94.6% .033 307.174);--color-purple-700:oklch(49.6% .265 301.924);--color-slate-50:oklch(98.4% .003 247.858);--color-slate-100:oklch(96.8% .007 247.896);--color-slate-300:oklch(86.9% .022 252.894);--color-gray-50:oklch(98.5% .002 247.839);--color-gray-100:oklch(96.7% .003 264.542);--color-gray-200:oklch(92.8% .006 264.531);--color-gray-400:oklch(70.7% .022 261.325);--color-gray-500:oklch(55.1% .027 264.364);--color-gray-600:oklch(44.6% .03 256.802);--color-gray-700:oklch(37.3% .034 259.733);--color-gray-800:oklch(27.8% .033 256.848);--color-gray-900:oklch(21% .034 264.665);--color-black:#000;--color-white:#fff;--spacing:.25rem;--container-sm:24rem;--container-md:28rem;--container-lg:32rem;--container-2xl:42rem;--container-3xl:48rem;--container-5xl:64rem;--text-xs:.75rem;--text-xs--line-height:calc(1 / .75);--text-sm:.875rem;--text-sm--line-height:calc(1.25 / .875);--text-base:1rem;--text-base--line-height: 1.5 ;--text-lg:1.125rem;--text-lg--line-height:calc(1.75 / 1.125);--text-xl:1.25rem;--text-xl--line-height:calc(1.75 / 1.25);--text-2xl:1.5rem;--text-2xl--line-height:calc(2 / 1.5);--text-3xl:1.875rem;--text-3xl--line-height: 1.2 ;--font-weight-normal:400;--font-weight-medium:500;--font-weight-semibold:600;--font-weight-bold:700;--tracking-wide:.025em;--tracking-wider:.05em;--leading-tight:1.25;--leading-relaxed:1.625;--radius-sm:.25rem;--radius-md:.375rem;--radius-lg:.5rem;--radius-xl:.75rem;--radius-2xl:1rem;--ease-in-out:cubic-bezier(.4, 0, .2, 1);--animate-pulse:pulse 2s cubic-bezier(.4, 0, .6, 1) infinite;--blur-sm:8px;--default-transition-duration:.15s;--default-transition-timing-function:cubic-bezier(.4, 0, .2, 1);--default-font-family:var(--font-sans);--default-mono-font-family:var(--font-mono)}}@layer base{*,:after,:before,::backdrop{box-sizing:border-box;border:0 solid;margin:0;padding:0}::file-selector-button{box-sizing:border-box;border:0 solid;margin:0;padding:0}html,:host{-webkit-text-size-adjust:100%;-moz-tab-size:4;tab-size:4;line-height:1.5;font-family:var(--default-font-family,ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji");font-feature-settings:var(--default-font-feature-settings,normal);font-variation-settings:var(--default-font-variation-settings,normal);-webkit-tap-highlight-color:transparent}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;-webkit-text-decoration:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:var(--default-mono-font-family,ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace);font-feature-settings:var(--default-mono-font-feature-settings,normal);font-variation-settings:var(--default-mono-font-variation-settings,normal);font-size:1em}small{font-size:80%}sub,sup{vertical-align:baseline;font-size:75%;line-height:0;position:relative}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}:-moz-focusring{outline:auto}progress{vertical-align:baseline}summary{display:list-item}ol,ul,menu{list-style:none}img,svg,video,canvas,audio,iframe,embed,object{vertical-align:middle;display:block}img,video{max-width:100%;height:auto}button,input,select,optgroup,textarea{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}::file-selector-button{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}:where(select:is([multiple],[size])) optgroup{font-weight:bolder}:where(select:is([multiple],[size])) optgroup option{padding-inline-start:20px}::file-selector-button{margin-inline-end:4px}::placeholder{opacity:1}@supports (not ((-webkit-appearance:-apple-pay-button))) or (contain-intrinsic-size:1px){::placeholder{color:currentColor}@supports (color:color-mix(in lab,red,red)){::placeholder{color:color-mix(in oklab,currentcolor 50%,transparent)}}}textarea{resize:vertical}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-date-and-time-value{min-height:1lh;text-align:inherit}::-webkit-datetime-edit{display:inline-flex}::-webkit-datetime-edit-fields-wrapper{padding:0}::-webkit-datetime-edit{padding-block:0}::-webkit-datetime-edit-year-field{padding-block:0}::-webkit-datetime-edit-month-field{padding-block:0}::-webkit-datetime-edit-day-field{padding-block:0}::-webkit-datetime-edit-hour-field{padding-block:0}::-webkit-datetime-edit-minute-field{padding-block:0}::-webkit-datetime-edit-second-field{padding-block:0}::-webkit-datetime-edit-millisecond-field{padding-block:0}::-webkit-datetime-edit-meridiem-field{padding-block:0}::-webkit-calendar-picker-indicator{line-height:1}:-moz-ui-invalid{box-shadow:none}button,input:where([type=button],[type=reset],[type=submit]){-webkit-appearance:button;-moz-appearance:button;appearance:button}::file-selector-button{-webkit-appearance:button;-moz-appearance:button;appearance:button}::-webkit-inner-spin-button{height:auto}::-webkit-outer-spin-button{height:auto}[hidden]:where(:not([hidden=until-found])){display:none!important}}@layer components;@layer utilities{.pointer-events-none{pointer-events:none}.collapse{visibility:collapse}.invisible{visibility:hidden}.visible{visibility:visible}.sr-only{clip-path:inset(50%);white-space:nowrap;border-width:0;width:1px;height:1px;margin:-1px;padding:0;position:absolute;overflow:hidden}.absolute{position:absolute}.fixed{position:fixed}.relative{position:relative}.static{position:static}.sticky{position:sticky}.inset-0{inset:calc(var(--spacing) * 0)}.inset-x-0{inset-inline:calc(var(--spacing) * 0)}.start{inset-inline-start:var(--spacing)}.end{inset-inline-end:var(--spacing)}.top-0{top:calc(var(--spacing) * 0)}.top-1\/2{top:50%}.top-3{top:calc(var(--spacing) * 3)}.top-7{top:calc(var(--spacing) * 7)}.top-16{top:calc(var(--spacing) * 16)}.top-full{top:100%}.right-0{right:calc(var(--spacing) * 0)}.right-3{right:calc(var(--spacing) * 3)}.right-full{right:100%}.bottom-3{bottom:calc(var(--spacing) * 3)}.bottom-12{bottom:calc(var(--spacing) * 12)}.left-0{left:calc(var(--spacing) * 0)}.left-1\/2{left:50%}.left-3{left:calc(var(--spacing) * 3)}.left-full{left:100%}.isolate{isolation:isolate}.z-10{z-index:10}.z-20{z-index:20}.z-30{z-index:30}.z-50{z-index:50}.z-\[100\]{z-index:100}.container{width:100%}@media(min-width:40rem){.container{max-width:40rem}}@media(min-width:48rem){.container{max-width:48rem}}@media(min-width:64rem){.container{max-width:64rem}}@media(min-width:80rem){.container{max-width:80rem}}@media(min-width:96rem){.container{max-width:96rem}}.m-3{margin:calc(var(--spacing) * 3)}.-mx-6{margin-inline:calc(var(--spacing) * -6)}.mx-0{margin-inline:calc(var(--spacing) * 0)}.mx-1{margin-inline:calc(var(--spacing) * 1)}.mx-3{margin-inline:calc(var(--spacing) * 3)}.mx-4{margin-inline:calc(var(--spacing) * 4)}.mx-auto{margin-inline:auto}.my-0{margin-block:calc(var(--spacing) * 0)}.mt-0\.5{margin-top:calc(var(--spacing) * .5)}.mt-1{margin-top:calc(var(--spacing) * 1)}.mt-1\.5{margin-top:calc(var(--spacing) * 1.5)}.mt-2{margin-top:calc(var(--spacing) * 2)}.mt-3{margin-top:calc(var(--spacing) * 3)}.mt-4{margin-top:calc(var(--spacing) * 4)}.mt-6{margin-top:calc(var(--spacing) * 6)}.mt-8{margin-top:calc(var(--spacing) * 8)}.mr-0\.5{margin-right:calc(var(--spacing) * .5)}.mr-2{margin-right:calc(var(--spacing) * 2)}.-mb-1{margin-bottom:calc(var(--spacing) * -1)}.mb-0\.5{margin-bottom:calc(var(--spacing) * .5)}.mb-1{margin-bottom:calc(var(--spacing) * 1)}.mb-1\.5{margin-bottom:calc(var(--spacing) * 1.5)}.mb-2{margin-bottom:calc(var(--spacing) * 2)}.mb-3{margin-bottom:calc(var(--spacing) * 3)}.mb-4{margin-bottom:calc(var(--spacing) * 4)}.mb-5{margin-bottom:calc(var(--spacing) * 5)}.mb-6{margin-bottom:calc(var(--spacing) * 6)}.mb-8{margin-bottom:calc(var(--spacing) * 8)}.ml-1{margin-left:calc(var(--spacing) * 1)}.ml-2{margin-left:calc(var(--spacing) * 2)}.ml-auto{margin-left:auto}.block{display:block}.contents{display:contents}.flex{display:flex}.grid{display:grid}.hidden{display:none}.inline{display:inline}.inline-block{display:inline-block}.inline-flex{display:inline-flex}.table{display:table}.h-1{height:calc(var(--spacing) * 1)}.h-1\.5{height:calc(var(--spacing) * 1.5)}.h-2{height:calc(var(--spacing) * 2)}.h-2\.5{height:calc(var(--spacing) * 2.5)}.h-3{height:calc(var(--spacing) * 3)}.h-4{height:calc(var(--spacing) * 4)}.h-5{height:calc(var(--spacing) * 5)}.h-6{height:calc(var(--spacing) * 6)}.h-8{height:calc(var(--spacing) * 8)}.h-\[11px\]{height:11px}.h-full{height:100%}.h-screen{height:100vh}.max-h-32{max-height:calc(var(--spacing) * 32)}.max-h-48{max-height:calc(var(--spacing) * 48)}.max-h-64{max-height:calc(var(--spacing) * 64)}.max-h-\[85vh\]{max-height:85vh}.max-h-full{max-height:100%}.min-h-0{min-height:calc(var(--spacing) * 0)}.w-2{width:calc(var(--spacing) * 2)}.w-2\.5{width:calc(var(--spacing) * 2.5)}.w-3{width:calc(var(--spacing) * 3)}.w-5{width:calc(var(--spacing) * 5)}.w-6{width:calc(var(--spacing) * 6)}.w-8{width:calc(var(--spacing) * 8)}.w-20{width:calc(var(--spacing) * 20)}.w-48{width:calc(var(--spacing) * 48)}.w-64{width:calc(var(--spacing) * 64)}.w-\[11px\]{width:11px}.w-\[400px\]{width:400px}.w-full{width:100%}.max-w-0{max-width:calc(var(--spacing) * 0)}.max-w-2xl{max-width:var(--container-2xl)}.max-w-3xl{max-width:var(--container-3xl)}.max-w-5xl{max-width:var(--container-5xl)}.max-w-lg{max-width:var(--container-lg)}.max-w-md{max-width:var(--container-md)}.max-w-sm{max-width:var(--container-sm)}.min-w-0{min-width:calc(var(--spacing) * 0)}.min-w-48{min-width:calc(var(--spacing) * 48)}.min-w-\[80px\]{min-width:80px}.min-w-\[100px\]{min-width:100px}.min-w-\[140px\]{min-width:140px}.flex-1{flex:1}.flex-shrink-0,.shrink-0{flex-shrink:0}.grow{flex-grow:1}.border-collapse{border-collapse:collapse}.-translate-x-1\/2{--tw-translate-x: -50% ;translate:var(--tw-translate-x) var(--tw-translate-y)}.-translate-y-1\/2{--tw-translate-y: -50% ;translate:var(--tw-translate-x) var(--tw-translate-y)}.transform{transform:var(--tw-rotate-x,) var(--tw-rotate-y,) var(--tw-rotate-z,) var(--tw-skew-x,) var(--tw-skew-y,)}.animate-pulse{animation:var(--animate-pulse)}.cursor-pointer{cursor:pointer}.resize{resize:both}.grid-cols-1{grid-template-columns:repeat(1,minmax(0,1fr))}.grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.flex-col{flex-direction:column}.flex-col-reverse{flex-direction:column-reverse}.flex-row{flex-direction:row}.flex-row-reverse{flex-direction:row-reverse}.flex-wrap{flex-wrap:wrap}.content-start{align-content:flex-start}.items-baseline{align-items:baseline}.items-center{align-items:center}.items-start{align-items:flex-start}.items-stretch{align-items:stretch}.justify-between{justify-content:space-between}.justify-center{justify-content:center}.justify-end{justify-content:flex-end}.justify-items-stretch{justify-items:stretch}.gap-0{gap:calc(var(--spacing) * 0)}.gap-0\.5{gap:calc(var(--spacing) * .5)}.gap-1{gap:calc(var(--spacing) * 1)}.gap-1\.5{gap:calc(var(--spacing) * 1.5)}.gap-2{gap:calc(var(--spacing) * 2)}.gap-2\.5{gap:calc(var(--spacing) * 2.5)}.gap-3{gap:calc(var(--spacing) * 3)}.gap-4{gap:calc(var(--spacing) * 4)}.gap-5{gap:calc(var(--spacing) * 5)}:where(.space-y-1>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 1) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 1) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-1\.5>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 1.5) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 1.5) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-2>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 2) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 2) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-3>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 3) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 3) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-4>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 4) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 4) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-5>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 5) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 5) * calc(1 - var(--tw-space-y-reverse)))}.gap-x-3{column-gap:calc(var(--spacing) * 3)}.gap-y-1{row-gap:calc(var(--spacing) * 1)}.gap-y-2{row-gap:calc(var(--spacing) * 2)}.truncate{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.overflow-auto{overflow:auto}.overflow-hidden{overflow:hidden}.overflow-y-auto{overflow-y:auto}.rounded{border-radius:.25rem}.rounded-2xl{border-radius:var(--radius-2xl)}.rounded-full{border-radius:3.40282e38px}.rounded-lg{border-radius:var(--radius-lg)}.rounded-md{border-radius:var(--radius-md)}.rounded-sm{border-radius:var(--radius-sm)}.rounded-xl{border-radius:var(--radius-xl)}.border{border-style:var(--tw-border-style);border-width:1px}.border-t{border-top-style:var(--tw-border-style);border-top-width:1px}.border-r{border-right-style:var(--tw-border-style);border-right-width:1px}.border-b{border-bottom-style:var(--tw-border-style);border-bottom-width:1px}.border-l{border-left-style:var(--tw-border-style);border-left-width:1px}.border-none{--tw-border-style:none;border-style:none}.border-gray-200{border-color:var(--color-gray-200)}.border-gray-200\/60{border-color:#e5e7eb99}@supports (color:color-mix(in lab,red,red)){.border-gray-200\/60{border-color:color-mix(in oklab,var(--color-gray-200) 60%,transparent)}}.border-slate-300{border-color:var(--color-slate-300)}.bg-black\/30{background-color:#0000004d}@supports (color:color-mix(in lab,red,red)){.bg-black\/30{background-color:color-mix(in oklab,var(--color-black) 30%,transparent)}}.bg-black\/60{background-color:#0009}@supports (color:color-mix(in lab,red,red)){.bg-black\/60{background-color:color-mix(in oklab,var(--color-black) 60%,transparent)}}.bg-blue-100{background-color:var(--color-blue-100)}.bg-gray-50{background-color:var(--color-gray-50)}.bg-gray-50\/30{background-color:#f9fafb4d}@supports (color:color-mix(in lab,red,red)){.bg-gray-50\/30{background-color:color-mix(in oklab,var(--color-gray-50) 30%,transparent)}}.bg-gray-50\/50{background-color:#f9fafb80}@supports (color:color-mix(in lab,red,red)){.bg-gray-50\/50{background-color:color-mix(in oklab,var(--color-gray-50) 50%,transparent)}}.bg-gray-100{background-color:var(--color-gray-100)}.bg-purple-100{background-color:var(--color-purple-100)}.bg-slate-50{background-color:var(--color-slate-50)}.bg-slate-100{background-color:var(--color-slate-100)}.bg-teal-100{background-color:var(--color-teal-100)}.bg-transparent{background-color:#0000}.bg-white{background-color:var(--color-white)}.p-1{padding:calc(var(--spacing) * 1)}.p-1\.5{padding:calc(var(--spacing) * 1.5)}.p-2{padding:calc(var(--spacing) * 2)}.p-2\.5{padding:calc(var(--spacing) * 2.5)}.p-3{padding:calc(var(--spacing) * 3)}.p-4{padding:calc(var(--spacing) * 4)}.p-5{padding:calc(var(--spacing) * 5)}.p-6{padding:calc(var(--spacing) * 6)}.p-8{padding:calc(var(--spacing) * 8)}.px-1{padding-inline:calc(var(--spacing) * 1)}.px-1\.5{padding-inline:calc(var(--spacing) * 1.5)}.px-2{padding-inline:calc(var(--spacing) * 2)}.px-2\.5{padding-inline:calc(var(--spacing) * 2.5)}.px-3{padding-inline:calc(var(--spacing) * 3)}.px-4{padding-inline:calc(var(--spacing) * 4)}.px-5{padding-inline:calc(var(--spacing) * 5)}.px-6{padding-inline:calc(var(--spacing) * 6)}.py-0\.5{padding-block:calc(var(--spacing) * .5)}.py-1{padding-block:calc(var(--spacing) * 1)}.py-1\.5{padding-block:calc(var(--spacing) * 1.5)}.py-2{padding-block:calc(var(--spacing) * 2)}.py-2\.5{padding-block:calc(var(--spacing) * 2.5)}.py-3{padding-block:calc(var(--spacing) * 3)}.py-4{padding-block:calc(var(--spacing) * 4)}.py-5{padding-block:calc(var(--spacing) * 5)}.py-6{padding-block:calc(var(--spacing) * 6)}.py-8{padding-block:calc(var(--spacing) * 8)}.py-12{padding-block:calc(var(--spacing) * 12)}.py-16{padding-block:calc(var(--spacing) * 16)}.pt-0\.5{padding-top:calc(var(--spacing) * .5)}.pt-1{padding-top:calc(var(--spacing) * 1)}.pt-1\.5{padding-top:calc(var(--spacing) * 1.5)}.pt-2{padding-top:calc(var(--spacing) * 2)}.pt-4{padding-top:calc(var(--spacing) * 4)}.pt-5{padding-top:calc(var(--spacing) * 5)}.pt-24{padding-top:calc(var(--spacing) * 24)}.pr-2{padding-right:calc(var(--spacing) * 2)}.pr-4{padding-right:calc(var(--spacing) * 4)}.pb-1{padding-bottom:calc(var(--spacing) * 1)}.pb-2{padding-bottom:calc(var(--spacing) * 2)}.pb-3{padding-bottom:calc(var(--spacing) * 3)}.pb-4{padding-bottom:calc(var(--spacing) * 4)}.pb-6{padding-bottom:calc(var(--spacing) * 6)}.text-center{text-align:center}.text-left{text-align:left}.text-right{text-align:right}.font-mono{font-family:var(--font-mono)}.text-2xl{font-size:var(--text-2xl);line-height:var(--tw-leading,var(--text-2xl--line-height))}.text-3xl{font-size:var(--text-3xl);line-height:var(--tw-leading,var(--text-3xl--line-height))}.text-base{font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height))}.text-lg{font-size:var(--text-lg);line-height:var(--tw-leading,var(--text-lg--line-height))}.text-sm{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.text-xl{font-size:var(--text-xl);line-height:var(--tw-leading,var(--text-xl--line-height))}.text-xs{font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height))}.text-\[10px\]{font-size:10px}.text-\[11px\]{font-size:11px}.text-\[15px\]{font-size:15px}.leading-relaxed{--tw-leading:var(--leading-relaxed);line-height:var(--leading-relaxed)}.leading-tight{--tw-leading:var(--leading-tight);line-height:var(--leading-tight)}.font-bold{--tw-font-weight:var(--font-weight-bold);font-weight:var(--font-weight-bold)}.font-medium{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.font-normal{--tw-font-weight:var(--font-weight-normal);font-weight:var(--font-weight-normal)}.font-semibold{--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold)}.tracking-wide{--tw-tracking:var(--tracking-wide);letter-spacing:var(--tracking-wide)}.tracking-wider{--tw-tracking:var(--tracking-wider);letter-spacing:var(--tracking-wider)}.break-all{word-break:break-all}.text-blue-700{color:var(--color-blue-700)}.text-gray-400{color:var(--color-gray-400)}.text-gray-500{color:var(--color-gray-500)}.text-gray-600{color:var(--color-gray-600)}.text-gray-700{color:var(--color-gray-700)}.text-gray-800{color:var(--color-gray-800)}.text-gray-900{color:var(--color-gray-900)}.text-purple-700{color:var(--color-purple-700)}.text-red-500{color:var(--color-red-500)}.text-teal-700{color:var(--color-teal-700)}.capitalize{text-transform:capitalize}.uppercase{text-transform:uppercase}.italic{font-style:italic}.line-through{text-decoration-line:line-through}.underline{text-decoration-line:underline}.opacity-0{opacity:0}.shadow{--tw-shadow:0 1px 3px 0 var(--tw-shadow-color,#0000001a), 0 1px 2px -1px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-2xl{--tw-shadow:0 25px 50px -12px var(--tw-shadow-color,#00000040);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-lg{--tw-shadow:0 10px 15px -3px var(--tw-shadow-color,#0000001a), 0 4px 6px -4px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-sm{--tw-shadow:0 1px 3px 0 var(--tw-shadow-color,#0000001a), 0 1px 2px -1px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-xl{--tw-shadow:0 20px 25px -5px var(--tw-shadow-color,#0000001a), 0 8px 10px -6px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.ring{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.outline{outline-style:var(--tw-outline-style);outline-width:1px}.blur{--tw-blur:blur(8px);filter:var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,)}.filter{filter:var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,)}.backdrop-blur-sm{--tw-backdrop-blur:blur(var(--blur-sm));-webkit-backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,);backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,)}.transition{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to,opacity,box-shadow,transform,translate,scale,rotate,filter,-webkit-backdrop-filter,backdrop-filter,display,content-visibility,overlay,pointer-events;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-all{transition-property:all;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-colors{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-opacity{transition-property:opacity;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-shadow{transition-property:box-shadow;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.duration-150{--tw-duration:.15s;transition-duration:.15s}.duration-200{--tw-duration:.2s;transition-duration:.2s}.ease-in-out{--tw-ease:var(--ease-in-out);transition-timing-function:var(--ease-in-out)}.select-none{-webkit-user-select:none;user-select:none}@media(hover:hover){.group-hover\:pointer-events-auto:is(:where(.group):hover *){pointer-events:auto}.group-hover\:visible:is(:where(.group):hover *){visibility:visible}.group-hover\:max-w-\[4\.5rem\]:is(:where(.group):hover *){max-width:4.5rem}.group-hover\:opacity-100:is(:where(.group):hover *){opacity:1}.hover\:bg-gray-50:hover{background-color:var(--color-gray-50)}.hover\:bg-gray-100:hover{background-color:var(--color-gray-100)}.hover\:bg-gray-200:hover{background-color:var(--color-gray-200)}.hover\:bg-red-50:hover{background-color:var(--color-red-50)}.hover\:bg-slate-100:hover{background-color:var(--color-slate-100)}.hover\:text-gray-600:hover{color:var(--color-gray-600)}.hover\:text-gray-700:hover{color:var(--color-gray-700)}.hover\:text-red-600:hover{color:var(--color-red-600)}.hover\:underline:hover{text-decoration-line:underline}.hover\:ring-1:hover{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}}.focus\:shadow-md:focus{--tw-shadow:0 4px 6px -1px var(--tw-shadow-color,#0000001a), 0 2px 4px -2px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.focus\:outline-none:focus{--tw-outline-style:none;outline-style:none}:where(.selected) .in-\[\.selected\]\:shadow-lg{--tw-shadow:0 10px 15px -3px var(--tw-shadow-color,#0000001a), 0 4px 6px -4px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}@media(min-width:48rem){.md\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.md\:grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}}}:root{--color-bg:#f7f7f5;--color-surface:#fff;--color-surface-alt:#f0f0ed;--color-border:#e5e5e0;--color-border-light:#ededea;--color-text:#1a1a1a;--color-text-secondary:#6b7280;--color-text-muted:#9ca3af;--color-accent:#2dd4a8;--color-hero-from:#1b3a4b;--color-hero-to:#2d6a7a}body{background:var(--color-bg);color:var(--color-text);-webkit-font-smoothing:antialiased;margin:0;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Inter,Roboto,sans-serif}#root{flex-direction:column;height:100vh;display:flex}.react-flow__controls{overflow:hidden;border:1px solid #e5e5e0!important;border-radius:12px!important;box-shadow:0 1px 3px #0000000f!important}.react-flow__controls-button{fill:#6b7280!important;background:#fff!important;border-bottom:1px solid #ededea!important}.react-flow__controls-button:hover{background:#f0f0ed!important}.react-flow__minimap{overflow:hidden;border:1px solid #e5e5e0!important;border-radius:12px!important;box-shadow:0 1px 3px #0000000f!important}::-webkit-scrollbar{width:6px}::-webkit-scrollbar-track{background:0 0}::-webkit-scrollbar-thumb{background:#d1d5db;border-radius:3px}::-webkit-scrollbar-thumb:hover{background:#9ca3af}.memo-explorer-resizer{z-index:30;cursor:col-resize;touch-action:none;outline:none;width:8px;position:absolute;top:0;bottom:0;right:-4px}.memo-explorer-resizer:after{content:"";background:0 0;width:2px;transition:background .12s;position:absolute;top:0;bottom:0;right:3px}.memo-explorer-resizer:hover:after,.memo-explorer-resizer:focus-visible:after{background:#38bdf8}.react-flow__node{transition:box-shadow .15s,opacity .15s}.ibd-interconnection-edge .react-flow__edge-interaction{pointer-events:none}@keyframes memo-ibd-flow{to{stroke-dashoffset:-30px}}.memo-ibd-flow{stroke-dasharray:8 7;pointer-events:none;animation:.7s linear infinite memo-ibd-flow}@media(prefers-reduced-motion:reduce){.memo-ibd-flow{animation:none}}.react-flow__edge path{transition:stroke-width .15s}.react-flow__edge:hover path{stroke-width:3px}.memo-diagram-canvas .react-flow__pane.draggable,.memo-diagram-canvas .react-flow__pane.selection,.memo-diagram-canvas .react-flow__node.draggable{cursor:default}.memo-diagram-canvas .react-flow__node.draggable:hover{cursor:pointer!important}.memo-diagram-canvas .react-flow__pane.dragging{cursor:grabbing}.memo-diagram-canvas .react-flow__node.dragging{cursor:grabbing!important}.memo-diagram-canvas .react-flow__resize-control{opacity:0;transition:opacity 80ms}.memo-diagram-canvas .react-flow__resize-control:hover,.memo-diagram-canvas .react-flow__resize-control:active{opacity:1}.memo-diagram-canvas .ibd-port-resize-handle{opacity:0;box-sizing:border-box;background:#fff;border:1.5px solid #2563eb;border-radius:2px;transition:opacity 80ms}.memo-diagram-canvas .ibd-port-resize-handle:hover,.memo-diagram-canvas .ibd-port-resize-handle:active{opacity:1}.memo-diagram-canvas .react-flow__edgeupdater{fill:#fff;stroke:#2563eb;stroke-width:1.5px;opacity:0;pointer-events:none;cursor:grab;transition:opacity .1s}.memo-diagram-canvas .react-flow__edge:hover .react-flow__edgeupdater,.memo-diagram-canvas .react-flow__edge.selected .react-flow__edgeupdater,.memo-diagram-canvas .react-flow__edgeupdater:hover{opacity:1;pointer-events:all}.memo-diagram-canvas .react-flow__edgeupdater:active{cursor:grabbing}.react-flow__node:hover .react-flow__handle{opacity:1!important}.react-flow__node:hover .react-flow__handle.ibd-port-anchor,.react-flow__handle.ibd-port-anchor{opacity:0!important;pointer-events:none!important}.react-flow__node:hover .react-flow__handle.ibd-port-connect,.react-flow__handle.ibd-port-connect{opacity:0!important}.memo-diagram-tools [title]{position:relative}.memo-diagram-tools [title]:after{content:attr(title);z-index:60;color:#fff;pointer-events:none;opacity:0;background:#1b3a4b;border-radius:5px;width:max-content;max-width:260px;padding:5px 7px;font-size:11px;font-weight:600;line-height:1.25;transition:opacity 70ms;position:absolute;top:50%;left:calc(100% + 7px);transform:translateY(-50%);box-shadow:0 2px 8px #0000002e}.memo-diagram-tools [title]:hover:after,.memo-diagram-tools [title]:focus-visible:after{opacity:1}.memo-diagram-tools--left>button,.memo-diagram-tools--left>[style*="position: relative"]>button,.memo-diagram-tools--left>[style*=grid-column]>button,.memo-diagram-tools--left #memo-diagram-editor-controls button,.memo-diagram-tools--left .memo-diagram-tools__layout-reset>button{justify-content:center;min-width:38px;height:38px;min-height:38px;border:1px solid #e2e1db!important;border-radius:9px!important;width:38px!important;padding:0!important}.memo-diagram-tools--left>span{display:none}.memo-diagram-tools--left>.memo-diagram-tools__layout-divider{background:#e2e1db;grid-column:1/-1;width:100%;height:1px;margin:2px 0}.memo-diagram-tools--left>.memo-diagram-tools__layout-reset-divider{order:-1}.memo-diagram-tools--left .memo-diagram-tools__layout-reset>button{order:-2}.memo-diagram-tools--left>.memo-diagram-tools__document-actions-divider{order:1}.memo-diagram-tools--left>.memo-diagram-tools__document-action,.memo-diagram-tools--left #memo-diagram-editor-controls button{order:2}.memo-diagram-tools--left>button>span:not([aria-hidden]),.memo-diagram-tools--left>button>span[aria-hidden]+span,.memo-diagram-tools--left>[style*="position: relative"]>button>span:not([aria-hidden]),.memo-diagram-tools--left>[style*="position: relative"]>button>span[aria-hidden]+span,.memo-diagram-tools--left #memo-diagram-editor-controls button>span:not([aria-hidden]),.memo-diagram-tools--left #memo-diagram-editor-controls button>span[aria-hidden]+span,.memo-diagram-tools--left .memo-diagram-tools__layout-reset>button>span:not([aria-hidden]),.memo-diagram-tools--left .memo-diagram-tools__layout-reset>button>span[aria-hidden]+span{display:none}.memo-diagram-tools--left button{color:#5b6470!important;background:#fff!important}.memo-diagram-tools--left button[aria-pressed=true]{box-shadow:inset 0 0 0 1px #d8e7f0;color:#1b3a4b!important;border-color:#7fa8c2!important}.memo-diagram-tools--top{align-content:flex-start;min-height:86px}.memo-diagram-tools--top>button,.memo-diagram-tools--top>[style*="position: relative"]>button,.memo-diagram-tools--top>[style*=grid-column]>button{flex:0 0 38px;justify-content:center;min-width:38px;height:38px;min-height:38px;width:38px!important;padding:0!important}.memo-diagram-tools--top>[role=tablist] button,.memo-diagram-tools--top>.flex.rounded button{width:38px;min-width:38px;height:38px;padding:0}@property --tw-translate-x{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-y{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-z{syntax:"*";inherits:false;initial-value:0}@property --tw-rotate-x{syntax:"*";inherits:false}@property --tw-rotate-y{syntax:"*";inherits:false}@property --tw-rotate-z{syntax:"*";inherits:false}@property --tw-skew-x{syntax:"*";inherits:false}@property --tw-skew-y{syntax:"*";inherits:false}@property --tw-space-y-reverse{syntax:"*";inherits:false;initial-value:0}@property --tw-border-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-leading{syntax:"*";inherits:false}@property --tw-font-weight{syntax:"*";inherits:false}@property --tw-tracking{syntax:"*";inherits:false}@property --tw-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-shadow-color{syntax:"*";inherits:false}@property --tw-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-inset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-shadow-color{syntax:"*";inherits:false}@property --tw-inset-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-ring-color{syntax:"*";inherits:false}@property --tw-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-ring-color{syntax:"*";inherits:false}@property --tw-inset-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-ring-inset{syntax:"*";inherits:false}@property --tw-ring-offset-width{syntax:"<length>";inherits:false;initial-value:0}@property --tw-ring-offset-color{syntax:"*";inherits:false;initial-value:#fff}@property --tw-ring-offset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-outline-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-blur{syntax:"*";inherits:false}@property --tw-brightness{syntax:"*";inherits:false}@property --tw-contrast{syntax:"*";inherits:false}@property --tw-grayscale{syntax:"*";inherits:false}@property --tw-hue-rotate{syntax:"*";inherits:false}@property --tw-invert{syntax:"*";inherits:false}@property --tw-opacity{syntax:"*";inherits:false}@property --tw-saturate{syntax:"*";inherits:false}@property --tw-sepia{syntax:"*";inherits:false}@property --tw-drop-shadow{syntax:"*";inherits:false}@property --tw-drop-shadow-color{syntax:"*";inherits:false}@property --tw-drop-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-drop-shadow-size{syntax:"*";inherits:false}@property --tw-backdrop-blur{syntax:"*";inherits:false}@property --tw-backdrop-brightness{syntax:"*";inherits:false}@property --tw-backdrop-contrast{syntax:"*";inherits:false}@property --tw-backdrop-grayscale{syntax:"*";inherits:false}@property --tw-backdrop-hue-rotate{syntax:"*";inherits:false}@property --tw-backdrop-invert{syntax:"*";inherits:false}@property --tw-backdrop-opacity{syntax:"*";inherits:false}@property --tw-backdrop-saturate{syntax:"*";inherits:false}@property --tw-backdrop-sepia{syntax:"*";inherits:false}@property --tw-duration{syntax:"*";inherits:false}@property --tw-ease{syntax:"*";inherits:false}@keyframes pulse{50%{opacity:.5}}