pilotswarm 0.5.31 → 0.5.33

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 (70) hide show
  1. package/package.json +2 -2
  2. package/ui/core/src/reducer.js +31 -1
  3. package/ui/core/src/selectors.js +8 -1
  4. package/ui/react/src/web-app.js +31 -3
  5. package/web/dist/assets/{abnfDiagram-VRR7QNED-B6Jg6EVO.js → abnfDiagram-VRR7QNED-DlP1x0QR.js} +1 -1
  6. package/web/dist/assets/{arc-CXlpRoiY.js → arc-Zo_8acjl.js} +1 -1
  7. package/web/dist/assets/{architectureDiagram-ZJ3FMSHR-Cz0HaJpP.js → architectureDiagram-ZJ3FMSHR-Bc18aajT.js} +1 -1
  8. package/web/dist/assets/{blockDiagram-677ZJIJ3-DZWo4rKx.js → blockDiagram-677ZJIJ3-DU76JwlX.js} +1 -1
  9. package/web/dist/assets/{c4Diagram-LMCZKHZV-B14XBZjN.js → c4Diagram-LMCZKHZV-COqs9Vhg.js} +1 -1
  10. package/web/dist/assets/channel-DA38xcdK.js +1 -0
  11. package/web/dist/assets/{chunk-2Q5K7J3B-Bwh2l9hA.js → chunk-2Q5K7J3B-DLg4HU8R.js} +1 -1
  12. package/web/dist/assets/{chunk-32BRIVSS-k8Ij2VYH.js → chunk-32BRIVSS-CU0Q4Vsz.js} +1 -1
  13. package/web/dist/assets/{chunk-5VM5RSS4-CsDT6hRk.js → chunk-5VM5RSS4-BqRSeab5.js} +1 -1
  14. package/web/dist/assets/{chunk-EX3LRPZG-BdjmGnAk.js → chunk-EX3LRPZG-DenHmuGS.js} +1 -1
  15. package/web/dist/assets/{chunk-JWPE2WC7-DOZ5TNvG.js → chunk-JWPE2WC7-BUpE28jH.js} +1 -1
  16. package/web/dist/assets/{chunk-MOJQB5TN-DEJZZ1iz.js → chunk-MOJQB5TN-D4WdKP4p.js} +1 -1
  17. package/web/dist/assets/{chunk-RYQCIY6F-lRr0UvHd.js → chunk-RYQCIY6F-DJgnfeyv.js} +1 -1
  18. package/web/dist/assets/{chunk-V7JOEXUC-CSvoAMmI.js → chunk-V7JOEXUC-DII2R5xT.js} +1 -1
  19. package/web/dist/assets/{chunk-VR4S4FIN-DTJAD-L9.js → chunk-VR4S4FIN-BJ_02Sft.js} +1 -1
  20. package/web/dist/assets/{chunk-XXDRQBXY-BVYiFUoV.js → chunk-XXDRQBXY-DTi_vPws.js} +1 -1
  21. package/web/dist/assets/classDiagram-OUVF2IWQ-1k2XCPxl.js +1 -0
  22. package/web/dist/assets/classDiagram-v2-EOCWNBFH-1k2XCPxl.js +1 -0
  23. package/web/dist/assets/{cose-bilkent-JH36ORCC-CWHrN90k.js → cose-bilkent-JH36ORCC-DzdVN7Sx.js} +1 -1
  24. package/web/dist/assets/{cynefin-VYW2F7L2-D59sMrUm.js → cynefin-VYW2F7L2-CLw-4-yw.js} +1 -1
  25. package/web/dist/assets/{cynefinDiagram-TSTJHNR4-K9FBPccF.js → cynefinDiagram-TSTJHNR4-P8h9O8wh.js} +1 -1
  26. package/web/dist/assets/{dagre-VKFMJZFB-BM7OoDEy.js → dagre-VKFMJZFB-CDArowlh.js} +1 -1
  27. package/web/dist/assets/{diagram-FQU43EPY-CJzzgGhs.js → diagram-FQU43EPY-GiMWEGCC.js} +1 -1
  28. package/web/dist/assets/{diagram-G47NLZAW-5pzXsCDr.js → diagram-G47NLZAW-CpiRJOW2.js} +1 -1
  29. package/web/dist/assets/{diagram-NH7WQ7WH-DxOZ99XW.js → diagram-NH7WQ7WH-BOdTWSov.js} +1 -1
  30. package/web/dist/assets/{diagram-OA4YK3LP-DOacm091.js → diagram-OA4YK3LP-BPKB7KD5.js} +1 -1
  31. package/web/dist/assets/{diagram-WEI45ONY-BahZjEvH.js → diagram-WEI45ONY-CPS66m-d.js} +1 -1
  32. package/web/dist/assets/{ebnfDiagram-CCIWWBDH-B6ECkTWL.js → ebnfDiagram-CCIWWBDH-nbpYqaxu.js} +1 -1
  33. package/web/dist/assets/{erDiagram-Q63AITRT-mVD6I-vf.js → erDiagram-Q63AITRT-BF547i7I.js} +1 -1
  34. package/web/dist/assets/{flowDiagram-23GEKE2U-C4aUdoJ_.js → flowDiagram-23GEKE2U-CWIuM8_R.js} +1 -1
  35. package/web/dist/assets/{ganttDiagram-NO4QXBWP-BtlpZbzc.js → ganttDiagram-NO4QXBWP-DZRmOOgZ.js} +1 -1
  36. package/web/dist/assets/{gitGraphDiagram-IHSO6WYX-BhFyRrAD.js → gitGraphDiagram-IHSO6WYX-DQASL6yJ.js} +1 -1
  37. package/web/dist/assets/index-Do0UrHeI.css +1 -0
  38. package/web/dist/assets/{index-D7XAx2Lr.js → index-MikpTOty.js} +6 -6
  39. package/web/dist/assets/{infoDiagram-FWYZ7A6U-BCvX64-p.js → infoDiagram-FWYZ7A6U-DlK6reuU.js} +1 -1
  40. package/web/dist/assets/{ishikawaDiagram-FXEZZL3T-BSn6_T0C.js → ishikawaDiagram-FXEZZL3T-DOiJ-xI_.js} +1 -1
  41. package/web/dist/assets/{journeyDiagram-5HDEW3XC-DQ_o7o49.js → journeyDiagram-5HDEW3XC-B4EVeK0i.js} +1 -1
  42. package/web/dist/assets/{kanban-definition-HUTT4EX6-B7_vixph.js → kanban-definition-HUTT4EX6-eBT_l0PV.js} +1 -1
  43. package/web/dist/assets/{linear-s_NWXV09.js → linear-CGPMpgYy.js} +1 -1
  44. package/web/dist/assets/{mermaid.core-DfKXu_iO.js → mermaid.core-CMg-D4qI.js} +4 -4
  45. package/web/dist/assets/{mindmap-definition-LN4V7U3C-CnPoIj_9.js → mindmap-definition-LN4V7U3C-COIkL1R_.js} +1 -1
  46. package/web/dist/assets/{papaparse.min-D0bEfQ6q.js → papaparse.min-BkzE5bQr.js} +1 -1
  47. package/web/dist/assets/{pegDiagram-2B236MQR-95e7M-Gf.js → pegDiagram-2B236MQR-nXLPVk3y.js} +1 -1
  48. package/web/dist/assets/{pieDiagram-ENE6RG2P-BBupPpGy.js → pieDiagram-ENE6RG2P-CLFUyga1.js} +1 -1
  49. package/web/dist/assets/{pilotswarm-CrkuNMdN.js → pilotswarm-C17s5NOb.js} +39 -39
  50. package/web/dist/assets/{quadrantDiagram-ABIIQ3AL-BtAFN6YL.js → quadrantDiagram-ABIIQ3AL-BHSt68p5.js} +1 -1
  51. package/web/dist/assets/{railroadDiagram-RFXS5EU6-D-iiFFZP.js → railroadDiagram-RFXS5EU6-CyohRm8J.js} +1 -1
  52. package/web/dist/assets/{requirementDiagram-TGXJPOKE-D5OE9UHr.js → requirementDiagram-TGXJPOKE-CQTikEcB.js} +1 -1
  53. package/web/dist/assets/{sankeyDiagram-HTMAVEWB-gQjiHMA4.js → sankeyDiagram-HTMAVEWB-CxDlhil0.js} +1 -1
  54. package/web/dist/assets/{sequenceDiagram-DBY2YBRQ-CZhVnr2O.js → sequenceDiagram-DBY2YBRQ-n4ZRJPY0.js} +1 -1
  55. package/web/dist/assets/{sizeCapture-X5ZJPWSS-DMzYlLpq.js → sizeCapture-X5ZJPWSS-J_LGaCmN.js} +1 -1
  56. package/web/dist/assets/{stateDiagram-2N3HPSRC-DLhjleJj.js → stateDiagram-2N3HPSRC-CWavHbpD.js} +1 -1
  57. package/web/dist/assets/stateDiagram-v2-6OUMAXLB-ClqTpkzd.js +1 -0
  58. package/web/dist/assets/{swimlanes-5IMT3BWC-gf8k1-EE.js → swimlanes-5IMT3BWC-l-bxBeeJ.js} +2 -2
  59. package/web/dist/assets/swimlanesDiagram-G3AALYLV-Bfar1rKu.js +8 -0
  60. package/web/dist/assets/{timeline-definition-FHXFAJF6-3Eh9mWX5.js → timeline-definition-FHXFAJF6-ChA5iURW.js} +1 -1
  61. package/web/dist/assets/{vennDiagram-L72KCM5P-CD_6s6Aw.js → vennDiagram-L72KCM5P-DVkk3iKL.js} +1 -1
  62. package/web/dist/assets/{wardleyDiagram-EHGQE667-0UHyI4So.js → wardleyDiagram-EHGQE667-CrN8c7Sv.js} +1 -1
  63. package/web/dist/assets/{xychartDiagram-FW5EYKEG-UgOpbm2K.js → xychartDiagram-FW5EYKEG-Hym-Hdkg.js} +1 -1
  64. package/web/dist/index.html +3 -3
  65. package/web/dist/assets/channel-B41IiEwn.js +0 -1
  66. package/web/dist/assets/classDiagram-OUVF2IWQ-DqVK0a7s.js +0 -1
  67. package/web/dist/assets/classDiagram-v2-EOCWNBFH-DqVK0a7s.js +0 -1
  68. package/web/dist/assets/index-D2B5bzSN.css +0 -1
  69. package/web/dist/assets/stateDiagram-v2-6OUMAXLB-C1XyS16K.js +0 -1
  70. package/web/dist/assets/swimlanesDiagram-G3AALYLV-COGrmqEf.js +0 -8
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pilotswarm",
3
- "version": "0.5.31",
3
+ "version": "0.5.33",
4
4
  "description": "PilotSwarm application package: terminal UI, browser portal + Web API server, and MCP server — one install, three bins.",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -81,7 +81,7 @@
81
81
  "ink": "^6.8.0",
82
82
  "jose": "^6.2.2",
83
83
  "mermaid": "^11.16.0",
84
- "pilotswarm-sdk": "0.5.31",
84
+ "pilotswarm-sdk": "0.5.33",
85
85
  "react": "^19.2.4",
86
86
  "react-dom": "^19.2.4",
87
87
  "ws": "^8.18.2"
@@ -53,8 +53,38 @@ function isPinnableSession(session) {
53
53
  );
54
54
  }
55
55
 
56
+ /**
57
+ * Keep a pin unless the row is loaded AND demonstrably no longer pinnable.
58
+ *
59
+ * Same rule, and the same reasoning, as pruneCollapsedIds below: a row missing
60
+ * from the current listing has NOT been unpinned. Not-loaded, filtered out,
61
+ * on another page, or simply slower to arrive are indistinguishable from here,
62
+ * and none of them is the user changing their mind.
63
+ *
64
+ * This ran unguarded on every `sessions/loaded`, so any listing that did not
65
+ * happen to contain the pinned row dropped the pin — and because pinnedIds is
66
+ * a dependency of the profile-save effect, the emptied list was then written
67
+ * back to the server as the user's preference. That is a one-way ratchet: the
68
+ * pin did not survive a restart, and the destroyed preference propagated to
69
+ * every other device, which is why a pin set on the desktop never reached the
70
+ * phone.
71
+ *
72
+ * A session that is genuinely present and NOT pinnable (moved into a group or
73
+ * under a parent, or a system row) is a real signal, so that still drops.
74
+ */
56
75
  function prunePinnedIds(ids, byId) {
57
- return pruneIdList(ids, byId).filter((sessionId) => isPinnableSession(byId[sessionId]));
76
+ const out = [];
77
+ const seen = new Set();
78
+ for (const id of ids || []) {
79
+ if (!id || seen.has(id)) continue;
80
+ seen.add(id);
81
+ const session = byId?.[id];
82
+ // Absent from this listing tells us nothing — keep it. A stale id
83
+ // matches no row and hoists nothing; a wrongly dropped one costs the
84
+ // user their pin permanently.
85
+ if (!session || isPinnableSession(session)) out.push(id);
86
+ }
87
+ return out;
58
88
  }
59
89
 
60
90
 
@@ -754,8 +754,15 @@ function buildSessionRowView(entry, session, state, totalDescendantCounts, visib
754
754
  // Multi-selection reads as a selection BAR on the chosen rows (plus the
755
755
  // host's own row styling) — not a checkbox column that shifts every row
756
756
  // the moment selection mode turns on.
757
+ // role:"selection" so a host that already SHOWS selection some other way
758
+ // can drop the glyph instead of paying a cell for it — the same contract
759
+ // role:"status" and role:"depth" already use. The portal outlines the row,
760
+ // so the bar there was pure duplication that cost one column: selected
761
+ // rows truncated one character earlier than their neighbours, which
762
+ // clipped the pin/folder/system icon on any row whose glyph happened to
763
+ // land on the boundary. The TUI ignores the tag and keeps the bar.
757
764
  if (isSelected) {
758
- prefixRuns.push({ text: "▌", color: "cyan", bold: true });
765
+ prefixRuns.push({ text: "▌", color: "cyan", bold: true, role: "selection" });
759
766
  }
760
767
 
761
768
  // Pin column renders first on top-level non-system rows so pinned and
@@ -3426,6 +3426,9 @@ function portalRowRuns(runs, theme) {
3426
3426
  const rest = [];
3427
3427
  for (const run of runs) {
3428
3428
  if (run?.role === "depth") continue;
3429
+ // The row's own styling already marks selection; drawing the bar too
3430
+ // would cost a column and truncate the row early.
3431
+ if (run?.role === "selection") continue;
3429
3432
  if (run?.role === "status") {
3430
3433
  statusColor = resolveColor(theme, run.color) || null;
3431
3434
  continue;
@@ -3736,9 +3739,21 @@ function SessionPane({ controller, actions = null, panelClassName = "", structur
3736
3739
  && String(activeSession.owner.provider) === String(authPrincipal.provider)
3737
3740
  && String(activeSession.owner.subject) === String(authPrincipal.subject),
3738
3741
  );
3742
+ // System sessions are ADMIN-modifiable and read-only for everyone else —
3743
+ // which is exactly what the server already enforces in
3744
+ // evaluateSessionAccess: an admin passes every class, and for a non-admin
3745
+ // a system session allows read and refuses every write with "System
3746
+ // sessions are managed by administrators."
3747
+ //
3748
+ // This gate used to be STRICTER than the server, excluding isSystem for
3749
+ // everybody, so an admin who was entitled to rename or re-model the
3750
+ // sweeper had the button disabled with no way to reach the capability.
3751
+ // Client and server now agree; the server remains the enforcement point.
3739
3752
  const canModifyActiveSession = Boolean(
3740
- activeSession && !activeSession.isSystem && !activeSession.isGroup
3741
- && (isAdminViewer || ownsActiveSession),
3753
+ activeSession && !activeSession.isGroup
3754
+ && (activeSession.isSystem
3755
+ ? isAdminViewer
3756
+ : (isAdminViewer || ownsActiveSession)),
3742
3757
  );
3743
3758
  const selectedCount = Array.isArray(viewState.selectedIds) ? viewState.selectedIds.length : 0;
3744
3759
  const isBulkSelection = selectedCount > 1;
@@ -4191,7 +4206,20 @@ function SessionPane({ controller, actions = null, panelClassName = "", structur
4191
4206
  icon: React.createElement(ManageGlyph),
4192
4207
  onClick: () => setManageOpen(true),
4193
4208
  disabled: !canModifyActiveSession || isBulkSelection,
4194
- label: isBulkSelection ? "Disabled while multiple sessions are selected" : "Manage session — rename, switch model, and sharing",
4209
+ // A disabled control has to say WHY. This label used to describe
4210
+ // the ENABLED behaviour in every disabled case except bulk
4211
+ // selection, so on a system session the tooltip promised "rename,
4212
+ // switch model, and sharing" while the click did nothing — which
4213
+ // reads as a broken dialog rather than an unavailable action.
4214
+ label: isBulkSelection
4215
+ ? "Disabled while multiple sessions are selected"
4216
+ : activeSession?.isSystem
4217
+ ? "System sessions are managed by administrators"
4218
+ : activeSession?.isGroup
4219
+ ? "Folders cannot be managed here — use the folder controls"
4220
+ : !canModifyActiveSession
4221
+ ? "Only this session's owner or an admin can manage it"
4222
+ : "Manage session — rename, switch model, and sharing",
4195
4223
  }),
4196
4224
  React.createElement(IconButton, {
4197
4225
  className: "ps-mini-button",
@@ -1 +1 @@
1
- import{g as p,r as u,d as a}from"./chunk-MOJQB5TN-DEJZZ1iz.js";import{p as f}from"./chunk-JWPE2WC7-DOZ5TNvG.js";import{_ as n,l as o}from"./mermaid.core-DfKXu_iO.js";import{M as c,b as d}from"./cynefin-VYW2F7L2-D59sMrUm.js";import"./pilotswarm-CrkuNMdN.js";var v=d().RailroadAbnf.parser.LangiumParser,i=n(e=>{const r=e.alternatives.map(g);return r.length===1?r[0]:{type:"choice",alternatives:r}},"transformAlternation"),g=n(e=>{const r=e.elements.map(y);return r.length===1?r[0]:{type:"sequence",elements:r}},"transformConcatenation"),b=n(e=>{if(e.includes("*")){const[t,s]=e.split("*"),l=t?parseInt(t,10):0,m=s?parseInt(s,10):1/0;return{min:l,max:m}}const r=parseInt(e,10);return{min:r,max:r}},"parseRepeat"),y=n(e=>{const r=A(e.primary);if(!e.repeat)return r;const{min:t,max:s}=b(e.repeat);return t===0&&s===1?{type:"optional",element:r}:{type:"repetition",element:r,min:t,max:s}},"transformElement"),A=n(e=>{switch(e.$type){case"AbnfStringLiteral":return{type:"terminal",value:e.value};case"AbnfNumVal":return{type:"terminal",value:e.value};case"AbnfRuleName":return{type:"nonterminal",name:e.name};case"AbnfGroup":return i(e.element);case"AbnfOptionalGroup":return{type:"optional",element:i(e.element)};default:throw new Error(`Unsupported ABNF primary node: ${e.$type}`)}},"transformPrimary"),P=n(e=>({name:e.name,definition:i(e.definition)}),"transformRule"),h=n(e=>{f(e,a),e.title&&a.setTitle(e.title),e.rules.map(r=>a.addRule(P(r)))},"populateDb"),R={parse:n(e=>{a.clear(),o.debug("[ABNF Parser] Starting Langium parse");const r=v.parse(e);if(r.lexerErrors.length>0||r.parserErrors.length>0)throw new c(r);const t=r.value;o.debug("[ABNF Parser] Parsed rules:",t.rules.length),h(t),o.debug("[ABNF Parser] Parse complete")},"parse"),parser:{yy:a}},B={parser:R,db:a,renderer:u,styles:p};export{B as diagram};
1
+ import{g as p,r as u,d as a}from"./chunk-MOJQB5TN-D4WdKP4p.js";import{p as f}from"./chunk-JWPE2WC7-BUpE28jH.js";import{_ as n,l as o}from"./mermaid.core-CMg-D4qI.js";import{M as c,b as d}from"./cynefin-VYW2F7L2-CLw-4-yw.js";import"./pilotswarm-C17s5NOb.js";var v=d().RailroadAbnf.parser.LangiumParser,i=n(e=>{const r=e.alternatives.map(g);return r.length===1?r[0]:{type:"choice",alternatives:r}},"transformAlternation"),g=n(e=>{const r=e.elements.map(y);return r.length===1?r[0]:{type:"sequence",elements:r}},"transformConcatenation"),b=n(e=>{if(e.includes("*")){const[t,s]=e.split("*"),l=t?parseInt(t,10):0,m=s?parseInt(s,10):1/0;return{min:l,max:m}}const r=parseInt(e,10);return{min:r,max:r}},"parseRepeat"),y=n(e=>{const r=A(e.primary);if(!e.repeat)return r;const{min:t,max:s}=b(e.repeat);return t===0&&s===1?{type:"optional",element:r}:{type:"repetition",element:r,min:t,max:s}},"transformElement"),A=n(e=>{switch(e.$type){case"AbnfStringLiteral":return{type:"terminal",value:e.value};case"AbnfNumVal":return{type:"terminal",value:e.value};case"AbnfRuleName":return{type:"nonterminal",name:e.name};case"AbnfGroup":return i(e.element);case"AbnfOptionalGroup":return{type:"optional",element:i(e.element)};default:throw new Error(`Unsupported ABNF primary node: ${e.$type}`)}},"transformPrimary"),P=n(e=>({name:e.name,definition:i(e.definition)}),"transformRule"),h=n(e=>{f(e,a),e.title&&a.setTitle(e.title),e.rules.map(r=>a.addRule(P(r)))},"populateDb"),R={parse:n(e=>{a.clear(),o.debug("[ABNF Parser] Starting Langium parse");const r=v.parse(e);if(r.lexerErrors.length>0||r.parserErrors.length>0)throw new c(r);const t=r.value;o.debug("[ABNF Parser] Parsed rules:",t.rules.length),h(t),o.debug("[ABNF Parser] Parse complete")},"parse"),parser:{yy:a}},B={parser:R,db:a,renderer:u,styles:p};export{B as diagram};
@@ -1 +1 @@
1
- import{Y as ln,$ as an,a0 as F,a1 as q,a2 as j,a3 as un,a4 as y,a5 as tn,a6 as J,a7 as _,a8 as rn,a9 as o,aa as on,ab as sn,ac as fn}from"./mermaid.core-DfKXu_iO.js";function cn(l){return l.innerRadius}function yn(l){return l.outerRadius}function gn(l){return l.startAngle}function dn(l){return l.endAngle}function mn(l){return l&&l.padAngle}function pn(l,h,I,D,v,A,z,a){var O=I-l,i=D-h,n=z-v,d=a-A,u=d*O-n*i;if(!(u*u<y))return u=(n*(h-A)-d*(l-v))/u,[l+u*O,h+u*i]}function U(l,h,I,D,v,A,z){var a=l-I,O=h-D,i=(z?A:-A)/J(a*a+O*O),n=i*O,d=-i*a,u=l+n,s=h+d,f=I+n,c=D+d,B=(u+f)/2,t=(s+c)/2,m=f-u,g=c-s,R=m*m+g*g,T=v-A,P=u*c-f*s,S=(g<0?-1:1)*J(on(0,T*T*R-P*P)),Y=(P*g-m*S)/R,$=(-P*m-g*S)/R,w=(P*g+m*S)/R,p=(-P*m+g*S)/R,x=Y-B,e=$-t,r=w-B,C=p-t;return x*x+e*e>r*r+C*C&&(Y=w,$=p),{cx:Y,cy:$,x01:-n,y01:-d,x11:Y*(v/T-1),y11:$*(v/T-1)}}function hn(){var l=cn,h=yn,I=j(0),D=null,v=gn,A=dn,z=mn,a=null,O=ln(i);function i(){var n,d,u=+l.apply(this,arguments),s=+h.apply(this,arguments),f=v.apply(this,arguments)-un,c=A.apply(this,arguments)-un,B=rn(c-f),t=c>f;if(a||(a=n=O()),s<u&&(d=s,s=u,u=d),!(s>y))a.moveTo(0,0);else if(B>tn-y)a.moveTo(s*F(f),s*q(f)),a.arc(0,0,s,f,c,!t),u>y&&(a.moveTo(u*F(c),u*q(c)),a.arc(0,0,u,c,f,t));else{var m=f,g=c,R=f,T=c,P=B,S=B,Y=z.apply(this,arguments)/2,$=Y>y&&(D?+D.apply(this,arguments):J(u*u+s*s)),w=_(rn(s-u)/2,+I.apply(this,arguments)),p=w,x=w,e,r;if($>y){var C=sn($/u*q(Y)),K=sn($/s*q(Y));(P-=C*2)>y?(C*=t?1:-1,R+=C,T-=C):(P=0,R=T=(f+c)/2),(S-=K*2)>y?(K*=t?1:-1,m+=K,g-=K):(S=0,m=g=(f+c)/2)}var G=s*F(m),H=s*q(m),L=u*F(T),M=u*q(T);if(w>y){var N=s*F(g),Q=s*q(g),V=u*F(R),W=u*q(R),E;if(B<an)if(E=pn(G,H,V,W,N,Q,L,M)){var X=G-E[0],Z=H-E[1],b=N-E[0],k=Q-E[1],nn=1/q(fn((X*b+Z*k)/(J(X*X+Z*Z)*J(b*b+k*k)))/2),en=J(E[0]*E[0]+E[1]*E[1]);p=_(w,(u-en)/(nn-1)),x=_(w,(s-en)/(nn+1))}else p=x=0}S>y?x>y?(e=U(V,W,G,H,s,x,t),r=U(N,Q,L,M,s,x,t),a.moveTo(e.cx+e.x01,e.cy+e.y01),x<w?a.arc(e.cx,e.cy,x,o(e.y01,e.x01),o(r.y01,r.x01),!t):(a.arc(e.cx,e.cy,x,o(e.y01,e.x01),o(e.y11,e.x11),!t),a.arc(0,0,s,o(e.cy+e.y11,e.cx+e.x11),o(r.cy+r.y11,r.cx+r.x11),!t),a.arc(r.cx,r.cy,x,o(r.y11,r.x11),o(r.y01,r.x01),!t))):(a.moveTo(G,H),a.arc(0,0,s,m,g,!t)):a.moveTo(G,H),!(u>y)||!(P>y)?a.lineTo(L,M):p>y?(e=U(L,M,N,Q,u,-p,t),r=U(G,H,V,W,u,-p,t),a.lineTo(e.cx+e.x01,e.cy+e.y01),p<w?a.arc(e.cx,e.cy,p,o(e.y01,e.x01),o(r.y01,r.x01),!t):(a.arc(e.cx,e.cy,p,o(e.y01,e.x01),o(e.y11,e.x11),!t),a.arc(0,0,u,o(e.cy+e.y11,e.cx+e.x11),o(r.cy+r.y11,r.cx+r.x11),t),a.arc(r.cx,r.cy,p,o(r.y11,r.x11),o(r.y01,r.x01),!t))):a.arc(0,0,u,T,R,t)}if(a.closePath(),n)return a=null,n+""||null}return i.centroid=function(){var n=(+l.apply(this,arguments)+ +h.apply(this,arguments))/2,d=(+v.apply(this,arguments)+ +A.apply(this,arguments))/2-an/2;return[F(d)*n,q(d)*n]},i.innerRadius=function(n){return arguments.length?(l=typeof n=="function"?n:j(+n),i):l},i.outerRadius=function(n){return arguments.length?(h=typeof n=="function"?n:j(+n),i):h},i.cornerRadius=function(n){return arguments.length?(I=typeof n=="function"?n:j(+n),i):I},i.padRadius=function(n){return arguments.length?(D=n==null?null:typeof n=="function"?n:j(+n),i):D},i.startAngle=function(n){return arguments.length?(v=typeof n=="function"?n:j(+n),i):v},i.endAngle=function(n){return arguments.length?(A=typeof n=="function"?n:j(+n),i):A},i.padAngle=function(n){return arguments.length?(z=typeof n=="function"?n:j(+n),i):z},i.context=function(n){return arguments.length?(a=n??null,i):a},i}export{hn as d};
1
+ import{Y as ln,$ as an,a0 as F,a1 as q,a2 as j,a3 as un,a4 as y,a5 as tn,a6 as J,a7 as _,a8 as rn,a9 as o,aa as on,ab as sn,ac as fn}from"./mermaid.core-CMg-D4qI.js";function cn(l){return l.innerRadius}function yn(l){return l.outerRadius}function gn(l){return l.startAngle}function dn(l){return l.endAngle}function mn(l){return l&&l.padAngle}function pn(l,h,I,D,v,A,z,a){var O=I-l,i=D-h,n=z-v,d=a-A,u=d*O-n*i;if(!(u*u<y))return u=(n*(h-A)-d*(l-v))/u,[l+u*O,h+u*i]}function U(l,h,I,D,v,A,z){var a=l-I,O=h-D,i=(z?A:-A)/J(a*a+O*O),n=i*O,d=-i*a,u=l+n,s=h+d,f=I+n,c=D+d,B=(u+f)/2,t=(s+c)/2,m=f-u,g=c-s,R=m*m+g*g,T=v-A,P=u*c-f*s,S=(g<0?-1:1)*J(on(0,T*T*R-P*P)),Y=(P*g-m*S)/R,$=(-P*m-g*S)/R,w=(P*g+m*S)/R,p=(-P*m+g*S)/R,x=Y-B,e=$-t,r=w-B,C=p-t;return x*x+e*e>r*r+C*C&&(Y=w,$=p),{cx:Y,cy:$,x01:-n,y01:-d,x11:Y*(v/T-1),y11:$*(v/T-1)}}function hn(){var l=cn,h=yn,I=j(0),D=null,v=gn,A=dn,z=mn,a=null,O=ln(i);function i(){var n,d,u=+l.apply(this,arguments),s=+h.apply(this,arguments),f=v.apply(this,arguments)-un,c=A.apply(this,arguments)-un,B=rn(c-f),t=c>f;if(a||(a=n=O()),s<u&&(d=s,s=u,u=d),!(s>y))a.moveTo(0,0);else if(B>tn-y)a.moveTo(s*F(f),s*q(f)),a.arc(0,0,s,f,c,!t),u>y&&(a.moveTo(u*F(c),u*q(c)),a.arc(0,0,u,c,f,t));else{var m=f,g=c,R=f,T=c,P=B,S=B,Y=z.apply(this,arguments)/2,$=Y>y&&(D?+D.apply(this,arguments):J(u*u+s*s)),w=_(rn(s-u)/2,+I.apply(this,arguments)),p=w,x=w,e,r;if($>y){var C=sn($/u*q(Y)),K=sn($/s*q(Y));(P-=C*2)>y?(C*=t?1:-1,R+=C,T-=C):(P=0,R=T=(f+c)/2),(S-=K*2)>y?(K*=t?1:-1,m+=K,g-=K):(S=0,m=g=(f+c)/2)}var G=s*F(m),H=s*q(m),L=u*F(T),M=u*q(T);if(w>y){var N=s*F(g),Q=s*q(g),V=u*F(R),W=u*q(R),E;if(B<an)if(E=pn(G,H,V,W,N,Q,L,M)){var X=G-E[0],Z=H-E[1],b=N-E[0],k=Q-E[1],nn=1/q(fn((X*b+Z*k)/(J(X*X+Z*Z)*J(b*b+k*k)))/2),en=J(E[0]*E[0]+E[1]*E[1]);p=_(w,(u-en)/(nn-1)),x=_(w,(s-en)/(nn+1))}else p=x=0}S>y?x>y?(e=U(V,W,G,H,s,x,t),r=U(N,Q,L,M,s,x,t),a.moveTo(e.cx+e.x01,e.cy+e.y01),x<w?a.arc(e.cx,e.cy,x,o(e.y01,e.x01),o(r.y01,r.x01),!t):(a.arc(e.cx,e.cy,x,o(e.y01,e.x01),o(e.y11,e.x11),!t),a.arc(0,0,s,o(e.cy+e.y11,e.cx+e.x11),o(r.cy+r.y11,r.cx+r.x11),!t),a.arc(r.cx,r.cy,x,o(r.y11,r.x11),o(r.y01,r.x01),!t))):(a.moveTo(G,H),a.arc(0,0,s,m,g,!t)):a.moveTo(G,H),!(u>y)||!(P>y)?a.lineTo(L,M):p>y?(e=U(L,M,N,Q,u,-p,t),r=U(G,H,V,W,u,-p,t),a.lineTo(e.cx+e.x01,e.cy+e.y01),p<w?a.arc(e.cx,e.cy,p,o(e.y01,e.x01),o(r.y01,r.x01),!t):(a.arc(e.cx,e.cy,p,o(e.y01,e.x01),o(e.y11,e.x11),!t),a.arc(0,0,u,o(e.cy+e.y11,e.cx+e.x11),o(r.cy+r.y11,r.cx+r.x11),t),a.arc(r.cx,r.cy,p,o(r.y11,r.x11),o(r.y01,r.x01),!t))):a.arc(0,0,u,T,R,t)}if(a.closePath(),n)return a=null,n+""||null}return i.centroid=function(){var n=(+l.apply(this,arguments)+ +h.apply(this,arguments))/2,d=(+v.apply(this,arguments)+ +A.apply(this,arguments))/2-an/2;return[F(d)*n,q(d)*n]},i.innerRadius=function(n){return arguments.length?(l=typeof n=="function"?n:j(+n),i):l},i.outerRadius=function(n){return arguments.length?(h=typeof n=="function"?n:j(+n),i):h},i.cornerRadius=function(n){return arguments.length?(I=typeof n=="function"?n:j(+n),i):I},i.padRadius=function(n){return arguments.length?(D=n==null?null:typeof n=="function"?n:j(+n),i):D},i.startAngle=function(n){return arguments.length?(v=typeof n=="function"?n:j(+n),i):v},i.endAngle=function(n){return arguments.length?(A=typeof n=="function"?n:j(+n),i):A},i.padAngle=function(n){return arguments.length?(z=typeof n=="function"?n:j(+n),i):z},i.context=function(n){return arguments.length?(a=n??null,i):a},i}export{hn as d};