@glandais/vcyclist-engine 4.3.0 → 5.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/vcyclist-gpx.js CHANGED
@@ -107,20 +107,23 @@
107
107
  var longArray = kotlin_kotlin.$_$.e7;
108
108
  var multiply = kotlin_kotlin.$_$.u5;
109
109
  var isInfinite = kotlin_kotlin.$_$.na;
110
- var charSequenceGet = kotlin_kotlin.$_$.h6;
111
- var replace = kotlin_kotlin.$_$.z8;
112
110
  var toString_1 = kotlin_kotlin.$_$.g;
113
111
  var Char__hashCode_impl_otmys = kotlin_kotlin.$_$.d;
114
112
  var getBooleanHashCode = kotlin_kotlin.$_$.p6;
113
+ var charSequenceGet = kotlin_kotlin.$_$.h6;
114
+ var replace = kotlin_kotlin.$_$.z8;
115
115
  var get_lastIndex = kotlin_kotlin.$_$.o3;
116
116
  var toString_2 = kotlin_kotlin.$_$.m9;
117
+ var ElevationSmoother_instance = kotlin_io_github_glandais_elevation.$_$.c;
118
+ var equals_0 = kotlin_kotlin.$_$.p8;
119
+ var joinToString = kotlin_kotlin.$_$.m3;
120
+ var isFinite = kotlin_kotlin.$_$.ma;
117
121
  var CoroutineImpl = kotlin_kotlin.$_$.d5;
118
- var LatLon = kotlin_io_github_glandais_elevation.$_$.f;
122
+ var LatLon = kotlin_io_github_glandais_elevation.$_$.g;
119
123
  var get_COROUTINE_SUSPENDED = kotlin_kotlin.$_$.o4;
120
124
  var initMetadataForCoroutine = kotlin_kotlin.$_$.w6;
121
- var ElevationSmoother_instance = kotlin_io_github_glandais_elevation.$_$.c;
122
125
  var until = kotlin_kotlin.$_$.z7;
123
- var LatLonElevation = kotlin_io_github_glandais_elevation.$_$.e;
126
+ var LatLonElevation = kotlin_io_github_glandais_elevation.$_$.f;
124
127
  var arrayCopy = kotlin_kotlin.$_$.t2;
125
128
  var Distance_instance = kotlin_io_github_glandais_elevation.$_$.a;
126
129
  var DouglasPeucker_instance = kotlin_io_github_glandais_elevation.$_$.b;
@@ -150,19 +153,27 @@
150
153
  initMetadataForClass(RepairResult, 'RepairResult');
151
154
  initMetadataForObject(OsmHighway, 'OsmHighway');
152
155
  initMetadataForObject(CsvNumberFormat, 'CsvNumberFormat');
153
- initMetadataForObject(CsvWriter, 'CsvWriter');
154
156
  initMetadataForClass(CsvOptions, 'CsvOptions', CsvOptions);
155
- initMetadataForObject(JsonWriter, 'JsonWriter');
157
+ initMetadataForObject(CsvWriter, 'CsvWriter');
156
158
  initMetadataForClass(JsonOptions, 'JsonOptions', JsonOptions);
159
+ initMetadataForObject(JsonWriter, 'JsonWriter');
160
+ initMetadataForCompanion(Companion_1);
161
+ initMetadataForClass(ElevationGainResult, 'ElevationGainResult');
162
+ initMetadataForClass(Banked, 'Banked');
163
+ initMetadataForObject(ElevationGain, 'ElevationGain');
164
+ initMetadataForCompanion(Companion_2);
165
+ initMetadataForClass(ElevationGainPreset, 'ElevationGainPreset', VOID, Enum);
166
+ initMetadataForCompanion(Companion_3);
167
+ initMetadataForClass(ElevationGainOptions, 'ElevationGainOptions', ElevationGainOptions);
157
168
  initMetadataForCoroutine($fixElevationCOROUTINE$, CoroutineImpl);
158
169
  initMetadataForObject(ElevationStep, 'ElevationStep', VOID, VOID, VOID, [2]);
159
170
  initMetadataForClass(GeneratedPath, 'GeneratedPath');
160
- initMetadataForCompanion(Companion_1);
171
+ initMetadataForCompanion(Companion_4);
161
172
  initMetadataForClass(BoundsRad, 'BoundsRad');
162
- initMetadataForCompanion(Companion_2);
173
+ initMetadataForCompanion(Companion_5);
163
174
  initMetadataForClass(Path, 'Path', VOID, GeneratedPath);
164
175
  initMetadataForObject(PathSimplifier, 'PathSimplifier');
165
- initMetadataForCompanion(Companion_3);
176
+ initMetadataForCompanion(Companion_6);
166
177
  initMetadataForClass(PointField, 'PointField', VOID, Enum);
167
178
  initMetadataForClass(PointFieldCategory, 'PointFieldCategory', VOID, Enum);
168
179
  initMetadataForClass(Copy, 'Copy');
@@ -2307,6 +2318,46 @@
2307
2318
  new CsvNumberFormat();
2308
2319
  return CsvNumberFormat_instance;
2309
2320
  }
2321
+ function CsvOptions(fields, separator, unitsInHeader, decimals, lineSeparator) {
2322
+ fields = fields === VOID ? null : fields;
2323
+ separator = separator === VOID ? _Char___init__impl__6a9atx(44) : separator;
2324
+ unitsInHeader = unitsInHeader === VOID ? true : unitsInHeader;
2325
+ decimals = decimals === VOID ? null : decimals;
2326
+ lineSeparator = lineSeparator === VOID ? '\n' : lineSeparator;
2327
+ this.fields_1 = fields;
2328
+ this.separator_1 = separator;
2329
+ this.unitsInHeader_1 = unitsInHeader;
2330
+ this.decimals_1 = decimals;
2331
+ this.lineSeparator_1 = lineSeparator;
2332
+ }
2333
+ protoOf(CsvOptions).toString = function () {
2334
+ return 'CsvOptions(fields=' + toString(this.fields_1) + ', separator=' + toString_1(this.separator_1) + ', unitsInHeader=' + this.unitsInHeader_1 + ', decimals=' + this.decimals_1 + ', lineSeparator=' + this.lineSeparator_1 + ')';
2335
+ };
2336
+ protoOf(CsvOptions).hashCode = function () {
2337
+ var result = this.fields_1 == null ? 0 : hashCode(this.fields_1);
2338
+ result = imul(result, 31) + Char__hashCode_impl_otmys(this.separator_1) | 0;
2339
+ result = imul(result, 31) + getBooleanHashCode(this.unitsInHeader_1) | 0;
2340
+ result = imul(result, 31) + (this.decimals_1 == null ? 0 : this.decimals_1) | 0;
2341
+ result = imul(result, 31) + getStringHashCode(this.lineSeparator_1) | 0;
2342
+ return result;
2343
+ };
2344
+ protoOf(CsvOptions).equals = function (other) {
2345
+ if (this === other)
2346
+ return true;
2347
+ if (!(other instanceof CsvOptions))
2348
+ return false;
2349
+ if (!equals(this.fields_1, other.fields_1))
2350
+ return false;
2351
+ if (!(this.separator_1 === other.separator_1))
2352
+ return false;
2353
+ if (!(this.unitsInHeader_1 === other.unitsInHeader_1))
2354
+ return false;
2355
+ if (!(this.decimals_1 == other.decimals_1))
2356
+ return false;
2357
+ if (!(this.lineSeparator_1 === other.lineSeparator_1))
2358
+ return false;
2359
+ return true;
2360
+ };
2310
2361
  function headerFor($this, field, unitsInHeader) {
2311
2362
  return unitsInHeader ? field.prop_1 + ' (' + field.unit_1 + ')' : field.prop_1;
2312
2363
  }
@@ -2351,7 +2402,7 @@
2351
2402
  }
2352
2403
  protoOf(CsvWriter).write_p5vnh4_k$ = function (path, options) {
2353
2404
  var tmp0_elvis_lhs = options.fields_1;
2354
- var fields = tmp0_elvis_lhs == null ? get_entries_1() : tmp0_elvis_lhs;
2405
+ var fields = tmp0_elvis_lhs == null ? get_entries_2() : tmp0_elvis_lhs;
2355
2406
  var sb = StringBuilder_init_$Create$();
2356
2407
  // Inline function 'kotlin.collections.map' call
2357
2408
  // Inline function 'kotlin.collections.mapTo' call
@@ -2388,43 +2439,38 @@
2388
2439
  function CsvWriter_getInstance() {
2389
2440
  return CsvWriter_instance;
2390
2441
  }
2391
- function CsvOptions(fields, separator, unitsInHeader, decimals, lineSeparator) {
2442
+ function JsonOptions(fields, pretty, decimals, includeMeta) {
2392
2443
  fields = fields === VOID ? null : fields;
2393
- separator = separator === VOID ? _Char___init__impl__6a9atx(44) : separator;
2394
- unitsInHeader = unitsInHeader === VOID ? true : unitsInHeader;
2444
+ pretty = pretty === VOID ? false : pretty;
2395
2445
  decimals = decimals === VOID ? null : decimals;
2396
- lineSeparator = lineSeparator === VOID ? '\n' : lineSeparator;
2446
+ includeMeta = includeMeta === VOID ? true : includeMeta;
2397
2447
  this.fields_1 = fields;
2398
- this.separator_1 = separator;
2399
- this.unitsInHeader_1 = unitsInHeader;
2448
+ this.pretty_1 = pretty;
2400
2449
  this.decimals_1 = decimals;
2401
- this.lineSeparator_1 = lineSeparator;
2450
+ this.includeMeta_1 = includeMeta;
2402
2451
  }
2403
- protoOf(CsvOptions).toString = function () {
2404
- return 'CsvOptions(fields=' + toString(this.fields_1) + ', separator=' + toString_1(this.separator_1) + ', unitsInHeader=' + this.unitsInHeader_1 + ', decimals=' + this.decimals_1 + ', lineSeparator=' + this.lineSeparator_1 + ')';
2452
+ protoOf(JsonOptions).toString = function () {
2453
+ return 'JsonOptions(fields=' + toString(this.fields_1) + ', pretty=' + this.pretty_1 + ', decimals=' + this.decimals_1 + ', includeMeta=' + this.includeMeta_1 + ')';
2405
2454
  };
2406
- protoOf(CsvOptions).hashCode = function () {
2455
+ protoOf(JsonOptions).hashCode = function () {
2407
2456
  var result = this.fields_1 == null ? 0 : hashCode(this.fields_1);
2408
- result = imul(result, 31) + Char__hashCode_impl_otmys(this.separator_1) | 0;
2409
- result = imul(result, 31) + getBooleanHashCode(this.unitsInHeader_1) | 0;
2457
+ result = imul(result, 31) + getBooleanHashCode(this.pretty_1) | 0;
2410
2458
  result = imul(result, 31) + (this.decimals_1 == null ? 0 : this.decimals_1) | 0;
2411
- result = imul(result, 31) + getStringHashCode(this.lineSeparator_1) | 0;
2459
+ result = imul(result, 31) + getBooleanHashCode(this.includeMeta_1) | 0;
2412
2460
  return result;
2413
2461
  };
2414
- protoOf(CsvOptions).equals = function (other) {
2462
+ protoOf(JsonOptions).equals = function (other) {
2415
2463
  if (this === other)
2416
2464
  return true;
2417
- if (!(other instanceof CsvOptions))
2465
+ if (!(other instanceof JsonOptions))
2418
2466
  return false;
2419
2467
  if (!equals(this.fields_1, other.fields_1))
2420
2468
  return false;
2421
- if (!(this.separator_1 === other.separator_1))
2422
- return false;
2423
- if (!(this.unitsInHeader_1 === other.unitsInHeader_1))
2469
+ if (!(this.pretty_1 === other.pretty_1))
2424
2470
  return false;
2425
2471
  if (!(this.decimals_1 == other.decimals_1))
2426
2472
  return false;
2427
- if (!(this.lineSeparator_1 === other.lineSeparator_1))
2473
+ if (!(this.includeMeta_1 === other.includeMeta_1))
2428
2474
  return false;
2429
2475
  return true;
2430
2476
  };
@@ -2440,6 +2486,10 @@
2440
2486
  sb.append_58al37_k$(_Char___init__impl__6a9atx(44)).append_22ad7x_k$(nl);
2441
2487
  appendKeyValueRaw($this, sb, inner, 'elevationLoss', numberOrNull($this, path.elevationLoss_1, decimals), colon);
2442
2488
  sb.append_58al37_k$(_Char___init__impl__6a9atx(44)).append_22ad7x_k$(nl);
2489
+ appendKeyValueRaw($this, sb, inner, 'elevationGainFiltered', numberOrNull($this, path.elevationGainFiltered_1, decimals), colon);
2490
+ sb.append_58al37_k$(_Char___init__impl__6a9atx(44)).append_22ad7x_k$(nl);
2491
+ appendKeyValueRaw($this, sb, inner, 'elevationLossFiltered', numberOrNull($this, path.elevationLossFiltered_1, decimals), colon);
2492
+ sb.append_58al37_k$(_Char___init__impl__6a9atx(44)).append_22ad7x_k$(nl);
2443
2493
  appendKeyRaw($this, sb, inner, 'units', colon);
2444
2494
  sb.append_58al37_k$(_Char___init__impl__6a9atx(123)).append_22ad7x_k$(nl);
2445
2495
  var innerUnits = inner + indent;
@@ -2510,7 +2560,7 @@
2510
2560
  }
2511
2561
  protoOf(JsonWriter).write_lwqeog_k$ = function (path, options) {
2512
2562
  var tmp0_elvis_lhs = options.fields_1;
2513
- var fields = tmp0_elvis_lhs == null ? get_entries_1() : tmp0_elvis_lhs;
2563
+ var fields = tmp0_elvis_lhs == null ? get_entries_2() : tmp0_elvis_lhs;
2514
2564
  var sb = StringBuilder_init_$Create$();
2515
2565
  var indent = options.pretty_1 ? ' ' : '';
2516
2566
  var nl = options.pretty_1 ? '\n' : '';
@@ -2562,41 +2612,361 @@
2562
2612
  function JsonWriter_getInstance() {
2563
2613
  return JsonWriter_instance;
2564
2614
  }
2565
- function JsonOptions(fields, pretty, decimals, includeMeta) {
2566
- fields = fields === VOID ? null : fields;
2567
- pretty = pretty === VOID ? false : pretty;
2568
- decimals = decimals === VOID ? null : decimals;
2569
- includeMeta = includeMeta === VOID ? true : includeMeta;
2570
- this.fields_1 = fields;
2571
- this.pretty_1 = pretty;
2572
- this.decimals_1 = decimals;
2573
- this.includeMeta_1 = includeMeta;
2615
+ function Companion_1() {
2574
2616
  }
2575
- protoOf(JsonOptions).toString = function () {
2576
- return 'JsonOptions(fields=' + toString(this.fields_1) + ', pretty=' + this.pretty_1 + ', decimals=' + this.decimals_1 + ', includeMeta=' + this.includeMeta_1 + ')';
2617
+ protoOf(Companion_1).empty_meutc3_k$ = function (options) {
2618
+ return new ElevationGainResult(0.0, 0.0, 0.0, 0.0, options.thresholdM_1, options.smoothWindowM_1, 0);
2577
2619
  };
2578
- protoOf(JsonOptions).hashCode = function () {
2579
- var result = this.fields_1 == null ? 0 : hashCode(this.fields_1);
2580
- result = imul(result, 31) + getBooleanHashCode(this.pretty_1) | 0;
2581
- result = imul(result, 31) + (this.decimals_1 == null ? 0 : this.decimals_1) | 0;
2582
- result = imul(result, 31) + getBooleanHashCode(this.includeMeta_1) | 0;
2620
+ var Companion_instance_2;
2621
+ function Companion_getInstance_2() {
2622
+ return Companion_instance_2;
2623
+ }
2624
+ function ElevationGainResult(gainM, lossM, rawGainM, rawLossM, thresholdM, smoothWindowM, legCount) {
2625
+ this.gainM_1 = gainM;
2626
+ this.lossM_1 = lossM;
2627
+ this.rawGainM_1 = rawGainM;
2628
+ this.rawLossM_1 = rawLossM;
2629
+ this.thresholdM_1 = thresholdM;
2630
+ this.smoothWindowM_1 = smoothWindowM;
2631
+ this.legCount_1 = legCount;
2632
+ }
2633
+ protoOf(ElevationGainResult).toString = function () {
2634
+ return 'ElevationGainResult(gainM=' + this.gainM_1 + ', lossM=' + this.lossM_1 + ', rawGainM=' + this.rawGainM_1 + ', rawLossM=' + this.rawLossM_1 + ', thresholdM=' + this.thresholdM_1 + ', smoothWindowM=' + this.smoothWindowM_1 + ', legCount=' + this.legCount_1 + ')';
2635
+ };
2636
+ protoOf(ElevationGainResult).hashCode = function () {
2637
+ var result = getNumberHashCode(this.gainM_1);
2638
+ result = imul(result, 31) + getNumberHashCode(this.lossM_1) | 0;
2639
+ result = imul(result, 31) + getNumberHashCode(this.rawGainM_1) | 0;
2640
+ result = imul(result, 31) + getNumberHashCode(this.rawLossM_1) | 0;
2641
+ result = imul(result, 31) + getNumberHashCode(this.thresholdM_1) | 0;
2642
+ result = imul(result, 31) + getNumberHashCode(this.smoothWindowM_1) | 0;
2643
+ result = imul(result, 31) + this.legCount_1 | 0;
2583
2644
  return result;
2584
2645
  };
2585
- protoOf(JsonOptions).equals = function (other) {
2646
+ protoOf(ElevationGainResult).equals = function (other) {
2586
2647
  if (this === other)
2587
2648
  return true;
2588
- if (!(other instanceof JsonOptions))
2649
+ if (!(other instanceof ElevationGainResult))
2589
2650
  return false;
2590
- if (!equals(this.fields_1, other.fields_1))
2651
+ if (!equals(this.gainM_1, other.gainM_1))
2591
2652
  return false;
2592
- if (!(this.pretty_1 === other.pretty_1))
2653
+ if (!equals(this.lossM_1, other.lossM_1))
2593
2654
  return false;
2594
- if (!(this.decimals_1 == other.decimals_1))
2655
+ if (!equals(this.rawGainM_1, other.rawGainM_1))
2595
2656
  return false;
2596
- if (!(this.includeMeta_1 === other.includeMeta_1))
2657
+ if (!equals(this.rawLossM_1, other.rawLossM_1))
2658
+ return false;
2659
+ if (!equals(this.thresholdM_1, other.thresholdM_1))
2660
+ return false;
2661
+ if (!equals(this.smoothWindowM_1, other.smoothWindowM_1))
2662
+ return false;
2663
+ if (!(this.legCount_1 === other.legCount_1))
2664
+ return false;
2665
+ return true;
2666
+ };
2667
+ function Banked(gainM, lossM, legCount) {
2668
+ this.gainM_1 = gainM;
2669
+ this.lossM_1 = lossM;
2670
+ this.legCount_1 = legCount;
2671
+ }
2672
+ function accumulate($this, h, threshold) {
2673
+ var gain = 0.0;
2674
+ var loss = 0.0;
2675
+ var legCount = 0;
2676
+ var hi = h[0];
2677
+ var lo = h[0];
2678
+ var iHi = 0;
2679
+ var iLo = 0;
2680
+ var dir = 0;
2681
+ var ref = h[0];
2682
+ var ext = h[0];
2683
+ var inductionVariable = 1;
2684
+ var last = h.length;
2685
+ if (inductionVariable < last)
2686
+ do {
2687
+ var i = inductionVariable;
2688
+ inductionVariable = inductionVariable + 1 | 0;
2689
+ var e = h[i];
2690
+ if (dir === 0) {
2691
+ if (e > hi) {
2692
+ hi = e;
2693
+ iHi = i;
2694
+ }
2695
+ if (e < lo) {
2696
+ lo = e;
2697
+ iLo = i;
2698
+ }
2699
+ if (hi - lo >= threshold) {
2700
+ if (iHi > iLo) {
2701
+ dir = 1;
2702
+ ref = lo;
2703
+ ext = e > hi ? e : hi;
2704
+ } else {
2705
+ dir = -1;
2706
+ ref = hi;
2707
+ ext = e < lo ? e : lo;
2708
+ }
2709
+ }
2710
+ } else if (dir > 0) {
2711
+ if (e > ext) {
2712
+ ext = e;
2713
+ } else if (ext - e >= threshold) {
2714
+ gain = gain + (ext - ref);
2715
+ legCount = legCount + 1 | 0;
2716
+ ref = ext;
2717
+ ext = e;
2718
+ dir = -1;
2719
+ }
2720
+ } else {
2721
+ if (e < ext) {
2722
+ ext = e;
2723
+ } else if (e - ext >= threshold) {
2724
+ loss = loss + (ext - ref);
2725
+ legCount = legCount + 1 | 0;
2726
+ ref = ext;
2727
+ ext = e;
2728
+ dir = 1;
2729
+ }
2730
+ }
2731
+ }
2732
+ while (inductionVariable < last);
2733
+ if (dir > 0 && ext > ref) {
2734
+ gain = gain + (ext - ref);
2735
+ legCount = legCount + 1 | 0;
2736
+ } else if (dir < 0 && ext < ref) {
2737
+ loss = loss + (ext - ref);
2738
+ legCount = legCount + 1 | 0;
2739
+ }
2740
+ return new Banked(gain, loss, legCount);
2741
+ }
2742
+ function ElevationGain() {
2743
+ }
2744
+ protoOf(ElevationGain).compute_8ftcln_k$ = function (path, options) {
2745
+ if (path.size_1 < 2)
2746
+ return Companion_instance_2.empty_meutc3_k$(options);
2747
+ var tmp = 0;
2748
+ var tmp_0 = path.size_1;
2749
+ var tmp_1 = new Float64Array(tmp_0);
2750
+ while (tmp < tmp_0) {
2751
+ var tmp_2 = tmp;
2752
+ tmp_1[tmp_2] = path.distance_5s4s77_k$(tmp_2);
2753
+ tmp = tmp + 1 | 0;
2754
+ }
2755
+ var distanceM = tmp_1;
2756
+ var tmp_3 = 0;
2757
+ var tmp_4 = path.size_1;
2758
+ var tmp_5 = new Float64Array(tmp_4);
2759
+ while (tmp_3 < tmp_4) {
2760
+ var tmp_6 = tmp_3;
2761
+ var source = path.sourceElevation_i35mcq_k$(tmp_6);
2762
+ tmp_5[tmp_6] = isNaN_0(source) ? path.elevation_iziwkb_k$(tmp_6) : source;
2763
+ tmp_3 = tmp_3 + 1 | 0;
2764
+ }
2765
+ var elevationM = tmp_5;
2766
+ return this.compute_74u9vr_k$(distanceM, elevationM, options);
2767
+ };
2768
+ protoOf(ElevationGain).annotate_eeml8q_k$ = function (path, options) {
2769
+ var result = this.compute_8ftcln_k$(path, options);
2770
+ path.elevationGainFiltered_1 = result.gainM_1;
2771
+ path.elevationLossFiltered_1 = result.lossM_1;
2772
+ return result;
2773
+ };
2774
+ protoOf(ElevationGain).compute_74u9vr_k$ = function (distanceM, elevationM, options) {
2775
+ // Inline function 'kotlin.require' call
2776
+ if (!(distanceM.length === elevationM.length)) {
2777
+ var message = 'distanceM (' + distanceM.length + ') and elevationM (' + elevationM.length + ') must have the same length';
2778
+ throw IllegalArgumentException_init_$Create$_0(toString_0(message));
2779
+ }
2780
+ if (elevationM.length < 2)
2781
+ return Companion_instance_2.empty_meutc3_k$(options);
2782
+ var profile = ElevationSmoother_instance.smoothProfile_6l6agp_k$(distanceM, elevationM, options.smoothWindowM_1);
2783
+ var rawGain = 0.0;
2784
+ var rawLoss = 0.0;
2785
+ var inductionVariable = 1;
2786
+ var last = profile.length;
2787
+ if (inductionVariable < last)
2788
+ do {
2789
+ var i = inductionVariable;
2790
+ inductionVariable = inductionVariable + 1 | 0;
2791
+ var d = profile[i] - profile[i - 1 | 0];
2792
+ if (d > 0.0)
2793
+ rawGain = rawGain + d;
2794
+ else
2795
+ rawLoss = rawLoss + d;
2796
+ }
2797
+ while (inductionVariable < last);
2798
+ if (options.thresholdM_1 <= 0.0) {
2799
+ return new ElevationGainResult(rawGain, rawLoss, rawGain, rawLoss, 0.0, options.smoothWindowM_1, 0);
2800
+ }
2801
+ var banked = accumulate(this, profile, options.thresholdM_1);
2802
+ return new ElevationGainResult(banked.gainM_1, banked.lossM_1, rawGain, rawLoss, options.thresholdM_1, options.smoothWindowM_1, banked.legCount_1);
2803
+ };
2804
+ var ElevationGain_instance;
2805
+ function ElevationGain_getInstance() {
2806
+ return ElevationGain_instance;
2807
+ }
2808
+ function ElevationGainPreset$Companion$byId$lambda(it) {
2809
+ return it.get_id_kntnx8_k$();
2810
+ }
2811
+ var static_init_called_1;
2812
+ function static_init_1() {
2813
+ if (static_init_called_1)
2814
+ return Unit_instance;
2815
+ static_init_called_1 = true;
2816
+ ElevationGainPreset_RAW_instance = new ElevationGainPreset('RAW', 0, 0.0, 0.0);
2817
+ ElevationGainPreset_BAROMETRIC_instance = new ElevationGainPreset('BAROMETRIC', 1, 2.0, 15.0);
2818
+ ElevationGainPreset_DEM_instance = new ElevationGainPreset('DEM', 2, 3.0, 30.0);
2819
+ ElevationGainPreset_GPS_instance = new ElevationGainPreset('GPS', 3, 10.0, 50.0);
2820
+ if (Companion_instance_3 == null) {
2821
+ Companion_instance;
2822
+ new Companion_2();
2823
+ }
2824
+ }
2825
+ var ElevationGainPreset_RAW_instance;
2826
+ var ElevationGainPreset_BAROMETRIC_instance;
2827
+ var ElevationGainPreset_DEM_instance;
2828
+ var ElevationGainPreset_GPS_instance;
2829
+ function Companion_2() {
2830
+ }
2831
+ protoOf(Companion_2).byId_8gmd94_k$ = function (name) {
2832
+ var tmp0 = get_entries_1();
2833
+ var tmp$ret$0;
2834
+ $l$block: {
2835
+ // Inline function 'kotlin.collections.firstOrNull' call
2836
+ var _iterator__ex2g4s = tmp0.iterator_jk1svi_k$();
2837
+ while (_iterator__ex2g4s.hasNext_bitz1p_k$()) {
2838
+ var element = _iterator__ex2g4s.next_20eer_k$();
2839
+ if (equals_0(element.get_id_kntnx8_k$(), name, true) || equals_0(element.name_1, name, true)) {
2840
+ tmp$ret$0 = element;
2841
+ break $l$block;
2842
+ }
2843
+ }
2844
+ tmp$ret$0 = null;
2845
+ }
2846
+ var tmp0_elvis_lhs = tmp$ret$0;
2847
+ var tmp;
2848
+ if (tmp0_elvis_lhs == null) {
2849
+ var tmp_0 = get_entries_1();
2850
+ throw IllegalArgumentException_init_$Create$_0("Unknown elevation gain preset '" + name + "': expected one of " + joinToString(tmp_0, ', ', VOID, VOID, VOID, VOID, ElevationGainPreset$Companion$byId$lambda));
2851
+ } else {
2852
+ tmp = tmp0_elvis_lhs;
2853
+ }
2854
+ return tmp;
2855
+ };
2856
+ var Companion_instance_3;
2857
+ function Companion_getInstance_3() {
2858
+ return Companion_instance_3;
2859
+ }
2860
+ function values_1() {
2861
+ static_init_1();
2862
+ return [ElevationGainPreset_RAW_getInstance(), ElevationGainPreset_BAROMETRIC_getInstance(), ElevationGainPreset_DEM_getInstance(), ElevationGainPreset_GPS_getInstance()];
2863
+ }
2864
+ function get_entries_1() {
2865
+ static_init_1();
2866
+ if ($ENTRIES_1 == null)
2867
+ $ENTRIES_1 = enumEntries(values_1());
2868
+ return $ENTRIES_1;
2869
+ }
2870
+ var $ENTRIES_1;
2871
+ function ElevationGainPreset(name, ordinal, thresholdM, smoothWindowM) {
2872
+ Enum.call(this, name, ordinal);
2873
+ this.thresholdM_1 = thresholdM;
2874
+ this.smoothWindowM_1 = smoothWindowM;
2875
+ }
2876
+ protoOf(ElevationGainPreset).get_id_kntnx8_k$ = function () {
2877
+ var tmp;
2878
+ switch (this.ordinal_1) {
2879
+ case 0:
2880
+ tmp = 'raw';
2881
+ break;
2882
+ case 1:
2883
+ tmp = 'barometric';
2884
+ break;
2885
+ case 2:
2886
+ tmp = 'dem';
2887
+ break;
2888
+ case 3:
2889
+ tmp = 'gps';
2890
+ break;
2891
+ default:
2892
+ noWhenBranchMatchedException();
2893
+ break;
2894
+ }
2895
+ return tmp;
2896
+ };
2897
+ function Companion_3() {
2898
+ Companion_instance_4 = this;
2899
+ this.DEFAULT_1 = new ElevationGainOptions();
2900
+ this.RAW_1 = new ElevationGainOptions(VOID, ElevationGainPreset_RAW_getInstance());
2901
+ }
2902
+ var Companion_instance_4;
2903
+ function Companion_getInstance_4() {
2904
+ if (Companion_instance_4 == null)
2905
+ new Companion_3();
2906
+ return Companion_instance_4;
2907
+ }
2908
+ function ElevationGainOptions(enabled, preset, thresholdM, smoothWindowM) {
2909
+ Companion_getInstance_4();
2910
+ enabled = enabled === VOID ? true : enabled;
2911
+ preset = preset === VOID ? ElevationGainPreset_DEM_getInstance() : preset;
2912
+ thresholdM = thresholdM === VOID ? preset.thresholdM_1 : thresholdM;
2913
+ smoothWindowM = smoothWindowM === VOID ? preset.smoothWindowM_1 : smoothWindowM;
2914
+ this.enabled_1 = enabled;
2915
+ this.preset_1 = preset;
2916
+ this.thresholdM_1 = thresholdM;
2917
+ this.smoothWindowM_1 = smoothWindowM;
2918
+ // Inline function 'kotlin.require' call
2919
+ if (!(this.thresholdM_1 >= 0.0 && isFinite(this.thresholdM_1))) {
2920
+ var message = 'thresholdM must be finite and >= 0, was ' + this.thresholdM_1;
2921
+ throw IllegalArgumentException_init_$Create$_0(toString_0(message));
2922
+ }
2923
+ // Inline function 'kotlin.require' call
2924
+ if (!(this.smoothWindowM_1 >= 0.0 && isFinite(this.smoothWindowM_1))) {
2925
+ var message_0 = 'smoothWindowM must be finite and >= 0, was ' + this.smoothWindowM_1;
2926
+ throw IllegalArgumentException_init_$Create$_0(toString_0(message_0));
2927
+ }
2928
+ }
2929
+ protoOf(ElevationGainOptions).toString = function () {
2930
+ return 'ElevationGainOptions(enabled=' + this.enabled_1 + ', preset=' + this.preset_1.toString() + ', thresholdM=' + this.thresholdM_1 + ', smoothWindowM=' + this.smoothWindowM_1 + ')';
2931
+ };
2932
+ protoOf(ElevationGainOptions).hashCode = function () {
2933
+ var result = getBooleanHashCode(this.enabled_1);
2934
+ result = imul(result, 31) + this.preset_1.hashCode() | 0;
2935
+ result = imul(result, 31) + getNumberHashCode(this.thresholdM_1) | 0;
2936
+ result = imul(result, 31) + getNumberHashCode(this.smoothWindowM_1) | 0;
2937
+ return result;
2938
+ };
2939
+ protoOf(ElevationGainOptions).equals = function (other) {
2940
+ if (this === other)
2941
+ return true;
2942
+ if (!(other instanceof ElevationGainOptions))
2943
+ return false;
2944
+ if (!(this.enabled_1 === other.enabled_1))
2945
+ return false;
2946
+ if (!this.preset_1.equals(other.preset_1))
2947
+ return false;
2948
+ if (!equals(this.thresholdM_1, other.thresholdM_1))
2949
+ return false;
2950
+ if (!equals(this.smoothWindowM_1, other.smoothWindowM_1))
2597
2951
  return false;
2598
2952
  return true;
2599
2953
  };
2954
+ function ElevationGainPreset_RAW_getInstance() {
2955
+ static_init_1();
2956
+ return ElevationGainPreset_RAW_instance;
2957
+ }
2958
+ function ElevationGainPreset_BAROMETRIC_getInstance() {
2959
+ static_init_1();
2960
+ return ElevationGainPreset_BAROMETRIC_instance;
2961
+ }
2962
+ function ElevationGainPreset_DEM_getInstance() {
2963
+ static_init_1();
2964
+ return ElevationGainPreset_DEM_instance;
2965
+ }
2966
+ function ElevationGainPreset_GPS_getInstance() {
2967
+ static_init_1();
2968
+ return ElevationGainPreset_GPS_instance;
2969
+ }
2600
2970
  function copyAllSlots($this, source) {
2601
2971
  var out = new Path(source.size_1);
2602
2972
  var inductionVariable = 0;
@@ -2605,7 +2975,7 @@
2605
2975
  do {
2606
2976
  var i = inductionVariable;
2607
2977
  inductionVariable = inductionVariable + 1 | 0;
2608
- var _iterator__ex2g4s = get_entries_1().iterator_jk1svi_k$();
2978
+ var _iterator__ex2g4s = get_entries_2().iterator_jk1svi_k$();
2609
2979
  while (_iterator__ex2g4s.hasNext_bitz1p_k$()) {
2610
2980
  var field = _iterator__ex2g4s.next_20eer_k$();
2611
2981
  out.set_b3ze83_k$(i, field, source.get_z3le6l_k$(i, field));
@@ -2711,16 +3081,15 @@
2711
3081
  do {
2712
3082
  var i = inductionVariable_0;
2713
3083
  inductionVariable_0 = inductionVariable_0 + 1 | 0;
3084
+ if (isNaN_0(out.sourceElevation_i35mcq_k$(i))) {
3085
+ out.setSourceElevation_vjgie6_k$(i, source.elevation_iziwkb_k$(i));
3086
+ }
2714
3087
  out.setElevation_pv2zuv_k$(i, smoothed.get_c1px32_k$(i).get_elevation_8fwyb8_k$());
2715
3088
  }
2716
3089
  while (inductionVariable_0 < last);
2717
3090
  out.computeDerivedData_uoxpeo_k$();
2718
3091
  return out;
2719
3092
  };
2720
- protoOf(ElevationStep).smoothElevation$default_3c035p_k$ = function (source, windowM, $super) {
2721
- windowM = windowM === VOID ? 150.0 : windowM;
2722
- return $super === VOID ? this.smoothElevation_ahln31_k$(source, windowM) : $super.smoothElevation_ahln31_k$.call(this, source, windowM);
2723
- };
2724
3093
  var ElevationStep_instance;
2725
3094
  function ElevationStep_getInstance() {
2726
3095
  return ElevationStep_instance;
@@ -2732,231 +3101,238 @@
2732
3101
  var message = 'Negative size: ' + this.size_1;
2733
3102
  throw IllegalArgumentException_init_$Create$_0(toString_0(message));
2734
3103
  }
2735
- this.data_1 = new Float64Array(imul(this.size_1, 43));
3104
+ this.data_1 = new Float64Array(imul(this.size_1, 44));
2736
3105
  var inductionVariable = 0;
2737
3106
  var last = this.size_1;
2738
3107
  if (inductionVariable < last)
2739
3108
  do {
2740
3109
  var i = inductionVariable;
2741
3110
  inductionVariable = inductionVariable + 1 | 0;
2742
- this.data_1[imul(i, 43) + 38 | 0] = NaN;
2743
- this.data_1[imul(i, 43) + 39 | 0] = NaN;
2744
- this.data_1[imul(i, 43) + 40 | 0] = NaN;
2745
- this.data_1[imul(i, 43) + 41 | 0] = NaN;
2746
- this.data_1[imul(i, 43) + 42 | 0] = NaN;
3111
+ this.data_1[imul(i, 44) + 38 | 0] = NaN;
3112
+ this.data_1[imul(i, 44) + 39 | 0] = NaN;
3113
+ this.data_1[imul(i, 44) + 40 | 0] = NaN;
3114
+ this.data_1[imul(i, 44) + 41 | 0] = NaN;
3115
+ this.data_1[imul(i, 44) + 42 | 0] = NaN;
3116
+ this.data_1[imul(i, 44) + 43 | 0] = NaN;
2747
3117
  }
2748
3118
  while (inductionVariable < last);
2749
3119
  }
2750
3120
  protoOf(GeneratedPath).get_z3le6l_k$ = function (i, field) {
2751
- return this.data_1[imul(i, 43) + field.ordinal_1 | 0];
3121
+ return this.data_1[imul(i, 44) + field.ordinal_1 | 0];
2752
3122
  };
2753
3123
  protoOf(GeneratedPath).set_b3ze83_k$ = function (i, field, v) {
2754
- this.data_1[imul(i, 43) + field.ordinal_1 | 0] = v;
3124
+ this.data_1[imul(i, 44) + field.ordinal_1 | 0] = v;
2755
3125
  };
2756
3126
  protoOf(GeneratedPath).latitude_gb4iok_k$ = function (i) {
2757
- return this.data_1[imul(i, 43) + 0 | 0];
3127
+ return this.data_1[imul(i, 44) + 0 | 0];
2758
3128
  };
2759
3129
  protoOf(GeneratedPath).setLatitude_skkzf0_k$ = function (i, v) {
2760
- this.data_1[imul(i, 43) + 0 | 0] = v;
3130
+ this.data_1[imul(i, 44) + 0 | 0] = v;
2761
3131
  };
2762
3132
  protoOf(GeneratedPath).longitude_a9xl_k$ = function (i) {
2763
- return this.data_1[imul(i, 43) + 1 | 0];
3133
+ return this.data_1[imul(i, 44) + 1 | 0];
2764
3134
  };
2765
3135
  protoOf(GeneratedPath).setLongitude_k0bc8l_k$ = function (i, v) {
2766
- this.data_1[imul(i, 43) + 1 | 0] = v;
3136
+ this.data_1[imul(i, 44) + 1 | 0] = v;
2767
3137
  };
2768
3138
  protoOf(GeneratedPath).distance_5s4s77_k$ = function (i) {
2769
- return this.data_1[imul(i, 43) + 2 | 0];
3139
+ return this.data_1[imul(i, 44) + 2 | 0];
2770
3140
  };
2771
3141
  protoOf(GeneratedPath).setDistance_d14hwr_k$ = function (i, v) {
2772
- this.data_1[imul(i, 43) + 2 | 0] = v;
3142
+ this.data_1[imul(i, 44) + 2 | 0] = v;
2773
3143
  };
2774
3144
  protoOf(GeneratedPath).setDx_uk0ky4_k$ = function (i, v) {
2775
- this.data_1[imul(i, 43) + 3 | 0] = v;
3145
+ this.data_1[imul(i, 44) + 3 | 0] = v;
2776
3146
  };
2777
3147
  protoOf(GeneratedPath).time_ryc845_k$ = function (i) {
2778
- return this.data_1[imul(i, 43) + 4 | 0];
3148
+ return this.data_1[imul(i, 44) + 4 | 0];
2779
3149
  };
2780
3150
  protoOf(GeneratedPath).setTime_rfmvcd_k$ = function (i, v) {
2781
- this.data_1[imul(i, 43) + 4 | 0] = v;
3151
+ this.data_1[imul(i, 44) + 4 | 0] = v;
2782
3152
  };
2783
3153
  protoOf(GeneratedPath).elapsed_7307rw_k$ = function (i) {
2784
- return this.data_1[imul(i, 43) + 5 | 0];
3154
+ return this.data_1[imul(i, 44) + 5 | 0];
2785
3155
  };
2786
3156
  protoOf(GeneratedPath).setElapsed_916ug_k$ = function (i, v) {
2787
- this.data_1[imul(i, 43) + 5 | 0] = v;
3157
+ this.data_1[imul(i, 44) + 5 | 0] = v;
2788
3158
  };
2789
3159
  protoOf(GeneratedPath).dt_17uzp4_k$ = function (i) {
2790
- return this.data_1[imul(i, 43) + 6 | 0];
3160
+ return this.data_1[imul(i, 44) + 6 | 0];
2791
3161
  };
2792
3162
  protoOf(GeneratedPath).setDt_sgarxs_k$ = function (i, v) {
2793
- this.data_1[imul(i, 43) + 6 | 0] = v;
3163
+ this.data_1[imul(i, 44) + 6 | 0] = v;
2794
3164
  };
2795
3165
  protoOf(GeneratedPath).bearing_fz5vxm_k$ = function (i) {
2796
- return this.data_1[imul(i, 43) + 7 | 0];
3166
+ return this.data_1[imul(i, 44) + 7 | 0];
2797
3167
  };
2798
3168
  protoOf(GeneratedPath).setBearing_in05l6_k$ = function (i, v) {
2799
- this.data_1[imul(i, 43) + 7 | 0] = v;
3169
+ this.data_1[imul(i, 44) + 7 | 0] = v;
2800
3170
  };
2801
3171
  protoOf(GeneratedPath).elevation_iziwkb_k$ = function (i) {
2802
- return this.data_1[imul(i, 43) + 8 | 0];
3172
+ return this.data_1[imul(i, 44) + 8 | 0];
2803
3173
  };
2804
3174
  protoOf(GeneratedPath).setElevation_pv2zuv_k$ = function (i, v) {
2805
- this.data_1[imul(i, 43) + 8 | 0] = v;
3175
+ this.data_1[imul(i, 44) + 8 | 0] = v;
2806
3176
  };
2807
3177
  protoOf(GeneratedPath).grade_c4yjz5_k$ = function (i) {
2808
- return this.data_1[imul(i, 43) + 9 | 0];
3178
+ return this.data_1[imul(i, 44) + 9 | 0];
2809
3179
  };
2810
3180
  protoOf(GeneratedPath).setGrade_3tur8z_k$ = function (i, v) {
2811
- this.data_1[imul(i, 43) + 9 | 0] = v;
3181
+ this.data_1[imul(i, 44) + 9 | 0] = v;
2812
3182
  };
2813
3183
  protoOf(GeneratedPath).radius_84q0sm_k$ = function (i) {
2814
- return this.data_1[imul(i, 43) + 10 | 0];
3184
+ return this.data_1[imul(i, 44) + 10 | 0];
2815
3185
  };
2816
3186
  protoOf(GeneratedPath).setRadius_p1cueq_k$ = function (i, v) {
2817
- this.data_1[imul(i, 43) + 10 | 0] = v;
3187
+ this.data_1[imul(i, 44) + 10 | 0] = v;
2818
3188
  };
2819
3189
  protoOf(GeneratedPath).setAeroCoef_tmjifm_k$ = function (i, v) {
2820
- this.data_1[imul(i, 43) + 11 | 0] = v;
3190
+ this.data_1[imul(i, 44) + 11 | 0] = v;
2821
3191
  };
2822
3192
  protoOf(GeneratedPath).setWindBearing_44dbry_k$ = function (i, v) {
2823
- this.data_1[imul(i, 43) + 12 | 0] = v;
3193
+ this.data_1[imul(i, 44) + 12 | 0] = v;
2824
3194
  };
2825
3195
  protoOf(GeneratedPath).windAlpha_7rjela_k$ = function (i) {
2826
- return this.data_1[imul(i, 43) + 13 | 0];
3196
+ return this.data_1[imul(i, 44) + 13 | 0];
2827
3197
  };
2828
3198
  protoOf(GeneratedPath).setWindAlpha_xkbtf2_k$ = function (i, v) {
2829
- this.data_1[imul(i, 43) + 13 | 0] = v;
3199
+ this.data_1[imul(i, 44) + 13 | 0] = v;
2830
3200
  };
2831
3201
  protoOf(GeneratedPath).setPAero_mmc4mr_k$ = function (i, v) {
2832
- this.data_1[imul(i, 43) + 14 | 0] = v;
3202
+ this.data_1[imul(i, 44) + 14 | 0] = v;
2833
3203
  };
2834
3204
  protoOf(GeneratedPath).setPGravity_tegtcu_k$ = function (i, v) {
2835
- this.data_1[imul(i, 43) + 15 | 0] = v;
3205
+ this.data_1[imul(i, 44) + 15 | 0] = v;
2836
3206
  };
2837
3207
  protoOf(GeneratedPath).setPRollingResistance_h04uz6_k$ = function (i, v) {
2838
- this.data_1[imul(i, 43) + 16 | 0] = v;
3208
+ this.data_1[imul(i, 44) + 16 | 0] = v;
2839
3209
  };
2840
3210
  protoOf(GeneratedPath).setPWheelBearings_djmhww_k$ = function (i, v) {
2841
- this.data_1[imul(i, 43) + 17 | 0] = v;
3211
+ this.data_1[imul(i, 44) + 17 | 0] = v;
2842
3212
  };
2843
3213
  protoOf(GeneratedPath).pInputPower_ybhudp_k$ = function (i) {
2844
- return this.data_1[imul(i, 43) + 18 | 0];
3214
+ return this.data_1[imul(i, 44) + 18 | 0];
2845
3215
  };
2846
3216
  protoOf(GeneratedPath).setPInputPower_i1beh_k$ = function (i, v) {
2847
- this.data_1[imul(i, 43) + 18 | 0] = v;
3217
+ this.data_1[imul(i, 44) + 18 | 0] = v;
2848
3218
  };
2849
3219
  protoOf(GeneratedPath).setPCyclistProvidedOptimalPower_gha9up_k$ = function (i, v) {
2850
- this.data_1[imul(i, 43) + 19 | 0] = v;
3220
+ this.data_1[imul(i, 44) + 19 | 0] = v;
2851
3221
  };
2852
3222
  protoOf(GeneratedPath).setPCyclistProvidedOptimalPowerWithHarmonics_tg3fol_k$ = function (i, v) {
2853
- this.data_1[imul(i, 43) + 20 | 0] = v;
3223
+ this.data_1[imul(i, 44) + 20 | 0] = v;
2854
3224
  };
2855
3225
  protoOf(GeneratedPath).setPCyclistPowerNeeded_54po1x_k$ = function (i, v) {
2856
- this.data_1[imul(i, 43) + 21 | 0] = v;
3226
+ this.data_1[imul(i, 44) + 21 | 0] = v;
2857
3227
  };
2858
3228
  protoOf(GeneratedPath).setPCyclistProvidedMuscular_aori9q_k$ = function (i, v) {
2859
- this.data_1[imul(i, 43) + 22 | 0] = v;
3229
+ this.data_1[imul(i, 44) + 22 | 0] = v;
2860
3230
  };
2861
3231
  protoOf(GeneratedPath).setPCyclistProvidedWheel_ofsihz_k$ = function (i, v) {
2862
- this.data_1[imul(i, 43) + 23 | 0] = v;
3232
+ this.data_1[imul(i, 44) + 23 | 0] = v;
2863
3233
  };
2864
3234
  protoOf(GeneratedPath).setPComputedTotalPower_wm6di_k$ = function (i, v) {
2865
- this.data_1[imul(i, 43) + 24 | 0] = v;
3235
+ this.data_1[imul(i, 44) + 24 | 0] = v;
2866
3236
  };
2867
3237
  protoOf(GeneratedPath).setPComputedWheelPower_qplog3_k$ = function (i, v) {
2868
- this.data_1[imul(i, 43) + 25 | 0] = v;
3238
+ this.data_1[imul(i, 44) + 25 | 0] = v;
2869
3239
  };
2870
3240
  protoOf(GeneratedPath).pComputedPower_g6dnn4_k$ = function (i) {
2871
- return this.data_1[imul(i, 43) + 26 | 0];
3241
+ return this.data_1[imul(i, 44) + 26 | 0];
2872
3242
  };
2873
3243
  protoOf(GeneratedPath).setPComputedPower_c3m6yw_k$ = function (i, v) {
2874
- this.data_1[imul(i, 43) + 26 | 0] = v;
3244
+ this.data_1[imul(i, 44) + 26 | 0] = v;
2875
3245
  };
2876
3246
  protoOf(GeneratedPath).speed_npav2n_k$ = function (i) {
2877
- return this.data_1[imul(i, 43) + 27 | 0];
3247
+ return this.data_1[imul(i, 44) + 27 | 0];
2878
3248
  };
2879
3249
  protoOf(GeneratedPath).setSpeed_1slan1_k$ = function (i, v) {
2880
- this.data_1[imul(i, 43) + 27 | 0] = v;
3250
+ this.data_1[imul(i, 44) + 27 | 0] = v;
2881
3251
  };
2882
3252
  protoOf(GeneratedPath).speedMax_mjo2cl_k$ = function (i) {
2883
- return this.data_1[imul(i, 43) + 28 | 0];
3253
+ return this.data_1[imul(i, 44) + 28 | 0];
2884
3254
  };
2885
3255
  protoOf(GeneratedPath).setSpeedMax_7xvqir_k$ = function (i, v) {
2886
- this.data_1[imul(i, 43) + 28 | 0] = v;
3256
+ this.data_1[imul(i, 44) + 28 | 0] = v;
2887
3257
  };
2888
3258
  protoOf(GeneratedPath).setSpeedMaxIncline_8l69w1_k$ = function (i, v) {
2889
- this.data_1[imul(i, 43) + 29 | 0] = v;
3259
+ this.data_1[imul(i, 44) + 29 | 0] = v;
2890
3260
  };
2891
3261
  protoOf(GeneratedPath).setVirtSpeedCurrent_kvg8yv_k$ = function (i, v) {
2892
- this.data_1[imul(i, 43) + 30 | 0] = v;
3262
+ this.data_1[imul(i, 44) + 30 | 0] = v;
2893
3263
  };
2894
3264
  protoOf(GeneratedPath).temperature_6yw0ik_k$ = function (i) {
2895
- return this.data_1[imul(i, 43) + 31 | 0];
3265
+ return this.data_1[imul(i, 44) + 31 | 0];
2896
3266
  };
2897
3267
  protoOf(GeneratedPath).setTemperature_nno5xs_k$ = function (i, v) {
2898
- this.data_1[imul(i, 43) + 31 | 0] = v;
3268
+ this.data_1[imul(i, 44) + 31 | 0] = v;
2899
3269
  };
2900
3270
  protoOf(GeneratedPath).windSpeed_6m3dy1_k$ = function (i) {
2901
- return this.data_1[imul(i, 43) + 32 | 0];
3271
+ return this.data_1[imul(i, 44) + 32 | 0];
2902
3272
  };
2903
3273
  protoOf(GeneratedPath).setWindSpeed_ggaslh_k$ = function (i, v) {
2904
- this.data_1[imul(i, 43) + 32 | 0] = v;
3274
+ this.data_1[imul(i, 44) + 32 | 0] = v;
2905
3275
  };
2906
3276
  protoOf(GeneratedPath).setWindDirection_86vnxv_k$ = function (i, v) {
2907
- this.data_1[imul(i, 43) + 33 | 0] = v;
3277
+ this.data_1[imul(i, 44) + 33 | 0] = v;
2908
3278
  };
2909
3279
  protoOf(GeneratedPath).heartRate_qiaqfm_k$ = function (i) {
2910
- return this.data_1[imul(i, 43) + 34 | 0];
3280
+ return this.data_1[imul(i, 44) + 34 | 0];
2911
3281
  };
2912
3282
  protoOf(GeneratedPath).setHeartRate_3mzzq6_k$ = function (i, v) {
2913
- this.data_1[imul(i, 43) + 34 | 0] = v;
3283
+ this.data_1[imul(i, 44) + 34 | 0] = v;
2914
3284
  };
2915
3285
  protoOf(GeneratedPath).cadence_h3r7af_k$ = function (i) {
2916
- return this.data_1[imul(i, 43) + 35 | 0];
3286
+ return this.data_1[imul(i, 44) + 35 | 0];
2917
3287
  };
2918
3288
  protoOf(GeneratedPath).setCadence_ick7df_k$ = function (i, v) {
2919
- this.data_1[imul(i, 43) + 35 | 0] = v;
3289
+ this.data_1[imul(i, 44) + 35 | 0] = v;
2920
3290
  };
2921
3291
  protoOf(GeneratedPath).setWPrimeBalance_stwqkw_k$ = function (i, v) {
2922
- this.data_1[imul(i, 43) + 36 | 0] = v;
3292
+ this.data_1[imul(i, 44) + 36 | 0] = v;
2923
3293
  };
2924
3294
  protoOf(GeneratedPath).setPBrake_iza4qj_k$ = function (i, v) {
2925
- this.data_1[imul(i, 43) + 37 | 0] = v;
3295
+ this.data_1[imul(i, 44) + 37 | 0] = v;
2926
3296
  };
2927
3297
  protoOf(GeneratedPath).trajectoryCurvature_t4abpc_k$ = function (i) {
2928
- return this.data_1[imul(i, 43) + 38 | 0];
3298
+ return this.data_1[imul(i, 44) + 38 | 0];
2929
3299
  };
2930
3300
  protoOf(GeneratedPath).setTrajectoryCurvature_yjmp8s_k$ = function (i, v) {
2931
- this.data_1[imul(i, 43) + 38 | 0] = v;
3301
+ this.data_1[imul(i, 44) + 38 | 0] = v;
2932
3302
  };
2933
3303
  protoOf(GeneratedPath).roadWidth_7zv9qq_k$ = function (i) {
2934
- return this.data_1[imul(i, 43) + 39 | 0];
3304
+ return this.data_1[imul(i, 44) + 39 | 0];
2935
3305
  };
2936
3306
  protoOf(GeneratedPath).setRoadWidth_g0vcte_k$ = function (i, v) {
2937
- this.data_1[imul(i, 43) + 39 | 0] = v;
3307
+ this.data_1[imul(i, 44) + 39 | 0] = v;
2938
3308
  };
2939
3309
  protoOf(GeneratedPath).setLateralOffset_k5uegq_k$ = function (i, v) {
2940
- this.data_1[imul(i, 43) + 40 | 0] = v;
3310
+ this.data_1[imul(i, 44) + 40 | 0] = v;
2941
3311
  };
2942
3312
  protoOf(GeneratedPath).setSourceLatitude_jzh9ix_k$ = function (i, v) {
2943
- this.data_1[imul(i, 43) + 41 | 0] = v;
3313
+ this.data_1[imul(i, 44) + 41 | 0] = v;
2944
3314
  };
2945
3315
  protoOf(GeneratedPath).setSourceLongitude_xmvvyo_k$ = function (i, v) {
2946
- this.data_1[imul(i, 43) + 42 | 0] = v;
3316
+ this.data_1[imul(i, 44) + 42 | 0] = v;
2947
3317
  };
2948
- function Companion_1() {
2949
- Companion_instance_2 = this;
3318
+ protoOf(GeneratedPath).sourceElevation_i35mcq_k$ = function (i) {
3319
+ return this.data_1[imul(i, 44) + 43 | 0];
3320
+ };
3321
+ protoOf(GeneratedPath).setSourceElevation_vjgie6_k$ = function (i, v) {
3322
+ this.data_1[imul(i, 44) + 43 | 0] = v;
3323
+ };
3324
+ function Companion_4() {
3325
+ Companion_instance_5 = this;
2950
3326
  this.EMPTY_1 = new BoundsRad(0.0, 0.0, 0.0, 0.0);
2951
3327
  }
2952
- var Companion_instance_2;
2953
- function Companion_getInstance_2() {
2954
- if (Companion_instance_2 == null)
2955
- new Companion_1();
2956
- return Companion_instance_2;
3328
+ var Companion_instance_5;
3329
+ function Companion_getInstance_5() {
3330
+ if (Companion_instance_5 == null)
3331
+ new Companion_4();
3332
+ return Companion_instance_5;
2957
3333
  }
2958
3334
  function BoundsRad(minLat, maxLat, minLon, maxLon) {
2959
- Companion_getInstance_2();
3335
+ Companion_getInstance_5();
2960
3336
  this.minLat_1 = minLat;
2961
3337
  this.maxLat_1 = maxLat;
2962
3338
  this.minLon_1 = minLon;
@@ -2993,6 +3369,8 @@
2993
3369
  $this.maxElevation_1 = other.maxElevation_1;
2994
3370
  $this.elevationGain_1 = other.elevationGain_1;
2995
3371
  $this.elevationLoss_1 = other.elevationLoss_1;
3372
+ $this.elevationGainFiltered_1 = other.elevationGainFiltered_1;
3373
+ $this.elevationLossFiltered_1 = other.elevationLossFiltered_1;
2996
3374
  $this.durationMs_1 = other.durationMs_1;
2997
3375
  $this.boundsRad_1 = other.boundsRad_1;
2998
3376
  }
@@ -3002,8 +3380,10 @@
3002
3380
  $this.maxElevation_1 = 0.0;
3003
3381
  $this.elevationGain_1 = 0.0;
3004
3382
  $this.elevationLoss_1 = 0.0;
3383
+ $this.elevationGainFiltered_1 = NaN;
3384
+ $this.elevationLossFiltered_1 = NaN;
3005
3385
  $this.durationMs_1 = 0.0;
3006
- $this.boundsRad_1 = Companion_getInstance_2().EMPTY_1;
3386
+ $this.boundsRad_1 = Companion_getInstance_5().EMPTY_1;
3007
3387
  }
3008
3388
  function computeBearing($this, from, to) {
3009
3389
  var lat1 = $this.latitude_gb4iok_k$(from);
@@ -3022,11 +3402,11 @@
3022
3402
  var y = -dy;
3023
3403
  return Math.atan2(y, dx);
3024
3404
  }
3025
- function Companion_2() {
3405
+ function Companion_5() {
3026
3406
  }
3027
- var Companion_instance_3;
3028
- function Companion_getInstance_3() {
3029
- return Companion_instance_3;
3407
+ var Companion_instance_6;
3408
+ function Companion_getInstance_6() {
3409
+ return Companion_instance_6;
3030
3410
  }
3031
3411
  function Path(size) {
3032
3412
  GeneratedPath.call(this, size);
@@ -3035,9 +3415,17 @@
3035
3415
  this.maxElevation_1 = 0.0;
3036
3416
  this.elevationGain_1 = 0.0;
3037
3417
  this.elevationLoss_1 = 0.0;
3418
+ this.elevationGainFiltered_1 = NaN;
3419
+ this.elevationLossFiltered_1 = NaN;
3038
3420
  this.durationMs_1 = 0.0;
3039
- this.boundsRad_1 = Companion_getInstance_2().EMPTY_1;
3421
+ this.boundsRad_1 = Companion_getInstance_5().EMPTY_1;
3040
3422
  }
3423
+ protoOf(Path).get_reportedElevationGain_hffpog_k$ = function () {
3424
+ return isNaN_0(this.elevationGainFiltered_1) ? this.elevationGain_1 : this.elevationGainFiltered_1;
3425
+ };
3426
+ protoOf(Path).get_reportedElevationLoss_hfc84c_k$ = function () {
3427
+ return isNaN_0(this.elevationLossFiltered_1) ? this.elevationLoss_1 : this.elevationLossFiltered_1;
3428
+ };
3041
3429
  protoOf(Path).get_indices_xelk8u_k$ = function () {
3042
3430
  return until(0, this.size_1);
3043
3431
  };
@@ -3197,7 +3585,7 @@
3197
3585
  var dstIdx = index;
3198
3586
  index = index + 1 | 0;
3199
3587
  var srcIdx = iterator.next_20eer_k$();
3200
- var _iterator__ex2g4s_0 = get_entries_1().iterator_jk1svi_k$();
3588
+ var _iterator__ex2g4s_0 = get_entries_2().iterator_jk1svi_k$();
3201
3589
  while (_iterator__ex2g4s_0.hasNext_bitz1p_k$()) {
3202
3590
  var field = _iterator__ex2g4s_0.next_20eer_k$();
3203
3591
  out.set_b3ze83_k$(dstIdx, field, path.get_z3le6l_k$(srcIdx, field));
@@ -3210,11 +3598,11 @@
3210
3598
  function PathSimplifier_getInstance() {
3211
3599
  return PathSimplifier_instance;
3212
3600
  }
3213
- var static_init_called_1;
3214
- function static_init_1() {
3215
- if (static_init_called_1)
3601
+ var static_init_called_2;
3602
+ function static_init_2() {
3603
+ if (static_init_called_2)
3216
3604
  return Unit_instance;
3217
- static_init_called_1 = true;
3605
+ static_init_called_2 = true;
3218
3606
  PointField_LATITUDE_instance = new PointField('LATITUDE', 0, 'latitude', 'radians', 'Latitude (radians)', PointFieldCategory_COORDINATES_getInstance(), true, true);
3219
3607
  PointField_LONGITUDE_instance = new PointField('LONGITUDE', 1, 'longitude', 'radians', 'Longitude (radians)', PointFieldCategory_COORDINATES_getInstance(), true, true);
3220
3608
  PointField_DISTANCE_instance = new PointField('DISTANCE', 2, 'distance', 'meters', 'Distance (meters)', PointFieldCategory_COORDINATES_getInstance());
@@ -3258,9 +3646,10 @@
3258
3646
  PointField_LATERAL_OFFSET_instance = new PointField('LATERAL_OFFSET', 40, 'lateralOffset', 'meters', 'Lateral offset (m, + = left)', PointFieldCategory_ROAD_getInstance(), VOID, VOID, true);
3259
3647
  PointField_SOURCE_LATITUDE_instance = new PointField('SOURCE_LATITUDE', 41, 'sourceLatitude', 'radians', 'Original latitude before the racing line (radians)', PointFieldCategory_ROAD_getInstance(), true, true, true);
3260
3648
  PointField_SOURCE_LONGITUDE_instance = new PointField('SOURCE_LONGITUDE', 42, 'sourceLongitude', 'radians', 'Original longitude before the racing line (radians)', PointFieldCategory_ROAD_getInstance(), true, true, true);
3261
- if (Companion_instance_4 == null) {
3649
+ PointField_SOURCE_ELEVATION_instance = new PointField('SOURCE_ELEVATION', 43, 'sourceElevation', 'meters', 'Original elevation before smoothing (m)', PointFieldCategory_ELEVATION_getInstance(), true, VOID, true);
3650
+ if (Companion_instance_7 == null) {
3262
3651
  Companion_instance;
3263
- new Companion_3();
3652
+ new Companion_6();
3264
3653
  }
3265
3654
  }
3266
3655
  var PointField_LATITUDE_instance;
@@ -3306,12 +3695,13 @@
3306
3695
  var PointField_LATERAL_OFFSET_instance;
3307
3696
  var PointField_SOURCE_LATITUDE_instance;
3308
3697
  var PointField_SOURCE_LONGITUDE_instance;
3309
- function Companion_3() {
3310
- Companion_instance_4 = this;
3311
- this.COUNT_1 = 43;
3698
+ var PointField_SOURCE_ELEVATION_instance;
3699
+ function Companion_6() {
3700
+ Companion_instance_7 = this;
3701
+ this.COUNT_1 = 44;
3312
3702
  var tmp = this;
3313
3703
  // Inline function 'kotlin.collections.associateBy' call
3314
- var this_0 = get_entries_1();
3704
+ var this_0 = get_entries_2();
3315
3705
  var capacity = coerceAtLeast(mapCapacity(collectionSizeOrDefault(this_0, 10)), 16);
3316
3706
  // Inline function 'kotlin.collections.associateByTo' call
3317
3707
  var destination = LinkedHashMap_init_$Create$(capacity);
@@ -3323,25 +3713,25 @@
3323
3713
  }
3324
3714
  tmp.byPropMap_1 = destination;
3325
3715
  }
3326
- protoOf(Companion_3).byProp_kdf1eo_k$ = function (prop) {
3716
+ protoOf(Companion_6).byProp_kdf1eo_k$ = function (prop) {
3327
3717
  return this.byPropMap_1.get_wei43m_k$(prop);
3328
3718
  };
3329
- var Companion_instance_4;
3330
- function Companion_getInstance_4() {
3331
- static_init_1();
3332
- return Companion_instance_4;
3719
+ var Companion_instance_7;
3720
+ function Companion_getInstance_7() {
3721
+ static_init_2();
3722
+ return Companion_instance_7;
3333
3723
  }
3334
- function values_1() {
3335
- static_init_1();
3336
- return [PointField_LATITUDE_getInstance(), PointField_LONGITUDE_getInstance(), PointField_DISTANCE_getInstance(), PointField_DX_getInstance(), PointField_TIME_getInstance(), PointField_ELAPSED_getInstance(), PointField_DT_getInstance(), PointField_BEARING_getInstance(), PointField_ELEVATION_getInstance(), PointField_GRADE_getInstance(), PointField_RADIUS_getInstance(), PointField_AERO_COEF_getInstance(), PointField_WIND_BEARING_getInstance(), PointField_WIND_ALPHA_getInstance(), PointField_P_AERO_getInstance(), PointField_P_GRAVITY_getInstance(), PointField_P_ROLLING_RESISTANCE_getInstance(), PointField_P_WHEEL_BEARINGS_getInstance(), PointField_P_INPUT_POWER_getInstance(), PointField_P_CYCLIST_PROVIDED_OPTIMAL_POWER_getInstance(), PointField_P_CYCLIST_PROVIDED_OPTIMAL_POWER_HARMONICS_getInstance(), PointField_P_CYCLIST_PROVIDED_POWER_NEEDED_getInstance(), PointField_P_CYCLIST_PROVIDED_MUSCULAR_getInstance(), PointField_P_CYCLIST_PROVIDED_WHEEL_getInstance(), PointField_P_COMPUTED_TOTAL_POWER_getInstance(), PointField_P_COMPUTED_WHEEL_POWER_getInstance(), PointField_POWER_getInstance(), PointField_SPEED_getInstance(), PointField_SPEED_MAX_getInstance(), PointField_SPEED_MAX_INCLINE_getInstance(), PointField_VIRT_SPEED_CURRENT_getInstance(), PointField_TEMPERATURE_getInstance(), PointField_WIND_SPEED_getInstance(), PointField_WIND_DIRECTION_getInstance(), PointField_HEART_RATE_getInstance(), PointField_CADENCE_getInstance(), PointField_W_PRIME_BALANCE_getInstance(), PointField_P_BRAKE_getInstance(), PointField_TRAJECTORY_CURVATURE_getInstance(), PointField_ROAD_WIDTH_getInstance(), PointField_LATERAL_OFFSET_getInstance(), PointField_SOURCE_LATITUDE_getInstance(), PointField_SOURCE_LONGITUDE_getInstance()];
3724
+ function values_2() {
3725
+ static_init_2();
3726
+ return [PointField_LATITUDE_getInstance(), PointField_LONGITUDE_getInstance(), PointField_DISTANCE_getInstance(), PointField_DX_getInstance(), PointField_TIME_getInstance(), PointField_ELAPSED_getInstance(), PointField_DT_getInstance(), PointField_BEARING_getInstance(), PointField_ELEVATION_getInstance(), PointField_GRADE_getInstance(), PointField_RADIUS_getInstance(), PointField_AERO_COEF_getInstance(), PointField_WIND_BEARING_getInstance(), PointField_WIND_ALPHA_getInstance(), PointField_P_AERO_getInstance(), PointField_P_GRAVITY_getInstance(), PointField_P_ROLLING_RESISTANCE_getInstance(), PointField_P_WHEEL_BEARINGS_getInstance(), PointField_P_INPUT_POWER_getInstance(), PointField_P_CYCLIST_PROVIDED_OPTIMAL_POWER_getInstance(), PointField_P_CYCLIST_PROVIDED_OPTIMAL_POWER_HARMONICS_getInstance(), PointField_P_CYCLIST_PROVIDED_POWER_NEEDED_getInstance(), PointField_P_CYCLIST_PROVIDED_MUSCULAR_getInstance(), PointField_P_CYCLIST_PROVIDED_WHEEL_getInstance(), PointField_P_COMPUTED_TOTAL_POWER_getInstance(), PointField_P_COMPUTED_WHEEL_POWER_getInstance(), PointField_POWER_getInstance(), PointField_SPEED_getInstance(), PointField_SPEED_MAX_getInstance(), PointField_SPEED_MAX_INCLINE_getInstance(), PointField_VIRT_SPEED_CURRENT_getInstance(), PointField_TEMPERATURE_getInstance(), PointField_WIND_SPEED_getInstance(), PointField_WIND_DIRECTION_getInstance(), PointField_HEART_RATE_getInstance(), PointField_CADENCE_getInstance(), PointField_W_PRIME_BALANCE_getInstance(), PointField_P_BRAKE_getInstance(), PointField_TRAJECTORY_CURVATURE_getInstance(), PointField_ROAD_WIDTH_getInstance(), PointField_LATERAL_OFFSET_getInstance(), PointField_SOURCE_LATITUDE_getInstance(), PointField_SOURCE_LONGITUDE_getInstance(), PointField_SOURCE_ELEVATION_getInstance()];
3337
3727
  }
3338
- function get_entries_1() {
3339
- static_init_1();
3340
- if ($ENTRIES_1 == null)
3341
- $ENTRIES_1 = enumEntries(values_1());
3342
- return $ENTRIES_1;
3728
+ function get_entries_2() {
3729
+ static_init_2();
3730
+ if ($ENTRIES_2 == null)
3731
+ $ENTRIES_2 = enumEntries(values_2());
3732
+ return $ENTRIES_2;
3343
3733
  }
3344
- var $ENTRIES_1;
3734
+ var $ENTRIES_2;
3345
3735
  function PointField(name, ordinal, prop, unit, shortDescription, category, notSelectable, anglesInRadians, nanDefault) {
3346
3736
  notSelectable = notSelectable === VOID ? false : notSelectable;
3347
3737
  anglesInRadians = anglesInRadians === VOID ? false : anglesInRadians;
@@ -3356,182 +3746,186 @@
3356
3746
  this.nanDefault_1 = nanDefault;
3357
3747
  }
3358
3748
  function PointField_LATITUDE_getInstance() {
3359
- static_init_1();
3749
+ static_init_2();
3360
3750
  return PointField_LATITUDE_instance;
3361
3751
  }
3362
3752
  function PointField_LONGITUDE_getInstance() {
3363
- static_init_1();
3753
+ static_init_2();
3364
3754
  return PointField_LONGITUDE_instance;
3365
3755
  }
3366
3756
  function PointField_DISTANCE_getInstance() {
3367
- static_init_1();
3757
+ static_init_2();
3368
3758
  return PointField_DISTANCE_instance;
3369
3759
  }
3370
3760
  function PointField_DX_getInstance() {
3371
- static_init_1();
3761
+ static_init_2();
3372
3762
  return PointField_DX_instance;
3373
3763
  }
3374
3764
  function PointField_TIME_getInstance() {
3375
- static_init_1();
3765
+ static_init_2();
3376
3766
  return PointField_TIME_instance;
3377
3767
  }
3378
3768
  function PointField_ELAPSED_getInstance() {
3379
- static_init_1();
3769
+ static_init_2();
3380
3770
  return PointField_ELAPSED_instance;
3381
3771
  }
3382
3772
  function PointField_DT_getInstance() {
3383
- static_init_1();
3773
+ static_init_2();
3384
3774
  return PointField_DT_instance;
3385
3775
  }
3386
3776
  function PointField_BEARING_getInstance() {
3387
- static_init_1();
3777
+ static_init_2();
3388
3778
  return PointField_BEARING_instance;
3389
3779
  }
3390
3780
  function PointField_ELEVATION_getInstance() {
3391
- static_init_1();
3781
+ static_init_2();
3392
3782
  return PointField_ELEVATION_instance;
3393
3783
  }
3394
3784
  function PointField_GRADE_getInstance() {
3395
- static_init_1();
3785
+ static_init_2();
3396
3786
  return PointField_GRADE_instance;
3397
3787
  }
3398
3788
  function PointField_RADIUS_getInstance() {
3399
- static_init_1();
3789
+ static_init_2();
3400
3790
  return PointField_RADIUS_instance;
3401
3791
  }
3402
3792
  function PointField_AERO_COEF_getInstance() {
3403
- static_init_1();
3793
+ static_init_2();
3404
3794
  return PointField_AERO_COEF_instance;
3405
3795
  }
3406
3796
  function PointField_WIND_BEARING_getInstance() {
3407
- static_init_1();
3797
+ static_init_2();
3408
3798
  return PointField_WIND_BEARING_instance;
3409
3799
  }
3410
3800
  function PointField_WIND_ALPHA_getInstance() {
3411
- static_init_1();
3801
+ static_init_2();
3412
3802
  return PointField_WIND_ALPHA_instance;
3413
3803
  }
3414
3804
  function PointField_P_AERO_getInstance() {
3415
- static_init_1();
3805
+ static_init_2();
3416
3806
  return PointField_P_AERO_instance;
3417
3807
  }
3418
3808
  function PointField_P_GRAVITY_getInstance() {
3419
- static_init_1();
3809
+ static_init_2();
3420
3810
  return PointField_P_GRAVITY_instance;
3421
3811
  }
3422
3812
  function PointField_P_ROLLING_RESISTANCE_getInstance() {
3423
- static_init_1();
3813
+ static_init_2();
3424
3814
  return PointField_P_ROLLING_RESISTANCE_instance;
3425
3815
  }
3426
3816
  function PointField_P_WHEEL_BEARINGS_getInstance() {
3427
- static_init_1();
3817
+ static_init_2();
3428
3818
  return PointField_P_WHEEL_BEARINGS_instance;
3429
3819
  }
3430
3820
  function PointField_P_INPUT_POWER_getInstance() {
3431
- static_init_1();
3821
+ static_init_2();
3432
3822
  return PointField_P_INPUT_POWER_instance;
3433
3823
  }
3434
3824
  function PointField_P_CYCLIST_PROVIDED_OPTIMAL_POWER_getInstance() {
3435
- static_init_1();
3825
+ static_init_2();
3436
3826
  return PointField_P_CYCLIST_PROVIDED_OPTIMAL_POWER_instance;
3437
3827
  }
3438
3828
  function PointField_P_CYCLIST_PROVIDED_OPTIMAL_POWER_HARMONICS_getInstance() {
3439
- static_init_1();
3829
+ static_init_2();
3440
3830
  return PointField_P_CYCLIST_PROVIDED_OPTIMAL_POWER_HARMONICS_instance;
3441
3831
  }
3442
3832
  function PointField_P_CYCLIST_PROVIDED_POWER_NEEDED_getInstance() {
3443
- static_init_1();
3833
+ static_init_2();
3444
3834
  return PointField_P_CYCLIST_PROVIDED_POWER_NEEDED_instance;
3445
3835
  }
3446
3836
  function PointField_P_CYCLIST_PROVIDED_MUSCULAR_getInstance() {
3447
- static_init_1();
3837
+ static_init_2();
3448
3838
  return PointField_P_CYCLIST_PROVIDED_MUSCULAR_instance;
3449
3839
  }
3450
3840
  function PointField_P_CYCLIST_PROVIDED_WHEEL_getInstance() {
3451
- static_init_1();
3841
+ static_init_2();
3452
3842
  return PointField_P_CYCLIST_PROVIDED_WHEEL_instance;
3453
3843
  }
3454
3844
  function PointField_P_COMPUTED_TOTAL_POWER_getInstance() {
3455
- static_init_1();
3845
+ static_init_2();
3456
3846
  return PointField_P_COMPUTED_TOTAL_POWER_instance;
3457
3847
  }
3458
3848
  function PointField_P_COMPUTED_WHEEL_POWER_getInstance() {
3459
- static_init_1();
3849
+ static_init_2();
3460
3850
  return PointField_P_COMPUTED_WHEEL_POWER_instance;
3461
3851
  }
3462
3852
  function PointField_POWER_getInstance() {
3463
- static_init_1();
3853
+ static_init_2();
3464
3854
  return PointField_POWER_instance;
3465
3855
  }
3466
3856
  function PointField_SPEED_getInstance() {
3467
- static_init_1();
3857
+ static_init_2();
3468
3858
  return PointField_SPEED_instance;
3469
3859
  }
3470
3860
  function PointField_SPEED_MAX_getInstance() {
3471
- static_init_1();
3861
+ static_init_2();
3472
3862
  return PointField_SPEED_MAX_instance;
3473
3863
  }
3474
3864
  function PointField_SPEED_MAX_INCLINE_getInstance() {
3475
- static_init_1();
3865
+ static_init_2();
3476
3866
  return PointField_SPEED_MAX_INCLINE_instance;
3477
3867
  }
3478
3868
  function PointField_VIRT_SPEED_CURRENT_getInstance() {
3479
- static_init_1();
3869
+ static_init_2();
3480
3870
  return PointField_VIRT_SPEED_CURRENT_instance;
3481
3871
  }
3482
3872
  function PointField_TEMPERATURE_getInstance() {
3483
- static_init_1();
3873
+ static_init_2();
3484
3874
  return PointField_TEMPERATURE_instance;
3485
3875
  }
3486
3876
  function PointField_WIND_SPEED_getInstance() {
3487
- static_init_1();
3877
+ static_init_2();
3488
3878
  return PointField_WIND_SPEED_instance;
3489
3879
  }
3490
3880
  function PointField_WIND_DIRECTION_getInstance() {
3491
- static_init_1();
3881
+ static_init_2();
3492
3882
  return PointField_WIND_DIRECTION_instance;
3493
3883
  }
3494
3884
  function PointField_HEART_RATE_getInstance() {
3495
- static_init_1();
3885
+ static_init_2();
3496
3886
  return PointField_HEART_RATE_instance;
3497
3887
  }
3498
3888
  function PointField_CADENCE_getInstance() {
3499
- static_init_1();
3889
+ static_init_2();
3500
3890
  return PointField_CADENCE_instance;
3501
3891
  }
3502
3892
  function PointField_W_PRIME_BALANCE_getInstance() {
3503
- static_init_1();
3893
+ static_init_2();
3504
3894
  return PointField_W_PRIME_BALANCE_instance;
3505
3895
  }
3506
3896
  function PointField_P_BRAKE_getInstance() {
3507
- static_init_1();
3897
+ static_init_2();
3508
3898
  return PointField_P_BRAKE_instance;
3509
3899
  }
3510
3900
  function PointField_TRAJECTORY_CURVATURE_getInstance() {
3511
- static_init_1();
3901
+ static_init_2();
3512
3902
  return PointField_TRAJECTORY_CURVATURE_instance;
3513
3903
  }
3514
3904
  function PointField_ROAD_WIDTH_getInstance() {
3515
- static_init_1();
3905
+ static_init_2();
3516
3906
  return PointField_ROAD_WIDTH_instance;
3517
3907
  }
3518
3908
  function PointField_LATERAL_OFFSET_getInstance() {
3519
- static_init_1();
3909
+ static_init_2();
3520
3910
  return PointField_LATERAL_OFFSET_instance;
3521
3911
  }
3522
3912
  function PointField_SOURCE_LATITUDE_getInstance() {
3523
- static_init_1();
3913
+ static_init_2();
3524
3914
  return PointField_SOURCE_LATITUDE_instance;
3525
3915
  }
3526
3916
  function PointField_SOURCE_LONGITUDE_getInstance() {
3527
- static_init_1();
3917
+ static_init_2();
3528
3918
  return PointField_SOURCE_LONGITUDE_instance;
3529
3919
  }
3530
- var static_init_called_2;
3531
- function static_init_2() {
3532
- if (static_init_called_2)
3920
+ function PointField_SOURCE_ELEVATION_getInstance() {
3921
+ static_init_2();
3922
+ return PointField_SOURCE_ELEVATION_instance;
3923
+ }
3924
+ var static_init_called_3;
3925
+ function static_init_3() {
3926
+ if (static_init_called_3)
3533
3927
  return Unit_instance;
3534
- static_init_called_2 = true;
3928
+ static_init_called_3 = true;
3535
3929
  PointFieldCategory_COORDINATES_instance = new PointFieldCategory('COORDINATES', 0, 'coordinates', 'Coordinates');
3536
3930
  PointFieldCategory_TEMPORAL_instance = new PointFieldCategory('TEMPORAL', 1, 'temporal', 'Temporal');
3537
3931
  PointFieldCategory_ANGLES_instance = new PointFieldCategory('ANGLES', 2, 'angles', 'Angles');
@@ -3569,63 +3963,63 @@
3569
3963
  this.displayName_1 = displayName;
3570
3964
  }
3571
3965
  function PointFieldCategory_COORDINATES_getInstance() {
3572
- static_init_2();
3966
+ static_init_3();
3573
3967
  return PointFieldCategory_COORDINATES_instance;
3574
3968
  }
3575
3969
  function PointFieldCategory_TEMPORAL_getInstance() {
3576
- static_init_2();
3970
+ static_init_3();
3577
3971
  return PointFieldCategory_TEMPORAL_instance;
3578
3972
  }
3579
3973
  function PointFieldCategory_ANGLES_getInstance() {
3580
- static_init_2();
3974
+ static_init_3();
3581
3975
  return PointFieldCategory_ANGLES_instance;
3582
3976
  }
3583
3977
  function PointFieldCategory_ELEVATION_getInstance() {
3584
- static_init_2();
3978
+ static_init_3();
3585
3979
  return PointFieldCategory_ELEVATION_instance;
3586
3980
  }
3587
3981
  function PointFieldCategory_GRADE_getInstance() {
3588
- static_init_2();
3982
+ static_init_3();
3589
3983
  return PointFieldCategory_GRADE_instance;
3590
3984
  }
3591
3985
  function PointFieldCategory_RADIUS_getInstance() {
3592
- static_init_2();
3986
+ static_init_3();
3593
3987
  return PointFieldCategory_RADIUS_instance;
3594
3988
  }
3595
3989
  function PointFieldCategory_AERO_COEF_getInstance() {
3596
- static_init_2();
3990
+ static_init_3();
3597
3991
  return PointFieldCategory_AERO_COEF_instance;
3598
3992
  }
3599
3993
  function PointFieldCategory_CYCLIST_WIND_getInstance() {
3600
- static_init_2();
3994
+ static_init_3();
3601
3995
  return PointFieldCategory_CYCLIST_WIND_instance;
3602
3996
  }
3603
3997
  function PointFieldCategory_POWER_PHYSICS_getInstance() {
3604
- static_init_2();
3998
+ static_init_3();
3605
3999
  return PointFieldCategory_POWER_PHYSICS_instance;
3606
4000
  }
3607
4001
  function PointFieldCategory_POWER_CYCLIST_getInstance() {
3608
- static_init_2();
4002
+ static_init_3();
3609
4003
  return PointFieldCategory_POWER_CYCLIST_instance;
3610
4004
  }
3611
4005
  function PointFieldCategory_POWER_POST_getInstance() {
3612
- static_init_2();
4006
+ static_init_3();
3613
4007
  return PointFieldCategory_POWER_POST_instance;
3614
4008
  }
3615
4009
  function PointFieldCategory_SPEED_getInstance() {
3616
- static_init_2();
4010
+ static_init_3();
3617
4011
  return PointFieldCategory_SPEED_instance;
3618
4012
  }
3619
4013
  function PointFieldCategory_ENVIRONMENTAL_getInstance() {
3620
- static_init_2();
4014
+ static_init_3();
3621
4015
  return PointFieldCategory_ENVIRONMENTAL_instance;
3622
4016
  }
3623
4017
  function PointFieldCategory_PHYSIOLOGICAL_getInstance() {
3624
- static_init_2();
4018
+ static_init_3();
3625
4019
  return PointFieldCategory_PHYSIOLOGICAL_instance;
3626
4020
  }
3627
4021
  function PointFieldCategory_ROAD_getInstance() {
3628
- static_init_2();
4022
+ static_init_3();
3629
4023
  return PointFieldCategory_ROAD_instance;
3630
4024
  }
3631
4025
  function Copy(sourceIndex) {
@@ -3752,14 +4146,14 @@
3752
4146
  return out;
3753
4147
  }
3754
4148
  function copyFields($this, src, srcIdx, dst, dstIdx) {
3755
- var _iterator__ex2g4s = get_entries_1().iterator_jk1svi_k$();
4149
+ var _iterator__ex2g4s = get_entries_2().iterator_jk1svi_k$();
3756
4150
  while (_iterator__ex2g4s.hasNext_bitz1p_k$()) {
3757
4151
  var field = _iterator__ex2g4s.next_20eer_k$();
3758
4152
  dst.set_b3ze83_k$(dstIdx, field, src.get_z3le6l_k$(srcIdx, field));
3759
4153
  }
3760
4154
  }
3761
4155
  function interpolateFields($this, src, i1, i2, coef, dst, dstIdx) {
3762
- var _iterator__ex2g4s = get_entries_1().iterator_jk1svi_k$();
4156
+ var _iterator__ex2g4s = get_entries_2().iterator_jk1svi_k$();
3763
4157
  while (_iterator__ex2g4s.hasNext_bitz1p_k$()) {
3764
4158
  var field = _iterator__ex2g4s.next_20eer_k$();
3765
4159
  var v1 = src.get_z3le6l_k$(i1, field);
@@ -3926,14 +4320,14 @@
3926
4320
  return out;
3927
4321
  }
3928
4322
  function copyFields_0($this, src, srcIdx, dst, dstIdx) {
3929
- var _iterator__ex2g4s = get_entries_1().iterator_jk1svi_k$();
4323
+ var _iterator__ex2g4s = get_entries_2().iterator_jk1svi_k$();
3930
4324
  while (_iterator__ex2g4s.hasNext_bitz1p_k$()) {
3931
4325
  var field = _iterator__ex2g4s.next_20eer_k$();
3932
4326
  dst.set_b3ze83_k$(dstIdx, field, src.get_z3le6l_k$(srcIdx, field));
3933
4327
  }
3934
4328
  }
3935
4329
  function interpolateFields_0($this, src, i1, i2, coef, dst, dstIdx) {
3936
- var _iterator__ex2g4s = get_entries_1().iterator_jk1svi_k$();
4330
+ var _iterator__ex2g4s = get_entries_2().iterator_jk1svi_k$();
3937
4331
  while (_iterator__ex2g4s.hasNext_bitz1p_k$()) {
3938
4332
  var field = _iterator__ex2g4s.next_20eer_k$();
3939
4333
  var v1 = src.get_z3le6l_k$(i1, field);
@@ -3960,8 +4354,11 @@
3960
4354
  GpxWriter_instance = new GpxWriter();
3961
4355
  CsvWriter_instance = new CsvWriter();
3962
4356
  JsonWriter_instance = new JsonWriter();
3963
- ElevationStep_instance = new ElevationStep();
4357
+ Companion_instance_2 = new Companion_1();
4358
+ ElevationGain_instance = new ElevationGain();
3964
4359
  Companion_instance_3 = new Companion_2();
4360
+ ElevationStep_instance = new ElevationStep();
4361
+ Companion_instance_6 = new Companion_5();
3965
4362
  PathSimplifier_instance = new PathSimplifier();
3966
4363
  PointPerDistance_instance = new PointPerDistance();
3967
4364
  PointPerSecond_instance = new PointPerSecond();
@@ -3970,27 +4367,31 @@
3970
4367
  _.$_$ = _.$_$ || {};
3971
4368
  _.$_$.a = GpxPathKind_ROUTE_getInstance;
3972
4369
  _.$_$.b = GpxPathKind_TRACK_getInstance;
3973
- _.$_$.c = PointField_TEMPERATURE_getInstance;
3974
- _.$_$.d = GpxParser_instance;
3975
- _.$_$.e = Companion_getInstance_1;
3976
- _.$_$.f = GpxWriter_instance;
3977
- _.$_$.g = CsvWriter_instance;
3978
- _.$_$.h = JsonWriter_instance;
3979
- _.$_$.i = ElevationStep_instance;
3980
- _.$_$.j = PathSimplifier_instance;
3981
- _.$_$.k = Companion_getInstance_4;
3982
- _.$_$.l = PointPerDistance_instance;
3983
- _.$_$.m = PointPerSecond_instance;
3984
- _.$_$.n = GpxWaypoint;
3985
- _.$_$.o = firstTrackAsPath;
3986
- _.$_$.p = pathsToGpxDocument;
3987
- _.$_$.q = segmentsAsPaths;
3988
- _.$_$.r = toGpxDocument;
3989
- _.$_$.s = tracksAsPaths;
3990
- _.$_$.t = CsvOptions;
3991
- _.$_$.u = JsonOptions;
3992
- _.$_$.v = Path;
3993
- _.$_$.w = get_entries_1;
4370
+ _.$_$.c = ElevationGainPreset_DEM_getInstance;
4371
+ _.$_$.d = PointField_TEMPERATURE_getInstance;
4372
+ _.$_$.e = GpxParser_instance;
4373
+ _.$_$.f = Companion_getInstance_1;
4374
+ _.$_$.g = GpxWriter_instance;
4375
+ _.$_$.h = CsvWriter_instance;
4376
+ _.$_$.i = JsonWriter_instance;
4377
+ _.$_$.j = Companion_instance_3;
4378
+ _.$_$.k = ElevationGain_instance;
4379
+ _.$_$.l = ElevationStep_instance;
4380
+ _.$_$.m = PathSimplifier_instance;
4381
+ _.$_$.n = Companion_getInstance_7;
4382
+ _.$_$.o = PointPerDistance_instance;
4383
+ _.$_$.p = PointPerSecond_instance;
4384
+ _.$_$.q = GpxWaypoint;
4385
+ _.$_$.r = firstTrackAsPath;
4386
+ _.$_$.s = pathsToGpxDocument;
4387
+ _.$_$.t = segmentsAsPaths;
4388
+ _.$_$.u = toGpxDocument;
4389
+ _.$_$.v = tracksAsPaths;
4390
+ _.$_$.w = CsvOptions;
4391
+ _.$_$.x = JsonOptions;
4392
+ _.$_$.y = ElevationGainOptions;
4393
+ _.$_$.z = Path;
4394
+ _.$_$.a1 = get_entries_2;
3994
4395
  //endregion
3995
4396
  return _;
3996
4397
  }));