@macrostrat/column-views 3.11.0 → 3.12.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 +169 -0
- package/dist/age-model/data.cjs +57 -0
- package/dist/age-model/data.cjs.map +1 -0
- package/dist/age-model/data.d.ts +29 -0
- package/dist/age-model/data.js +57 -0
- package/dist/age-model/data.js.map +1 -0
- package/dist/age-model/details.cjs +261 -0
- package/dist/age-model/details.cjs.map +1 -0
- package/dist/age-model/details.d.ts +39 -0
- package/dist/age-model/details.js +258 -0
- package/dist/age-model/details.js.map +1 -0
- package/dist/age-model/details.module.sass.cjs +42 -0
- package/dist/age-model/details.module.sass.cjs.map +1 -0
- package/dist/age-model/details.module.sass.js +40 -0
- package/dist/age-model/details.module.sass.js.map +1 -0
- package/dist/age-model/index.d.ts +5 -0
- package/dist/age-model/legacy.cjs +28 -0
- package/dist/age-model/legacy.cjs.map +1 -0
- package/dist/age-model/legacy.d.ts +6 -0
- package/dist/age-model/legacy.js +26 -0
- package/dist/age-model/legacy.js.map +1 -0
- package/dist/age-model/surfaces.cjs +355 -0
- package/dist/age-model/surfaces.cjs.map +1 -0
- package/dist/age-model/surfaces.d.ts +68 -0
- package/dist/age-model/surfaces.js +352 -0
- package/dist/age-model/surfaces.js.map +1 -0
- package/dist/age-model/surfaces.module.sass.cjs +45 -0
- package/dist/age-model/surfaces.module.sass.cjs.map +1 -0
- package/dist/age-model/surfaces.module.sass.js +43 -0
- package/dist/age-model/surfaces.module.sass.js.map +1 -0
- package/dist/age-model/types.cjs +229 -0
- package/dist/age-model/types.cjs.map +1 -0
- package/dist/age-model/types.d.ts +112 -0
- package/dist/age-model/types.js +229 -0
- package/dist/age-model/types.js.map +1 -0
- package/dist/column-views.css +389 -57
- package/dist/column.cjs +20 -13
- package/dist/column.cjs.map +1 -1
- package/dist/column.d.ts +21 -6
- package/dist/column.js +21 -14
- package/dist/column.js.map +1 -1
- package/dist/column.module.sass.cjs +19 -15
- package/dist/column.module.sass.cjs.map +1 -1
- package/dist/column.module.sass.js +19 -15
- package/dist/column.module.sass.js.map +1 -1
- package/dist/data-provider/store.cjs +34 -1
- package/dist/data-provider/store.cjs.map +1 -1
- package/dist/data-provider/store.d.ts +5 -0
- package/dist/data-provider/store.js +35 -2
- package/dist/data-provider/store.js.map +1 -1
- package/dist/index.cjs +54 -3
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +3 -1
- package/dist/index.js +54 -3
- package/dist/index.js.map +1 -1
- package/dist/notes.cjs +11 -2
- package/dist/notes.cjs.map +1 -1
- package/dist/notes.d.ts +11 -1
- package/dist/notes.js +11 -2
- package/dist/notes.js.map +1 -1
- package/dist/prepare-units/composite-scale.cjs +18 -16
- package/dist/prepare-units/composite-scale.cjs.map +1 -1
- package/dist/prepare-units/composite-scale.js +18 -16
- package/dist/prepare-units/composite-scale.js.map +1 -1
- package/dist/prepare-units/density.cjs +83 -0
- package/dist/prepare-units/density.cjs.map +1 -0
- package/dist/prepare-units/density.d.ts +92 -0
- package/dist/prepare-units/density.js +83 -0
- package/dist/prepare-units/density.js.map +1 -0
- package/dist/prepare-units/index.cjs +15 -7
- package/dist/prepare-units/index.cjs.map +1 -1
- package/dist/prepare-units/index.d.ts +1 -0
- package/dist/prepare-units/index.js +15 -7
- package/dist/prepare-units/index.js.map +1 -1
- package/dist/prepare-units/types.cjs.map +1 -1
- package/dist/prepare-units/types.d.ts +34 -13
- package/dist/prepare-units/types.js.map +1 -1
- package/dist/section.cjs +108 -24
- package/dist/section.cjs.map +1 -1
- package/dist/section.d.ts +66 -6
- package/dist/section.js +109 -25
- package/dist/section.js.map +1 -1
- package/dist/timescale-zoom.cjs +191 -0
- package/dist/timescale-zoom.cjs.map +1 -0
- package/dist/timescale-zoom.d.ts +74 -0
- package/dist/timescale-zoom.js +191 -0
- package/dist/timescale-zoom.js.map +1 -0
- package/dist/unit-details/age-range.cjs +1 -0
- package/dist/unit-details/age-range.cjs.map +1 -1
- package/dist/unit-details/age-range.d.ts +5 -1
- package/dist/unit-details/age-range.js +1 -0
- package/dist/unit-details/age-range.js.map +1 -1
- package/dist/units/composite.cjs +4 -1
- package/dist/units/composite.cjs.map +1 -1
- package/dist/units/composite.d.ts +2 -0
- package/dist/units/composite.js +4 -1
- package/dist/units/composite.js.map +1 -1
- package/package.json +7 -7
- package/src/age-model/data.ts +98 -0
- package/src/age-model/details.module.sass +108 -0
- package/src/age-model/details.ts +333 -0
- package/src/age-model/index.ts +5 -0
- package/src/age-model/legacy.ts +30 -0
- package/src/age-model/surfaces.module.sass +168 -0
- package/src/age-model/surfaces.ts +568 -0
- package/src/age-model/types.ts +392 -0
- package/src/column.module.sass +59 -8
- package/src/column.ts +49 -23
- package/src/data-provider/store.ts +50 -1
- package/src/index.ts +5 -1
- package/src/notes.ts +20 -2
- package/src/prepare-units/composite-scale.ts +34 -31
- package/src/prepare-units/density.ts +197 -0
- package/src/prepare-units/index.ts +25 -6
- package/src/prepare-units/types.ts +34 -13
- package/src/section.ts +219 -33
- package/src/timescale-zoom.ts +341 -0
- package/src/unit-details/age-range.ts +3 -3
- package/src/units/composite.ts +11 -0
- package/dist/age-model-overlay.cjs +0 -50
- package/dist/age-model-overlay.cjs.map +0 -1
- package/dist/age-model-overlay.d.ts +0 -24
- package/dist/age-model-overlay.js +0 -48
- package/dist/age-model-overlay.js.map +0 -1
- package/dist/age-model-overlay.module.sass.cjs +0 -12
- package/dist/age-model-overlay.module.sass.cjs.map +0 -1
- package/dist/age-model-overlay.module.sass.js +0 -11
- package/dist/age-model-overlay.module.sass.js.map +0 -1
- package/src/age-model-overlay.module.sass +0 -11
- package/src/age-model-overlay.ts +0 -96
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
import { BoundaryType, ColumnSurface, SurfaceStatus } from './types';
|
|
3
|
+
export interface SurfaceDetailsPanelProps {
|
|
4
|
+
/** The surface to inspect; `null` renders the panel's empty state */
|
|
5
|
+
surface: ColumnSurface | null;
|
|
6
|
+
onClose?: () => void;
|
|
7
|
+
/** Called when a unit above or below the surface is clicked */
|
|
8
|
+
onSelectUnit?: (unitID: number) => void;
|
|
9
|
+
/** Extra controls for the header */
|
|
10
|
+
actions?: ReactNode;
|
|
11
|
+
/** Label for the measured-position field ("Height" or "Depth") */
|
|
12
|
+
positionLabel?: string;
|
|
13
|
+
className?: string;
|
|
14
|
+
}
|
|
15
|
+
/** Details of one surface: its age, calibration, the units it separates, and
|
|
16
|
+
* provenance. A companion to `UnitDetailsPanel`. */
|
|
17
|
+
export declare function SurfaceDetailsPanel(props: SurfaceDetailsPanelProps): import('react').ReactElement<{
|
|
18
|
+
className: string | undefined;
|
|
19
|
+
}, string | import('react').JSXElementConstructor<any>>;
|
|
20
|
+
export declare function SurfaceStatusTag({ status, inferred, className, }: {
|
|
21
|
+
status: SurfaceStatus;
|
|
22
|
+
/** The status was inferred rather than recorded (see
|
|
23
|
+
* `inferTiePointStatuses`); the tag says so. */
|
|
24
|
+
inferred?: boolean;
|
|
25
|
+
className?: string;
|
|
26
|
+
}): import('react').FunctionComponentElement<import('@blueprintjs/core').TagProps>;
|
|
27
|
+
export declare function SurfaceTypeTag({ type, className, }: {
|
|
28
|
+
type: BoundaryType | null | undefined;
|
|
29
|
+
className?: string;
|
|
30
|
+
}): import('react').FunctionComponentElement<import('@blueprintjs/core').TagProps> | null;
|
|
31
|
+
export interface SurfaceStatusLegendProps {
|
|
32
|
+
statuses?: SurfaceStatus[];
|
|
33
|
+
showDescriptions?: boolean;
|
|
34
|
+
className?: string;
|
|
35
|
+
}
|
|
36
|
+
/** A legend of surface line styles, one entry per boundary status. */
|
|
37
|
+
export declare function SurfaceStatusLegend(props: SurfaceStatusLegendProps): import('react').ReactElement<{
|
|
38
|
+
className: string;
|
|
39
|
+
}, string | import('react').JSXElementConstructor<any>>;
|
|
@@ -0,0 +1,258 @@
|
|
|
1
|
+
import h$1 from "@macrostrat/hyper";
|
|
2
|
+
import classNames from "classnames";
|
|
3
|
+
import { useMemo } from "react";
|
|
4
|
+
import { Button, Tag } from "@blueprintjs/core";
|
|
5
|
+
import { DataField, Identifier, IntervalTag, UnitIdentifier } from "@macrostrat/data-components";
|
|
6
|
+
import { useMacrostratDefs } from "@macrostrat/data-provider";
|
|
7
|
+
import { AgeLabel, Proportion } from "../unit-details/age-range.js";
|
|
8
|
+
import { ReferencesField } from "../unit-details/panel.js";
|
|
9
|
+
import { surfaceClasses } from "./surfaces.js";
|
|
10
|
+
import h$3 from "./surfaces.module.sass.js";
|
|
11
|
+
import h$2 from "./details.module.sass.js";
|
|
12
|
+
import { surfaceStatuses, surfaceStatusDescriptions, surfaceStatusLabels } from "./types.js";
|
|
13
|
+
import { useColumnUnitsMap } from "../data-provider/store.js";
|
|
14
|
+
const h = h$1.styled({ ...h$3, ...h$2 });
|
|
15
|
+
function SurfaceDetailsPanel(props) {
|
|
16
|
+
const {
|
|
17
|
+
surface,
|
|
18
|
+
onClose,
|
|
19
|
+
onSelectUnit,
|
|
20
|
+
actions,
|
|
21
|
+
positionLabel = "Position",
|
|
22
|
+
className
|
|
23
|
+
} = props;
|
|
24
|
+
if (surface == null) {
|
|
25
|
+
return h(
|
|
26
|
+
"div.surface-details-panel.no-surface",
|
|
27
|
+
{ className },
|
|
28
|
+
h("p.placeholder", "No surface selected.")
|
|
29
|
+
);
|
|
30
|
+
}
|
|
31
|
+
let closeButton = null;
|
|
32
|
+
if (onClose != null) {
|
|
33
|
+
closeButton = h(Button, {
|
|
34
|
+
icon: "cross",
|
|
35
|
+
variant: "minimal",
|
|
36
|
+
size: "small",
|
|
37
|
+
onClick: onClose,
|
|
38
|
+
"aria-label": "Close"
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
let positionField = null;
|
|
42
|
+
if (surface.position != null) {
|
|
43
|
+
positionField = h(DataField, {
|
|
44
|
+
label: positionLabel,
|
|
45
|
+
value: surface.position.toLocaleString("en-US", {
|
|
46
|
+
maximumFractionDigits: 2
|
|
47
|
+
}),
|
|
48
|
+
unit: "m"
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
let sectionField = null;
|
|
52
|
+
if (surface.section_id != null) {
|
|
53
|
+
sectionField = h(
|
|
54
|
+
DataField,
|
|
55
|
+
{ label: "Section" },
|
|
56
|
+
h(Identifier, { id: surface.section_id })
|
|
57
|
+
);
|
|
58
|
+
}
|
|
59
|
+
let refsField = null;
|
|
60
|
+
if (surface.ref_id != null) {
|
|
61
|
+
refsField = h(ReferencesField, { refs: [surface.ref_id] });
|
|
62
|
+
}
|
|
63
|
+
return h(
|
|
64
|
+
"div.surface-details-panel",
|
|
65
|
+
{ className: classNames(className, surfaceClasses(surface)) },
|
|
66
|
+
[
|
|
67
|
+
h("div.surface-details-header", [
|
|
68
|
+
h("h3.surface-details-title", [
|
|
69
|
+
"Surface ",
|
|
70
|
+
h(SurfaceIdentifier, { id: surface.id })
|
|
71
|
+
]),
|
|
72
|
+
h("div.surface-details-tags", [
|
|
73
|
+
h(SurfaceStatusTag, {
|
|
74
|
+
status: surface.status,
|
|
75
|
+
inferred: surface.statusInferred
|
|
76
|
+
}),
|
|
77
|
+
h(SurfaceTypeTag, { type: surface.type })
|
|
78
|
+
]),
|
|
79
|
+
h("div.spacer"),
|
|
80
|
+
actions,
|
|
81
|
+
closeButton
|
|
82
|
+
]),
|
|
83
|
+
h("div.surface-details-content", [
|
|
84
|
+
h(DataField, { label: "Model age" }, h(AgeLabel, { age: surface.age })),
|
|
85
|
+
h(SurfaceCalibrationField, { surface }),
|
|
86
|
+
positionField,
|
|
87
|
+
h(SurfaceUnitsField, {
|
|
88
|
+
label: "Unit above",
|
|
89
|
+
unitIDs: surface.unitsAbove,
|
|
90
|
+
onSelectUnit
|
|
91
|
+
}),
|
|
92
|
+
h(SurfaceUnitsField, {
|
|
93
|
+
label: "Unit below",
|
|
94
|
+
unitIDs: surface.unitsBelow,
|
|
95
|
+
onSelectUnit
|
|
96
|
+
}),
|
|
97
|
+
sectionField,
|
|
98
|
+
refsField
|
|
99
|
+
])
|
|
100
|
+
]
|
|
101
|
+
);
|
|
102
|
+
}
|
|
103
|
+
function SurfaceIdentifier({ id }) {
|
|
104
|
+
if (typeof id === "number") {
|
|
105
|
+
return h(Identifier, { id });
|
|
106
|
+
}
|
|
107
|
+
return h("code.surface-id", String(id));
|
|
108
|
+
}
|
|
109
|
+
function SurfaceCalibrationField({ surface }) {
|
|
110
|
+
const { calibration, proportion } = surface;
|
|
111
|
+
const ids = useMemo(() => {
|
|
112
|
+
if (calibration == null) return [];
|
|
113
|
+
return [calibration.id];
|
|
114
|
+
}, [calibration?.id]);
|
|
115
|
+
const intervalMap = useMacrostratDefs("intervals", ids, null);
|
|
116
|
+
if (calibration == null) {
|
|
117
|
+
return h(DataField, {
|
|
118
|
+
label: "Calibration",
|
|
119
|
+
value: "None",
|
|
120
|
+
className: "no-calibration"
|
|
121
|
+
});
|
|
122
|
+
}
|
|
123
|
+
const def = intervalMap?.get(calibration.id);
|
|
124
|
+
const interval = {
|
|
125
|
+
id: calibration.id,
|
|
126
|
+
name: calibration.name,
|
|
127
|
+
b_age: calibration.b_age,
|
|
128
|
+
t_age: calibration.t_age,
|
|
129
|
+
color: def?.color,
|
|
130
|
+
rank: def?.rank
|
|
131
|
+
};
|
|
132
|
+
return h(DataField, { label: "Calibration" }, [
|
|
133
|
+
h(
|
|
134
|
+
"div.calibration-interval",
|
|
135
|
+
h(IntervalTag, {
|
|
136
|
+
interval,
|
|
137
|
+
prefix: h(Proportion, { value: proportion })
|
|
138
|
+
})
|
|
139
|
+
)
|
|
140
|
+
]);
|
|
141
|
+
}
|
|
142
|
+
function SurfaceUnitsField({
|
|
143
|
+
label,
|
|
144
|
+
unitIDs,
|
|
145
|
+
onSelectUnit
|
|
146
|
+
}) {
|
|
147
|
+
const unitsMap = useColumnUnitsMap();
|
|
148
|
+
if (unitIDs.length === 0) {
|
|
149
|
+
return h(DataField, { label, value: "None", className: "no-units" });
|
|
150
|
+
}
|
|
151
|
+
return h(
|
|
152
|
+
DataField,
|
|
153
|
+
{ label, className: "surface-units-field" },
|
|
154
|
+
h(
|
|
155
|
+
"ul.surface-units-list",
|
|
156
|
+
unitIDs.map((unitID) => {
|
|
157
|
+
const unit = unitsMap?.get(unitID);
|
|
158
|
+
let onClick = void 0;
|
|
159
|
+
if (onSelectUnit != null) {
|
|
160
|
+
onClick = () => onSelectUnit(unitID);
|
|
161
|
+
}
|
|
162
|
+
return h(
|
|
163
|
+
"li",
|
|
164
|
+
{ key: unitID },
|
|
165
|
+
h(UnitIdentifier, {
|
|
166
|
+
unitID,
|
|
167
|
+
colID: unit?.col_id,
|
|
168
|
+
name: unit?.unit_name,
|
|
169
|
+
onClick
|
|
170
|
+
})
|
|
171
|
+
);
|
|
172
|
+
})
|
|
173
|
+
)
|
|
174
|
+
);
|
|
175
|
+
}
|
|
176
|
+
function SurfaceStatusTag({
|
|
177
|
+
status,
|
|
178
|
+
inferred = false,
|
|
179
|
+
className
|
|
180
|
+
}) {
|
|
181
|
+
let label = surfaceStatusLabels[status] ?? status;
|
|
182
|
+
let title = surfaceStatusDescriptions[status];
|
|
183
|
+
if (inferred) {
|
|
184
|
+
label = [label, h("span.inferred-marker", "*")];
|
|
185
|
+
title = INFERRED_STATUS_DESCRIPTION;
|
|
186
|
+
}
|
|
187
|
+
return h(
|
|
188
|
+
Tag,
|
|
189
|
+
{
|
|
190
|
+
variant: "minimal",
|
|
191
|
+
className: classNames(
|
|
192
|
+
"surface-tag",
|
|
193
|
+
className,
|
|
194
|
+
surfaceClasses({ status }),
|
|
195
|
+
{ inferred }
|
|
196
|
+
),
|
|
197
|
+
title
|
|
198
|
+
},
|
|
199
|
+
label
|
|
200
|
+
);
|
|
201
|
+
}
|
|
202
|
+
const INFERRED_STATUS_DESCRIPTION = "Recorded as modeled, but this surface cannot have been interpolated — it sits on the base or top of its interval, or is the edge of a gap-bound package — so it constrains the age model rather than falling out of it";
|
|
203
|
+
function SurfaceTypeTag({
|
|
204
|
+
type,
|
|
205
|
+
className
|
|
206
|
+
}) {
|
|
207
|
+
if (type == null || type === "") return null;
|
|
208
|
+
return h(
|
|
209
|
+
Tag,
|
|
210
|
+
{
|
|
211
|
+
variant: "minimal",
|
|
212
|
+
className: classNames("surface-tag", "surface-type-tag", className)
|
|
213
|
+
},
|
|
214
|
+
type
|
|
215
|
+
);
|
|
216
|
+
}
|
|
217
|
+
function SurfaceStatusLegend(props) {
|
|
218
|
+
const {
|
|
219
|
+
statuses = surfaceStatuses,
|
|
220
|
+
showDescriptions = false,
|
|
221
|
+
className
|
|
222
|
+
} = props;
|
|
223
|
+
return h(
|
|
224
|
+
"ul.surface-status-legend",
|
|
225
|
+
{
|
|
226
|
+
className: classNames(className, {
|
|
227
|
+
"with-descriptions": showDescriptions
|
|
228
|
+
})
|
|
229
|
+
},
|
|
230
|
+
statuses.map((status) => {
|
|
231
|
+
let description = null;
|
|
232
|
+
if (showDescriptions) {
|
|
233
|
+
description = h(
|
|
234
|
+
"div.legend-description",
|
|
235
|
+
surfaceStatusDescriptions[status]
|
|
236
|
+
);
|
|
237
|
+
}
|
|
238
|
+
return h(
|
|
239
|
+
"li.legend-item",
|
|
240
|
+
{ key: status, className: surfaceClasses({ status }) },
|
|
241
|
+
[
|
|
242
|
+
h("div.surface-label-marker"),
|
|
243
|
+
h("div.legend-text", [
|
|
244
|
+
h("div.legend-label", surfaceStatusLabels[status]),
|
|
245
|
+
description
|
|
246
|
+
])
|
|
247
|
+
]
|
|
248
|
+
);
|
|
249
|
+
})
|
|
250
|
+
);
|
|
251
|
+
}
|
|
252
|
+
export {
|
|
253
|
+
SurfaceDetailsPanel,
|
|
254
|
+
SurfaceStatusLegend,
|
|
255
|
+
SurfaceStatusTag,
|
|
256
|
+
SurfaceTypeTag
|
|
257
|
+
};
|
|
258
|
+
//# sourceMappingURL=details.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"details.js","sources":["../../src/age-model/details.ts"],"sourcesContent":["/** The inspector for a selected surface, and the small tags and legend that\n * explain surface statuses and types. */\nimport hyper from \"@macrostrat/hyper\";\nimport classNames from \"classnames\";\nimport { type ReactNode, useMemo } from \"react\";\nimport { Button, Tag } from \"@blueprintjs/core\";\nimport {\n DataField,\n Identifier,\n type IntervalShort,\n IntervalTag,\n UnitIdentifier,\n Value,\n} from \"@macrostrat/data-components\";\nimport { useMacrostratDefs } from \"@macrostrat/data-provider\";\nimport type { UnitLong } from \"@macrostrat/api-types\";\nimport { useColumnUnitsMap } from \"../data-provider\";\nimport { AgeLabel, Proportion } from \"../unit-details/age-range\";\nimport { formatRange } from \"../unit-details/utils\";\nimport { ReferencesField } from \"../unit-details/panel\";\nimport { surfaceClasses } from \"./surfaces\";\nimport surfaceStyles from \"./surfaces.module.sass\";\nimport styles from \"./details.module.sass\";\nimport {\n type BoundaryType,\n type ColumnSurface,\n type SurfaceStatus,\n formatProportion,\n surfaceStatuses,\n surfaceStatusDescriptions,\n surfaceStatusLabels,\n} from \"./types\";\n\nconst h = hyper.styled({ ...surfaceStyles, ...styles });\n\nexport interface SurfaceDetailsPanelProps {\n /** The surface to inspect; `null` renders the panel's empty state */\n surface: ColumnSurface | null;\n onClose?: () => void;\n /** Called when a unit above or below the surface is clicked */\n onSelectUnit?: (unitID: number) => void;\n /** Extra controls for the header */\n actions?: ReactNode;\n /** Label for the measured-position field (\"Height\" or \"Depth\") */\n positionLabel?: string;\n className?: string;\n}\n\n/** Details of one surface: its age, calibration, the units it separates, and\n * provenance. A companion to `UnitDetailsPanel`. */\nexport function SurfaceDetailsPanel(props: SurfaceDetailsPanelProps) {\n const {\n surface,\n onClose,\n onSelectUnit,\n actions,\n positionLabel = \"Position\",\n className,\n } = props;\n\n // A selection that hasn't been made yet is an ordinary state for a panel\n // bound to one, not a caller error\n if (surface == null) {\n return h(\n \"div.surface-details-panel.no-surface\",\n { className },\n h(\"p.placeholder\", \"No surface selected.\"),\n );\n }\n\n let closeButton: ReactNode = null;\n if (onClose != null) {\n closeButton = h(Button, {\n icon: \"cross\",\n variant: \"minimal\",\n size: \"small\",\n onClick: onClose,\n \"aria-label\": \"Close\",\n });\n }\n\n let positionField: ReactNode = null;\n if (surface.position != null) {\n positionField = h(DataField, {\n label: positionLabel,\n value: surface.position.toLocaleString(\"en-US\", {\n maximumFractionDigits: 2,\n }),\n unit: \"m\",\n });\n }\n\n let sectionField: ReactNode = null;\n if (surface.section_id != null) {\n sectionField = h(\n DataField,\n { label: \"Section\" },\n h(Identifier, { id: surface.section_id }),\n );\n }\n\n let refsField: ReactNode = null;\n if (surface.ref_id != null) {\n refsField = h(ReferencesField, { refs: [surface.ref_id] });\n }\n\n return h(\n \"div.surface-details-panel\",\n { className: classNames(className, surfaceClasses(surface)) },\n [\n h(\"div.surface-details-header\", [\n h(\"h3.surface-details-title\", [\n \"Surface \",\n h(SurfaceIdentifier, { id: surface.id }),\n ]),\n h(\"div.surface-details-tags\", [\n h(SurfaceStatusTag, {\n status: surface.status,\n inferred: surface.statusInferred,\n }),\n h(SurfaceTypeTag, { type: surface.type }),\n ]),\n h(\"div.spacer\"),\n actions,\n closeButton,\n ]),\n h(\"div.surface-details-content\", [\n h(DataField, { label: \"Model age\" }, h(AgeLabel, { age: surface.age })),\n h(SurfaceCalibrationField, { surface }),\n positionField,\n h(SurfaceUnitsField, {\n label: \"Unit above\",\n unitIDs: surface.unitsAbove,\n onSelectUnit,\n }),\n h(SurfaceUnitsField, {\n label: \"Unit below\",\n unitIDs: surface.unitsBelow,\n onSelectUnit,\n }),\n sectionField,\n refsField,\n ]),\n ],\n );\n}\n\nfunction SurfaceIdentifier({ id }: { id: ColumnSurface[\"id\"] }) {\n if (typeof id === \"number\") {\n return h(Identifier, { id });\n }\n return h(\"code.surface-id\", String(id));\n}\n\n/** The calibration interval as a colored tag, with the surface's position in\n * it: \"Calymmian (1600–1400 Ma), 85% above base\". */\nfunction SurfaceCalibrationField({ surface }: { surface: ColumnSurface }) {\n const { calibration, proportion } = surface;\n const ids = useMemo(() => {\n if (calibration == null) return [];\n return [calibration.id];\n }, [calibration?.id]);\n // Interval colors come from the definitions table; the age model itself\n // doesn't carry them\n const intervalMap = useMacrostratDefs(\"intervals\", ids, null);\n\n if (calibration == null) {\n return h(DataField, {\n label: \"Calibration\",\n value: \"None\",\n className: \"no-calibration\",\n });\n }\n\n const def = intervalMap?.get(calibration.id);\n const interval: IntervalShort = {\n id: calibration.id,\n name: calibration.name,\n b_age: calibration.b_age,\n t_age: calibration.t_age,\n color: def?.color,\n rank: def?.rank,\n };\n\n return h(DataField, { label: \"Calibration\" }, [\n h(\n \"div.calibration-interval\",\n h(IntervalTag, {\n interval,\n prefix: h(Proportion, { value: proportion }),\n }),\n ),\n ]);\n}\n\nfunction SurfaceUnitsField({\n label,\n unitIDs,\n onSelectUnit,\n}: {\n label: string;\n unitIDs: number[];\n onSelectUnit?: (unitID: number) => void;\n}) {\n const unitsMap = useColumnUnitsMap();\n if (unitIDs.length === 0) {\n return h(DataField, { label, value: \"None\", className: \"no-units\" });\n }\n return h(\n DataField,\n { label, className: \"surface-units-field\" },\n h(\n \"ul.surface-units-list\",\n unitIDs.map((unitID) => {\n const unit = unitsMap?.get(unitID) as UnitLong | undefined;\n let onClick: (() => void) | undefined = undefined;\n if (onSelectUnit != null) {\n onClick = () => onSelectUnit(unitID);\n }\n return h(\n \"li\",\n { key: unitID },\n h(UnitIdentifier, {\n unitID,\n colID: unit?.col_id,\n name: unit?.unit_name,\n onClick,\n }),\n );\n }),\n ),\n );\n}\n\nexport function SurfaceStatusTag({\n status,\n inferred = false,\n className,\n}: {\n status: SurfaceStatus;\n /** The status was inferred rather than recorded (see\n * `inferTiePointStatuses`); the tag says so. */\n inferred?: boolean;\n className?: string;\n}) {\n let label: ReactNode = surfaceStatusLabels[status] ?? status;\n let title = surfaceStatusDescriptions[status];\n if (inferred) {\n label = [label, h(\"span.inferred-marker\", \"*\")];\n title = INFERRED_STATUS_DESCRIPTION;\n }\n\n return h(\n Tag,\n {\n variant: \"minimal\",\n className: classNames(\n \"surface-tag\",\n className,\n surfaceClasses({ status }),\n { inferred },\n ),\n title,\n },\n label,\n );\n}\n\nconst INFERRED_STATUS_DESCRIPTION =\n \"Recorded as modeled, but this surface cannot have been interpolated — it \" +\n \"sits on the base or top of its interval, or is the edge of a gap-bound \" +\n \"package — so it constrains the age model rather than falling out of it\";\n\nexport function SurfaceTypeTag({\n type,\n className,\n}: {\n type: BoundaryType | null | undefined;\n className?: string;\n}) {\n if (type == null || type === \"\") return null;\n return h(\n Tag,\n {\n variant: \"minimal\",\n className: classNames(\"surface-tag\", \"surface-type-tag\", className),\n },\n type,\n );\n}\n\nexport interface SurfaceStatusLegendProps {\n statuses?: SurfaceStatus[];\n showDescriptions?: boolean;\n className?: string;\n}\n\n/** A legend of surface line styles, one entry per boundary status. */\nexport function SurfaceStatusLegend(props: SurfaceStatusLegendProps) {\n const {\n statuses = surfaceStatuses,\n showDescriptions = false,\n className,\n } = props;\n return h(\n \"ul.surface-status-legend\",\n {\n className: classNames(className, {\n \"with-descriptions\": showDescriptions,\n }),\n },\n statuses.map((status) => {\n let description: ReactNode = null;\n if (showDescriptions) {\n description = h(\n \"div.legend-description\",\n surfaceStatusDescriptions[status],\n );\n }\n return h(\n \"li.legend-item\",\n { key: status, className: surfaceClasses({ status }) },\n [\n h(\"div.surface-label-marker\"),\n h(\"div.legend-text\", [\n h(\"div.legend-label\", surfaceStatusLabels[status]),\n description,\n ]),\n ],\n );\n }),\n );\n}\n"],"names":["hyper","surfaceStyles","styles"],"mappings":";;;;;;;;;;;;;AAiCA,MAAM,IAAIA,IAAM,OAAO,EAAE,GAAGC,KAAe,GAAGC,KAAQ;AAiB/C,SAAS,oBAAoB,OAAiC;AACnE,QAAM;AAAA,IACJ;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA,gBAAgB;AAAA,IAChB;AAAA,EAAA,IACE;AAIJ,MAAI,WAAW,MAAM;AACnB,WAAO;AAAA,MACL;AAAA,MACA,EAAE,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AA,QACzB,EAAE,SAAA;AAAA,MAAS;AAAA,MAEb;AAAA,IAAA;AAAA,IAEF;AAAA,EAAA;AAEJ;AAEA,MAAM,8BACJ;AAIK,SAAS,eAAe;AAAA,EAC7B;AAAA,EACA;AACF,GAGG;AACD,MAAI,QAAQ,QAAQ,SAAS,GAAI,QAAO;AACxC,SAAO;AAAA,IACL;AAAA,IACA;AAAA,MACE,SAAS;AAAA,MACT,WAAW,WAAW,eAAe,oBAAoB,SAAS;AAAA,IAAA;AAAA,IAEpE;AAAA,EAAA;AAEJ;AASO,SAAS,oBAAoB,OAAiC;AACnE,QAAM;AAAA,IACJ,WAAW;AAAA,IACX,mBAAmB;AAAA,IACnB;AAAA,EAAA,IACE;AACJ,SAAO;AAAA,IACL;AAAA,IACA;AAAA,MACE,WAAW,WAAW,WAAW;AAAA,QAC/B,qBAAqB;AAAA,MAAA,CACtB;AAAA,IAAA;AAAA,IAEH,SAAS,IAAI,CAAC,WAAW;AACvB,UAAI,cAAyB;AAC7B,UAAI,kBAAkB;AACpB,sBAAc;AAAA,UACZ;AAAA,UACA,0BAA0B,MAAM;AAAA,QAAA;AAAA,MAEpC;AACA,aAAO;AAAA,QACL;AAAA,QACA,EAAE,KAAK,QAAQ,WAAW,eAAe,EAAE,OAAA,CAAQ,EAAA;AAAA,QACnD;AAAA,UACE,EAAE,0BAA0B;AAAA,UAC5B,EAAE,mBAAmB;AAAA,YACnB,EAAE,oBAAoB,oBAAoB,MAAM,CAAC;AAAA,YACjD;AAAA,UAAA,CACD;AAAA,QAAA;AAAA,MACH;AAAA,IAEJ,CAAC;AAAA,EAAA;AAEL;"}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: "Module" } });
|
|
3
|
+
const h$1 = require("@macrostrat/hyper");
|
|
4
|
+
const _interopDefault = (e) => e && e.__esModule ? e : { default: e };
|
|
5
|
+
const h__default = /* @__PURE__ */ _interopDefault(h$1);
|
|
6
|
+
const spacer = "_spacer_14xjd_16";
|
|
7
|
+
const placeholder = "_placeholder_14xjd_38";
|
|
8
|
+
const inferred = "_inferred_14xjd_55";
|
|
9
|
+
const styles = {
|
|
10
|
+
"surface-details-panel": "_surface-details-panel_14xjd_1",
|
|
11
|
+
"surface-details-header": "_surface-details-header_14xjd_7",
|
|
12
|
+
spacer,
|
|
13
|
+
"surface-details-title": "_surface-details-title_14xjd_20",
|
|
14
|
+
"surface-id": "_surface-id_14xjd_24",
|
|
15
|
+
"surface-details-tags": "_surface-details-tags_14xjd_29",
|
|
16
|
+
"surface-details-content": "_surface-details-content_14xjd_34",
|
|
17
|
+
"no-surface": "_no-surface_14xjd_38",
|
|
18
|
+
placeholder,
|
|
19
|
+
"surface-tag": "_surface-tag_14xjd_43",
|
|
20
|
+
"surface-type-tag": "_surface-type-tag_14xjd_52",
|
|
21
|
+
inferred,
|
|
22
|
+
"inferred-marker": "_inferred-marker_14xjd_59",
|
|
23
|
+
"calibration-interval": "_calibration-interval_14xjd_64",
|
|
24
|
+
"calibration-range": "_calibration-range_14xjd_71",
|
|
25
|
+
"calibration-proportion": "_calibration-proportion_14xjd_76",
|
|
26
|
+
"surface-units-list": "_surface-units-list_14xjd_80",
|
|
27
|
+
"no-units": "_no-units_14xjd_95",
|
|
28
|
+
"no-calibration": "_no-calibration_14xjd_95",
|
|
29
|
+
"surface-status-legend": "_surface-status-legend_14xjd_99",
|
|
30
|
+
"with-descriptions": "_with-descriptions_14xjd_108",
|
|
31
|
+
"legend-item": "_legend-item_14xjd_112",
|
|
32
|
+
"surface-label-marker": "_surface-label-marker_14xjd_118",
|
|
33
|
+
"legend-label": "_legend-label_14xjd_124",
|
|
34
|
+
"legend-description": "_legend-description_14xjd_128"
|
|
35
|
+
};
|
|
36
|
+
let h = h__default.default.styled(styles);
|
|
37
|
+
Object.assign(h, styles);
|
|
38
|
+
exports.default = h;
|
|
39
|
+
exports.inferred = inferred;
|
|
40
|
+
exports.placeholder = placeholder;
|
|
41
|
+
exports.spacer = spacer;
|
|
42
|
+
//# sourceMappingURL=details.module.sass.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"details.module.sass.cjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import h$1 from "@macrostrat/hyper";
|
|
2
|
+
const spacer = "_spacer_14xjd_16";
|
|
3
|
+
const placeholder = "_placeholder_14xjd_38";
|
|
4
|
+
const inferred = "_inferred_14xjd_55";
|
|
5
|
+
const styles = {
|
|
6
|
+
"surface-details-panel": "_surface-details-panel_14xjd_1",
|
|
7
|
+
"surface-details-header": "_surface-details-header_14xjd_7",
|
|
8
|
+
spacer,
|
|
9
|
+
"surface-details-title": "_surface-details-title_14xjd_20",
|
|
10
|
+
"surface-id": "_surface-id_14xjd_24",
|
|
11
|
+
"surface-details-tags": "_surface-details-tags_14xjd_29",
|
|
12
|
+
"surface-details-content": "_surface-details-content_14xjd_34",
|
|
13
|
+
"no-surface": "_no-surface_14xjd_38",
|
|
14
|
+
placeholder,
|
|
15
|
+
"surface-tag": "_surface-tag_14xjd_43",
|
|
16
|
+
"surface-type-tag": "_surface-type-tag_14xjd_52",
|
|
17
|
+
inferred,
|
|
18
|
+
"inferred-marker": "_inferred-marker_14xjd_59",
|
|
19
|
+
"calibration-interval": "_calibration-interval_14xjd_64",
|
|
20
|
+
"calibration-range": "_calibration-range_14xjd_71",
|
|
21
|
+
"calibration-proportion": "_calibration-proportion_14xjd_76",
|
|
22
|
+
"surface-units-list": "_surface-units-list_14xjd_80",
|
|
23
|
+
"no-units": "_no-units_14xjd_95",
|
|
24
|
+
"no-calibration": "_no-calibration_14xjd_95",
|
|
25
|
+
"surface-status-legend": "_surface-status-legend_14xjd_99",
|
|
26
|
+
"with-descriptions": "_with-descriptions_14xjd_108",
|
|
27
|
+
"legend-item": "_legend-item_14xjd_112",
|
|
28
|
+
"surface-label-marker": "_surface-label-marker_14xjd_118",
|
|
29
|
+
"legend-label": "_legend-label_14xjd_124",
|
|
30
|
+
"legend-description": "_legend-description_14xjd_128"
|
|
31
|
+
};
|
|
32
|
+
let h = h$1.styled(styles);
|
|
33
|
+
Object.assign(h, styles);
|
|
34
|
+
export {
|
|
35
|
+
h as default,
|
|
36
|
+
inferred,
|
|
37
|
+
placeholder,
|
|
38
|
+
spacer
|
|
39
|
+
};
|
|
40
|
+
//# sourceMappingURL=details.module.sass.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"details.module.sass.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
+
const h = require("@macrostrat/hyper");
|
|
4
|
+
const React = require("react");
|
|
5
|
+
const surfaces = require("./surfaces.cjs");
|
|
6
|
+
const types = require("./types.cjs");
|
|
7
|
+
const store = require("../data-provider/store.cjs");
|
|
8
|
+
const _interopDefault = (e) => e && e.__esModule ? e : { default: e };
|
|
9
|
+
const h__default = /* @__PURE__ */ _interopDefault(h);
|
|
10
|
+
function BoundaryAgeModelOverlay() {
|
|
11
|
+
return h__default.default(surfaces.ColumnSurfaces, {
|
|
12
|
+
showLabels: false,
|
|
13
|
+
extent: "column",
|
|
14
|
+
fallbackToUnits: false
|
|
15
|
+
});
|
|
16
|
+
}
|
|
17
|
+
function ComputedSurfacesOverlay() {
|
|
18
|
+
const units = store.useMacrostratUnits();
|
|
19
|
+
const { axisType } = store.useMacrostratColumnData();
|
|
20
|
+
const surfaces$1 = React.useMemo(
|
|
21
|
+
() => types.surfacesFromUnits(units, { axisType }),
|
|
22
|
+
[units, axisType]
|
|
23
|
+
);
|
|
24
|
+
return h__default.default(surfaces.ColumnSurfaces, { surfaces: surfaces$1, showLabels: false, extent: "column" });
|
|
25
|
+
}
|
|
26
|
+
exports.BoundaryAgeModelOverlay = BoundaryAgeModelOverlay;
|
|
27
|
+
exports.ComputedSurfacesOverlay = ComputedSurfacesOverlay;
|
|
28
|
+
//# sourceMappingURL=legacy.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"legacy.cjs","sources":["../../src/age-model/legacy.ts"],"sourcesContent":["/** Earlier, in-development overlays, kept so existing consumers keep working.\n * Both are now thin wrappers over `ColumnSurfaces`. */\nimport h from \"@macrostrat/hyper\";\nimport { useMemo } from \"react\";\nimport type { UnitLong } from \"@macrostrat/api-types\";\nimport { useMacrostratColumnData, useMacrostratUnits } from \"../data-provider\";\nimport { ColumnSurfaces } from \"./surfaces\";\nimport { surfacesFromUnits } from \"./types\";\n\n/** @deprecated Use `ColumnSurfaces`, which also labels the surfaces and\n * styles them by boundary status. */\nexport function BoundaryAgeModelOverlay() {\n return h(ColumnSurfaces, {\n showLabels: false,\n extent: \"column\",\n fallbackToUnits: false,\n });\n}\n\n/** @deprecated Use `ColumnSurfaces` with `surfaces: surfacesFromUnits(units)`,\n * or rely on its default fallback to unit-derived surfaces. */\nexport function ComputedSurfacesOverlay() {\n const units = useMacrostratUnits() as UnitLong[];\n const { axisType } = useMacrostratColumnData();\n const surfaces = useMemo(\n () => surfacesFromUnits(units, { axisType }),\n [units, axisType],\n );\n return h(ColumnSurfaces, { surfaces, showLabels: false, extent: \"column\" });\n}\n"],"names":["h","ColumnSurfaces","useMacrostratUnits","useMacrostratColumnData","surfaces","useMemo","surfacesFromUnits"],"mappings":";;;;;;;;;AAWO,SAAS,0BAA0B;AACxC,SAAOA,WAAAA,QAAEC,SAAAA,gBAAgB;AAAA,IACvB,YAAY;AAAA,IACZ,QAAQ;AAAA,IACR,iBAAiB;AAAA,EAAA,CAClB;AACH;AAIO,SAAS,0BAA0B;AACxC,QAAM,QAAQC,MAAAA,mBAAA;AACd,QAAM,EAAE,SAAA,IAAaC,8BAAA;AACrB,QAAMC,aAAWC,MAAAA;AAAAA,IACf,MAAMC,wBAAkB,OAAO,EAAE,UAAU;AAAA,IAC3C,CAAC,OAAO,QAAQ;AAAA,EAAA;AAElB,SAAON,WAAAA,QAAEC,SAAAA,gBAAgB,YAAEG,YAAU,YAAY,OAAO,QAAQ,UAAU;AAC5E;;;"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/** @deprecated Use `ColumnSurfaces`, which also labels the surfaces and
|
|
2
|
+
* styles them by boundary status. */
|
|
3
|
+
export declare function BoundaryAgeModelOverlay(): import('react').FunctionComponentElement<import('./surfaces').ColumnSurfacesProps>;
|
|
4
|
+
/** @deprecated Use `ColumnSurfaces` with `surfaces: surfacesFromUnits(units)`,
|
|
5
|
+
* or rely on its default fallback to unit-derived surfaces. */
|
|
6
|
+
export declare function ComputedSurfacesOverlay(): import('react').FunctionComponentElement<import('./surfaces').ColumnSurfacesProps>;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import h from "@macrostrat/hyper";
|
|
2
|
+
import { useMemo } from "react";
|
|
3
|
+
import { ColumnSurfaces } from "./surfaces.js";
|
|
4
|
+
import { surfacesFromUnits } from "./types.js";
|
|
5
|
+
import { useMacrostratUnits, useMacrostratColumnData } from "../data-provider/store.js";
|
|
6
|
+
function BoundaryAgeModelOverlay() {
|
|
7
|
+
return h(ColumnSurfaces, {
|
|
8
|
+
showLabels: false,
|
|
9
|
+
extent: "column",
|
|
10
|
+
fallbackToUnits: false
|
|
11
|
+
});
|
|
12
|
+
}
|
|
13
|
+
function ComputedSurfacesOverlay() {
|
|
14
|
+
const units = useMacrostratUnits();
|
|
15
|
+
const { axisType } = useMacrostratColumnData();
|
|
16
|
+
const surfaces = useMemo(
|
|
17
|
+
() => surfacesFromUnits(units, { axisType }),
|
|
18
|
+
[units, axisType]
|
|
19
|
+
);
|
|
20
|
+
return h(ColumnSurfaces, { surfaces, showLabels: false, extent: "column" });
|
|
21
|
+
}
|
|
22
|
+
export {
|
|
23
|
+
BoundaryAgeModelOverlay,
|
|
24
|
+
ComputedSurfacesOverlay
|
|
25
|
+
};
|
|
26
|
+
//# sourceMappingURL=legacy.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"legacy.js","sources":["../../src/age-model/legacy.ts"],"sourcesContent":["/** Earlier, in-development overlays, kept so existing consumers keep working.\n * Both are now thin wrappers over `ColumnSurfaces`. */\nimport h from \"@macrostrat/hyper\";\nimport { useMemo } from \"react\";\nimport type { UnitLong } from \"@macrostrat/api-types\";\nimport { useMacrostratColumnData, useMacrostratUnits } from \"../data-provider\";\nimport { ColumnSurfaces } from \"./surfaces\";\nimport { surfacesFromUnits } from \"./types\";\n\n/** @deprecated Use `ColumnSurfaces`, which also labels the surfaces and\n * styles them by boundary status. */\nexport function BoundaryAgeModelOverlay() {\n return h(ColumnSurfaces, {\n showLabels: false,\n extent: \"column\",\n fallbackToUnits: false,\n });\n}\n\n/** @deprecated Use `ColumnSurfaces` with `surfaces: surfacesFromUnits(units)`,\n * or rely on its default fallback to unit-derived surfaces. */\nexport function ComputedSurfacesOverlay() {\n const units = useMacrostratUnits() as UnitLong[];\n const { axisType } = useMacrostratColumnData();\n const surfaces = useMemo(\n () => surfacesFromUnits(units, { axisType }),\n [units, axisType],\n );\n return h(ColumnSurfaces, { surfaces, showLabels: false, extent: \"column\" });\n}\n"],"names":[],"mappings":";;;;;AAWO,SAAS,0BAA0B;AACxC,SAAO,EAAE,gBAAgB;AAAA,IACvB,YAAY;AAAA,IACZ,QAAQ;AAAA,IACR,iBAAiB;AAAA,EAAA,CAClB;AACH;AAIO,SAAS,0BAA0B;AACxC,QAAM,QAAQ,mBAAA;AACd,QAAM,EAAE,SAAA,IAAa,wBAAA;AACrB,QAAM,WAAW;AAAA,IACf,MAAM,kBAAkB,OAAO,EAAE,UAAU;AAAA,IAC3C,CAAC,OAAO,QAAQ;AAAA,EAAA;AAElB,SAAO,EAAE,gBAAgB,EAAE,UAAU,YAAY,OAAO,QAAQ,UAAU;AAC5E;"}
|