@umriss-ui/calculation 0.2.4 → 0.3.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.
- package/CHANGELOG.md +18 -0
- package/README.md +6 -0
- package/dist/calculation.css +1 -1
- package/dist/calculation.js +133 -133
- package/docs/llms-full.md +1083 -0
- package/package.json +4 -3
package/CHANGELOG.md
CHANGED
|
@@ -11,6 +11,24 @@ under a heading "Changed" of its own, no matter which digit rose.
|
|
|
11
11
|
|
|
12
12
|
---
|
|
13
13
|
|
|
14
|
+
## 0.3.0 – Forced colours and agent-readable docs (Sep. 2026)
|
|
15
|
+
|
|
16
|
+
Needs `@umriss-ui/core` 0.10; the peer range moves to `^0.10.0`.
|
|
17
|
+
|
|
18
|
+
### Added
|
|
19
|
+
|
|
20
|
+
- **The Windows contrast mode** (`forced-colors: active`, forced-colors 03).
|
|
21
|
+
The hover coupling keeps its band as an outline in the system's selection
|
|
22
|
+
colour, the open derivation its spine, the frame and the disclosure's ring an
|
|
23
|
+
outline where the box-shadow stood; the verdicts keep their words. Nothing
|
|
24
|
+
changes outside forced colours.
|
|
25
|
+
- **`docs/llms-full.md`**, the package's documentation as one Markdown file for
|
|
26
|
+
a coding agent, in the npm package and pinned to its version: every demo page
|
|
27
|
+
with its import line, its examples' source, its props tables and why it is
|
|
28
|
+
built as it is, and the declaration of every other export. The same text
|
|
29
|
+
stands online as <https://romanhaendler.github.io/umriss-ui/calculation/llms-full.txt>,
|
|
30
|
+
with an index of the pages beside it (`llms.txt`).
|
|
31
|
+
|
|
14
32
|
## 0.2.4 – Core 0.9.0 (Sep. 2026)
|
|
15
33
|
|
|
16
34
|
Admits `@umriss-ui/core` 0.9, which only adds a token; the peer range moves to `^0.9.0`. Nothing else changes.
|
package/README.md
CHANGED
|
@@ -111,3 +111,9 @@ in a tree - there it folds, and opens whole.
|
|
|
111
111
|
The demo is the documentation: `pnpm dev:calculation` in the repository, port
|
|
112
112
|
4177. The vocabulary — calculation, quantity, result, given, operator, operand,
|
|
113
113
|
derivation, reference — stands in `CONTEXT.md` under "Calculations".
|
|
114
|
+
|
|
115
|
+
For a coding agent the demo stands as one Markdown file inside the installed
|
|
116
|
+
package, `docs/llms-full.md`, pinned to that version: every page with its
|
|
117
|
+
examples' source, its props tables and why it is built as it is, and the
|
|
118
|
+
declaration of every other export. Online, for the latest version:
|
|
119
|
+
<https://romanhaendler.github.io/umriss-ui/calculation/llms.txt>.
|
package/dist/calculation.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
@layer umriss.tokens,umriss.base,umriss.components;@layer umriss.base{._text_1hv7a_23{font-family:var(--u-font-sans);font-size:var(--u-text-md);line-height:var(--u-leading-normal);color:var(--u-color-text);-webkit-font-smoothing:antialiased;text-rendering:optimizeLegibility}._field_1hv7a_34{caret-color:var(--u-color-accent)}._scroll_1hv7a_40{scrollbar-width:thin;scrollbar-color:color-mix(in srgb,var(--u-color-text) 25%,transparent) transparent}._scroll_1hv7a_40::-webkit-scrollbar{width:10px;height:10px}._scroll_1hv7a_40::-webkit-scrollbar-thumb{background:color-mix(in srgb,var(--u-color-text) 22%,transparent);border-radius:var(--u-radius-full);border:3px solid transparent;background-clip:content-box}._scroll_1hv7a_40::-webkit-scrollbar-track{background:transparent}}@layer umriss.components{._ring_1hv7a_65:focus-visible{outline:none;box-shadow:var(--u-focus-ring)}@media(pointer:coarse){._field_1hv7a_34._field_1hv7a_34{font-size:16px}}._field_1hv7a_34:-webkit-autofill,._field_1hv7a_34:-webkit-autofill:hover,._field_1hv7a_34:-webkit-autofill:focus{-webkit-box-shadow:inset 0 0 0 1000px var(--u-color-surface),0 0 0 1px var(--u-edge-color-strong);-webkit-text-fill-color:var(--u-color-text);caret-color:var(--u-color-accent)}}@layer umriss.tokens,umriss.base,umriss.components;@layer umriss.components{._frame_1vwog_21,._frame_1vwog_21:before,._frame_1vwog_21:after{box-sizing:border-box}._calculation_1vwog_39,._calculation_1vwog_39:before,._calculation_1vwog_39:after{box-sizing:border-box}._disclosure_1vwog_53,._disclosure_1vwog_53:before,._disclosure_1vwog_53:after{box-sizing:border-box}._list_1vwog_57,._list_1vwog_57:before,._list_1vwog_57:after{box-sizing:border-box}._item_1vwog_58,._item_1vwog_58:before,._item_1vwog_58:after{box-sizing:border-box}._derivation_1vwog_59,._derivation_1vwog_59:before,._derivation_1vwog_59:after{box-sizing:border-box}._line_1vwog_109,._line_1vwog_109:before,._line_1vwog_109:after{box-sizing:border-box}._labelCell_1vwog_151,._labelCell_1vwog_151:before,._labelCell_1vwog_151:after{box-sizing:border-box}._names_1vwog_152,._names_1vwog_152:before,._names_1vwog_152:after{box-sizing:border-box}._operator_1vwog_153,._operator_1vwog_153:before,._operator_1vwog_153:after{box-sizing:border-box}._amount_1vwog_154,._amount_1vwog_154:before,._amount_1vwog_154:after{box-sizing:border-box}._unit_1vwog_155,._unit_1vwog_155:before,._unit_1vwog_155:after{box-sizing:border-box}._assessment_1vwog_156,._assessment_1vwog_156:before,._assessment_1vwog_156:after{box-sizing:border-box}._label_1vwog_151,._label_1vwog_151:before,._label_1vwog_151:after{box-sizing:border-box}._approximate_1vwog_274,._approximate_1vwog_274:before,._approximate_1vwog_274:after{box-sizing:border-box}._target_1vwog_302,._target_1vwog_302:before,._target_1vwog_302:after{box-sizing:border-box}._worst_1vwog_303,._worst_1vwog_303:before,._worst_1vwog_303:after{box-sizing:border-box}._notes_1vwog_395,._notes_1vwog_395:before,._notes_1vwog_395:after{box-sizing:border-box}._freshness_1vwog_409,._freshness_1vwog_409:before,._freshness_1vwog_409:after{box-sizing:border-box}._frame_1vwog_21{font-size:var(--u-text-sm);border-radius:var(--u-radius-md);corner-shape:squircle;background:var(--u-color-surface);box-shadow:var(--u-edge);overflow:hidden;--disclosure-size: 20px;--disclosure-gap: var(--u-space-2);container-type:inline-size;width:100%}._calculation_1vwog_39{display:grid;grid-template-columns:fit-content(22rem) minmax(0,1fr) auto auto auto auto;margin:0;padding:0;list-style:none}._frame_1vwog_21[data-still]{--disclosure-size: 0px;--disclosure-gap: 0px}._frame_1vwog_21[data-still] ._disclosure_1vwog_53{display:none}._list_1vwog_57,._item_1vwog_58,._derivation_1vwog_59{display:grid;grid-template-columns:subgrid;grid-column:1 / -1;margin:0;padding:0;list-style:none}._derivation_1vwog_59[hidden]{display:none}._derivation_1vwog_59:not([hidden]){animation:_derivationIn_1vwog_1 var(--u-duration-fast) var(--u-ease-out)}@keyframes _derivationIn_1vwog_1{0%{opacity:0}}._item_1vwog_58{--fall: calc(var(--u-space-3) + var(--depth, 0) * var(--u-space-5) + var(--disclosure-size) / 2 - 1px)}._derivation_1vwog_59{position:relative}._derivation_1vwog_59:before{content:"";position:absolute;top:0;bottom:0;left:var(--fall);z-index:1;width:2px;background:var(--u-color-accent);pointer-events:none}:not(._derivation_1vwog_59)>._item_1vwog_58[data-open]>._line_1vwog_109:not([data-mark]),:not(._derivation_1vwog_59)>._item_1vwog_58>._derivation_1vwog_59{background-color:var(--u-color-surface-sunken)}._derivation_1vwog_59 ._line_1vwog_109{border-top-color:transparent}._line_1vwog_109{position:relative;display:grid;grid-template-columns:subgrid;grid-column:1 / -1;align-items:baseline;border-top:1px solid var(--u-hairline)}._calculation_1vwog_39>._item_1vwog_58:first-child>._line_1vwog_109:first-child,._calculation_1vwog_39>._item_1vwog_58:first-child>._list_1vwog_57>._item_1vwog_58:first-child>._line_1vwog_109{border-top-color:transparent}._line_1vwog_109[data-foldable]{cursor:pointer}._line_1vwog_109[data-mark]{background:color-mix(in srgb,var(--u-color-accent-subtle) 50%,transparent)}._line_1vwog_109[data-mark=use]{background:var(--u-color-accent-subtle)}._labelCell_1vwog_151,._names_1vwog_152,._operator_1vwog_153,._amount_1vwog_154,._unit_1vwog_155,._assessment_1vwog_156{grid-row:1;padding-top:var(--u-space-2);padding-bottom:var(--u-space-2)}._labelCell_1vwog_151{grid-column:1;display:flex;align-items:baseline;gap:var(--disclosure-gap);min-width:0;padding-left:calc(var(--u-space-3) + var(--depth, 0) * var(--u-space-5));padding-right:var(--u-space-5)}._label_1vwog_151{min-width:0;color:var(--u-color-text)}._line_1vwog_109[data-reference] ._label_1vwog_151{font-style:italic;color:var(--u-color-text-secondary)}._disclosure_1vwog_53{flex:none;align-self:center;display:inline-flex;align-items:center;justify-content:center;width:var(--disclosure-size);height:var(--disclosure-size);padding:0;border:none;border-radius:var(--u-radius-xs);corner-shape:squircle;background:none;color:var(--u-color-text-muted)}button._disclosure_1vwog_53{box-sizing:border-box}button._disclosure_1vwog_53{cursor:pointer}button._disclosure_1vwog_53:hover,._line_1vwog_109[data-foldable]:hover button._disclosure_1vwog_53{box-sizing:border-box}button._disclosure_1vwog_53:hover,._line_1vwog_109[data-foldable]:hover button._disclosure_1vwog_53{background:var(--u-color-surface-sunken);color:var(--u-color-text)}button._disclosure_1vwog_53:active,._line_1vwog_109[data-foldable]:active button._disclosure_1vwog_53{box-sizing:border-box}button._disclosure_1vwog_53:active,._line_1vwog_109[data-foldable]:active button._disclosure_1vwog_53{background:var(--u-color-surface-pressed)}._item_1vwog_58[data-open]>._line_1vwog_109 button._disclosure_1vwog_53{box-sizing:border-box}._item_1vwog_58[data-open]>._line_1vwog_109 button._disclosure_1vwog_53{color:var(--u-color-accent)}button._disclosure_1vwog_53:focus-visible{box-sizing:border-box}button._disclosure_1vwog_53:focus-visible{outline:none;box-shadow:var(--u-focus-ring)}._disclosure_1vwog_53 svg{box-sizing:border-box}._disclosure_1vwog_53 svg{transition:transform var(--u-transition-path)}._disclosure_1vwog_53 svg[data-open]{box-sizing:border-box}._disclosure_1vwog_53 svg[data-open]{transform:rotate(90deg)}._names_1vwog_152{grid-column:2;min-width:0;overflow:hidden;padding-right:var(--u-space-4);white-space:nowrap;text-overflow:ellipsis;color:var(--u-color-text-secondary)}._operator_1vwog_153,._amount_1vwog_154,._unit_1vwog_155{font-family:var(--u-font-mono);font-variant-numeric:tabular-nums;font-feature-settings:"tnum" 1;white-space:nowrap}._operator_1vwog_153{grid-column:3;padding-right:var(--u-space-3);text-align:right;color:var(--u-color-text-secondary)}._amount_1vwog_154{grid-column:4;text-align:right;color:var(--u-color-text)}._amount_1vwog_154[data-verdict=unknown]{color:var(--u-color-text-secondary)}._approximate_1vwog_274{display:inline-block;margin-right:var(--u-space-1);color:var(--u-color-text-secondary);cursor:help}._unit_1vwog_155{grid-column:5;padding-left:var(--u-space-1);padding-right:var(--u-space-3);color:var(--u-color-text-secondary)}._assessment_1vwog_156{grid-column:6;display:flex;align-items:baseline;justify-content:flex-end;gap:var(--u-space-2);padding-right:var(--u-space-3);white-space:nowrap}._assessment_1vwog_156:empty{padding-right:0}._target_1vwog_302,._worst_1vwog_303{font-size:var(--u-text-xs);color:var(--u-color-text-secondary)}._worst_1vwog_303:before{content:"● "}._worst_1vwog_303[data-verdict=unknown]:before{color:var(--u-color-text-muted)}._worst_1vwog_303[data-verdict=warning]:before{color:var(--u-color-warning)}._worst_1vwog_303[data-verdict=alarm]:before{color:var(--u-color-danger-text)}._line_1vwog_109[data-inner]>._amount_1vwog_154{color:var(--u-color-text-secondary)}._line_1vwog_109[data-kind=interim] ._label_1vwog_151,._line_1vwog_109[data-kind=interim]>._amount_1vwog_154{font-weight:var(--u-weight-medium)}._line_1vwog_109[data-kind=interim]:before{content:"";grid-row:1;grid-column:3 / 6;align-self:start;border-top:1px solid var(--u-color-text-secondary);pointer-events:none}._line_1vwog_109[data-closing] ._label_1vwog_151{font-weight:var(--u-weight-medium);color:var(--u-color-text-secondary)}._line_1vwog_109[data-closing]:before{content:"";grid-row:1;grid-column:3 / 6;align-self:start;border-top:1px solid var(--u-color-text-muted);pointer-events:none}._line_1vwog_109[data-kind=result]{border-top:1px solid var(--u-edge-color-strong)}._line_1vwog_109[data-kind=result]:not([data-mark]){background:var(--u-color-surface-sunken)}._line_1vwog_109[data-kind=result] ._label_1vwog_151{font-weight:var(--u-weight-semibold)}._line_1vwog_109[data-kind=result]>._amount_1vwog_154{font-size:var(--u-text-md);font-weight:var(--u-weight-semibold)}._line_1vwog_109[data-kind=result]>._amount_1vwog_154:not([data-verdict=unknown]){text-decoration-line:underline;text-decoration-style:double;text-underline-offset:5px}._notes_1vwog_395{grid-row:2;grid-column:1 / 3;display:flex;flex-wrap:wrap;align-items:center;column-gap:var(--u-space-3);margin-top:calc(-1 * var(--u-space-1));padding:0 var(--u-space-4) var(--u-space-2) calc(var(--u-space-3) + var(--depth, 0) * var(--u-space-5) + var(--disclosure-size) + var(--disclosure-gap));font-size:var(--u-text-xs);color:var(--u-color-text-secondary)}._freshness_1vwog_409[data-freshness=stale]{color:var(--u-color-warning)}._freshness_1vwog_409[data-freshness=lost]{color:var(--u-color-danger-text);font-weight:var(--u-weight-medium)}@container (max-width: 34rem){._calculation_1vwog_39{grid-template-columns:minmax(0,1fr) 0 auto auto auto 0}._names_1vwog_152{display:none}._labelCell_1vwog_151{padding-right:var(--u-space-3)}._assessment_1vwog_156:not(:empty){grid-area:2 / 1 / 3 / -1;justify-content:flex-start;flex-wrap:wrap;padding:0 var(--u-space-3) var(--u-space-2) calc(var(--u-space-3) + var(--depth, 0) * var(--u-space-5) + var(--disclosure-size) + var(--disclosure-gap));white-space:normal}._notes_1vwog_395{grid-row:3;grid-column:1 / -1}}@media(prefers-reduced-motion:reduce){._disclosure_1vwog_53 svg{transition:none}._derivation_1vwog_59:not([hidden]){animation:none}}}
|
|
1
|
+
@layer umriss.tokens,umriss.base,umriss.components;@layer umriss.base{._text_k1tvc_23{font-family:var(--u-font-sans);font-size:var(--u-text-md);line-height:var(--u-leading-normal);color:var(--u-color-text);-webkit-font-smoothing:antialiased;text-rendering:optimizeLegibility}._field_k1tvc_34{caret-color:var(--u-color-accent)}._scroll_k1tvc_40{scrollbar-width:thin;scrollbar-color:color-mix(in srgb,var(--u-color-text) 25%,transparent) transparent}._scroll_k1tvc_40::-webkit-scrollbar{width:10px;height:10px}._scroll_k1tvc_40::-webkit-scrollbar-thumb{background:color-mix(in srgb,var(--u-color-text) 22%,transparent);border-radius:var(--u-radius-full);border:3px solid transparent;background-clip:content-box}._scroll_k1tvc_40::-webkit-scrollbar-track{background:transparent}}@layer umriss.components{._ring_k1tvc_69:focus-visible{outline:2px solid transparent;box-shadow:var(--u-focus-ring)}@media(pointer:coarse){._field_k1tvc_34._field_k1tvc_34{font-size:16px}}._field_k1tvc_34:-webkit-autofill,._field_k1tvc_34:-webkit-autofill:hover,._field_k1tvc_34:-webkit-autofill:focus{-webkit-box-shadow:inset 0 0 0 1000px var(--u-color-surface),0 0 0 1px var(--u-edge-color-strong);-webkit-text-fill-color:var(--u-color-text);caret-color:var(--u-color-accent)}}@layer umriss.tokens,umriss.base,umriss.components;@layer umriss.components{._frame_1ydwt_21,._frame_1ydwt_21:before,._frame_1ydwt_21:after{box-sizing:border-box}._calculation_1ydwt_40,._calculation_1ydwt_40:before,._calculation_1ydwt_40:after{box-sizing:border-box}._disclosure_1ydwt_54,._disclosure_1ydwt_54:before,._disclosure_1ydwt_54:after{box-sizing:border-box}._list_1ydwt_58,._list_1ydwt_58:before,._list_1ydwt_58:after{box-sizing:border-box}._item_1ydwt_59,._item_1ydwt_59:before,._item_1ydwt_59:after{box-sizing:border-box}._derivation_1ydwt_60,._derivation_1ydwt_60:before,._derivation_1ydwt_60:after{box-sizing:border-box}._line_1ydwt_110,._line_1ydwt_110:before,._line_1ydwt_110:after{box-sizing:border-box}._labelCell_1ydwt_152,._labelCell_1ydwt_152:before,._labelCell_1ydwt_152:after{box-sizing:border-box}._names_1ydwt_153,._names_1ydwt_153:before,._names_1ydwt_153:after{box-sizing:border-box}._operator_1ydwt_154,._operator_1ydwt_154:before,._operator_1ydwt_154:after{box-sizing:border-box}._amount_1ydwt_155,._amount_1ydwt_155:before,._amount_1ydwt_155:after{box-sizing:border-box}._unit_1ydwt_156,._unit_1ydwt_156:before,._unit_1ydwt_156:after{box-sizing:border-box}._assessment_1ydwt_157,._assessment_1ydwt_157:before,._assessment_1ydwt_157:after{box-sizing:border-box}._label_1ydwt_152,._label_1ydwt_152:before,._label_1ydwt_152:after{box-sizing:border-box}._approximate_1ydwt_275,._approximate_1ydwt_275:before,._approximate_1ydwt_275:after{box-sizing:border-box}._target_1ydwt_303,._target_1ydwt_303:before,._target_1ydwt_303:after{box-sizing:border-box}._worst_1ydwt_304,._worst_1ydwt_304:before,._worst_1ydwt_304:after{box-sizing:border-box}._notes_1ydwt_396,._notes_1ydwt_396:before,._notes_1ydwt_396:after{box-sizing:border-box}._freshness_1ydwt_410,._freshness_1ydwt_410:before,._freshness_1ydwt_410:after{box-sizing:border-box}._frame_1ydwt_21{font-size:var(--u-text-sm);border-radius:var(--u-radius-md);corner-shape:squircle;background:var(--u-color-surface);outline:1px solid transparent;box-shadow:var(--u-edge);overflow:hidden;--disclosure-size: 20px;--disclosure-gap: var(--u-space-2);container-type:inline-size;width:100%}._calculation_1ydwt_40{display:grid;grid-template-columns:fit-content(22rem) minmax(0,1fr) auto auto auto auto;margin:0;padding:0;list-style:none}._frame_1ydwt_21[data-still]{--disclosure-size: 0px;--disclosure-gap: 0px}._frame_1ydwt_21[data-still] ._disclosure_1ydwt_54{display:none}._list_1ydwt_58,._item_1ydwt_59,._derivation_1ydwt_60{display:grid;grid-template-columns:subgrid;grid-column:1 / -1;margin:0;padding:0;list-style:none}._derivation_1ydwt_60[hidden]{display:none}._derivation_1ydwt_60:not([hidden]){animation:_derivationIn_1ydwt_1 var(--u-duration-fast) var(--u-ease-out)}@keyframes _derivationIn_1ydwt_1{0%{opacity:0}}._item_1ydwt_59{--fall: calc(var(--u-space-3) + var(--depth, 0) * var(--u-space-5) + var(--disclosure-size) / 2 - 1px)}._derivation_1ydwt_60{position:relative}._derivation_1ydwt_60:before{content:"";position:absolute;top:0;bottom:0;left:var(--fall);z-index:1;width:2px;background:var(--u-color-accent);pointer-events:none}:not(._derivation_1ydwt_60)>._item_1ydwt_59[data-open]>._line_1ydwt_110:not([data-mark]),:not(._derivation_1ydwt_60)>._item_1ydwt_59>._derivation_1ydwt_60{background-color:var(--u-color-surface-sunken)}._derivation_1ydwt_60 ._line_1ydwt_110{border-top-color:transparent}._line_1ydwt_110{position:relative;display:grid;grid-template-columns:subgrid;grid-column:1 / -1;align-items:baseline;border-top:1px solid var(--u-hairline)}._calculation_1ydwt_40>._item_1ydwt_59:first-child>._line_1ydwt_110:first-child,._calculation_1ydwt_40>._item_1ydwt_59:first-child>._list_1ydwt_58>._item_1ydwt_59:first-child>._line_1ydwt_110{border-top-color:transparent}._line_1ydwt_110[data-foldable]{cursor:pointer}._line_1ydwt_110[data-mark]{background:color-mix(in srgb,var(--u-color-accent-subtle) 50%,transparent)}._line_1ydwt_110[data-mark=use]{background:var(--u-color-accent-subtle)}._labelCell_1ydwt_152,._names_1ydwt_153,._operator_1ydwt_154,._amount_1ydwt_155,._unit_1ydwt_156,._assessment_1ydwt_157{grid-row:1;padding-top:var(--u-space-2);padding-bottom:var(--u-space-2)}._labelCell_1ydwt_152{grid-column:1;display:flex;align-items:baseline;gap:var(--disclosure-gap);min-width:0;padding-left:calc(var(--u-space-3) + var(--depth, 0) * var(--u-space-5));padding-right:var(--u-space-5)}._label_1ydwt_152{min-width:0;color:var(--u-color-text)}._line_1ydwt_110[data-reference] ._label_1ydwt_152{font-style:italic;color:var(--u-color-text-secondary)}._disclosure_1ydwt_54{flex:none;align-self:center;display:inline-flex;align-items:center;justify-content:center;width:var(--disclosure-size);height:var(--disclosure-size);padding:0;border:none;border-radius:var(--u-radius-xs);corner-shape:squircle;background:none;color:var(--u-color-text-muted)}button._disclosure_1ydwt_54{box-sizing:border-box}button._disclosure_1ydwt_54{cursor:pointer}button._disclosure_1ydwt_54:hover,._line_1ydwt_110[data-foldable]:hover button._disclosure_1ydwt_54{box-sizing:border-box}button._disclosure_1ydwt_54:hover,._line_1ydwt_110[data-foldable]:hover button._disclosure_1ydwt_54{background:var(--u-color-surface-sunken);color:var(--u-color-text)}button._disclosure_1ydwt_54:active,._line_1ydwt_110[data-foldable]:active button._disclosure_1ydwt_54{box-sizing:border-box}button._disclosure_1ydwt_54:active,._line_1ydwt_110[data-foldable]:active button._disclosure_1ydwt_54{background:var(--u-color-surface-pressed)}._item_1ydwt_59[data-open]>._line_1ydwt_110 button._disclosure_1ydwt_54{box-sizing:border-box}._item_1ydwt_59[data-open]>._line_1ydwt_110 button._disclosure_1ydwt_54{color:var(--u-color-accent)}button._disclosure_1ydwt_54:focus-visible{box-sizing:border-box}button._disclosure_1ydwt_54:focus-visible{outline:2px solid transparent;box-shadow:var(--u-focus-ring)}._disclosure_1ydwt_54 svg{box-sizing:border-box}._disclosure_1ydwt_54 svg{transition:transform var(--u-transition-path)}._disclosure_1ydwt_54 svg[data-open]{box-sizing:border-box}._disclosure_1ydwt_54 svg[data-open]{transform:rotate(90deg)}._names_1ydwt_153{grid-column:2;min-width:0;overflow:hidden;padding-right:var(--u-space-4);white-space:nowrap;text-overflow:ellipsis;color:var(--u-color-text-secondary)}._operator_1ydwt_154,._amount_1ydwt_155,._unit_1ydwt_156{font-family:var(--u-font-mono);font-variant-numeric:tabular-nums;font-feature-settings:"tnum" 1;white-space:nowrap}._operator_1ydwt_154{grid-column:3;padding-right:var(--u-space-3);text-align:right;color:var(--u-color-text-secondary)}._amount_1ydwt_155{grid-column:4;text-align:right;color:var(--u-color-text)}._amount_1ydwt_155[data-verdict=unknown]{color:var(--u-color-text-secondary)}._approximate_1ydwt_275{display:inline-block;margin-right:var(--u-space-1);color:var(--u-color-text-secondary);cursor:help}._unit_1ydwt_156{grid-column:5;padding-left:var(--u-space-1);padding-right:var(--u-space-3);color:var(--u-color-text-secondary)}._assessment_1ydwt_157{grid-column:6;display:flex;align-items:baseline;justify-content:flex-end;gap:var(--u-space-2);padding-right:var(--u-space-3);white-space:nowrap}._assessment_1ydwt_157:empty{padding-right:0}._target_1ydwt_303,._worst_1ydwt_304{font-size:var(--u-text-xs);color:var(--u-color-text-secondary)}._worst_1ydwt_304:before{content:"● "}._worst_1ydwt_304[data-verdict=unknown]:before{color:var(--u-color-text-muted)}._worst_1ydwt_304[data-verdict=warning]:before{color:var(--u-color-warning)}._worst_1ydwt_304[data-verdict=alarm]:before{color:var(--u-color-danger-text)}._line_1ydwt_110[data-inner]>._amount_1ydwt_155{color:var(--u-color-text-secondary)}._line_1ydwt_110[data-kind=interim] ._label_1ydwt_152,._line_1ydwt_110[data-kind=interim]>._amount_1ydwt_155{font-weight:var(--u-weight-medium)}._line_1ydwt_110[data-kind=interim]:before{content:"";grid-row:1;grid-column:3 / 6;align-self:start;border-top:1px solid var(--u-color-text-secondary);pointer-events:none}._line_1ydwt_110[data-closing] ._label_1ydwt_152{font-weight:var(--u-weight-medium);color:var(--u-color-text-secondary)}._line_1ydwt_110[data-closing]:before{content:"";grid-row:1;grid-column:3 / 6;align-self:start;border-top:1px solid var(--u-color-text-muted);pointer-events:none}._line_1ydwt_110[data-kind=result]{border-top:1px solid var(--u-edge-color-strong)}._line_1ydwt_110[data-kind=result]:not([data-mark]){background:var(--u-color-surface-sunken)}._line_1ydwt_110[data-kind=result] ._label_1ydwt_152{font-weight:var(--u-weight-semibold)}._line_1ydwt_110[data-kind=result]>._amount_1ydwt_155{font-size:var(--u-text-md);font-weight:var(--u-weight-semibold)}._line_1ydwt_110[data-kind=result]>._amount_1ydwt_155:not([data-verdict=unknown]){text-decoration-line:underline;text-decoration-style:double;text-underline-offset:5px}._notes_1ydwt_396{grid-row:2;grid-column:1 / 3;display:flex;flex-wrap:wrap;align-items:center;column-gap:var(--u-space-3);margin-top:calc(-1 * var(--u-space-1));padding:0 var(--u-space-4) var(--u-space-2) calc(var(--u-space-3) + var(--depth, 0) * var(--u-space-5) + var(--disclosure-size) + var(--disclosure-gap));font-size:var(--u-text-xs);color:var(--u-color-text-secondary)}._freshness_1ydwt_410[data-freshness=stale]{color:var(--u-color-warning)}._freshness_1ydwt_410[data-freshness=lost]{color:var(--u-color-danger-text);font-weight:var(--u-weight-medium)}@container (max-width: 34rem){._calculation_1ydwt_40{grid-template-columns:minmax(0,1fr) 0 auto auto auto 0}._names_1ydwt_153{display:none}._labelCell_1ydwt_152{padding-right:var(--u-space-3)}._assessment_1ydwt_157:not(:empty){grid-area:2 / 1 / 3 / -1;justify-content:flex-start;flex-wrap:wrap;padding:0 var(--u-space-3) var(--u-space-2) calc(var(--u-space-3) + var(--depth, 0) * var(--u-space-5) + var(--disclosure-size) + var(--disclosure-gap));white-space:normal}._notes_1ydwt_396{grid-row:3;grid-column:1 / -1}}@media(prefers-reduced-motion:reduce){._disclosure_1ydwt_54 svg{transition:none}._derivation_1ydwt_60:not([hidden]){animation:none}}@media(forced-colors:active){._line_1ydwt_110[data-mark]{outline:1px solid Highlight;outline-offset:-1px}._line_1ydwt_110[data-mark=use]{outline-width:2px;outline-offset:-2px}._derivation_1ydwt_60:before{background:CanvasText}}}
|
package/dist/calculation.js
CHANGED
|
@@ -1,22 +1,22 @@
|
|
|
1
1
|
import "./calculation.css";
|
|
2
2
|
import { jsx as f, jsxs as k } from "react/jsx-runtime";
|
|
3
|
-
import { Children as ve, isValidElement as j, Fragment as ge, useId as we, useState as
|
|
4
|
-
import { assess as
|
|
5
|
-
function
|
|
3
|
+
import { Children as ve, isValidElement as j, Fragment as ge, useId as we, useState as oe } from "react";
|
|
4
|
+
import { assess as ye, verdictWeight as K, useFormats as me, useWording as fe, VisuallyHidden as _e, AngleGlyph as be, Tooltip as re, Badge as ie, useFreshness as $e } from "@umriss-ui/core";
|
|
5
|
+
function Ne(t) {
|
|
6
6
|
return t.decimals !== void 0 ? t.decimals : t.format === "percent" ? 1 : t.given ? void 0 : 2;
|
|
7
7
|
}
|
|
8
8
|
function xe(t, n) {
|
|
9
9
|
return n === void 0 ? t : Math.sign(t) * Number(Math.abs(t).toFixed(n));
|
|
10
10
|
}
|
|
11
11
|
function G(t, n) {
|
|
12
|
-
return xe(t.format === "percent" ? n * 100 : n,
|
|
12
|
+
return xe(t.format === "percent" ? n * 100 : n, Ne(t));
|
|
13
13
|
}
|
|
14
14
|
const Oe = (t, n) => t.format === "percent" ? n / 100 : n;
|
|
15
|
-
function
|
|
15
|
+
function ce(t, n, v) {
|
|
16
16
|
const [m, ...i] = n;
|
|
17
17
|
switch (t) {
|
|
18
18
|
case "sum":
|
|
19
|
-
return i.reduce((e, h,
|
|
19
|
+
return i.reduce((e, h, o) => v[o + 1] ? e - h : e + h, m);
|
|
20
20
|
case "difference":
|
|
21
21
|
return i.reduce((e, h) => e - h, m);
|
|
22
22
|
case "product":
|
|
@@ -25,46 +25,46 @@ function le(t, n, v) {
|
|
|
25
25
|
return m / i[0];
|
|
26
26
|
}
|
|
27
27
|
}
|
|
28
|
-
const
|
|
28
|
+
const le = (t, n) => n === void 0 || t !== void 0 && K(t) >= K(n) ? t : n;
|
|
29
29
|
function Se(t) {
|
|
30
30
|
const n = /* @__PURE__ */ new Map(), v = (m) => {
|
|
31
|
-
var
|
|
31
|
+
var _, x, T;
|
|
32
32
|
const i = n.get(m);
|
|
33
33
|
if (i) return i;
|
|
34
34
|
const e = t.quantities.get(m);
|
|
35
|
-
let h = null,
|
|
35
|
+
let h = null, o, N = !1, C;
|
|
36
36
|
if (e.given) {
|
|
37
|
-
const
|
|
38
|
-
typeof
|
|
37
|
+
const b = e.given.value;
|
|
38
|
+
typeof b == "number" && Number.isFinite(b) ? h = b : o = { kind: "missing", label: e.label };
|
|
39
39
|
} else {
|
|
40
|
-
const
|
|
41
|
-
for (const { operand: a, verdict:
|
|
42
|
-
const w = a.reference ?
|
|
43
|
-
C =
|
|
40
|
+
const b = e.operands.map((a) => ({ operand: a, ...v(a.key) }));
|
|
41
|
+
for (const { operand: a, verdict: l, worst: r } of b) {
|
|
42
|
+
const w = a.reference ? l : le(l, r);
|
|
43
|
+
C = le(C, w);
|
|
44
44
|
}
|
|
45
|
-
|
|
46
|
-
const O =
|
|
47
|
-
if (!
|
|
45
|
+
o = (_ = b.find((a) => a.absence)) == null ? void 0 : _.absence;
|
|
46
|
+
const O = b[1];
|
|
47
|
+
if (!o && e.operator === "quotient" && O.value === 0 && (o = { kind: "zero", label: t.quantities.get(O.operand.key).label }), !o) {
|
|
48
48
|
const a = e.operands.map((r) => r.negated === !0);
|
|
49
|
-
h =
|
|
50
|
-
const
|
|
49
|
+
h = ce(e.operator, b.map((r) => r.value), a);
|
|
50
|
+
const l = ce(
|
|
51
51
|
e.operator,
|
|
52
|
-
|
|
52
|
+
b.map((r) => Oe(t.quantities.get(r.operand.key), r.shown)),
|
|
53
53
|
a
|
|
54
54
|
);
|
|
55
|
-
|
|
55
|
+
N = G(e, l) !== G(e, h);
|
|
56
56
|
}
|
|
57
57
|
}
|
|
58
|
-
const d = { target: e.target, limits: e.limits }, g = e.target !== void 0 || (((x = e.limits) == null ? void 0 : x.length) ?? 0) > 0 ?
|
|
58
|
+
const d = { target: e.target, limits: e.limits }, g = e.target !== void 0 || (((x = e.limits) == null ? void 0 : x.length) ?? 0) > 0 ? ye(h, d) : void 0, y = (((T = e.limits) == null ? void 0 : T.length) ?? 0) > 0 ? g.verdict : h === null ? "unknown" : void 0, c = {
|
|
59
59
|
value: h,
|
|
60
|
-
absence:
|
|
60
|
+
absence: o,
|
|
61
61
|
shown: h === null ? null : G(e, h),
|
|
62
|
-
approximate:
|
|
62
|
+
approximate: N,
|
|
63
63
|
assessment: g,
|
|
64
|
-
verdict:
|
|
64
|
+
verdict: y,
|
|
65
65
|
worst: C
|
|
66
66
|
};
|
|
67
|
-
return n.set(m,
|
|
67
|
+
return n.set(m, c), c;
|
|
68
68
|
};
|
|
69
69
|
for (const m of t.quantities.keys()) v(m);
|
|
70
70
|
return n;
|
|
@@ -102,69 +102,69 @@ const ee = (t, n, v) => `${t}/${j(n) && n.key || v}`;
|
|
|
102
102
|
function je(t) {
|
|
103
103
|
const n = Q(t);
|
|
104
104
|
n.length !== 1 && q(`<Calculation> takes exactly one child, the result; it was given ${n.length}.`);
|
|
105
|
-
const v = /* @__PURE__ */ new Map(), m = /* @__PURE__ */ new Map(), i = [], e = (d, g,
|
|
106
|
-
const { id:
|
|
107
|
-
|
|
108
|
-
const x = { ...
|
|
105
|
+
const v = /* @__PURE__ */ new Map(), m = /* @__PURE__ */ new Map(), i = [], e = (d, g, y) => {
|
|
106
|
+
const { id: c, ..._ } = g;
|
|
107
|
+
c !== void 0 && (m.has(c) && q(`${y}: the id "${c}" is used twice.`), m.set(c, d));
|
|
108
|
+
const x = { ..._, key: d, id: c, operands: [] };
|
|
109
109
|
return v.set(d, x), x;
|
|
110
|
-
}, h = (d, g,
|
|
110
|
+
}, h = (d, g, y) => {
|
|
111
111
|
if (j(d) && d.type === ue) {
|
|
112
|
-
const
|
|
113
|
-
return i.push({ operand:
|
|
112
|
+
const c = { key: "", reference: !0 };
|
|
113
|
+
return i.push({ operand: c, to: d.props.to, where: y }), c;
|
|
114
114
|
}
|
|
115
|
-
return { key:
|
|
116
|
-
},
|
|
117
|
-
if ((!j(d) || d.type === ue || Z.has(d.type) || d.type === Y) && q(`${
|
|
118
|
-
const
|
|
119
|
-
d.type !== qe &&
|
|
120
|
-
`${
|
|
115
|
+
return { key: o(d, g, y), reference: !1 };
|
|
116
|
+
}, o = (d, g, y) => {
|
|
117
|
+
if ((!j(d) || d.type === ue || Z.has(d.type) || d.type === Y) && q(`${y}: ${V(d)} cannot stand here; a quantity must be ${X}.`), d.type === Ie) return N(d.props.children, g, y);
|
|
118
|
+
const c = Be.get(d.type);
|
|
119
|
+
d.type !== qe && c === void 0 && q(
|
|
120
|
+
`${y}: ${V(d)} is not an element of the calculation. A calculation reads its children's props and cannot look inside a component of your own; write ${X} or <Ref> directly, or return them from .map.`
|
|
121
121
|
);
|
|
122
|
-
const { children:
|
|
123
|
-
if (
|
|
124
|
-
return r.given = { value: x, source: T, asOf:
|
|
125
|
-
r.operator =
|
|
126
|
-
const w = Q(
|
|
127
|
-
return (
|
|
128
|
-
`${
|
|
129
|
-
), r.operands = w.map((u,
|
|
130
|
-
},
|
|
131
|
-
const
|
|
132
|
-
(
|
|
133
|
-
let T = h(
|
|
134
|
-
return x.forEach((
|
|
135
|
-
const w = ee(g,
|
|
136
|
-
if (j(
|
|
137
|
-
const M =
|
|
138
|
-
O.length === 0 && q(`${D}: an <Interim> needs an operand since the named value before it, ${
|
|
122
|
+
const { children: _, value: x, source: T, asOf: b, ages: O, ...a } = d.props, l = `${y} › ${a.label}`, r = e(g, a, l);
|
|
123
|
+
if (c === void 0)
|
|
124
|
+
return r.given = { value: x, source: T, asOf: b, ages: O }, g;
|
|
125
|
+
r.operator = c;
|
|
126
|
+
const w = Q(_), s = w.length;
|
|
127
|
+
return (c === "quotient" ? s !== 2 : s < 2) && q(
|
|
128
|
+
`${l}: <${We[c]}> takes ${c === "quotient" ? "exactly two operands" : "two or more operands"}; it was given ${s}.`
|
|
129
|
+
), r.operands = w.map((u, $) => h(u, ee(g, u, $), l)), g;
|
|
130
|
+
}, N = (d, g, y) => {
|
|
131
|
+
const c = `${y} › <Chain>`, [_, ...x] = Q(d);
|
|
132
|
+
(_ === void 0 || j(_) && (Z.has(_.type) || _.type === Y)) && q(`${c}: a chain starts with a quantity that has no operator - ${X} or <Ref>.`);
|
|
133
|
+
let T = h(_, ee(g, _, 0), c), b = V(_), O = [], a;
|
|
134
|
+
return x.forEach((l, r) => {
|
|
135
|
+
const w = ee(g, l, r + 1);
|
|
136
|
+
if (j(l) && l.type === Y) {
|
|
137
|
+
const M = l.props, D = `${c} › ${M.label}`;
|
|
138
|
+
O.length === 0 && q(`${D}: an <Interim> needs an operand since the named value before it, ${b}.`);
|
|
139
139
|
const S = e(w, M, D);
|
|
140
|
-
S.interim = !0, S.operator = O[0].line.operator, S.operands = [T, ...O.map((J) => J.operand)], T = { key: w, reference: !1, previous: !0 },
|
|
140
|
+
S.interim = !0, S.operator = O[0].line.operator, S.operands = [T, ...O.map((J) => J.operand)], T = { key: w, reference: !1, previous: !0 }, b = `<Interim label="${M.label}">`, O = [], a = w;
|
|
141
141
|
return;
|
|
142
142
|
}
|
|
143
|
-
const
|
|
144
|
-
|
|
145
|
-
const u =
|
|
146
|
-
(u && O.length > 0 ||
|
|
147
|
-
`${
|
|
143
|
+
const s = j(l) ? Z.get(l.type) : void 0;
|
|
144
|
+
s === void 0 && q(`${c}: ${V(l)} needs an operator in a chain - <Plus>, <Minus>, <Times> or <DividedBy> - or is an <Interim>.`);
|
|
145
|
+
const u = s.operator !== "sum", $ = O.find((M) => M.line.operator !== "sum");
|
|
146
|
+
(u && O.length > 0 || $) && q(
|
|
147
|
+
`${c}: <${($ ?? { line: s }).line.name}> stands alone between two named values - directly after the first quantity or an <Interim>, and directly before an <Interim>.`
|
|
148
148
|
);
|
|
149
|
-
const { children: B, ...A } =
|
|
149
|
+
const { children: B, ...A } = l.props, W = Q(B), I = () => q(`${c}: <${s.name}> takes either a label and a value, or exactly one quantity as its child.`);
|
|
150
150
|
if (W.length > 0) {
|
|
151
151
|
(W.length > 1 || Object.values(A).some((D) => D !== void 0)) && I();
|
|
152
|
-
const M = h(W[0], w,
|
|
153
|
-
M.negated =
|
|
152
|
+
const M = h(W[0], w, c);
|
|
153
|
+
M.negated = s.negated, O.push({ operand: M, line: s });
|
|
154
154
|
return;
|
|
155
155
|
}
|
|
156
156
|
A.label === void 0 && I();
|
|
157
|
-
const { value: E, source: U, asOf: F, ages: R, ...L } = A, z = e(w, { ...L, label: A.label }, `${
|
|
158
|
-
z.given = { value: E, source: U, asOf: F, ages: R }, O.push({ operand: { key: w, reference: !1, negated:
|
|
159
|
-
}), (O.length > 0 || a === void 0) && q(`${
|
|
160
|
-
}, C =
|
|
161
|
-
for (const { operand: d, to: g, where:
|
|
162
|
-
const
|
|
163
|
-
if (
|
|
164
|
-
const
|
|
165
|
-
q(`${
|
|
157
|
+
const { value: E, source: U, asOf: F, ages: R, ...L } = A, z = e(w, { ...L, label: A.label }, `${c} › ${A.label}`);
|
|
158
|
+
z.given = { value: E, source: U, asOf: F, ages: R }, O.push({ operand: { key: w, reference: !1, negated: s.negated }, line: s });
|
|
159
|
+
}), (O.length > 0 || a === void 0) && q(`${c}: a chain ends with an <Interim>, which names its value.`), a;
|
|
160
|
+
}, C = o(n[0], "0", "<Calculation>");
|
|
161
|
+
for (const { operand: d, to: g, where: y } of i) {
|
|
162
|
+
const c = m.get(g);
|
|
163
|
+
if (c === void 0) {
|
|
164
|
+
const _ = [...m.keys()].map((x) => `"${x}"`).join(", ");
|
|
165
|
+
q(`${y}: <Ref to="${g}"> names no quantity. ${_ ? `The ids that exist: ${_}.` : "No quantity has an id."}`);
|
|
166
166
|
}
|
|
167
|
-
d.key =
|
|
167
|
+
d.key = c;
|
|
168
168
|
}
|
|
169
169
|
return Re(v), { result: C, quantities: v };
|
|
170
170
|
}
|
|
@@ -173,7 +173,7 @@ function Re(t) {
|
|
|
173
173
|
if (n.has(i)) return;
|
|
174
174
|
const e = v.indexOf(i);
|
|
175
175
|
if (e !== -1) {
|
|
176
|
-
const h = [...v.slice(e), i].map((
|
|
176
|
+
const h = [...v.slice(e), i].map((o) => t.get(o).label);
|
|
177
177
|
q(`the calculation goes round in a circle through references: ${h.join(" → ")}.`);
|
|
178
178
|
}
|
|
179
179
|
v.push(i);
|
|
@@ -217,33 +217,33 @@ function pe(t, n, v, m) {
|
|
|
217
217
|
return i ? `${e} ${i}` : e;
|
|
218
218
|
}
|
|
219
219
|
function Le(t, n, v, m, i, e, h) {
|
|
220
|
-
const
|
|
221
|
-
if (m || !
|
|
222
|
-
if (!w &&
|
|
223
|
-
return { names: e.calculationOperandCount(
|
|
224
|
-
const
|
|
225
|
-
const A = t.quantities.get(
|
|
226
|
-
return B === 0 ? u(A) : `${te({ operator:
|
|
220
|
+
const o = t.quantities.get(v), N = n.get(v), C = (w, s, u) => s.shown === null ? u ? e.verdictUnknown : e.statAbsentValue : pe(w, s.shown, i, u ? e.calculationPercent : "%"), d = (w) => {
|
|
221
|
+
if (m || !o.operator) return {};
|
|
222
|
+
if (!w && o.operands.length > de)
|
|
223
|
+
return { names: e.calculationOperandCount(o.operands.length) };
|
|
224
|
+
const s = (u) => o.operands.map(($, B) => {
|
|
225
|
+
const A = t.quantities.get($.key);
|
|
226
|
+
return B === 0 ? u(A) : `${te({ operator: o.operator, negated: $.negated === !0 }, w, e)} ${u(A)}`;
|
|
227
227
|
}).join(" ");
|
|
228
228
|
return {
|
|
229
|
-
names:
|
|
230
|
-
numbers:
|
|
229
|
+
names: s((u) => u.label),
|
|
230
|
+
numbers: s((u) => C(u, n.get(u.key), w))
|
|
231
231
|
};
|
|
232
232
|
}, g = (w) => {
|
|
233
|
-
var
|
|
234
|
-
const
|
|
235
|
-
if (
|
|
236
|
-
const u = pe(
|
|
237
|
-
return
|
|
238
|
-
},
|
|
239
|
-
(h ? `${te(h, !0, e)} ` : "") +
|
|
240
|
-
|
|
233
|
+
var $;
|
|
234
|
+
const s = ($ = N.assessment) == null ? void 0 : $.deviation;
|
|
235
|
+
if (s === void 0 || o.target === void 0) return;
|
|
236
|
+
const u = pe(o, G(o, o.target), i, w ? e.calculationPercent : "%");
|
|
237
|
+
return s > 0 ? e.calculationAboveTarget(u) : s < 0 ? e.calculationBelowTarget(u) : e.calculationOnTarget(u);
|
|
238
|
+
}, y = d(!1).names, c = y === void 0 || o.operands.length > de ? y : `= ${y}`, _ = d(!0), x = N.absence ? Ue(N.absence, e) : void 0, T = ` ${e.calculationEquals} `, b = N.approximate ? `${e.calculationApproximately} ${C(o, N, !0)}` : C(o, N, !0), a = [
|
|
239
|
+
(h ? `${te(h, !0, e)} ` : "") + o.label + T + [_.names, _.numbers, b].filter(Boolean).join(`,${T}`),
|
|
240
|
+
N.verdict !== void 0 && N.verdict !== "unknown" ? H(N.verdict, e) : void 0,
|
|
241
241
|
g(!0),
|
|
242
242
|
x
|
|
243
|
-
].filter(Boolean).join(", "),
|
|
244
|
-
return { amount:
|
|
243
|
+
].filter(Boolean).join(", "), l = N.shown === null ? void 0 : o.format === "percent" ? "%" : o.unit;
|
|
244
|
+
return { amount: N.shown === null ? e.statAbsentValue : i.number(N.shown, o.decimals), unit: l, names: c, target: g(!1), reason: x, sentence: a };
|
|
245
245
|
}
|
|
246
|
-
const Ve = "
|
|
246
|
+
const Ve = "_frame_1ydwt_21 _text_k1tvc_23", Ge = "_calculation_1ydwt_40", He = "_disclosure_1ydwt_54", Ke = "_list_1ydwt_58", ze = "_item_1ydwt_59", Je = "_derivation_1ydwt_60", Ye = "_line_1ydwt_110", Ze = "_labelCell_1ydwt_152", Xe = "_names_1ydwt_153", et = "_operator_1ydwt_154", tt = "_amount_1ydwt_155", nt = "_unit_1ydwt_156", at = "_assessment_1ydwt_157", st = "_label_1ydwt_152", ot = "_approximate_1ydwt_275", rt = "_target_1ydwt_303", it = "_worst_1ydwt_304", ct = "_notes_1ydwt_396", lt = "_freshness_1ydwt_410", p = {
|
|
247
247
|
frame: Ve,
|
|
248
248
|
calculation: Ge,
|
|
249
249
|
disclosure: He,
|
|
@@ -257,37 +257,37 @@ const Ve = "_frame_1vwog_21 _text_1hv7a_23", Ge = "_calculation_1vwog_39", He =
|
|
|
257
257
|
amount: tt,
|
|
258
258
|
unit: nt,
|
|
259
259
|
assessment: at,
|
|
260
|
-
label:
|
|
261
|
-
approximate:
|
|
260
|
+
label: st,
|
|
261
|
+
approximate: ot,
|
|
262
262
|
target: rt,
|
|
263
263
|
worst: it,
|
|
264
|
-
notes:
|
|
265
|
-
freshness:
|
|
264
|
+
notes: ct,
|
|
265
|
+
freshness: lt
|
|
266
266
|
}, ut = { ok: "success", unknown: "neutral", warning: "warning", alarm: "danger" }, dt = (...t) => t.filter(Boolean).join(" ");
|
|
267
267
|
function pt({ asOf: t, ages: n }) {
|
|
268
|
-
const v = me(), m = fe(), i =
|
|
268
|
+
const v = me(), m = fe(), i = $e(t, n), e = i.freshness === "lost" ? m.freshnessDisconnected : i.freshness === "stale" ? m.freshnessStale : m.freshnessFresh;
|
|
269
269
|
return /* @__PURE__ */ k("span", { className: p.freshness, "data-freshness": i.freshness, children: [
|
|
270
270
|
e,
|
|
271
271
|
i.age !== null && ` · ${v.relative(i.age)}`
|
|
272
272
|
] });
|
|
273
273
|
}
|
|
274
274
|
function vt({ children: t, className: n, style: v, ...m }) {
|
|
275
|
-
const i = me(), e = fe(), h = we(),
|
|
276
|
-
const r = new Set(
|
|
275
|
+
const i = me(), e = fe(), h = we(), o = je(t), N = Se(o), [C, d] = oe(() => /* @__PURE__ */ new Set()), [g, y] = oe(null), c = (a) => d((l) => {
|
|
276
|
+
const r = new Set(l);
|
|
277
277
|
return r.delete(a) || r.add(a), r;
|
|
278
|
-
}),
|
|
278
|
+
}), _ = (a, l, r) => r === 0 || l.previous ? void 0 : { operator: a.operator, negated: l.negated === !0 };
|
|
279
279
|
let x = !1;
|
|
280
|
-
const T = (a,
|
|
281
|
-
const
|
|
280
|
+
const T = (a, l) => g === null ? void 0 : a === g ? "use" : l === g ? "operand" : void 0, b = (a, l, r, w) => {
|
|
281
|
+
const s = o.quantities.get(a), u = N.get(a), $ = Le(o, N, a, l, i, e, r.position), B = s.operator !== void 0 && !l, A = a === o.result && !l, W = B && (s.interim ? r.flat : A), I = B && !W, E = I && C.has(a);
|
|
282
282
|
x || (x = I);
|
|
283
|
-
const U = `${h}-${a}`, F = { depth: W ? r.depth : r.depth + 1, flat: !1, parent: a }, R = B ?
|
|
284
|
-
(P,
|
|
285
|
-
) : [], D = I && !E && u.worst !== void 0 && K(u.worst) > K(u.verdict ?? "ok") ? u.worst : void 0, S =
|
|
286
|
-
!
|
|
283
|
+
const U = `${h}-${a}`, F = { depth: W ? r.depth : r.depth + 1, flat: !1, parent: a }, R = B ? s.operands.find((P) => P.previous) : void 0, L = R && r.flat ? b(R.key, !1, { ...r, parent: a, position: void 0 }, `${w}-c`) : [], z = R && !r.flat ? b(R.key, !1, { ...F, flat: !0 }, `${w}-c`) : [], M = B ? s.operands.map(
|
|
284
|
+
(P, se) => P.previous ? null : b(P.key, P.reference, { ...F, position: _(s, P, se) }, `${w}-${se}`)
|
|
285
|
+
) : [], D = I && !E && u.worst !== void 0 && K(u.worst) > K(u.verdict ?? "ok") ? u.worst : void 0, S = l ? void 0 : s.given, J = r.position ? te(r.position, !1, e) : void 0, ne = [
|
|
286
|
+
!l && s.explanation !== void 0 && /* @__PURE__ */ f("span", { children: s.explanation }, "explanation"),
|
|
287
287
|
(S == null ? void 0 : S.source) !== void 0 && /* @__PURE__ */ f("span", { children: e.calculationSource(S.source) }, "source"),
|
|
288
288
|
(S == null ? void 0 : S.asOf) !== void 0 && (S.ages !== void 0 ? /* @__PURE__ */ f(pt, { asOf: S.asOf, ages: S.ages }, "asOf") : /* @__PURE__ */ f("span", { children: e.asOfAgo(i.dateTime(new Date(S.asOf), !1)) }, "asOf")),
|
|
289
|
-
!
|
|
290
|
-
].filter(Boolean), he = A ? "result" :
|
|
289
|
+
!l && s.aside !== void 0 && /* @__PURE__ */ f("span", { children: s.aside }, "aside")
|
|
290
|
+
].filter(Boolean), he = A ? "result" : s.interim && !l && r.flat ? "interim" : void 0, ae = /* @__PURE__ */ k(
|
|
291
291
|
"div",
|
|
292
292
|
{
|
|
293
293
|
className: p.line,
|
|
@@ -295,19 +295,19 @@ function vt({ children: t, className: n, style: v, ...m }) {
|
|
|
295
295
|
"data-inner": r.depth > 0 ? "" : void 0,
|
|
296
296
|
"data-kind": he,
|
|
297
297
|
"data-foldable": I ? "" : void 0,
|
|
298
|
-
"data-reference":
|
|
298
|
+
"data-reference": l ? "" : void 0,
|
|
299
299
|
"data-mark": T(a, r.parent),
|
|
300
|
-
onPointerEnter: () =>
|
|
301
|
-
onPointerLeave: () =>
|
|
302
|
-
onFocus: () =>
|
|
303
|
-
onBlur: () =>
|
|
300
|
+
onPointerEnter: () => y(a),
|
|
301
|
+
onPointerLeave: () => y(null),
|
|
302
|
+
onFocus: () => y(a),
|
|
303
|
+
onBlur: () => y(null),
|
|
304
304
|
onClick: I ? () => {
|
|
305
305
|
var P;
|
|
306
|
-
(P = window.getSelection()) != null && P.toString() ||
|
|
306
|
+
(P = window.getSelection()) != null && P.toString() || c(a);
|
|
307
307
|
} : void 0,
|
|
308
308
|
children: [
|
|
309
|
-
/* @__PURE__ */ f(
|
|
310
|
-
|
|
309
|
+
/* @__PURE__ */ f(_e, { children: [
|
|
310
|
+
$.sentence,
|
|
311
311
|
u.approximate && e.calculationApproximateNote,
|
|
312
312
|
D !== void 0 && e.calculationWorstInside(H(D, e))
|
|
313
313
|
].filter(Boolean).join(". ") }),
|
|
@@ -319,22 +319,22 @@ function vt({ children: t, className: n, style: v, ...m }) {
|
|
|
319
319
|
className: p.disclosure,
|
|
320
320
|
"aria-expanded": E,
|
|
321
321
|
"aria-controls": U,
|
|
322
|
-
"aria-label": (E ? e.calculationHideDerivation : e.calculationShowDerivation)(
|
|
323
|
-
children: /* @__PURE__ */ f(
|
|
322
|
+
"aria-label": (E ? e.calculationHideDerivation : e.calculationShowDerivation)(s.label),
|
|
323
|
+
children: /* @__PURE__ */ f(be, { "data-open": E ? "" : void 0 })
|
|
324
324
|
}
|
|
325
325
|
) : /* @__PURE__ */ f("span", { className: p.disclosure, "aria-hidden": "true" }),
|
|
326
|
-
/* @__PURE__ */ f("span", { className: p.label, "aria-hidden": "true", children:
|
|
326
|
+
/* @__PURE__ */ f("span", { className: p.label, "aria-hidden": "true", children: s.label })
|
|
327
327
|
] }),
|
|
328
|
-
/* @__PURE__ */ f("span", { className: p.names, "aria-hidden": "true", children: I && !E ?
|
|
328
|
+
/* @__PURE__ */ f("span", { className: p.names, "aria-hidden": "true", children: I && !E ? $.names : void 0 }),
|
|
329
329
|
/* @__PURE__ */ f("span", { className: p.operator, "aria-hidden": "true", children: J }),
|
|
330
330
|
/* @__PURE__ */ k("span", { className: p.amount, "aria-hidden": "true", "data-verdict": u.verdict, children: [
|
|
331
331
|
u.approximate && /* @__PURE__ */ f(re, { content: e.calculationApproximateNote, children: /* @__PURE__ */ f("span", { className: p.approximate, children: "≈" }) }),
|
|
332
|
-
|
|
332
|
+
$.amount
|
|
333
333
|
] }),
|
|
334
|
-
/* @__PURE__ */ f("span", { className: p.unit, "aria-hidden": "true", children:
|
|
334
|
+
/* @__PURE__ */ f("span", { className: p.unit, "aria-hidden": "true", children: $.unit }),
|
|
335
335
|
/* @__PURE__ */ k("span", { className: p.assessment, "aria-hidden": "true", children: [
|
|
336
|
-
|
|
337
|
-
|
|
336
|
+
$.reason !== void 0 ? /* @__PURE__ */ f(ie, { children: $.reason }) : u.verdict !== void 0 && /* @__PURE__ */ f(ie, { tone: ut[u.verdict], children: H(u.verdict, e) }),
|
|
337
|
+
$.target !== void 0 && /* @__PURE__ */ f("span", { className: p.target, children: $.target }),
|
|
338
338
|
D !== void 0 && /* @__PURE__ */ f("span", { className: p.worst, "data-verdict": D, children: e.calculationWorstInside(H(D, e)) })
|
|
339
339
|
] }),
|
|
340
340
|
ne.length > 0 && /* A click here - on a link in the aside, on a sparkline - is the
|
|
@@ -369,23 +369,23 @@ function vt({ children: t, className: n, style: v, ...m }) {
|
|
|
369
369
|
/* @__PURE__ */ f("span", { className: p.disclosure }),
|
|
370
370
|
/* @__PURE__ */ k("span", { className: p.label, children: [
|
|
371
371
|
"= ",
|
|
372
|
-
|
|
372
|
+
s.label
|
|
373
373
|
] })
|
|
374
374
|
] }),
|
|
375
375
|
/* @__PURE__ */ f("span", { className: p.names }),
|
|
376
376
|
/* @__PURE__ */ f("span", { className: p.operator }),
|
|
377
377
|
/* @__PURE__ */ k("span", { className: p.amount, "data-verdict": u.verdict, children: [
|
|
378
378
|
u.approximate && /* @__PURE__ */ f(re, { content: e.calculationApproximateNote, children: /* @__PURE__ */ f("span", { className: p.approximate, children: "≈" }) }),
|
|
379
|
-
|
|
379
|
+
$.amount
|
|
380
380
|
] }),
|
|
381
|
-
/* @__PURE__ */ f("span", { className: p.unit, children:
|
|
381
|
+
/* @__PURE__ */ f("span", { className: p.unit, children: $.unit })
|
|
382
382
|
]
|
|
383
383
|
}
|
|
384
384
|
) })
|
|
385
385
|
] })
|
|
386
386
|
] }, w)
|
|
387
387
|
];
|
|
388
|
-
}, O =
|
|
388
|
+
}, O = b(o.result, !1, { depth: 0, flat: !0, parent: null }, "r");
|
|
389
389
|
return (
|
|
390
390
|
/* The frame is the surface and the container the layout measures itself
|
|
391
391
|
against; the list inside it is the statement. */
|