@loaders.gl/tile-converter 4.0.0-alpha.4 → 4.0.0-alpha.6

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 (407) hide show
  1. package/dist/3d-tiles-attributes-worker.d.ts +28 -0
  2. package/dist/3d-tiles-attributes-worker.d.ts.map +1 -0
  3. package/dist/3d-tiles-attributes-worker.js +3 -0
  4. package/dist/3d-tiles-attributes-worker.js.map +7 -0
  5. package/dist/3d-tiles-converter/3d-tiles-converter.d.ts +90 -0
  6. package/dist/3d-tiles-converter/3d-tiles-converter.d.ts.map +1 -0
  7. package/dist/3d-tiles-converter/3d-tiles-converter.js +273 -231
  8. package/dist/3d-tiles-converter/helpers/b3dm-converter.d.ts +79 -18
  9. package/dist/3d-tiles-converter/helpers/b3dm-converter.d.ts.map +1 -0
  10. package/dist/3d-tiles-converter/helpers/b3dm-converter.js +269 -236
  11. package/dist/3d-tiles-converter/helpers/i3s-obb-to-3d-tiles-obb.d.ts +4 -7
  12. package/dist/3d-tiles-converter/helpers/i3s-obb-to-3d-tiles-obb.d.ts.map +1 -0
  13. package/dist/3d-tiles-converter/helpers/i3s-obb-to-3d-tiles-obb.js +22 -9
  14. package/dist/3d-tiles-converter/helpers/texture-atlas.d.ts +9 -0
  15. package/dist/3d-tiles-converter/helpers/texture-atlas.d.ts.map +1 -0
  16. package/dist/3d-tiles-converter/helpers/texture-atlas.js +47 -28
  17. package/dist/3d-tiles-converter/json-templates/tileset.d.ts +15 -0
  18. package/dist/3d-tiles-converter/json-templates/tileset.d.ts.map +1 -0
  19. package/dist/3d-tiles-converter/json-templates/tileset.js +42 -36
  20. package/dist/bundle.d.ts +2 -0
  21. package/dist/bundle.d.ts.map +1 -0
  22. package/dist/bundle.js +2 -2
  23. package/dist/constants.d.ts +2 -0
  24. package/dist/constants.d.ts.map +1 -0
  25. package/dist/constants.js +4 -0
  26. package/dist/converter-cli.d.ts +2 -0
  27. package/dist/converter-cli.d.ts.map +1 -0
  28. package/dist/converter-cli.js +280 -0
  29. package/dist/converter.min.js +186 -190
  30. package/dist/deps-installer/deps-installer.d.ts +11 -3
  31. package/dist/deps-installer/deps-installer.d.ts.map +1 -0
  32. package/dist/deps-installer/deps-installer.js +60 -23
  33. package/dist/dist.min.js +63496 -0
  34. package/dist/es5/3d-tiles-attributes-worker.js +25 -0
  35. package/dist/es5/3d-tiles-attributes-worker.js.map +1 -0
  36. package/dist/es5/3d-tiles-converter/3d-tiles-converter.js +470 -0
  37. package/dist/es5/3d-tiles-converter/3d-tiles-converter.js.map +1 -0
  38. package/dist/es5/3d-tiles-converter/helpers/b3dm-converter.js +301 -0
  39. package/dist/es5/3d-tiles-converter/helpers/b3dm-converter.js.map +1 -0
  40. package/dist/es5/3d-tiles-converter/helpers/i3s-obb-to-3d-tiles-obb.js +18 -0
  41. package/dist/es5/3d-tiles-converter/helpers/i3s-obb-to-3d-tiles-obb.js.map +1 -0
  42. package/dist/es5/3d-tiles-converter/helpers/texture-atlas.js +33 -0
  43. package/dist/es5/3d-tiles-converter/helpers/texture-atlas.js.map +1 -0
  44. package/dist/es5/3d-tiles-converter/json-templates/tileset.js +61 -0
  45. package/dist/es5/3d-tiles-converter/json-templates/tileset.js.map +1 -0
  46. package/dist/es5/bundle.js +6 -0
  47. package/dist/es5/bundle.js.map +1 -0
  48. package/dist/es5/constants.js +9 -0
  49. package/dist/es5/constants.js.map +1 -0
  50. package/dist/es5/converter-cli.js +289 -0
  51. package/dist/es5/converter-cli.js.map +1 -0
  52. package/dist/es5/deps-installer/deps-installer.js +123 -0
  53. package/dist/es5/deps-installer/deps-installer.js.map +1 -0
  54. package/dist/es5/i3s-attributes-worker.js +25 -0
  55. package/dist/es5/i3s-attributes-worker.js.map +1 -0
  56. package/dist/es5/i3s-converter/helpers/batch-ids-extensions.js +116 -0
  57. package/dist/es5/i3s-converter/helpers/batch-ids-extensions.js.map +1 -0
  58. package/dist/es5/i3s-converter/helpers/coordinate-converter.js +90 -0
  59. package/dist/es5/i3s-converter/helpers/coordinate-converter.js.map +1 -0
  60. package/dist/es5/i3s-converter/helpers/create-scene-server-path.js +41 -0
  61. package/dist/es5/i3s-converter/helpers/create-scene-server-path.js.map +1 -0
  62. package/dist/es5/i3s-converter/helpers/feature-attributes.js +174 -0
  63. package/dist/es5/i3s-converter/helpers/feature-attributes.js.map +1 -0
  64. package/dist/es5/i3s-converter/helpers/geometry-attributes.js +213 -0
  65. package/dist/es5/i3s-converter/helpers/geometry-attributes.js.map +1 -0
  66. package/dist/es5/i3s-converter/helpers/geometry-converter.js +1173 -0
  67. package/dist/es5/i3s-converter/helpers/geometry-converter.js.map +1 -0
  68. package/dist/es5/i3s-converter/helpers/gltf-attributes.js +83 -0
  69. package/dist/es5/i3s-converter/helpers/gltf-attributes.js.map +1 -0
  70. package/dist/es5/i3s-converter/helpers/node-debug.js +76 -0
  71. package/dist/es5/i3s-converter/helpers/node-debug.js.map +1 -0
  72. package/dist/es5/i3s-converter/helpers/node-index-document.js +492 -0
  73. package/dist/es5/i3s-converter/helpers/node-index-document.js.map +1 -0
  74. package/dist/es5/i3s-converter/helpers/node-pages.js +519 -0
  75. package/dist/es5/i3s-converter/helpers/node-pages.js.map +1 -0
  76. package/dist/es5/i3s-converter/i3s-converter.js +1519 -0
  77. package/dist/es5/i3s-converter/i3s-converter.js.map +1 -0
  78. package/dist/es5/i3s-converter/json-templates/geometry-definitions.js +107 -0
  79. package/dist/es5/i3s-converter/json-templates/geometry-definitions.js.map +1 -0
  80. package/dist/es5/i3s-converter/json-templates/layers.js +163 -0
  81. package/dist/es5/i3s-converter/json-templates/layers.js.map +1 -0
  82. package/dist/es5/i3s-converter/json-templates/metadata.js +31 -0
  83. package/dist/es5/i3s-converter/json-templates/metadata.js.map +1 -0
  84. package/dist/es5/i3s-converter/json-templates/node.js +99 -0
  85. package/dist/es5/i3s-converter/json-templates/node.js.map +1 -0
  86. package/dist/es5/i3s-converter/json-templates/scene-server.js +39 -0
  87. package/dist/es5/i3s-converter/json-templates/scene-server.js.map +1 -0
  88. package/dist/es5/i3s-converter/json-templates/shared-resources.js +173 -0
  89. package/dist/es5/i3s-converter/json-templates/shared-resources.js.map +1 -0
  90. package/dist/es5/i3s-converter/json-templates/store.js +107 -0
  91. package/dist/es5/i3s-converter/json-templates/store.js.map +1 -0
  92. package/dist/es5/i3s-converter/types.js +2 -0
  93. package/dist/es5/i3s-converter/types.js.map +1 -0
  94. package/dist/es5/i3s-server/app.js +18 -0
  95. package/dist/es5/i3s-server/app.js.map +1 -0
  96. package/dist/es5/i3s-server/controllers/index-controller.js +55 -0
  97. package/dist/es5/i3s-server/controllers/index-controller.js.map +1 -0
  98. package/dist/es5/i3s-server/routes/index.js +37 -0
  99. package/dist/es5/i3s-server/routes/index.js.map +1 -0
  100. package/dist/es5/index.js +21 -0
  101. package/dist/es5/index.js.map +1 -0
  102. package/dist/es5/lib/utils/compress-util.js +346 -0
  103. package/dist/es5/lib/utils/compress-util.js.map +1 -0
  104. package/dist/es5/lib/utils/file-utils.js +208 -0
  105. package/dist/es5/lib/utils/file-utils.js.map +1 -0
  106. package/dist/es5/lib/utils/lod-conversion-utils.js +44 -0
  107. package/dist/es5/lib/utils/lod-conversion-utils.js.map +1 -0
  108. package/dist/es5/lib/utils/queue.js +47 -0
  109. package/dist/es5/lib/utils/queue.js.map +1 -0
  110. package/dist/es5/lib/utils/statistic-utills.d.ts +25 -0
  111. package/dist/es5/lib/utils/statistic-utills.js +147 -0
  112. package/dist/es5/lib/utils/statistic-utills.js.map +1 -0
  113. package/dist/es5/lib/utils/write-queue.js +214 -0
  114. package/dist/es5/lib/utils/write-queue.js.map +1 -0
  115. package/dist/es5/pgm-loader.js +41 -0
  116. package/dist/es5/pgm-loader.js.map +1 -0
  117. package/dist/es5/workers/3d-tiles-attributes-worker.js +28 -0
  118. package/dist/es5/workers/3d-tiles-attributes-worker.js.map +1 -0
  119. package/dist/es5/workers/i3s-attributes-worker.js +30 -0
  120. package/dist/es5/workers/i3s-attributes-worker.js.map +1 -0
  121. package/dist/esm/3d-tiles-attributes-worker.js +16 -0
  122. package/dist/esm/3d-tiles-attributes-worker.js.map +1 -0
  123. package/dist/esm/3d-tiles-converter/3d-tiles-converter.js +248 -0
  124. package/dist/esm/3d-tiles-converter/3d-tiles-converter.js.map +1 -0
  125. package/dist/esm/3d-tiles-converter/helpers/b3dm-converter.js +224 -0
  126. package/dist/esm/3d-tiles-converter/helpers/b3dm-converter.js.map +1 -0
  127. package/dist/esm/3d-tiles-converter/helpers/i3s-obb-to-3d-tiles-obb.js +10 -0
  128. package/dist/esm/3d-tiles-converter/helpers/i3s-obb-to-3d-tiles-obb.js.map +1 -0
  129. package/dist/esm/3d-tiles-converter/helpers/texture-atlas.js +27 -0
  130. package/dist/esm/3d-tiles-converter/helpers/texture-atlas.js.map +1 -0
  131. package/dist/esm/3d-tiles-converter/json-templates/tileset.js +37 -0
  132. package/dist/esm/3d-tiles-converter/json-templates/tileset.js.map +1 -0
  133. package/dist/esm/bundle.js +4 -0
  134. package/dist/esm/bundle.js.map +1 -0
  135. package/dist/esm/constants.js +2 -0
  136. package/dist/esm/constants.js.map +1 -0
  137. package/dist/esm/converter-cli.js +232 -0
  138. package/dist/esm/converter-cli.js.map +1 -0
  139. package/dist/esm/deps-installer/deps-installer.js +44 -0
  140. package/dist/esm/deps-installer/deps-installer.js.map +1 -0
  141. package/dist/esm/i3s-attributes-worker.js +16 -0
  142. package/dist/esm/i3s-attributes-worker.js.map +1 -0
  143. package/dist/esm/i3s-converter/helpers/batch-ids-extensions.js +105 -0
  144. package/dist/esm/i3s-converter/helpers/batch-ids-extensions.js.map +1 -0
  145. package/dist/esm/i3s-converter/helpers/coordinate-converter.js +80 -0
  146. package/dist/esm/i3s-converter/helpers/coordinate-converter.js.map +1 -0
  147. package/dist/esm/i3s-converter/helpers/create-scene-server-path.js +16 -0
  148. package/dist/esm/i3s-converter/helpers/create-scene-server-path.js.map +1 -0
  149. package/dist/esm/i3s-converter/helpers/feature-attributes.js +147 -0
  150. package/dist/esm/i3s-converter/helpers/feature-attributes.js.map +1 -0
  151. package/{src → dist/esm}/i3s-converter/helpers/geometry-attributes.js +80 -106
  152. package/dist/esm/i3s-converter/helpers/geometry-attributes.js.map +1 -0
  153. package/dist/esm/i3s-converter/helpers/geometry-converter.js +887 -0
  154. package/dist/esm/i3s-converter/helpers/geometry-converter.js.map +1 -0
  155. package/dist/esm/i3s-converter/helpers/gltf-attributes.js +76 -0
  156. package/dist/esm/i3s-converter/helpers/gltf-attributes.js.map +1 -0
  157. package/{src → dist/esm}/i3s-converter/helpers/node-debug.js +20 -41
  158. package/dist/esm/i3s-converter/helpers/node-debug.js.map +1 -0
  159. package/dist/esm/i3s-converter/helpers/node-index-document.js +188 -0
  160. package/dist/esm/i3s-converter/helpers/node-index-document.js.map +1 -0
  161. package/dist/esm/i3s-converter/helpers/node-pages.js +206 -0
  162. package/dist/esm/i3s-converter/helpers/node-pages.js.map +1 -0
  163. package/dist/esm/i3s-converter/i3s-converter.js +771 -0
  164. package/dist/esm/i3s-converter/i3s-converter.js.map +1 -0
  165. package/dist/esm/i3s-converter/json-templates/geometry-definitions.js +89 -0
  166. package/dist/esm/i3s-converter/json-templates/geometry-definitions.js.map +1 -0
  167. package/dist/esm/i3s-converter/json-templates/layers.js +133 -0
  168. package/dist/esm/i3s-converter/json-templates/layers.js.map +1 -0
  169. package/dist/esm/i3s-converter/json-templates/metadata.js +22 -0
  170. package/dist/esm/i3s-converter/json-templates/metadata.js.map +1 -0
  171. package/dist/esm/i3s-converter/json-templates/node.js +80 -0
  172. package/dist/esm/i3s-converter/json-templates/node.js.map +1 -0
  173. package/dist/esm/i3s-converter/json-templates/scene-server.js +28 -0
  174. package/dist/esm/i3s-converter/json-templates/scene-server.js.map +1 -0
  175. package/dist/esm/i3s-converter/json-templates/shared-resources.js +123 -0
  176. package/dist/esm/i3s-converter/json-templates/shared-resources.js.map +1 -0
  177. package/dist/esm/i3s-converter/json-templates/store.js +98 -0
  178. package/dist/esm/i3s-converter/json-templates/store.js.map +1 -0
  179. package/dist/esm/i3s-converter/types.js +2 -0
  180. package/dist/esm/i3s-converter/types.js.map +1 -0
  181. package/dist/esm/i3s-server/app.js +16 -0
  182. package/dist/esm/i3s-server/app.js.map +1 -0
  183. package/dist/esm/i3s-server/bin/www +102 -0
  184. package/dist/esm/i3s-server/certs/cert.pem +19 -0
  185. package/dist/esm/i3s-server/certs/key.pem +27 -0
  186. package/dist/esm/i3s-server/controllers/index-controller.js +24 -0
  187. package/dist/esm/i3s-server/controllers/index-controller.js.map +1 -0
  188. package/dist/esm/i3s-server/routes/index.js +16 -0
  189. package/dist/esm/i3s-server/routes/index.js.map +1 -0
  190. package/dist/esm/index.js +3 -0
  191. package/dist/esm/index.js.map +1 -0
  192. package/dist/esm/lib/utils/compress-util.js +168 -0
  193. package/dist/esm/lib/utils/compress-util.js.map +1 -0
  194. package/dist/esm/lib/utils/file-utils.js +87 -0
  195. package/dist/esm/lib/utils/file-utils.js.map +1 -0
  196. package/dist/esm/lib/utils/lod-conversion-utils.js +37 -0
  197. package/dist/esm/lib/utils/lod-conversion-utils.js.map +1 -0
  198. package/dist/esm/lib/utils/queue.js +15 -0
  199. package/dist/esm/lib/utils/queue.js.map +1 -0
  200. package/dist/esm/lib/utils/statistic-utills.d.ts +25 -0
  201. package/dist/esm/lib/utils/statistic-utills.js +62 -0
  202. package/dist/esm/lib/utils/statistic-utills.js.map +1 -0
  203. package/dist/esm/lib/utils/write-queue.js +85 -0
  204. package/dist/esm/lib/utils/write-queue.js.map +1 -0
  205. package/dist/esm/pgm-loader.js +15 -0
  206. package/dist/esm/pgm-loader.js.map +1 -0
  207. package/dist/esm/workers/3d-tiles-attributes-worker.js +8 -0
  208. package/dist/esm/workers/3d-tiles-attributes-worker.js.map +1 -0
  209. package/dist/esm/workers/i3s-attributes-worker.js +7 -0
  210. package/dist/esm/workers/i3s-attributes-worker.js.map +1 -0
  211. package/dist/i3s-attributes-worker.d.ts +37 -0
  212. package/dist/i3s-attributes-worker.d.ts.map +1 -0
  213. package/dist/i3s-attributes-worker.js +9 -0
  214. package/dist/i3s-attributes-worker.js.map +7 -0
  215. package/dist/i3s-converter/helpers/batch-ids-extensions.d.ts +11 -0
  216. package/dist/i3s-converter/helpers/batch-ids-extensions.d.ts.map +1 -0
  217. package/dist/i3s-converter/helpers/batch-ids-extensions.js +141 -0
  218. package/dist/i3s-converter/helpers/coordinate-converter.d.ts +41 -0
  219. package/dist/i3s-converter/helpers/coordinate-converter.d.ts.map +1 -0
  220. package/dist/i3s-converter/helpers/coordinate-converter.js +120 -42
  221. package/dist/i3s-converter/helpers/create-scene-server-path.d.ts +9 -0
  222. package/dist/i3s-converter/helpers/create-scene-server-path.d.ts.map +1 -0
  223. package/dist/i3s-converter/helpers/create-scene-server-path.js +27 -15
  224. package/dist/i3s-converter/helpers/feature-attributes.d.ts +56 -0
  225. package/dist/i3s-converter/helpers/feature-attributes.d.ts.map +1 -0
  226. package/dist/i3s-converter/helpers/feature-attributes.js +216 -0
  227. package/dist/i3s-converter/helpers/geometry-attributes.d.ts +8 -0
  228. package/dist/i3s-converter/helpers/geometry-attributes.d.ts.map +1 -0
  229. package/dist/i3s-converter/helpers/geometry-attributes.js +188 -185
  230. package/dist/i3s-converter/helpers/geometry-converter.d.ts +36 -35
  231. package/dist/i3s-converter/helpers/geometry-converter.d.ts.map +1 -0
  232. package/dist/i3s-converter/helpers/geometry-converter.js +1149 -650
  233. package/dist/i3s-converter/helpers/gltf-attributes.d.ts +9 -0
  234. package/dist/i3s-converter/helpers/gltf-attributes.d.ts.map +1 -0
  235. package/dist/i3s-converter/helpers/gltf-attributes.js +88 -0
  236. package/dist/i3s-converter/helpers/node-debug.d.ts +8 -0
  237. package/dist/i3s-converter/helpers/node-debug.d.ts.map +1 -0
  238. package/dist/i3s-converter/helpers/node-debug.js +106 -74
  239. package/dist/i3s-converter/helpers/node-index-document.d.ts +95 -0
  240. package/dist/i3s-converter/helpers/node-index-document.d.ts.map +1 -0
  241. package/dist/i3s-converter/helpers/node-index-document.js +250 -0
  242. package/dist/i3s-converter/helpers/node-pages.d.ts +125 -113
  243. package/dist/i3s-converter/helpers/node-pages.d.ts.map +1 -0
  244. package/dist/i3s-converter/helpers/node-pages.js +313 -133
  245. package/dist/i3s-converter/i3s-converter.d.ts +267 -0
  246. package/dist/i3s-converter/i3s-converter.d.ts.map +1 -0
  247. package/dist/i3s-converter/i3s-converter.js +860 -861
  248. package/dist/i3s-converter/json-templates/geometry-definitions.d.ts +7 -0
  249. package/dist/i3s-converter/json-templates/geometry-definitions.d.ts.map +1 -0
  250. package/dist/i3s-converter/json-templates/geometry-definitions.js +87 -0
  251. package/dist/i3s-converter/json-templates/layers.d.ts +70 -0
  252. package/dist/i3s-converter/json-templates/layers.d.ts.map +1 -0
  253. package/dist/i3s-converter/json-templates/layers.js +138 -190
  254. package/dist/i3s-converter/json-templates/metadata.d.ts +22 -0
  255. package/dist/i3s-converter/json-templates/metadata.d.ts.map +1 -0
  256. package/dist/i3s-converter/json-templates/metadata.js +25 -22
  257. package/dist/i3s-converter/json-templates/node.d.ts +61 -0
  258. package/dist/i3s-converter/json-templates/node.d.ts.map +1 -0
  259. package/dist/i3s-converter/json-templates/node.js +88 -79
  260. package/dist/i3s-converter/json-templates/scene-server.d.ts +28 -0
  261. package/dist/i3s-converter/json-templates/scene-server.d.ts.map +1 -0
  262. package/dist/i3s-converter/json-templates/scene-server.js +31 -28
  263. package/dist/i3s-converter/json-templates/shared-resources.d.ts +14 -0
  264. package/dist/i3s-converter/json-templates/shared-resources.d.ts.map +1 -0
  265. package/dist/i3s-converter/json-templates/shared-resources.js +124 -125
  266. package/dist/i3s-converter/json-templates/store.d.ts +95 -0
  267. package/dist/i3s-converter/json-templates/store.d.ts.map +1 -0
  268. package/dist/i3s-converter/json-templates/store.js +100 -95
  269. package/dist/i3s-converter/types.d.ts +145 -0
  270. package/dist/i3s-converter/types.d.ts.map +1 -0
  271. package/dist/i3s-converter/types.js +2 -0
  272. package/dist/i3s-server/app.d.ts +3 -0
  273. package/dist/i3s-server/app.d.ts.map +1 -0
  274. package/dist/i3s-server/app.js +2 -9
  275. package/dist/i3s-server/controllers/index-controller.d.ts +2 -0
  276. package/dist/i3s-server/controllers/index-controller.d.ts.map +1 -0
  277. package/dist/i3s-server/controllers/index-controller.js +16 -24
  278. package/dist/i3s-server/routes/index.d.ts +3 -0
  279. package/dist/i3s-server/routes/index.d.ts.map +1 -0
  280. package/dist/i3s-server/routes/index.js +11 -15
  281. package/dist/index.d.ts +3 -0
  282. package/dist/index.d.ts.map +1 -0
  283. package/dist/index.js +10 -5
  284. package/dist/lib/utils/compress-util.d.ts +45 -0
  285. package/dist/lib/utils/compress-util.d.ts.map +1 -0
  286. package/dist/lib/utils/compress-util.js +238 -160
  287. package/dist/lib/utils/file-utils.d.ts +22 -14
  288. package/dist/lib/utils/file-utils.d.ts.map +1 -0
  289. package/dist/lib/utils/file-utils.js +133 -36
  290. package/dist/lib/utils/lod-conversion-utils.d.ts +21 -12
  291. package/dist/lib/utils/lod-conversion-utils.d.ts.map +1 -0
  292. package/dist/lib/utils/lod-conversion-utils.js +72 -39
  293. package/dist/lib/utils/queue.d.ts +7 -0
  294. package/dist/lib/utils/queue.d.ts.map +1 -0
  295. package/dist/lib/utils/queue.js +18 -0
  296. package/dist/lib/utils/statistic-utills.d.ts +3 -25
  297. package/dist/lib/utils/statistic-utills.d.ts.map +1 -0
  298. package/dist/lib/utils/statistic-utills.js +58 -67
  299. package/dist/lib/utils/write-queue.d.ts +39 -0
  300. package/dist/lib/utils/write-queue.d.ts.map +1 -0
  301. package/dist/lib/utils/write-queue.js +80 -0
  302. package/dist/pgm-loader.d.ts +6 -0
  303. package/dist/pgm-loader.d.ts.map +1 -0
  304. package/dist/pgm-loader.js +23 -14
  305. package/dist/workers/3d-tiles-attributes-worker.d.ts +2 -0
  306. package/dist/workers/3d-tiles-attributes-worker.d.ts.map +1 -0
  307. package/dist/workers/3d-tiles-attributes-worker.js +9 -0
  308. package/dist/workers/i3s-attributes-worker.d.ts +2 -0
  309. package/dist/workers/i3s-attributes-worker.d.ts.map +1 -0
  310. package/dist/workers/i3s-attributes-worker.js +5 -0
  311. package/package.json +35 -24
  312. package/src/3d-tiles-attributes-worker.ts +43 -0
  313. package/src/3d-tiles-converter/3d-tiles-converter.ts +124 -59
  314. package/src/3d-tiles-converter/helpers/{b3dm-converter.js → b3dm-converter.ts} +71 -38
  315. package/src/3d-tiles-converter/helpers/{i3s-obb-to-3d-tiles-obb.js → i3s-obb-to-3d-tiles-obb.ts} +16 -1
  316. package/src/3d-tiles-converter/helpers/texture-atlas.ts +4 -4
  317. package/src/3d-tiles-converter/json-templates/{tileset.js → tileset.ts} +9 -9
  318. package/src/constants.ts +2 -0
  319. package/src/converter-cli.ts +370 -0
  320. package/src/deps-installer/deps-installer.ts +71 -0
  321. package/src/i3s-attributes-worker.ts +50 -0
  322. package/src/i3s-converter/helpers/batch-ids-extensions.ts +206 -0
  323. package/src/i3s-converter/helpers/coordinate-converter.ts +87 -27
  324. package/src/i3s-converter/helpers/create-scene-server-path.ts +29 -0
  325. package/src/i3s-converter/helpers/feature-attributes.ts +247 -0
  326. package/src/i3s-converter/helpers/geometry-attributes.ts +267 -0
  327. package/src/i3s-converter/helpers/geometry-converter.ts +1608 -0
  328. package/src/i3s-converter/helpers/gltf-attributes.ts +103 -0
  329. package/src/i3s-converter/helpers/node-debug.ts +146 -0
  330. package/src/i3s-converter/helpers/node-index-document.ts +315 -0
  331. package/src/i3s-converter/helpers/node-pages.ts +344 -0
  332. package/src/i3s-converter/i3s-converter.ts +557 -627
  333. package/src/i3s-converter/json-templates/geometry-definitions.ts +83 -0
  334. package/src/i3s-converter/json-templates/layers.ts +137 -0
  335. package/src/i3s-converter/json-templates/{metadata.js → metadata.ts} +2 -2
  336. package/src/i3s-converter/json-templates/{node.js → node.ts} +12 -12
  337. package/src/i3s-converter/json-templates/{scene-server.js → scene-server.ts} +2 -2
  338. package/src/i3s-converter/json-templates/{shared-resources.js → shared-resources.ts} +17 -17
  339. package/src/i3s-converter/types.ts +165 -0
  340. package/src/index.ts +0 -4
  341. package/src/lib/utils/{compress-util.js → compress-util.ts} +105 -18
  342. package/src/lib/utils/file-utils.ts +139 -0
  343. package/src/lib/utils/{lod-conversion-utils.js → lod-conversion-utils.ts} +27 -5
  344. package/src/lib/utils/queue.ts +17 -0
  345. package/src/lib/utils/write-queue.ts +110 -0
  346. package/src/pgm-loader.ts +3 -3
  347. package/src/workers/3d-tiles-attributes-worker.ts +6 -0
  348. package/src/workers/i3s-attributes-worker.ts +7 -0
  349. package/dist/3d-tiles-converter/3d-tiles-converter.js.map +0 -1
  350. package/dist/3d-tiles-converter/helpers/b3dm-converter.js.map +0 -1
  351. package/dist/3d-tiles-converter/helpers/i3s-obb-to-3d-tiles-obb.js.map +0 -1
  352. package/dist/3d-tiles-converter/helpers/texture-atlas.js.map +0 -1
  353. package/dist/3d-tiles-converter/json-templates/tileset.js.map +0 -1
  354. package/dist/bundle.js.map +0 -1
  355. package/dist/deps-installer/deps-installer.js.map +0 -1
  356. package/dist/i3s-converter/helpers/coordinate-converter.js.map +0 -1
  357. package/dist/i3s-converter/helpers/create-scene-server-path.js.map +0 -1
  358. package/dist/i3s-converter/helpers/geometry-attributes.js.map +0 -1
  359. package/dist/i3s-converter/helpers/geometry-converter.js.map +0 -1
  360. package/dist/i3s-converter/helpers/node-debug.js.map +0 -1
  361. package/dist/i3s-converter/helpers/node-pages.js.map +0 -1
  362. package/dist/i3s-converter/i3s-converter.js.map +0 -1
  363. package/dist/i3s-converter/json-templates/layers.js.map +0 -1
  364. package/dist/i3s-converter/json-templates/metadata.js.map +0 -1
  365. package/dist/i3s-converter/json-templates/node.js.map +0 -1
  366. package/dist/i3s-converter/json-templates/scene-server.js.map +0 -1
  367. package/dist/i3s-converter/json-templates/shared-resources.js.map +0 -1
  368. package/dist/i3s-converter/json-templates/store.js.map +0 -1
  369. package/dist/i3s-server/app.js.map +0 -1
  370. package/dist/i3s-server/controllers/index-controller.js.map +0 -1
  371. package/dist/i3s-server/routes/index.js.map +0 -1
  372. package/dist/index.js.map +0 -1
  373. package/dist/lib/geoid-height-model.d.ts +0 -41
  374. package/dist/lib/geoid-height-model.js +0 -140
  375. package/dist/lib/geoid-height-model.js.map +0 -1
  376. package/dist/lib/pgm-parser.d.ts +0 -14
  377. package/dist/lib/pgm-parser.js +0 -183
  378. package/dist/lib/pgm-parser.js.map +0 -1
  379. package/dist/lib/utils/compress-util.js.map +0 -1
  380. package/dist/lib/utils/compress-utils.d.ts +0 -53
  381. package/dist/lib/utils/file-utils.js.map +0 -1
  382. package/dist/lib/utils/lod-conversion-utils.js.map +0 -1
  383. package/dist/lib/utils/statistic-utills.js.map +0 -1
  384. package/dist/pgm-loader.js.map +0 -1
  385. package/src/3d-tiles-converter/helpers/b3dm-converter.d.ts +0 -23
  386. package/src/3d-tiles-converter/helpers/i3s-obb-to-3d-tiles-obb.d.ts +0 -16
  387. package/src/deps-installer/deps-installer.d.ts +0 -10
  388. package/src/deps-installer/deps-installer.js +0 -22
  389. package/src/i3s-converter/helpers/create-scene-server-path.js +0 -25
  390. package/src/i3s-converter/helpers/geometry-converter.d.ts +0 -40
  391. package/src/i3s-converter/helpers/geometry-converter.js +0 -915
  392. package/src/i3s-converter/helpers/node-pages.d.ts +0 -144
  393. package/src/i3s-converter/helpers/node-pages.js +0 -208
  394. package/src/i3s-converter/json-templates/layers.js +0 -199
  395. package/src/lib/geoid-height-model.d.ts +0 -41
  396. package/src/lib/geoid-height-model.js +0 -239
  397. package/src/lib/pgm-parser.d.ts +0 -14
  398. package/src/lib/pgm-parser.js +0 -179
  399. package/src/lib/utils/compress-utils.d.ts +0 -53
  400. package/src/lib/utils/file-utils.d.ts +0 -43
  401. package/src/lib/utils/file-utils.js +0 -38
  402. package/src/lib/utils/lod-conversion-utils.d.ts +0 -32
  403. /package/dist/{i3s-server → es5/i3s-server}/bin/www +0 -0
  404. /package/dist/{i3s-server → es5/i3s-server}/certs/cert.pem +0 -0
  405. /package/dist/{i3s-server → es5/i3s-server}/certs/key.pem +0 -0
  406. /package/src/i3s-converter/json-templates/{store.js → store.ts} +0 -0
  407. /package/src/lib/utils/{statistic-utills.js → statistic-utills.ts} +0 -0
@@ -0,0 +1,37 @@
1
+ import type { WorkerObject } from '@loaders.gl/worker-utils';
2
+ import type { ConvertedAttributes } from './i3s-converter/types';
3
+ import type { Matrix4, Vector3 } from '@math.gl/core';
4
+ import type { GLTFImagePostprocessed, GLTFNodePostprocessed } from '@loaders.gl/gltf';
5
+ export type I3SAttributesWorkerOptions = {
6
+ _nodeWorkers: boolean;
7
+ reuseWorkers: boolean;
8
+ useCartesianPositions: boolean;
9
+ source: string;
10
+ };
11
+ export type B3DMAttributesData = {
12
+ gltfMaterials?: {
13
+ id: string;
14
+ }[];
15
+ nodes: GLTFNodePostprocessed[];
16
+ images: GLTFImagePostprocessed[];
17
+ cartographicOrigin: Vector3;
18
+ cartesianModelMatrix: Matrix4;
19
+ };
20
+ /**
21
+ * I3S Attributes Worker to handle B3DM object
22
+ */
23
+ export declare const I3SAttributesWorker: {
24
+ id: string;
25
+ name: string;
26
+ module: string;
27
+ version: any;
28
+ options: {
29
+ useCartesianPositions: boolean;
30
+ };
31
+ };
32
+ /**
33
+ * Performs I3S attributes transformation
34
+ */
35
+ export declare function transformI3SAttributesOnWorker(attributesData: B3DMAttributesData, options: I3SAttributesWorkerOptions): Promise<Map<string, ConvertedAttributes>>;
36
+ export declare const _typecheckI3SAttributesWorker: WorkerObject;
37
+ //# sourceMappingURL=i3s-attributes-worker.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"i3s-attributes-worker.d.ts","sourceRoot":"","sources":["../src/i3s-attributes-worker.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,YAAY,EAAC,MAAM,0BAA0B,CAAC;AAC3D,OAAO,KAAK,EAAC,mBAAmB,EAAC,MAAM,uBAAuB,CAAC;AAC/D,OAAO,KAAK,EAAC,OAAO,EAAE,OAAO,EAAC,MAAM,eAAe,CAAC;AACpD,OAAO,KAAK,EAAC,sBAAsB,EAAE,qBAAqB,EAAC,MAAM,kBAAkB,CAAC;AAQpF,MAAM,MAAM,0BAA0B,GAAG;IACvC,YAAY,EAAE,OAAO,CAAC;IACtB,YAAY,EAAE,OAAO,CAAC;IACtB,qBAAqB,EAAE,OAAO,CAAC;IAC/B,MAAM,EAAE,MAAM,CAAC;CAChB,CAAC;AAEF,MAAM,MAAM,kBAAkB,GAAG;IAC/B,aAAa,CAAC,EAAE;QAAC,EAAE,EAAE,MAAM,CAAA;KAAC,EAAE,CAAC;IAC/B,KAAK,EAAE,qBAAqB,EAAE,CAAC;IAC/B,MAAM,EAAE,sBAAsB,EAAE,CAAC;IACjC,kBAAkB,EAAE,OAAO,CAAC;IAC5B,oBAAoB,EAAE,OAAO,CAAC;CAC/B,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,mBAAmB;;;;;;;;CAQ/B,CAAC;AAEF;;GAEG;AACH,wBAAgB,8BAA8B,CAC5C,cAAc,EAAE,kBAAkB,EAClC,OAAO,EAAE,0BAA0B,GAClC,OAAO,CAAC,GAAG,CAAC,MAAM,EAAE,mBAAmB,CAAC,CAAC,CAE3C;AAED,eAAO,MAAM,6BAA6B,EAAE,YAAkC,CAAC"}
@@ -0,0 +1,9 @@
1
+ var Ji=Object.create;var qr=Object.defineProperty;var ji=Object.getOwnPropertyDescriptor;var es=Object.getOwnPropertyNames,Mn=Object.getOwnPropertySymbols,rs=Object.getPrototypeOf,bn=Object.prototype.hasOwnProperty,ts=Object.prototype.propertyIsEnumerable;var xn=(e,r,n)=>r in e?qr(e,r,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[r]=n,Er=(e,r)=>{for(var n in r||(r={}))bn.call(r,n)&&xn(e,n,r[n]);if(Mn)for(var n of Mn(r))ts.call(r,n)&&xn(e,n,r[n]);return e};var ns=e=>qr(e,"__esModule",{value:!0});var P=(e,r)=>()=>(r||e((r={exports:{}}).exports,r),r.exports);var as=(e,r,n)=>{if(r&&typeof r=="object"||typeof r=="function")for(let a of es(r))!bn.call(e,a)&&a!=="default"&&qr(e,a,{get:()=>r[a],enumerable:!(n=ji(r,a))||n.enumerable});return e},Tt=e=>as(ns(qr(e!=null?Ji(rs(e)):{},"default",e&&e.__esModule&&"default"in e?{get:()=>e.default,enumerable:!0}:{value:e,enumerable:!0})),e);var U=P((G1,cr)=>{function us(e){return e&&e.__esModule?e:{default:e}}cr.exports=us,cr.exports.__esModule=!0,cr.exports.default=cr.exports});var j=P((U1,Me)=>{function St(e){return Me.exports=St=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(r){return typeof r}:function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},Me.exports.__esModule=!0,Me.exports.default=Me.exports,St(e)}Me.exports=St,Me.exports.__esModule=!0,Me.exports.default=Me.exports});var $=P((X1,lr)=>{function cs(e,r){if(!(e instanceof r))throw new TypeError("Cannot call a class as a function")}lr.exports=cs,lr.exports.__esModule=!0,lr.exports.default=lr.exports});var Rn=P((Z1,fr)=>{var kn=j().default;function ls(e,r){if(kn(e)!=="object"||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var a=n.call(e,r||"default");if(kn(a)!=="object")return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return(r==="string"?String:Number)(e)}fr.exports=ls,fr.exports.__esModule=!0,fr.exports.default=fr.exports});var qt=P((Q1,hr)=>{var fs=j().default,hs=Rn();function vs(e){var r=hs(e,"string");return fs(r)==="symbol"?r:String(r)}hr.exports=vs,hr.exports.__esModule=!0,hr.exports.default=hr.exports});var H=P(($1,vr)=>{var ds=qt();function Tn(e,r){for(var n=0;n<r.length;n++){var a=r[n];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,ds(a.key),a)}}function ps(e,r,n){return r&&Tn(e.prototype,r),n&&Tn(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}vr.exports=ps,vr.exports.__esModule=!0,vr.exports.default=vr.exports});var Pn=P((H1,be)=>{function Et(e,r){return be.exports=Et=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(a,t){return a.__proto__=t,a},be.exports.__esModule=!0,be.exports.default=be.exports,Et(e,r)}be.exports=Et,be.exports.__esModule=!0,be.exports.default=be.exports});var se=P((K1,dr)=>{var ms=Pn();function ys(e,r){if(typeof r!="function"&&r!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(r&&r.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),r&&ms(e,r)}dr.exports=ys,dr.exports.__esModule=!0,dr.exports.default=dr.exports});var An=P((J1,pr)=>{function gs(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}pr.exports=gs,pr.exports.__esModule=!0,pr.exports.default=pr.exports});var oe=P((j1,mr)=>{var Ms=j().default,bs=An();function xs(e,r){if(r&&(Ms(r)==="object"||typeof r=="function"))return r;if(r!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return bs(e)}mr.exports=xs,mr.exports.__esModule=!0,mr.exports.default=mr.exports});var ue=P((ev,xe)=>{function Lt(e){return xe.exports=Lt=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},xe.exports.__esModule=!0,xe.exports.default=xe.exports,Lt(e)}xe.exports=Lt,xe.exports.__esModule=!0,xe.exports.default=xe.exports});var Nr=P(It=>{"use strict";Object.defineProperty(It,"__esModule",{value:!0});It.default=_s;function _s(e,r){if(!e)throw new Error("math.gl assertion ".concat(r))}});var ve=P(z=>{"use strict";var wn=U();Object.defineProperty(z,"__esModule",{value:!0});z.configure=Ts;z.formatValue=Ps;z.isArray=De;z.clone=As;z.toRadians=ws;z.toDegrees=Ss;z.radians=qn;z.degrees=En;z.sin=qs;z.cos=Es;z.tan=Ls;z.asin=Is;z.acos=Ns;z.atan=Cs;z.clamp=Ws;z.lerp=Ln;z.equals=In;z.exactEquals=Nn;z.withEpsilon=Ds;z.config=void 0;var Sn=wn(j()),Os=wn(Nr()),ks=1/Math.PI*180,Rs=1/180*Math.PI,K={EPSILON:1e-12,debug:!1,precision:4,printTypes:!1,printDegrees:!1,printRowMajor:!0};z.config=K;function Ts(e){for(var r in e)(0,Os.default)(r in K),K[r]=e[r];return K}function Ps(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=r.precision,a=n===void 0?K.precision:n;return e=Fs(e),"".concat(parseFloat(e.toPrecision(a)))}function De(e){return Array.isArray(e)||ArrayBuffer.isView(e)&&!(e instanceof DataView)}function As(e){return"clone"in e?e.clone():e.slice()}function ws(e){return qn(e)}function Ss(e){return En(e)}function qn(e,r){return _e(e,function(n){return n*Rs},r)}function En(e,r){return _e(e,function(n){return n*ks},r)}function qs(e,r){return _e(e,function(n){return Math.sin(n)},r)}function Es(e,r){return _e(e,function(n){return Math.cos(n)},r)}function Ls(e,r){return _e(e,function(n){return Math.tan(n)},r)}function Is(e,r){return _e(e,function(n){return Math.asin(n)},r)}function Ns(e,r){return _e(e,function(n){return Math.acos(n)},r)}function Cs(e,r){return _e(e,function(n){return Math.atan(n)},r)}function Ws(e,r,n){return _e(e,function(a){return Math.max(r,Math.min(n,a))})}function Ln(e,r,n){return De(e)?e.map(function(a,t){return Ln(a,r[t],n)}):n*r+(1-n)*e}function In(e,r,n){var a=K.EPSILON;n&&(K.EPSILON=n);try{if(e===r)return!0;if(De(e)&&De(r)){if(e.length!==r.length)return!1;for(var t=0;t<e.length;++t)if(!In(e[t],r[t]))return!1;return!0}return e&&e.equals?e.equals(r):r&&r.equals?r.equals(e):typeof e=="number"&&typeof r=="number"?Math.abs(e-r)<=K.EPSILON*Math.max(1,Math.abs(e),Math.abs(r)):!1}finally{K.EPSILON=a}}function Nn(e,r){if(e===r)return!0;if(e&&(0,Sn.default)(e)==="object"&&r&&(0,Sn.default)(r)==="object"){if(e.constructor!==r.constructor)return!1;if(e.exactEquals)return e.exactEquals(r)}if(De(e)&&De(r)){if(e.length!==r.length)return!1;for(var n=0;n<e.length;++n)if(!Nn(e[n],r[n]))return!1;return!0}return!1}function Ds(e,r){var n=K.EPSILON;K.EPSILON=e;var a;try{a=r()}finally{K.EPSILON=n}return a}function Fs(e){return Math.round(e/K.EPSILON)*K.EPSILON}function zs(e){return e.clone?e.clone():new Array(e.length)}function _e(e,r,n){if(De(e)){var a=e;n=n||zs(a);for(var t=0;t<n.length&&t<a.length;++t)n[t]=r(e[t],t,n);return n}return r(e)}});var Mr=P(Cr=>{"use strict";var yr=U();Object.defineProperty(Cr,"__esModule",{value:!0});Cr.default=void 0;var Bs=yr($()),Vs=yr(H()),Ys=yr(se()),Gs=yr(oe()),Cn=yr(ue()),gr=ve();function Us(e){var r=Xs();return function(){var a=(0,Cn.default)(e),t;if(r){var i=(0,Cn.default)(this).constructor;t=Reflect.construct(a,arguments,i)}else t=a.apply(this,arguments);return(0,Gs.default)(this,t)}}function Xs(){if(typeof Reflect=="undefined"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function Zs(e){function r(){var n=Reflect.construct(e,Array.from(arguments));return Object.setPrototypeOf(n,Object.getPrototypeOf(this)),n}return r.prototype=Object.create(e.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),Object.setPrototypeOf?Object.setPrototypeOf(r,e):r.__proto__=e,r}var Qs=function(e){(0,Ys.default)(n,e);var r=Us(n);function n(){return(0,Bs.default)(this,n),r.apply(this,arguments)}return(0,Vs.default)(n,[{key:"clone",value:function(){return new this.constructor().copy(this)}},{key:"fromArray",value:function(t){for(var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,s=0;s<this.ELEMENTS;++s)this[s]=t[s+i];return this.check()}},{key:"toArray",value:function(){for(var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,s=0;s<this.ELEMENTS;++s)t[i+s]=this[s];return t}},{key:"from",value:function(t){return Array.isArray(t)?this.copy(t):this.fromObject(t)}},{key:"to",value:function(t){return t===this?this:(0,gr.isArray)(t)?this.toArray(t):this.toObject(t)}},{key:"toTarget",value:function(t){return t?this.to(t):this}},{key:"toFloat32Array",value:function(){return new Float32Array(this)}},{key:"toString",value:function(){return this.formatString(gr.config)}},{key:"formatString",value:function(t){for(var i="",s=0;s<this.ELEMENTS;++s)i+=(s>0?", ":"")+(0,gr.formatValue)(this[s],t);return"".concat(t.printTypes?this.constructor.name:"","[").concat(i,"]")}},{key:"equals",value:function(t){if(!t||this.length!==t.length)return!1;for(var i=0;i<this.ELEMENTS;++i)if(!(0,gr.equals)(this[i],t[i]))return!1;return!0}},{key:"exactEquals",value:function(t){if(!t||this.length!==t.length)return!1;for(var i=0;i<this.ELEMENTS;++i)if(this[i]!==t[i])return!1;return!0}},{key:"negate",value:function(){for(var t=0;t<this.ELEMENTS;++t)this[t]=-this[t];return this.check()}},{key:"lerp",value:function(t,i,s){if(s===void 0)return this.lerp(this,t,i);for(var o=0;o<this.ELEMENTS;++o){var c=t[o];this[o]=c+s*(i[o]-c)}return this.check()}},{key:"min",value:function(t){for(var i=0;i<this.ELEMENTS;++i)this[i]=Math.min(t[i],this[i]);return this.check()}},{key:"max",value:function(t){for(var i=0;i<this.ELEMENTS;++i)this[i]=Math.max(t[i],this[i]);return this.check()}},{key:"clamp",value:function(t,i){for(var s=0;s<this.ELEMENTS;++s)this[s]=Math.min(Math.max(this[s],t[s]),i[s]);return this.check()}},{key:"add",value:function(){for(var t=arguments.length,i=new Array(t),s=0;s<t;s++)i[s]=arguments[s];for(var o=0,c=i;o<c.length;o++)for(var u=c[o],l=0;l<this.ELEMENTS;++l)this[l]+=u[l];return this.check()}},{key:"subtract",value:function(){for(var t=arguments.length,i=new Array(t),s=0;s<t;s++)i[s]=arguments[s];for(var o=0,c=i;o<c.length;o++)for(var u=c[o],l=0;l<this.ELEMENTS;++l)this[l]-=u[l];return this.check()}},{key:"scale",value:function(t){if(typeof t=="number")for(var i=0;i<this.ELEMENTS;++i)this[i]*=t;else for(var s=0;s<this.ELEMENTS&&s<t.length;++s)this[s]*=t[s];return this.check()}},{key:"multiplyByScalar",value:function(t){for(var i=0;i<this.ELEMENTS;++i)this[i]*=t;return this.check()}},{key:"check",value:function(){if(gr.config.debug&&!this.validate())throw new Error("math.gl: ".concat(this.constructor.name," some fields set to invalid numbers'"));return this}},{key:"validate",value:function(){for(var t=this.length===this.ELEMENTS,i=0;i<this.ELEMENTS;++i)t=t&&Number.isFinite(this[i]);return t}},{key:"sub",value:function(t){return this.subtract(t)}},{key:"setScalar",value:function(t){for(var i=0;i<this.ELEMENTS;++i)this[i]=t;return this.check()}},{key:"addScalar",value:function(t){for(var i=0;i<this.ELEMENTS;++i)this[i]+=t;return this.check()}},{key:"subScalar",value:function(t){return this.addScalar(-t)}},{key:"multiplyScalar",value:function(t){for(var i=0;i<this.ELEMENTS;++i)this[i]*=t;return this.check()}},{key:"divideScalar",value:function(t){return this.multiplyByScalar(1/t)}},{key:"clampScalar",value:function(t,i){for(var s=0;s<this.ELEMENTS;++s)this[s]=Math.min(Math.max(this[s],t),i);return this.check()}},{key:"elements",get:function(){return this}}]),n}(Zs(Array));Cr.default=Qs});var de=P(Ze=>{"use strict";Object.defineProperty(Ze,"__esModule",{value:!0});Ze.validateVector=Wn;Ze.checkNumber=Hs;Ze.checkVector=Ks;Ze.deprecated=Js;var $s=ve();function Wn(e,r){if(e.length!==r)return!1;for(var n=0;n<e.length;++n)if(!Number.isFinite(e[n]))return!1;return!0}function Hs(e){if(!Number.isFinite(e))throw new Error("Invalid number ".concat(e));return e}function Ks(e,r){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"";if($s.config.debug&&!Wn(e,r))throw new Error("math.gl: ".concat(n," some fields set to invalid numbers'"));return e}var Dn={};function Js(e,r){Dn[e]||(Dn[e]=!0,console.warn("".concat(e," has been removed in version ").concat(r,", see upgrade guide for more information")))}});var Dr=P(Wr=>{"use strict";var Fe=U();Object.defineProperty(Wr,"__esModule",{value:!0});Wr.default=void 0;var js=Fe($()),eo=Fe(H()),ro=Fe(se()),to=Fe(oe()),Fn=Fe(ue()),no=Fe(Mr()),br=de(),zn=Fe(Nr());function ao(e){var r=io();return function(){var a=(0,Fn.default)(e),t;if(r){var i=(0,Fn.default)(this).constructor;t=Reflect.construct(a,arguments,i)}else t=a.apply(this,arguments);return(0,to.default)(this,t)}}function io(){if(typeof Reflect=="undefined"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}var so=function(e){(0,ro.default)(n,e);var r=ao(n);function n(){return(0,js.default)(this,n),r.apply(this,arguments)}return(0,eo.default)(n,[{key:"x",get:function(){return this[0]},set:function(t){this[0]=(0,br.checkNumber)(t)}},{key:"y",get:function(){return this[1]},set:function(t){this[1]=(0,br.checkNumber)(t)}},{key:"len",value:function(){return Math.sqrt(this.lengthSquared())}},{key:"magnitude",value:function(){return this.len()}},{key:"lengthSquared",value:function(){for(var t=0,i=0;i<this.ELEMENTS;++i)t+=this[i]*this[i];return t}},{key:"magnitudeSquared",value:function(){return this.lengthSquared()}},{key:"distance",value:function(t){return Math.sqrt(this.distanceSquared(t))}},{key:"distanceSquared",value:function(t){for(var i=0,s=0;s<this.ELEMENTS;++s){var o=this[s]-t[s];i+=o*o}return(0,br.checkNumber)(i)}},{key:"dot",value:function(t){for(var i=0,s=0;s<this.ELEMENTS;++s)i+=this[s]*t[s];return(0,br.checkNumber)(i)}},{key:"normalize",value:function(){var t=this.magnitude();if(t!==0)for(var i=0;i<this.ELEMENTS;++i)this[i]/=t;return this.check()}},{key:"multiply",value:function(){for(var t=arguments.length,i=new Array(t),s=0;s<t;s++)i[s]=arguments[s];for(var o=0,c=i;o<c.length;o++)for(var u=c[o],l=0;l<this.ELEMENTS;++l)this[l]*=u[l];return this.check()}},{key:"divide",value:function(){for(var t=arguments.length,i=new Array(t),s=0;s<t;s++)i[s]=arguments[s];for(var o=0,c=i;o<c.length;o++)for(var u=c[o],l=0;l<this.ELEMENTS;++l)this[l]/=u[l];return this.check()}},{key:"lengthSq",value:function(){return this.lengthSquared()}},{key:"distanceTo",value:function(t){return this.distance(t)}},{key:"distanceToSquared",value:function(t){return this.distanceSquared(t)}},{key:"getComponent",value:function(t){return(0,zn.default)(t>=0&&t<this.ELEMENTS,"index is out of range"),(0,br.checkNumber)(this[t])}},{key:"setComponent",value:function(t,i){return(0,zn.default)(t>=0&&t<this.ELEMENTS,"index is out of range"),this[t]=i,this.check()}},{key:"addVectors",value:function(t,i){return this.copy(t).add(i)}},{key:"subVectors",value:function(t,i){return this.copy(t).subtract(i)}},{key:"multiplyVectors",value:function(t,i){return this.copy(t).multiply(i)}},{key:"addScaledVector",value:function(t,i){return this.add(new this.constructor(t).multiplyScalar(i))}}]),n}(no.default);Wr.default=so});var ze=P(ne=>{"use strict";Object.defineProperty(ne,"__esModule",{value:!0});ne.setMatrixArrayType=uo;ne.toRadian=lo;ne.equals=fo;ne.RANDOM=ne.ARRAY_TYPE=ne.EPSILON=void 0;var Bn=1e-6;ne.EPSILON=Bn;var Vn=typeof Float32Array!="undefined"?Float32Array:Array;ne.ARRAY_TYPE=Vn;var oo=Math.random;ne.RANDOM=oo;function uo(e){ne.ARRAY_TYPE=Vn=e}var co=Math.PI/180;function lo(e){return e*co}function fo(e,r){return Math.abs(e-r)<=Bn*Math.max(1,Math.abs(e),Math.abs(r))}Math.hypot||(Math.hypot=function(){for(var e=0,r=arguments.length;r--;)e+=arguments[r]*arguments[r];return Math.sqrt(e)})});var zr=P(T=>{"use strict";function Fr(e){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Fr=function(n){return typeof n}:Fr=function(n){return n&&typeof Symbol=="function"&&n.constructor===Symbol&&n!==Symbol.prototype?"symbol":typeof n},Fr(e)}Object.defineProperty(T,"__esModule",{value:!0});T.create=Gn;T.clone=vo;T.fromValues=po;T.copy=mo;T.set=yo;T.add=go;T.subtract=Un;T.multiply=Xn;T.divide=Zn;T.ceil=Mo;T.floor=bo;T.min=xo;T.max=_o;T.round=Oo;T.scale=ko;T.scaleAndAdd=Ro;T.distance=Qn;T.squaredDistance=$n;T.length=Hn;T.squaredLength=Kn;T.negate=To;T.inverse=Po;T.normalize=Ao;T.dot=wo;T.cross=So;T.lerp=qo;T.random=Eo;T.transformMat2=Lo;T.transformMat2d=Io;T.transformMat3=No;T.transformMat4=Co;T.rotate=Wo;T.angle=Do;T.zero=Fo;T.str=zo;T.exactEquals=Bo;T.equals=Vo;T.forEach=T.sqrLen=T.sqrDist=T.dist=T.div=T.mul=T.sub=T.len=void 0;var Be=ho(ze());function Yn(e){if(typeof WeakMap!="function")return null;var r=new WeakMap,n=new WeakMap;return(Yn=function(t){return t?n:r})(e)}function ho(e,r){if(!r&&e&&e.__esModule)return e;if(e===null||Fr(e)!=="object"&&typeof e!="function")return{default:e};var n=Yn(r);if(n&&n.has(e))return n.get(e);var a={},t=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if(i!=="default"&&Object.prototype.hasOwnProperty.call(e,i)){var s=t?Object.getOwnPropertyDescriptor(e,i):null;s&&(s.get||s.set)?Object.defineProperty(a,i,s):a[i]=e[i]}return a.default=e,n&&n.set(e,a),a}function Gn(){var e=new Be.ARRAY_TYPE(2);return Be.ARRAY_TYPE!=Float32Array&&(e[0]=0,e[1]=0),e}function vo(e){var r=new Be.ARRAY_TYPE(2);return r[0]=e[0],r[1]=e[1],r}function po(e,r){var n=new Be.ARRAY_TYPE(2);return n[0]=e,n[1]=r,n}function mo(e,r){return e[0]=r[0],e[1]=r[1],e}function yo(e,r,n){return e[0]=r,e[1]=n,e}function go(e,r,n){return e[0]=r[0]+n[0],e[1]=r[1]+n[1],e}function Un(e,r,n){return e[0]=r[0]-n[0],e[1]=r[1]-n[1],e}function Xn(e,r,n){return e[0]=r[0]*n[0],e[1]=r[1]*n[1],e}function Zn(e,r,n){return e[0]=r[0]/n[0],e[1]=r[1]/n[1],e}function Mo(e,r){return e[0]=Math.ceil(r[0]),e[1]=Math.ceil(r[1]),e}function bo(e,r){return e[0]=Math.floor(r[0]),e[1]=Math.floor(r[1]),e}function xo(e,r,n){return e[0]=Math.min(r[0],n[0]),e[1]=Math.min(r[1],n[1]),e}function _o(e,r,n){return e[0]=Math.max(r[0],n[0]),e[1]=Math.max(r[1],n[1]),e}function Oo(e,r){return e[0]=Math.round(r[0]),e[1]=Math.round(r[1]),e}function ko(e,r,n){return e[0]=r[0]*n,e[1]=r[1]*n,e}function Ro(e,r,n,a){return e[0]=r[0]+n[0]*a,e[1]=r[1]+n[1]*a,e}function Qn(e,r){var n=r[0]-e[0],a=r[1]-e[1];return Math.hypot(n,a)}function $n(e,r){var n=r[0]-e[0],a=r[1]-e[1];return n*n+a*a}function Hn(e){var r=e[0],n=e[1];return Math.hypot(r,n)}function Kn(e){var r=e[0],n=e[1];return r*r+n*n}function To(e,r){return e[0]=-r[0],e[1]=-r[1],e}function Po(e,r){return e[0]=1/r[0],e[1]=1/r[1],e}function Ao(e,r){var n=r[0],a=r[1],t=n*n+a*a;return t>0&&(t=1/Math.sqrt(t)),e[0]=r[0]*t,e[1]=r[1]*t,e}function wo(e,r){return e[0]*r[0]+e[1]*r[1]}function So(e,r,n){var a=r[0]*n[1]-r[1]*n[0];return e[0]=e[1]=0,e[2]=a,e}function qo(e,r,n,a){var t=r[0],i=r[1];return e[0]=t+a*(n[0]-t),e[1]=i+a*(n[1]-i),e}function Eo(e,r){r=r||1;var n=Be.RANDOM()*2*Math.PI;return e[0]=Math.cos(n)*r,e[1]=Math.sin(n)*r,e}function Lo(e,r,n){var a=r[0],t=r[1];return e[0]=n[0]*a+n[2]*t,e[1]=n[1]*a+n[3]*t,e}function Io(e,r,n){var a=r[0],t=r[1];return e[0]=n[0]*a+n[2]*t+n[4],e[1]=n[1]*a+n[3]*t+n[5],e}function No(e,r,n){var a=r[0],t=r[1];return e[0]=n[0]*a+n[3]*t+n[6],e[1]=n[1]*a+n[4]*t+n[7],e}function Co(e,r,n){var a=r[0],t=r[1];return e[0]=n[0]*a+n[4]*t+n[12],e[1]=n[1]*a+n[5]*t+n[13],e}function Wo(e,r,n,a){var t=r[0]-n[0],i=r[1]-n[1],s=Math.sin(a),o=Math.cos(a);return e[0]=t*o-i*s+n[0],e[1]=t*s+i*o+n[1],e}function Do(e,r){var n=e[0],a=e[1],t=r[0],i=r[1],s=Math.sqrt(n*n+a*a)*Math.sqrt(t*t+i*i),o=s&&(n*t+a*i)/s;return Math.acos(Math.min(Math.max(o,-1),1))}function Fo(e){return e[0]=0,e[1]=0,e}function zo(e){return"vec2("+e[0]+", "+e[1]+")"}function Bo(e,r){return e[0]===r[0]&&e[1]===r[1]}function Vo(e,r){var n=e[0],a=e[1],t=r[0],i=r[1];return Math.abs(n-t)<=Be.EPSILON*Math.max(1,Math.abs(n),Math.abs(t))&&Math.abs(a-i)<=Be.EPSILON*Math.max(1,Math.abs(a),Math.abs(i))}var Yo=Hn;T.len=Yo;var Go=Un;T.sub=Go;var Uo=Xn;T.mul=Uo;var Xo=Zn;T.div=Xo;var Zo=Qn;T.dist=Zo;var Qo=$n;T.sqrDist=Qo;var $o=Kn;T.sqrLen=$o;var Ho=function(){var e=Gn();return function(r,n,a,t,i,s){var o,c;for(n||(n=2),a||(a=0),t?c=Math.min(t*n+a,r.length):c=r.length,o=a;o<c;o+=n)e[0]=r[o],e[1]=r[o+1],i(e,e,s),r[o]=e[0],r[o+1]=e[1];return r}}();T.forEach=Ho});var Qe=P(Ve=>{"use strict";Object.defineProperty(Ve,"__esModule",{value:!0});Ve.vec2_transformMat4AsVector=Ko;Ve.vec3_transformMat4AsVector=Jo;Ve.vec3_transformMat2=jo;Ve.vec4_transformMat2=eu;Ve.vec4_transformMat3=ru;function Ko(e,r,n){var a=r[0],t=r[1],i=n[3]*a+n[7]*t||1;return e[0]=(n[0]*a+n[4]*t)/i,e[1]=(n[1]*a+n[5]*t)/i,e}function Jo(e,r,n){var a=r[0],t=r[1],i=r[2],s=n[3]*a+n[7]*t+n[11]*i||1;return e[0]=(n[0]*a+n[4]*t+n[8]*i)/s,e[1]=(n[1]*a+n[5]*t+n[9]*i)/s,e[2]=(n[2]*a+n[6]*t+n[10]*i)/s,e}function jo(e,r,n){var a=r[0],t=r[1];return e[0]=n[0]*a+n[2]*t,e[1]=n[1]*a+n[3]*t,e[2]=r[2],e}function eu(e,r,n){var a=r[0],t=r[1];return e[0]=n[0]*a+n[2]*t,e[1]=n[1]*a+n[3]*t,e[2]=r[2],e[3]=r[3],e}function ru(e,r,n){var a=r[0],t=r[1],i=r[2];return e[0]=n[0]*a+n[3]*t+n[6]*i,e[1]=n[1]*a+n[4]*t+n[7]*i,e[2]=n[2]*a+n[5]*t+n[8]*i,e[3]=r[3],e}});var ea=P(Yr=>{"use strict";var $e=U(),tu=j();Object.defineProperty(Yr,"__esModule",{value:!0});Yr.default=void 0;var nu=$e($()),au=$e(H()),iu=$e(se()),su=$e(oe()),Jn=$e(ue()),ou=$e(Dr()),Nt=ve(),Br=de(),Vr=cu(zr()),uu=Qe();function jn(e){if(typeof WeakMap!="function")return null;var r=new WeakMap,n=new WeakMap;return(jn=function(t){return t?n:r})(e)}function cu(e,r){if(!r&&e&&e.__esModule)return e;if(e===null||tu(e)!=="object"&&typeof e!="function")return{default:e};var n=jn(r);if(n&&n.has(e))return n.get(e);var a={},t=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if(i!=="default"&&Object.prototype.hasOwnProperty.call(e,i)){var s=t?Object.getOwnPropertyDescriptor(e,i):null;s&&(s.get||s.set)?Object.defineProperty(a,i,s):a[i]=e[i]}return a.default=e,n&&n.set(e,a),a}function lu(e){var r=fu();return function(){var a=(0,Jn.default)(e),t;if(r){var i=(0,Jn.default)(this).constructor;t=Reflect.construct(a,arguments,i)}else t=a.apply(this,arguments);return(0,su.default)(this,t)}}function fu(){if(typeof Reflect=="undefined"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}var hu=function(e){(0,iu.default)(n,e);var r=lu(n);function n(){var a,t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return(0,nu.default)(this,n),a=r.call(this,2),(0,Nt.isArray)(t)&&arguments.length===1?a.copy(t):(Nt.config.debug&&((0,Br.checkNumber)(t),(0,Br.checkNumber)(i)),a[0]=t,a[1]=i),a}return(0,au.default)(n,[{key:"set",value:function(t,i){return this[0]=t,this[1]=i,this.check()}},{key:"copy",value:function(t){return this[0]=t[0],this[1]=t[1],this.check()}},{key:"fromObject",value:function(t){return Nt.config.debug&&((0,Br.checkNumber)(t.x),(0,Br.checkNumber)(t.y)),this[0]=t.x,this[1]=t.y,this.check()}},{key:"toObject",value:function(t){return t.x=this[0],t.y=this[1],t}},{key:"ELEMENTS",get:function(){return 2}},{key:"horizontalAngle",value:function(){return Math.atan2(this.y,this.x)}},{key:"verticalAngle",value:function(){return Math.atan2(this.x,this.y)}},{key:"transform",value:function(t){return this.transformAsPoint(t)}},{key:"transformAsPoint",value:function(t){return Vr.transformMat4(this,this,t),this.check()}},{key:"transformAsVector",value:function(t){return(0,uu.vec2_transformMat4AsVector)(this,this,t),this.check()}},{key:"transformByMatrix3",value:function(t){return Vr.transformMat3(this,this,t),this.check()}},{key:"transformByMatrix2x3",value:function(t){return Vr.transformMat2d(this,this,t),this.check()}},{key:"transformByMatrix2",value:function(t){return Vr.transformMat2(this,this,t),this.check()}}]),n}(ou.default);Yr.default=hu});var Ae=P(O=>{"use strict";function Gr(e){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Gr=function(n){return typeof n}:Gr=function(n){return n&&typeof Symbol=="function"&&n.constructor===Symbol&&n!==Symbol.prototype?"symbol":typeof n},Gr(e)}Object.defineProperty(O,"__esModule",{value:!0});O.create=ta;O.clone=du;O.length=na;O.fromValues=pu;O.copy=mu;O.set=yu;O.add=gu;O.subtract=aa;O.multiply=ia;O.divide=sa;O.ceil=Mu;O.floor=bu;O.min=xu;O.max=_u;O.round=Ou;O.scale=ku;O.scaleAndAdd=Ru;O.distance=oa;O.squaredDistance=ua;O.squaredLength=ca;O.negate=Tu;O.inverse=Pu;O.normalize=Au;O.dot=la;O.cross=wu;O.lerp=Su;O.hermite=qu;O.bezier=Eu;O.random=Lu;O.transformMat4=Iu;O.transformMat3=Nu;O.transformQuat=Cu;O.rotateX=Wu;O.rotateY=Du;O.rotateZ=Fu;O.angle=zu;O.zero=Bu;O.str=Vu;O.exactEquals=Yu;O.equals=Gu;O.forEach=O.sqrLen=O.len=O.sqrDist=O.dist=O.div=O.mul=O.sub=void 0;var Oe=vu(ze());function ra(e){if(typeof WeakMap!="function")return null;var r=new WeakMap,n=new WeakMap;return(ra=function(t){return t?n:r})(e)}function vu(e,r){if(!r&&e&&e.__esModule)return e;if(e===null||Gr(e)!=="object"&&typeof e!="function")return{default:e};var n=ra(r);if(n&&n.has(e))return n.get(e);var a={},t=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if(i!=="default"&&Object.prototype.hasOwnProperty.call(e,i)){var s=t?Object.getOwnPropertyDescriptor(e,i):null;s&&(s.get||s.set)?Object.defineProperty(a,i,s):a[i]=e[i]}return a.default=e,n&&n.set(e,a),a}function ta(){var e=new Oe.ARRAY_TYPE(3);return Oe.ARRAY_TYPE!=Float32Array&&(e[0]=0,e[1]=0,e[2]=0),e}function du(e){var r=new Oe.ARRAY_TYPE(3);return r[0]=e[0],r[1]=e[1],r[2]=e[2],r}function na(e){var r=e[0],n=e[1],a=e[2];return Math.hypot(r,n,a)}function pu(e,r,n){var a=new Oe.ARRAY_TYPE(3);return a[0]=e,a[1]=r,a[2]=n,a}function mu(e,r){return e[0]=r[0],e[1]=r[1],e[2]=r[2],e}function yu(e,r,n,a){return e[0]=r,e[1]=n,e[2]=a,e}function gu(e,r,n){return e[0]=r[0]+n[0],e[1]=r[1]+n[1],e[2]=r[2]+n[2],e}function aa(e,r,n){return e[0]=r[0]-n[0],e[1]=r[1]-n[1],e[2]=r[2]-n[2],e}function ia(e,r,n){return e[0]=r[0]*n[0],e[1]=r[1]*n[1],e[2]=r[2]*n[2],e}function sa(e,r,n){return e[0]=r[0]/n[0],e[1]=r[1]/n[1],e[2]=r[2]/n[2],e}function Mu(e,r){return e[0]=Math.ceil(r[0]),e[1]=Math.ceil(r[1]),e[2]=Math.ceil(r[2]),e}function bu(e,r){return e[0]=Math.floor(r[0]),e[1]=Math.floor(r[1]),e[2]=Math.floor(r[2]),e}function xu(e,r,n){return e[0]=Math.min(r[0],n[0]),e[1]=Math.min(r[1],n[1]),e[2]=Math.min(r[2],n[2]),e}function _u(e,r,n){return e[0]=Math.max(r[0],n[0]),e[1]=Math.max(r[1],n[1]),e[2]=Math.max(r[2],n[2]),e}function Ou(e,r){return e[0]=Math.round(r[0]),e[1]=Math.round(r[1]),e[2]=Math.round(r[2]),e}function ku(e,r,n){return e[0]=r[0]*n,e[1]=r[1]*n,e[2]=r[2]*n,e}function Ru(e,r,n,a){return e[0]=r[0]+n[0]*a,e[1]=r[1]+n[1]*a,e[2]=r[2]+n[2]*a,e}function oa(e,r){var n=r[0]-e[0],a=r[1]-e[1],t=r[2]-e[2];return Math.hypot(n,a,t)}function ua(e,r){var n=r[0]-e[0],a=r[1]-e[1],t=r[2]-e[2];return n*n+a*a+t*t}function ca(e){var r=e[0],n=e[1],a=e[2];return r*r+n*n+a*a}function Tu(e,r){return e[0]=-r[0],e[1]=-r[1],e[2]=-r[2],e}function Pu(e,r){return e[0]=1/r[0],e[1]=1/r[1],e[2]=1/r[2],e}function Au(e,r){var n=r[0],a=r[1],t=r[2],i=n*n+a*a+t*t;return i>0&&(i=1/Math.sqrt(i)),e[0]=r[0]*i,e[1]=r[1]*i,e[2]=r[2]*i,e}function la(e,r){return e[0]*r[0]+e[1]*r[1]+e[2]*r[2]}function wu(e,r,n){var a=r[0],t=r[1],i=r[2],s=n[0],o=n[1],c=n[2];return e[0]=t*c-i*o,e[1]=i*s-a*c,e[2]=a*o-t*s,e}function Su(e,r,n,a){var t=r[0],i=r[1],s=r[2];return e[0]=t+a*(n[0]-t),e[1]=i+a*(n[1]-i),e[2]=s+a*(n[2]-s),e}function qu(e,r,n,a,t,i){var s=i*i,o=s*(2*i-3)+1,c=s*(i-2)+i,u=s*(i-1),l=s*(3-2*i);return e[0]=r[0]*o+n[0]*c+a[0]*u+t[0]*l,e[1]=r[1]*o+n[1]*c+a[1]*u+t[1]*l,e[2]=r[2]*o+n[2]*c+a[2]*u+t[2]*l,e}function Eu(e,r,n,a,t,i){var s=1-i,o=s*s,c=i*i,u=o*s,l=3*i*o,h=3*c*s,f=c*i;return e[0]=r[0]*u+n[0]*l+a[0]*h+t[0]*f,e[1]=r[1]*u+n[1]*l+a[1]*h+t[1]*f,e[2]=r[2]*u+n[2]*l+a[2]*h+t[2]*f,e}function Lu(e,r){r=r||1;var n=Oe.RANDOM()*2*Math.PI,a=Oe.RANDOM()*2-1,t=Math.sqrt(1-a*a)*r;return e[0]=Math.cos(n)*t,e[1]=Math.sin(n)*t,e[2]=a*r,e}function Iu(e,r,n){var a=r[0],t=r[1],i=r[2],s=n[3]*a+n[7]*t+n[11]*i+n[15];return s=s||1,e[0]=(n[0]*a+n[4]*t+n[8]*i+n[12])/s,e[1]=(n[1]*a+n[5]*t+n[9]*i+n[13])/s,e[2]=(n[2]*a+n[6]*t+n[10]*i+n[14])/s,e}function Nu(e,r,n){var a=r[0],t=r[1],i=r[2];return e[0]=a*n[0]+t*n[3]+i*n[6],e[1]=a*n[1]+t*n[4]+i*n[7],e[2]=a*n[2]+t*n[5]+i*n[8],e}function Cu(e,r,n){var a=n[0],t=n[1],i=n[2],s=n[3],o=r[0],c=r[1],u=r[2],l=t*u-i*c,h=i*o-a*u,f=a*c-t*o,v=t*f-i*h,d=i*l-a*f,m=a*h-t*l,p=s*2;return l*=p,h*=p,f*=p,v*=2,d*=2,m*=2,e[0]=o+l+v,e[1]=c+h+d,e[2]=u+f+m,e}function Wu(e,r,n,a){var t=[],i=[];return t[0]=r[0]-n[0],t[1]=r[1]-n[1],t[2]=r[2]-n[2],i[0]=t[0],i[1]=t[1]*Math.cos(a)-t[2]*Math.sin(a),i[2]=t[1]*Math.sin(a)+t[2]*Math.cos(a),e[0]=i[0]+n[0],e[1]=i[1]+n[1],e[2]=i[2]+n[2],e}function Du(e,r,n,a){var t=[],i=[];return t[0]=r[0]-n[0],t[1]=r[1]-n[1],t[2]=r[2]-n[2],i[0]=t[2]*Math.sin(a)+t[0]*Math.cos(a),i[1]=t[1],i[2]=t[2]*Math.cos(a)-t[0]*Math.sin(a),e[0]=i[0]+n[0],e[1]=i[1]+n[1],e[2]=i[2]+n[2],e}function Fu(e,r,n,a){var t=[],i=[];return t[0]=r[0]-n[0],t[1]=r[1]-n[1],t[2]=r[2]-n[2],i[0]=t[0]*Math.cos(a)-t[1]*Math.sin(a),i[1]=t[0]*Math.sin(a)+t[1]*Math.cos(a),i[2]=t[2],e[0]=i[0]+n[0],e[1]=i[1]+n[1],e[2]=i[2]+n[2],e}function zu(e,r){var n=e[0],a=e[1],t=e[2],i=r[0],s=r[1],o=r[2],c=Math.sqrt(n*n+a*a+t*t),u=Math.sqrt(i*i+s*s+o*o),l=c*u,h=l&&la(e,r)/l;return Math.acos(Math.min(Math.max(h,-1),1))}function Bu(e){return e[0]=0,e[1]=0,e[2]=0,e}function Vu(e){return"vec3("+e[0]+", "+e[1]+", "+e[2]+")"}function Yu(e,r){return e[0]===r[0]&&e[1]===r[1]&&e[2]===r[2]}function Gu(e,r){var n=e[0],a=e[1],t=e[2],i=r[0],s=r[1],o=r[2];return Math.abs(n-i)<=Oe.EPSILON*Math.max(1,Math.abs(n),Math.abs(i))&&Math.abs(a-s)<=Oe.EPSILON*Math.max(1,Math.abs(a),Math.abs(s))&&Math.abs(t-o)<=Oe.EPSILON*Math.max(1,Math.abs(t),Math.abs(o))}var Uu=aa;O.sub=Uu;var Xu=ia;O.mul=Xu;var Zu=sa;O.div=Zu;var Qu=oa;O.dist=Qu;var $u=ua;O.sqrDist=$u;var Hu=na;O.len=Hu;var Ku=ca;O.sqrLen=Ku;var Ju=function(){var e=ta();return function(r,n,a,t,i,s){var o,c;for(n||(n=3),a||(a=0),t?c=Math.min(t*n+a,r.length):c=r.length,o=a;o<c;o+=n)e[0]=r[o],e[1]=r[o+1],e[2]=r[o+2],i(e,e,s),r[o]=e[0],r[o+1]=e[1],r[o+2]=e[2];return r}}();O.forEach=Ju});var Zr=P(Xr=>{"use strict";var He=U(),ju=j();Object.defineProperty(Xr,"__esModule",{value:!0});Xr.default=void 0;var ec=He($()),rc=He(H()),tc=He(se()),nc=He(oe()),fa=He(ue()),ac=He(Dr()),Ct=ve(),Ye=de(),we=ic(Ae()),ha=Qe();function va(e){if(typeof WeakMap!="function")return null;var r=new WeakMap,n=new WeakMap;return(va=function(t){return t?n:r})(e)}function ic(e,r){if(!r&&e&&e.__esModule)return e;if(e===null||ju(e)!=="object"&&typeof e!="function")return{default:e};var n=va(r);if(n&&n.has(e))return n.get(e);var a={},t=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if(i!=="default"&&Object.prototype.hasOwnProperty.call(e,i)){var s=t?Object.getOwnPropertyDescriptor(e,i):null;s&&(s.get||s.set)?Object.defineProperty(a,i,s):a[i]=e[i]}return a.default=e,n&&n.set(e,a),a}function sc(e){var r=oc();return function(){var a=(0,fa.default)(e),t;if(r){var i=(0,fa.default)(this).constructor;t=Reflect.construct(a,arguments,i)}else t=a.apply(this,arguments);return(0,nc.default)(this,t)}}function oc(){if(typeof Reflect=="undefined"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}var Wt=[0,0,0],Ur,uc=function(e){(0,tc.default)(n,e);var r=sc(n);function n(){var a,t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,s=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0;return(0,ec.default)(this,n),a=r.call(this,-0,-0,-0),arguments.length===1&&(0,Ct.isArray)(t)?a.copy(t):(Ct.config.debug&&((0,Ye.checkNumber)(t),(0,Ye.checkNumber)(i),(0,Ye.checkNumber)(s)),a[0]=t,a[1]=i,a[2]=s),a}return(0,rc.default)(n,[{key:"set",value:function(t,i,s){return this[0]=t,this[1]=i,this[2]=s,this.check()}},{key:"copy",value:function(t){return this[0]=t[0],this[1]=t[1],this[2]=t[2],this.check()}},{key:"fromObject",value:function(t){return Ct.config.debug&&((0,Ye.checkNumber)(t.x),(0,Ye.checkNumber)(t.y),(0,Ye.checkNumber)(t.z)),this[0]=t.x,this[1]=t.y,this[2]=t.z,this.check()}},{key:"toObject",value:function(t){return t.x=this[0],t.y=this[1],t.z=this[2],t}},{key:"ELEMENTS",get:function(){return 3}},{key:"z",get:function(){return this[2]},set:function(t){this[2]=(0,Ye.checkNumber)(t)}},{key:"angle",value:function(t){return we.angle(this,t)}},{key:"cross",value:function(t){return we.cross(this,this,t),this.check()}},{key:"rotateX",value:function(t){var i=t.radians,s=t.origin,o=s===void 0?Wt:s;return we.rotateX(this,this,o,i),this.check()}},{key:"rotateY",value:function(t){var i=t.radians,s=t.origin,o=s===void 0?Wt:s;return we.rotateY(this,this,o,i),this.check()}},{key:"rotateZ",value:function(t){var i=t.radians,s=t.origin,o=s===void 0?Wt:s;return we.rotateZ(this,this,o,i),this.check()}},{key:"transform",value:function(t){return this.transformAsPoint(t)}},{key:"transformAsPoint",value:function(t){return we.transformMat4(this,this,t),this.check()}},{key:"transformAsVector",value:function(t){return(0,ha.vec3_transformMat4AsVector)(this,this,t),this.check()}},{key:"transformByMatrix3",value:function(t){return we.transformMat3(this,this,t),this.check()}},{key:"transformByMatrix2",value:function(t){return(0,ha.vec3_transformMat2)(this,this,t),this.check()}},{key:"transformByQuaternion",value:function(t){return we.transformQuat(this,this,t),this.check()}}],[{key:"ZERO",get:function(){return Ur||(Ur=new n(0,0,0),Object.freeze(Ur)),Ur}}]),n}(ac.default);Xr.default=uc});var Ft=P($r=>{"use strict";var Ke=U(),cc=j();Object.defineProperty($r,"__esModule",{value:!0});$r.default=void 0;var lc=Ke($()),fc=Ke(H()),hc=Ke(se()),vc=Ke(oe()),da=Ke(ue()),dc=Ke(Dr()),Dt=ve(),pe=de(),pa=pc(Ae()),ma=Qe();function ya(e){if(typeof WeakMap!="function")return null;var r=new WeakMap,n=new WeakMap;return(ya=function(t){return t?n:r})(e)}function pc(e,r){if(!r&&e&&e.__esModule)return e;if(e===null||cc(e)!=="object"&&typeof e!="function")return{default:e};var n=ya(r);if(n&&n.has(e))return n.get(e);var a={},t=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if(i!=="default"&&Object.prototype.hasOwnProperty.call(e,i)){var s=t?Object.getOwnPropertyDescriptor(e,i):null;s&&(s.get||s.set)?Object.defineProperty(a,i,s):a[i]=e[i]}return a.default=e,n&&n.set(e,a),a}function mc(e){var r=yc();return function(){var a=(0,da.default)(e),t;if(r){var i=(0,da.default)(this).constructor;t=Reflect.construct(a,arguments,i)}else t=a.apply(this,arguments);return(0,vc.default)(this,t)}}function yc(){if(typeof Reflect=="undefined"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}var Qr,gc=function(e){(0,hc.default)(n,e);var r=mc(n);function n(){var a,t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,s=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,o=arguments.length>3&&arguments[3]!==void 0?arguments[3]:0;return(0,lc.default)(this,n),a=r.call(this,-0,-0,-0,-0),(0,Dt.isArray)(t)&&arguments.length===1?a.copy(t):(Dt.config.debug&&((0,pe.checkNumber)(t),(0,pe.checkNumber)(i),(0,pe.checkNumber)(s),(0,pe.checkNumber)(o)),a[0]=t,a[1]=i,a[2]=s,a[3]=o),a}return(0,fc.default)(n,[{key:"set",value:function(t,i,s,o){return this[0]=t,this[1]=i,this[2]=s,this[3]=o,this.check()}},{key:"copy",value:function(t){return this[0]=t[0],this[1]=t[1],this[2]=t[2],this[3]=t[3],this.check()}},{key:"fromObject",value:function(t){return Dt.config.debug&&((0,pe.checkNumber)(t.x),(0,pe.checkNumber)(t.y),(0,pe.checkNumber)(t.z),(0,pe.checkNumber)(t.w)),this[0]=t.x,this[1]=t.y,this[2]=t.z,this[3]=t.w,this}},{key:"toObject",value:function(t){return t.x=this[0],t.y=this[1],t.z=this[2],t.w=this[3],t}},{key:"ELEMENTS",get:function(){return 4}},{key:"z",get:function(){return this[2]},set:function(t){this[2]=(0,pe.checkNumber)(t)}},{key:"w",get:function(){return this[3]},set:function(t){this[3]=(0,pe.checkNumber)(t)}},{key:"transform",value:function(t){return pa.transformMat4(this,this,t),this.check()}},{key:"transformByMatrix3",value:function(t){return(0,ma.vec4_transformMat3)(this,this,t),this.check()}},{key:"transformByMatrix2",value:function(t){return(0,ma.vec4_transformMat2)(this,this,t),this.check()}},{key:"transformByQuaternion",value:function(t){return pa.transformQuat(this,this,t),this.check()}},{key:"applyMatrix4",value:function(t){return t.transform(this,this),this}}],[{key:"ZERO",get:function(){return Qr||(Qr=new n(0,0,0,0),Object.freeze(Qr)),Qr}}]),n}(dc.default);$r.default=gc});var zt=P(Hr=>{"use strict";var Je=U();Object.defineProperty(Hr,"__esModule",{value:!0});Hr.default=void 0;var Mc=Je($()),bc=Je(H()),xc=Je(se()),_c=Je(oe()),ga=Je(ue()),Oc=Je(Mr()),kc=de(),Rc=ve();function Tc(e){var r=Pc();return function(){var a=(0,ga.default)(e),t;if(r){var i=(0,ga.default)(this).constructor;t=Reflect.construct(a,arguments,i)}else t=a.apply(this,arguments);return(0,_c.default)(this,t)}}function Pc(){if(typeof Reflect=="undefined"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}var Ac=function(e){(0,xc.default)(n,e);var r=Tc(n);function n(){return(0,Mc.default)(this,n),r.apply(this,arguments)}return(0,bc.default)(n,[{key:"toString",value:function(){var t="[";if(Rc.config.printRowMajor){t+="row-major:";for(var i=0;i<this.RANK;++i)for(var s=0;s<this.RANK;++s)t+=" ".concat(this[s*this.RANK+i])}else{t+="column-major:";for(var o=0;o<this.ELEMENTS;++o)t+=" ".concat(this[o])}return t+="]",t}},{key:"getElementIndex",value:function(t,i){return i*this.RANK+t}},{key:"getElement",value:function(t,i){return this[i*this.RANK+t]}},{key:"setElement",value:function(t,i,s){return this[i*this.RANK+t]=(0,kc.checkNumber)(s),this}},{key:"getColumn",value:function(t){for(var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:new Array(this.RANK).fill(-0),s=t*this.RANK,o=0;o<this.RANK;++o)i[o]=this[s+o];return i}},{key:"setColumn",value:function(t,i){for(var s=t*this.RANK,o=0;o<this.RANK;++o)this[s+o]=i[o];return this}}]),n}(Oc.default);Hr.default=Ac});var Bt=P(q=>{"use strict";function Kr(e){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Kr=function(n){return typeof n}:Kr=function(n){return n&&typeof Symbol=="function"&&n.constructor===Symbol&&n!==Symbol.prototype?"symbol":typeof n},Kr(e)}Object.defineProperty(q,"__esModule",{value:!0});q.create=Sc;q.fromMat4=qc;q.clone=Ec;q.copy=Lc;q.fromValues=Ic;q.set=Nc;q.identity=Cc;q.transpose=Wc;q.invert=Dc;q.adjoint=Fc;q.determinant=zc;q.multiply=ba;q.translate=Bc;q.rotate=Vc;q.scale=Yc;q.fromTranslation=Gc;q.fromRotation=Uc;q.fromScaling=Xc;q.fromMat2d=Zc;q.fromQuat=Qc;q.normalFromMat4=$c;q.projection=Hc;q.str=Kc;q.frob=Jc;q.add=jc;q.subtract=xa;q.multiplyScalar=el;q.multiplyScalarAndAdd=rl;q.exactEquals=tl;q.equals=nl;q.sub=q.mul=void 0;var ee=wc(ze());function Ma(e){if(typeof WeakMap!="function")return null;var r=new WeakMap,n=new WeakMap;return(Ma=function(t){return t?n:r})(e)}function wc(e,r){if(!r&&e&&e.__esModule)return e;if(e===null||Kr(e)!=="object"&&typeof e!="function")return{default:e};var n=Ma(r);if(n&&n.has(e))return n.get(e);var a={},t=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if(i!=="default"&&Object.prototype.hasOwnProperty.call(e,i)){var s=t?Object.getOwnPropertyDescriptor(e,i):null;s&&(s.get||s.set)?Object.defineProperty(a,i,s):a[i]=e[i]}return a.default=e,n&&n.set(e,a),a}function Sc(){var e=new ee.ARRAY_TYPE(9);return ee.ARRAY_TYPE!=Float32Array&&(e[1]=0,e[2]=0,e[3]=0,e[5]=0,e[6]=0,e[7]=0),e[0]=1,e[4]=1,e[8]=1,e}function qc(e,r){return e[0]=r[0],e[1]=r[1],e[2]=r[2],e[3]=r[4],e[4]=r[5],e[5]=r[6],e[6]=r[8],e[7]=r[9],e[8]=r[10],e}function Ec(e){var r=new ee.ARRAY_TYPE(9);return r[0]=e[0],r[1]=e[1],r[2]=e[2],r[3]=e[3],r[4]=e[4],r[5]=e[5],r[6]=e[6],r[7]=e[7],r[8]=e[8],r}function Lc(e,r){return e[0]=r[0],e[1]=r[1],e[2]=r[2],e[3]=r[3],e[4]=r[4],e[5]=r[5],e[6]=r[6],e[7]=r[7],e[8]=r[8],e}function Ic(e,r,n,a,t,i,s,o,c){var u=new ee.ARRAY_TYPE(9);return u[0]=e,u[1]=r,u[2]=n,u[3]=a,u[4]=t,u[5]=i,u[6]=s,u[7]=o,u[8]=c,u}function Nc(e,r,n,a,t,i,s,o,c,u){return e[0]=r,e[1]=n,e[2]=a,e[3]=t,e[4]=i,e[5]=s,e[6]=o,e[7]=c,e[8]=u,e}function Cc(e){return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=1,e[5]=0,e[6]=0,e[7]=0,e[8]=1,e}function Wc(e,r){if(e===r){var n=r[1],a=r[2],t=r[5];e[1]=r[3],e[2]=r[6],e[3]=n,e[5]=r[7],e[6]=a,e[7]=t}else e[0]=r[0],e[1]=r[3],e[2]=r[6],e[3]=r[1],e[4]=r[4],e[5]=r[7],e[6]=r[2],e[7]=r[5],e[8]=r[8];return e}function Dc(e,r){var n=r[0],a=r[1],t=r[2],i=r[3],s=r[4],o=r[5],c=r[6],u=r[7],l=r[8],h=l*s-o*u,f=-l*i+o*c,v=u*i-s*c,d=n*h+a*f+t*v;return d?(d=1/d,e[0]=h*d,e[1]=(-l*a+t*u)*d,e[2]=(o*a-t*s)*d,e[3]=f*d,e[4]=(l*n-t*c)*d,e[5]=(-o*n+t*i)*d,e[6]=v*d,e[7]=(-u*n+a*c)*d,e[8]=(s*n-a*i)*d,e):null}function Fc(e,r){var n=r[0],a=r[1],t=r[2],i=r[3],s=r[4],o=r[5],c=r[6],u=r[7],l=r[8];return e[0]=s*l-o*u,e[1]=t*u-a*l,e[2]=a*o-t*s,e[3]=o*c-i*l,e[4]=n*l-t*c,e[5]=t*i-n*o,e[6]=i*u-s*c,e[7]=a*c-n*u,e[8]=n*s-a*i,e}function zc(e){var r=e[0],n=e[1],a=e[2],t=e[3],i=e[4],s=e[5],o=e[6],c=e[7],u=e[8];return r*(u*i-s*c)+n*(-u*t+s*o)+a*(c*t-i*o)}function ba(e,r,n){var a=r[0],t=r[1],i=r[2],s=r[3],o=r[4],c=r[5],u=r[6],l=r[7],h=r[8],f=n[0],v=n[1],d=n[2],m=n[3],p=n[4],y=n[5],b=n[6],g=n[7],M=n[8];return e[0]=f*a+v*s+d*u,e[1]=f*t+v*o+d*l,e[2]=f*i+v*c+d*h,e[3]=m*a+p*s+y*u,e[4]=m*t+p*o+y*l,e[5]=m*i+p*c+y*h,e[6]=b*a+g*s+M*u,e[7]=b*t+g*o+M*l,e[8]=b*i+g*c+M*h,e}function Bc(e,r,n){var a=r[0],t=r[1],i=r[2],s=r[3],o=r[4],c=r[5],u=r[6],l=r[7],h=r[8],f=n[0],v=n[1];return e[0]=a,e[1]=t,e[2]=i,e[3]=s,e[4]=o,e[5]=c,e[6]=f*a+v*s+u,e[7]=f*t+v*o+l,e[8]=f*i+v*c+h,e}function Vc(e,r,n){var a=r[0],t=r[1],i=r[2],s=r[3],o=r[4],c=r[5],u=r[6],l=r[7],h=r[8],f=Math.sin(n),v=Math.cos(n);return e[0]=v*a+f*s,e[1]=v*t+f*o,e[2]=v*i+f*c,e[3]=v*s-f*a,e[4]=v*o-f*t,e[5]=v*c-f*i,e[6]=u,e[7]=l,e[8]=h,e}function Yc(e,r,n){var a=n[0],t=n[1];return e[0]=a*r[0],e[1]=a*r[1],e[2]=a*r[2],e[3]=t*r[3],e[4]=t*r[4],e[5]=t*r[5],e[6]=r[6],e[7]=r[7],e[8]=r[8],e}function Gc(e,r){return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=1,e[5]=0,e[6]=r[0],e[7]=r[1],e[8]=1,e}function Uc(e,r){var n=Math.sin(r),a=Math.cos(r);return e[0]=a,e[1]=n,e[2]=0,e[3]=-n,e[4]=a,e[5]=0,e[6]=0,e[7]=0,e[8]=1,e}function Xc(e,r){return e[0]=r[0],e[1]=0,e[2]=0,e[3]=0,e[4]=r[1],e[5]=0,e[6]=0,e[7]=0,e[8]=1,e}function Zc(e,r){return e[0]=r[0],e[1]=r[1],e[2]=0,e[3]=r[2],e[4]=r[3],e[5]=0,e[6]=r[4],e[7]=r[5],e[8]=1,e}function Qc(e,r){var n=r[0],a=r[1],t=r[2],i=r[3],s=n+n,o=a+a,c=t+t,u=n*s,l=a*s,h=a*o,f=t*s,v=t*o,d=t*c,m=i*s,p=i*o,y=i*c;return e[0]=1-h-d,e[3]=l-y,e[6]=f+p,e[1]=l+y,e[4]=1-u-d,e[7]=v-m,e[2]=f-p,e[5]=v+m,e[8]=1-u-h,e}function $c(e,r){var n=r[0],a=r[1],t=r[2],i=r[3],s=r[4],o=r[5],c=r[6],u=r[7],l=r[8],h=r[9],f=r[10],v=r[11],d=r[12],m=r[13],p=r[14],y=r[15],b=n*o-a*s,g=n*c-t*s,M=n*u-i*s,k=a*c-t*o,_=a*u-i*o,C=t*u-i*c,L=l*m-h*d,I=l*p-f*d,S=l*y-v*d,W=h*p-f*m,N=h*y-v*m,D=f*y-v*p,w=b*D-g*N+M*W+k*S-_*I+C*L;return w?(w=1/w,e[0]=(o*D-c*N+u*W)*w,e[1]=(c*S-s*D-u*I)*w,e[2]=(s*N-o*S+u*L)*w,e[3]=(t*N-a*D-i*W)*w,e[4]=(n*D-t*S+i*I)*w,e[5]=(a*S-n*N-i*L)*w,e[6]=(m*C-p*_+y*k)*w,e[7]=(p*M-d*C-y*g)*w,e[8]=(d*_-m*M+y*b)*w,e):null}function Hc(e,r,n){return e[0]=2/r,e[1]=0,e[2]=0,e[3]=0,e[4]=-2/n,e[5]=0,e[6]=-1,e[7]=1,e[8]=1,e}function Kc(e){return"mat3("+e[0]+", "+e[1]+", "+e[2]+", "+e[3]+", "+e[4]+", "+e[5]+", "+e[6]+", "+e[7]+", "+e[8]+")"}function Jc(e){return Math.hypot(e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8])}function jc(e,r,n){return e[0]=r[0]+n[0],e[1]=r[1]+n[1],e[2]=r[2]+n[2],e[3]=r[3]+n[3],e[4]=r[4]+n[4],e[5]=r[5]+n[5],e[6]=r[6]+n[6],e[7]=r[7]+n[7],e[8]=r[8]+n[8],e}function xa(e,r,n){return e[0]=r[0]-n[0],e[1]=r[1]-n[1],e[2]=r[2]-n[2],e[3]=r[3]-n[3],e[4]=r[4]-n[4],e[5]=r[5]-n[5],e[6]=r[6]-n[6],e[7]=r[7]-n[7],e[8]=r[8]-n[8],e}function el(e,r,n){return e[0]=r[0]*n,e[1]=r[1]*n,e[2]=r[2]*n,e[3]=r[3]*n,e[4]=r[4]*n,e[5]=r[5]*n,e[6]=r[6]*n,e[7]=r[7]*n,e[8]=r[8]*n,e}function rl(e,r,n,a){return e[0]=r[0]+n[0]*a,e[1]=r[1]+n[1]*a,e[2]=r[2]+n[2]*a,e[3]=r[3]+n[3]*a,e[4]=r[4]+n[4]*a,e[5]=r[5]+n[5]*a,e[6]=r[6]+n[6]*a,e[7]=r[7]+n[7]*a,e[8]=r[8]+n[8]*a,e}function tl(e,r){return e[0]===r[0]&&e[1]===r[1]&&e[2]===r[2]&&e[3]===r[3]&&e[4]===r[4]&&e[5]===r[5]&&e[6]===r[6]&&e[7]===r[7]&&e[8]===r[8]}function nl(e,r){var n=e[0],a=e[1],t=e[2],i=e[3],s=e[4],o=e[5],c=e[6],u=e[7],l=e[8],h=r[0],f=r[1],v=r[2],d=r[3],m=r[4],p=r[5],y=r[6],b=r[7],g=r[8];return Math.abs(n-h)<=ee.EPSILON*Math.max(1,Math.abs(n),Math.abs(h))&&Math.abs(a-f)<=ee.EPSILON*Math.max(1,Math.abs(a),Math.abs(f))&&Math.abs(t-v)<=ee.EPSILON*Math.max(1,Math.abs(t),Math.abs(v))&&Math.abs(i-d)<=ee.EPSILON*Math.max(1,Math.abs(i),Math.abs(d))&&Math.abs(s-m)<=ee.EPSILON*Math.max(1,Math.abs(s),Math.abs(m))&&Math.abs(o-p)<=ee.EPSILON*Math.max(1,Math.abs(o),Math.abs(p))&&Math.abs(c-y)<=ee.EPSILON*Math.max(1,Math.abs(c),Math.abs(y))&&Math.abs(u-b)<=ee.EPSILON*Math.max(1,Math.abs(u),Math.abs(b))&&Math.abs(l-g)<=ee.EPSILON*Math.max(1,Math.abs(l),Math.abs(g))}var al=ba;q.mul=al;var il=xa;q.sub=il});var ka=P(et=>{"use strict";var je=U(),sl=j();Object.defineProperty(et,"__esModule",{value:!0});et.default=void 0;var ol=je($()),ul=je(H()),cl=je(se()),ll=je(oe()),_a=je(ue()),fl=je(zt()),hl=de(),vl=Qe(),me=Vt(Bt()),dl=Vt(zr()),pl=Vt(Ae());function Oa(e){if(typeof WeakMap!="function")return null;var r=new WeakMap,n=new WeakMap;return(Oa=function(t){return t?n:r})(e)}function Vt(e,r){if(!r&&e&&e.__esModule)return e;if(e===null||sl(e)!=="object"&&typeof e!="function")return{default:e};var n=Oa(r);if(n&&n.has(e))return n.get(e);var a={},t=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if(i!=="default"&&Object.prototype.hasOwnProperty.call(e,i)){var s=t?Object.getOwnPropertyDescriptor(e,i):null;s&&(s.get||s.set)?Object.defineProperty(a,i,s):a[i]=e[i]}return a.default=e,n&&n.set(e,a),a}function ml(e){var r=yl();return function(){var a=(0,_a.default)(e),t;if(r){var i=(0,_a.default)(this).constructor;t=Reflect.construct(a,arguments,i)}else t=a.apply(this,arguments);return(0,ll.default)(this,t)}}function yl(){if(typeof Reflect=="undefined"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}var Yt;(function(e){e[e.COL0ROW0=0]="COL0ROW0",e[e.COL0ROW1=1]="COL0ROW1",e[e.COL0ROW2=2]="COL0ROW2",e[e.COL1ROW0=3]="COL1ROW0",e[e.COL1ROW1=4]="COL1ROW1",e[e.COL1ROW2=5]="COL1ROW2",e[e.COL2ROW0=6]="COL2ROW0",e[e.COL2ROW1=7]="COL2ROW1",e[e.COL2ROW2=8]="COL2ROW2"})(Yt||(Yt={}));var gl=Object.freeze([1,0,0,0,1,0,0,0,1]),Gt=function(e){(0,cl.default)(n,e);var r=ml(n);function n(a){for(var t,i=arguments.length,s=new Array(i>1?i-1:0),o=1;o<i;o++)s[o-1]=arguments[o];return(0,ol.default)(this,n),t=r.call(this,-0,-0,-0,-0,-0,-0,-0,-0,-0),arguments.length===1&&Array.isArray(a)?t.copy(a):s.length>0?t.copy([a].concat(s)):t.identity(),t}return(0,ul.default)(n,[{key:"ELEMENTS",get:function(){return 9}},{key:"RANK",get:function(){return 3}},{key:"INDICES",get:function(){return Yt}},{key:"copy",value:function(t){return this[0]=t[0],this[1]=t[1],this[2]=t[2],this[3]=t[3],this[4]=t[4],this[5]=t[5],this[6]=t[6],this[7]=t[7],this[8]=t[8],this.check()}},{key:"identity",value:function(){return this.copy(gl)}},{key:"fromObject",value:function(t){return this.check()}},{key:"fromQuaternion",value:function(t){return me.fromQuat(this,t),this.check()}},{key:"set",value:function(t,i,s,o,c,u,l,h,f){return this[0]=t,this[1]=i,this[2]=s,this[3]=o,this[4]=c,this[5]=u,this[6]=l,this[7]=h,this[8]=f,this.check()}},{key:"setRowMajor",value:function(t,i,s,o,c,u,l,h,f){return this[0]=t,this[1]=o,this[2]=l,this[3]=i,this[4]=c,this[5]=h,this[6]=s,this[7]=u,this[8]=f,this.check()}},{key:"determinant",value:function(){return me.determinant(this)}},{key:"transpose",value:function(){return me.transpose(this,this),this.check()}},{key:"invert",value:function(){return me.invert(this,this),this.check()}},{key:"multiplyLeft",value:function(t){return me.multiply(this,t,this),this.check()}},{key:"multiplyRight",value:function(t){return me.multiply(this,this,t),this.check()}},{key:"rotate",value:function(t){return me.rotate(this,this,t),this.check()}},{key:"scale",value:function(t){return Array.isArray(t)?me.scale(this,this,t):me.scale(this,this,[t,t]),this.check()}},{key:"translate",value:function(t){return me.translate(this,this,t),this.check()}},{key:"transform",value:function(t,i){var s;switch(t.length){case 2:s=dl.transformMat3(i||[-0,-0],t,this);break;case 3:s=pl.transformMat3(i||[-0,-0,-0],t,this);break;case 4:s=(0,vl.vec4_transformMat3)(i||[-0,-0,-0,-0],t,this);break;default:throw new Error("Illegal vector")}return(0,hl.checkVector)(s,t.length),s}},{key:"transformVector",value:function(t,i){return this.transform(t,i)}},{key:"transformVector2",value:function(t,i){return this.transform(t,i)}},{key:"transformVector3",value:function(t,i){return this.transform(t,i)}}],[{key:"IDENTITY",get:function(){return bl()}},{key:"ZERO",get:function(){return Ml()}}]),n}(fl.default);et.default=Gt;var Jr,jr;function Ml(){return Jr||(Jr=new Gt([0,0,0,0,0,0,0,0,0]),Object.freeze(Jr)),Jr}function bl(){return jr||(jr=new Gt,Object.freeze(jr)),jr}});var La=P(R=>{"use strict";function rt(e){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?rt=function(n){return typeof n}:rt=function(n){return n&&typeof Symbol=="function"&&n.constructor===Symbol&&n!==Symbol.prototype?"symbol":typeof n},rt(e)}Object.defineProperty(R,"__esModule",{value:!0});R.create=_l;R.clone=Ol;R.copy=kl;R.fromValues=Rl;R.set=Tl;R.identity=Ta;R.transpose=Pl;R.invert=Al;R.adjoint=wl;R.determinant=Sl;R.multiply=Pa;R.translate=ql;R.scale=El;R.rotate=Ll;R.rotateX=Il;R.rotateY=Nl;R.rotateZ=Cl;R.fromTranslation=Wl;R.fromScaling=Dl;R.fromRotation=Fl;R.fromXRotation=zl;R.fromYRotation=Bl;R.fromZRotation=Vl;R.fromRotationTranslation=Aa;R.fromQuat2=Yl;R.getTranslation=Gl;R.getScaling=wa;R.getRotation=Ul;R.fromRotationTranslationScale=Xl;R.fromRotationTranslationScaleOrigin=Zl;R.fromQuat=Ql;R.frustum=$l;R.perspectiveNO=Sa;R.perspectiveZO=Kl;R.perspectiveFromFieldOfView=Jl;R.orthoNO=qa;R.orthoZO=ef;R.lookAt=rf;R.targetTo=tf;R.str=nf;R.frob=af;R.add=sf;R.subtract=Ea;R.multiplyScalar=of;R.multiplyScalarAndAdd=uf;R.exactEquals=cf;R.equals=lf;R.sub=R.mul=R.ortho=R.perspective=void 0;var F=xl(ze());function Ra(e){if(typeof WeakMap!="function")return null;var r=new WeakMap,n=new WeakMap;return(Ra=function(t){return t?n:r})(e)}function xl(e,r){if(!r&&e&&e.__esModule)return e;if(e===null||rt(e)!=="object"&&typeof e!="function")return{default:e};var n=Ra(r);if(n&&n.has(e))return n.get(e);var a={},t=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if(i!=="default"&&Object.prototype.hasOwnProperty.call(e,i)){var s=t?Object.getOwnPropertyDescriptor(e,i):null;s&&(s.get||s.set)?Object.defineProperty(a,i,s):a[i]=e[i]}return a.default=e,n&&n.set(e,a),a}function _l(){var e=new F.ARRAY_TYPE(16);return F.ARRAY_TYPE!=Float32Array&&(e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[11]=0,e[12]=0,e[13]=0,e[14]=0),e[0]=1,e[5]=1,e[10]=1,e[15]=1,e}function Ol(e){var r=new F.ARRAY_TYPE(16);return r[0]=e[0],r[1]=e[1],r[2]=e[2],r[3]=e[3],r[4]=e[4],r[5]=e[5],r[6]=e[6],r[7]=e[7],r[8]=e[8],r[9]=e[9],r[10]=e[10],r[11]=e[11],r[12]=e[12],r[13]=e[13],r[14]=e[14],r[15]=e[15],r}function kl(e,r){return e[0]=r[0],e[1]=r[1],e[2]=r[2],e[3]=r[3],e[4]=r[4],e[5]=r[5],e[6]=r[6],e[7]=r[7],e[8]=r[8],e[9]=r[9],e[10]=r[10],e[11]=r[11],e[12]=r[12],e[13]=r[13],e[14]=r[14],e[15]=r[15],e}function Rl(e,r,n,a,t,i,s,o,c,u,l,h,f,v,d,m){var p=new F.ARRAY_TYPE(16);return p[0]=e,p[1]=r,p[2]=n,p[3]=a,p[4]=t,p[5]=i,p[6]=s,p[7]=o,p[8]=c,p[9]=u,p[10]=l,p[11]=h,p[12]=f,p[13]=v,p[14]=d,p[15]=m,p}function Tl(e,r,n,a,t,i,s,o,c,u,l,h,f,v,d,m,p){return e[0]=r,e[1]=n,e[2]=a,e[3]=t,e[4]=i,e[5]=s,e[6]=o,e[7]=c,e[8]=u,e[9]=l,e[10]=h,e[11]=f,e[12]=v,e[13]=d,e[14]=m,e[15]=p,e}function Ta(e){return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=1,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=1,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}function Pl(e,r){if(e===r){var n=r[1],a=r[2],t=r[3],i=r[6],s=r[7],o=r[11];e[1]=r[4],e[2]=r[8],e[3]=r[12],e[4]=n,e[6]=r[9],e[7]=r[13],e[8]=a,e[9]=i,e[11]=r[14],e[12]=t,e[13]=s,e[14]=o}else e[0]=r[0],e[1]=r[4],e[2]=r[8],e[3]=r[12],e[4]=r[1],e[5]=r[5],e[6]=r[9],e[7]=r[13],e[8]=r[2],e[9]=r[6],e[10]=r[10],e[11]=r[14],e[12]=r[3],e[13]=r[7],e[14]=r[11],e[15]=r[15];return e}function Al(e,r){var n=r[0],a=r[1],t=r[2],i=r[3],s=r[4],o=r[5],c=r[6],u=r[7],l=r[8],h=r[9],f=r[10],v=r[11],d=r[12],m=r[13],p=r[14],y=r[15],b=n*o-a*s,g=n*c-t*s,M=n*u-i*s,k=a*c-t*o,_=a*u-i*o,C=t*u-i*c,L=l*m-h*d,I=l*p-f*d,S=l*y-v*d,W=h*p-f*m,N=h*y-v*m,D=f*y-v*p,w=b*D-g*N+M*W+k*S-_*I+C*L;return w?(w=1/w,e[0]=(o*D-c*N+u*W)*w,e[1]=(t*N-a*D-i*W)*w,e[2]=(m*C-p*_+y*k)*w,e[3]=(f*_-h*C-v*k)*w,e[4]=(c*S-s*D-u*I)*w,e[5]=(n*D-t*S+i*I)*w,e[6]=(p*M-d*C-y*g)*w,e[7]=(l*C-f*M+v*g)*w,e[8]=(s*N-o*S+u*L)*w,e[9]=(a*S-n*N-i*L)*w,e[10]=(d*_-m*M+y*b)*w,e[11]=(h*M-l*_-v*b)*w,e[12]=(o*I-s*W-c*L)*w,e[13]=(n*W-a*I+t*L)*w,e[14]=(m*g-d*k-p*b)*w,e[15]=(l*k-h*g+f*b)*w,e):null}function wl(e,r){var n=r[0],a=r[1],t=r[2],i=r[3],s=r[4],o=r[5],c=r[6],u=r[7],l=r[8],h=r[9],f=r[10],v=r[11],d=r[12],m=r[13],p=r[14],y=r[15];return e[0]=o*(f*y-v*p)-h*(c*y-u*p)+m*(c*v-u*f),e[1]=-(a*(f*y-v*p)-h*(t*y-i*p)+m*(t*v-i*f)),e[2]=a*(c*y-u*p)-o*(t*y-i*p)+m*(t*u-i*c),e[3]=-(a*(c*v-u*f)-o*(t*v-i*f)+h*(t*u-i*c)),e[4]=-(s*(f*y-v*p)-l*(c*y-u*p)+d*(c*v-u*f)),e[5]=n*(f*y-v*p)-l*(t*y-i*p)+d*(t*v-i*f),e[6]=-(n*(c*y-u*p)-s*(t*y-i*p)+d*(t*u-i*c)),e[7]=n*(c*v-u*f)-s*(t*v-i*f)+l*(t*u-i*c),e[8]=s*(h*y-v*m)-l*(o*y-u*m)+d*(o*v-u*h),e[9]=-(n*(h*y-v*m)-l*(a*y-i*m)+d*(a*v-i*h)),e[10]=n*(o*y-u*m)-s*(a*y-i*m)+d*(a*u-i*o),e[11]=-(n*(o*v-u*h)-s*(a*v-i*h)+l*(a*u-i*o)),e[12]=-(s*(h*p-f*m)-l*(o*p-c*m)+d*(o*f-c*h)),e[13]=n*(h*p-f*m)-l*(a*p-t*m)+d*(a*f-t*h),e[14]=-(n*(o*p-c*m)-s*(a*p-t*m)+d*(a*c-t*o)),e[15]=n*(o*f-c*h)-s*(a*f-t*h)+l*(a*c-t*o),e}function Sl(e){var r=e[0],n=e[1],a=e[2],t=e[3],i=e[4],s=e[5],o=e[6],c=e[7],u=e[8],l=e[9],h=e[10],f=e[11],v=e[12],d=e[13],m=e[14],p=e[15],y=r*s-n*i,b=r*o-a*i,g=r*c-t*i,M=n*o-a*s,k=n*c-t*s,_=a*c-t*o,C=u*d-l*v,L=u*m-h*v,I=u*p-f*v,S=l*m-h*d,W=l*p-f*d,N=h*p-f*m;return y*N-b*W+g*S+M*I-k*L+_*C}function Pa(e,r,n){var a=r[0],t=r[1],i=r[2],s=r[3],o=r[4],c=r[5],u=r[6],l=r[7],h=r[8],f=r[9],v=r[10],d=r[11],m=r[12],p=r[13],y=r[14],b=r[15],g=n[0],M=n[1],k=n[2],_=n[3];return e[0]=g*a+M*o+k*h+_*m,e[1]=g*t+M*c+k*f+_*p,e[2]=g*i+M*u+k*v+_*y,e[3]=g*s+M*l+k*d+_*b,g=n[4],M=n[5],k=n[6],_=n[7],e[4]=g*a+M*o+k*h+_*m,e[5]=g*t+M*c+k*f+_*p,e[6]=g*i+M*u+k*v+_*y,e[7]=g*s+M*l+k*d+_*b,g=n[8],M=n[9],k=n[10],_=n[11],e[8]=g*a+M*o+k*h+_*m,e[9]=g*t+M*c+k*f+_*p,e[10]=g*i+M*u+k*v+_*y,e[11]=g*s+M*l+k*d+_*b,g=n[12],M=n[13],k=n[14],_=n[15],e[12]=g*a+M*o+k*h+_*m,e[13]=g*t+M*c+k*f+_*p,e[14]=g*i+M*u+k*v+_*y,e[15]=g*s+M*l+k*d+_*b,e}function ql(e,r,n){var a=n[0],t=n[1],i=n[2],s,o,c,u,l,h,f,v,d,m,p,y;return r===e?(e[12]=r[0]*a+r[4]*t+r[8]*i+r[12],e[13]=r[1]*a+r[5]*t+r[9]*i+r[13],e[14]=r[2]*a+r[6]*t+r[10]*i+r[14],e[15]=r[3]*a+r[7]*t+r[11]*i+r[15]):(s=r[0],o=r[1],c=r[2],u=r[3],l=r[4],h=r[5],f=r[6],v=r[7],d=r[8],m=r[9],p=r[10],y=r[11],e[0]=s,e[1]=o,e[2]=c,e[3]=u,e[4]=l,e[5]=h,e[6]=f,e[7]=v,e[8]=d,e[9]=m,e[10]=p,e[11]=y,e[12]=s*a+l*t+d*i+r[12],e[13]=o*a+h*t+m*i+r[13],e[14]=c*a+f*t+p*i+r[14],e[15]=u*a+v*t+y*i+r[15]),e}function El(e,r,n){var a=n[0],t=n[1],i=n[2];return e[0]=r[0]*a,e[1]=r[1]*a,e[2]=r[2]*a,e[3]=r[3]*a,e[4]=r[4]*t,e[5]=r[5]*t,e[6]=r[6]*t,e[7]=r[7]*t,e[8]=r[8]*i,e[9]=r[9]*i,e[10]=r[10]*i,e[11]=r[11]*i,e[12]=r[12],e[13]=r[13],e[14]=r[14],e[15]=r[15],e}function Ll(e,r,n,a){var t=a[0],i=a[1],s=a[2],o=Math.hypot(t,i,s),c,u,l,h,f,v,d,m,p,y,b,g,M,k,_,C,L,I,S,W,N,D,w,X;return o<F.EPSILON?null:(o=1/o,t*=o,i*=o,s*=o,c=Math.sin(n),u=Math.cos(n),l=1-u,h=r[0],f=r[1],v=r[2],d=r[3],m=r[4],p=r[5],y=r[6],b=r[7],g=r[8],M=r[9],k=r[10],_=r[11],C=t*t*l+u,L=i*t*l+s*c,I=s*t*l-i*c,S=t*i*l-s*c,W=i*i*l+u,N=s*i*l+t*c,D=t*s*l+i*c,w=i*s*l-t*c,X=s*s*l+u,e[0]=h*C+m*L+g*I,e[1]=f*C+p*L+M*I,e[2]=v*C+y*L+k*I,e[3]=d*C+b*L+_*I,e[4]=h*S+m*W+g*N,e[5]=f*S+p*W+M*N,e[6]=v*S+y*W+k*N,e[7]=d*S+b*W+_*N,e[8]=h*D+m*w+g*X,e[9]=f*D+p*w+M*X,e[10]=v*D+y*w+k*X,e[11]=d*D+b*w+_*X,r!==e&&(e[12]=r[12],e[13]=r[13],e[14]=r[14],e[15]=r[15]),e)}function Il(e,r,n){var a=Math.sin(n),t=Math.cos(n),i=r[4],s=r[5],o=r[6],c=r[7],u=r[8],l=r[9],h=r[10],f=r[11];return r!==e&&(e[0]=r[0],e[1]=r[1],e[2]=r[2],e[3]=r[3],e[12]=r[12],e[13]=r[13],e[14]=r[14],e[15]=r[15]),e[4]=i*t+u*a,e[5]=s*t+l*a,e[6]=o*t+h*a,e[7]=c*t+f*a,e[8]=u*t-i*a,e[9]=l*t-s*a,e[10]=h*t-o*a,e[11]=f*t-c*a,e}function Nl(e,r,n){var a=Math.sin(n),t=Math.cos(n),i=r[0],s=r[1],o=r[2],c=r[3],u=r[8],l=r[9],h=r[10],f=r[11];return r!==e&&(e[4]=r[4],e[5]=r[5],e[6]=r[6],e[7]=r[7],e[12]=r[12],e[13]=r[13],e[14]=r[14],e[15]=r[15]),e[0]=i*t-u*a,e[1]=s*t-l*a,e[2]=o*t-h*a,e[3]=c*t-f*a,e[8]=i*a+u*t,e[9]=s*a+l*t,e[10]=o*a+h*t,e[11]=c*a+f*t,e}function Cl(e,r,n){var a=Math.sin(n),t=Math.cos(n),i=r[0],s=r[1],o=r[2],c=r[3],u=r[4],l=r[5],h=r[6],f=r[7];return r!==e&&(e[8]=r[8],e[9]=r[9],e[10]=r[10],e[11]=r[11],e[12]=r[12],e[13]=r[13],e[14]=r[14],e[15]=r[15]),e[0]=i*t+u*a,e[1]=s*t+l*a,e[2]=o*t+h*a,e[3]=c*t+f*a,e[4]=u*t-i*a,e[5]=l*t-s*a,e[6]=h*t-o*a,e[7]=f*t-c*a,e}function Wl(e,r){return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=1,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=1,e[11]=0,e[12]=r[0],e[13]=r[1],e[14]=r[2],e[15]=1,e}function Dl(e,r){return e[0]=r[0],e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=r[1],e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=r[2],e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}function Fl(e,r,n){var a=n[0],t=n[1],i=n[2],s=Math.hypot(a,t,i),o,c,u;return s<F.EPSILON?null:(s=1/s,a*=s,t*=s,i*=s,o=Math.sin(r),c=Math.cos(r),u=1-c,e[0]=a*a*u+c,e[1]=t*a*u+i*o,e[2]=i*a*u-t*o,e[3]=0,e[4]=a*t*u-i*o,e[5]=t*t*u+c,e[6]=i*t*u+a*o,e[7]=0,e[8]=a*i*u+t*o,e[9]=t*i*u-a*o,e[10]=i*i*u+c,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e)}function zl(e,r){var n=Math.sin(r),a=Math.cos(r);return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=a,e[6]=n,e[7]=0,e[8]=0,e[9]=-n,e[10]=a,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}function Bl(e,r){var n=Math.sin(r),a=Math.cos(r);return e[0]=a,e[1]=0,e[2]=-n,e[3]=0,e[4]=0,e[5]=1,e[6]=0,e[7]=0,e[8]=n,e[9]=0,e[10]=a,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}function Vl(e,r){var n=Math.sin(r),a=Math.cos(r);return e[0]=a,e[1]=n,e[2]=0,e[3]=0,e[4]=-n,e[5]=a,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=1,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}function Aa(e,r,n){var a=r[0],t=r[1],i=r[2],s=r[3],o=a+a,c=t+t,u=i+i,l=a*o,h=a*c,f=a*u,v=t*c,d=t*u,m=i*u,p=s*o,y=s*c,b=s*u;return e[0]=1-(v+m),e[1]=h+b,e[2]=f-y,e[3]=0,e[4]=h-b,e[5]=1-(l+m),e[6]=d+p,e[7]=0,e[8]=f+y,e[9]=d-p,e[10]=1-(l+v),e[11]=0,e[12]=n[0],e[13]=n[1],e[14]=n[2],e[15]=1,e}function Yl(e,r){var n=new F.ARRAY_TYPE(3),a=-r[0],t=-r[1],i=-r[2],s=r[3],o=r[4],c=r[5],u=r[6],l=r[7],h=a*a+t*t+i*i+s*s;return h>0?(n[0]=(o*s+l*a+c*i-u*t)*2/h,n[1]=(c*s+l*t+u*a-o*i)*2/h,n[2]=(u*s+l*i+o*t-c*a)*2/h):(n[0]=(o*s+l*a+c*i-u*t)*2,n[1]=(c*s+l*t+u*a-o*i)*2,n[2]=(u*s+l*i+o*t-c*a)*2),Aa(e,r,n),e}function Gl(e,r){return e[0]=r[12],e[1]=r[13],e[2]=r[14],e}function wa(e,r){var n=r[0],a=r[1],t=r[2],i=r[4],s=r[5],o=r[6],c=r[8],u=r[9],l=r[10];return e[0]=Math.hypot(n,a,t),e[1]=Math.hypot(i,s,o),e[2]=Math.hypot(c,u,l),e}function Ul(e,r){var n=new F.ARRAY_TYPE(3);wa(n,r);var a=1/n[0],t=1/n[1],i=1/n[2],s=r[0]*a,o=r[1]*t,c=r[2]*i,u=r[4]*a,l=r[5]*t,h=r[6]*i,f=r[8]*a,v=r[9]*t,d=r[10]*i,m=s+l+d,p=0;return m>0?(p=Math.sqrt(m+1)*2,e[3]=.25*p,e[0]=(h-v)/p,e[1]=(f-c)/p,e[2]=(o-u)/p):s>l&&s>d?(p=Math.sqrt(1+s-l-d)*2,e[3]=(h-v)/p,e[0]=.25*p,e[1]=(o+u)/p,e[2]=(f+c)/p):l>d?(p=Math.sqrt(1+l-s-d)*2,e[3]=(f-c)/p,e[0]=(o+u)/p,e[1]=.25*p,e[2]=(h+v)/p):(p=Math.sqrt(1+d-s-l)*2,e[3]=(o-u)/p,e[0]=(f+c)/p,e[1]=(h+v)/p,e[2]=.25*p),e}function Xl(e,r,n,a){var t=r[0],i=r[1],s=r[2],o=r[3],c=t+t,u=i+i,l=s+s,h=t*c,f=t*u,v=t*l,d=i*u,m=i*l,p=s*l,y=o*c,b=o*u,g=o*l,M=a[0],k=a[1],_=a[2];return e[0]=(1-(d+p))*M,e[1]=(f+g)*M,e[2]=(v-b)*M,e[3]=0,e[4]=(f-g)*k,e[5]=(1-(h+p))*k,e[6]=(m+y)*k,e[7]=0,e[8]=(v+b)*_,e[9]=(m-y)*_,e[10]=(1-(h+d))*_,e[11]=0,e[12]=n[0],e[13]=n[1],e[14]=n[2],e[15]=1,e}function Zl(e,r,n,a,t){var i=r[0],s=r[1],o=r[2],c=r[3],u=i+i,l=s+s,h=o+o,f=i*u,v=i*l,d=i*h,m=s*l,p=s*h,y=o*h,b=c*u,g=c*l,M=c*h,k=a[0],_=a[1],C=a[2],L=t[0],I=t[1],S=t[2],W=(1-(m+y))*k,N=(v+M)*k,D=(d-g)*k,w=(v-M)*_,X=(1-(f+y))*_,fe=(p+b)*_,he=(d+g)*C,Ne=(p-b)*C,Ce=(1-(f+m))*C;return e[0]=W,e[1]=N,e[2]=D,e[3]=0,e[4]=w,e[5]=X,e[6]=fe,e[7]=0,e[8]=he,e[9]=Ne,e[10]=Ce,e[11]=0,e[12]=n[0]+L-(W*L+w*I+he*S),e[13]=n[1]+I-(N*L+X*I+Ne*S),e[14]=n[2]+S-(D*L+fe*I+Ce*S),e[15]=1,e}function Ql(e,r){var n=r[0],a=r[1],t=r[2],i=r[3],s=n+n,o=a+a,c=t+t,u=n*s,l=a*s,h=a*o,f=t*s,v=t*o,d=t*c,m=i*s,p=i*o,y=i*c;return e[0]=1-h-d,e[1]=l+y,e[2]=f-p,e[3]=0,e[4]=l-y,e[5]=1-u-d,e[6]=v+m,e[7]=0,e[8]=f+p,e[9]=v-m,e[10]=1-u-h,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}function $l(e,r,n,a,t,i,s){var o=1/(n-r),c=1/(t-a),u=1/(i-s);return e[0]=i*2*o,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=i*2*c,e[6]=0,e[7]=0,e[8]=(n+r)*o,e[9]=(t+a)*c,e[10]=(s+i)*u,e[11]=-1,e[12]=0,e[13]=0,e[14]=s*i*2*u,e[15]=0,e}function Sa(e,r,n,a,t){var i=1/Math.tan(r/2),s;return e[0]=i/n,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=i,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[11]=-1,e[12]=0,e[13]=0,e[15]=0,t!=null&&t!==1/0?(s=1/(a-t),e[10]=(t+a)*s,e[14]=2*t*a*s):(e[10]=-1,e[14]=-2*a),e}var Hl=Sa;R.perspective=Hl;function Kl(e,r,n,a,t){var i=1/Math.tan(r/2),s;return e[0]=i/n,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=i,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[11]=-1,e[12]=0,e[13]=0,e[15]=0,t!=null&&t!==1/0?(s=1/(a-t),e[10]=t*s,e[14]=t*a*s):(e[10]=-1,e[14]=-a),e}function Jl(e,r,n,a){var t=Math.tan(r.upDegrees*Math.PI/180),i=Math.tan(r.downDegrees*Math.PI/180),s=Math.tan(r.leftDegrees*Math.PI/180),o=Math.tan(r.rightDegrees*Math.PI/180),c=2/(s+o),u=2/(t+i);return e[0]=c,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=u,e[6]=0,e[7]=0,e[8]=-((s-o)*c*.5),e[9]=(t-i)*u*.5,e[10]=a/(n-a),e[11]=-1,e[12]=0,e[13]=0,e[14]=a*n/(n-a),e[15]=0,e}function qa(e,r,n,a,t,i,s){var o=1/(r-n),c=1/(a-t),u=1/(i-s);return e[0]=-2*o,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=-2*c,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=2*u,e[11]=0,e[12]=(r+n)*o,e[13]=(t+a)*c,e[14]=(s+i)*u,e[15]=1,e}var jl=qa;R.ortho=jl;function ef(e,r,n,a,t,i,s){var o=1/(r-n),c=1/(a-t),u=1/(i-s);return e[0]=-2*o,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=-2*c,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=u,e[11]=0,e[12]=(r+n)*o,e[13]=(t+a)*c,e[14]=i*u,e[15]=1,e}function rf(e,r,n,a){var t,i,s,o,c,u,l,h,f,v,d=r[0],m=r[1],p=r[2],y=a[0],b=a[1],g=a[2],M=n[0],k=n[1],_=n[2];return Math.abs(d-M)<F.EPSILON&&Math.abs(m-k)<F.EPSILON&&Math.abs(p-_)<F.EPSILON?Ta(e):(l=d-M,h=m-k,f=p-_,v=1/Math.hypot(l,h,f),l*=v,h*=v,f*=v,t=b*f-g*h,i=g*l-y*f,s=y*h-b*l,v=Math.hypot(t,i,s),v?(v=1/v,t*=v,i*=v,s*=v):(t=0,i=0,s=0),o=h*s-f*i,c=f*t-l*s,u=l*i-h*t,v=Math.hypot(o,c,u),v?(v=1/v,o*=v,c*=v,u*=v):(o=0,c=0,u=0),e[0]=t,e[1]=o,e[2]=l,e[3]=0,e[4]=i,e[5]=c,e[6]=h,e[7]=0,e[8]=s,e[9]=u,e[10]=f,e[11]=0,e[12]=-(t*d+i*m+s*p),e[13]=-(o*d+c*m+u*p),e[14]=-(l*d+h*m+f*p),e[15]=1,e)}function tf(e,r,n,a){var t=r[0],i=r[1],s=r[2],o=a[0],c=a[1],u=a[2],l=t-n[0],h=i-n[1],f=s-n[2],v=l*l+h*h+f*f;v>0&&(v=1/Math.sqrt(v),l*=v,h*=v,f*=v);var d=c*f-u*h,m=u*l-o*f,p=o*h-c*l;return v=d*d+m*m+p*p,v>0&&(v=1/Math.sqrt(v),d*=v,m*=v,p*=v),e[0]=d,e[1]=m,e[2]=p,e[3]=0,e[4]=h*p-f*m,e[5]=f*d-l*p,e[6]=l*m-h*d,e[7]=0,e[8]=l,e[9]=h,e[10]=f,e[11]=0,e[12]=t,e[13]=i,e[14]=s,e[15]=1,e}function nf(e){return"mat4("+e[0]+", "+e[1]+", "+e[2]+", "+e[3]+", "+e[4]+", "+e[5]+", "+e[6]+", "+e[7]+", "+e[8]+", "+e[9]+", "+e[10]+", "+e[11]+", "+e[12]+", "+e[13]+", "+e[14]+", "+e[15]+")"}function af(e){return Math.hypot(e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8],e[9],e[10],e[11],e[12],e[13],e[14],e[15])}function sf(e,r,n){return e[0]=r[0]+n[0],e[1]=r[1]+n[1],e[2]=r[2]+n[2],e[3]=r[3]+n[3],e[4]=r[4]+n[4],e[5]=r[5]+n[5],e[6]=r[6]+n[6],e[7]=r[7]+n[7],e[8]=r[8]+n[8],e[9]=r[9]+n[9],e[10]=r[10]+n[10],e[11]=r[11]+n[11],e[12]=r[12]+n[12],e[13]=r[13]+n[13],e[14]=r[14]+n[14],e[15]=r[15]+n[15],e}function Ea(e,r,n){return e[0]=r[0]-n[0],e[1]=r[1]-n[1],e[2]=r[2]-n[2],e[3]=r[3]-n[3],e[4]=r[4]-n[4],e[5]=r[5]-n[5],e[6]=r[6]-n[6],e[7]=r[7]-n[7],e[8]=r[8]-n[8],e[9]=r[9]-n[9],e[10]=r[10]-n[10],e[11]=r[11]-n[11],e[12]=r[12]-n[12],e[13]=r[13]-n[13],e[14]=r[14]-n[14],e[15]=r[15]-n[15],e}function of(e,r,n){return e[0]=r[0]*n,e[1]=r[1]*n,e[2]=r[2]*n,e[3]=r[3]*n,e[4]=r[4]*n,e[5]=r[5]*n,e[6]=r[6]*n,e[7]=r[7]*n,e[8]=r[8]*n,e[9]=r[9]*n,e[10]=r[10]*n,e[11]=r[11]*n,e[12]=r[12]*n,e[13]=r[13]*n,e[14]=r[14]*n,e[15]=r[15]*n,e}function uf(e,r,n,a){return e[0]=r[0]+n[0]*a,e[1]=r[1]+n[1]*a,e[2]=r[2]+n[2]*a,e[3]=r[3]+n[3]*a,e[4]=r[4]+n[4]*a,e[5]=r[5]+n[5]*a,e[6]=r[6]+n[6]*a,e[7]=r[7]+n[7]*a,e[8]=r[8]+n[8]*a,e[9]=r[9]+n[9]*a,e[10]=r[10]+n[10]*a,e[11]=r[11]+n[11]*a,e[12]=r[12]+n[12]*a,e[13]=r[13]+n[13]*a,e[14]=r[14]+n[14]*a,e[15]=r[15]+n[15]*a,e}function cf(e,r){return e[0]===r[0]&&e[1]===r[1]&&e[2]===r[2]&&e[3]===r[3]&&e[4]===r[4]&&e[5]===r[5]&&e[6]===r[6]&&e[7]===r[7]&&e[8]===r[8]&&e[9]===r[9]&&e[10]===r[10]&&e[11]===r[11]&&e[12]===r[12]&&e[13]===r[13]&&e[14]===r[14]&&e[15]===r[15]}function lf(e,r){var n=e[0],a=e[1],t=e[2],i=e[3],s=e[4],o=e[5],c=e[6],u=e[7],l=e[8],h=e[9],f=e[10],v=e[11],d=e[12],m=e[13],p=e[14],y=e[15],b=r[0],g=r[1],M=r[2],k=r[3],_=r[4],C=r[5],L=r[6],I=r[7],S=r[8],W=r[9],N=r[10],D=r[11],w=r[12],X=r[13],fe=r[14],he=r[15];return Math.abs(n-b)<=F.EPSILON*Math.max(1,Math.abs(n),Math.abs(b))&&Math.abs(a-g)<=F.EPSILON*Math.max(1,Math.abs(a),Math.abs(g))&&Math.abs(t-M)<=F.EPSILON*Math.max(1,Math.abs(t),Math.abs(M))&&Math.abs(i-k)<=F.EPSILON*Math.max(1,Math.abs(i),Math.abs(k))&&Math.abs(s-_)<=F.EPSILON*Math.max(1,Math.abs(s),Math.abs(_))&&Math.abs(o-C)<=F.EPSILON*Math.max(1,Math.abs(o),Math.abs(C))&&Math.abs(c-L)<=F.EPSILON*Math.max(1,Math.abs(c),Math.abs(L))&&Math.abs(u-I)<=F.EPSILON*Math.max(1,Math.abs(u),Math.abs(I))&&Math.abs(l-S)<=F.EPSILON*Math.max(1,Math.abs(l),Math.abs(S))&&Math.abs(h-W)<=F.EPSILON*Math.max(1,Math.abs(h),Math.abs(W))&&Math.abs(f-N)<=F.EPSILON*Math.max(1,Math.abs(f),Math.abs(N))&&Math.abs(v-D)<=F.EPSILON*Math.max(1,Math.abs(v),Math.abs(D))&&Math.abs(d-w)<=F.EPSILON*Math.max(1,Math.abs(d),Math.abs(w))&&Math.abs(m-X)<=F.EPSILON*Math.max(1,Math.abs(m),Math.abs(X))&&Math.abs(p-fe)<=F.EPSILON*Math.max(1,Math.abs(p),Math.abs(fe))&&Math.abs(y-he)<=F.EPSILON*Math.max(1,Math.abs(y),Math.abs(he))}var ff=Pa;R.mul=ff;var hf=Ea;R.sub=hf});var nt=P(A=>{"use strict";function tt(e){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?tt=function(n){return typeof n}:tt=function(n){return n&&typeof Symbol=="function"&&n.constructor===Symbol&&n!==Symbol.prototype?"symbol":typeof n},tt(e)}Object.defineProperty(A,"__esModule",{value:!0});A.create=Na;A.clone=df;A.fromValues=pf;A.copy=mf;A.set=yf;A.add=gf;A.subtract=Ca;A.multiply=Wa;A.divide=Da;A.ceil=Mf;A.floor=bf;A.min=xf;A.max=_f;A.round=Of;A.scale=kf;A.scaleAndAdd=Rf;A.distance=Fa;A.squaredDistance=za;A.length=Ba;A.squaredLength=Va;A.negate=Tf;A.inverse=Pf;A.normalize=Af;A.dot=wf;A.cross=Sf;A.lerp=qf;A.random=Ef;A.transformMat4=Lf;A.transformQuat=If;A.zero=Nf;A.str=Cf;A.exactEquals=Wf;A.equals=Df;A.forEach=A.sqrLen=A.len=A.sqrDist=A.dist=A.div=A.mul=A.sub=void 0;var ae=vf(ze());function Ia(e){if(typeof WeakMap!="function")return null;var r=new WeakMap,n=new WeakMap;return(Ia=function(t){return t?n:r})(e)}function vf(e,r){if(!r&&e&&e.__esModule)return e;if(e===null||tt(e)!=="object"&&typeof e!="function")return{default:e};var n=Ia(r);if(n&&n.has(e))return n.get(e);var a={},t=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if(i!=="default"&&Object.prototype.hasOwnProperty.call(e,i)){var s=t?Object.getOwnPropertyDescriptor(e,i):null;s&&(s.get||s.set)?Object.defineProperty(a,i,s):a[i]=e[i]}return a.default=e,n&&n.set(e,a),a}function Na(){var e=new ae.ARRAY_TYPE(4);return ae.ARRAY_TYPE!=Float32Array&&(e[0]=0,e[1]=0,e[2]=0,e[3]=0),e}function df(e){var r=new ae.ARRAY_TYPE(4);return r[0]=e[0],r[1]=e[1],r[2]=e[2],r[3]=e[3],r}function pf(e,r,n,a){var t=new ae.ARRAY_TYPE(4);return t[0]=e,t[1]=r,t[2]=n,t[3]=a,t}function mf(e,r){return e[0]=r[0],e[1]=r[1],e[2]=r[2],e[3]=r[3],e}function yf(e,r,n,a,t){return e[0]=r,e[1]=n,e[2]=a,e[3]=t,e}function gf(e,r,n){return e[0]=r[0]+n[0],e[1]=r[1]+n[1],e[2]=r[2]+n[2],e[3]=r[3]+n[3],e}function Ca(e,r,n){return e[0]=r[0]-n[0],e[1]=r[1]-n[1],e[2]=r[2]-n[2],e[3]=r[3]-n[3],e}function Wa(e,r,n){return e[0]=r[0]*n[0],e[1]=r[1]*n[1],e[2]=r[2]*n[2],e[3]=r[3]*n[3],e}function Da(e,r,n){return e[0]=r[0]/n[0],e[1]=r[1]/n[1],e[2]=r[2]/n[2],e[3]=r[3]/n[3],e}function Mf(e,r){return e[0]=Math.ceil(r[0]),e[1]=Math.ceil(r[1]),e[2]=Math.ceil(r[2]),e[3]=Math.ceil(r[3]),e}function bf(e,r){return e[0]=Math.floor(r[0]),e[1]=Math.floor(r[1]),e[2]=Math.floor(r[2]),e[3]=Math.floor(r[3]),e}function xf(e,r,n){return e[0]=Math.min(r[0],n[0]),e[1]=Math.min(r[1],n[1]),e[2]=Math.min(r[2],n[2]),e[3]=Math.min(r[3],n[3]),e}function _f(e,r,n){return e[0]=Math.max(r[0],n[0]),e[1]=Math.max(r[1],n[1]),e[2]=Math.max(r[2],n[2]),e[3]=Math.max(r[3],n[3]),e}function Of(e,r){return e[0]=Math.round(r[0]),e[1]=Math.round(r[1]),e[2]=Math.round(r[2]),e[3]=Math.round(r[3]),e}function kf(e,r,n){return e[0]=r[0]*n,e[1]=r[1]*n,e[2]=r[2]*n,e[3]=r[3]*n,e}function Rf(e,r,n,a){return e[0]=r[0]+n[0]*a,e[1]=r[1]+n[1]*a,e[2]=r[2]+n[2]*a,e[3]=r[3]+n[3]*a,e}function Fa(e,r){var n=r[0]-e[0],a=r[1]-e[1],t=r[2]-e[2],i=r[3]-e[3];return Math.hypot(n,a,t,i)}function za(e,r){var n=r[0]-e[0],a=r[1]-e[1],t=r[2]-e[2],i=r[3]-e[3];return n*n+a*a+t*t+i*i}function Ba(e){var r=e[0],n=e[1],a=e[2],t=e[3];return Math.hypot(r,n,a,t)}function Va(e){var r=e[0],n=e[1],a=e[2],t=e[3];return r*r+n*n+a*a+t*t}function Tf(e,r){return e[0]=-r[0],e[1]=-r[1],e[2]=-r[2],e[3]=-r[3],e}function Pf(e,r){return e[0]=1/r[0],e[1]=1/r[1],e[2]=1/r[2],e[3]=1/r[3],e}function Af(e,r){var n=r[0],a=r[1],t=r[2],i=r[3],s=n*n+a*a+t*t+i*i;return s>0&&(s=1/Math.sqrt(s)),e[0]=n*s,e[1]=a*s,e[2]=t*s,e[3]=i*s,e}function wf(e,r){return e[0]*r[0]+e[1]*r[1]+e[2]*r[2]+e[3]*r[3]}function Sf(e,r,n,a){var t=n[0]*a[1]-n[1]*a[0],i=n[0]*a[2]-n[2]*a[0],s=n[0]*a[3]-n[3]*a[0],o=n[1]*a[2]-n[2]*a[1],c=n[1]*a[3]-n[3]*a[1],u=n[2]*a[3]-n[3]*a[2],l=r[0],h=r[1],f=r[2],v=r[3];return e[0]=h*u-f*c+v*o,e[1]=-(l*u)+f*s-v*i,e[2]=l*c-h*s+v*t,e[3]=-(l*o)+h*i-f*t,e}function qf(e,r,n,a){var t=r[0],i=r[1],s=r[2],o=r[3];return e[0]=t+a*(n[0]-t),e[1]=i+a*(n[1]-i),e[2]=s+a*(n[2]-s),e[3]=o+a*(n[3]-o),e}function Ef(e,r){r=r||1;var n,a,t,i,s,o;do n=ae.RANDOM()*2-1,a=ae.RANDOM()*2-1,s=n*n+a*a;while(s>=1);do t=ae.RANDOM()*2-1,i=ae.RANDOM()*2-1,o=t*t+i*i;while(o>=1);var c=Math.sqrt((1-s)/o);return e[0]=r*n,e[1]=r*a,e[2]=r*t*c,e[3]=r*i*c,e}function Lf(e,r,n){var a=r[0],t=r[1],i=r[2],s=r[3];return e[0]=n[0]*a+n[4]*t+n[8]*i+n[12]*s,e[1]=n[1]*a+n[5]*t+n[9]*i+n[13]*s,e[2]=n[2]*a+n[6]*t+n[10]*i+n[14]*s,e[3]=n[3]*a+n[7]*t+n[11]*i+n[15]*s,e}function If(e,r,n){var a=r[0],t=r[1],i=r[2],s=n[0],o=n[1],c=n[2],u=n[3],l=u*a+o*i-c*t,h=u*t+c*a-s*i,f=u*i+s*t-o*a,v=-s*a-o*t-c*i;return e[0]=l*u+v*-s+h*-c-f*-o,e[1]=h*u+v*-o+f*-s-l*-c,e[2]=f*u+v*-c+l*-o-h*-s,e[3]=r[3],e}function Nf(e){return e[0]=0,e[1]=0,e[2]=0,e[3]=0,e}function Cf(e){return"vec4("+e[0]+", "+e[1]+", "+e[2]+", "+e[3]+")"}function Wf(e,r){return e[0]===r[0]&&e[1]===r[1]&&e[2]===r[2]&&e[3]===r[3]}function Df(e,r){var n=e[0],a=e[1],t=e[2],i=e[3],s=r[0],o=r[1],c=r[2],u=r[3];return Math.abs(n-s)<=ae.EPSILON*Math.max(1,Math.abs(n),Math.abs(s))&&Math.abs(a-o)<=ae.EPSILON*Math.max(1,Math.abs(a),Math.abs(o))&&Math.abs(t-c)<=ae.EPSILON*Math.max(1,Math.abs(t),Math.abs(c))&&Math.abs(i-u)<=ae.EPSILON*Math.max(1,Math.abs(i),Math.abs(u))}var Ff=Ca;A.sub=Ff;var zf=Wa;A.mul=zf;var Bf=Da;A.div=Bf;var Vf=Fa;A.dist=Vf;var Yf=za;A.sqrDist=Yf;var Gf=Ba;A.len=Gf;var Uf=Va;A.sqrLen=Uf;var Xf=function(){var e=Na();return function(r,n,a,t,i,s){var o,c;for(n||(n=4),a||(a=0),t?c=Math.min(t*n+a,r.length):c=r.length,o=a;o<c;o+=n)e[0]=r[o],e[1]=r[o+1],e[2]=r[o+2],e[3]=r[o+3],i(e,e,s),r[o]=e[0],r[o+1]=e[1],r[o+2]=e[2],r[o+3]=e[3];return r}}();A.forEach=Xf});var Ht=P(ot=>{"use strict";var er=U(),Zf=j();Object.defineProperty(ot,"__esModule",{value:!0});ot.default=void 0;var Qf=er($()),$f=er(H()),Hf=er(se()),Kf=er(oe()),Ya=er(ue()),Jf=er(zt()),Ut=de(),Ga=Qe(),Z=at(La()),jf=at(zr()),eh=at(Ae()),rh=at(nt());function Ua(e){if(typeof WeakMap!="function")return null;var r=new WeakMap,n=new WeakMap;return(Ua=function(t){return t?n:r})(e)}function at(e,r){if(!r&&e&&e.__esModule)return e;if(e===null||Zf(e)!=="object"&&typeof e!="function")return{default:e};var n=Ua(r);if(n&&n.has(e))return n.get(e);var a={},t=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if(i!=="default"&&Object.prototype.hasOwnProperty.call(e,i)){var s=t?Object.getOwnPropertyDescriptor(e,i):null;s&&(s.get||s.set)?Object.defineProperty(a,i,s):a[i]=e[i]}return a.default=e,n&&n.set(e,a),a}function th(e){var r=nh();return function(){var a=(0,Ya.default)(e),t;if(r){var i=(0,Ya.default)(this).constructor;t=Reflect.construct(a,arguments,i)}else t=a.apply(this,arguments);return(0,Kf.default)(this,t)}}function nh(){if(typeof Reflect=="undefined"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}var Xt;(function(e){e[e.COL0ROW0=0]="COL0ROW0",e[e.COL0ROW1=1]="COL0ROW1",e[e.COL0ROW2=2]="COL0ROW2",e[e.COL0ROW3=3]="COL0ROW3",e[e.COL1ROW0=4]="COL1ROW0",e[e.COL1ROW1=5]="COL1ROW1",e[e.COL1ROW2=6]="COL1ROW2",e[e.COL1ROW3=7]="COL1ROW3",e[e.COL2ROW0=8]="COL2ROW0",e[e.COL2ROW1=9]="COL2ROW1",e[e.COL2ROW2=10]="COL2ROW2",e[e.COL2ROW3=11]="COL2ROW3",e[e.COL3ROW0=12]="COL3ROW0",e[e.COL3ROW1=13]="COL3ROW1",e[e.COL3ROW2=14]="COL3ROW2",e[e.COL3ROW3=15]="COL3ROW3"})(Xt||(Xt={}));var ah=45*Math.PI/180,ih=1,Zt=.1,Qt=500,sh=Object.freeze([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]),$t=function(e){(0,Hf.default)(n,e);var r=th(n);function n(a){var t;return(0,Qf.default)(this,n),t=r.call(this,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0),arguments.length===1&&Array.isArray(a)?t.copy(a):t.identity(),t}return(0,$f.default)(n,[{key:"ELEMENTS",get:function(){return 16}},{key:"RANK",get:function(){return 4}},{key:"INDICES",get:function(){return Xt}},{key:"copy",value:function(t){return this[0]=t[0],this[1]=t[1],this[2]=t[2],this[3]=t[3],this[4]=t[4],this[5]=t[5],this[6]=t[6],this[7]=t[7],this[8]=t[8],this[9]=t[9],this[10]=t[10],this[11]=t[11],this[12]=t[12],this[13]=t[13],this[14]=t[14],this[15]=t[15],this.check()}},{key:"set",value:function(t,i,s,o,c,u,l,h,f,v,d,m,p,y,b,g){return this[0]=t,this[1]=i,this[2]=s,this[3]=o,this[4]=c,this[5]=u,this[6]=l,this[7]=h,this[8]=f,this[9]=v,this[10]=d,this[11]=m,this[12]=p,this[13]=y,this[14]=b,this[15]=g,this.check()}},{key:"setRowMajor",value:function(t,i,s,o,c,u,l,h,f,v,d,m,p,y,b,g){return this[0]=t,this[1]=c,this[2]=f,this[3]=p,this[4]=i,this[5]=u,this[6]=v,this[7]=y,this[8]=s,this[9]=l,this[10]=d,this[11]=b,this[12]=o,this[13]=h,this[14]=m,this[15]=g,this.check()}},{key:"toRowMajor",value:function(t){return t[0]=this[0],t[1]=this[4],t[2]=this[8],t[3]=this[12],t[4]=this[1],t[5]=this[5],t[6]=this[9],t[7]=this[13],t[8]=this[2],t[9]=this[6],t[10]=this[10],t[11]=this[14],t[12]=this[3],t[13]=this[7],t[14]=this[11],t[15]=this[15],t}},{key:"identity",value:function(){return this.copy(sh)}},{key:"fromObject",value:function(t){return this.check()}},{key:"fromQuaternion",value:function(t){return Z.fromQuat(this,t),this.check()}},{key:"frustum",value:function(t){var i=t.left,s=t.right,o=t.bottom,c=t.top,u=t.near,l=u===void 0?Zt:u,h=t.far,f=h===void 0?Qt:h;return f===1/0?ch(this,i,s,o,c,l):Z.frustum(this,i,s,o,c,l,f),this.check()}},{key:"lookAt",value:function(t){var i=t.eye,s=t.center,o=s===void 0?[0,0,0]:s,c=t.up,u=c===void 0?[0,1,0]:c;return Z.lookAt(this,i,o,u),this.check()}},{key:"ortho",value:function(t){var i=t.left,s=t.right,o=t.bottom,c=t.top,u=t.near,l=u===void 0?Zt:u,h=t.far,f=h===void 0?Qt:h;return Z.ortho(this,i,s,o,c,l,f),this.check()}},{key:"orthographic",value:function(t){var i=t.fovy,s=i===void 0?ah:i,o=t.aspect,c=o===void 0?ih:o,u=t.focalDistance,l=u===void 0?1:u,h=t.near,f=h===void 0?Zt:h,v=t.far,d=v===void 0?Qt:v;Xa(s);var m=s/2,p=l*Math.tan(m),y=p*c;return this.ortho({left:-y,right:y,bottom:-p,top:p,near:f,far:d})}},{key:"perspective",value:function(t){var i=t.fovy,s=i===void 0?45*Math.PI/180:i,o=t.aspect,c=o===void 0?1:o,u=t.near,l=u===void 0?.1:u,h=t.far,f=h===void 0?500:h;return Xa(s),Z.perspective(this,s,c,l,f),this.check()}},{key:"determinant",value:function(){return Z.determinant(this)}},{key:"getScale",value:function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[-0,-0,-0];return t[0]=Math.sqrt(this[0]*this[0]+this[1]*this[1]+this[2]*this[2]),t[1]=Math.sqrt(this[4]*this[4]+this[5]*this[5]+this[6]*this[6]),t[2]=Math.sqrt(this[8]*this[8]+this[9]*this[9]+this[10]*this[10]),t}},{key:"getTranslation",value:function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[-0,-0,-0];return t[0]=this[12],t[1]=this[13],t[2]=this[14],t}},{key:"getRotation",value:function(t,i){t=t||[-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0],i=i||[-0,-0,-0];var s=this.getScale(i),o=1/s[0],c=1/s[1],u=1/s[2];return t[0]=this[0]*o,t[1]=this[1]*c,t[2]=this[2]*u,t[3]=0,t[4]=this[4]*o,t[5]=this[5]*c,t[6]=this[6]*u,t[7]=0,t[8]=this[8]*o,t[9]=this[9]*c,t[10]=this[10]*u,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}},{key:"getRotationMatrix3",value:function(t,i){t=t||[-0,-0,-0,-0,-0,-0,-0,-0,-0],i=i||[-0,-0,-0];var s=this.getScale(i),o=1/s[0],c=1/s[1],u=1/s[2];return t[0]=this[0]*o,t[1]=this[1]*c,t[2]=this[2]*u,t[3]=this[4]*o,t[4]=this[5]*c,t[5]=this[6]*u,t[6]=this[8]*o,t[7]=this[9]*c,t[8]=this[10]*u,t}},{key:"transpose",value:function(){return Z.transpose(this,this),this.check()}},{key:"invert",value:function(){return Z.invert(this,this),this.check()}},{key:"multiplyLeft",value:function(t){return Z.multiply(this,t,this),this.check()}},{key:"multiplyRight",value:function(t){return Z.multiply(this,this,t),this.check()}},{key:"rotateX",value:function(t){return Z.rotateX(this,this,t),this.check()}},{key:"rotateY",value:function(t){return Z.rotateY(this,this,t),this.check()}},{key:"rotateZ",value:function(t){return Z.rotateZ(this,this,t),this.check()}},{key:"rotateXYZ",value:function(t){return this.rotateX(t[0]).rotateY(t[1]).rotateZ(t[2])}},{key:"rotateAxis",value:function(t,i){return Z.rotate(this,this,t,i),this.check()}},{key:"scale",value:function(t){return Z.scale(this,this,Array.isArray(t)?t:[t,t,t]),this.check()}},{key:"translate",value:function(t){return Z.translate(this,this,t),this.check()}},{key:"transform",value:function(t,i){return t.length===4?(i=rh.transformMat4(i||[-0,-0,-0,-0],t,this),(0,Ut.checkVector)(i,4),i):this.transformAsPoint(t,i)}},{key:"transformAsPoint",value:function(t,i){var s=t.length,o;switch(s){case 2:o=jf.transformMat4(i||[-0,-0],t,this);break;case 3:o=eh.transformMat4(i||[-0,-0,-0],t,this);break;default:throw new Error("Illegal vector")}return(0,Ut.checkVector)(o,t.length),o}},{key:"transformAsVector",value:function(t,i){var s;switch(t.length){case 2:s=(0,Ga.vec2_transformMat4AsVector)(i||[-0,-0],t,this);break;case 3:s=(0,Ga.vec3_transformMat4AsVector)(i||[-0,-0,-0],t,this);break;default:throw new Error("Illegal vector")}return(0,Ut.checkVector)(s,t.length),s}},{key:"transformPoint",value:function(t,i){return this.transformAsPoint(t,i)}},{key:"transformVector",value:function(t,i){return this.transformAsPoint(t,i)}},{key:"transformDirection",value:function(t,i){return this.transformAsVector(t,i)}},{key:"makeRotationX",value:function(t){return this.identity().rotateX(t)}},{key:"makeTranslation",value:function(t,i,s){return this.identity().translate([t,i,s])}}],[{key:"IDENTITY",get:function(){return uh()}},{key:"ZERO",get:function(){return oh()}}]),n}(Jf.default);ot.default=$t;var it,st;function oh(){return it||(it=new $t([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]),Object.freeze(it)),it}function uh(){return st||(st=new $t,Object.freeze(st)),st}function Xa(e){if(e>Math.PI*2)throw Error("expected radians")}function ch(e,r,n,a,t,i){var s=2*i/(n-r),o=2*i/(t-a),c=(n+r)/(n-r),u=(t+a)/(t-a),l=-1,h=-1,f=-2*i;return e[0]=s,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=o,e[6]=0,e[7]=0,e[8]=c,e[9]=u,e[10]=l,e[11]=h,e[12]=0,e[13]=0,e[14]=f,e[15]=0,e}});var ni=P(x=>{"use strict";function ut(e){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?ut=function(n){return typeof n}:ut=function(n){return n&&typeof Symbol=="function"&&n.constructor===Symbol&&n!==Symbol.prototype?"symbol":typeof n},ut(e)}Object.defineProperty(x,"__esModule",{value:!0});x.create=Kt;x.identity=fh;x.setAxisAngle=Qa;x.getAxisAngle=hh;x.getAngle=vh;x.multiply=$a;x.rotateX=dh;x.rotateY=ph;x.rotateZ=mh;x.calculateW=yh;x.exp=Ha;x.ln=Ka;x.pow=gh;x.slerp=lt;x.random=Mh;x.invert=bh;x.conjugate=xh;x.fromMat3=Ja;x.fromEuler=_h;x.str=Oh;x.setAxes=x.sqlerp=x.rotationTo=x.equals=x.exactEquals=x.normalize=x.sqrLen=x.squaredLength=x.len=x.length=x.lerp=x.dot=x.scale=x.mul=x.add=x.set=x.copy=x.fromValues=x.clone=void 0;var Ge=ct(ze()),lh=ct(Bt()),ke=ct(Ae()),re=ct(nt());function Za(e){if(typeof WeakMap!="function")return null;var r=new WeakMap,n=new WeakMap;return(Za=function(t){return t?n:r})(e)}function ct(e,r){if(!r&&e&&e.__esModule)return e;if(e===null||ut(e)!=="object"&&typeof e!="function")return{default:e};var n=Za(r);if(n&&n.has(e))return n.get(e);var a={},t=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if(i!=="default"&&Object.prototype.hasOwnProperty.call(e,i)){var s=t?Object.getOwnPropertyDescriptor(e,i):null;s&&(s.get||s.set)?Object.defineProperty(a,i,s):a[i]=e[i]}return a.default=e,n&&n.set(e,a),a}function Kt(){var e=new Ge.ARRAY_TYPE(4);return Ge.ARRAY_TYPE!=Float32Array&&(e[0]=0,e[1]=0,e[2]=0),e[3]=1,e}function fh(e){return e[0]=0,e[1]=0,e[2]=0,e[3]=1,e}function Qa(e,r,n){n=n*.5;var a=Math.sin(n);return e[0]=a*r[0],e[1]=a*r[1],e[2]=a*r[2],e[3]=Math.cos(n),e}function hh(e,r){var n=Math.acos(r[3])*2,a=Math.sin(n/2);return a>Ge.EPSILON?(e[0]=r[0]/a,e[1]=r[1]/a,e[2]=r[2]/a):(e[0]=1,e[1]=0,e[2]=0),n}function vh(e,r){var n=ei(e,r);return Math.acos(2*n*n-1)}function $a(e,r,n){var a=r[0],t=r[1],i=r[2],s=r[3],o=n[0],c=n[1],u=n[2],l=n[3];return e[0]=a*l+s*o+t*u-i*c,e[1]=t*l+s*c+i*o-a*u,e[2]=i*l+s*u+a*c-t*o,e[3]=s*l-a*o-t*c-i*u,e}function dh(e,r,n){n*=.5;var a=r[0],t=r[1],i=r[2],s=r[3],o=Math.sin(n),c=Math.cos(n);return e[0]=a*c+s*o,e[1]=t*c+i*o,e[2]=i*c-t*o,e[3]=s*c-a*o,e}function ph(e,r,n){n*=.5;var a=r[0],t=r[1],i=r[2],s=r[3],o=Math.sin(n),c=Math.cos(n);return e[0]=a*c-i*o,e[1]=t*c+s*o,e[2]=i*c+a*o,e[3]=s*c-t*o,e}function mh(e,r,n){n*=.5;var a=r[0],t=r[1],i=r[2],s=r[3],o=Math.sin(n),c=Math.cos(n);return e[0]=a*c+t*o,e[1]=t*c-a*o,e[2]=i*c+s*o,e[3]=s*c-i*o,e}function yh(e,r){var n=r[0],a=r[1],t=r[2];return e[0]=n,e[1]=a,e[2]=t,e[3]=Math.sqrt(Math.abs(1-n*n-a*a-t*t)),e}function Ha(e,r){var n=r[0],a=r[1],t=r[2],i=r[3],s=Math.sqrt(n*n+a*a+t*t),o=Math.exp(i),c=s>0?o*Math.sin(s)/s:0;return e[0]=n*c,e[1]=a*c,e[2]=t*c,e[3]=o*Math.cos(s),e}function Ka(e,r){var n=r[0],a=r[1],t=r[2],i=r[3],s=Math.sqrt(n*n+a*a+t*t),o=s>0?Math.atan2(s,i)/s:0;return e[0]=n*o,e[1]=a*o,e[2]=t*o,e[3]=.5*Math.log(n*n+a*a+t*t+i*i),e}function gh(e,r,n){return Ka(e,r),ja(e,e,n),Ha(e,e),e}function lt(e,r,n,a){var t=r[0],i=r[1],s=r[2],o=r[3],c=n[0],u=n[1],l=n[2],h=n[3],f,v,d,m,p;return v=t*c+i*u+s*l+o*h,v<0&&(v=-v,c=-c,u=-u,l=-l,h=-h),1-v>Ge.EPSILON?(f=Math.acos(v),d=Math.sin(f),m=Math.sin((1-a)*f)/d,p=Math.sin(a*f)/d):(m=1-a,p=a),e[0]=m*t+p*c,e[1]=m*i+p*u,e[2]=m*s+p*l,e[3]=m*o+p*h,e}function Mh(e){var r=Ge.RANDOM(),n=Ge.RANDOM(),a=Ge.RANDOM(),t=Math.sqrt(1-r),i=Math.sqrt(r);return e[0]=t*Math.sin(2*Math.PI*n),e[1]=t*Math.cos(2*Math.PI*n),e[2]=i*Math.sin(2*Math.PI*a),e[3]=i*Math.cos(2*Math.PI*a),e}function bh(e,r){var n=r[0],a=r[1],t=r[2],i=r[3],s=n*n+a*a+t*t+i*i,o=s?1/s:0;return e[0]=-n*o,e[1]=-a*o,e[2]=-t*o,e[3]=i*o,e}function xh(e,r){return e[0]=-r[0],e[1]=-r[1],e[2]=-r[2],e[3]=r[3],e}function Ja(e,r){var n=r[0]+r[4]+r[8],a;if(n>0)a=Math.sqrt(n+1),e[3]=.5*a,a=.5/a,e[0]=(r[5]-r[7])*a,e[1]=(r[6]-r[2])*a,e[2]=(r[1]-r[3])*a;else{var t=0;r[4]>r[0]&&(t=1),r[8]>r[t*3+t]&&(t=2);var i=(t+1)%3,s=(t+2)%3;a=Math.sqrt(r[t*3+t]-r[i*3+i]-r[s*3+s]+1),e[t]=.5*a,a=.5/a,e[3]=(r[i*3+s]-r[s*3+i])*a,e[i]=(r[i*3+t]+r[t*3+i])*a,e[s]=(r[s*3+t]+r[t*3+s])*a}return e}function _h(e,r,n,a){var t=.5*Math.PI/180;r*=t,n*=t,a*=t;var i=Math.sin(r),s=Math.cos(r),o=Math.sin(n),c=Math.cos(n),u=Math.sin(a),l=Math.cos(a);return e[0]=i*c*l-s*o*u,e[1]=s*o*l+i*c*u,e[2]=s*c*u-i*o*l,e[3]=s*c*l+i*o*u,e}function Oh(e){return"quat("+e[0]+", "+e[1]+", "+e[2]+", "+e[3]+")"}var kh=re.clone;x.clone=kh;var Rh=re.fromValues;x.fromValues=Rh;var Th=re.copy;x.copy=Th;var Ph=re.set;x.set=Ph;var Ah=re.add;x.add=Ah;var wh=$a;x.mul=wh;var ja=re.scale;x.scale=ja;var ei=re.dot;x.dot=ei;var Sh=re.lerp;x.lerp=Sh;var ri=re.length;x.length=ri;var qh=ri;x.len=qh;var ti=re.squaredLength;x.squaredLength=ti;var Eh=ti;x.sqrLen=Eh;var Jt=re.normalize;x.normalize=Jt;var Lh=re.exactEquals;x.exactEquals=Lh;var Ih=re.equals;x.equals=Ih;var Nh=function(){var e=ke.create(),r=ke.fromValues(1,0,0),n=ke.fromValues(0,1,0);return function(a,t,i){var s=ke.dot(t,i);return s<-.999999?(ke.cross(e,r,t),ke.len(e)<1e-6&&ke.cross(e,n,t),ke.normalize(e,e),Qa(a,e,Math.PI),a):s>.999999?(a[0]=0,a[1]=0,a[2]=0,a[3]=1,a):(ke.cross(e,t,i),a[0]=e[0],a[1]=e[1],a[2]=e[2],a[3]=1+s,Jt(a,a))}}();x.rotationTo=Nh;var Ch=function(){var e=Kt(),r=Kt();return function(n,a,t,i,s,o){return lt(e,a,s,o),lt(r,t,i,o),lt(n,e,r,2*o*(1-o)),n}}();x.sqlerp=Ch;var Wh=function(){var e=lh.create();return function(r,n,a,t){return e[0]=a[0],e[3]=a[1],e[6]=a[2],e[1]=t[0],e[4]=t[1],e[7]=t[2],e[2]=-n[0],e[5]=-n[1],e[8]=-n[2],Jt(r,Ja(r,e))}}();x.setAxes=Wh});var jt=P(ft=>{"use strict";var Ue=U(),Dh=j();Object.defineProperty(ft,"__esModule",{value:!0});ft.default=void 0;var Fh=Ue($()),zh=Ue(H()),Bh=Ue(se()),Vh=Ue(oe()),ai=Ue(ue()),Yh=Ue(Mr()),xr=de(),Gh=Ue(Ft()),Y=si(ni()),Uh=si(nt());function ii(e){if(typeof WeakMap!="function")return null;var r=new WeakMap,n=new WeakMap;return(ii=function(t){return t?n:r})(e)}function si(e,r){if(!r&&e&&e.__esModule)return e;if(e===null||Dh(e)!=="object"&&typeof e!="function")return{default:e};var n=ii(r);if(n&&n.has(e))return n.get(e);var a={},t=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if(i!=="default"&&Object.prototype.hasOwnProperty.call(e,i)){var s=t?Object.getOwnPropertyDescriptor(e,i):null;s&&(s.get||s.set)?Object.defineProperty(a,i,s):a[i]=e[i]}return a.default=e,n&&n.set(e,a),a}function Xh(e){var r=Zh();return function(){var a=(0,ai.default)(e),t;if(r){var i=(0,ai.default)(this).constructor;t=Reflect.construct(a,arguments,i)}else t=a.apply(this,arguments);return(0,Vh.default)(this,t)}}function Zh(){if(typeof Reflect=="undefined"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}var Qh=[0,0,0,1],$h=function(e){(0,Bh.default)(n,e);var r=Xh(n);function n(){var a,t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,s=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,o=arguments.length>3&&arguments[3]!==void 0?arguments[3]:1;return(0,Fh.default)(this,n),a=r.call(this,-0,-0,-0,-0),Array.isArray(t)&&arguments.length===1?a.copy(t):a.set(t,i,s,o),a}return(0,zh.default)(n,[{key:"copy",value:function(t){return this[0]=t[0],this[1]=t[1],this[2]=t[2],this[3]=t[3],this.check()}},{key:"set",value:function(t,i,s,o){return this[0]=t,this[1]=i,this[2]=s,this[3]=o,this.check()}},{key:"fromObject",value:function(t){return this[0]=t.x,this[1]=t.y,this[2]=t.z,this[3]=t.w,this.check()}},{key:"fromMatrix3",value:function(t){return Y.fromMat3(this,t),this.check()}},{key:"fromAxisRotation",value:function(t,i){return Y.setAxisAngle(this,t,i),this.check()}},{key:"identity",value:function(){return Y.identity(this),this.check()}},{key:"setAxisAngle",value:function(t,i){return this.fromAxisRotation(t,i)}},{key:"ELEMENTS",get:function(){return 4}},{key:"x",get:function(){return this[0]},set:function(t){this[0]=(0,xr.checkNumber)(t)}},{key:"y",get:function(){return this[1]},set:function(t){this[1]=(0,xr.checkNumber)(t)}},{key:"z",get:function(){return this[2]},set:function(t){this[2]=(0,xr.checkNumber)(t)}},{key:"w",get:function(){return this[3]},set:function(t){this[3]=(0,xr.checkNumber)(t)}},{key:"len",value:function(){return Y.length(this)}},{key:"lengthSquared",value:function(){return Y.squaredLength(this)}},{key:"dot",value:function(t){return Y.dot(this,t)}},{key:"rotationTo",value:function(t,i){return Y.rotationTo(this,t,i),this.check()}},{key:"add",value:function(t){return Y.add(this,this,t),this.check()}},{key:"calculateW",value:function(){return Y.calculateW(this,this),this.check()}},{key:"conjugate",value:function(){return Y.conjugate(this,this),this.check()}},{key:"invert",value:function(){return Y.invert(this,this),this.check()}},{key:"lerp",value:function(t,i,s){return s===void 0?this.lerp(this,t,i):(Y.lerp(this,t,i,s),this.check())}},{key:"multiplyRight",value:function(t){return Y.multiply(this,this,t),this.check()}},{key:"multiplyLeft",value:function(t){return Y.multiply(this,t,this),this.check()}},{key:"normalize",value:function(){var t=this.len(),i=t>0?1/t:0;return this[0]=this[0]*i,this[1]=this[1]*i,this[2]=this[2]*i,this[3]=this[3]*i,t===0&&(this[3]=1),this.check()}},{key:"rotateX",value:function(t){return Y.rotateX(this,this,t),this.check()}},{key:"rotateY",value:function(t){return Y.rotateY(this,this,t),this.check()}},{key:"rotateZ",value:function(t){return Y.rotateZ(this,this,t),this.check()}},{key:"scale",value:function(t){return Y.scale(this,this,t),this.check()}},{key:"slerp",value:function(t,i,s){var o,c,u;switch(arguments.length){case 1:var l=t,h=l.start;o=h===void 0?Qh:h,c=l.target,u=l.ratio;break;case 2:o=this,c=t,u=i;break;default:o=t,c=i,u=s}return Y.slerp(this,o,c,u),this.check()}},{key:"transformVector4",value:function(t){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:new Gh.default;return Uh.transformQuat(i,t,this),(0,xr.checkVector)(i,4)}},{key:"lengthSq",value:function(){return this.lengthSquared()}},{key:"setFromAxisAngle",value:function(t,i){return this.setAxisAngle(t,i)}},{key:"premultiply",value:function(t){return this.multiplyLeft(t)}},{key:"multiply",value:function(t){return this.multiplyRight(t)}}]),n}(Yh.default);ft.default=$h});var oi=P((xv,_r)=>{function Hh(e){if(Array.isArray(e))return e}_r.exports=Hh,_r.exports.__esModule=!0,_r.exports.default=_r.exports});var ui=P((_v,Or)=>{function Kh(e,r){var n=e==null?null:typeof Symbol!="undefined"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var a,t,i,s,o=[],c=!0,u=!1;try{if(i=(n=n.call(e)).next,r===0){if(Object(n)!==n)return;c=!1}else for(;!(c=(a=i.call(n)).done)&&(o.push(a.value),o.length!==r);c=!0);}catch(l){u=!0,t=l}finally{try{if(!c&&n.return!=null&&(s=n.return(),Object(s)!==s))return}finally{if(u)throw t}}return o}}Or.exports=Kh,Or.exports.__esModule=!0,Or.exports.default=Or.exports});var ci=P((Ov,kr)=>{function Jh(e,r){(r==null||r>e.length)&&(r=e.length);for(var n=0,a=new Array(r);n<r;n++)a[n]=e[n];return a}kr.exports=Jh,kr.exports.__esModule=!0,kr.exports.default=kr.exports});var fi=P((kv,Rr)=>{var li=ci();function jh(e,r){if(!!e){if(typeof e=="string")return li(e,r);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return li(e,r)}}Rr.exports=jh,Rr.exports.__esModule=!0,Rr.exports.default=Rr.exports});var hi=P((Rv,Tr)=>{function e0(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
2
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}Tr.exports=e0,Tr.exports.__esModule=!0,Tr.exports.default=Tr.exports});var ht=P((Tv,Pr)=>{var r0=oi(),t0=ui(),n0=fi(),a0=hi();function i0(e,r){return r0(e)||t0(e,r)||n0(e,r)||a0()}Pr.exports=i0,Pr.exports.__esModule=!0,Pr.exports.default=Pr.exports});var vt=P((Pv,Ar)=>{var s0=qt();function o0(e,r,n){return r=s0(r),r in e?Object.defineProperty(e,r,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[r]=n,e}Ar.exports=o0,Ar.exports.__esModule=!0,Ar.exports.default=Ar.exports});var pi=P(pt=>{"use strict";var wr=U(),u0=j();Object.defineProperty(pt,"__esModule",{value:!0});pt.default=void 0;var c0=wr(ht()),l0=wr($()),f0=wr(H()),dt=wr(vt()),h0=wr(Zr()),Q=ve(),v0=d0(Ae());function vi(e){if(typeof WeakMap!="function")return null;var r=new WeakMap,n=new WeakMap;return(vi=function(t){return t?n:r})(e)}function d0(e,r){if(!r&&e&&e.__esModule)return e;if(e===null||u0(e)!=="object"&&typeof e!="function")return{default:e};var n=vi(r);if(n&&n.has(e))return n.get(e);var a={},t=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if(i!=="default"&&Object.prototype.hasOwnProperty.call(e,i)){var s=t?Object.getOwnPropertyDescriptor(e,i):null;s&&(s.get||s.set)?Object.defineProperty(a,i,s):a[i]=e[i]}return a.default=e,n&&n.set(e,a),a}var di=1e-6,p0=6371e3,m0=function(){function e(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=r.phi,a=n===void 0?0:n,t=r.theta,i=t===void 0?0:t,s=r.radius,o=s===void 0?1:s,c=r.bearing,u=r.pitch,l=r.altitude,h=r.radiusScale,f=h===void 0?p0:h;(0,l0.default)(this,e),(0,dt.default)(this,"phi",void 0),(0,dt.default)(this,"theta",void 0),(0,dt.default)(this,"radius",void 0),(0,dt.default)(this,"radiusScale",void 0),this.phi=a,this.theta=i,this.radius=o||l||1,this.radiusScale=f||1,c!==void 0&&(this.bearing=c),u!==void 0&&(this.pitch=u),this.check()}return(0,f0.default)(e,[{key:"toString",value:function(){return this.formatString(Q.config)}},{key:"formatString",value:function(n){var a=n.printTypes,t=a===void 0?!1:a,i=Q.formatValue;return"".concat(t?"Spherical":"","[rho:").concat(i(this.radius),",theta:").concat(i(this.theta),",phi:").concat(i(this.phi),"]")}},{key:"equals",value:function(n){return(0,Q.equals)(this.radius,n.radius)&&(0,Q.equals)(this.theta,n.theta)&&(0,Q.equals)(this.phi,n.phi)}},{key:"exactEquals",value:function(n){return this.radius===n.radius&&this.theta===n.theta&&this.phi===n.phi}},{key:"bearing",get:function(){return 180-(0,Q.degrees)(this.phi)},set:function(n){this.phi=Math.PI-(0,Q.radians)(n)}},{key:"pitch",get:function(){return(0,Q.degrees)(this.theta)},set:function(n){this.theta=(0,Q.radians)(n)}},{key:"longitude",get:function(){return(0,Q.degrees)(this.phi)}},{key:"latitude",get:function(){return(0,Q.degrees)(this.theta)}},{key:"lng",get:function(){return(0,Q.degrees)(this.phi)}},{key:"lat",get:function(){return(0,Q.degrees)(this.theta)}},{key:"z",get:function(){return(this.radius-1)*this.radiusScale}},{key:"set",value:function(n,a,t){return this.radius=n,this.phi=a,this.theta=t,this.check()}},{key:"clone",value:function(){return new e().copy(this)}},{key:"copy",value:function(n){return this.radius=n.radius,this.phi=n.phi,this.theta=n.theta,this.check()}},{key:"fromLngLatZ",value:function(n){var a=(0,c0.default)(n,3),t=a[0],i=a[1],s=a[2];return this.radius=1+s/this.radiusScale,this.phi=(0,Q.radians)(i),this.theta=(0,Q.radians)(t),this.check()}},{key:"fromVector3",value:function(n){return this.radius=v0.length(n),this.radius>0&&(this.theta=Math.atan2(n[0],n[1]),this.phi=Math.acos((0,Q.clamp)(n[2]/this.radius,-1,1))),this.check()}},{key:"toVector3",value:function(){return new h0.default(0,0,this.radius).rotateX({radians:this.theta}).rotateZ({radians:this.phi})}},{key:"makeSafe",value:function(){return this.phi=Math.max(di,Math.min(Math.PI-di,this.phi)),this}},{key:"check",value:function(){if(!Number.isFinite(this.phi)||!Number.isFinite(this.theta)||!(this.radius>0))throw new Error("SphericalCoordinates: some fields set to invalid numbers");return this}}]),e}();pt.default=m0});var en=P(yt=>{"use strict";var Se=U();Object.defineProperty(yt,"__esModule",{value:!0});yt.default=void 0;var y0=Se(ht()),g0=Se($()),M0=Se(H()),b0=Se(se()),x0=Se(oe()),mi=Se(ue()),_0=Se(Mr()),yi=Se(jt()),rr=ve(),ie=de();function O0(e){var r=k0();return function(){var a=(0,mi.default)(e),t;if(r){var i=(0,mi.default)(this).constructor;t=Reflect.construct(a,arguments,i)}else t=a.apply(this,arguments);return(0,x0.default)(this,t)}}function k0(){if(typeof Reflect=="undefined"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}var mt="Unknown Euler angle order",tr=.99999,G;(function(e){e[e.ZYX=0]="ZYX",e[e.YXZ=1]="YXZ",e[e.XZY=2]="XZY",e[e.ZXY=3]="ZXY",e[e.YZX=4]="YZX",e[e.XYZ=5]="XYZ"})(G||(G={}));var R0=function(e){(0,b0.default)(n,e);var r=O0(n);function n(){var a,t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,s=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,o=arguments.length>3&&arguments[3]!==void 0?arguments[3]:n.DefaultOrder;if((0,g0.default)(this,n),a=r.call(this,-0,-0,-0,-0),arguments.length>0&&Array.isArray(arguments[0])){var c;(c=a).fromVector3.apply(c,arguments)}else a.set(t,i,s,o);return a}return(0,M0.default)(n,[{key:"ELEMENTS",get:function(){return 4}},{key:"fromQuaternion",value:function(t){var i=(0,y0.default)(t,4),s=i[0],o=i[1],c=i[2],u=i[3],l=o*o,h=-2*(l+c*c)+1,f=2*(s*o+u*c),v=-2*(s*c-u*o),d=2*(o*c+u*s),m=-2*(s*s+l)+1;v=v>1?1:v,v=v<-1?-1:v;var p=Math.atan2(d,m),y=Math.asin(v),b=Math.atan2(f,h);return this.set(p,y,b,n.RollPitchYaw)}},{key:"fromObject",value:function(t){throw new Error("not implemented")}},{key:"copy",value:function(t){return this[0]=t[0],this[1]=t[1],this[2]=t[2],this[3]=Number.isFinite(t[3])||this.order,this.check()}},{key:"set",value:function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,s=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,o=arguments.length>3?arguments[3]:void 0;return this[0]=t,this[1]=i,this[2]=s,this[3]=Number.isFinite(o)?o:this[3],this.check()}},{key:"validate",value:function(){return T0(this[3])&&Number.isFinite(this[0])&&Number.isFinite(this[1])&&Number.isFinite(this[2])}},{key:"toArray",value:function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return t[i]=this[0],t[i+1]=this[1],t[i+2]=this[2],t}},{key:"toArray4",value:function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return t[i]=this[0],t[i+1]=this[1],t[i+2]=this[2],t[i+3]=this[3],t}},{key:"toVector3",value:function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[-0,-0,-0];return t[0]=this[0],t[1]=this[1],t[2]=this[2],t}},{key:"x",get:function(){return this[0]},set:function(t){this[0]=(0,ie.checkNumber)(t)}},{key:"y",get:function(){return this[1]},set:function(t){this[1]=(0,ie.checkNumber)(t)}},{key:"z",get:function(){return this[2]},set:function(t){this[2]=(0,ie.checkNumber)(t)}},{key:"alpha",get:function(){return this[0]},set:function(t){this[0]=(0,ie.checkNumber)(t)}},{key:"beta",get:function(){return this[1]},set:function(t){this[1]=(0,ie.checkNumber)(t)}},{key:"gamma",get:function(){return this[2]},set:function(t){this[2]=(0,ie.checkNumber)(t)}},{key:"phi",get:function(){return this[0]},set:function(t){this[0]=(0,ie.checkNumber)(t)}},{key:"theta",get:function(){return this[1]},set:function(t){this[1]=(0,ie.checkNumber)(t)}},{key:"psi",get:function(){return this[2]},set:function(t){this[2]=(0,ie.checkNumber)(t)}},{key:"roll",get:function(){return this[0]},set:function(t){this[0]=(0,ie.checkNumber)(t)}},{key:"pitch",get:function(){return this[1]},set:function(t){this[1]=(0,ie.checkNumber)(t)}},{key:"yaw",get:function(){return this[2]},set:function(t){this[2]=(0,ie.checkNumber)(t)}},{key:"order",get:function(){return this[3]},set:function(t){this[3]=P0(t)}},{key:"fromVector3",value:function(t,i){return this.set(t[0],t[1],t[2],Number.isFinite(i)?i:this[3])}},{key:"fromArray",value:function(t){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return this[0]=t[0+i],this[1]=t[1+i],this[2]=t[2+i],t[3]!==void 0&&(this[3]=t[3]),this.check()}},{key:"fromRollPitchYaw",value:function(t,i,s){return this.set(t,i,s,G.ZYX)}},{key:"fromRotationMatrix",value:function(t){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:n.DefaultOrder;return this._fromRotationMatrix(t,i),this.check()}},{key:"getRotationMatrix",value:function(t){return this._getRotationMatrix(t)}},{key:"getQuaternion",value:function(){var t=new yi.default;switch(this[4]){case G.XYZ:return t.rotateX(this[0]).rotateY(this[1]).rotateZ(this[2]);case G.YXZ:return t.rotateY(this[0]).rotateX(this[1]).rotateZ(this[2]);case G.ZXY:return t.rotateZ(this[0]).rotateX(this[1]).rotateY(this[2]);case G.ZYX:return t.rotateZ(this[0]).rotateY(this[1]).rotateX(this[2]);case G.YZX:return t.rotateY(this[0]).rotateZ(this[1]).rotateX(this[2]);case G.XZY:return t.rotateX(this[0]).rotateZ(this[1]).rotateY(this[2]);default:throw new Error(mt)}}},{key:"_fromRotationMatrix",value:function(t){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:n.DefaultOrder,s=t[0],o=t[4],c=t[8],u=t[1],l=t[5],h=t[9],f=t[2],v=t[6],d=t[10];switch(i=i||this[3],i){case n.XYZ:this[1]=Math.asin((0,rr.clamp)(c,-1,1)),Math.abs(c)<tr?(this[0]=Math.atan2(-h,d),this[2]=Math.atan2(-o,s)):(this[0]=Math.atan2(v,l),this[2]=0);break;case n.YXZ:this[0]=Math.asin(-(0,rr.clamp)(h,-1,1)),Math.abs(h)<tr?(this[1]=Math.atan2(c,d),this[2]=Math.atan2(u,l)):(this[1]=Math.atan2(-f,s),this[2]=0);break;case n.ZXY:this[0]=Math.asin((0,rr.clamp)(v,-1,1)),Math.abs(v)<tr?(this[1]=Math.atan2(-f,d),this[2]=Math.atan2(-o,l)):(this[1]=0,this[2]=Math.atan2(u,s));break;case n.ZYX:this[1]=Math.asin(-(0,rr.clamp)(f,-1,1)),Math.abs(f)<tr?(this[0]=Math.atan2(v,d),this[2]=Math.atan2(u,s)):(this[0]=0,this[2]=Math.atan2(-o,l));break;case n.YZX:this[2]=Math.asin((0,rr.clamp)(u,-1,1)),Math.abs(u)<tr?(this[0]=Math.atan2(-h,l),this[1]=Math.atan2(-f,s)):(this[0]=0,this[1]=Math.atan2(c,d));break;case n.XZY:this[2]=Math.asin(-(0,rr.clamp)(o,-1,1)),Math.abs(o)<tr?(this[0]=Math.atan2(v,l),this[1]=Math.atan2(c,s)):(this[0]=Math.atan2(-h,d),this[1]=0);break;default:throw new Error(mt)}return this[3]=i,this}},{key:"_getRotationMatrix",value:function(t){var i=t||[-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0],s=this.x,o=this.y,c=this.z,u=Math.cos(s),l=Math.cos(o),h=Math.cos(c),f=Math.sin(s),v=Math.sin(o),d=Math.sin(c);switch(this[3]){case n.XYZ:{var m=u*h,p=u*d,y=f*h,b=f*d;i[0]=l*h,i[4]=-l*d,i[8]=v,i[1]=p+y*v,i[5]=m-b*v,i[9]=-f*l,i[2]=b-m*v,i[6]=y+p*v,i[10]=u*l;break}case n.YXZ:{var g=l*h,M=l*d,k=v*h,_=v*d;i[0]=g+_*f,i[4]=k*f-M,i[8]=u*v,i[1]=u*d,i[5]=u*h,i[9]=-f,i[2]=M*f-k,i[6]=_+g*f,i[10]=u*l;break}case n.ZXY:{var C=l*h,L=l*d,I=v*h,S=v*d;i[0]=C-S*f,i[4]=-u*d,i[8]=I+L*f,i[1]=L+I*f,i[5]=u*h,i[9]=S-C*f,i[2]=-u*v,i[6]=f,i[10]=u*l;break}case n.ZYX:{var W=u*h,N=u*d,D=f*h,w=f*d;i[0]=l*h,i[4]=D*v-N,i[8]=W*v+w,i[1]=l*d,i[5]=w*v+W,i[9]=N*v-D,i[2]=-v,i[6]=f*l,i[10]=u*l;break}case n.YZX:{var X=u*l,fe=u*v,he=f*l,Ne=f*v;i[0]=l*h,i[4]=Ne-X*d,i[8]=he*d+fe,i[1]=d,i[5]=u*h,i[9]=-f*h,i[2]=-v*h,i[6]=fe*d+he,i[10]=X-Ne*d;break}case n.XZY:{var Ce=u*l,mn=u*v,yn=f*l,gn=f*v;i[0]=l*h,i[4]=-d,i[8]=v*h,i[1]=Ce*d+gn,i[5]=u*h,i[9]=mn*d-yn,i[2]=yn*d-mn,i[6]=f*h,i[10]=gn*d+Ce;break}default:throw new Error(mt)}return i[3]=0,i[7]=0,i[11]=0,i[12]=0,i[13]=0,i[14]=0,i[15]=1,i}},{key:"toQuaternion",value:function(){var t=Math.cos(this.yaw*.5),i=Math.sin(this.yaw*.5),s=Math.cos(this.roll*.5),o=Math.sin(this.roll*.5),c=Math.cos(this.pitch*.5),u=Math.sin(this.pitch*.5),l=t*s*c+i*o*u,h=t*o*c-i*s*u,f=t*s*u+i*o*c,v=i*s*c-t*o*u;return new yi.default(h,f,v,l)}}],[{key:"ZYX",get:function(){return G.ZYX}},{key:"YXZ",get:function(){return G.YXZ}},{key:"XZY",get:function(){return G.XZY}},{key:"ZXY",get:function(){return G.ZXY}},{key:"YZX",get:function(){return G.YZX}},{key:"XYZ",get:function(){return G.XYZ}},{key:"RollPitchYaw",get:function(){return G.ZYX}},{key:"DefaultOrder",get:function(){return G.ZYX}},{key:"RotationOrders",get:function(){return G}},{key:"rotationOrder",value:function(t){return G[t]}}]),n}(_0.default);yt.default=R0;function T0(e){return e>=0&&e<6}function P0(e){if(e<0&&e>=6)throw new Error(mt);return e}});var bi=P(gt=>{"use strict";var nr=U();Object.defineProperty(gt,"__esModule",{value:!0});gt.default=void 0;var A0=nr($()),w0=nr(H()),gi=nr(vt()),rn=nr(Ht()),Mi=nr(Zr()),tn=nr(en()),S0=function(){function e(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=r.x,a=n===void 0?0:n,t=r.y,i=t===void 0?0:t,s=r.z,o=s===void 0?0:s,c=r.roll,u=c===void 0?0:c,l=r.pitch,h=l===void 0?0:l,f=r.yaw,v=f===void 0?0:f,d=r.position,m=r.orientation;(0,A0.default)(this,e),(0,gi.default)(this,"position",void 0),(0,gi.default)(this,"orientation",void 0),Array.isArray(d)&&d.length===3?this.position=new Mi.default(d):this.position=new Mi.default(a,i,o),Array.isArray(m)&&m.length===4?this.orientation=new tn.default(m,m[3]):this.orientation=new tn.default(u,h,v,tn.default.RollPitchYaw)}return(0,w0.default)(e,[{key:"x",get:function(){return this.position.x},set:function(n){this.position.x=n}},{key:"y",get:function(){return this.position.y},set:function(n){this.position.y=n}},{key:"z",get:function(){return this.position.z},set:function(n){this.position.z=n}},{key:"roll",get:function(){return this.orientation.roll},set:function(n){this.orientation.roll=n}},{key:"pitch",get:function(){return this.orientation.pitch},set:function(n){this.orientation.pitch=n}},{key:"yaw",get:function(){return this.orientation.yaw},set:function(n){this.orientation.yaw=n}},{key:"getPosition",value:function(){return this.position}},{key:"getOrientation",value:function(){return this.orientation}},{key:"equals",value:function(n){return n?this.position.equals(n.position)&&this.orientation.equals(n.orientation):!1}},{key:"exactEquals",value:function(n){return n?this.position.exactEquals(n.position)&&this.orientation.exactEquals(n.orientation):!1}},{key:"getTransformationMatrix",value:function(){var n=Math.sin(this.roll),a=Math.sin(this.pitch),t=Math.sin(this.yaw),i=Math.cos(this.roll),s=Math.cos(this.pitch),o=Math.cos(this.yaw);return new rn.default().setRowMajor(o*s,-t*i+o*a*n,t*n+o*a*i,this.x,t*s,o*i+t*a*n,-o*n+t*a*i,this.y,-a,s*n,s*i,this.z,0,0,0,1)}},{key:"getTransformationMatrixFromPose",value:function(n){return new rn.default().multiplyRight(this.getTransformationMatrix()).multiplyRight(n.getTransformationMatrix().invert())}},{key:"getTransformationMatrixToPose",value:function(n){return new rn.default().multiplyRight(n.getTransformationMatrix()).multiplyRight(this.getTransformationMatrix().invert())}}]),e}();gt.default=S0});var xi=P(Mt=>{"use strict";Object.defineProperty(Mt,"__esModule",{value:!0});Mt.default=void 0;var q0={EPSILON1:.1,EPSILON2:.01,EPSILON3:.001,EPSILON4:1e-4,EPSILON5:1e-5,EPSILON6:1e-6,EPSILON7:1e-7,EPSILON8:1e-8,EPSILON9:1e-9,EPSILON10:1e-10,EPSILON11:1e-11,EPSILON12:1e-12,EPSILON13:1e-13,EPSILON14:1e-14,EPSILON15:1e-15,EPSILON16:1e-16,EPSILON17:1e-17,EPSILON18:1e-18,EPSILON19:1e-19,EPSILON20:1e-20,PI_OVER_TWO:Math.PI/2,PI_OVER_FOUR:Math.PI/4,PI_OVER_SIX:Math.PI/6,TWO_PI:Math.PI*2};Mt.default=q0});var ar=P(E=>{"use strict";var ce=U();Object.defineProperty(E,"__esModule",{value:!0});Object.defineProperty(E,"Vector2",{enumerable:!0,get:function(){return E0.default}});Object.defineProperty(E,"Vector3",{enumerable:!0,get:function(){return L0.default}});Object.defineProperty(E,"Vector4",{enumerable:!0,get:function(){return I0.default}});Object.defineProperty(E,"Matrix3",{enumerable:!0,get:function(){return N0.default}});Object.defineProperty(E,"Matrix4",{enumerable:!0,get:function(){return C0.default}});Object.defineProperty(E,"Quaternion",{enumerable:!0,get:function(){return W0.default}});Object.defineProperty(E,"SphericalCoordinates",{enumerable:!0,get:function(){return _i.default}});Object.defineProperty(E,"_SphericalCoordinates",{enumerable:!0,get:function(){return _i.default}});Object.defineProperty(E,"Pose",{enumerable:!0,get:function(){return Oi.default}});Object.defineProperty(E,"_Pose",{enumerable:!0,get:function(){return Oi.default}});Object.defineProperty(E,"Euler",{enumerable:!0,get:function(){return ki.default}});Object.defineProperty(E,"_Euler",{enumerable:!0,get:function(){return ki.default}});Object.defineProperty(E,"_MathUtils",{enumerable:!0,get:function(){return D0.default}});Object.defineProperty(E,"assert",{enumerable:!0,get:function(){return F0.default}});Object.defineProperty(E,"config",{enumerable:!0,get:function(){return V.config}});Object.defineProperty(E,"configure",{enumerable:!0,get:function(){return V.configure}});Object.defineProperty(E,"formatValue",{enumerable:!0,get:function(){return V.formatValue}});Object.defineProperty(E,"isArray",{enumerable:!0,get:function(){return V.isArray}});Object.defineProperty(E,"clone",{enumerable:!0,get:function(){return V.clone}});Object.defineProperty(E,"equals",{enumerable:!0,get:function(){return V.equals}});Object.defineProperty(E,"exactEquals",{enumerable:!0,get:function(){return V.exactEquals}});Object.defineProperty(E,"toRadians",{enumerable:!0,get:function(){return V.toRadians}});Object.defineProperty(E,"toDegrees",{enumerable:!0,get:function(){return V.toDegrees}});Object.defineProperty(E,"radians",{enumerable:!0,get:function(){return V.radians}});Object.defineProperty(E,"degrees",{enumerable:!0,get:function(){return V.degrees}});Object.defineProperty(E,"sin",{enumerable:!0,get:function(){return V.sin}});Object.defineProperty(E,"cos",{enumerable:!0,get:function(){return V.cos}});Object.defineProperty(E,"tan",{enumerable:!0,get:function(){return V.tan}});Object.defineProperty(E,"asin",{enumerable:!0,get:function(){return V.asin}});Object.defineProperty(E,"acos",{enumerable:!0,get:function(){return V.acos}});Object.defineProperty(E,"atan",{enumerable:!0,get:function(){return V.atan}});Object.defineProperty(E,"clamp",{enumerable:!0,get:function(){return V.clamp}});Object.defineProperty(E,"lerp",{enumerable:!0,get:function(){return V.lerp}});Object.defineProperty(E,"withEpsilon",{enumerable:!0,get:function(){return V.withEpsilon}});var E0=ce(ea()),L0=ce(Zr()),I0=ce(Ft()),N0=ce(ka()),C0=ce(Ht()),W0=ce(jt()),_i=ce(pi()),Oi=ce(bi()),ki=ce(en()),D0=ce(xi()),F0=ce(Nr()),V=ve()});var nn=P(ye=>{"use strict";Object.defineProperty(ye,"__esModule",{value:!0});ye.WGS84_CONSTANTS=ye.WGS84_RADIUS_Z=ye.WGS84_RADIUS_Y=ye.WGS84_RADIUS_X=void 0;var qe=6378137;ye.WGS84_RADIUS_X=qe;var Ee=6378137;ye.WGS84_RADIUS_Y=Ee;var Le=6356752314245179e-9;ye.WGS84_RADIUS_Z=Le;var z0={radii:[qe,Ee,Le],radiiSquared:[qe*qe,Ee*Ee,Le*Le],oneOverRadii:[1/qe,1/Ee,1/Le],oneOverRadiiSquared:[1/(qe*qe),1/(Ee*Ee),1/(Le*Le)],maximumRadius:Math.max(qe,Ee,Le),centerToleranceSquared:.1};ye.WGS84_CONSTANTS=z0});var on=P(Te=>{"use strict";Object.defineProperty(Te,"__esModule",{value:!0});Te.fromCartographic=an;Te.fromCartographicToRadians=V0;Te.fromCartographicToDegrees=Y0;Te.toCartographic=sn;Te.toCartographicFromRadians=G0;Te.toCartographicFromDegrees=U0;Te.isWGS84=X0;var Re=ar(),Ri=nn();function ir(e){return e}var B0=new Re.Vector3;function an(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:ir;return"longitude"in e?(r[0]=n(e.longitude),r[1]=n(e.latitude),r[2]=e.height):"x"in e?(r[0]=n(e.x),r[1]=n(e.y),r[2]=e.z):(r[0]=n(e[0]),r[1]=n(e[1]),r[2]=e[2]),r}function V0(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[];return an(e,r,Re.config._cartographicRadians?ir:Re.toRadians)}function Y0(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[];return an(e,r,Re.config._cartographicRadians?Re.toDegrees:ir)}function sn(e,r){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:ir;return"longitude"in r?(r.longitude=n(e[0]),r.latitude=n(e[1]),r.height=e[2]):"x"in r?(r.x=n(e[0]),r.y=n(e[1]),r.z=e[2]):(r[0]=n(e[0]),r[1]=n(e[1]),r[2]=e[2]),r}function G0(e,r){return sn(e,r,Re.config._cartographicRadians?ir:Re.toDegrees)}function U0(e,r){return sn(e,r,Re.config._cartographicRadians?Re.toRadians:ir)}function X0(e){if(!e)return!1;B0.from(e);var r=Ri.WGS84_CONSTANTS.oneOverRadiiSquared,n=Ri.WGS84_CONSTANTS.centerToleranceSquared,a=e[0]*e[0]*r[0],t=e[1]*e[1]*r[1],i=e[2]*e[2]*r[2];return Math.abs(a+t+i-1)<n}});var Ti=P(un=>{"use strict";Object.defineProperty(un,"__esModule",{value:!0});un.default=$0;var bt=ar(),sr=new bt.Vector3,Z0=new bt.Vector3,Q0=new bt.Vector3;function $0(e,r){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:[],a=r.oneOverRadii,t=r.oneOverRadiiSquared,i=r.centerToleranceSquared;sr.from(e);var s=sr.x,o=sr.y,c=sr.z,u=a.x,l=a.y,h=a.z,f=s*s*u*u,v=o*o*l*l,d=c*c*h*h,m=f+v+d,p=Math.sqrt(1/m);if(!!Number.isFinite(p)){var y=Z0;if(y.copy(e).scale(p),m<i)return y.to(n);var b=t.x,g=t.y,M=t.z,k=Q0;k.set(y.x*b*2,y.y*g*2,y.z*M*2);var _=(1-p)*sr.len()/(.5*k.len()),C=0,L,I,S,W;do{_-=C,L=1/(1+_*b),I=1/(1+_*g),S=1/(1+_*M);var N=L*L,D=I*I,w=S*S,X=N*L,fe=D*I,he=w*S;W=f*N+v*D+d*w-1;var Ne=f*X*b+v*fe*g+d*he*M,Ce=-2*Ne;C=W/Ce}while(Math.abs(W)>bt._MathUtils.EPSILON12);return sr.scale([L,I,S]).to(n)}}});var wi=P(ln=>{"use strict";Object.defineProperty(ln,"__esModule",{value:!0});ln.default=e1;var te=ar(),Pi=1e-14,H0=new te.Vector3,Ai={up:{south:"east",north:"west",west:"south",east:"north"},down:{south:"west",north:"east",west:"north",east:"south"},south:{up:"west",down:"east",west:"down",east:"up"},north:{up:"east",down:"west",west:"up",east:"down"},west:{up:"north",down:"south",north:"down",south:"up"},east:{up:"south",down:"north",north:"up",south:"down"}},cn={north:[-1,0,0],east:[0,1,0],up:[0,0,1],south:[1,0,0],west:[0,-1,0],down:[0,0,-1]},Pe={east:new te.Vector3,north:new te.Vector3,up:new te.Vector3,west:new te.Vector3,south:new te.Vector3,down:new te.Vector3},K0=new te.Vector3,J0=new te.Vector3,j0=new te.Vector3;function e1(e,r,n,a,t,i){var s=Ai[r]&&Ai[r][n];(0,te.assert)(s&&(!a||a===s));var o,c,u,l=H0.copy(t),h=(0,te.equals)(l.x,0,Pi)&&(0,te.equals)(l.y,0,Pi);if(h){var f=Math.sign(l.z);o=K0.fromArray(cn[r]),r!=="east"&&r!=="west"&&o.scale(f),c=J0.fromArray(cn[n]),n!=="east"&&n!=="west"&&c.scale(f),u=j0.fromArray(cn[a]),a!=="east"&&a!=="west"&&u.scale(f)}else{var v=Pe.up,d=Pe.east,m=Pe.north;d.set(-l.y,l.x,0).normalize(),e.geodeticSurfaceNormal(l,v),m.copy(v).cross(d);var p=Pe.down,y=Pe.west,b=Pe.south;p.copy(v).scale(-1),y.copy(d).scale(-1),b.copy(m).scale(-1),o=Pe[r],c=Pe[n],u=Pe[a]}return i[0]=o.x,i[1]=o.y,i[2]=o.z,i[3]=0,i[4]=c.x,i[5]=c.y,i[6]=c.z,i[7]=0,i[8]=u.x,i[9]=u.y,i[10]=u.z,i[11]=0,i[12]=l.x,i[13]=l.y,i[14]=l.z,i[15]=1,i}});var Ni=P(Ot=>{"use strict";var or=U(),r1=j();Object.defineProperty(Ot,"__esModule",{value:!0});Ot.default=void 0;var t1=or(ht()),n1=or($()),a1=or(H()),ge=or(vt()),B=ar(),Si=s1(Ae()),fn=nn(),qi=on(),i1=or(Ti()),Ei=or(wi());function Li(e){if(typeof WeakMap!="function")return null;var r=new WeakMap,n=new WeakMap;return(Li=function(t){return t?n:r})(e)}function s1(e,r){if(!r&&e&&e.__esModule)return e;if(e===null||r1(e)!=="object"&&typeof e!="function")return{default:e};var n=Li(r);if(n&&n.has(e))return n.get(e);var a={},t=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if(i!=="default"&&Object.prototype.hasOwnProperty.call(e,i)){var s=t?Object.getOwnPropertyDescriptor(e,i):null;s&&(s.get||s.set)?Object.defineProperty(a,i,s):a[i]=e[i]}return a.default=e,n&&n.set(e,a),a}var xt=new B.Vector3,Ii=new B.Vector3,o1=new B.Vector3,le=new B.Vector3,u1=new B.Vector3,_t=new B.Vector3,hn=function(){function e(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0;(0,n1.default)(this,e),(0,ge.default)(this,"radii",void 0),(0,ge.default)(this,"radiiSquared",void 0),(0,ge.default)(this,"radiiToTheFourth",void 0),(0,ge.default)(this,"oneOverRadii",void 0),(0,ge.default)(this,"oneOverRadiiSquared",void 0),(0,ge.default)(this,"minimumRadius",void 0),(0,ge.default)(this,"maximumRadius",void 0),(0,ge.default)(this,"centerToleranceSquared",B._MathUtils.EPSILON1),(0,ge.default)(this,"squaredXOverSquaredZ",void 0),(0,B.assert)(r>=0),(0,B.assert)(n>=0),(0,B.assert)(a>=0),this.radii=new B.Vector3(r,n,a),this.radiiSquared=new B.Vector3(r*r,n*n,a*a),this.radiiToTheFourth=new B.Vector3(r*r*r*r,n*n*n*n,a*a*a*a),this.oneOverRadii=new B.Vector3(r===0?0:1/r,n===0?0:1/n,a===0?0:1/a),this.oneOverRadiiSquared=new B.Vector3(r===0?0:1/(r*r),n===0?0:1/(n*n),a===0?0:1/(a*a)),this.minimumRadius=Math.min(r,n,a),this.maximumRadius=Math.max(r,n,a),this.radiiSquared.z!==0&&(this.squaredXOverSquaredZ=this.radiiSquared.x/this.radiiSquared.z),Object.freeze(this)}return(0,a1.default)(e,[{key:"equals",value:function(n){return this===n||Boolean(n&&this.radii.equals(n.radii))}},{key:"toString",value:function(){return this.radii.toString()}},{key:"cartographicToCartesian",value:function(n){var a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[0,0,0],t=Ii,i=o1,s=(0,t1.default)(n,3),o=s[2];this.geodeticSurfaceNormalCartographic(n,t),i.copy(this.radiiSquared).scale(t);var c=Math.sqrt(t.dot(i));return i.scale(1/c),t.scale(o),i.add(t),i.to(a)}},{key:"cartesianToCartographic",value:function(n){var a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[0,0,0];_t.from(n);var t=this.scaleToGeodeticSurface(_t,le);if(!!t){var i=this.geodeticSurfaceNormal(t,Ii),s=u1;s.copy(_t).subtract(t);var o=Math.atan2(i.y,i.x),c=Math.asin(i.z),u=Math.sign(Si.dot(s,_t))*Si.length(s);return(0,qi.toCartographicFromRadians)([o,c,u],a)}}},{key:"eastNorthUpToFixedFrame",value:function(n){var a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:new B.Matrix4;return(0,Ei.default)(this,"east","north","up",n,a)}},{key:"localFrameToFixedFrame",value:function(n,a,t,i){var s=arguments.length>4&&arguments[4]!==void 0?arguments[4]:new B.Matrix4;return(0,Ei.default)(this,n,a,t,i,s)}},{key:"geocentricSurfaceNormal",value:function(n){var a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[0,0,0];return xt.from(n).normalize().to(a)}},{key:"geodeticSurfaceNormalCartographic",value:function(n){var a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[0,0,0],t=(0,qi.fromCartographicToRadians)(n),i=t[0],s=t[1],o=Math.cos(s);return xt.set(o*Math.cos(i),o*Math.sin(i),Math.sin(s)).normalize(),xt.to(a)}},{key:"geodeticSurfaceNormal",value:function(n){var a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[0,0,0];return xt.from(n).scale(this.oneOverRadiiSquared).normalize().to(a)}},{key:"scaleToGeodeticSurface",value:function(n,a){return(0,i1.default)(n,this,a)}},{key:"scaleToGeocentricSurface",value:function(n){var a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[0,0,0];le.from(n);var t=le.x,i=le.y,s=le.z,o=this.oneOverRadiiSquared,c=1/Math.sqrt(t*t*o.x+i*i*o.y+s*s*o.z);return le.multiplyScalar(c).to(a)}},{key:"transformPositionToScaledSpace",value:function(n){var a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[0,0,0];return le.from(n).scale(this.oneOverRadii).to(a)}},{key:"transformPositionFromScaledSpace",value:function(n){var a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[0,0,0];return le.from(n).scale(this.radii).to(a)}},{key:"getSurfaceNormalIntersectionWithZAxis",value:function(n){var a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:[0,0,0];(0,B.assert)((0,B.equals)(this.radii.x,this.radii.y,B._MathUtils.EPSILON15)),(0,B.assert)(this.radii.z>0),le.from(n);var i=le.z*(1-this.squaredXOverSquaredZ);if(!(Math.abs(i)>=this.radii.z-a))return le.set(0,0,i).to(t)}}]),e}();Ot.default=hn;(0,ge.default)(hn,"WGS84",new hn(fn.WGS84_RADIUS_X,fn.WGS84_RADIUS_Y,fn.WGS84_RADIUS_Z))});var Ci=P(kt=>{"use strict";var c1=U();Object.defineProperty(kt,"__esModule",{value:!0});Object.defineProperty(kt,"Ellipsoid",{enumerable:!0,get:function(){return l1.default}});Object.defineProperty(kt,"isWGS84",{enumerable:!0,get:function(){return f1.isWGS84}});var l1=c1(Ni()),f1=on()});var Di=P((Qv,Wi)=>{(function(){var e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",r={rotl:function(n,a){return n<<a|n>>>32-a},rotr:function(n,a){return n<<32-a|n>>>a},endian:function(n){if(n.constructor==Number)return r.rotl(n,8)&16711935|r.rotl(n,24)&4278255360;for(var a=0;a<n.length;a++)n[a]=r.endian(n[a]);return n},randomBytes:function(n){for(var a=[];n>0;n--)a.push(Math.floor(Math.random()*256));return a},bytesToWords:function(n){for(var a=[],t=0,i=0;t<n.length;t++,i+=8)a[i>>>5]|=n[t]<<24-i%32;return a},wordsToBytes:function(n){for(var a=[],t=0;t<n.length*32;t+=8)a.push(n[t>>>5]>>>24-t%32&255);return a},bytesToHex:function(n){for(var a=[],t=0;t<n.length;t++)a.push((n[t]>>>4).toString(16)),a.push((n[t]&15).toString(16));return a.join("")},hexToBytes:function(n){for(var a=[],t=0;t<n.length;t+=2)a.push(parseInt(n.substr(t,2),16));return a},bytesToBase64:function(n){for(var a=[],t=0;t<n.length;t+=3)for(var i=n[t]<<16|n[t+1]<<8|n[t+2],s=0;s<4;s++)t*8+s*6<=n.length*8?a.push(e.charAt(i>>>6*(3-s)&63)):a.push("=");return a.join("")},base64ToBytes:function(n){n=n.replace(/[^A-Z0-9+\/]/ig,"");for(var a=[],t=0,i=0;t<n.length;i=++t%4)i!=0&&a.push((e.indexOf(n.charAt(t-1))&Math.pow(2,-2*i+8)-1)<<i*2|e.indexOf(n.charAt(t))>>>6-i*2);return a}};Wi.exports=r})()});var dn=P(($v,Fi)=>{var vn={utf8:{stringToBytes:function(e){return vn.bin.stringToBytes(unescape(encodeURIComponent(e)))},bytesToString:function(e){return decodeURIComponent(escape(vn.bin.bytesToString(e)))}},bin:{stringToBytes:function(e){for(var r=[],n=0;n<e.length;n++)r.push(e.charCodeAt(n)&255);return r},bytesToString:function(e){for(var r=[],n=0;n<e.length;n++)r.push(String.fromCharCode(e[n]));return r.join("")}}};Fi.exports=vn});var Vi=P((Hv,Bi)=>{Bi.exports=function(e){return e!=null&&(zi(e)||v1(e)||!!e._isBuffer)};function zi(e){return!!e.constructor&&typeof e.constructor.isBuffer=="function"&&e.constructor.isBuffer(e)}function v1(e){return typeof e.readFloatLE=="function"&&typeof e.slice=="function"&&zi(e.slice(0,0))}});var Gi=P((Kv,Yi)=>{(function(){var e=Di(),r=dn().utf8,n=Vi(),a=dn().bin,t=function(i,s){i.constructor==String?s&&s.encoding==="binary"?i=a.stringToBytes(i):i=r.stringToBytes(i):n(i)?i=Array.prototype.slice.call(i,0):!Array.isArray(i)&&i.constructor!==Uint8Array&&(i=i.toString());for(var o=e.bytesToWords(i),c=i.length*8,u=1732584193,l=-271733879,h=-1732584194,f=271733878,v=0;v<o.length;v++)o[v]=(o[v]<<8|o[v]>>>24)&16711935|(o[v]<<24|o[v]>>>8)&4278255360;o[c>>>5]|=128<<c%32,o[(c+64>>>9<<4)+14]=c;for(var d=t._ff,m=t._gg,p=t._hh,y=t._ii,v=0;v<o.length;v+=16){var b=u,g=l,M=h,k=f;u=d(u,l,h,f,o[v+0],7,-680876936),f=d(f,u,l,h,o[v+1],12,-389564586),h=d(h,f,u,l,o[v+2],17,606105819),l=d(l,h,f,u,o[v+3],22,-1044525330),u=d(u,l,h,f,o[v+4],7,-176418897),f=d(f,u,l,h,o[v+5],12,1200080426),h=d(h,f,u,l,o[v+6],17,-1473231341),l=d(l,h,f,u,o[v+7],22,-45705983),u=d(u,l,h,f,o[v+8],7,1770035416),f=d(f,u,l,h,o[v+9],12,-1958414417),h=d(h,f,u,l,o[v+10],17,-42063),l=d(l,h,f,u,o[v+11],22,-1990404162),u=d(u,l,h,f,o[v+12],7,1804603682),f=d(f,u,l,h,o[v+13],12,-40341101),h=d(h,f,u,l,o[v+14],17,-1502002290),l=d(l,h,f,u,o[v+15],22,1236535329),u=m(u,l,h,f,o[v+1],5,-165796510),f=m(f,u,l,h,o[v+6],9,-1069501632),h=m(h,f,u,l,o[v+11],14,643717713),l=m(l,h,f,u,o[v+0],20,-373897302),u=m(u,l,h,f,o[v+5],5,-701558691),f=m(f,u,l,h,o[v+10],9,38016083),h=m(h,f,u,l,o[v+15],14,-660478335),l=m(l,h,f,u,o[v+4],20,-405537848),u=m(u,l,h,f,o[v+9],5,568446438),f=m(f,u,l,h,o[v+14],9,-1019803690),h=m(h,f,u,l,o[v+3],14,-187363961),l=m(l,h,f,u,o[v+8],20,1163531501),u=m(u,l,h,f,o[v+13],5,-1444681467),f=m(f,u,l,h,o[v+2],9,-51403784),h=m(h,f,u,l,o[v+7],14,1735328473),l=m(l,h,f,u,o[v+12],20,-1926607734),u=p(u,l,h,f,o[v+5],4,-378558),f=p(f,u,l,h,o[v+8],11,-2022574463),h=p(h,f,u,l,o[v+11],16,1839030562),l=p(l,h,f,u,o[v+14],23,-35309556),u=p(u,l,h,f,o[v+1],4,-1530992060),f=p(f,u,l,h,o[v+4],11,1272893353),h=p(h,f,u,l,o[v+7],16,-155497632),l=p(l,h,f,u,o[v+10],23,-1094730640),u=p(u,l,h,f,o[v+13],4,681279174),f=p(f,u,l,h,o[v+0],11,-358537222),h=p(h,f,u,l,o[v+3],16,-722521979),l=p(l,h,f,u,o[v+6],23,76029189),u=p(u,l,h,f,o[v+9],4,-640364487),f=p(f,u,l,h,o[v+12],11,-421815835),h=p(h,f,u,l,o[v+15],16,530742520),l=p(l,h,f,u,o[v+2],23,-995338651),u=y(u,l,h,f,o[v+0],6,-198630844),f=y(f,u,l,h,o[v+7],10,1126891415),h=y(h,f,u,l,o[v+14],15,-1416354905),l=y(l,h,f,u,o[v+5],21,-57434055),u=y(u,l,h,f,o[v+12],6,1700485571),f=y(f,u,l,h,o[v+3],10,-1894986606),h=y(h,f,u,l,o[v+10],15,-1051523),l=y(l,h,f,u,o[v+1],21,-2054922799),u=y(u,l,h,f,o[v+8],6,1873313359),f=y(f,u,l,h,o[v+15],10,-30611744),h=y(h,f,u,l,o[v+6],15,-1560198380),l=y(l,h,f,u,o[v+13],21,1309151649),u=y(u,l,h,f,o[v+4],6,-145523070),f=y(f,u,l,h,o[v+11],10,-1120210379),h=y(h,f,u,l,o[v+2],15,718787259),l=y(l,h,f,u,o[v+9],21,-343485551),u=u+b>>>0,l=l+g>>>0,h=h+M>>>0,f=f+k>>>0}return e.endian([u,l,h,f])};t._ff=function(i,s,o,c,u,l,h){var f=i+(s&o|~s&c)+(u>>>0)+h;return(f<<l|f>>>32-l)+s},t._gg=function(i,s,o,c,u,l,h){var f=i+(s&c|o&~c)+(u>>>0)+h;return(f<<l|f>>>32-l)+s},t._hh=function(i,s,o,c,u,l,h){var f=i+(s^o^c)+(u>>>0)+h;return(f<<l|f>>>32-l)+s},t._ii=function(i,s,o,c,u,l,h){var f=i+(o^(s|~c))+(u>>>0)+h;return(f<<l|f>>>32-l)+s},t._blocksize=16,t._digestsize=16,Yi.exports=function(i,s){if(i==null)throw new Error("Illegal argument "+i);var o=e.wordsToBytes(t(i,s));return s&&s.asBytes?o:s&&s.asString?a.bytesToString(o):e.bytesToHex(o)}})()});function Pt(e,r=!0,n){let a=n||new Set;if(e){if(_n(e))a.add(e);else if(_n(e.buffer))a.add(e.buffer);else if(!ArrayBuffer.isView(e)){if(r&&typeof e=="object")for(let t in e)Pt(e[t],r,a)}}return n===void 0?Array.from(a):[]}function _n(e){return e?e instanceof ArrayBuffer||typeof MessagePort!="undefined"&&e instanceof MessagePort||typeof ImageBitmap!="undefined"&&e instanceof ImageBitmap||typeof OffscreenCanvas!="undefined"&&e instanceof OffscreenCanvas:!1}function We(){let parentPort;try{eval("globalThis.parentPort = require('worker_threads').parentPort"),parentPort=globalThis.parentPort}catch{}return parentPort}var At=new Map,J=class{static inWorkerThread(){return typeof self!="undefined"||Boolean(We())}static set onmessage(r){function n(t){let i=We(),{type:s,payload:o}=i?t:t.data;r(s,o)}let a=We();a?(a.on("message",n),a.on("exit",()=>console.debug("Node worker closing"))):globalThis.onmessage=n}static addEventListener(r){let n=At.get(r);n||(n=t=>{if(!is(t))return;let i=We(),{type:s,payload:o}=i?t:t.data;r(s,o)}),We()?console.error("not implemented"):globalThis.addEventListener("message",n)}static removeEventListener(r){let n=At.get(r);At.delete(r),We()?console.error("not implemented"):globalThis.removeEventListener("message",n)}static postMessage(r,n){let a={source:"loaders.gl",type:r,payload:n},t=Pt(n),i=We();i?i.postMessage(a,t):globalThis.postMessage(a,t)}};function is(e){let{type:r,data:n}=e;return r==="message"&&n&&typeof n.source=="string"&&n.source.startsWith("loaders.gl")}var Lr=class{constructor(){this._values=[],this._settlers=[],this._closed=!1}[Symbol.asyncIterator](){return this}push(r){return this.enqueue(r)}enqueue(r){if(this._closed)throw new Error("Closed");if(this._settlers.length>0){if(this._values.length>0)throw new Error("Illegal internal state");let n=this._settlers.shift();r instanceof Error?n.reject(r):n.resolve({value:r})}else this._values.push(r)}close(){for(;this._settlers.length>0;)this._settlers.shift().resolve({done:!0});this._closed=!0}next(){if(this._values.length>0){let r=this._values.shift();return r instanceof Error?Promise.reject(r):Promise.resolve({done:!1,value:r})}if(this._closed){if(this._settlers.length>0)throw new Error("Illegal internal state");return Promise.resolve({done:!0,value:void 0})}return new Promise((r,n)=>{this._settlers.push({resolve:r,reject:n})})}};var ss=0,Ir,On;function wt(e,r){if(!J.inWorkerThread())return;let n={process:os};J.onmessage=async(a,t)=>{try{switch(a){case"process":if(!e)throw new Error("Worker does not support atomic processing");let i=await e(t.input,t.options||{},n);J.postMessage("done",{result:i});break;case"process-in-batches":if(!r)throw new Error("Worker does not support batched processing");Ir=new Lr,On=t.options||{};let s=r(Ir,On,n);for await(let o of s)J.postMessage("output-batch",{result:o});J.postMessage("done",{});break;case"input-batch":Ir.push(t.input);break;case"input-done":Ir.close();break;default:}}catch(i){let s=i instanceof Error?i.message:"";J.postMessage("error",{error:s})}}}function os(e,r={}){return new Promise((n,a)=>{let t=ss++,i=(o,c)=>{if(c.id===t)switch(o){case"done":J.removeEventListener(i),n(c.result);break;case"error":J.removeEventListener(i),a(c.error);break;default:}};J.addEventListener(i);let s={id:t,input:e,options:r};J.postMessage("process",s)})}var Ie=Tt(ar()),Zi=Tt(Ci());function Rt(e,r){if(!e)throw new Error(r||"loader assertion failed.")}function Xe(...e){let r=e,n=r&&r.length>1&&r[0].constructor||null;if(!n)throw new Error('"concatenateTypedArrays" - incorrect quantity of arguments or arguments have incompatible data types');let a=r.reduce((s,o)=>s+o.length,0),t=new n(a),i=0;for(let s of r)t.set(s,i),i+=s.length;return t}var x1=Tt(Gi());var d1="EXT_mesh_features",p1="EXT_feature_metadata";function Ui(e,r,n){let a=r==null?void 0:r.extensions;if(!a)return[];for(let[t,i]of Object.entries(a||{}))switch(t){case p1:return m1(e,i,n);case d1:return console.warn("EXT_mesh_features extension is not supported yet"),[];default:return[]}return[]}function m1(e,r,n){var s,o,c,u,l,h,f;let a=(s=r==null?void 0:r.featureIdAttributes)==null?void 0:s[0];if((o=a==null?void 0:a.featureIds)==null?void 0:o.attribute)return e[a.featureIds.attribute].value;if(((c=a==null?void 0:a.featureIds)==null?void 0:c.hasOwnProperty("constant"))&&((u=a==null?void 0:a.featureIds)==null?void 0:u.hasOwnProperty("divisor"))){let v=((l=e==null?void 0:e.POSITIONS)==null?void 0:l.value.length)/3||0;return y1(v,a.featureIds.constant,a.featureIds.divisor)}let t=(r==null?void 0:r.featureIdTextures)&&(r==null?void 0:r.featureIdTextures[0]);if(t){let d=`TEXCOORD_${((f=(h=t==null?void 0:t.featureIds)==null?void 0:h.texture)==null?void 0:f.texCoord)||0}`,m=e[d].value;return g1(t,m,n)}return(r==null?void 0:r.featureTextures)&&(r==null?void 0:r.featureTextures[0])?(console.warn("EXT_feature_metadata doesn't yet support featureTextures in primitive"),[]):[]}function y1(e,r=0,n=0){let a=[];if(n>0){let t=r,i=n;for(let s=0;s<e;s++)a.push(t),i-=1,i===0&&(t++,i=n)}else a=Array(e).fill(r,0,e);return a}function g1(e,r,n){var u,l,h;if(!(n==null?void 0:n.length))return[];let a={r:0,g:1,b:2,a:3},t=(l=(u=e==null?void 0:e.featureIds)==null?void 0:u.texture)==null?void 0:l.index,i=(h=e==null?void 0:e.featureIds)==null?void 0:h.channels;if(!i||t===void 0)return[];let s=n[t],o=[],c=a[i];if(s.compressed)console.warn(`Can't get batch Ids from ${s.mimeType} compressed texture`);else for(let f=0;f<r.length;f+=2){let v=r[f],d=r[f+1],m=Math.min(Xi(v)*s.width|0,s.width-1),y=(Math.min(Xi(d)*s.height|0,s.height-1)*s.width+m)*s.components+c,b=new Uint8Array(s.data)[y];o.push(b)}return o}function Xi(e){return(e%1+1)%1}var M1={POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,TRIANGLE_STRIP:5,TRIANGLE_FAN:6},b1={BYTE:5120,UNSIGNED_BYTE:5121,SHORT:5122,UNSIGNED_SHORT:5123,INT:5124,UNSIGNED_INT:5125,FLOAT:5126,DOUBLE:5130},pn=Er(Er({},M1),b1);var ur=3,Sr=2,_1=4;var Qi=["CUSTOM_ATTRIBUTE_2","_BATCHID","BATCHID"];var ud=new Ie.Vector3;async function $i(e,r,n){let{nodes:a,images:t,cartographicOrigin:i,cartesianModelMatrix:s}=e,o=new Map;for(let c of r){let u={positions:new Float32Array(0),normals:new Float32Array(0),texCoords:new Float32Array(0),colors:new Uint8Array(0),uvRegions:new Uint16Array(0),featureIndicesGroups:[],featureIndices:[],boundingVolumes:null,mergedMaterials:c.mergedMaterials};for(let l of c.mergedMaterials)o.set(l.originalMaterialId,u)}Hi(a,t,i,s,o,n);for(let c of o.keys()){let u=o.get(c);if(!!u){if(u.positions.length===0){o.delete(c);continue}u.featureIndicesGroups&&(u.featureIndices=u.featureIndicesGroups.reduce((l,h)=>l.concat(h)),delete u.featureIndicesGroups)}}return o}function Hi(e,r,n,a,t,i,s=new Ie.Matrix4([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1])){if(e)for(let o of e)k1(o,r,n,a,t,i,s)}function O1(e,r){let n=r,{matrix:a,rotation:t,scale:i,translation:s}=e;return a&&(n=r.multiplyRight(a)),s&&(n=n.translate(s)),t&&(n=n.rotateXYZ(t)),i&&(n=n.scale(i)),n}function k1(e,r,n,a,t,i,s=new Ie.Matrix4([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1])){let o=O1(e,s),c=e.mesh;c&&R1(c,r,n,a,t,i,o),Hi(e.children||[],r,n,a,t,i,o)}function R1(e,r,n,a,t,i=!1,s=new Ie.Matrix4([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1])){var o;for(let c of e.primitives){let u=null,l;c.material?(u=t.get(c.material.uniqueId),l=(o=u==null?void 0:u.mergedMaterials.find(({originalMaterialId:v})=>{var d;return v===((d=c.material)==null?void 0:d.uniqueId)}))==null?void 0:o.uvRegion):t.has("default")&&(u=t.get("default")),Rt(u!==null,"Primitive - material mapping failed");let h=c.attributes;if(!u)continue;let f=T1(c);u.positions=Xe(u.positions,Ki({vertices:h.POSITION.value,cartographicOrigin:n,cartesianModelMatrix:a,nodeMatrix:s,indices:f,attributeSpecificTransformation:P1,useCartesianPositions:i})),u.normals=Xe(u.normals,Ki({vertices:h.NORMAL&&h.NORMAL.value,cartographicOrigin:n,cartesianModelMatrix:a,nodeMatrix:s,indices:f,attributeSpecificTransformation:A1,useCartesianPositions:!1})),u.texCoords=Xe(u.texCoords,w1(h.TEXCOORD_0&&h.TEXCOORD_0.value,f)),u.colors=Xe(u.colors,S1(h.COLOR_0,f)),l&&(u.uvRegions=Xe(u.uvRegions,q1(l,f))),u.featureIndicesGroups=u.featureIndicesGroups||[],u.featureIndicesGroups.push(E1(L1(h,c,r),f))}}function T1(e){var n;let r=(n=e.indices)==null?void 0:n.value;if(r&&e.mode===pn.TRIANGLE_STRIP){let a=r.constructor,t=new a((r.length-2)*3),i=0,s=r.slice(0,3);t.set(s,0);for(let o=1;o+2<r.length;o++)i+=3,s=r.slice(o,o+3),o%2==0?t.set(s,i):t.set(s.reverse(),i);r=t}return r}function Ki(e){let{vertices:r,indices:n,attributeSpecificTransformation:a}=e,t=new Float32Array(n.length*ur);if(!r)return t;for(let i=0;i<n.length;i++){let s=n[i]*ur,o=r.subarray(s,s+ur),c=new Ie.Vector3(Array.from(o));c=a(c,e),t[i*ur]=c.x,t[i*ur+1]=c.y,t[i*ur+2]=c.z}return t}function P1(e,r){let{cartesianModelMatrix:n,cartographicOrigin:a,nodeMatrix:t,useCartesianPositions:i}=r;return t&&(e=e.transform(t)),e=e.transform(n),i||(Zi.Ellipsoid.WGS84.cartesianToCartographic([e[0],e[1],e[2]],e),e=e.subtract(a)),e}function A1(e,r){let{cartesianModelMatrix:n,nodeMatrix:a}=r;return a&&(e=e.transformAsVector(a)),e=e.transformAsVector(n),e}function w1(e,r){let n=new Float32Array(r.length*Sr);if(!e)return n.fill(1),n;for(let a=0;a<r.length;a++){let t=r[a]*Sr,i=e.subarray(t,t+Sr);n[a*Sr]=i[0],n[a*Sr+1]=i[1]}return n}function S1(e,r){let n=(e==null?void 0:e.components)||_1,a=new Uint8Array(r.length*n);if(!e)return a.fill(255),a;let t=e.value;for(let i=0;i<r.length;i++){let s=r[i]*n,o=t.subarray(s,s+n),c=new Uint8Array(n);for(let u=0;u<o.length;u++)c[u]=o[u]*255;a.set(c,i*n)}return a}function q1(e,r){let n=new Uint16Array(r.length*4);for(let a=0;a<n.length;a+=4)n.set(e,a);return n}function E1(e,r){if(!e.length||!r.length)return[];let n=[];for(let a=0;a<r.length;a++){let t=r[a];n.push(e[t])}return n}function L1(e,r,n){let a=Ui(e,r,n);if(a.length)return a;for(let t=0;t<Qi.length;t++){let i=Qi[t];if(e[i]&&e[i].value)return e[i].value}return[]}wt(async(e,r={})=>await $i(e,r.materialAndTextureList,r.useCartesianPositions));
3
+ /*!
4
+ * Determine if an object is a Buffer
5
+ *
6
+ * @author Feross Aboukhadijeh <https://feross.org>
7
+ * @license MIT
8
+ */
9
+ //# sourceMappingURL=i3s-attributes-worker.js.map