@welldot/core 0.2.3 → 0.4.0-next.20261014.26249fd

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/dist/index.js CHANGED
@@ -9,6 +9,19 @@ var mergeWell = createDefu((obj, key, value) => {
9
9
  });
10
10
  var RFC3339_WITH_OFFSET = /^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(\.\d+)?(Z|[+-]\d{2}:\d{2})$/;
11
11
  var rfc3339 = () => z.string().regex(RFC3339_WITH_OFFSET, "datetime must be RFC 3339 with UTC offset");
12
+ var CALENDAR_DATE = /^\d{4}-\d{2}-\d{2}$/;
13
+ var calendarDate = () => z.string().regex(CALENDAR_DATE, "date must be YYYY-MM-DD");
14
+ var DATE_DURATION = /^P(?=\d)(\d+Y)?(\d+M)?(\d+W)?(\d+D)?$/;
15
+ var dateDuration = () => z.string().regex(DATE_DURATION, "duration must be an ISO 8601 date duration");
16
+ var AttachmentSchema = z.object({
17
+ id: z.string(),
18
+ uri: z.string().url(),
19
+ media_type: z.string(),
20
+ document_type: z.string().optional(),
21
+ filename: z.string().optional(),
22
+ description: z.string().optional(),
23
+ sha256: z.string().optional()
24
+ });
12
25
  var WellIdSchema = z.object({
13
26
  authority: z.string(),
14
27
  id: z.string(),
@@ -52,7 +65,8 @@ var WellScreenSchema = z.object({
52
65
  to: z.number(),
53
66
  type: z.string(),
54
67
  diameter: z.number(),
55
- screen_slot: z.number()
68
+ screen_slot: z.number(),
69
+ slot_type: z.string().optional()
56
70
  });
57
71
  var HoleFillSchema = z.object({
58
72
  from: z.number(),
@@ -66,6 +80,14 @@ var SurfaceCaseSchema = z.object({
66
80
  to: z.number(),
67
81
  diameter: z.number()
68
82
  });
83
+ var CentralizerSchema = z.object({
84
+ from: z.number(),
85
+ to: z.number(),
86
+ spacing: z.number().positive().optional(),
87
+ type: z.string(),
88
+ diameter: z.number().optional(),
89
+ description: z.string().optional()
90
+ });
69
91
  var CementPadSchema = z.object({
70
92
  type: z.string(),
71
93
  width: z.number(),
@@ -122,7 +144,9 @@ var HydrodynamicEventBaseSchema = z.object({
122
144
  sequence: z.number().int().optional(),
123
145
  operator: z.string().optional(),
124
146
  equipment: z.string().optional(),
125
- notes: z.string().optional()
147
+ notes: z.string().optional(),
148
+ corrects: z.string().optional(),
149
+ attachments: z.array(AttachmentSchema).optional()
126
150
  });
127
151
  var SpotMeasurementEventSchema = HydrodynamicEventBaseSchema.extend({
128
152
  type: z.literal("spot_measurement"),
@@ -164,14 +188,13 @@ var HydrodynamicEventSchema = z.discriminatedUnion("type", [
164
188
  AirliftEventSchema,
165
189
  RecoveryOnlyEventSchema
166
190
  ]).or(HydrodynamicEventBaseSchema.passthrough());
167
- var AttachmentSchema = z.object({
168
- id: z.string(),
169
- uri: z.string().url(),
170
- media_type: z.string(),
171
- filename: z.string().optional(),
172
- description: z.string().optional(),
173
- sha256: z.string().optional()
174
- });
191
+ var WellStatusSchema = z.enum([
192
+ "active",
193
+ "maintenance",
194
+ "inactive",
195
+ "decommissioned",
196
+ "abandoned"
197
+ ]);
175
198
  var HistoryLogEntrySchema = z.object({
176
199
  id: z.string(),
177
200
  datetime: rfc3339(),
@@ -180,7 +203,13 @@ var HistoryLogEntrySchema = z.object({
180
203
  description: z.string(),
181
204
  author: z.string().optional(),
182
205
  severity: z.string().optional(),
183
- attachments: z.array(AttachmentSchema).optional()
206
+ attachments: z.array(AttachmentSchema).optional(),
207
+ hydrodynamic_event_ids: z.array(z.string()).optional(),
208
+ sample_ids: z.array(z.string()).optional(),
209
+ maintenance_type: z.string().optional(),
210
+ pump_installation_id: z.string().optional(),
211
+ meter_id: z.string().optional(),
212
+ status: WellStatusSchema.optional()
184
213
  });
185
214
  var AquiferAnalysisSchema = z.object({
186
215
  id: z.string(),
@@ -206,8 +235,297 @@ var AquiferAnalysisSchema = z.object({
206
235
  jacob_b: z.number().optional(),
207
236
  jacob_c: z.number().optional(),
208
237
  well_efficiency_pct: z.number().optional(),
238
+ notes: z.string().optional(),
239
+ attachments: z.array(AttachmentSchema).optional()
240
+ });
241
+ var PumpElectricalSchema = z.object({
242
+ voltage: z.number().nonnegative().optional(),
243
+ phases: z.union([z.literal(1), z.literal(3)]).optional(),
244
+ cable_section: z.number().nonnegative().optional(),
245
+ cable_length: z.number().nonnegative().optional()
246
+ });
247
+ var PumpInstallationSchema = z.object({
248
+ id: z.string(),
249
+ installed_at: rfc3339(),
250
+ removed_at: rfc3339().optional(),
251
+ installed_by: z.string().optional(),
252
+ removed_by: z.string().optional(),
253
+ type: z.string(),
254
+ power_source: z.string().optional(),
255
+ manufacturer: z.string().optional(),
256
+ model: z.string().optional(),
257
+ serial: z.string().optional(),
258
+ intake_depth: z.number().nonnegative().optional(),
259
+ rated_flow_rate: z.number().nonnegative().optional(),
260
+ rated_head: z.number().nonnegative().optional(),
261
+ rated_power: z.number().nonnegative().optional(),
262
+ stages: z.number().int().positive().optional(),
263
+ riser_diameter: z.number().nonnegative().optional(),
264
+ riser_material: z.string().optional(),
265
+ check_valve: z.boolean().optional(),
266
+ electrical: PumpElectricalSchema.optional(),
267
+ notes: z.string().optional(),
268
+ updated_at: rfc3339().optional(),
269
+ attachments: z.array(AttachmentSchema).optional()
270
+ });
271
+ var VolumeLimitSchema = z.object({
272
+ period: z.enum(["daily", "monthly", "annual"]),
273
+ volume: z.number().nonnegative()
274
+ });
275
+ var MonthlyGrantSchema = z.object({
276
+ month: z.number().int().min(1).max(12),
277
+ flow_rate: z.number().nonnegative().optional(),
278
+ daily_operating_time: z.number().nonnegative().optional(),
279
+ days: z.number().int().min(0).max(31).optional()
280
+ });
281
+ var ConditionFulfillmentSchema = z.object({
282
+ id: z.string(),
283
+ datetime: rfc3339(),
284
+ due_date: calendarDate().optional(),
285
+ description: z.string().optional(),
286
+ author: z.string().optional(),
287
+ event_id: z.string().optional(),
288
+ sample_id: z.string().optional(),
289
+ updated_at: rfc3339().optional(),
290
+ attachments: z.array(AttachmentSchema).optional()
291
+ });
292
+ var PermitConditionSchema = z.object({
293
+ id: z.string(),
294
+ description: z.string(),
295
+ category: z.string().optional(),
296
+ first_due: calendarDate().optional(),
297
+ due_after: dateDuration().optional(),
298
+ recurrence: dateDuration().optional(),
299
+ last_due: calendarDate().optional(),
300
+ occurrences: z.number().int().positive().optional(),
301
+ responsible: z.string().optional(),
302
+ fulfillments: z.array(ConditionFulfillmentSchema).optional()
303
+ });
304
+ var PermitAdministrativeStatusSchema = z.enum([
305
+ "requested",
306
+ "granted",
307
+ "suspended",
308
+ "revoked",
309
+ "denied",
310
+ "withdrawn"
311
+ ]);
312
+ var PermitHistoryEntrySchema = z.object({
313
+ id: z.string(),
314
+ date: calendarDate(),
315
+ type: z.string().optional(),
316
+ description: z.string(),
317
+ done: z.boolean().optional(),
318
+ due_date: calendarDate().optional(),
319
+ updated_at: rfc3339().optional(),
320
+ attachments: z.array(AttachmentSchema).optional()
321
+ });
322
+ var PermitSchema = z.object({
323
+ id: z.string(),
324
+ type: z.string(),
325
+ authority: z.string(),
326
+ identifier: z.string().optional(),
327
+ request_identifier: z.string().optional(),
328
+ status: PermitAdministrativeStatusSchema.optional(),
329
+ issued_at: calendarDate().optional(),
330
+ valid_from: calendarDate().optional(),
331
+ valid_until: calendarDate().optional(),
332
+ renewal_requested_at: calendarDate().optional(),
333
+ water_use: z.array(z.string()).optional(),
334
+ flow_rate: z.number().nonnegative().optional(),
335
+ daily_operating_time: z.number().nonnegative().optional(),
336
+ volume_limits: z.array(VolumeLimitSchema).optional(),
337
+ monthly_schedule: z.array(MonthlyGrantSchema).optional(),
338
+ conditions: z.array(PermitConditionSchema).optional(),
339
+ history: z.array(PermitHistoryEntrySchema).optional(),
340
+ supersedes: z.string().optional(),
341
+ notes: z.string().optional(),
342
+ updated_at: rfc3339().optional(),
343
+ attachments: z.array(AttachmentSchema).optional()
344
+ });
345
+ var MeterSchema = z.object({
346
+ id: z.string(),
347
+ installed_at: rfc3339(),
348
+ removed_at: rfc3339().optional(),
349
+ installed_by: z.string().optional(),
350
+ removed_by: z.string().optional(),
351
+ type: z.string().optional(),
352
+ manufacturer: z.string().optional(),
353
+ model: z.string().optional(),
354
+ serial: z.string().optional(),
355
+ nominal_diameter: z.number().nonnegative().optional(),
356
+ max_reading: z.number().positive().optional(),
357
+ notes: z.string().optional(),
358
+ updated_at: rfc3339().optional(),
359
+ attachments: z.array(AttachmentSchema).optional()
360
+ });
361
+ var ProductionEntryBaseSchema = z.object({
362
+ id: z.string(),
363
+ type: z.string(),
364
+ corrects: z.string().optional(),
365
+ sequence: z.number().int().optional(),
209
366
  notes: z.string().optional()
210
367
  });
368
+ var MeterReadingSchema = ProductionEntryBaseSchema.extend({
369
+ type: z.literal("meter_reading"),
370
+ datetime: rfc3339(),
371
+ meter_id: z.string(),
372
+ reading: z.number().nonnegative(),
373
+ source: z.string().optional()
374
+ });
375
+ var EstimatedVolumeSchema = ProductionEntryBaseSchema.extend({
376
+ type: z.literal("estimated_volume"),
377
+ period_start: rfc3339(),
378
+ period_end: rfc3339(),
379
+ volume: z.number().nonnegative(),
380
+ method: z.string().optional()
381
+ });
382
+ var PRODUCTION_TYPES = ["meter_reading", "estimated_volume"];
383
+ var ProductionEntrySchema = z.discriminatedUnion("type", [MeterReadingSchema, EstimatedVolumeSchema]).or(
384
+ ProductionEntryBaseSchema.passthrough().refine(
385
+ (e) => !PRODUCTION_TYPES.includes(e.type),
386
+ { message: "malformed production entry" }
387
+ )
388
+ );
389
+ var OperatingRegimeSchema = z.object({
390
+ id: z.string(),
391
+ effective_from: rfc3339(),
392
+ flow_rate: z.number().nonnegative().optional(),
393
+ daily_operating_time: z.number().min(0).max(24).optional(),
394
+ days_per_week: z.number().int().min(1).max(7).optional(),
395
+ notes: z.string().optional(),
396
+ updated_at: rfc3339().optional()
397
+ });
398
+ var PARAMETER_VOCABULARY = /^(welldot|cas|x-.+)$/;
399
+ var ParameterSchema = z.object({
400
+ code: z.string().min(1),
401
+ vocabulary: z.string().regex(PARAMETER_VOCABULARY, "vocabulary must be welldot, cas or x-\u2026")
402
+ });
403
+ var TimeResolutionSchema = z.literal("day");
404
+ var SamplingPointSchema = z.object({
405
+ type: z.string(),
406
+ depth: z.number().nonnegative().optional(),
407
+ depth_precision: z.number().nonnegative().optional(),
408
+ from: z.number().nonnegative().optional(),
409
+ to: z.number().nonnegative().optional(),
410
+ device: z.string().optional(),
411
+ pump_installation_id: z.string().optional()
412
+ }).refine(
413
+ (p) => !(p.depth !== void 0 && (p.from !== void 0 || p.to !== void 0)),
414
+ { message: "depth and from/to are mutually exclusive" }
415
+ );
416
+ var PurgeReadingSchema = z.object({
417
+ elapsed: z.number().nonnegative(),
418
+ parameter: ParameterSchema,
419
+ value: z.number()
420
+ });
421
+ var PurgeSchema = z.object({
422
+ duration: z.number().nonnegative().optional(),
423
+ volume: z.number().nonnegative().optional(),
424
+ flow_rate: z.number().nonnegative().optional(),
425
+ stabilized: z.boolean().optional(),
426
+ readings: z.array(PurgeReadingSchema).optional()
427
+ });
428
+ var LaboratorySchema = z.object({
429
+ name: z.string(),
430
+ accreditation: z.string().optional(),
431
+ report_number: z.string().optional(),
432
+ batch_id: z.string().optional(),
433
+ sample_id: z.string().optional(),
434
+ received_at: rfc3339().optional(),
435
+ received_at_resolution: TimeResolutionSchema.optional(),
436
+ received_temperature: z.number().optional()
437
+ });
438
+ var FiltrationSchema = z.object({
439
+ pore_size: z.number().positive().optional(),
440
+ location: z.enum(["field", "lab"]).optional()
441
+ });
442
+ var ResultValidationSchema = z.object({
443
+ status: z.enum(["unvalidated", "validated", "qualified", "rejected"]),
444
+ qualifier: z.string().optional(),
445
+ guideline: z.string().optional(),
446
+ validated_by: z.string().optional(),
447
+ validated_at: rfc3339().optional()
448
+ });
449
+ var ResultQualifierSchema = z.enum([
450
+ "<",
451
+ ">",
452
+ "not_detected",
453
+ "estimated"
454
+ ]);
455
+ var WaterQualityResultSchema = z.object({
456
+ parameter: ParameterSchema,
457
+ value: z.number().optional(),
458
+ presence: z.boolean().optional(),
459
+ text: z.string().optional(),
460
+ qualifier: ResultQualifierSchema.optional(),
461
+ unit: z.string().min(1).optional(),
462
+ detection_limit: z.number().nonnegative().optional(),
463
+ quantification_limit: z.number().nonnegative().optional(),
464
+ value_precision: z.number().nonnegative().optional(),
465
+ fraction: z.enum(["total", "dissolved", "suspended"]).optional(),
466
+ filtration: FiltrationSchema.optional(),
467
+ measured_in: z.enum(["field", "lab"]).optional(),
468
+ method: z.string().optional(),
469
+ analyzed_at: rfc3339().optional(),
470
+ analyzed_at_resolution: TimeResolutionSchema.optional(),
471
+ lab_flags: z.array(z.string()).optional(),
472
+ validation: ResultValidationSchema.optional(),
473
+ notes: z.string().optional()
474
+ }).superRefine((r, ctx) => {
475
+ const forms = [r.value, r.presence, r.text].filter(
476
+ (v) => v !== void 0
477
+ ).length;
478
+ if (r.qualifier === "not_detected") {
479
+ if (forms !== 0)
480
+ ctx.addIssue({
481
+ code: z.ZodIssueCode.custom,
482
+ message: "not_detected results carry no value form"
483
+ });
484
+ } else if (forms !== 1) {
485
+ ctx.addIssue({
486
+ code: z.ZodIssueCode.custom,
487
+ message: "result must have exactly one of value, presence or text"
488
+ });
489
+ } else if (r.qualifier !== void 0 && r.value === void 0) {
490
+ ctx.addIssue({
491
+ code: z.ZodIssueCode.custom,
492
+ message: `qualifier ${r.qualifier} requires a numeric value`
493
+ });
494
+ }
495
+ const custom = r.parameter.vocabulary.startsWith("x-");
496
+ if (custom && r.unit === void 0)
497
+ ctx.addIssue({
498
+ code: z.ZodIssueCode.custom,
499
+ path: ["unit"],
500
+ message: "unit is required for x- vocabularies"
501
+ });
502
+ if (!custom && r.unit !== void 0)
503
+ ctx.addIssue({
504
+ code: z.ZodIssueCode.custom,
505
+ path: ["unit"],
506
+ message: "unit is forbidden for welldot and cas parameters"
507
+ });
508
+ });
509
+ var WaterSampleSchema = z.object({
510
+ id: z.string(),
511
+ datetime: rfc3339(),
512
+ sample_type: z.string(),
513
+ parent_sample_id: z.string().optional(),
514
+ sequence: z.number().int().optional(),
515
+ campaign: z.string().optional(),
516
+ sampling_method: z.string().optional(),
517
+ sampling_point: SamplingPointSchema.optional(),
518
+ purge: PurgeSchema.optional(),
519
+ static_level_event_id: z.string().optional(),
520
+ collected_by: z.string().optional(),
521
+ preservation: z.string().optional(),
522
+ chain_of_custody: z.string().optional(),
523
+ laboratory: LaboratorySchema.optional(),
524
+ corrects: z.string().optional(),
525
+ notes: z.string().optional(),
526
+ attachments: z.array(AttachmentSchema).optional(),
527
+ results: z.array(WaterQualityResultSchema).min(1)
528
+ });
211
529
  var WellSchema = z.object({
212
530
  version: z.number().int(),
213
531
  "@context": z.union([z.string(), z.array(z.unknown()), z.record(z.unknown())]).optional(),
@@ -219,9 +537,10 @@ var WellSchema = z.object({
219
537
  })
220
538
  ).optional(),
221
539
  well_type: z.string().optional(),
540
+ well_purpose: z.array(z.string()).optional(),
222
541
  name: z.string().optional(),
223
542
  well_driller: z.string().optional(),
224
- construction_date: z.string().regex(/^\d{4}-\d{2}-\d{2}$/, "construction_date must be YYYY-MM-DD").optional(),
543
+ construction_date: z.string().regex(CALENDAR_DATE, "construction_date must be YYYY-MM-DD").optional(),
225
544
  obs: z.string().optional(),
226
545
  lat: z.number().optional(),
227
546
  lng: z.number().optional(),
@@ -233,13 +552,21 @@ var WellSchema = z.object({
233
552
  well_screen: z.array(WellScreenSchema),
234
553
  surface_case: z.array(SurfaceCaseSchema),
235
554
  hole_fill: z.array(HoleFillSchema),
555
+ centralizers: z.array(CentralizerSchema).optional(),
236
556
  cement_pad: CementPadSchema.optional(),
237
557
  lithology: z.array(LithologySchema),
238
558
  fractures: z.array(FractureSchema),
239
559
  caves: z.array(CaveSchema),
240
560
  hydrodynamic_events: z.array(HydrodynamicEventSchema).optional(),
241
561
  aquifer_analysis: z.array(AquiferAnalysisSchema).optional(),
242
- history_logs: z.array(HistoryLogEntrySchema).optional()
562
+ history_logs: z.array(HistoryLogEntrySchema).optional(),
563
+ attachments: z.array(AttachmentSchema).optional(),
564
+ pump_installations: z.array(PumpInstallationSchema).optional(),
565
+ permits: z.array(PermitSchema).optional(),
566
+ meters: z.array(MeterSchema).optional(),
567
+ production: z.array(ProductionEntrySchema).optional(),
568
+ operating_regime: z.array(OperatingRegimeSchema).optional(),
569
+ water_samples: z.array(WaterSampleSchema).optional()
243
570
  }).passthrough();
244
571
  function normalizeV1Fields(raw) {
245
572
  const out = { ...raw };
@@ -332,8 +659,37 @@ var SECTION_KEYS = [
332
659
  "constructive",
333
660
  "geology",
334
661
  "hydrodynamic",
335
- "history"
662
+ "history",
663
+ "operation",
664
+ "water_quality"
336
665
  ];
666
+ var VISIBILITY_TREE = {
667
+ general: ["identification", "location", "obs", "attachments"],
668
+ constructive: [
669
+ "bore_hole",
670
+ "surface_case",
671
+ "well_case",
672
+ "reduction",
673
+ "well_screen",
674
+ "hole_fill",
675
+ "centralizers",
676
+ "cement_pad"
677
+ ],
678
+ geology: ["lithology", "fractures", "caves"],
679
+ hydrodynamic: ["hydrodynamic_events", "aquifer_analysis"],
680
+ history: [],
681
+ operation: [
682
+ "pump_installations",
683
+ "meters",
684
+ "operating_regime",
685
+ "production",
686
+ "permits"
687
+ ],
688
+ water_quality: []
689
+ };
690
+ var VISIBILITY_LEAF_KEYS = SECTION_KEYS.flatMap(
691
+ (section) => VISIBILITY_TREE[section].length ? VISIBILITY_TREE[section] : [section]
692
+ );
337
693
  var EMPTY_WELL = {
338
694
  version: 2,
339
695
  bore_hole: [],
@@ -445,6 +801,9 @@ function decodeV2Well(raw) {
445
801
  profiles: raw.profiles
446
802
  },
447
803
  ...raw.well_type !== void 0 && { well_type: raw.well_type },
804
+ ...raw.well_purpose !== void 0 && {
805
+ well_purpose: raw.well_purpose
806
+ },
448
807
  ...raw.name !== void 0 && { name: raw.name },
449
808
  ...raw.well_driller !== void 0 && {
450
809
  well_driller: raw.well_driller
@@ -462,6 +821,9 @@ function decodeV2Well(raw) {
462
821
  well_screen: normalizeWellScreens(rawScreens),
463
822
  surface_case: raw.surface_case ?? [],
464
823
  hole_fill: raw.hole_fill ?? [],
824
+ ...raw.centralizers !== void 0 && {
825
+ centralizers: raw.centralizers
826
+ },
465
827
  ...raw.cement_pad ? { cement_pad: raw.cement_pad } : {},
466
828
  lithology: normalizeLithology(raw.lithology ?? []),
467
829
  fractures: raw.fractures ?? [],
@@ -474,6 +836,27 @@ function decodeV2Well(raw) {
474
836
  },
475
837
  ...raw.history_logs !== void 0 && {
476
838
  history_logs: raw.history_logs
839
+ },
840
+ ...raw.attachments !== void 0 && {
841
+ attachments: raw.attachments
842
+ },
843
+ ...raw.pump_installations !== void 0 && {
844
+ pump_installations: raw.pump_installations
845
+ },
846
+ ...raw.permits !== void 0 && {
847
+ permits: raw.permits
848
+ },
849
+ ...raw.meters !== void 0 && {
850
+ meters: raw.meters
851
+ },
852
+ ...raw.production !== void 0 && {
853
+ production: raw.production
854
+ },
855
+ ...raw.operating_regime !== void 0 && {
856
+ operating_regime: raw.operating_regime
857
+ },
858
+ ...raw.water_samples !== void 0 && {
859
+ water_samples: raw.water_samples
477
860
  }
478
861
  };
479
862
  return mergeWell(decoded, raw);
@@ -523,6 +906,9 @@ function serializeWell(well) {
523
906
  ...well.location !== void 0 && { location: well.location },
524
907
  ...well.profiles !== void 0 && { profiles: well.profiles },
525
908
  ...well.well_type !== void 0 && { well_type: well.well_type },
909
+ ...well.well_purpose !== void 0 && {
910
+ well_purpose: well.well_purpose
911
+ },
526
912
  ...well.name !== void 0 && { name: well.name },
527
913
  ...well.well_driller !== void 0 && { well_driller: well.well_driller },
528
914
  ...well.construction_date !== void 0 && {
@@ -536,6 +922,9 @@ function serializeWell(well) {
536
922
  well_screen: well.well_screen,
537
923
  surface_case: well.surface_case,
538
924
  hole_fill: well.hole_fill,
925
+ ...well.centralizers !== void 0 && {
926
+ centralizers: well.centralizers
927
+ },
539
928
  ...well.cement_pad && { cement_pad: well.cement_pad },
540
929
  lithology: well.lithology,
541
930
  fractures: well.fractures,
@@ -546,7 +935,20 @@ function serializeWell(well) {
546
935
  ...well.aquifer_analysis !== void 0 && {
547
936
  aquifer_analysis: well.aquifer_analysis
548
937
  },
549
- ...well.history_logs !== void 0 && { history_logs: well.history_logs }
938
+ ...well.history_logs !== void 0 && { history_logs: well.history_logs },
939
+ ...well.attachments !== void 0 && { attachments: well.attachments },
940
+ ...well.pump_installations !== void 0 && {
941
+ pump_installations: well.pump_installations
942
+ },
943
+ ...well.permits !== void 0 && { permits: well.permits },
944
+ ...well.meters !== void 0 && { meters: well.meters },
945
+ ...well.production !== void 0 && { production: well.production },
946
+ ...well.operating_regime !== void 0 && {
947
+ operating_regime: well.operating_regime
948
+ },
949
+ ...well.water_samples !== void 0 && {
950
+ water_samples: well.water_samples
951
+ }
550
952
  };
551
953
  return JSON.stringify(payload);
552
954
  }
@@ -557,41 +959,48 @@ function isWellEmpty(well) {
557
959
  return well.lithology?.length === 0 && well.fractures?.length === 0 && well.caves?.length === 0 && well.bore_hole?.length === 0 && well.hole_fill?.length === 0 && well.well_case?.length === 0 && well.well_screen?.length === 0;
558
960
  }
559
961
  function redactWell(well, visibility) {
962
+ const v = visibility;
560
963
  const redacted = { ...well };
561
- if (!visibility.general) {
964
+ const sectionOf = (field) => SECTION_KEYS.find((s) => VISIBILITY_TREE[s].includes(field));
965
+ const hidden = (key) => v[key] === false || !SECTION_KEYS.includes(key) && v[sectionOf(key)] === false;
966
+ const sectionHidden = (section) => v[section] === false || VISIBILITY_TREE[section].length > 0 && VISIBILITY_TREE[section].every((f) => v[f] === false);
967
+ if (hidden("identification")) {
562
968
  delete redacted.well_id;
563
- delete redacted.location;
564
969
  delete redacted.well_type;
970
+ delete redacted.well_purpose;
565
971
  delete redacted.name;
566
972
  delete redacted.well_driller;
567
973
  delete redacted.construction_date;
568
- delete redacted.obs;
974
+ }
975
+ if (hidden("location")) {
976
+ delete redacted.location;
569
977
  delete redacted.lat;
570
978
  delete redacted.lng;
571
979
  delete redacted.elevation;
572
980
  }
573
- if (!visibility.constructive) {
574
- redacted.bore_hole = [];
575
- redacted.well_case = [];
576
- redacted.reduction = [];
577
- redacted.well_screen = [];
578
- redacted.surface_case = [];
579
- redacted.hole_fill = [];
580
- delete redacted.cement_pad;
581
- delete redacted.well_depth;
582
- }
583
- if (!visibility.geology) {
584
- redacted.lithology = [];
585
- redacted.fractures = [];
586
- redacted.caves = [];
587
- }
588
- if (!visibility.hydrodynamic) {
589
- redacted.hydrodynamic_events = [];
590
- redacted.aquifer_analysis = [];
591
- }
592
- if (!visibility.history) {
593
- redacted.history_logs = [];
594
- }
981
+ if (hidden("obs")) delete redacted.obs;
982
+ if (hidden("attachments")) delete redacted.attachments;
983
+ if (hidden("bore_hole")) redacted.bore_hole = [];
984
+ if (hidden("surface_case")) redacted.surface_case = [];
985
+ if (hidden("well_case")) redacted.well_case = [];
986
+ if (hidden("reduction")) redacted.reduction = [];
987
+ if (hidden("well_screen")) redacted.well_screen = [];
988
+ if (hidden("hole_fill")) redacted.hole_fill = [];
989
+ if (hidden("centralizers")) delete redacted.centralizers;
990
+ if (hidden("cement_pad")) delete redacted.cement_pad;
991
+ if (sectionHidden("constructive")) delete redacted.well_depth;
992
+ if (hidden("lithology")) redacted.lithology = [];
993
+ if (hidden("fractures")) redacted.fractures = [];
994
+ if (hidden("caves")) redacted.caves = [];
995
+ if (hidden("hydrodynamic_events")) redacted.hydrodynamic_events = [];
996
+ if (hidden("aquifer_analysis")) redacted.aquifer_analysis = [];
997
+ if (hidden("history")) redacted.history_logs = [];
998
+ if (hidden("pump_installations")) delete redacted.pump_installations;
999
+ if (hidden("meters")) delete redacted.meters;
1000
+ if (hidden("operating_regime")) delete redacted.operating_regime;
1001
+ if (hidden("production")) delete redacted.production;
1002
+ if (hidden("permits")) delete redacted.permits;
1003
+ if (hidden("water_quality")) delete redacted.water_samples;
595
1004
  return redacted;
596
1005
  }
597
1006
  function deserializeWell(jsonString) {
@@ -945,6 +1354,1521 @@ var FGDC_TEXTURES_OPTIONS = [
945
1354
  { code: 733, label: "Ore" }
946
1355
  ];
947
1356
 
1357
+ // src/vocab/waterQuality.limits.ts
1358
+ var NEPHELOMETRIC_TURBIDITY_CODES = [
1359
+ "turbidity",
1360
+ "turbidity_ntu",
1361
+ "turbidity_fnu"
1362
+ ];
1363
+ var WHO_GDWQ_2022 = {
1364
+ id: "who_gdwq_2022",
1365
+ name: "WHO Guidelines for Drinking-water Quality (2022)",
1366
+ jurisdiction: "INT",
1367
+ source: "WHO, Guidelines for drinking-water quality: 4th edition incorporating the first and second addenda, 2022",
1368
+ limits: [
1369
+ { code: "antimony", max: 0.02, basis: "health" },
1370
+ { code: "arsenic", max: 0.01, basis: "health", note: "provisional" },
1371
+ { code: "barium", max: 1.3, basis: "health" },
1372
+ { code: "boron", max: 2.4, basis: "health" },
1373
+ { code: "cadmium", max: 3e-3, basis: "health" },
1374
+ { code: "chromium", max: 0.05, basis: "health", note: "provisional" },
1375
+ { code: "copper", max: 2, basis: "health" },
1376
+ { code: "fluoride", max: 1.5, basis: "health" },
1377
+ { code: "lead", max: 0.01, basis: "health", note: "provisional" },
1378
+ { code: "manganese", max: 0.08, basis: "health", note: "provisional" },
1379
+ { code: "mercury", max: 6e-3, basis: "health", note: "inorganic mercury" },
1380
+ { code: "nickel", max: 0.07, basis: "health" },
1381
+ { code: "nitrate_as_no3", max: 50, basis: "health" },
1382
+ { code: "nitrite_as_no2", max: 3, basis: "health" },
1383
+ { code: "selenium", max: 0.04, basis: "health", note: "provisional" },
1384
+ { code: "uranium", max: 0.03, basis: "health", note: "provisional" },
1385
+ { code: "e_coli", presence_allowed: false, basis: "health" },
1386
+ {
1387
+ code: "thermotolerant_coliforms",
1388
+ presence_allowed: false,
1389
+ basis: "health"
1390
+ },
1391
+ { code: "gross_alpha", max: 0.5, basis: "health", note: "screening level" },
1392
+ { code: "gross_beta", max: 1, basis: "health", note: "screening level" }
1393
+ ]
1394
+ };
1395
+ var BR_GM_MS_888_2021 = {
1396
+ id: "br_gm_ms_888_2021",
1397
+ name: "Brasil \u2014 Portaria GM/MS 888/2021",
1398
+ jurisdiction: "BR",
1399
+ source: "Minist\xE9rio da Sa\xFAde, Portaria GM/MS n\xBA 888, de 4 de maio de 2021",
1400
+ limits: [
1401
+ // Inorganic substances (health)
1402
+ { code: "antimony", max: 6e-3, basis: "health" },
1403
+ { code: "arsenic", max: 0.01, basis: "health" },
1404
+ { code: "barium", max: 0.7, basis: "health" },
1405
+ { code: "cadmium", max: 3e-3, basis: "health" },
1406
+ { code: "lead", max: 0.01, basis: "health" },
1407
+ { code: "cyanide_total_as_cn", max: 0.07, basis: "health" },
1408
+ { code: "copper", max: 2, basis: "health" },
1409
+ { code: "chromium", max: 0.05, basis: "health" },
1410
+ { code: "fluoride", max: 1.5, basis: "health" },
1411
+ { code: "mercury", max: 1e-3, basis: "health" },
1412
+ { code: "nickel", max: 0.07, basis: "health" },
1413
+ { code: "nitrate_as_n", max: 10, basis: "health" },
1414
+ { code: "nitrite_as_n", max: 1, basis: "health" },
1415
+ { code: "selenium", max: 0.04, basis: "health" },
1416
+ { code: "uranium", max: 0.03, basis: "health" },
1417
+ // Organoleptic standard
1418
+ { code: "aluminum", max: 0.2, basis: "aesthetic" },
1419
+ { code: "ammonia_as_nh3", max: 1.2, basis: "aesthetic" },
1420
+ { code: "chloride", max: 250, basis: "aesthetic" },
1421
+ { code: "apparent_color", max: 15, basis: "aesthetic" },
1422
+ { code: "hardness_total_as_caco3", max: 300, basis: "aesthetic" },
1423
+ { code: "iron", max: 0.3, basis: "aesthetic" },
1424
+ { code: "manganese", max: 0.1, basis: "aesthetic" },
1425
+ { code: "sodium", max: 200, basis: "aesthetic" },
1426
+ { code: "total_dissolved_solids", max: 500, basis: "aesthetic" },
1427
+ { code: "sulfate", max: 250, basis: "aesthetic" },
1428
+ {
1429
+ code: "turbidity",
1430
+ max: 5,
1431
+ basis: "aesthetic",
1432
+ note: "organoleptic standard (uT)"
1433
+ },
1434
+ // Operational
1435
+ {
1436
+ code: "ph",
1437
+ min: 6,
1438
+ max: 9,
1439
+ basis: "operational",
1440
+ note: "recommended range"
1441
+ },
1442
+ {
1443
+ code: "free_chlorine",
1444
+ min: 0.2,
1445
+ max: 5,
1446
+ basis: "operational",
1447
+ note: "residual in the distribution system"
1448
+ },
1449
+ // Microbiological
1450
+ { code: "e_coli", presence_allowed: false, basis: "health" },
1451
+ {
1452
+ code: "total_coliforms",
1453
+ presence_allowed: false,
1454
+ basis: "indicator",
1455
+ note: "tolerances apply by system size and sampling point"
1456
+ },
1457
+ // Radioactivity
1458
+ { code: "gross_alpha", max: 0.5, basis: "health", note: "screening level" },
1459
+ { code: "gross_beta", max: 1, basis: "health", note: "screening level" },
1460
+ { code: "radium_226", max: 1, basis: "health" },
1461
+ { code: "radium_228", max: 0.1, basis: "health" }
1462
+ ]
1463
+ };
1464
+ var EU_2020_2184 = {
1465
+ id: "eu_2020_2184",
1466
+ name: "EU Drinking Water Directive 2020/2184",
1467
+ jurisdiction: "EU",
1468
+ source: "Directive (EU) 2020/2184 of the European Parliament and of the Council, Annex I",
1469
+ limits: [
1470
+ // Part A — microbiological
1471
+ { code: "e_coli", presence_allowed: false, basis: "health" },
1472
+ // Part B — chemical
1473
+ { code: "antimony", max: 0.01, basis: "health" },
1474
+ { code: "arsenic", max: 0.01, basis: "health" },
1475
+ {
1476
+ code: "boron",
1477
+ max: 1.5,
1478
+ basis: "health",
1479
+ note: "2.4 mg/L where desalinated water is the predominant source"
1480
+ },
1481
+ { code: "cadmium", max: 5e-3, basis: "health" },
1482
+ {
1483
+ code: "chromium",
1484
+ max: 0.05,
1485
+ basis: "health",
1486
+ note: "0.025 mg/L from 12 January 2036"
1487
+ },
1488
+ { code: "copper", max: 2, basis: "health" },
1489
+ { code: "cyanide_total_as_cn", max: 0.05, basis: "health" },
1490
+ { code: "fluoride", max: 1.5, basis: "health" },
1491
+ {
1492
+ code: "lead",
1493
+ max: 0.01,
1494
+ basis: "health",
1495
+ note: "0.005 mg/L from 12 January 2036"
1496
+ },
1497
+ { code: "mercury", max: 1e-3, basis: "health" },
1498
+ { code: "nickel", max: 0.02, basis: "health" },
1499
+ { code: "nitrate_as_no3", max: 50, basis: "health" },
1500
+ { code: "nitrite_as_no2", max: 0.5, basis: "health", note: "at the tap" },
1501
+ { code: "selenium", max: 0.02, basis: "health" },
1502
+ { code: "uranium", max: 0.03, basis: "health" },
1503
+ // Part C — indicator parameters
1504
+ { code: "aluminum", max: 0.2, basis: "indicator" },
1505
+ { code: "chloride", max: 250, basis: "indicator" },
1506
+ {
1507
+ code: "specific_conductance",
1508
+ max: 2500,
1509
+ basis: "indicator",
1510
+ note: "directive value is at 20 \xB0C"
1511
+ },
1512
+ { code: "ph", min: 6.5, max: 9.5, basis: "indicator" },
1513
+ { code: "iron", max: 0.2, basis: "indicator" },
1514
+ { code: "manganese", max: 0.05, basis: "indicator" },
1515
+ { code: "sodium", max: 200, basis: "indicator" },
1516
+ { code: "sulfate", max: 250, basis: "indicator" },
1517
+ { code: "total_coliforms", presence_allowed: false, basis: "indicator" }
1518
+ ]
1519
+ };
1520
+ var WATER_QUALITY_LIMIT_SETS = [
1521
+ WHO_GDWQ_2022,
1522
+ BR_GM_MS_888_2021,
1523
+ EU_2020_2184
1524
+ ];
1525
+ function getLimitSet(id) {
1526
+ return WATER_QUALITY_LIMIT_SETS.find((s) => s.id === id);
1527
+ }
1528
+
1529
+ // src/utils/language.utils.ts
1530
+ function parseLanguageTextJson(value) {
1531
+ const trimmed = value.trim();
1532
+ if (!trimmed.startsWith("{") || !trimmed.endsWith("}")) return void 0;
1533
+ let parsed;
1534
+ try {
1535
+ parsed = JSON.parse(trimmed);
1536
+ } catch {
1537
+ return void 0;
1538
+ }
1539
+ if (typeof parsed !== "object" || parsed === null || Array.isArray(parsed)) {
1540
+ return void 0;
1541
+ }
1542
+ const entries = Object.entries(parsed).filter(
1543
+ (entry) => typeof entry[1] === "string" && entry[1].trim() !== ""
1544
+ );
1545
+ return Object.fromEntries(entries);
1546
+ }
1547
+ function resolveLanguageText(text, locale, fallback = "en") {
1548
+ if (text == null) return "";
1549
+ const labels = typeof text === "string" ? parseLanguageTextJson(text) : text;
1550
+ if (labels === void 0) return text;
1551
+ const base = locale.split("-")[0];
1552
+ const usable = (key) => {
1553
+ const value = labels[key];
1554
+ return typeof value === "string" && value.trim() !== "" ? value : void 0;
1555
+ };
1556
+ return usable(locale) ?? usable(base) ?? usable(fallback) ?? Object.keys(labels).map(usable).find((v) => v !== void 0) ?? "";
1557
+ }
1558
+
1559
+ // src/vocab/waterQuality.vocab.ts
1560
+ var WATER_QUALITY_VOCABULARY_VERSION = "1.0.0";
1561
+ var WATER_QUALITY_UNITS = {
1562
+ mg_l: { symbol: "mg/L", ucum: "mg/L" },
1563
+ us_cm: { symbol: "\xB5S/cm", ucum: "uS/cm" },
1564
+ celsius: { symbol: "\xB0C", ucum: "Cel" },
1565
+ mv: { symbol: "mV", ucum: "mV" },
1566
+ ph: { symbol: "", ucum: "[pH]" },
1567
+ ftu: { symbol: "FTU" },
1568
+ ntu: { symbol: "NTU" },
1569
+ fnu: { symbol: "FNU" },
1570
+ fau: { symbol: "FAU" },
1571
+ hazen: { symbol: "uH" },
1572
+ mpn_100ml: { symbol: "MPN/100 mL", ucum: "{MPN}/(100.mL)" },
1573
+ cfu_100ml: { symbol: "CFU/100 mL", ucum: "{CFU}/(100.mL)" },
1574
+ cfu_ml: { symbol: "CFU/mL", ucum: "{CFU}/mL" },
1575
+ bq_l: { symbol: "Bq/L", ucum: "Bq/L" },
1576
+ none: { symbol: "" }
1577
+ };
1578
+ var U = WATER_QUALITY_UNITS;
1579
+ function defineParameter(code, group, label, pt, unit, extra = {}) {
1580
+ return {
1581
+ code,
1582
+ group,
1583
+ label,
1584
+ labels: { pt },
1585
+ unit,
1586
+ form: extra.form ?? "value",
1587
+ ...extra.cas !== void 0 && { cas: extra.cas },
1588
+ ...extra.molar_mass !== void 0 && { molar_mass: extra.molar_mass },
1589
+ ...extra.charge !== void 0 && { charge: extra.charge }
1590
+ };
1591
+ }
1592
+ var WATER_QUALITY_PARAMETERS = [
1593
+ // Physical / field
1594
+ defineParameter(
1595
+ "temperature",
1596
+ "physical",
1597
+ "Temperature",
1598
+ "Temperatura",
1599
+ U.celsius
1600
+ ),
1601
+ defineParameter("ph", "physical", "pH", "pH", U.ph),
1602
+ defineParameter(
1603
+ "specific_conductance",
1604
+ "physical",
1605
+ "Specific conductance at 25 \xB0C",
1606
+ "Condutividade el\xE9trica a 25 \xB0C",
1607
+ U.us_cm
1608
+ ),
1609
+ defineParameter(
1610
+ "conductivity_uncompensated",
1611
+ "physical",
1612
+ "Electrical conductivity, uncompensated",
1613
+ "Condutividade sem compensa\xE7\xE3o",
1614
+ U.us_cm
1615
+ ),
1616
+ defineParameter(
1617
+ "dissolved_oxygen",
1618
+ "physical",
1619
+ "Dissolved oxygen",
1620
+ "Oxig\xEAnio dissolvido",
1621
+ U.mg_l
1622
+ ),
1623
+ defineParameter(
1624
+ "orp",
1625
+ "physical",
1626
+ "Oxidation-reduction potential vs. reference electrode",
1627
+ "Potencial redox vs. eletrodo de refer\xEAncia",
1628
+ U.mv
1629
+ ),
1630
+ defineParameter(
1631
+ "eh",
1632
+ "physical",
1633
+ "Redox potential vs. SHE",
1634
+ "Potencial redox corrigido vs. EPH",
1635
+ U.mv
1636
+ ),
1637
+ defineParameter(
1638
+ "turbidity",
1639
+ "physical",
1640
+ "Turbidity, formazin, method unspecified",
1641
+ "Turbidez, formazina sem m\xE9todo identificado",
1642
+ U.ftu
1643
+ ),
1644
+ defineParameter(
1645
+ "turbidity_ntu",
1646
+ "physical",
1647
+ "Turbidity, nephelometric white light",
1648
+ "Turbidez nefelom\xE9trica, luz branca",
1649
+ U.ntu
1650
+ ),
1651
+ defineParameter(
1652
+ "turbidity_fnu",
1653
+ "physical",
1654
+ "Turbidity, nephelometric infrared (ISO 7027)",
1655
+ "Turbidez nefelom\xE9trica, infravermelho",
1656
+ U.fnu
1657
+ ),
1658
+ defineParameter(
1659
+ "turbidity_fau",
1660
+ "physical",
1661
+ "Turbidity, attenuation (ISO 7027)",
1662
+ "Turbidez por atenua\xE7\xE3o",
1663
+ U.fau
1664
+ ),
1665
+ defineParameter(
1666
+ "apparent_color",
1667
+ "physical",
1668
+ "Apparent color",
1669
+ "Cor aparente",
1670
+ U.hazen
1671
+ ),
1672
+ defineParameter(
1673
+ "true_color",
1674
+ "physical",
1675
+ "True color",
1676
+ "Cor verdadeira",
1677
+ U.hazen
1678
+ ),
1679
+ defineParameter("odor", "physical", "Odor", "Odor", U.none, { form: "text" }),
1680
+ defineParameter("taste", "physical", "Taste", "Gosto", U.none, {
1681
+ form: "text"
1682
+ }),
1683
+ defineParameter(
1684
+ "total_dissolved_solids",
1685
+ "physical",
1686
+ "Total dissolved solids",
1687
+ "S\xF3lidos totais dissolvidos",
1688
+ U.mg_l
1689
+ ),
1690
+ defineParameter(
1691
+ "total_suspended_solids",
1692
+ "physical",
1693
+ "Total suspended solids",
1694
+ "S\xF3lidos suspensos totais",
1695
+ U.mg_l
1696
+ ),
1697
+ defineParameter(
1698
+ "total_solids",
1699
+ "physical",
1700
+ "Total solids",
1701
+ "S\xF3lidos totais",
1702
+ U.mg_l
1703
+ ),
1704
+ defineParameter(
1705
+ "free_co2",
1706
+ "physical",
1707
+ "Free carbon dioxide",
1708
+ "G\xE1s carb\xF4nico livre",
1709
+ U.mg_l
1710
+ ),
1711
+ // Aggregate (expressed as CaCO₃: 100.087 g/mol, divalent → 50.04 mg/meq)
1712
+ defineParameter(
1713
+ "alkalinity_total_as_caco3",
1714
+ "aggregate",
1715
+ "Total alkalinity as CaCO\u2083",
1716
+ "Alcalinidade total como CaCO\u2083",
1717
+ U.mg_l,
1718
+ { molar_mass: 100.087, charge: -2 }
1719
+ ),
1720
+ defineParameter(
1721
+ "alkalinity_bicarbonate_as_caco3",
1722
+ "aggregate",
1723
+ "Bicarbonate alkalinity as CaCO\u2083",
1724
+ "Alcalinidade de bicarbonatos como CaCO\u2083",
1725
+ U.mg_l,
1726
+ { molar_mass: 100.087, charge: -2 }
1727
+ ),
1728
+ defineParameter(
1729
+ "alkalinity_carbonate_as_caco3",
1730
+ "aggregate",
1731
+ "Carbonate alkalinity as CaCO\u2083",
1732
+ "Alcalinidade de carbonatos como CaCO\u2083",
1733
+ U.mg_l,
1734
+ { molar_mass: 100.087, charge: -2 }
1735
+ ),
1736
+ defineParameter(
1737
+ "alkalinity_hydroxide_as_caco3",
1738
+ "aggregate",
1739
+ "Hydroxide alkalinity as CaCO\u2083",
1740
+ "Alcalinidade de hidr\xF3xidos como CaCO\u2083",
1741
+ U.mg_l,
1742
+ { molar_mass: 100.087, charge: -2 }
1743
+ ),
1744
+ defineParameter(
1745
+ "acidity_total_as_caco3",
1746
+ "aggregate",
1747
+ "Total acidity as CaCO\u2083",
1748
+ "Acidez total como CaCO\u2083",
1749
+ U.mg_l,
1750
+ { molar_mass: 100.087, charge: 2 }
1751
+ ),
1752
+ defineParameter(
1753
+ "hardness_total_as_caco3",
1754
+ "aggregate",
1755
+ "Total hardness as CaCO\u2083",
1756
+ "Dureza total como CaCO\u2083",
1757
+ U.mg_l,
1758
+ { molar_mass: 100.087, charge: 2 }
1759
+ ),
1760
+ defineParameter(
1761
+ "hardness_calcium_as_caco3",
1762
+ "aggregate",
1763
+ "Calcium hardness as CaCO\u2083",
1764
+ "Dureza de c\xE1lcio como CaCO\u2083",
1765
+ U.mg_l,
1766
+ { molar_mass: 100.087, charge: 2 }
1767
+ ),
1768
+ // Major ions
1769
+ defineParameter("calcium", "major_ion", "Calcium", "C\xE1lcio", U.mg_l, {
1770
+ cas: "7440-70-2",
1771
+ molar_mass: 40.078,
1772
+ charge: 2
1773
+ }),
1774
+ defineParameter("magnesium", "major_ion", "Magnesium", "Magn\xE9sio", U.mg_l, {
1775
+ cas: "7439-95-4",
1776
+ molar_mass: 24.305,
1777
+ charge: 2
1778
+ }),
1779
+ defineParameter("sodium", "major_ion", "Sodium", "S\xF3dio", U.mg_l, {
1780
+ cas: "7440-23-5",
1781
+ molar_mass: 22.99,
1782
+ charge: 1
1783
+ }),
1784
+ defineParameter("potassium", "major_ion", "Potassium", "Pot\xE1ssio", U.mg_l, {
1785
+ cas: "7440-09-7",
1786
+ molar_mass: 39.098,
1787
+ charge: 1
1788
+ }),
1789
+ defineParameter(
1790
+ "bicarbonate",
1791
+ "major_ion",
1792
+ "Bicarbonate as HCO\u2083\u207B",
1793
+ "Bicarbonato como HCO\u2083\u207B",
1794
+ U.mg_l,
1795
+ { cas: "71-52-3", molar_mass: 61.017, charge: -1 }
1796
+ ),
1797
+ defineParameter(
1798
+ "carbonate",
1799
+ "major_ion",
1800
+ "Carbonate as CO\u2083\xB2\u207B",
1801
+ "Carbonato como CO\u2083\xB2\u207B",
1802
+ U.mg_l,
1803
+ { cas: "3812-32-6", molar_mass: 60.009, charge: -2 }
1804
+ ),
1805
+ defineParameter("chloride", "major_ion", "Chloride", "Cloreto", U.mg_l, {
1806
+ cas: "16887-00-6",
1807
+ molar_mass: 35.453,
1808
+ charge: -1
1809
+ }),
1810
+ defineParameter("sulfate", "major_ion", "Sulfate", "Sulfato", U.mg_l, {
1811
+ cas: "14808-79-8",
1812
+ molar_mass: 96.06,
1813
+ charge: -2
1814
+ }),
1815
+ defineParameter("fluoride", "major_ion", "Fluoride", "Fluoreto", U.mg_l, {
1816
+ cas: "16984-48-8",
1817
+ molar_mass: 18.998,
1818
+ charge: -1
1819
+ }),
1820
+ defineParameter(
1821
+ "silica_as_sio2",
1822
+ "major_ion",
1823
+ "Silica as SiO\u2082",
1824
+ "S\xEDlica como SiO\u2082",
1825
+ U.mg_l,
1826
+ { cas: "7631-86-9" }
1827
+ ),
1828
+ // Nutrients
1829
+ defineParameter(
1830
+ "nitrate_as_n",
1831
+ "nutrient",
1832
+ "Nitrate as N",
1833
+ "Nitrato como N",
1834
+ U.mg_l,
1835
+ {
1836
+ molar_mass: 14.007,
1837
+ charge: -1
1838
+ }
1839
+ ),
1840
+ defineParameter(
1841
+ "nitrate_as_no3",
1842
+ "nutrient",
1843
+ "Nitrate as NO\u2083\u207B",
1844
+ "Nitrato como NO\u2083\u207B",
1845
+ U.mg_l,
1846
+ { cas: "14797-55-8", molar_mass: 62.004, charge: -1 }
1847
+ ),
1848
+ defineParameter(
1849
+ "nitrite_as_n",
1850
+ "nutrient",
1851
+ "Nitrite as N",
1852
+ "Nitrito como N",
1853
+ U.mg_l,
1854
+ {
1855
+ molar_mass: 14.007,
1856
+ charge: -1
1857
+ }
1858
+ ),
1859
+ defineParameter(
1860
+ "nitrite_as_no2",
1861
+ "nutrient",
1862
+ "Nitrite as NO\u2082\u207B",
1863
+ "Nitrito como NO\u2082\u207B",
1864
+ U.mg_l,
1865
+ { cas: "14797-65-0", molar_mass: 46.005, charge: -1 }
1866
+ ),
1867
+ defineParameter(
1868
+ "ammonia_as_n",
1869
+ "nutrient",
1870
+ "Ammonia nitrogen as N",
1871
+ "Nitrog\xEAnio amoniacal como N",
1872
+ U.mg_l,
1873
+ { molar_mass: 14.007, charge: 1 }
1874
+ ),
1875
+ defineParameter(
1876
+ "ammonia_as_nh3",
1877
+ "nutrient",
1878
+ "Ammonia as NH\u2083",
1879
+ "Am\xF4nia como NH\u2083",
1880
+ U.mg_l,
1881
+ {
1882
+ cas: "7664-41-7"
1883
+ }
1884
+ ),
1885
+ defineParameter(
1886
+ "kjeldahl_nitrogen_as_n",
1887
+ "nutrient",
1888
+ "Total Kjeldahl nitrogen as N",
1889
+ "Nitrog\xEAnio Kjeldahl total como N",
1890
+ U.mg_l
1891
+ ),
1892
+ defineParameter(
1893
+ "phosphorus_total_as_p",
1894
+ "nutrient",
1895
+ "Total phosphorus as P",
1896
+ "F\xF3sforo total como P",
1897
+ U.mg_l
1898
+ ),
1899
+ defineParameter(
1900
+ "orthophosphate_as_po4",
1901
+ "nutrient",
1902
+ "Orthophosphate as PO\u2084\xB3\u207B",
1903
+ "Ortofosfato como PO\u2084\xB3\u207B",
1904
+ U.mg_l,
1905
+ { molar_mass: 94.971, charge: -3 }
1906
+ ),
1907
+ // Organic
1908
+ defineParameter(
1909
+ "total_organic_carbon",
1910
+ "organic",
1911
+ "Total organic carbon",
1912
+ "Carbono org\xE2nico total",
1913
+ U.mg_l
1914
+ ),
1915
+ defineParameter(
1916
+ "cod",
1917
+ "organic",
1918
+ "Chemical oxygen demand",
1919
+ "Demanda qu\xEDmica de oxig\xEAnio (DQO)",
1920
+ U.mg_l
1921
+ ),
1922
+ defineParameter(
1923
+ "bod5",
1924
+ "organic",
1925
+ "Biochemical oxygen demand, 5-day",
1926
+ "Demanda bioqu\xEDmica de oxig\xEAnio (DBO\u2085)",
1927
+ U.mg_l
1928
+ ),
1929
+ defineParameter(
1930
+ "total_petroleum_hydrocarbons",
1931
+ "organic",
1932
+ "Total petroleum hydrocarbons (range per method)",
1933
+ "Hidrocarbonetos totais de petr\xF3leo",
1934
+ U.mg_l
1935
+ ),
1936
+ defineParameter(
1937
+ "oil_and_grease",
1938
+ "organic",
1939
+ "Oil and grease",
1940
+ "\xD3leos e graxas",
1941
+ U.mg_l
1942
+ ),
1943
+ // Disinfection
1944
+ defineParameter(
1945
+ "free_chlorine",
1946
+ "disinfection",
1947
+ "Free chlorine residual",
1948
+ "Cloro residual livre",
1949
+ U.mg_l
1950
+ ),
1951
+ defineParameter(
1952
+ "total_chlorine",
1953
+ "disinfection",
1954
+ "Total chlorine residual",
1955
+ "Cloro residual total",
1956
+ U.mg_l
1957
+ ),
1958
+ // Mining and redox
1959
+ defineParameter(
1960
+ "ferrous_iron",
1961
+ "mining_redox",
1962
+ "Ferrous iron (Fe\xB2\u207A)",
1963
+ "Ferro ferroso (Fe\xB2\u207A)",
1964
+ U.mg_l
1965
+ ),
1966
+ defineParameter(
1967
+ "chromium_hexavalent",
1968
+ "mining_redox",
1969
+ "Hexavalent chromium",
1970
+ "Cromo hexavalente",
1971
+ U.mg_l,
1972
+ { cas: "18540-29-9" }
1973
+ ),
1974
+ defineParameter(
1975
+ "cyanide_total_as_cn",
1976
+ "mining_redox",
1977
+ "Total cyanide as CN\u207B",
1978
+ "Cianeto total como CN\u207B",
1979
+ U.mg_l
1980
+ ),
1981
+ defineParameter(
1982
+ "cyanide_wad_as_cn",
1983
+ "mining_redox",
1984
+ "Weak acid dissociable cyanide as CN\u207B",
1985
+ "Cianeto WAD como CN\u207B",
1986
+ U.mg_l
1987
+ ),
1988
+ defineParameter(
1989
+ "cyanide_free_as_cn",
1990
+ "mining_redox",
1991
+ "Free cyanide as CN\u207B",
1992
+ "Cianeto livre como CN\u207B",
1993
+ U.mg_l
1994
+ ),
1995
+ defineParameter(
1996
+ "thiocyanate",
1997
+ "mining_redox",
1998
+ "Thiocyanate",
1999
+ "Tiocianato",
2000
+ U.mg_l,
2001
+ {
2002
+ cas: "302-04-5"
2003
+ }
2004
+ ),
2005
+ defineParameter(
2006
+ "sulfide_total_as_s",
2007
+ "mining_redox",
2008
+ "Total sulfide as S",
2009
+ "Sulfeto total como S",
2010
+ U.mg_l
2011
+ ),
2012
+ // Metals / trace
2013
+ defineParameter("iron", "metal", "Iron", "Ferro", U.mg_l, {
2014
+ cas: "7439-89-6",
2015
+ molar_mass: 55.845,
2016
+ charge: 2
2017
+ }),
2018
+ defineParameter("manganese", "metal", "Manganese", "Mangan\xEAs", U.mg_l, {
2019
+ cas: "7439-96-5",
2020
+ molar_mass: 54.938,
2021
+ charge: 2
2022
+ }),
2023
+ defineParameter("aluminum", "metal", "Aluminium", "Alum\xEDnio", U.mg_l, {
2024
+ cas: "7429-90-5"
2025
+ }),
2026
+ defineParameter("antimony", "metal", "Antimony", "Antim\xF4nio", U.mg_l, {
2027
+ cas: "7440-36-0"
2028
+ }),
2029
+ defineParameter("arsenic", "metal", "Arsenic", "Ars\xEAnio", U.mg_l, {
2030
+ cas: "7440-38-2"
2031
+ }),
2032
+ defineParameter("barium", "metal", "Barium", "B\xE1rio", U.mg_l, {
2033
+ cas: "7440-39-3"
2034
+ }),
2035
+ defineParameter("beryllium", "metal", "Beryllium", "Ber\xEDlio", U.mg_l, {
2036
+ cas: "7440-41-7"
2037
+ }),
2038
+ defineParameter("boron", "metal", "Boron", "Boro", U.mg_l, {
2039
+ cas: "7440-42-8"
2040
+ }),
2041
+ defineParameter("cadmium", "metal", "Cadmium", "C\xE1dmio", U.mg_l, {
2042
+ cas: "7440-43-9"
2043
+ }),
2044
+ defineParameter(
2045
+ "chromium",
2046
+ "metal",
2047
+ "Chromium, total",
2048
+ "Cromo total",
2049
+ U.mg_l,
2050
+ {
2051
+ cas: "7440-47-3"
2052
+ }
2053
+ ),
2054
+ defineParameter("cobalt", "metal", "Cobalt", "Cobalto", U.mg_l, {
2055
+ cas: "7440-48-4"
2056
+ }),
2057
+ defineParameter("copper", "metal", "Copper", "Cobre", U.mg_l, {
2058
+ cas: "7440-50-8"
2059
+ }),
2060
+ defineParameter("lead", "metal", "Lead", "Chumbo", U.mg_l, {
2061
+ cas: "7439-92-1"
2062
+ }),
2063
+ defineParameter("lithium", "metal", "Lithium", "L\xEDtio", U.mg_l, {
2064
+ cas: "7439-93-2",
2065
+ molar_mass: 6.94,
2066
+ charge: 1
2067
+ }),
2068
+ defineParameter("mercury", "metal", "Mercury", "Merc\xFArio", U.mg_l, {
2069
+ cas: "7439-97-6"
2070
+ }),
2071
+ defineParameter("molybdenum", "metal", "Molybdenum", "Molibd\xEAnio", U.mg_l, {
2072
+ cas: "7439-98-7"
2073
+ }),
2074
+ defineParameter("nickel", "metal", "Nickel", "N\xEDquel", U.mg_l, {
2075
+ cas: "7440-02-0"
2076
+ }),
2077
+ defineParameter("selenium", "metal", "Selenium", "Sel\xEAnio", U.mg_l, {
2078
+ cas: "7782-49-2"
2079
+ }),
2080
+ defineParameter("silver", "metal", "Silver", "Prata", U.mg_l, {
2081
+ cas: "7440-22-4"
2082
+ }),
2083
+ defineParameter("strontium", "metal", "Strontium", "Estr\xF4ncio", U.mg_l, {
2084
+ cas: "7440-24-6",
2085
+ molar_mass: 87.62,
2086
+ charge: 2
2087
+ }),
2088
+ defineParameter("thallium", "metal", "Thallium", "T\xE1lio", U.mg_l, {
2089
+ cas: "7440-28-0"
2090
+ }),
2091
+ defineParameter("uranium", "metal", "Uranium", "Ur\xE2nio", U.mg_l, {
2092
+ cas: "7440-61-1"
2093
+ }),
2094
+ defineParameter("vanadium", "metal", "Vanadium", "Van\xE1dio", U.mg_l, {
2095
+ cas: "7440-62-2"
2096
+ }),
2097
+ defineParameter("zinc", "metal", "Zinc", "Zinco", U.mg_l, {
2098
+ cas: "7440-66-6"
2099
+ }),
2100
+ // Microbiology
2101
+ defineParameter(
2102
+ "total_coliforms",
2103
+ "microbiology",
2104
+ "Total coliforms in 100 mL",
2105
+ "Coliformes totais em 100 mL",
2106
+ U.none,
2107
+ { form: "presence" }
2108
+ ),
2109
+ defineParameter(
2110
+ "total_coliforms_mpn",
2111
+ "microbiology",
2112
+ "Total coliforms, count",
2113
+ "Coliformes totais, contagem",
2114
+ U.mpn_100ml
2115
+ ),
2116
+ defineParameter(
2117
+ "total_coliforms_cfu",
2118
+ "microbiology",
2119
+ "Total coliforms, count",
2120
+ "Coliformes totais, contagem",
2121
+ U.cfu_100ml
2122
+ ),
2123
+ defineParameter(
2124
+ "e_coli",
2125
+ "microbiology",
2126
+ "E. coli in 100 mL",
2127
+ "E. coli em 100 mL",
2128
+ U.none,
2129
+ { form: "presence" }
2130
+ ),
2131
+ defineParameter(
2132
+ "e_coli_mpn",
2133
+ "microbiology",
2134
+ "E. coli, count",
2135
+ "E. coli, contagem",
2136
+ U.mpn_100ml
2137
+ ),
2138
+ defineParameter(
2139
+ "e_coli_cfu",
2140
+ "microbiology",
2141
+ "E. coli, count",
2142
+ "E. coli, contagem",
2143
+ U.cfu_100ml
2144
+ ),
2145
+ defineParameter(
2146
+ "thermotolerant_coliforms",
2147
+ "microbiology",
2148
+ "Thermotolerant coliforms in 100 mL",
2149
+ "Coliformes termotolerantes em 100 mL",
2150
+ U.none,
2151
+ { form: "presence" }
2152
+ ),
2153
+ defineParameter(
2154
+ "thermotolerant_coliforms_mpn",
2155
+ "microbiology",
2156
+ "Thermotolerant coliforms, count",
2157
+ "Coliformes termotolerantes, contagem",
2158
+ U.mpn_100ml
2159
+ ),
2160
+ defineParameter(
2161
+ "thermotolerant_coliforms_cfu",
2162
+ "microbiology",
2163
+ "Thermotolerant coliforms, count",
2164
+ "Coliformes termotolerantes, contagem",
2165
+ U.cfu_100ml
2166
+ ),
2167
+ defineParameter(
2168
+ "heterotrophic_plate_count",
2169
+ "microbiology",
2170
+ "Heterotrophic plate count",
2171
+ "Bact\xE9rias heterotr\xF3ficas",
2172
+ U.cfu_ml
2173
+ ),
2174
+ // Radioactivity (Bq/L even where a CAS exists)
2175
+ defineParameter(
2176
+ "gross_alpha",
2177
+ "radioactivity",
2178
+ "Gross alpha activity",
2179
+ "Atividade alfa total",
2180
+ U.bq_l
2181
+ ),
2182
+ defineParameter(
2183
+ "gross_beta",
2184
+ "radioactivity",
2185
+ "Gross beta activity",
2186
+ "Atividade beta total",
2187
+ U.bq_l
2188
+ ),
2189
+ defineParameter(
2190
+ "radium_226",
2191
+ "radioactivity",
2192
+ "Radium-226",
2193
+ "R\xE1dio-226",
2194
+ U.bq_l,
2195
+ {
2196
+ cas: "13982-63-3"
2197
+ }
2198
+ ),
2199
+ defineParameter(
2200
+ "radium_228",
2201
+ "radioactivity",
2202
+ "Radium-228",
2203
+ "R\xE1dio-228",
2204
+ U.bq_l,
2205
+ {
2206
+ cas: "15262-20-1"
2207
+ }
2208
+ ),
2209
+ defineParameter(
2210
+ "radon_222",
2211
+ "radioactivity",
2212
+ "Radon-222",
2213
+ "Rad\xF4nio-222",
2214
+ U.bq_l,
2215
+ {
2216
+ cas: "14859-67-7"
2217
+ }
2218
+ )
2219
+ ];
2220
+ var BY_CODE = new Map(WATER_QUALITY_PARAMETERS.map((d) => [d.code, d]));
2221
+ var BY_CAS = new Map(
2222
+ WATER_QUALITY_PARAMETERS.filter((d) => d.cas).map((d) => [d.cas, d])
2223
+ );
2224
+ function getParameterDefinition(parameter) {
2225
+ if (parameter.vocabulary === "welldot") return BY_CODE.get(parameter.code);
2226
+ if (parameter.vocabulary === "cas") return BY_CAS.get(parameter.code);
2227
+ return void 0;
2228
+ }
2229
+ function getParameterLabel(parameter, locale) {
2230
+ const def = getParameterDefinition(parameter);
2231
+ if (!def) return parameter.code;
2232
+ return resolveLanguageText({ ...def.labels, en: def.label }, locale, "en");
2233
+ }
2234
+ function parameterKey(parameter) {
2235
+ const def = getParameterDefinition(parameter);
2236
+ if (def) return def.code;
2237
+ return `${parameter.vocabulary}:${parameter.code}`;
2238
+ }
2239
+ function isKnownParameter(parameter) {
2240
+ if (parameter.vocabulary !== "welldot") return true;
2241
+ return BY_CODE.has(parameter.code);
2242
+ }
2243
+
2244
+ // src/vocab/attachment.vocab.ts
2245
+ var DOCUMENT_TYPES = [
2246
+ {
2247
+ value: "drilling_report",
2248
+ label: { en: "Drilling report", pt: "Relat\xF3rio de perfura\xE7\xE3o" }
2249
+ },
2250
+ {
2251
+ value: "as_built_drawing",
2252
+ label: { en: "As-built drawing", pt: "Perfil construtivo as-built" }
2253
+ },
2254
+ {
2255
+ value: "registry_record",
2256
+ label: { en: "Registry record", pt: "Ficha cadastral" }
2257
+ },
2258
+ { value: "photo", label: { en: "Photo", pt: "Fotografia" } },
2259
+ {
2260
+ value: "permit_document",
2261
+ label: { en: "Permit document", pt: "Portaria / outorga" }
2262
+ },
2263
+ {
2264
+ value: "condition_evidence",
2265
+ label: { en: "Condition evidence", pt: "Comprovante de condicionante" }
2266
+ },
2267
+ { value: "pump_curve", label: { en: "Pump curve", pt: "Curva da bomba" } },
2268
+ {
2269
+ value: "field_sheet",
2270
+ label: { en: "Field sheet", pt: "Planilha de campo" }
2271
+ },
2272
+ {
2273
+ value: "test_report",
2274
+ label: {
2275
+ en: "Pumping test report",
2276
+ pt: "Relat\xF3rio de teste de bombeamento"
2277
+ }
2278
+ },
2279
+ {
2280
+ value: "lab_report",
2281
+ label: { en: "Lab report", pt: "Laudo laboratorial" }
2282
+ },
2283
+ { value: "invoice", label: { en: "Invoice", pt: "Nota fiscal" } }
2284
+ ];
2285
+ var DOCUMENT_TYPE_SUGGESTIONS = {
2286
+ root: ["drilling_report", "as_built_drawing", "registry_record", "photo"],
2287
+ pump: ["pump_curve", "invoice", "photo"],
2288
+ meter: ["photo", "invoice", "condition_evidence"],
2289
+ permit: ["permit_document", "photo"],
2290
+ condition: ["condition_evidence", "photo"],
2291
+ permit_history: ["permit_document", "invoice", "photo"],
2292
+ event: ["field_sheet", "photo"],
2293
+ history: ["condition_evidence", "photo", "invoice"],
2294
+ sample: ["lab_report", "field_sheet", "photo", "condition_evidence"]
2295
+ };
2296
+
2297
+ // src/vocab/construction.vocab.ts
2298
+ var DRILLING_METHODS = [
2299
+ { value: "rotary", label: { en: "Rotary", pt: "Rotativo" } },
2300
+ { value: "percussion", label: { en: "Percussion", pt: "Percuss\xE3o" } },
2301
+ { value: "cable_tool", label: { en: "Cable tool", pt: "Percuss\xE3o a cabo" } },
2302
+ { value: "auger", label: { en: "Auger", pt: "Trado" } },
2303
+ {
2304
+ value: "air_hammer",
2305
+ label: { en: "Air hammer", pt: "Martelo pneum\xE1tico" }
2306
+ }
2307
+ ];
2308
+ var CONSTRUCTION_MATERIALS = [
2309
+ { value: "pvc", label: { en: "PVC", pt: "PVC" } },
2310
+ {
2311
+ value: "geomechanical_pvc",
2312
+ label: { en: "Geomechanical PVC", pt: "PVC geomec\xE2nico" }
2313
+ },
2314
+ { value: "carbon_steel", label: { en: "Carbon steel", pt: "A\xE7o carbono" } },
2315
+ {
2316
+ value: "galvanized_steel",
2317
+ label: { en: "Galvanized steel", pt: "A\xE7o galvanizado" }
2318
+ },
2319
+ {
2320
+ value: "stainless_steel",
2321
+ label: { en: "Stainless steel", pt: "A\xE7o inox" }
2322
+ },
2323
+ { value: "fiberglass", label: { en: "Fiberglass", pt: "Fibra de vidro" } }
2324
+ ];
2325
+ var SCREEN_SLOT_TYPES = [
2326
+ {
2327
+ value: "continuous_slot",
2328
+ label: { en: "Continuous slot", pt: "Espiralado (tipo Johnson)" }
2329
+ },
2330
+ { value: "slotted", label: { en: "Slotted", pt: "Ranhurado" } },
2331
+ { value: "bridge_slot", label: { en: "Bridge slot", pt: "Tipo ponte" } },
2332
+ { value: "louver", label: { en: "Louver", pt: "Veneziana" } },
2333
+ { value: "perforated", label: { en: "Perforated", pt: "Perfurado" } },
2334
+ { value: "nold", label: { en: "Nold type", pt: "Tipo Nold" } }
2335
+ ];
2336
+ var CENTRALIZER_TYPES = [
2337
+ { value: "spring_bow", label: { en: "Spring bow", pt: "Mola (spring bow)" } },
2338
+ { value: "rigid", label: { en: "Rigid", pt: "R\xEDgido" } },
2339
+ { value: "semi_rigid", label: { en: "Semi-rigid", pt: "Semirr\xEDgido" } },
2340
+ { value: "polymer", label: { en: "Polymer", pt: "Polim\xE9rico" } },
2341
+ { value: "carbon_steel", label: { en: "Carbon steel", pt: "A\xE7o carbono" } },
2342
+ {
2343
+ value: "galvanized_steel",
2344
+ label: { en: "Galvanized steel", pt: "A\xE7o galvanizado" }
2345
+ },
2346
+ {
2347
+ value: "stainless_steel",
2348
+ label: { en: "Stainless steel", pt: "A\xE7o inox" }
2349
+ }
2350
+ ];
2351
+ var CEMENT_PAD_TYPES = [
2352
+ { value: "concrete", label: { en: "Concrete", pt: "Concreto" } },
2353
+ {
2354
+ value: "reinforced_concrete",
2355
+ label: { en: "Reinforced concrete", pt: "Concreto armado" }
2356
+ },
2357
+ { value: "cement", label: { en: "Cement", pt: "Cimento" } },
2358
+ { value: "mortar", label: { en: "Mortar", pt: "Argamassa" } }
2359
+ ];
2360
+
2361
+ // src/vocab/general.vocab.ts
2362
+ var WELL_TYPES = [
2363
+ { value: "tubular", label: { en: "Tubular", pt: "Tubular" } },
2364
+ {
2365
+ value: "hand_dug",
2366
+ label: { en: "Hand dug", pt: "Cacimba / po\xE7o escavado" }
2367
+ },
2368
+ { value: "horizontal", label: { en: "Horizontal", pt: "Horizontal" } },
2369
+ {
2370
+ value: "infiltration_gallery",
2371
+ label: { en: "Infiltration gallery", pt: "Galeria de infiltra\xE7\xE3o" }
2372
+ },
2373
+ {
2374
+ value: "artesian",
2375
+ label: { en: "Artesian (deprecated)", pt: "Artesiano (obsoleto)" },
2376
+ deprecated: true
2377
+ }
2378
+ ];
2379
+ var WELL_PURPOSES = [
2380
+ {
2381
+ value: "production",
2382
+ label: { en: "Production", pt: "Produ\xE7\xE3o / capta\xE7\xE3o" }
2383
+ },
2384
+ {
2385
+ value: "monitoring",
2386
+ label: { en: "Monitoring well", pt: "Po\xE7o de monitoramento" }
2387
+ },
2388
+ { value: "piezometer", label: { en: "Piezometer", pt: "Piez\xF4metro" } },
2389
+ {
2390
+ value: "water_level_indicator",
2391
+ label: {
2392
+ en: "Water level indicator",
2393
+ pt: "INA \u2014 indicador de n\xEDvel d'\xE1gua"
2394
+ }
2395
+ },
2396
+ {
2397
+ value: "observation",
2398
+ label: { en: "Observation well", pt: "Po\xE7o de observa\xE7\xE3o" }
2399
+ },
2400
+ {
2401
+ value: "exploration",
2402
+ label: { en: "Exploration", pt: "Pesquisa / explorat\xF3rio" }
2403
+ },
2404
+ {
2405
+ value: "injection",
2406
+ label: { en: "Injection / recharge", pt: "Inje\xE7\xE3o / recarga" }
2407
+ },
2408
+ { value: "dewatering", label: { en: "Dewatering", pt: "Rebaixamento" } }
2409
+ ];
2410
+
2411
+ // src/vocab/history.vocab.ts
2412
+ var HISTORY_LOG_CATEGORIES = [
2413
+ { value: "maintenance", label: { en: "Maintenance", pt: "Manuten\xE7\xE3o" } },
2414
+ { value: "inspection", label: { en: "Inspection", pt: "Inspe\xE7\xE3o" } },
2415
+ { value: "incident", label: { en: "Incident", pt: "Incidente" } },
2416
+ { value: "event", label: { en: "Event", pt: "Evento" } },
2417
+ {
2418
+ value: "status_change",
2419
+ label: { en: "Status change", pt: "Mudan\xE7a de situa\xE7\xE3o" }
2420
+ }
2421
+ ];
2422
+ var HISTORY_LOG_SEVERITIES = [
2423
+ { value: "low", label: { en: "Low", pt: "Baixa" } },
2424
+ { value: "medium", label: { en: "Medium", pt: "M\xE9dia" } },
2425
+ { value: "high", label: { en: "High", pt: "Alta" } },
2426
+ { value: "critical", label: { en: "Critical", pt: "Cr\xEDtica" } }
2427
+ ];
2428
+
2429
+ // src/vocab/hydrodynamic.vocab.ts
2430
+ var HYDRODYNAMIC_EVENT_TYPES = [
2431
+ {
2432
+ value: "spot_measurement",
2433
+ label: { en: "Spot measurement", pt: "Medi\xE7\xE3o pontual" }
2434
+ },
2435
+ {
2436
+ value: "constant_rate",
2437
+ label: { en: "Constant rate", pt: "Vaz\xE3o constante" }
2438
+ },
2439
+ { value: "step_drawdown", label: { en: "Step drawdown", pt: "Escalonada" } },
2440
+ { value: "airlift", label: { en: "Air-lift", pt: "Air-lift" } },
2441
+ {
2442
+ value: "recovery_only",
2443
+ label: { en: "Recovery only", pt: "Recupera\xE7\xE3o" }
2444
+ }
2445
+ ];
2446
+ var MEASUREMENT_METHODS = [
2447
+ {
2448
+ value: "electric_probe",
2449
+ label: { en: "Electric probe", pt: "Sonda el\xE9trica" }
2450
+ },
2451
+ {
2452
+ value: "pressure_transducer",
2453
+ label: { en: "Pressure transducer", pt: "Transdutor de press\xE3o" }
2454
+ },
2455
+ { value: "air_line", label: { en: "Air line", pt: "Linha de ar" } },
2456
+ { value: "tape", label: { en: "Tape", pt: "Trena" } }
2457
+ ];
2458
+ var AQUIFER_ANALYSIS_METHODS = [
2459
+ { value: "cooper_jacob", label: { en: "Cooper-Jacob", pt: "Cooper-Jacob" } },
2460
+ { value: "theis", label: { en: "Theis", pt: "Theis" } },
2461
+ { value: "neuman", label: { en: "Neuman", pt: "Neuman" } },
2462
+ { value: "hantush", label: { en: "Hantush", pt: "Hantush" } },
2463
+ {
2464
+ value: "birsoy_summers",
2465
+ label: { en: "Birsoy-Summers", pt: "Birsoy-Summers" }
2466
+ },
2467
+ { value: "eden_hazel", label: { en: "Eden-Hazel", pt: "Eden-Hazel" } },
2468
+ {
2469
+ value: "visual_inspection",
2470
+ label: { en: "Visual inspection", pt: "Inspe\xE7\xE3o visual" }
2471
+ }
2472
+ ];
2473
+
2474
+ // src/vocab/operation.vocab.ts
2475
+ var PUMP_TYPES = [
2476
+ {
2477
+ value: "submersible",
2478
+ label: { en: "Submersible pump", pt: "Bomba submersa" }
2479
+ },
2480
+ {
2481
+ value: "vertical_turbine",
2482
+ label: { en: "Vertical turbine pump", pt: "Bomba de eixo vertical" }
2483
+ },
2484
+ { value: "jet", label: { en: "Jet pump", pt: "Bomba injetora" } },
2485
+ {
2486
+ value: "progressive_cavity",
2487
+ label: { en: "Progressive cavity pump", pt: "Bomba helicoidal" }
2488
+ },
2489
+ { value: "hand_pump", label: { en: "Hand pump", pt: "Bomba manual" } },
2490
+ {
2491
+ value: "compressor_airlift",
2492
+ label: { en: "Compressor (air-lift)", pt: "Compressor (air-lift)" }
2493
+ }
2494
+ ];
2495
+ var POWER_SOURCES = [
2496
+ { value: "grid", label: { en: "Grid", pt: "Rede el\xE9trica" } },
2497
+ { value: "solar", label: { en: "Solar", pt: "Solar" } },
2498
+ { value: "diesel", label: { en: "Diesel", pt: "Diesel" } },
2499
+ { value: "hybrid", label: { en: "Hybrid", pt: "H\xEDbrido" } }
2500
+ ];
2501
+ var METER_TYPES = [
2502
+ { value: "mechanical", label: { en: "Mechanical", pt: "Mec\xE2nico" } },
2503
+ {
2504
+ value: "electromagnetic",
2505
+ label: { en: "Electromagnetic", pt: "Eletromagn\xE9tico" }
2506
+ },
2507
+ { value: "ultrasonic", label: { en: "Ultrasonic", pt: "Ultrass\xF4nico" } }
2508
+ ];
2509
+ var READING_SOURCES = [
2510
+ { value: "manual", label: { en: "Manual", pt: "Manual" } },
2511
+ { value: "telemetry", label: { en: "Telemetry", pt: "Telemetria" } }
2512
+ ];
2513
+ var ESTIMATION_METHODS = [
2514
+ {
2515
+ value: "flow_time",
2516
+ label: { en: "Flow \xD7 operating time", pt: "Vaz\xE3o \xD7 tempo de opera\xE7\xE3o" }
2517
+ },
2518
+ {
2519
+ value: "energy",
2520
+ label: { en: "Energy consumption", pt: "Consumo de energia" }
2521
+ },
2522
+ {
2523
+ value: "user_statement",
2524
+ label: { en: "User statement", pt: "Informado pelo usu\xE1rio" }
2525
+ }
2526
+ ];
2527
+ var MAINTENANCE_TYPES = [
2528
+ { value: "inspection", label: { en: "Inspection", pt: "Inspe\xE7\xE3o" } },
2529
+ { value: "cleaning", label: { en: "Cleaning", pt: "Limpeza" } },
2530
+ {
2531
+ value: "redevelopment",
2532
+ label: { en: "Redevelopment", pt: "Redesenvolvimento" }
2533
+ },
2534
+ { value: "disinfection", label: { en: "Disinfection", pt: "Desinfec\xE7\xE3o" } },
2535
+ {
2536
+ value: "pump_service",
2537
+ label: { en: "Pump service", pt: "Manuten\xE7\xE3o da bomba" }
2538
+ },
2539
+ {
2540
+ value: "meter_calibration",
2541
+ label: { en: "Meter calibration", pt: "Aferi\xE7\xE3o do hidr\xF4metro" }
2542
+ },
2543
+ {
2544
+ value: "video_inspection",
2545
+ label: {
2546
+ en: "Video inspection / optical logging",
2547
+ pt: "Filmagem / perfilagem \xF3tica"
2548
+ }
2549
+ },
2550
+ {
2551
+ value: "level_measurement",
2552
+ label: { en: "Level measurement", pt: "Medi\xE7\xE3o de n\xEDvel" }
2553
+ },
2554
+ {
2555
+ value: "pump_test",
2556
+ label: { en: "Pumping test", pt: "Teste de bombeamento" }
2557
+ },
2558
+ {
2559
+ value: "water_sampling",
2560
+ label: { en: "Water sampling", pt: "Coleta de \xE1gua" }
2561
+ }
2562
+ ];
2563
+
2564
+ // src/vocab/permit.vocab.ts
2565
+ var PERMIT_TYPES = [
2566
+ {
2567
+ value: "abstraction_permit",
2568
+ label: { en: "Abstraction permit", pt: "Outorga de direito de uso" }
2569
+ },
2570
+ {
2571
+ value: "preliminary_permit",
2572
+ label: { en: "Preliminary permit", pt: "Outorga pr\xE9via" }
2573
+ },
2574
+ {
2575
+ value: "exemption",
2576
+ label: { en: "Exemption", pt: "Dispensa / uso insignificante" }
2577
+ },
2578
+ { value: "registration", label: { en: "Registration", pt: "Cadastro" } },
2579
+ {
2580
+ value: "dewatering_permit",
2581
+ label: { en: "Dewatering permit", pt: "Outorga para rebaixamento" }
2582
+ },
2583
+ {
2584
+ value: "drilling_permit",
2585
+ label: { en: "Drilling permit", pt: "Autoriza\xE7\xE3o de perfura\xE7\xE3o" }
2586
+ }
2587
+ ];
2588
+ var WATER_USES = [
2589
+ {
2590
+ value: "human_supply",
2591
+ label: { en: "Human supply", pt: "Abastecimento humano" }
2592
+ },
2593
+ { value: "industrial", label: { en: "Industrial", pt: "Industrial" } },
2594
+ { value: "mining", label: { en: "Mining", pt: "Minera\xE7\xE3o" } },
2595
+ { value: "irrigation", label: { en: "Irrigation", pt: "Irriga\xE7\xE3o" } },
2596
+ {
2597
+ value: "livestock",
2598
+ label: { en: "Livestock", pt: "Dessedenta\xE7\xE3o animal" }
2599
+ },
2600
+ {
2601
+ value: "commercial",
2602
+ label: { en: "Commercial", pt: "Comercial / servi\xE7os" }
2603
+ }
2604
+ ];
2605
+ var CONDITION_CATEGORIES = [
2606
+ {
2607
+ value: "monitoring",
2608
+ label: { en: "Monitoring", pt: "Monitoramento" },
2609
+ description: {
2610
+ en: "Water level, flow, abstracted volume and water quality monitoring/sampling",
2611
+ pt: "Monitoramento/amostragem de n\xEDvel, vaz\xE3o, volume captado e qualidade da \xE1gua"
2612
+ }
2613
+ },
2614
+ {
2615
+ value: "reporting",
2616
+ label: { en: "Reporting", pt: "Relat\xF3rios e declara\xE7\xF5es" },
2617
+ description: {
2618
+ en: "Periodic reports and volume/flow declarations submitted to the authority",
2619
+ pt: "Relat\xF3rios peri\xF3dicos e declara\xE7\xF5es de volume/vaz\xE3o entregues ao \xF3rg\xE3o"
2620
+ }
2621
+ },
2622
+ {
2623
+ value: "equipment_installation",
2624
+ label: { en: "Equipment installation", pt: "Instala\xE7\xE3o de equipamentos" },
2625
+ description: {
2626
+ en: "Meters (hidr\xF4metro), level gauges, sampling taps, telemetry",
2627
+ pt: "Hidr\xF4metro, medidor de n\xEDvel, torneira de amostragem, telemetria"
2628
+ }
2629
+ },
2630
+ {
2631
+ value: "well_protection",
2632
+ label: { en: "Well protection", pt: "Prote\xE7\xE3o do po\xE7o" },
2633
+ description: {
2634
+ en: "Sanitary slab, seal, protection perimeter, wellhead closure",
2635
+ pt: "Laje de prote\xE7\xE3o, selo sanit\xE1rio, per\xEDmetro de prote\xE7\xE3o, tampa do po\xE7o"
2636
+ }
2637
+ },
2638
+ {
2639
+ value: "environmental",
2640
+ label: { en: "Environmental", pt: "Ambiental" },
2641
+ description: {
2642
+ en: "Environmental measures, compensation, licensing of the activity",
2643
+ pt: "Medidas ambientais, compensa\xE7\xE3o, licenciamento da atividade"
2644
+ }
2645
+ },
2646
+ {
2647
+ value: "legal",
2648
+ label: { en: "Legal / administrative", pt: "Legal / administrativo" },
2649
+ description: {
2650
+ en: "Renewal request, fees, registrations, document submissions",
2651
+ pt: "Pedido de renova\xE7\xE3o, taxas, cadastros, entrega de documentos"
2652
+ }
2653
+ }
2654
+ ];
2655
+ var PERMIT_HISTORY_TYPES = [
2656
+ { value: "filing", label: { en: "Filing", pt: "Protocolo" } },
2657
+ { value: "process", label: { en: "Process", pt: "Andamento" } },
2658
+ { value: "notification", label: { en: "Notification", pt: "Notifica\xE7\xE3o" } },
2659
+ { value: "fee", label: { en: "Fee", pt: "Taxa" } },
2660
+ { value: "inspection", label: { en: "Inspection", pt: "Vistoria" } },
2661
+ { value: "decision", label: { en: "Decision", pt: "Decis\xE3o" } },
2662
+ { value: "renewal", label: { en: "Renewal", pt: "Renova\xE7\xE3o" } }
2663
+ ];
2664
+
2665
+ // src/vocab/vocab.ts
2666
+ function getVocabEntry(vocab, value) {
2667
+ if (value === void 0) return void 0;
2668
+ return vocab.find((entry) => entry.value === value);
2669
+ }
2670
+ function isVocabValue(vocab, value) {
2671
+ return getVocabEntry(vocab, value) !== void 0;
2672
+ }
2673
+ function getVocabLabel(vocab, value, locale) {
2674
+ const entry = getVocabEntry(vocab, value);
2675
+ return entry ? resolveLanguageText(entry.label, locale) : value;
2676
+ }
2677
+ function formatVocabList(vocab, values, locale) {
2678
+ return (values ?? []).map((v) => getVocabLabel(vocab, v, locale)).join(", ");
2679
+ }
2680
+ function vocabValues(vocab, { includeDeprecated = false } = {}) {
2681
+ return vocab.filter((entry) => includeDeprecated || !entry.deprecated).map((entry) => entry.value);
2682
+ }
2683
+
2684
+ // src/vocab/closed.vocab.ts
2685
+ function closedVocab() {
2686
+ return (entries) => entries;
2687
+ }
2688
+ var valuesOf = (vocab) => vocab.map((entry) => entry.value);
2689
+ var WELL_STATUSES = closedVocab()([
2690
+ { value: "active", label: { en: "Active", pt: "Ativo" } },
2691
+ {
2692
+ value: "maintenance",
2693
+ label: { en: "Under maintenance", pt: "Em manuten\xE7\xE3o" }
2694
+ },
2695
+ { value: "inactive", label: { en: "Inactive", pt: "Paralisado" } },
2696
+ {
2697
+ value: "decommissioned",
2698
+ label: { en: "Decommissioned", pt: "Desativado" }
2699
+ },
2700
+ { value: "abandoned", label: { en: "Abandoned", pt: "Abandonado" } }
2701
+ ]);
2702
+ var PERMIT_ADMINISTRATIVE_STATUSES = closedVocab()([
2703
+ { value: "requested", label: { en: "Requested", pt: "Requerida" } },
2704
+ { value: "granted", label: { en: "Granted", pt: "Concedida" } },
2705
+ { value: "suspended", label: { en: "Suspended", pt: "Suspensa" } },
2706
+ { value: "revoked", label: { en: "Revoked", pt: "Revogada" } },
2707
+ { value: "denied", label: { en: "Denied", pt: "Indeferida" } },
2708
+ { value: "withdrawn", label: { en: "Withdrawn", pt: "Cancelada" } }
2709
+ ]);
2710
+ var VOLUME_LIMIT_PERIODS = closedVocab()([
2711
+ { value: "daily", label: { en: "Daily", pt: "Di\xE1rio" } },
2712
+ { value: "monthly", label: { en: "Monthly", pt: "Mensal" } },
2713
+ { value: "annual", label: { en: "Annual", pt: "Anual" } }
2714
+ ]);
2715
+ var PRODUCTION_ENTRY_TYPES = closedVocab()([
2716
+ {
2717
+ value: "meter_reading",
2718
+ label: { en: "Meter reading", pt: "Leitura de hidr\xF4metro" }
2719
+ },
2720
+ {
2721
+ value: "estimated_volume",
2722
+ label: { en: "Estimated volume", pt: "Volume estimado" }
2723
+ }
2724
+ ]);
2725
+ var RESULT_QUALIFIERS = closedVocab()([
2726
+ { value: "<", label: { en: "< less than", pt: "< menor que" } },
2727
+ { value: ">", label: { en: "> greater than", pt: "> maior que" } },
2728
+ { value: "not_detected", label: { en: "Not detected", pt: "N\xE3o detectado" } },
2729
+ { value: "estimated", label: { en: "Estimated", pt: "Estimado" } }
2730
+ ]);
2731
+ var RESULT_FRACTIONS = closedVocab()([
2732
+ { value: "total", label: { en: "Total", pt: "Total" } },
2733
+ { value: "dissolved", label: { en: "Dissolved", pt: "Dissolvida" } },
2734
+ { value: "suspended", label: { en: "Suspended", pt: "Suspensa" } }
2735
+ ]);
2736
+ var MEASUREMENT_LOCATIONS = closedVocab()([
2737
+ { value: "field", label: { en: "Field", pt: "Campo" } },
2738
+ { value: "lab", label: { en: "Lab", pt: "Laborat\xF3rio" } }
2739
+ ]);
2740
+ var VALIDATION_STATUSES = closedVocab()([
2741
+ { value: "unvalidated", label: { en: "Unvalidated", pt: "N\xE3o validado" } },
2742
+ { value: "validated", label: { en: "Validated", pt: "Validado" } },
2743
+ { value: "qualified", label: { en: "Qualified", pt: "Qualificado" } },
2744
+ { value: "rejected", label: { en: "Rejected", pt: "Rejeitado" } }
2745
+ ]);
2746
+ var PARAMETER_GROUPS = closedVocab()([
2747
+ {
2748
+ value: "physical",
2749
+ label: { en: "Physical / field", pt: "F\xEDsico / campo" }
2750
+ },
2751
+ { value: "aggregate", label: { en: "Aggregate", pt: "Agregados" } },
2752
+ { value: "major_ion", label: { en: "Major ions", pt: "\xCDons maiores" } },
2753
+ { value: "nutrient", label: { en: "Nutrients", pt: "Nutrientes" } },
2754
+ { value: "organic", label: { en: "Organic", pt: "Org\xE2nicos" } },
2755
+ { value: "disinfection", label: { en: "Disinfection", pt: "Desinfec\xE7\xE3o" } },
2756
+ {
2757
+ value: "mining_redox",
2758
+ label: { en: "Mining and redox", pt: "Minera\xE7\xE3o e redox" }
2759
+ },
2760
+ { value: "metal", label: { en: "Metals / trace", pt: "Metais / tra\xE7o" } },
2761
+ { value: "microbiology", label: { en: "Microbiology", pt: "Microbiologia" } },
2762
+ {
2763
+ value: "radioactivity",
2764
+ label: { en: "Radioactivity", pt: "Radioatividade" }
2765
+ }
2766
+ ]);
2767
+ var WELL_STATUS_VALUES = valuesOf(WELL_STATUSES);
2768
+ var PERMIT_ADMINISTRATIVE_STATUS_VALUES = valuesOf(
2769
+ PERMIT_ADMINISTRATIVE_STATUSES
2770
+ );
2771
+ var QUALIFIER_VALUES = valuesOf(RESULT_QUALIFIERS);
2772
+ var FRACTION_VALUES = valuesOf(RESULT_FRACTIONS);
2773
+ var MEASURED_IN_VALUES = valuesOf(MEASUREMENT_LOCATIONS);
2774
+ var FILTRATION_LOCATION_VALUES = valuesOf(MEASUREMENT_LOCATIONS);
2775
+ var VALIDATION_STATUS_VALUES = valuesOf(VALIDATION_STATUSES);
2776
+ var PARAMETER_GROUP_VALUES = valuesOf(PARAMETER_GROUPS);
2777
+ var NUMERIC_QUALIFIERS = [
2778
+ "<",
2779
+ ">",
2780
+ "estimated"
2781
+ ];
2782
+ var PARENT_SAMPLE_TYPES = [
2783
+ "field_duplicate",
2784
+ "split_sample"
2785
+ ];
2786
+ var BLANK_SAMPLE_TYPES = [
2787
+ "field_blank",
2788
+ "trip_blank",
2789
+ "equipment_blank"
2790
+ ];
2791
+
2792
+ // src/vocab/waterSample.vocab.ts
2793
+ var SAMPLE_TYPES = [
2794
+ { value: "routine", label: { en: "Routine", pt: "Rotina" } },
2795
+ {
2796
+ value: "field_duplicate",
2797
+ label: { en: "Field duplicate", pt: "Duplicata de campo" }
2798
+ },
2799
+ {
2800
+ value: "split_sample",
2801
+ label: { en: "Split sample", pt: "Amostra dividida (split)" }
2802
+ },
2803
+ { value: "field_blank", label: { en: "Field blank", pt: "Branco de campo" } },
2804
+ {
2805
+ value: "trip_blank",
2806
+ label: { en: "Trip blank", pt: "Branco de transporte" }
2807
+ },
2808
+ {
2809
+ value: "equipment_blank",
2810
+ label: { en: "Equipment blank", pt: "Branco de equipamento" }
2811
+ }
2812
+ ];
2813
+ var SAMPLING_METHODS = [
2814
+ {
2815
+ value: "low_flow",
2816
+ label: { en: "Low flow", pt: "Purga de baixa vaz\xE3o (micropurga)" }
2817
+ },
2818
+ {
2819
+ value: "volumetric_purge",
2820
+ label: { en: "Volumetric purge", pt: "Purga de volume determinado" }
2821
+ },
2822
+ { value: "no_purge", label: { en: "No purge", pt: "Amostragem sem purga" } },
2823
+ {
2824
+ value: "pump_discharge",
2825
+ label: { en: "Pump discharge", pt: "Bomba de produ\xE7\xE3o em opera\xE7\xE3o" }
2826
+ }
2827
+ ];
2828
+ var SAMPLING_POINT_TYPES = [
2829
+ {
2830
+ value: "pump_discharge",
2831
+ label: { en: "Pump discharge", pt: "Sa\xEDda da bomba de produ\xE7\xE3o" }
2832
+ },
2833
+ {
2834
+ value: "wellhead_tap",
2835
+ label: { en: "Wellhead tap", pt: "Torneira do cavalete" }
2836
+ },
2837
+ { value: "in_well", label: { en: "In well", pt: "Dentro do po\xE7o" } }
2838
+ ];
2839
+ var SAMPLING_DEVICES = [
2840
+ {
2841
+ value: "bailer",
2842
+ label: { en: "Bailer", pt: "Bailer (amostrador de reten\xE7\xE3o)" }
2843
+ },
2844
+ {
2845
+ value: "discrete_depth_sampler",
2846
+ label: {
2847
+ en: "Discrete depth sampler",
2848
+ pt: "Amostrador pontual de profundidade"
2849
+ }
2850
+ },
2851
+ {
2852
+ value: "passive_diffusion_bag",
2853
+ label: { en: "Passive diffusion bag", pt: "Bolsa de difus\xE3o passiva" }
2854
+ },
2855
+ {
2856
+ value: "grab_sleeve",
2857
+ label: {
2858
+ en: "Grab sleeve (HydraSleeve)",
2859
+ pt: "Amostrador passivo tipo luva (HydraSleeve)"
2860
+ }
2861
+ },
2862
+ {
2863
+ value: "low_flow_pump",
2864
+ label: { en: "Low-flow pump", pt: "Bomba de baixa vaz\xE3o" }
2865
+ },
2866
+ {
2867
+ value: "packer_pump",
2868
+ label: { en: "Packer pump", pt: "Bomba com obturador (packer)" }
2869
+ }
2870
+ ];
2871
+
948
2872
  // src/utils/units.ts
949
2873
  var FEET_PER_METER = 3.280839895;
950
2874
  var METERS_PER_FOOT = 0.3048;
@@ -954,6 +2878,11 @@ var M3H_TO_USGPM = 4.402867361;
954
2878
  var M2S_TO_M2D = 86400;
955
2879
  var PSI_PER_KPA = 0.145037738;
956
2880
  var SLOT_MM = 0.0254;
2881
+ var KW_PER_CV = 0.73549875;
2882
+ var KW_PER_HP = 0.745699872;
2883
+ var LITERS_PER_M3 = 1e3;
2884
+ var FT3_PER_M3 = 35.314666721;
2885
+ var USGAL_PER_M3 = 264.172052358;
957
2886
  function metersToFeet(m) {
958
2887
  return m * FEET_PER_METER;
959
2888
  }
@@ -978,6 +2907,68 @@ function cubicMeterPerHourToUsGallonsPerMinute(q) {
978
2907
  function usGallonsPerMinuteToCubicMeterPerHour(q) {
979
2908
  return q / M3H_TO_USGPM;
980
2909
  }
2910
+ function litersToCubicMeters(l) {
2911
+ return l / LITERS_PER_M3;
2912
+ }
2913
+ function cubicMetersToLiters(m3) {
2914
+ return m3 * LITERS_PER_M3;
2915
+ }
2916
+ function cubicMetersToCubicFeet(m3) {
2917
+ return m3 * FT3_PER_M3;
2918
+ }
2919
+ function cubicFeetToCubicMeters(ft3) {
2920
+ return ft3 / FT3_PER_M3;
2921
+ }
2922
+ function cubicMetersToUsGallons(m3) {
2923
+ return m3 * USGAL_PER_M3;
2924
+ }
2925
+ function usGallonsToCubicMeters(gal) {
2926
+ return gal / USGAL_PER_M3;
2927
+ }
2928
+ function cvToKilowatts(cv) {
2929
+ return cv * KW_PER_CV;
2930
+ }
2931
+ function kilowattsToCv(kw) {
2932
+ return kw / KW_PER_CV;
2933
+ }
2934
+ function hpToKilowatts(hp) {
2935
+ return hp * KW_PER_HP;
2936
+ }
2937
+ function kilowattsToHp(kw) {
2938
+ return kw / KW_PER_HP;
2939
+ }
2940
+ function flowFromCanonical(m3h, unit) {
2941
+ if (unit === "L/s") return cubicMeterPerHourToLitersPerSecond(m3h);
2942
+ if (unit === "gpm") return cubicMeterPerHourToUsGallonsPerMinute(m3h);
2943
+ return m3h;
2944
+ }
2945
+ function flowToCanonical(value, unit) {
2946
+ if (unit === "L/s") return litersPerSecondToCubicMeterPerHour(value);
2947
+ if (unit === "gpm") return usGallonsPerMinuteToCubicMeterPerHour(value);
2948
+ return value;
2949
+ }
2950
+ function powerFromCanonical(kw, unit) {
2951
+ if (unit === "cv") return kilowattsToCv(kw);
2952
+ if (unit === "hp") return kilowattsToHp(kw);
2953
+ return kw;
2954
+ }
2955
+ function powerToCanonical(value, unit) {
2956
+ if (unit === "cv") return cvToKilowatts(value);
2957
+ if (unit === "hp") return hpToKilowatts(value);
2958
+ return value;
2959
+ }
2960
+ function volumeFromCanonical(m3, unit) {
2961
+ if (unit === "L") return cubicMetersToLiters(m3);
2962
+ if (unit === "ft3") return cubicMetersToCubicFeet(m3);
2963
+ if (unit === "gal") return cubicMetersToUsGallons(m3);
2964
+ return m3;
2965
+ }
2966
+ function volumeToCanonical(value, unit) {
2967
+ if (unit === "L") return litersToCubicMeters(value);
2968
+ if (unit === "ft3") return cubicFeetToCubicMeters(value);
2969
+ if (unit === "gal") return usGallonsToCubicMeters(value);
2970
+ return value;
2971
+ }
981
2972
  function squareMeterPerSecondToSquareMeterPerDay(t) {
982
2973
  return t * M2S_TO_M2D;
983
2974
  }
@@ -1015,62 +3006,225 @@ function minutesToHours(min) {
1015
3006
  function hoursToMinutes(h) {
1016
3007
  return h * 60;
1017
3008
  }
3009
+ var MG_L_PER_UNIT = {
3010
+ "g/L": 1e3,
3011
+ "mg/L": 1,
3012
+ "ug/L": 1e-3,
3013
+ "ng/L": 1e-6
3014
+ };
3015
+ function concentrationToCanonical(value, unit) {
3016
+ return value * MG_L_PER_UNIT[unit];
3017
+ }
3018
+ function concentrationFromCanonical(mgL, unit) {
3019
+ return mgL / MG_L_PER_UNIT[unit];
3020
+ }
3021
+ function milliSiemensPerMeterToMicroSiemensPerCm(mSm) {
3022
+ return mSm * 10;
3023
+ }
3024
+ function milliSiemensPerCmToMicroSiemensPerCm(mScm) {
3025
+ return mScm * 1e3;
3026
+ }
3027
+ function normalizeColorUnit(unit) {
3028
+ const u = unit.trim().toLowerCase().replace(/\s+/g, "");
3029
+ return ["uh", "hazen", "mgpt-co/l", "mgpt/l", "pt-co", "pcu", "tcu"].includes(
3030
+ u
3031
+ ) ? "uH" : void 0;
3032
+ }
3033
+ function turbidityCodeForUnit(unit) {
3034
+ switch (unit.trim().toUpperCase()) {
3035
+ case "NTU":
3036
+ return "turbidity_ntu";
3037
+ case "FNU":
3038
+ return "turbidity_fnu";
3039
+ case "FAU":
3040
+ return "turbidity_fau";
3041
+ case "FTU":
3042
+ case "UT":
3043
+ return "turbidity";
3044
+ default:
3045
+ return void 0;
3046
+ }
3047
+ }
3048
+ function expandedToStandardUncertainty(expanded, coverageFactor = 2) {
3049
+ return expanded / coverageFactor;
3050
+ }
1018
3051
  export {
3052
+ AQUIFER_ANALYSIS_METHODS,
1019
3053
  AirliftEventSchema,
1020
3054
  AquiferAnalysisSchema,
1021
3055
  AttachmentSchema,
3056
+ BLANK_SAMPLE_TYPES,
3057
+ BR_GM_MS_888_2021,
1022
3058
  BoreHoleSchema,
3059
+ CEMENT_PAD_TYPES,
3060
+ CENTRALIZER_TYPES,
3061
+ CONDITION_CATEGORIES,
3062
+ CONSTRUCTION_MATERIALS,
1023
3063
  CaveSchema,
1024
3064
  CementPadSchema,
3065
+ CentralizerSchema,
3066
+ ConditionFulfillmentSchema,
1025
3067
  ConstantRateEventSchema,
3068
+ DOCUMENT_TYPES,
3069
+ DOCUMENT_TYPE_SUGGESTIONS,
3070
+ DRILLING_METHODS,
3071
+ ESTIMATION_METHODS,
3072
+ EU_2020_2184,
3073
+ EstimatedVolumeSchema,
1026
3074
  FGDC_TEXTURES_OPTIONS,
3075
+ FILTRATION_LOCATION_VALUES,
3076
+ FRACTION_VALUES,
3077
+ FiltrationSchema,
1027
3078
  FractureSchema,
3079
+ HISTORY_LOG_CATEGORIES,
3080
+ HISTORY_LOG_SEVERITIES,
3081
+ HYDRODYNAMIC_EVENT_TYPES,
1028
3082
  HistoryLogEntrySchema,
1029
3083
  HoleFillSchema,
1030
3084
  HydrodynamicEventBaseSchema,
1031
3085
  HydrodynamicEventSchema,
3086
+ LaboratorySchema,
1032
3087
  LevelReadingSchema,
1033
3088
  LithologySchema,
1034
3089
  LocationPropertiesSchema,
1035
3090
  LocationSchema,
3091
+ MAINTENANCE_TYPES,
3092
+ MEASURED_IN_VALUES,
3093
+ MEASUREMENT_LOCATIONS,
3094
+ MEASUREMENT_METHODS,
3095
+ METER_TYPES,
3096
+ MeterReadingSchema,
3097
+ MeterSchema,
3098
+ MonthlyGrantSchema,
3099
+ NEPHELOMETRIC_TURBIDITY_CODES,
3100
+ NUMERIC_QUALIFIERS,
3101
+ OperatingRegimeSchema,
3102
+ PARAMETER_GROUPS,
3103
+ PARAMETER_GROUP_VALUES,
3104
+ PARENT_SAMPLE_TYPES,
3105
+ PERMIT_ADMINISTRATIVE_STATUSES,
3106
+ PERMIT_ADMINISTRATIVE_STATUS_VALUES,
3107
+ PERMIT_HISTORY_TYPES,
3108
+ PERMIT_TYPES,
3109
+ POWER_SOURCES,
3110
+ PRODUCTION_ENTRY_TYPES,
3111
+ PUMP_TYPES,
3112
+ ParameterSchema,
3113
+ PermitAdministrativeStatusSchema,
3114
+ PermitConditionSchema,
3115
+ PermitHistoryEntrySchema,
3116
+ PermitSchema,
3117
+ ProductionEntryBaseSchema,
3118
+ ProductionEntrySchema,
3119
+ PumpElectricalSchema,
3120
+ PumpInstallationSchema,
1036
3121
  PumpingStepSchema,
3122
+ PurgeReadingSchema,
3123
+ PurgeSchema,
3124
+ QUALIFIER_VALUES,
3125
+ READING_SOURCES,
3126
+ RESULT_FRACTIONS,
3127
+ RESULT_QUALIFIERS,
1037
3128
  RecoveryOnlyEventSchema,
1038
3129
  RecoveryPhaseSchema,
1039
3130
  ReductionSchema,
3131
+ ResultQualifierSchema,
3132
+ ResultValidationSchema,
3133
+ SAMPLE_TYPES,
3134
+ SAMPLING_DEVICES,
3135
+ SAMPLING_METHODS,
3136
+ SAMPLING_POINT_TYPES,
3137
+ SCREEN_SLOT_TYPES,
1040
3138
  SECTION_KEYS,
3139
+ SamplingPointSchema,
1041
3140
  SpotMeasurementEventSchema,
1042
3141
  StepDrawdownEventSchema,
1043
3142
  SurfaceCaseSchema,
1044
3143
  TextureSchema,
3144
+ TimeResolutionSchema,
3145
+ VALIDATION_STATUSES,
3146
+ VALIDATION_STATUS_VALUES,
3147
+ VISIBILITY_LEAF_KEYS,
3148
+ VISIBILITY_TREE,
3149
+ VOLUME_LIMIT_PERIODS,
3150
+ VolumeLimitSchema,
3151
+ WATER_QUALITY_LIMIT_SETS,
3152
+ WATER_QUALITY_PARAMETERS,
3153
+ WATER_QUALITY_UNITS,
3154
+ WATER_QUALITY_VOCABULARY_VERSION,
3155
+ WATER_USES,
3156
+ WELL_PURPOSES,
3157
+ WELL_STATUSES,
3158
+ WELL_STATUS_VALUES,
3159
+ WELL_TYPES,
3160
+ WHO_GDWQ_2022,
3161
+ WaterQualityResultSchema,
3162
+ WaterSampleSchema,
1045
3163
  WellCaseSchema,
1046
3164
  WellIdSchema,
1047
3165
  WellSchema,
1048
3166
  WellScreenSchema,
3167
+ WellStatusSchema,
3168
+ calculatedWellDepth,
1049
3169
  checkIfProfileIsEmpty,
3170
+ concentrationFromCanonical,
3171
+ concentrationToCanonical,
1050
3172
  convertProfileFromJSON,
3173
+ cubicFeetToCubicMeters,
1051
3174
  cubicMeterPerHourToLitersPerSecond,
1052
3175
  cubicMeterPerHourToUsGallonsPerMinute,
3176
+ cubicMetersToCubicFeet,
3177
+ cubicMetersToLiters,
3178
+ cubicMetersToUsGallons,
3179
+ cvToKilowatts,
1053
3180
  decimalDegreesToDms,
1054
3181
  deserializeWell,
1055
3182
  dmsToDecimalDegrees,
3183
+ expandedToStandardUncertainty,
1056
3184
  feetToMeters,
3185
+ flowFromCanonical,
3186
+ flowToCanonical,
3187
+ formatVocabList,
3188
+ getLimitSet,
3189
+ getParameterDefinition,
3190
+ getParameterLabel,
3191
+ getVocabEntry,
3192
+ getVocabLabel,
1057
3193
  hoursToMinutes,
3194
+ hpToKilowatts,
1058
3195
  inchesToMm,
3196
+ isKnownParameter,
3197
+ isVocabValue,
1059
3198
  isWellEmpty,
1060
3199
  kilopascalToPsi,
3200
+ kilowattsToCv,
3201
+ kilowattsToHp,
1061
3202
  litersPerSecondToCubicMeterPerHour,
3203
+ litersToCubicMeters,
1062
3204
  metersToFeet,
3205
+ milliSiemensPerCmToMicroSiemensPerCm,
3206
+ milliSiemensPerMeterToMicroSiemensPerCm,
1063
3207
  minutesToHours,
1064
3208
  mmToInches,
1065
3209
  mmToSlotNumber,
3210
+ normalizeColorUnit,
3211
+ parameterKey,
1066
3212
  parseWell,
3213
+ powerFromCanonical,
3214
+ powerToCanonical,
1067
3215
  profileToWell,
1068
3216
  psiToKilopascal,
1069
3217
  redactWell,
3218
+ resolveLanguageText,
1070
3219
  serializeWell,
1071
3220
  slotNumberToMm,
1072
3221
  squareMeterPerDayToSquareMeterPerSecond,
1073
3222
  squareMeterPerSecondToSquareMeterPerDay,
1074
- usGallonsPerMinuteToCubicMeterPerHour
3223
+ turbidityCodeForUnit,
3224
+ usGallonsPerMinuteToCubicMeterPerHour,
3225
+ usGallonsToCubicMeters,
3226
+ vocabValues,
3227
+ volumeFromCanonical,
3228
+ volumeToCanonical
1075
3229
  };
1076
3230
  //# sourceMappingURL=index.js.map