@glandais/vcyclist-engine 3.0.0 → 3.1.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/README.md +23 -4
- package/fit-kotlin-sdk.js +13575 -0
- package/fit-kotlin-sdk.js.map +1 -0
- package/kotlin-kotlin-stdlib.js +2883 -2128
- package/kotlin-kotlin-stdlib.js.map +1 -1
- package/kotlin_org_jetbrains_kotlin_kotlin_dom_api_compat.js.map +1 -1
- package/kotlinx-atomicfu.js +22 -22
- package/kotlinx-atomicfu.js.map +1 -1
- package/kotlinx-browser.js.map +1 -1
- package/kotlinx-coroutines-core.js +1224 -1224
- package/kotlinx-coroutines-core.js.map +1 -1
- package/kotlinx-serialization-kotlinx-serialization-core.js +1 -1
- package/kotlinx-serialization-kotlinx-serialization-core.js.map +1 -1
- package/package.json +7 -8
- package/vcyclist-elevation.js +931 -931
- package/vcyclist-elevation.js.map +1 -1
- package/vcyclist-engine.js +774 -758
- package/vcyclist-engine.js.map +1 -1
- package/vcyclist-fit.js +456 -424
- package/vcyclist-fit.js.map +1 -1
- package/vcyclist-gpx.js +1112 -1106
- package/vcyclist-gpx.js.map +1 -1
- package/xmlutil-core.js +2983 -2950
- package/xmlutil-core.js.map +1 -1
- package/xmlutil-serialization.js.map +1 -1
package/vcyclist-elevation.js
CHANGED
|
@@ -18,68 +18,68 @@
|
|
|
18
18
|
var imul = Math.imul;
|
|
19
19
|
var hypot = Math.hypot;
|
|
20
20
|
var VOID = kotlin_kotlin.$_$.a;
|
|
21
|
-
var protoOf = kotlin_kotlin.$_$.
|
|
22
|
-
var getNumberHashCode = kotlin_kotlin.$_$.
|
|
23
|
-
var getBooleanHashCode = kotlin_kotlin.$_$.
|
|
24
|
-
var equals = kotlin_kotlin.$_$.
|
|
25
|
-
var initMetadataForClass = kotlin_kotlin.$_$.
|
|
26
|
-
var numberToLong = kotlin_kotlin.$_$.
|
|
27
|
-
var toNumber = kotlin_kotlin.$_$.
|
|
28
|
-
var CoroutineImpl = kotlin_kotlin.$_$.
|
|
29
|
-
var Unit_instance = kotlin_kotlin.$_$.
|
|
30
|
-
var THROW_CCE = kotlin_kotlin.$_$.
|
|
31
|
-
var MutableEntry = kotlin_kotlin.$_$.
|
|
32
|
-
var isInterface = kotlin_kotlin.$_$.
|
|
33
|
-
var get_COROUTINE_SUSPENDED = kotlin_kotlin.$_$.
|
|
34
|
-
var initMetadataForLambda = kotlin_kotlin.$_$.
|
|
35
|
-
var constructCallableReference = kotlin_kotlin.$_$.
|
|
36
|
-
var emptyList = kotlin_kotlin.$_$.
|
|
37
|
-
var LinkedHashMap_init_$Create$ = kotlin_kotlin.$_$.
|
|
38
|
-
var ArrayList_init_$Create$ = kotlin_kotlin.$_$.
|
|
39
|
-
var toList = kotlin_kotlin.$_$.
|
|
40
|
-
var KtList = kotlin_kotlin.$_$.
|
|
41
|
-
var initMetadataForCoroutine = kotlin_kotlin.$_$.
|
|
42
|
-
var toString = kotlin_kotlin.$_$.
|
|
43
|
-
var IllegalArgumentException_init_$Create$ = kotlin_kotlin.$_$.
|
|
44
|
-
var ArrayList_init_$Create$_0 = kotlin_kotlin.$_$.
|
|
45
|
-
var listOf = kotlin_kotlin.$_$.
|
|
46
|
-
var numberToInt = kotlin_kotlin.$_$.
|
|
47
|
-
var initMetadataForObject = kotlin_kotlin.$_$.
|
|
48
|
-
var toList_0 = kotlin_kotlin.$_$.
|
|
49
|
-
var collectionSizeOrDefault = kotlin_kotlin.$_$.
|
|
50
|
-
var get_indices = kotlin_kotlin.$_$.
|
|
51
|
-
var get_lastIndex = kotlin_kotlin.$_$.
|
|
52
|
-
var checkBuilderCapacity = kotlin_kotlin.$_$.
|
|
53
|
-
var IllegalStateException_init_$Create$ = kotlin_kotlin.$_$.
|
|
54
|
-
var coerceIn = kotlin_kotlin.$_$.
|
|
55
|
-
var KFunctionImpl = kotlin_kotlin.$_$.
|
|
56
|
-
var initMetadataForFunctionReference = kotlin_kotlin.$_$.
|
|
57
|
-
var getStringHashCode = kotlin_kotlin.$_$.
|
|
21
|
+
var protoOf = kotlin_kotlin.$_$.t6;
|
|
22
|
+
var getNumberHashCode = kotlin_kotlin.$_$.a6;
|
|
23
|
+
var getBooleanHashCode = kotlin_kotlin.$_$.z5;
|
|
24
|
+
var equals = kotlin_kotlin.$_$.x5;
|
|
25
|
+
var initMetadataForClass = kotlin_kotlin.$_$.e6;
|
|
26
|
+
var numberToLong = kotlin_kotlin.$_$.h5;
|
|
27
|
+
var toNumber = kotlin_kotlin.$_$.k5;
|
|
28
|
+
var CoroutineImpl = kotlin_kotlin.$_$.s4;
|
|
29
|
+
var Unit_instance = kotlin_kotlin.$_$.f1;
|
|
30
|
+
var THROW_CCE = kotlin_kotlin.$_$.e9;
|
|
31
|
+
var MutableEntry = kotlin_kotlin.$_$.p2;
|
|
32
|
+
var isInterface = kotlin_kotlin.$_$.m6;
|
|
33
|
+
var get_COROUTINE_SUSPENDED = kotlin_kotlin.$_$.d4;
|
|
34
|
+
var initMetadataForLambda = kotlin_kotlin.$_$.j6;
|
|
35
|
+
var constructCallableReference = kotlin_kotlin.$_$.u5;
|
|
36
|
+
var emptyList = kotlin_kotlin.$_$.c3;
|
|
37
|
+
var LinkedHashMap_init_$Create$ = kotlin_kotlin.$_$.n1;
|
|
38
|
+
var ArrayList_init_$Create$ = kotlin_kotlin.$_$.i1;
|
|
39
|
+
var toList = kotlin_kotlin.$_$.y3;
|
|
40
|
+
var KtList = kotlin_kotlin.$_$.m2;
|
|
41
|
+
var initMetadataForCoroutine = kotlin_kotlin.$_$.g6;
|
|
42
|
+
var toString = kotlin_kotlin.$_$.w6;
|
|
43
|
+
var IllegalArgumentException_init_$Create$ = kotlin_kotlin.$_$.y1;
|
|
44
|
+
var ArrayList_init_$Create$_0 = kotlin_kotlin.$_$.h1;
|
|
45
|
+
var listOf = kotlin_kotlin.$_$.n3;
|
|
46
|
+
var numberToInt = kotlin_kotlin.$_$.r6;
|
|
47
|
+
var initMetadataForObject = kotlin_kotlin.$_$.k6;
|
|
48
|
+
var toList_0 = kotlin_kotlin.$_$.x3;
|
|
49
|
+
var collectionSizeOrDefault = kotlin_kotlin.$_$.v2;
|
|
50
|
+
var get_indices = kotlin_kotlin.$_$.h3;
|
|
51
|
+
var get_lastIndex = kotlin_kotlin.$_$.j3;
|
|
52
|
+
var checkBuilderCapacity = kotlin_kotlin.$_$.t2;
|
|
53
|
+
var IllegalStateException_init_$Create$ = kotlin_kotlin.$_$.b2;
|
|
54
|
+
var coerceIn = kotlin_kotlin.$_$.e7;
|
|
55
|
+
var KFunctionImpl = kotlin_kotlin.$_$.i7;
|
|
56
|
+
var initMetadataForFunctionReference = kotlin_kotlin.$_$.h6;
|
|
57
|
+
var getStringHashCode = kotlin_kotlin.$_$.c6;
|
|
58
58
|
var CoroutineScope = kotlin_org_jetbrains_kotlinx_kotlinx_coroutines_core.$_$.h;
|
|
59
59
|
var Semaphore = kotlin_org_jetbrains_kotlinx_kotlinx_coroutines_core.$_$.f;
|
|
60
60
|
var async = kotlin_org_jetbrains_kotlinx_kotlinx_coroutines_core.$_$.i;
|
|
61
61
|
var awaitAll = kotlin_org_jetbrains_kotlinx_kotlinx_coroutines_core.$_$.b;
|
|
62
62
|
var coroutineScope = kotlin_org_jetbrains_kotlinx_kotlinx_coroutines_core.$_$.d;
|
|
63
63
|
var CompletableDeferred = kotlin_org_jetbrains_kotlinx_kotlinx_coroutines_core.$_$.g;
|
|
64
|
-
var KtMap = kotlin_kotlin.$_$.
|
|
64
|
+
var KtMap = kotlin_kotlin.$_$.n2;
|
|
65
65
|
var Mutex = kotlin_org_jetbrains_kotlinx_kotlinx_coroutines_core.$_$.e;
|
|
66
|
-
var contentEquals = kotlin_kotlin.$_$.
|
|
67
|
-
var contentHashCode = kotlin_kotlin.$_$.
|
|
68
|
-
var objectCreate = kotlin_kotlin.$_$.
|
|
69
|
-
var round = kotlin_kotlin.$_$.
|
|
70
|
-
var initMetadataForCompanion = kotlin_kotlin.$_$.
|
|
71
|
-
var isNaN_0 = kotlin_kotlin.$_$.
|
|
72
|
-
var replace = kotlin_kotlin.$_$.
|
|
73
|
-
var coerceIn_0 = kotlin_kotlin.$_$.
|
|
66
|
+
var contentEquals = kotlin_kotlin.$_$.w2;
|
|
67
|
+
var contentHashCode = kotlin_kotlin.$_$.x2;
|
|
68
|
+
var objectCreate = kotlin_kotlin.$_$.s6;
|
|
69
|
+
var round = kotlin_kotlin.$_$.z6;
|
|
70
|
+
var initMetadataForCompanion = kotlin_kotlin.$_$.f6;
|
|
71
|
+
var isNaN_0 = kotlin_kotlin.$_$.p9;
|
|
72
|
+
var replace = kotlin_kotlin.$_$.f8;
|
|
73
|
+
var coerceIn_0 = kotlin_kotlin.$_$.d7;
|
|
74
74
|
var GlobalScope_instance = kotlin_org_jetbrains_kotlinx_kotlinx_coroutines_core.$_$.a;
|
|
75
75
|
var promise = kotlin_org_jetbrains_kotlinx_kotlinx_coroutines_core.$_$.j;
|
|
76
|
-
var KProperty0 = kotlin_kotlin.$_$.
|
|
77
|
-
var getPropertyCallableRef = kotlin_kotlin.$_$.
|
|
78
|
-
var isNumber = kotlin_kotlin.$_$.
|
|
76
|
+
var KProperty0 = kotlin_kotlin.$_$.k7;
|
|
77
|
+
var getPropertyCallableRef = kotlin_kotlin.$_$.b6;
|
|
78
|
+
var isNumber = kotlin_kotlin.$_$.n6;
|
|
79
79
|
var await_0 = kotlin_org_jetbrains_kotlinx_kotlinx_coroutines_core.$_$.c;
|
|
80
|
-
var IllegalStateException_init_$Create$_0 = kotlin_kotlin.$_$.
|
|
81
|
-
var charSequenceLength = kotlin_kotlin.$_$.
|
|
82
|
-
var lazy = kotlin_kotlin.$_$.
|
|
80
|
+
var IllegalStateException_init_$Create$_0 = kotlin_kotlin.$_$.a2;
|
|
81
|
+
var charSequenceLength = kotlin_kotlin.$_$.s5;
|
|
82
|
+
var lazy = kotlin_kotlin.$_$.q9;
|
|
83
83
|
//endregion
|
|
84
84
|
//region block: pre-declaration
|
|
85
85
|
initMetadataForClass(SmoothingOptions, 'SmoothingOptions', SmoothingOptions);
|
|
@@ -132,15 +132,15 @@
|
|
|
132
132
|
function SmoothingOptions(windowSize, enabled) {
|
|
133
133
|
windowSize = windowSize === VOID ? 50.0 : windowSize;
|
|
134
134
|
enabled = enabled === VOID ? false : enabled;
|
|
135
|
-
this.
|
|
136
|
-
this.
|
|
135
|
+
this.windowSize_1 = windowSize;
|
|
136
|
+
this.enabled_1 = enabled;
|
|
137
137
|
}
|
|
138
138
|
protoOf(SmoothingOptions).toString = function () {
|
|
139
|
-
return 'SmoothingOptions(windowSize=' + this.
|
|
139
|
+
return 'SmoothingOptions(windowSize=' + this.windowSize_1 + ', enabled=' + this.enabled_1 + ')';
|
|
140
140
|
};
|
|
141
141
|
protoOf(SmoothingOptions).hashCode = function () {
|
|
142
|
-
var result = this.
|
|
143
|
-
result = imul(result, 31) + getBooleanHashCode(this.
|
|
142
|
+
var result = this.windowSize_1 == null ? 0 : getNumberHashCode(this.windowSize_1);
|
|
143
|
+
result = imul(result, 31) + getBooleanHashCode(this.enabled_1) | 0;
|
|
144
144
|
return result;
|
|
145
145
|
};
|
|
146
146
|
protoOf(SmoothingOptions).equals = function (other) {
|
|
@@ -148,9 +148,9 @@
|
|
|
148
148
|
return true;
|
|
149
149
|
if (!(other instanceof SmoothingOptions))
|
|
150
150
|
return false;
|
|
151
|
-
if (!equals(this.
|
|
151
|
+
if (!equals(this.windowSize_1, other.windowSize_1))
|
|
152
152
|
return false;
|
|
153
|
-
if (!(this.
|
|
153
|
+
if (!(this.enabled_1 === other.enabled_1))
|
|
154
154
|
return false;
|
|
155
155
|
return true;
|
|
156
156
|
};
|
|
@@ -158,17 +158,17 @@
|
|
|
158
158
|
tolerance = tolerance === VOID ? 10.0 : tolerance;
|
|
159
159
|
zExaggeration = zExaggeration === VOID ? 3.0 : zExaggeration;
|
|
160
160
|
enabled = enabled === VOID ? false : enabled;
|
|
161
|
-
this.
|
|
162
|
-
this.
|
|
163
|
-
this.
|
|
161
|
+
this.tolerance_1 = tolerance;
|
|
162
|
+
this.zExaggeration_1 = zExaggeration;
|
|
163
|
+
this.enabled_1 = enabled;
|
|
164
164
|
}
|
|
165
165
|
protoOf(FilterOptions).toString = function () {
|
|
166
|
-
return 'FilterOptions(tolerance=' + this.
|
|
166
|
+
return 'FilterOptions(tolerance=' + this.tolerance_1 + ', zExaggeration=' + this.zExaggeration_1 + ', enabled=' + this.enabled_1 + ')';
|
|
167
167
|
};
|
|
168
168
|
protoOf(FilterOptions).hashCode = function () {
|
|
169
|
-
var result = this.
|
|
170
|
-
result = imul(result, 31) + (this.
|
|
171
|
-
result = imul(result, 31) + getBooleanHashCode(this.
|
|
169
|
+
var result = this.tolerance_1 == null ? 0 : getNumberHashCode(this.tolerance_1);
|
|
170
|
+
result = imul(result, 31) + (this.zExaggeration_1 == null ? 0 : getNumberHashCode(this.zExaggeration_1)) | 0;
|
|
171
|
+
result = imul(result, 31) + getBooleanHashCode(this.enabled_1) | 0;
|
|
172
172
|
return result;
|
|
173
173
|
};
|
|
174
174
|
protoOf(FilterOptions).equals = function (other) {
|
|
@@ -176,11 +176,11 @@
|
|
|
176
176
|
return true;
|
|
177
177
|
if (!(other instanceof FilterOptions))
|
|
178
178
|
return false;
|
|
179
|
-
if (!equals(this.
|
|
179
|
+
if (!equals(this.tolerance_1, other.tolerance_1))
|
|
180
180
|
return false;
|
|
181
|
-
if (!equals(this.
|
|
181
|
+
if (!equals(this.zExaggeration_1, other.zExaggeration_1))
|
|
182
182
|
return false;
|
|
183
|
-
if (!(this.
|
|
183
|
+
if (!(this.enabled_1 === other.enabled_1))
|
|
184
184
|
return false;
|
|
185
185
|
return true;
|
|
186
186
|
};
|
|
@@ -189,44 +189,44 @@
|
|
|
189
189
|
return toNumber(asLong) === d ? asLong.toString() : d.toString();
|
|
190
190
|
}
|
|
191
191
|
function BatchCalculator$setElevations$slambda($coordinates, this$0, $zoomLevel, $interpolation, $results, resultContinuation) {
|
|
192
|
-
this
|
|
193
|
-
this.
|
|
194
|
-
this
|
|
195
|
-
this
|
|
196
|
-
this
|
|
192
|
+
this.$coordinates_1 = $coordinates;
|
|
193
|
+
this.this$0__1 = this$0;
|
|
194
|
+
this.$zoomLevel_1 = $zoomLevel;
|
|
195
|
+
this.$interpolation_1 = $interpolation;
|
|
196
|
+
this.$results_1 = $results;
|
|
197
197
|
CoroutineImpl.call(this, resultContinuation);
|
|
198
198
|
}
|
|
199
|
-
protoOf(BatchCalculator$setElevations$slambda).
|
|
200
|
-
var tmp = this.
|
|
201
|
-
tmp.
|
|
202
|
-
tmp.
|
|
203
|
-
return tmp.
|
|
199
|
+
protoOf(BatchCalculator$setElevations$slambda).invoke_adz50t_k$ = function (_destruct__k2r9zo, $completion) {
|
|
200
|
+
var tmp = this.create_83s1ov_k$(_destruct__k2r9zo, $completion);
|
|
201
|
+
tmp.result_1 = Unit_instance;
|
|
202
|
+
tmp.exception_1 = null;
|
|
203
|
+
return tmp.doResume_5yljmg_k$();
|
|
204
204
|
};
|
|
205
|
-
protoOf(BatchCalculator$setElevations$slambda).
|
|
206
|
-
return this.
|
|
205
|
+
protoOf(BatchCalculator$setElevations$slambda).invoke_qns8j1_k$ = function (p1, $completion) {
|
|
206
|
+
return this.invoke_adz50t_k$((!(p1 == null) ? isInterface(p1, MutableEntry) : false) ? p1 : THROW_CCE(), $completion);
|
|
207
207
|
};
|
|
208
|
-
protoOf(BatchCalculator$setElevations$slambda).
|
|
209
|
-
var suspendResult = this.
|
|
208
|
+
protoOf(BatchCalculator$setElevations$slambda).doResume_5yljmg_k$ = function () {
|
|
209
|
+
var suspendResult = this.result_1;
|
|
210
210
|
$sm: do
|
|
211
211
|
try {
|
|
212
|
-
var tmp = this.
|
|
212
|
+
var tmp = this.state_1;
|
|
213
213
|
switch (tmp) {
|
|
214
214
|
case 0:
|
|
215
|
-
this.
|
|
216
|
-
var indices = this.
|
|
217
|
-
this.
|
|
218
|
-
this.
|
|
215
|
+
this.exceptionState_1 = 4;
|
|
216
|
+
var indices = this._destruct__k2r9zo_1.get_value_j01efc_k$();
|
|
217
|
+
this._iterator_2_yqohr2__1 = indices.iterator_jk1svi_k$();
|
|
218
|
+
this.state_1 = 1;
|
|
219
219
|
continue $sm;
|
|
220
220
|
case 1:
|
|
221
|
-
if (!this.
|
|
222
|
-
this.
|
|
221
|
+
if (!this._iterator_2_yqohr2__1.hasNext_bitz1p_k$()) {
|
|
222
|
+
this.state_1 = 3;
|
|
223
223
|
continue $sm;
|
|
224
224
|
}
|
|
225
225
|
|
|
226
|
-
this.
|
|
227
|
-
this.
|
|
228
|
-
this.
|
|
229
|
-
suspendResult = this.
|
|
226
|
+
this.i1__1 = this._iterator_2_yqohr2__1.next_20eer_k$();
|
|
227
|
+
this.coord0__1 = this.$coordinates_1.get_c1px32_k$(this.i1__1);
|
|
228
|
+
this.state_1 = 2;
|
|
229
|
+
suspendResult = this.this$0__1.calculator_1.getElevation_e117b3_k$(this.coord0__1, this.$zoomLevel_1, this.$interpolation_1, this);
|
|
230
230
|
if (suspendResult === get_COROUTINE_SUSPENDED()) {
|
|
231
231
|
return suspendResult;
|
|
232
232
|
}
|
|
@@ -234,136 +234,136 @@
|
|
|
234
234
|
continue $sm;
|
|
235
235
|
case 2:
|
|
236
236
|
var ele = suspendResult;
|
|
237
|
-
this
|
|
238
|
-
this.
|
|
237
|
+
this.$results_1[this.i1__1] = new LatLonElevation(this.coord0__1.get_latitude_feukvp_k$(), this.coord0__1.get_longitude_asb1fq_k$(), ele);
|
|
238
|
+
this.state_1 = 1;
|
|
239
239
|
continue $sm;
|
|
240
240
|
case 3:
|
|
241
241
|
return Unit_instance;
|
|
242
242
|
case 4:
|
|
243
|
-
throw this.
|
|
243
|
+
throw this.exception_1;
|
|
244
244
|
}
|
|
245
245
|
} catch ($p) {
|
|
246
246
|
var e = $p;
|
|
247
|
-
if (this.
|
|
247
|
+
if (this.exceptionState_1 === 4) {
|
|
248
248
|
throw e;
|
|
249
249
|
} else {
|
|
250
|
-
this.
|
|
251
|
-
this.
|
|
250
|
+
this.state_1 = this.exceptionState_1;
|
|
251
|
+
this.exception_1 = e;
|
|
252
252
|
}
|
|
253
253
|
}
|
|
254
254
|
while (true);
|
|
255
255
|
};
|
|
256
|
-
protoOf(BatchCalculator$setElevations$slambda).
|
|
257
|
-
var i = new BatchCalculator$setElevations$slambda(this
|
|
258
|
-
i.
|
|
256
|
+
protoOf(BatchCalculator$setElevations$slambda).create_83s1ov_k$ = function (_destruct__k2r9zo, completion) {
|
|
257
|
+
var i = new BatchCalculator$setElevations$slambda(this.$coordinates_1, this.this$0__1, this.$zoomLevel_1, this.$interpolation_1, this.$results_1, completion);
|
|
258
|
+
i._destruct__k2r9zo_1 = _destruct__k2r9zo;
|
|
259
259
|
return i;
|
|
260
260
|
};
|
|
261
261
|
function BatchCalculator$setElevations$slambda_0($coordinates, this$0, $zoomLevel, $interpolation, $results, resultContinuation) {
|
|
262
262
|
var i = new BatchCalculator$setElevations$slambda($coordinates, this$0, $zoomLevel, $interpolation, $results, resultContinuation);
|
|
263
263
|
return constructCallableReference(function (_destruct__k2r9zo, $completion) {
|
|
264
|
-
return i.
|
|
264
|
+
return i.invoke_adz50t_k$(_destruct__k2r9zo, $completion);
|
|
265
265
|
}, 1);
|
|
266
266
|
}
|
|
267
267
|
function $setElevationsCOROUTINE$(_this__u8e3s4, coordinates, zoomLevel, interpolation, maxParallelTiles, resultContinuation) {
|
|
268
268
|
CoroutineImpl.call(this, resultContinuation);
|
|
269
|
-
this.
|
|
270
|
-
this.
|
|
271
|
-
this.
|
|
272
|
-
this.
|
|
273
|
-
this.
|
|
274
|
-
}
|
|
275
|
-
protoOf($setElevationsCOROUTINE$).
|
|
276
|
-
var suspendResult = this.
|
|
269
|
+
this._this__u8e3s4__1 = _this__u8e3s4;
|
|
270
|
+
this.coordinates_1 = coordinates;
|
|
271
|
+
this.zoomLevel_1 = zoomLevel;
|
|
272
|
+
this.interpolation_1 = interpolation;
|
|
273
|
+
this.maxParallelTiles_1 = maxParallelTiles;
|
|
274
|
+
}
|
|
275
|
+
protoOf($setElevationsCOROUTINE$).doResume_5yljmg_k$ = function () {
|
|
276
|
+
var suspendResult = this.result_1;
|
|
277
277
|
$sm: do
|
|
278
278
|
try {
|
|
279
|
-
var tmp = this.
|
|
279
|
+
var tmp = this.state_1;
|
|
280
280
|
switch (tmp) {
|
|
281
281
|
case 0:
|
|
282
|
-
this.
|
|
283
|
-
if (this.
|
|
282
|
+
this.exceptionState_1 = 2;
|
|
283
|
+
if (this.coordinates_1.isEmpty_y1axqb_k$())
|
|
284
284
|
return emptyList();
|
|
285
285
|
var tmp_0 = this;
|
|
286
|
-
var size = this.
|
|
287
|
-
tmp_0.
|
|
286
|
+
var size = this.coordinates_1.get_size_woubt6_k$();
|
|
287
|
+
tmp_0.results0__1 = Array(size);
|
|
288
288
|
var byTile = LinkedHashMap_init_$Create$();
|
|
289
|
-
var iterator = this.
|
|
289
|
+
var iterator = this.coordinates_1.iterator_jk1svi_k$();
|
|
290
290
|
var index = 0;
|
|
291
|
-
while (iterator.
|
|
291
|
+
while (iterator.hasNext_bitz1p_k$()) {
|
|
292
292
|
var i = index;
|
|
293
293
|
index = index + 1 | 0;
|
|
294
|
-
var p = iterator.
|
|
295
|
-
var tile = ElevationFunctions_instance.
|
|
296
|
-
var key = '' + tile.
|
|
297
|
-
var value = byTile.
|
|
294
|
+
var p = iterator.next_20eer_k$();
|
|
295
|
+
var tile = ElevationFunctions_instance.toTileCoordinates_jamtrs_k$(p, this.zoomLevel_1);
|
|
296
|
+
var key = '' + tile.z_1 + '/' + tile.x_1 + '/' + tile.y_1;
|
|
297
|
+
var value = byTile.get_wei43m_k$(key);
|
|
298
298
|
var tmp_1;
|
|
299
299
|
if (value == null) {
|
|
300
300
|
var answer = ArrayList_init_$Create$();
|
|
301
|
-
byTile.
|
|
301
|
+
byTile.put_4fpzoq_k$(key, answer);
|
|
302
302
|
tmp_1 = answer;
|
|
303
303
|
} else {
|
|
304
304
|
tmp_1 = value;
|
|
305
305
|
}
|
|
306
|
-
tmp_1.
|
|
306
|
+
tmp_1.add_utx5q5_k$(i);
|
|
307
307
|
}
|
|
308
308
|
|
|
309
|
-
this.
|
|
309
|
+
this.state_1 = 1;
|
|
310
310
|
var tmp_2 = Flux_instance;
|
|
311
|
-
var tmp_3 = byTile.
|
|
312
|
-
suspendResult = tmp_2.
|
|
311
|
+
var tmp_3 = byTile.get_entries_p20ztl_k$();
|
|
312
|
+
suspendResult = tmp_2.forEachParallel_gstfa7_k$(tmp_3, this.maxParallelTiles_1, BatchCalculator$setElevations$slambda_0(this.coordinates_1, this._this__u8e3s4__1, this.zoomLevel_1, this.interpolation_1, this.results0__1, null), this);
|
|
313
313
|
if (suspendResult === get_COROUTINE_SUSPENDED()) {
|
|
314
314
|
return suspendResult;
|
|
315
315
|
}
|
|
316
316
|
|
|
317
317
|
continue $sm;
|
|
318
318
|
case 1:
|
|
319
|
-
var tmp_4 = toList(this.
|
|
319
|
+
var tmp_4 = toList(this.results0__1);
|
|
320
320
|
return isInterface(tmp_4, KtList) ? tmp_4 : THROW_CCE();
|
|
321
321
|
case 2:
|
|
322
|
-
throw this.
|
|
322
|
+
throw this.exception_1;
|
|
323
323
|
}
|
|
324
324
|
} catch ($p) {
|
|
325
325
|
var e = $p;
|
|
326
|
-
if (this.
|
|
326
|
+
if (this.exceptionState_1 === 2) {
|
|
327
327
|
throw e;
|
|
328
328
|
} else {
|
|
329
|
-
this.
|
|
330
|
-
this.
|
|
329
|
+
this.state_1 = this.exceptionState_1;
|
|
330
|
+
this.exception_1 = e;
|
|
331
331
|
}
|
|
332
332
|
}
|
|
333
333
|
while (true);
|
|
334
334
|
};
|
|
335
335
|
function $getElevationsAlongCOROUTINE$(_this__u8e3s4, path, zoomLevel, step, minDistance, interpolation, smoothingOptions, filterOptions, resultContinuation) {
|
|
336
336
|
CoroutineImpl.call(this, resultContinuation);
|
|
337
|
-
this.
|
|
338
|
-
this.
|
|
339
|
-
this.
|
|
340
|
-
this.
|
|
341
|
-
this.
|
|
342
|
-
this.
|
|
343
|
-
this.
|
|
344
|
-
this.
|
|
345
|
-
}
|
|
346
|
-
protoOf($getElevationsAlongCOROUTINE$).
|
|
347
|
-
var suspendResult = this.
|
|
337
|
+
this._this__u8e3s4__1 = _this__u8e3s4;
|
|
338
|
+
this.path_1 = path;
|
|
339
|
+
this.zoomLevel_1 = zoomLevel;
|
|
340
|
+
this.step_1 = step;
|
|
341
|
+
this.minDistance_1 = minDistance;
|
|
342
|
+
this.interpolation_1 = interpolation;
|
|
343
|
+
this.smoothingOptions_1 = smoothingOptions;
|
|
344
|
+
this.filterOptions_1 = filterOptions;
|
|
345
|
+
}
|
|
346
|
+
protoOf($getElevationsAlongCOROUTINE$).doResume_5yljmg_k$ = function () {
|
|
347
|
+
var suspendResult = this.result_1;
|
|
348
348
|
$sm: do
|
|
349
349
|
try {
|
|
350
|
-
var tmp = this.
|
|
350
|
+
var tmp = this.state_1;
|
|
351
351
|
switch (tmp) {
|
|
352
352
|
case 0:
|
|
353
|
-
this.
|
|
354
|
-
if (!(this.
|
|
353
|
+
this.exceptionState_1 = 2;
|
|
354
|
+
if (!(this.path_1.get_size_woubt6_k$() >= 2)) {
|
|
355
355
|
var message = 'Path must contain at least 2 coordinates';
|
|
356
356
|
throw IllegalArgumentException_init_$Create$(toString(message));
|
|
357
357
|
}
|
|
358
358
|
|
|
359
|
-
if (!(this.
|
|
360
|
-
var message_0 = 'Step is too small: ' + formatNumber(this.
|
|
359
|
+
if (!(this.step_1 > 1.0)) {
|
|
360
|
+
var message_0 = 'Step is too small: ' + formatNumber(this._this__u8e3s4__1, this.step_1) + ' meters';
|
|
361
361
|
throw IllegalArgumentException_init_$Create$(toString(message_0));
|
|
362
362
|
}
|
|
363
363
|
|
|
364
|
-
var densified = this.
|
|
365
|
-
this.
|
|
366
|
-
suspendResult = this.
|
|
364
|
+
var densified = this._this__u8e3s4__1.generateCoordinatesAlong_8q0lbj_k$(this.path_1, this.step_1, this.minDistance_1);
|
|
365
|
+
this.state_1 = 1;
|
|
366
|
+
suspendResult = this._this__u8e3s4__1.setElevations$default_qzn313_k$(densified, this.zoomLevel_1, this.interpolation_1, VOID, this);
|
|
367
367
|
if (suspendResult === get_COROUTINE_SUSPENDED()) {
|
|
368
368
|
return suspendResult;
|
|
369
369
|
}
|
|
@@ -372,9 +372,9 @@
|
|
|
372
372
|
case 1:
|
|
373
373
|
var withElevation = suspendResult;
|
|
374
374
|
var tmp_0;
|
|
375
|
-
var tmp1_safe_receiver = this.
|
|
376
|
-
if ((tmp1_safe_receiver == null ? null : tmp1_safe_receiver.
|
|
377
|
-
tmp_0 = withElevation.
|
|
375
|
+
var tmp1_safe_receiver = this.smoothingOptions_1;
|
|
376
|
+
if ((tmp1_safe_receiver == null ? null : tmp1_safe_receiver.enabled_1) === true) {
|
|
377
|
+
tmp_0 = withElevation.get_size_woubt6_k$() >= 3;
|
|
378
378
|
} else {
|
|
379
379
|
tmp_0 = false;
|
|
380
380
|
}
|
|
@@ -382,14 +382,14 @@
|
|
|
382
382
|
if (tmp_0) {
|
|
383
383
|
var tmp_1 = ElevationSmoother_instance;
|
|
384
384
|
var tmp_2 = withElevation;
|
|
385
|
-
var tmp0_elvis_lhs = this.
|
|
386
|
-
withElevation = tmp_1.
|
|
385
|
+
var tmp0_elvis_lhs = this.smoothingOptions_1.windowSize_1;
|
|
386
|
+
withElevation = tmp_1.smooth_j2mgq7_k$(tmp_2, tmp0_elvis_lhs == null ? 50.0 : tmp0_elvis_lhs);
|
|
387
387
|
}
|
|
388
388
|
|
|
389
389
|
var tmp_3;
|
|
390
|
-
var tmp4_safe_receiver = this.
|
|
391
|
-
if ((tmp4_safe_receiver == null ? null : tmp4_safe_receiver.
|
|
392
|
-
tmp_3 = withElevation.
|
|
390
|
+
var tmp4_safe_receiver = this.filterOptions_1;
|
|
391
|
+
if ((tmp4_safe_receiver == null ? null : tmp4_safe_receiver.enabled_1) === true) {
|
|
392
|
+
tmp_3 = withElevation.get_size_woubt6_k$() > 2;
|
|
393
393
|
} else {
|
|
394
394
|
tmp_3 = false;
|
|
395
395
|
}
|
|
@@ -397,89 +397,89 @@
|
|
|
397
397
|
if (tmp_3) {
|
|
398
398
|
var tmp_4 = DouglasPeucker_instance;
|
|
399
399
|
var tmp_5 = withElevation;
|
|
400
|
-
var tmp2_elvis_lhs = this.
|
|
400
|
+
var tmp2_elvis_lhs = this.filterOptions_1.tolerance_1;
|
|
401
401
|
var tmp_6 = tmp2_elvis_lhs == null ? 10.0 : tmp2_elvis_lhs;
|
|
402
|
-
var tmp3_elvis_lhs = this.
|
|
403
|
-
withElevation = tmp_4.
|
|
402
|
+
var tmp3_elvis_lhs = this.filterOptions_1.zExaggeration_1;
|
|
403
|
+
withElevation = tmp_4.simplify_o1pnyo_k$(tmp_5, tmp_6, tmp3_elvis_lhs == null ? 3.0 : tmp3_elvis_lhs);
|
|
404
404
|
}
|
|
405
405
|
|
|
406
406
|
return withElevation;
|
|
407
407
|
case 2:
|
|
408
|
-
throw this.
|
|
408
|
+
throw this.exception_1;
|
|
409
409
|
}
|
|
410
410
|
} catch ($p) {
|
|
411
411
|
var e = $p;
|
|
412
|
-
if (this.
|
|
412
|
+
if (this.exceptionState_1 === 2) {
|
|
413
413
|
throw e;
|
|
414
414
|
} else {
|
|
415
|
-
this.
|
|
416
|
-
this.
|
|
415
|
+
this.state_1 = this.exceptionState_1;
|
|
416
|
+
this.exception_1 = e;
|
|
417
417
|
}
|
|
418
418
|
}
|
|
419
419
|
while (true);
|
|
420
420
|
};
|
|
421
421
|
function BatchCalculator(calculator) {
|
|
422
|
-
this.
|
|
422
|
+
this.calculator_1 = calculator;
|
|
423
423
|
}
|
|
424
|
-
protoOf(BatchCalculator).
|
|
424
|
+
protoOf(BatchCalculator).setElevations_anil9n_k$ = function (coordinates, zoomLevel, interpolation, maxParallelTiles, $completion) {
|
|
425
425
|
var tmp = new $setElevationsCOROUTINE$(this, coordinates, zoomLevel, interpolation, maxParallelTiles, $completion);
|
|
426
|
-
tmp.
|
|
427
|
-
tmp.
|
|
428
|
-
return tmp.
|
|
426
|
+
tmp.result_1 = Unit_instance;
|
|
427
|
+
tmp.exception_1 = null;
|
|
428
|
+
return tmp.doResume_5yljmg_k$();
|
|
429
429
|
};
|
|
430
|
-
protoOf(BatchCalculator).
|
|
430
|
+
protoOf(BatchCalculator).setElevations$default_qzn313_k$ = function (coordinates, zoomLevel, interpolation, maxParallelTiles, $completion, $super) {
|
|
431
431
|
maxParallelTiles = maxParallelTiles === VOID ? 10 : maxParallelTiles;
|
|
432
|
-
return $super === VOID ? this.
|
|
432
|
+
return $super === VOID ? this.setElevations_anil9n_k$(coordinates, zoomLevel, interpolation, maxParallelTiles, $completion) : $super.setElevations_anil9n_k$.call(this, coordinates, zoomLevel, interpolation, maxParallelTiles, $completion);
|
|
433
433
|
};
|
|
434
|
-
protoOf(BatchCalculator).
|
|
434
|
+
protoOf(BatchCalculator).getElevationsAlong_4qke12_k$ = function (path, zoomLevel, step, minDistance, interpolation, smoothingOptions, filterOptions, $completion) {
|
|
435
435
|
var tmp = new $getElevationsAlongCOROUTINE$(this, path, zoomLevel, step, minDistance, interpolation, smoothingOptions, filterOptions, $completion);
|
|
436
|
-
tmp.
|
|
437
|
-
tmp.
|
|
438
|
-
return tmp.
|
|
436
|
+
tmp.result_1 = Unit_instance;
|
|
437
|
+
tmp.exception_1 = null;
|
|
438
|
+
return tmp.doResume_5yljmg_k$();
|
|
439
439
|
};
|
|
440
|
-
protoOf(BatchCalculator).
|
|
441
|
-
if (path.
|
|
440
|
+
protoOf(BatchCalculator).generateCoordinatesAlong_8q0lbj_k$ = function (path, step, minDistance) {
|
|
441
|
+
if (path.isEmpty_y1axqb_k$())
|
|
442
442
|
return emptyList();
|
|
443
|
-
var out = ArrayList_init_$Create$_0(imul(path.
|
|
443
|
+
var out = ArrayList_init_$Create$_0(imul(path.get_size_woubt6_k$(), 2));
|
|
444
444
|
// Inline function 'kotlin.collections.plusAssign' call
|
|
445
|
-
var element = path.
|
|
446
|
-
out.
|
|
445
|
+
var element = path.get_c1px32_k$(0);
|
|
446
|
+
out.add_utx5q5_k$(element);
|
|
447
447
|
var inductionVariable = 0;
|
|
448
|
-
var last = path.
|
|
448
|
+
var last = path.get_size_woubt6_k$() - 1 | 0;
|
|
449
449
|
if (inductionVariable < last)
|
|
450
450
|
$l$loop: do {
|
|
451
451
|
var i = inductionVariable;
|
|
452
452
|
inductionVariable = inductionVariable + 1 | 0;
|
|
453
|
-
var a = path.
|
|
454
|
-
var b = path.
|
|
455
|
-
var d = Distance_instance.
|
|
453
|
+
var a = path.get_c1px32_k$(i);
|
|
454
|
+
var b = path.get_c1px32_k$(i + 1 | 0);
|
|
455
|
+
var d = Distance_instance.haversine_mrx4ab_k$(a, b);
|
|
456
456
|
if (d < minDistance)
|
|
457
457
|
continue $l$loop;
|
|
458
|
-
var between = this.
|
|
458
|
+
var between = this.generateCoordinatesBetween_nqn6s8_k$(a, b, step, d);
|
|
459
459
|
var inductionVariable_0 = 1;
|
|
460
|
-
var last_0 = between.
|
|
460
|
+
var last_0 = between.get_size_woubt6_k$();
|
|
461
461
|
if (inductionVariable_0 < last_0)
|
|
462
462
|
do {
|
|
463
463
|
var j = inductionVariable_0;
|
|
464
464
|
inductionVariable_0 = inductionVariable_0 + 1 | 0;
|
|
465
465
|
// Inline function 'kotlin.collections.plusAssign' call
|
|
466
|
-
var element_0 = between.
|
|
467
|
-
out.
|
|
466
|
+
var element_0 = between.get_c1px32_k$(j);
|
|
467
|
+
out.add_utx5q5_k$(element_0);
|
|
468
468
|
}
|
|
469
469
|
while (inductionVariable_0 < last_0);
|
|
470
470
|
}
|
|
471
471
|
while (inductionVariable < last);
|
|
472
472
|
return out;
|
|
473
473
|
};
|
|
474
|
-
protoOf(BatchCalculator).
|
|
474
|
+
protoOf(BatchCalculator).generateCoordinatesBetween_nqn6s8_k$ = function (a, b, step, distance) {
|
|
475
475
|
if (distance <= step)
|
|
476
476
|
return listOf([a, b]);
|
|
477
477
|
var numSteps = numberToInt(distance / step);
|
|
478
478
|
var out = ArrayList_init_$Create$_0(numSteps + 2 | 0);
|
|
479
479
|
// Inline function 'kotlin.collections.plusAssign' call
|
|
480
|
-
out.
|
|
481
|
-
var latDiff = b.
|
|
482
|
-
var lonDiff = b.
|
|
480
|
+
out.add_utx5q5_k$(a);
|
|
481
|
+
var latDiff = b.get_latitude_feukvp_k$() - a.get_latitude_feukvp_k$();
|
|
482
|
+
var lonDiff = b.get_longitude_asb1fq_k$() - a.get_longitude_asb1fq_k$();
|
|
483
483
|
var inductionVariable = 1;
|
|
484
484
|
if (inductionVariable <= numSteps)
|
|
485
485
|
do {
|
|
@@ -487,36 +487,36 @@
|
|
|
487
487
|
inductionVariable = inductionVariable + 1 | 0;
|
|
488
488
|
var f = i * step / distance;
|
|
489
489
|
// Inline function 'kotlin.collections.plusAssign' call
|
|
490
|
-
var element = new LatLon(a.
|
|
491
|
-
out.
|
|
490
|
+
var element = new LatLon(a.get_latitude_feukvp_k$() + latDiff * f, a.get_longitude_asb1fq_k$() + lonDiff * f);
|
|
491
|
+
out.add_utx5q5_k$(element);
|
|
492
492
|
}
|
|
493
493
|
while (!(i === numSteps));
|
|
494
494
|
// Inline function 'kotlin.collections.plusAssign' call
|
|
495
|
-
out.
|
|
495
|
+
out.add_utx5q5_k$(b);
|
|
496
496
|
return out;
|
|
497
497
|
};
|
|
498
498
|
function LatLon(latitude, longitude, elevation) {
|
|
499
499
|
elevation = elevation === VOID ? null : elevation;
|
|
500
|
-
this.
|
|
501
|
-
this.
|
|
502
|
-
this.
|
|
500
|
+
this.latitude_1 = latitude;
|
|
501
|
+
this.longitude_1 = longitude;
|
|
502
|
+
this.elevation_1 = elevation;
|
|
503
503
|
}
|
|
504
|
-
protoOf(LatLon).
|
|
505
|
-
return this.
|
|
504
|
+
protoOf(LatLon).get_latitude_feukvp_k$ = function () {
|
|
505
|
+
return this.latitude_1;
|
|
506
506
|
};
|
|
507
|
-
protoOf(LatLon).
|
|
508
|
-
return this.
|
|
507
|
+
protoOf(LatLon).get_longitude_asb1fq_k$ = function () {
|
|
508
|
+
return this.longitude_1;
|
|
509
509
|
};
|
|
510
|
-
protoOf(LatLon).
|
|
511
|
-
return this.
|
|
510
|
+
protoOf(LatLon).get_elevation_8fwyb8_k$ = function () {
|
|
511
|
+
return this.elevation_1;
|
|
512
512
|
};
|
|
513
513
|
protoOf(LatLon).toString = function () {
|
|
514
|
-
return 'LatLon(latitude=' + this.
|
|
514
|
+
return 'LatLon(latitude=' + this.latitude_1 + ', longitude=' + this.longitude_1 + ', elevation=' + this.elevation_1 + ')';
|
|
515
515
|
};
|
|
516
516
|
protoOf(LatLon).hashCode = function () {
|
|
517
|
-
var result = getNumberHashCode(this.
|
|
518
|
-
result = imul(result, 31) + getNumberHashCode(this.
|
|
519
|
-
result = imul(result, 31) + (this.
|
|
517
|
+
var result = getNumberHashCode(this.latitude_1);
|
|
518
|
+
result = imul(result, 31) + getNumberHashCode(this.longitude_1) | 0;
|
|
519
|
+
result = imul(result, 31) + (this.elevation_1 == null ? 0 : getNumberHashCode(this.elevation_1)) | 0;
|
|
520
520
|
return result;
|
|
521
521
|
};
|
|
522
522
|
protoOf(LatLon).equals = function (other) {
|
|
@@ -524,35 +524,35 @@
|
|
|
524
524
|
return true;
|
|
525
525
|
if (!(other instanceof LatLon))
|
|
526
526
|
return false;
|
|
527
|
-
if (!equals(this.
|
|
527
|
+
if (!equals(this.latitude_1, other.latitude_1))
|
|
528
528
|
return false;
|
|
529
|
-
if (!equals(this.
|
|
529
|
+
if (!equals(this.longitude_1, other.longitude_1))
|
|
530
530
|
return false;
|
|
531
|
-
if (!equals(this.
|
|
531
|
+
if (!equals(this.elevation_1, other.elevation_1))
|
|
532
532
|
return false;
|
|
533
533
|
return true;
|
|
534
534
|
};
|
|
535
535
|
function LatLonElevation(latitude, longitude, elevation) {
|
|
536
|
-
this.
|
|
537
|
-
this.
|
|
538
|
-
this.
|
|
536
|
+
this.latitude_1 = latitude;
|
|
537
|
+
this.longitude_1 = longitude;
|
|
538
|
+
this.elevation_1 = elevation;
|
|
539
539
|
}
|
|
540
|
-
protoOf(LatLonElevation).
|
|
541
|
-
return this.
|
|
540
|
+
protoOf(LatLonElevation).get_latitude_feukvp_k$ = function () {
|
|
541
|
+
return this.latitude_1;
|
|
542
542
|
};
|
|
543
|
-
protoOf(LatLonElevation).
|
|
544
|
-
return this.
|
|
543
|
+
protoOf(LatLonElevation).get_longitude_asb1fq_k$ = function () {
|
|
544
|
+
return this.longitude_1;
|
|
545
545
|
};
|
|
546
|
-
protoOf(LatLonElevation).
|
|
547
|
-
return this.
|
|
546
|
+
protoOf(LatLonElevation).get_elevation_8fwyb8_k$ = function () {
|
|
547
|
+
return this.elevation_1;
|
|
548
548
|
};
|
|
549
549
|
protoOf(LatLonElevation).toString = function () {
|
|
550
|
-
return 'LatLonElevation(latitude=' + this.
|
|
550
|
+
return 'LatLonElevation(latitude=' + this.latitude_1 + ', longitude=' + this.longitude_1 + ', elevation=' + this.elevation_1 + ')';
|
|
551
551
|
};
|
|
552
552
|
protoOf(LatLonElevation).hashCode = function () {
|
|
553
|
-
var result = getNumberHashCode(this.
|
|
554
|
-
result = imul(result, 31) + getNumberHashCode(this.
|
|
555
|
-
result = imul(result, 31) + getNumberHashCode(this.
|
|
553
|
+
var result = getNumberHashCode(this.latitude_1);
|
|
554
|
+
result = imul(result, 31) + getNumberHashCode(this.longitude_1) | 0;
|
|
555
|
+
result = imul(result, 31) + getNumberHashCode(this.elevation_1) | 0;
|
|
556
556
|
return result;
|
|
557
557
|
};
|
|
558
558
|
protoOf(LatLonElevation).equals = function (other) {
|
|
@@ -560,21 +560,21 @@
|
|
|
560
560
|
return true;
|
|
561
561
|
if (!(other instanceof LatLonElevation))
|
|
562
562
|
return false;
|
|
563
|
-
if (!equals(this.
|
|
563
|
+
if (!equals(this.latitude_1, other.latitude_1))
|
|
564
564
|
return false;
|
|
565
|
-
if (!equals(this.
|
|
565
|
+
if (!equals(this.longitude_1, other.longitude_1))
|
|
566
566
|
return false;
|
|
567
|
-
if (!equals(this.
|
|
567
|
+
if (!equals(this.elevation_1, other.elevation_1))
|
|
568
568
|
return false;
|
|
569
569
|
return true;
|
|
570
570
|
};
|
|
571
571
|
function Distance() {
|
|
572
572
|
}
|
|
573
|
-
protoOf(Distance).
|
|
574
|
-
var lat1Rad = coord1.
|
|
575
|
-
var lat2Rad = coord2.
|
|
576
|
-
var deltaLat = (coord2.
|
|
577
|
-
var deltaLon = (coord2.
|
|
573
|
+
protoOf(Distance).haversine_mrx4ab_k$ = function (coord1, coord2) {
|
|
574
|
+
var lat1Rad = coord1.get_latitude_feukvp_k$() * 0.017453292519943295;
|
|
575
|
+
var lat2Rad = coord2.get_latitude_feukvp_k$() * 0.017453292519943295;
|
|
576
|
+
var deltaLat = (coord2.get_latitude_feukvp_k$() - coord1.get_latitude_feukvp_k$()) * 0.017453292519943295;
|
|
577
|
+
var deltaLon = (coord2.get_longitude_asb1fq_k$() - coord1.get_longitude_asb1fq_k$()) * 0.017453292519943295;
|
|
578
578
|
// Inline function 'kotlin.math.sin' call
|
|
579
579
|
var x = deltaLat / 2.0;
|
|
580
580
|
var sinHalfLat = Math.sin(x);
|
|
@@ -595,19 +595,19 @@
|
|
|
595
595
|
var c = 2.0 * Math.atan2(tmp0, x_2);
|
|
596
596
|
return 6371000.0 * c;
|
|
597
597
|
};
|
|
598
|
-
protoOf(Distance).
|
|
599
|
-
if (points.
|
|
598
|
+
protoOf(Distance).cumulativeDistances_92iok5_k$ = function (points) {
|
|
599
|
+
if (points.isEmpty_y1axqb_k$()) {
|
|
600
600
|
// Inline function 'kotlin.doubleArrayOf' call
|
|
601
601
|
return new Float64Array([0.0]);
|
|
602
602
|
}
|
|
603
|
-
var out = new Float64Array(points.
|
|
603
|
+
var out = new Float64Array(points.get_size_woubt6_k$());
|
|
604
604
|
var inductionVariable = 1;
|
|
605
|
-
var last = points.
|
|
605
|
+
var last = points.get_size_woubt6_k$();
|
|
606
606
|
if (inductionVariable < last)
|
|
607
607
|
do {
|
|
608
608
|
var i = inductionVariable;
|
|
609
609
|
inductionVariable = inductionVariable + 1 | 0;
|
|
610
|
-
out[i] = out[i - 1 | 0] + this.
|
|
610
|
+
out[i] = out[i - 1 | 0] + this.haversine_mrx4ab_k$(points.get_c1px32_k$(i - 1 | 0), points.get_c1px32_k$(i));
|
|
611
611
|
}
|
|
612
612
|
while (inductionVariable < last);
|
|
613
613
|
return out;
|
|
@@ -617,8 +617,8 @@
|
|
|
617
617
|
return Distance_instance;
|
|
618
618
|
}
|
|
619
619
|
function simplifyRecursive($this, points, firstIndex, lastIndex, tolerance, out) {
|
|
620
|
-
var first = points.
|
|
621
|
-
var last = points.
|
|
620
|
+
var first = points.get_c1px32_k$(firstIndex);
|
|
621
|
+
var last = points.get_c1px32_k$(lastIndex);
|
|
622
622
|
var maxDistance = 0.0;
|
|
623
623
|
var maxIndex = -1;
|
|
624
624
|
var inductionVariable = firstIndex + 1 | 0;
|
|
@@ -626,7 +626,7 @@
|
|
|
626
626
|
do {
|
|
627
627
|
var i = inductionVariable;
|
|
628
628
|
inductionVariable = inductionVariable + 1 | 0;
|
|
629
|
-
var d = points.
|
|
629
|
+
var d = points.get_c1px32_k$(i).distanceToSegment_bfq4v7_k$(first, last);
|
|
630
630
|
if (d > maxDistance) {
|
|
631
631
|
maxDistance = d;
|
|
632
632
|
maxIndex = i;
|
|
@@ -637,7 +637,7 @@
|
|
|
637
637
|
if ((maxIndex - firstIndex | 0) > 1) {
|
|
638
638
|
simplifyRecursive($this, points, firstIndex, maxIndex, tolerance, out);
|
|
639
639
|
}
|
|
640
|
-
out.
|
|
640
|
+
out.add_utx5q5_k$(maxIndex);
|
|
641
641
|
if ((lastIndex - maxIndex | 0) > 1) {
|
|
642
642
|
simplifyRecursive($this, points, maxIndex, lastIndex, tolerance, out);
|
|
643
643
|
}
|
|
@@ -645,45 +645,45 @@
|
|
|
645
645
|
}
|
|
646
646
|
function DouglasPeucker() {
|
|
647
647
|
}
|
|
648
|
-
protoOf(DouglasPeucker).
|
|
649
|
-
if (points.
|
|
648
|
+
protoOf(DouglasPeucker).simplify_o1pnyo_k$ = function (points, tolerance, zExaggeration) {
|
|
649
|
+
if (points.get_size_woubt6_k$() <= 2)
|
|
650
650
|
return toList_0(points);
|
|
651
651
|
// Inline function 'kotlin.collections.map' call
|
|
652
652
|
// Inline function 'kotlin.collections.mapTo' call
|
|
653
653
|
var destination = ArrayList_init_$Create$_0(collectionSizeOrDefault(points, 10));
|
|
654
|
-
var _iterator__ex2g4s = points.
|
|
655
|
-
while (_iterator__ex2g4s.
|
|
656
|
-
var item = _iterator__ex2g4s.
|
|
657
|
-
var tmp$ret$2 = EcefConverter_instance.
|
|
658
|
-
destination.
|
|
654
|
+
var _iterator__ex2g4s = points.iterator_jk1svi_k$();
|
|
655
|
+
while (_iterator__ex2g4s.hasNext_bitz1p_k$()) {
|
|
656
|
+
var item = _iterator__ex2g4s.next_20eer_k$();
|
|
657
|
+
var tmp$ret$2 = EcefConverter_instance.toEcef_pue96q_k$(item, zExaggeration);
|
|
658
|
+
destination.add_utx5q5_k$(tmp$ret$2);
|
|
659
659
|
}
|
|
660
660
|
var ecef = destination;
|
|
661
661
|
// Inline function 'kotlin.collections.map' call
|
|
662
|
-
var this_0 = this.
|
|
662
|
+
var this_0 = this.simplifyIndices_1yk9dd_k$(ecef, tolerance);
|
|
663
663
|
// Inline function 'kotlin.collections.mapTo' call
|
|
664
664
|
var destination_0 = ArrayList_init_$Create$_0(collectionSizeOrDefault(this_0, 10));
|
|
665
|
-
var _iterator__ex2g4s_0 = this_0.
|
|
666
|
-
while (_iterator__ex2g4s_0.
|
|
667
|
-
var item_0 = _iterator__ex2g4s_0.
|
|
668
|
-
var tmp$ret$5 = points.
|
|
669
|
-
destination_0.
|
|
665
|
+
var _iterator__ex2g4s_0 = this_0.iterator_jk1svi_k$();
|
|
666
|
+
while (_iterator__ex2g4s_0.hasNext_bitz1p_k$()) {
|
|
667
|
+
var item_0 = _iterator__ex2g4s_0.next_20eer_k$();
|
|
668
|
+
var tmp$ret$5 = points.get_c1px32_k$(item_0);
|
|
669
|
+
destination_0.add_utx5q5_k$(tmp$ret$5);
|
|
670
670
|
}
|
|
671
671
|
return destination_0;
|
|
672
672
|
};
|
|
673
|
-
protoOf(DouglasPeucker).
|
|
674
|
-
if (points.
|
|
673
|
+
protoOf(DouglasPeucker).simplifyIndices_1yk9dd_k$ = function (points, tolerance) {
|
|
674
|
+
if (points.get_size_woubt6_k$() <= 2)
|
|
675
675
|
return toList_0(get_indices(points));
|
|
676
676
|
var lastIndex = get_lastIndex(points);
|
|
677
677
|
// Inline function 'kotlin.collections.buildList' call
|
|
678
678
|
// Inline function 'kotlin.collections.buildListInternal' call
|
|
679
|
-
var capacity = points.
|
|
679
|
+
var capacity = points.get_size_woubt6_k$();
|
|
680
680
|
checkBuilderCapacity(capacity);
|
|
681
681
|
// Inline function 'kotlin.apply' call
|
|
682
682
|
var this_0 = ArrayList_init_$Create$_0(capacity);
|
|
683
|
-
this_0.
|
|
683
|
+
this_0.add_utx5q5_k$(0);
|
|
684
684
|
simplifyRecursive(DouglasPeucker_instance, points, 0, lastIndex, tolerance, this_0);
|
|
685
|
-
this_0.
|
|
686
|
-
return this_0.
|
|
685
|
+
this_0.add_utx5q5_k$(lastIndex);
|
|
686
|
+
return this_0.build_nmwvly_k$();
|
|
687
687
|
};
|
|
688
688
|
var DouglasPeucker_instance;
|
|
689
689
|
function DouglasPeucker_getInstance() {
|
|
@@ -691,10 +691,10 @@
|
|
|
691
691
|
}
|
|
692
692
|
function EcefConverter() {
|
|
693
693
|
}
|
|
694
|
-
protoOf(EcefConverter).
|
|
695
|
-
var latRad = coordinates.
|
|
696
|
-
var lonRad = coordinates.
|
|
697
|
-
var tmp0_elvis_lhs = coordinates.
|
|
694
|
+
protoOf(EcefConverter).toEcef_pue96q_k$ = function (coordinates, zExaggeration) {
|
|
695
|
+
var latRad = coordinates.get_latitude_feukvp_k$() * 0.017453292519943295;
|
|
696
|
+
var lonRad = coordinates.get_longitude_asb1fq_k$() * 0.017453292519943295;
|
|
697
|
+
var tmp0_elvis_lhs = coordinates.get_elevation_8fwyb8_k$();
|
|
698
698
|
var elevationExaggerated = zExaggeration * (tmp0_elvis_lhs == null ? 0.0 : tmp0_elvis_lhs);
|
|
699
699
|
// Inline function 'kotlin.math.sin' call
|
|
700
700
|
var sinLat = Math.sin(latRad);
|
|
@@ -718,43 +718,43 @@
|
|
|
718
718
|
}
|
|
719
719
|
function getInterpolatedElevation($this, coords, zoomLevel, $completion) {
|
|
720
720
|
var tmp = new $getInterpolatedElevationCOROUTINE$($this, coords, zoomLevel, $completion);
|
|
721
|
-
tmp.
|
|
722
|
-
tmp.
|
|
723
|
-
return tmp.
|
|
721
|
+
tmp.result_1 = Unit_instance;
|
|
722
|
+
tmp.exception_1 = null;
|
|
723
|
+
return tmp.doResume_5yljmg_k$();
|
|
724
724
|
}
|
|
725
725
|
function elevationFromPixel($this, pixel, $completion) {
|
|
726
726
|
var tmp = new $elevationFromPixelCOROUTINE$($this, pixel, $completion);
|
|
727
|
-
tmp.
|
|
728
|
-
tmp.
|
|
729
|
-
return tmp.
|
|
727
|
+
tmp.result_1 = Unit_instance;
|
|
728
|
+
tmp.exception_1 = null;
|
|
729
|
+
return tmp.doResume_5yljmg_k$();
|
|
730
730
|
}
|
|
731
731
|
function $getElevationCOROUTINE$(_this__u8e3s4, coords, zoomLevel, interpolation, resultContinuation) {
|
|
732
732
|
CoroutineImpl.call(this, resultContinuation);
|
|
733
|
-
this.
|
|
734
|
-
this.
|
|
735
|
-
this.
|
|
736
|
-
this.
|
|
733
|
+
this._this__u8e3s4__1 = _this__u8e3s4;
|
|
734
|
+
this.coords_1 = coords;
|
|
735
|
+
this.zoomLevel_1 = zoomLevel;
|
|
736
|
+
this.interpolation_1 = interpolation;
|
|
737
737
|
}
|
|
738
|
-
protoOf($getElevationCOROUTINE$).
|
|
739
|
-
var suspendResult = this.
|
|
738
|
+
protoOf($getElevationCOROUTINE$).doResume_5yljmg_k$ = function () {
|
|
739
|
+
var suspendResult = this.result_1;
|
|
740
740
|
$sm: do
|
|
741
741
|
try {
|
|
742
|
-
var tmp = this.
|
|
742
|
+
var tmp = this.state_1;
|
|
743
743
|
switch (tmp) {
|
|
744
744
|
case 0:
|
|
745
|
-
this.
|
|
746
|
-
this.
|
|
747
|
-
if (this.
|
|
748
|
-
this.
|
|
749
|
-
suspendResult = getInterpolatedElevation(this.
|
|
745
|
+
this.exceptionState_1 = 5;
|
|
746
|
+
this.exceptionState_1 = 4;
|
|
747
|
+
if (this.interpolation_1) {
|
|
748
|
+
this.state_1 = 2;
|
|
749
|
+
suspendResult = getInterpolatedElevation(this._this__u8e3s4__1, this.coords_1, this.zoomLevel_1, this);
|
|
750
750
|
if (suspendResult === get_COROUTINE_SUSPENDED()) {
|
|
751
751
|
return suspendResult;
|
|
752
752
|
}
|
|
753
753
|
continue $sm;
|
|
754
754
|
} else {
|
|
755
|
-
var pixel = ElevationFunctions_instance.
|
|
756
|
-
this.
|
|
757
|
-
suspendResult = elevationFromPixel(this.
|
|
755
|
+
var pixel = ElevationFunctions_instance.toPixel_iyzwlj_k$(this.coords_1, this.zoomLevel_1, this._this__u8e3s4__1.tileSize_1);
|
|
756
|
+
this.state_1 = 1;
|
|
757
|
+
suspendResult = elevationFromPixel(this._this__u8e3s4__1, pixel, this);
|
|
758
758
|
if (suspendResult === get_COROUTINE_SUSPENDED()) {
|
|
759
759
|
return suspendResult;
|
|
760
760
|
}
|
|
@@ -762,100 +762,100 @@
|
|
|
762
762
|
}
|
|
763
763
|
|
|
764
764
|
case 1:
|
|
765
|
-
this.
|
|
766
|
-
this.
|
|
765
|
+
this.WHEN_RESULT1__1 = suspendResult;
|
|
766
|
+
this.state_1 = 3;
|
|
767
767
|
continue $sm;
|
|
768
768
|
case 2:
|
|
769
|
-
this.
|
|
770
|
-
this.
|
|
769
|
+
this.WHEN_RESULT1__1 = suspendResult;
|
|
770
|
+
this.state_1 = 3;
|
|
771
771
|
continue $sm;
|
|
772
772
|
case 3:
|
|
773
|
-
this.
|
|
774
|
-
this.
|
|
775
|
-
this.
|
|
773
|
+
this.TRY_RESULT0__1 = this.WHEN_RESULT1__1;
|
|
774
|
+
this.exceptionState_1 = 5;
|
|
775
|
+
this.state_1 = 6;
|
|
776
776
|
continue $sm;
|
|
777
777
|
case 4:
|
|
778
|
-
this.
|
|
779
|
-
var tmp_0 = this.
|
|
778
|
+
this.exceptionState_1 = 5;
|
|
779
|
+
var tmp_0 = this.exception_1;
|
|
780
780
|
if (tmp_0 instanceof Error) {
|
|
781
|
-
var t = this.
|
|
781
|
+
var t = this.exception_1;
|
|
782
782
|
var tmp_1 = this;
|
|
783
783
|
throw IllegalStateException_init_$Create$('Failed to get elevation: ' + t.message, t);
|
|
784
784
|
} else {
|
|
785
|
-
throw this.
|
|
785
|
+
throw this.exception_1;
|
|
786
786
|
}
|
|
787
787
|
|
|
788
788
|
case 5:
|
|
789
|
-
throw this.
|
|
789
|
+
throw this.exception_1;
|
|
790
790
|
case 6:
|
|
791
|
-
this.
|
|
792
|
-
return this.
|
|
791
|
+
this.exceptionState_1 = 5;
|
|
792
|
+
return this.TRY_RESULT0__1;
|
|
793
793
|
}
|
|
794
794
|
} catch ($p) {
|
|
795
795
|
var e = $p;
|
|
796
|
-
if (this.
|
|
796
|
+
if (this.exceptionState_1 === 5) {
|
|
797
797
|
throw e;
|
|
798
798
|
} else {
|
|
799
|
-
this.
|
|
800
|
-
this.
|
|
799
|
+
this.state_1 = this.exceptionState_1;
|
|
800
|
+
this.exception_1 = e;
|
|
801
801
|
}
|
|
802
802
|
}
|
|
803
803
|
while (true);
|
|
804
804
|
};
|
|
805
805
|
function $getInterpolatedElevationCOROUTINE$(_this__u8e3s4, coords, zoomLevel, resultContinuation) {
|
|
806
806
|
CoroutineImpl.call(this, resultContinuation);
|
|
807
|
-
this.
|
|
808
|
-
this.
|
|
809
|
-
this.
|
|
807
|
+
this._this__u8e3s4__1 = _this__u8e3s4;
|
|
808
|
+
this.coords_1 = coords;
|
|
809
|
+
this.zoomLevel_1 = zoomLevel;
|
|
810
810
|
}
|
|
811
|
-
protoOf($getInterpolatedElevationCOROUTINE$).
|
|
812
|
-
var suspendResult = this.
|
|
811
|
+
protoOf($getInterpolatedElevationCOROUTINE$).doResume_5yljmg_k$ = function () {
|
|
812
|
+
var suspendResult = this.result_1;
|
|
813
813
|
$sm: do
|
|
814
814
|
try {
|
|
815
|
-
var tmp = this.
|
|
815
|
+
var tmp = this.state_1;
|
|
816
816
|
switch (tmp) {
|
|
817
817
|
case 0:
|
|
818
|
-
this.
|
|
819
|
-
this.
|
|
818
|
+
this.exceptionState_1 = 5;
|
|
819
|
+
this.pf7__1 = ElevationFunctions_instance.toPixelFloat_ler4xt_k$(this.coords_1, this.zoomLevel_1, this._this__u8e3s4__1.tileSize_1);
|
|
820
820
|
var tmp_0 = this;
|
|
821
|
-
var x = this.
|
|
822
|
-
tmp_0.
|
|
821
|
+
var x = this.pf7__1.x_1;
|
|
822
|
+
tmp_0.x0i8__1 = numberToInt(Math.floor(x));
|
|
823
823
|
var tmp_1 = this;
|
|
824
|
-
var x_0 = this.
|
|
825
|
-
tmp_1.
|
|
826
|
-
this.
|
|
827
|
-
this.
|
|
828
|
-
this.
|
|
829
|
-
this.
|
|
830
|
-
this.
|
|
831
|
-
suspendResult = elevationFromPixel(this.
|
|
824
|
+
var x_0 = this.pf7__1.y_1;
|
|
825
|
+
tmp_1.y0i9__1 = numberToInt(Math.floor(x_0));
|
|
826
|
+
this.x1i6__1 = this.x0i8__1 + 1 | 0;
|
|
827
|
+
this.y1i5__1 = this.y0i9__1 + 1 | 0;
|
|
828
|
+
this.dx1__1 = this.pf7__1.x_1 - this.x0i8__1;
|
|
829
|
+
this.dy0__1 = this.pf7__1.y_1 - this.y0i9__1;
|
|
830
|
+
this.state_1 = 1;
|
|
831
|
+
suspendResult = elevationFromPixel(this._this__u8e3s4__1, ElevationFunctions_instance.normalizePixel_364azo_k$(new Pixel(this.pf7__1.tile_1, this.x0i8__1, this.y0i9__1), this._this__u8e3s4__1.tileSize_1), this);
|
|
832
832
|
if (suspendResult === get_COROUTINE_SUSPENDED()) {
|
|
833
833
|
return suspendResult;
|
|
834
834
|
}
|
|
835
835
|
|
|
836
836
|
continue $sm;
|
|
837
837
|
case 1:
|
|
838
|
-
this.
|
|
839
|
-
this.
|
|
840
|
-
suspendResult = elevationFromPixel(this.
|
|
838
|
+
this.p004__1 = suspendResult;
|
|
839
|
+
this.state_1 = 2;
|
|
840
|
+
suspendResult = elevationFromPixel(this._this__u8e3s4__1, ElevationFunctions_instance.normalizePixel_364azo_k$(new Pixel(this.pf7__1.tile_1, this.x1i6__1, this.y0i9__1), this._this__u8e3s4__1.tileSize_1), this);
|
|
841
841
|
if (suspendResult === get_COROUTINE_SUSPENDED()) {
|
|
842
842
|
return suspendResult;
|
|
843
843
|
}
|
|
844
844
|
|
|
845
845
|
continue $sm;
|
|
846
846
|
case 2:
|
|
847
|
-
this.
|
|
848
|
-
this.
|
|
849
|
-
suspendResult = elevationFromPixel(this.
|
|
847
|
+
this.p103__1 = suspendResult;
|
|
848
|
+
this.state_1 = 3;
|
|
849
|
+
suspendResult = elevationFromPixel(this._this__u8e3s4__1, ElevationFunctions_instance.normalizePixel_364azo_k$(new Pixel(this.pf7__1.tile_1, this.x0i8__1, this.y1i5__1), this._this__u8e3s4__1.tileSize_1), this);
|
|
850
850
|
if (suspendResult === get_COROUTINE_SUSPENDED()) {
|
|
851
851
|
return suspendResult;
|
|
852
852
|
}
|
|
853
853
|
|
|
854
854
|
continue $sm;
|
|
855
855
|
case 3:
|
|
856
|
-
this.
|
|
857
|
-
this.
|
|
858
|
-
suspendResult = elevationFromPixel(this.
|
|
856
|
+
this.p012__1 = suspendResult;
|
|
857
|
+
this.state_1 = 4;
|
|
858
|
+
suspendResult = elevationFromPixel(this._this__u8e3s4__1, ElevationFunctions_instance.normalizePixel_364azo_k$(new Pixel(this.pf7__1.tile_1, this.x1i6__1, this.y1i5__1), this._this__u8e3s4__1.tileSize_1), this);
|
|
859
859
|
if (suspendResult === get_COROUTINE_SUSPENDED()) {
|
|
860
860
|
return suspendResult;
|
|
861
861
|
}
|
|
@@ -863,69 +863,69 @@
|
|
|
863
863
|
continue $sm;
|
|
864
864
|
case 4:
|
|
865
865
|
var p11 = suspendResult;
|
|
866
|
-
var top = this.
|
|
867
|
-
var bottom = this.
|
|
868
|
-
return top * (1.0 - this.
|
|
866
|
+
var top = this.p004__1 * (1.0 - this.dx1__1) + this.p103__1 * this.dx1__1;
|
|
867
|
+
var bottom = this.p012__1 * (1.0 - this.dx1__1) + p11 * this.dx1__1;
|
|
868
|
+
return top * (1.0 - this.dy0__1) + bottom * this.dy0__1;
|
|
869
869
|
case 5:
|
|
870
|
-
throw this.
|
|
870
|
+
throw this.exception_1;
|
|
871
871
|
}
|
|
872
872
|
} catch ($p) {
|
|
873
873
|
var e = $p;
|
|
874
|
-
if (this.
|
|
874
|
+
if (this.exceptionState_1 === 5) {
|
|
875
875
|
throw e;
|
|
876
876
|
} else {
|
|
877
|
-
this.
|
|
878
|
-
this.
|
|
877
|
+
this.state_1 = this.exceptionState_1;
|
|
878
|
+
this.exception_1 = e;
|
|
879
879
|
}
|
|
880
880
|
}
|
|
881
881
|
while (true);
|
|
882
882
|
};
|
|
883
883
|
function $elevationFromPixelCOROUTINE$(_this__u8e3s4, pixel, resultContinuation) {
|
|
884
884
|
CoroutineImpl.call(this, resultContinuation);
|
|
885
|
-
this.
|
|
886
|
-
this.
|
|
885
|
+
this._this__u8e3s4__1 = _this__u8e3s4;
|
|
886
|
+
this.pixel_1 = pixel;
|
|
887
887
|
}
|
|
888
|
-
protoOf($elevationFromPixelCOROUTINE$).
|
|
889
|
-
var suspendResult = this.
|
|
888
|
+
protoOf($elevationFromPixelCOROUTINE$).doResume_5yljmg_k$ = function () {
|
|
889
|
+
var suspendResult = this.result_1;
|
|
890
890
|
$sm: do
|
|
891
891
|
try {
|
|
892
|
-
var tmp = this.
|
|
892
|
+
var tmp = this.state_1;
|
|
893
893
|
switch (tmp) {
|
|
894
894
|
case 0:
|
|
895
|
-
this.
|
|
896
|
-
this.
|
|
897
|
-
suspendResult = this.
|
|
895
|
+
this.exceptionState_1 = 2;
|
|
896
|
+
this.state_1 = 1;
|
|
897
|
+
suspendResult = this._this__u8e3s4__1.tileManager_1.getTile_c22khk_k$(this.pixel_1.tile_1, this);
|
|
898
898
|
if (suspendResult === get_COROUTINE_SUSPENDED()) {
|
|
899
899
|
return suspendResult;
|
|
900
900
|
}
|
|
901
901
|
|
|
902
902
|
continue $sm;
|
|
903
903
|
case 1:
|
|
904
|
-
return suspendResult.
|
|
904
|
+
return suspendResult.getElevation_exacdm_k$(this.pixel_1);
|
|
905
905
|
case 2:
|
|
906
|
-
throw this.
|
|
906
|
+
throw this.exception_1;
|
|
907
907
|
}
|
|
908
908
|
} catch ($p) {
|
|
909
909
|
var e = $p;
|
|
910
|
-
if (this.
|
|
910
|
+
if (this.exceptionState_1 === 2) {
|
|
911
911
|
throw e;
|
|
912
912
|
} else {
|
|
913
|
-
this.
|
|
914
|
-
this.
|
|
913
|
+
this.state_1 = this.exceptionState_1;
|
|
914
|
+
this.exception_1 = e;
|
|
915
915
|
}
|
|
916
916
|
}
|
|
917
917
|
while (true);
|
|
918
918
|
};
|
|
919
919
|
function ElevationCalculator(tileManager, tileSize) {
|
|
920
920
|
tileSize = tileSize === VOID ? 256 : tileSize;
|
|
921
|
-
this.
|
|
922
|
-
this.
|
|
921
|
+
this.tileManager_1 = tileManager;
|
|
922
|
+
this.tileSize_1 = tileSize;
|
|
923
923
|
}
|
|
924
|
-
protoOf(ElevationCalculator).
|
|
924
|
+
protoOf(ElevationCalculator).getElevation_e117b3_k$ = function (coords, zoomLevel, interpolation, $completion) {
|
|
925
925
|
var tmp = new $getElevationCOROUTINE$(this, coords, zoomLevel, interpolation, $completion);
|
|
926
|
-
tmp.
|
|
927
|
-
tmp.
|
|
928
|
-
return tmp.
|
|
926
|
+
tmp.result_1 = Unit_instance;
|
|
927
|
+
tmp.exception_1 = null;
|
|
928
|
+
return tmp.doResume_5yljmg_k$();
|
|
929
929
|
};
|
|
930
930
|
function formatNumber_0($this, d) {
|
|
931
931
|
var asLong = numberToLong(d);
|
|
@@ -933,24 +933,24 @@
|
|
|
933
933
|
}
|
|
934
934
|
function ElevationFunctions() {
|
|
935
935
|
}
|
|
936
|
-
protoOf(ElevationFunctions).
|
|
936
|
+
protoOf(ElevationFunctions).degToRad_hya2pa_k$ = function (degrees) {
|
|
937
937
|
return degrees * 0.017453292519943295;
|
|
938
938
|
};
|
|
939
|
-
protoOf(ElevationFunctions).
|
|
939
|
+
protoOf(ElevationFunctions).isValidLatitude_gohohk_k$ = function (lat) {
|
|
940
940
|
return lat >= -85.0511 && lat <= 85.0511;
|
|
941
941
|
};
|
|
942
|
-
protoOf(ElevationFunctions).
|
|
942
|
+
protoOf(ElevationFunctions).isValidLongitude_hbos7_k$ = function (lon) {
|
|
943
943
|
return -180.0 <= lon ? lon <= 180.0 : false;
|
|
944
944
|
};
|
|
945
|
-
protoOf(ElevationFunctions).
|
|
945
|
+
protoOf(ElevationFunctions).isValidZoomLevel_bzars7_k$ = function (zoom) {
|
|
946
946
|
return 0 <= zoom ? zoom <= 15 : false;
|
|
947
947
|
};
|
|
948
|
-
protoOf(ElevationFunctions).
|
|
949
|
-
var x = pixel.
|
|
950
|
-
var y = pixel.
|
|
951
|
-
var tileX = pixel.
|
|
952
|
-
var tileY = pixel.
|
|
953
|
-
var z = pixel.
|
|
948
|
+
protoOf(ElevationFunctions).normalizePixel_364azo_k$ = function (pixel, tileSize) {
|
|
949
|
+
var x = pixel.x_1;
|
|
950
|
+
var y = pixel.y_1;
|
|
951
|
+
var tileX = pixel.tile_1.x_1;
|
|
952
|
+
var tileY = pixel.tile_1.y_1;
|
|
953
|
+
var z = pixel.tile_1.z_1;
|
|
954
954
|
if (x < 0) {
|
|
955
955
|
x = x + tileSize | 0;
|
|
956
956
|
tileX = tileX - 1 | 0;
|
|
@@ -972,25 +972,25 @@
|
|
|
972
972
|
tileY = coerceIn(tileY, 0, maxTile);
|
|
973
973
|
return new Pixel(new TileCoordinates(tileX, tileY, z), x, y);
|
|
974
974
|
};
|
|
975
|
-
protoOf(ElevationFunctions).
|
|
975
|
+
protoOf(ElevationFunctions).toTileCoordinatesFloat_fctdpc_k$ = function (coords, z) {
|
|
976
976
|
// Inline function 'kotlin.require' call
|
|
977
|
-
if (!this.
|
|
978
|
-
var message = 'Invalid latitude: ' + formatNumber_0(ElevationFunctions_instance, coords.
|
|
977
|
+
if (!this.isValidLatitude_gohohk_k$(coords.get_latitude_feukvp_k$())) {
|
|
978
|
+
var message = 'Invalid latitude: ' + formatNumber_0(ElevationFunctions_instance, coords.get_latitude_feukvp_k$()) + '. Must be between -85.0511 and 85.0511';
|
|
979
979
|
throw IllegalArgumentException_init_$Create$(toString(message));
|
|
980
980
|
}
|
|
981
981
|
// Inline function 'kotlin.require' call
|
|
982
|
-
if (!this.
|
|
983
|
-
var message_0 = 'Invalid longitude: ' + formatNumber_0(ElevationFunctions_instance, coords.
|
|
982
|
+
if (!this.isValidLongitude_hbos7_k$(coords.get_longitude_asb1fq_k$())) {
|
|
983
|
+
var message_0 = 'Invalid longitude: ' + formatNumber_0(ElevationFunctions_instance, coords.get_longitude_asb1fq_k$()) + '. Must be between -180 and 180';
|
|
984
984
|
throw IllegalArgumentException_init_$Create$(toString(message_0));
|
|
985
985
|
}
|
|
986
986
|
// Inline function 'kotlin.require' call
|
|
987
|
-
if (!this.
|
|
987
|
+
if (!this.isValidZoomLevel_bzars7_k$(z)) {
|
|
988
988
|
var message_1 = 'Invalid zoom level: ' + z + '. Must be between 0 and 15';
|
|
989
989
|
throw IllegalArgumentException_init_$Create$(toString(message_1));
|
|
990
990
|
}
|
|
991
|
-
var lat = this.
|
|
991
|
+
var lat = this.degToRad_hya2pa_k$(coords.get_latitude_feukvp_k$());
|
|
992
992
|
var n = 1 << z;
|
|
993
|
-
var xFloat = (coords.
|
|
993
|
+
var xFloat = (coords.get_longitude_asb1fq_k$() + 180.0) / 360.0 * n;
|
|
994
994
|
// Inline function 'kotlin.math.tan' call
|
|
995
995
|
var tmp = Math.tan(lat);
|
|
996
996
|
// Inline function 'kotlin.math.cos' call
|
|
@@ -1006,27 +1006,27 @@
|
|
|
1006
1006
|
var y = coerceIn(numberToInt(tmp$ret$10), 0, maxTile);
|
|
1007
1007
|
return new TileCoordinatesFloat(x_0, y, xFloat, yFloat, z);
|
|
1008
1008
|
};
|
|
1009
|
-
protoOf(ElevationFunctions).
|
|
1010
|
-
var tile = this.
|
|
1011
|
-
return new TileCoordinates(tile.
|
|
1009
|
+
protoOf(ElevationFunctions).toTileCoordinates_jamtrs_k$ = function (coords, z) {
|
|
1010
|
+
var tile = this.toTileCoordinatesFloat_fctdpc_k$(coords, z);
|
|
1011
|
+
return new TileCoordinates(tile.x_1, tile.y_1, tile.z_1);
|
|
1012
1012
|
};
|
|
1013
|
-
protoOf(ElevationFunctions).
|
|
1014
|
-
var tile = this.
|
|
1013
|
+
protoOf(ElevationFunctions).toPixel_iyzwlj_k$ = function (coords, z, tileSize) {
|
|
1014
|
+
var tile = this.toTileCoordinatesFloat_fctdpc_k$(coords, z);
|
|
1015
1015
|
// Inline function 'kotlin.math.floor' call
|
|
1016
|
-
var x = (tile.
|
|
1016
|
+
var x = (tile.xFloat_1 - tile.x_1) * tileSize;
|
|
1017
1017
|
var tmp$ret$0 = Math.floor(x);
|
|
1018
1018
|
var px = coerceIn(numberToInt(tmp$ret$0), 0, tileSize - 1 | 0);
|
|
1019
1019
|
// Inline function 'kotlin.math.floor' call
|
|
1020
|
-
var x_0 = (tile.
|
|
1020
|
+
var x_0 = (tile.yFloat_1 - tile.y_1) * tileSize;
|
|
1021
1021
|
var tmp$ret$1 = Math.floor(x_0);
|
|
1022
1022
|
var py = coerceIn(numberToInt(tmp$ret$1), 0, tileSize - 1 | 0);
|
|
1023
|
-
return new Pixel(new TileCoordinates(tile.
|
|
1023
|
+
return new Pixel(new TileCoordinates(tile.x_1, tile.y_1, z), px, py);
|
|
1024
1024
|
};
|
|
1025
|
-
protoOf(ElevationFunctions).
|
|
1026
|
-
var tile = this.
|
|
1027
|
-
var px = (tile.
|
|
1028
|
-
var py = (tile.
|
|
1029
|
-
return new PixelFloat(new TileCoordinates(tile.
|
|
1025
|
+
protoOf(ElevationFunctions).toPixelFloat_ler4xt_k$ = function (coords, z, tileSize) {
|
|
1026
|
+
var tile = this.toTileCoordinatesFloat_fctdpc_k$(coords, z);
|
|
1027
|
+
var px = (tile.xFloat_1 - tile.x_1) * tileSize;
|
|
1028
|
+
var py = (tile.yFloat_1 - tile.y_1) * tileSize;
|
|
1029
|
+
return new PixelFloat(new TileCoordinates(tile.x_1, tile.y_1, z), px, py);
|
|
1030
1030
|
};
|
|
1031
1031
|
var ElevationFunctions_instance;
|
|
1032
1032
|
function ElevationFunctions_getInstance() {
|
|
@@ -1035,11 +1035,11 @@
|
|
|
1035
1035
|
function fetchAndDecodeTile$ref() {
|
|
1036
1036
|
KFunctionImpl.call(this, 1, 2, 2);
|
|
1037
1037
|
}
|
|
1038
|
-
protoOf(fetchAndDecodeTile$ref).
|
|
1038
|
+
protoOf(fetchAndDecodeTile$ref).invoke_fa3hvc_k$ = function (p0, $completion) {
|
|
1039
1039
|
return fetchAndDecodeTile(p0, $completion);
|
|
1040
1040
|
};
|
|
1041
|
-
protoOf(fetchAndDecodeTile$ref).
|
|
1042
|
-
return this.
|
|
1041
|
+
protoOf(fetchAndDecodeTile$ref).invoke_qns8j1_k$ = function (p1, $completion) {
|
|
1042
|
+
return this.invoke_fa3hvc_k$((!(p1 == null) ? typeof p1 === 'string' : false) ? p1 : THROW_CCE(), $completion);
|
|
1043
1043
|
};
|
|
1044
1044
|
function ElevationProvider(config, fetcher) {
|
|
1045
1045
|
config = config === VOID ? new ElevationProviderConfig() : config;
|
|
@@ -1050,39 +1050,39 @@
|
|
|
1050
1050
|
tmp = fetcher;
|
|
1051
1051
|
}
|
|
1052
1052
|
fetcher = tmp;
|
|
1053
|
-
this.
|
|
1054
|
-
var containsArg = this.
|
|
1053
|
+
this.config_1 = config;
|
|
1054
|
+
var containsArg = this.config_1.zoomLevel_1;
|
|
1055
1055
|
// Inline function 'kotlin.require' call
|
|
1056
1056
|
if (!(0 <= containsArg ? containsArg <= 15 : false)) {
|
|
1057
|
-
var message = 'Invalid zoom level: ' + this.
|
|
1057
|
+
var message = 'Invalid zoom level: ' + this.config_1.zoomLevel_1 + '. Must be an integer between 0 and 15';
|
|
1058
1058
|
throw IllegalArgumentException_init_$Create$(toString(message));
|
|
1059
1059
|
}
|
|
1060
1060
|
// Inline function 'kotlin.require' call
|
|
1061
|
-
if (!(this.
|
|
1062
|
-
var message_0 = 'Invalid cache size: ' + this.
|
|
1061
|
+
if (!(this.config_1.cacheSize_1 > 0)) {
|
|
1062
|
+
var message_0 = 'Invalid cache size: ' + this.config_1.cacheSize_1 + '. Must be a positive integer';
|
|
1063
1063
|
throw IllegalArgumentException_init_$Create$(toString(message_0));
|
|
1064
1064
|
}
|
|
1065
1065
|
// Inline function 'kotlin.require' call
|
|
1066
|
-
if (!(this.
|
|
1067
|
-
var message_1 = 'Invalid tile size: ' + this.
|
|
1066
|
+
if (!(this.config_1.tileSize_1 > 0 && (this.config_1.tileSize_1 & (this.config_1.tileSize_1 - 1 | 0)) === 0)) {
|
|
1067
|
+
var message_1 = 'Invalid tile size: ' + this.config_1.tileSize_1 + '. Must be a positive power of 2';
|
|
1068
1068
|
throw IllegalArgumentException_init_$Create$(toString(message_1));
|
|
1069
1069
|
}
|
|
1070
|
-
this.
|
|
1071
|
-
this.
|
|
1072
|
-
this.
|
|
1070
|
+
this.tileManager_1 = new TileManager(this.config_1.tileUrlTemplate_1, this.config_1.cacheSize_1, fetcher);
|
|
1071
|
+
this.calculator_1 = new ElevationCalculator(this.tileManager_1, this.config_1.tileSize_1);
|
|
1072
|
+
this.batchCalculator_1 = new BatchCalculator(this.calculator_1);
|
|
1073
1073
|
}
|
|
1074
|
-
protoOf(ElevationProvider).
|
|
1075
|
-
return this.
|
|
1074
|
+
protoOf(ElevationProvider).getElevation_vb6cmz_k$ = function (latitude, longitude, interpolation, $completion) {
|
|
1075
|
+
return this.calculator_1.getElevation_e117b3_k$(new LatLon(latitude, longitude), this.config_1.zoomLevel_1, interpolation, $completion);
|
|
1076
1076
|
};
|
|
1077
|
-
protoOf(ElevationProvider).
|
|
1078
|
-
return this.
|
|
1077
|
+
protoOf(ElevationProvider).setElevations_opglu7_k$ = function (coordinates, interpolation, $completion) {
|
|
1078
|
+
return this.batchCalculator_1.setElevations$default_qzn313_k$(coordinates, this.config_1.zoomLevel_1, interpolation, VOID, $completion);
|
|
1079
1079
|
};
|
|
1080
|
-
protoOf(ElevationProvider).
|
|
1080
|
+
protoOf(ElevationProvider).setElevations$default_vdh3yj_k$ = function (coordinates, interpolation, $completion, $super) {
|
|
1081
1081
|
interpolation = interpolation === VOID ? true : interpolation;
|
|
1082
|
-
return $super === VOID ? this.
|
|
1082
|
+
return $super === VOID ? this.setElevations_opglu7_k$(coordinates, interpolation, $completion) : $super.setElevations_opglu7_k$.call(this, coordinates, interpolation, $completion);
|
|
1083
1083
|
};
|
|
1084
|
-
protoOf(ElevationProvider).
|
|
1085
|
-
return this.
|
|
1084
|
+
protoOf(ElevationProvider).getElevationsAlong_o6hmac_k$ = function (path, step, minDistance, interpolation, smoothingOptions, filterOptions, $completion) {
|
|
1085
|
+
return this.batchCalculator_1.getElevationsAlong_4qke12_k$(path, this.config_1.zoomLevel_1, step, minDistance, interpolation, smoothingOptions, filterOptions, $completion);
|
|
1086
1086
|
};
|
|
1087
1087
|
function ElevationProviderConfig(zoomLevel, cacheSize, tileUrlTemplate, tileSize, attribution) {
|
|
1088
1088
|
zoomLevel = zoomLevel === VOID ? 12 : zoomLevel;
|
|
@@ -1090,21 +1090,21 @@
|
|
|
1090
1090
|
tileUrlTemplate = tileUrlTemplate === VOID ? 'https://tiles.mapterhorn.com/{z}/{x}/{y}.webp' : tileUrlTemplate;
|
|
1091
1091
|
tileSize = tileSize === VOID ? 512 : tileSize;
|
|
1092
1092
|
attribution = attribution === VOID ? new Attribution('Mapterhorn elevation data. See mapterhorn.com/attribution/ for details.', 'https://mapterhorn.com/attribution/') : attribution;
|
|
1093
|
-
this.
|
|
1094
|
-
this.
|
|
1095
|
-
this.
|
|
1096
|
-
this.
|
|
1097
|
-
this.
|
|
1093
|
+
this.zoomLevel_1 = zoomLevel;
|
|
1094
|
+
this.cacheSize_1 = cacheSize;
|
|
1095
|
+
this.tileUrlTemplate_1 = tileUrlTemplate;
|
|
1096
|
+
this.tileSize_1 = tileSize;
|
|
1097
|
+
this.attribution_1 = attribution;
|
|
1098
1098
|
}
|
|
1099
1099
|
protoOf(ElevationProviderConfig).toString = function () {
|
|
1100
|
-
return 'ElevationProviderConfig(zoomLevel=' + this.
|
|
1100
|
+
return 'ElevationProviderConfig(zoomLevel=' + this.zoomLevel_1 + ', cacheSize=' + this.cacheSize_1 + ', tileUrlTemplate=' + this.tileUrlTemplate_1 + ', tileSize=' + this.tileSize_1 + ', attribution=' + this.attribution_1.toString() + ')';
|
|
1101
1101
|
};
|
|
1102
1102
|
protoOf(ElevationProviderConfig).hashCode = function () {
|
|
1103
|
-
var result = this.
|
|
1104
|
-
result = imul(result, 31) + this.
|
|
1105
|
-
result = imul(result, 31) + getStringHashCode(this.
|
|
1106
|
-
result = imul(result, 31) + this.
|
|
1107
|
-
result = imul(result, 31) + this.
|
|
1103
|
+
var result = this.zoomLevel_1;
|
|
1104
|
+
result = imul(result, 31) + this.cacheSize_1 | 0;
|
|
1105
|
+
result = imul(result, 31) + getStringHashCode(this.tileUrlTemplate_1) | 0;
|
|
1106
|
+
result = imul(result, 31) + this.tileSize_1 | 0;
|
|
1107
|
+
result = imul(result, 31) + this.attribution_1.hashCode() | 0;
|
|
1108
1108
|
return result;
|
|
1109
1109
|
};
|
|
1110
1110
|
protoOf(ElevationProviderConfig).equals = function (other) {
|
|
@@ -1112,29 +1112,29 @@
|
|
|
1112
1112
|
return true;
|
|
1113
1113
|
if (!(other instanceof ElevationProviderConfig))
|
|
1114
1114
|
return false;
|
|
1115
|
-
if (!(this.
|
|
1115
|
+
if (!(this.zoomLevel_1 === other.zoomLevel_1))
|
|
1116
1116
|
return false;
|
|
1117
|
-
if (!(this.
|
|
1117
|
+
if (!(this.cacheSize_1 === other.cacheSize_1))
|
|
1118
1118
|
return false;
|
|
1119
|
-
if (!(this.
|
|
1119
|
+
if (!(this.tileUrlTemplate_1 === other.tileUrlTemplate_1))
|
|
1120
1120
|
return false;
|
|
1121
|
-
if (!(this.
|
|
1121
|
+
if (!(this.tileSize_1 === other.tileSize_1))
|
|
1122
1122
|
return false;
|
|
1123
|
-
if (!this.
|
|
1123
|
+
if (!this.attribution_1.equals(other.attribution_1))
|
|
1124
1124
|
return false;
|
|
1125
1125
|
return true;
|
|
1126
1126
|
};
|
|
1127
1127
|
function Attribution(text, url) {
|
|
1128
1128
|
url = url === VOID ? null : url;
|
|
1129
|
-
this.
|
|
1130
|
-
this.
|
|
1129
|
+
this.text_1 = text;
|
|
1130
|
+
this.url_1 = url;
|
|
1131
1131
|
}
|
|
1132
1132
|
protoOf(Attribution).toString = function () {
|
|
1133
|
-
return 'Attribution(text=' + this.
|
|
1133
|
+
return 'Attribution(text=' + this.text_1 + ', url=' + this.url_1 + ')';
|
|
1134
1134
|
};
|
|
1135
1135
|
protoOf(Attribution).hashCode = function () {
|
|
1136
|
-
var result = getStringHashCode(this.
|
|
1137
|
-
result = imul(result, 31) + (this.
|
|
1136
|
+
var result = getStringHashCode(this.text_1);
|
|
1137
|
+
result = imul(result, 31) + (this.url_1 == null ? 0 : getStringHashCode(this.url_1)) | 0;
|
|
1138
1138
|
return result;
|
|
1139
1139
|
};
|
|
1140
1140
|
protoOf(Attribution).equals = function (other) {
|
|
@@ -1142,9 +1142,9 @@
|
|
|
1142
1142
|
return true;
|
|
1143
1143
|
if (!(other instanceof Attribution))
|
|
1144
1144
|
return false;
|
|
1145
|
-
if (!(this.
|
|
1145
|
+
if (!(this.text_1 === other.text_1))
|
|
1146
1146
|
return false;
|
|
1147
|
-
if (!(this.
|
|
1147
|
+
if (!(this.url_1 == other.url_1))
|
|
1148
1148
|
return false;
|
|
1149
1149
|
return true;
|
|
1150
1150
|
};
|
|
@@ -1155,7 +1155,7 @@
|
|
|
1155
1155
|
startIndex = startIndex - 1 | 0;
|
|
1156
1156
|
}
|
|
1157
1157
|
var endIndex = index;
|
|
1158
|
-
while (endIndex < (points.
|
|
1158
|
+
while (endIndex < (points.get_size_woubt6_k$() - 1 | 0) && distances[endIndex + 1 | 0] - current <= windowSize) {
|
|
1159
1159
|
endIndex = endIndex + 1 | 0;
|
|
1160
1160
|
}
|
|
1161
1161
|
var totalWeight = 0.0;
|
|
@@ -1171,10 +1171,10 @@
|
|
|
1171
1171
|
var d = Math.abs(this_0);
|
|
1172
1172
|
var weight = 1.0 - d / windowSize;
|
|
1173
1173
|
totalWeight = totalWeight + weight;
|
|
1174
|
-
weightedSum = weightedSum + points.
|
|
1174
|
+
weightedSum = weightedSum + points.get_c1px32_k$(j).get_elevation_8fwyb8_k$() * weight;
|
|
1175
1175
|
}
|
|
1176
1176
|
while (!(j === last));
|
|
1177
|
-
return totalWeight > 0.0 ? weightedSum / totalWeight : points.
|
|
1177
|
+
return totalWeight > 0.0 ? weightedSum / totalWeight : points.get_c1px32_k$(index).get_elevation_8fwyb8_k$();
|
|
1178
1178
|
}
|
|
1179
1179
|
function formatWindow($this, w) {
|
|
1180
1180
|
var asLong = numberToLong(w);
|
|
@@ -1182,18 +1182,18 @@
|
|
|
1182
1182
|
}
|
|
1183
1183
|
function ElevationSmoother() {
|
|
1184
1184
|
}
|
|
1185
|
-
protoOf(ElevationSmoother).
|
|
1186
|
-
if (points.
|
|
1185
|
+
protoOf(ElevationSmoother).smooth_j2mgq7_k$ = function (points, windowSize) {
|
|
1186
|
+
if (points.get_size_woubt6_k$() < 3)
|
|
1187
1187
|
return points;
|
|
1188
1188
|
// Inline function 'kotlin.require' call
|
|
1189
1189
|
if (!(windowSize > 0.0)) {
|
|
1190
1190
|
var message = 'Invalid window size: ' + formatWindow(ElevationSmoother_instance, windowSize) + '. Must be positive';
|
|
1191
1191
|
throw IllegalArgumentException_init_$Create$(toString(message));
|
|
1192
1192
|
}
|
|
1193
|
-
var distances = Distance_instance.
|
|
1193
|
+
var distances = Distance_instance.cumulativeDistances_92iok5_k$(points);
|
|
1194
1194
|
// Inline function 'kotlin.collections.List' call
|
|
1195
1195
|
// Inline function 'kotlin.collections.MutableList' call
|
|
1196
|
-
var size = points.
|
|
1196
|
+
var size = points.get_size_woubt6_k$();
|
|
1197
1197
|
var list = ArrayList_init_$Create$_0(size);
|
|
1198
1198
|
// Inline function 'kotlin.repeat' call
|
|
1199
1199
|
var inductionVariable = 0;
|
|
@@ -1202,8 +1202,8 @@
|
|
|
1202
1202
|
var index = inductionVariable;
|
|
1203
1203
|
inductionVariable = inductionVariable + 1 | 0;
|
|
1204
1204
|
var smoothed = computeSmoothedValue(ElevationSmoother_instance, index, points, distances, windowSize);
|
|
1205
|
-
var tmp$ret$6 = new LatLonElevation(points.
|
|
1206
|
-
list.
|
|
1205
|
+
var tmp$ret$6 = new LatLonElevation(points.get_c1px32_k$(index).get_latitude_feukvp_k$(), points.get_c1px32_k$(index).get_longitude_asb1fq_k$(), smoothed);
|
|
1206
|
+
list.add_utx5q5_k$(tmp$ret$6);
|
|
1207
1207
|
}
|
|
1208
1208
|
while (inductionVariable < size);
|
|
1209
1209
|
return list;
|
|
@@ -1213,120 +1213,120 @@
|
|
|
1213
1213
|
return ElevationSmoother_instance;
|
|
1214
1214
|
}
|
|
1215
1215
|
function Flux$forEachParallel$slambda$slambda($semaphore, $action, $item, resultContinuation) {
|
|
1216
|
-
this
|
|
1217
|
-
this
|
|
1218
|
-
this
|
|
1216
|
+
this.$semaphore_1 = $semaphore;
|
|
1217
|
+
this.$action_1 = $action;
|
|
1218
|
+
this.$item_1 = $item;
|
|
1219
1219
|
CoroutineImpl.call(this, resultContinuation);
|
|
1220
1220
|
}
|
|
1221
|
-
protoOf(Flux$forEachParallel$slambda$slambda).
|
|
1222
|
-
var tmp = this.
|
|
1223
|
-
tmp.
|
|
1224
|
-
tmp.
|
|
1225
|
-
return tmp.
|
|
1221
|
+
protoOf(Flux$forEachParallel$slambda$slambda).invoke_d9fzmj_k$ = function ($this$async, $completion) {
|
|
1222
|
+
var tmp = this.create_rcuf4x_k$($this$async, $completion);
|
|
1223
|
+
tmp.result_1 = Unit_instance;
|
|
1224
|
+
tmp.exception_1 = null;
|
|
1225
|
+
return tmp.doResume_5yljmg_k$();
|
|
1226
1226
|
};
|
|
1227
|
-
protoOf(Flux$forEachParallel$slambda$slambda).
|
|
1228
|
-
return this.
|
|
1227
|
+
protoOf(Flux$forEachParallel$slambda$slambda).invoke_qns8j1_k$ = function (p1, $completion) {
|
|
1228
|
+
return this.invoke_d9fzmj_k$((!(p1 == null) ? isInterface(p1, CoroutineScope) : false) ? p1 : THROW_CCE(), $completion);
|
|
1229
1229
|
};
|
|
1230
|
-
protoOf(Flux$forEachParallel$slambda$slambda).
|
|
1231
|
-
var suspendResult = this.
|
|
1230
|
+
protoOf(Flux$forEachParallel$slambda$slambda).doResume_5yljmg_k$ = function () {
|
|
1231
|
+
var suspendResult = this.result_1;
|
|
1232
1232
|
$sm: do
|
|
1233
1233
|
try {
|
|
1234
|
-
var tmp = this.
|
|
1234
|
+
var tmp = this.state_1;
|
|
1235
1235
|
switch (tmp) {
|
|
1236
1236
|
case 0:
|
|
1237
|
-
this.
|
|
1238
|
-
this.
|
|
1239
|
-
this.
|
|
1240
|
-
suspendResult = this.
|
|
1237
|
+
this.exceptionState_1 = 6;
|
|
1238
|
+
this.this0__1 = this.$semaphore_1;
|
|
1239
|
+
this.state_1 = 1;
|
|
1240
|
+
suspendResult = this.this0__1.acquire_kfvtdt_k$(this);
|
|
1241
1241
|
if (suspendResult === get_COROUTINE_SUSPENDED()) {
|
|
1242
1242
|
return suspendResult;
|
|
1243
1243
|
}
|
|
1244
1244
|
|
|
1245
1245
|
continue $sm;
|
|
1246
1246
|
case 1:
|
|
1247
|
-
this.
|
|
1248
|
-
this.
|
|
1247
|
+
this.tmp$ret$01__1 = Unit_instance;
|
|
1248
|
+
this.state_1 = 2;
|
|
1249
1249
|
continue $sm;
|
|
1250
1250
|
case 2:
|
|
1251
|
-
this.
|
|
1252
|
-
this.
|
|
1253
|
-
suspendResult = this
|
|
1251
|
+
this.exceptionState_1 = 5;
|
|
1252
|
+
this.state_1 = 3;
|
|
1253
|
+
suspendResult = this.$action_1(this.$item_1, this);
|
|
1254
1254
|
if (suspendResult === get_COROUTINE_SUSPENDED()) {
|
|
1255
1255
|
return suspendResult;
|
|
1256
1256
|
}
|
|
1257
1257
|
|
|
1258
1258
|
continue $sm;
|
|
1259
1259
|
case 3:
|
|
1260
|
-
this.
|
|
1261
|
-
this.
|
|
1262
|
-
this.
|
|
1260
|
+
this.tmp$ret$01__1 = Unit_instance;
|
|
1261
|
+
this.exceptionState_1 = 6;
|
|
1262
|
+
this.state_1 = 4;
|
|
1263
1263
|
continue $sm;
|
|
1264
1264
|
case 4:
|
|
1265
|
-
this.
|
|
1266
|
-
this.
|
|
1267
|
-
this.
|
|
1265
|
+
this.tmp$ret$01__1;
|
|
1266
|
+
this.exceptionState_1 = 6;
|
|
1267
|
+
this.this0__1.release_wu5yyf_k$();
|
|
1268
1268
|
return Unit_instance;
|
|
1269
1269
|
case 5:
|
|
1270
|
-
this.
|
|
1271
|
-
var t = this.
|
|
1272
|
-
this.
|
|
1270
|
+
this.exceptionState_1 = 6;
|
|
1271
|
+
var t = this.exception_1;
|
|
1272
|
+
this.this0__1.release_wu5yyf_k$();
|
|
1273
1273
|
throw t;
|
|
1274
1274
|
case 6:
|
|
1275
|
-
throw this.
|
|
1275
|
+
throw this.exception_1;
|
|
1276
1276
|
}
|
|
1277
1277
|
} catch ($p) {
|
|
1278
1278
|
var e = $p;
|
|
1279
|
-
if (this.
|
|
1279
|
+
if (this.exceptionState_1 === 6) {
|
|
1280
1280
|
throw e;
|
|
1281
1281
|
} else {
|
|
1282
|
-
this.
|
|
1283
|
-
this.
|
|
1282
|
+
this.state_1 = this.exceptionState_1;
|
|
1283
|
+
this.exception_1 = e;
|
|
1284
1284
|
}
|
|
1285
1285
|
}
|
|
1286
1286
|
while (true);
|
|
1287
1287
|
};
|
|
1288
|
-
protoOf(Flux$forEachParallel$slambda$slambda).
|
|
1289
|
-
var i = new Flux$forEachParallel$slambda$slambda(this
|
|
1290
|
-
i
|
|
1288
|
+
protoOf(Flux$forEachParallel$slambda$slambda).create_rcuf4x_k$ = function ($this$async, completion) {
|
|
1289
|
+
var i = new Flux$forEachParallel$slambda$slambda(this.$semaphore_1, this.$action_1, this.$item_1, completion);
|
|
1290
|
+
i.$this$async_1 = $this$async;
|
|
1291
1291
|
return i;
|
|
1292
1292
|
};
|
|
1293
1293
|
function Flux$forEachParallel$slambda$slambda_0($semaphore, $action, $item, resultContinuation) {
|
|
1294
1294
|
var i = new Flux$forEachParallel$slambda$slambda($semaphore, $action, $item, resultContinuation);
|
|
1295
1295
|
return constructCallableReference(function ($this$async, $completion) {
|
|
1296
|
-
return i.
|
|
1296
|
+
return i.invoke_d9fzmj_k$($this$async, $completion);
|
|
1297
1297
|
}, 1);
|
|
1298
1298
|
}
|
|
1299
1299
|
function Flux$forEachParallel$slambda($maxParallel, $items, $action, resultContinuation) {
|
|
1300
|
-
this
|
|
1301
|
-
this
|
|
1302
|
-
this
|
|
1300
|
+
this.$maxParallel_1 = $maxParallel;
|
|
1301
|
+
this.$items_1 = $items;
|
|
1302
|
+
this.$action_1 = $action;
|
|
1303
1303
|
CoroutineImpl.call(this, resultContinuation);
|
|
1304
1304
|
}
|
|
1305
|
-
protoOf(Flux$forEachParallel$slambda).
|
|
1306
|
-
var tmp = this.
|
|
1307
|
-
tmp.
|
|
1308
|
-
tmp.
|
|
1309
|
-
return tmp.
|
|
1305
|
+
protoOf(Flux$forEachParallel$slambda).invoke_pvnt3t_k$ = function ($this$coroutineScope, $completion) {
|
|
1306
|
+
var tmp = this.create_rcuf4x_k$($this$coroutineScope, $completion);
|
|
1307
|
+
tmp.result_1 = Unit_instance;
|
|
1308
|
+
tmp.exception_1 = null;
|
|
1309
|
+
return tmp.doResume_5yljmg_k$();
|
|
1310
1310
|
};
|
|
1311
|
-
protoOf(Flux$forEachParallel$slambda).
|
|
1312
|
-
return this.
|
|
1311
|
+
protoOf(Flux$forEachParallel$slambda).invoke_qns8j1_k$ = function (p1, $completion) {
|
|
1312
|
+
return this.invoke_pvnt3t_k$((!(p1 == null) ? isInterface(p1, CoroutineScope) : false) ? p1 : THROW_CCE(), $completion);
|
|
1313
1313
|
};
|
|
1314
|
-
protoOf(Flux$forEachParallel$slambda).
|
|
1315
|
-
var suspendResult = this.
|
|
1314
|
+
protoOf(Flux$forEachParallel$slambda).doResume_5yljmg_k$ = function () {
|
|
1315
|
+
var suspendResult = this.result_1;
|
|
1316
1316
|
$sm: do
|
|
1317
1317
|
try {
|
|
1318
|
-
var tmp = this.
|
|
1318
|
+
var tmp = this.state_1;
|
|
1319
1319
|
switch (tmp) {
|
|
1320
1320
|
case 0:
|
|
1321
|
-
this.
|
|
1322
|
-
var semaphore = Semaphore(this
|
|
1323
|
-
this.
|
|
1324
|
-
var this_0 = this
|
|
1321
|
+
this.exceptionState_1 = 2;
|
|
1322
|
+
var semaphore = Semaphore(this.$maxParallel_1);
|
|
1323
|
+
this.state_1 = 1;
|
|
1324
|
+
var this_0 = this.$items_1;
|
|
1325
1325
|
var destination = ArrayList_init_$Create$_0(collectionSizeOrDefault(this_0, 10));
|
|
1326
|
-
var _iterator__ex2g4s = this_0.
|
|
1327
|
-
while (_iterator__ex2g4s.
|
|
1328
|
-
var item = _iterator__ex2g4s.
|
|
1329
|
-
destination.
|
|
1326
|
+
var _iterator__ex2g4s = this_0.iterator_jk1svi_k$();
|
|
1327
|
+
while (_iterator__ex2g4s.hasNext_bitz1p_k$()) {
|
|
1328
|
+
var item = _iterator__ex2g4s.next_20eer_k$();
|
|
1329
|
+
destination.add_utx5q5_k$(async(this.$this$coroutineScope_1, VOID, VOID, Flux$forEachParallel$slambda$slambda_0(semaphore, this.$action_1, item, null)));
|
|
1330
1330
|
}
|
|
1331
1331
|
|
|
1332
1332
|
suspendResult = awaitAll(destination, this);
|
|
@@ -1338,52 +1338,52 @@
|
|
|
1338
1338
|
case 1:
|
|
1339
1339
|
return suspendResult;
|
|
1340
1340
|
case 2:
|
|
1341
|
-
throw this.
|
|
1341
|
+
throw this.exception_1;
|
|
1342
1342
|
}
|
|
1343
1343
|
} catch ($p) {
|
|
1344
1344
|
var e = $p;
|
|
1345
|
-
if (this.
|
|
1345
|
+
if (this.exceptionState_1 === 2) {
|
|
1346
1346
|
throw e;
|
|
1347
1347
|
} else {
|
|
1348
|
-
this.
|
|
1349
|
-
this.
|
|
1348
|
+
this.state_1 = this.exceptionState_1;
|
|
1349
|
+
this.exception_1 = e;
|
|
1350
1350
|
}
|
|
1351
1351
|
}
|
|
1352
1352
|
while (true);
|
|
1353
1353
|
};
|
|
1354
|
-
protoOf(Flux$forEachParallel$slambda).
|
|
1355
|
-
var i = new Flux$forEachParallel$slambda(this
|
|
1356
|
-
i
|
|
1354
|
+
protoOf(Flux$forEachParallel$slambda).create_rcuf4x_k$ = function ($this$coroutineScope, completion) {
|
|
1355
|
+
var i = new Flux$forEachParallel$slambda(this.$maxParallel_1, this.$items_1, this.$action_1, completion);
|
|
1356
|
+
i.$this$coroutineScope_1 = $this$coroutineScope;
|
|
1357
1357
|
return i;
|
|
1358
1358
|
};
|
|
1359
1359
|
function Flux$forEachParallel$slambda_0($maxParallel, $items, $action, resultContinuation) {
|
|
1360
1360
|
var i = new Flux$forEachParallel$slambda($maxParallel, $items, $action, resultContinuation);
|
|
1361
1361
|
return constructCallableReference(function ($this$coroutineScope, $completion) {
|
|
1362
|
-
return i.
|
|
1362
|
+
return i.invoke_pvnt3t_k$($this$coroutineScope, $completion);
|
|
1363
1363
|
}, 1);
|
|
1364
1364
|
}
|
|
1365
1365
|
function $forEachParallelCOROUTINE$(_this__u8e3s4, items, maxParallel, action, resultContinuation) {
|
|
1366
1366
|
CoroutineImpl.call(this, resultContinuation);
|
|
1367
|
-
this.
|
|
1368
|
-
this.
|
|
1369
|
-
this.
|
|
1370
|
-
this.
|
|
1367
|
+
this._this__u8e3s4__1 = _this__u8e3s4;
|
|
1368
|
+
this.items_1 = items;
|
|
1369
|
+
this.maxParallel_1 = maxParallel;
|
|
1370
|
+
this.action_1 = action;
|
|
1371
1371
|
}
|
|
1372
|
-
protoOf($forEachParallelCOROUTINE$).
|
|
1373
|
-
var suspendResult = this.
|
|
1372
|
+
protoOf($forEachParallelCOROUTINE$).doResume_5yljmg_k$ = function () {
|
|
1373
|
+
var suspendResult = this.result_1;
|
|
1374
1374
|
$sm: do
|
|
1375
1375
|
try {
|
|
1376
|
-
var tmp = this.
|
|
1376
|
+
var tmp = this.state_1;
|
|
1377
1377
|
switch (tmp) {
|
|
1378
1378
|
case 0:
|
|
1379
|
-
this.
|
|
1380
|
-
if (!(this.
|
|
1381
|
-
var message = 'maxParallel must be >= 1, got ' + this.
|
|
1379
|
+
this.exceptionState_1 = 2;
|
|
1380
|
+
if (!(this.maxParallel_1 >= 1)) {
|
|
1381
|
+
var message = 'maxParallel must be >= 1, got ' + this.maxParallel_1;
|
|
1382
1382
|
throw IllegalArgumentException_init_$Create$(toString(message));
|
|
1383
1383
|
}
|
|
1384
1384
|
|
|
1385
|
-
this.
|
|
1386
|
-
suspendResult = coroutineScope(Flux$forEachParallel$slambda_0(this.
|
|
1385
|
+
this.state_1 = 1;
|
|
1386
|
+
suspendResult = coroutineScope(Flux$forEachParallel$slambda_0(this.maxParallel_1, this.items_1, this.action_1, null), this);
|
|
1387
1387
|
if (suspendResult === get_COROUTINE_SUSPENDED()) {
|
|
1388
1388
|
return suspendResult;
|
|
1389
1389
|
}
|
|
@@ -1392,26 +1392,26 @@
|
|
|
1392
1392
|
case 1:
|
|
1393
1393
|
return Unit_instance;
|
|
1394
1394
|
case 2:
|
|
1395
|
-
throw this.
|
|
1395
|
+
throw this.exception_1;
|
|
1396
1396
|
}
|
|
1397
1397
|
} catch ($p) {
|
|
1398
1398
|
var e = $p;
|
|
1399
|
-
if (this.
|
|
1399
|
+
if (this.exceptionState_1 === 2) {
|
|
1400
1400
|
throw e;
|
|
1401
1401
|
} else {
|
|
1402
|
-
this.
|
|
1403
|
-
this.
|
|
1402
|
+
this.state_1 = this.exceptionState_1;
|
|
1403
|
+
this.exception_1 = e;
|
|
1404
1404
|
}
|
|
1405
1405
|
}
|
|
1406
1406
|
while (true);
|
|
1407
1407
|
};
|
|
1408
1408
|
function Flux() {
|
|
1409
1409
|
}
|
|
1410
|
-
protoOf(Flux).
|
|
1410
|
+
protoOf(Flux).forEachParallel_gstfa7_k$ = function (items, maxParallel, action, $completion) {
|
|
1411
1411
|
var tmp = new $forEachParallelCOROUTINE$(this, items, maxParallel, action, $completion);
|
|
1412
|
-
tmp.
|
|
1413
|
-
tmp.
|
|
1414
|
-
return tmp.
|
|
1412
|
+
tmp.result_1 = Unit_instance;
|
|
1413
|
+
tmp.exception_1 = null;
|
|
1414
|
+
return tmp.doResume_5yljmg_k$();
|
|
1415
1415
|
};
|
|
1416
1416
|
var Flux_instance;
|
|
1417
1417
|
function Flux_getInstance() {
|
|
@@ -1419,21 +1419,21 @@
|
|
|
1419
1419
|
}
|
|
1420
1420
|
function $getCOROUTINE$(_this__u8e3s4, key, resultContinuation) {
|
|
1421
1421
|
CoroutineImpl.call(this, resultContinuation);
|
|
1422
|
-
this.
|
|
1423
|
-
this.
|
|
1422
|
+
this._this__u8e3s4__1 = _this__u8e3s4;
|
|
1423
|
+
this.key_1 = key;
|
|
1424
1424
|
}
|
|
1425
|
-
protoOf($getCOROUTINE$).
|
|
1426
|
-
var suspendResult = this.
|
|
1425
|
+
protoOf($getCOROUTINE$).doResume_5yljmg_k$ = function () {
|
|
1426
|
+
var suspendResult = this.result_1;
|
|
1427
1427
|
$sm: do
|
|
1428
1428
|
try {
|
|
1429
|
-
var tmp = this.
|
|
1429
|
+
var tmp = this.state_1;
|
|
1430
1430
|
switch (tmp) {
|
|
1431
1431
|
case 0:
|
|
1432
|
-
this.
|
|
1433
|
-
this.
|
|
1434
|
-
this.
|
|
1435
|
-
this.
|
|
1436
|
-
suspendResult = this.
|
|
1432
|
+
this.exceptionState_1 = 12;
|
|
1433
|
+
this.this11__1 = this._this__u8e3s4__1.mutex_1;
|
|
1434
|
+
this.owner10__1 = null;
|
|
1435
|
+
this.state_1 = 1;
|
|
1436
|
+
suspendResult = this.this11__1.lock_ugrcvf_k$(this.owner10__1, this);
|
|
1437
1437
|
if (suspendResult === get_COROUTINE_SUSPENDED()) {
|
|
1438
1438
|
return suspendResult;
|
|
1439
1439
|
}
|
|
@@ -1446,52 +1446,52 @@
|
|
|
1446
1446
|
l$ret$1: do {
|
|
1447
1447
|
var tmp_0;
|
|
1448
1448
|
try {
|
|
1449
|
-
var tmp0_safe_receiver = this.
|
|
1449
|
+
var tmp0_safe_receiver = this._this__u8e3s4__1.entries_1.remove_gppy8k_k$(this.key_1);
|
|
1450
1450
|
if (tmp0_safe_receiver == null)
|
|
1451
1451
|
null;
|
|
1452
1452
|
else {
|
|
1453
|
-
var tmp0 = this.
|
|
1454
|
-
var key = this.
|
|
1455
|
-
tmp0.
|
|
1453
|
+
var tmp0 = this._this__u8e3s4__1.entries_1;
|
|
1454
|
+
var key = this.key_1;
|
|
1455
|
+
tmp0.put_4fpzoq_k$(key, tmp0_safe_receiver);
|
|
1456
1456
|
tmp$ret$0 = tmp0_safe_receiver;
|
|
1457
1457
|
break l$ret$1;
|
|
1458
1458
|
}
|
|
1459
|
-
tmp$ret$2 = this.
|
|
1459
|
+
tmp$ret$2 = this._this__u8e3s4__1.inFlight_1.get_wei43m_k$(this.key_1);
|
|
1460
1460
|
break l$ret$3;
|
|
1461
1461
|
} catch ($p) {
|
|
1462
1462
|
var tmp_1;
|
|
1463
1463
|
var t = $p;
|
|
1464
|
-
this.
|
|
1464
|
+
this.this11__1.unlock_ulcrcl_k$(this.owner10__1);
|
|
1465
1465
|
throw t;
|
|
1466
1466
|
}
|
|
1467
1467
|
}
|
|
1468
1468
|
while (false);
|
|
1469
1469
|
var tmp_2 = tmp$ret$0;
|
|
1470
|
-
this.
|
|
1470
|
+
this.this11__1.unlock_ulcrcl_k$(this.owner10__1);
|
|
1471
1471
|
return tmp_2;
|
|
1472
1472
|
}
|
|
1473
1473
|
while (false);
|
|
1474
1474
|
var tmp_3 = tmp$ret$2;
|
|
1475
|
-
this.
|
|
1475
|
+
this.this11__1.unlock_ulcrcl_k$(this.owner10__1);
|
|
1476
1476
|
var existing = tmp_3;
|
|
1477
1477
|
if (!(existing == null)) {
|
|
1478
|
-
this.
|
|
1479
|
-
suspendResult = existing.
|
|
1478
|
+
this.state_1 = 11;
|
|
1479
|
+
suspendResult = existing.await_4rdzbx_k$(this);
|
|
1480
1480
|
if (suspendResult === get_COROUTINE_SUSPENDED()) {
|
|
1481
1481
|
return suspendResult;
|
|
1482
1482
|
}
|
|
1483
1483
|
continue $sm;
|
|
1484
1484
|
} else {
|
|
1485
|
-
this.
|
|
1485
|
+
this.state_1 = 2;
|
|
1486
1486
|
continue $sm;
|
|
1487
1487
|
}
|
|
1488
1488
|
|
|
1489
1489
|
case 2:
|
|
1490
|
-
this.
|
|
1491
|
-
this.
|
|
1492
|
-
this.
|
|
1493
|
-
this.
|
|
1494
|
-
suspendResult = this.
|
|
1490
|
+
this.ours1__1 = CompletableDeferred();
|
|
1491
|
+
this.this9__1 = this._this__u8e3s4__1.mutex_1;
|
|
1492
|
+
this.owner8__1 = null;
|
|
1493
|
+
this.state_1 = 3;
|
|
1494
|
+
suspendResult = this.this9__1.lock_ugrcvf_k$(this.owner8__1, this);
|
|
1495
1495
|
if (suspendResult === get_COROUTINE_SUSPENDED()) {
|
|
1496
1496
|
return suspendResult;
|
|
1497
1497
|
}
|
|
@@ -1504,25 +1504,25 @@
|
|
|
1504
1504
|
l$ret$5: do {
|
|
1505
1505
|
var tmp_4;
|
|
1506
1506
|
try {
|
|
1507
|
-
var tmp0_safe_receiver_0 = this.
|
|
1507
|
+
var tmp0_safe_receiver_0 = this._this__u8e3s4__1.entries_1.remove_gppy8k_k$(this.key_1);
|
|
1508
1508
|
if (tmp0_safe_receiver_0 == null)
|
|
1509
1509
|
null;
|
|
1510
1510
|
else {
|
|
1511
|
-
var tmp0_0 = this.
|
|
1512
|
-
var key_0 = this.
|
|
1513
|
-
tmp0_0.
|
|
1511
|
+
var tmp0_0 = this._this__u8e3s4__1.entries_1;
|
|
1512
|
+
var key_0 = this.key_1;
|
|
1513
|
+
tmp0_0.put_4fpzoq_k$(key_0, tmp0_safe_receiver_0);
|
|
1514
1514
|
tmp$ret$4 = tmp0_safe_receiver_0;
|
|
1515
1515
|
break l$ret$5;
|
|
1516
1516
|
}
|
|
1517
|
-
var raced = this.
|
|
1517
|
+
var raced = this._this__u8e3s4__1.inFlight_1.get_wei43m_k$(this.key_1);
|
|
1518
1518
|
var tmp_5;
|
|
1519
1519
|
if (!(raced == null)) {
|
|
1520
1520
|
tmp_5 = raced;
|
|
1521
1521
|
} else {
|
|
1522
|
-
var tmp0_1 = this.
|
|
1523
|
-
var tmp2 = this.
|
|
1524
|
-
var value = this.
|
|
1525
|
-
tmp0_1.
|
|
1522
|
+
var tmp0_1 = this._this__u8e3s4__1.inFlight_1;
|
|
1523
|
+
var tmp2 = this.key_1;
|
|
1524
|
+
var value = this.ours1__1;
|
|
1525
|
+
tmp0_1.put_4fpzoq_k$(tmp2, value);
|
|
1526
1526
|
tmp_5 = null;
|
|
1527
1527
|
}
|
|
1528
1528
|
tmp$ret$6 = tmp_5;
|
|
@@ -1530,87 +1530,87 @@
|
|
|
1530
1530
|
} catch ($p_0) {
|
|
1531
1531
|
var tmp_6;
|
|
1532
1532
|
var t_0 = $p_0;
|
|
1533
|
-
this.
|
|
1533
|
+
this.this9__1.unlock_ulcrcl_k$(this.owner8__1);
|
|
1534
1534
|
throw t_0;
|
|
1535
1535
|
}
|
|
1536
1536
|
}
|
|
1537
1537
|
while (false);
|
|
1538
1538
|
var tmp_7 = tmp$ret$4;
|
|
1539
|
-
this.
|
|
1539
|
+
this.this9__1.unlock_ulcrcl_k$(this.owner8__1);
|
|
1540
1540
|
return tmp_7;
|
|
1541
1541
|
}
|
|
1542
1542
|
while (false);
|
|
1543
1543
|
var tmp_8 = tmp$ret$6;
|
|
1544
|
-
this.
|
|
1544
|
+
this.this9__1.unlock_ulcrcl_k$(this.owner8__1);
|
|
1545
1545
|
var awaitInstead = tmp_8;
|
|
1546
1546
|
if (!(awaitInstead == null)) {
|
|
1547
|
-
this.
|
|
1548
|
-
suspendResult = awaitInstead.
|
|
1547
|
+
this.state_1 = 10;
|
|
1548
|
+
suspendResult = awaitInstead.await_4rdzbx_k$(this);
|
|
1549
1549
|
if (suspendResult === get_COROUTINE_SUSPENDED()) {
|
|
1550
1550
|
return suspendResult;
|
|
1551
1551
|
}
|
|
1552
1552
|
continue $sm;
|
|
1553
1553
|
} else {
|
|
1554
|
-
this.
|
|
1554
|
+
this.state_1 = 4;
|
|
1555
1555
|
continue $sm;
|
|
1556
1556
|
}
|
|
1557
1557
|
|
|
1558
1558
|
case 4:
|
|
1559
|
-
this.
|
|
1560
|
-
this.
|
|
1561
|
-
suspendResult = this.
|
|
1559
|
+
this.exceptionState_1 = 6;
|
|
1560
|
+
this.state_1 = 5;
|
|
1561
|
+
suspendResult = this._this__u8e3s4__1.loader_1(this.key_1, this);
|
|
1562
1562
|
if (suspendResult === get_COROUTINE_SUSPENDED()) {
|
|
1563
1563
|
return suspendResult;
|
|
1564
1564
|
}
|
|
1565
1565
|
|
|
1566
1566
|
continue $sm;
|
|
1567
1567
|
case 5:
|
|
1568
|
-
this.
|
|
1569
|
-
this.
|
|
1570
|
-
this.
|
|
1568
|
+
this.TRY_RESULT4__1 = suspendResult;
|
|
1569
|
+
this.exceptionState_1 = 12;
|
|
1570
|
+
this.state_1 = 8;
|
|
1571
1571
|
continue $sm;
|
|
1572
1572
|
case 6:
|
|
1573
|
-
this.
|
|
1574
|
-
var tmp_9 = this.
|
|
1573
|
+
this.exceptionState_1 = 12;
|
|
1574
|
+
var tmp_9 = this.exception_1;
|
|
1575
1575
|
if (tmp_9 instanceof Error) {
|
|
1576
|
-
this.
|
|
1577
|
-
this.
|
|
1578
|
-
this.
|
|
1579
|
-
this.
|
|
1580
|
-
suspendResult = this.
|
|
1576
|
+
this.t5__1 = this.exception_1;
|
|
1577
|
+
this.this7__1 = this._this__u8e3s4__1.mutex_1;
|
|
1578
|
+
this.owner6__1 = null;
|
|
1579
|
+
this.state_1 = 7;
|
|
1580
|
+
suspendResult = this.this7__1.lock_ugrcvf_k$(this.owner6__1, this);
|
|
1581
1581
|
if (suspendResult === get_COROUTINE_SUSPENDED()) {
|
|
1582
1582
|
return suspendResult;
|
|
1583
1583
|
}
|
|
1584
1584
|
continue $sm;
|
|
1585
1585
|
} else {
|
|
1586
|
-
throw this.
|
|
1586
|
+
throw this.exception_1;
|
|
1587
1587
|
}
|
|
1588
1588
|
|
|
1589
1589
|
case 7:
|
|
1590
1590
|
l$ret$9: do {
|
|
1591
1591
|
var tmp_10;
|
|
1592
1592
|
try {
|
|
1593
|
-
this.
|
|
1593
|
+
this._this__u8e3s4__1.inFlight_1.remove_gppy8k_k$(this.key_1);
|
|
1594
1594
|
break l$ret$9;
|
|
1595
1595
|
} catch ($p_1) {
|
|
1596
1596
|
var tmp_11;
|
|
1597
1597
|
var t_1 = $p_1;
|
|
1598
|
-
this.
|
|
1598
|
+
this.this7__1.unlock_ulcrcl_k$(this.owner6__1);
|
|
1599
1599
|
throw t_1;
|
|
1600
1600
|
}
|
|
1601
1601
|
}
|
|
1602
1602
|
while (false);
|
|
1603
|
-
this.
|
|
1604
|
-
this.
|
|
1603
|
+
this.this7__1.unlock_ulcrcl_k$(this.owner6__1);
|
|
1604
|
+
this.ours1__1.completeExceptionally_xyzekf_k$(this.t5__1);
|
|
1605
1605
|
var tmp_12 = this;
|
|
1606
|
-
throw this.
|
|
1606
|
+
throw this.t5__1;
|
|
1607
1607
|
case 8:
|
|
1608
|
-
this.
|
|
1609
|
-
this.
|
|
1610
|
-
this.
|
|
1611
|
-
this.
|
|
1612
|
-
this.
|
|
1613
|
-
suspendResult = this.
|
|
1608
|
+
this.exceptionState_1 = 12;
|
|
1609
|
+
this.value0__1 = this.TRY_RESULT4__1;
|
|
1610
|
+
this.this3__1 = this._this__u8e3s4__1.mutex_1;
|
|
1611
|
+
this.owner2__1 = null;
|
|
1612
|
+
this.state_1 = 9;
|
|
1613
|
+
suspendResult = this.this3__1.lock_ugrcvf_k$(this.owner2__1, this);
|
|
1614
1614
|
if (suspendResult === get_COROUTINE_SUSPENDED()) {
|
|
1615
1615
|
return suspendResult;
|
|
1616
1616
|
}
|
|
@@ -1620,89 +1620,89 @@
|
|
|
1620
1620
|
l$ret$11: do {
|
|
1621
1621
|
var tmp_13;
|
|
1622
1622
|
try {
|
|
1623
|
-
this.
|
|
1623
|
+
this._this__u8e3s4__1.inFlight_1.remove_gppy8k_k$(this.key_1);
|
|
1624
1624
|
var tmp_14;
|
|
1625
|
-
if (this.
|
|
1626
|
-
var tmp0_2 = this.
|
|
1627
|
-
var key_1 = this.
|
|
1628
|
-
tmp_14 = !(isInterface(tmp0_2, KtMap) ? tmp0_2 : THROW_CCE()).
|
|
1625
|
+
if (this._this__u8e3s4__1.entries_1.get_size_woubt6_k$() >= this._this__u8e3s4__1.maxSize_1) {
|
|
1626
|
+
var tmp0_2 = this._this__u8e3s4__1.entries_1;
|
|
1627
|
+
var key_1 = this.key_1;
|
|
1628
|
+
tmp_14 = !(isInterface(tmp0_2, KtMap) ? tmp0_2 : THROW_CCE()).containsKey_aw81wo_k$(key_1);
|
|
1629
1629
|
} else {
|
|
1630
1630
|
tmp_14 = false;
|
|
1631
1631
|
}
|
|
1632
1632
|
if (tmp_14) {
|
|
1633
|
-
var iter = this.
|
|
1634
|
-
var oldest = iter.
|
|
1635
|
-
var oldestValue = oldest.
|
|
1636
|
-
iter.
|
|
1637
|
-
var tmp0_safe_receiver_1 = this.
|
|
1633
|
+
var iter = this._this__u8e3s4__1.entries_1.get_entries_p20ztl_k$().iterator_jk1svi_k$();
|
|
1634
|
+
var oldest = iter.next_20eer_k$();
|
|
1635
|
+
var oldestValue = oldest.get_value_j01efc_k$();
|
|
1636
|
+
iter.remove_ldkf9o_k$();
|
|
1637
|
+
var tmp0_safe_receiver_1 = this._this__u8e3s4__1.onEvict_1;
|
|
1638
1638
|
if (tmp0_safe_receiver_1 == null)
|
|
1639
1639
|
null;
|
|
1640
1640
|
else
|
|
1641
1641
|
tmp0_safe_receiver_1(oldestValue);
|
|
1642
1642
|
}
|
|
1643
|
-
var tmp0_3 = this.
|
|
1644
|
-
var tmp2_0 = this.
|
|
1645
|
-
var value_0 = this.
|
|
1646
|
-
tmp0_3.
|
|
1643
|
+
var tmp0_3 = this._this__u8e3s4__1.entries_1;
|
|
1644
|
+
var tmp2_0 = this.key_1;
|
|
1645
|
+
var value_0 = this.value0__1;
|
|
1646
|
+
tmp0_3.put_4fpzoq_k$(tmp2_0, value_0);
|
|
1647
1647
|
break l$ret$11;
|
|
1648
1648
|
} catch ($p_2) {
|
|
1649
1649
|
var tmp_15;
|
|
1650
1650
|
var t_2 = $p_2;
|
|
1651
|
-
this.
|
|
1651
|
+
this.this3__1.unlock_ulcrcl_k$(this.owner2__1);
|
|
1652
1652
|
throw t_2;
|
|
1653
1653
|
}
|
|
1654
1654
|
}
|
|
1655
1655
|
while (false);
|
|
1656
|
-
this.
|
|
1657
|
-
this.
|
|
1658
|
-
return this.
|
|
1656
|
+
this.this3__1.unlock_ulcrcl_k$(this.owner2__1);
|
|
1657
|
+
this.ours1__1.complete_ixf84q_k$(this.value0__1);
|
|
1658
|
+
return this.value0__1;
|
|
1659
1659
|
case 10:
|
|
1660
1660
|
return suspendResult;
|
|
1661
1661
|
case 11:
|
|
1662
1662
|
return suspendResult;
|
|
1663
1663
|
case 12:
|
|
1664
|
-
throw this.
|
|
1664
|
+
throw this.exception_1;
|
|
1665
1665
|
}
|
|
1666
1666
|
} catch ($p_3) {
|
|
1667
1667
|
var e = $p_3;
|
|
1668
|
-
if (this.
|
|
1668
|
+
if (this.exceptionState_1 === 12) {
|
|
1669
1669
|
throw e;
|
|
1670
1670
|
} else {
|
|
1671
|
-
this.
|
|
1672
|
-
this.
|
|
1671
|
+
this.state_1 = this.exceptionState_1;
|
|
1672
|
+
this.exception_1 = e;
|
|
1673
1673
|
}
|
|
1674
1674
|
}
|
|
1675
1675
|
while (true);
|
|
1676
1676
|
};
|
|
1677
1677
|
function LruCache(maxSize, loader, onEvict) {
|
|
1678
1678
|
onEvict = onEvict === VOID ? null : onEvict;
|
|
1679
|
-
this.
|
|
1680
|
-
this.
|
|
1681
|
-
this.
|
|
1679
|
+
this.maxSize_1 = maxSize;
|
|
1680
|
+
this.loader_1 = loader;
|
|
1681
|
+
this.onEvict_1 = onEvict;
|
|
1682
1682
|
// Inline function 'kotlin.require' call
|
|
1683
|
-
if (!(this.
|
|
1683
|
+
if (!(this.maxSize_1 > 0)) {
|
|
1684
1684
|
var message = 'Cache size must be greater than 0';
|
|
1685
1685
|
throw IllegalArgumentException_init_$Create$(toString(message));
|
|
1686
1686
|
}
|
|
1687
|
-
this.
|
|
1688
|
-
this.
|
|
1687
|
+
this.mutex_1 = Mutex();
|
|
1688
|
+
this.entries_1 = LinkedHashMap_init_$Create$();
|
|
1689
1689
|
var tmp = this;
|
|
1690
1690
|
// Inline function 'kotlin.collections.mutableMapOf' call
|
|
1691
|
-
tmp.
|
|
1691
|
+
tmp.inFlight_1 = LinkedHashMap_init_$Create$();
|
|
1692
1692
|
}
|
|
1693
|
-
protoOf(LruCache).
|
|
1693
|
+
protoOf(LruCache).get_27lcp2_k$ = function (key, $completion) {
|
|
1694
1694
|
var tmp = new $getCOROUTINE$(this, key, $completion);
|
|
1695
|
-
tmp.
|
|
1696
|
-
tmp.
|
|
1697
|
-
return tmp.
|
|
1695
|
+
tmp.result_1 = Unit_instance;
|
|
1696
|
+
tmp.exception_1 = null;
|
|
1697
|
+
return tmp.doResume_5yljmg_k$();
|
|
1698
1698
|
};
|
|
1699
1699
|
function RawTile(width, height, rgba) {
|
|
1700
|
-
this.
|
|
1701
|
-
this.
|
|
1702
|
-
this.
|
|
1700
|
+
this.width_1 = width;
|
|
1701
|
+
this.height_1 = height;
|
|
1702
|
+
this.rgba_1 = rgba;
|
|
1703
1703
|
// Inline function 'kotlin.require' call
|
|
1704
|
-
if (!(this.
|
|
1705
|
-
var message = 'rgba size ' + this.
|
|
1704
|
+
if (!(this.rgba_1.length === imul(imul(this.width_1, this.height_1), 4))) {
|
|
1705
|
+
var message = 'rgba size ' + this.rgba_1.length + ' does not match width*height*4 (' + imul(imul(this.width_1, this.height_1), 4) + ')';
|
|
1706
1706
|
throw IllegalArgumentException_init_$Create$(toString(message));
|
|
1707
1707
|
}
|
|
1708
1708
|
}
|
|
@@ -1711,16 +1711,16 @@
|
|
|
1711
1711
|
return true;
|
|
1712
1712
|
if (!(other instanceof RawTile))
|
|
1713
1713
|
return false;
|
|
1714
|
-
return this.
|
|
1714
|
+
return this.width_1 === other.width_1 && this.height_1 === other.height_1 && contentEquals(this.rgba_1, other.rgba_1);
|
|
1715
1715
|
};
|
|
1716
1716
|
protoOf(RawTile).hashCode = function () {
|
|
1717
|
-
var result = this.
|
|
1718
|
-
result = imul(31, result) + this.
|
|
1719
|
-
result = imul(31, result) + contentHashCode(this.
|
|
1717
|
+
var result = this.width_1;
|
|
1718
|
+
result = imul(31, result) + this.height_1 | 0;
|
|
1719
|
+
result = imul(31, result) + contentHashCode(this.rgba_1) | 0;
|
|
1720
1720
|
return result;
|
|
1721
1721
|
};
|
|
1722
1722
|
function Tile_init_$Init$(raw, $this) {
|
|
1723
|
-
Tile.call($this, raw.
|
|
1723
|
+
Tile.call($this, raw.width_1, raw.height_1, raw.rgba_1);
|
|
1724
1724
|
return $this;
|
|
1725
1725
|
}
|
|
1726
1726
|
function Tile_init_$Create$(raw) {
|
|
@@ -1728,7 +1728,7 @@
|
|
|
1728
1728
|
}
|
|
1729
1729
|
function Companion() {
|
|
1730
1730
|
}
|
|
1731
|
-
protoOf(Companion).
|
|
1731
|
+
protoOf(Companion).decodeTerrariumElevation_vmx8i4_k$ = function (r, g, b) {
|
|
1732
1732
|
var raw = r * 256.0 + g + b / 256.0 - 32768.0;
|
|
1733
1733
|
return round(raw * 100.0) / 100.0;
|
|
1734
1734
|
};
|
|
@@ -1737,83 +1737,83 @@
|
|
|
1737
1737
|
return Companion_instance;
|
|
1738
1738
|
}
|
|
1739
1739
|
function Tile(width, height, rgba) {
|
|
1740
|
-
this.
|
|
1741
|
-
this.
|
|
1742
|
-
this.
|
|
1740
|
+
this.width_1 = width;
|
|
1741
|
+
this.height_1 = height;
|
|
1742
|
+
this.rgba_1 = rgba;
|
|
1743
1743
|
var tmp = this;
|
|
1744
1744
|
var tmp_0 = 0;
|
|
1745
|
-
var tmp_1 = imul(this.
|
|
1745
|
+
var tmp_1 = imul(this.width_1, this.height_1);
|
|
1746
1746
|
var tmp_2 = new Float64Array(tmp_1);
|
|
1747
1747
|
while (tmp_0 < tmp_1) {
|
|
1748
1748
|
tmp_2[tmp_0] = NaN;
|
|
1749
1749
|
tmp_0 = tmp_0 + 1 | 0;
|
|
1750
1750
|
}
|
|
1751
|
-
tmp.
|
|
1752
|
-
this.
|
|
1751
|
+
tmp.cache_1 = tmp_2;
|
|
1752
|
+
this.decodeCount_1 = 0;
|
|
1753
1753
|
}
|
|
1754
|
-
protoOf(Tile).
|
|
1755
|
-
var containsUpper = this.
|
|
1756
|
-
var containsArg = pixel.
|
|
1754
|
+
protoOf(Tile).getElevation_exacdm_k$ = function (pixel) {
|
|
1755
|
+
var containsUpper = this.width_1;
|
|
1756
|
+
var containsArg = pixel.x_1;
|
|
1757
1757
|
// Inline function 'kotlin.require' call
|
|
1758
1758
|
if (!(0 <= containsArg ? containsArg < containsUpper : false)) {
|
|
1759
|
-
var message = 'Invalid x position: ' + pixel.
|
|
1759
|
+
var message = 'Invalid x position: ' + pixel.x_1 + '. Must be between 0 and ' + (this.width_1 - 1 | 0);
|
|
1760
1760
|
throw IllegalArgumentException_init_$Create$(toString(message));
|
|
1761
1761
|
}
|
|
1762
|
-
var containsUpper_0 = this.
|
|
1763
|
-
var containsArg_0 = pixel.
|
|
1762
|
+
var containsUpper_0 = this.height_1;
|
|
1763
|
+
var containsArg_0 = pixel.y_1;
|
|
1764
1764
|
// Inline function 'kotlin.require' call
|
|
1765
1765
|
if (!(0 <= containsArg_0 ? containsArg_0 < containsUpper_0 : false)) {
|
|
1766
|
-
var message_0 = 'Invalid y position: ' + pixel.
|
|
1766
|
+
var message_0 = 'Invalid y position: ' + pixel.y_1 + '. Must be between 0 and ' + (this.height_1 - 1 | 0);
|
|
1767
1767
|
throw IllegalArgumentException_init_$Create$(toString(message_0));
|
|
1768
1768
|
}
|
|
1769
|
-
var idx = imul(pixel.
|
|
1770
|
-
var cached = this.
|
|
1769
|
+
var idx = imul(pixel.y_1, this.width_1) + pixel.x_1 | 0;
|
|
1770
|
+
var cached = this.cache_1[idx];
|
|
1771
1771
|
if (!isNaN_0(cached))
|
|
1772
1772
|
return cached;
|
|
1773
1773
|
var byteOffset = imul(idx, 4);
|
|
1774
|
-
var r = this.
|
|
1775
|
-
var g = this.
|
|
1776
|
-
var b = this.
|
|
1777
|
-
var elevation = Companion_instance.
|
|
1778
|
-
this.
|
|
1779
|
-
this.
|
|
1774
|
+
var r = this.rgba_1[byteOffset] & 255;
|
|
1775
|
+
var g = this.rgba_1[byteOffset + 1 | 0] & 255;
|
|
1776
|
+
var b = this.rgba_1[byteOffset + 2 | 0] & 255;
|
|
1777
|
+
var elevation = Companion_instance.decodeTerrariumElevation_vmx8i4_k$(r, g, b);
|
|
1778
|
+
this.cache_1[idx] = elevation;
|
|
1779
|
+
this.decodeCount_1 = this.decodeCount_1 + 1 | 0;
|
|
1780
1780
|
return elevation;
|
|
1781
1781
|
};
|
|
1782
1782
|
function buildUrl($this, tc) {
|
|
1783
|
-
return replace(replace(replace($this.
|
|
1783
|
+
return replace(replace(replace($this.urlTemplate_1, '{z}', tc.z_1.toString()), '{x}', tc.x_1.toString()), '{y}', tc.y_1.toString());
|
|
1784
1784
|
}
|
|
1785
1785
|
function fetchAndDecodeTile$ref_0() {
|
|
1786
1786
|
KFunctionImpl.call(this, 1, 2, 2);
|
|
1787
1787
|
}
|
|
1788
|
-
protoOf(fetchAndDecodeTile$ref_0).
|
|
1788
|
+
protoOf(fetchAndDecodeTile$ref_0).invoke_fa3hvc_k$ = function (p0, $completion) {
|
|
1789
1789
|
return fetchAndDecodeTile(p0, $completion);
|
|
1790
1790
|
};
|
|
1791
|
-
protoOf(fetchAndDecodeTile$ref_0).
|
|
1792
|
-
return this.
|
|
1791
|
+
protoOf(fetchAndDecodeTile$ref_0).invoke_qns8j1_k$ = function (p1, $completion) {
|
|
1792
|
+
return this.invoke_fa3hvc_k$((!(p1 == null) ? typeof p1 === 'string' : false) ? p1 : THROW_CCE(), $completion);
|
|
1793
1793
|
};
|
|
1794
1794
|
function TileManager$cache$slambda(this$0, resultContinuation) {
|
|
1795
|
-
this.
|
|
1795
|
+
this.this$0__1 = this$0;
|
|
1796
1796
|
CoroutineImpl.call(this, resultContinuation);
|
|
1797
1797
|
}
|
|
1798
|
-
protoOf(TileManager$cache$slambda).
|
|
1799
|
-
var tmp = this.
|
|
1800
|
-
tmp.
|
|
1801
|
-
tmp.
|
|
1802
|
-
return tmp.
|
|
1798
|
+
protoOf(TileManager$cache$slambda).invoke_m1epgk_k$ = function (tc, $completion) {
|
|
1799
|
+
var tmp = this.create_w0r0yx_k$(tc, $completion);
|
|
1800
|
+
tmp.result_1 = Unit_instance;
|
|
1801
|
+
tmp.exception_1 = null;
|
|
1802
|
+
return tmp.doResume_5yljmg_k$();
|
|
1803
1803
|
};
|
|
1804
|
-
protoOf(TileManager$cache$slambda).
|
|
1805
|
-
return this.
|
|
1804
|
+
protoOf(TileManager$cache$slambda).invoke_qns8j1_k$ = function (p1, $completion) {
|
|
1805
|
+
return this.invoke_m1epgk_k$(p1 instanceof TileCoordinates ? p1 : THROW_CCE(), $completion);
|
|
1806
1806
|
};
|
|
1807
|
-
protoOf(TileManager$cache$slambda).
|
|
1808
|
-
var suspendResult = this.
|
|
1807
|
+
protoOf(TileManager$cache$slambda).doResume_5yljmg_k$ = function () {
|
|
1808
|
+
var suspendResult = this.result_1;
|
|
1809
1809
|
$sm: do
|
|
1810
1810
|
try {
|
|
1811
|
-
var tmp = this.
|
|
1811
|
+
var tmp = this.state_1;
|
|
1812
1812
|
switch (tmp) {
|
|
1813
1813
|
case 0:
|
|
1814
|
-
this.
|
|
1815
|
-
this.
|
|
1816
|
-
suspendResult = this.
|
|
1814
|
+
this.exceptionState_1 = 2;
|
|
1815
|
+
this.state_1 = 1;
|
|
1816
|
+
suspendResult = this.this$0__1.fetcher_1(buildUrl(this.this$0__1, this.tc_1), this);
|
|
1817
1817
|
if (suspendResult === get_COROUTINE_SUSPENDED()) {
|
|
1818
1818
|
return suspendResult;
|
|
1819
1819
|
}
|
|
@@ -1823,28 +1823,28 @@
|
|
|
1823
1823
|
var ARGUMENT = suspendResult;
|
|
1824
1824
|
return Tile_init_$Create$(ARGUMENT);
|
|
1825
1825
|
case 2:
|
|
1826
|
-
throw this.
|
|
1826
|
+
throw this.exception_1;
|
|
1827
1827
|
}
|
|
1828
1828
|
} catch ($p) {
|
|
1829
1829
|
var e = $p;
|
|
1830
|
-
if (this.
|
|
1830
|
+
if (this.exceptionState_1 === 2) {
|
|
1831
1831
|
throw e;
|
|
1832
1832
|
} else {
|
|
1833
|
-
this.
|
|
1834
|
-
this.
|
|
1833
|
+
this.state_1 = this.exceptionState_1;
|
|
1834
|
+
this.exception_1 = e;
|
|
1835
1835
|
}
|
|
1836
1836
|
}
|
|
1837
1837
|
while (true);
|
|
1838
1838
|
};
|
|
1839
|
-
protoOf(TileManager$cache$slambda).
|
|
1840
|
-
var i = new TileManager$cache$slambda(this.
|
|
1841
|
-
i.
|
|
1839
|
+
protoOf(TileManager$cache$slambda).create_w0r0yx_k$ = function (tc, completion) {
|
|
1840
|
+
var i = new TileManager$cache$slambda(this.this$0__1, completion);
|
|
1841
|
+
i.tc_1 = tc;
|
|
1842
1842
|
return i;
|
|
1843
1843
|
};
|
|
1844
1844
|
function TileManager$cache$slambda_0(this$0, resultContinuation) {
|
|
1845
1845
|
var i = new TileManager$cache$slambda(this$0, resultContinuation);
|
|
1846
1846
|
return constructCallableReference(function (tc, $completion) {
|
|
1847
|
-
return i.
|
|
1847
|
+
return i.invoke_m1epgk_k$(tc, $completion);
|
|
1848
1848
|
}, 1);
|
|
1849
1849
|
}
|
|
1850
1850
|
function TileManager(urlTemplate, cacheSize, fetcher) {
|
|
@@ -1855,26 +1855,26 @@
|
|
|
1855
1855
|
tmp = fetcher;
|
|
1856
1856
|
}
|
|
1857
1857
|
fetcher = tmp;
|
|
1858
|
-
this.
|
|
1859
|
-
this.
|
|
1858
|
+
this.urlTemplate_1 = urlTemplate;
|
|
1859
|
+
this.fetcher_1 = fetcher;
|
|
1860
1860
|
var tmp_0 = this;
|
|
1861
|
-
tmp_0.
|
|
1861
|
+
tmp_0.cache_1 = new LruCache(cacheSize, TileManager$cache$slambda_0(this, null));
|
|
1862
1862
|
}
|
|
1863
|
-
protoOf(TileManager).
|
|
1864
|
-
return this.
|
|
1863
|
+
protoOf(TileManager).getTile_c22khk_k$ = function (tileCoords, $completion) {
|
|
1864
|
+
return this.cache_1.get_27lcp2_k$(tileCoords, $completion);
|
|
1865
1865
|
};
|
|
1866
1866
|
function TileCoordinates(x, y, z) {
|
|
1867
|
-
this.
|
|
1868
|
-
this.
|
|
1869
|
-
this.
|
|
1867
|
+
this.x_1 = x;
|
|
1868
|
+
this.y_1 = y;
|
|
1869
|
+
this.z_1 = z;
|
|
1870
1870
|
}
|
|
1871
1871
|
protoOf(TileCoordinates).toString = function () {
|
|
1872
|
-
return 'TileCoordinates(x=' + this.
|
|
1872
|
+
return 'TileCoordinates(x=' + this.x_1 + ', y=' + this.y_1 + ', z=' + this.z_1 + ')';
|
|
1873
1873
|
};
|
|
1874
1874
|
protoOf(TileCoordinates).hashCode = function () {
|
|
1875
|
-
var result = this.
|
|
1876
|
-
result = imul(result, 31) + this.
|
|
1877
|
-
result = imul(result, 31) + this.
|
|
1875
|
+
var result = this.x_1;
|
|
1876
|
+
result = imul(result, 31) + this.y_1 | 0;
|
|
1877
|
+
result = imul(result, 31) + this.z_1 | 0;
|
|
1878
1878
|
return result;
|
|
1879
1879
|
};
|
|
1880
1880
|
protoOf(TileCoordinates).equals = function (other) {
|
|
@@ -1882,26 +1882,26 @@
|
|
|
1882
1882
|
return true;
|
|
1883
1883
|
if (!(other instanceof TileCoordinates))
|
|
1884
1884
|
return false;
|
|
1885
|
-
if (!(this.
|
|
1885
|
+
if (!(this.x_1 === other.x_1))
|
|
1886
1886
|
return false;
|
|
1887
|
-
if (!(this.
|
|
1887
|
+
if (!(this.y_1 === other.y_1))
|
|
1888
1888
|
return false;
|
|
1889
|
-
if (!(this.
|
|
1889
|
+
if (!(this.z_1 === other.z_1))
|
|
1890
1890
|
return false;
|
|
1891
1891
|
return true;
|
|
1892
1892
|
};
|
|
1893
1893
|
function Pixel(tile, x, y) {
|
|
1894
|
-
this.
|
|
1895
|
-
this.
|
|
1896
|
-
this.
|
|
1894
|
+
this.tile_1 = tile;
|
|
1895
|
+
this.x_1 = x;
|
|
1896
|
+
this.y_1 = y;
|
|
1897
1897
|
}
|
|
1898
1898
|
protoOf(Pixel).toString = function () {
|
|
1899
|
-
return 'Pixel(tile=' + this.
|
|
1899
|
+
return 'Pixel(tile=' + this.tile_1.toString() + ', x=' + this.x_1 + ', y=' + this.y_1 + ')';
|
|
1900
1900
|
};
|
|
1901
1901
|
protoOf(Pixel).hashCode = function () {
|
|
1902
|
-
var result = this.
|
|
1903
|
-
result = imul(result, 31) + this.
|
|
1904
|
-
result = imul(result, 31) + this.
|
|
1902
|
+
var result = this.tile_1.hashCode();
|
|
1903
|
+
result = imul(result, 31) + this.x_1 | 0;
|
|
1904
|
+
result = imul(result, 31) + this.y_1 | 0;
|
|
1905
1905
|
return result;
|
|
1906
1906
|
};
|
|
1907
1907
|
protoOf(Pixel).equals = function (other) {
|
|
@@ -1909,26 +1909,26 @@
|
|
|
1909
1909
|
return true;
|
|
1910
1910
|
if (!(other instanceof Pixel))
|
|
1911
1911
|
return false;
|
|
1912
|
-
if (!this.
|
|
1912
|
+
if (!this.tile_1.equals(other.tile_1))
|
|
1913
1913
|
return false;
|
|
1914
|
-
if (!(this.
|
|
1914
|
+
if (!(this.x_1 === other.x_1))
|
|
1915
1915
|
return false;
|
|
1916
|
-
if (!(this.
|
|
1916
|
+
if (!(this.y_1 === other.y_1))
|
|
1917
1917
|
return false;
|
|
1918
1918
|
return true;
|
|
1919
1919
|
};
|
|
1920
1920
|
function PixelFloat(tile, x, y) {
|
|
1921
|
-
this.
|
|
1922
|
-
this.
|
|
1923
|
-
this.
|
|
1921
|
+
this.tile_1 = tile;
|
|
1922
|
+
this.x_1 = x;
|
|
1923
|
+
this.y_1 = y;
|
|
1924
1924
|
}
|
|
1925
1925
|
protoOf(PixelFloat).toString = function () {
|
|
1926
|
-
return 'PixelFloat(tile=' + this.
|
|
1926
|
+
return 'PixelFloat(tile=' + this.tile_1.toString() + ', x=' + this.x_1 + ', y=' + this.y_1 + ')';
|
|
1927
1927
|
};
|
|
1928
1928
|
protoOf(PixelFloat).hashCode = function () {
|
|
1929
|
-
var result = this.
|
|
1930
|
-
result = imul(result, 31) + getNumberHashCode(this.
|
|
1931
|
-
result = imul(result, 31) + getNumberHashCode(this.
|
|
1929
|
+
var result = this.tile_1.hashCode();
|
|
1930
|
+
result = imul(result, 31) + getNumberHashCode(this.x_1) | 0;
|
|
1931
|
+
result = imul(result, 31) + getNumberHashCode(this.y_1) | 0;
|
|
1932
1932
|
return result;
|
|
1933
1933
|
};
|
|
1934
1934
|
protoOf(PixelFloat).equals = function (other) {
|
|
@@ -1936,30 +1936,30 @@
|
|
|
1936
1936
|
return true;
|
|
1937
1937
|
if (!(other instanceof PixelFloat))
|
|
1938
1938
|
return false;
|
|
1939
|
-
if (!this.
|
|
1939
|
+
if (!this.tile_1.equals(other.tile_1))
|
|
1940
1940
|
return false;
|
|
1941
|
-
if (!equals(this.
|
|
1941
|
+
if (!equals(this.x_1, other.x_1))
|
|
1942
1942
|
return false;
|
|
1943
|
-
if (!equals(this.
|
|
1943
|
+
if (!equals(this.y_1, other.y_1))
|
|
1944
1944
|
return false;
|
|
1945
1945
|
return true;
|
|
1946
1946
|
};
|
|
1947
1947
|
function TileCoordinatesFloat(x, y, xFloat, yFloat, z) {
|
|
1948
|
-
this.
|
|
1949
|
-
this.
|
|
1950
|
-
this.
|
|
1951
|
-
this.
|
|
1952
|
-
this.
|
|
1948
|
+
this.x_1 = x;
|
|
1949
|
+
this.y_1 = y;
|
|
1950
|
+
this.xFloat_1 = xFloat;
|
|
1951
|
+
this.yFloat_1 = yFloat;
|
|
1952
|
+
this.z_1 = z;
|
|
1953
1953
|
}
|
|
1954
1954
|
protoOf(TileCoordinatesFloat).toString = function () {
|
|
1955
|
-
return 'TileCoordinatesFloat(x=' + this.
|
|
1955
|
+
return 'TileCoordinatesFloat(x=' + this.x_1 + ', y=' + this.y_1 + ', xFloat=' + this.xFloat_1 + ', yFloat=' + this.yFloat_1 + ', z=' + this.z_1 + ')';
|
|
1956
1956
|
};
|
|
1957
1957
|
protoOf(TileCoordinatesFloat).hashCode = function () {
|
|
1958
|
-
var result = this.
|
|
1959
|
-
result = imul(result, 31) + this.
|
|
1960
|
-
result = imul(result, 31) + getNumberHashCode(this.
|
|
1961
|
-
result = imul(result, 31) + getNumberHashCode(this.
|
|
1962
|
-
result = imul(result, 31) + this.
|
|
1958
|
+
var result = this.x_1;
|
|
1959
|
+
result = imul(result, 31) + this.y_1 | 0;
|
|
1960
|
+
result = imul(result, 31) + getNumberHashCode(this.xFloat_1) | 0;
|
|
1961
|
+
result = imul(result, 31) + getNumberHashCode(this.yFloat_1) | 0;
|
|
1962
|
+
result = imul(result, 31) + this.z_1 | 0;
|
|
1963
1963
|
return result;
|
|
1964
1964
|
};
|
|
1965
1965
|
protoOf(TileCoordinatesFloat).equals = function (other) {
|
|
@@ -1967,21 +1967,21 @@
|
|
|
1967
1967
|
return true;
|
|
1968
1968
|
if (!(other instanceof TileCoordinatesFloat))
|
|
1969
1969
|
return false;
|
|
1970
|
-
if (!(this.
|
|
1970
|
+
if (!(this.x_1 === other.x_1))
|
|
1971
1971
|
return false;
|
|
1972
|
-
if (!(this.
|
|
1972
|
+
if (!(this.y_1 === other.y_1))
|
|
1973
1973
|
return false;
|
|
1974
|
-
if (!equals(this.
|
|
1974
|
+
if (!equals(this.xFloat_1, other.xFloat_1))
|
|
1975
1975
|
return false;
|
|
1976
|
-
if (!equals(this.
|
|
1976
|
+
if (!equals(this.yFloat_1, other.yFloat_1))
|
|
1977
1977
|
return false;
|
|
1978
|
-
if (!(this.
|
|
1978
|
+
if (!(this.z_1 === other.z_1))
|
|
1979
1979
|
return false;
|
|
1980
1980
|
return true;
|
|
1981
1981
|
};
|
|
1982
1982
|
function Companion_0() {
|
|
1983
1983
|
Companion_instance_0 = this;
|
|
1984
|
-
this.
|
|
1984
|
+
this.ZERO_1 = new Vector3D(0.0, 0.0, 0.0);
|
|
1985
1985
|
}
|
|
1986
1986
|
var Companion_instance_0;
|
|
1987
1987
|
function Companion_getInstance_0() {
|
|
@@ -1991,49 +1991,49 @@
|
|
|
1991
1991
|
}
|
|
1992
1992
|
function Vector3D(x, y, z) {
|
|
1993
1993
|
Companion_getInstance_0();
|
|
1994
|
-
this.
|
|
1995
|
-
this.
|
|
1996
|
-
this.
|
|
1994
|
+
this.x_1 = x;
|
|
1995
|
+
this.y_1 = y;
|
|
1996
|
+
this.z_1 = z;
|
|
1997
1997
|
}
|
|
1998
|
-
protoOf(Vector3D).
|
|
1999
|
-
var tmp0 = this.
|
|
1998
|
+
protoOf(Vector3D).distanceTo_53ug7b_k$ = function (other) {
|
|
1999
|
+
var tmp0 = this.x_1 - other.x_1;
|
|
2000
2000
|
// Inline function 'kotlin.math.hypot' call
|
|
2001
|
-
var y = this.
|
|
2001
|
+
var y = this.y_1 - other.y_1;
|
|
2002
2002
|
var tmp0_0 = hypot(tmp0, y);
|
|
2003
2003
|
// Inline function 'kotlin.math.hypot' call
|
|
2004
|
-
var y_0 = this.
|
|
2004
|
+
var y_0 = this.z_1 - other.z_1;
|
|
2005
2005
|
return hypot(tmp0_0, y_0);
|
|
2006
2006
|
};
|
|
2007
|
-
protoOf(Vector3D).
|
|
2008
|
-
return new Vector3D(this.
|
|
2007
|
+
protoOf(Vector3D).minus_de4vqf_k$ = function (other) {
|
|
2008
|
+
return new Vector3D(this.x_1 - other.x_1, this.y_1 - other.y_1, this.z_1 - other.z_1);
|
|
2009
2009
|
};
|
|
2010
|
-
protoOf(Vector3D).
|
|
2011
|
-
return new Vector3D(this.
|
|
2010
|
+
protoOf(Vector3D).plus_e4szu7_k$ = function (other) {
|
|
2011
|
+
return new Vector3D(this.x_1 + other.x_1, this.y_1 + other.y_1, this.z_1 + other.z_1);
|
|
2012
2012
|
};
|
|
2013
|
-
protoOf(Vector3D).
|
|
2014
|
-
return new Vector3D(this.
|
|
2013
|
+
protoOf(Vector3D).times_qz1dds_k$ = function (scalar) {
|
|
2014
|
+
return new Vector3D(this.x_1 * scalar, this.y_1 * scalar, this.z_1 * scalar);
|
|
2015
2015
|
};
|
|
2016
|
-
protoOf(Vector3D).
|
|
2017
|
-
return this.
|
|
2016
|
+
protoOf(Vector3D).dot_o3y6jk_k$ = function (other) {
|
|
2017
|
+
return this.x_1 * other.x_1 + this.y_1 * other.y_1 + this.z_1 * other.z_1;
|
|
2018
2018
|
};
|
|
2019
|
-
protoOf(Vector3D).
|
|
2020
|
-
var segmentVector = segmentEnd.
|
|
2021
|
-
var segmentLengthSq = segmentVector.
|
|
2019
|
+
protoOf(Vector3D).distanceToSegment_bfq4v7_k$ = function (segmentStart, segmentEnd) {
|
|
2020
|
+
var segmentVector = segmentEnd.minus_de4vqf_k$(segmentStart);
|
|
2021
|
+
var segmentLengthSq = segmentVector.dot_o3y6jk_k$(segmentVector);
|
|
2022
2022
|
if (segmentLengthSq === 0.0)
|
|
2023
|
-
return this.
|
|
2024
|
-
var pointVector = this.
|
|
2025
|
-
var projection = pointVector.
|
|
2023
|
+
return this.distanceTo_53ug7b_k$(segmentStart);
|
|
2024
|
+
var pointVector = this.minus_de4vqf_k$(segmentStart);
|
|
2025
|
+
var projection = pointVector.dot_o3y6jk_k$(segmentVector) / segmentLengthSq;
|
|
2026
2026
|
var clamped = coerceIn_0(projection, 0.0, 1.0);
|
|
2027
|
-
var closest = segmentStart.
|
|
2028
|
-
return this.
|
|
2027
|
+
var closest = segmentStart.plus_e4szu7_k$(segmentVector.times_qz1dds_k$(clamped));
|
|
2028
|
+
return this.distanceTo_53ug7b_k$(closest);
|
|
2029
2029
|
};
|
|
2030
2030
|
protoOf(Vector3D).toString = function () {
|
|
2031
|
-
return 'Vector3D(x=' + this.
|
|
2031
|
+
return 'Vector3D(x=' + this.x_1 + ', y=' + this.y_1 + ', z=' + this.z_1 + ')';
|
|
2032
2032
|
};
|
|
2033
2033
|
protoOf(Vector3D).hashCode = function () {
|
|
2034
|
-
var result = getNumberHashCode(this.
|
|
2035
|
-
result = imul(result, 31) + getNumberHashCode(this.
|
|
2036
|
-
result = imul(result, 31) + getNumberHashCode(this.
|
|
2034
|
+
var result = getNumberHashCode(this.x_1);
|
|
2035
|
+
result = imul(result, 31) + getNumberHashCode(this.y_1) | 0;
|
|
2036
|
+
result = imul(result, 31) + getNumberHashCode(this.z_1) | 0;
|
|
2037
2037
|
return result;
|
|
2038
2038
|
};
|
|
2039
2039
|
protoOf(Vector3D).equals = function (other) {
|
|
@@ -2041,24 +2041,24 @@
|
|
|
2041
2041
|
return true;
|
|
2042
2042
|
if (!(other instanceof Vector3D))
|
|
2043
2043
|
return false;
|
|
2044
|
-
if (!equals(this.
|
|
2044
|
+
if (!equals(this.x_1, other.x_1))
|
|
2045
2045
|
return false;
|
|
2046
|
-
if (!equals(this.
|
|
2046
|
+
if (!equals(this.y_1, other.y_1))
|
|
2047
2047
|
return false;
|
|
2048
|
-
if (!equals(this.
|
|
2048
|
+
if (!equals(this.z_1, other.z_1))
|
|
2049
2049
|
return false;
|
|
2050
2050
|
return true;
|
|
2051
2051
|
};
|
|
2052
2052
|
function newElevationProvider(configDto) {
|
|
2053
2053
|
var defaults = new ElevationProviderConfig();
|
|
2054
2054
|
var tmp1_elvis_lhs = configDto == null ? null : configDto.zoomLevel;
|
|
2055
|
-
var tmp = tmp1_elvis_lhs == null ? defaults.
|
|
2055
|
+
var tmp = tmp1_elvis_lhs == null ? defaults.zoomLevel_1 : tmp1_elvis_lhs;
|
|
2056
2056
|
var tmp3_elvis_lhs = configDto == null ? null : configDto.cacheSize;
|
|
2057
|
-
var tmp_0 = tmp3_elvis_lhs == null ? defaults.
|
|
2057
|
+
var tmp_0 = tmp3_elvis_lhs == null ? defaults.cacheSize_1 : tmp3_elvis_lhs;
|
|
2058
2058
|
var tmp5_elvis_lhs = configDto == null ? null : configDto.tileUrlTemplate;
|
|
2059
|
-
var tmp_1 = tmp5_elvis_lhs == null ? defaults.
|
|
2059
|
+
var tmp_1 = tmp5_elvis_lhs == null ? defaults.tileUrlTemplate_1 : tmp5_elvis_lhs;
|
|
2060
2060
|
var tmp7_elvis_lhs = configDto == null ? null : configDto.tileSize;
|
|
2061
|
-
var cfg = new ElevationProviderConfig(tmp, tmp_0, tmp_1, tmp7_elvis_lhs == null ? defaults.
|
|
2061
|
+
var cfg = new ElevationProviderConfig(tmp, tmp_0, tmp_1, tmp7_elvis_lhs == null ? defaults.tileSize_1 : tmp7_elvis_lhs, defaults.attribution_1);
|
|
2062
2062
|
return new ElevationProvider(cfg);
|
|
2063
2063
|
}
|
|
2064
2064
|
function getElevation(provider, latitude, longitude, interpolation) {
|
|
@@ -2084,31 +2084,31 @@
|
|
|
2084
2084
|
return o;
|
|
2085
2085
|
}
|
|
2086
2086
|
function getElevation$slambda($provider, $latitude, $longitude, $interpolation, resultContinuation) {
|
|
2087
|
-
this
|
|
2088
|
-
this
|
|
2089
|
-
this
|
|
2090
|
-
this
|
|
2087
|
+
this.$provider_1 = $provider;
|
|
2088
|
+
this.$latitude_1 = $latitude;
|
|
2089
|
+
this.$longitude_1 = $longitude;
|
|
2090
|
+
this.$interpolation_1 = $interpolation;
|
|
2091
2091
|
CoroutineImpl.call(this, resultContinuation);
|
|
2092
2092
|
}
|
|
2093
|
-
protoOf(getElevation$slambda).
|
|
2094
|
-
var tmp = this.
|
|
2095
|
-
tmp.
|
|
2096
|
-
tmp.
|
|
2097
|
-
return tmp.
|
|
2093
|
+
protoOf(getElevation$slambda).invoke_41ewvl_k$ = function ($this$promise, $completion) {
|
|
2094
|
+
var tmp = this.create_rcuf4x_k$($this$promise, $completion);
|
|
2095
|
+
tmp.result_1 = Unit_instance;
|
|
2096
|
+
tmp.exception_1 = null;
|
|
2097
|
+
return tmp.doResume_5yljmg_k$();
|
|
2098
2098
|
};
|
|
2099
|
-
protoOf(getElevation$slambda).
|
|
2100
|
-
return this.
|
|
2099
|
+
protoOf(getElevation$slambda).invoke_qns8j1_k$ = function (p1, $completion) {
|
|
2100
|
+
return this.invoke_41ewvl_k$((!(p1 == null) ? isInterface(p1, CoroutineScope) : false) ? p1 : THROW_CCE(), $completion);
|
|
2101
2101
|
};
|
|
2102
|
-
protoOf(getElevation$slambda).
|
|
2103
|
-
var suspendResult = this.
|
|
2102
|
+
protoOf(getElevation$slambda).doResume_5yljmg_k$ = function () {
|
|
2103
|
+
var suspendResult = this.result_1;
|
|
2104
2104
|
$sm: do
|
|
2105
2105
|
try {
|
|
2106
|
-
var tmp = this.
|
|
2106
|
+
var tmp = this.state_1;
|
|
2107
2107
|
switch (tmp) {
|
|
2108
2108
|
case 0:
|
|
2109
|
-
this.
|
|
2110
|
-
this.
|
|
2111
|
-
suspendResult = this.
|
|
2109
|
+
this.exceptionState_1 = 2;
|
|
2110
|
+
this.state_1 = 1;
|
|
2111
|
+
suspendResult = this.$provider_1.getElevation_vb6cmz_k$(this.$latitude_1, this.$longitude_1, this.$interpolation_1, this);
|
|
2112
2112
|
if (suspendResult === get_COROUTINE_SUSPENDED()) {
|
|
2113
2113
|
return suspendResult;
|
|
2114
2114
|
}
|
|
@@ -2117,80 +2117,80 @@
|
|
|
2117
2117
|
case 1:
|
|
2118
2118
|
return suspendResult;
|
|
2119
2119
|
case 2:
|
|
2120
|
-
throw this.
|
|
2120
|
+
throw this.exception_1;
|
|
2121
2121
|
}
|
|
2122
2122
|
} catch ($p) {
|
|
2123
2123
|
var e = $p;
|
|
2124
|
-
if (this.
|
|
2124
|
+
if (this.exceptionState_1 === 2) {
|
|
2125
2125
|
throw e;
|
|
2126
2126
|
} else {
|
|
2127
|
-
this.
|
|
2128
|
-
this.
|
|
2127
|
+
this.state_1 = this.exceptionState_1;
|
|
2128
|
+
this.exception_1 = e;
|
|
2129
2129
|
}
|
|
2130
2130
|
}
|
|
2131
2131
|
while (true);
|
|
2132
2132
|
};
|
|
2133
|
-
protoOf(getElevation$slambda).
|
|
2134
|
-
var i = new getElevation$slambda(this
|
|
2135
|
-
i
|
|
2133
|
+
protoOf(getElevation$slambda).create_rcuf4x_k$ = function ($this$promise, completion) {
|
|
2134
|
+
var i = new getElevation$slambda(this.$provider_1, this.$latitude_1, this.$longitude_1, this.$interpolation_1, completion);
|
|
2135
|
+
i.$this$promise_1 = $this$promise;
|
|
2136
2136
|
return i;
|
|
2137
2137
|
};
|
|
2138
2138
|
function getElevation$slambda_0($provider, $latitude, $longitude, $interpolation, resultContinuation) {
|
|
2139
2139
|
var i = new getElevation$slambda($provider, $latitude, $longitude, $interpolation, resultContinuation);
|
|
2140
2140
|
return constructCallableReference(function ($this$promise, $completion) {
|
|
2141
|
-
return i.
|
|
2141
|
+
return i.invoke_41ewvl_k$($this$promise, $completion);
|
|
2142
2142
|
}, 1);
|
|
2143
2143
|
}
|
|
2144
2144
|
function getElevationsAlong$slambda($path, $provider, $options, resultContinuation) {
|
|
2145
|
-
this
|
|
2146
|
-
this
|
|
2147
|
-
this
|
|
2145
|
+
this.$path_1 = $path;
|
|
2146
|
+
this.$provider_1 = $provider;
|
|
2147
|
+
this.$options_1 = $options;
|
|
2148
2148
|
CoroutineImpl.call(this, resultContinuation);
|
|
2149
2149
|
}
|
|
2150
|
-
protoOf(getElevationsAlong$slambda).
|
|
2151
|
-
var tmp = this.
|
|
2152
|
-
tmp.
|
|
2153
|
-
tmp.
|
|
2154
|
-
return tmp.
|
|
2150
|
+
protoOf(getElevationsAlong$slambda).invoke_k3oqbv_k$ = function ($this$promise, $completion) {
|
|
2151
|
+
var tmp = this.create_rcuf4x_k$($this$promise, $completion);
|
|
2152
|
+
tmp.result_1 = Unit_instance;
|
|
2153
|
+
tmp.exception_1 = null;
|
|
2154
|
+
return tmp.doResume_5yljmg_k$();
|
|
2155
2155
|
};
|
|
2156
|
-
protoOf(getElevationsAlong$slambda).
|
|
2157
|
-
return this.
|
|
2156
|
+
protoOf(getElevationsAlong$slambda).invoke_qns8j1_k$ = function (p1, $completion) {
|
|
2157
|
+
return this.invoke_k3oqbv_k$((!(p1 == null) ? isInterface(p1, CoroutineScope) : false) ? p1 : THROW_CCE(), $completion);
|
|
2158
2158
|
};
|
|
2159
|
-
protoOf(getElevationsAlong$slambda).
|
|
2160
|
-
var suspendResult = this.
|
|
2159
|
+
protoOf(getElevationsAlong$slambda).doResume_5yljmg_k$ = function () {
|
|
2160
|
+
var suspendResult = this.result_1;
|
|
2161
2161
|
$sm: do
|
|
2162
2162
|
try {
|
|
2163
|
-
var tmp = this.
|
|
2163
|
+
var tmp = this.state_1;
|
|
2164
2164
|
switch (tmp) {
|
|
2165
2165
|
case 0:
|
|
2166
|
-
this.
|
|
2167
|
-
var this_0 = this
|
|
2166
|
+
this.exceptionState_1 = 2;
|
|
2167
|
+
var this_0 = this.$path_1;
|
|
2168
2168
|
var destination = ArrayList_init_$Create$_0(this_0.length);
|
|
2169
2169
|
var inductionVariable = 0;
|
|
2170
2170
|
var last = this_0.length;
|
|
2171
2171
|
while (inductionVariable < last) {
|
|
2172
2172
|
var item = this_0[inductionVariable];
|
|
2173
2173
|
inductionVariable = inductionVariable + 1 | 0;
|
|
2174
|
-
destination.
|
|
2174
|
+
destination.add_utx5q5_k$(new LatLon(item.latitude, item.longitude));
|
|
2175
2175
|
}
|
|
2176
2176
|
|
|
2177
2177
|
var coords = destination;
|
|
2178
|
-
this.
|
|
2179
|
-
var tmp0_safe_receiver = this
|
|
2178
|
+
this.state_1 = 1;
|
|
2179
|
+
var tmp0_safe_receiver = this.$options_1;
|
|
2180
2180
|
var tmp1_elvis_lhs = tmp0_safe_receiver == null ? null : tmp0_safe_receiver.step;
|
|
2181
2181
|
var tmp_0 = tmp1_elvis_lhs == null ? 10.0 : tmp1_elvis_lhs;
|
|
2182
|
-
var tmp2_safe_receiver = this
|
|
2182
|
+
var tmp2_safe_receiver = this.$options_1;
|
|
2183
2183
|
var tmp3_elvis_lhs = tmp2_safe_receiver == null ? null : tmp2_safe_receiver.minDistance;
|
|
2184
2184
|
var tmp_1 = tmp3_elvis_lhs == null ? 1.0 : tmp3_elvis_lhs;
|
|
2185
|
-
var tmp4_safe_receiver = this
|
|
2185
|
+
var tmp4_safe_receiver = this.$options_1;
|
|
2186
2186
|
var tmp5_elvis_lhs = tmp4_safe_receiver == null ? null : tmp4_safe_receiver.interpolation;
|
|
2187
2187
|
var tmp_2 = tmp5_elvis_lhs == null ? true : tmp5_elvis_lhs;
|
|
2188
|
-
var tmp6_safe_receiver = this
|
|
2188
|
+
var tmp6_safe_receiver = this.$options_1;
|
|
2189
2189
|
var tmp7_safe_receiver = tmp6_safe_receiver == null ? null : tmp6_safe_receiver.smoothingOptions;
|
|
2190
2190
|
var tmp_3 = tmp7_safe_receiver == null ? null : toKotlin(tmp7_safe_receiver);
|
|
2191
|
-
var tmp8_safe_receiver = this
|
|
2191
|
+
var tmp8_safe_receiver = this.$options_1;
|
|
2192
2192
|
var tmp9_safe_receiver = tmp8_safe_receiver == null ? null : tmp8_safe_receiver.filterOptions;
|
|
2193
|
-
suspendResult = this.
|
|
2193
|
+
suspendResult = this.$provider_1.getElevationsAlong_o6hmac_k$(coords, tmp_0, tmp_1, tmp_2, tmp_3, tmp9_safe_receiver == null ? null : toKotlin_0(tmp9_safe_receiver), this);
|
|
2194
2194
|
if (suspendResult === get_COROUTINE_SUSPENDED()) {
|
|
2195
2195
|
return suspendResult;
|
|
2196
2196
|
}
|
|
@@ -2199,39 +2199,39 @@
|
|
|
2199
2199
|
case 1:
|
|
2200
2200
|
var results = suspendResult;
|
|
2201
2201
|
var tmp_4 = 0;
|
|
2202
|
-
var tmp_5 = results.
|
|
2202
|
+
var tmp_5 = results.get_size_woubt6_k$();
|
|
2203
2203
|
var tmp_6 = Array(tmp_5);
|
|
2204
2204
|
while (tmp_4 < tmp_5) {
|
|
2205
2205
|
var tmp_7 = tmp_4;
|
|
2206
|
-
var c = results.
|
|
2207
|
-
tmp_6[tmp_7] = coordsEle(c.
|
|
2206
|
+
var c = results.get_c1px32_k$(tmp_7);
|
|
2207
|
+
tmp_6[tmp_7] = coordsEle(c.get_latitude_feukvp_k$(), c.get_longitude_asb1fq_k$(), c.get_elevation_8fwyb8_k$());
|
|
2208
2208
|
tmp_4 = tmp_4 + 1 | 0;
|
|
2209
2209
|
}
|
|
2210
2210
|
|
|
2211
2211
|
return tmp_6;
|
|
2212
2212
|
case 2:
|
|
2213
|
-
throw this.
|
|
2213
|
+
throw this.exception_1;
|
|
2214
2214
|
}
|
|
2215
2215
|
} catch ($p) {
|
|
2216
2216
|
var e = $p;
|
|
2217
|
-
if (this.
|
|
2217
|
+
if (this.exceptionState_1 === 2) {
|
|
2218
2218
|
throw e;
|
|
2219
2219
|
} else {
|
|
2220
|
-
this.
|
|
2221
|
-
this.
|
|
2220
|
+
this.state_1 = this.exceptionState_1;
|
|
2221
|
+
this.exception_1 = e;
|
|
2222
2222
|
}
|
|
2223
2223
|
}
|
|
2224
2224
|
while (true);
|
|
2225
2225
|
};
|
|
2226
|
-
protoOf(getElevationsAlong$slambda).
|
|
2227
|
-
var i = new getElevationsAlong$slambda(this
|
|
2228
|
-
i
|
|
2226
|
+
protoOf(getElevationsAlong$slambda).create_rcuf4x_k$ = function ($this$promise, completion) {
|
|
2227
|
+
var i = new getElevationsAlong$slambda(this.$path_1, this.$provider_1, this.$options_1, completion);
|
|
2228
|
+
i.$this$promise_1 = $this$promise;
|
|
2229
2229
|
return i;
|
|
2230
2230
|
};
|
|
2231
2231
|
function getElevationsAlong$slambda_0($path, $provider, $options, resultContinuation) {
|
|
2232
2232
|
var i = new getElevationsAlong$slambda($path, $provider, $options, resultContinuation);
|
|
2233
2233
|
return constructCallableReference(function ($this$promise, $completion) {
|
|
2234
|
-
return i.
|
|
2234
|
+
return i.invoke_k3oqbv_k$($this$promise, $completion);
|
|
2235
2235
|
}, 1);
|
|
2236
2236
|
}
|
|
2237
2237
|
function get_isNode() {
|
|
@@ -2245,26 +2245,26 @@
|
|
|
2245
2245
|
var tmp = KProperty0;
|
|
2246
2246
|
// Inline function 'kotlin.getValue' call
|
|
2247
2247
|
getPropertyCallableRef('nodeWebpDecoderPromise', 0, tmp, _get_nodeWebpDecoderPromise_$ref_s562t(), null);
|
|
2248
|
-
return tmp0.
|
|
2248
|
+
return tmp0.get_value_j01efc_k$();
|
|
2249
2249
|
}
|
|
2250
2250
|
var nodeWebpDecoderPromise$delegate;
|
|
2251
2251
|
function fetchAndDecodeTile(url, $completion) {
|
|
2252
2252
|
var tmp = new $fetchAndDecodeTileCOROUTINE$(url, $completion);
|
|
2253
|
-
tmp.
|
|
2254
|
-
tmp.
|
|
2255
|
-
return tmp.
|
|
2253
|
+
tmp.result_1 = Unit_instance;
|
|
2254
|
+
tmp.exception_1 = null;
|
|
2255
|
+
return tmp.doResume_5yljmg_k$();
|
|
2256
2256
|
}
|
|
2257
2257
|
function decodeNode(url, $completion) {
|
|
2258
2258
|
var tmp = new $decodeNodeCOROUTINE$(url, $completion);
|
|
2259
|
-
tmp.
|
|
2260
|
-
tmp.
|
|
2261
|
-
return tmp.
|
|
2259
|
+
tmp.result_1 = Unit_instance;
|
|
2260
|
+
tmp.exception_1 = null;
|
|
2261
|
+
return tmp.doResume_5yljmg_k$();
|
|
2262
2262
|
}
|
|
2263
2263
|
function decodeBrowser(url, $completion) {
|
|
2264
2264
|
var tmp = new $decodeBrowserCOROUTINE$(url, $completion);
|
|
2265
|
-
tmp.
|
|
2266
|
-
tmp.
|
|
2267
|
-
return tmp.
|
|
2265
|
+
tmp.result_1 = Unit_instance;
|
|
2266
|
+
tmp.exception_1 = null;
|
|
2267
|
+
return tmp.doResume_5yljmg_k$();
|
|
2268
2268
|
}
|
|
2269
2269
|
function fetchUrlNode(url) {
|
|
2270
2270
|
_init_properties_TileFetcher_js_kt__7a2f1e();
|
|
@@ -2295,9 +2295,9 @@
|
|
|
2295
2295
|
}
|
|
2296
2296
|
function decodeWebpNode(buffer, $completion) {
|
|
2297
2297
|
var tmp = new $decodeWebpNodeCOROUTINE$(buffer, $completion);
|
|
2298
|
-
tmp.
|
|
2299
|
-
tmp.
|
|
2300
|
-
return tmp.
|
|
2298
|
+
tmp.result_1 = Unit_instance;
|
|
2299
|
+
tmp.exception_1 = null;
|
|
2300
|
+
return tmp.doResume_5yljmg_k$();
|
|
2301
2301
|
}
|
|
2302
2302
|
function fetchUrlBrowser(url) {
|
|
2303
2303
|
_init_properties_TileFetcher_js_kt__7a2f1e();
|
|
@@ -2306,9 +2306,9 @@
|
|
|
2306
2306
|
}
|
|
2307
2307
|
function decodeBlob(blob, sourceUrl, $completion) {
|
|
2308
2308
|
var tmp = new $decodeBlobCOROUTINE$(blob, sourceUrl, $completion);
|
|
2309
|
-
tmp.
|
|
2310
|
-
tmp.
|
|
2311
|
-
return tmp.
|
|
2309
|
+
tmp.result_1 = Unit_instance;
|
|
2310
|
+
tmp.exception_1 = null;
|
|
2311
|
+
return tmp.doResume_5yljmg_k$();
|
|
2312
2312
|
}
|
|
2313
2313
|
function nodeWebpDecoderPromise$delegate$lambda() {
|
|
2314
2314
|
_init_properties_TileFetcher_js_kt__7a2f1e();
|
|
@@ -2335,26 +2335,26 @@
|
|
|
2335
2335
|
}
|
|
2336
2336
|
function $fetchAndDecodeTileCOROUTINE$(url, resultContinuation) {
|
|
2337
2337
|
CoroutineImpl.call(this, resultContinuation);
|
|
2338
|
-
this.
|
|
2338
|
+
this.url_1 = url;
|
|
2339
2339
|
}
|
|
2340
|
-
protoOf($fetchAndDecodeTileCOROUTINE$).
|
|
2341
|
-
var suspendResult = this.
|
|
2340
|
+
protoOf($fetchAndDecodeTileCOROUTINE$).doResume_5yljmg_k$ = function () {
|
|
2341
|
+
var suspendResult = this.result_1;
|
|
2342
2342
|
$sm: do
|
|
2343
2343
|
try {
|
|
2344
|
-
var tmp = this.
|
|
2344
|
+
var tmp = this.state_1;
|
|
2345
2345
|
switch (tmp) {
|
|
2346
2346
|
case 0:
|
|
2347
|
-
this.
|
|
2347
|
+
this.exceptionState_1 = 4;
|
|
2348
2348
|
if (get_isNode()) {
|
|
2349
|
-
this.
|
|
2350
|
-
suspendResult = decodeNode(this.
|
|
2349
|
+
this.state_1 = 2;
|
|
2350
|
+
suspendResult = decodeNode(this.url_1, this);
|
|
2351
2351
|
if (suspendResult === get_COROUTINE_SUSPENDED()) {
|
|
2352
2352
|
return suspendResult;
|
|
2353
2353
|
}
|
|
2354
2354
|
continue $sm;
|
|
2355
2355
|
} else {
|
|
2356
|
-
this.
|
|
2357
|
-
suspendResult = decodeBrowser(this.
|
|
2356
|
+
this.state_1 = 1;
|
|
2357
|
+
suspendResult = decodeBrowser(this.url_1, this);
|
|
2358
2358
|
if (suspendResult === get_COROUTINE_SUSPENDED()) {
|
|
2359
2359
|
return suspendResult;
|
|
2360
2360
|
}
|
|
@@ -2362,43 +2362,43 @@
|
|
|
2362
2362
|
}
|
|
2363
2363
|
|
|
2364
2364
|
case 1:
|
|
2365
|
-
this.
|
|
2366
|
-
this.
|
|
2365
|
+
this.WHEN_RESULT0__1 = suspendResult;
|
|
2366
|
+
this.state_1 = 3;
|
|
2367
2367
|
continue $sm;
|
|
2368
2368
|
case 2:
|
|
2369
|
-
this.
|
|
2370
|
-
this.
|
|
2369
|
+
this.WHEN_RESULT0__1 = suspendResult;
|
|
2370
|
+
this.state_1 = 3;
|
|
2371
2371
|
continue $sm;
|
|
2372
2372
|
case 3:
|
|
2373
|
-
return this.
|
|
2373
|
+
return this.WHEN_RESULT0__1;
|
|
2374
2374
|
case 4:
|
|
2375
|
-
throw this.
|
|
2375
|
+
throw this.exception_1;
|
|
2376
2376
|
}
|
|
2377
2377
|
} catch ($p) {
|
|
2378
2378
|
var e = $p;
|
|
2379
|
-
if (this.
|
|
2379
|
+
if (this.exceptionState_1 === 4) {
|
|
2380
2380
|
throw e;
|
|
2381
2381
|
} else {
|
|
2382
|
-
this.
|
|
2383
|
-
this.
|
|
2382
|
+
this.state_1 = this.exceptionState_1;
|
|
2383
|
+
this.exception_1 = e;
|
|
2384
2384
|
}
|
|
2385
2385
|
}
|
|
2386
2386
|
while (true);
|
|
2387
2387
|
};
|
|
2388
2388
|
function $decodeNodeCOROUTINE$(url, resultContinuation) {
|
|
2389
2389
|
CoroutineImpl.call(this, resultContinuation);
|
|
2390
|
-
this.
|
|
2390
|
+
this.url_1 = url;
|
|
2391
2391
|
}
|
|
2392
|
-
protoOf($decodeNodeCOROUTINE$).
|
|
2393
|
-
var suspendResult = this.
|
|
2392
|
+
protoOf($decodeNodeCOROUTINE$).doResume_5yljmg_k$ = function () {
|
|
2393
|
+
var suspendResult = this.result_1;
|
|
2394
2394
|
$sm: do
|
|
2395
2395
|
try {
|
|
2396
|
-
var tmp = this.
|
|
2396
|
+
var tmp = this.state_1;
|
|
2397
2397
|
switch (tmp) {
|
|
2398
2398
|
case 0:
|
|
2399
|
-
this.
|
|
2400
|
-
this.
|
|
2401
|
-
suspendResult = await_0(fetchUrlNode(this.
|
|
2399
|
+
this.exceptionState_1 = 4;
|
|
2400
|
+
this.state_1 = 1;
|
|
2401
|
+
suspendResult = await_0(fetchUrlNode(this.url_1), this);
|
|
2402
2402
|
if (suspendResult === get_COROUTINE_SUSPENDED()) {
|
|
2403
2403
|
return suspendResult;
|
|
2404
2404
|
}
|
|
@@ -2407,11 +2407,11 @@
|
|
|
2407
2407
|
case 1:
|
|
2408
2408
|
var res = suspendResult;
|
|
2409
2409
|
if (!res.ok) {
|
|
2410
|
-
var message = 'Tile fetch failed for ' + this.
|
|
2410
|
+
var message = 'Tile fetch failed for ' + this.url_1 + ': HTTP ' + res.status;
|
|
2411
2411
|
throw IllegalStateException_init_$Create$_0(toString(message));
|
|
2412
2412
|
}
|
|
2413
2413
|
|
|
2414
|
-
this.
|
|
2414
|
+
this.state_1 = 2;
|
|
2415
2415
|
suspendResult = await_0(responseArrayBuffer(res), this);
|
|
2416
2416
|
if (suspendResult === get_COROUTINE_SUSPENDED()) {
|
|
2417
2417
|
return suspendResult;
|
|
@@ -2420,7 +2420,7 @@
|
|
|
2420
2420
|
continue $sm;
|
|
2421
2421
|
case 2:
|
|
2422
2422
|
var ab = suspendResult;
|
|
2423
|
-
this.
|
|
2423
|
+
this.state_1 = 3;
|
|
2424
2424
|
suspendResult = decodeWebpNode(ab, this);
|
|
2425
2425
|
if (suspendResult === get_COROUTINE_SUSPENDED()) {
|
|
2426
2426
|
return suspendResult;
|
|
@@ -2431,33 +2431,33 @@
|
|
|
2431
2431
|
var ARGUMENT = suspendResult;
|
|
2432
2432
|
return rawTileFromJsquash(ARGUMENT);
|
|
2433
2433
|
case 4:
|
|
2434
|
-
throw this.
|
|
2434
|
+
throw this.exception_1;
|
|
2435
2435
|
}
|
|
2436
2436
|
} catch ($p) {
|
|
2437
2437
|
var e = $p;
|
|
2438
|
-
if (this.
|
|
2438
|
+
if (this.exceptionState_1 === 4) {
|
|
2439
2439
|
throw e;
|
|
2440
2440
|
} else {
|
|
2441
|
-
this.
|
|
2442
|
-
this.
|
|
2441
|
+
this.state_1 = this.exceptionState_1;
|
|
2442
|
+
this.exception_1 = e;
|
|
2443
2443
|
}
|
|
2444
2444
|
}
|
|
2445
2445
|
while (true);
|
|
2446
2446
|
};
|
|
2447
2447
|
function $decodeBrowserCOROUTINE$(url, resultContinuation) {
|
|
2448
2448
|
CoroutineImpl.call(this, resultContinuation);
|
|
2449
|
-
this.
|
|
2449
|
+
this.url_1 = url;
|
|
2450
2450
|
}
|
|
2451
|
-
protoOf($decodeBrowserCOROUTINE$).
|
|
2452
|
-
var suspendResult = this.
|
|
2451
|
+
protoOf($decodeBrowserCOROUTINE$).doResume_5yljmg_k$ = function () {
|
|
2452
|
+
var suspendResult = this.result_1;
|
|
2453
2453
|
$sm: do
|
|
2454
2454
|
try {
|
|
2455
|
-
var tmp = this.
|
|
2455
|
+
var tmp = this.state_1;
|
|
2456
2456
|
switch (tmp) {
|
|
2457
2457
|
case 0:
|
|
2458
|
-
this.
|
|
2459
|
-
this.
|
|
2460
|
-
suspendResult = await_0(fetchUrlBrowser(this.
|
|
2458
|
+
this.exceptionState_1 = 4;
|
|
2459
|
+
this.state_1 = 1;
|
|
2460
|
+
suspendResult = await_0(fetchUrlBrowser(this.url_1), this);
|
|
2461
2461
|
if (suspendResult === get_COROUTINE_SUSPENDED()) {
|
|
2462
2462
|
return suspendResult;
|
|
2463
2463
|
}
|
|
@@ -2466,11 +2466,11 @@
|
|
|
2466
2466
|
case 1:
|
|
2467
2467
|
var res = suspendResult;
|
|
2468
2468
|
if (!res.ok) {
|
|
2469
|
-
var message = 'Tile fetch failed for ' + this.
|
|
2469
|
+
var message = 'Tile fetch failed for ' + this.url_1 + ': HTTP ' + res.status;
|
|
2470
2470
|
throw IllegalStateException_init_$Create$_0(toString(message));
|
|
2471
2471
|
}
|
|
2472
2472
|
|
|
2473
|
-
this.
|
|
2473
|
+
this.state_1 = 2;
|
|
2474
2474
|
suspendResult = await_0(res.blob(), this);
|
|
2475
2475
|
if (suspendResult === get_COROUTINE_SUSPENDED()) {
|
|
2476
2476
|
return suspendResult;
|
|
@@ -2479,8 +2479,8 @@
|
|
|
2479
2479
|
continue $sm;
|
|
2480
2480
|
case 2:
|
|
2481
2481
|
var ARGUMENT = suspendResult;
|
|
2482
|
-
this.
|
|
2483
|
-
suspendResult = decodeBlob(ARGUMENT, this.
|
|
2482
|
+
this.state_1 = 3;
|
|
2483
|
+
suspendResult = decodeBlob(ARGUMENT, this.url_1, this);
|
|
2484
2484
|
if (suspendResult === get_COROUTINE_SUSPENDED()) {
|
|
2485
2485
|
return suspendResult;
|
|
2486
2486
|
}
|
|
@@ -2489,32 +2489,32 @@
|
|
|
2489
2489
|
case 3:
|
|
2490
2490
|
return suspendResult;
|
|
2491
2491
|
case 4:
|
|
2492
|
-
throw this.
|
|
2492
|
+
throw this.exception_1;
|
|
2493
2493
|
}
|
|
2494
2494
|
} catch ($p) {
|
|
2495
2495
|
var e = $p;
|
|
2496
|
-
if (this.
|
|
2496
|
+
if (this.exceptionState_1 === 4) {
|
|
2497
2497
|
throw e;
|
|
2498
2498
|
} else {
|
|
2499
|
-
this.
|
|
2500
|
-
this.
|
|
2499
|
+
this.state_1 = this.exceptionState_1;
|
|
2500
|
+
this.exception_1 = e;
|
|
2501
2501
|
}
|
|
2502
2502
|
}
|
|
2503
2503
|
while (true);
|
|
2504
2504
|
};
|
|
2505
2505
|
function $decodeWebpNodeCOROUTINE$(buffer, resultContinuation) {
|
|
2506
2506
|
CoroutineImpl.call(this, resultContinuation);
|
|
2507
|
-
this.
|
|
2507
|
+
this.buffer_1 = buffer;
|
|
2508
2508
|
}
|
|
2509
|
-
protoOf($decodeWebpNodeCOROUTINE$).
|
|
2510
|
-
var suspendResult = this.
|
|
2509
|
+
protoOf($decodeWebpNodeCOROUTINE$).doResume_5yljmg_k$ = function () {
|
|
2510
|
+
var suspendResult = this.result_1;
|
|
2511
2511
|
$sm: do
|
|
2512
2512
|
try {
|
|
2513
|
-
var tmp = this.
|
|
2513
|
+
var tmp = this.state_1;
|
|
2514
2514
|
switch (tmp) {
|
|
2515
2515
|
case 0:
|
|
2516
|
-
this.
|
|
2517
|
-
this.
|
|
2516
|
+
this.exceptionState_1 = 3;
|
|
2517
|
+
this.state_1 = 1;
|
|
2518
2518
|
suspendResult = await_0(get_nodeWebpDecoderPromise(), this);
|
|
2519
2519
|
if (suspendResult === get_COROUTINE_SUSPENDED()) {
|
|
2520
2520
|
return suspendResult;
|
|
@@ -2523,8 +2523,8 @@
|
|
|
2523
2523
|
continue $sm;
|
|
2524
2524
|
case 1:
|
|
2525
2525
|
var decode = suspendResult;
|
|
2526
|
-
var resultPromise = decode(this.
|
|
2527
|
-
this.
|
|
2526
|
+
var resultPromise = decode(this.buffer_1);
|
|
2527
|
+
this.state_1 = 2;
|
|
2528
2528
|
suspendResult = await_0(resultPromise, this);
|
|
2529
2529
|
if (suspendResult === get_COROUTINE_SUSPENDED()) {
|
|
2530
2530
|
return suspendResult;
|
|
@@ -2534,52 +2534,52 @@
|
|
|
2534
2534
|
case 2:
|
|
2535
2535
|
return suspendResult;
|
|
2536
2536
|
case 3:
|
|
2537
|
-
throw this.
|
|
2537
|
+
throw this.exception_1;
|
|
2538
2538
|
}
|
|
2539
2539
|
} catch ($p) {
|
|
2540
2540
|
var e = $p;
|
|
2541
|
-
if (this.
|
|
2541
|
+
if (this.exceptionState_1 === 3) {
|
|
2542
2542
|
throw e;
|
|
2543
2543
|
} else {
|
|
2544
|
-
this.
|
|
2545
|
-
this.
|
|
2544
|
+
this.state_1 = this.exceptionState_1;
|
|
2545
|
+
this.exception_1 = e;
|
|
2546
2546
|
}
|
|
2547
2547
|
}
|
|
2548
2548
|
while (true);
|
|
2549
2549
|
};
|
|
2550
2550
|
function $decodeBlobCOROUTINE$(blob, sourceUrl, resultContinuation) {
|
|
2551
2551
|
CoroutineImpl.call(this, resultContinuation);
|
|
2552
|
-
this.
|
|
2553
|
-
this.
|
|
2552
|
+
this.blob_1 = blob;
|
|
2553
|
+
this.sourceUrl_1 = sourceUrl;
|
|
2554
2554
|
}
|
|
2555
|
-
protoOf($decodeBlobCOROUTINE$).
|
|
2556
|
-
var suspendResult = this.
|
|
2555
|
+
protoOf($decodeBlobCOROUTINE$).doResume_5yljmg_k$ = function () {
|
|
2556
|
+
var suspendResult = this.result_1;
|
|
2557
2557
|
$sm: do
|
|
2558
2558
|
try {
|
|
2559
|
-
var tmp = this.
|
|
2559
|
+
var tmp = this.state_1;
|
|
2560
2560
|
switch (tmp) {
|
|
2561
2561
|
case 0:
|
|
2562
|
-
this.
|
|
2563
|
-
this.
|
|
2564
|
-
this.
|
|
2565
|
-
suspendResult = await_0(window.createImageBitmap(this.
|
|
2562
|
+
this.exceptionState_1 = 3;
|
|
2563
|
+
this.exceptionState_1 = 2;
|
|
2564
|
+
this.state_1 = 1;
|
|
2565
|
+
suspendResult = await_0(window.createImageBitmap(this.blob_1), this);
|
|
2566
2566
|
if (suspendResult === get_COROUTINE_SUSPENDED()) {
|
|
2567
2567
|
return suspendResult;
|
|
2568
2568
|
}
|
|
2569
2569
|
|
|
2570
2570
|
continue $sm;
|
|
2571
2571
|
case 1:
|
|
2572
|
-
this.
|
|
2573
|
-
this.
|
|
2574
|
-
this.
|
|
2572
|
+
this.TRY_RESULT0__1 = suspendResult;
|
|
2573
|
+
this.exceptionState_1 = 3;
|
|
2574
|
+
this.state_1 = 4;
|
|
2575
2575
|
continue $sm;
|
|
2576
2576
|
case 2:
|
|
2577
|
-
this.
|
|
2578
|
-
var tmp_0 = this.
|
|
2577
|
+
this.exceptionState_1 = 3;
|
|
2578
|
+
var tmp_0 = this.exception_1;
|
|
2579
2579
|
if (tmp_0 instanceof Error) {
|
|
2580
|
-
var e = this.
|
|
2580
|
+
var e = this.exception_1;
|
|
2581
2581
|
var tmp_1 = this;
|
|
2582
|
-
var this_0 = this.
|
|
2582
|
+
var this_0 = this.sourceUrl_1;
|
|
2583
2583
|
var tmp_2;
|
|
2584
2584
|
if (charSequenceLength(this_0) === 0) {
|
|
2585
2585
|
tmp_2 = '<unnamed bytes>';
|
|
@@ -2589,14 +2589,14 @@
|
|
|
2589
2589
|
var message = 'Cannot decode tile at ' + tmp_2 + ': ' + e.message;
|
|
2590
2590
|
throw IllegalStateException_init_$Create$_0(toString(message));
|
|
2591
2591
|
} else {
|
|
2592
|
-
throw this.
|
|
2592
|
+
throw this.exception_1;
|
|
2593
2593
|
}
|
|
2594
2594
|
|
|
2595
2595
|
case 3:
|
|
2596
|
-
throw this.
|
|
2596
|
+
throw this.exception_1;
|
|
2597
2597
|
case 4:
|
|
2598
|
-
this.
|
|
2599
|
-
var bitmap = this.
|
|
2598
|
+
this.exceptionState_1 = 3;
|
|
2599
|
+
var bitmap = this.TRY_RESULT0__1;
|
|
2600
2600
|
l$ret$3: do {
|
|
2601
2601
|
var tmp$ret$0;
|
|
2602
2602
|
l$ret$1: do {
|
|
@@ -2633,11 +2633,11 @@
|
|
|
2633
2633
|
}
|
|
2634
2634
|
} catch ($p_0) {
|
|
2635
2635
|
var e_0 = $p_0;
|
|
2636
|
-
if (this.
|
|
2636
|
+
if (this.exceptionState_1 === 3) {
|
|
2637
2637
|
throw e_0;
|
|
2638
2638
|
} else {
|
|
2639
|
-
this.
|
|
2640
|
-
this.
|
|
2639
|
+
this.state_1 = this.exceptionState_1;
|
|
2640
|
+
this.exception_1 = e_0;
|
|
2641
2641
|
}
|
|
2642
2642
|
}
|
|
2643
2643
|
while (true);
|
|
@@ -2654,7 +2654,7 @@
|
|
|
2654
2654
|
function fetchAndDecodeTile$ref_1() {
|
|
2655
2655
|
var i = new fetchAndDecodeTile$ref();
|
|
2656
2656
|
return constructCallableReference(function (p0, $completion) {
|
|
2657
|
-
return i.
|
|
2657
|
+
return i.invoke_fa3hvc_k$(p0, $completion);
|
|
2658
2658
|
}, 1, 1, 2, 'fetchAndDecodeTile');
|
|
2659
2659
|
}
|
|
2660
2660
|
//region block: init
|