@pggis/pg-sdk 3.3.10 → 4.3.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (163) hide show
  1. package/README.md +8 -8
  2. package/dist/index.js +1966 -4
  3. package/dist/pggis.min.css +1 -1
  4. package/dist/pggis.min.js +10980 -7539
  5. package/dist/resources/ThirdParty/Workers/pako_deflate.min.js +1 -2
  6. package/dist/resources/ThirdParty/Workers/pako_inflate.min.js +1 -2
  7. package/dist/resources/ThirdParty/Workers/z-worker-pako.js +1 -1
  8. package/dist/resources/ThirdParty/google-earth-dbroot-parser.js +1 -8337
  9. package/dist/resources/ThirdParty/wasm_splats_bg.wasm +0 -0
  10. package/dist/resources/Workers/chunk-35SHYARM.js +26 -0
  11. package/dist/resources/Workers/chunk-37F5JSTI.js +26 -0
  12. package/dist/resources/Workers/chunk-3SSKC3VN.js +26 -0
  13. package/dist/resources/Workers/chunk-3W4GT7KQ.js +26 -0
  14. package/dist/resources/Workers/chunk-4IW2T6GF.js +26 -0
  15. package/dist/resources/Workers/chunk-5YEWO3HT.js +26 -0
  16. package/dist/resources/Workers/chunk-64RSHJUE.js +28 -0
  17. package/dist/resources/Workers/chunk-77IHZJJ3.js +26 -0
  18. package/dist/resources/Workers/chunk-7HTKERZY.js +26 -0
  19. package/dist/resources/Workers/{chunk-F3YA3Y2Z.js → chunk-A56XVLQR.js} +2 -13
  20. package/dist/resources/Workers/chunk-AJYK4IVJ.js +26 -0
  21. package/dist/resources/Workers/{chunk-EHWHNOEX.js → chunk-ARG42DC4.js} +2 -31
  22. package/dist/resources/Workers/chunk-AU7IKHOH.js +26 -0
  23. package/dist/resources/Workers/chunk-B4AA3ARO.js +26 -0
  24. package/dist/resources/Workers/chunk-CNCV5UL7.js +26 -0
  25. package/dist/resources/Workers/chunk-CYCB63OH.js +26 -0
  26. package/dist/resources/Workers/{chunk-4H7PY4U5.js → chunk-D6AA5QVT.js} +2 -20
  27. package/dist/resources/Workers/chunk-D6C66QON.js +26 -0
  28. package/dist/resources/Workers/chunk-DEPHB2WM.js +26 -0
  29. package/dist/resources/Workers/chunk-DMEY62ID.js +26 -0
  30. package/dist/resources/Workers/chunk-DQQ63PYM.js +26 -0
  31. package/dist/resources/Workers/chunk-ED5JPB3S.js +27 -0
  32. package/dist/resources/Workers/chunk-EZUYS2JF.js +26 -0
  33. package/dist/resources/Workers/chunk-FEVXJ54I.js +26 -0
  34. package/dist/resources/Workers/chunk-G5AGHVVC.js +26 -0
  35. package/dist/resources/Workers/{chunk-BBWDMCVU.js → chunk-GBYLG25F.js} +2 -15
  36. package/dist/resources/Workers/chunk-GILIDQNQ.js +26 -0
  37. package/dist/resources/Workers/chunk-HMIYSTF6.js +26 -0
  38. package/dist/resources/Workers/chunk-HTFSEEMT.js +26 -0
  39. package/dist/resources/Workers/chunk-HWXX4CWK.js +26 -0
  40. package/dist/resources/Workers/chunk-IYTZ52EY.js +26 -0
  41. package/dist/resources/Workers/chunk-J6UP6FLE.js +26 -0
  42. package/dist/resources/Workers/chunk-LEYMRMBK.js +27 -0
  43. package/dist/resources/Workers/chunk-M3MGYQSL.js +26 -0
  44. package/dist/resources/Workers/chunk-N4VJKXZS.js +26 -0
  45. package/dist/resources/Workers/chunk-NB3ML6JO.js +26 -0
  46. package/dist/resources/Workers/chunk-OFUUQVMR.js +26 -0
  47. package/dist/resources/Workers/chunk-OSW76XDF.js +26 -0
  48. package/dist/resources/Workers/chunk-PSPPBZWI.js +66 -0
  49. package/dist/resources/Workers/chunk-QN3VOORQ.js +26 -0
  50. package/dist/resources/Workers/chunk-QOUAJ6TL.js +26 -0
  51. package/dist/resources/Workers/chunk-RCV6KWXS.js +26 -0
  52. package/dist/resources/Workers/chunk-TCGIRNHN.js +26 -0
  53. package/dist/resources/Workers/chunk-U4IEOH5K.js +26 -0
  54. package/dist/resources/Workers/chunk-UP6I5URU.js +26 -0
  55. package/dist/resources/Workers/chunk-VTAIKJXX.js +26 -0
  56. package/dist/resources/Workers/chunk-VTBDSFTG.js +26 -0
  57. package/dist/resources/Workers/chunk-VW6VD53G.js +26 -0
  58. package/dist/resources/Workers/chunk-WGGIH7QW.js +26 -0
  59. package/dist/resources/Workers/chunk-WWA5PL4H.js +26 -0
  60. package/dist/resources/Workers/chunk-WZDE3RYP.js +28 -0
  61. package/dist/resources/Workers/chunk-XRL4AVS5.js +26 -0
  62. package/dist/resources/Workers/combineGeometry.js +2 -44
  63. package/dist/resources/Workers/createBoxGeometry.js +2 -34
  64. package/dist/resources/Workers/createBoxOutlineGeometry.js +2 -211
  65. package/dist/resources/Workers/createCircleGeometry.js +2 -173
  66. package/dist/resources/Workers/createCircleOutlineGeometry.js +2 -123
  67. package/dist/resources/Workers/createCoplanarPolygonGeometry.js +2 -482
  68. package/dist/resources/Workers/createCoplanarPolygonOutlineGeometry.js +2 -201
  69. package/dist/resources/Workers/createCorridorGeometry.js +2 -1239
  70. package/dist/resources/Workers/createCorridorOutlineGeometry.js +2 -544
  71. package/dist/resources/Workers/createCylinderGeometry.js +2 -36
  72. package/dist/resources/Workers/createCylinderOutlineGeometry.js +2 -207
  73. package/dist/resources/Workers/createEllipseGeometry.js +2 -47
  74. package/dist/resources/Workers/createEllipseOutlineGeometry.js +2 -40
  75. package/dist/resources/Workers/createEllipsoidGeometry.js +2 -35
  76. package/dist/resources/Workers/createEllipsoidOutlineGeometry.js +2 -37
  77. package/dist/resources/Workers/createFrustumGeometry.js +2 -34
  78. package/dist/resources/Workers/createFrustumOutlineGeometry.js +2 -211
  79. package/dist/resources/Workers/createGeometry.js +2 -147
  80. package/dist/resources/Workers/createGroundPolylineGeometry.js +2 -1584
  81. package/dist/resources/Workers/createPlaneGeometry.js +2 -200
  82. package/dist/resources/Workers/createPlaneOutlineGeometry.js +2 -100
  83. package/dist/resources/Workers/createPolygonGeometry.js +2 -1387
  84. package/dist/resources/Workers/createPolygonOutlineGeometry.js +2 -519
  85. package/dist/resources/Workers/createPolylineGeometry.js +2 -472
  86. package/dist/resources/Workers/createPolylineVolumeGeometry.js +2 -355
  87. package/dist/resources/Workers/createPolylineVolumeOutlineGeometry.js +2 -253
  88. package/dist/resources/Workers/createRectangleGeometry.js +2 -1250
  89. package/dist/resources/Workers/createRectangleOutlineGeometry.js +2 -455
  90. package/dist/resources/Workers/createSimplePolylineGeometry.js +2 -376
  91. package/dist/resources/Workers/createSphereGeometry.js +2 -94
  92. package/dist/resources/Workers/createSphereOutlineGeometry.js +2 -94
  93. package/dist/resources/Workers/createTaskProcessorWorker.js +2 -8
  94. package/dist/resources/Workers/createVectorTileClampedPolylines.js +2 -468
  95. package/dist/resources/Workers/createVectorTileGeometries.js +2 -363
  96. package/dist/resources/Workers/createVectorTilePoints.js +2 -88
  97. package/dist/resources/Workers/createVectorTilePolygons.js +2 -361
  98. package/dist/resources/Workers/createVectorTilePolylines.js +2 -238
  99. package/dist/resources/Workers/createVerticesFromGoogleEarthEnterpriseBuffer.js +2 -545
  100. package/dist/resources/Workers/createVerticesFromHeightmap.js +2 -2254
  101. package/dist/resources/Workers/createVerticesFromQuantizedTerrainMesh.js +2 -722
  102. package/dist/resources/Workers/createWallGeometry.js +2 -466
  103. package/dist/resources/Workers/createWallOutlineGeometry.js +2 -314
  104. package/dist/resources/Workers/decodeDraco.js +2 -345
  105. package/dist/resources/Workers/decodeGoogleEarthEnterprisePacket.js +2 -2626
  106. package/dist/resources/Workers/decodeI3S.js +2 -1320
  107. package/dist/resources/Workers/gaussianSplatSorter.js +26 -0
  108. package/dist/resources/Workers/gaussianSplatTextureGenerator.js +26 -0
  109. package/dist/resources/Workers/transcodeKTX2.js +29 -3398
  110. package/dist/resources/Workers/transferTypedArrayTest.js +2 -17
  111. package/dist/resources/Workers/upsampleQuantizedTerrainMesh.js +2 -795
  112. package/package.json +9 -8
  113. package/dist/resources/ThirdParty/Workers/basis_transcoder.js +0 -21
  114. package/dist/resources/Workers/chunk-23UFSGND.js +0 -236
  115. package/dist/resources/Workers/chunk-2A75IWRS.js +0 -218
  116. package/dist/resources/Workers/chunk-2FRVPMCS.js +0 -1258
  117. package/dist/resources/Workers/chunk-2FWRMUTY.js +0 -138
  118. package/dist/resources/Workers/chunk-2UPKWTMJ.js +0 -117
  119. package/dist/resources/Workers/chunk-34FXV7D7.js +0 -73
  120. package/dist/resources/Workers/chunk-3VAZEH7M.js +0 -101
  121. package/dist/resources/Workers/chunk-4DO5W5XZ.js +0 -196
  122. package/dist/resources/Workers/chunk-5QULIR53.js +0 -501
  123. package/dist/resources/Workers/chunk-7TC63SJW.js +0 -302
  124. package/dist/resources/Workers/chunk-7ZFGPDJA.js +0 -122
  125. package/dist/resources/Workers/chunk-A5DWLWCY.js +0 -834
  126. package/dist/resources/Workers/chunk-BG4UCVXN.js +0 -73
  127. package/dist/resources/Workers/chunk-BIKA3NRA.js +0 -59
  128. package/dist/resources/Workers/chunk-BROJAZRZ.js +0 -390
  129. package/dist/resources/Workers/chunk-DDUQAJ4P.js +0 -476
  130. package/dist/resources/Workers/chunk-EERJKOAF.js +0 -305
  131. package/dist/resources/Workers/chunk-EG6PTBY2.js +0 -2716
  132. package/dist/resources/Workers/chunk-F4HFJMGM.js +0 -353
  133. package/dist/resources/Workers/chunk-FJKNFAKQ.js +0 -8219
  134. package/dist/resources/Workers/chunk-FNIRWHJB.js +0 -289
  135. package/dist/resources/Workers/chunk-FZRIVR7Y.js +0 -100
  136. package/dist/resources/Workers/chunk-G43QFN4Q.js +0 -157
  137. package/dist/resources/Workers/chunk-GATZHF3K.js +0 -1860
  138. package/dist/resources/Workers/chunk-GRC2ZTAF.js +0 -398
  139. package/dist/resources/Workers/chunk-HU6N6EXB.js +0 -767
  140. package/dist/resources/Workers/chunk-I46ZRR5W.js +0 -1052
  141. package/dist/resources/Workers/chunk-JURN7NPV.js +0 -1075
  142. package/dist/resources/Workers/chunk-KKCR2YOP.js +0 -421
  143. package/dist/resources/Workers/chunk-LPR3YNP2.js +0 -138
  144. package/dist/resources/Workers/chunk-M7ERACJJ.js +0 -511
  145. package/dist/resources/Workers/chunk-MDWEGWPA.js +0 -1007
  146. package/dist/resources/Workers/chunk-OGXZVPPM.js +0 -2365
  147. package/dist/resources/Workers/chunk-PGSJK77E.js +0 -634
  148. package/dist/resources/Workers/chunk-PPH7OFP3.js +0 -258
  149. package/dist/resources/Workers/chunk-SH5USDPI.js +0 -456
  150. package/dist/resources/Workers/chunk-SOWMRMWA.js +0 -629
  151. package/dist/resources/Workers/chunk-STW2DGFI.js +0 -58
  152. package/dist/resources/Workers/chunk-T3XIFPYR.js +0 -1477
  153. package/dist/resources/Workers/chunk-TTUZP4BO.js +0 -501
  154. package/dist/resources/Workers/chunk-UEXTBDBE.js +0 -693
  155. package/dist/resources/Workers/chunk-VOXYEYJT.js +0 -684
  156. package/dist/resources/Workers/chunk-X4356LRH.js +0 -368
  157. package/dist/resources/Workers/chunk-XGI5BXZY.js +0 -163
  158. package/dist/resources/Workers/chunk-Y2ME2IJV.js +0 -781
  159. package/dist/resources/Workers/chunk-Y5UQJLYE.js +0 -171
  160. package/dist/resources/Workers/chunk-YJEBABKH.js +0 -2977
  161. package/dist/resources/Workers/chunk-YWTJ2B4B.js +0 -77
  162. package/dist/resources/Workers/chunk-Z3TIFFGF.js +0 -430
  163. package/dist/resources/Workers/chunk-ZT7KWISZ.js +0 -102
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * @license
3
3
  * Cesium - https://github.com/CesiumGS/cesium
4
- * Version 1.115
4
+ * Version 1.132
5
5
  *
6
6
  * Copyright 2011-2022 Cesium Contributors
7
7
  *
@@ -23,316 +23,4 @@
23
23
  * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details.
24
24
  */
25
25
 
26
- import {
27
- WallGeometryLibrary_default
28
- } from "./chunk-4DO5W5XZ.js";
29
- import "./chunk-KKCR2YOP.js";
30
- import "./chunk-F4HFJMGM.js";
31
- import "./chunk-FZRIVR7Y.js";
32
- import "./chunk-SH5USDPI.js";
33
- import "./chunk-2FRVPMCS.js";
34
- import "./chunk-Y5UQJLYE.js";
35
- import {
36
- IndexDatatype_default
37
- } from "./chunk-LPR3YNP2.js";
38
- import {
39
- GeometryAttributes_default
40
- } from "./chunk-4H7PY4U5.js";
41
- import {
42
- GeometryAttribute_default,
43
- Geometry_default,
44
- PrimitiveType_default
45
- } from "./chunk-7TC63SJW.js";
46
- import {
47
- BoundingSphere_default
48
- } from "./chunk-FJKNFAKQ.js";
49
- import "./chunk-TTUZP4BO.js";
50
- import "./chunk-BG4UCVXN.js";
51
- import "./chunk-YJEBABKH.js";
52
- import {
53
- ComponentDatatype_default
54
- } from "./chunk-PPH7OFP3.js";
55
- import {
56
- Cartesian3_default,
57
- Ellipsoid_default
58
- } from "./chunk-OGXZVPPM.js";
59
- import {
60
- Math_default
61
- } from "./chunk-5QULIR53.js";
62
- import "./chunk-SOWMRMWA.js";
63
- import "./chunk-STW2DGFI.js";
64
- import {
65
- defaultValue_default
66
- } from "./chunk-BBWDMCVU.js";
67
- import {
68
- DeveloperError_default
69
- } from "./chunk-XGI5BXZY.js";
70
- import {
71
- defined_default
72
- } from "./chunk-YWTJ2B4B.js";
73
-
74
- // packages/engine/Source/Core/WallOutlineGeometry.js
75
- var scratchCartesian3Position1 = new Cartesian3_default();
76
- var scratchCartesian3Position2 = new Cartesian3_default();
77
- function WallOutlineGeometry(options) {
78
- options = defaultValue_default(options, defaultValue_default.EMPTY_OBJECT);
79
- const wallPositions = options.positions;
80
- const maximumHeights = options.maximumHeights;
81
- const minimumHeights = options.minimumHeights;
82
- if (!defined_default(wallPositions)) {
83
- throw new DeveloperError_default("options.positions is required.");
84
- }
85
- if (defined_default(maximumHeights) && maximumHeights.length !== wallPositions.length) {
86
- throw new DeveloperError_default(
87
- "options.positions and options.maximumHeights must have the same length."
88
- );
89
- }
90
- if (defined_default(minimumHeights) && minimumHeights.length !== wallPositions.length) {
91
- throw new DeveloperError_default(
92
- "options.positions and options.minimumHeights must have the same length."
93
- );
94
- }
95
- const granularity = defaultValue_default(
96
- options.granularity,
97
- Math_default.RADIANS_PER_DEGREE
98
- );
99
- const ellipsoid = defaultValue_default(options.ellipsoid, Ellipsoid_default.WGS84);
100
- this._positions = wallPositions;
101
- this._minimumHeights = minimumHeights;
102
- this._maximumHeights = maximumHeights;
103
- this._granularity = granularity;
104
- this._ellipsoid = Ellipsoid_default.clone(ellipsoid);
105
- this._workerName = "createWallOutlineGeometry";
106
- let numComponents = 1 + wallPositions.length * Cartesian3_default.packedLength + 2;
107
- if (defined_default(minimumHeights)) {
108
- numComponents += minimumHeights.length;
109
- }
110
- if (defined_default(maximumHeights)) {
111
- numComponents += maximumHeights.length;
112
- }
113
- this.packedLength = numComponents + Ellipsoid_default.packedLength + 1;
114
- }
115
- WallOutlineGeometry.pack = function(value, array, startingIndex) {
116
- if (!defined_default(value)) {
117
- throw new DeveloperError_default("value is required");
118
- }
119
- if (!defined_default(array)) {
120
- throw new DeveloperError_default("array is required");
121
- }
122
- startingIndex = defaultValue_default(startingIndex, 0);
123
- let i;
124
- const positions = value._positions;
125
- let length = positions.length;
126
- array[startingIndex++] = length;
127
- for (i = 0; i < length; ++i, startingIndex += Cartesian3_default.packedLength) {
128
- Cartesian3_default.pack(positions[i], array, startingIndex);
129
- }
130
- const minimumHeights = value._minimumHeights;
131
- length = defined_default(minimumHeights) ? minimumHeights.length : 0;
132
- array[startingIndex++] = length;
133
- if (defined_default(minimumHeights)) {
134
- for (i = 0; i < length; ++i) {
135
- array[startingIndex++] = minimumHeights[i];
136
- }
137
- }
138
- const maximumHeights = value._maximumHeights;
139
- length = defined_default(maximumHeights) ? maximumHeights.length : 0;
140
- array[startingIndex++] = length;
141
- if (defined_default(maximumHeights)) {
142
- for (i = 0; i < length; ++i) {
143
- array[startingIndex++] = maximumHeights[i];
144
- }
145
- }
146
- Ellipsoid_default.pack(value._ellipsoid, array, startingIndex);
147
- startingIndex += Ellipsoid_default.packedLength;
148
- array[startingIndex] = value._granularity;
149
- return array;
150
- };
151
- var scratchEllipsoid = Ellipsoid_default.clone(Ellipsoid_default.UNIT_SPHERE);
152
- var scratchOptions = {
153
- positions: void 0,
154
- minimumHeights: void 0,
155
- maximumHeights: void 0,
156
- ellipsoid: scratchEllipsoid,
157
- granularity: void 0
158
- };
159
- WallOutlineGeometry.unpack = function(array, startingIndex, result) {
160
- if (!defined_default(array)) {
161
- throw new DeveloperError_default("array is required");
162
- }
163
- startingIndex = defaultValue_default(startingIndex, 0);
164
- let i;
165
- let length = array[startingIndex++];
166
- const positions = new Array(length);
167
- for (i = 0; i < length; ++i, startingIndex += Cartesian3_default.packedLength) {
168
- positions[i] = Cartesian3_default.unpack(array, startingIndex);
169
- }
170
- length = array[startingIndex++];
171
- let minimumHeights;
172
- if (length > 0) {
173
- minimumHeights = new Array(length);
174
- for (i = 0; i < length; ++i) {
175
- minimumHeights[i] = array[startingIndex++];
176
- }
177
- }
178
- length = array[startingIndex++];
179
- let maximumHeights;
180
- if (length > 0) {
181
- maximumHeights = new Array(length);
182
- for (i = 0; i < length; ++i) {
183
- maximumHeights[i] = array[startingIndex++];
184
- }
185
- }
186
- const ellipsoid = Ellipsoid_default.unpack(array, startingIndex, scratchEllipsoid);
187
- startingIndex += Ellipsoid_default.packedLength;
188
- const granularity = array[startingIndex];
189
- if (!defined_default(result)) {
190
- scratchOptions.positions = positions;
191
- scratchOptions.minimumHeights = minimumHeights;
192
- scratchOptions.maximumHeights = maximumHeights;
193
- scratchOptions.granularity = granularity;
194
- return new WallOutlineGeometry(scratchOptions);
195
- }
196
- result._positions = positions;
197
- result._minimumHeights = minimumHeights;
198
- result._maximumHeights = maximumHeights;
199
- result._ellipsoid = Ellipsoid_default.clone(ellipsoid, result._ellipsoid);
200
- result._granularity = granularity;
201
- return result;
202
- };
203
- WallOutlineGeometry.fromConstantHeights = function(options) {
204
- options = defaultValue_default(options, defaultValue_default.EMPTY_OBJECT);
205
- const positions = options.positions;
206
- if (!defined_default(positions)) {
207
- throw new DeveloperError_default("options.positions is required.");
208
- }
209
- let minHeights;
210
- let maxHeights;
211
- const min = options.minimumHeight;
212
- const max = options.maximumHeight;
213
- const doMin = defined_default(min);
214
- const doMax = defined_default(max);
215
- if (doMin || doMax) {
216
- const length = positions.length;
217
- minHeights = doMin ? new Array(length) : void 0;
218
- maxHeights = doMax ? new Array(length) : void 0;
219
- for (let i = 0; i < length; ++i) {
220
- if (doMin) {
221
- minHeights[i] = min;
222
- }
223
- if (doMax) {
224
- maxHeights[i] = max;
225
- }
226
- }
227
- }
228
- const newOptions = {
229
- positions,
230
- maximumHeights: maxHeights,
231
- minimumHeights: minHeights,
232
- ellipsoid: options.ellipsoid
233
- };
234
- return new WallOutlineGeometry(newOptions);
235
- };
236
- WallOutlineGeometry.createGeometry = function(wallGeometry) {
237
- const wallPositions = wallGeometry._positions;
238
- const minimumHeights = wallGeometry._minimumHeights;
239
- const maximumHeights = wallGeometry._maximumHeights;
240
- const granularity = wallGeometry._granularity;
241
- const ellipsoid = wallGeometry._ellipsoid;
242
- const pos = WallGeometryLibrary_default.computePositions(
243
- ellipsoid,
244
- wallPositions,
245
- maximumHeights,
246
- minimumHeights,
247
- granularity,
248
- false
249
- );
250
- if (!defined_default(pos)) {
251
- return;
252
- }
253
- const bottomPositions = pos.bottomPositions;
254
- const topPositions = pos.topPositions;
255
- let length = topPositions.length;
256
- let size = length * 2;
257
- const positions = new Float64Array(size);
258
- let positionIndex = 0;
259
- length /= 3;
260
- let i;
261
- for (i = 0; i < length; ++i) {
262
- const i3 = i * 3;
263
- const topPosition = Cartesian3_default.fromArray(
264
- topPositions,
265
- i3,
266
- scratchCartesian3Position1
267
- );
268
- const bottomPosition = Cartesian3_default.fromArray(
269
- bottomPositions,
270
- i3,
271
- scratchCartesian3Position2
272
- );
273
- positions[positionIndex++] = bottomPosition.x;
274
- positions[positionIndex++] = bottomPosition.y;
275
- positions[positionIndex++] = bottomPosition.z;
276
- positions[positionIndex++] = topPosition.x;
277
- positions[positionIndex++] = topPosition.y;
278
- positions[positionIndex++] = topPosition.z;
279
- }
280
- const attributes = new GeometryAttributes_default({
281
- position: new GeometryAttribute_default({
282
- componentDatatype: ComponentDatatype_default.DOUBLE,
283
- componentsPerAttribute: 3,
284
- values: positions
285
- })
286
- });
287
- const numVertices = size / 3;
288
- size = 2 * numVertices - 4 + numVertices;
289
- const indices = IndexDatatype_default.createTypedArray(numVertices, size);
290
- let edgeIndex = 0;
291
- for (i = 0; i < numVertices - 2; i += 2) {
292
- const LL = i;
293
- const LR = i + 2;
294
- const pl = Cartesian3_default.fromArray(
295
- positions,
296
- LL * 3,
297
- scratchCartesian3Position1
298
- );
299
- const pr = Cartesian3_default.fromArray(
300
- positions,
301
- LR * 3,
302
- scratchCartesian3Position2
303
- );
304
- if (Cartesian3_default.equalsEpsilon(pl, pr, Math_default.EPSILON10)) {
305
- continue;
306
- }
307
- const UL = i + 1;
308
- const UR = i + 3;
309
- indices[edgeIndex++] = UL;
310
- indices[edgeIndex++] = LL;
311
- indices[edgeIndex++] = UL;
312
- indices[edgeIndex++] = UR;
313
- indices[edgeIndex++] = LL;
314
- indices[edgeIndex++] = LR;
315
- }
316
- indices[edgeIndex++] = numVertices - 2;
317
- indices[edgeIndex++] = numVertices - 1;
318
- return new Geometry_default({
319
- attributes,
320
- indices,
321
- primitiveType: PrimitiveType_default.LINES,
322
- boundingSphere: new BoundingSphere_default.fromVertices(positions)
323
- });
324
- };
325
- var WallOutlineGeometry_default = WallOutlineGeometry;
326
-
327
- // packages/engine/Source/Workers/createWallOutlineGeometry.js
328
- function createWallOutlineGeometry(wallGeometry, offset) {
329
- if (defined_default(offset)) {
330
- wallGeometry = WallOutlineGeometry_default.unpack(wallGeometry, offset);
331
- }
332
- wallGeometry._ellipsoid = Ellipsoid_default.clone(wallGeometry._ellipsoid);
333
- return WallOutlineGeometry_default.createGeometry(wallGeometry);
334
- }
335
- var createWallOutlineGeometry_default = createWallOutlineGeometry;
336
- export {
337
- createWallOutlineGeometry_default as default
338
- };
26
+ import{a as z}from"./chunk-NB3ML6JO.js";import"./chunk-XRL4AVS5.js";import"./chunk-U4IEOH5K.js";import"./chunk-3W4GT7KQ.js";import"./chunk-G5AGHVVC.js";import"./chunk-DMEY62ID.js";import"./chunk-HTFSEEMT.js";import{a as W}from"./chunk-OFUUQVMR.js";import{a as N}from"./chunk-A56XVLQR.js";import{b as R,c as S,d as M}from"./chunk-RCV6KWXS.js";import{d as D}from"./chunk-4IW2T6GF.js";import"./chunk-PSPPBZWI.js";import{a as q}from"./chunk-AU7IKHOH.js";import{a as p,d as l,f as O}from"./chunk-64RSHJUE.js";import{a as b}from"./chunk-3SSKC3VN.js";import"./chunk-OSW76XDF.js";import"./chunk-ED5JPB3S.js";import{a as H}from"./chunk-LEYMRMBK.js";import{e as m}from"./chunk-VTAIKJXX.js";var B=new p,U=new p;function _(i){i=i??O.EMPTY_OBJECT;let t=i.positions,e=i.maximumHeights,o=i.minimumHeights;if(!m(t))throw new H("options.positions is required.");if(m(e)&&e.length!==t.length)throw new H("options.positions and options.maximumHeights must have the same length.");if(m(o)&&o.length!==t.length)throw new H("options.positions and options.minimumHeights must have the same length.");let s=i.granularity??b.RADIANS_PER_DEGREE,r=i.ellipsoid??l.default;this._positions=t,this._minimumHeights=o,this._maximumHeights=e,this._granularity=s,this._ellipsoid=l.clone(r),this._workerName="createWallOutlineGeometry";let n=1+t.length*p.packedLength+2;m(o)&&(n+=o.length),m(e)&&(n+=e.length),this.packedLength=n+l.packedLength+1}_.pack=function(i,t,e){if(!m(i))throw new H("value is required");if(!m(t))throw new H("array is required");e=e??0;let o,s=i._positions,r=s.length;for(t[e++]=r,o=0;o<r;++o,e+=p.packedLength)p.pack(s[o],t,e);let n=i._minimumHeights;if(r=m(n)?n.length:0,t[e++]=r,m(n))for(o=0;o<r;++o)t[e++]=n[o];let c=i._maximumHeights;if(r=m(c)?c.length:0,t[e++]=r,m(c))for(o=0;o<r;++o)t[e++]=c[o];return l.pack(i._ellipsoid,t,e),e+=l.packedLength,t[e]=i._granularity,t};var G=l.clone(l.UNIT_SPHERE),L={positions:void 0,minimumHeights:void 0,maximumHeights:void 0,ellipsoid:G,granularity:void 0};_.unpack=function(i,t,e){if(!m(i))throw new H("array is required");t=t??0;let o,s=i[t++],r=new Array(s);for(o=0;o<s;++o,t+=p.packedLength)r[o]=p.unpack(i,t);s=i[t++];let n;if(s>0)for(n=new Array(s),o=0;o<s;++o)n[o]=i[t++];s=i[t++];let c;if(s>0)for(c=new Array(s),o=0;o<s;++o)c[o]=i[t++];let w=l.unpack(i,t,G);t+=l.packedLength;let u=i[t];return m(e)?(e._positions=r,e._minimumHeights=n,e._maximumHeights=c,e._ellipsoid=l.clone(w,e._ellipsoid),e._granularity=u,e):(L.positions=r,L.minimumHeights=n,L.maximumHeights=c,L.granularity=u,new _(L))};_.fromConstantHeights=function(i){i=i??O.EMPTY_OBJECT;let t=i.positions;if(!m(t))throw new H("options.positions is required.");let e,o,s=i.minimumHeight,r=i.maximumHeight,n=m(s),c=m(r);if(n||c){let u=t.length;e=n?new Array(u):void 0,o=c?new Array(u):void 0;for(let g=0;g<u;++g)n&&(e[g]=s),c&&(o[g]=r)}let w={positions:t,maximumHeights:o,minimumHeights:e,ellipsoid:i.ellipsoid};return new _(w)};_.createGeometry=function(i){let t=i._positions,e=i._minimumHeights,o=i._maximumHeights,s=i._granularity,r=i._ellipsoid,n=z.computePositions(r,t,o,e,s,!1);if(!m(n))return;let c=n.bottomPositions,w=n.topPositions,u=w.length,g=u*2,f=new Float64Array(g),E=0;u/=3;let h;for(h=0;h<u;++h){let y=h*3,A=p.fromArray(w,y,B),k=p.fromArray(c,y,U);f[E++]=k.x,f[E++]=k.y,f[E++]=k.z,f[E++]=A.x,f[E++]=A.y,f[E++]=A.z}let v=new N({position:new M({componentDatatype:q.DOUBLE,componentsPerAttribute:3,values:f})}),P=g/3;g=2*P-4+P;let a=W.createTypedArray(P,g),d=0;for(h=0;h<P-2;h+=2){let y=h,A=h+2,k=p.fromArray(f,y*3,B),x=p.fromArray(f,A*3,U);if(p.equalsEpsilon(k,x,b.EPSILON10))continue;let T=h+1,F=h+3;a[d++]=T,a[d++]=y,a[d++]=T,a[d++]=F,a[d++]=y,a[d++]=A}return a[d++]=P-2,a[d++]=P-1,new S({attributes:v,indices:a,primitiveType:R.LINES,boundingSphere:new D.fromVertices(f)})};var C=_;function J(i,t){return m(t)&&(i=C.unpack(i,t)),i._ellipsoid=l.clone(i._ellipsoid),C.createGeometry(i)}var pi=J;export{pi as default};
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * @license
3
3
  * Cesium - https://github.com/CesiumGS/cesium
4
- * Version 1.115
4
+ * Version 1.132
5
5
  *
6
6
  * Copyright 2011-2022 Cesium Contributors
7
7
  *
@@ -23,347 +23,4 @@
23
23
  * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details.
24
24
  */
25
25
 
26
- import {
27
- require_draco_decoder_nodejs
28
- } from "./chunk-GATZHF3K.js";
29
- import {
30
- createTaskProcessorWorker_default
31
- } from "./chunk-3VAZEH7M.js";
32
- import {
33
- IndexDatatype_default
34
- } from "./chunk-LPR3YNP2.js";
35
- import {
36
- ComponentDatatype_default
37
- } from "./chunk-PPH7OFP3.js";
38
- import "./chunk-5QULIR53.js";
39
- import "./chunk-SOWMRMWA.js";
40
- import {
41
- RuntimeError_default
42
- } from "./chunk-STW2DGFI.js";
43
- import "./chunk-BBWDMCVU.js";
44
- import "./chunk-XGI5BXZY.js";
45
- import {
46
- __toESM,
47
- defined_default
48
- } from "./chunk-YWTJ2B4B.js";
49
-
50
- // packages/engine/Source/Workers/decodeDraco.js
51
- var import_draco_decoder_nodejs = __toESM(require_draco_decoder_nodejs(), 1);
52
- var draco;
53
- function decodeIndexArray(dracoGeometry, dracoDecoder) {
54
- const numPoints = dracoGeometry.num_points();
55
- const numFaces = dracoGeometry.num_faces();
56
- const faceIndices = new draco.DracoInt32Array();
57
- const numIndices = numFaces * 3;
58
- const indexArray = IndexDatatype_default.createTypedArray(numPoints, numIndices);
59
- let offset = 0;
60
- for (let i = 0; i < numFaces; ++i) {
61
- dracoDecoder.GetFaceFromMesh(dracoGeometry, i, faceIndices);
62
- indexArray[offset + 0] = faceIndices.GetValue(0);
63
- indexArray[offset + 1] = faceIndices.GetValue(1);
64
- indexArray[offset + 2] = faceIndices.GetValue(2);
65
- offset += 3;
66
- }
67
- draco.destroy(faceIndices);
68
- return {
69
- typedArray: indexArray,
70
- numberOfIndices: numIndices
71
- };
72
- }
73
- function decodeQuantizedDracoTypedArray(dracoGeometry, dracoDecoder, dracoAttribute, quantization, vertexArrayLength) {
74
- let vertexArray;
75
- let attributeData;
76
- if (quantization.quantizationBits <= 8) {
77
- attributeData = new draco.DracoUInt8Array();
78
- vertexArray = new Uint8Array(vertexArrayLength);
79
- dracoDecoder.GetAttributeUInt8ForAllPoints(
80
- dracoGeometry,
81
- dracoAttribute,
82
- attributeData
83
- );
84
- } else if (quantization.quantizationBits <= 16) {
85
- attributeData = new draco.DracoUInt16Array();
86
- vertexArray = new Uint16Array(vertexArrayLength);
87
- dracoDecoder.GetAttributeUInt16ForAllPoints(
88
- dracoGeometry,
89
- dracoAttribute,
90
- attributeData
91
- );
92
- } else {
93
- attributeData = new draco.DracoFloat32Array();
94
- vertexArray = new Float32Array(vertexArrayLength);
95
- dracoDecoder.GetAttributeFloatForAllPoints(
96
- dracoGeometry,
97
- dracoAttribute,
98
- attributeData
99
- );
100
- }
101
- for (let i = 0; i < vertexArrayLength; ++i) {
102
- vertexArray[i] = attributeData.GetValue(i);
103
- }
104
- draco.destroy(attributeData);
105
- return vertexArray;
106
- }
107
- function decodeDracoTypedArray(dracoGeometry, dracoDecoder, dracoAttribute, vertexArrayLength) {
108
- let vertexArray;
109
- let attributeData;
110
- switch (dracoAttribute.data_type()) {
111
- case 1:
112
- case 11:
113
- attributeData = new draco.DracoInt8Array();
114
- vertexArray = new Int8Array(vertexArrayLength);
115
- dracoDecoder.GetAttributeInt8ForAllPoints(
116
- dracoGeometry,
117
- dracoAttribute,
118
- attributeData
119
- );
120
- break;
121
- case 2:
122
- attributeData = new draco.DracoUInt8Array();
123
- vertexArray = new Uint8Array(vertexArrayLength);
124
- dracoDecoder.GetAttributeUInt8ForAllPoints(
125
- dracoGeometry,
126
- dracoAttribute,
127
- attributeData
128
- );
129
- break;
130
- case 3:
131
- attributeData = new draco.DracoInt16Array();
132
- vertexArray = new Int16Array(vertexArrayLength);
133
- dracoDecoder.GetAttributeInt16ForAllPoints(
134
- dracoGeometry,
135
- dracoAttribute,
136
- attributeData
137
- );
138
- break;
139
- case 4:
140
- attributeData = new draco.DracoUInt16Array();
141
- vertexArray = new Uint16Array(vertexArrayLength);
142
- dracoDecoder.GetAttributeUInt16ForAllPoints(
143
- dracoGeometry,
144
- dracoAttribute,
145
- attributeData
146
- );
147
- break;
148
- case 5:
149
- case 7:
150
- attributeData = new draco.DracoInt32Array();
151
- vertexArray = new Int32Array(vertexArrayLength);
152
- dracoDecoder.GetAttributeInt32ForAllPoints(
153
- dracoGeometry,
154
- dracoAttribute,
155
- attributeData
156
- );
157
- break;
158
- case 6:
159
- case 8:
160
- attributeData = new draco.DracoUInt32Array();
161
- vertexArray = new Uint32Array(vertexArrayLength);
162
- dracoDecoder.GetAttributeUInt32ForAllPoints(
163
- dracoGeometry,
164
- dracoAttribute,
165
- attributeData
166
- );
167
- break;
168
- case 9:
169
- case 10:
170
- attributeData = new draco.DracoFloat32Array();
171
- vertexArray = new Float32Array(vertexArrayLength);
172
- dracoDecoder.GetAttributeFloatForAllPoints(
173
- dracoGeometry,
174
- dracoAttribute,
175
- attributeData
176
- );
177
- break;
178
- }
179
- for (let i = 0; i < vertexArrayLength; ++i) {
180
- vertexArray[i] = attributeData.GetValue(i);
181
- }
182
- draco.destroy(attributeData);
183
- return vertexArray;
184
- }
185
- function decodeAttribute(dracoGeometry, dracoDecoder, dracoAttribute) {
186
- const numPoints = dracoGeometry.num_points();
187
- const numComponents = dracoAttribute.num_components();
188
- let quantization;
189
- let transform = new draco.AttributeQuantizationTransform();
190
- if (transform.InitFromAttribute(dracoAttribute)) {
191
- const minValues = new Array(numComponents);
192
- for (let i = 0; i < numComponents; ++i) {
193
- minValues[i] = transform.min_value(i);
194
- }
195
- quantization = {
196
- quantizationBits: transform.quantization_bits(),
197
- minValues,
198
- range: transform.range(),
199
- octEncoded: false
200
- };
201
- }
202
- draco.destroy(transform);
203
- transform = new draco.AttributeOctahedronTransform();
204
- if (transform.InitFromAttribute(dracoAttribute)) {
205
- quantization = {
206
- quantizationBits: transform.quantization_bits(),
207
- octEncoded: true
208
- };
209
- }
210
- draco.destroy(transform);
211
- const vertexArrayLength = numPoints * numComponents;
212
- let vertexArray;
213
- if (defined_default(quantization)) {
214
- vertexArray = decodeQuantizedDracoTypedArray(
215
- dracoGeometry,
216
- dracoDecoder,
217
- dracoAttribute,
218
- quantization,
219
- vertexArrayLength
220
- );
221
- } else {
222
- vertexArray = decodeDracoTypedArray(
223
- dracoGeometry,
224
- dracoDecoder,
225
- dracoAttribute,
226
- vertexArrayLength
227
- );
228
- }
229
- const componentDatatype = ComponentDatatype_default.fromTypedArray(vertexArray);
230
- return {
231
- array: vertexArray,
232
- data: {
233
- componentsPerAttribute: numComponents,
234
- componentDatatype,
235
- byteOffset: dracoAttribute.byte_offset(),
236
- byteStride: ComponentDatatype_default.getSizeInBytes(componentDatatype) * numComponents,
237
- normalized: dracoAttribute.normalized(),
238
- quantization
239
- }
240
- };
241
- }
242
- function decodePointCloud(parameters) {
243
- const dracoDecoder = new draco.Decoder();
244
- if (parameters.dequantizeInShader) {
245
- dracoDecoder.SkipAttributeTransform(draco.POSITION);
246
- dracoDecoder.SkipAttributeTransform(draco.NORMAL);
247
- }
248
- const buffer = new draco.DecoderBuffer();
249
- buffer.Init(parameters.buffer, parameters.buffer.length);
250
- const geometryType = dracoDecoder.GetEncodedGeometryType(buffer);
251
- if (geometryType !== draco.POINT_CLOUD) {
252
- throw new RuntimeError_default("Draco geometry type must be POINT_CLOUD.");
253
- }
254
- const dracoPointCloud = new draco.PointCloud();
255
- const decodingStatus = dracoDecoder.DecodeBufferToPointCloud(
256
- buffer,
257
- dracoPointCloud
258
- );
259
- if (!decodingStatus.ok() || dracoPointCloud.ptr === 0) {
260
- throw new RuntimeError_default(
261
- `Error decoding draco point cloud: ${decodingStatus.error_msg()}`
262
- );
263
- }
264
- draco.destroy(buffer);
265
- const result = {};
266
- const properties = parameters.properties;
267
- for (const propertyName in properties) {
268
- if (properties.hasOwnProperty(propertyName)) {
269
- let dracoAttribute;
270
- if (propertyName === "POSITION" || propertyName === "NORMAL") {
271
- const dracoAttributeId = dracoDecoder.GetAttributeId(
272
- dracoPointCloud,
273
- draco[propertyName]
274
- );
275
- dracoAttribute = dracoDecoder.GetAttribute(
276
- dracoPointCloud,
277
- dracoAttributeId
278
- );
279
- } else {
280
- const attributeId = properties[propertyName];
281
- dracoAttribute = dracoDecoder.GetAttributeByUniqueId(
282
- dracoPointCloud,
283
- attributeId
284
- );
285
- }
286
- result[propertyName] = decodeAttribute(
287
- dracoPointCloud,
288
- dracoDecoder,
289
- dracoAttribute
290
- );
291
- }
292
- }
293
- draco.destroy(dracoPointCloud);
294
- draco.destroy(dracoDecoder);
295
- return result;
296
- }
297
- function decodePrimitive(parameters) {
298
- const dracoDecoder = new draco.Decoder();
299
- const attributesToSkip = ["POSITION", "NORMAL", "COLOR", "TEX_COORD"];
300
- if (parameters.dequantizeInShader) {
301
- for (let i = 0; i < attributesToSkip.length; ++i) {
302
- dracoDecoder.SkipAttributeTransform(draco[attributesToSkip[i]]);
303
- }
304
- }
305
- const bufferView = parameters.bufferView;
306
- const buffer = new draco.DecoderBuffer();
307
- buffer.Init(parameters.array, bufferView.byteLength);
308
- const geometryType = dracoDecoder.GetEncodedGeometryType(buffer);
309
- if (geometryType !== draco.TRIANGULAR_MESH) {
310
- throw new RuntimeError_default("Unsupported draco mesh geometry type.");
311
- }
312
- const dracoGeometry = new draco.Mesh();
313
- const decodingStatus = dracoDecoder.DecodeBufferToMesh(buffer, dracoGeometry);
314
- if (!decodingStatus.ok() || dracoGeometry.ptr === 0) {
315
- throw new RuntimeError_default(
316
- `Error decoding draco mesh geometry: ${decodingStatus.error_msg()}`
317
- );
318
- }
319
- draco.destroy(buffer);
320
- const attributeData = {};
321
- const compressedAttributes = parameters.compressedAttributes;
322
- for (const attributeName in compressedAttributes) {
323
- if (compressedAttributes.hasOwnProperty(attributeName)) {
324
- const compressedAttribute = compressedAttributes[attributeName];
325
- const dracoAttribute = dracoDecoder.GetAttributeByUniqueId(
326
- dracoGeometry,
327
- compressedAttribute
328
- );
329
- attributeData[attributeName] = decodeAttribute(
330
- dracoGeometry,
331
- dracoDecoder,
332
- dracoAttribute
333
- );
334
- }
335
- }
336
- const result = {
337
- indexArray: decodeIndexArray(dracoGeometry, dracoDecoder),
338
- attributeData
339
- };
340
- draco.destroy(dracoGeometry);
341
- draco.destroy(dracoDecoder);
342
- return result;
343
- }
344
- async function decode(parameters, transferableObjects) {
345
- if (defined_default(parameters.bufferView)) {
346
- return decodePrimitive(parameters);
347
- }
348
- return decodePointCloud(parameters);
349
- }
350
- async function initWorker(parameters, transferableObjects) {
351
- const wasmConfig = parameters.webAssemblyConfig;
352
- if (defined_default(wasmConfig) && defined_default(wasmConfig.wasmBinaryFile)) {
353
- draco = await (0, import_draco_decoder_nodejs.default)(wasmConfig);
354
- } else {
355
- draco = await (0, import_draco_decoder_nodejs.default)();
356
- }
357
- return true;
358
- }
359
- async function decodeDraco(parameters, transferableObjects) {
360
- const wasmConfig = parameters.webAssemblyConfig;
361
- if (defined_default(wasmConfig)) {
362
- return initWorker(parameters, transferableObjects);
363
- }
364
- return decode(parameters, transferableObjects);
365
- }
366
- var decodeDraco_default = createTaskProcessorWorker_default(decodeDraco);
367
- export {
368
- decodeDraco_default as default
369
- };
26
+ import{a as D}from"./chunk-35SHYARM.js";import{a as I}from"./chunk-WZDE3RYP.js";import{a as m}from"./chunk-OFUUQVMR.js";import{a as w}from"./chunk-AU7IKHOH.js";import"./chunk-3SSKC3VN.js";import"./chunk-OSW76XDF.js";import{a as A}from"./chunk-ED5JPB3S.js";import"./chunk-LEYMRMBK.js";import{d as P,e as d}from"./chunk-VTAIKJXX.js";var b=P(D(),1),r;function F(t,n){let o=t.num_points(),a=t.num_faces(),i=new r.DracoInt32Array,e=a*3,s=m.createTypedArray(o,e),u=0;for(let f=0;f<a;++f)n.GetFaceFromMesh(t,f,i),s[u+0]=i.GetValue(0),s[u+1]=i.GetValue(1),s[u+2]=i.GetValue(2),u+=3;return r.destroy(i),{typedArray:s,numberOfIndices:e}}function U(t,n,o,a,i){let e,s;a.quantizationBits<=8?(s=new r.DracoUInt8Array,e=new Uint8Array(i),n.GetAttributeUInt8ForAllPoints(t,o,s)):a.quantizationBits<=16?(s=new r.DracoUInt16Array,e=new Uint16Array(i),n.GetAttributeUInt16ForAllPoints(t,o,s)):(s=new r.DracoFloat32Array,e=new Float32Array(i),n.GetAttributeFloatForAllPoints(t,o,s));for(let u=0;u<i;++u)e[u]=s.GetValue(u);return r.destroy(s),e}function k(t,n,o,a){let i,e;switch(o.data_type()){case 1:case 11:e=new r.DracoInt8Array,i=new Int8Array(a),n.GetAttributeInt8ForAllPoints(t,o,e);break;case 2:e=new r.DracoUInt8Array,i=new Uint8Array(a),n.GetAttributeUInt8ForAllPoints(t,o,e);break;case 3:e=new r.DracoInt16Array,i=new Int16Array(a),n.GetAttributeInt16ForAllPoints(t,o,e);break;case 4:e=new r.DracoUInt16Array,i=new Uint16Array(a),n.GetAttributeUInt16ForAllPoints(t,o,e);break;case 5:case 7:e=new r.DracoInt32Array,i=new Int32Array(a),n.GetAttributeInt32ForAllPoints(t,o,e);break;case 6:case 8:e=new r.DracoUInt32Array,i=new Uint32Array(a),n.GetAttributeUInt32ForAllPoints(t,o,e);break;case 9:case 10:e=new r.DracoFloat32Array,i=new Float32Array(a),n.GetAttributeFloatForAllPoints(t,o,e);break}for(let s=0;s<a;++s)i[s]=e.GetValue(s);return r.destroy(e),i}function p(t,n,o){let a=t.num_points(),i=o.num_components(),e,s=new r.AttributeQuantizationTransform;if(s.InitFromAttribute(o)){let c=new Array(i);for(let y=0;y<i;++y)c[y]=s.min_value(y);e={quantizationBits:s.quantization_bits(),minValues:c,range:s.range(),octEncoded:!1}}r.destroy(s),s=new r.AttributeOctahedronTransform,s.InitFromAttribute(o)&&(e={quantizationBits:s.quantization_bits(),octEncoded:!0}),r.destroy(s);let u=a*i,f;d(e)?f=U(t,n,o,e,u):f=k(t,n,o,u);let l=w.fromTypedArray(f);return{array:f,data:{componentsPerAttribute:i,componentDatatype:l,byteOffset:o.byte_offset(),byteStride:w.getSizeInBytes(l)*i,normalized:o.normalized(),quantization:e}}}function O(t){let n=new r.Decoder;t.dequantizeInShader&&(n.SkipAttributeTransform(r.POSITION),n.SkipAttributeTransform(r.NORMAL));let o=new r.DecoderBuffer;if(o.Init(t.buffer,t.buffer.length),n.GetEncodedGeometryType(o)!==r.POINT_CLOUD)throw new A("Draco geometry type must be POINT_CLOUD.");let i=new r.PointCloud,e=n.DecodeBufferToPointCloud(o,i);if(!e.ok()||i.ptr===0)throw new A(`Error decoding draco point cloud: ${e.error_msg()}`);r.destroy(o);let s={},u=t.properties;for(let f in u)if(u.hasOwnProperty(f)){let l;if(f==="POSITION"||f==="NORMAL"){let c=n.GetAttributeId(i,r[f]);l=n.GetAttribute(i,c)}else{let c=u[f];l=n.GetAttributeByUniqueId(i,c)}s[f]=p(i,n,l)}return r.destroy(i),r.destroy(n),s}function g(t){let n=new r.Decoder;if(t.dequantizeInShader)for(let c=0;c<t.attributesToSkipTransform.length;++c)n.SkipAttributeTransform(r[t.attributesToSkipTransform[c]]);let o=t.bufferView,a=new r.DecoderBuffer;if(a.Init(t.array,o.byteLength),n.GetEncodedGeometryType(a)!==r.TRIANGULAR_MESH)throw new A("Unsupported draco mesh geometry type.");let e=new r.Mesh,s=n.DecodeBufferToMesh(a,e);if(!s.ok()||e.ptr===0)throw new A(`Error decoding draco mesh geometry: ${s.error_msg()}`);r.destroy(a);let u={},f=t.compressedAttributes;for(let c in f)if(f.hasOwnProperty(c)){let y=f[c],T=n.GetAttributeByUniqueId(e,y);u[c]=p(e,n,T)}let l={indexArray:F(e,n),attributeData:u};return r.destroy(e),r.destroy(n),l}async function z(t,n){return d(t.bufferView)?g(t):O(t)}async function G(t,n){let o=t.webAssemblyConfig;return d(o)&&d(o.wasmBinaryFile)?r=await(0,b.default)(o):r=await(0,b.default)(),!0}async function S(t,n){let o=t.webAssemblyConfig;return d(o)?G(t,n):z(t,n)}var h=I(S);export{h as default};