@cesium/engine 6.2.0 → 8.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (268) hide show
  1. package/Build/ThirdParty/Workers/z-worker-pako.js +568 -407
  2. package/Build/Workers/{chunk-RH4N2ONY.js → chunk-23UFSGND.js} +7 -7
  3. package/Build/Workers/{chunk-HPP4JLNH.js → chunk-2A75IWRS.js} +7 -7
  4. package/Build/Workers/{chunk-5IRLXUTA.js → chunk-2FRVPMCS.js} +10 -10
  5. package/Build/Workers/{chunk-ZQRZBHYI.js → chunk-2FWRMUTY.js} +4 -4
  6. package/Build/Workers/{chunk-Z2SIPUKB.js → chunk-2UPKWTMJ.js} +6 -6
  7. package/Build/Workers/{chunk-434ZTTFX.js → chunk-34FXV7D7.js} +2 -2
  8. package/Build/Workers/{chunk-MW3CJYLX.js → chunk-3VAZEH7M.js} +2 -2
  9. package/Build/Workers/{chunk-HUPNRBWW.js → chunk-4DO5W5XZ.js} +6 -6
  10. package/Build/Workers/{chunk-PIXK6KHB.js → chunk-4H7PY4U5.js} +2 -2
  11. package/Build/Workers/{chunk-BP467WX3.js → chunk-5QULIR53.js} +4 -4
  12. package/Build/Workers/{chunk-R3HUGXBH.js → chunk-7TC63SJW.js} +8 -8
  13. package/Build/Workers/{chunk-SQVTYRZY.js → chunk-7ZFGPDJA.js} +4 -4
  14. package/Build/Workers/{chunk-TIXXVKUY.js → chunk-A5DWLWCY.js} +10 -10
  15. package/Build/Workers/{chunk-CWJQGBWT.js → chunk-BBWDMCVU.js} +1 -1
  16. package/Build/Workers/{chunk-4KP73B43.js → chunk-BG4UCVXN.js} +3 -3
  17. package/Build/Workers/{chunk-Y4OJ4B23.js → chunk-BIKA3NRA.js} +5 -5
  18. package/Build/Workers/{chunk-DR5XZ6K5.js → chunk-BROJAZRZ.js} +13 -13
  19. package/Build/Workers/{chunk-FWGNCYP6.js → chunk-DDUQAJ4P.js} +7 -7
  20. package/Build/Workers/{chunk-QRBRVGZC.js → chunk-EERJKOAF.js} +4 -4
  21. package/Build/Workers/{chunk-52VSIKEA.js → chunk-EG6PTBY2.js} +15 -15
  22. package/Build/Workers/{chunk-O43GWBSF.js → chunk-EHWHNOEX.js} +1 -1
  23. package/Build/Workers/{chunk-MN34FIF5.js → chunk-F3YA3Y2Z.js} +1 -1
  24. package/Build/Workers/{chunk-GF5TNNKP.js → chunk-F4HFJMGM.js} +6 -6
  25. package/Build/Workers/{chunk-HOT2SNXP.js → chunk-FJKNFAKQ.js} +133 -553
  26. package/Build/Workers/{chunk-TMPVBFJQ.js → chunk-FNIRWHJB.js} +10 -10
  27. package/Build/Workers/{chunk-DMCSY5BU.js → chunk-FZRIVR7Y.js} +5 -5
  28. package/Build/Workers/{chunk-Z4JUBRHP.js → chunk-G43QFN4Q.js} +6 -6
  29. package/Build/Workers/{chunk-HPH5HSFE.js → chunk-GATZHF3K.js} +2 -2
  30. package/Build/Workers/{chunk-CSIZ3BGT.js → chunk-GRC2ZTAF.js} +14 -14
  31. package/Build/Workers/{chunk-NE4JNU6H.js → chunk-HU6N6EXB.js} +10 -10
  32. package/Build/Workers/{chunk-GVL5I7TC.js → chunk-I46ZRR5W.js} +17 -17
  33. package/Build/Workers/{chunk-5GDBZTHX.js → chunk-JURN7NPV.js} +17 -17
  34. package/Build/Workers/{chunk-H5DUXHCV.js → chunk-KKCR2YOP.js} +11 -11
  35. package/Build/Workers/{chunk-LX6XV4DK.js → chunk-LPR3YNP2.js} +5 -5
  36. package/Build/Workers/{chunk-HFKSAB5K.js → chunk-M7ERACJJ.js} +13 -13
  37. package/Build/Workers/{chunk-BUZDZBUH.js → chunk-MDWEGWPA.js} +10 -10
  38. package/Build/Workers/{chunk-LGJUI2CE.js → chunk-OGXZVPPM.js} +9 -5
  39. package/Build/Workers/{chunk-PZ2WJWUG.js → chunk-PGSJK77E.js} +6 -6
  40. package/Build/Workers/{chunk-ARPTYYKS.js → chunk-PPH7OFP3.js} +5 -5
  41. package/Build/Workers/{chunk-R4OZKBXH.js → chunk-SH5USDPI.js} +6 -6
  42. package/Build/Workers/{chunk-SV7DDPAC.js → chunk-SOWMRMWA.js} +1 -1
  43. package/Build/Workers/{chunk-RIDPF7PO.js → chunk-STW2DGFI.js} +2 -2
  44. package/Build/Workers/{chunk-CDGHUKQ4.js → chunk-T3XIFPYR.js} +13 -13
  45. package/Build/Workers/chunk-TTUZP4BO.js +501 -0
  46. package/Build/Workers/{chunk-QTZQZY2C.js → chunk-UEXTBDBE.js} +34 -10
  47. package/Build/Workers/{chunk-XUTVA4K5.js → chunk-VOXYEYJT.js} +11 -11
  48. package/Build/Workers/{chunk-AXFRNOVC.js → chunk-X4356LRH.js} +12 -12
  49. package/Build/Workers/{chunk-5HLGKKG3.js → chunk-XGI5BXZY.js} +2 -2
  50. package/Build/Workers/{chunk-SNN7WOC2.js → chunk-Y2ME2IJV.js} +13 -13
  51. package/Build/Workers/{chunk-LGL4P5KL.js → chunk-Y5UQJLYE.js} +6 -6
  52. package/Build/Workers/{chunk-3PW6ZBN4.js → chunk-YJEBABKH.js} +7 -7
  53. package/Build/Workers/{chunk-YBKFS53K.js → chunk-YWTJ2B4B.js} +1 -1
  54. package/Build/Workers/{chunk-5SK36PU4.js → chunk-Z3TIFFGF.js} +7 -7
  55. package/Build/Workers/{chunk-JGG36SQV.js → chunk-ZT7KWISZ.js} +4 -4
  56. package/Build/Workers/combineGeometry.js +24 -23
  57. package/Build/Workers/createBoxGeometry.js +18 -17
  58. package/Build/Workers/createBoxOutlineGeometry.js +16 -15
  59. package/Build/Workers/createCircleGeometry.js +26 -25
  60. package/Build/Workers/createCircleOutlineGeometry.js +19 -18
  61. package/Build/Workers/createCoplanarPolygonGeometry.js +33 -32
  62. package/Build/Workers/createCoplanarPolygonOutlineGeometry.js +31 -30
  63. package/Build/Workers/createCorridorGeometry.js +29 -29
  64. package/Build/Workers/createCorridorOutlineGeometry.js +28 -28
  65. package/Build/Workers/createCylinderGeometry.js +20 -19
  66. package/Build/Workers/createCylinderOutlineGeometry.js +18 -17
  67. package/Build/Workers/createEllipseGeometry.js +26 -25
  68. package/Build/Workers/createEllipseOutlineGeometry.js +19 -18
  69. package/Build/Workers/createEllipsoidGeometry.js +19 -18
  70. package/Build/Workers/createEllipsoidOutlineGeometry.js +18 -17
  71. package/Build/Workers/createFrustumGeometry.js +18 -17
  72. package/Build/Workers/createFrustumOutlineGeometry.js +18 -17
  73. package/Build/Workers/createGeometry.js +54 -33
  74. package/Build/Workers/createGroundPolylineGeometry.js +22 -21
  75. package/Build/Workers/createPlaneGeometry.js +16 -15
  76. package/Build/Workers/createPlaneOutlineGeometry.js +15 -14
  77. package/Build/Workers/createPolygonGeometry.js +32 -166
  78. package/Build/Workers/createPolygonOutlineGeometry.js +30 -29
  79. package/Build/Workers/createPolylineGeometry.js +25 -24
  80. package/Build/Workers/createPolylineVolumeGeometry.js +32 -33
  81. package/Build/Workers/createPolylineVolumeOutlineGeometry.js +27 -27
  82. package/Build/Workers/createRectangleGeometry.js +27 -26
  83. package/Build/Workers/createRectangleOutlineGeometry.js +20 -19
  84. package/Build/Workers/createSimplePolylineGeometry.js +23 -22
  85. package/Build/Workers/createSphereGeometry.js +19 -18
  86. package/Build/Workers/createSphereOutlineGeometry.js +18 -17
  87. package/Build/Workers/createTaskProcessorWorker.js +3 -3
  88. package/Build/Workers/createVectorTileClampedPolylines.js +14 -14
  89. package/Build/Workers/createVectorTileGeometries.js +24 -23
  90. package/Build/Workers/createVectorTilePoints.js +12 -12
  91. package/Build/Workers/createVectorTilePolygons.js +22 -21
  92. package/Build/Workers/createVectorTilePolylines.js +14 -14
  93. package/Build/Workers/createVerticesFromGoogleEarthEnterpriseBuffer.js +22 -21
  94. package/Build/Workers/createVerticesFromHeightmap.js +22 -21
  95. package/Build/Workers/createVerticesFromQuantizedTerrainMesh.js +19 -18
  96. package/Build/Workers/createWallGeometry.js +24 -23
  97. package/Build/Workers/createWallOutlineGeometry.js +23 -22
  98. package/Build/Workers/decodeDraco.js +11 -11
  99. package/Build/Workers/decodeGoogleEarthEnterprisePacket.js +5 -5
  100. package/Build/Workers/decodeI3S.js +601 -92
  101. package/Build/Workers/transcodeKTX2.js +7 -7
  102. package/Build/Workers/transferTypedArrayTest.js +1 -1
  103. package/Build/Workers/upsampleQuantizedTerrainMesh.js +22 -21
  104. package/LICENSE.md +1 -1
  105. package/Source/Assets/approximateTerrainHeights.json +1 -1
  106. package/Source/Core/Ellipsoid.js +6 -0
  107. package/Source/Core/GregorianDate.js +85 -0
  108. package/Source/Core/HeadingPitchRange.js +2 -2
  109. package/Source/Core/IntersectionTests.js +6 -3
  110. package/Source/Core/Ion.js +1 -1
  111. package/Source/Core/PixelFormat.js +5 -0
  112. package/Source/Core/PolygonGeometry.js +0 -169
  113. package/Source/Core/Resource.js +30 -69
  114. package/Source/Core/Transforms.js +30 -18
  115. package/Source/Core/createWorldBathymetryAsync.js +45 -0
  116. package/Source/Core/srgbToLinear.js +32 -0
  117. package/Source/DataSources/CzmlDataSource.js +51 -23
  118. package/Source/DataSources/DataSourceDisplay.js +27 -0
  119. package/Source/DataSources/EllipsoidGeometryUpdater.js +3 -4
  120. package/Source/DataSources/Entity.js +28 -7
  121. package/Source/DataSources/EntityCollection.js +1 -2
  122. package/Source/DataSources/GeometryUpdater.js +1 -2
  123. package/Source/DataSources/GeometryUpdaterSet.js +114 -0
  124. package/Source/DataSources/GeometryVisualizer.js +19 -83
  125. package/Source/DataSources/GroundGeometryUpdater.js +6 -3
  126. package/Source/DataSources/ModelVisualizer.js +19 -98
  127. package/Source/DataSources/PolygonGeometryUpdater.js +14 -2
  128. package/Source/DataSources/PolylineGeometryUpdater.js +9 -8
  129. package/Source/DataSources/TerrainOffsetProperty.js +15 -23
  130. package/Source/Renderer/AutomaticUniforms.js +121 -1
  131. package/Source/Renderer/Context.js +10 -0
  132. package/Source/Renderer/ContextLimits.js +2 -0
  133. package/Source/Renderer/UniformState.js +127 -0
  134. package/Source/Renderer/demodernizeShader.js +4 -1
  135. package/Source/Scene/ArcGisMapService.js +1 -1
  136. package/Source/Scene/Atmosphere.js +127 -0
  137. package/Source/Scene/Axis.js +12 -7
  138. package/Source/Scene/Billboard.js +29 -26
  139. package/Source/Scene/BillboardCollection.js +3 -3
  140. package/Source/Scene/Camera.js +47 -5
  141. package/Source/Scene/Cesium3DTile.js +1 -0
  142. package/Source/Scene/Cesium3DTileContent.js +14 -0
  143. package/Source/Scene/Cesium3DTileset.js +364 -45
  144. package/Source/Scene/Cesium3DTilesetBaseTraversal.js +2 -4
  145. package/Source/Scene/Cesium3DTilesetTraversal.js +4 -0
  146. package/Source/Scene/Composite3DTileContent.js +42 -0
  147. package/Source/Scene/DynamicAtmosphereLightingType.js +56 -0
  148. package/Source/Scene/Empty3DTileContent.js +4 -0
  149. package/Source/Scene/Fog.js +1 -0
  150. package/Source/Scene/FrameState.js +14 -1
  151. package/Source/Scene/Geometry3DTileContent.js +4 -0
  152. package/Source/Scene/Globe.js +3 -2
  153. package/Source/Scene/GlobeSurfaceTileProvider.js +3 -1
  154. package/Source/Scene/GlobeTranslucencyState.js +1 -1
  155. package/Source/Scene/GltfLoader.js +15 -5
  156. package/Source/Scene/GltfPipeline/updateVersion.js +69 -68
  157. package/Source/Scene/HeightReference.js +59 -2
  158. package/Source/Scene/I3SDataProvider.js +270 -53
  159. package/Source/Scene/I3SDecoder.js +8 -1
  160. package/Source/Scene/I3SFeature.js +2 -5
  161. package/Source/Scene/I3SField.js +136 -31
  162. package/Source/Scene/I3SGeometry.js +70 -2
  163. package/Source/Scene/I3SLayer.js +55 -10
  164. package/Source/Scene/I3SNode.js +175 -18
  165. package/Source/Scene/I3SStatistics.js +94 -0
  166. package/Source/Scene/I3SSublayer.js +176 -0
  167. package/Source/Scene/I3SSymbology.js +337 -0
  168. package/Source/Scene/Implicit3DTileContent.js +4 -0
  169. package/Source/Scene/KeyframeNode.js +1 -1
  170. package/Source/Scene/LabelCollection.js +2 -2
  171. package/Source/Scene/Model/AtmospherePipelineStage.js +59 -0
  172. package/Source/Scene/Model/B3dmLoader.js +4 -0
  173. package/Source/Scene/Model/FeatureIdPipelineStage.js +25 -2
  174. package/Source/Scene/Model/I3dmLoader.js +4 -0
  175. package/Source/Scene/Model/InstancingPipelineStage.js +24 -6
  176. package/Source/Scene/Model/MetadataPipelineStage.js +31 -3
  177. package/Source/Scene/Model/Model.js +82 -32
  178. package/Source/Scene/Model/Model3DTileContent.js +31 -0
  179. package/Source/Scene/Model/ModelAnimationChannel.js +16 -15
  180. package/Source/Scene/Model/ModelSceneGraph.js +6 -0
  181. package/Source/Scene/Model/pickModel.js +426 -0
  182. package/Source/Scene/Multiple3DTileContent.js +42 -0
  183. package/Source/Scene/PickFramebuffer.js +37 -2
  184. package/Source/Scene/Picking.js +113 -39
  185. package/Source/Scene/Primitive.js +6 -2
  186. package/Source/Scene/QuadtreePrimitive.js +1 -1
  187. package/Source/Scene/Scene.js +312 -46
  188. package/Source/Scene/ScreenSpaceCameraController.js +23 -13
  189. package/Source/Scene/SensorVolumePortionToDisplay.js +69 -0
  190. package/Source/Scene/SkyAtmosphere.js +5 -6
  191. package/Source/Scene/SpatialNode.js +12 -19
  192. package/Source/Scene/StructuralMetadata.js +1 -1
  193. package/Source/Scene/Terrain.js +49 -0
  194. package/Source/Scene/TileBoundingS2Cell.js +2 -2
  195. package/Source/Scene/Tileset3DTileContent.js +4 -0
  196. package/Source/Scene/Vector3DTileContent.js +4 -0
  197. package/Source/Scene/VoxelBoxShape.js +76 -0
  198. package/Source/Scene/VoxelCell.js +273 -0
  199. package/Source/Scene/VoxelCylinderShape.js +114 -43
  200. package/Source/Scene/VoxelEllipsoidShape.js +158 -116
  201. package/Source/Scene/VoxelPrimitive.js +3 -1
  202. package/Source/Scene/VoxelRenderResources.js +3 -0
  203. package/Source/Scene/VoxelShape.js +13 -0
  204. package/Source/Scene/VoxelTraversal.js +76 -54
  205. package/Source/Scene/buildVoxelDrawCommands.js +23 -0
  206. package/Source/Scene/createGooglePhotorealistic3DTileset.js +1 -0
  207. package/Source/Scene/processVoxelProperties.js +2 -0
  208. package/Source/Shaders/AtmosphereCommon.glsl +3 -11
  209. package/Source/Shaders/AtmosphereCommon.js +3 -11
  210. package/Source/Shaders/Builtin/CzmBuiltins.js +12 -0
  211. package/Source/Shaders/Builtin/Functions/applyHSBShift.glsl +32 -0
  212. package/Source/Shaders/Builtin/Functions/applyHSBShift.js +34 -0
  213. package/Source/Shaders/Builtin/Functions/approximateTanh.glsl +10 -0
  214. package/Source/Shaders/Builtin/Functions/approximateTanh.js +12 -0
  215. package/Source/Shaders/Builtin/Functions/computeAtmosphereColor.glsl +44 -0
  216. package/Source/Shaders/Builtin/Functions/computeAtmosphereColor.js +46 -0
  217. package/Source/Shaders/Builtin/Functions/computeGroundAtmosphereScattering.glsl +30 -0
  218. package/Source/Shaders/Builtin/Functions/computeGroundAtmosphereScattering.js +32 -0
  219. package/Source/Shaders/Builtin/Functions/computeScattering.glsl +150 -0
  220. package/Source/Shaders/Builtin/Functions/computeScattering.js +152 -0
  221. package/Source/Shaders/Builtin/Functions/getDynamicAtmosphereLightDirection.glsl +22 -0
  222. package/Source/Shaders/Builtin/Functions/getDynamicAtmosphereLightDirection.js +24 -0
  223. package/Source/Shaders/Builtin/Functions/translateRelativeToEye.glsl +5 -0
  224. package/Source/Shaders/Builtin/Functions/translateRelativeToEye.js +5 -0
  225. package/Source/Shaders/GlobeFS.glsl +16 -25
  226. package/Source/Shaders/GlobeFS.js +16 -25
  227. package/Source/Shaders/GlobeVS.glsl +1 -1
  228. package/Source/Shaders/GlobeVS.js +1 -1
  229. package/Source/Shaders/Model/AtmosphereStageFS.glsl +111 -0
  230. package/Source/Shaders/Model/AtmosphereStageFS.js +113 -0
  231. package/Source/Shaders/Model/AtmosphereStageVS.glsl +12 -0
  232. package/Source/Shaders/Model/AtmosphereStageVS.js +14 -0
  233. package/Source/Shaders/Model/GeometryStageFS.glsl +1 -1
  234. package/Source/Shaders/Model/GeometryStageFS.js +1 -1
  235. package/Source/Shaders/Model/GeometryStageVS.glsl +4 -4
  236. package/Source/Shaders/Model/GeometryStageVS.js +4 -4
  237. package/Source/Shaders/Model/ModelColorStageFS.glsl +1 -1
  238. package/Source/Shaders/Model/ModelColorStageFS.js +2 -1
  239. package/Source/Shaders/Model/ModelFS.glsl +4 -0
  240. package/Source/Shaders/Model/ModelFS.js +4 -0
  241. package/Source/Shaders/Model/ModelVS.glsl +9 -4
  242. package/Source/Shaders/Model/ModelVS.js +9 -4
  243. package/Source/Shaders/SkyAtmosphereCommon.glsl +3 -13
  244. package/Source/Shaders/SkyAtmosphereCommon.js +3 -13
  245. package/Source/Shaders/SkyAtmosphereFS.glsl +5 -10
  246. package/Source/Shaders/SkyAtmosphereFS.js +5 -10
  247. package/Source/Shaders/SkyAtmosphereVS.glsl +3 -2
  248. package/Source/Shaders/SkyAtmosphereVS.js +3 -2
  249. package/Source/Shaders/Voxels/IntersectCylinder.glsl +14 -111
  250. package/Source/Shaders/Voxels/IntersectCylinder.js +14 -111
  251. package/Source/Shaders/Voxels/IntersectEllipsoid.glsl +32 -113
  252. package/Source/Shaders/Voxels/IntersectEllipsoid.js +32 -113
  253. package/Source/Shaders/Voxels/IntersectLongitude.glsl +102 -0
  254. package/Source/Shaders/Voxels/IntersectLongitude.js +104 -0
  255. package/Source/Shaders/Voxels/VoxelFS.glsl +39 -1
  256. package/Source/Shaders/Voxels/VoxelFS.js +39 -1
  257. package/Source/Shaders/Voxels/convertUvToCylinder.glsl +19 -37
  258. package/Source/Shaders/Voxels/convertUvToCylinder.js +19 -37
  259. package/Source/Shaders/Voxels/convertUvToEllipsoid.glsl +24 -44
  260. package/Source/Shaders/Voxels/convertUvToEllipsoid.js +24 -44
  261. package/Source/ThirdParty/Workers/z-worker-pako.js +1 -1
  262. package/Source/ThirdParty/draco_decoder.wasm +0 -0
  263. package/Source/Workers/createGeometry.js +40 -11
  264. package/Source/Workers/decodeI3S.js +720 -94
  265. package/index.d.ts +574 -71
  266. package/index.js +217 -196
  267. package/package.json +3 -3
  268. package/Build/Workers/chunk-ATB2I7OS.js +0 -55
@@ -1,11 +1,8 @@
1
1
  //This file is automatically rebuilt by the Cesium build process.
2
2
  export default "/* Cylinder defines (set in Scene/VoxelCylinderShape.js)\n\
3
3
  #define CYLINDER_HAS_SHAPE_BOUNDS_RADIUS\n\
4
- #define CYLINDER_HAS_SHAPE_BOUNDS_RADIUS_FLAT\n\
5
4
  #define CYLINDER_HAS_SHAPE_BOUNDS_HEIGHT\n\
6
- #define CYLINDER_HAS_SHAPE_BOUNDS_HEIGHT_FLAT\n\
7
5
  #define CYLINDER_HAS_SHAPE_BOUNDS_ANGLE\n\
8
- #define CYLINDER_HAS_SHAPE_BOUNDS_ANGLE_RANGE_EQUAL_ZERO\n\
9
6
  #define CYLINDER_HAS_SHAPE_BOUNDS_ANGLE_MIN_DISCONTINUITY\n\
10
7
  #define CYLINDER_HAS_SHAPE_BOUNDS_ANGLE_MAX_DISCONTINUITY\n\
11
8
  #define CYLINDER_HAS_SHAPE_BOUNDS_ANGLE_MIN_MAX_REVERSED\n\
@@ -30,46 +27,31 @@ export default "/* Cylinder defines (set in Scene/VoxelCylinderShape.js)\n\
30
27
  vec3 convertUvToShapeUvSpace(in vec3 positionUv) {\n\
31
28
  vec3 positionLocal = positionUv * 2.0 - 1.0; // [-1,+1]\n\
32
29
  \n\
33
- // Compute radius\n\
34
- #if defined(CYLINDER_HAS_SHAPE_BOUNDS_RADIUS_FLAT)\n\
35
- float radius = 1.0;\n\
36
- #else\n\
37
- float radius = length(positionLocal.xy); // [0,1]\n\
38
- #if defined(CYLINDER_HAS_SHAPE_BOUNDS_RADIUS)\n\
39
- radius = radius * u_cylinderUvToShapeUvRadius.x + u_cylinderUvToShapeUvRadius.y; // x = scale, y = offset\n\
40
- #endif\n\
30
+ float radius = length(positionLocal.xy); // [0,1]\n\
31
+ #if defined(CYLINDER_HAS_SHAPE_BOUNDS_RADIUS)\n\
32
+ radius = radius * u_cylinderUvToShapeUvRadius.x + u_cylinderUvToShapeUvRadius.y; // x = scale, y = offset\n\
41
33
  #endif\n\
42
34
  \n\
43
- // Compute height\n\
44
- #if defined(CYLINDER_HAS_SHAPE_BOUNDS_HEIGHT_FLAT)\n\
45
- float height = 1.0;\n\
46
- #else\n\
47
- float height = positionUv.z; // [0,1]\n\
48
- #if defined(CYLINDER_HAS_SHAPE_BOUNDS_HEIGHT)\n\
49
- height = height * u_cylinderUvToShapeUvHeight.x + u_cylinderUvToShapeUvHeight.y; // x = scale, y = offset\n\
50
- #endif\n\
35
+ float height = positionUv.z; // [0,1]\n\
36
+ #if defined(CYLINDER_HAS_SHAPE_BOUNDS_HEIGHT)\n\
37
+ height = height * u_cylinderUvToShapeUvHeight.x + u_cylinderUvToShapeUvHeight.y; // x = scale, y = offset\n\
51
38
  #endif\n\
52
39
  \n\
53
- // Compute angle\n\
54
- #if defined(CYLINDER_HAS_SHAPE_BOUNDS_ANGLE_RANGE_EQUAL_ZERO)\n\
55
- float angle = 1.0;\n\
56
- #else\n\
57
- float angle = (atan(positionLocal.y, positionLocal.x) + czm_pi) / czm_twoPi; // [0,1]\n\
58
- #if defined(CYLINDER_HAS_SHAPE_BOUNDS_ANGLE)\n\
59
- #if defined(CYLINDER_HAS_SHAPE_BOUNDS_ANGLE_MIN_MAX_REVERSED)\n\
60
- // Comparing against u_cylinderShapeUvAngleMinMax has precision problems. u_cylinderShapeUvAngleRangeZeroMid is more conservative.\n\
61
- angle += float(angle < u_cylinderShapeUvAngleRangeZeroMid);\n\
62
- #endif\n\
63
- \n\
64
- // Avoid flickering from reading voxels from both sides of the -pi/+pi discontinuity.\n\
65
- #if defined(CYLINDER_HAS_SHAPE_BOUNDS_ANGLE_MIN_DISCONTINUITY)\n\
66
- angle = angle > u_cylinderShapeUvAngleRangeZeroMid ? u_cylinderShapeUvAngleMinMax.x : angle;\n\
67
- #elif defined(CYLINDER_HAS_SHAPE_BOUNDS_ANGLE_MAX_DISCONTINUITY)\n\
68
- angle = angle < u_cylinderShapeUvAngleRangeZeroMid ? u_cylinderShapeUvAngleMinMax.y : angle;\n\
69
- #endif\n\
40
+ float angle = (atan(positionLocal.y, positionLocal.x) + czm_pi) / czm_twoPi; // [0,1]\n\
41
+ #if defined(CYLINDER_HAS_SHAPE_BOUNDS_ANGLE)\n\
42
+ #if defined(CYLINDER_HAS_SHAPE_BOUNDS_ANGLE_MIN_MAX_REVERSED)\n\
43
+ // Comparing against u_cylinderShapeUvAngleMinMax has precision problems. u_cylinderShapeUvAngleRangeZeroMid is more conservative.\n\
44
+ angle += float(angle < u_cylinderShapeUvAngleRangeZeroMid);\n\
45
+ #endif\n\
70
46
  \n\
71
- angle = angle * u_cylinderUvToShapeUvAngle.x + u_cylinderUvToShapeUvAngle.y; // x = scale, y = offset\n\
47
+ // Avoid flickering from reading voxels from both sides of the -pi/+pi discontinuity.\n\
48
+ #if defined(CYLINDER_HAS_SHAPE_BOUNDS_ANGLE_MIN_DISCONTINUITY)\n\
49
+ angle = angle > u_cylinderShapeUvAngleRangeZeroMid ? u_cylinderShapeUvAngleMinMax.x : angle;\n\
50
+ #elif defined(CYLINDER_HAS_SHAPE_BOUNDS_ANGLE_MAX_DISCONTINUITY)\n\
51
+ angle = angle < u_cylinderShapeUvAngleRangeZeroMid ? u_cylinderShapeUvAngleMinMax.y : angle;\n\
72
52
  #endif\n\
53
+ \n\
54
+ angle = angle * u_cylinderUvToShapeUvAngle.x + u_cylinderUvToShapeUvAngle.y; // x = scale, y = offset\n\
73
55
  #endif\n\
74
56
  \n\
75
57
  return vec3(radius, height, angle);\n\
@@ -2,11 +2,8 @@
2
2
  #define ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_MIN_DISCONTINUITY
3
3
  #define ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_MAX_DISCONTINUITY
4
4
  #define ELLIPSOID_HAS_SHAPE_BOUNDS_LONGITUDE
5
- #define ELLIPSOID_HAS_SHAPE_BOUNDS_LONGITUDE_RANGE_EQUAL_ZERO
6
5
  #define ELLIPSOID_HAS_SHAPE_BOUNDS_LONGITUDE_MIN_MAX_REVERSED
7
6
  #define ELLIPSOID_HAS_SHAPE_BOUNDS_LATITUDE
8
- #define ELLIPSOID_HAS_SHAPE_BOUNDS_LATITUDE_RANGE_EQUAL_ZERO
9
- #define ELLIPSOID_HAS_SHAPE_BOUNDS_HEIGHT_MIN
10
7
  #define ELLIPSOID_HAS_SHAPE_BOUNDS_HEIGHT_FLAT
11
8
  #define ELLIPSOID_IS_SPHERE
12
9
  */
@@ -24,7 +21,7 @@ uniform vec3 u_ellipsoidRadiiUv; // [0,1]
24
21
  #if defined(ELLIPSOID_HAS_SHAPE_BOUNDS_LATITUDE)
25
22
  uniform vec2 u_ellipsoidUvToShapeUvLatitude; // x = scale, y = offset
26
23
  #endif
27
- #if defined(ELLIPSOID_HAS_SHAPE_BOUNDS_HEIGHT_MIN) && !defined(ELLIPSOID_HAS_SHAPE_BOUNDS_HEIGHT_FLAT)
24
+ #if !defined(ELLIPSOID_HAS_SHAPE_BOUNDS_HEIGHT_FLAT)
28
25
  uniform float u_ellipsoidInverseHeightDifferenceUv;
29
26
  uniform vec2 u_ellipseInnerRadiiUv; // [0,1]
30
27
  #endif
@@ -66,38 +63,30 @@ vec3 convertUvToShapeUvSpace(in vec3 positionUv) {
66
63
  #endif
67
64
 
68
65
  // Compute longitude
69
- #if defined(ELLIPSOID_HAS_SHAPE_BOUNDS_LONGITUDE_RANGE_EQUAL_ZERO)
70
- float longitude = 1.0;
71
- #else
72
- float longitude = (atan(normal.y, normal.x) + czm_pi) / czm_twoPi;
66
+ float longitude = (atan(normal.y, normal.x) + czm_pi) / czm_twoPi;
73
67
 
74
- // Correct the angle when max < min
75
- // Technically this should compare against min longitude - but it has precision problems so compare against the middle of empty space.
76
- #if defined(ELLIPSOID_HAS_SHAPE_BOUNDS_LONGITUDE_MIN_MAX_REVERSED)
77
- longitude += float(longitude < u_ellipsoidShapeUvLongitudeMinMaxMid.z);
78
- #endif
68
+ // Correct the angle when max < min
69
+ // Technically this should compare against min longitude - but it has precision problems so compare against the middle of empty space.
70
+ #if defined(ELLIPSOID_HAS_SHAPE_BOUNDS_LONGITUDE_MIN_MAX_REVERSED)
71
+ longitude += float(longitude < u_ellipsoidShapeUvLongitudeMinMaxMid.z);
72
+ #endif
79
73
 
80
- // Avoid flickering from reading voxels from both sides of the -pi/+pi discontinuity.
81
- #if defined(ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_MIN_DISCONTINUITY)
82
- longitude = longitude > u_ellipsoidShapeUvLongitudeMinMaxMid.z ? u_ellipsoidShapeUvLongitudeMinMaxMid.x : longitude;
83
- #endif
84
- #if defined(ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_MAX_DISCONTINUITY)
85
- longitude = longitude < u_ellipsoidShapeUvLongitudeMinMaxMid.z ? u_ellipsoidShapeUvLongitudeMinMaxMid.y : longitude;
86
- #endif
74
+ // Avoid flickering from reading voxels from both sides of the -pi/+pi discontinuity.
75
+ #if defined(ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_MIN_DISCONTINUITY)
76
+ longitude = longitude > u_ellipsoidShapeUvLongitudeMinMaxMid.z ? u_ellipsoidShapeUvLongitudeMinMaxMid.x : longitude;
77
+ #endif
78
+ #if defined(ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_MAX_DISCONTINUITY)
79
+ longitude = longitude < u_ellipsoidShapeUvLongitudeMinMaxMid.z ? u_ellipsoidShapeUvLongitudeMinMaxMid.y : longitude;
80
+ #endif
87
81
 
88
- #if defined(ELLIPSOID_HAS_SHAPE_BOUNDS_LONGITUDE)
89
- longitude = longitude * u_ellipsoidUvToShapeUvLongitude.x + u_ellipsoidUvToShapeUvLongitude.y;
90
- #endif
82
+ #if defined(ELLIPSOID_HAS_SHAPE_BOUNDS_LONGITUDE)
83
+ longitude = longitude * u_ellipsoidUvToShapeUvLongitude.x + u_ellipsoidUvToShapeUvLongitude.y;
91
84
  #endif
92
85
 
93
86
  // Compute latitude
94
- #if defined(ELLIPSOID_HAS_SHAPE_BOUNDS_LATITUDE_RANGE_EQUAL_ZERO)
95
- float latitude = 1.0;
96
- #else
97
- float latitude = (asin(normal.z) + czm_piOverTwo) / czm_pi;
98
- #if defined(ELLIPSOID_HAS_SHAPE_BOUNDS_LATITUDE)
99
- latitude = latitude * u_ellipsoidUvToShapeUvLatitude.x + u_ellipsoidUvToShapeUvLatitude.y;
100
- #endif
87
+ float latitude = (asin(normal.z) + czm_piOverTwo) / czm_pi;
88
+ #if defined(ELLIPSOID_HAS_SHAPE_BOUNDS_LATITUDE)
89
+ latitude = latitude * u_ellipsoidUvToShapeUvLatitude.x + u_ellipsoidUvToShapeUvLatitude.y;
101
90
  #endif
102
91
 
103
92
  // Compute height
@@ -108,21 +97,12 @@ vec3 convertUvToShapeUvSpace(in vec3 positionUv) {
108
97
  float height = 1.0;
109
98
  #else
110
99
  #if defined(ELLIPSOID_IS_SPHERE)
111
- #if defined(ELLIPSOID_HAS_SHAPE_BOUNDS_HEIGHT_MIN)
112
- float height = (length(posEllipsoid) - u_ellipseInnerRadiiUv.x) * u_ellipsoidInverseHeightDifferenceUv;
113
- #else
114
- float height = length(posEllipsoid);
115
- #endif
100
+ float height = (length(posEllipsoid) - u_ellipseInnerRadiiUv.x) * u_ellipsoidInverseHeightDifferenceUv;
116
101
  #else
117
- #if defined(ELLIPSOID_HAS_SHAPE_BOUNDS_HEIGHT_MIN)
118
- // Convert the 3D position to a 2D position relative to the ellipse (radii.x, radii.z) (assuming radii.x == radii.y which is true for WGS84).
119
- // This is an optimization so that math can be done with ellipses instead of ellipsoids.
120
- vec2 posEllipse = vec2(length(posEllipsoid.xy), posEllipsoid.z);
121
- float height = ellipseDistanceIterative(posEllipse, u_ellipseInnerRadiiUv) * u_ellipsoidInverseHeightDifferenceUv;
122
- #else
123
- // TODO: this is probably not correct
124
- float height = length(posEllipsoid);
125
- #endif
102
+ // Convert the 3D position to a 2D position relative to the ellipse (radii.x, radii.z) (assuming radii.x == radii.y which is true for WGS84).
103
+ // This is an optimization so that math can be done with ellipses instead of ellipsoids.
104
+ vec2 posEllipse = vec2(length(posEllipsoid.xy), posEllipsoid.z);
105
+ float height = ellipseDistanceIterative(posEllipse, u_ellipseInnerRadiiUv) * u_ellipsoidInverseHeightDifferenceUv;
126
106
  #endif
127
107
  #endif
128
108
 
@@ -3,11 +3,8 @@ export default "/* Ellipsoid defines (set in Scene/VoxelEllipsoidShape.js)\n\
3
3
  #define ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_MIN_DISCONTINUITY\n\
4
4
  #define ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_MAX_DISCONTINUITY\n\
5
5
  #define ELLIPSOID_HAS_SHAPE_BOUNDS_LONGITUDE\n\
6
- #define ELLIPSOID_HAS_SHAPE_BOUNDS_LONGITUDE_RANGE_EQUAL_ZERO\n\
7
6
  #define ELLIPSOID_HAS_SHAPE_BOUNDS_LONGITUDE_MIN_MAX_REVERSED\n\
8
7
  #define ELLIPSOID_HAS_SHAPE_BOUNDS_LATITUDE\n\
9
- #define ELLIPSOID_HAS_SHAPE_BOUNDS_LATITUDE_RANGE_EQUAL_ZERO\n\
10
- #define ELLIPSOID_HAS_SHAPE_BOUNDS_HEIGHT_MIN\n\
11
8
  #define ELLIPSOID_HAS_SHAPE_BOUNDS_HEIGHT_FLAT\n\
12
9
  #define ELLIPSOID_IS_SPHERE\n\
13
10
  */\n\
@@ -25,7 +22,7 @@ uniform vec3 u_ellipsoidRadiiUv; // [0,1]\n\
25
22
  #if defined(ELLIPSOID_HAS_SHAPE_BOUNDS_LATITUDE)\n\
26
23
  uniform vec2 u_ellipsoidUvToShapeUvLatitude; // x = scale, y = offset\n\
27
24
  #endif\n\
28
- #if defined(ELLIPSOID_HAS_SHAPE_BOUNDS_HEIGHT_MIN) && !defined(ELLIPSOID_HAS_SHAPE_BOUNDS_HEIGHT_FLAT)\n\
25
+ #if !defined(ELLIPSOID_HAS_SHAPE_BOUNDS_HEIGHT_FLAT)\n\
29
26
  uniform float u_ellipsoidInverseHeightDifferenceUv;\n\
30
27
  uniform vec2 u_ellipseInnerRadiiUv; // [0,1]\n\
31
28
  #endif\n\
@@ -67,38 +64,30 @@ vec3 convertUvToShapeUvSpace(in vec3 positionUv) {\n\
67
64
  #endif\n\
68
65
  \n\
69
66
  // Compute longitude\n\
70
- #if defined(ELLIPSOID_HAS_SHAPE_BOUNDS_LONGITUDE_RANGE_EQUAL_ZERO)\n\
71
- float longitude = 1.0;\n\
72
- #else\n\
73
- float longitude = (atan(normal.y, normal.x) + czm_pi) / czm_twoPi;\n\
67
+ float longitude = (atan(normal.y, normal.x) + czm_pi) / czm_twoPi;\n\
74
68
  \n\
75
- // Correct the angle when max < min\n\
76
- // Technically this should compare against min longitude - but it has precision problems so compare against the middle of empty space.\n\
77
- #if defined(ELLIPSOID_HAS_SHAPE_BOUNDS_LONGITUDE_MIN_MAX_REVERSED)\n\
78
- longitude += float(longitude < u_ellipsoidShapeUvLongitudeMinMaxMid.z);\n\
79
- #endif\n\
69
+ // Correct the angle when max < min\n\
70
+ // Technically this should compare against min longitude - but it has precision problems so compare against the middle of empty space.\n\
71
+ #if defined(ELLIPSOID_HAS_SHAPE_BOUNDS_LONGITUDE_MIN_MAX_REVERSED)\n\
72
+ longitude += float(longitude < u_ellipsoidShapeUvLongitudeMinMaxMid.z);\n\
73
+ #endif\n\
80
74
  \n\
81
- // Avoid flickering from reading voxels from both sides of the -pi/+pi discontinuity.\n\
82
- #if defined(ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_MIN_DISCONTINUITY)\n\
83
- longitude = longitude > u_ellipsoidShapeUvLongitudeMinMaxMid.z ? u_ellipsoidShapeUvLongitudeMinMaxMid.x : longitude;\n\
84
- #endif\n\
85
- #if defined(ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_MAX_DISCONTINUITY)\n\
86
- longitude = longitude < u_ellipsoidShapeUvLongitudeMinMaxMid.z ? u_ellipsoidShapeUvLongitudeMinMaxMid.y : longitude;\n\
87
- #endif\n\
75
+ // Avoid flickering from reading voxels from both sides of the -pi/+pi discontinuity.\n\
76
+ #if defined(ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_MIN_DISCONTINUITY)\n\
77
+ longitude = longitude > u_ellipsoidShapeUvLongitudeMinMaxMid.z ? u_ellipsoidShapeUvLongitudeMinMaxMid.x : longitude;\n\
78
+ #endif\n\
79
+ #if defined(ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_MAX_DISCONTINUITY)\n\
80
+ longitude = longitude < u_ellipsoidShapeUvLongitudeMinMaxMid.z ? u_ellipsoidShapeUvLongitudeMinMaxMid.y : longitude;\n\
81
+ #endif\n\
88
82
  \n\
89
- #if defined(ELLIPSOID_HAS_SHAPE_BOUNDS_LONGITUDE)\n\
90
- longitude = longitude * u_ellipsoidUvToShapeUvLongitude.x + u_ellipsoidUvToShapeUvLongitude.y;\n\
91
- #endif\n\
83
+ #if defined(ELLIPSOID_HAS_SHAPE_BOUNDS_LONGITUDE)\n\
84
+ longitude = longitude * u_ellipsoidUvToShapeUvLongitude.x + u_ellipsoidUvToShapeUvLongitude.y;\n\
92
85
  #endif\n\
93
86
  \n\
94
87
  // Compute latitude\n\
95
- #if defined(ELLIPSOID_HAS_SHAPE_BOUNDS_LATITUDE_RANGE_EQUAL_ZERO)\n\
96
- float latitude = 1.0;\n\
97
- #else\n\
98
- float latitude = (asin(normal.z) + czm_piOverTwo) / czm_pi;\n\
99
- #if defined(ELLIPSOID_HAS_SHAPE_BOUNDS_LATITUDE)\n\
100
- latitude = latitude * u_ellipsoidUvToShapeUvLatitude.x + u_ellipsoidUvToShapeUvLatitude.y;\n\
101
- #endif\n\
88
+ float latitude = (asin(normal.z) + czm_piOverTwo) / czm_pi;\n\
89
+ #if defined(ELLIPSOID_HAS_SHAPE_BOUNDS_LATITUDE)\n\
90
+ latitude = latitude * u_ellipsoidUvToShapeUvLatitude.x + u_ellipsoidUvToShapeUvLatitude.y;\n\
102
91
  #endif\n\
103
92
  \n\
104
93
  // Compute height\n\
@@ -109,21 +98,12 @@ vec3 convertUvToShapeUvSpace(in vec3 positionUv) {\n\
109
98
  float height = 1.0;\n\
110
99
  #else\n\
111
100
  #if defined(ELLIPSOID_IS_SPHERE)\n\
112
- #if defined(ELLIPSOID_HAS_SHAPE_BOUNDS_HEIGHT_MIN)\n\
113
- float height = (length(posEllipsoid) - u_ellipseInnerRadiiUv.x) * u_ellipsoidInverseHeightDifferenceUv;\n\
114
- #else\n\
115
- float height = length(posEllipsoid);\n\
116
- #endif\n\
101
+ float height = (length(posEllipsoid) - u_ellipseInnerRadiiUv.x) * u_ellipsoidInverseHeightDifferenceUv;\n\
117
102
  #else\n\
118
- #if defined(ELLIPSOID_HAS_SHAPE_BOUNDS_HEIGHT_MIN)\n\
119
- // Convert the 3D position to a 2D position relative to the ellipse (radii.x, radii.z) (assuming radii.x == radii.y which is true for WGS84).\n\
120
- // This is an optimization so that math can be done with ellipses instead of ellipsoids.\n\
121
- vec2 posEllipse = vec2(length(posEllipsoid.xy), posEllipsoid.z);\n\
122
- float height = ellipseDistanceIterative(posEllipse, u_ellipseInnerRadiiUv) * u_ellipsoidInverseHeightDifferenceUv;\n\
123
- #else\n\
124
- // TODO: this is probably not correct\n\
125
- float height = length(posEllipsoid);\n\
126
- #endif\n\
103
+ // Convert the 3D position to a 2D position relative to the ellipse (radii.x, radii.z) (assuming radii.x == radii.y which is true for WGS84).\n\
104
+ // This is an optimization so that math can be done with ellipses instead of ellipsoids.\n\
105
+ vec2 posEllipse = vec2(length(posEllipsoid.xy), posEllipsoid.z);\n\
106
+ float height = ellipseDistanceIterative(posEllipse, u_ellipseInnerRadiiUv) * u_ellipsoidInverseHeightDifferenceUv;\n\
127
107
  #endif\n\
128
108
  #endif\n\
129
109
  \n\
@@ -1 +1 @@
1
- !function(){"use strict";const{Array:t,Object:e,Math:n,Error:s,Uint8Array:r,Uint16Array:a,Uint32Array:i,Int32Array:c,DataView:o,TextEncoder:l,crypto:h,postMessage:p}=globalThis,d=[];for(let t=0;256>t;t++){let e=t;for(let t=0;8>t;t++)1&e?e=e>>>1^3988292384:e>>>=1;d[t]=e}class u{constructor(t){this.crc=t||-1}append(t){let e=0|this.crc;for(let n=0,s=0|t.length;s>n;n++)e=e>>>8^d[255&(e^t[n])];this.crc=e}get(){return~this.crc}}const f={concat(t,e){if(0===t.length||0===e.length)return t.concat(e);const n=t[t.length-1],s=f.getPartial(n);return 32===s?t.concat(e):f._shiftRight(e,s,0|n,t.slice(0,t.length-1))},bitLength(t){const e=t.length;if(0===e)return 0;const n=t[e-1];return 32*(e-1)+f.getPartial(n)},clamp(t,e){if(32*t.length<e)return t;const s=(t=t.slice(0,n.ceil(e/32))).length;return e&=31,s>0&&e&&(t[s-1]=f.partial(e,t[s-1]&2147483648>>e-1,1)),t},partial:(t,e,n)=>32===t?e:(n?0|e:e<<32-t)+1099511627776*t,getPartial:t=>n.round(t/1099511627776)||32,_shiftRight(t,e,n,s){for(void 0===s&&(s=[]);e>=32;e-=32)s.push(n),n=0;if(0===e)return s.concat(t);for(let r=0;r<t.length;r++)s.push(n|t[r]>>>e),n=t[r]<<32-e;const r=t.length?t[t.length-1]:0,a=f.getPartial(r);return s.push(f.partial(e+a&31,e+a>32?n:s.pop(),1)),s}},g={bytes:{fromBits(t){const e=f.bitLength(t)/8,n=new r(e);let s;for(let r=0;e>r;r++)0==(3&r)&&(s=t[r/4]),n[r]=s>>>24,s<<=8;return n},toBits(t){const e=[];let n,s=0;for(n=0;n<t.length;n++)s=s<<8|t[n],3==(3&n)&&(e.push(s),s=0);return 3&n&&e.push(f.partial(8*(3&n),s)),e}}},w={sha1:function(t){t?(this._h=t._h.slice(0),this._buffer=t._buffer.slice(0),this._length=t._length):this.reset()}};w.sha1.prototype={blockSize:512,reset:function(){const t=this;return t._h=this._init.slice(0),t._buffer=[],t._length=0,t},update:function(t){const e=this;"string"==typeof t&&(t=g.utf8String.toBits(t));const n=e._buffer=f.concat(e._buffer,t),r=e._length,a=e._length=r+f.bitLength(t);if(a>9007199254740991)throw new s("Cannot hash more than 2^53 - 1 bits");const c=new i(n);let o=0;for(let t=e.blockSize+r-(e.blockSize+r&e.blockSize-1);a>=t;t+=e.blockSize)e._block(c.subarray(16*o,16*(o+1))),o+=1;return n.splice(0,16*o),e},finalize:function(){const t=this;let e=t._buffer;const s=t._h;e=f.concat(e,[f.partial(1,1)]);for(let t=e.length+2;15&t;t++)e.push(0);for(e.push(n.floor(t._length/4294967296)),e.push(0|t._length);e.length;)t._block(e.splice(0,16));return t.reset(),s},_init:[1732584193,4023233417,2562383102,271733878,3285377520],_key:[1518500249,1859775393,2400959708,3395469782],_f:(t,e,n,s)=>t>19?t>39?t>59?t>79?void 0:e^n^s:e&n|e&s|n&s:e^n^s:e&n|~e&s,_S:(t,e)=>e<<t|e>>>32-t,_block:function(e){const s=this,r=s._h,a=t(80);for(let t=0;16>t;t++)a[t]=e[t];let i=r[0],c=r[1],o=r[2],l=r[3],h=r[4];for(let t=0;79>=t;t++){16>t||(a[t]=s._S(1,a[t-3]^a[t-8]^a[t-14]^a[t-16]));const e=s._S(5,i)+s._f(t,c,o,l)+h+a[t]+s._key[n.floor(t/20)]|0;h=l,l=o,o=s._S(30,c),c=i,i=e}r[0]=r[0]+i|0,r[1]=r[1]+c|0,r[2]=r[2]+o|0,r[3]=r[3]+l|0,r[4]=r[4]+h|0}};const y={getRandomValues(t){const e=new i(t.buffer),s=t=>{let e=987654321;const s=4294967295;return()=>(e=36969*(65535&e)+(e>>16)&s,(((e<<16)+(t=18e3*(65535&t)+(t>>16)&s)&s)/4294967296+.5)*(n.random()>.5?1:-1))};for(let r,a=0;a<t.length;a+=4){const t=s(4294967296*(r||n.random()));r=987654071*t(),e[a/4]=4294967296*t()|0}return t}},_={importKey:t=>new _.hmacSha1(g.bytes.toBits(t)),pbkdf2(t,e,n,r){if(n=n||1e4,0>r||0>n)throw new s("invalid params to pbkdf2");const a=1+(r>>5)<<2;let i,c,l,h,p;const d=new ArrayBuffer(a),u=new o(d);let w=0;const y=f;for(e=g.bytes.toBits(e),p=1;(a||1)>w;p++){for(i=c=t.encrypt(y.concat(e,[p])),l=1;n>l;l++)for(c=t.encrypt(c),h=0;h<c.length;h++)i[h]^=c[h];for(l=0;(a||1)>w&&l<i.length;l++)u.setInt32(w,i[l]),w+=4}return d.slice(0,r/8)},hmacSha1:class{constructor(t){const e=this,n=e._hash=w.sha1,s=[[],[]],r=n.prototype.blockSize/32;e._baseHash=[new n,new n],t.length>r&&(t=n.hash(t));for(let e=0;r>e;e++)s[0][e]=909522486^t[e],s[1][e]=1549556828^t[e];e._baseHash[0].update(s[0]),e._baseHash[1].update(s[1]),e._resultHash=new n(e._baseHash[0])}reset(){const t=this;t._resultHash=new t._hash(t._baseHash[0]),t._updated=!1}update(t){this._updated=!0,this._resultHash.update(t)}digest(){const t=this,e=t._resultHash.finalize(),n=new t._hash(t._baseHash[1]).update(e).finalize();return t.reset(),n}encrypt(t){if(this._updated)throw new s("encrypt on already updated hmac called!");return this.update(t),this.digest(t)}}},m="Invalid pasword",b=16,k={name:"PBKDF2"},v=e.assign({hash:{name:"HMAC"}},k),z=e.assign({iterations:1e3,hash:{name:"SHA-1"}},k),C=["deriveBits"],S=[8,12,16],B=[16,24,32],I=10,D=[0,0,0,0],V=void 0!==h,H=V&&void 0!==h.subtle,K=g.bytes,A=class{constructor(t){const e=this;e._tables=[[[],[],[],[],[]],[[],[],[],[],[]]],e._tables[0][0][0]||e._precompute();const n=e._tables[0][4],r=e._tables[1],a=t.length;let i,c,o,l=1;if(4!==a&&6!==a&&8!==a)throw new s("invalid aes key size");for(e._key=[c=t.slice(0),o=[]],i=a;4*a+28>i;i++){let t=c[i-1];(i%a==0||8===a&&i%a==4)&&(t=n[t>>>24]<<24^n[t>>16&255]<<16^n[t>>8&255]<<8^n[255&t],i%a==0&&(t=t<<8^t>>>24^l<<24,l=l<<1^283*(l>>7))),c[i]=c[i-a]^t}for(let t=0;i;t++,i--){const e=c[3&t?i:i-4];o[t]=4>=i||4>t?e:r[0][n[e>>>24]]^r[1][n[e>>16&255]]^r[2][n[e>>8&255]]^r[3][n[255&e]]}}encrypt(t){return this._crypt(t,0)}decrypt(t){return this._crypt(t,1)}_precompute(){const t=this._tables[0],e=this._tables[1],n=t[4],s=e[4],r=[],a=[];let i,c,o,l;for(let t=0;256>t;t++)a[(r[t]=t<<1^283*(t>>7))^t]=t;for(let h=i=0;!n[h];h^=c||1,i=a[i]||1){let a=i^i<<1^i<<2^i<<3^i<<4;a=a>>8^255&a^99,n[h]=a,s[a]=h,l=r[o=r[c=r[h]]];let p=16843009*l^65537*o^257*c^16843008*h,d=257*r[a]^16843008*a;for(let n=0;4>n;n++)t[n][h]=d=d<<24^d>>>8,e[n][a]=p=p<<24^p>>>8}for(let n=0;5>n;n++)t[n]=t[n].slice(0),e[n]=e[n].slice(0)}_crypt(t,e){if(4!==t.length)throw new s("invalid aes block size");const n=this._key[e],r=n.length/4-2,a=[0,0,0,0],i=this._tables[e],c=i[0],o=i[1],l=i[2],h=i[3],p=i[4];let d,u,f,g=t[0]^n[0],w=t[e?3:1]^n[1],y=t[2]^n[2],_=t[e?1:3]^n[3],m=4;for(let t=0;r>t;t++)d=c[g>>>24]^o[w>>16&255]^l[y>>8&255]^h[255&_]^n[m],u=c[w>>>24]^o[y>>16&255]^l[_>>8&255]^h[255&g]^n[m+1],f=c[y>>>24]^o[_>>16&255]^l[g>>8&255]^h[255&w]^n[m+2],_=c[_>>>24]^o[g>>16&255]^l[w>>8&255]^h[255&y]^n[m+3],m+=4,g=d,w=u,y=f;for(let t=0;4>t;t++)a[e?3&-t:t]=p[g>>>24]<<24^p[w>>16&255]<<16^p[y>>8&255]<<8^p[255&_]^n[m++],d=g,g=w,w=y,y=_,_=d;return a}},R=class{constructor(t,e){this._prf=t,this._initIv=e,this._iv=e}reset(){this._iv=this._initIv}update(t){return this.calculate(this._prf,t,this._iv)}incWord(t){if(255==(t>>24&255)){let e=t>>16&255,n=t>>8&255,s=255&t;255===e?(e=0,255===n?(n=0,255===s?s=0:++s):++n):++e,t=0,t+=e<<16,t+=n<<8,t+=s}else t+=1<<24;return t}incCounter(t){0===(t[0]=this.incWord(t[0]))&&(t[1]=this.incWord(t[1]))}calculate(t,e,n){let s;if(!(s=e.length))return[];const r=f.bitLength(e);for(let r=0;s>r;r+=4){this.incCounter(n);const s=t.encrypt(n);e[r]^=s[0],e[r+1]^=s[1],e[r+2]^=s[2],e[r+3]^=s[3]}return f.clamp(e,r)}},W=_.hmacSha1;class T{constructor(t,n,s){e.assign(this,{password:t,signed:n,strength:s-1,pendingInput:new r(0)})}async append(e){const n=this;if(n.password){const r=E(e,0,S[n.strength]+2);await(async(t,e,n)=>{await L(t,n,E(e,0,S[t.strength]));const r=E(e,S[t.strength]),a=t.keys.passwordVerification;if(a[0]!=r[0]||a[1]!=r[1])throw new s(m)})(n,r,n.password),n.password=null,n.aesCtrGladman=new R(new A(n.keys.key),t.from(D)),n.hmac=new W(n.keys.authentication),e=E(e,S[n.strength]+2)}return G(n,e,new r(e.length-I-(e.length-I)%b),0,I,!0)}flush(){const t=this,e=t.pendingInput,n=E(e,0,e.length-I),s=E(e,e.length-I);let a=new r(0);if(n.length){const e=K.toBits(n);t.hmac.update(e);const s=t.aesCtrGladman.update(e);a=K.fromBits(s)}let i=!0;if(t.signed){const e=E(K.fromBits(t.hmac.digest()),0,I);for(let t=0;I>t;t++)e[t]!=s[t]&&(i=!1)}return{valid:i,data:a}}}class U{constructor(t,n){e.assign(this,{password:t,strength:n-1,pendingInput:new r(0)})}async append(e){const n=this;let s=new r(0);n.password&&(s=await(async(t,e)=>{const n=(s=new r(S[t.strength]),V&&"function"==typeof h.getRandomValues?h.getRandomValues(s):y.getRandomValues(s));var s;return await L(t,e,n),P(n,t.keys.passwordVerification)})(n,n.password),n.password=null,n.aesCtrGladman=new R(new A(n.keys.key),t.from(D)),n.hmac=new W(n.keys.authentication));const a=new r(s.length+e.length-e.length%b);return a.set(s,0),G(n,e,a,s.length,0)}flush(){const t=this;let e=new r(0);if(t.pendingInput.length){const n=t.aesCtrGladman.update(K.toBits(t.pendingInput));t.hmac.update(n),e=K.fromBits(n)}const n=E(K.fromBits(t.hmac.digest()),0,I);return{data:P(e,n),signature:n}}}function G(t,e,n,s,a,i){const c=e.length-a;let o;for(t.pendingInput.length&&(e=P(t.pendingInput,e),n=((t,e)=>{if(e&&e>t.length){const n=t;(t=new r(e)).set(n,0)}return t})(n,c-c%b)),o=0;c-b>=o;o+=b){const r=K.toBits(E(e,o,o+b));i&&t.hmac.update(r);const a=t.aesCtrGladman.update(r);i||t.hmac.update(a),n.set(K.fromBits(a),o+s)}return t.pendingInput=E(e,o),n}async function L(t,n,s){const a=(t=>{if(void 0===l){const e=new r((t=unescape(encodeURIComponent(t))).length);for(let n=0;n<e.length;n++)e[n]=t.charCodeAt(n);return e}return(new l).encode(t)})(n),i=await((t,e,n,s,r)=>V&&H&&"function"==typeof h.subtle.importKey?h.subtle.importKey("raw",e,n,!1,r):_.importKey(e))(0,a,v,0,C),c=await(async(t,e,n)=>V&&H&&"function"==typeof h.subtle.deriveBits?await h.subtle.deriveBits(t,e,n):_.pbkdf2(e,t.salt,z.iterations,n))(e.assign({salt:s},z),i,8*(2*B[t.strength]+2)),o=new r(c);t.keys={key:K.toBits(E(o,0,B[t.strength])),authentication:K.toBits(E(o,B[t.strength],2*B[t.strength])),passwordVerification:E(o,2*B[t.strength])}}function P(t,e){let n=t;return t.length+e.length&&(n=new r(t.length+e.length),n.set(t,0),n.set(e,t.length)),n}function E(t,e,n){return t.subarray(e,n)}class M{constructor(t,n){e.assign(this,{password:t,passwordVerification:n}),O(this,t)}append(t){const e=this;if(e.password){const n=x(e,t.subarray(0,12));if(e.password=null,n[11]!=e.passwordVerification)throw new s(m);t=t.subarray(12)}return x(e,t)}flush(){return{valid:!0,data:new r(0)}}}class j{constructor(t,n){e.assign(this,{password:t,passwordVerification:n}),O(this,t)}append(t){const e=this;let n,s;if(e.password){e.password=null;const a=h.getRandomValues(new r(12));a[11]=e.passwordVerification,n=new r(t.length+a.length),n.set(F(e,a),0),s=12}else n=new r(t.length),s=0;return n.set(F(e,t),s),n}flush(){return{data:new r(0)}}}function x(t,e){const n=new r(e.length);for(let s=0;s<e.length;s++)n[s]=J(t)^e[s],q(t,n[s]);return n}function F(t,e){const n=new r(e.length);for(let s=0;s<e.length;s++)n[s]=J(t)^e[s],q(t,e[s]);return n}function O(t,e){t.keys=[305419896,591751049,878082192],t.crcKey0=new u(t.keys[0]),t.crcKey2=new u(t.keys[2]);for(let n=0;n<e.length;n++)q(t,e.charCodeAt(n))}function q(t,e){t.crcKey0.append([e]),t.keys[0]=~t.crcKey0.get(),t.keys[1]=Q(t.keys[1]+N(t.keys[0])),t.keys[1]=Q(n.imul(t.keys[1],134775813)+1),t.crcKey2.append([t.keys[1]>>>24]),t.keys[2]=~t.crcKey2.get()}function J(t){const e=2|t.keys[2];return N(n.imul(e,1^e)>>>8)}function N(t){return 255&t}function Q(t){return 4294967295&t}const X="deflate",Y="inflate",Z="Invalid signature";class ${constructor(t,{signature:n,password:s,signed:r,compressed:a,zipCrypto:i,passwordVerification:c,encryptionStrength:o},{chunkSize:l}){const h=!!s;e.assign(this,{signature:n,encrypted:h,signed:r,compressed:a,inflate:a&&new t({chunkSize:l}),crc32:r&&new u,zipCrypto:i,decrypt:h&&i?new M(s,c):new T(s,r,o)})}async append(t){const e=this;return e.encrypted&&t.length&&(t=await e.decrypt.append(t)),e.compressed&&t.length&&(t=await e.inflate.append(t)),(!e.encrypted||e.zipCrypto)&&e.signed&&t.length&&e.crc32.append(t),t}async flush(){const t=this;let e,n=new r(0);if(t.encrypted){const e=t.decrypt.flush();if(!e.valid)throw new s(Z);n=e.data}if((!t.encrypted||t.zipCrypto)&&t.signed){const n=new o(new r(4).buffer);if(e=t.crc32.get(),n.setUint32(0,e),t.signature!=n.getUint32(0,!1))throw new s(Z)}return t.compressed&&(n=await t.inflate.append(n)||new r(0),await t.inflate.flush()),{data:n,signature:e}}}class tt{constructor(t,{encrypted:n,signed:s,compressed:r,level:a,zipCrypto:i,password:c,passwordVerification:o,encryptionStrength:l},{chunkSize:h}){e.assign(this,{encrypted:n,signed:s,compressed:r,deflate:r&&new t({level:a||5,chunkSize:h}),crc32:s&&new u,zipCrypto:i,encrypt:n&&i?new j(c,o):new U(c,l)})}async append(t){const e=this;let n=t;return e.compressed&&t.length&&(n=await e.deflate.append(t)),e.encrypted&&n.length&&(n=await e.encrypt.append(n)),(!e.encrypted||e.zipCrypto)&&e.signed&&t.length&&e.crc32.append(t),n}async flush(){const t=this;let e,n=new r(0);if(t.compressed&&(n=await t.deflate.flush()||new r(0)),t.encrypted){n=await t.encrypt.append(n);const s=t.encrypt.flush();e=s.signature;const a=new r(n.length+s.data.length);a.set(n,0),a.set(s.data,n.length),n=a}return t.encrypted&&!t.zipCrypto||!t.signed||(e=t.crc32.get()),{data:n,signature:e}}}const et={init(t){t.scripts&&t.scripts.length&&importScripts.apply(void 0,t.scripts);const e=t.options;let n;self.initCodec&&self.initCodec(),e.codecType.startsWith(X)?n=self.Deflate:e.codecType.startsWith(Y)&&(n=self.Inflate),nt=((t,e,n)=>e.codecType.startsWith(X)?new tt(t,e,n):e.codecType.startsWith(Y)?new $(t,e,n):void 0)(n,e,t.config)},append:async t=>({data:await nt.append(t.data)}),flush:()=>nt.flush()};let nt;function st(t,n,s){return class{constructor(a){const i=this;i.codec=new t(e.assign({},n,a)),s(i.codec,(t=>{if(i.pendingData){const e=i.pendingData;i.pendingData=new r(e.length+t.length),i.pendingData.set(e,0),i.pendingData.set(t,e.length)}else i.pendingData=new r(t)}))}append(t){return this.codec.push(t),a(this)}flush(){return this.codec.push(new r(0),!0),a(this)}};function a(t){if(t.pendingData){const e=t.pendingData;return t.pendingData=null,e}return new r(0)}}addEventListener("message",(async t=>{const e=t.data,n=e.type,s=et[n];if(s)try{e.data&&(e.data=new r(e.data));const t=await s(e)||{};if(t.type=n,t.data)try{t.data=t.data.buffer,p(t,[t.data])}catch(e){p(t)}else p(t)}catch(t){p({type:n,error:{message:t.message,stack:t.stack}})}})),self.initCodec=()=>{const{Deflate:t,Inflate:e}=((t,e={},n)=>({Deflate:st(t.Deflate,e.deflate,n),Inflate:st(t.Inflate,e.inflate,n)}))(pako,{deflate:{raw:!0},inflate:{raw:!0}},((t,e)=>t.onData=e));self.Deflate=t,self.Inflate=e}}();
1
+ !function(){"use strict";const{Array:e,Object:t,Number:n,Math:s,Error:r,Uint8Array:a,Uint16Array:o,Uint32Array:i,Int32Array:c,Map:l,DataView:u,Promise:h,TextEncoder:f,crypto:p,postMessage:d,TransformStream:g,ReadableStream:w,WritableStream:y,CompressionStream:m,DecompressionStream:_}=self,b=void 0,S="undefined",v="function";class k{constructor(e){return class extends g{constructor(t,n){const s=new e(n);super({transform(e,t){t.enqueue(s.append(e))},flush(e){const t=s.flush();t&&e.enqueue(t)}})}}}}const z=[];for(let e=0;256>e;e++){let t=e;for(let e=0;8>e;e++)1&t?t=t>>>1^3988292384:t>>>=1;z[e]=t}class D{constructor(e){this.crc=e||-1}append(e){let t=0|this.crc;for(let n=0,s=0|e.length;s>n;n++)t=t>>>8^z[255&(t^e[n])];this.crc=t}get(){return~this.crc}}class C extends g{constructor(){let e;const t=new D;super({transform(e,n){t.append(e),n.enqueue(e)},flush(){const n=new a(4);new u(n.buffer).setUint32(0,t.get()),e.value=n}}),e=this}}const I={concat(e,t){if(0===e.length||0===t.length)return e.concat(t);const n=e[e.length-1],s=I.getPartial(n);return 32===s?e.concat(t):I._shiftRight(t,s,0|n,e.slice(0,e.length-1))},bitLength(e){const t=e.length;if(0===t)return 0;const n=e[t-1];return 32*(t-1)+I.getPartial(n)},clamp(e,t){if(32*e.length<t)return e;const n=(e=e.slice(0,s.ceil(t/32))).length;return t&=31,n>0&&t&&(e[n-1]=I.partial(t,e[n-1]&2147483648>>t-1,1)),e},partial:(e,t,n)=>32===e?t:(n?0|t:t<<32-e)+1099511627776*e,getPartial:e=>s.round(e/1099511627776)||32,_shiftRight(e,t,n,s){for(void 0===s&&(s=[]);t>=32;t-=32)s.push(n),n=0;if(0===t)return s.concat(e);for(let r=0;r<e.length;r++)s.push(n|e[r]>>>t),n=e[r]<<32-t;const r=e.length?e[e.length-1]:0,a=I.getPartial(r);return s.push(I.partial(t+a&31,t+a>32?n:s.pop(),1)),s}},A={bytes:{fromBits(e){const t=I.bitLength(e)/8,n=new a(t);let s;for(let r=0;t>r;r++)0==(3&r)&&(s=e[r/4]),n[r]=s>>>24,s<<=8;return n},toBits(e){const t=[];let n,s=0;for(n=0;n<e.length;n++)s=s<<8|e[n],3==(3&n)&&(t.push(s),s=0);return 3&n&&t.push(I.partial(8*(3&n),s)),t}}},q=class{constructor(e){const t=this;t.blockSize=512,t._init=[1732584193,4023233417,2562383102,271733878,3285377520],t._key=[1518500249,1859775393,2400959708,3395469782],e?(t._h=e._h.slice(0),t._buffer=e._buffer.slice(0),t._length=e._length):t.reset()}reset(){const e=this;return e._h=e._init.slice(0),e._buffer=[],e._length=0,e}update(e){const t=this;"string"==typeof e&&(e=A.utf8String.toBits(e));const n=t._buffer=I.concat(t._buffer,e),s=t._length,a=t._length=s+I.bitLength(e);if(a>9007199254740991)throw new r("Cannot hash more than 2^53 - 1 bits");const o=new i(n);let c=0;for(let e=t.blockSize+s-(t.blockSize+s&t.blockSize-1);a>=e;e+=t.blockSize)t._block(o.subarray(16*c,16*(c+1))),c+=1;return n.splice(0,16*c),t}finalize(){const e=this;let t=e._buffer;const n=e._h;t=I.concat(t,[I.partial(1,1)]);for(let e=t.length+2;15&e;e++)t.push(0);for(t.push(s.floor(e._length/4294967296)),t.push(0|e._length);t.length;)e._block(t.splice(0,16));return e.reset(),n}_f(e,t,n,s){return e>19?e>39?e>59?e>79?void 0:t^n^s:t&n|t&s|n&s:t^n^s:t&n|~t&s}_S(e,t){return t<<e|t>>>32-e}_block(t){const n=this,r=n._h,a=e(80);for(let e=0;16>e;e++)a[e]=t[e];let o=r[0],i=r[1],c=r[2],l=r[3],u=r[4];for(let e=0;79>=e;e++){16>e||(a[e]=n._S(1,a[e-3]^a[e-8]^a[e-14]^a[e-16]));const t=n._S(5,o)+n._f(e,i,c,l)+u+a[e]+n._key[s.floor(e/20)]|0;u=l,l=c,c=n._S(30,i),i=o,o=t}r[0]=r[0]+o|0,r[1]=r[1]+i|0,r[2]=r[2]+c|0,r[3]=r[3]+l|0,r[4]=r[4]+u|0}},R={getRandomValues(e){const t=new i(e.buffer),n=e=>{let t=987654321;const n=4294967295;return()=>(t=36969*(65535&t)+(t>>16)&n,(((t<<16)+(e=18e3*(65535&e)+(e>>16)&n)&n)/4294967296+.5)*(s.random()>.5?1:-1))};for(let r,a=0;a<e.length;a+=4){const e=n(4294967296*(r||s.random()));r=987654071*e(),t[a/4]=4294967296*e()|0}return e}},H={importKey:e=>new H.hmacSha1(A.bytes.toBits(e)),pbkdf2(e,t,n,s){if(n=n||1e4,0>s||0>n)throw new r("invalid params to pbkdf2");const a=1+(s>>5)<<2;let o,i,c,l,h;const f=new ArrayBuffer(a),p=new u(f);let d=0;const g=I;for(t=A.bytes.toBits(t),h=1;(a||1)>d;h++){for(o=i=e.encrypt(g.concat(t,[h])),c=1;n>c;c++)for(i=e.encrypt(i),l=0;l<i.length;l++)o[l]^=i[l];for(c=0;(a||1)>d&&c<o.length;c++)p.setInt32(d,o[c]),d+=4}return f.slice(0,s/8)},hmacSha1:class{constructor(e){const t=this,n=t._hash=q,s=[[],[]];t._baseHash=[new n,new n];const r=t._baseHash[0].blockSize/32;e.length>r&&(e=(new n).update(e).finalize());for(let t=0;r>t;t++)s[0][t]=909522486^e[t],s[1][t]=1549556828^e[t];t._baseHash[0].update(s[0]),t._baseHash[1].update(s[1]),t._resultHash=new n(t._baseHash[0])}reset(){const e=this;e._resultHash=new e._hash(e._baseHash[0]),e._updated=!1}update(e){this._updated=!0,this._resultHash.update(e)}digest(){const e=this,t=e._resultHash.finalize(),n=new e._hash(e._baseHash[1]).update(t).finalize();return e.reset(),n}encrypt(e){if(this._updated)throw new r("encrypt on already updated hmac called!");return this.update(e),this.digest(e)}}},P=typeof p!=S&&typeof p.getRandomValues==v,B="Invalid password",K="Invalid signature",T="zipjs-abort-check-password";function V(e){return P?p.getRandomValues(e):R.getRandomValues(e)}const x=16,E={name:"PBKDF2"},U=t.assign({hash:{name:"HMAC"}},E),W=t.assign({iterations:1e3,hash:{name:"SHA-1"}},E),M=["deriveBits"],N=[8,12,16],O=[16,24,32],L=10,F=[0,0,0,0],j=typeof p!=S,G=j&&p.subtle,X=j&&typeof G!=S,J=A.bytes,Q=class{constructor(e){const t=this;t._tables=[[[],[],[],[],[]],[[],[],[],[],[]]],t._tables[0][0][0]||t._precompute();const n=t._tables[0][4],s=t._tables[1],a=e.length;let o,i,c,l=1;if(4!==a&&6!==a&&8!==a)throw new r("invalid aes key size");for(t._key=[i=e.slice(0),c=[]],o=a;4*a+28>o;o++){let e=i[o-1];(o%a==0||8===a&&o%a==4)&&(e=n[e>>>24]<<24^n[e>>16&255]<<16^n[e>>8&255]<<8^n[255&e],o%a==0&&(e=e<<8^e>>>24^l<<24,l=l<<1^283*(l>>7))),i[o]=i[o-a]^e}for(let e=0;o;e++,o--){const t=i[3&e?o:o-4];c[e]=4>=o||4>e?t:s[0][n[t>>>24]]^s[1][n[t>>16&255]]^s[2][n[t>>8&255]]^s[3][n[255&t]]}}encrypt(e){return this._crypt(e,0)}decrypt(e){return this._crypt(e,1)}_precompute(){const e=this._tables[0],t=this._tables[1],n=e[4],s=t[4],r=[],a=[];let o,i,c,l;for(let e=0;256>e;e++)a[(r[e]=e<<1^283*(e>>7))^e]=e;for(let u=o=0;!n[u];u^=i||1,o=a[o]||1){let a=o^o<<1^o<<2^o<<3^o<<4;a=a>>8^255&a^99,n[u]=a,s[a]=u,l=r[c=r[i=r[u]]];let h=16843009*l^65537*c^257*i^16843008*u,f=257*r[a]^16843008*a;for(let n=0;4>n;n++)e[n][u]=f=f<<24^f>>>8,t[n][a]=h=h<<24^h>>>8}for(let n=0;5>n;n++)e[n]=e[n].slice(0),t[n]=t[n].slice(0)}_crypt(e,t){if(4!==e.length)throw new r("invalid aes block size");const n=this._key[t],s=n.length/4-2,a=[0,0,0,0],o=this._tables[t],i=o[0],c=o[1],l=o[2],u=o[3],h=o[4];let f,p,d,g=e[0]^n[0],w=e[t?3:1]^n[1],y=e[2]^n[2],m=e[t?1:3]^n[3],_=4;for(let e=0;s>e;e++)f=i[g>>>24]^c[w>>16&255]^l[y>>8&255]^u[255&m]^n[_],p=i[w>>>24]^c[y>>16&255]^l[m>>8&255]^u[255&g]^n[_+1],d=i[y>>>24]^c[m>>16&255]^l[g>>8&255]^u[255&w]^n[_+2],m=i[m>>>24]^c[g>>16&255]^l[w>>8&255]^u[255&y]^n[_+3],_+=4,g=f,w=p,y=d;for(let e=0;4>e;e++)a[t?3&-e:e]=h[g>>>24]<<24^h[w>>16&255]<<16^h[y>>8&255]<<8^h[255&m]^n[_++],f=g,g=w,w=y,y=m,m=f;return a}},Y=class{constructor(e,t){this._prf=e,this._initIv=t,this._iv=t}reset(){this._iv=this._initIv}update(e){return this.calculate(this._prf,e,this._iv)}incWord(e){if(255==(e>>24&255)){let t=e>>16&255,n=e>>8&255,s=255&e;255===t?(t=0,255===n?(n=0,255===s?s=0:++s):++n):++t,e=0,e+=t<<16,e+=n<<8,e+=s}else e+=1<<24;return e}incCounter(e){0===(e[0]=this.incWord(e[0]))&&(e[1]=this.incWord(e[1]))}calculate(e,t,n){let s;if(!(s=t.length))return[];const r=I.bitLength(t);for(let r=0;s>r;r+=4){this.incCounter(n);const s=e.encrypt(n);t[r]^=s[0],t[r+1]^=s[1],t[r+2]^=s[2],t[r+3]^=s[3]}return I.clamp(t,r)}},Z=H.hmacSha1;let $=j&&X&&typeof G.importKey==v,ee=j&&X&&typeof G.deriveBits==v;class te extends g{constructor({password:e,rawPassword:n,signed:s,encryptionStrength:o,checkPasswordOnly:i}){super({start(){t.assign(this,{ready:new h((e=>this.resolveReady=e)),password:ae(e,n),signed:s,strength:o-1,pending:new a})},async transform(e,t){const n=this,{password:s,strength:o,resolveReady:c,ready:l}=n;s?(await(async(e,t,n,s)=>{const a=await re(e,t,n,ie(s,0,N[t])),o=ie(s,N[t]);if(a[0]!=o[0]||a[1]!=o[1])throw new r(B)})(n,o,s,ie(e,0,N[o]+2)),e=ie(e,N[o]+2),i?t.error(new r(T)):c()):await l;const u=new a(e.length-L-(e.length-L)%x);t.enqueue(se(n,e,u,0,L,!0))},async flush(e){const{signed:t,ctr:n,hmac:s,pending:o,ready:i}=this;if(s&&n){await i;const c=ie(o,0,o.length-L),l=ie(o,o.length-L);let u=new a;if(c.length){const e=le(J,c);s.update(e);const t=n.update(e);u=ce(J,t)}if(t){const e=ie(ce(J,s.digest()),0,L);for(let t=0;L>t;t++)if(e[t]!=l[t])throw new r(K)}e.enqueue(u)}}})}}class ne extends g{constructor({password:e,rawPassword:n,encryptionStrength:s}){let r;super({start(){t.assign(this,{ready:new h((e=>this.resolveReady=e)),password:ae(e,n),strength:s-1,pending:new a})},async transform(e,t){const n=this,{password:s,strength:r,resolveReady:o,ready:i}=n;let c=new a;s?(c=await(async(e,t,n)=>{const s=V(new a(N[t]));return oe(s,await re(e,t,n,s))})(n,r,s),o()):await i;const l=new a(c.length+e.length-e.length%x);l.set(c,0),t.enqueue(se(n,e,l,c.length,0))},async flush(e){const{ctr:t,hmac:n,pending:s,ready:o}=this;if(n&&t){await o;let i=new a;if(s.length){const e=t.update(le(J,s));n.update(e),i=ce(J,e)}r.signature=ce(J,n.digest()).slice(0,L),e.enqueue(oe(i,r.signature))}}}),r=this}}function se(e,t,n,s,r,o){const{ctr:i,hmac:c,pending:l}=e,u=t.length-r;let h;for(l.length&&(t=oe(l,t),n=((e,t)=>{if(t&&t>e.length){const n=e;(e=new a(t)).set(n,0)}return e})(n,u-u%x)),h=0;u-x>=h;h+=x){const e=le(J,ie(t,h,h+x));o&&c.update(e);const r=i.update(e);o||c.update(r),n.set(ce(J,r),h+s)}return e.pending=ie(t,h),n}async function re(n,s,r,o){n.password=null;const i=await(async(e,t,n,s,r)=>{if(!$)return H.importKey(t);try{return await G.importKey("raw",t,n,!1,r)}catch(e){return $=!1,H.importKey(t)}})(0,r,U,0,M),c=await(async(e,t,n)=>{if(!ee)return H.pbkdf2(t,e.salt,W.iterations,n);try{return await G.deriveBits(e,t,n)}catch(s){return ee=!1,H.pbkdf2(t,e.salt,W.iterations,n)}})(t.assign({salt:o},W),i,8*(2*O[s]+2)),l=new a(c),u=le(J,ie(l,0,O[s])),h=le(J,ie(l,O[s],2*O[s])),f=ie(l,2*O[s]);return t.assign(n,{keys:{key:u,authentication:h,passwordVerification:f},ctr:new Y(new Q(u),e.from(F)),hmac:new Z(h)}),f}function ae(e,t){return t===b?(e=>{if(typeof f==S){const t=new a((e=unescape(encodeURIComponent(e))).length);for(let n=0;n<t.length;n++)t[n]=e.charCodeAt(n);return t}return(new f).encode(e)})(e):t}function oe(e,t){let n=e;return e.length+t.length&&(n=new a(e.length+t.length),n.set(e,0),n.set(t,e.length)),n}function ie(e,t,n){return e.subarray(t,n)}function ce(e,t){return e.fromBits(t)}function le(e,t){return e.toBits(t)}class ue extends g{constructor({password:e,passwordVerification:n,checkPasswordOnly:s}){super({start(){t.assign(this,{password:e,passwordVerification:n}),de(this,e)},transform(e,t){const n=this;if(n.password){const t=fe(n,e.subarray(0,12));if(n.password=null,t[11]!=n.passwordVerification)throw new r(B);e=e.subarray(12)}s?t.error(new r(T)):t.enqueue(fe(n,e))}})}}class he extends g{constructor({password:e,passwordVerification:n}){super({start(){t.assign(this,{password:e,passwordVerification:n}),de(this,e)},transform(e,t){const n=this;let s,r;if(n.password){n.password=null;const t=V(new a(12));t[11]=n.passwordVerification,s=new a(e.length+t.length),s.set(pe(n,t),0),r=12}else s=new a(e.length),r=0;s.set(pe(n,e),r),t.enqueue(s)}})}}function fe(e,t){const n=new a(t.length);for(let s=0;s<t.length;s++)n[s]=we(e)^t[s],ge(e,n[s]);return n}function pe(e,t){const n=new a(t.length);for(let s=0;s<t.length;s++)n[s]=we(e)^t[s],ge(e,t[s]);return n}function de(e,n){const s=[305419896,591751049,878082192];t.assign(e,{keys:s,crcKey0:new D(s[0]),crcKey2:new D(s[2])});for(let t=0;t<n.length;t++)ge(e,n.charCodeAt(t))}function ge(e,t){let[n,r,a]=e.keys;e.crcKey0.append([t]),n=~e.crcKey0.get(),r=me(s.imul(me(r+ye(n)),134775813)+1),e.crcKey2.append([r>>>24]),a=~e.crcKey2.get(),e.keys=[n,r,a]}function we(e){const t=2|e.keys[2];return ye(s.imul(t,1^t)>>>8)}function ye(e){return 255&e}function me(e){return 4294967295&e}const _e="deflate-raw";class be extends g{constructor(e,{chunkSize:t,CompressionStream:n,CompressionStreamNative:s}){super({});const{compressed:r,encrypted:a,useCompressionStream:o,zipCrypto:i,signed:c,level:l}=e,h=this;let f,p,d=ve(super.readable);a&&!i||!c||(f=new C,d=De(d,f)),r&&(d=ze(d,o,{level:l,chunkSize:t},s,n)),a&&(i?d=De(d,new he(e)):(p=new ne(e),d=De(d,p))),ke(h,d,(()=>{let e;a&&!i&&(e=p.signature),a&&!i||!c||(e=new u(f.value.buffer).getUint32(0)),h.signature=e}))}}class Se extends g{constructor(e,{chunkSize:t,DecompressionStream:n,DecompressionStreamNative:s}){super({});const{zipCrypto:a,encrypted:o,signed:i,signature:c,compressed:l,useCompressionStream:h}=e;let f,p,d=ve(super.readable);o&&(a?d=De(d,new ue(e)):(p=new te(e),d=De(d,p))),l&&(d=ze(d,h,{chunkSize:t},s,n)),o&&!a||!i||(f=new C,d=De(d,f)),ke(this,d,(()=>{if((!o||a)&&i){const e=new u(f.value.buffer);if(c!=e.getUint32(0,!1))throw new r(K)}}))}}function ve(e){return De(e,new g({transform(e,t){e&&e.length&&t.enqueue(e)}}))}function ke(e,n,s){n=De(n,new g({flush:s})),t.defineProperty(e,"readable",{get:()=>n})}function ze(e,t,n,s,r){try{e=De(e,new(t&&s?s:r)(_e,n))}catch(s){if(!t)return e;try{e=De(e,new r(_e,n))}catch(t){return e}}return e}function De(e,t){return e.pipeThrough(t)}const Ce="data",Ie="close";class Ae extends g{constructor(e,n){super({});const s=this,{codecType:r}=e;let a;r.startsWith("deflate")?a=be:r.startsWith("inflate")&&(a=Se);let o=0,i=0;const c=new a(e,n),l=super.readable,u=new g({transform(e,t){e&&e.length&&(i+=e.length,t.enqueue(e))},flush(){t.assign(s,{inputSize:i})}}),h=new g({transform(e,t){e&&e.length&&(o+=e.length,t.enqueue(e))},flush(){const{signature:e}=c;t.assign(s,{signature:e,outputSize:o,inputSize:i})}});t.defineProperty(s,"readable",{get:()=>l.pipeThrough(u).pipeThrough(c).pipeThrough(h)})}}class qe extends g{constructor(e){let t;super({transform:function n(s,r){if(t){const e=new a(t.length+s.length);e.set(t),e.set(s,t.length),s=e,t=null}s.length>e?(r.enqueue(s.slice(0,e)),n(s.slice(e),r)):t=s},flush(e){t&&t.length&&e.enqueue(t)}})}}const Re=new l,He=new l;let Pe,Be=0,Ke=!0;async function Te(e){try{const{options:t,scripts:s,config:r}=e;if(s&&s.length)try{Ke?importScripts.apply(b,s):await Ve(s)}catch(e){Ke=!1,await Ve(s)}self.initCodec&&self.initCodec(),r.CompressionStreamNative=self.CompressionStream,r.DecompressionStreamNative=self.DecompressionStream,self.Deflate&&(r.CompressionStream=new k(self.Deflate)),self.Inflate&&(r.DecompressionStream=new k(self.Inflate));const a={highWaterMark:1},o=e.readable||new w({async pull(e){const t=new h((e=>Re.set(Be,e)));xe({type:"pull",messageId:Be}),Be=(Be+1)%n.MAX_SAFE_INTEGER;const{value:s,done:r}=await t;e.enqueue(s),r&&e.close()}},a),i=e.writable||new y({async write(e){let t;const s=new h((e=>t=e));He.set(Be,t),xe({type:Ce,value:e,messageId:Be}),Be=(Be+1)%n.MAX_SAFE_INTEGER,await s}},a),c=new Ae(t,r);Pe=new AbortController;const{signal:l}=Pe;await o.pipeThrough(c).pipeThrough(new qe(r.chunkSize)).pipeTo(i,{signal:l,preventClose:!0,preventAbort:!0});try{await i.getWriter().close()}catch(e){}const{signature:u,inputSize:f,outputSize:p}=c;xe({type:Ie,result:{signature:u,inputSize:f,outputSize:p}})}catch(e){Ee(e)}}async function Ve(e){for(const t of e)await import(t)}function xe(e){let{value:t}=e;if(t)if(t.length)try{t=new a(t),e.value=t.buffer,d(e,[e.value])}catch(t){d(e)}else d(e);else d(e)}function Ee(e=new r("Unknown error")){const{message:t,stack:n,code:s,name:a}=e;d({error:{message:t,stack:n,code:s,name:a}})}function Ue(e,n,s){return class{constructor(r){const o=this;var i,c;i=r,c="level",(typeof t.hasOwn===v?t.hasOwn(i,c):i.hasOwnProperty(c))&&r.level===b&&delete r.level,o.codec=new e(t.assign({},n,r)),s(o.codec,(e=>{if(o.pendingData){const t=o.pendingData;o.pendingData=new a(t.length+e.length);const{pendingData:n}=o;n.set(t,0),n.set(e,t.length)}else o.pendingData=new a(e)}))}append(e){return this.codec.push(e),r(this)}flush(){return this.codec.push(new a,!0),r(this)}};function r(e){if(e.pendingData){const t=e.pendingData;return e.pendingData=null,t}return new a}}addEventListener("message",(({data:e})=>{const{type:t,messageId:n,value:s,done:r}=e;try{if("start"==t&&Te(e),t==Ce){const e=Re.get(n);Re.delete(n),e({value:new a(s),done:r})}if("ack"==t){const e=He.get(n);He.delete(n),e()}t==Ie&&Pe.abort()}catch(e){Ee(e)}})),self.initCodec=()=>{const{Deflate:e,Inflate:t}=((e,t={},n)=>({Deflate:Ue(e.Deflate,t.deflate,n),Inflate:Ue(e.Inflate,t.inflate,n)}))(pako,{deflate:{raw:!0},inflate:{raw:!0}},((e,t)=>e.onData=t));self.Deflate=e,self.Inflate=t}}();
@@ -1,23 +1,46 @@
1
+ import DeveloperError from "../Core/DeveloperError.js";
2
+ import defaultValue from "../Core/defaultValue.js";
1
3
  import defined from "../Core/defined.js";
2
4
  import PrimitivePipeline from "../Scene/PrimitivePipeline.js";
3
5
  import createTaskProcessorWorker from "./createTaskProcessorWorker.js";
6
+ /* global require */
4
7
 
5
8
  const moduleCache = {};
6
9
 
7
- async function getModule(moduleName) {
8
- let module = moduleCache[moduleName];
9
- if (!defined(module)) {
10
+ async function getModule(moduleName, modulePath) {
11
+ let module = defaultValue(moduleCache[modulePath] ?? moduleCache[moduleName]);
12
+
13
+ if (defined(module)) {
14
+ return module;
15
+ }
16
+
17
+ if (defined(modulePath)) {
18
+ // ignore moduleName and use the path to import
10
19
  if (typeof exports === "object") {
11
20
  // Use CommonJS-style require.
12
- /* global require */
13
- moduleCache[module] = module = require(`Workers/${moduleName}`);
21
+ module = require(modulePath);
14
22
  } else {
15
23
  // Use ESM-style dynamic import
16
- const result = await import(`./${moduleName}.js`);
24
+ const result = await import(modulePath);
17
25
  module = result.default;
18
- moduleCache[module] = module;
19
26
  }
27
+
28
+ moduleCache[modulePath] = module;
29
+ return module;
20
30
  }
31
+
32
+ if (typeof exports === "object") {
33
+ // Use CommonJS-style require.
34
+ module = require(`Workers/${moduleName}`);
35
+ } else {
36
+ // Use ESM-style dynamic import
37
+ const result = defined(modulePath)
38
+ ? await import(modulePath)
39
+ : await import(`./${moduleName}.js`);
40
+ module = result.default;
41
+ }
42
+
43
+ moduleCache[moduleName] = module;
21
44
  return module;
22
45
  }
23
46
 
@@ -30,11 +53,17 @@ async function createGeometry(parameters, transferableObjects) {
30
53
  const task = subTasks[i];
31
54
  const geometry = task.geometry;
32
55
  const moduleName = task.moduleName;
56
+ const modulePath = task.modulePath;
57
+
58
+ if (defined(moduleName) && defined(modulePath)) {
59
+ throw new DeveloperError("Must only set moduleName or modulePath");
60
+ }
33
61
 
34
- if (defined(moduleName)) {
35
- resultsOrPromises[i] = getModule(moduleName).then((createFunction) =>
36
- createFunction(geometry, task.offset)
37
- );
62
+ if (defined(moduleName) || defined(modulePath)) {
63
+ resultsOrPromises[i] = getModule(
64
+ moduleName,
65
+ modulePath
66
+ ).then((createFunction) => createFunction(geometry, task.offset));
38
67
  } else {
39
68
  // Already created geometry
40
69
  resultsOrPromises[i] = geometry;