@loadmap/react 0.44.0 → 0.46.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.
@@ -89,7 +89,7 @@ function covered(size, bars, panel, panels = true) {
89
89
  };
90
90
  }
91
91
  // src/Diagram.tsx
92
- const Detail = lazy(() => import("./later-DEyKXK9p.js").then((m) => ({ default: m.Detail })));
92
+ const Detail = lazy(() => import("./later-DC3ZTVv3.js").then((m) => ({ default: m.Detail })));
93
93
  /**
94
94
  * What draws the subsystems (frames.tsx): their frames, and what a closed one's box says and does. It comes with the
95
95
  * first view that has a subsystem, before that view is laid out, so a page without subsystems never loads it and a
@@ -815,8 +815,11 @@ function Node({ n, state, title, sub, lm, focused, selected, handlers }) {
815
815
  const stroke = state ? STATE_STROKE[state] : lost ? "var(--lm-lost-line)" : "var(--lm-line)";
816
816
  const flows = lm.view.def.flows;
817
817
  const st = n.kind === "pool" ? lm.ev.stages[n.stages[0] ?? ""] : void 0;
818
- const running = st?.kind === "workers" ? st.running : n.members.length;
819
- const idle = (i) => i >= running && i < (st?.kind === "workers" ? st.pods : n.members.length);
818
+ const first = n.stages[0] == null ? void 0 : lm.ev.stages[n.stages[0]];
819
+ const comp = n.component ?? (first && "component" in first ? first.component : void 0);
820
+ const out = comp == null ? void 0 : lm.ev.components[comp]?.out;
821
+ const running = st?.kind === "workers" ? st.running : out ? n.members.length - Math.ceil(n.members.length / out.count) : n.members.length;
822
+ const idle = (i) => i >= running && i < (st?.kind === "workers" && !out ? st.pods : n.members.length);
820
823
  const a = st?.kind === "workers" ? st.assignment : void 0;
821
824
  const unassigned = (i) => a != null && i < a.weights.length && a.weights[i] === 0;
822
825
  const e = 6;
@@ -1284,7 +1287,7 @@ const LOADMAP_CSS = `
1284
1287
  .lm-verdict { margin: 0; padding: 10px 14px; border-left: 4px solid var(--lm-ok); background: var(--lm-accent-soft); border-radius: 0 6px 6px 0; }
1285
1288
  .lm-verdict[data-tier="warn"] { border-color: var(--lm-warn); }
1286
1289
  .lm-verdict[data-tier="over"] { border-color: var(--lm-drop); }
1287
- .lm-measure { margin: 6px 0 0; padding: 0 14px; font-size: .86rem; color: var(--lm-muted); }
1290
+ .lm-measure, .lm-peak, .lm-outage { margin: 6px 0 0; padding: 0 14px; font-size: .86rem; color: var(--lm-muted); }
1288
1291
 
1289
1292
  .lm-strip { display: grid; grid-template-columns: minmax(0, 3fr) minmax(280px, 2fr); gap: 14px; align-items: start; }
1290
1293
  @container (max-width: 860px) { .lm-strip { grid-template-columns: minmax(0, 1fr); } }
@@ -2177,7 +2180,7 @@ function VerdictLine({ lm, verdict = true, extra = 0, open, why = true, assumpti
2177
2180
  ] });
2178
2181
  }
2179
2182
  // src/frame.tsx
2180
- const Body = lazy(() => import("./framePanels-8jyTYFiO.js").then((m) => ({ default: m.FramePanelBody })));
2183
+ const Body = lazy(() => import("./framePanels-B7rTLqFC.js").then((m) => ({ default: m.FramePanelBody })));
2181
2184
  /** A frame's panels, in the order of their tabs: one opens at a time. */
2182
2185
  const FRAME_PANELS = [
2183
2186
  "limits",
@@ -2489,19 +2492,21 @@ var Engine = class {
2489
2492
  this.setModel(model, view, ev, o);
2490
2493
  }
2491
2494
  /**
2492
- * A new version of the model and view (the text edited): a story stops, and what is drawn stays, its dots running,
2493
- * until the new scene moves in from it; the sim starts over on the new model then, so no dot looks for a box the
2494
- * old scene does not have.
2495
+ * A new version of the model and view (the text edited): a story stops playing (the step it shows stays, the page
2496
+ * holds it), and what is drawn stays, its dots running, until the new scene moves in from it. A model with other
2497
+ * flows, stages or routes starts its sim over then, so no dot looks for a box the old scene does not have; one with
2498
+ * the same keeps its sim, dots and backlog.
2495
2499
  */
2496
2500
  setModel(model, view, ev, o) {
2497
2501
  this.stopStory({ cut: true });
2498
2502
  this.model = model;
2499
2503
  this.view = view;
2500
2504
  this.ev = ev;
2501
- this.#o = o;
2502
2505
  this.#setHand(null);
2503
- if (this.frame) this.#stale = true;
2504
- else this.sim = createSim(model, ev, o);
2506
+ this.#o = o;
2507
+ if (!this.frame) this.sim = createSim(model, ev, o);
2508
+ else if (!this.#stale && this.sim.adopt(model, ev, o)) return;
2509
+ else this.#stale = true;
2505
2510
  }
2506
2511
  setEvaluation(ev) {
2507
2512
  if (ev === this.ev) return;
@@ -3059,11 +3064,8 @@ const DUE = {
3059
3064
  };
3060
3065
  /** The state behind a loadmap: values, the model's evaluation, the layout and the engine. */
3061
3066
  function useLoadmap(model, whole, o = {}) {
3062
- const [stepState, setStepState] = useState({
3063
- model,
3064
- i: null
3065
- });
3066
- const step = stepState.model === model && stepState.i != null && stepState.i < model.story.length ? stepState.i : null;
3067
+ const [stepAt, setStepAt] = useState(null);
3068
+ const step = stepAt != null && stepAt < model.story.length ? stepAt : null;
3067
3069
  const [turned, setTurned] = useState(null);
3068
3070
  const own = o.closed ?? NONE;
3069
3071
  const ownRef = useRef(own);
@@ -3116,6 +3118,18 @@ function useLoadmap(model, whole, o = {}) {
3116
3118
  let values = state.values;
3117
3119
  if (state.model !== model) {
3118
3120
  values = init();
3121
+ const was = stepAt == null ? void 0 : state.model.story[stepAt];
3122
+ const same = was ? model.story.findIndex((st) => st.text === was.text) : -1;
3123
+ const at = same >= 0 ? same : was && model.story.length === state.model.story.length ? stepAt : null;
3124
+ const now = at == null ? void 0 : model.story[at];
3125
+ if (at !== stepAt) setStepAt(at);
3126
+ if (was && now) {
3127
+ if (!Object.entries(was.values).some(([k, v]) => state.values[k] !== v)) values = {
3128
+ ...values,
3129
+ ...now.values
3130
+ };
3131
+ if (!kept || kept.story) setTurn(now.closed ?? null, true);
3132
+ }
3119
3133
  evaluated.current = null;
3120
3134
  setState({
3121
3135
  model,
@@ -3138,7 +3152,6 @@ function useLoadmap(model, whole, o = {}) {
3138
3152
  const [narrow, setNarrow] = useState(false);
3139
3153
  const [measure, setMeasure] = useState(null);
3140
3154
  const [laid, setLaid] = useState(null);
3141
- const scene = laid?.view === view ? laid.scene : null;
3142
3155
  const reducedMotion = useMediaQuery("(prefers-reduced-motion: reduce)");
3143
3156
  engine.reducedMotion = reducedMotion;
3144
3157
  const narrowBelow = o.narrowBelow ?? 640;
@@ -3229,7 +3242,10 @@ function useLoadmap(model, whole, o = {}) {
3229
3242
  rows,
3230
3243
  measure
3231
3244
  ]);
3232
- if (fresh) engine.wantKey = pending ? "" : key;
3245
+ const from = rows === 1 ? o.from : void 0;
3246
+ const scene = laid?.view === view && laid.from === from ? laid.scene : null;
3247
+ const relaid = laid?.view === view && laid.from !== from;
3248
+ if (fresh) engine.wantKey = pending || relaid ? "" : key;
3233
3249
  useEffect(() => {
3234
3250
  if (!measure || !key || waits) return;
3235
3251
  let live = true;
@@ -3237,11 +3253,13 @@ function useLoadmap(model, whole, o = {}) {
3237
3253
  direction,
3238
3254
  rows,
3239
3255
  measure,
3240
- elk: elk ?? pageElk()
3256
+ elk: elk ?? pageElk(),
3257
+ from
3241
3258
  }).then((s) => {
3242
3259
  if (live) setLaid({
3243
3260
  view,
3244
- scene: s
3261
+ scene: s,
3262
+ from
3245
3263
  });
3246
3264
  }, (err) => console.error("loadmap: layout failed", err));
3247
3265
  return () => {
@@ -3255,7 +3273,8 @@ function useLoadmap(model, whole, o = {}) {
3255
3273
  rows,
3256
3274
  measure,
3257
3275
  elk,
3258
- waits
3276
+ waits,
3277
+ from
3259
3278
  ]);
3260
3279
  const labels = useMemo(() => labelsAt(view, ev), [view, ev]);
3261
3280
  const valuesRef = useRef(values);
@@ -3299,10 +3318,7 @@ function useLoadmap(model, whole, o = {}) {
3299
3318
  if (st) apply(st.values);
3300
3319
  engine.wantFocus = st?.focus ?? null;
3301
3320
  engine.storyStep = st ? i : null;
3302
- setStepState({
3303
- model,
3304
- i: st ? i : null
3305
- });
3321
+ setStepAt(st ? i : null);
3306
3322
  setTurn(st?.closed ?? null, true);
3307
3323
  }, [
3308
3324
  model,
@@ -1,5 +1,5 @@
1
1
  import { Evaluation, Model, Scenario, Values } from "@loadmap/core";
2
- import { Direction, ElkEngine, Scene, View, labelsAt } from "@loadmap/layout";
2
+ import { Direction, ElkEngine, Held, Scene, View, labelsAt } from "@loadmap/layout";
3
3
  import { CSSProperties, ReactNode, Ref } from "react";
4
4
  import { Room } from "@loadmap/layout/internal";
5
5
  import { Particle, Sim, SimOptions } from "@loadmap/sim";
@@ -210,9 +210,10 @@ declare class Engine {
210
210
  canvas: HTMLCanvasElement | null;
211
211
  constructor(model: Model, view: View, ev: Evaluation, o?: SimOptions);
212
212
  /**
213
- * A new version of the model and view (the text edited): a story stops, and what is drawn stays, its dots running,
214
- * until the new scene moves in from it; the sim starts over on the new model then, so no dot looks for a box the
215
- * old scene does not have.
213
+ * A new version of the model and view (the text edited): a story stops playing (the step it shows stays, the page
214
+ * holds it), and what is drawn stays, its dots running, until the new scene moves in from it. A model with other
215
+ * flows, stages or routes starts its sim over then, so no dot looks for a box the old scene does not have; one with
216
+ * the same keeps its sim, dots and backlog.
216
217
  */
217
218
  setModel(model: Model, view: View, ev: Evaluation, o: SimOptions): void;
218
219
  setEvaluation(ev: Evaluation): void;
@@ -340,6 +341,12 @@ interface LoadmapOptions<P> extends SimOptions {
340
341
  * page of its own zooms with the wheel alone. Pictures and recordings show the whole diagram whatever the view.
341
342
  */
342
343
  zoom?: boolean;
344
+ /**
345
+ * A scene the layout holds to (`layout()`'s `from`): an editor gives the one that was drawn before an edit, so the
346
+ * boxes the edit did not touch stay in their places, and takes it away again to lay the diagram out as a page draws
347
+ * it. Keep it the same object while it holds. Default none.
348
+ */
349
+ from?: Held;
343
350
  /**
344
351
  * The subsystems drawn closed at first, each as one box that stands for everything inside it, by the ids the view
345
352
  * gives them. The reader opens one with a click on it and closes one with a click on its name; a story step says
@@ -1,6 +1,6 @@
1
- import { w as Legend } from "./Loadmap-UvoLoTLT.js";
2
- import { a as Verdict, i as Meters, n as Controls, r as Limits, t as Assumptions } from "./panels-DVlqE2Dj.js";
3
- import { n as HeadroomChart, t as Compare } from "./scenarios-CFSzYWOU.js";
1
+ import { w as Legend } from "./Loadmap-C7Wf68Ur.js";
2
+ import { a as Verdict, i as Meters, n as Controls, r as Limits, t as Assumptions } from "./panels-CQdTPlJD.js";
3
+ import { n as HeadroomChart, t as Compare } from "./scenarios-CoRymVnX.js";
4
4
  import { Fragment, jsx, jsxs } from "react/jsx-runtime";
5
5
  // src/framePanels.tsx
6
6
  /**
package/dist/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { _ as useLoadmap, a as LoadmapProps, b as Engine, c as handleOf, d as Diagram, f as DiagramProps, g as LoadmapOptions, h as LoadmapController, i as LoadmapPanel, l as panelsOf, m as FullScreenMode, n as Loadmap, o as LoadmapRoot, p as Chrome, r as LoadmapHandle, s as Theme, t as LOADMAP_PANELS, u as usePageTheme, v as Cue, y as Dot } from "./Loadmap-D6Yrp2jI.js";
1
+ import { _ as useLoadmap, a as LoadmapProps, b as Engine, c as handleOf, d as Diagram, f as DiagramProps, g as LoadmapOptions, h as LoadmapController, i as LoadmapPanel, l as panelsOf, m as FullScreenMode, n as Loadmap, o as LoadmapRoot, p as Chrome, r as LoadmapHandle, s as Theme, t as LOADMAP_PANELS, u as usePageTheme, v as Cue, y as Dot } from "./Loadmap-DDQh2RSi.js";
2
2
  import { Comparison, Model } from "@loadmap/core";
3
3
  import { fitLinear } from "@loadmap/core/calibrate";
4
4
  import { compact, fmt, multiple, pct, secs } from "@loadmap/core/format";
@@ -203,7 +203,7 @@ export declare function Story({ lm }: {
203
203
  * that has its own, set on the root (`.card > .lm`) so they resolve there and reach no nested board; full screen
204
204
  * keeps both.
205
205
  */
206
- export declare const LOADMAP_CSS = "\n.lm { \n --lm-bg: #eef2f5; --lm-surface: #ffffff; --lm-fg: #17212b; --lm-muted: #5d6d7c; --lm-line: #c6d0da;\n --lm-accent: #0b6b8f; --lm-accent-soft: #d6e9f0; --lm-alt: #7a4f9a; --lm-alt-soft: #efe5f6;\n --lm-ok: #2a7f5a; --lm-warn: #b86e00; --lm-drop: #b7392e; --lm-lane: #e3e9ee;\n --lm-lost-fill: #fbefed; --lm-lost-line: #b7392e;\n --lm-tier-base: #f4f7fa; --lm-tier: #e8eef3; --lm-tier-head: #dbe3eb; --lm-tier-fg: #34424f; --lm-tier-line: #c6d0da;\n --lm-s1: #2a78d6; --lm-s2: #eb6834; --lm-s3: #6250d6; --lm-s4: #eda100; color-scheme: light;\n --lm-font: ui-sans-serif, -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, sans-serif;\n --lm-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;\n font: 14px/1.45 var(--lm-font); color: var(--lm-fg); background: var(--lm-root-bg, var(--lm-bg));\n display: grid; gap: 14px; padding: var(--lm-pad, 16px); min-width: 0; box-sizing: border-box; }\n@media (prefers-color-scheme: dark) { .lm:not([data-theme=\"light\"]) { \n --lm-bg: #0d141b; --lm-surface: #151e27; --lm-fg: #e4ebf1; --lm-muted: #93a3b3; --lm-line: #2a3744;\n --lm-accent: #5fb7d6; --lm-accent-soft: #163442; --lm-alt: #c39be0; --lm-alt-soft: #2b2236;\n --lm-ok: #5fc08f; --lm-warn: #e2a24a; --lm-drop: #e26a5c; --lm-lane: #1b2631;\n --lm-lost-fill: #2b1c1d; --lm-lost-line: #e26a5c;\n --lm-tier-base: #1b2530; --lm-tier: #24323f; --lm-tier-head: #2c3b4a; --lm-tier-fg: #c3cfda; --lm-tier-line: #33424f;\n --lm-s1: #3987e5; --lm-s2: #d95926; --lm-s3: #9085e9; --lm-s4: #c98500; color-scheme: dark; } }\n.lm[data-theme=\"dark\"] { \n --lm-bg: #0d141b; --lm-surface: #151e27; --lm-fg: #e4ebf1; --lm-muted: #93a3b3; --lm-line: #2a3744;\n --lm-accent: #5fb7d6; --lm-accent-soft: #163442; --lm-alt: #c39be0; --lm-alt-soft: #2b2236;\n --lm-ok: #5fc08f; --lm-warn: #e2a24a; --lm-drop: #e26a5c; --lm-lane: #1b2631;\n --lm-lost-fill: #2b1c1d; --lm-lost-line: #e26a5c;\n --lm-tier-base: #1b2530; --lm-tier: #24323f; --lm-tier-head: #2c3b4a; --lm-tier-fg: #c3cfda; --lm-tier-line: #33424f;\n --lm-s1: #3987e5; --lm-s2: #d95926; --lm-s3: #9085e9; --lm-s4: #c98500; color-scheme: dark; }\n.lm *, .lm *::before, .lm *::after { box-sizing: border-box; }\n.lm h2 { font-size: 1.3rem; font-weight: 600; margin: 0; text-wrap: balance; }\n.lm h3 { font: 600 .74rem var(--lm-font); text-transform: uppercase; letter-spacing: .08em; color: var(--lm-muted); margin: 0; }\n.lm button:focus-visible, .lm input:focus-visible, .lm select:focus-visible { outline: 2px solid var(--lm-accent); outline-offset: 2px; }\n.lm-problems { margin: 0; padding: 10px 12px; font: .8rem/1.5 var(--lm-mono); white-space: pre-wrap; overflow-x: auto; color: var(--lm-fg); background: var(--lm-surface); border: 1px solid var(--lm-line); border-left: 3px solid var(--lm-drop); border-radius: 6px; }\n.lm-note { margin: 0; font-size: .8rem; color: var(--lm-muted); }\n.lm-card { background: var(--lm-surface); border: 1px solid var(--lm-line); border-radius: 8px; padding: 14px 16px; display: grid; gap: 12px; align-content: start; min-width: 0; }\n\n.lm-wrap { display: grid; gap: 8px; min-width: 0; position: relative; }\n.lm-bar { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }\n.lm-btn { font: 500 .8rem var(--lm-font); color: var(--lm-fg); background: var(--lm-surface); border: 1px solid var(--lm-line); border-radius: 6px; padding: 6px 12px; cursor: pointer; white-space: nowrap; }\n.lm-board { position: relative; background: var(--lm-surface); border: 1px solid var(--lm-line); border-radius: 8px; overflow: hidden; margin: 0 auto; width: 100%; }\n.lm-board svg { display: block; width: 100%; height: auto; font-family: var(--lm-font); }\n.lm-board canvas { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }\n/* the story's title over the board while it plays: a lower third, at the top when what is framed is low; a strip\n across the top of a narrow board */\n.lm-title { position: absolute; left: 12px; bottom: 12px; z-index: 1; display: grid; gap: 1px; max-width: min(34rem, calc(100% - 24px)); padding: 7px 12px 8px; border-left: 4px solid var(--lm-accent); border-radius: 0 6px 6px 0; background: color-mix(in srgb, var(--lm-surface) 92%, transparent); box-shadow: 0 4px 16px rgb(0 0 0 / .12); pointer-events: none; overflow-wrap: anywhere; }\n.lm-title[data-top] { top: 12px; bottom: auto; }\n.lm-title b { font-size: .95rem; font-weight: 600; }\n.lm-title span { font: 500 .8rem var(--lm-mono); color: var(--lm-muted); }\n@container (max-width: 520px) {\n .lm-title, .lm-title[data-top] { top: 0; right: 0; bottom: auto; left: 0; max-width: none; padding: 4px 8px; border-radius: 0; box-shadow: none; }\n .lm-title b { font-size: .8rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }\n .lm-title span { display: none; }\n}\n.lm-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: .78rem; color: var(--lm-muted); }\n.lm-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 50%; vertical-align: -1px; margin-right: 5px; }\n.lm-legend i.lm-legend-merge { box-sizing: border-box; border: 1.5px solid var(--lm-muted); }\n\n/* full screen (the browser's, or a fixed overlay): a column that never scrolls. The diagram as wide as the screen on\n top; under it the verdict in a line and the panels, compact, in a dock the screen sizes. The load changes what is\n in them, never their size, so it never moves the board. Focus: the diagram, the story, the verdict and the load */\n.lm-side, .lm-card > .lm-panel { display: contents; }\n.lm-panel { display: grid; gap: 14px; min-width: 0; }\n.lm[data-full] { height: 100vh; height: 100dvh; padding: 16px; background: var(--lm-bg); overflow: hidden; overscroll-behavior: contain; display: flex; flex-direction: column; gap: 10px; position: relative; }\n.lm[data-full=\"fill\"] { height: 100%; padding: 10px; }\n.lm[data-full=\"overlay\"] { position: fixed; inset: 0; z-index: 2147483000; width: auto; max-width: none; max-height: none; margin: 0; border: 0; }\n.lm[data-full] > * { flex: none; }\n/* a page of its own keeps the rest outside full screen, as <Loadmap> does */\n.lm[data-full] > :not(.lm-canvas, .lm-head, h2, .lm-scenarios, .lm-loadbar, .lm-story, .lm-wrap, .lm-side) { display: none; }\n.lm-head { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 20px; min-width: 0; }\n.lm-head h2 { font-size: 1.1rem; }\n.lm-head .lm-loadbar { flex: 1 1 520px; }\n.lm[data-full] .lm-wrap { gap: 6px; }\n/* the board as large as fits (--lm-fit, from Diagram), left under the bar, so the legend starts where the board does */\n.lm[data-full] .lm-board { width: var(--lm-fit, 100%); margin: 0; align-self: start; justify-self: start; }\n.lm-tools { display: flex; align-items: center; gap: 8px; margin-left: auto; }\n.lm-modes { display: inline-flex; margin: 0; padding: 0; min-width: 0; border: 1px solid var(--lm-line); border-radius: 6px; overflow: hidden; }\n.lm-modes button { font: 500 .8rem var(--lm-font); color: var(--lm-fg); background: var(--lm-surface); border: 0; padding: 6px 12px; cursor: pointer; }\n.lm-modes button[aria-pressed=\"true\"] { background: var(--lm-fg); color: var(--lm-surface); }\n.lm[data-full] .lm-story { padding: 6px 12px; }\n.lm[data-full] [data-out] { display: none; }\n\n.lm-headline { flex: 1 1 auto; min-width: 0; margin: 0; font-size: .9rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }\n.lm-num { font: 600 .95em var(--lm-mono); font-variant-numeric: tabular-nums; }\n.lm-link { font: 500 .8rem var(--lm-font); color: var(--lm-accent); background: none; border: 0; padding: 2px 4px; cursor: pointer; white-space: nowrap; }\n\n\n\n/* a page of its own: its .lm-side is a box under the board that scrolls on its own, the board as large as leaves it a\n third of the screen */\n.lm[data-full] > .lm-side { display: grid; gap: 14px; align-content: start; flex: 1 1 0; min-height: 33dvh; overflow: auto; overscroll-behavior: contain; container-type: inline-size; }\n\n/* focus: the board and what runs on it in the middle of the screen */\n.lm[data-mode=\"focus\"] > .lm-side { display: none; }\n.lm[data-mode=\"focus\"] > .lm-wrap { margin-top: auto; }\n.lm[data-mode=\"focus\"] > .lm-story { order: 1; }\n.lm[data-mode=\"focus\"]::after { content: \"\"; order: 2; margin-top: auto; }\n.lm[data-mode=\"focus\"] > .lm-story { border-left-width: 4px; padding: 10px 14px; }\n.lm[data-mode=\"focus\"] > .lm-story p { font-size: 1.1rem; }\n\n@media (max-width: 760px) {\n .lm[data-full] { padding: 10px; gap: 8px; }\n /* the page has the title, and the legend: here they would leave the diagram no room */\n .lm[data-full] > h2, .lm[data-full] :is(.lm-head h2, .lm-legend, .lm-story legend) { display: none; }\n /* the one exception: here the diagram runs top to bottom, and shrunk to the screen it is too small to read, so it\n pans in a box of its own with the bar on top. The page never scrolls */\n .lm[data-full] .lm-board { width: 100%; }\n .lm[data-full] > .lm-wrap { height: 40dvh; overflow: auto; row-gap: 0; overscroll-behavior: contain; }\n .lm[data-mode=\"focus\"] > .lm-wrap { height: auto; flex: 1 1 0; min-height: 0; margin-top: 0; }\n .lm[data-full] .lm-bar { position: sticky; top: 0; z-index: 1; padding-bottom: 8px; background: var(--lm-bg); }\n .lm[data-full] > .lm-story { padding: 6px 10px; gap: 6px 10px; }\n .lm[data-full] > .lm-story p { font-size: .84rem; }\n .lm[data-full] .lm-story button { padding: 4px 10px; }\n .lm[data-full] .lm-headline { flex-basis: 100%; }\n /* the load in thumb reach: the bar under the board and the story, over the verdict */\n .lm[data-full] .lm-head { display: contents; }\n .lm[data-full] .lm-loadbar { order: 2; flex: none; }\n /* two lines, so the board keeps its room: the scenarios and the load's value, then the track; the label names the\n slider unseen */\n .lm[data-full] .lm-load small { display: none; }\n .lm[data-full] .lm-load { display: contents; }\n .lm[data-full] :is(.lm-loadbar legend, .lm-load > label) { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }\n .lm[data-full] .lm-load > output { margin-left: auto; }\n .lm[data-full] .lm-load-track { flex: 1 1 100%; }\n}\n\n.lm-verdict { margin: 0; padding: 10px 14px; border-left: 4px solid var(--lm-ok); background: var(--lm-accent-soft); border-radius: 0 6px 6px 0; }\n.lm-verdict[data-tier=\"warn\"] { border-color: var(--lm-warn); }\n.lm-verdict[data-tier=\"over\"] { border-color: var(--lm-drop); }\n.lm-measure { margin: 6px 0 0; padding: 0 14px; font-size: .86rem; color: var(--lm-muted); }\n\n.lm-strip { display: grid; grid-template-columns: minmax(0, 3fr) minmax(280px, 2fr); gap: 14px; align-items: start; }\n@container (max-width: 860px) { .lm-strip { grid-template-columns: minmax(0, 1fr); } }\n.lm { container-type: inline-size; }\n\n.lm-meters { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 8px; }\n.lm-meter { padding: 8px 10px; border-radius: 6px; background: var(--lm-bg); min-width: 0; }\n.lm-meter b { display: block; font: 500 1.15rem var(--lm-mono); font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }\n.lm-meter span { font-size: .74rem; color: var(--lm-muted); }\n.lm-meter[data-state=\"warn\"] b { color: var(--lm-warn); } .lm-meter[data-state=\"over\"] b { color: var(--lm-drop); }\n\n.lm-limits { display: grid; gap: 10px; }\n.lm-lim, .lm-scale { display: grid; grid-template-columns: minmax(0, 14rem) minmax(0, 1fr) 10rem; gap: 4px 14px; align-items: center; }\n@container (max-width: 640px) { .lm-lim, .lm-scale { grid-template-columns: minmax(0, 1fr); } .lm-scale > :first-child, .lm-scale > :last-child { display: none; } }\n.lm-lim b { display: block; font-weight: 600; font-size: .88rem; }\n.lm-lim .lm-sub { display: block; font-size: .74rem; color: var(--lm-muted); }\n.lm-tag { font: 600 .64rem var(--lm-font); text-transform: uppercase; letter-spacing: .06em; border-radius: 3px; padding: 1px 5px; margin-left: 6px; vertical-align: 1px; }\n.lm-tag[data-kind=\"first\"] { color: var(--lm-surface); background: var(--lm-drop); }\n.lm-tag[data-kind=\"estimated\"] { color: var(--lm-warn); border: 1px solid currentColor; }\n.lm-tag[data-kind=\"published\"] { color: var(--lm-alt); border: 1px solid currentColor; }\n.lm-tag[data-kind=\"none\"] { color: var(--lm-muted); border: 1px dashed currentColor; }\n.lm-tag[data-kind=\"range\"], .lm-tag[data-kind=\"rank\"] { color: var(--lm-muted); border: 1px solid currentColor; }\n.lm-track { position: relative; height: 16px; background: var(--lm-bg); border-radius: 3px; overflow: hidden; }\n.lm-fill { position: absolute; inset: 0 auto 0 0; background: var(--lm-ok); transition: width .25s ease; }\n.lm-fill[data-state=\"warn\"] { background: var(--lm-warn); } .lm-fill[data-state=\"over\"] { background: var(--lm-drop); }\n.lm-tick { position: absolute; top: 0; bottom: 0; width: 1px; background: var(--lm-fg); opacity: .55; }\n.lm-val { font: 500 .8rem var(--lm-mono); font-variant-numeric: tabular-nums; }\n.lm-val small { display: block; font: 400 .72rem var(--lm-font); color: var(--lm-muted); }\n.lm-scale { font: 400 .7rem var(--lm-mono); color: var(--lm-muted); }\n.lm-scale div { position: relative; height: 12px; }\n.lm-scale div span { position: absolute; transform: translateX(-50%); white-space: nowrap; }\n\n.lm-controls label.lm-range { display: grid; gap: 4px; font-size: .84rem; }\n.lm-controls label.lm-range > span { display: flex; justify-content: space-between; gap: 8px; }\n.lm-controls output { font-family: var(--lm-mono); font-variant-numeric: tabular-nums; }\n.lm-controls input[type=range] { width: 100%; accent-color: var(--lm-accent); }\n.lm-presets { display: flex; flex-wrap: wrap; gap: 6px; }\n.lm-presets button { font: 500 .76rem var(--lm-font); background: var(--lm-accent-soft); color: var(--lm-fg); border: 1px solid transparent; border-radius: 5px; padding: 5px 10px; cursor: pointer; }\n.lm-presets button[aria-pressed=\"true\"] { border-color: var(--lm-accent); }\n.lm-switch { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 0 8px; align-items: start; font-size: .84rem; cursor: pointer; }\n.lm-switch input { margin: 3px 0 0; accent-color: var(--lm-accent); }\n.lm-switch small, .lm-select small { grid-column: 2; color: var(--lm-muted); font-size: .74rem; line-height: 1.3; }\n.lm-select { display: grid; gap: 4px; font-size: .84rem; }\n.lm-select select { width: 100%; min-width: 0; font: 400 .84rem var(--lm-font); color: var(--lm-fg); background: var(--lm-surface); border: 1px solid var(--lm-line); border-radius: 5px; padding: 5px 8px; }\n.lm-off { opacity: .45; cursor: default; }\n\n.lm-facts { margin: 0; padding-left: 1.1em; font-size: .88rem; columns: 2; column-gap: 28px; }\n@container (max-width: 860px) { .lm-facts { columns: 1; } }\n.lm-facts li { margin-bottom: 8px; break-inside: avoid; }\n.lm-prov { font: 600 .66rem var(--lm-font); text-transform: uppercase; letter-spacing: .06em; }\n.lm-prov[data-kind=\"measured\"] { color: var(--lm-ok); } .lm-prov[data-kind=\"estimated\"] { color: var(--lm-warn); }\n.lm-prov[data-kind=\"configured\"] { color: var(--lm-accent); } .lm-prov[data-kind=\"published\"] { color: var(--lm-alt); }\n\n/* scenario identity colours (s1–s4) are checked for colour-blind separation on both surfaces; text never wears them */\n.lm-scenarios { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; border: 0; padding: 0; margin: 0; min-width: 0; }\n.lm-scenarios legend { float: left; font: 600 .74rem var(--lm-font); text-transform: uppercase; letter-spacing: .08em; color: var(--lm-muted); margin-right: 6px; padding: 0; }\n.lm-scenarios button { font: 500 .84rem var(--lm-font); color: var(--lm-fg); background: var(--lm-surface); border: 1px solid var(--lm-line); border-radius: 6px; padding: 6px 12px; cursor: pointer; }\n.lm-scenarios button[aria-pressed=\"true\"] { border-color: var(--lm-fg); box-shadow: inset 0 0 0 1px var(--lm-fg); }\n.lm-scenarios i, .lm-table i { display: inline-block; width: 10px; height: 10px; border-radius: 50%; vertical-align: -1px; margin-right: 6px; }\n.lm-story { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin: 0; min-width: 0; padding: 8px 12px; border: 1px solid var(--lm-line); border-left: 3px solid var(--lm-accent); border-radius: 6px; background: var(--lm-surface); }\n.lm-story legend { float: left; font: 600 .74rem var(--lm-font); text-transform: uppercase; letter-spacing: .08em; color: var(--lm-muted); padding: 0; }\n.lm-story p { flex: 1 1 240px; display: grid; margin: 0; font: 400 .9rem/1.4 var(--lm-font); color: var(--lm-fg); }\n.lm-story p > span { grid-area: 1 / 1; }\n.lm-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }\n.lm-story p > span:not([data-shown]), .lm-story em:not([data-shown]) { visibility: hidden; }\n.lm-story-progress { display: flex; align-items: center; gap: 4px; }\n.lm-story-progress i { position: relative; width: 28px; height: 4px; border-radius: 2px; background: var(--lm-line); overflow: hidden; }\n.lm-story-progress i[data-state=\"done\"], .lm-story:not([data-playing]) .lm-story-progress i[data-state=\"now\"] { background: var(--lm-accent); }\n.lm-story[data-playing] .lm-story-progress i[data-state=\"now\"]::before { content: \"\"; position: absolute; inset: 0; background: var(--lm-accent); transform-origin: left; animation: lm-step var(--lm-step) linear both; }\n@keyframes lm-step { from { transform: scaleX(0); } to { transform: scaleX(1); } }\n.lm-story b { font-weight: 600; color: var(--lm-muted); margin-right: 4px; white-space: nowrap; }\n.lm-story-nav { display: flex; gap: 6px; }\n.lm-story em { color: var(--lm-muted); }\n.lm-story button { font: 500 .84rem var(--lm-font); color: var(--lm-fg); background: var(--lm-surface); border: 1px solid var(--lm-line); border-radius: 6px; padding: 6px 12px; cursor: pointer; }\n.lm-story button[aria-disabled=\"true\"] { opacity: .45; cursor: default; }\n.lm-own { font-size: .78rem; color: var(--lm-muted); }\n\n/* the scenarios and the load over the board, in view while the page scrolls; on a phone under the board */\n.lm-loadbar { position: sticky; top: var(--lm-sticky-top, 0px); z-index: 3; container-type: inline-size; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 20px; padding: 6px 12px 2px; background: var(--lm-surface); border: 1px solid var(--lm-line); border-radius: 8px; box-shadow: 0 4px 14px -10px rgb(0 0 0 / .4); }\n.lm-loadbar .lm-scenarios { flex-wrap: nowrap; max-width: 100%; overflow-x: auto; padding: 2px; }\n.lm-loadbar .lm-scenarios button { flex: none; white-space: nowrap; }\n.lm-loadbar .lm-load { flex: 1 1 300px; }\n@container (min-width: 720px) {\n .lm-loadbar .lm-load { grid-template: \"label track value\" / minmax(0, max-content) minmax(160px, 1fr) auto; align-items: start; }\n .lm-loadbar .lm-load > label { max-width: 14em; padding-top: 6px; }\n}\n@container (max-width: 520px) {\n .lm:not([data-full]) > .lm-loadbar { order: 1; top: auto; bottom: 0; }\n .lm:not([data-full]) > .lm-side { order: 2; }\n}\n/* the load: its label and value, the track under them, the marks under it */\n.lm-load { display: grid; grid-template: \"label value\" \"track track\" / minmax(0, 1fr) auto; align-items: center; gap: 0 12px; font-size: .84rem; min-width: 0; }\n.lm-load > label { grid-area: label; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }\n.lm-load > output { grid-area: value; text-align: right; font: 600 .95rem/1.2 var(--lm-mono); font-variant-numeric: tabular-nums; }\n.lm-load small { display: block; font: 400 .7rem var(--lm-mono); color: var(--lm-muted); }\n.lm-load-track { grid-area: track; position: relative; min-width: 0; padding-bottom: 22px; }\n.lm-load input { display: block; width: 100%; height: 32px; margin: 0; accent-color: var(--lm-accent); cursor: pointer; }\n.lm-zones, .lm-marks { position: absolute; left: 8px; right: 8px; top: 30px; }\n.lm-zones { height: 4px; border-radius: 2px; }\n.lm-marks button { position: absolute; top: 0; transform: translateX(-50%); min-width: 20px; height: 24px; padding: 7px 2px 0; border: 0; background: none; font: 500 .68rem var(--lm-mono); color: var(--lm-accent); white-space: nowrap; cursor: pointer; }\n.lm-marks button::before { content: \"\"; position: absolute; left: 50%; top: 0; width: 2px; height: 6px; margin-left: -1px; background: currentColor; }\n.lm-marks button:not([data-label]) span { display: none; }\n.lm-marks [data-kind=\"target\"] { color: var(--lm-warn); }\n.lm-marks [data-kind=\"full\"] { color: var(--lm-drop); }\n.lm-marks [aria-pressed=\"true\"] { font-weight: 700; text-decoration: underline; }\n.lm-key { display: inline-block; width: 14px; height: 2px; border-radius: 1px; vertical-align: 3px; margin-right: 6px; }\n\n.lm-compare-text { margin: 0; }\n.lm-table-wrap { overflow-x: auto; }\n.lm-table { border-collapse: collapse; width: 100%; font-size: .84rem; }\n.lm-table th, .lm-table td { text-align: left; padding: 6px 10px 6px 0; border-bottom: 1px solid var(--lm-line); vertical-align: top; }\n.lm-table thead th { font: 600 .7rem var(--lm-font); text-transform: uppercase; letter-spacing: .06em; color: var(--lm-muted); }\n.lm-table tbody th { font-weight: 600; white-space: nowrap; }\n.lm-table td { font-family: var(--lm-mono); font-variant-numeric: tabular-nums; }\n.lm-table td.lm-text { font-family: var(--lm-font); }\n.lm-table td small { display: block; font: 400 .72rem var(--lm-font); color: var(--lm-muted); }\n.lm-table tr[aria-current] th { text-decoration: underline; text-underline-offset: 3px; }\n\n.lm-chart { position: relative; min-width: 0; }\n.lm-chart svg { display: block; overflow: visible; }\n.lm-chart:focus-visible { outline: 2px solid var(--lm-accent); outline-offset: 2px; }\n.lm-axis, .lm-axis text { font: 400 11px var(--lm-mono); fill: var(--lm-muted); }\n.lm-mark { font: 600 11px var(--lm-mono); fill: var(--lm-fg); }\n.lm-tip { position: absolute; z-index: 2; display: grid; gap: 2px; width: max-content; max-width: min(17rem, calc(100% - 8px)); overflow-wrap: anywhere; padding: 8px 10px; font-size: .78rem; background: var(--lm-surface); color: var(--lm-fg); border: 1px solid var(--lm-line); border-radius: 6px; box-shadow: 0 4px 14px rgb(0 0 0 / .14); pointer-events: none; }\n.lm-tip strong { font: 600 .82rem var(--lm-mono); font-variant-numeric: tabular-nums; }\n.lm-tip .lm-sub { color: var(--lm-muted); }\n.lm-nowrap { white-space: nowrap; }\n.lm-node { cursor: pointer; outline: none; }\n.lm-node:focus-visible > :first-child { stroke-width: 3; }\n\n@media (prefers-reduced-motion: reduce) {\n .lm-fill { transition: none; }\n .lm-story[data-playing] .lm-story-progress i[data-state=\"now\"]::before { animation: none; transform: none; }\n}\n\n/* without weight: a page's own .lm-canvas { height } wins, wherever its stylesheet stands */\n:where(.lm-canvas) { height: clamp(420px, 70dvh, 760px); }\n.lm-canvas { position: relative; box-sizing: border-box; overflow: hidden; contain: layout; border: 1px solid var(--lm-line); border-radius: var(--lm-radius, 10px); background: var(--lm-surface); }\n.lm.lm[data-full] > .lm-canvas { display: block; flex: 1 1 0; height: auto; min-height: 0; }\n/* the spacer that centres a page of parts with the least around it would take a gap under the canvas */\n.lm.lm[data-full]:has(> .lm-canvas)::after { content: none; }\n.lm-canvas > .lm-wrap[data-canvas] { position: absolute; inset: 0; }\n.lm-canvas-bar, .lm-canvas-console { position: absolute; left: 0; right: var(--lm-canvas-right, 0px); z-index: 3; box-sizing: border-box; display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; padding: 8px 12px; background: var(--lm-surface); }\n.lm-canvas-bar { top: 0; border-bottom: 1px solid var(--lm-line); }\n.lm-canvas-console { bottom: 0; border-top: 1px solid var(--lm-line); }\n/* over the bar for a while, across the whole top: as tall as it needs */\n.lm-canvas-panel[hidden] { display: none; }\n/* never more than the diagram can give: a long step scrolls in its strip */\n.lm-canvas-over { position: absolute; z-index: 5; top: 0; left: 0; right: 0; box-sizing: border-box; display: flex; align-items: center; max-height: 45%; overflow: auto; overscroll-behavior: contain; background: var(--lm-surface); border-bottom: 1px solid var(--lm-line); box-shadow: 0 8px 18px -14px rgb(0 0 0 / .45); }\n.lm-canvas-over > .lm-story { flex: 1 1 auto; border: 0; border-radius: 0; background: none; }\n.lm-canvas-over > .lm-canvas-leave { flex: none; margin-right: 12px; }\n/* the bar's own buttons, at its end */\n.lm-canvas-tools { display: flex; flex: none; gap: 6px; margin-left: auto; }\n.lm-canvas-tools .lm-btn { padding: 4px 9px; }\n.lm-canvas-tools .lm-btn[aria-pressed=\"true\"].lm-canvas-chrome { border-color: var(--lm-fg); box-shadow: inset 0 0 0 1px var(--lm-fg); }\n.lm-frame .lm-canvas-bar > .lm-legend + .lm-canvas-tools { margin-left: 0; }\n/* a slot that holds nothing takes no room */\n.lm-canvas-bar:empty, .lm-canvas-console:empty { display: none; }\n.lm-canvas[data-width=\"compact\"] :is(.lm-canvas-bar, .lm-canvas-console) { padding: 6px 8px; }\n.lm-canvas[data-short] .lm-canvas-bar { padding: 4px 8px; }\n/* on a touch screen two fingers zoom a narrow canvas: Fit alone stays, clear of the boxes */\n@media (pointer: coarse) { .lm-canvas[data-width=\"compact\"] .lm-zoom .lm-btn:not(:last-child) { display: none; } }\n/* a page of its own parts has full-screen rules for a phone (the load on two lines, no legend): not the canvas's */\n.lm.lm[data-full] .lm-canvas .lm-load { display: grid; }\n.lm.lm[data-full] .lm-canvas .lm-load small { display: block; }\n.lm.lm[data-full] .lm-canvas .lm-load > label { position: static; width: auto; height: auto; clip-path: none; }\n.lm.lm[data-full] .lm-canvas .lm-load > output { margin-left: 0; }\n.lm.lm[data-full] .lm-canvas .lm-headline { flex-basis: auto; }\n.lm.lm[data-full] .lm-canvas .lm-legend { display: flex; }\n\n/* the panels: their tabs, and the one that is open. Nothing but the open panel scrolls in a canvas */\n.lm-canvas-tabs { position: absolute; z-index: 3; display: flex; box-sizing: border-box; background: var(--lm-surface); }\n.lm-canvas-tabs button { flex: none; font: 500 .8rem var(--lm-font); color: var(--lm-muted); background: none; border: 0; padding: 0 12px; cursor: pointer; white-space: nowrap; }\n.lm-canvas-tabs button:hover { color: var(--lm-fg); }\n.lm-canvas-tabs button[aria-expanded=\"true\"] { color: var(--lm-fg); font-weight: 600; box-shadow: inset 0 -2px 0 var(--lm-fg); }\n.lm-canvas-tabs button:focus-visible, .lm-canvas-menu:focus-visible { outline: 2px solid var(--lm-accent); outline-offset: -2px; }\n.lm-canvas[data-tabs=\"row\"] .lm-canvas-tabs { left: 0; right: 0; bottom: var(--lm-canvas-bottom); height: 36px; border-top: 1px solid var(--lm-line); overflow-x: auto; scrollbar-width: none; }\n.lm-canvas[data-tabs=\"row\"] .lm-canvas-tabs::-webkit-scrollbar { display: none; }\n/* the five share a narrow row */\n.lm-canvas[data-tabs=\"row\"][data-width=\"compact\"] .lm-canvas-tabs button { flex: 1 1 auto; padding: 0 4px; }\n.lm-canvas[data-tabs=\"rail\"] .lm-canvas-tabs { top: 0; right: 0; bottom: 0; width: 44px; flex-direction: column; align-items: stretch; padding-top: 6px; border-left: 1px solid var(--lm-line); overflow: hidden; }\n.lm-canvas[data-tabs=\"rail\"] .lm-canvas-tabs button { padding: 12px 0; display: flex; justify-content: center; }\n.lm-canvas[data-tabs=\"rail\"] .lm-canvas-tabs button span { writing-mode: vertical-rl; }\n.lm-canvas[data-tabs=\"rail\"] .lm-canvas-tabs button[aria-expanded=\"true\"] { box-shadow: inset 2px 0 0 var(--lm-fg); }\n.lm-canvas[data-tabs=\"head\"] .lm-canvas-tabs { top: 0; right: 0; width: var(--lm-canvas-right); height: 40px; border-left: 1px solid var(--lm-line); border-bottom: 1px solid var(--lm-line); overflow-x: auto; scrollbar-width: none; }\n.lm-canvas[data-tabs=\"head\"] .lm-canvas-tabs::-webkit-scrollbar { display: none; }\n.lm-canvas-menu { position: absolute; z-index: 4; top: 5px; right: 8px; width: 116px; font: 500 .8rem var(--lm-font); color: var(--lm-fg); background: var(--lm-surface); border: 1px solid var(--lm-line); border-radius: 6px; padding: 4px 6px; }\n.lm-canvas[data-tabs=\"menu\"] .lm-canvas-bar, .lm-canvas[data-tabs=\"menu\"] .lm-canvas-bar:empty { display: flex; min-height: 40px; padding-right: 132px; }\n.lm-canvas-panel { position: absolute; z-index: 4; box-sizing: border-box; display: grid; grid-template-rows: auto minmax(0, 1fr); background: var(--lm-surface); outline: 0; }\n.lm-canvas-panel[data-place=\"side\"] { top: var(--lm-canvas-top); bottom: var(--lm-canvas-under); right: var(--lm-canvas-right); width: calc(var(--lm-canvas-reach) - var(--lm-canvas-right)); border-left: 1px solid var(--lm-line); box-shadow: -8px 0 18px -14px rgb(0 0 0 / .45); }\n.lm-canvas[data-pinned] .lm-canvas-panel { top: 40px; right: 0; bottom: 0; width: var(--lm-canvas-right); box-shadow: none; }\n.lm-canvas[data-pinned] .lm-canvas-panel-head { display: none; }\n.lm-canvas-panel[data-place=\"sheet\"] { left: 0; right: 0; bottom: var(--lm-canvas-under); height: var(--lm-canvas-reach); border-top: 1px solid var(--lm-line); border-radius: 10px 10px 0 0; box-shadow: 0 -8px 18px -14px rgb(0 0 0 / .45); }\n.lm-canvas-panel-head { display: flex; align-items: center; gap: 6px; padding: 6px 8px 6px 12px; border-bottom: 1px solid var(--lm-line); }\n.lm-canvas-panel-head h3 { flex: 1 1 auto; min-width: 0; margin: 0; font-size: .86rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }\n.lm-canvas-panel-head .lm-btn { padding: 3px 8px; }\n.lm-canvas-panel-body { display: grid; gap: 14px; align-content: start; min-height: 0; padding: 12px; overflow: auto; overscroll-behavior: contain; container-type: inline-size; }\n@media (prefers-reduced-motion: no-preference) {\n .lm-canvas-panel[data-place=\"side\"] { animation: lm-canvas-side .16s ease-out; }\n .lm-canvas[data-pinned] .lm-canvas-panel { animation: none; }\n .lm-canvas-panel[data-place=\"sheet\"] { animation: lm-canvas-sheet .16s ease-out; }\n}\n@keyframes lm-canvas-side { from { transform: translateX(16px); opacity: 0; } }\n@keyframes lm-canvas-sheet { from { transform: translateY(16px); opacity: 0; } }\n\n/* the frame: what <Frame> puts in the two slots. Each is one row of a height nothing the reader does changes */\n.lm-frame .lm-canvas-bar { flex-wrap: nowrap; overflow: hidden; }\n.lm-frame .lm-canvas-bar > h2 { flex: 0 5 auto; min-width: 0; font-size: .95rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }\n.lm-frame .lm-canvas-bar > .lm-scenarios { flex: 0 2 auto; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; padding: 2px; }\n.lm-frame .lm-canvas-bar > .lm-scenarios::-webkit-scrollbar { display: none; }\n.lm-frame .lm-canvas-bar > .lm-scenarios > * { flex: none; white-space: nowrap; }\n.lm-frame .lm-canvas-bar > .lm-scenarios button { padding: 4px 10px; }\n/* named for a screen reader, unseen: the buttons say what they are */\n.lm-frame .lm-canvas-bar > .lm-scenarios legend, .lm.lm .lm-frame[data-short] .lm-load > label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }\n/* one row whatever is on: an entry that does not fit wraps under it, out of view, whole */\n.lm-frame .lm-canvas-bar > .lm-legend { flex: 1 1 0; justify-content: flex-end; min-width: 0; height: 1.5em; line-height: 1.5; overflow: hidden; white-space: nowrap; }\n.lm-canvas-pick { flex: 0 1 auto; min-width: 0; max-width: 100%; font: 500 .84rem var(--lm-font); color: var(--lm-fg); background: var(--lm-surface); border: 1px solid var(--lm-line); border-radius: 6px; padding: 5px 8px; }\n.lm-frame .lm-canvas-console { display: grid; grid-template-columns: minmax(0, 1fr); gap: 2px; padding: 6px 12px 8px; }\n.lm-frame .lm-canvas-console > .lm-load { grid-template: \"label track value\" / minmax(0, max-content) minmax(120px, 1fr) auto; align-items: start; }\n.lm-frame .lm-canvas-console > .lm-load > label { max-width: 14em; padding-top: 6px; }\n.lm-frame .lm-canvas-console > .lm-load > output { padding-top: 5px; }\n.lm-canvas-verdict { display: flex; align-items: center; gap: 6px 14px; min-width: 0; padding-left: 8px; border-left: 4px solid var(--lm-ok); }\n.lm-canvas-verdict[data-tier=\"warn\"] { border-color: var(--lm-warn); }\n.lm-canvas-verdict[data-tier=\"over\"] { border-color: var(--lm-drop); }\n.lm-frame[data-width=\"compact\"] .lm-canvas-console { padding: 6px 8px; }\n.lm-frame[data-width=\"compact\"] .lm-canvas-console > .lm-load { grid-template: \"label value\" \"track track\" / minmax(0, 1fr) auto; align-items: center; }\n.lm-frame[data-width=\"compact\"] .lm-canvas-console > .lm-load > :is(label, output) { padding-top: 0; }\n/* room for the date under the load, with one or not */\n.lm-frame[data-width=\"compact\"] .lm-canvas-console > .lm-load > output { min-height: 2.1rem; }\n/* two lines kept whatever the verdict says: the load never changes the console's height */\n.lm-frame[data-width=\"compact\"]:not([data-short]) .lm-headline { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; height: 2.6em; line-height: 1.3; white-space: normal; }\n.lm-frame[data-short] .lm-canvas-console { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: center; gap: 12px; padding: 2px 8px; }\n.lm-frame[data-short] .lm-canvas-console > .lm-load { grid-template: \"track value\" / minmax(0, 1fr) auto; align-items: start; }\n.lm-frame[data-short][data-width=\"compact\"] .lm-canvas-console { grid-template-columns: minmax(0, 1fr); gap: 0; }\n";
206
+ export declare const LOADMAP_CSS = "\n.lm { \n --lm-bg: #eef2f5; --lm-surface: #ffffff; --lm-fg: #17212b; --lm-muted: #5d6d7c; --lm-line: #c6d0da;\n --lm-accent: #0b6b8f; --lm-accent-soft: #d6e9f0; --lm-alt: #7a4f9a; --lm-alt-soft: #efe5f6;\n --lm-ok: #2a7f5a; --lm-warn: #b86e00; --lm-drop: #b7392e; --lm-lane: #e3e9ee;\n --lm-lost-fill: #fbefed; --lm-lost-line: #b7392e;\n --lm-tier-base: #f4f7fa; --lm-tier: #e8eef3; --lm-tier-head: #dbe3eb; --lm-tier-fg: #34424f; --lm-tier-line: #c6d0da;\n --lm-s1: #2a78d6; --lm-s2: #eb6834; --lm-s3: #6250d6; --lm-s4: #eda100; color-scheme: light;\n --lm-font: ui-sans-serif, -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, sans-serif;\n --lm-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;\n font: 14px/1.45 var(--lm-font); color: var(--lm-fg); background: var(--lm-root-bg, var(--lm-bg));\n display: grid; gap: 14px; padding: var(--lm-pad, 16px); min-width: 0; box-sizing: border-box; }\n@media (prefers-color-scheme: dark) { .lm:not([data-theme=\"light\"]) { \n --lm-bg: #0d141b; --lm-surface: #151e27; --lm-fg: #e4ebf1; --lm-muted: #93a3b3; --lm-line: #2a3744;\n --lm-accent: #5fb7d6; --lm-accent-soft: #163442; --lm-alt: #c39be0; --lm-alt-soft: #2b2236;\n --lm-ok: #5fc08f; --lm-warn: #e2a24a; --lm-drop: #e26a5c; --lm-lane: #1b2631;\n --lm-lost-fill: #2b1c1d; --lm-lost-line: #e26a5c;\n --lm-tier-base: #1b2530; --lm-tier: #24323f; --lm-tier-head: #2c3b4a; --lm-tier-fg: #c3cfda; --lm-tier-line: #33424f;\n --lm-s1: #3987e5; --lm-s2: #d95926; --lm-s3: #9085e9; --lm-s4: #c98500; color-scheme: dark; } }\n.lm[data-theme=\"dark\"] { \n --lm-bg: #0d141b; --lm-surface: #151e27; --lm-fg: #e4ebf1; --lm-muted: #93a3b3; --lm-line: #2a3744;\n --lm-accent: #5fb7d6; --lm-accent-soft: #163442; --lm-alt: #c39be0; --lm-alt-soft: #2b2236;\n --lm-ok: #5fc08f; --lm-warn: #e2a24a; --lm-drop: #e26a5c; --lm-lane: #1b2631;\n --lm-lost-fill: #2b1c1d; --lm-lost-line: #e26a5c;\n --lm-tier-base: #1b2530; --lm-tier: #24323f; --lm-tier-head: #2c3b4a; --lm-tier-fg: #c3cfda; --lm-tier-line: #33424f;\n --lm-s1: #3987e5; --lm-s2: #d95926; --lm-s3: #9085e9; --lm-s4: #c98500; color-scheme: dark; }\n.lm *, .lm *::before, .lm *::after { box-sizing: border-box; }\n.lm h2 { font-size: 1.3rem; font-weight: 600; margin: 0; text-wrap: balance; }\n.lm h3 { font: 600 .74rem var(--lm-font); text-transform: uppercase; letter-spacing: .08em; color: var(--lm-muted); margin: 0; }\n.lm button:focus-visible, .lm input:focus-visible, .lm select:focus-visible { outline: 2px solid var(--lm-accent); outline-offset: 2px; }\n.lm-problems { margin: 0; padding: 10px 12px; font: .8rem/1.5 var(--lm-mono); white-space: pre-wrap; overflow-x: auto; color: var(--lm-fg); background: var(--lm-surface); border: 1px solid var(--lm-line); border-left: 3px solid var(--lm-drop); border-radius: 6px; }\n.lm-note { margin: 0; font-size: .8rem; color: var(--lm-muted); }\n.lm-card { background: var(--lm-surface); border: 1px solid var(--lm-line); border-radius: 8px; padding: 14px 16px; display: grid; gap: 12px; align-content: start; min-width: 0; }\n\n.lm-wrap { display: grid; gap: 8px; min-width: 0; position: relative; }\n.lm-bar { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }\n.lm-btn { font: 500 .8rem var(--lm-font); color: var(--lm-fg); background: var(--lm-surface); border: 1px solid var(--lm-line); border-radius: 6px; padding: 6px 12px; cursor: pointer; white-space: nowrap; }\n.lm-board { position: relative; background: var(--lm-surface); border: 1px solid var(--lm-line); border-radius: 8px; overflow: hidden; margin: 0 auto; width: 100%; }\n.lm-board svg { display: block; width: 100%; height: auto; font-family: var(--lm-font); }\n.lm-board canvas { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }\n/* the story's title over the board while it plays: a lower third, at the top when what is framed is low; a strip\n across the top of a narrow board */\n.lm-title { position: absolute; left: 12px; bottom: 12px; z-index: 1; display: grid; gap: 1px; max-width: min(34rem, calc(100% - 24px)); padding: 7px 12px 8px; border-left: 4px solid var(--lm-accent); border-radius: 0 6px 6px 0; background: color-mix(in srgb, var(--lm-surface) 92%, transparent); box-shadow: 0 4px 16px rgb(0 0 0 / .12); pointer-events: none; overflow-wrap: anywhere; }\n.lm-title[data-top] { top: 12px; bottom: auto; }\n.lm-title b { font-size: .95rem; font-weight: 600; }\n.lm-title span { font: 500 .8rem var(--lm-mono); color: var(--lm-muted); }\n@container (max-width: 520px) {\n .lm-title, .lm-title[data-top] { top: 0; right: 0; bottom: auto; left: 0; max-width: none; padding: 4px 8px; border-radius: 0; box-shadow: none; }\n .lm-title b { font-size: .8rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }\n .lm-title span { display: none; }\n}\n.lm-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: .78rem; color: var(--lm-muted); }\n.lm-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 50%; vertical-align: -1px; margin-right: 5px; }\n.lm-legend i.lm-legend-merge { box-sizing: border-box; border: 1.5px solid var(--lm-muted); }\n\n/* full screen (the browser's, or a fixed overlay): a column that never scrolls. The diagram as wide as the screen on\n top; under it the verdict in a line and the panels, compact, in a dock the screen sizes. The load changes what is\n in them, never their size, so it never moves the board. Focus: the diagram, the story, the verdict and the load */\n.lm-side, .lm-card > .lm-panel { display: contents; }\n.lm-panel { display: grid; gap: 14px; min-width: 0; }\n.lm[data-full] { height: 100vh; height: 100dvh; padding: 16px; background: var(--lm-bg); overflow: hidden; overscroll-behavior: contain; display: flex; flex-direction: column; gap: 10px; position: relative; }\n.lm[data-full=\"fill\"] { height: 100%; padding: 10px; }\n.lm[data-full=\"overlay\"] { position: fixed; inset: 0; z-index: 2147483000; width: auto; max-width: none; max-height: none; margin: 0; border: 0; }\n.lm[data-full] > * { flex: none; }\n/* a page of its own keeps the rest outside full screen, as <Loadmap> does */\n.lm[data-full] > :not(.lm-canvas, .lm-head, h2, .lm-scenarios, .lm-loadbar, .lm-story, .lm-wrap, .lm-side) { display: none; }\n.lm-head { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 20px; min-width: 0; }\n.lm-head h2 { font-size: 1.1rem; }\n.lm-head .lm-loadbar { flex: 1 1 520px; }\n.lm[data-full] .lm-wrap { gap: 6px; }\n/* the board as large as fits (--lm-fit, from Diagram), left under the bar, so the legend starts where the board does */\n.lm[data-full] .lm-board { width: var(--lm-fit, 100%); margin: 0; align-self: start; justify-self: start; }\n.lm-tools { display: flex; align-items: center; gap: 8px; margin-left: auto; }\n.lm-modes { display: inline-flex; margin: 0; padding: 0; min-width: 0; border: 1px solid var(--lm-line); border-radius: 6px; overflow: hidden; }\n.lm-modes button { font: 500 .8rem var(--lm-font); color: var(--lm-fg); background: var(--lm-surface); border: 0; padding: 6px 12px; cursor: pointer; }\n.lm-modes button[aria-pressed=\"true\"] { background: var(--lm-fg); color: var(--lm-surface); }\n.lm[data-full] .lm-story { padding: 6px 12px; }\n.lm[data-full] [data-out] { display: none; }\n\n.lm-headline { flex: 1 1 auto; min-width: 0; margin: 0; font-size: .9rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }\n.lm-num { font: 600 .95em var(--lm-mono); font-variant-numeric: tabular-nums; }\n.lm-link { font: 500 .8rem var(--lm-font); color: var(--lm-accent); background: none; border: 0; padding: 2px 4px; cursor: pointer; white-space: nowrap; }\n\n\n\n/* a page of its own: its .lm-side is a box under the board that scrolls on its own, the board as large as leaves it a\n third of the screen */\n.lm[data-full] > .lm-side { display: grid; gap: 14px; align-content: start; flex: 1 1 0; min-height: 33dvh; overflow: auto; overscroll-behavior: contain; container-type: inline-size; }\n\n/* focus: the board and what runs on it in the middle of the screen */\n.lm[data-mode=\"focus\"] > .lm-side { display: none; }\n.lm[data-mode=\"focus\"] > .lm-wrap { margin-top: auto; }\n.lm[data-mode=\"focus\"] > .lm-story { order: 1; }\n.lm[data-mode=\"focus\"]::after { content: \"\"; order: 2; margin-top: auto; }\n.lm[data-mode=\"focus\"] > .lm-story { border-left-width: 4px; padding: 10px 14px; }\n.lm[data-mode=\"focus\"] > .lm-story p { font-size: 1.1rem; }\n\n@media (max-width: 760px) {\n .lm[data-full] { padding: 10px; gap: 8px; }\n /* the page has the title, and the legend: here they would leave the diagram no room */\n .lm[data-full] > h2, .lm[data-full] :is(.lm-head h2, .lm-legend, .lm-story legend) { display: none; }\n /* the one exception: here the diagram runs top to bottom, and shrunk to the screen it is too small to read, so it\n pans in a box of its own with the bar on top. The page never scrolls */\n .lm[data-full] .lm-board { width: 100%; }\n .lm[data-full] > .lm-wrap { height: 40dvh; overflow: auto; row-gap: 0; overscroll-behavior: contain; }\n .lm[data-mode=\"focus\"] > .lm-wrap { height: auto; flex: 1 1 0; min-height: 0; margin-top: 0; }\n .lm[data-full] .lm-bar { position: sticky; top: 0; z-index: 1; padding-bottom: 8px; background: var(--lm-bg); }\n .lm[data-full] > .lm-story { padding: 6px 10px; gap: 6px 10px; }\n .lm[data-full] > .lm-story p { font-size: .84rem; }\n .lm[data-full] .lm-story button { padding: 4px 10px; }\n .lm[data-full] .lm-headline { flex-basis: 100%; }\n /* the load in thumb reach: the bar under the board and the story, over the verdict */\n .lm[data-full] .lm-head { display: contents; }\n .lm[data-full] .lm-loadbar { order: 2; flex: none; }\n /* two lines, so the board keeps its room: the scenarios and the load's value, then the track; the label names the\n slider unseen */\n .lm[data-full] .lm-load small { display: none; }\n .lm[data-full] .lm-load { display: contents; }\n .lm[data-full] :is(.lm-loadbar legend, .lm-load > label) { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }\n .lm[data-full] .lm-load > output { margin-left: auto; }\n .lm[data-full] .lm-load-track { flex: 1 1 100%; }\n}\n\n.lm-verdict { margin: 0; padding: 10px 14px; border-left: 4px solid var(--lm-ok); background: var(--lm-accent-soft); border-radius: 0 6px 6px 0; }\n.lm-verdict[data-tier=\"warn\"] { border-color: var(--lm-warn); }\n.lm-verdict[data-tier=\"over\"] { border-color: var(--lm-drop); }\n.lm-measure, .lm-peak, .lm-outage { margin: 6px 0 0; padding: 0 14px; font-size: .86rem; color: var(--lm-muted); }\n\n.lm-strip { display: grid; grid-template-columns: minmax(0, 3fr) minmax(280px, 2fr); gap: 14px; align-items: start; }\n@container (max-width: 860px) { .lm-strip { grid-template-columns: minmax(0, 1fr); } }\n.lm { container-type: inline-size; }\n\n.lm-meters { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 8px; }\n.lm-meter { padding: 8px 10px; border-radius: 6px; background: var(--lm-bg); min-width: 0; }\n.lm-meter b { display: block; font: 500 1.15rem var(--lm-mono); font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }\n.lm-meter span { font-size: .74rem; color: var(--lm-muted); }\n.lm-meter[data-state=\"warn\"] b { color: var(--lm-warn); } .lm-meter[data-state=\"over\"] b { color: var(--lm-drop); }\n\n.lm-limits { display: grid; gap: 10px; }\n.lm-lim, .lm-scale { display: grid; grid-template-columns: minmax(0, 14rem) minmax(0, 1fr) 10rem; gap: 4px 14px; align-items: center; }\n@container (max-width: 640px) { .lm-lim, .lm-scale { grid-template-columns: minmax(0, 1fr); } .lm-scale > :first-child, .lm-scale > :last-child { display: none; } }\n.lm-lim b { display: block; font-weight: 600; font-size: .88rem; }\n.lm-lim .lm-sub { display: block; font-size: .74rem; color: var(--lm-muted); }\n.lm-tag { font: 600 .64rem var(--lm-font); text-transform: uppercase; letter-spacing: .06em; border-radius: 3px; padding: 1px 5px; margin-left: 6px; vertical-align: 1px; }\n.lm-tag[data-kind=\"first\"] { color: var(--lm-surface); background: var(--lm-drop); }\n.lm-tag[data-kind=\"estimated\"] { color: var(--lm-warn); border: 1px solid currentColor; }\n.lm-tag[data-kind=\"published\"] { color: var(--lm-alt); border: 1px solid currentColor; }\n.lm-tag[data-kind=\"none\"] { color: var(--lm-muted); border: 1px dashed currentColor; }\n.lm-tag[data-kind=\"range\"], .lm-tag[data-kind=\"rank\"] { color: var(--lm-muted); border: 1px solid currentColor; }\n.lm-track { position: relative; height: 16px; background: var(--lm-bg); border-radius: 3px; overflow: hidden; }\n.lm-fill { position: absolute; inset: 0 auto 0 0; background: var(--lm-ok); transition: width .25s ease; }\n.lm-fill[data-state=\"warn\"] { background: var(--lm-warn); } .lm-fill[data-state=\"over\"] { background: var(--lm-drop); }\n.lm-tick { position: absolute; top: 0; bottom: 0; width: 1px; background: var(--lm-fg); opacity: .55; }\n.lm-val { font: 500 .8rem var(--lm-mono); font-variant-numeric: tabular-nums; }\n.lm-val small { display: block; font: 400 .72rem var(--lm-font); color: var(--lm-muted); }\n.lm-scale { font: 400 .7rem var(--lm-mono); color: var(--lm-muted); }\n.lm-scale div { position: relative; height: 12px; }\n.lm-scale div span { position: absolute; transform: translateX(-50%); white-space: nowrap; }\n\n.lm-controls label.lm-range { display: grid; gap: 4px; font-size: .84rem; }\n.lm-controls label.lm-range > span { display: flex; justify-content: space-between; gap: 8px; }\n.lm-controls output { font-family: var(--lm-mono); font-variant-numeric: tabular-nums; }\n.lm-controls input[type=range] { width: 100%; accent-color: var(--lm-accent); }\n.lm-presets { display: flex; flex-wrap: wrap; gap: 6px; }\n.lm-presets button { font: 500 .76rem var(--lm-font); background: var(--lm-accent-soft); color: var(--lm-fg); border: 1px solid transparent; border-radius: 5px; padding: 5px 10px; cursor: pointer; }\n.lm-presets button[aria-pressed=\"true\"] { border-color: var(--lm-accent); }\n.lm-switch { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 0 8px; align-items: start; font-size: .84rem; cursor: pointer; }\n.lm-switch input { margin: 3px 0 0; accent-color: var(--lm-accent); }\n.lm-switch small, .lm-select small { grid-column: 2; color: var(--lm-muted); font-size: .74rem; line-height: 1.3; }\n.lm-select { display: grid; gap: 4px; font-size: .84rem; }\n.lm-select select { width: 100%; min-width: 0; font: 400 .84rem var(--lm-font); color: var(--lm-fg); background: var(--lm-surface); border: 1px solid var(--lm-line); border-radius: 5px; padding: 5px 8px; }\n.lm-off { opacity: .45; cursor: default; }\n\n.lm-facts { margin: 0; padding-left: 1.1em; font-size: .88rem; columns: 2; column-gap: 28px; }\n@container (max-width: 860px) { .lm-facts { columns: 1; } }\n.lm-facts li { margin-bottom: 8px; break-inside: avoid; }\n.lm-prov { font: 600 .66rem var(--lm-font); text-transform: uppercase; letter-spacing: .06em; }\n.lm-prov[data-kind=\"measured\"] { color: var(--lm-ok); } .lm-prov[data-kind=\"estimated\"] { color: var(--lm-warn); }\n.lm-prov[data-kind=\"configured\"] { color: var(--lm-accent); } .lm-prov[data-kind=\"published\"] { color: var(--lm-alt); }\n\n/* scenario identity colours (s1–s4) are checked for colour-blind separation on both surfaces; text never wears them */\n.lm-scenarios { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; border: 0; padding: 0; margin: 0; min-width: 0; }\n.lm-scenarios legend { float: left; font: 600 .74rem var(--lm-font); text-transform: uppercase; letter-spacing: .08em; color: var(--lm-muted); margin-right: 6px; padding: 0; }\n.lm-scenarios button { font: 500 .84rem var(--lm-font); color: var(--lm-fg); background: var(--lm-surface); border: 1px solid var(--lm-line); border-radius: 6px; padding: 6px 12px; cursor: pointer; }\n.lm-scenarios button[aria-pressed=\"true\"] { border-color: var(--lm-fg); box-shadow: inset 0 0 0 1px var(--lm-fg); }\n.lm-scenarios i, .lm-table i { display: inline-block; width: 10px; height: 10px; border-radius: 50%; vertical-align: -1px; margin-right: 6px; }\n.lm-story { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin: 0; min-width: 0; padding: 8px 12px; border: 1px solid var(--lm-line); border-left: 3px solid var(--lm-accent); border-radius: 6px; background: var(--lm-surface); }\n.lm-story legend { float: left; font: 600 .74rem var(--lm-font); text-transform: uppercase; letter-spacing: .08em; color: var(--lm-muted); padding: 0; }\n.lm-story p { flex: 1 1 240px; display: grid; margin: 0; font: 400 .9rem/1.4 var(--lm-font); color: var(--lm-fg); }\n.lm-story p > span { grid-area: 1 / 1; }\n.lm-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }\n.lm-story p > span:not([data-shown]), .lm-story em:not([data-shown]) { visibility: hidden; }\n.lm-story-progress { display: flex; align-items: center; gap: 4px; }\n.lm-story-progress i { position: relative; width: 28px; height: 4px; border-radius: 2px; background: var(--lm-line); overflow: hidden; }\n.lm-story-progress i[data-state=\"done\"], .lm-story:not([data-playing]) .lm-story-progress i[data-state=\"now\"] { background: var(--lm-accent); }\n.lm-story[data-playing] .lm-story-progress i[data-state=\"now\"]::before { content: \"\"; position: absolute; inset: 0; background: var(--lm-accent); transform-origin: left; animation: lm-step var(--lm-step) linear both; }\n@keyframes lm-step { from { transform: scaleX(0); } to { transform: scaleX(1); } }\n.lm-story b { font-weight: 600; color: var(--lm-muted); margin-right: 4px; white-space: nowrap; }\n.lm-story-nav { display: flex; gap: 6px; }\n.lm-story em { color: var(--lm-muted); }\n.lm-story button { font: 500 .84rem var(--lm-font); color: var(--lm-fg); background: var(--lm-surface); border: 1px solid var(--lm-line); border-radius: 6px; padding: 6px 12px; cursor: pointer; }\n.lm-story button[aria-disabled=\"true\"] { opacity: .45; cursor: default; }\n.lm-own { font-size: .78rem; color: var(--lm-muted); }\n\n/* the scenarios and the load over the board, in view while the page scrolls; on a phone under the board */\n.lm-loadbar { position: sticky; top: var(--lm-sticky-top, 0px); z-index: 3; container-type: inline-size; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 20px; padding: 6px 12px 2px; background: var(--lm-surface); border: 1px solid var(--lm-line); border-radius: 8px; box-shadow: 0 4px 14px -10px rgb(0 0 0 / .4); }\n.lm-loadbar .lm-scenarios { flex-wrap: nowrap; max-width: 100%; overflow-x: auto; padding: 2px; }\n.lm-loadbar .lm-scenarios button { flex: none; white-space: nowrap; }\n.lm-loadbar .lm-load { flex: 1 1 300px; }\n@container (min-width: 720px) {\n .lm-loadbar .lm-load { grid-template: \"label track value\" / minmax(0, max-content) minmax(160px, 1fr) auto; align-items: start; }\n .lm-loadbar .lm-load > label { max-width: 14em; padding-top: 6px; }\n}\n@container (max-width: 520px) {\n .lm:not([data-full]) > .lm-loadbar { order: 1; top: auto; bottom: 0; }\n .lm:not([data-full]) > .lm-side { order: 2; }\n}\n/* the load: its label and value, the track under them, the marks under it */\n.lm-load { display: grid; grid-template: \"label value\" \"track track\" / minmax(0, 1fr) auto; align-items: center; gap: 0 12px; font-size: .84rem; min-width: 0; }\n.lm-load > label { grid-area: label; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }\n.lm-load > output { grid-area: value; text-align: right; font: 600 .95rem/1.2 var(--lm-mono); font-variant-numeric: tabular-nums; }\n.lm-load small { display: block; font: 400 .7rem var(--lm-mono); color: var(--lm-muted); }\n.lm-load-track { grid-area: track; position: relative; min-width: 0; padding-bottom: 22px; }\n.lm-load input { display: block; width: 100%; height: 32px; margin: 0; accent-color: var(--lm-accent); cursor: pointer; }\n.lm-zones, .lm-marks { position: absolute; left: 8px; right: 8px; top: 30px; }\n.lm-zones { height: 4px; border-radius: 2px; }\n.lm-marks button { position: absolute; top: 0; transform: translateX(-50%); min-width: 20px; height: 24px; padding: 7px 2px 0; border: 0; background: none; font: 500 .68rem var(--lm-mono); color: var(--lm-accent); white-space: nowrap; cursor: pointer; }\n.lm-marks button::before { content: \"\"; position: absolute; left: 50%; top: 0; width: 2px; height: 6px; margin-left: -1px; background: currentColor; }\n.lm-marks button:not([data-label]) span { display: none; }\n.lm-marks [data-kind=\"target\"] { color: var(--lm-warn); }\n.lm-marks [data-kind=\"full\"] { color: var(--lm-drop); }\n.lm-marks [aria-pressed=\"true\"] { font-weight: 700; text-decoration: underline; }\n.lm-key { display: inline-block; width: 14px; height: 2px; border-radius: 1px; vertical-align: 3px; margin-right: 6px; }\n\n.lm-compare-text { margin: 0; }\n.lm-table-wrap { overflow-x: auto; }\n.lm-table { border-collapse: collapse; width: 100%; font-size: .84rem; }\n.lm-table th, .lm-table td { text-align: left; padding: 6px 10px 6px 0; border-bottom: 1px solid var(--lm-line); vertical-align: top; }\n.lm-table thead th { font: 600 .7rem var(--lm-font); text-transform: uppercase; letter-spacing: .06em; color: var(--lm-muted); }\n.lm-table tbody th { font-weight: 600; white-space: nowrap; }\n.lm-table td { font-family: var(--lm-mono); font-variant-numeric: tabular-nums; }\n.lm-table td.lm-text { font-family: var(--lm-font); }\n.lm-table td small { display: block; font: 400 .72rem var(--lm-font); color: var(--lm-muted); }\n.lm-table tr[aria-current] th { text-decoration: underline; text-underline-offset: 3px; }\n\n.lm-chart { position: relative; min-width: 0; }\n.lm-chart svg { display: block; overflow: visible; }\n.lm-chart:focus-visible { outline: 2px solid var(--lm-accent); outline-offset: 2px; }\n.lm-axis, .lm-axis text { font: 400 11px var(--lm-mono); fill: var(--lm-muted); }\n.lm-mark { font: 600 11px var(--lm-mono); fill: var(--lm-fg); }\n.lm-tip { position: absolute; z-index: 2; display: grid; gap: 2px; width: max-content; max-width: min(17rem, calc(100% - 8px)); overflow-wrap: anywhere; padding: 8px 10px; font-size: .78rem; background: var(--lm-surface); color: var(--lm-fg); border: 1px solid var(--lm-line); border-radius: 6px; box-shadow: 0 4px 14px rgb(0 0 0 / .14); pointer-events: none; }\n.lm-tip strong { font: 600 .82rem var(--lm-mono); font-variant-numeric: tabular-nums; }\n.lm-tip .lm-sub { color: var(--lm-muted); }\n.lm-nowrap { white-space: nowrap; }\n.lm-node { cursor: pointer; outline: none; }\n.lm-node:focus-visible > :first-child { stroke-width: 3; }\n\n@media (prefers-reduced-motion: reduce) {\n .lm-fill { transition: none; }\n .lm-story[data-playing] .lm-story-progress i[data-state=\"now\"]::before { animation: none; transform: none; }\n}\n\n/* without weight: a page's own .lm-canvas { height } wins, wherever its stylesheet stands */\n:where(.lm-canvas) { height: clamp(420px, 70dvh, 760px); }\n.lm-canvas { position: relative; box-sizing: border-box; overflow: hidden; contain: layout; border: 1px solid var(--lm-line); border-radius: var(--lm-radius, 10px); background: var(--lm-surface); }\n.lm.lm[data-full] > .lm-canvas { display: block; flex: 1 1 0; height: auto; min-height: 0; }\n/* the spacer that centres a page of parts with the least around it would take a gap under the canvas */\n.lm.lm[data-full]:has(> .lm-canvas)::after { content: none; }\n.lm-canvas > .lm-wrap[data-canvas] { position: absolute; inset: 0; }\n.lm-canvas-bar, .lm-canvas-console { position: absolute; left: 0; right: var(--lm-canvas-right, 0px); z-index: 3; box-sizing: border-box; display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; padding: 8px 12px; background: var(--lm-surface); }\n.lm-canvas-bar { top: 0; border-bottom: 1px solid var(--lm-line); }\n.lm-canvas-console { bottom: 0; border-top: 1px solid var(--lm-line); }\n/* over the bar for a while, across the whole top: as tall as it needs */\n.lm-canvas-panel[hidden] { display: none; }\n/* never more than the diagram can give: a long step scrolls in its strip */\n.lm-canvas-over { position: absolute; z-index: 5; top: 0; left: 0; right: 0; box-sizing: border-box; display: flex; align-items: center; max-height: 45%; overflow: auto; overscroll-behavior: contain; background: var(--lm-surface); border-bottom: 1px solid var(--lm-line); box-shadow: 0 8px 18px -14px rgb(0 0 0 / .45); }\n.lm-canvas-over > .lm-story { flex: 1 1 auto; border: 0; border-radius: 0; background: none; }\n.lm-canvas-over > .lm-canvas-leave { flex: none; margin-right: 12px; }\n/* the bar's own buttons, at its end */\n.lm-canvas-tools { display: flex; flex: none; gap: 6px; margin-left: auto; }\n.lm-canvas-tools .lm-btn { padding: 4px 9px; }\n.lm-canvas-tools .lm-btn[aria-pressed=\"true\"].lm-canvas-chrome { border-color: var(--lm-fg); box-shadow: inset 0 0 0 1px var(--lm-fg); }\n.lm-frame .lm-canvas-bar > .lm-legend + .lm-canvas-tools { margin-left: 0; }\n/* a slot that holds nothing takes no room */\n.lm-canvas-bar:empty, .lm-canvas-console:empty { display: none; }\n.lm-canvas[data-width=\"compact\"] :is(.lm-canvas-bar, .lm-canvas-console) { padding: 6px 8px; }\n.lm-canvas[data-short] .lm-canvas-bar { padding: 4px 8px; }\n/* on a touch screen two fingers zoom a narrow canvas: Fit alone stays, clear of the boxes */\n@media (pointer: coarse) { .lm-canvas[data-width=\"compact\"] .lm-zoom .lm-btn:not(:last-child) { display: none; } }\n/* a page of its own parts has full-screen rules for a phone (the load on two lines, no legend): not the canvas's */\n.lm.lm[data-full] .lm-canvas .lm-load { display: grid; }\n.lm.lm[data-full] .lm-canvas .lm-load small { display: block; }\n.lm.lm[data-full] .lm-canvas .lm-load > label { position: static; width: auto; height: auto; clip-path: none; }\n.lm.lm[data-full] .lm-canvas .lm-load > output { margin-left: 0; }\n.lm.lm[data-full] .lm-canvas .lm-headline { flex-basis: auto; }\n.lm.lm[data-full] .lm-canvas .lm-legend { display: flex; }\n\n/* the panels: their tabs, and the one that is open. Nothing but the open panel scrolls in a canvas */\n.lm-canvas-tabs { position: absolute; z-index: 3; display: flex; box-sizing: border-box; background: var(--lm-surface); }\n.lm-canvas-tabs button { flex: none; font: 500 .8rem var(--lm-font); color: var(--lm-muted); background: none; border: 0; padding: 0 12px; cursor: pointer; white-space: nowrap; }\n.lm-canvas-tabs button:hover { color: var(--lm-fg); }\n.lm-canvas-tabs button[aria-expanded=\"true\"] { color: var(--lm-fg); font-weight: 600; box-shadow: inset 0 -2px 0 var(--lm-fg); }\n.lm-canvas-tabs button:focus-visible, .lm-canvas-menu:focus-visible { outline: 2px solid var(--lm-accent); outline-offset: -2px; }\n.lm-canvas[data-tabs=\"row\"] .lm-canvas-tabs { left: 0; right: 0; bottom: var(--lm-canvas-bottom); height: 36px; border-top: 1px solid var(--lm-line); overflow-x: auto; scrollbar-width: none; }\n.lm-canvas[data-tabs=\"row\"] .lm-canvas-tabs::-webkit-scrollbar { display: none; }\n/* the five share a narrow row */\n.lm-canvas[data-tabs=\"row\"][data-width=\"compact\"] .lm-canvas-tabs button { flex: 1 1 auto; padding: 0 4px; }\n.lm-canvas[data-tabs=\"rail\"] .lm-canvas-tabs { top: 0; right: 0; bottom: 0; width: 44px; flex-direction: column; align-items: stretch; padding-top: 6px; border-left: 1px solid var(--lm-line); overflow: hidden; }\n.lm-canvas[data-tabs=\"rail\"] .lm-canvas-tabs button { padding: 12px 0; display: flex; justify-content: center; }\n.lm-canvas[data-tabs=\"rail\"] .lm-canvas-tabs button span { writing-mode: vertical-rl; }\n.lm-canvas[data-tabs=\"rail\"] .lm-canvas-tabs button[aria-expanded=\"true\"] { box-shadow: inset 2px 0 0 var(--lm-fg); }\n.lm-canvas[data-tabs=\"head\"] .lm-canvas-tabs { top: 0; right: 0; width: var(--lm-canvas-right); height: 40px; border-left: 1px solid var(--lm-line); border-bottom: 1px solid var(--lm-line); overflow-x: auto; scrollbar-width: none; }\n.lm-canvas[data-tabs=\"head\"] .lm-canvas-tabs::-webkit-scrollbar { display: none; }\n.lm-canvas-menu { position: absolute; z-index: 4; top: 5px; right: 8px; width: 116px; font: 500 .8rem var(--lm-font); color: var(--lm-fg); background: var(--lm-surface); border: 1px solid var(--lm-line); border-radius: 6px; padding: 4px 6px; }\n.lm-canvas[data-tabs=\"menu\"] .lm-canvas-bar, .lm-canvas[data-tabs=\"menu\"] .lm-canvas-bar:empty { display: flex; min-height: 40px; padding-right: 132px; }\n.lm-canvas-panel { position: absolute; z-index: 4; box-sizing: border-box; display: grid; grid-template-rows: auto minmax(0, 1fr); background: var(--lm-surface); outline: 0; }\n.lm-canvas-panel[data-place=\"side\"] { top: var(--lm-canvas-top); bottom: var(--lm-canvas-under); right: var(--lm-canvas-right); width: calc(var(--lm-canvas-reach) - var(--lm-canvas-right)); border-left: 1px solid var(--lm-line); box-shadow: -8px 0 18px -14px rgb(0 0 0 / .45); }\n.lm-canvas[data-pinned] .lm-canvas-panel { top: 40px; right: 0; bottom: 0; width: var(--lm-canvas-right); box-shadow: none; }\n.lm-canvas[data-pinned] .lm-canvas-panel-head { display: none; }\n.lm-canvas-panel[data-place=\"sheet\"] { left: 0; right: 0; bottom: var(--lm-canvas-under); height: var(--lm-canvas-reach); border-top: 1px solid var(--lm-line); border-radius: 10px 10px 0 0; box-shadow: 0 -8px 18px -14px rgb(0 0 0 / .45); }\n.lm-canvas-panel-head { display: flex; align-items: center; gap: 6px; padding: 6px 8px 6px 12px; border-bottom: 1px solid var(--lm-line); }\n.lm-canvas-panel-head h3 { flex: 1 1 auto; min-width: 0; margin: 0; font-size: .86rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }\n.lm-canvas-panel-head .lm-btn { padding: 3px 8px; }\n.lm-canvas-panel-body { display: grid; gap: 14px; align-content: start; min-height: 0; padding: 12px; overflow: auto; overscroll-behavior: contain; container-type: inline-size; }\n@media (prefers-reduced-motion: no-preference) {\n .lm-canvas-panel[data-place=\"side\"] { animation: lm-canvas-side .16s ease-out; }\n .lm-canvas[data-pinned] .lm-canvas-panel { animation: none; }\n .lm-canvas-panel[data-place=\"sheet\"] { animation: lm-canvas-sheet .16s ease-out; }\n}\n@keyframes lm-canvas-side { from { transform: translateX(16px); opacity: 0; } }\n@keyframes lm-canvas-sheet { from { transform: translateY(16px); opacity: 0; } }\n\n/* the frame: what <Frame> puts in the two slots. Each is one row of a height nothing the reader does changes */\n.lm-frame .lm-canvas-bar { flex-wrap: nowrap; overflow: hidden; }\n.lm-frame .lm-canvas-bar > h2 { flex: 0 5 auto; min-width: 0; font-size: .95rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }\n.lm-frame .lm-canvas-bar > .lm-scenarios { flex: 0 2 auto; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; padding: 2px; }\n.lm-frame .lm-canvas-bar > .lm-scenarios::-webkit-scrollbar { display: none; }\n.lm-frame .lm-canvas-bar > .lm-scenarios > * { flex: none; white-space: nowrap; }\n.lm-frame .lm-canvas-bar > .lm-scenarios button { padding: 4px 10px; }\n/* named for a screen reader, unseen: the buttons say what they are */\n.lm-frame .lm-canvas-bar > .lm-scenarios legend, .lm.lm .lm-frame[data-short] .lm-load > label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }\n/* one row whatever is on: an entry that does not fit wraps under it, out of view, whole */\n.lm-frame .lm-canvas-bar > .lm-legend { flex: 1 1 0; justify-content: flex-end; min-width: 0; height: 1.5em; line-height: 1.5; overflow: hidden; white-space: nowrap; }\n.lm-canvas-pick { flex: 0 1 auto; min-width: 0; max-width: 100%; font: 500 .84rem var(--lm-font); color: var(--lm-fg); background: var(--lm-surface); border: 1px solid var(--lm-line); border-radius: 6px; padding: 5px 8px; }\n.lm-frame .lm-canvas-console { display: grid; grid-template-columns: minmax(0, 1fr); gap: 2px; padding: 6px 12px 8px; }\n.lm-frame .lm-canvas-console > .lm-load { grid-template: \"label track value\" / minmax(0, max-content) minmax(120px, 1fr) auto; align-items: start; }\n.lm-frame .lm-canvas-console > .lm-load > label { max-width: 14em; padding-top: 6px; }\n.lm-frame .lm-canvas-console > .lm-load > output { padding-top: 5px; }\n.lm-canvas-verdict { display: flex; align-items: center; gap: 6px 14px; min-width: 0; padding-left: 8px; border-left: 4px solid var(--lm-ok); }\n.lm-canvas-verdict[data-tier=\"warn\"] { border-color: var(--lm-warn); }\n.lm-canvas-verdict[data-tier=\"over\"] { border-color: var(--lm-drop); }\n.lm-frame[data-width=\"compact\"] .lm-canvas-console { padding: 6px 8px; }\n.lm-frame[data-width=\"compact\"] .lm-canvas-console > .lm-load { grid-template: \"label value\" \"track track\" / minmax(0, 1fr) auto; align-items: center; }\n.lm-frame[data-width=\"compact\"] .lm-canvas-console > .lm-load > :is(label, output) { padding-top: 0; }\n/* room for the date under the load, with one or not */\n.lm-frame[data-width=\"compact\"] .lm-canvas-console > .lm-load > output { min-height: 2.1rem; }\n/* two lines kept whatever the verdict says: the load never changes the console's height */\n.lm-frame[data-width=\"compact\"]:not([data-short]) .lm-headline { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; height: 2.6em; line-height: 1.3; white-space: normal; }\n.lm-frame[data-short] .lm-canvas-console { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: center; gap: 12px; padding: 2px 8px; }\n.lm-frame[data-short] .lm-canvas-console > .lm-load { grid-template: \"track value\" / minmax(0, 1fr) auto; align-items: start; }\n.lm-frame[data-short][data-width=\"compact\"] .lm-canvas-console { grid-template-columns: minmax(0, 1fr); gap: 0; }\n";
207
207
  /** Adds the stylesheet once per document. */
208
208
  export declare function injectStyles(doc?: Document): void;
209
209
  export { type AnyNodeDef, type CanvasProps, type CanvasSize, type Chrome, type ClusterDef, type Cue, Diagram, type DiagramProps, type Dot, type EdgeDef, type ElkEngine, type Engine, type FlowColor, type FlowView, type FullScreenMode, LOADMAP_PANELS, type Label, Loadmap, type LoadmapController, type LoadmapHandle, type LoadmapOptions, type LoadmapPanel, type LoadmapProps, LoadmapRoot, MEASURES, type NodeDef, type PoolDef, type SubsystemDef, type Theme, type TierDef, type View, type ViewDef, cluster, compact, defineView, directionOf, edge, fitLinear, fmt, fromSnapshot, handleOf, multiple, node, originText, panelsOf, parseSnapshot, pct, pool, secs, summarize, useLoadmap, usePageTheme };
package/dist/index.js CHANGED
@@ -1,6 +1,6 @@
1
- import { C as Diagram, S as injectStyles, T as CANVAS, _ as workerElk, a as panelsOf, b as useCanvasSize, c as LoadBar, i as handleOf, l as LoadRange, n as Loadmap, o as usePageTheme, p as scenarioColor, r as LoadmapRoot, s as useLoadmap, t as LOADMAP_PANELS, u as Scenarios, v as Canvas, x as LOADMAP_CSS, y as useCanvasPanels } from "./Loadmap-UvoLoTLT.js";
2
- import { a as Verdict, i as Meters, n as Controls, r as Limits, t as Assumptions } from "./panels-DVlqE2Dj.js";
3
- import { n as HeadroomChart, r as useComparison, t as Compare } from "./scenarios-CFSzYWOU.js";
1
+ import { C as Diagram, S as injectStyles, T as CANVAS, _ as workerElk, a as panelsOf, b as useCanvasSize, c as LoadBar, i as handleOf, l as LoadRange, n as Loadmap, o as usePageTheme, p as scenarioColor, r as LoadmapRoot, s as useLoadmap, t as LOADMAP_PANELS, u as Scenarios, v as Canvas, x as LOADMAP_CSS, y as useCanvasPanels } from "./Loadmap-C7Wf68Ur.js";
2
+ import { a as Verdict, i as Meters, n as Controls, r as Limits, t as Assumptions } from "./panels-CQdTPlJD.js";
3
+ import { n as HeadroomChart, r as useComparison, t as Compare } from "./scenarios-CoRymVnX.js";
4
4
  import { t as Story } from "./story-mK-TEB6j.js";
5
5
  import { fitLinear } from "@loadmap/core/calibrate";
6
6
  import { compact, fmt, multiple, pct, secs } from "@loadmap/core/format";
@@ -1,6 +1,6 @@
1
1
  import { g as rankLabels, r as boxComponent } from "./camera-RqbxjjVv.js";
2
- import { f as plusMinus, p as scenarioColor } from "./Loadmap-UvoLoTLT.js";
3
- import { r as useComparison } from "./scenarios-CFSzYWOU.js";
2
+ import { f as plusMinus, p as scenarioColor } from "./Loadmap-C7Wf68Ur.js";
3
+ import { r as useComparison } from "./scenarios-CoRymVnX.js";
4
4
  import { reach } from "@loadmap/core";
5
5
  import { compact, fmt, multiple, multiples, pct } from "@loadmap/core/format";
6
6
  import { useEffect, useLayoutEffect, useRef } from "react";
@@ -1,22 +1,58 @@
1
- import { d as isOn, f as plusMinus, l as LoadRange } from "./Loadmap-UvoLoTLT.js";
1
+ import { d as isOn, f as plusMinus, l as LoadRange } from "./Loadmap-C7Wf68Ur.js";
2
2
  import { sourceText } from "@loadmap/core";
3
- import { compact, duration, fmt, multiple, multiples, pct, secs } from "@loadmap/core/format";
4
- import { useEffect, useState } from "react";
3
+ import { compact, duration, fmt, multiple, multiples, pct, period, secs } from "@loadmap/core/format";
4
+ import { useEffect, useMemo, useState } from "react";
5
5
  import { Fragment, jsx, jsxs } from "react/jsx-runtime";
6
+ import { backlog } from "@loadmap/core/backlog";
7
+ import { outages } from "@loadmap/core/outages";
8
+ import { curveText } from "@loadmap/core/scaling";
6
9
  // src/panels.tsx
10
+ const n1 = /* @__PURE__ */ new WeakMap();
11
+ /**
12
+ * N−1 for what the page shows, once for the verdict and the limits: each is a whole evaluation, and its crossings do
13
+ * not move with the load, so a drag of the slider reuses them.
14
+ */
15
+ function nMinusOne(lm) {
16
+ const { load: _, ...rest } = lm.ev.values;
17
+ const key = JSON.stringify(rest);
18
+ let byValues = n1.get(lm.model);
19
+ if (!byValues) {
20
+ byValues = /* @__PURE__ */ new Map();
21
+ n1.set(lm.model, byValues);
22
+ }
23
+ const known = byValues.get(key);
24
+ if (known) return known;
25
+ const o = outages(lm.model, lm.ev.values);
26
+ if (byValues.size > 16) byValues.delete(byValues.keys().next().value);
27
+ byValues.set(key, o);
28
+ return o;
29
+ }
7
30
  /** The model's one-sentence answer for the current values, and which capacity to measure when it is unsure. */
8
31
  function Verdict({ lm }) {
9
32
  const { measure } = lm.ev;
10
- return /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx("p", {
11
- className: "lm-verdict",
12
- "data-tier": lm.ev.verdict.tier,
13
- "aria-live": "polite",
14
- children: lm.ev.verdict.text
15
- }), measure && /* @__PURE__ */ jsx("p", {
16
- className: "lm-measure",
17
- "data-component": measure.component,
18
- children: measure.text
19
- })] });
33
+ const peak = usePeak(lm);
34
+ return /* @__PURE__ */ jsxs(Fragment, { children: [
35
+ /* @__PURE__ */ jsx("p", {
36
+ className: "lm-verdict",
37
+ "data-tier": lm.ev.verdict.tier,
38
+ "aria-live": "polite",
39
+ children: lm.ev.verdict.text
40
+ }),
41
+ peak && /* @__PURE__ */ jsx("p", {
42
+ className: "lm-peak",
43
+ children: peak
44
+ }),
45
+ nMinusOne(lm).map((o) => /* @__PURE__ */ jsx("p", {
46
+ className: "lm-outage",
47
+ "data-domain": o.domain,
48
+ children: o.text
49
+ }, o.domain)),
50
+ measure && /* @__PURE__ */ jsx("p", {
51
+ className: "lm-measure",
52
+ "data-component": measure.component,
53
+ children: measure.text
54
+ })
55
+ ] });
20
56
  }
21
57
  /** The tag beside a component's name when its capacity is not plainly measured: estimated, published, a range, none. */
22
58
  function CapTag({ c, short }) {
@@ -35,12 +71,70 @@ function CapTag({ c, short }) {
35
71
  children: short && kind === "range" ? "±" : [word, short ? "" : pm].filter(Boolean).join(" ")
36
72
  });
37
73
  }
74
+ /**
75
+ * While the values are a preset's that says how long it lasts: what it leaves in the queues. "After 2 h of Black
76
+ * Friday, 1.4M events wait in the events topic, which at 1× clears in 5 h." Worked out once per evaluation.
77
+ */
78
+ function usePeak(lm) {
79
+ const { ev, model } = lm;
80
+ return useMemo(() => {
81
+ const p = ev.presets.find((x) => x.lasts != null && Object.entries(x.values).every(([k, v]) => ev.values[k] === v));
82
+ if (!p?.lasts) return null;
83
+ const left = backlog(model, ev.values, p.lasts);
84
+ const head = `After ${period(p.lasts)} of ${p.label}`;
85
+ if (!left.length) return `${head}, no queue falls behind.`;
86
+ const rest = multiple(model.defaults().load, model.searchMax);
87
+ return `${head}, ${left.map((b) => {
88
+ const flows = Object.entries(b.flows).filter(([, n]) => n > 0);
89
+ const one = flows.length === 1 ? flows[0][0] : void 0;
90
+ const what = one == null ? "units" : model.def.flows[one]?.label ?? one;
91
+ const clears = Number.isFinite(b.empties) ? `clears in ${period(b.empties)}` : "never clears";
92
+ return `${compact(b.units)} ${what} wait in ${ev.stages[b.stage]?.label ?? b.stage}, which at ${rest} ${clears}`;
93
+ }).join("; ")}.`;
94
+ }, [ev, model]);
95
+ }
96
+ /** "A daily quota: gone after 15.2 h, the rest refused." In the window's own steps, so a day just over says 23.5 h. */
97
+ function quotaText(q) {
98
+ const name = {
99
+ hour: "An hourly",
100
+ day: "A daily",
101
+ month: "A monthly"
102
+ }[q.per];
103
+ if (q.goneAfter == null) return `${name} quota.`;
104
+ const [step, word] = {
105
+ hour: [60, "min"],
106
+ day: [3600, "h"],
107
+ month: [86400, "days"]
108
+ }[q.per];
109
+ return `${name} quota: gone after ${fmt(q.goneAfter / step)} ${word}, the rest refused.`;
110
+ }
111
+ /** "Runs every day: a run takes 1.9 h of its 4 h." Past its window: "a run needs 5 h of its 4 h: it misses it." */
112
+ function runsText(r) {
113
+ const every = {
114
+ 3600: "hour",
115
+ 86400: "day",
116
+ 604800: "week"
117
+ }[r.every] ?? period(r.every);
118
+ if (!Number.isFinite(r.takes)) return `Runs every ${every}: a run never ends.`;
119
+ if (r.takes > r.within) return `Runs every ${every}: a run needs ${period(r.takes)} of its ${period(r.within)}, so it misses it.`;
120
+ return `Runs every ${every}: a run takes ${period(r.takes)} of its ${period(r.within)}.`;
121
+ }
122
+ /** "Gains 3.1 GB a day · full in 41 days at this rate"; "Keeps 7 days of 9.3 GB a day". */
123
+ function stockText(s, unit) {
124
+ const day = `${fmt(s.gains * 86400)} ${unit} a day`;
125
+ if (s.keeps != null) return `Keeps ${period(s.keeps)} of ${day}.`;
126
+ return s.room === 0 ? `Full: it gains ${day}.` : `Gains ${day} · full in ${period(s.room ?? Infinity)} at this rate.`;
127
+ }
38
128
  /** Each component's utilization in the order they reach the target, with where they cross it and 100 %. */
39
129
  function Limits({ lm, title = "Where it runs out, in order" }) {
40
130
  const { ev, model } = lm;
41
131
  const top = Math.max(1.5, model.thresholds.full * 1.5);
42
132
  const at = (u) => `${u / top * 100}%`;
43
133
  const span = (r, x) => r ? multiples(r, model.searchMax, true) : multiple(x, model.searchMax);
134
+ const outageSuffix = (c) => nMinusOne(lm).flatMap((o) => {
135
+ const r = o.components[c.id];
136
+ return r && r.low < (c.targetRange?.low ?? Number.POSITIVE_INFINITY) ? [` · ${o.with}: ${pct(model.thresholds.target)} at ${span(r, null)}`] : [];
137
+ });
44
138
  return /* @__PURE__ */ jsxs(Fragment, { children: [
45
139
  /* @__PURE__ */ jsx("h3", { children: title }),
46
140
  /* @__PURE__ */ jsxs("div", {
@@ -98,6 +192,18 @@ function Limits({ lm, title = "Where it runs out, in order" }) {
98
192
  c.spread && c.util != null && /* @__PURE__ */ jsx("span", {
99
193
  className: "lm-sub lm-spread",
100
194
  children: c.spread.text
195
+ }),
196
+ c.stock && /* @__PURE__ */ jsx("span", {
197
+ className: "lm-sub lm-stock",
198
+ children: stockText(c.stock, c.capacity?.unit ?? "")
199
+ }),
200
+ c.quota && /* @__PURE__ */ jsx("span", {
201
+ className: "lm-sub lm-quota",
202
+ children: quotaText(c.quota)
203
+ }),
204
+ c.runs && /* @__PURE__ */ jsx("span", {
205
+ className: "lm-sub lm-runs",
206
+ children: runsText(c.runs)
101
207
  })
102
208
  ] }),
103
209
  /* @__PURE__ */ jsxs("div", {
@@ -122,7 +228,7 @@ function Limits({ lm, title = "Where it runs out, in order" }) {
122
228
  }),
123
229
  /* @__PURE__ */ jsxs("div", {
124
230
  className: "lm-val",
125
- children: [c.util == null ? "—" : `${pct(c.util)} · ${num(c.demand ?? 0)} ${c.capacity?.unit ?? ""}`, /* @__PURE__ */ jsx("small", { children: c.util == null ? "switched off" : `${pct(model.thresholds.target)} at ${span(c.targetRange, c.target)} · full at ${span(c.fullRange, c.full)}` })]
231
+ children: [c.util == null ? "—" : `${pct(c.util)} · ${num(c.demand ?? 0)} ${c.capacity?.unit ?? ""}`, /* @__PURE__ */ jsx("small", { children: c.util == null ? c.stock?.undated ? "not ranked: no growth dates it" : "switched off" : `${pct(model.thresholds.target)} at ${span(c.targetRange, c.target)} · full at ${span(c.fullRange, c.full)}${outageSuffix(c).join("")}` })]
126
232
  })
127
233
  ]
128
234
  }, c.id))
@@ -399,16 +505,11 @@ function describe(a) {
399
505
  });
400
506
  }
401
507
  const f = a.fit;
508
+ const shape = "curve" in f ? curveText(f) : `${f.y} = ${sig(f.a)} + ${sig(f.b)} × ${f.x}`;
402
509
  return /* @__PURE__ */ jsxs(Fragment, { children: [
403
510
  /* @__PURE__ */ jsxs("b", { children: [a.name, ":"] }),
404
511
  " ",
405
- f.y,
406
- " = ",
407
- sig(f.a),
408
- " + ",
409
- sig(f.b),
410
- " × ",
411
- f.x,
512
+ shape,
412
513
  ", r² ",
413
514
  f.r2.toFixed(3),
414
515
  " over ",
@@ -1,10 +1,19 @@
1
- import { g as whenRange, h as when, m as useSize, p as scenarioColor } from "./Loadmap-UvoLoTLT.js";
1
+ import { g as whenRange, h as when, m as useSize, p as scenarioColor } from "./Loadmap-C7Wf68Ur.js";
2
2
  import { compare, headroom } from "@loadmap/core";
3
3
  import { fmt, multiple, multiples, pct } from "@loadmap/core/format";
4
4
  import { useId, useLayoutEffect, useMemo, useRef, useState } from "react";
5
5
  import { Fragment, jsx, jsxs } from "react/jsx-runtime";
6
6
  // src/scenarios.tsx
7
7
  const lineName = (l) => l.label ?? "These values";
8
+ /** A line's colour: an N−1 line has the colour of the line it is the outage of, and is dashed. */
9
+ const lineColor = (model, l) => scenarioColor(model, l.outage ? l.outage.of : l.label);
10
+ /** An N−1 line may carry a scenario's label: its key says it is the outage. */
11
+ const lineKey = (l) => l.outage ? `${lineName(l)}#${l.outage.domain}` : lineName(l);
12
+ /** The legend's swatch, dashed for an N−1 line as its line is. */
13
+ const keyStyle = (model, l) => {
14
+ const c = lineColor(model, l);
15
+ return { background: l.outage ? `repeating-linear-gradient(90deg, ${c} 0 4px, transparent 4px 7px)` : c };
16
+ };
8
17
  /** The comparison at the shown load: crossings do not depend on it, the verdicts do. */
9
18
  function useComparison(lm) {
10
19
  return useMemo(() => compare(lm.model, lm.values.load), [lm.model, lm.values.load]);
@@ -282,8 +291,8 @@ function HeadroomChart({ lm, title = "Headroom" }) {
282
291
  className: "lm-legend",
283
292
  children: [h.lines.map((l) => /* @__PURE__ */ jsxs("span", { children: [/* @__PURE__ */ jsx("b", {
284
293
  className: "lm-key",
285
- style: { background: scenarioColor(model, l.label) }
286
- }), lineName(l)] }, lineName(l))), selected && /* @__PURE__ */ jsxs("span", { children: ["thin lines: each component of ", lineName(selected)] })]
294
+ style: keyStyle(model, l)
295
+ }), lineName(l)] }, lineKey(l))), selected && /* @__PURE__ */ jsxs("span", { children: ["thin lines: each component of ", lineName(selected)] })]
287
296
  }),
288
297
  /* @__PURE__ */ jsxs("div", {
289
298
  className: "lm-chart",
@@ -364,9 +373,9 @@ function HeadroomChart({ lm, title = "Headroom" }) {
364
373
  [...h.lines].sort((a, b) => Number(a.selected) - Number(b.selected)).map((l) => l.band ? /* @__PURE__ */ jsx("path", {
365
374
  "data-band": lineName(l),
366
375
  d: area(l.band),
367
- fill: scenarioColor(model, l.label),
376
+ fill: lineColor(model, l),
368
377
  fillOpacity: l.selected ? .2 : .08
369
- }, lineName(l)) : null),
378
+ }, lineKey(l)) : null),
370
379
  selected?.components.map((c) => /* @__PURE__ */ jsx("path", {
371
380
  d: path(c.points),
372
381
  fill: "none",
@@ -378,11 +387,12 @@ function HeadroomChart({ lm, title = "Headroom" }) {
378
387
  "data-line": lineName(l),
379
388
  d: path(l.envelope),
380
389
  fill: "none",
381
- stroke: scenarioColor(model, l.label),
390
+ stroke: lineColor(model, l),
391
+ strokeDasharray: l.outage ? "6 4" : void 0,
382
392
  strokeWidth: "2",
383
393
  strokeLinejoin: "round",
384
394
  strokeLinecap: "round"
385
- }, lineName(l)))
395
+ }, lineKey(l)))
386
396
  ]
387
397
  }),
388
398
  /* @__PURE__ */ jsx("line", {
@@ -416,7 +426,7 @@ function HeadroomChart({ lm, title = "Headroom" }) {
416
426
  "data-scenario": lineName(l),
417
427
  "data-low": r.low,
418
428
  "data-high": r.high,
419
- stroke: scenarioColor(model, l.label),
429
+ stroke: lineColor(model, l),
420
430
  strokeWidth: l.selected ? 3 : 2,
421
431
  strokeOpacity: l.selected ? 1 : .6,
422
432
  children: [
@@ -439,7 +449,7 @@ function HeadroomChart({ lm, title = "Headroom" }) {
439
449
  y2: y + 5
440
450
  })
441
451
  ]
442
- }, `${lineName(l)}/${kind}/range`);
452
+ }, `${lineKey(l)}/${kind}/range`);
443
453
  })),
444
454
  h.lines.flatMap((l) => [[
445
455
  "target",
@@ -458,10 +468,10 @@ function HeadroomChart({ lm, title = "Headroom" }) {
458
468
  cx: lx(x),
459
469
  cy: ly(u),
460
470
  r: "4",
461
- fill: scenarioColor(model, l.label),
471
+ fill: lineColor(model, l),
462
472
  stroke: "var(--lm-surface)",
463
473
  strokeWidth: "2"
464
- }), l.selected && mark(r && l0(r) ? multiples(r, model.searchMax, true) : multiple(x, model.searchMax), lx(r && l0(r) ? Math.max(h.from, r.low) : x), ly(u) - 8)] }, `${lineName(l)}/${kind}`) : null)),
474
+ }), l.selected && mark(r && l0(r) ? multiples(r, model.searchMax, true) : multiple(x, model.searchMax), lx(r && l0(r) ? Math.max(h.from, r.low) : x), ly(u) - 8)] }, `${lineKey(l)}/${kind}`) : null)),
465
475
  hx != null && /* @__PURE__ */ jsx("line", {
466
476
  x1: lx(hx),
467
477
  x2: lx(hx),
@@ -498,12 +508,12 @@ function HeadroomChart({ lm, title = "Headroom" }) {
498
508
  h.lines.map((l) => /* @__PURE__ */ jsxs("span", { children: [
499
509
  /* @__PURE__ */ jsx("b", {
500
510
  className: "lm-key",
501
- style: { background: scenarioColor(model, l.label) }
511
+ style: keyStyle(model, l)
502
512
  }),
503
513
  /* @__PURE__ */ jsx("strong", { children: l.envelope[hover][1] == null ? "off" : pct(l.envelope[hover][1]) }),
504
514
  " ",
505
515
  lineName(l)
506
- ] }, lineName(l))),
516
+ ] }, lineKey(l))),
507
517
  selected?.components.map((c) => /* @__PURE__ */ jsxs("span", {
508
518
  className: "lm-sub",
509
519
  children: [
package/dist/source.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { a as LoadmapProps } from "./Loadmap-D6Yrp2jI.js";
1
+ import { a as LoadmapProps } from "./Loadmap-DDQh2RSi.js";
2
2
  import { CompileOptions } from "@loadmap/dsl";
3
3
  export interface LoadmapSourceProps extends Omit<LoadmapProps<any>, 'model' | 'view'> {
4
4
  /** The `.loadmap` text. Compiled again when its tokens change: spaces, line breaks and comments change nothing. */
package/dist/source.js CHANGED
@@ -1,4 +1,4 @@
1
- import { S as injectStyles, n as Loadmap, o as usePageTheme } from "./Loadmap-UvoLoTLT.js";
1
+ import { S as injectStyles, n as Loadmap, o as usePageTheme } from "./Loadmap-C7Wf68Ur.js";
2
2
  import { useCallback, useEffect, useMemo, useRef, useState } from "react";
3
3
  import { Fragment, jsx, jsxs } from "react/jsx-runtime";
4
4
  import { compile, formatDiagnostic, loadCatalogFor, loadedCatalog, needsCatalog, sharedValues } from "@loadmap/dsl";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@loadmap/react",
3
- "version": "0.44.0",
3
+ "version": "0.46.0",
4
4
  "description": "Interactive capacity models for React: an architecture diagram with moving dots, the limits ranked, the verdict, scenarios and headroom.",
5
5
  "keywords": [
6
6
  "loadmap",
@@ -39,10 +39,10 @@
39
39
  "dist"
40
40
  ],
41
41
  "dependencies": {
42
- "@loadmap/core": "0.44.0",
43
- "@loadmap/dsl": "0.44.0",
44
- "@loadmap/sim": "0.44.0",
45
- "@loadmap/layout": "0.44.0",
42
+ "@loadmap/core": "0.46.0",
43
+ "@loadmap/dsl": "0.46.0",
44
+ "@loadmap/sim": "0.46.0",
45
+ "@loadmap/layout": "0.46.0",
46
46
  "elkjs": "^0.12.1"
47
47
  },
48
48
  "peerDependencies": {