@nakafa/aksara-contracts 8.15.0 → 8.17.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (43) hide show
  1. package/dist/visual/base.d.ts +785 -0
  2. package/dist/visual/base.js +13 -0
  3. package/dist/visual/biology/ecosystem.d.ts +425 -0
  4. package/dist/visual/biology/ecosystem.js +140 -0
  5. package/dist/visual/biology/respiration.d.ts +286 -0
  6. package/dist/visual/biology/respiration.js +97 -0
  7. package/dist/visual/biology.d.ts +11158 -205
  8. package/dist/visual/biology.js +104 -0
  9. package/dist/visual/catalog.d.ts +16 -41206
  10. package/dist/visual/catalog.js +8 -216
  11. package/dist/visual/chemistry/green.d.ts +282 -0
  12. package/dist/visual/chemistry/green.js +98 -0
  13. package/dist/visual/chemistry/groups.d.ts +276 -0
  14. package/dist/visual/chemistry/groups.js +85 -0
  15. package/dist/visual/chemistry/industry.d.ts +420 -0
  16. package/dist/visual/chemistry/industry.js +126 -0
  17. package/dist/visual/chemistry/materials.d.ts +416 -0
  18. package/dist/visual/chemistry/materials.js +116 -0
  19. package/dist/visual/chemistry/organic.d.ts +416 -0
  20. package/dist/visual/chemistry/organic.js +128 -0
  21. package/dist/visual/chemistry/polymer.d.ts +422 -0
  22. package/dist/visual/chemistry/polymer.js +126 -0
  23. package/dist/visual/chemistry/solution.d.ts +278 -0
  24. package/dist/visual/chemistry/solution.js +89 -0
  25. package/dist/visual/chemistry/stoichiometry.d.ts +287 -0
  26. package/dist/visual/chemistry/stoichiometry.js +83 -0
  27. package/dist/visual/chemistry.d.ts +8827 -0
  28. package/dist/visual/chemistry.js +50 -0
  29. package/dist/visual/mathematics/derivative.d.ts +425 -0
  30. package/dist/visual/mathematics/derivative.js +132 -0
  31. package/dist/visual/mathematics/integral.d.ts +428 -0
  32. package/dist/visual/mathematics/integral.js +146 -0
  33. package/dist/visual/mathematics/limit.d.ts +425 -0
  34. package/dist/visual/mathematics/limit.js +139 -0
  35. package/dist/visual/mathematics/linear.d.ts +425 -0
  36. package/dist/visual/mathematics/linear.js +140 -0
  37. package/dist/visual/mathematics/vector.d.ts +419 -0
  38. package/dist/visual/mathematics/vector.js +129 -0
  39. package/dist/visual/mathematics.d.ts +5148 -0
  40. package/dist/visual/mathematics.js +41 -0
  41. package/dist/visual/physics.d.ts +17875 -0
  42. package/dist/visual/physics.js +70 -0
  43. package/package.json +1 -1
@@ -0,0 +1,422 @@
1
+ import { Schema } from "effect";
2
+ import type { RichSlot } from "#contracts/visual/card";
3
+ /**
4
+ * Polymer chemistry labs covering addition chain growth, condensation
5
+ * polyamide/polyester synthesis, and sulfur vulcanisation of rubber.
6
+ */
7
+ export declare function polymerVisuals<E>(rich: RichSlot<E>): {
8
+ AdditionPolymerChainLab: import("#contracts/visual/entry").VisualEntry<Schema.Struct<{
9
+ readonly description: RichSlot<E>;
10
+ readonly footer: Schema.optionalKey<Schema.Codec<readonly [{
11
+ readonly marks?: readonly [{
12
+ readonly type: "bold" | "code" | "italic" | "subscript" | "superscript" | "underline";
13
+ } | {
14
+ readonly attrs: {
15
+ readonly href: string;
16
+ };
17
+ readonly type: "link";
18
+ } | {
19
+ readonly attrs: {
20
+ readonly variant: "success" | "warning" | null;
21
+ };
22
+ readonly type: "highlight";
23
+ }, ...({
24
+ readonly type: "bold" | "code" | "italic" | "subscript" | "superscript" | "underline";
25
+ } | {
26
+ readonly attrs: {
27
+ readonly href: string;
28
+ };
29
+ readonly type: "link";
30
+ } | {
31
+ readonly attrs: {
32
+ readonly variant: "success" | "warning" | null;
33
+ };
34
+ readonly type: "highlight";
35
+ })[]];
36
+ readonly text: string;
37
+ readonly type: "text";
38
+ } | {
39
+ readonly attrs: {
40
+ readonly latex: string;
41
+ };
42
+ readonly marks?: readonly [{
43
+ readonly type: "bold" | "code" | "italic" | "subscript" | "superscript" | "underline";
44
+ } | {
45
+ readonly attrs: {
46
+ readonly href: string;
47
+ };
48
+ readonly type: "link";
49
+ } | {
50
+ readonly attrs: {
51
+ readonly variant: "success" | "warning" | null;
52
+ };
53
+ readonly type: "highlight";
54
+ }, ...({
55
+ readonly type: "bold" | "code" | "italic" | "subscript" | "superscript" | "underline";
56
+ } | {
57
+ readonly attrs: {
58
+ readonly href: string;
59
+ };
60
+ readonly type: "link";
61
+ } | {
62
+ readonly attrs: {
63
+ readonly variant: "success" | "warning" | null;
64
+ };
65
+ readonly type: "highlight";
66
+ })[]];
67
+ readonly type: "mathInline";
68
+ }, ...({
69
+ readonly marks?: readonly [{
70
+ readonly type: "bold" | "code" | "italic" | "subscript" | "superscript" | "underline";
71
+ } | {
72
+ readonly attrs: {
73
+ readonly href: string;
74
+ };
75
+ readonly type: "link";
76
+ } | {
77
+ readonly attrs: {
78
+ readonly variant: "success" | "warning" | null;
79
+ };
80
+ readonly type: "highlight";
81
+ }, ...({
82
+ readonly type: "bold" | "code" | "italic" | "subscript" | "superscript" | "underline";
83
+ } | {
84
+ readonly attrs: {
85
+ readonly href: string;
86
+ };
87
+ readonly type: "link";
88
+ } | {
89
+ readonly attrs: {
90
+ readonly variant: "success" | "warning" | null;
91
+ };
92
+ readonly type: "highlight";
93
+ })[]];
94
+ readonly text: string;
95
+ readonly type: "text";
96
+ } | {
97
+ readonly attrs: {
98
+ readonly latex: string;
99
+ };
100
+ readonly marks?: readonly [{
101
+ readonly type: "bold" | "code" | "italic" | "subscript" | "superscript" | "underline";
102
+ } | {
103
+ readonly attrs: {
104
+ readonly href: string;
105
+ };
106
+ readonly type: "link";
107
+ } | {
108
+ readonly attrs: {
109
+ readonly variant: "success" | "warning" | null;
110
+ };
111
+ readonly type: "highlight";
112
+ }, ...({
113
+ readonly type: "bold" | "code" | "italic" | "subscript" | "superscript" | "underline";
114
+ } | {
115
+ readonly attrs: {
116
+ readonly href: string;
117
+ };
118
+ readonly type: "link";
119
+ } | {
120
+ readonly attrs: {
121
+ readonly variant: "success" | "warning" | null;
122
+ };
123
+ readonly type: "highlight";
124
+ })[]];
125
+ readonly type: "mathInline";
126
+ })[]], E, never, never>>;
127
+ readonly title: RichSlot<E>;
128
+ readonly chainLength: Schema.Struct<{
129
+ readonly max: Schema.Finite;
130
+ readonly min: Schema.Finite;
131
+ readonly value: Schema.Finite;
132
+ }>;
133
+ readonly labels: Schema.Struct<{
134
+ readonly chainLength: Schema.Trimmed;
135
+ readonly monomer: Schema.Trimmed;
136
+ readonly monomers: Schema.$Record<Schema.Literals<readonly ["ethene", "propene", "chloroethene", "tetrafluoroethene"]>, Schema.optionalKey<Schema.Struct<{
137
+ readonly name: Schema.Trimmed;
138
+ readonly polymerName: RichSlot<E>;
139
+ readonly repeatUnit: RichSlot<E>;
140
+ }>>>;
141
+ readonly parts: Schema.$Record<Schema.Literals<readonly ["monomerUnit", "doubleBond", "singleBackbone", "sideGroup"]>, Schema.Trimmed>;
142
+ readonly polymerName: Schema.optionalKey<RichSlot<E>>;
143
+ readonly repeatUnit: Schema.optionalKey<RichSlot<E>>;
144
+ readonly view: Schema.Trimmed;
145
+ }>;
146
+ readonly monomers: Schema.NonEmptyArray<Schema.Literals<readonly ["ethene", "propene", "chloroethene", "tetrafluoroethene"]>>;
147
+ }>, "figure">;
148
+ CondensationNylonLab: import("#contracts/visual/entry").VisualEntry<Schema.Struct<{
149
+ readonly description: RichSlot<E>;
150
+ readonly footer: Schema.optionalKey<Schema.Codec<readonly [{
151
+ readonly marks?: readonly [{
152
+ readonly type: "bold" | "code" | "italic" | "subscript" | "superscript" | "underline";
153
+ } | {
154
+ readonly attrs: {
155
+ readonly href: string;
156
+ };
157
+ readonly type: "link";
158
+ } | {
159
+ readonly attrs: {
160
+ readonly variant: "success" | "warning" | null;
161
+ };
162
+ readonly type: "highlight";
163
+ }, ...({
164
+ readonly type: "bold" | "code" | "italic" | "subscript" | "superscript" | "underline";
165
+ } | {
166
+ readonly attrs: {
167
+ readonly href: string;
168
+ };
169
+ readonly type: "link";
170
+ } | {
171
+ readonly attrs: {
172
+ readonly variant: "success" | "warning" | null;
173
+ };
174
+ readonly type: "highlight";
175
+ })[]];
176
+ readonly text: string;
177
+ readonly type: "text";
178
+ } | {
179
+ readonly attrs: {
180
+ readonly latex: string;
181
+ };
182
+ readonly marks?: readonly [{
183
+ readonly type: "bold" | "code" | "italic" | "subscript" | "superscript" | "underline";
184
+ } | {
185
+ readonly attrs: {
186
+ readonly href: string;
187
+ };
188
+ readonly type: "link";
189
+ } | {
190
+ readonly attrs: {
191
+ readonly variant: "success" | "warning" | null;
192
+ };
193
+ readonly type: "highlight";
194
+ }, ...({
195
+ readonly type: "bold" | "code" | "italic" | "subscript" | "superscript" | "underline";
196
+ } | {
197
+ readonly attrs: {
198
+ readonly href: string;
199
+ };
200
+ readonly type: "link";
201
+ } | {
202
+ readonly attrs: {
203
+ readonly variant: "success" | "warning" | null;
204
+ };
205
+ readonly type: "highlight";
206
+ })[]];
207
+ readonly type: "mathInline";
208
+ }, ...({
209
+ readonly marks?: readonly [{
210
+ readonly type: "bold" | "code" | "italic" | "subscript" | "superscript" | "underline";
211
+ } | {
212
+ readonly attrs: {
213
+ readonly href: string;
214
+ };
215
+ readonly type: "link";
216
+ } | {
217
+ readonly attrs: {
218
+ readonly variant: "success" | "warning" | null;
219
+ };
220
+ readonly type: "highlight";
221
+ }, ...({
222
+ readonly type: "bold" | "code" | "italic" | "subscript" | "superscript" | "underline";
223
+ } | {
224
+ readonly attrs: {
225
+ readonly href: string;
226
+ };
227
+ readonly type: "link";
228
+ } | {
229
+ readonly attrs: {
230
+ readonly variant: "success" | "warning" | null;
231
+ };
232
+ readonly type: "highlight";
233
+ })[]];
234
+ readonly text: string;
235
+ readonly type: "text";
236
+ } | {
237
+ readonly attrs: {
238
+ readonly latex: string;
239
+ };
240
+ readonly marks?: readonly [{
241
+ readonly type: "bold" | "code" | "italic" | "subscript" | "superscript" | "underline";
242
+ } | {
243
+ readonly attrs: {
244
+ readonly href: string;
245
+ };
246
+ readonly type: "link";
247
+ } | {
248
+ readonly attrs: {
249
+ readonly variant: "success" | "warning" | null;
250
+ };
251
+ readonly type: "highlight";
252
+ }, ...({
253
+ readonly type: "bold" | "code" | "italic" | "subscript" | "superscript" | "underline";
254
+ } | {
255
+ readonly attrs: {
256
+ readonly href: string;
257
+ };
258
+ readonly type: "link";
259
+ } | {
260
+ readonly attrs: {
261
+ readonly variant: "success" | "warning" | null;
262
+ };
263
+ readonly type: "highlight";
264
+ })[]];
265
+ readonly type: "mathInline";
266
+ })[]], E, never, never>>;
267
+ readonly title: RichSlot<E>;
268
+ readonly labels: Schema.Struct<{
269
+ readonly byproduct: Schema.optionalKey<RichSlot<E>>;
270
+ readonly linkage: Schema.optionalKey<RichSlot<E>>;
271
+ readonly parts: Schema.$Record<Schema.Literals<readonly ["monomerA", "monomerB", "esterOrAmideLink", "waterByproduct", "polymerChain"]>, Schema.Trimmed>;
272
+ readonly polymer: Schema.Trimmed;
273
+ readonly polymers: Schema.$Record<Schema.Literals<readonly ["nylon66", "terylene"]>, Schema.optionalKey<Schema.Struct<{
274
+ readonly byproduct: RichSlot<E>;
275
+ readonly linkage: RichSlot<E>;
276
+ readonly name: Schema.Trimmed;
277
+ }>>>;
278
+ readonly view: Schema.Trimmed;
279
+ }>;
280
+ readonly polymers: Schema.NonEmptyArray<Schema.Literals<readonly ["nylon66", "terylene"]>>;
281
+ }>, "figure">;
282
+ RubberVulcanizationLab: import("#contracts/visual/entry").VisualEntry<Schema.Struct<{
283
+ readonly description: RichSlot<E>;
284
+ readonly footer: Schema.optionalKey<Schema.Codec<readonly [{
285
+ readonly marks?: readonly [{
286
+ readonly type: "bold" | "code" | "italic" | "subscript" | "superscript" | "underline";
287
+ } | {
288
+ readonly attrs: {
289
+ readonly href: string;
290
+ };
291
+ readonly type: "link";
292
+ } | {
293
+ readonly attrs: {
294
+ readonly variant: "success" | "warning" | null;
295
+ };
296
+ readonly type: "highlight";
297
+ }, ...({
298
+ readonly type: "bold" | "code" | "italic" | "subscript" | "superscript" | "underline";
299
+ } | {
300
+ readonly attrs: {
301
+ readonly href: string;
302
+ };
303
+ readonly type: "link";
304
+ } | {
305
+ readonly attrs: {
306
+ readonly variant: "success" | "warning" | null;
307
+ };
308
+ readonly type: "highlight";
309
+ })[]];
310
+ readonly text: string;
311
+ readonly type: "text";
312
+ } | {
313
+ readonly attrs: {
314
+ readonly latex: string;
315
+ };
316
+ readonly marks?: readonly [{
317
+ readonly type: "bold" | "code" | "italic" | "subscript" | "superscript" | "underline";
318
+ } | {
319
+ readonly attrs: {
320
+ readonly href: string;
321
+ };
322
+ readonly type: "link";
323
+ } | {
324
+ readonly attrs: {
325
+ readonly variant: "success" | "warning" | null;
326
+ };
327
+ readonly type: "highlight";
328
+ }, ...({
329
+ readonly type: "bold" | "code" | "italic" | "subscript" | "superscript" | "underline";
330
+ } | {
331
+ readonly attrs: {
332
+ readonly href: string;
333
+ };
334
+ readonly type: "link";
335
+ } | {
336
+ readonly attrs: {
337
+ readonly variant: "success" | "warning" | null;
338
+ };
339
+ readonly type: "highlight";
340
+ })[]];
341
+ readonly type: "mathInline";
342
+ }, ...({
343
+ readonly marks?: readonly [{
344
+ readonly type: "bold" | "code" | "italic" | "subscript" | "superscript" | "underline";
345
+ } | {
346
+ readonly attrs: {
347
+ readonly href: string;
348
+ };
349
+ readonly type: "link";
350
+ } | {
351
+ readonly attrs: {
352
+ readonly variant: "success" | "warning" | null;
353
+ };
354
+ readonly type: "highlight";
355
+ }, ...({
356
+ readonly type: "bold" | "code" | "italic" | "subscript" | "superscript" | "underline";
357
+ } | {
358
+ readonly attrs: {
359
+ readonly href: string;
360
+ };
361
+ readonly type: "link";
362
+ } | {
363
+ readonly attrs: {
364
+ readonly variant: "success" | "warning" | null;
365
+ };
366
+ readonly type: "highlight";
367
+ })[]];
368
+ readonly text: string;
369
+ readonly type: "text";
370
+ } | {
371
+ readonly attrs: {
372
+ readonly latex: string;
373
+ };
374
+ readonly marks?: readonly [{
375
+ readonly type: "bold" | "code" | "italic" | "subscript" | "superscript" | "underline";
376
+ } | {
377
+ readonly attrs: {
378
+ readonly href: string;
379
+ };
380
+ readonly type: "link";
381
+ } | {
382
+ readonly attrs: {
383
+ readonly variant: "success" | "warning" | null;
384
+ };
385
+ readonly type: "highlight";
386
+ }, ...({
387
+ readonly type: "bold" | "code" | "italic" | "subscript" | "superscript" | "underline";
388
+ } | {
389
+ readonly attrs: {
390
+ readonly href: string;
391
+ };
392
+ readonly type: "link";
393
+ } | {
394
+ readonly attrs: {
395
+ readonly variant: "success" | "warning" | null;
396
+ };
397
+ readonly type: "highlight";
398
+ })[]];
399
+ readonly type: "mathInline";
400
+ })[]], E, never, never>>;
401
+ readonly title: RichSlot<E>;
402
+ readonly labels: Schema.Struct<{
403
+ readonly elasticityNote: Schema.optionalKey<RichSlot<E>>;
404
+ readonly heatNote: Schema.optionalKey<RichSlot<E>>;
405
+ readonly parts: Schema.$Record<Schema.Literals<readonly ["isopreneChain", "sulfurCrosslink", "doubleBond", "tensionArrow"]>, Schema.Trimmed>;
406
+ readonly state: Schema.Trimmed;
407
+ readonly states: Schema.$Record<Schema.Literals<readonly ["naturalLatex", "vulcanisedRubber"]>, Schema.optionalKey<Schema.Struct<{
408
+ readonly elasticityNote: RichSlot<E>;
409
+ readonly heatNote: RichSlot<E>;
410
+ readonly name: Schema.Trimmed;
411
+ }>>>;
412
+ readonly stretch: Schema.Trimmed;
413
+ readonly view: Schema.Trimmed;
414
+ }>;
415
+ readonly states: Schema.NonEmptyArray<Schema.Literals<readonly ["naturalLatex", "vulcanisedRubber"]>>;
416
+ readonly stretch: Schema.Struct<{
417
+ readonly max: Schema.Finite;
418
+ readonly min: Schema.Finite;
419
+ readonly value: Schema.Finite;
420
+ }>;
421
+ }>, "figure">;
422
+ };
@@ -0,0 +1,126 @@
1
+ import { Schema } from "effect";
2
+ import { byIds, byPickedIds, cardFields, namesEach, TextSchema, } from "#contracts/visual/card";
3
+ import { answerAt, figure } from "#contracts/visual/entry";
4
+ const PositiveSchema = Schema.Finite.check(Schema.isGreaterThan(0));
5
+ const NonNegativeSchema = Schema.Finite.check(Schema.isGreaterThanOrEqualTo(0));
6
+ const PositiveSliderSchema = Schema.Struct({
7
+ max: PositiveSchema,
8
+ min: PositiveSchema,
9
+ value: PositiveSchema,
10
+ }).check(Schema.makeFilter(({ max, min, value }) => min < max && min <= value && value <= max, {
11
+ message: "Expected a positive slider range whose minimum is below its maximum, with the starting value between them.",
12
+ }));
13
+ const NonNegativeSliderSchema = Schema.Struct({
14
+ max: PositiveSchema,
15
+ min: NonNegativeSchema,
16
+ value: NonNegativeSchema,
17
+ }).check(Schema.makeFilter(({ max, min, value }) => min < max && min <= value && value <= max, {
18
+ message: "Expected a slider range whose minimum is below its maximum, with the starting value between them.",
19
+ }));
20
+ const ADDITION_MONOMERS = [
21
+ "ethene",
22
+ "propene",
23
+ "chloroethene",
24
+ "tetrafluoroethene",
25
+ ];
26
+ const CONDENSATION_POLYMERS = ["nylon66", "terylene"];
27
+ const RUBBER_STATES = ["naturalLatex", "vulcanisedRubber"];
28
+ /**
29
+ * Props of `AdditionPolymerChainLab`: a 3D chain-growth visual showing alkene
30
+ * monomers opening their C=C double bonds to link end-to-end into polyethene,
31
+ * polypropene, PVC, or PTFE with adjustable repeating-unit count. Polymer name
32
+ * and repeat-unit readouts are optional answer state.
33
+ */
34
+ function additionPolymerChainLab(rich) {
35
+ return figure(Schema.Struct({
36
+ ...cardFields(rich),
37
+ chainLength: PositiveSliderSchema,
38
+ labels: Schema.Struct({
39
+ chainLength: TextSchema,
40
+ monomer: TextSchema,
41
+ monomers: byPickedIds(ADDITION_MONOMERS, Schema.Struct({
42
+ name: TextSchema,
43
+ polymerName: rich,
44
+ repeatUnit: rich,
45
+ })),
46
+ parts: byIds(["monomerUnit", "doubleBond", "singleBackbone", "sideGroup"], TextSchema),
47
+ polymerName: Schema.optionalKey(rich),
48
+ repeatUnit: Schema.optionalKey(rich),
49
+ view: TextSchema,
50
+ }),
51
+ monomers: Schema.NonEmptyArray(Schema.Literals(ADDITION_MONOMERS)).check(Schema.isUnique()),
52
+ }).check(Schema.makeFilter(({ labels, monomers }) => namesEach(monomers, labels.monomers), {
53
+ message: "Expected a name, polymer name, and repeat unit for every addition monomer shown, and no other.",
54
+ })), answerAt(["labels", "polymerName"], ["labels", "repeatUnit"]));
55
+ }
56
+ /**
57
+ * Props of `CondensationNylonLab`: a 3D step-growth polymerisation model
58
+ * joining two bifunctional monomers into alternating polyamide (nylon-6,6) or
59
+ * polyester (terylene) chains while eliminating small water molecules.
60
+ * Byproduct and linkage readouts are optional answer state.
61
+ */
62
+ function condensationNylonLab(rich) {
63
+ return figure(Schema.Struct({
64
+ ...cardFields(rich),
65
+ labels: Schema.Struct({
66
+ byproduct: Schema.optionalKey(rich),
67
+ linkage: Schema.optionalKey(rich),
68
+ parts: byIds([
69
+ "monomerA",
70
+ "monomerB",
71
+ "esterOrAmideLink",
72
+ "waterByproduct",
73
+ "polymerChain",
74
+ ], TextSchema),
75
+ polymer: TextSchema,
76
+ polymers: byPickedIds(CONDENSATION_POLYMERS, Schema.Struct({
77
+ byproduct: rich,
78
+ linkage: rich,
79
+ name: TextSchema,
80
+ })),
81
+ view: TextSchema,
82
+ }),
83
+ polymers: Schema.NonEmptyArray(Schema.Literals(CONDENSATION_POLYMERS)).check(Schema.isUnique()),
84
+ }).check(Schema.makeFilter(({ labels, polymers }) => namesEach(polymers, labels.polymers), {
85
+ message: "Expected a name, linkage, and byproduct note for every condensation polymer shown, and no other.",
86
+ })), answerAt(["labels", "byproduct"], ["labels", "linkage"]));
87
+ }
88
+ /**
89
+ * Props of `RubberVulcanizationLab`: a 3D polyisoprene chain bundle comparing
90
+ * uncrosslinked natural latex that slips permanently under stretch against
91
+ * sulfur-crosslinked vulcanised rubber that snaps back elastically. Elasticity
92
+ * and heat-resistance readouts are optional answer state.
93
+ */
94
+ function rubberVulcanizationLab(rich) {
95
+ return figure(Schema.Struct({
96
+ ...cardFields(rich),
97
+ labels: Schema.Struct({
98
+ elasticityNote: Schema.optionalKey(rich),
99
+ heatNote: Schema.optionalKey(rich),
100
+ parts: byIds(["isopreneChain", "sulfurCrosslink", "doubleBond", "tensionArrow"], TextSchema),
101
+ state: TextSchema,
102
+ states: byPickedIds(RUBBER_STATES, Schema.Struct({
103
+ elasticityNote: rich,
104
+ heatNote: rich,
105
+ name: TextSchema,
106
+ })),
107
+ stretch: TextSchema,
108
+ view: TextSchema,
109
+ }),
110
+ states: Schema.NonEmptyArray(Schema.Literals(RUBBER_STATES)).check(Schema.isUnique()),
111
+ stretch: NonNegativeSliderSchema,
112
+ }).check(Schema.makeFilter(({ labels, states }) => namesEach(states, labels.states), {
113
+ message: "Expected a name, elasticity note, and heat note for every rubber state shown, and no other.",
114
+ })), answerAt(["labels", "elasticityNote"], ["labels", "heatNote"]));
115
+ }
116
+ /**
117
+ * Polymer chemistry labs covering addition chain growth, condensation
118
+ * polyamide/polyester synthesis, and sulfur vulcanisation of rubber.
119
+ */
120
+ export function polymerVisuals(rich) {
121
+ return {
122
+ AdditionPolymerChainLab: additionPolymerChainLab(rich),
123
+ CondensationNylonLab: condensationNylonLab(rich),
124
+ RubberVulcanizationLab: rubberVulcanizationLab(rich),
125
+ };
126
+ }