tangram-core 0.3.0__cp310-cp310-manylinux_2_28_aarch64.whl

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 (162) hide show
  1. tangram_core/App.vue +441 -0
  2. tangram_core/CommandPalette.vue +200 -0
  3. tangram_core/HighlightText.vue +32 -0
  4. tangram_core/__Timeline.vue +300 -0
  5. tangram_core/__init__.py +5 -0
  6. tangram_core/__main__.py +331 -0
  7. tangram_core/_core.cpython-310-aarch64-linux-gnu.so +0 -0
  8. tangram_core/_core.pyi +38 -0
  9. tangram_core/api.ts +652 -0
  10. tangram_core/backend.py +458 -0
  11. tangram_core/components.ts +2 -0
  12. tangram_core/config.py +167 -0
  13. tangram_core/dist-frontend/aggregation-layers.js +521 -0
  14. tangram_core/dist-frontend/aggregation-layers.js.map +1 -0
  15. tangram_core/dist-frontend/assets/_commonjsHelpers-CqkleIqs.js +2 -0
  16. tangram_core/dist-frontend/assets/_commonjsHelpers-CqkleIqs.js.map +1 -0
  17. tangram_core/dist-frontend/assets/array-utils-flat-BBMak426.js +11 -0
  18. tangram_core/dist-frontend/assets/array-utils-flat-BBMak426.js.map +1 -0
  19. tangram_core/dist-frontend/assets/assert-cyW4mg7q.js +3 -0
  20. tangram_core/dist-frontend/assets/assert-cyW4mg7q.js.map +1 -0
  21. tangram_core/dist-frontend/assets/b612-latin-400-italic-DePNXA0a.woff +0 -0
  22. tangram_core/dist-frontend/assets/b612-latin-400-italic-a-4GLPtl.woff2 +0 -0
  23. tangram_core/dist-frontend/assets/b612-latin-400-normal-CC98FVm_.woff2 +0 -0
  24. tangram_core/dist-frontend/assets/b612-latin-400-normal-JbZ7xwUX.woff +0 -0
  25. tangram_core/dist-frontend/assets/b612-latin-700-normal-B_Snq1wd.woff +0 -0
  26. tangram_core/dist-frontend/assets/b612-latin-700-normal-BinQrnoB.woff2 +0 -0
  27. tangram_core/dist-frontend/assets/clip-extension-D-rbmFPj.js +26 -0
  28. tangram_core/dist-frontend/assets/clip-extension-D-rbmFPj.js.map +1 -0
  29. tangram_core/dist-frontend/assets/color-CUNNsFV-.js +17 -0
  30. tangram_core/dist-frontend/assets/color-CUNNsFV-.js.map +1 -0
  31. tangram_core/dist-frontend/assets/cube-geometry-v0HQ793i.js +2 -0
  32. tangram_core/dist-frontend/assets/cube-geometry-v0HQ793i.js.map +1 -0
  33. tangram_core/dist-frontend/assets/deep-equal-BTW2ZN6S.js +2 -0
  34. tangram_core/dist-frontend/assets/deep-equal-BTW2ZN6S.js.map +1 -0
  35. tangram_core/dist-frontend/assets/fly-to-interpolator-CIXGjOdo.js +2 -0
  36. tangram_core/dist-frontend/assets/fly-to-interpolator-CIXGjOdo.js.map +1 -0
  37. tangram_core/dist-frontend/assets/geojson-layer-DgMOQ4Qu.js +1010 -0
  38. tangram_core/dist-frontend/assets/geojson-layer-DgMOQ4Qu.js.map +1 -0
  39. tangram_core/dist-frontend/assets/globe-view-Day_n1iB.js +94 -0
  40. tangram_core/dist-frontend/assets/globe-view-Day_n1iB.js.map +1 -0
  41. tangram_core/dist-frontend/assets/globe-viewport-tqhQW7C4.js +2 -0
  42. tangram_core/dist-frontend/assets/globe-viewport-tqhQW7C4.js.map +1 -0
  43. tangram_core/dist-frontend/assets/image-loader-hHJsndO6.js +2 -0
  44. tangram_core/dist-frontend/assets/image-loader-hHJsndO6.js.map +1 -0
  45. tangram_core/dist-frontend/assets/inconsolata-latin-400-normal-DTZQ6lD6.woff2 +0 -0
  46. tangram_core/dist-frontend/assets/inconsolata-latin-400-normal-HYADljCo.woff +0 -0
  47. tangram_core/dist-frontend/assets/inconsolata-latin-700-normal-ByjKuJjN.woff2 +0 -0
  48. tangram_core/dist-frontend/assets/inconsolata-latin-700-normal-DzgUY3Rl.woff +0 -0
  49. tangram_core/dist-frontend/assets/inconsolata-latin-ext-400-normal-BaHVOdFB.woff2 +0 -0
  50. tangram_core/dist-frontend/assets/inconsolata-latin-ext-400-normal-yvPjCxxx.woff +0 -0
  51. tangram_core/dist-frontend/assets/inconsolata-latin-ext-700-normal-D0Kpgs_9.woff2 +0 -0
  52. tangram_core/dist-frontend/assets/inconsolata-latin-ext-700-normal-Dlt-daqV.woff +0 -0
  53. tangram_core/dist-frontend/assets/inconsolata-vietnamese-400-normal-ByiM2lek.woff +0 -0
  54. tangram_core/dist-frontend/assets/inconsolata-vietnamese-400-normal-DfC_iMic.woff2 +0 -0
  55. tangram_core/dist-frontend/assets/inconsolata-vietnamese-700-normal-DLCFFAUf.woff +0 -0
  56. tangram_core/dist-frontend/assets/inconsolata-vietnamese-700-normal-DuasYmn8.woff2 +0 -0
  57. tangram_core/dist-frontend/assets/index-CcogpxdD.js +824 -0
  58. tangram_core/dist-frontend/assets/index-CcogpxdD.js.map +1 -0
  59. tangram_core/dist-frontend/assets/index-SSLdizTv.css +1 -0
  60. tangram_core/dist-frontend/assets/layer-DPcO4AXQ.js +555 -0
  61. tangram_core/dist-frontend/assets/layer-DPcO4AXQ.js.map +1 -0
  62. tangram_core/dist-frontend/assets/layer-extension-CYwTXf73.js +2 -0
  63. tangram_core/dist-frontend/assets/layer-extension-CYwTXf73.js.map +1 -0
  64. tangram_core/dist-frontend/assets/mesh-layers-wiqredoy.js +1123 -0
  65. tangram_core/dist-frontend/assets/mesh-layers-wiqredoy.js.map +1 -0
  66. tangram_core/dist-frontend/assets/orthographic-viewport-B4nCj5tn.js +2 -0
  67. tangram_core/dist-frontend/assets/orthographic-viewport-B4nCj5tn.js.map +1 -0
  68. tangram_core/dist-frontend/assets/pick-layers-pass-C-3k0wbN.js +2 -0
  69. tangram_core/dist-frontend/assets/pick-layers-pass-C-3k0wbN.js.map +1 -0
  70. tangram_core/dist-frontend/assets/project-BTjD2Imj.js +760 -0
  71. tangram_core/dist-frontend/assets/project-BTjD2Imj.js.map +1 -0
  72. tangram_core/dist-frontend/assets/roboto-condensed-cyrillic-400-italic-4qS3_zkX.woff2 +0 -0
  73. tangram_core/dist-frontend/assets/roboto-condensed-cyrillic-400-italic-CDK-EZBY.woff +0 -0
  74. tangram_core/dist-frontend/assets/roboto-condensed-cyrillic-400-normal-Bgns473E.woff +0 -0
  75. tangram_core/dist-frontend/assets/roboto-condensed-cyrillic-400-normal-_T2aQlWs.woff2 +0 -0
  76. tangram_core/dist-frontend/assets/roboto-condensed-cyrillic-500-normal-CvEVpWxD.woff +0 -0
  77. tangram_core/dist-frontend/assets/roboto-condensed-cyrillic-500-normal-s4PklZE0.woff2 +0 -0
  78. tangram_core/dist-frontend/assets/roboto-condensed-cyrillic-700-normal-9RN-Z7cI.woff2 +0 -0
  79. tangram_core/dist-frontend/assets/roboto-condensed-cyrillic-700-normal-BGMkBBYx.woff +0 -0
  80. tangram_core/dist-frontend/assets/roboto-condensed-cyrillic-ext-400-italic-C7erd-g8.woff +0 -0
  81. tangram_core/dist-frontend/assets/roboto-condensed-cyrillic-ext-400-italic-DR5R5TWx.woff2 +0 -0
  82. tangram_core/dist-frontend/assets/roboto-condensed-cyrillic-ext-400-normal-DGo1Ayjq.woff2 +0 -0
  83. tangram_core/dist-frontend/assets/roboto-condensed-cyrillic-ext-400-normal-WtM1l1qc.woff +0 -0
  84. tangram_core/dist-frontend/assets/roboto-condensed-cyrillic-ext-500-normal-C8FNIdXm.woff2 +0 -0
  85. tangram_core/dist-frontend/assets/roboto-condensed-cyrillic-ext-500-normal-TLDmfi3Q.woff +0 -0
  86. tangram_core/dist-frontend/assets/roboto-condensed-cyrillic-ext-700-normal-CTXjXnze.woff2 +0 -0
  87. tangram_core/dist-frontend/assets/roboto-condensed-cyrillic-ext-700-normal-CWPRiRXS.woff +0 -0
  88. tangram_core/dist-frontend/assets/roboto-condensed-greek-400-italic-CR6qj4Z4.woff2 +0 -0
  89. tangram_core/dist-frontend/assets/roboto-condensed-greek-400-italic-DHRaIs10.woff +0 -0
  90. tangram_core/dist-frontend/assets/roboto-condensed-greek-400-normal-D5vBSIyg.woff2 +0 -0
  91. tangram_core/dist-frontend/assets/roboto-condensed-greek-400-normal-FabMgVmk.woff +0 -0
  92. tangram_core/dist-frontend/assets/roboto-condensed-greek-500-normal-BIN62cw9.woff +0 -0
  93. tangram_core/dist-frontend/assets/roboto-condensed-greek-500-normal-Hsn-wDIp.woff2 +0 -0
  94. tangram_core/dist-frontend/assets/roboto-condensed-greek-700-normal-89Up2Xly.woff +0 -0
  95. tangram_core/dist-frontend/assets/roboto-condensed-greek-700-normal-DWMOA2VK.woff2 +0 -0
  96. tangram_core/dist-frontend/assets/roboto-condensed-latin-400-italic-D_BR-3LG.woff2 +0 -0
  97. tangram_core/dist-frontend/assets/roboto-condensed-latin-400-italic-om57GXsO.woff +0 -0
  98. tangram_core/dist-frontend/assets/roboto-condensed-latin-400-normal-BICmKrXV.woff2 +0 -0
  99. tangram_core/dist-frontend/assets/roboto-condensed-latin-400-normal-D2e7XwB1.woff +0 -0
  100. tangram_core/dist-frontend/assets/roboto-condensed-latin-500-normal-3p2daRJW.woff2 +0 -0
  101. tangram_core/dist-frontend/assets/roboto-condensed-latin-500-normal-Dc9bsamC.woff +0 -0
  102. tangram_core/dist-frontend/assets/roboto-condensed-latin-700-normal-BOl6B_hI.woff +0 -0
  103. tangram_core/dist-frontend/assets/roboto-condensed-latin-700-normal-DRbp0YnP.woff2 +0 -0
  104. tangram_core/dist-frontend/assets/roboto-condensed-latin-ext-400-italic-BXrkWnoY.woff +0 -0
  105. tangram_core/dist-frontend/assets/roboto-condensed-latin-ext-400-italic-Bhem1d5z.woff2 +0 -0
  106. tangram_core/dist-frontend/assets/roboto-condensed-latin-ext-400-normal-DT8nEsYA.woff +0 -0
  107. tangram_core/dist-frontend/assets/roboto-condensed-latin-ext-400-normal-OHaX69iP.woff2 +0 -0
  108. tangram_core/dist-frontend/assets/roboto-condensed-latin-ext-500-normal-CcSTXKtO.woff2 +0 -0
  109. tangram_core/dist-frontend/assets/roboto-condensed-latin-ext-500-normal-JgPl2bDS.woff +0 -0
  110. tangram_core/dist-frontend/assets/roboto-condensed-latin-ext-700-normal-B004qtqu.woff2 +0 -0
  111. tangram_core/dist-frontend/assets/roboto-condensed-latin-ext-700-normal-O6H_RRvN.woff +0 -0
  112. tangram_core/dist-frontend/assets/roboto-condensed-vietnamese-400-italic-BwUYFJ2t.woff2 +0 -0
  113. tangram_core/dist-frontend/assets/roboto-condensed-vietnamese-400-italic-DV8QogUk.woff +0 -0
  114. tangram_core/dist-frontend/assets/roboto-condensed-vietnamese-400-normal-0o1laQ-g.woff2 +0 -0
  115. tangram_core/dist-frontend/assets/roboto-condensed-vietnamese-400-normal-CPsdS8_S.woff +0 -0
  116. tangram_core/dist-frontend/assets/roboto-condensed-vietnamese-500-normal-G9shSJ2z.woff +0 -0
  117. tangram_core/dist-frontend/assets/roboto-condensed-vietnamese-500-normal-TFWhjk13.woff2 +0 -0
  118. tangram_core/dist-frontend/assets/roboto-condensed-vietnamese-700-normal-BtNeb9D6.woff +0 -0
  119. tangram_core/dist-frontend/assets/roboto-condensed-vietnamese-700-normal-D35V1G0s.woff2 +0 -0
  120. tangram_core/dist-frontend/assets/shader-Cbdysp2j.js +843 -0
  121. tangram_core/dist-frontend/assets/shader-Cbdysp2j.js.map +1 -0
  122. tangram_core/dist-frontend/assets/solid-polygon-layer-DJFl_7Ca.js +392 -0
  123. tangram_core/dist-frontend/assets/solid-polygon-layer-DJFl_7Ca.js.map +1 -0
  124. tangram_core/dist-frontend/assets/tesselator-CENyUZ2p.js +2 -0
  125. tangram_core/dist-frontend/assets/tesselator-CENyUZ2p.js.map +1 -0
  126. tangram_core/dist-frontend/assets/webgl-developer-tools-utTNOsNf.js +7 -0
  127. tangram_core/dist-frontend/assets/webgl-developer-tools-utTNOsNf.js.map +1 -0
  128. tangram_core/dist-frontend/assets/webgl-device-BYRB-GQX.js +3 -0
  129. tangram_core/dist-frontend/assets/webgl-device-BYRB-GQX.js.map +1 -0
  130. tangram_core/dist-frontend/assets/widget-BjgEeHAL.js +2 -0
  131. tangram_core/dist-frontend/assets/widget-BjgEeHAL.js.map +1 -0
  132. tangram_core/dist-frontend/core.js +60 -0
  133. tangram_core/dist-frontend/core.js.map +1 -0
  134. tangram_core/dist-frontend/extensions.js +609 -0
  135. tangram_core/dist-frontend/extensions.js.map +1 -0
  136. tangram_core/dist-frontend/favicon.ico +0 -0
  137. tangram_core/dist-frontend/favicon.png +0 -0
  138. tangram_core/dist-frontend/geo-layers.js +115 -0
  139. tangram_core/dist-frontend/geo-layers.js.map +1 -0
  140. tangram_core/dist-frontend/index.html +39 -0
  141. tangram_core/dist-frontend/json.js +3 -0
  142. tangram_core/dist-frontend/json.js.map +1 -0
  143. tangram_core/dist-frontend/layers.js +268 -0
  144. tangram_core/dist-frontend/layers.js.map +1 -0
  145. tangram_core/dist-frontend/mapbox.js +2 -0
  146. tangram_core/dist-frontend/mapbox.js.map +1 -0
  147. tangram_core/dist-frontend/mesh-layers.js +2 -0
  148. tangram_core/dist-frontend/mesh-layers.js.map +1 -0
  149. tangram_core/dist-frontend/widgets.js +3 -0
  150. tangram_core/dist-frontend/widgets.js.map +1 -0
  151. tangram_core/main.ts +28 -0
  152. tangram_core/package.json +62 -0
  153. tangram_core/plugin.py +109 -0
  154. tangram_core/plugin.ts +47 -0
  155. tangram_core/redis.py +89 -0
  156. tangram_core/user.css +114 -0
  157. tangram_core/utils.ts +143 -0
  158. tangram_core/vite-plugin-tangram.mjs +155 -0
  159. tangram_core-0.3.0.dist-info/METADATA +101 -0
  160. tangram_core-0.3.0.dist-info/RECORD +162 -0
  161. tangram_core-0.3.0.dist-info/WHEEL +4 -0
  162. tangram_core-0.3.0.dist-info/entry_points.txt +2 -0
@@ -0,0 +1 @@
1
+ {"version":3,"file":"deep-equal-BTW2ZN6S.js","sources":["../../../../node_modules/.pnpm/@probe.gl+env@4.1.0/node_modules/@probe.gl/env/dist/lib/globals.js","../../../../node_modules/.pnpm/@probe.gl+env@4.1.0/node_modules/@probe.gl/env/dist/lib/is-electron.js","../../../../node_modules/.pnpm/@probe.gl+env@4.1.0/node_modules/@probe.gl/env/dist/lib/is-browser.js","../../../../node_modules/.pnpm/@probe.gl+env@4.1.0/node_modules/@probe.gl/env/dist/index.js","../../../../node_modules/.pnpm/@probe.gl+log@4.1.0/node_modules/@probe.gl/log/dist/utils/local-storage.js","../../../../node_modules/.pnpm/@probe.gl+log@4.1.0/node_modules/@probe.gl/log/dist/utils/formatters.js","../../../../node_modules/.pnpm/@probe.gl+log@4.1.0/node_modules/@probe.gl/log/dist/utils/color.js","../../../../node_modules/.pnpm/@probe.gl+log@4.1.0/node_modules/@probe.gl/log/dist/utils/autobind.js","../../../../node_modules/.pnpm/@probe.gl+log@4.1.0/node_modules/@probe.gl/log/dist/utils/assert.js","../../../../node_modules/.pnpm/@probe.gl+log@4.1.0/node_modules/@probe.gl/log/dist/utils/hi-res-timestamp.js","../../../../node_modules/.pnpm/@probe.gl+log@4.1.0/node_modules/@probe.gl/log/dist/log.js","../../../../node_modules/.pnpm/@deck.gl+core@9.2.6/node_modules/@deck.gl/core/dist/utils/log.js","../../../../node_modules/.pnpm/@luma.gl+core@9.2.6/node_modules/@luma.gl/core/dist/utils/log.js","../../../../node_modules/.pnpm/@luma.gl+core@9.2.6/node_modules/@luma.gl/core/dist/utils/uid.js","../../../../node_modules/.pnpm/@luma.gl+core@9.2.6/node_modules/@luma.gl/core/dist/adapter/resources/resource.js","../../../../node_modules/.pnpm/@luma.gl+core@9.2.6/node_modules/@luma.gl/core/dist/adapter/resources/buffer.js","../../../../node_modules/.pnpm/@luma.gl+core@9.2.6/node_modules/@luma.gl/core/dist/shadertypes/data-types/decode-data-types.js","../../../../node_modules/.pnpm/@luma.gl+core@9.2.6/node_modules/@luma.gl/core/dist/shadertypes/vertex-arrays/decode-vertex-format.js","../../../../node_modules/.pnpm/@math.gl+core@4.1.0/node_modules/@math.gl/core/dist/lib/common.js","../../../../node_modules/.pnpm/@math.gl+core@4.1.0/node_modules/@math.gl/core/dist/classes/base/math-array.js","../../../../node_modules/.pnpm/@math.gl+core@4.1.0/node_modules/@math.gl/core/dist/lib/validators.js","../../../../node_modules/.pnpm/@math.gl+core@4.1.0/node_modules/@math.gl/core/dist/lib/assert.js","../../../../node_modules/.pnpm/@math.gl+core@4.1.0/node_modules/@math.gl/core/dist/classes/base/vector.js","../../../../node_modules/.pnpm/@math.gl+core@4.1.0/node_modules/@math.gl/core/dist/gl-matrix/common.js","../../../../node_modules/.pnpm/@math.gl+core@4.1.0/node_modules/@math.gl/core/dist/gl-matrix/vec2.js","../../../../node_modules/.pnpm/@math.gl+core@4.1.0/node_modules/@math.gl/core/dist/lib/gl-matrix-extras.js","../../../../node_modules/.pnpm/@math.gl+core@4.1.0/node_modules/@math.gl/core/dist/gl-matrix/vec3.js","../../../../node_modules/.pnpm/@math.gl+core@4.1.0/node_modules/@math.gl/core/dist/classes/vector3.js","../../../../node_modules/.pnpm/@math.gl+core@4.1.0/node_modules/@math.gl/core/dist/classes/base/matrix.js","../../../../node_modules/.pnpm/@math.gl+core@4.1.0/node_modules/@math.gl/core/dist/gl-matrix/mat4.js","../../../../node_modules/.pnpm/@math.gl+core@4.1.0/node_modules/@math.gl/core/dist/gl-matrix/vec4.js","../../../../node_modules/.pnpm/@math.gl+core@4.1.0/node_modules/@math.gl/core/dist/classes/matrix4.js","../../../../node_modules/.pnpm/mjolnir.js@3.0.0/node_modules/mjolnir.js/dist/hammerjs/input/input-consts.js","../../../../node_modules/.pnpm/mjolnir.js@3.0.0/node_modules/mjolnir.js/dist/hammerjs/recognizer/recognizer-state.js","../../../../node_modules/.pnpm/mjolnir.js@3.0.0/node_modules/mjolnir.js/dist/hammerjs/touchaction/touchaction-Consts.js","../../../../node_modules/.pnpm/mjolnir.js@3.0.0/node_modules/mjolnir.js/dist/hammerjs/utils/split-str.js","../../../../node_modules/.pnpm/mjolnir.js@3.0.0/node_modules/mjolnir.js/dist/hammerjs/utils/event-listeners.js","../../../../node_modules/.pnpm/mjolnir.js@3.0.0/node_modules/mjolnir.js/dist/hammerjs/utils/get-window-for-element.js","../../../../node_modules/.pnpm/mjolnir.js@3.0.0/node_modules/mjolnir.js/dist/hammerjs/utils/has-parent.js","../../../../node_modules/.pnpm/mjolnir.js@3.0.0/node_modules/mjolnir.js/dist/hammerjs/input/get-center.js","../../../../node_modules/.pnpm/mjolnir.js@3.0.0/node_modules/mjolnir.js/dist/hammerjs/input/simple-clone-input-data.js","../../../../node_modules/.pnpm/mjolnir.js@3.0.0/node_modules/mjolnir.js/dist/hammerjs/input/get-distance.js","../../../../node_modules/.pnpm/mjolnir.js@3.0.0/node_modules/mjolnir.js/dist/hammerjs/input/get-angle.js","../../../../node_modules/.pnpm/mjolnir.js@3.0.0/node_modules/mjolnir.js/dist/hammerjs/input/get-direction.js","../../../../node_modules/.pnpm/mjolnir.js@3.0.0/node_modules/mjolnir.js/dist/hammerjs/input/get-delta-xy.js","../../../../node_modules/.pnpm/mjolnir.js@3.0.0/node_modules/mjolnir.js/dist/hammerjs/input/get-velocity.js","../../../../node_modules/.pnpm/mjolnir.js@3.0.0/node_modules/mjolnir.js/dist/hammerjs/input/get-scale.js","../../../../node_modules/.pnpm/mjolnir.js@3.0.0/node_modules/mjolnir.js/dist/hammerjs/input/get-rotation.js","../../../../node_modules/.pnpm/mjolnir.js@3.0.0/node_modules/mjolnir.js/dist/hammerjs/input/compute-interval-input-data.js","../../../../node_modules/.pnpm/mjolnir.js@3.0.0/node_modules/mjolnir.js/dist/hammerjs/input/compute-input-data.js","../../../../node_modules/.pnpm/mjolnir.js@3.0.0/node_modules/mjolnir.js/dist/hammerjs/input/input-handler.js","../../../../node_modules/.pnpm/mjolnir.js@3.0.0/node_modules/mjolnir.js/dist/hammerjs/input/input.js","../../../../node_modules/.pnpm/mjolnir.js@3.0.0/node_modules/mjolnir.js/dist/hammerjs/inputs/pointerevent.js","../../../../node_modules/.pnpm/mjolnir.js@3.0.0/node_modules/mjolnir.js/dist/hammerjs/utils/unique-id.js","../../../../node_modules/.pnpm/mjolnir.js@3.0.0/node_modules/mjolnir.js/dist/hammerjs/recognizer/state-str.js","../../../../node_modules/.pnpm/mjolnir.js@3.0.0/node_modules/mjolnir.js/dist/hammerjs/recognizer/recognizer.js","../../../../node_modules/.pnpm/mjolnir.js@3.0.0/node_modules/mjolnir.js/dist/hammerjs/recognizers/attribute.js","../../../../node_modules/.pnpm/mjolnir.js@3.0.0/node_modules/mjolnir.js/dist/hammerjs/recognizers/tap.js","../../../../node_modules/.pnpm/mjolnir.js@3.0.0/node_modules/mjolnir.js/dist/hammerjs/recognizers/pan.js","../../../../node_modules/.pnpm/mjolnir.js@3.0.0/node_modules/mjolnir.js/dist/hammerjs/recognizers/pinch.js","../../../../node_modules/.pnpm/mjolnir.js@3.0.0/node_modules/mjolnir.js/dist/inputs/input.js","../../../../node_modules/.pnpm/mjolnir.js@3.0.0/node_modules/mjolnir.js/dist/utils/globals.js","../../../../node_modules/.pnpm/mjolnir.js@3.0.0/node_modules/mjolnir.js/dist/inputs/wheel-input.js","../../../../node_modules/.pnpm/@deck.gl+core@9.2.6/node_modules/@deck.gl/core/dist/lib/constants.js","../../../../node_modules/.pnpm/@math.gl+web-mercator@4.1.0/node_modules/@math.gl/web-mercator/dist/math-utils.js","../../../../node_modules/.pnpm/@math.gl+web-mercator@4.1.0/node_modules/@math.gl/web-mercator/dist/assert.js","../../../../node_modules/.pnpm/@math.gl+web-mercator@4.1.0/node_modules/@math.gl/web-mercator/dist/web-mercator-utils.js","../../../../node_modules/.pnpm/@math.gl+web-mercator@4.1.0/node_modules/@math.gl/web-mercator/dist/fit-bounds.js","../../../../node_modules/.pnpm/@math.gl+web-mercator@4.1.0/node_modules/@math.gl/web-mercator/dist/get-bounds.js","../../../../node_modules/.pnpm/@deck.gl+core@9.2.6/node_modules/@deck.gl/core/dist/utils/typed-array-manager.js","../../../../node_modules/.pnpm/@deck.gl+core@9.2.6/node_modules/@deck.gl/core/dist/utils/math-utils.js","../../../../node_modules/.pnpm/@deck.gl+core@9.2.6/node_modules/@deck.gl/core/dist/viewports/viewport.js","../../../../node_modules/.pnpm/@deck.gl+core@9.2.6/node_modules/@deck.gl/core/dist/viewports/web-mercator-viewport.js","../../../../node_modules/.pnpm/@deck.gl+core@9.2.6/node_modules/@deck.gl/core/dist/utils/deep-equal.js"],"sourcesContent":["// Do not name these variables the same as the global objects - will break bundling\nconst global_ = globalThis;\nconst window_ = globalThis;\nconst document_ = globalThis.document || {};\nconst process_ = globalThis.process || {};\nconst console_ = globalThis.console;\nconst navigator_ = globalThis.navigator || {};\nexport { global_ as global, global_ as self, window_ as window, document_ as document, process_ as process, console_ as console, navigator_ as navigator };\n//# sourceMappingURL=globals.js.map","// based on https://github.com/cheton/is-electron\n// https://github.com/electron/electron/issues/2288\n/* eslint-disable complexity */\nexport function isElectron(mockUserAgent) {\n // Renderer process\n // @ts-expect-error\n if (typeof window !== 'undefined' && window.process?.type === 'renderer') {\n return true;\n }\n // Main process\n // eslint-disable-next-line\n if (typeof process !== 'undefined' && Boolean(process.versions?.['electron'])) {\n return true;\n }\n // Detect the user agent when the `nodeIntegration` option is set to true\n const realUserAgent = typeof navigator !== 'undefined' && navigator.userAgent;\n const userAgent = mockUserAgent || realUserAgent;\n return Boolean(userAgent && userAgent.indexOf('Electron') >= 0);\n}\n//# sourceMappingURL=is-electron.js.map","// This function is needed in initialization stages,\n// make sure it can be imported in isolation\nimport { isElectron } from \"./is-electron.js\";\n/** Check if in browser by duck-typing Node context */\nexport function isBrowser() {\n const isNode = \n // @ts-expect-error\n typeof process === 'object' && String(process) === '[object process]' && !process?.browser;\n return !isNode || isElectron();\n}\n//# sourceMappingURL=is-browser.js.map","// Extract injected version from package.json (injected by babel plugin)\n// @ts-expect-error\nexport const VERSION = typeof \"4.1.0\" !== 'undefined' ? \"4.1.0\" : 'untranspiled source';\n// ENVIRONMENT\nexport { self, window, global, document, process, console } from \"./lib/globals.js\";\nexport { isBrowser } from \"./lib/is-browser.js\";\nexport { getBrowser, isMobile } from \"./lib/get-browser.js\";\nexport { isElectron } from \"./lib/is-electron.js\";\n// ENVIRONMENT'S ASSERT IS 5-15KB, SO WE PROVIDE OUR OWN\nexport { assert } from \"./utils/assert.js\";\n// TODO - wish we could just export a constant\n// export const isBrowser = checkIfBrowser();\n//# sourceMappingURL=index.js.map","// probe.gl, MIT license\nfunction getStorage(type) {\n try {\n const storage = window[type];\n const x = '__storage_test__';\n storage.setItem(x, x);\n storage.removeItem(x);\n return storage;\n }\n catch (e) {\n return null;\n }\n}\n// Store keys in local storage via simple interface\nexport class LocalStorage {\n constructor(id, defaultConfig, type = 'sessionStorage') {\n this.storage = getStorage(type);\n this.id = id;\n this.config = defaultConfig;\n this._loadConfiguration();\n }\n getConfiguration() {\n return this.config;\n }\n setConfiguration(configuration) {\n Object.assign(this.config, configuration);\n if (this.storage) {\n const serialized = JSON.stringify(this.config);\n this.storage.setItem(this.id, serialized);\n }\n }\n // Get config from persistent store, if available\n _loadConfiguration() {\n let configuration = {};\n if (this.storage) {\n const serializedConfiguration = this.storage.getItem(this.id);\n configuration = serializedConfiguration ? JSON.parse(serializedConfiguration) : {};\n }\n Object.assign(this.config, configuration);\n return this;\n }\n}\n//# sourceMappingURL=local-storage.js.map","// probe.gl, MIT license\n/**\n * Format time\n */\nexport function formatTime(ms) {\n let formatted;\n if (ms < 10) {\n formatted = `${ms.toFixed(2)}ms`;\n }\n else if (ms < 100) {\n formatted = `${ms.toFixed(1)}ms`;\n }\n else if (ms < 1000) {\n formatted = `${ms.toFixed(0)}ms`;\n }\n else {\n formatted = `${(ms / 1000).toFixed(2)}s`;\n }\n return formatted;\n}\nexport function leftPad(string, length = 8) {\n const padLength = Math.max(length - string.length, 0);\n return `${' '.repeat(padLength)}${string}`;\n}\nexport function rightPad(string, length = 8) {\n const padLength = Math.max(length - string.length, 0);\n return `${string}${' '.repeat(padLength)}`;\n}\nexport function formatValue(v, options = {}) {\n const EPSILON = 1e-16;\n const { isInteger = false } = options;\n if (Array.isArray(v) || ArrayBuffer.isView(v)) {\n return formatArrayValue(v, options);\n }\n if (!Number.isFinite(v)) {\n return String(v);\n }\n // @ts-expect-error\n if (Math.abs(v) < EPSILON) {\n return isInteger ? '0' : '0.';\n }\n if (isInteger) {\n // @ts-expect-error\n return v.toFixed(0);\n }\n // @ts-expect-error\n if (Math.abs(v) > 100 && Math.abs(v) < 10000) {\n // @ts-expect-error\n return v.toFixed(0);\n }\n // @ts-expect-error\n const string = v.toPrecision(2);\n const decimal = string.indexOf('.0');\n return decimal === string.length - 2 ? string.slice(0, -1) : string;\n}\n/** Helper to formatValue */\nfunction formatArrayValue(v, options) {\n const { maxElts = 16, size = 1 } = options;\n let string = '[';\n for (let i = 0; i < v.length && i < maxElts; ++i) {\n if (i > 0) {\n string += `,${i % size === 0 ? ' ' : ''}`;\n }\n string += formatValue(v[i], options);\n }\n const terminator = v.length > maxElts ? '...' : ']';\n return `${string}${terminator}`;\n}\n//# sourceMappingURL=formatters.js.map","import { isBrowser } from '@probe.gl/env';\nexport var COLOR;\n(function (COLOR) {\n COLOR[COLOR[\"BLACK\"] = 30] = \"BLACK\";\n COLOR[COLOR[\"RED\"] = 31] = \"RED\";\n COLOR[COLOR[\"GREEN\"] = 32] = \"GREEN\";\n COLOR[COLOR[\"YELLOW\"] = 33] = \"YELLOW\";\n COLOR[COLOR[\"BLUE\"] = 34] = \"BLUE\";\n COLOR[COLOR[\"MAGENTA\"] = 35] = \"MAGENTA\";\n COLOR[COLOR[\"CYAN\"] = 36] = \"CYAN\";\n COLOR[COLOR[\"WHITE\"] = 37] = \"WHITE\";\n COLOR[COLOR[\"BRIGHT_BLACK\"] = 90] = \"BRIGHT_BLACK\";\n COLOR[COLOR[\"BRIGHT_RED\"] = 91] = \"BRIGHT_RED\";\n COLOR[COLOR[\"BRIGHT_GREEN\"] = 92] = \"BRIGHT_GREEN\";\n COLOR[COLOR[\"BRIGHT_YELLOW\"] = 93] = \"BRIGHT_YELLOW\";\n COLOR[COLOR[\"BRIGHT_BLUE\"] = 94] = \"BRIGHT_BLUE\";\n COLOR[COLOR[\"BRIGHT_MAGENTA\"] = 95] = \"BRIGHT_MAGENTA\";\n COLOR[COLOR[\"BRIGHT_CYAN\"] = 96] = \"BRIGHT_CYAN\";\n COLOR[COLOR[\"BRIGHT_WHITE\"] = 97] = \"BRIGHT_WHITE\";\n})(COLOR || (COLOR = {}));\nconst BACKGROUND_INCREMENT = 10;\nfunction getColor(color) {\n if (typeof color !== 'string') {\n return color;\n }\n color = color.toUpperCase();\n return COLOR[color] || COLOR.WHITE;\n}\nexport function addColor(string, color, background) {\n if (!isBrowser && typeof string === 'string') {\n if (color) {\n const colorCode = getColor(color);\n string = `\\u001b[${colorCode}m${string}\\u001b[39m`;\n }\n if (background) {\n // background colors values are +10\n const colorCode = getColor(background);\n string = `\\u001b[${colorCode + BACKGROUND_INCREMENT}m${string}\\u001b[49m`;\n }\n }\n return string;\n}\n//# sourceMappingURL=color.js.map","// Copyright (c) 2015 - 2017 Uber Technologies, Inc.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n/**\n * Binds the \"this\" argument of all functions on a class instance to the instance\n * @param obj - class instance (typically a react component)\n */\nexport function autobind(obj, predefined = ['constructor']) {\n const proto = Object.getPrototypeOf(obj);\n const propNames = Object.getOwnPropertyNames(proto);\n const object = obj;\n for (const key of propNames) {\n const value = object[key];\n if (typeof value === 'function') {\n if (!predefined.find((name) => key === name)) {\n object[key] = value.bind(obj);\n }\n }\n }\n}\n//# sourceMappingURL=autobind.js.map","export default function assert(condition, message) {\n if (!condition) {\n throw new Error(message || 'Assertion failed');\n }\n}\n//# sourceMappingURL=assert.js.map","// probe.gl, MIT license\nimport { window, process, isBrowser } from '@probe.gl/env';\n/** Get best timer available. */\nexport function getHiResTimestamp() {\n let timestamp;\n if (isBrowser() && window.performance) {\n timestamp = window?.performance?.now?.();\n }\n else if ('hrtime' in process) {\n // @ts-ignore\n const timeParts = process?.hrtime?.();\n timestamp = timeParts[0] * 1000 + timeParts[1] / 1e6;\n }\n else {\n timestamp = Date.now();\n }\n return timestamp;\n}\n//# sourceMappingURL=hi-res-timestamp.js.map","// probe.gl, MIT license\n/* eslint-disable no-console,prefer-rest-params */\nimport { VERSION, isBrowser } from '@probe.gl/env';\nimport { LocalStorage } from \"./utils/local-storage.js\";\nimport { formatTime, leftPad } from \"./utils/formatters.js\";\nimport { addColor } from \"./utils/color.js\";\nimport { autobind } from \"./utils/autobind.js\";\nimport assert from \"./utils/assert.js\";\nimport { getHiResTimestamp } from \"./utils/hi-res-timestamp.js\";\n// Instrumentation in other packages may override console methods, so preserve them here\nconst originalConsole = {\n debug: isBrowser() ? console.debug || console.log : console.log,\n log: console.log,\n info: console.info,\n warn: console.warn,\n error: console.error\n};\nconst DEFAULT_LOG_CONFIGURATION = {\n enabled: true,\n level: 0\n};\nfunction noop() { } // eslint-disable-line @typescript-eslint/no-empty-function\nconst cache = {};\nconst ONCE = { once: true };\n/** A console wrapper */\nexport class Log {\n constructor({ id } = { id: '' }) {\n this.VERSION = VERSION;\n this._startTs = getHiResTimestamp();\n this._deltaTs = getHiResTimestamp();\n this.userData = {};\n // TODO - fix support from throttling groups\n this.LOG_THROTTLE_TIMEOUT = 0; // Time before throttled messages are logged again\n this.id = id;\n this.userData = {};\n this._storage = new LocalStorage(`__probe-${this.id}__`, DEFAULT_LOG_CONFIGURATION);\n this.timeStamp(`${this.id} started`);\n autobind(this);\n Object.seal(this);\n }\n set level(newLevel) {\n this.setLevel(newLevel);\n }\n get level() {\n return this.getLevel();\n }\n isEnabled() {\n return this._storage.config.enabled;\n }\n getLevel() {\n return this._storage.config.level;\n }\n /** @return milliseconds, with fractions */\n getTotal() {\n return Number((getHiResTimestamp() - this._startTs).toPrecision(10));\n }\n /** @return milliseconds, with fractions */\n getDelta() {\n return Number((getHiResTimestamp() - this._deltaTs).toPrecision(10));\n }\n /** @deprecated use logLevel */\n set priority(newPriority) {\n this.level = newPriority;\n }\n /** @deprecated use logLevel */\n get priority() {\n return this.level;\n }\n /** @deprecated use logLevel */\n getPriority() {\n return this.level;\n }\n // Configure\n enable(enabled = true) {\n this._storage.setConfiguration({ enabled });\n return this;\n }\n setLevel(level) {\n this._storage.setConfiguration({ level });\n return this;\n }\n /** return the current status of the setting */\n get(setting) {\n return this._storage.config[setting];\n }\n // update the status of the setting\n set(setting, value) {\n this._storage.setConfiguration({ [setting]: value });\n }\n /** Logs the current settings as a table */\n settings() {\n if (console.table) {\n console.table(this._storage.config);\n }\n else {\n console.log(this._storage.config);\n }\n }\n // Unconditional logging\n assert(condition, message) {\n if (!condition) {\n throw new Error(message || 'Assertion failed');\n }\n }\n warn(message) {\n return this._getLogFunction(0, message, originalConsole.warn, arguments, ONCE);\n }\n error(message) {\n return this._getLogFunction(0, message, originalConsole.error, arguments);\n }\n /** Print a deprecation warning */\n deprecated(oldUsage, newUsage) {\n return this.warn(`\\`${oldUsage}\\` is deprecated and will be removed \\\nin a later version. Use \\`${newUsage}\\` instead`);\n }\n /** Print a removal warning */\n removed(oldUsage, newUsage) {\n return this.error(`\\`${oldUsage}\\` has been removed. Use \\`${newUsage}\\` instead`);\n }\n probe(logLevel, message) {\n return this._getLogFunction(logLevel, message, originalConsole.log, arguments, {\n time: true,\n once: true\n });\n }\n log(logLevel, message) {\n return this._getLogFunction(logLevel, message, originalConsole.debug, arguments);\n }\n info(logLevel, message) {\n return this._getLogFunction(logLevel, message, console.info, arguments);\n }\n once(logLevel, message) {\n return this._getLogFunction(logLevel, message, originalConsole.debug || originalConsole.info, arguments, ONCE);\n }\n /** Logs an object as a table */\n table(logLevel, table, columns) {\n if (table) {\n return this._getLogFunction(logLevel, table, console.table || noop, (columns && [columns]), {\n tag: getTableHeader(table)\n });\n }\n return noop;\n }\n time(logLevel, message) {\n return this._getLogFunction(logLevel, message, console.time ? console.time : console.info);\n }\n timeEnd(logLevel, message) {\n return this._getLogFunction(logLevel, message, console.timeEnd ? console.timeEnd : console.info);\n }\n timeStamp(logLevel, message) {\n return this._getLogFunction(logLevel, message, console.timeStamp || noop);\n }\n group(logLevel, message, opts = { collapsed: false }) {\n const options = normalizeArguments({ logLevel, message, opts });\n const { collapsed } = opts;\n // @ts-expect-error\n options.method = (collapsed ? console.groupCollapsed : console.group) || console.info;\n return this._getLogFunction(options);\n }\n groupCollapsed(logLevel, message, opts = {}) {\n return this.group(logLevel, message, Object.assign({}, opts, { collapsed: true }));\n }\n groupEnd(logLevel) {\n return this._getLogFunction(logLevel, '', console.groupEnd || noop);\n }\n // EXPERIMENTAL\n withGroup(logLevel, message, func) {\n this.group(logLevel, message)();\n try {\n func();\n }\n finally {\n this.groupEnd(logLevel)();\n }\n }\n trace() {\n if (console.trace) {\n console.trace();\n }\n }\n // PRIVATE METHODS\n /** Deduces log level from a variety of arguments */\n _shouldLog(logLevel) {\n return this.isEnabled() && this.getLevel() >= normalizeLogLevel(logLevel);\n }\n _getLogFunction(logLevel, message, method, args, opts) {\n if (this._shouldLog(logLevel)) {\n // normalized opts + timings\n opts = normalizeArguments({ logLevel, message, args, opts });\n method = method || opts.method;\n assert(method);\n opts.total = this.getTotal();\n opts.delta = this.getDelta();\n // reset delta timer\n this._deltaTs = getHiResTimestamp();\n const tag = opts.tag || opts.message;\n if (opts.once && tag) {\n if (!cache[tag]) {\n cache[tag] = getHiResTimestamp();\n }\n else {\n return noop;\n }\n }\n // TODO - Make throttling work with groups\n // if (opts.nothrottle || !throttle(tag, this.LOG_THROTTLE_TIMEOUT)) {\n // return noop;\n // }\n message = decorateMessage(this.id, opts.message, opts);\n // Bind console function so that it can be called after being returned\n return method.bind(console, message, ...opts.args);\n }\n return noop;\n }\n}\nLog.VERSION = VERSION;\n/**\n * Get logLevel from first argument:\n * - log(logLevel, message, args) => logLevel\n * - log(message, args) => 0\n * - log({logLevel, ...}, message, args) => logLevel\n * - log({logLevel, message, args}) => logLevel\n */\nfunction normalizeLogLevel(logLevel) {\n if (!logLevel) {\n return 0;\n }\n let resolvedLevel;\n switch (typeof logLevel) {\n case 'number':\n resolvedLevel = logLevel;\n break;\n case 'object':\n // Backward compatibility\n // TODO - deprecate `priority`\n // @ts-expect-error\n resolvedLevel = logLevel.logLevel || logLevel.priority || 0;\n break;\n default:\n return 0;\n }\n // 'log level must be a number'\n assert(Number.isFinite(resolvedLevel) && resolvedLevel >= 0);\n return resolvedLevel;\n}\n/**\n * \"Normalizes\" the various argument patterns into an object with known types\n * - log(logLevel, message, args) => {logLevel, message, args}\n * - log(message, args) => {logLevel: 0, message, args}\n * - log({logLevel, ...}, message, args) => {logLevel, message, args}\n * - log({logLevel, message, args}) => {logLevel, message, args}\n */\nexport function normalizeArguments(opts) {\n const { logLevel, message } = opts;\n opts.logLevel = normalizeLogLevel(logLevel);\n // We use `arguments` instead of rest parameters (...args) because IE\n // does not support the syntax. Rest parameters is transpiled to code with\n // perf impact. Doing it here instead avoids constructing args when logging is\n // disabled.\n // TODO - remove when/if IE support is dropped\n const args = opts.args ? Array.from(opts.args) : [];\n // args should only contain arguments that appear after `message`\n // eslint-disable-next-line no-empty\n while (args.length && args.shift() !== message) { }\n switch (typeof logLevel) {\n case 'string':\n case 'function':\n if (message !== undefined) {\n args.unshift(message);\n }\n opts.message = logLevel;\n break;\n case 'object':\n Object.assign(opts, logLevel);\n break;\n default:\n }\n // Resolve functions into strings by calling them\n if (typeof opts.message === 'function') {\n opts.message = opts.message();\n }\n const messageType = typeof opts.message;\n // 'log message must be a string' or object\n assert(messageType === 'string' || messageType === 'object');\n // original opts + normalized opts + opts arg + fixed up message\n return Object.assign(opts, { args }, opts.opts);\n}\nfunction decorateMessage(id, message, opts) {\n if (typeof message === 'string') {\n const time = opts.time ? leftPad(formatTime(opts.total)) : '';\n message = opts.time ? `${id}: ${time} ${message}` : `${id}: ${message}`;\n message = addColor(message, opts.color, opts.background);\n }\n return message;\n}\nfunction getTableHeader(table) {\n for (const key in table) {\n for (const title in table[key]) {\n return title || 'untitled';\n }\n }\n return 'empty';\n}\n//# sourceMappingURL=log.js.map","// deck.gl\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\nimport { Log } from '@probe.gl/log';\nconst defaultLogger = new Log({ id: 'deck' });\nexport default defaultLogger;\n//# sourceMappingURL=log.js.map","// luma.gl\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\nimport { Log } from '@probe.gl/log';\n/** Global log instance */\nexport const log = new Log({ id: 'luma.gl' });\n//# sourceMappingURL=log.js.map","// luma.gl\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\nconst uidCounters = {};\n/**\n * Returns a UID.\n * @param id= - Identifier base name\n * @return uid\n **/\nexport function uid(id = 'id') {\n uidCounters[id] = uidCounters[id] || 1;\n const count = uidCounters[id]++;\n return `${id}-${count}`;\n}\n//# sourceMappingURL=uid.js.map","// luma.gl\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\nimport { uid } from \"../../utils/uid.js\";\n/**\n * Base class for GPU (WebGPU/WebGL) Resources\n */\nexport class Resource {\n /** Default properties for resource */\n static defaultProps = {\n id: 'undefined',\n handle: undefined,\n userData: undefined\n };\n toString() {\n return `${this[Symbol.toStringTag] || this.constructor.name}:\"${this.id}\"`;\n }\n /** props.id, for debugging. */\n id;\n props;\n userData = {};\n _device;\n /** Whether this resource has been destroyed */\n destroyed = false;\n /** For resources that allocate GPU memory */\n allocatedBytes = 0;\n /** Attached resources will be destroyed when this resource is destroyed. Tracks auto-created \"sub\" resources. */\n _attachedResources = new Set();\n /**\n * Create a new Resource. Called from Subclass\n */\n constructor(device, props, defaultProps) {\n if (!device) {\n throw new Error('no device');\n }\n this._device = device;\n this.props = selectivelyMerge(props, defaultProps);\n const id = this.props.id !== 'undefined' ? this.props.id : uid(this[Symbol.toStringTag]);\n this.props.id = id;\n this.id = id;\n this.userData = this.props.userData || {};\n this.addStats();\n }\n /**\n * destroy can be called on any resource to release it before it is garbage collected.\n */\n destroy() {\n this.destroyResource();\n }\n /** @deprecated Use destroy() */\n delete() {\n this.destroy();\n return this;\n }\n /**\n * Combines a map of user props and default props, only including props from defaultProps\n * @returns returns a map of overridden default props\n */\n getProps() {\n return this.props;\n }\n // ATTACHED RESOURCES\n /**\n * Attaches a resource. Attached resources are auto destroyed when this resource is destroyed\n * Called automatically when sub resources are auto created but can be called by application\n */\n attachResource(resource) {\n this._attachedResources.add(resource);\n }\n /**\n * Detach an attached resource. The resource will no longer be auto-destroyed when this resource is destroyed.\n */\n detachResource(resource) {\n this._attachedResources.delete(resource);\n }\n /**\n * Destroys a resource (only if owned), and removes from the owned (auto-destroy) list for this resource.\n */\n destroyAttachedResource(resource) {\n if (this._attachedResources.delete(resource)) {\n resource.destroy();\n }\n }\n /** Destroy all owned resources. Make sure the resources are no longer needed before calling. */\n destroyAttachedResources() {\n for (const resource of Object.values(this._attachedResources)) {\n resource.destroy();\n }\n // don't remove while we are iterating\n this._attachedResources = new Set();\n }\n // PROTECTED METHODS\n /** Perform all destroy steps. Can be called by derived resources when overriding destroy() */\n destroyResource() {\n this.destroyAttachedResources();\n this.removeStats();\n this.destroyed = true;\n }\n /** Called by .destroy() to track object destruction. Subclass must call if overriding destroy() */\n removeStats() {\n const stats = this._device.statsManager.getStats('Resource Counts');\n const name = this[Symbol.toStringTag];\n stats.get(`${name}s Active`).decrementCount();\n }\n /** Called by subclass to track memory allocations */\n trackAllocatedMemory(bytes, name = this[Symbol.toStringTag]) {\n const stats = this._device.statsManager.getStats('Resource Counts');\n stats.get('GPU Memory').addCount(bytes);\n stats.get(`${name} Memory`).addCount(bytes);\n this.allocatedBytes = bytes;\n }\n /** Called by subclass to track memory deallocations */\n trackDeallocatedMemory(name = this[Symbol.toStringTag]) {\n const stats = this._device.statsManager.getStats('Resource Counts');\n stats.get('GPU Memory').subtractCount(this.allocatedBytes);\n stats.get(`${name} Memory`).subtractCount(this.allocatedBytes);\n this.allocatedBytes = 0;\n }\n /** Called by resource constructor to track object creation */\n addStats() {\n const stats = this._device.statsManager.getStats('Resource Counts');\n const name = this[Symbol.toStringTag];\n stats.get('Resources Created').incrementCount();\n stats.get(`${name}s Created`).incrementCount();\n stats.get(`${name}s Active`).incrementCount();\n }\n}\n/**\n * Combines a map of user props and default props, only including props from defaultProps\n * @param props\n * @param defaultProps\n * @returns returns a map of overridden default props\n */\nfunction selectivelyMerge(props, defaultProps) {\n const mergedProps = { ...defaultProps };\n for (const key in props) {\n if (props[key] !== undefined) {\n mergedProps[key] = props[key];\n }\n }\n return mergedProps;\n}\n//# sourceMappingURL=resource.js.map","// luma.gl\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\nimport { Resource } from \"./resource.js\";\n/** Abstract GPU buffer */\nexport class Buffer extends Resource {\n /** Index buffer */\n static INDEX = 0x0010;\n /** Vertex buffer */\n static VERTEX = 0x0020;\n /** Uniform buffer */\n static UNIFORM = 0x0040;\n /** Storage buffer */\n static STORAGE = 0x0080;\n static INDIRECT = 0x0100;\n static QUERY_RESOLVE = 0x0200;\n // Usage Flags\n static MAP_READ = 0x01;\n static MAP_WRITE = 0x02;\n static COPY_SRC = 0x0004;\n static COPY_DST = 0x0008;\n get [Symbol.toStringTag]() {\n return 'Buffer';\n }\n /** The usage with which this buffer was created */\n usage;\n /** For index buffers, whether indices are 8, 16 or 32 bit. Note: uint8 indices are automatically converted to uint16 for WebGPU compatibility */\n indexType;\n /** \"Time\" of last update, can be used to check if redraw is needed */\n updateTimestamp;\n constructor(device, props) {\n const deducedProps = { ...props };\n // Deduce indexType\n if ((props.usage || 0) & Buffer.INDEX && !props.indexType) {\n if (props.data instanceof Uint32Array) {\n deducedProps.indexType = 'uint32';\n }\n else if (props.data instanceof Uint16Array) {\n deducedProps.indexType = 'uint16';\n }\n else if (props.data instanceof Uint8Array) {\n deducedProps.indexType = 'uint8';\n }\n }\n // Remove data from props before storing, we don't want to hold on to a big chunk of memory\n delete deducedProps.data;\n super(device, deducedProps, Buffer.defaultProps);\n this.usage = deducedProps.usage || 0;\n this.indexType = deducedProps.indexType;\n // TODO - perhaps this should be set on async write completion?\n this.updateTimestamp = device.incrementTimestamp();\n }\n /**\n * Create a copy of this Buffer with new byteLength, with same props but of the specified size.\n * @note Does not copy contents of the cloned Buffer.\n */\n clone(props) {\n return this.device.createBuffer({ ...this.props, ...props });\n }\n // PROTECTED METHODS (INTENDED FOR USE BY OTHER FRAMEWORK CODE ONLY)\n /** Max amount of debug data saved. Two vec4's */\n static DEBUG_DATA_MAX_LENGTH = 32;\n /** A partial CPU-side copy of the data in this buffer, for debugging purposes */\n debugData = new ArrayBuffer(0);\n /** This doesn't handle partial non-zero offset updates correctly */\n _setDebugData(data, byteOffset, byteLength) {\n const arrayBuffer = ArrayBuffer.isView(data) ? data.buffer : data;\n const debugDataLength = Math.min(data ? data.byteLength : byteLength, Buffer.DEBUG_DATA_MAX_LENGTH);\n if (arrayBuffer === null) {\n this.debugData = new ArrayBuffer(debugDataLength);\n }\n else if (byteOffset === 0 && byteLength === arrayBuffer.byteLength) {\n this.debugData = arrayBuffer.slice(0, debugDataLength);\n }\n else {\n this.debugData = arrayBuffer.slice(byteOffset, byteOffset + debugDataLength);\n }\n }\n static defaultProps = {\n ...Resource.defaultProps,\n usage: 0, // Buffer.COPY_DST | Buffer.COPY_SRC\n byteLength: 0,\n byteOffset: 0,\n data: null,\n indexType: 'uint16',\n onMapped: undefined\n };\n}\n//# sourceMappingURL=buffer.js.map","// luma.gl\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\n/**\n * Gets info about a data type constant (signed or normalized)\n * @returns underlying primitive / signed types, byte length, normalization, integer, signed flags\n */\nexport function getDataTypeInfo(type) {\n const [signedType, primitiveType, byteLength] = NORMALIZED_TYPE_MAP[type];\n const normalized = type.includes('norm');\n const integer = !normalized && !type.startsWith('float');\n const signed = type.startsWith('s');\n return {\n signedType,\n primitiveType,\n byteLength,\n normalized,\n integer,\n signed\n };\n}\n/** Build a vertex format from a signed data type and a component */\nexport function getNormalizedDataType(signedDataType) {\n const dataType = signedDataType;\n // prettier-ignore\n switch (dataType) {\n case 'uint8': return 'unorm8';\n case 'sint8': return 'snorm8';\n case 'uint16': return 'unorm16';\n case 'sint16': return 'snorm16';\n default: return dataType;\n }\n}\n/** Align offset to 1, 2 or 4 elements (4, 8 or 16 bytes) */\nexport function alignTo(size, count) {\n // prettier-ignore\n switch (count) {\n case 1: return size; // Pad upwards to even multiple of 2\n case 2: return size + (size % 2); // Pad upwards to even multiple of 2\n default: return size + ((4 - (size % 4)) % 4); // Pad upwards to even multiple of 4\n }\n}\n/** Returns the VariableShaderType that corresponds to a typed array */\nexport function getDataType(arrayOrType) {\n const Constructor = ArrayBuffer.isView(arrayOrType) ? arrayOrType.constructor : arrayOrType;\n if (Constructor === Uint8ClampedArray) {\n return 'uint8';\n }\n const info = Object.values(NORMALIZED_TYPE_MAP).find(entry => Constructor === entry[4]);\n if (!info) {\n throw new Error(Constructor.name);\n }\n return info[0];\n}\n/** Returns the TypedArray that corresponds to a shader data type */\nexport function getTypedArrayConstructor(type) {\n const [, , , , Constructor] = NORMALIZED_TYPE_MAP[type];\n return Constructor;\n}\nconst NORMALIZED_TYPE_MAP = {\n uint8: ['uint8', 'u32', 1, false, Uint8Array],\n sint8: ['sint8', 'i32', 1, false, Int8Array],\n unorm8: ['uint8', 'f32', 1, true, Uint8Array],\n snorm8: ['sint8', 'f32', 1, true, Int8Array],\n uint16: ['uint16', 'u32', 2, false, Uint16Array],\n sint16: ['sint16', 'i32', 2, false, Int16Array],\n unorm16: ['uint16', 'u32', 2, true, Uint16Array],\n snorm16: ['sint16', 'i32', 2, true, Int16Array],\n float16: ['float16', 'f16', 2, false, Uint16Array],\n float32: ['float32', 'f32', 4, false, Float32Array],\n uint32: ['uint32', 'u32', 4, false, Uint32Array],\n sint32: ['sint32', 'i32', 4, false, Int32Array]\n};\n//# sourceMappingURL=decode-data-types.js.map","// luma.gl\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\nimport { getDataTypeInfo, getDataType, getNormalizedDataType } from \"../data-types/decode-data-types.js\";\n/**\n * Decodes a vertex format, returning type, components, byte length and flags (integer, signed, normalized)\n */\nexport function getVertexFormatInfo(format) {\n // Strip the -webgl ending if present\n let webglOnly;\n if (format.endsWith('-webgl')) {\n format.replace('-webgl', '');\n webglOnly = true;\n }\n // split components from type\n const [type_, count] = format.split('x');\n const type = type_;\n const components = (count ? parseInt(count) : 1);\n // decode the type\n const decodedType = getDataTypeInfo(type);\n const result = {\n type,\n components,\n byteLength: decodedType.byteLength * components,\n integer: decodedType.integer,\n signed: decodedType.signed,\n normalized: decodedType.normalized\n };\n if (webglOnly) {\n result.webglOnly = true;\n }\n return result;\n}\n/** Build a vertex format from a signed data type and a component */\nexport function makeVertexFormat(signedDataType, components, normalized) {\n const dataType = normalized\n ? getNormalizedDataType(signedDataType)\n : signedDataType;\n switch (dataType) {\n // TODO - Special cases for WebGL (not supported on WebGPU), overrides the check below\n case 'unorm8':\n if (components === 1) {\n return 'unorm8';\n }\n if (components === 3) {\n return 'unorm8x3-webgl';\n }\n return `${dataType}x${components}`;\n case 'snorm8':\n case 'uint8':\n case 'sint8':\n // WebGPU 8 bit formats must be aligned to 16 bit boundaries');\n // fall through\n case 'uint16':\n case 'sint16':\n case 'unorm16':\n case 'snorm16':\n case 'float16':\n // WebGPU 16 bit formats must be aligned to 32 bit boundaries\n if (components === 1 || components === 3) {\n throw new Error(`size: ${components}`);\n }\n return `${dataType}x${components}`;\n default:\n return components === 1 ? dataType : `${dataType}x${components}`;\n }\n}\n/** Get the vertex format for an attribute with TypedArray and size */\nexport function getVertexFormatFromAttribute(typedArray, size, normalized) {\n if (!size || size > 4) {\n throw new Error(`size ${size}`);\n }\n const components = size;\n const signedDataType = getDataType(typedArray);\n return makeVertexFormat(signedDataType, components, normalized);\n}\n/** Return a \"default\" vertex format for a certain shader data type\n The simplest vertex format that matches the shader attribute's data type */\nexport function getCompatibleVertexFormat(opts) {\n let vertexType;\n switch (opts.primitiveType) {\n case 'f32':\n vertexType = 'float32';\n break;\n case 'i32':\n vertexType = 'sint32';\n break;\n case 'u32':\n vertexType = 'uint32';\n break;\n case 'f16':\n return opts.components <= 2 ? 'float16x2' : 'float16x4';\n }\n // TODO logic does not work for float16\n if (opts.components === 1) {\n return vertexType;\n }\n return `${vertexType}x${opts.components}`;\n}\n//# sourceMappingURL=decode-vertex-format.js.map","// math.gl\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\nconst RADIANS_TO_DEGREES = (1 / Math.PI) * 180;\nconst DEGREES_TO_RADIANS = (1 / 180) * Math.PI;\nconst DEFAULT_CONFIG = {\n EPSILON: 1e-12,\n debug: false,\n precision: 4,\n printTypes: false,\n printDegrees: false,\n printRowMajor: true,\n _cartographicRadians: false\n};\n// Configuration is truly global as of v3.6 to ensure single config even if multiple copies of math.gl\n// Multiple copies of config can be quite tricky to debug...\nglobalThis.mathgl = globalThis.mathgl || { config: { ...DEFAULT_CONFIG } };\nexport const config = globalThis.mathgl.config;\nexport function configure(options) {\n // Only copy existing keys\n Object.assign(config, options);\n return config;\n}\n/**\n * Formats a value into a string\n * @param value\n * @param param1\n * @returns\n */\nexport function formatValue(value, { precision = config.precision } = {}) {\n value = round(value);\n // get rid of trailing zeros\n return `${parseFloat(value.toPrecision(precision))}`;\n}\n/**\n * Check if value is an \"array\"\n * Returns `true` if value is either an array or a typed array\n * Note: returns `false` for `ArrayBuffer` and `DataView` instances\n * @note isTypedArray and isNumericArray are often more useful in TypeScript\n */\nexport function isArray(value) {\n return Array.isArray(value) || (ArrayBuffer.isView(value) && !(value instanceof DataView));\n}\nexport function clone(array) {\n return 'clone' in array ? array.clone() : array.slice();\n}\nexport function toRadians(degrees) {\n return radians(degrees);\n}\nexport function toDegrees(radians) {\n return degrees(radians);\n}\nexport function radians(degrees, result) {\n return map(degrees, (degrees) => degrees * DEGREES_TO_RADIANS, result);\n}\nexport function degrees(radians, result) {\n return map(radians, (radians) => radians * RADIANS_TO_DEGREES, result);\n}\n/**\n * \"GLSL equivalent\" of `Math.sin`: Works on single values and vectors\n * @deprecated\n */\nexport function sin(radians, result) {\n return map(radians, (angle) => Math.sin(angle), result);\n}\n/**\n * \"GLSL equivalent\" of `Math.cos`: Works on single values and vectors\n * @deprecated\n */\nexport function cos(radians, result) {\n return map(radians, (angle) => Math.cos(angle), result);\n}\n/**\n * \"GLSL equivalent\" of `Math.tan`: Works on single values and vectors\n * @deprecated\n */\nexport function tan(radians, result) {\n return map(radians, (angle) => Math.tan(angle), result);\n}\n/**\n * \"GLSL equivalent\" of `Math.asin`: Works on single values and vectors\n * @deprecated\n */\nexport function asin(radians, result) {\n return map(radians, (angle) => Math.asin(angle), result);\n}\n/**\n * \"GLSL equivalent\" of `Math.acos`: Works on single values and vectors\n * @deprecated\n */\nexport function acos(radians, result) {\n return map(radians, (angle) => Math.acos(angle), result);\n}\n/**\n * \"GLSL equivalent\" of `Math.atan`: Works on single values and vectors\n * @deprecated\n */\nexport function atan(radians, result) {\n return map(radians, (angle) => Math.atan(angle), result);\n}\nexport function clamp(value, min, max) {\n return map(value, (value) => Math.max(min, Math.min(max, value)));\n}\nexport function lerp(a, b, t) {\n if (isArray(a)) {\n return a.map((ai, i) => lerp(ai, b[i], t));\n }\n return t * b + (1 - t) * a;\n}\n/* eslint-disable */\n/**\n * Compares any two math objects, using `equals` method if available.\n * @param a\n * @param b\n * @param epsilon\n * @returns\n */\nexport function equals(a, b, epsilon) {\n const oldEpsilon = config.EPSILON;\n if (epsilon) {\n config.EPSILON = epsilon;\n }\n try {\n if (a === b) {\n return true;\n }\n if (isArray(a) && isArray(b)) {\n if (a.length !== b.length) {\n return false;\n }\n for (let i = 0; i < a.length; ++i) {\n // eslint-disable-next-line max-depth\n if (!equals(a[i], b[i])) {\n return false;\n }\n }\n return true;\n }\n if (a && a.equals) {\n return a.equals(b);\n }\n if (b && b.equals) {\n return b.equals(a);\n }\n if (typeof a === 'number' && typeof b === 'number') {\n return Math.abs(a - b) <= config.EPSILON * Math.max(1, Math.abs(a), Math.abs(b));\n }\n return false;\n }\n finally {\n config.EPSILON = oldEpsilon;\n }\n}\nexport function exactEquals(a, b) {\n if (a === b) {\n return true;\n }\n if (a && typeof a === 'object' && b && typeof b === 'object') {\n if (a.constructor !== b.constructor) {\n return false;\n }\n if (a.exactEquals) {\n return a.exactEquals(b);\n }\n }\n if (isArray(a) && isArray(b)) {\n if (a.length !== b.length) {\n return false;\n }\n for (let i = 0; i < a.length; ++i) {\n if (!exactEquals(a[i], b[i])) {\n return false;\n }\n }\n return true;\n }\n return false;\n}\n/* eslint-enable */\nexport function withEpsilon(epsilon, func) {\n const oldPrecision = config.EPSILON;\n config.EPSILON = epsilon;\n let value;\n try {\n value = func();\n }\n finally {\n config.EPSILON = oldPrecision;\n }\n return value;\n}\n// HELPERS\nfunction round(value) {\n return Math.round(value / config.EPSILON) * config.EPSILON;\n}\n// If the array has a clone function, calls it, otherwise returns a copy\nfunction duplicateArray(array) {\n // @ts-expect-error We check for math.gl class methods\n // eslint-disable-next-line @typescript-eslint/no-unsafe-call\n return array.clone ? array.clone() : new Array(array.length);\n}\n// If the argument value is an array, applies the func element wise,\n// otherwise applies func to the argument value\nfunction map(value, func, result) {\n if (isArray(value)) {\n const array = value;\n result = result || duplicateArray(array);\n for (let i = 0; i < result.length && i < array.length; ++i) {\n const val = typeof value === 'number' ? value : value[i];\n result[i] = func(val, i, result);\n }\n return result;\n }\n return func(value);\n}\n//# sourceMappingURL=common.js.map","// math.gl\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\nimport { config, formatValue, equals, isArray } from \"../../lib/common.js\";\n/** Base class for vectors and matrices */\nexport class MathArray extends Array {\n // Common methods\n /**\n * Clone the current object\n * @returns a new copy of this object\n */\n clone() {\n // @ts-expect-error TS2351: Cannot use 'new' with an expression whose type lacks a call or construct signature.\n return new this.constructor().copy(this); // eslint-disable-line\n }\n fromArray(array, offset = 0) {\n for (let i = 0; i < this.ELEMENTS; ++i) {\n this[i] = array[i + offset];\n }\n return this.check();\n }\n toArray(targetArray = [], offset = 0) {\n for (let i = 0; i < this.ELEMENTS; ++i) {\n targetArray[offset + i] = this[i];\n }\n return targetArray;\n }\n toObject(targetObject) {\n return targetObject;\n }\n from(arrayOrObject) {\n return Array.isArray(arrayOrObject)\n ? this.copy(arrayOrObject)\n : // @ts-ignore\n this.fromObject(arrayOrObject);\n }\n to(arrayOrObject) {\n // @ts-ignore\n if (arrayOrObject === this) {\n return this;\n }\n // @ts-expect-error TS2339: Property 'toObject' does not exist on type 'MathArray'.\n return isArray(arrayOrObject) ? this.toArray(arrayOrObject) : this.toObject(arrayOrObject);\n }\n toTarget(target) {\n return target ? this.to(target) : this;\n }\n /** @deprecated */\n toFloat32Array() {\n return new Float32Array(this);\n }\n toString() {\n return this.formatString(config);\n }\n /** Formats string according to options */\n formatString(opts) {\n let string = '';\n for (let i = 0; i < this.ELEMENTS; ++i) {\n string += (i > 0 ? ', ' : '') + formatValue(this[i], opts);\n }\n return `${opts.printTypes ? this.constructor.name : ''}[${string}]`;\n }\n equals(array) {\n if (!array || this.length !== array.length) {\n return false;\n }\n for (let i = 0; i < this.ELEMENTS; ++i) {\n if (!equals(this[i], array[i])) {\n return false;\n }\n }\n return true;\n }\n exactEquals(array) {\n if (!array || this.length !== array.length) {\n return false;\n }\n for (let i = 0; i < this.ELEMENTS; ++i) {\n if (this[i] !== array[i]) {\n return false;\n }\n }\n return true;\n }\n // Modifiers\n /** Negates all values in this object */\n negate() {\n for (let i = 0; i < this.ELEMENTS; ++i) {\n this[i] = -this[i];\n }\n return this.check();\n }\n lerp(a, b, t) {\n if (t === undefined) {\n return this.lerp(this, a, b);\n }\n for (let i = 0; i < this.ELEMENTS; ++i) {\n const ai = a[i];\n const endValue = typeof b === 'number' ? b : b[i];\n this[i] = ai + t * (endValue - ai);\n }\n return this.check();\n }\n /** Minimal */\n min(vector) {\n for (let i = 0; i < this.ELEMENTS; ++i) {\n this[i] = Math.min(vector[i], this[i]);\n }\n return this.check();\n }\n /** Maximal */\n max(vector) {\n for (let i = 0; i < this.ELEMENTS; ++i) {\n this[i] = Math.max(vector[i], this[i]);\n }\n return this.check();\n }\n clamp(minVector, maxVector) {\n for (let i = 0; i < this.ELEMENTS; ++i) {\n this[i] = Math.min(Math.max(this[i], minVector[i]), maxVector[i]);\n }\n return this.check();\n }\n add(...vectors) {\n for (const vector of vectors) {\n for (let i = 0; i < this.ELEMENTS; ++i) {\n this[i] += vector[i];\n }\n }\n return this.check();\n }\n subtract(...vectors) {\n for (const vector of vectors) {\n for (let i = 0; i < this.ELEMENTS; ++i) {\n this[i] -= vector[i];\n }\n }\n return this.check();\n }\n scale(scale) {\n if (typeof scale === 'number') {\n for (let i = 0; i < this.ELEMENTS; ++i) {\n this[i] *= scale;\n }\n }\n else {\n for (let i = 0; i < this.ELEMENTS && i < scale.length; ++i) {\n this[i] *= scale[i];\n }\n }\n return this.check();\n }\n /**\n * Multiplies all elements by `scale`\n * Note: `Matrix4.multiplyByScalar` only scales its 3x3 \"minor\"\n */\n multiplyByScalar(scalar) {\n for (let i = 0; i < this.ELEMENTS; ++i) {\n this[i] *= scalar;\n }\n return this.check();\n }\n // Debug checks\n /** Throws an error if array length is incorrect or contains illegal values */\n check() {\n if (config.debug && !this.validate()) {\n throw new Error(`math.gl: ${this.constructor.name} some fields set to invalid numbers'`);\n }\n return this;\n }\n /** Returns false if the array length is incorrect or contains illegal values */\n validate() {\n let valid = this.length === this.ELEMENTS;\n for (let i = 0; i < this.ELEMENTS; ++i) {\n valid = valid && Number.isFinite(this[i]);\n }\n return valid;\n }\n // three.js compatibility\n /** @deprecated */\n sub(a) {\n return this.subtract(a);\n }\n /** @deprecated */\n setScalar(a) {\n for (let i = 0; i < this.ELEMENTS; ++i) {\n this[i] = a;\n }\n return this.check();\n }\n /** @deprecated */\n addScalar(a) {\n for (let i = 0; i < this.ELEMENTS; ++i) {\n this[i] += a;\n }\n return this.check();\n }\n /** @deprecated */\n subScalar(a) {\n return this.addScalar(-a);\n }\n /** @deprecated */\n multiplyScalar(scalar) {\n // Multiplies all elements\n // `Matrix4.scale` only scales its 3x3 \"minor\"\n for (let i = 0; i < this.ELEMENTS; ++i) {\n this[i] *= scalar;\n }\n return this.check();\n }\n /** @deprecated */\n divideScalar(a) {\n return this.multiplyByScalar(1 / a);\n }\n /** @deprecated */\n clampScalar(min, max) {\n for (let i = 0; i < this.ELEMENTS; ++i) {\n this[i] = Math.min(Math.max(this[i], min), max);\n }\n return this.check();\n }\n /** @deprecated */\n get elements() {\n return this;\n }\n}\n//# sourceMappingURL=math-array.js.map","// math.gl\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\nimport { config } from \"./common.js\";\nexport function validateVector(v, length) {\n if (v.length !== length) {\n return false;\n }\n // Could be arguments \"array\" (v.every not availasble)\n for (let i = 0; i < v.length; ++i) {\n if (!Number.isFinite(v[i])) {\n return false;\n }\n }\n return true;\n}\nexport function checkNumber(value) {\n if (!Number.isFinite(value)) {\n throw new Error(`Invalid number ${JSON.stringify(value)}`);\n }\n return value;\n}\nexport function checkVector(v, length, callerName = '') {\n if (config.debug && !validateVector(v, length)) {\n throw new Error(`math.gl: ${callerName} some fields set to invalid numbers'`);\n }\n return v;\n}\nconst map = {};\nexport function deprecated(method, version) {\n if (!map[method]) {\n map[method] = true;\n // eslint-disable-next-line\n console.warn(`${method} has been removed in version ${version}, see upgrade guide for more information`);\n }\n}\n//# sourceMappingURL=validators.js.map","// math.gl\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\nexport function assert(condition, message) {\n if (!condition) {\n throw new Error(`math.gl assertion ${message}`);\n }\n}\n//# sourceMappingURL=assert.js.map","// math.gl\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\n// Copyright (c) 2017 Uber Technologies, Inc.\nimport { MathArray } from \"./math-array.js\";\nimport { checkNumber } from \"../../lib/validators.js\";\nimport { assert } from \"../../lib/assert.js\";\n/** Base class for vectors with at least 2 elements */\nexport class Vector extends MathArray {\n // ACCESSORS\n get x() {\n return this[0];\n }\n set x(value) {\n this[0] = checkNumber(value);\n }\n get y() {\n return this[1];\n }\n set y(value) {\n this[1] = checkNumber(value);\n }\n /**\n * Returns the length of the vector from the origin to the point described by this vector\n *\n * @note `length` is a reserved word for Arrays, so `v.length()` will return number of elements\n * Instead we provide `len` and `magnitude`\n */\n len() {\n return Math.sqrt(this.lengthSquared());\n }\n /**\n * Returns the length of the vector from the origin to the point described by this vector\n */\n magnitude() {\n return this.len();\n }\n /**\n * Returns the squared length of the vector from the origin to the point described by this vector\n */\n lengthSquared() {\n let length = 0;\n for (let i = 0; i < this.ELEMENTS; ++i) {\n length += this[i] * this[i];\n }\n return length;\n }\n /**\n * Returns the squared length of the vector from the origin to the point described by this vector\n */\n magnitudeSquared() {\n return this.lengthSquared();\n }\n distance(mathArray) {\n return Math.sqrt(this.distanceSquared(mathArray));\n }\n distanceSquared(mathArray) {\n let length = 0;\n for (let i = 0; i < this.ELEMENTS; ++i) {\n const dist = this[i] - mathArray[i];\n length += dist * dist;\n }\n return checkNumber(length);\n }\n dot(mathArray) {\n let product = 0;\n for (let i = 0; i < this.ELEMENTS; ++i) {\n product += this[i] * mathArray[i];\n }\n return checkNumber(product);\n }\n // MODIFIERS\n normalize() {\n const length = this.magnitude();\n if (length !== 0) {\n for (let i = 0; i < this.ELEMENTS; ++i) {\n this[i] /= length;\n }\n }\n return this.check();\n }\n multiply(...vectors) {\n for (const vector of vectors) {\n for (let i = 0; i < this.ELEMENTS; ++i) {\n this[i] *= vector[i];\n }\n }\n return this.check();\n }\n divide(...vectors) {\n for (const vector of vectors) {\n for (let i = 0; i < this.ELEMENTS; ++i) {\n this[i] /= vector[i];\n }\n }\n return this.check();\n }\n // THREE.js compatibility\n lengthSq() {\n return this.lengthSquared();\n }\n distanceTo(vector) {\n return this.distance(vector);\n }\n distanceToSquared(vector) {\n return this.distanceSquared(vector);\n }\n getComponent(i) {\n assert(i >= 0 && i < this.ELEMENTS, 'index is out of range');\n return checkNumber(this[i]);\n }\n setComponent(i, value) {\n assert(i >= 0 && i < this.ELEMENTS, 'index is out of range');\n this[i] = value;\n return this.check();\n }\n addVectors(a, b) {\n return this.copy(a).add(b);\n }\n subVectors(a, b) {\n return this.copy(a).subtract(b);\n }\n multiplyVectors(a, b) {\n return this.copy(a).multiply(b);\n }\n addScaledVector(a, b) {\n // @ts-expect-error error TS2351: Cannot use 'new' with an expression whose type lacks a call or construct signature.\n return this.add(new this.constructor(a).multiplyScalar(b));\n }\n}\n//# sourceMappingURL=vector.js.map","// @eslint-disable\n// @ts-nocheck\n/**\n * Common utilities\n * @module glMatrix\n */\n// Configuration Constants\nexport const EPSILON = 0.000001;\nexport let ARRAY_TYPE = typeof Float32Array !== 'undefined' ? Float32Array : Array;\nexport const RANDOM = Math.random;\nexport const ANGLE_ORDER = 'zyx';\n/**\n * Symmetric round\n * see https://www.npmjs.com/package/round-half-up-symmetric#user-content-detailed-background\n *\n * @param {Number} a value to round\n */\nexport function round(a) {\n if (a >= 0)\n return Math.round(a);\n return a % 0.5 === 0 ? Math.floor(a) : Math.round(a);\n}\n/**\n * Sets the type of array used when creating new vectors and matrices\n *\n * @param {Float32ArrayConstructor | ArrayConstructor} type Array type, such as Float32Array or Array\n */\nexport function setMatrixArrayType(type) {\n ARRAY_TYPE = type;\n}\nconst degree = Math.PI / 180;\n/**\n * Convert Degree To Radian\n *\n * @param {Number} a Angle in Degrees\n */\nexport function toRadian(a) {\n return a * degree;\n}\n/**\n * Tests whether or not the arguments have approximately the same value, within an absolute\n * or relative tolerance of glMatrix.EPSILON (an absolute tolerance is used for values less\n * than or equal to 1.0, and a relative tolerance is used for larger values)\n *\n * @param {Number} a The first number to test.\n * @param {Number} b The second number to test.\n * @returns {Boolean} True if the numbers are approximately equal, false otherwise.\n */\nexport function equals(a, b) {\n return Math.abs(a - b) <= EPSILON * Math.max(1.0, Math.abs(a), Math.abs(b));\n}\n//# sourceMappingURL=common.js.map","// @eslint-disable\n// @ts-nocheck\nimport * as glMatrix from './common.js';\n/**\n * 2 Dimensional Vector\n * @module vec2\n */\n/**\n * Creates a new, empty vec2\n *\n * @returns a new 2D vector\n */\nexport function create() {\n const out = new glMatrix.ARRAY_TYPE(2);\n if (glMatrix.ARRAY_TYPE != Float32Array) {\n out[0] = 0;\n out[1] = 0;\n }\n return out;\n}\n/**\n * Creates a new vec2 initialized with values from an existing vector\n *\n * @param a vector to clone\n * @returns a new 2D vector\n */\nexport function clone(a) {\n const out = new glMatrix.ARRAY_TYPE(2);\n out[0] = a[0];\n out[1] = a[1];\n return out;\n}\n/**\n * Creates a new vec2 initialized with the given values\n *\n * @param x X component\n * @param y Y component\n * @returns a new 2D vector\n */\nexport function fromValues(x, y) {\n const out = new glMatrix.ARRAY_TYPE(2);\n out[0] = x;\n out[1] = y;\n return out;\n}\n/**\n * Copy the values from one vec2 to another\n *\n * @param {NumericArray} out the receiving vector\n * @param {Readonly<NumericArray>} a the source vector\n * @returns {NumericArray} out\n */\nexport function copy(out, a) {\n out[0] = a[0];\n out[1] = a[1];\n return out;\n}\n/**\n * Set the components of a vec2 to the given values\n *\n * @param {NumericArray} out the receiving vector\n * @param {Number} x X component\n * @param {Number} y Y component\n * @returns {NumericArray} out\n */\nexport function set(out, x, y) {\n out[0] = x;\n out[1] = y;\n return out;\n}\n/**\n * Adds two vec2's\n *\n * @param {NumericArray} out the receiving vector\n * @param {Readonly<NumericArray>} a the first operand\n * @param {Readonly<NumericArray>} b the second operand\n * @returns {NumericArray} out\n */\nexport function add(out, a, b) {\n out[0] = a[0] + b[0];\n out[1] = a[1] + b[1];\n return out;\n}\n/**\n * Subtracts vector b from vector a\n *\n * @param {NumericArray} out the receiving vector\n * @param {Readonly<NumericArray>} a the first operand\n * @param {Readonly<NumericArray>} b the second operand\n * @returns {NumericArray} out\n */\nexport function subtract(out, a, b) {\n out[0] = a[0] - b[0];\n out[1] = a[1] - b[1];\n return out;\n}\n/**\n * Multiplies two vec2's\n *\n * @param {NumericArray} out the receiving vector\n * @param {Readonly<NumericArray>} a the first operand\n * @param {Readonly<NumericArray>} b the second operand\n * @returns {NumericArray} out\n */\nexport function multiply(out, a, b) {\n out[0] = a[0] * b[0];\n out[1] = a[1] * b[1];\n return out;\n}\n/**\n * Divides two vec2's\n *\n * @param {NumericArray} out the receiving vector\n * @param {Readonly<NumericArray>} a the first operand\n * @param {Readonly<NumericArray>} b the second operand\n * @returns {NumericArray} out\n */\nexport function divide(out, a, b) {\n out[0] = a[0] / b[0];\n out[1] = a[1] / b[1];\n return out;\n}\n/**\n * Math.ceil the components of a vec2\n *\n * @param {NumericArray} out the receiving vector\n * @param {Readonly<NumericArray>} a vector to ceil\n * @returns {NumericArray} out\n */\nexport function ceil(out, a) {\n out[0] = Math.ceil(a[0]);\n out[1] = Math.ceil(a[1]);\n return out;\n}\n/**\n * Math.floor the components of a vec2\n *\n * @param {NumericArray} out the receiving vector\n * @param {Readonly<NumericArray>} a vector to floor\n * @returns {NumericArray} out\n */\nexport function floor(out, a) {\n out[0] = Math.floor(a[0]);\n out[1] = Math.floor(a[1]);\n return out;\n}\n/**\n * Returns the minimum of two vec2's\n *\n * @param {NumericArray} out the receiving vector\n * @param {Readonly<NumericArray>} a the first operand\n * @param {Readonly<NumericArray>} b the second operand\n * @returns {NumericArray} out\n */\nexport function min(out, a, b) {\n out[0] = Math.min(a[0], b[0]);\n out[1] = Math.min(a[1], b[1]);\n return out;\n}\n/**\n * Returns the maximum of two vec2's\n *\n * @param {NumericArray} out the receiving vector\n * @param {Readonly<NumericArray>} a the first operand\n * @param {Readonly<NumericArray>} b the second operand\n * @returns {NumericArray} out\n */\nexport function max(out, a, b) {\n out[0] = Math.max(a[0], b[0]);\n out[1] = Math.max(a[1], b[1]);\n return out;\n}\n/**\n * symmetric round the components of a vec2\n *\n * @param {NumericArray} out the receiving vector\n * @param {Readonly<NumericArray>} a vector to round\n * @returns {NumericArray} out\n */\nexport function round(out, a) {\n out[0] = glMatrix.round(a[0]);\n out[1] = glMatrix.round(a[1]);\n return out;\n}\n/**\n * Scales a vec2 by a scalar number\n *\n * @param {NumericArray} out the receiving vector\n * @param {Readonly<NumericArray>} a the vector to scale\n * @param {Number} b amount to scale the vector by\n * @returns {NumericArray} out\n */\nexport function scale(out, a, b) {\n out[0] = a[0] * b;\n out[1] = a[1] * b;\n return out;\n}\n/**\n * Adds two vec2's after scaling the second operand by a scalar value\n *\n * @param {NumericArray} out the receiving vector\n * @param {Readonly<NumericArray>} a the first operand\n * @param {Readonly<NumericArray>} b the second operand\n * @param {Number} scale the amount to scale b by before adding\n * @returns {NumericArray} out\n */\nexport function scaleAndAdd(out, a, b, scale) {\n out[0] = a[0] + b[0] * scale;\n out[1] = a[1] + b[1] * scale;\n return out;\n}\n/**\n * Calculates the euclidian distance between two vec2's\n *\n * @param {Readonly<NumericArray>} a the first operand\n * @param {Readonly<NumericArray>} b the second operand\n * @returns {Number} distance between a and b\n */\nexport function distance(a, b) {\n const x = b[0] - a[0];\n const y = b[1] - a[1];\n return Math.sqrt(x * x + y * y);\n}\n/**\n * Calculates the squared euclidian distance between two vec2's\n *\n * @param {Readonly<NumericArray>} a the first operand\n * @param {Readonly<NumericArray>} b the second operand\n * @returns {Number} squared distance between a and b\n */\nexport function squaredDistance(a, b) {\n const x = b[0] - a[0];\n const y = b[1] - a[1];\n return x * x + y * y;\n}\n/**\n * Calculates the length of a vec2\n *\n * @param {Readonly<NumericArray>} a vector to calculate length of\n * @returns {Number} length of a\n */\nexport function length(a) {\n const x = a[0];\n const y = a[1];\n return Math.sqrt(x * x + y * y);\n}\n/**\n * Calculates the squared length of a vec2\n *\n * @param {Readonly<NumericArray>} a vector to calculate squared length of\n * @returns {Number} squared length of a\n */\nexport function squaredLength(a) {\n const x = a[0];\n const y = a[1];\n return x * x + y * y;\n}\n/**\n * Negates the components of a vec2\n *\n * @param {NumericArray} out the receiving vector\n * @param {Readonly<NumericArray>} a vector to negate\n * @returns {NumericArray} out\n */\nexport function negate(out, a) {\n out[0] = -a[0];\n out[1] = -a[1];\n return out;\n}\n/**\n * Returns the inverse of the components of a vec2\n *\n * @param {NumericArray} out the receiving vector\n * @param {Readonly<NumericArray>} a vector to invert\n * @returns {NumericArray} out\n */\nexport function inverse(out, a) {\n out[0] = 1.0 / a[0];\n out[1] = 1.0 / a[1];\n return out;\n}\n/**\n * Normalize a vec2\n *\n * @param {NumericArray} out the receiving vector\n * @param {Readonly<NumericArray>} a vector to normalize\n * @returns {NumericArray} out\n */\nexport function normalize(out, a) {\n const x = a[0];\n const y = a[1];\n let len = x * x + y * y;\n if (len > 0) {\n // TODO: evaluate use of glm_invsqrt here?\n len = 1 / Math.sqrt(len);\n }\n out[0] = a[0] * len;\n out[1] = a[1] * len;\n return out;\n}\n/**\n * Calculates the dot product of two vec2's\n *\n * @param {Readonly<NumericArray>} a the first operand\n * @param {Readonly<NumericArray>} b the second operand\n * @returns {Number} dot product of a and b\n */\nexport function dot(a, b) {\n return a[0] * b[0] + a[1] * b[1];\n}\n/**\n * Computes the cross product of two vec2's\n * Note that the cross product must by definition produce a 3D vector\n *\n * @param {vec3} out the receiving vector\n * @param {Readonly<NumericArray>} a the first operand\n * @param {Readonly<NumericArray>} b the second operand\n * @returns {vec3} out\n */\nexport function cross(out, a, b) {\n const z = a[0] * b[1] - a[1] * b[0];\n out[0] = out[1] = 0;\n out[2] = z;\n return out;\n}\n/**\n * Performs a linear interpolation between two vec2's\n *\n * @param {NumericArray} out the receiving vector\n * @param {Readonly<NumericArray>} a the first operand\n * @param {Readonly<NumericArray>} b the second operand\n * @param {Number} t interpolation amount, in the range [0-1], between the two inputs\n * @returns {NumericArray} out\n */\nexport function lerp(out, a, b, t) {\n const ax = a[0];\n const ay = a[1];\n out[0] = ax + t * (b[0] - ax);\n out[1] = ay + t * (b[1] - ay);\n return out;\n}\n/**\n * Generates a random vector with the given scale\n *\n * @param {NumericArray} out the receiving vector\n * @param {Number} [scale] Length of the resulting vector. If omitted, a unit vector will be returned\n * @returns {NumericArray} out\n */\nexport function random(out, scale) {\n scale = scale === undefined ? 1.0 : scale;\n const r = glMatrix.RANDOM() * 2.0 * Math.PI;\n out[0] = Math.cos(r) * scale;\n out[1] = Math.sin(r) * scale;\n return out;\n}\n/**\n * Transforms the vec2 with a mat2\n *\n * @param {NumericArray} out the receiving vector\n * @param {Readonly<NumericArray>} a the vector to transform\n * @param {ReadonlyMat2} m matrix to transform with\n * @returns {NumericArray} out\n */\nexport function transformMat2(out, a, m) {\n const x = a[0];\n const y = a[1];\n out[0] = m[0] * x + m[2] * y;\n out[1] = m[1] * x + m[3] * y;\n return out;\n}\n/**\n * Transforms the vec2 with a mat2d\n *\n * @param {NumericArray} out the receiving vector\n * @param {Readonly<NumericArray>} a the vector to transform\n * @param {ReadonlyMat2d} m matrix to transform with\n * @returns {NumericArray} out\n */\nexport function transformMat2d(out, a, m) {\n const x = a[0];\n const y = a[1];\n out[0] = m[0] * x + m[2] * y + m[4];\n out[1] = m[1] * x + m[3] * y + m[5];\n return out;\n}\n/**\n * Transforms the vec2 with a mat3\n * 3rd vector component is implicitly '1'\n *\n * @param {NumericArray} out the receiving vector\n * @param {Readonly<NumericArray>} a the vector to transform\n * @param {ReadonlyMat3} m matrix to transform with\n * @returns {NumericArray} out\n */\nexport function transformMat3(out, a, m) {\n const x = a[0];\n const y = a[1];\n out[0] = m[0] * x + m[3] * y + m[6];\n out[1] = m[1] * x + m[4] * y + m[7];\n return out;\n}\n/**\n * Transforms the vec2 with a mat4\n * 3rd vector component is implicitly '0'\n * 4th vector component is implicitly '1'\n *\n * @param {NumericArray} out the receiving vector\n * @param {Readonly<NumericArray>} a the vector to transform\n * @param {ReadonlyMat4} m matrix to transform with\n * @returns {NumericArray} out\n */\nexport function transformMat4(out, a, m) {\n const x = a[0];\n const y = a[1];\n out[0] = m[0] * x + m[4] * y + m[12];\n out[1] = m[1] * x + m[5] * y + m[13];\n return out;\n}\n/**\n * Rotate a 2D vector\n * @param {NumericArray} out The receiving vec2\n * @param {Readonly<NumericArray>} a The vec2 point to rotate\n * @param {Readonly<NumericArray>} b The origin of the rotation\n * @param {Number} rad The angle of rotation in radians\n * @returns {NumericArray} out\n */\nexport function rotate(out, a, b, rad) {\n // Translate point to the origin\n const p0 = a[0] - b[0];\n const p1 = a[1] - b[1];\n const sinC = Math.sin(rad);\n const cosC = Math.cos(rad);\n // perform rotation and translate to correct position\n out[0] = p0 * cosC - p1 * sinC + b[0];\n out[1] = p0 * sinC + p1 * cosC + b[1];\n return out;\n}\n/**\n * Get the angle between two 2D vectors\n * @param {Readonly<NumericArray>} a The first operand\n * @param {Readonly<NumericArray>} b The second operand\n * @returns {Number} The angle in radians\n */\nexport function angle(a, b) {\n const x1 = a[0];\n const y1 = a[1];\n const x2 = b[0];\n const y2 = b[1];\n // mag is the product of the magnitudes of a and b\n const mag = Math.sqrt((x1 * x1 + y1 * y1) * (x2 * x2 + y2 * y2));\n // mag &&.. short circuits if mag == 0\n const cosine = mag && (x1 * x2 + y1 * y2) / mag;\n // Math.min(Math.max(cosine, -1), 1) clamps the cosine between -1 and 1\n return Math.acos(Math.min(Math.max(cosine, -1), 1));\n}\n/**\n * Set the components of a vec2 to zero\n *\n * @param {NumericArray} out the receiving vector\n * @returns {NumericArray} out\n */\nexport function zero(out) {\n out[0] = 0.0;\n out[1] = 0.0;\n return out;\n}\n/**\n * Returns a string representation of a vector\n *\n * @param {Readonly<NumericArray>} a vector to represent as a string\n * @returns {String} string representation of the vector\n */\nexport function str(a) {\n return `vec2(${a[0]}, ${a[1]})`;\n}\n/**\n * Returns whether or not the vectors exactly have the same elements in the same position (when compared with ===)\n *\n * @param {Readonly<NumericArray>} a The first vector.\n * @param {Readonly<NumericArray>} b The second vector.\n * @returns {Boolean} True if the vectors are equal, false otherwise.\n */\nexport function exactEquals(a, b) {\n return a[0] === b[0] && a[1] === b[1];\n}\n/**\n * Returns whether or not the vectors have approximately the same elements in the same position.\n *\n * @param {Readonly<NumericArray>} a The first vector.\n * @param {Readonly<NumericArray>} b The second vector.\n * @returns {Boolean} True if the vectors are equal, false otherwise.\n */\nexport function equals(a, b) {\n const a0 = a[0];\n const a1 = a[1];\n const b0 = b[0];\n const b1 = b[1];\n return (Math.abs(a0 - b0) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a0), Math.abs(b0)) &&\n Math.abs(a1 - b1) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a1), Math.abs(b1)));\n}\n/**\n * Alias for {@link vec2.length}\n * @function\n */\nexport const len = length;\n/**\n * Alias for {@link vec2.subtract}\n * @function\n */\nexport const sub = subtract;\n/**\n * Alias for {@link vec2.multiply}\n * @function\n */\nexport const mul = multiply;\n/**\n * Alias for {@link vec2.divide}\n * @function\n */\nexport const div = divide;\n/**\n * Alias for {@link vec2.distance}\n * @function\n */\nexport const dist = distance;\n/**\n * Alias for {@link vec2.squaredDistance}\n * @function\n */\nexport const sqrDist = squaredDistance;\n/**\n * Alias for {@link vec2.squaredLength}\n * @function\n */\nexport const sqrLen = squaredLength;\n/**\n * Perform some operation over an array of vec2s.\n *\n * @param {Array} a the array of vectors to iterate over\n * @param {Number} stride Number of elements between the start of each vec2. If 0 assumes tightly packed\n * @param {Number} offset Number of elements to skip at the beginning of the array\n * @param {Number} count Number of vec2s to iterate over. If 0 iterates over entire array\n * @param {Function} fn Function to call for each vector in the array\n * @param {Object} [arg] additional argument to pass to fn\n * @returns {Array} a\n * @function\n */\nexport const forEach = (function () {\n const vec = create();\n return function (a, stride, offset, count, fn, arg) {\n let i;\n let l;\n if (!stride) {\n stride = 2;\n }\n if (!offset) {\n offset = 0;\n }\n if (count) {\n l = Math.min(count * stride + offset, a.length);\n }\n else {\n l = a.length;\n }\n for (i = offset; i < l; i += stride) {\n vec[0] = a[i];\n vec[1] = a[i + 1];\n fn(vec, vec, arg);\n a[i] = vec[0];\n a[i + 1] = vec[1];\n }\n return a;\n };\n})();\n//# sourceMappingURL=vec2.js.map","// math.gl\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\n// vec2 additions\nexport function vec2_transformMat4AsVector(out, a, m) {\n const x = a[0];\n const y = a[1];\n const w = m[3] * x + m[7] * y || 1.0;\n out[0] = (m[0] * x + m[4] * y) / w;\n out[1] = (m[1] * x + m[5] * y) / w;\n return out;\n}\n// vec3 additions\n// Transform as vector, only uses 3x3 minor matrix\nexport function vec3_transformMat4AsVector(out, a, m) {\n const x = a[0];\n const y = a[1];\n const z = a[2];\n const w = m[3] * x + m[7] * y + m[11] * z || 1.0;\n out[0] = (m[0] * x + m[4] * y + m[8] * z) / w;\n out[1] = (m[1] * x + m[5] * y + m[9] * z) / w;\n out[2] = (m[2] * x + m[6] * y + m[10] * z) / w;\n return out;\n}\nexport function vec3_transformMat2(out, a, m) {\n const x = a[0];\n const y = a[1];\n out[0] = m[0] * x + m[2] * y;\n out[1] = m[1] * x + m[3] * y;\n out[2] = a[2];\n return out;\n}\n// vec4 additions\nexport function vec4_transformMat2(out, a, m) {\n const x = a[0];\n const y = a[1];\n out[0] = m[0] * x + m[2] * y;\n out[1] = m[1] * x + m[3] * y;\n out[2] = a[2];\n out[3] = a[3];\n return out;\n}\nexport function vec4_transformMat3(out, a, m) {\n const x = a[0];\n const y = a[1];\n const z = a[2];\n out[0] = m[0] * x + m[3] * y + m[6] * z;\n out[1] = m[1] * x + m[4] * y + m[7] * z;\n out[2] = m[2] * x + m[5] * y + m[8] * z;\n out[3] = a[3];\n return out;\n}\n//# sourceMappingURL=gl-matrix-extras.js.map","// @eslint-disable\n// @ts-nocheck\nimport * as glMatrix from './common.js';\n/**\n * 3 Dimensional Vector\n * @module vec3\n */\n/**\n * Creates a new, empty vec3\n *\n * @returns {vec3} a new 3D vector\n */\nexport function create() {\n const out = new glMatrix.ARRAY_TYPE(3);\n if (glMatrix.ARRAY_TYPE != Float32Array) {\n out[0] = 0;\n out[1] = 0;\n out[2] = 0;\n }\n return out;\n}\n/**\n * Creates a new vec3 initialized with values from an existing vector\n *\n * @param {ReadonlyVec3} a vector to clone\n * @returns {vec3} a new 3D vector\n */\nexport function clone(a) {\n const out = new glMatrix.ARRAY_TYPE(3);\n out[0] = a[0];\n out[1] = a[1];\n out[2] = a[2];\n return out;\n}\n/**\n * Calculates the length of a vec3\n *\n * @param {ReadonlyVec3} a vector to calculate length of\n * @returns {Number} length of a\n */\nexport function length(a) {\n const x = a[0];\n const y = a[1];\n const z = a[2];\n return Math.sqrt(x * x + y * y + z * z);\n}\n/**\n * Creates a new vec3 initialized with the given values\n *\n * @param {Number} x X component\n * @param {Number} y Y component\n * @param {Number} z Z component\n * @returns {vec3} a new 3D vector\n */\nexport function fromValues(x, y, z) {\n const out = new glMatrix.ARRAY_TYPE(3);\n out[0] = x;\n out[1] = y;\n out[2] = z;\n return out;\n}\n/**\n * Copy the values from one vec3 to another\n *\n * @param {vec3} out the receiving vector\n * @param {ReadonlyVec3} a the source vector\n * @returns {vec3} out\n */\nexport function copy(out, a) {\n out[0] = a[0];\n out[1] = a[1];\n out[2] = a[2];\n return out;\n}\n/**\n * Set the components of a vec3 to the given values\n *\n * @param {vec3} out the receiving vector\n * @param {Number} x X component\n * @param {Number} y Y component\n * @param {Number} z Z component\n * @returns {vec3} out\n */\nexport function set(out, x, y, z) {\n out[0] = x;\n out[1] = y;\n out[2] = z;\n return out;\n}\n/**\n * Adds two vec3's\n *\n * @param {vec3} out the receiving vector\n * @param {ReadonlyVec3} a the first operand\n * @param {ReadonlyVec3} b the second operand\n * @returns {vec3} out\n */\nexport function add(out, a, b) {\n out[0] = a[0] + b[0];\n out[1] = a[1] + b[1];\n out[2] = a[2] + b[2];\n return out;\n}\n/**\n * Subtracts vector b from vector a\n *\n * @param {vec3} out the receiving vector\n * @param {ReadonlyVec3} a the first operand\n * @param {ReadonlyVec3} b the second operand\n * @returns {vec3} out\n */\nexport function subtract(out, a, b) {\n out[0] = a[0] - b[0];\n out[1] = a[1] - b[1];\n out[2] = a[2] - b[2];\n return out;\n}\n/**\n * Multiplies two vec3's\n *\n * @param {vec3} out the receiving vector\n * @param {ReadonlyVec3} a the first operand\n * @param {ReadonlyVec3} b the second operand\n * @returns {vec3} out\n */\nexport function multiply(out, a, b) {\n out[0] = a[0] * b[0];\n out[1] = a[1] * b[1];\n out[2] = a[2] * b[2];\n return out;\n}\n/**\n * Divides two vec3's\n *\n * @param {vec3} out the receiving vector\n * @param {ReadonlyVec3} a the first operand\n * @param {ReadonlyVec3} b the second operand\n * @returns {vec3} out\n */\nexport function divide(out, a, b) {\n out[0] = a[0] / b[0];\n out[1] = a[1] / b[1];\n out[2] = a[2] / b[2];\n return out;\n}\n/**\n * Math.ceil the components of a vec3\n *\n * @param {vec3} out the receiving vector\n * @param {ReadonlyVec3} a vector to ceil\n * @returns {vec3} out\n */\nexport function ceil(out, a) {\n out[0] = Math.ceil(a[0]);\n out[1] = Math.ceil(a[1]);\n out[2] = Math.ceil(a[2]);\n return out;\n}\n/**\n * Math.floor the components of a vec3\n *\n * @param {vec3} out the receiving vector\n * @param {ReadonlyVec3} a vector to floor\n * @returns {vec3} out\n */\nexport function floor(out, a) {\n out[0] = Math.floor(a[0]);\n out[1] = Math.floor(a[1]);\n out[2] = Math.floor(a[2]);\n return out;\n}\n/**\n * Returns the minimum of two vec3's\n *\n * @param {vec3} out the receiving vector\n * @param {ReadonlyVec3} a the first operand\n * @param {ReadonlyVec3} b the second operand\n * @returns {vec3} out\n */\nexport function min(out, a, b) {\n out[0] = Math.min(a[0], b[0]);\n out[1] = Math.min(a[1], b[1]);\n out[2] = Math.min(a[2], b[2]);\n return out;\n}\n/**\n * Returns the maximum of two vec3's\n *\n * @param {vec3} out the receiving vector\n * @param {ReadonlyVec3} a the first operand\n * @param {ReadonlyVec3} b the second operand\n * @returns {vec3} out\n */\nexport function max(out, a, b) {\n out[0] = Math.max(a[0], b[0]);\n out[1] = Math.max(a[1], b[1]);\n out[2] = Math.max(a[2], b[2]);\n return out;\n}\n/**\n * symmetric round the components of a vec3\n *\n * @param {vec3} out the receiving vector\n * @param {ReadonlyVec3} a vector to round\n * @returns {vec3} out\n */\nexport function round(out, a) {\n out[0] = glMatrix.round(a[0]);\n out[1] = glMatrix.round(a[1]);\n out[2] = glMatrix.round(a[2]);\n return out;\n}\n/**\n * Scales a vec3 by a scalar number\n *\n * @param {vec3} out the receiving vector\n * @param {ReadonlyVec3} a the vector to scale\n * @param {Number} b amount to scale the vector by\n * @returns {vec3} out\n */\nexport function scale(out, a, b) {\n out[0] = a[0] * b;\n out[1] = a[1] * b;\n out[2] = a[2] * b;\n return out;\n}\n/**\n * Adds two vec3's after scaling the second operand by a scalar value\n *\n * @param {vec3} out the receiving vector\n * @param {ReadonlyVec3} a the first operand\n * @param {ReadonlyVec3} b the second operand\n * @param {Number} scale the amount to scale b by before adding\n * @returns {vec3} out\n */\nexport function scaleAndAdd(out, a, b, scale) {\n out[0] = a[0] + b[0] * scale;\n out[1] = a[1] + b[1] * scale;\n out[2] = a[2] + b[2] * scale;\n return out;\n}\n/**\n * Calculates the euclidian distance between two vec3's\n *\n * @param {ReadonlyVec3} a the first operand\n * @param {ReadonlyVec3} b the second operand\n * @returns {Number} distance between a and b\n */\nexport function distance(a, b) {\n const x = b[0] - a[0];\n const y = b[1] - a[1];\n const z = b[2] - a[2];\n return Math.sqrt(x * x + y * y + z * z);\n}\n/**\n * Calculates the squared euclidian distance between two vec3's\n *\n * @param {ReadonlyVec3} a the first operand\n * @param {ReadonlyVec3} b the second operand\n * @returns {Number} squared distance between a and b\n */\nexport function squaredDistance(a, b) {\n const x = b[0] - a[0];\n const y = b[1] - a[1];\n const z = b[2] - a[2];\n return x * x + y * y + z * z;\n}\n/**\n * Calculates the squared length of a vec3\n *\n * @param {ReadonlyVec3} a vector to calculate squared length of\n * @returns {Number} squared length of a\n */\nexport function squaredLength(a) {\n const x = a[0];\n const y = a[1];\n const z = a[2];\n return x * x + y * y + z * z;\n}\n/**\n * Negates the components of a vec3\n *\n * @param {vec3} out the receiving vector\n * @param {ReadonlyVec3} a vector to negate\n * @returns {vec3} out\n */\nexport function negate(out, a) {\n out[0] = -a[0];\n out[1] = -a[1];\n out[2] = -a[2];\n return out;\n}\n/**\n * Returns the inverse of the components of a vec3\n *\n * @param {vec3} out the receiving vector\n * @param {ReadonlyVec3} a vector to invert\n * @returns {vec3} out\n */\nexport function inverse(out, a) {\n out[0] = 1.0 / a[0];\n out[1] = 1.0 / a[1];\n out[2] = 1.0 / a[2];\n return out;\n}\n/**\n * Normalize a vec3\n *\n * @param {vec3} out the receiving vector\n * @param {ReadonlyVec3} a vector to normalize\n * @returns {vec3} out\n */\nexport function normalize(out, a) {\n const x = a[0];\n const y = a[1];\n const z = a[2];\n let len = x * x + y * y + z * z;\n if (len > 0) {\n // TODO: evaluate use of glm_invsqrt here?\n len = 1 / Math.sqrt(len);\n }\n out[0] = a[0] * len;\n out[1] = a[1] * len;\n out[2] = a[2] * len;\n return out;\n}\n/**\n * Calculates the dot product of two vec3's\n *\n * @param {ReadonlyVec3} a the first operand\n * @param {ReadonlyVec3} b the second operand\n * @returns {Number} dot product of a and b\n */\nexport function dot(a, b) {\n return a[0] * b[0] + a[1] * b[1] + a[2] * b[2];\n}\n/**\n * Computes the cross product of two vec3's\n *\n * @param {vec3} out the receiving vector\n * @param {ReadonlyVec3} a the first operand\n * @param {ReadonlyVec3} b the second operand\n * @returns {vec3} out\n */\nexport function cross(out, a, b) {\n const ax = a[0];\n const ay = a[1];\n const az = a[2];\n const bx = b[0];\n const by = b[1];\n const bz = b[2];\n out[0] = ay * bz - az * by;\n out[1] = az * bx - ax * bz;\n out[2] = ax * by - ay * bx;\n return out;\n}\n/**\n * Performs a linear interpolation between two vec3's\n *\n * @param {vec3} out the receiving vector\n * @param {ReadonlyVec3} a the first operand\n * @param {ReadonlyVec3} b the second operand\n * @param {Number} t interpolation amount, in the range [0-1], between the two inputs\n * @returns {vec3} out\n */\nexport function lerp(out, a, b, t) {\n const ax = a[0];\n const ay = a[1];\n const az = a[2];\n out[0] = ax + t * (b[0] - ax);\n out[1] = ay + t * (b[1] - ay);\n out[2] = az + t * (b[2] - az);\n return out;\n}\n/**\n * Performs a spherical linear interpolation between two vec3's\n *\n * @param {vec3} out the receiving vector\n * @param {ReadonlyVec3} a the first operand\n * @param {ReadonlyVec3} b the second operand\n * @param {Number} t interpolation amount, in the range [0-1], between the two inputs\n * @returns {vec3} out\n */\nexport function slerp(out, a, b, t) {\n const angle = Math.acos(Math.min(Math.max(dot(a, b), -1), 1));\n const sinTotal = Math.sin(angle);\n const ratioA = Math.sin((1 - t) * angle) / sinTotal;\n const ratioB = Math.sin(t * angle) / sinTotal;\n out[0] = ratioA * a[0] + ratioB * b[0];\n out[1] = ratioA * a[1] + ratioB * b[1];\n out[2] = ratioA * a[2] + ratioB * b[2];\n return out;\n}\n/**\n * Performs a hermite interpolation with two control points\n *\n * @param {vec3} out the receiving vector\n * @param {ReadonlyVec3} a the first operand\n * @param {ReadonlyVec3} b the second operand\n * @param {ReadonlyVec3} c the third operand\n * @param {ReadonlyVec3} d the fourth operand\n * @param {Number} t interpolation amount, in the range [0-1], between the two inputs\n * @returns {vec3} out\n */\nexport function hermite(out, a, b, c, d, t) {\n const factorTimes2 = t * t;\n const factor1 = factorTimes2 * (2 * t - 3) + 1;\n const factor2 = factorTimes2 * (t - 2) + t;\n const factor3 = factorTimes2 * (t - 1);\n const factor4 = factorTimes2 * (3 - 2 * t);\n out[0] = a[0] * factor1 + b[0] * factor2 + c[0] * factor3 + d[0] * factor4;\n out[1] = a[1] * factor1 + b[1] * factor2 + c[1] * factor3 + d[1] * factor4;\n out[2] = a[2] * factor1 + b[2] * factor2 + c[2] * factor3 + d[2] * factor4;\n return out;\n}\n/**\n * Performs a bezier interpolation with two control points\n *\n * @param {vec3} out the receiving vector\n * @param {ReadonlyVec3} a the first operand\n * @param {ReadonlyVec3} b the second operand\n * @param {ReadonlyVec3} c the third operand\n * @param {ReadonlyVec3} d the fourth operand\n * @param {Number} t interpolation amount, in the range [0-1], between the two inputs\n * @returns {vec3} out\n */\nexport function bezier(out, a, b, c, d, t) {\n const inverseFactor = 1 - t;\n const inverseFactorTimesTwo = inverseFactor * inverseFactor;\n const factorTimes2 = t * t;\n const factor1 = inverseFactorTimesTwo * inverseFactor;\n const factor2 = 3 * t * inverseFactorTimesTwo;\n const factor3 = 3 * factorTimes2 * inverseFactor;\n const factor4 = factorTimes2 * t;\n out[0] = a[0] * factor1 + b[0] * factor2 + c[0] * factor3 + d[0] * factor4;\n out[1] = a[1] * factor1 + b[1] * factor2 + c[1] * factor3 + d[1] * factor4;\n out[2] = a[2] * factor1 + b[2] * factor2 + c[2] * factor3 + d[2] * factor4;\n return out;\n}\n/**\n * Generates a random vector with the given scale\n *\n * @param {vec3} out the receiving vector\n * @param {Number} [scale] Length of the resulting vector. If omitted, a unit vector will be returned\n * @returns {vec3} out\n */\nexport function random(out, scale) {\n scale = scale === undefined ? 1.0 : scale;\n const r = glMatrix.RANDOM() * 2.0 * Math.PI;\n const z = glMatrix.RANDOM() * 2.0 - 1.0;\n const zScale = Math.sqrt(1.0 - z * z) * scale;\n out[0] = Math.cos(r) * zScale;\n out[1] = Math.sin(r) * zScale;\n out[2] = z * scale;\n return out;\n}\n/**\n * Transforms the vec3 with a mat4.\n * 4th vector component is implicitly '1'\n *\n * @param {vec3} out the receiving vector\n * @param {ReadonlyVec3} a the vector to transform\n * @param {ReadonlyMat4} m matrix to transform with\n * @returns {vec3} out\n */\nexport function transformMat4(out, a, m) {\n const x = a[0];\n const y = a[1];\n const z = a[2];\n let w = m[3] * x + m[7] * y + m[11] * z + m[15];\n w = w || 1.0;\n out[0] = (m[0] * x + m[4] * y + m[8] * z + m[12]) / w;\n out[1] = (m[1] * x + m[5] * y + m[9] * z + m[13]) / w;\n out[2] = (m[2] * x + m[6] * y + m[10] * z + m[14]) / w;\n return out;\n}\n/**\n * Transforms the vec3 with a mat3.\n *\n * @param {vec3} out the receiving vector\n * @param {ReadonlyVec3} a the vector to transform\n * @param {ReadonlyMat3} m the 3x3 matrix to transform with\n * @returns {vec3} out\n */\nexport function transformMat3(out, a, m) {\n const x = a[0];\n const y = a[1];\n const z = a[2];\n out[0] = x * m[0] + y * m[3] + z * m[6];\n out[1] = x * m[1] + y * m[4] + z * m[7];\n out[2] = x * m[2] + y * m[5] + z * m[8];\n return out;\n}\n/**\n * Transforms the vec3 with a quat\n * Can also be used for dual quaternions. (Multiply it with the real part)\n *\n * @param {vec3} out the receiving vector\n * @param {ReadonlyVec3} a the vector to transform\n * @param {ReadonlyQuat} q quaternion to transform with\n * @returns {vec3} out\n */\nexport function transformQuat(out, a, q) {\n // benchmarks: https://jsperf.com/quaternion-transform-vec3-implementations-fixed\n const qx = q[0];\n const qy = q[1];\n const qz = q[2];\n const qw = q[3];\n const x = a[0];\n const y = a[1];\n const z = a[2];\n // var qvec = [qx, qy, qz];\n // var uv = vec3.cross([], qvec, a);\n let uvx = qy * z - qz * y;\n let uvy = qz * x - qx * z;\n let uvz = qx * y - qy * x;\n // var uuv = vec3.cross([], qvec, uv);\n let uuvx = qy * uvz - qz * uvy;\n let uuvy = qz * uvx - qx * uvz;\n let uuvz = qx * uvy - qy * uvx;\n // vec3.scale(uv, uv, 2 * w);\n const w2 = qw * 2;\n uvx *= w2;\n uvy *= w2;\n uvz *= w2;\n // vec3.scale(uuv, uuv, 2);\n uuvx *= 2;\n uuvy *= 2;\n uuvz *= 2;\n // return vec3.add(out, a, vec3.add(out, uv, uuv));\n out[0] = x + uvx + uuvx;\n out[1] = y + uvy + uuvy;\n out[2] = z + uvz + uuvz;\n return out;\n}\n/**\n * Rotate a 3D vector around the x-axis\n * @param {vec3} out The receiving vec3\n * @param {ReadonlyVec3} a The vec3 point to rotate\n * @param {ReadonlyVec3} b The origin of the rotation\n * @param {Number} rad The angle of rotation in radians\n * @returns {vec3} out\n */\nexport function rotateX(out, a, b, rad) {\n const p = [];\n const r = [];\n // Translate point to the origin\n p[0] = a[0] - b[0];\n p[1] = a[1] - b[1];\n p[2] = a[2] - b[2];\n // perform rotation\n r[0] = p[0];\n r[1] = p[1] * Math.cos(rad) - p[2] * Math.sin(rad);\n r[2] = p[1] * Math.sin(rad) + p[2] * Math.cos(rad);\n // translate to correct position\n out[0] = r[0] + b[0];\n out[1] = r[1] + b[1];\n out[2] = r[2] + b[2];\n return out;\n}\n/**\n * Rotate a 3D vector around the y-axis\n * @param {vec3} out The receiving vec3\n * @param {ReadonlyVec3} a The vec3 point to rotate\n * @param {ReadonlyVec3} b The origin of the rotation\n * @param {Number} rad The angle of rotation in radians\n * @returns {vec3} out\n */\nexport function rotateY(out, a, b, rad) {\n const p = [];\n const r = [];\n // Translate point to the origin\n p[0] = a[0] - b[0];\n p[1] = a[1] - b[1];\n p[2] = a[2] - b[2];\n // perform rotation\n r[0] = p[2] * Math.sin(rad) + p[0] * Math.cos(rad);\n r[1] = p[1];\n r[2] = p[2] * Math.cos(rad) - p[0] * Math.sin(rad);\n // translate to correct position\n out[0] = r[0] + b[0];\n out[1] = r[1] + b[1];\n out[2] = r[2] + b[2];\n return out;\n}\n/**\n * Rotate a 3D vector around the z-axis\n * @param {vec3} out The receiving vec3\n * @param {ReadonlyVec3} a The vec3 point to rotate\n * @param {ReadonlyVec3} b The origin of the rotation\n * @param {Number} rad The angle of rotation in radians\n * @returns {vec3} out\n */\nexport function rotateZ(out, a, b, rad) {\n const p = [];\n const r = [];\n // Translate point to the origin\n p[0] = a[0] - b[0];\n p[1] = a[1] - b[1];\n p[2] = a[2] - b[2];\n // perform rotation\n r[0] = p[0] * Math.cos(rad) - p[1] * Math.sin(rad);\n r[1] = p[0] * Math.sin(rad) + p[1] * Math.cos(rad);\n r[2] = p[2];\n // translate to correct position\n out[0] = r[0] + b[0];\n out[1] = r[1] + b[1];\n out[2] = r[2] + b[2];\n return out;\n}\n/**\n * Get the angle between two 3D vectors\n * @param {ReadonlyVec3} a The first operand\n * @param {ReadonlyVec3} b The second operand\n * @returns {Number} The angle in radians\n */\nexport function angle(a, b) {\n const ax = a[0];\n const ay = a[1];\n const az = a[2];\n const bx = b[0];\n const by = b[1];\n const bz = b[2];\n const mag = Math.sqrt((ax * ax + ay * ay + az * az) * (bx * bx + by * by + bz * bz));\n const cosine = mag && dot(a, b) / mag;\n return Math.acos(Math.min(Math.max(cosine, -1), 1));\n}\n/**\n * Set the components of a vec3 to zero\n *\n * @param {vec3} out the receiving vector\n * @returns {vec3} out\n */\nexport function zero(out) {\n out[0] = 0.0;\n out[1] = 0.0;\n out[2] = 0.0;\n return out;\n}\n/**\n * Returns a string representation of a vector\n *\n * @param {ReadonlyVec3} a vector to represent as a string\n * @returns {String} string representation of the vector\n */\nexport function str(a) {\n return `vec3(${a[0]}, ${a[1]}, ${a[2]})`;\n}\n/**\n * Returns whether or not the vectors have exactly the same elements in the same position (when compared with ===)\n *\n * @param {ReadonlyVec3} a The first vector.\n * @param {ReadonlyVec3} b The second vector.\n * @returns {Boolean} True if the vectors are equal, false otherwise.\n */\nexport function exactEquals(a, b) {\n return a[0] === b[0] && a[1] === b[1] && a[2] === b[2];\n}\n/**\n * Returns whether or not the vectors have approximately the same elements in the same position.\n *\n * @param {ReadonlyVec3} a The first vector.\n * @param {ReadonlyVec3} b The second vector.\n * @returns {Boolean} True if the vectors are equal, false otherwise.\n */\nexport function equals(a, b) {\n const a0 = a[0];\n const a1 = a[1];\n const a2 = a[2];\n const b0 = b[0];\n const b1 = b[1];\n const b2 = b[2];\n return (Math.abs(a0 - b0) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a0), Math.abs(b0)) &&\n Math.abs(a1 - b1) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a1), Math.abs(b1)) &&\n Math.abs(a2 - b2) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a2), Math.abs(b2)));\n}\n/**\n * Alias for {@link vec3.subtract}\n * @function\n */\nexport const sub = subtract;\n/**\n * Alias for {@link vec3.multiply}\n * @function\n */\nexport const mul = multiply;\n/**\n * Alias for {@link vec3.divide}\n * @function\n */\nexport const div = divide;\n/**\n * Alias for {@link vec3.distance}\n * @function\n */\nexport const dist = distance;\n/**\n * Alias for {@link vec3.squaredDistance}\n * @function\n */\nexport const sqrDist = squaredDistance;\n/**\n * Alias for {@link vec3.length}\n * @function\n */\nexport const len = length;\n/**\n * Alias for {@link vec3.squaredLength}\n * @function\n */\nexport const sqrLen = squaredLength;\n/**\n * Perform some operation over an array of vec3s.\n *\n * @param {Array} a the array of vectors to iterate over\n * @param {Number} stride Number of elements between the start of each vec3. If 0 assumes tightly packed\n * @param {Number} offset Number of elements to skip at the beginning of the array\n * @param {Number} count Number of vec3s to iterate over. If 0 iterates over entire array\n * @param {Function} fn Function to call for each vector in the array\n * @param {Object} [arg] additional argument to pass to fn\n * @returns {Array} a\n * @function\n */\nexport const forEach = (function () {\n const vec = create();\n return function (a, stride, offset, count, fn, arg) {\n let i;\n let l;\n if (!stride) {\n stride = 3;\n }\n if (!offset) {\n offset = 0;\n }\n if (count) {\n l = Math.min(count * stride + offset, a.length);\n }\n else {\n l = a.length;\n }\n for (i = offset; i < l; i += stride) {\n vec[0] = a[i];\n vec[1] = a[i + 1];\n vec[2] = a[i + 2];\n fn(vec, vec, arg);\n a[i] = vec[0];\n a[i + 1] = vec[1];\n a[i + 2] = vec[2];\n }\n return a;\n };\n})();\n//# sourceMappingURL=vec3.js.map","// math.gl\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\n// Copyright (c) 2017 Uber Technologies, Inc.\nimport { Vector } from \"./base/vector.js\";\nimport { config, isArray } from \"../lib/common.js\";\nimport { checkNumber } from \"../lib/validators.js\";\n// @ts-ignore gl-matrix types\nimport { angle as vec3_angle, cross as vec3_cross, rotateX as vec3_rotateX, rotateY as vec3_rotateY, rotateZ as vec3_rotateZ, transformMat4 as vec3_transformMat4, transformMat3 as vec3_transformMat3, transformQuat as vec3_transformQuat } from \"../gl-matrix/vec3.js\";\n/* eslint-disable camelcase */\nimport { vec3_transformMat2, vec3_transformMat4AsVector } from \"../lib/gl-matrix-extras.js\";\nconst ORIGIN = [0, 0, 0];\nlet ZERO;\n/**\n * Three-element vector class with common linear algebra operations.\n * Subclass of Array<number> meaning that it is highly compatible with other libraries\n */\nexport class Vector3 extends Vector {\n static get ZERO() {\n if (!ZERO) {\n ZERO = new Vector3(0, 0, 0);\n Object.freeze(ZERO);\n }\n return ZERO;\n }\n /**\n * @class\n * @param x\n * @param y\n * @param z\n */\n constructor(x = 0, y = 0, z = 0) {\n // PERF NOTE: initialize elements as double precision numbers\n super(-0, -0, -0);\n if (arguments.length === 1 && isArray(x)) {\n this.copy(x);\n }\n else {\n // this.set(x, y, z);\n if (config.debug) {\n checkNumber(x);\n checkNumber(y);\n checkNumber(z);\n }\n // @ts-expect-error TS2412: Property '0' of type 'number | [number, number, number]' is not assignable to numeric index type 'number'\n this[0] = x;\n this[1] = y;\n this[2] = z;\n }\n }\n set(x, y, z) {\n this[0] = x;\n this[1] = y;\n this[2] = z;\n return this.check();\n }\n copy(array) {\n this[0] = array[0];\n this[1] = array[1];\n this[2] = array[2];\n return this.check();\n }\n fromObject(object) {\n if (config.debug) {\n checkNumber(object.x);\n checkNumber(object.y);\n checkNumber(object.z);\n }\n this[0] = object.x;\n this[1] = object.y;\n this[2] = object.z;\n return this.check();\n }\n toObject(object) {\n object.x = this[0];\n object.y = this[1];\n object.z = this[2];\n return object;\n }\n // Getters/setters\n get ELEMENTS() {\n return 3;\n }\n get z() {\n return this[2];\n }\n set z(value) {\n this[2] = checkNumber(value);\n }\n // ACCESSORS\n angle(vector) {\n return vec3_angle(this, vector);\n }\n // MODIFIERS\n cross(vector) {\n vec3_cross(this, this, vector);\n return this.check();\n }\n rotateX({ radians, origin = ORIGIN }) {\n vec3_rotateX(this, this, origin, radians);\n return this.check();\n }\n rotateY({ radians, origin = ORIGIN }) {\n vec3_rotateY(this, this, origin, radians);\n return this.check();\n }\n rotateZ({ radians, origin = ORIGIN }) {\n vec3_rotateZ(this, this, origin, radians);\n return this.check();\n }\n // Transforms\n // transforms as point (4th component is implicitly 1)\n transform(matrix4) {\n return this.transformAsPoint(matrix4);\n }\n // transforms as point (4th component is implicitly 1)\n transformAsPoint(matrix4) {\n vec3_transformMat4(this, this, matrix4);\n return this.check();\n }\n // transforms as vector (4th component is implicitly 0, ignores translation. slightly faster)\n transformAsVector(matrix4) {\n vec3_transformMat4AsVector(this, this, matrix4);\n return this.check();\n }\n transformByMatrix3(matrix3) {\n vec3_transformMat3(this, this, matrix3);\n return this.check();\n }\n transformByMatrix2(matrix2) {\n vec3_transformMat2(this, this, matrix2);\n return this.check();\n }\n transformByQuaternion(quaternion) {\n vec3_transformQuat(this, this, quaternion);\n return this.check();\n }\n}\n//# sourceMappingURL=vector3.js.map","// math.gl\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\n// Copyright (c) 2017 Uber Technologies, Inc.\nimport { MathArray } from \"./math-array.js\";\nimport { checkNumber } from \"../../lib/validators.js\";\nimport { config } from \"../../lib/common.js\";\n/** Base class for matrices */\nexport class Matrix extends MathArray {\n // fromObject(object) {\n // const array = object.elements;\n // return this.fromRowMajor(array);\n // }\n // toObject(object) {\n // const array = object.elements;\n // this.toRowMajor(array);\n // return object;\n // }\n // TODO better override formatString?\n toString() {\n let string = '[';\n if (config.printRowMajor) {\n string += 'row-major:';\n for (let row = 0; row < this.RANK; ++row) {\n for (let col = 0; col < this.RANK; ++col) {\n string += ` ${this[col * this.RANK + row]}`;\n }\n }\n }\n else {\n string += 'column-major:';\n for (let i = 0; i < this.ELEMENTS; ++i) {\n string += ` ${this[i]}`;\n }\n }\n string += ']';\n return string;\n }\n getElementIndex(row, col) {\n return col * this.RANK + row;\n }\n // By default assumes row major indices\n getElement(row, col) {\n return this[col * this.RANK + row];\n }\n // By default assumes row major indices\n setElement(row, col, value) {\n this[col * this.RANK + row] = checkNumber(value);\n return this;\n }\n getColumn(columnIndex, result = new Array(this.RANK).fill(-0)) {\n const firstIndex = columnIndex * this.RANK;\n for (let i = 0; i < this.RANK; ++i) {\n result[i] = this[firstIndex + i];\n }\n return result;\n }\n setColumn(columnIndex, columnVector) {\n const firstIndex = columnIndex * this.RANK;\n for (let i = 0; i < this.RANK; ++i) {\n this[firstIndex + i] = columnVector[i];\n }\n return this;\n }\n}\n//# sourceMappingURL=matrix.js.map","// @eslint-disable\n// @ts-nocheck\nimport * as glMatrix from './common.js';\n/**\n * 4x4 Matrix<br>Format: column-major, when typed out it looks like row-major<br>The matrices are being post multiplied.\n * @module mat4\n */\n/**\n * Creates a new identity mat4\n *\n * @returns a new 4x4 matrix\n */\nexport function create() {\n const out = new glMatrix.ARRAY_TYPE(16);\n if (glMatrix.ARRAY_TYPE != Float32Array) {\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[4] = 0;\n out[6] = 0;\n out[7] = 0;\n out[8] = 0;\n out[9] = 0;\n out[11] = 0;\n out[12] = 0;\n out[13] = 0;\n out[14] = 0;\n }\n out[0] = 1;\n out[5] = 1;\n out[10] = 1;\n out[15] = 1;\n return out;\n}\n/**\n * Creates a new mat4 initialized with values from an existing matrix\n *\n * @param {ReadonlyMat4} a matrix to clone\n * @returns {mat4} a new 4x4 matrix\n */\nexport function clone(a) {\n const out = new glMatrix.ARRAY_TYPE(16);\n out[0] = a[0];\n out[1] = a[1];\n out[2] = a[2];\n out[3] = a[3];\n out[4] = a[4];\n out[5] = a[5];\n out[6] = a[6];\n out[7] = a[7];\n out[8] = a[8];\n out[9] = a[9];\n out[10] = a[10];\n out[11] = a[11];\n out[12] = a[12];\n out[13] = a[13];\n out[14] = a[14];\n out[15] = a[15];\n return out;\n}\n/**\n * Copy the values from one mat4 to another\n *\n * @param {mat4} out the receiving matrix\n * @param {ReadonlyMat4} a the source matrix\n * @returns {mat4} out\n */\nexport function copy(out, a) {\n out[0] = a[0];\n out[1] = a[1];\n out[2] = a[2];\n out[3] = a[3];\n out[4] = a[4];\n out[5] = a[5];\n out[6] = a[6];\n out[7] = a[7];\n out[8] = a[8];\n out[9] = a[9];\n out[10] = a[10];\n out[11] = a[11];\n out[12] = a[12];\n out[13] = a[13];\n out[14] = a[14];\n out[15] = a[15];\n return out;\n}\n/**\n * Create a new mat4 with the given values\n *\n * @param {Number} m00 Component in column 0, row 0 position (index 0)\n * @param {Number} m01 Component in column 0, row 1 position (index 1)\n * @param {Number} m02 Component in column 0, row 2 position (index 2)\n * @param {Number} m03 Component in column 0, row 3 position (index 3)\n * @param {Number} m10 Component in column 1, row 0 position (index 4)\n * @param {Number} m11 Component in column 1, row 1 position (index 5)\n * @param {Number} m12 Component in column 1, row 2 position (index 6)\n * @param {Number} m13 Component in column 1, row 3 position (index 7)\n * @param {Number} m20 Component in column 2, row 0 position (index 8)\n * @param {Number} m21 Component in column 2, row 1 position (index 9)\n * @param {Number} m22 Component in column 2, row 2 position (index 10)\n * @param {Number} m23 Component in column 2, row 3 position (index 11)\n * @param {Number} m30 Component in column 3, row 0 position (index 12)\n * @param {Number} m31 Component in column 3, row 1 position (index 13)\n * @param {Number} m32 Component in column 3, row 2 position (index 14)\n * @param {Number} m33 Component in column 3, row 3 position (index 15)\n * @returns {mat4} A new mat4\n */\nexport function fromValues(m00, m01, m02, m03, m10, m11, m12, m13, m20, m21, m22, m23, m30, m31, m32, m33) {\n const out = new glMatrix.ARRAY_TYPE(16);\n out[0] = m00;\n out[1] = m01;\n out[2] = m02;\n out[3] = m03;\n out[4] = m10;\n out[5] = m11;\n out[6] = m12;\n out[7] = m13;\n out[8] = m20;\n out[9] = m21;\n out[10] = m22;\n out[11] = m23;\n out[12] = m30;\n out[13] = m31;\n out[14] = m32;\n out[15] = m33;\n return out;\n}\n/**\n * Set the components of a mat4 to the given values\n *\n * @param {mat4} out the receiving matrix\n * @param {Number} m00 Component in column 0, row 0 position (index 0)\n * @param {Number} m01 Component in column 0, row 1 position (index 1)\n * @param {Number} m02 Component in column 0, row 2 position (index 2)\n * @param {Number} m03 Component in column 0, row 3 position (index 3)\n * @param {Number} m10 Component in column 1, row 0 position (index 4)\n * @param {Number} m11 Component in column 1, row 1 position (index 5)\n * @param {Number} m12 Component in column 1, row 2 position (index 6)\n * @param {Number} m13 Component in column 1, row 3 position (index 7)\n * @param {Number} m20 Component in column 2, row 0 position (index 8)\n * @param {Number} m21 Component in column 2, row 1 position (index 9)\n * @param {Number} m22 Component in column 2, row 2 position (index 10)\n * @param {Number} m23 Component in column 2, row 3 position (index 11)\n * @param {Number} m30 Component in column 3, row 0 position (index 12)\n * @param {Number} m31 Component in column 3, row 1 position (index 13)\n * @param {Number} m32 Component in column 3, row 2 position (index 14)\n * @param {Number} m33 Component in column 3, row 3 position (index 15)\n * @returns {mat4} out\n */\nexport function set(out, m00, m01, m02, m03, m10, m11, m12, m13, m20, m21, m22, m23, m30, m31, m32, m33) {\n out[0] = m00;\n out[1] = m01;\n out[2] = m02;\n out[3] = m03;\n out[4] = m10;\n out[5] = m11;\n out[6] = m12;\n out[7] = m13;\n out[8] = m20;\n out[9] = m21;\n out[10] = m22;\n out[11] = m23;\n out[12] = m30;\n out[13] = m31;\n out[14] = m32;\n out[15] = m33;\n return out;\n}\n/**\n * Set a mat4 to the identity matrix\n *\n * @param {mat4} out the receiving matrix\n * @returns {mat4} out\n */\nexport function identity(out) {\n out[0] = 1;\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[4] = 0;\n out[5] = 1;\n out[6] = 0;\n out[7] = 0;\n out[8] = 0;\n out[9] = 0;\n out[10] = 1;\n out[11] = 0;\n out[12] = 0;\n out[13] = 0;\n out[14] = 0;\n out[15] = 1;\n return out;\n}\n/**\n * Transpose the values of a mat4\n *\n * @param {mat4} out the receiving matrix\n * @param {ReadonlyMat4} a the source matrix\n * @returns {mat4} out\n */\nexport function transpose(out, a) {\n // If we are transposing ourselves we can skip a few steps but have to cache some values\n if (out === a) {\n const a01 = a[1];\n const a02 = a[2];\n const a03 = a[3];\n const a12 = a[6];\n const a13 = a[7];\n const a23 = a[11];\n out[1] = a[4];\n out[2] = a[8];\n out[3] = a[12];\n out[4] = a01;\n out[6] = a[9];\n out[7] = a[13];\n out[8] = a02;\n out[9] = a12;\n out[11] = a[14];\n out[12] = a03;\n out[13] = a13;\n out[14] = a23;\n }\n else {\n out[0] = a[0];\n out[1] = a[4];\n out[2] = a[8];\n out[3] = a[12];\n out[4] = a[1];\n out[5] = a[5];\n out[6] = a[9];\n out[7] = a[13];\n out[8] = a[2];\n out[9] = a[6];\n out[10] = a[10];\n out[11] = a[14];\n out[12] = a[3];\n out[13] = a[7];\n out[14] = a[11];\n out[15] = a[15];\n }\n return out;\n}\n/**\n * Inverts a mat4\n *\n * @param {mat4} out the receiving matrix\n * @param {ReadonlyMat4} a the source matrix\n * @returns {mat4} out\n */\nexport function invert(out, a) {\n const a00 = a[0];\n const a01 = a[1];\n const a02 = a[2];\n const a03 = a[3];\n const a10 = a[4];\n const a11 = a[5];\n const a12 = a[6];\n const a13 = a[7];\n const a20 = a[8];\n const a21 = a[9];\n const a22 = a[10];\n const a23 = a[11];\n const a30 = a[12];\n const a31 = a[13];\n const a32 = a[14];\n const a33 = a[15];\n const b00 = a00 * a11 - a01 * a10;\n const b01 = a00 * a12 - a02 * a10;\n const b02 = a00 * a13 - a03 * a10;\n const b03 = a01 * a12 - a02 * a11;\n const b04 = a01 * a13 - a03 * a11;\n const b05 = a02 * a13 - a03 * a12;\n const b06 = a20 * a31 - a21 * a30;\n const b07 = a20 * a32 - a22 * a30;\n const b08 = a20 * a33 - a23 * a30;\n const b09 = a21 * a32 - a22 * a31;\n const b10 = a21 * a33 - a23 * a31;\n const b11 = a22 * a33 - a23 * a32;\n // Calculate the determinant\n let det = b00 * b11 - b01 * b10 + b02 * b09 + b03 * b08 - b04 * b07 + b05 * b06;\n if (!det) {\n return null;\n }\n det = 1.0 / det;\n out[0] = (a11 * b11 - a12 * b10 + a13 * b09) * det;\n out[1] = (a02 * b10 - a01 * b11 - a03 * b09) * det;\n out[2] = (a31 * b05 - a32 * b04 + a33 * b03) * det;\n out[3] = (a22 * b04 - a21 * b05 - a23 * b03) * det;\n out[4] = (a12 * b08 - a10 * b11 - a13 * b07) * det;\n out[5] = (a00 * b11 - a02 * b08 + a03 * b07) * det;\n out[6] = (a32 * b02 - a30 * b05 - a33 * b01) * det;\n out[7] = (a20 * b05 - a22 * b02 + a23 * b01) * det;\n out[8] = (a10 * b10 - a11 * b08 + a13 * b06) * det;\n out[9] = (a01 * b08 - a00 * b10 - a03 * b06) * det;\n out[10] = (a30 * b04 - a31 * b02 + a33 * b00) * det;\n out[11] = (a21 * b02 - a20 * b04 - a23 * b00) * det;\n out[12] = (a11 * b07 - a10 * b09 - a12 * b06) * det;\n out[13] = (a00 * b09 - a01 * b07 + a02 * b06) * det;\n out[14] = (a31 * b01 - a30 * b03 - a32 * b00) * det;\n out[15] = (a20 * b03 - a21 * b01 + a22 * b00) * det;\n return out;\n}\n/**\n * Calculates the adjugate of a mat4\n *\n * @param {mat4} out the receiving matrix\n * @param {ReadonlyMat4} a the source matrix\n * @returns {mat4} out\n */\nexport function adjoint(out, a) {\n const a00 = a[0];\n const a01 = a[1];\n const a02 = a[2];\n const a03 = a[3];\n const a10 = a[4];\n const a11 = a[5];\n const a12 = a[6];\n const a13 = a[7];\n const a20 = a[8];\n const a21 = a[9];\n const a22 = a[10];\n const a23 = a[11];\n const a30 = a[12];\n const a31 = a[13];\n const a32 = a[14];\n const a33 = a[15];\n const b00 = a00 * a11 - a01 * a10;\n const b01 = a00 * a12 - a02 * a10;\n const b02 = a00 * a13 - a03 * a10;\n const b03 = a01 * a12 - a02 * a11;\n const b04 = a01 * a13 - a03 * a11;\n const b05 = a02 * a13 - a03 * a12;\n const b06 = a20 * a31 - a21 * a30;\n const b07 = a20 * a32 - a22 * a30;\n const b08 = a20 * a33 - a23 * a30;\n const b09 = a21 * a32 - a22 * a31;\n const b10 = a21 * a33 - a23 * a31;\n const b11 = a22 * a33 - a23 * a32;\n out[0] = a11 * b11 - a12 * b10 + a13 * b09;\n out[1] = a02 * b10 - a01 * b11 - a03 * b09;\n out[2] = a31 * b05 - a32 * b04 + a33 * b03;\n out[3] = a22 * b04 - a21 * b05 - a23 * b03;\n out[4] = a12 * b08 - a10 * b11 - a13 * b07;\n out[5] = a00 * b11 - a02 * b08 + a03 * b07;\n out[6] = a32 * b02 - a30 * b05 - a33 * b01;\n out[7] = a20 * b05 - a22 * b02 + a23 * b01;\n out[8] = a10 * b10 - a11 * b08 + a13 * b06;\n out[9] = a01 * b08 - a00 * b10 - a03 * b06;\n out[10] = a30 * b04 - a31 * b02 + a33 * b00;\n out[11] = a21 * b02 - a20 * b04 - a23 * b00;\n out[12] = a11 * b07 - a10 * b09 - a12 * b06;\n out[13] = a00 * b09 - a01 * b07 + a02 * b06;\n out[14] = a31 * b01 - a30 * b03 - a32 * b00;\n out[15] = a20 * b03 - a21 * b01 + a22 * b00;\n return out;\n}\n/**\n * Calculates the determinant of a mat4\n *\n * @param {ReadonlyMat4} a the source matrix\n * @returns {Number} determinant of a\n */\nexport function determinant(a) {\n const a00 = a[0];\n const a01 = a[1];\n const a02 = a[2];\n const a03 = a[3];\n const a10 = a[4];\n const a11 = a[5];\n const a12 = a[6];\n const a13 = a[7];\n const a20 = a[8];\n const a21 = a[9];\n const a22 = a[10];\n const a23 = a[11];\n const a30 = a[12];\n const a31 = a[13];\n const a32 = a[14];\n const a33 = a[15];\n const b0 = a00 * a11 - a01 * a10;\n const b1 = a00 * a12 - a02 * a10;\n const b2 = a01 * a12 - a02 * a11;\n const b3 = a20 * a31 - a21 * a30;\n const b4 = a20 * a32 - a22 * a30;\n const b5 = a21 * a32 - a22 * a31;\n const b6 = a00 * b5 - a01 * b4 + a02 * b3;\n const b7 = a10 * b5 - a11 * b4 + a12 * b3;\n const b8 = a20 * b2 - a21 * b1 + a22 * b0;\n const b9 = a30 * b2 - a31 * b1 + a32 * b0;\n // Calculate the determinant\n return a13 * b6 - a03 * b7 + a33 * b8 - a23 * b9;\n}\n/**\n * Multiplies two mat4s\n *\n * @param {mat4} out the receiving matrix\n * @param {ReadonlyMat4} a the first operand\n * @param {ReadonlyMat4} b the second operand\n * @returns {mat4} out\n */\nexport function multiply(out, a, b) {\n const a00 = a[0];\n const a01 = a[1];\n const a02 = a[2];\n const a03 = a[3];\n const a10 = a[4];\n const a11 = a[5];\n const a12 = a[6];\n const a13 = a[7];\n const a20 = a[8];\n const a21 = a[9];\n const a22 = a[10];\n const a23 = a[11];\n const a30 = a[12];\n const a31 = a[13];\n const a32 = a[14];\n const a33 = a[15];\n // Cache only the current line of the second matrix\n let b0 = b[0];\n let b1 = b[1];\n let b2 = b[2];\n let b3 = b[3];\n out[0] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30;\n out[1] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31;\n out[2] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32;\n out[3] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33;\n b0 = b[4];\n b1 = b[5];\n b2 = b[6];\n b3 = b[7];\n out[4] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30;\n out[5] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31;\n out[6] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32;\n out[7] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33;\n b0 = b[8];\n b1 = b[9];\n b2 = b[10];\n b3 = b[11];\n out[8] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30;\n out[9] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31;\n out[10] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32;\n out[11] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33;\n b0 = b[12];\n b1 = b[13];\n b2 = b[14];\n b3 = b[15];\n out[12] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30;\n out[13] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31;\n out[14] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32;\n out[15] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33;\n return out;\n}\n/**\n * Translate a mat4 by the given vector\n *\n * @param {mat4} out the receiving matrix\n * @param {ReadonlyMat4} a the matrix to translate\n * @param {ReadonlyVec3} v vector to translate by\n * @returns {mat4} out\n */\nexport function translate(out, a, v) {\n const x = v[0];\n const y = v[1];\n const z = v[2];\n let a00;\n let a01;\n let a02;\n let a03;\n let a10;\n let a11;\n let a12;\n let a13;\n let a20;\n let a21;\n let a22;\n let a23;\n if (a === out) {\n out[12] = a[0] * x + a[4] * y + a[8] * z + a[12];\n out[13] = a[1] * x + a[5] * y + a[9] * z + a[13];\n out[14] = a[2] * x + a[6] * y + a[10] * z + a[14];\n out[15] = a[3] * x + a[7] * y + a[11] * z + a[15];\n }\n else {\n a00 = a[0];\n a01 = a[1];\n a02 = a[2];\n a03 = a[3];\n a10 = a[4];\n a11 = a[5];\n a12 = a[6];\n a13 = a[7];\n a20 = a[8];\n a21 = a[9];\n a22 = a[10];\n a23 = a[11];\n out[0] = a00;\n out[1] = a01;\n out[2] = a02;\n out[3] = a03;\n out[4] = a10;\n out[5] = a11;\n out[6] = a12;\n out[7] = a13;\n out[8] = a20;\n out[9] = a21;\n out[10] = a22;\n out[11] = a23;\n out[12] = a00 * x + a10 * y + a20 * z + a[12];\n out[13] = a01 * x + a11 * y + a21 * z + a[13];\n out[14] = a02 * x + a12 * y + a22 * z + a[14];\n out[15] = a03 * x + a13 * y + a23 * z + a[15];\n }\n return out;\n}\n/**\n * Scales the mat4 by the dimensions in the given vec3 not using vectorization\n *\n * @param {mat4} out the receiving matrix\n * @param {ReadonlyMat4} a the matrix to scale\n * @param {ReadonlyVec3} v the vec3 to scale the matrix by\n * @returns {mat4} out\n **/\nexport function scale(out, a, v) {\n const x = v[0];\n const y = v[1];\n const z = v[2];\n out[0] = a[0] * x;\n out[1] = a[1] * x;\n out[2] = a[2] * x;\n out[3] = a[3] * x;\n out[4] = a[4] * y;\n out[5] = a[5] * y;\n out[6] = a[6] * y;\n out[7] = a[7] * y;\n out[8] = a[8] * z;\n out[9] = a[9] * z;\n out[10] = a[10] * z;\n out[11] = a[11] * z;\n out[12] = a[12];\n out[13] = a[13];\n out[14] = a[14];\n out[15] = a[15];\n return out;\n}\n/**\n * Rotates a mat4 by the given angle around the given axis\n *\n * @param {mat4} out the receiving matrix\n * @param {ReadonlyMat4} a the matrix to rotate\n * @param {Number} rad the angle to rotate the matrix by\n * @param {ReadonlyVec3} axis the axis to rotate around\n * @returns {mat4} out\n */\nexport function rotate(out, a, rad, axis) {\n let x = axis[0];\n let y = axis[1];\n let z = axis[2];\n let len = Math.sqrt(x * x + y * y + z * z);\n let c;\n let s;\n let t;\n let a00;\n let a01;\n let a02;\n let a03;\n let a10;\n let a11;\n let a12;\n let a13;\n let a20;\n let a21;\n let a22;\n let a23;\n let b00;\n let b01;\n let b02;\n let b10;\n let b11;\n let b12;\n let b20;\n let b21;\n let b22;\n if (len < glMatrix.EPSILON) {\n return null;\n }\n len = 1 / len;\n x *= len;\n y *= len;\n z *= len;\n s = Math.sin(rad);\n c = Math.cos(rad);\n t = 1 - c;\n a00 = a[0];\n a01 = a[1];\n a02 = a[2];\n a03 = a[3];\n a10 = a[4];\n a11 = a[5];\n a12 = a[6];\n a13 = a[7];\n a20 = a[8];\n a21 = a[9];\n a22 = a[10];\n a23 = a[11];\n // Construct the elements of the rotation matrix\n b00 = x * x * t + c;\n b01 = y * x * t + z * s;\n b02 = z * x * t - y * s;\n b10 = x * y * t - z * s;\n b11 = y * y * t + c;\n b12 = z * y * t + x * s;\n b20 = x * z * t + y * s;\n b21 = y * z * t - x * s;\n b22 = z * z * t + c;\n // Perform rotation-specific matrix multiplication\n out[0] = a00 * b00 + a10 * b01 + a20 * b02;\n out[1] = a01 * b00 + a11 * b01 + a21 * b02;\n out[2] = a02 * b00 + a12 * b01 + a22 * b02;\n out[3] = a03 * b00 + a13 * b01 + a23 * b02;\n out[4] = a00 * b10 + a10 * b11 + a20 * b12;\n out[5] = a01 * b10 + a11 * b11 + a21 * b12;\n out[6] = a02 * b10 + a12 * b11 + a22 * b12;\n out[7] = a03 * b10 + a13 * b11 + a23 * b12;\n out[8] = a00 * b20 + a10 * b21 + a20 * b22;\n out[9] = a01 * b20 + a11 * b21 + a21 * b22;\n out[10] = a02 * b20 + a12 * b21 + a22 * b22;\n out[11] = a03 * b20 + a13 * b21 + a23 * b22;\n if (a !== out) {\n // If the source and destination differ, copy the unchanged last row\n out[12] = a[12];\n out[13] = a[13];\n out[14] = a[14];\n out[15] = a[15];\n }\n return out;\n}\n/**\n * Rotates a matrix by the given angle around the X axis\n *\n * @param {mat4} out the receiving matrix\n * @param {ReadonlyMat4} a the matrix to rotate\n * @param {Number} rad the angle to rotate the matrix by\n * @returns {mat4} out\n */\nexport function rotateX(out, a, rad) {\n const s = Math.sin(rad);\n const c = Math.cos(rad);\n const a10 = a[4];\n const a11 = a[5];\n const a12 = a[6];\n const a13 = a[7];\n const a20 = a[8];\n const a21 = a[9];\n const a22 = a[10];\n const a23 = a[11];\n if (a !== out) {\n // If the source and destination differ, copy the unchanged rows\n out[0] = a[0];\n out[1] = a[1];\n out[2] = a[2];\n out[3] = a[3];\n out[12] = a[12];\n out[13] = a[13];\n out[14] = a[14];\n out[15] = a[15];\n }\n // Perform axis-specific matrix multiplication\n out[4] = a10 * c + a20 * s;\n out[5] = a11 * c + a21 * s;\n out[6] = a12 * c + a22 * s;\n out[7] = a13 * c + a23 * s;\n out[8] = a20 * c - a10 * s;\n out[9] = a21 * c - a11 * s;\n out[10] = a22 * c - a12 * s;\n out[11] = a23 * c - a13 * s;\n return out;\n}\n/**\n * Rotates a matrix by the given angle around the Y axis\n *\n * @param {mat4} out the receiving matrix\n * @param {ReadonlyMat4} a the matrix to rotate\n * @param {Number} rad the angle to rotate the matrix by\n * @returns {mat4} out\n */\nexport function rotateY(out, a, rad) {\n const s = Math.sin(rad);\n const c = Math.cos(rad);\n const a00 = a[0];\n const a01 = a[1];\n const a02 = a[2];\n const a03 = a[3];\n const a20 = a[8];\n const a21 = a[9];\n const a22 = a[10];\n const a23 = a[11];\n if (a !== out) {\n // If the source and destination differ, copy the unchanged rows\n out[4] = a[4];\n out[5] = a[5];\n out[6] = a[6];\n out[7] = a[7];\n out[12] = a[12];\n out[13] = a[13];\n out[14] = a[14];\n out[15] = a[15];\n }\n // Perform axis-specific matrix multiplication\n out[0] = a00 * c - a20 * s;\n out[1] = a01 * c - a21 * s;\n out[2] = a02 * c - a22 * s;\n out[3] = a03 * c - a23 * s;\n out[8] = a00 * s + a20 * c;\n out[9] = a01 * s + a21 * c;\n out[10] = a02 * s + a22 * c;\n out[11] = a03 * s + a23 * c;\n return out;\n}\n/**\n * Rotates a matrix by the given angle around the Z axis\n *\n * @param {mat4} out the receiving matrix\n * @param {ReadonlyMat4} a the matrix to rotate\n * @param {Number} rad the angle to rotate the matrix by\n * @returns {mat4} out\n */\nexport function rotateZ(out, a, rad) {\n const s = Math.sin(rad);\n const c = Math.cos(rad);\n const a00 = a[0];\n const a01 = a[1];\n const a02 = a[2];\n const a03 = a[3];\n const a10 = a[4];\n const a11 = a[5];\n const a12 = a[6];\n const a13 = a[7];\n if (a !== out) {\n // If the source and destination differ, copy the unchanged last row\n out[8] = a[8];\n out[9] = a[9];\n out[10] = a[10];\n out[11] = a[11];\n out[12] = a[12];\n out[13] = a[13];\n out[14] = a[14];\n out[15] = a[15];\n }\n // Perform axis-specific matrix multiplication\n out[0] = a00 * c + a10 * s;\n out[1] = a01 * c + a11 * s;\n out[2] = a02 * c + a12 * s;\n out[3] = a03 * c + a13 * s;\n out[4] = a10 * c - a00 * s;\n out[5] = a11 * c - a01 * s;\n out[6] = a12 * c - a02 * s;\n out[7] = a13 * c - a03 * s;\n return out;\n}\n/**\n * Creates a matrix from a vector translation\n * This is equivalent to (but much faster than):\n *\n * mat4.identity(dest);\n * mat4.translate(dest, dest, vec);\n *\n * @param {mat4} out mat4 receiving operation result\n * @param {ReadonlyVec3} v Translation vector\n * @returns {mat4} out\n */\nexport function fromTranslation(out, v) {\n out[0] = 1;\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[4] = 0;\n out[5] = 1;\n out[6] = 0;\n out[7] = 0;\n out[8] = 0;\n out[9] = 0;\n out[10] = 1;\n out[11] = 0;\n out[12] = v[0];\n out[13] = v[1];\n out[14] = v[2];\n out[15] = 1;\n return out;\n}\n/**\n * Creates a matrix from a vector scaling\n * This is equivalent to (but much faster than):\n *\n * mat4.identity(dest);\n * mat4.scale(dest, dest, vec);\n *\n * @param {mat4} out mat4 receiving operation result\n * @param {ReadonlyVec3} v Scaling vector\n * @returns {mat4} out\n */\nexport function fromScaling(out, v) {\n out[0] = v[0];\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[4] = 0;\n out[5] = v[1];\n out[6] = 0;\n out[7] = 0;\n out[8] = 0;\n out[9] = 0;\n out[10] = v[2];\n out[11] = 0;\n out[12] = 0;\n out[13] = 0;\n out[14] = 0;\n out[15] = 1;\n return out;\n}\n/**\n * Creates a matrix from a given angle around a given axis\n * This is equivalent to (but much faster than):\n *\n * mat4.identity(dest);\n * mat4.rotate(dest, dest, rad, axis);\n *\n * @param {mat4} out mat4 receiving operation result\n * @param {Number} rad the angle to rotate the matrix by\n * @param {ReadonlyVec3} axis the axis to rotate around\n * @returns {mat4} out\n */\nexport function fromRotation(out, rad, axis) {\n let x = axis[0];\n let y = axis[1];\n let z = axis[2];\n let len = Math.sqrt(x * x + y * y + z * z);\n let c;\n let s;\n let t;\n if (len < glMatrix.EPSILON) {\n return null;\n }\n len = 1 / len;\n x *= len;\n y *= len;\n z *= len;\n s = Math.sin(rad);\n c = Math.cos(rad);\n t = 1 - c;\n // Perform rotation-specific matrix multiplication\n out[0] = x * x * t + c;\n out[1] = y * x * t + z * s;\n out[2] = z * x * t - y * s;\n out[3] = 0;\n out[4] = x * y * t - z * s;\n out[5] = y * y * t + c;\n out[6] = z * y * t + x * s;\n out[7] = 0;\n out[8] = x * z * t + y * s;\n out[9] = y * z * t - x * s;\n out[10] = z * z * t + c;\n out[11] = 0;\n out[12] = 0;\n out[13] = 0;\n out[14] = 0;\n out[15] = 1;\n return out;\n}\n/**\n * Creates a matrix from the given angle around the X axis\n * This is equivalent to (but much faster than):\n *\n * mat4.identity(dest);\n * mat4.rotateX(dest, dest, rad);\n *\n * @param {mat4} out mat4 receiving operation result\n * @param {Number} rad the angle to rotate the matrix by\n * @returns {mat4} out\n */\nexport function fromXRotation(out, rad) {\n const s = Math.sin(rad);\n const c = Math.cos(rad);\n // Perform axis-specific matrix multiplication\n out[0] = 1;\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[4] = 0;\n out[5] = c;\n out[6] = s;\n out[7] = 0;\n out[8] = 0;\n out[9] = -s;\n out[10] = c;\n out[11] = 0;\n out[12] = 0;\n out[13] = 0;\n out[14] = 0;\n out[15] = 1;\n return out;\n}\n/**\n * Creates a matrix from the given angle around the Y axis\n * This is equivalent to (but much faster than):\n *\n * mat4.identity(dest);\n * mat4.rotateY(dest, dest, rad);\n *\n * @param {mat4} out mat4 receiving operation result\n * @param {Number} rad the angle to rotate the matrix by\n * @returns {mat4} out\n */\nexport function fromYRotation(out, rad) {\n const s = Math.sin(rad);\n const c = Math.cos(rad);\n // Perform axis-specific matrix multiplication\n out[0] = c;\n out[1] = 0;\n out[2] = -s;\n out[3] = 0;\n out[4] = 0;\n out[5] = 1;\n out[6] = 0;\n out[7] = 0;\n out[8] = s;\n out[9] = 0;\n out[10] = c;\n out[11] = 0;\n out[12] = 0;\n out[13] = 0;\n out[14] = 0;\n out[15] = 1;\n return out;\n}\n/**\n * Creates a matrix from the given angle around the Z axis\n * This is equivalent to (but much faster than):\n *\n * mat4.identity(dest);\n * mat4.rotateZ(dest, dest, rad);\n *\n * @param {mat4} out mat4 receiving operation result\n * @param {Number} rad the angle to rotate the matrix by\n * @returns {mat4} out\n */\nexport function fromZRotation(out, rad) {\n const s = Math.sin(rad);\n const c = Math.cos(rad);\n // Perform axis-specific matrix multiplication\n out[0] = c;\n out[1] = s;\n out[2] = 0;\n out[3] = 0;\n out[4] = -s;\n out[5] = c;\n out[6] = 0;\n out[7] = 0;\n out[8] = 0;\n out[9] = 0;\n out[10] = 1;\n out[11] = 0;\n out[12] = 0;\n out[13] = 0;\n out[14] = 0;\n out[15] = 1;\n return out;\n}\n/**\n * Creates a matrix from a quaternion rotation and vector translation\n * This is equivalent to (but much faster than):\n *\n * mat4.identity(dest);\n * mat4.translate(dest, vec);\n * let quatMat = mat4.create();\n * quat4.toMat4(quat, quatMat);\n * mat4.multiply(dest, quatMat);\n *\n * @param {mat4} out mat4 receiving operation result\n * @param {quat4} q Rotation quaternion\n * @param {ReadonlyVec3} v Translation vector\n * @returns {mat4} out\n */\nexport function fromRotationTranslation(out, q, v) {\n // Quaternion math\n const x = q[0];\n const y = q[1];\n const z = q[2];\n const w = q[3];\n const x2 = x + x;\n const y2 = y + y;\n const z2 = z + z;\n const xx = x * x2;\n const xy = x * y2;\n const xz = x * z2;\n const yy = y * y2;\n const yz = y * z2;\n const zz = z * z2;\n const wx = w * x2;\n const wy = w * y2;\n const wz = w * z2;\n out[0] = 1 - (yy + zz);\n out[1] = xy + wz;\n out[2] = xz - wy;\n out[3] = 0;\n out[4] = xy - wz;\n out[5] = 1 - (xx + zz);\n out[6] = yz + wx;\n out[7] = 0;\n out[8] = xz + wy;\n out[9] = yz - wx;\n out[10] = 1 - (xx + yy);\n out[11] = 0;\n out[12] = v[0];\n out[13] = v[1];\n out[14] = v[2];\n out[15] = 1;\n return out;\n}\n/**\n * Creates a new mat4 from a dual quat.\n *\n * @param {mat4} out Matrix\n * @param {ReadonlyQuat2} a Dual Quaternion\n * @returns {mat4} mat4 receiving operation result\n */\nexport function fromQuat2(out, a) {\n const translation = new glMatrix.ARRAY_TYPE(3);\n const bx = -a[0];\n const by = -a[1];\n const bz = -a[2];\n const bw = a[3];\n const ax = a[4];\n const ay = a[5];\n const az = a[6];\n const aw = a[7];\n const magnitude = bx * bx + by * by + bz * bz + bw * bw;\n // Only scale if it makes sense\n if (magnitude > 0) {\n translation[0] = ((ax * bw + aw * bx + ay * bz - az * by) * 2) / magnitude;\n translation[1] = ((ay * bw + aw * by + az * bx - ax * bz) * 2) / magnitude;\n translation[2] = ((az * bw + aw * bz + ax * by - ay * bx) * 2) / magnitude;\n }\n else {\n translation[0] = (ax * bw + aw * bx + ay * bz - az * by) * 2;\n translation[1] = (ay * bw + aw * by + az * bx - ax * bz) * 2;\n translation[2] = (az * bw + aw * bz + ax * by - ay * bx) * 2;\n }\n fromRotationTranslation(out, a, translation);\n return out;\n}\n/**\n * Returns the translation vector component of a transformation\n * matrix. If a matrix is built with fromRotationTranslation,\n * the returned vector will be the same as the translation vector\n * originally supplied.\n * @param {vec3} out Vector to receive translation component\n * @param {ReadonlyMat4} mat Matrix to be decomposed (input)\n * @return {vec3} out\n */\nexport function getTranslation(out, mat) {\n out[0] = mat[12];\n out[1] = mat[13];\n out[2] = mat[14];\n return out;\n}\n/**\n * Returns the scaling factor component of a transformation\n * matrix. If a matrix is built with fromRotationTranslationScale\n * with a normalized Quaternion paramter, the returned vector will be\n * the same as the scaling vector\n * originally supplied.\n * @param {vec3} out Vector to receive scaling factor component\n * @param {ReadonlyMat4} mat Matrix to be decomposed (input)\n * @return {vec3} out\n */\nexport function getScaling(out, mat) {\n const m11 = mat[0];\n const m12 = mat[1];\n const m13 = mat[2];\n const m21 = mat[4];\n const m22 = mat[5];\n const m23 = mat[6];\n const m31 = mat[8];\n const m32 = mat[9];\n const m33 = mat[10];\n out[0] = Math.sqrt(m11 * m11 + m12 * m12 + m13 * m13);\n out[1] = Math.sqrt(m21 * m21 + m22 * m22 + m23 * m23);\n out[2] = Math.sqrt(m31 * m31 + m32 * m32 + m33 * m33);\n return out;\n}\n/**\n * Returns a quaternion representing the rotational component\n * of a transformation matrix. If a matrix is built with\n * fromRotationTranslation, the returned quaternion will be the\n * same as the quaternion originally supplied.\n * @param {quat} out Quaternion to receive the rotation component\n * @param {ReadonlyMat4} mat Matrix to be decomposed (input)\n * @return {quat} out\n */\nexport function getRotation(out, mat) {\n const scaling = new glMatrix.ARRAY_TYPE(3);\n getScaling(scaling, mat);\n const is1 = 1 / scaling[0];\n const is2 = 1 / scaling[1];\n const is3 = 1 / scaling[2];\n const sm11 = mat[0] * is1;\n const sm12 = mat[1] * is2;\n const sm13 = mat[2] * is3;\n const sm21 = mat[4] * is1;\n const sm22 = mat[5] * is2;\n const sm23 = mat[6] * is3;\n const sm31 = mat[8] * is1;\n const sm32 = mat[9] * is2;\n const sm33 = mat[10] * is3;\n const trace = sm11 + sm22 + sm33;\n let S = 0;\n if (trace > 0) {\n S = Math.sqrt(trace + 1.0) * 2;\n out[3] = 0.25 * S;\n out[0] = (sm23 - sm32) / S;\n out[1] = (sm31 - sm13) / S;\n out[2] = (sm12 - sm21) / S;\n }\n else if (sm11 > sm22 && sm11 > sm33) {\n S = Math.sqrt(1.0 + sm11 - sm22 - sm33) * 2;\n out[3] = (sm23 - sm32) / S;\n out[0] = 0.25 * S;\n out[1] = (sm12 + sm21) / S;\n out[2] = (sm31 + sm13) / S;\n }\n else if (sm22 > sm33) {\n S = Math.sqrt(1.0 + sm22 - sm11 - sm33) * 2;\n out[3] = (sm31 - sm13) / S;\n out[0] = (sm12 + sm21) / S;\n out[1] = 0.25 * S;\n out[2] = (sm23 + sm32) / S;\n }\n else {\n S = Math.sqrt(1.0 + sm33 - sm11 - sm22) * 2;\n out[3] = (sm12 - sm21) / S;\n out[0] = (sm31 + sm13) / S;\n out[1] = (sm23 + sm32) / S;\n out[2] = 0.25 * S;\n }\n return out;\n}\n/**\n * Decomposes a transformation matrix into its rotation, translation\n * and scale components. Returns only the rotation component\n * @param {quat} out_r Quaternion to receive the rotation component\n * @param {vec3} out_t Vector to receive the translation vector\n * @param {vec3} out_s Vector to receive the scaling factor\n * @param {ReadonlyMat4} mat Matrix to be decomposed (input)\n * @returns {quat} out_r\n */\nexport function decompose(out_r, out_t, out_s, mat) {\n out_t[0] = mat[12];\n out_t[1] = mat[13];\n out_t[2] = mat[14];\n const m11 = mat[0];\n const m12 = mat[1];\n const m13 = mat[2];\n const m21 = mat[4];\n const m22 = mat[5];\n const m23 = mat[6];\n const m31 = mat[8];\n const m32 = mat[9];\n const m33 = mat[10];\n out_s[0] = Math.sqrt(m11 * m11 + m12 * m12 + m13 * m13);\n out_s[1] = Math.sqrt(m21 * m21 + m22 * m22 + m23 * m23);\n out_s[2] = Math.sqrt(m31 * m31 + m32 * m32 + m33 * m33);\n const is1 = 1 / out_s[0];\n const is2 = 1 / out_s[1];\n const is3 = 1 / out_s[2];\n const sm11 = m11 * is1;\n const sm12 = m12 * is2;\n const sm13 = m13 * is3;\n const sm21 = m21 * is1;\n const sm22 = m22 * is2;\n const sm23 = m23 * is3;\n const sm31 = m31 * is1;\n const sm32 = m32 * is2;\n const sm33 = m33 * is3;\n const trace = sm11 + sm22 + sm33;\n let S = 0;\n if (trace > 0) {\n S = Math.sqrt(trace + 1.0) * 2;\n out_r[3] = 0.25 * S;\n out_r[0] = (sm23 - sm32) / S;\n out_r[1] = (sm31 - sm13) / S;\n out_r[2] = (sm12 - sm21) / S;\n }\n else if (sm11 > sm22 && sm11 > sm33) {\n S = Math.sqrt(1.0 + sm11 - sm22 - sm33) * 2;\n out_r[3] = (sm23 - sm32) / S;\n out_r[0] = 0.25 * S;\n out_r[1] = (sm12 + sm21) / S;\n out_r[2] = (sm31 + sm13) / S;\n }\n else if (sm22 > sm33) {\n S = Math.sqrt(1.0 + sm22 - sm11 - sm33) * 2;\n out_r[3] = (sm31 - sm13) / S;\n out_r[0] = (sm12 + sm21) / S;\n out_r[1] = 0.25 * S;\n out_r[2] = (sm23 + sm32) / S;\n }\n else {\n S = Math.sqrt(1.0 + sm33 - sm11 - sm22) * 2;\n out_r[3] = (sm12 - sm21) / S;\n out_r[0] = (sm31 + sm13) / S;\n out_r[1] = (sm23 + sm32) / S;\n out_r[2] = 0.25 * S;\n }\n return out_r;\n}\n/**\n * Creates a matrix from a quaternion rotation, vector translation and vector scale\n * This is equivalent to (but much faster than):\n *\n * mat4.identity(dest);\n * mat4.translate(dest, vec);\n * let quatMat = mat4.create();\n * quat4.toMat4(quat, quatMat);\n * mat4.multiply(dest, quatMat);\n * mat4.scale(dest, scale)\n *\n * @param {mat4} out mat4 receiving operation result\n * @param {quat4} q Rotation quaternion\n * @param {ReadonlyVec3} v Translation vector\n * @param {ReadonlyVec3} s Scaling vector\n * @returns {mat4} out\n */\nexport function fromRotationTranslationScale(out, q, v, s) {\n // Quaternion math\n const x = q[0];\n const y = q[1];\n const z = q[2];\n const w = q[3];\n const x2 = x + x;\n const y2 = y + y;\n const z2 = z + z;\n const xx = x * x2;\n const xy = x * y2;\n const xz = x * z2;\n const yy = y * y2;\n const yz = y * z2;\n const zz = z * z2;\n const wx = w * x2;\n const wy = w * y2;\n const wz = w * z2;\n const sx = s[0];\n const sy = s[1];\n const sz = s[2];\n out[0] = (1 - (yy + zz)) * sx;\n out[1] = (xy + wz) * sx;\n out[2] = (xz - wy) * sx;\n out[3] = 0;\n out[4] = (xy - wz) * sy;\n out[5] = (1 - (xx + zz)) * sy;\n out[6] = (yz + wx) * sy;\n out[7] = 0;\n out[8] = (xz + wy) * sz;\n out[9] = (yz - wx) * sz;\n out[10] = (1 - (xx + yy)) * sz;\n out[11] = 0;\n out[12] = v[0];\n out[13] = v[1];\n out[14] = v[2];\n out[15] = 1;\n return out;\n}\n/**\n * Creates a matrix from a quaternion rotation, vector translation and vector scale, rotating and scaling around the given origin\n * This is equivalent to (but much faster than):\n *\n * mat4.identity(dest);\n * mat4.translate(dest, vec);\n * mat4.translate(dest, origin);\n * let quatMat = mat4.create();\n * quat4.toMat4(quat, quatMat);\n * mat4.multiply(dest, quatMat);\n * mat4.scale(dest, scale)\n * mat4.translate(dest, negativeOrigin);\n *\n * @param {mat4} out mat4 receiving operation result\n * @param {quat4} q Rotation quaternion\n * @param {ReadonlyVec3} v Translation vector\n * @param {ReadonlyVec3} s Scaling vector\n * @param {ReadonlyVec3} o The origin vector around which to scale and rotate\n * @returns {mat4} out\n */\nexport function fromRotationTranslationScaleOrigin(out, q, v, s, o) {\n // Quaternion math\n const x = q[0];\n const y = q[1];\n const z = q[2];\n const w = q[3];\n const x2 = x + x;\n const y2 = y + y;\n const z2 = z + z;\n const xx = x * x2;\n const xy = x * y2;\n const xz = x * z2;\n const yy = y * y2;\n const yz = y * z2;\n const zz = z * z2;\n const wx = w * x2;\n const wy = w * y2;\n const wz = w * z2;\n const sx = s[0];\n const sy = s[1];\n const sz = s[2];\n const ox = o[0];\n const oy = o[1];\n const oz = o[2];\n const out0 = (1 - (yy + zz)) * sx;\n const out1 = (xy + wz) * sx;\n const out2 = (xz - wy) * sx;\n const out4 = (xy - wz) * sy;\n const out5 = (1 - (xx + zz)) * sy;\n const out6 = (yz + wx) * sy;\n const out8 = (xz + wy) * sz;\n const out9 = (yz - wx) * sz;\n const out10 = (1 - (xx + yy)) * sz;\n out[0] = out0;\n out[1] = out1;\n out[2] = out2;\n out[3] = 0;\n out[4] = out4;\n out[5] = out5;\n out[6] = out6;\n out[7] = 0;\n out[8] = out8;\n out[9] = out9;\n out[10] = out10;\n out[11] = 0;\n out[12] = v[0] + ox - (out0 * ox + out4 * oy + out8 * oz);\n out[13] = v[1] + oy - (out1 * ox + out5 * oy + out9 * oz);\n out[14] = v[2] + oz - (out2 * ox + out6 * oy + out10 * oz);\n out[15] = 1;\n return out;\n}\n/**\n * Calculates a 4x4 matrix from the given quaternion\n *\n * @param {mat4} out mat4 receiving operation result\n * @param {ReadonlyQuat} q Quaternion to create matrix from\n *\n * @returns {mat4} out\n */\nexport function fromQuat(out, q) {\n const x = q[0];\n const y = q[1];\n const z = q[2];\n const w = q[3];\n const x2 = x + x;\n const y2 = y + y;\n const z2 = z + z;\n const xx = x * x2;\n const yx = y * x2;\n const yy = y * y2;\n const zx = z * x2;\n const zy = z * y2;\n const zz = z * z2;\n const wx = w * x2;\n const wy = w * y2;\n const wz = w * z2;\n out[0] = 1 - yy - zz;\n out[1] = yx + wz;\n out[2] = zx - wy;\n out[3] = 0;\n out[4] = yx - wz;\n out[5] = 1 - xx - zz;\n out[6] = zy + wx;\n out[7] = 0;\n out[8] = zx + wy;\n out[9] = zy - wx;\n out[10] = 1 - xx - yy;\n out[11] = 0;\n out[12] = 0;\n out[13] = 0;\n out[14] = 0;\n out[15] = 1;\n return out;\n}\n/**\n * Generates a frustum matrix with the given bounds\n *\n * @param {mat4} out mat4 frustum matrix will be written into\n * @param {Number} left Left bound of the frustum\n * @param {Number} right Right bound of the frustum\n * @param {Number} bottom Bottom bound of the frustum\n * @param {Number} top Top bound of the frustum\n * @param {Number} near Near bound of the frustum\n * @param {Number} far Far bound of the frustum\n * @returns {mat4} out\n */\nexport function frustum(out, left, right, bottom, top, near, far) {\n const rl = 1 / (right - left);\n const tb = 1 / (top - bottom);\n const nf = 1 / (near - far);\n out[0] = near * 2 * rl;\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[4] = 0;\n out[5] = near * 2 * tb;\n out[6] = 0;\n out[7] = 0;\n out[8] = (right + left) * rl;\n out[9] = (top + bottom) * tb;\n out[10] = (far + near) * nf;\n out[11] = -1;\n out[12] = 0;\n out[13] = 0;\n out[14] = far * near * 2 * nf;\n out[15] = 0;\n return out;\n}\n/**\n * Generates a perspective projection matrix with the given bounds.\n * The near/far clip planes correspond to a normalized device coordinate Z range of [-1, 1],\n * which matches WebGL/OpenGL's clip volume.\n * Passing null/undefined/no value for far will generate infinite projection matrix.\n *\n * @param {mat4} out mat4 frustum matrix will be written into\n * @param {number} fovy Vertical field of view in radians\n * @param {number} aspect Aspect ratio. typically viewport width/height\n * @param {number} near Near bound of the frustum\n * @param {number} far Far bound of the frustum, can be null or Infinity\n * @returns {mat4} out\n */\nexport function perspectiveNO(out, fovy, aspect, near, far) {\n const f = 1.0 / Math.tan(fovy / 2);\n out[0] = f / aspect;\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[4] = 0;\n out[5] = f;\n out[6] = 0;\n out[7] = 0;\n out[8] = 0;\n out[9] = 0;\n out[11] = -1;\n out[12] = 0;\n out[13] = 0;\n out[15] = 0;\n if (far != null && far !== Infinity) {\n const nf = 1 / (near - far);\n out[10] = (far + near) * nf;\n out[14] = 2 * far * near * nf;\n }\n else {\n out[10] = -1;\n out[14] = -2 * near;\n }\n return out;\n}\n/**\n * Alias for {@link mat4.perspectiveNO}\n * @function\n */\nexport const perspective = perspectiveNO;\n/**\n * Generates a perspective projection matrix suitable for WebGPU with the given bounds.\n * The near/far clip planes correspond to a normalized device coordinate Z range of [0, 1],\n * which matches WebGPU/Vulkan/DirectX/Metal's clip volume.\n * Passing null/undefined/no value for far will generate infinite projection matrix.\n *\n * @param {mat4} out mat4 frustum matrix will be written into\n * @param {number} fovy Vertical field of view in radians\n * @param {number} aspect Aspect ratio. typically viewport width/height\n * @param {number} near Near bound of the frustum\n * @param {number} far Far bound of the frustum, can be null or Infinity\n * @returns {mat4} out\n */\nexport function perspectiveZO(out, fovy, aspect, near, far) {\n const f = 1.0 / Math.tan(fovy / 2);\n out[0] = f / aspect;\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[4] = 0;\n out[5] = f;\n out[6] = 0;\n out[7] = 0;\n out[8] = 0;\n out[9] = 0;\n out[11] = -1;\n out[12] = 0;\n out[13] = 0;\n out[15] = 0;\n if (far != null && far !== Infinity) {\n const nf = 1 / (near - far);\n out[10] = far * nf;\n out[14] = far * near * nf;\n }\n else {\n out[10] = -1;\n out[14] = -near;\n }\n return out;\n}\n/**\n * Generates a perspective projection matrix with the given field of view.\n * This is primarily useful for generating projection matrices to be used\n * with the still experiemental WebVR API.\n *\n * @param {mat4} out mat4 frustum matrix will be written into\n * @param {Object} fov Object containing the following values: upDegrees, downDegrees, leftDegrees, rightDegrees\n * @param {number} near Near bound of the frustum\n * @param {number} far Far bound of the frustum\n * @returns {mat4} out\n */\nexport function perspectiveFromFieldOfView(out, fov, near, far) {\n const upTan = Math.tan((fov.upDegrees * Math.PI) / 180.0);\n const downTan = Math.tan((fov.downDegrees * Math.PI) / 180.0);\n const leftTan = Math.tan((fov.leftDegrees * Math.PI) / 180.0);\n const rightTan = Math.tan((fov.rightDegrees * Math.PI) / 180.0);\n const xScale = 2.0 / (leftTan + rightTan);\n const yScale = 2.0 / (upTan + downTan);\n out[0] = xScale;\n out[1] = 0.0;\n out[2] = 0.0;\n out[3] = 0.0;\n out[4] = 0.0;\n out[5] = yScale;\n out[6] = 0.0;\n out[7] = 0.0;\n out[8] = -((leftTan - rightTan) * xScale * 0.5);\n out[9] = (upTan - downTan) * yScale * 0.5;\n out[10] = far / (near - far);\n out[11] = -1.0;\n out[12] = 0.0;\n out[13] = 0.0;\n out[14] = (far * near) / (near - far);\n out[15] = 0.0;\n return out;\n}\n/**\n * Generates a orthogonal projection matrix with the given bounds.\n * The near/far clip planes correspond to a normalized device coordinate Z range of [-1, 1],\n * which matches WebGL/OpenGL's clip volume.\n *\n * @param {mat4} out mat4 frustum matrix will be written into\n * @param {number} left Left bound of the frustum\n * @param {number} right Right bound of the frustum\n * @param {number} bottom Bottom bound of the frustum\n * @param {number} top Top bound of the frustum\n * @param {number} near Near bound of the frustum\n * @param {number} far Far bound of the frustum\n * @returns {mat4} out\n */\nexport function orthoNO(out, left, right, bottom, top, near, far) {\n const lr = 1 / (left - right);\n const bt = 1 / (bottom - top);\n const nf = 1 / (near - far);\n out[0] = -2 * lr;\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[4] = 0;\n out[5] = -2 * bt;\n out[6] = 0;\n out[7] = 0;\n out[8] = 0;\n out[9] = 0;\n out[10] = 2 * nf;\n out[11] = 0;\n out[12] = (left + right) * lr;\n out[13] = (top + bottom) * bt;\n out[14] = (far + near) * nf;\n out[15] = 1;\n return out;\n}\n/**\n * Alias for {@link mat4.orthoNO}\n * @function\n */\nexport const ortho = orthoNO;\n/**\n * Generates a orthogonal projection matrix with the given bounds.\n * The near/far clip planes correspond to a normalized device coordinate Z range of [0, 1],\n * which matches WebGPU/Vulkan/DirectX/Metal's clip volume.\n *\n * @param {mat4} out mat4 frustum matrix will be written into\n * @param {number} left Left bound of the frustum\n * @param {number} right Right bound of the frustum\n * @param {number} bottom Bottom bound of the frustum\n * @param {number} top Top bound of the frustum\n * @param {number} near Near bound of the frustum\n * @param {number} far Far bound of the frustum\n * @returns {mat4} out\n */\nexport function orthoZO(out, left, right, bottom, top, near, far) {\n const lr = 1 / (left - right);\n const bt = 1 / (bottom - top);\n const nf = 1 / (near - far);\n out[0] = -2 * lr;\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[4] = 0;\n out[5] = -2 * bt;\n out[6] = 0;\n out[7] = 0;\n out[8] = 0;\n out[9] = 0;\n out[10] = nf;\n out[11] = 0;\n out[12] = (left + right) * lr;\n out[13] = (top + bottom) * bt;\n out[14] = near * nf;\n out[15] = 1;\n return out;\n}\n/**\n * Generates a look-at matrix with the given eye position, focal point, and up axis.\n * If you want a matrix that actually makes an object look at another object, you should use targetTo instead.\n *\n * @param {mat4} out mat4 frustum matrix will be written into\n * @param {ReadonlyVec3} eye Position of the viewer\n * @param {ReadonlyVec3} center Point the viewer is looking at\n * @param {ReadonlyVec3} up vec3 pointing up\n * @returns {mat4} out\n */\nexport function lookAt(out, eye, center, up) {\n let len;\n let x0;\n let x1;\n let x2;\n let y0;\n let y1;\n let y2;\n let z0;\n let z1;\n let z2;\n const eyex = eye[0];\n const eyey = eye[1];\n const eyez = eye[2];\n const upx = up[0];\n const upy = up[1];\n const upz = up[2];\n const centerx = center[0];\n const centery = center[1];\n const centerz = center[2];\n if (Math.abs(eyex - centerx) < glMatrix.EPSILON &&\n Math.abs(eyey - centery) < glMatrix.EPSILON &&\n Math.abs(eyez - centerz) < glMatrix.EPSILON) {\n return identity(out);\n }\n z0 = eyex - centerx;\n z1 = eyey - centery;\n z2 = eyez - centerz;\n len = 1 / Math.sqrt(z0 * z0 + z1 * z1 + z2 * z2);\n z0 *= len;\n z1 *= len;\n z2 *= len;\n x0 = upy * z2 - upz * z1;\n x1 = upz * z0 - upx * z2;\n x2 = upx * z1 - upy * z0;\n len = Math.sqrt(x0 * x0 + x1 * x1 + x2 * x2);\n if (!len) {\n x0 = 0;\n x1 = 0;\n x2 = 0;\n }\n else {\n len = 1 / len;\n x0 *= len;\n x1 *= len;\n x2 *= len;\n }\n y0 = z1 * x2 - z2 * x1;\n y1 = z2 * x0 - z0 * x2;\n y2 = z0 * x1 - z1 * x0;\n len = Math.sqrt(y0 * y0 + y1 * y1 + y2 * y2);\n if (!len) {\n y0 = 0;\n y1 = 0;\n y2 = 0;\n }\n else {\n len = 1 / len;\n y0 *= len;\n y1 *= len;\n y2 *= len;\n }\n out[0] = x0;\n out[1] = y0;\n out[2] = z0;\n out[3] = 0;\n out[4] = x1;\n out[5] = y1;\n out[6] = z1;\n out[7] = 0;\n out[8] = x2;\n out[9] = y2;\n out[10] = z2;\n out[11] = 0;\n out[12] = -(x0 * eyex + x1 * eyey + x2 * eyez);\n out[13] = -(y0 * eyex + y1 * eyey + y2 * eyez);\n out[14] = -(z0 * eyex + z1 * eyey + z2 * eyez);\n out[15] = 1;\n return out;\n}\n/**\n * Generates a matrix that makes something look at something else.\n *\n * @param {mat4} out mat4 frustum matrix will be written into\n * @param {ReadonlyVec3} eye Position of the viewer\n * @param {ReadonlyVec3} center Point the viewer is looking at\n * @param {ReadonlyVec3} up vec3 pointing up\n * @returns {mat4} out\n */\nexport function targetTo(out, eye, target, up) {\n const eyex = eye[0];\n const eyey = eye[1];\n const eyez = eye[2];\n const upx = up[0];\n const upy = up[1];\n const upz = up[2];\n let z0 = eyex - target[0];\n let z1 = eyey - target[1];\n let z2 = eyez - target[2];\n let len = z0 * z0 + z1 * z1 + z2 * z2;\n if (len > 0) {\n len = 1 / Math.sqrt(len);\n z0 *= len;\n z1 *= len;\n z2 *= len;\n }\n let x0 = upy * z2 - upz * z1;\n let x1 = upz * z0 - upx * z2;\n let x2 = upx * z1 - upy * z0;\n len = x0 * x0 + x1 * x1 + x2 * x2;\n if (len > 0) {\n len = 1 / Math.sqrt(len);\n x0 *= len;\n x1 *= len;\n x2 *= len;\n }\n out[0] = x0;\n out[1] = x1;\n out[2] = x2;\n out[3] = 0;\n out[4] = z1 * x2 - z2 * x1;\n out[5] = z2 * x0 - z0 * x2;\n out[6] = z0 * x1 - z1 * x0;\n out[7] = 0;\n out[8] = z0;\n out[9] = z1;\n out[10] = z2;\n out[11] = 0;\n out[12] = eyex;\n out[13] = eyey;\n out[14] = eyez;\n out[15] = 1;\n return out;\n}\n/**\n * Returns a string representation of a mat4\n *\n * @param {ReadonlyMat4} a matrix to represent as a string\n * @returns {String} string representation of the matrix\n */\nexport function str(a) {\n return `mat4(${a[0]}, ${a[1]}, ${a[2]}, ${a[3]}, ${a[4]}, ${a[5]}, ${a[6]}, ${a[7]}, ${a[8]}, ${a[9]}, ${a[10]}, ${a[11]}, ${a[12]}, ${a[13]}, ${a[14]}, ${a[15]})`;\n}\n/**\n * Returns Frobenius norm of a mat4\n *\n * @param {ReadonlyMat4} a the matrix to calculate Frobenius norm of\n * @returns {Number} Frobenius norm\n */\nexport function frob(a) {\n return Math.sqrt(a[0] * a[0] +\n a[1] * a[1] +\n a[2] * a[2] +\n a[3] * a[3] +\n a[4] * a[4] +\n a[5] * a[5] +\n a[6] * a[6] +\n a[7] * a[7] +\n a[8] * a[8] +\n a[9] * a[9] +\n a[10] * a[10] +\n a[11] * a[11] +\n a[12] * a[12] +\n a[13] * a[13] +\n a[14] * a[14] +\n a[15] * a[15]);\n}\n/**\n * Adds two mat4's\n *\n * @param {mat4} out the receiving matrix\n * @param {ReadonlyMat4} a the first operand\n * @param {ReadonlyMat4} b the second operand\n * @returns {mat4} out\n */\nexport function add(out, a, b) {\n out[0] = a[0] + b[0];\n out[1] = a[1] + b[1];\n out[2] = a[2] + b[2];\n out[3] = a[3] + b[3];\n out[4] = a[4] + b[4];\n out[5] = a[5] + b[5];\n out[6] = a[6] + b[6];\n out[7] = a[7] + b[7];\n out[8] = a[8] + b[8];\n out[9] = a[9] + b[9];\n out[10] = a[10] + b[10];\n out[11] = a[11] + b[11];\n out[12] = a[12] + b[12];\n out[13] = a[13] + b[13];\n out[14] = a[14] + b[14];\n out[15] = a[15] + b[15];\n return out;\n}\n/**\n * Subtracts matrix b from matrix a\n *\n * @param {mat4} out the receiving matrix\n * @param {ReadonlyMat4} a the first operand\n * @param {ReadonlyMat4} b the second operand\n * @returns {mat4} out\n */\nexport function subtract(out, a, b) {\n out[0] = a[0] - b[0];\n out[1] = a[1] - b[1];\n out[2] = a[2] - b[2];\n out[3] = a[3] - b[3];\n out[4] = a[4] - b[4];\n out[5] = a[5] - b[5];\n out[6] = a[6] - b[6];\n out[7] = a[7] - b[7];\n out[8] = a[8] - b[8];\n out[9] = a[9] - b[9];\n out[10] = a[10] - b[10];\n out[11] = a[11] - b[11];\n out[12] = a[12] - b[12];\n out[13] = a[13] - b[13];\n out[14] = a[14] - b[14];\n out[15] = a[15] - b[15];\n return out;\n}\n/**\n * Multiply each element of the matrix by a scalar.\n *\n * @param {mat4} out the receiving matrix\n * @param {ReadonlyMat4} a the matrix to scale\n * @param {Number} b amount to scale the matrix's elements by\n * @returns {mat4} out\n */\nexport function multiplyScalar(out, a, b) {\n out[0] = a[0] * b;\n out[1] = a[1] * b;\n out[2] = a[2] * b;\n out[3] = a[3] * b;\n out[4] = a[4] * b;\n out[5] = a[5] * b;\n out[6] = a[6] * b;\n out[7] = a[7] * b;\n out[8] = a[8] * b;\n out[9] = a[9] * b;\n out[10] = a[10] * b;\n out[11] = a[11] * b;\n out[12] = a[12] * b;\n out[13] = a[13] * b;\n out[14] = a[14] * b;\n out[15] = a[15] * b;\n return out;\n}\n/**\n * Adds two mat4's after multiplying each element of the second operand by a scalar value.\n *\n * @param {mat4} out the receiving vector\n * @param {ReadonlyMat4} a the first operand\n * @param {ReadonlyMat4} b the second operand\n * @param {Number} scale the amount to scale b's elements by before adding\n * @returns {mat4} out\n */\nexport function multiplyScalarAndAdd(out, a, b, scale) {\n out[0] = a[0] + b[0] * scale;\n out[1] = a[1] + b[1] * scale;\n out[2] = a[2] + b[2] * scale;\n out[3] = a[3] + b[3] * scale;\n out[4] = a[4] + b[4] * scale;\n out[5] = a[5] + b[5] * scale;\n out[6] = a[6] + b[6] * scale;\n out[7] = a[7] + b[7] * scale;\n out[8] = a[8] + b[8] * scale;\n out[9] = a[9] + b[9] * scale;\n out[10] = a[10] + b[10] * scale;\n out[11] = a[11] + b[11] * scale;\n out[12] = a[12] + b[12] * scale;\n out[13] = a[13] + b[13] * scale;\n out[14] = a[14] + b[14] * scale;\n out[15] = a[15] + b[15] * scale;\n return out;\n}\n/**\n * Returns whether or not the matrices have exactly the same elements in the same position (when compared with ===)\n *\n * @param {ReadonlyMat4} a The first matrix.\n * @param {ReadonlyMat4} b The second matrix.\n * @returns {Boolean} True if the matrices are equal, false otherwise.\n */\nexport function exactEquals(a, b) {\n return (a[0] === b[0] &&\n a[1] === b[1] &&\n a[2] === b[2] &&\n a[3] === b[3] &&\n a[4] === b[4] &&\n a[5] === b[5] &&\n a[6] === b[6] &&\n a[7] === b[7] &&\n a[8] === b[8] &&\n a[9] === b[9] &&\n a[10] === b[10] &&\n a[11] === b[11] &&\n a[12] === b[12] &&\n a[13] === b[13] &&\n a[14] === b[14] &&\n a[15] === b[15]);\n}\n/**\n * Returns whether or not the matrices have approximately the same elements in the same position.\n *\n * @param {ReadonlyMat4} a The first matrix.\n * @param {ReadonlyMat4} b The second matrix.\n * @returns {Boolean} True if the matrices are equal, false otherwise.\n */\nexport function equals(a, b) {\n const a0 = a[0];\n const a1 = a[1];\n const a2 = a[2];\n const a3 = a[3];\n const a4 = a[4];\n const a5 = a[5];\n const a6 = a[6];\n const a7 = a[7];\n const a8 = a[8];\n const a9 = a[9];\n const a10 = a[10];\n const a11 = a[11];\n const a12 = a[12];\n const a13 = a[13];\n const a14 = a[14];\n const a15 = a[15];\n const b0 = b[0];\n const b1 = b[1];\n const b2 = b[2];\n const b3 = b[3];\n const b4 = b[4];\n const b5 = b[5];\n const b6 = b[6];\n const b7 = b[7];\n const b8 = b[8];\n const b9 = b[9];\n const b10 = b[10];\n const b11 = b[11];\n const b12 = b[12];\n const b13 = b[13];\n const b14 = b[14];\n const b15 = b[15];\n return (Math.abs(a0 - b0) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a0), Math.abs(b0)) &&\n Math.abs(a1 - b1) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a1), Math.abs(b1)) &&\n Math.abs(a2 - b2) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a2), Math.abs(b2)) &&\n Math.abs(a3 - b3) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a3), Math.abs(b3)) &&\n Math.abs(a4 - b4) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a4), Math.abs(b4)) &&\n Math.abs(a5 - b5) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a5), Math.abs(b5)) &&\n Math.abs(a6 - b6) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a6), Math.abs(b6)) &&\n Math.abs(a7 - b7) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a7), Math.abs(b7)) &&\n Math.abs(a8 - b8) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a8), Math.abs(b8)) &&\n Math.abs(a9 - b9) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a9), Math.abs(b9)) &&\n Math.abs(a10 - b10) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a10), Math.abs(b10)) &&\n Math.abs(a11 - b11) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a11), Math.abs(b11)) &&\n Math.abs(a12 - b12) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a12), Math.abs(b12)) &&\n Math.abs(a13 - b13) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a13), Math.abs(b13)) &&\n Math.abs(a14 - b14) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a14), Math.abs(b14)) &&\n Math.abs(a15 - b15) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a15), Math.abs(b15)));\n}\n/**\n * Alias for {@link mat4.multiply}\n * @function\n */\nexport const mul = multiply;\n/**\n * Alias for {@link mat4.subtract}\n * @function\n */\nexport const sub = subtract;\n//# sourceMappingURL=mat4.js.map","// @eslint-disable\n// @ts-nocheck\nimport * as glMatrix from './common.js';\n/**\n * 4 Dimensional Vector\n * @module vec4\n */\n/**\n * Creates a new, empty vec4\n *\n * @returns {vec4} a new 4D vector\n */\nexport function create() {\n const out = new glMatrix.ARRAY_TYPE(4);\n if (glMatrix.ARRAY_TYPE != Float32Array) {\n out[0] = 0;\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n }\n return out;\n}\n/**\n * Creates a new vec4 initialized with values from an existing vector\n *\n * @param {ReadonlyVec4} a vector to clone\n * @returns {vec4} a new 4D vector\n */\nexport function clone(a) {\n const out = new glMatrix.ARRAY_TYPE(4);\n out[0] = a[0];\n out[1] = a[1];\n out[2] = a[2];\n out[3] = a[3];\n return out;\n}\n/**\n * Creates a new vec4 initialized with the given values\n *\n * @param {Number} x X component\n * @param {Number} y Y component\n * @param {Number} z Z component\n * @param {Number} w W component\n * @returns {vec4} a new 4D vector\n */\nexport function fromValues(x, y, z, w) {\n const out = new glMatrix.ARRAY_TYPE(4);\n out[0] = x;\n out[1] = y;\n out[2] = z;\n out[3] = w;\n return out;\n}\n/**\n * Copy the values from one vec4 to another\n *\n * @param {vec4} out the receiving vector\n * @param {ReadonlyVec4} a the source vector\n * @returns {vec4} out\n */\nexport function copy(out, a) {\n out[0] = a[0];\n out[1] = a[1];\n out[2] = a[2];\n out[3] = a[3];\n return out;\n}\n/**\n * Set the components of a vec4 to the given values\n *\n * @param {vec4} out the receiving vector\n * @param {Number} x X component\n * @param {Number} y Y component\n * @param {Number} z Z component\n * @param {Number} w W component\n * @returns {vec4} out\n */\nexport function set(out, x, y, z, w) {\n out[0] = x;\n out[1] = y;\n out[2] = z;\n out[3] = w;\n return out;\n}\n/**\n * Adds two vec4's\n *\n * @param {vec4} out the receiving vector\n * @param {ReadonlyVec4} a the first operand\n * @param {ReadonlyVec4} b the second operand\n * @returns {vec4} out\n */\nexport function add(out, a, b) {\n out[0] = a[0] + b[0];\n out[1] = a[1] + b[1];\n out[2] = a[2] + b[2];\n out[3] = a[3] + b[3];\n return out;\n}\n/**\n * Subtracts vector b from vector a\n *\n * @param {vec4} out the receiving vector\n * @param {ReadonlyVec4} a the first operand\n * @param {ReadonlyVec4} b the second operand\n * @returns {vec4} out\n */\nexport function subtract(out, a, b) {\n out[0] = a[0] - b[0];\n out[1] = a[1] - b[1];\n out[2] = a[2] - b[2];\n out[3] = a[3] - b[3];\n return out;\n}\n/**\n * Multiplies two vec4's\n *\n * @param {vec4} out the receiving vector\n * @param {ReadonlyVec4} a the first operand\n * @param {ReadonlyVec4} b the second operand\n * @returns {vec4} out\n */\nexport function multiply(out, a, b) {\n out[0] = a[0] * b[0];\n out[1] = a[1] * b[1];\n out[2] = a[2] * b[2];\n out[3] = a[3] * b[3];\n return out;\n}\n/**\n * Divides two vec4's\n *\n * @param {vec4} out the receiving vector\n * @param {ReadonlyVec4} a the first operand\n * @param {ReadonlyVec4} b the second operand\n * @returns {vec4} out\n */\nexport function divide(out, a, b) {\n out[0] = a[0] / b[0];\n out[1] = a[1] / b[1];\n out[2] = a[2] / b[2];\n out[3] = a[3] / b[3];\n return out;\n}\n/**\n * Math.ceil the components of a vec4\n *\n * @param {vec4} out the receiving vector\n * @param {ReadonlyVec4} a vector to ceil\n * @returns {vec4} out\n */\nexport function ceil(out, a) {\n out[0] = Math.ceil(a[0]);\n out[1] = Math.ceil(a[1]);\n out[2] = Math.ceil(a[2]);\n out[3] = Math.ceil(a[3]);\n return out;\n}\n/**\n * Math.floor the components of a vec4\n *\n * @param {vec4} out the receiving vector\n * @param {ReadonlyVec4} a vector to floor\n * @returns {vec4} out\n */\nexport function floor(out, a) {\n out[0] = Math.floor(a[0]);\n out[1] = Math.floor(a[1]);\n out[2] = Math.floor(a[2]);\n out[3] = Math.floor(a[3]);\n return out;\n}\n/**\n * Returns the minimum of two vec4's\n *\n * @param {vec4} out the receiving vector\n * @param {ReadonlyVec4} a the first operand\n * @param {ReadonlyVec4} b the second operand\n * @returns {vec4} out\n */\nexport function min(out, a, b) {\n out[0] = Math.min(a[0], b[0]);\n out[1] = Math.min(a[1], b[1]);\n out[2] = Math.min(a[2], b[2]);\n out[3] = Math.min(a[3], b[3]);\n return out;\n}\n/**\n * Returns the maximum of two vec4's\n *\n * @param {vec4} out the receiving vector\n * @param {ReadonlyVec4} a the first operand\n * @param {ReadonlyVec4} b the second operand\n * @returns {vec4} out\n */\nexport function max(out, a, b) {\n out[0] = Math.max(a[0], b[0]);\n out[1] = Math.max(a[1], b[1]);\n out[2] = Math.max(a[2], b[2]);\n out[3] = Math.max(a[3], b[3]);\n return out;\n}\n/**\n * symmetric round the components of a vec4\n *\n * @param {vec4} out the receiving vector\n * @param {ReadonlyVec4} a vector to round\n * @returns {vec4} out\n */\nexport function round(out, a) {\n out[0] = glMatrix.round(a[0]);\n out[1] = glMatrix.round(a[1]);\n out[2] = glMatrix.round(a[2]);\n out[3] = glMatrix.round(a[3]);\n return out;\n}\n/**\n * Scales a vec4 by a scalar number\n *\n * @param {vec4} out the receiving vector\n * @param {ReadonlyVec4} a the vector to scale\n * @param {Number} b amount to scale the vector by\n * @returns {vec4} out\n */\nexport function scale(out, a, b) {\n out[0] = a[0] * b;\n out[1] = a[1] * b;\n out[2] = a[2] * b;\n out[3] = a[3] * b;\n return out;\n}\n/**\n * Adds two vec4's after scaling the second operand by a scalar value\n *\n * @param {vec4} out the receiving vector\n * @param {ReadonlyVec4} a the first operand\n * @param {ReadonlyVec4} b the second operand\n * @param {Number} scale the amount to scale b by before adding\n * @returns {vec4} out\n */\nexport function scaleAndAdd(out, a, b, scale) {\n out[0] = a[0] + b[0] * scale;\n out[1] = a[1] + b[1] * scale;\n out[2] = a[2] + b[2] * scale;\n out[3] = a[3] + b[3] * scale;\n return out;\n}\n/**\n * Calculates the euclidian distance between two vec4's\n *\n * @param {ReadonlyVec4} a the first operand\n * @param {ReadonlyVec4} b the second operand\n * @returns {Number} distance between a and b\n */\nexport function distance(a, b) {\n const x = b[0] - a[0];\n const y = b[1] - a[1];\n const z = b[2] - a[2];\n const w = b[3] - a[3];\n return Math.sqrt(x * x + y * y + z * z + w * w);\n}\n/**\n * Calculates the squared euclidian distance between two vec4's\n *\n * @param {ReadonlyVec4} a the first operand\n * @param {ReadonlyVec4} b the second operand\n * @returns {Number} squared distance between a and b\n */\nexport function squaredDistance(a, b) {\n const x = b[0] - a[0];\n const y = b[1] - a[1];\n const z = b[2] - a[2];\n const w = b[3] - a[3];\n return x * x + y * y + z * z + w * w;\n}\n/**\n * Calculates the length of a vec4\n *\n * @param {ReadonlyVec4} a vector to calculate length of\n * @returns {Number} length of a\n */\nexport function length(a) {\n const x = a[0];\n const y = a[1];\n const z = a[2];\n const w = a[3];\n return Math.sqrt(x * x + y * y + z * z + w * w);\n}\n/**\n * Calculates the squared length of a vec4\n *\n * @param {ReadonlyVec4} a vector to calculate squared length of\n * @returns {Number} squared length of a\n */\nexport function squaredLength(a) {\n const x = a[0];\n const y = a[1];\n const z = a[2];\n const w = a[3];\n return x * x + y * y + z * z + w * w;\n}\n/**\n * Negates the components of a vec4\n *\n * @param {vec4} out the receiving vector\n * @param {ReadonlyVec4} a vector to negate\n * @returns {vec4} out\n */\nexport function negate(out, a) {\n out[0] = -a[0];\n out[1] = -a[1];\n out[2] = -a[2];\n out[3] = -a[3];\n return out;\n}\n/**\n * Returns the inverse of the components of a vec4\n *\n * @param {vec4} out the receiving vector\n * @param {ReadonlyVec4} a vector to invert\n * @returns {vec4} out\n */\nexport function inverse(out, a) {\n out[0] = 1.0 / a[0];\n out[1] = 1.0 / a[1];\n out[2] = 1.0 / a[2];\n out[3] = 1.0 / a[3];\n return out;\n}\n/**\n * Normalize a vec4\n *\n * @param {vec4} out the receiving vector\n * @param {ReadonlyVec4} a vector to normalize\n * @returns {vec4} out\n */\nexport function normalize(out, a) {\n const x = a[0];\n const y = a[1];\n const z = a[2];\n const w = a[3];\n let len = x * x + y * y + z * z + w * w;\n if (len > 0) {\n len = 1 / Math.sqrt(len);\n }\n out[0] = x * len;\n out[1] = y * len;\n out[2] = z * len;\n out[3] = w * len;\n return out;\n}\n/**\n * Calculates the dot product of two vec4's\n *\n * @param {ReadonlyVec4} a the first operand\n * @param {ReadonlyVec4} b the second operand\n * @returns {Number} dot product of a and b\n */\nexport function dot(a, b) {\n return a[0] * b[0] + a[1] * b[1] + a[2] * b[2] + a[3] * b[3];\n}\n/**\n * Returns the cross-product of three vectors in a 4-dimensional space\n *\n * @param {ReadonlyVec4} result the receiving vector\n * @param {ReadonlyVec4} U the first vector\n * @param {ReadonlyVec4} V the second vector\n * @param {ReadonlyVec4} W the third vector\n * @returns {vec4} result\n */\nexport function cross(out, u, v, w) {\n const A = v[0] * w[1] - v[1] * w[0];\n const B = v[0] * w[2] - v[2] * w[0];\n const C = v[0] * w[3] - v[3] * w[0];\n const D = v[1] * w[2] - v[2] * w[1];\n const E = v[1] * w[3] - v[3] * w[1];\n const F = v[2] * w[3] - v[3] * w[2];\n const G = u[0];\n const H = u[1];\n const I = u[2];\n const J = u[3];\n out[0] = H * F - I * E + J * D;\n out[1] = -(G * F) + I * C - J * B;\n out[2] = G * E - H * C + J * A;\n out[3] = -(G * D) + H * B - I * A;\n return out;\n}\n/**\n * Performs a linear interpolation between two vec4's\n *\n * @param {vec4} out the receiving vector\n * @param {ReadonlyVec4} a the first operand\n * @param {ReadonlyVec4} b the second operand\n * @param {Number} t interpolation amount, in the range [0-1], between the two inputs\n * @returns {vec4} out\n */\nexport function lerp(out, a, b, t) {\n const ax = a[0];\n const ay = a[1];\n const az = a[2];\n const aw = a[3];\n out[0] = ax + t * (b[0] - ax);\n out[1] = ay + t * (b[1] - ay);\n out[2] = az + t * (b[2] - az);\n out[3] = aw + t * (b[3] - aw);\n return out;\n}\n/**\n * Generates a random vector with the given scale\n *\n * @param {vec4} out the receiving vector\n * @param {Number} [scale] Length of the resulting vector. If omitted, a unit vector will be returned\n * @returns {vec4} out\n */\nexport function random(out, scale) {\n scale = scale === undefined ? 1.0 : scale;\n // Marsaglia, George. Choosing a Point from the Surface of a\n // Sphere. Ann. Math. Statist. 43 (1972), no. 2, 645--646.\n // http://projecteuclid.org/euclid.aoms/1177692644;\n let v1;\n let v2;\n let v3;\n let v4;\n let s1;\n let s2;\n do {\n v1 = glMatrix.RANDOM() * 2 - 1;\n v2 = glMatrix.RANDOM() * 2 - 1;\n s1 = v1 * v1 + v2 * v2;\n } while (s1 >= 1);\n do {\n v3 = glMatrix.RANDOM() * 2 - 1;\n v4 = glMatrix.RANDOM() * 2 - 1;\n s2 = v3 * v3 + v4 * v4;\n } while (s2 >= 1);\n const d = Math.sqrt((1 - s1) / s2);\n out[0] = scale * v1;\n out[1] = scale * v2;\n out[2] = scale * v3 * d;\n out[3] = scale * v4 * d;\n return out;\n}\n/**\n * Transforms the vec4 with a mat4.\n *\n * @param {vec4} out the receiving vector\n * @param {ReadonlyVec4} a the vector to transform\n * @param {ReadonlyMat4} m matrix to transform with\n * @returns {vec4} out\n */\nexport function transformMat4(out, a, m) {\n const x = a[0];\n const y = a[1];\n const z = a[2];\n const w = a[3];\n out[0] = m[0] * x + m[4] * y + m[8] * z + m[12] * w;\n out[1] = m[1] * x + m[5] * y + m[9] * z + m[13] * w;\n out[2] = m[2] * x + m[6] * y + m[10] * z + m[14] * w;\n out[3] = m[3] * x + m[7] * y + m[11] * z + m[15] * w;\n return out;\n}\n/**\n * Transforms the vec4 with a quat\n *\n * @param {vec4} out the receiving vector\n * @param {ReadonlyVec4} a the vector to transform\n * @param {ReadonlyQuat} q quaternion to transform with\n * @returns {vec4} out\n */\nexport function transformQuat(out, a, q) {\n const x = a[0];\n const y = a[1];\n const z = a[2];\n const qx = q[0];\n const qy = q[1];\n const qz = q[2];\n const qw = q[3];\n // calculate quat * vec\n const ix = qw * x + qy * z - qz * y;\n const iy = qw * y + qz * x - qx * z;\n const iz = qw * z + qx * y - qy * x;\n const iw = -qx * x - qy * y - qz * z;\n // calculate result * inverse quat\n out[0] = ix * qw + iw * -qx + iy * -qz - iz * -qy;\n out[1] = iy * qw + iw * -qy + iz * -qx - ix * -qz;\n out[2] = iz * qw + iw * -qz + ix * -qy - iy * -qx;\n out[3] = a[3];\n return out;\n}\n/**\n * Set the components of a vec4 to zero\n *\n * @param {vec4} out the receiving vector\n * @returns {vec4} out\n */\nexport function zero(out) {\n out[0] = 0.0;\n out[1] = 0.0;\n out[2] = 0.0;\n out[3] = 0.0;\n return out;\n}\n/**\n * Returns a string representation of a vector\n *\n * @param {ReadonlyVec4} a vector to represent as a string\n * @returns {String} string representation of the vector\n */\nexport function str(a) {\n return `vec4(${a[0]}, ${a[1]}, ${a[2]}, ${a[3]})`;\n}\n/**\n * Returns whether or not the vectors have exactly the same elements in the same position (when compared with ===)\n *\n * @param {ReadonlyVec4} a The first vector.\n * @param {ReadonlyVec4} b The second vector.\n * @returns {Boolean} True if the vectors are equal, false otherwise.\n */\nexport function exactEquals(a, b) {\n return a[0] === b[0] && a[1] === b[1] && a[2] === b[2] && a[3] === b[3];\n}\n/**\n * Returns whether or not the vectors have approximately the same elements in the same position.\n *\n * @param {ReadonlyVec4} a The first vector.\n * @param {ReadonlyVec4} b The second vector.\n * @returns {Boolean} True if the vectors are equal, false otherwise.\n */\nexport function equals(a, b) {\n const a0 = a[0];\n const a1 = a[1];\n const a2 = a[2];\n const a3 = a[3];\n const b0 = b[0];\n const b1 = b[1];\n const b2 = b[2];\n const b3 = b[3];\n return (Math.abs(a0 - b0) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a0), Math.abs(b0)) &&\n Math.abs(a1 - b1) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a1), Math.abs(b1)) &&\n Math.abs(a2 - b2) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a2), Math.abs(b2)) &&\n Math.abs(a3 - b3) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a3), Math.abs(b3)));\n}\n/**\n * Alias for {@link vec4.subtract}\n * @function\n */\nexport const sub = subtract;\n/**\n * Alias for {@link vec4.multiply}\n * @function\n */\nexport const mul = multiply;\n/**\n * Alias for {@link vec4.divide}\n * @function\n */\nexport const div = divide;\n/**\n * Alias for {@link vec4.distance}\n * @function\n */\nexport const dist = distance;\n/**\n * Alias for {@link vec4.squaredDistance}\n * @function\n */\nexport const sqrDist = squaredDistance;\n/**\n * Alias for {@link vec4.length}\n * @function\n */\nexport const len = length;\n/**\n * Alias for {@link vec4.squaredLength}\n * @function\n */\nexport const sqrLen = squaredLength;\n/**\n * Perform some operation over an array of vec4s.\n *\n * @param {Array} a the array of vectors to iterate over\n * @param {Number} stride Number of elements between the start of each vec4. If 0 assumes tightly packed\n * @param {Number} offset Number of elements to skip at the beginning of the array\n * @param {Number} count Number of vec4s to iterate over. If 0 iterates over entire array\n * @param {Function} fn Function to call for each vector in the array\n * @param {Object} [arg] additional argument to pass to fn\n * @returns {Array} a\n * @function\n */\nexport const forEach = (function () {\n const vec = create();\n return function (a, stride, offset, count, fn, arg) {\n let i;\n let l;\n if (!stride) {\n stride = 4;\n }\n if (!offset) {\n offset = 0;\n }\n if (count) {\n l = Math.min(count * stride + offset, a.length);\n }\n else {\n l = a.length;\n }\n for (i = offset; i < l; i += stride) {\n vec[0] = a[i];\n vec[1] = a[i + 1];\n vec[2] = a[i + 2];\n vec[3] = a[i + 3];\n fn(vec, vec, arg);\n a[i] = vec[0];\n a[i + 1] = vec[1];\n a[i + 2] = vec[2];\n a[i + 3] = vec[3];\n }\n return a;\n };\n})();\n//# sourceMappingURL=vec4.js.map","// math.gl\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\n// Copyright (c) 2017 Uber Technologies, Inc.\nimport { Matrix } from \"./base/matrix.js\";\nimport { checkVector } from \"../lib/validators.js\";\n/* eslint-disable camelcase */\nimport { vec2_transformMat4AsVector, vec3_transformMat4AsVector } from \"../lib/gl-matrix-extras.js\";\n// @ts-ignore gl-matrix types...\nimport { fromQuat as mat4_fromQuat, frustum as mat4_frustum, lookAt as mat4_lookAt, ortho as mat4_ortho, perspective as mat4_perspective, determinant as mat4_determinant, transpose as mat4_transpose, invert as mat4_invert, multiply as mat4_multiply, rotateX as mat4_rotateX, rotateY as mat4_rotateY, rotateZ as mat4_rotateZ, rotate as mat4_rotate, scale as mat4_scale, translate as mat4_translate } from \"../gl-matrix/mat4.js\";\nimport { transformMat4 as vec2_transformMat4 } from \"../gl-matrix/vec2.js\";\nimport { transformMat4 as vec3_transformMat4 } from \"../gl-matrix/vec3.js\";\nimport { transformMat4 as vec4_transformMat4 } from \"../gl-matrix/vec4.js\";\n// eslint-disable-next-line no-shadow\nvar INDICES;\n(function (INDICES) {\n INDICES[INDICES[\"COL0ROW0\"] = 0] = \"COL0ROW0\";\n INDICES[INDICES[\"COL0ROW1\"] = 1] = \"COL0ROW1\";\n INDICES[INDICES[\"COL0ROW2\"] = 2] = \"COL0ROW2\";\n INDICES[INDICES[\"COL0ROW3\"] = 3] = \"COL0ROW3\";\n INDICES[INDICES[\"COL1ROW0\"] = 4] = \"COL1ROW0\";\n INDICES[INDICES[\"COL1ROW1\"] = 5] = \"COL1ROW1\";\n INDICES[INDICES[\"COL1ROW2\"] = 6] = \"COL1ROW2\";\n INDICES[INDICES[\"COL1ROW3\"] = 7] = \"COL1ROW3\";\n INDICES[INDICES[\"COL2ROW0\"] = 8] = \"COL2ROW0\";\n INDICES[INDICES[\"COL2ROW1\"] = 9] = \"COL2ROW1\";\n INDICES[INDICES[\"COL2ROW2\"] = 10] = \"COL2ROW2\";\n INDICES[INDICES[\"COL2ROW3\"] = 11] = \"COL2ROW3\";\n INDICES[INDICES[\"COL3ROW0\"] = 12] = \"COL3ROW0\";\n INDICES[INDICES[\"COL3ROW1\"] = 13] = \"COL3ROW1\";\n INDICES[INDICES[\"COL3ROW2\"] = 14] = \"COL3ROW2\";\n INDICES[INDICES[\"COL3ROW3\"] = 15] = \"COL3ROW3\";\n})(INDICES || (INDICES = {}));\nconst DEFAULT_FOVY = (45 * Math.PI) / 180;\nconst DEFAULT_ASPECT = 1;\nconst DEFAULT_NEAR = 0.1;\nconst DEFAULT_FAR = 500;\nconst IDENTITY_MATRIX = Object.freeze([1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1]);\n/**\n * A 4x4 matrix with common linear algebra operations\n * Subclass of Array<number> meaning that it is highly compatible with other libraries\n */\nexport class Matrix4 extends Matrix {\n static get IDENTITY() {\n return getIdentityMatrix();\n }\n static get ZERO() {\n return getZeroMatrix();\n }\n get ELEMENTS() {\n return 16;\n }\n get RANK() {\n return 4;\n }\n get INDICES() {\n return INDICES;\n }\n constructor(array) {\n // PERF NOTE: initialize elements as double precision numbers\n super(-0, -0, -0, -0, -0, -0, -0, -0, -0, -0, -0, -0, -0, -0, -0, -0);\n if (arguments.length === 1 && Array.isArray(array)) {\n this.copy(array);\n }\n else {\n this.identity();\n }\n }\n copy(array) {\n this[0] = array[0];\n this[1] = array[1];\n this[2] = array[2];\n this[3] = array[3];\n this[4] = array[4];\n this[5] = array[5];\n this[6] = array[6];\n this[7] = array[7];\n this[8] = array[8];\n this[9] = array[9];\n this[10] = array[10];\n this[11] = array[11];\n this[12] = array[12];\n this[13] = array[13];\n this[14] = array[14];\n this[15] = array[15];\n return this.check();\n }\n // eslint-disable-next-line max-params\n set(m00, m10, m20, m30, m01, m11, m21, m31, m02, m12, m22, m32, m03, m13, m23, m33) {\n this[0] = m00;\n this[1] = m10;\n this[2] = m20;\n this[3] = m30;\n this[4] = m01;\n this[5] = m11;\n this[6] = m21;\n this[7] = m31;\n this[8] = m02;\n this[9] = m12;\n this[10] = m22;\n this[11] = m32;\n this[12] = m03;\n this[13] = m13;\n this[14] = m23;\n this[15] = m33;\n return this.check();\n }\n // accepts row major order, stores as column major\n // eslint-disable-next-line max-params\n setRowMajor(m00, m01, m02, m03, m10, m11, m12, m13, m20, m21, m22, m23, m30, m31, m32, m33) {\n this[0] = m00;\n this[1] = m10;\n this[2] = m20;\n this[3] = m30;\n this[4] = m01;\n this[5] = m11;\n this[6] = m21;\n this[7] = m31;\n this[8] = m02;\n this[9] = m12;\n this[10] = m22;\n this[11] = m32;\n this[12] = m03;\n this[13] = m13;\n this[14] = m23;\n this[15] = m33;\n return this.check();\n }\n toRowMajor(result) {\n result[0] = this[0];\n result[1] = this[4];\n result[2] = this[8];\n result[3] = this[12];\n result[4] = this[1];\n result[5] = this[5];\n result[6] = this[9];\n result[7] = this[13];\n result[8] = this[2];\n result[9] = this[6];\n result[10] = this[10];\n result[11] = this[14];\n result[12] = this[3];\n result[13] = this[7];\n result[14] = this[11];\n result[15] = this[15];\n return result;\n }\n // Constructors\n /** Set to identity matrix */\n identity() {\n return this.copy(IDENTITY_MATRIX);\n }\n /**\n *\n * @param object\n * @returns self\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n fromObject(object) {\n return this.check();\n }\n /**\n * Calculates a 4x4 matrix from the given quaternion\n * @param quaternion Quaternion to create matrix from\n * @returns self\n */\n fromQuaternion(quaternion) {\n mat4_fromQuat(this, quaternion);\n return this.check();\n }\n /**\n * Generates a frustum matrix with the given bounds\n * @param view.left - Left bound of the frustum\n * @param view.right - Right bound of the frustum\n * @param view.bottom - Bottom bound of the frustum\n * @param view.top - Top bound of the frustum\n * @param view.near - Near bound of the frustum\n * @param view.far - Far bound of the frustum. Can be set to Infinity.\n * @returns self\n */\n frustum(view) {\n const { left, right, bottom, top, near = DEFAULT_NEAR, far = DEFAULT_FAR } = view;\n if (far === Infinity) {\n computeInfinitePerspectiveOffCenter(this, left, right, bottom, top, near);\n }\n else {\n mat4_frustum(this, left, right, bottom, top, near, far);\n }\n return this.check();\n }\n /**\n * Generates a look-at matrix with the given eye position, focal point,\n * and up axis\n * @param view.eye - (vector) Position of the viewer\n * @param view.center - (vector) Point the viewer is looking at\n * @param view.up - (vector) Up axis\n * @returns self\n */\n lookAt(view) {\n const { eye, center = [0, 0, 0], up = [0, 1, 0] } = view;\n mat4_lookAt(this, eye, center, up);\n return this.check();\n }\n /**\n * Generates a orthogonal projection matrix with the given bounds\n * from \"traditional\" view space parameters\n * @param view.left - Left bound of the frustum\n * @param view.right number Right bound of the frustum\n * @param view.bottom - Bottom bound of the frustum\n * @param view.top number Top bound of the frustum\n * @param view.near - Near bound of the frustum\n * @param view.far number Far bound of the frustum\n * @returns self\n */\n ortho(view) {\n const { left, right, bottom, top, near = DEFAULT_NEAR, far = DEFAULT_FAR } = view;\n mat4_ortho(this, left, right, bottom, top, near, far);\n return this.check();\n }\n /**\n * Generates an orthogonal projection matrix with the same parameters\n * as a perspective matrix (plus focalDistance)\n * @param view.fovy Vertical field of view in radians\n * @param view.aspect Aspect ratio. Typically viewport width / viewport height\n * @param view.focalDistance Distance in the view frustum used for extent calculations\n * @param view.near Near bound of the frustum\n * @param view.far Far bound of the frustum\n * @returns self\n */\n orthographic(view) {\n const { fovy = DEFAULT_FOVY, aspect = DEFAULT_ASPECT, focalDistance = 1, near = DEFAULT_NEAR, far = DEFAULT_FAR } = view;\n checkRadians(fovy);\n const halfY = fovy / 2;\n const top = focalDistance * Math.tan(halfY); // focus_plane is the distance from the camera\n const right = top * aspect;\n return this.ortho({\n left: -right,\n right,\n bottom: -top,\n top,\n near,\n far\n });\n }\n /**\n * Generates a perspective projection matrix with the given bounds\n * @param view.fovy Vertical field of view in radians\n * @param view.aspect Aspect ratio. typically viewport width/height\n * @param view.near Near bound of the frustum\n * @param view.far Far bound of the frustum\n * @returns self\n */\n perspective(view) {\n const { fovy = (45 * Math.PI) / 180, aspect = 1, near = 0.1, far = 500 } = view;\n checkRadians(fovy);\n mat4_perspective(this, fovy, aspect, near, far);\n return this.check();\n }\n // Accessors\n determinant() {\n return mat4_determinant(this);\n }\n /**\n * Extracts the non-uniform scale assuming the matrix is an affine transformation.\n * The scales are the \"lengths\" of the column vectors in the upper-left 3x3 matrix.\n * @param result\n * @returns self\n */\n getScale(result = [-0, -0, -0]) {\n // explicit is faster than hypot...\n result[0] = Math.sqrt(this[0] * this[0] + this[1] * this[1] + this[2] * this[2]);\n result[1] = Math.sqrt(this[4] * this[4] + this[5] * this[5] + this[6] * this[6]);\n result[2] = Math.sqrt(this[8] * this[8] + this[9] * this[9] + this[10] * this[10]);\n // result[0] = Math.hypot(this[0], this[1], this[2]);\n // result[1] = Math.hypot(this[4], this[5], this[6]);\n // result[2] = Math.hypot(this[8], this[9], this[10]);\n return result;\n }\n /**\n * Gets the translation portion, assuming the matrix is a affine transformation matrix.\n * @param result\n * @returns self\n */\n getTranslation(result = [-0, -0, -0]) {\n result[0] = this[12];\n result[1] = this[13];\n result[2] = this[14];\n return result;\n }\n /**\n * Gets upper left 3x3 pure rotation matrix (non-scaling), assume affine transformation matrix\n * @param result\n * @param scaleResult\n * @returns self\n */\n getRotation(result, scaleResult) {\n result = result || [-0, -0, -0, -0, -0, -0, -0, -0, -0, -0, -0, -0, -0, -0, -0, -0];\n scaleResult = scaleResult || [-0, -0, -0];\n const scale = this.getScale(scaleResult);\n const inverseScale0 = 1 / scale[0];\n const inverseScale1 = 1 / scale[1];\n const inverseScale2 = 1 / scale[2];\n result[0] = this[0] * inverseScale0;\n result[1] = this[1] * inverseScale1;\n result[2] = this[2] * inverseScale2;\n result[3] = 0;\n result[4] = this[4] * inverseScale0;\n result[5] = this[5] * inverseScale1;\n result[6] = this[6] * inverseScale2;\n result[7] = 0;\n result[8] = this[8] * inverseScale0;\n result[9] = this[9] * inverseScale1;\n result[10] = this[10] * inverseScale2;\n result[11] = 0;\n result[12] = 0;\n result[13] = 0;\n result[14] = 0;\n result[15] = 1;\n return result;\n }\n /**\n *\n * @param result\n * @param scaleResult\n * @returns self\n */\n getRotationMatrix3(result, scaleResult) {\n result = result || [-0, -0, -0, -0, -0, -0, -0, -0, -0];\n scaleResult = scaleResult || [-0, -0, -0];\n const scale = this.getScale(scaleResult);\n const inverseScale0 = 1 / scale[0];\n const inverseScale1 = 1 / scale[1];\n const inverseScale2 = 1 / scale[2];\n result[0] = this[0] * inverseScale0;\n result[1] = this[1] * inverseScale1;\n result[2] = this[2] * inverseScale2;\n result[3] = this[4] * inverseScale0;\n result[4] = this[5] * inverseScale1;\n result[5] = this[6] * inverseScale2;\n result[6] = this[8] * inverseScale0;\n result[7] = this[9] * inverseScale1;\n result[8] = this[10] * inverseScale2;\n return result;\n }\n // Modifiers\n transpose() {\n mat4_transpose(this, this);\n return this.check();\n }\n invert() {\n mat4_invert(this, this);\n return this.check();\n }\n // Operations\n multiplyLeft(a) {\n mat4_multiply(this, a, this);\n return this.check();\n }\n multiplyRight(a) {\n mat4_multiply(this, this, a);\n return this.check();\n }\n // Rotates a matrix by the given angle around the X axis\n rotateX(radians) {\n mat4_rotateX(this, this, radians);\n // mat4_rotate(this, this, radians, [1, 0, 0]);\n return this.check();\n }\n // Rotates a matrix by the given angle around the Y axis.\n rotateY(radians) {\n mat4_rotateY(this, this, radians);\n // mat4_rotate(this, this, radians, [0, 1, 0]);\n return this.check();\n }\n /**\n * Rotates a matrix by the given angle around the Z axis.\n * @param radians\n * @returns self\n */\n rotateZ(radians) {\n mat4_rotateZ(this, this, radians);\n // mat4_rotate(this, this, radians, [0, 0, 1]);\n return this.check();\n }\n /**\n *\n * @param param0\n * @returns self\n */\n rotateXYZ(angleXYZ) {\n return this.rotateX(angleXYZ[0]).rotateY(angleXYZ[1]).rotateZ(angleXYZ[2]);\n }\n /**\n *\n * @param radians\n * @param axis\n * @returns self\n */\n rotateAxis(radians, axis) {\n mat4_rotate(this, this, radians, axis);\n return this.check();\n }\n /**\n *\n * @param factor\n * @returns self\n */\n scale(factor) {\n mat4_scale(this, this, Array.isArray(factor) ? factor : [factor, factor, factor]);\n return this.check();\n }\n /**\n *\n * @param vec\n * @returns self\n */\n translate(vector) {\n mat4_translate(this, this, vector);\n return this.check();\n }\n // Transforms\n /**\n * Transforms any 2, 3 or 4 element vector. 2 and 3 elements are treated as points\n * @param vector\n * @param result\n * @returns self\n */\n transform(vector, result) {\n if (vector.length === 4) {\n result = vec4_transformMat4(result || [-0, -0, -0, -0], vector, this);\n checkVector(result, 4);\n return result;\n }\n return this.transformAsPoint(vector, result);\n }\n /**\n * Transforms any 2 or 3 element array as point (w implicitly 1)\n * @param vector\n * @param result\n * @returns self\n */\n transformAsPoint(vector, result) {\n const { length } = vector;\n let out;\n switch (length) {\n case 2:\n out = vec2_transformMat4(result || [-0, -0], vector, this);\n break;\n case 3:\n out = vec3_transformMat4(result || [-0, -0, -0], vector, this);\n break;\n default:\n throw new Error('Illegal vector');\n }\n checkVector(out, vector.length);\n return out;\n }\n /**\n * Transforms any 2 or 3 element array as vector (w implicitly 0)\n * @param vector\n * @param result\n * @returns self\n */\n transformAsVector(vector, result) {\n let out;\n switch (vector.length) {\n case 2:\n out = vec2_transformMat4AsVector(result || [-0, -0], vector, this);\n break;\n case 3:\n out = vec3_transformMat4AsVector(result || [-0, -0, -0], vector, this);\n break;\n default:\n throw new Error('Illegal vector');\n }\n checkVector(out, vector.length);\n return out;\n }\n /** @deprecated */\n transformPoint(vector, result) {\n return this.transformAsPoint(vector, result);\n }\n /** @deprecated */\n transformVector(vector, result) {\n return this.transformAsPoint(vector, result);\n }\n /** @deprecated */\n transformDirection(vector, result) {\n return this.transformAsVector(vector, result);\n }\n // three.js math API compatibility\n makeRotationX(radians) {\n return this.identity().rotateX(radians);\n }\n makeTranslation(x, y, z) {\n return this.identity().translate([x, y, z]);\n }\n}\n// TODO initializing static members directly is an option, but make sure no tree-shaking issues\nlet ZERO;\nlet IDENTITY;\nfunction getZeroMatrix() {\n if (!ZERO) {\n ZERO = new Matrix4([0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]);\n Object.freeze(ZERO);\n }\n return ZERO;\n}\nfunction getIdentityMatrix() {\n if (!IDENTITY) {\n IDENTITY = new Matrix4();\n Object.freeze(IDENTITY);\n }\n return IDENTITY;\n}\n// HELPER FUNCTIONS\nfunction checkRadians(possiblyDegrees) {\n if (possiblyDegrees > Math.PI * 2) {\n throw Error('expected radians');\n }\n}\n// eslint-disable-next-line max-params\nfunction computeInfinitePerspectiveOffCenter(result, left, right, bottom, top, near) {\n const column0Row0 = (2 * near) / (right - left);\n const column1Row1 = (2 * near) / (top - bottom);\n const column2Row0 = (right + left) / (right - left);\n const column2Row1 = (top + bottom) / (top - bottom);\n const column2Row2 = -1;\n const column2Row3 = -1;\n const column3Row2 = -2 * near;\n result[0] = column0Row0;\n result[1] = 0;\n result[2] = 0;\n result[3] = 0;\n result[4] = 0;\n result[5] = column1Row1;\n result[6] = 0;\n result[7] = 0;\n result[8] = column2Row0;\n result[9] = column2Row1;\n result[10] = column2Row2;\n result[11] = column2Row3;\n result[12] = 0;\n result[13] = 0;\n result[14] = column3Row2;\n result[15] = 0;\n return result;\n}\n//# sourceMappingURL=matrix4.js.map","export const MOBILE_REGEX = /mobile|tablet|ip(ad|hone|od)|android/i;\nexport const COMPUTE_INTERVAL = 25;\nexport var InputEvent;\n(function (InputEvent) {\n InputEvent[InputEvent[\"Start\"] = 1] = \"Start\";\n InputEvent[InputEvent[\"Move\"] = 2] = \"Move\";\n InputEvent[InputEvent[\"End\"] = 4] = \"End\";\n InputEvent[InputEvent[\"Cancel\"] = 8] = \"Cancel\";\n})(InputEvent || (InputEvent = {}));\nexport var InputDirection;\n(function (InputDirection) {\n InputDirection[InputDirection[\"None\"] = 0] = \"None\";\n InputDirection[InputDirection[\"Left\"] = 1] = \"Left\";\n InputDirection[InputDirection[\"Right\"] = 2] = \"Right\";\n InputDirection[InputDirection[\"Up\"] = 4] = \"Up\";\n InputDirection[InputDirection[\"Down\"] = 8] = \"Down\";\n InputDirection[InputDirection[\"Horizontal\"] = 3] = \"Horizontal\";\n InputDirection[InputDirection[\"Vertical\"] = 12] = \"Vertical\";\n InputDirection[InputDirection[\"All\"] = 15] = \"All\";\n})(InputDirection || (InputDirection = {}));\n//# sourceMappingURL=input-consts.js.map","export var RecognizerState;\n(function (RecognizerState) {\n RecognizerState[RecognizerState[\"Possible\"] = 1] = \"Possible\";\n RecognizerState[RecognizerState[\"Began\"] = 2] = \"Began\";\n RecognizerState[RecognizerState[\"Changed\"] = 4] = \"Changed\";\n RecognizerState[RecognizerState[\"Ended\"] = 8] = \"Ended\";\n RecognizerState[RecognizerState[\"Recognized\"] = 8] = \"Recognized\";\n RecognizerState[RecognizerState[\"Cancelled\"] = 16] = \"Cancelled\";\n RecognizerState[RecognizerState[\"Failed\"] = 32] = \"Failed\";\n})(RecognizerState || (RecognizerState = {}));\n//# sourceMappingURL=recognizer-state.js.map","// magical touchAction value\nexport const TOUCH_ACTION_COMPUTE = 'compute';\nexport const TOUCH_ACTION_AUTO = 'auto';\nexport const TOUCH_ACTION_MANIPULATION = 'manipulation'; // not implemented\nexport const TOUCH_ACTION_NONE = 'none';\nexport const TOUCH_ACTION_PAN_X = 'pan-x';\nexport const TOUCH_ACTION_PAN_Y = 'pan-y';\n//# sourceMappingURL=touchaction-Consts.js.map","/**\n * split string on whitespace\n * @returns {Array} words\n */\nexport function splitStr(str) {\n return str.trim().split(/\\s+/g);\n}\n//# sourceMappingURL=split-str.js.map","import { splitStr } from \"./split-str.js\";\n/**\n * addEventListener with multiple events at once\n */\nexport function addEventListeners(target, types, handler) {\n if (!target) {\n return;\n }\n for (const type of splitStr(types)) {\n target.addEventListener(type, handler, false);\n }\n}\n/**\n * removeEventListener with multiple events at once\n */\nexport function removeEventListeners(target, types, handler) {\n if (!target) {\n return;\n }\n for (const type of splitStr(types)) {\n target.removeEventListener(type, handler, false);\n }\n}\n//# sourceMappingURL=event-listeners.js.map","/**\n * get the window object of an element\n */\nexport function getWindowForElement(element) {\n const doc = element.ownerDocument || element;\n return doc.defaultView;\n}\n//# sourceMappingURL=get-window-for-element.js.map","/**\n * find if a node is in the given parent\n */\nexport default function hasParent(node, parent) {\n let ancestor = node;\n while (ancestor) {\n if (ancestor === parent) {\n return true;\n }\n ancestor = ancestor.parentNode;\n }\n return false;\n}\n//# sourceMappingURL=has-parent.js.map","/**\n * get the center of all the pointers\n */\nexport function getCenter(pointers) {\n const pointersLength = pointers.length;\n // no need to loop when only one touch\n if (pointersLength === 1) {\n return {\n x: Math.round(pointers[0].clientX),\n y: Math.round(pointers[0].clientY)\n };\n }\n let x = 0;\n let y = 0;\n let i = 0;\n while (i < pointersLength) {\n x += pointers[i].clientX;\n y += pointers[i].clientY;\n i++;\n }\n return {\n x: Math.round(x / pointersLength),\n y: Math.round(y / pointersLength)\n };\n}\n//# sourceMappingURL=get-center.js.map","import { getCenter } from \"./get-center.js\";\n/**\n * create a simple clone from the input used for storage of firstInput and firstMultiple\n */\nexport function simpleCloneInputData(input) {\n // make a simple copy of the pointers because we will get a reference if we don't\n const pointers = [];\n let i = 0;\n while (i < input.pointers.length) {\n pointers[i] = {\n clientX: Math.round(input.pointers[i].clientX),\n clientY: Math.round(input.pointers[i].clientY)\n };\n i++;\n }\n return {\n timeStamp: Date.now(),\n pointers,\n center: getCenter(pointers),\n deltaX: input.deltaX,\n deltaY: input.deltaY\n };\n}\n//# sourceMappingURL=simple-clone-input-data.js.map","/**\n * calculate the absolute distance between two points\n * @returns distance\n */\nexport function getPointDistance(p1, p2) {\n const x = p2.x - p1.x;\n const y = p2.y - p1.y;\n return Math.sqrt(x * x + y * y);\n}\n/**\n * calculate the absolute distance between two pointer events\n * @returns distance\n */\nexport function getEventDistance(p1, p2) {\n const x = p2.clientX - p1.clientX;\n const y = p2.clientY - p1.clientY;\n return Math.sqrt(x * x + y * y);\n}\n//# sourceMappingURL=get-distance.js.map","/**\n * calculate the angle between two coordinates\n * @returns angle in degrees\n */\nexport function getPointAngle(p1, p2) {\n const x = p2.x - p1.x;\n const y = p2.y - p1.y;\n return (Math.atan2(y, x) * 180) / Math.PI;\n}\n/**\n * calculate the angle between two pointer events\n * @returns angle in degrees\n */\nexport function getEventAngle(p1, p2) {\n const x = p2.clientX - p1.clientX;\n const y = p2.clientY - p1.clientY;\n return (Math.atan2(y, x) * 180) / Math.PI;\n}\n//# sourceMappingURL=get-angle.js.map","import { InputDirection } from \"./input-consts.js\";\n/**\n * get the direction between two points\n * @returns direction\n */\nexport function getDirection(dx, dy) {\n if (dx === dy) {\n return InputDirection.None;\n }\n if (Math.abs(dx) >= Math.abs(dy)) {\n return dx < 0 ? InputDirection.Left : InputDirection.Right;\n }\n return dy < 0 ? InputDirection.Up : InputDirection.Down;\n}\n//# sourceMappingURL=get-direction.js.map","import { InputEvent } from \"./input-consts.js\";\n/** Populates input.deltaX, input.deltaY */\nexport function computeDeltaXY(session, input) {\n // getCenter is called before computeDeltaXY\n const center = input.center;\n let offset = session.offsetDelta;\n let prevDelta = session.prevDelta;\n const prevInput = session.prevInput;\n if (input.eventType === InputEvent.Start || prevInput?.eventType === InputEvent.End) {\n prevDelta = session.prevDelta = {\n x: prevInput?.deltaX || 0,\n y: prevInput?.deltaY || 0\n };\n offset = session.offsetDelta = {\n x: center.x,\n y: center.y\n };\n }\n return {\n deltaX: prevDelta.x + (center.x - offset.x),\n deltaY: prevDelta.y + (center.y - offset.y)\n };\n}\n//# sourceMappingURL=get-delta-xy.js.map","/**\n * calculate the velocity between two points. unit is in px per ms.\n */\nexport function getVelocity(deltaTime, x, y) {\n return {\n x: x / deltaTime || 0,\n y: y / deltaTime || 0\n };\n}\n//# sourceMappingURL=get-velocity.js.map","import { getEventDistance } from \"./get-distance.js\";\n/**\n * calculate the scale factor between two pointersets\n * no scale is 1, and goes down to 0 when pinched together, and bigger when pinched out\n */\nexport function getScale(start, end) {\n return getEventDistance(end[0], end[1]) / getEventDistance(start[0], start[1]);\n}\n//# sourceMappingURL=get-scale.js.map","import { getEventAngle } from \"./get-angle.js\";\n/**\n * calculate the rotation degrees between two pointer sets\n * @returns rotation in degrees\n */\nexport function getRotation(start, end) {\n return getEventAngle(end[1], end[0]) - getEventAngle(start[1], start[0]);\n}\n//# sourceMappingURL=get-rotation.js.map","import { InputEvent, COMPUTE_INTERVAL } from \"./input-consts.js\";\nimport { getVelocity } from \"./get-velocity.js\";\nimport { getDirection } from \"./get-direction.js\";\n/**\n * velocity is calculated every x ms\n */\nexport function computeIntervalInputData(session, input) {\n const last = session.lastInterval || input;\n const deltaTime = input.timeStamp - last.timeStamp;\n let velocity;\n let velocityX;\n let velocityY;\n let direction;\n if (input.eventType !== InputEvent.Cancel &&\n (deltaTime > COMPUTE_INTERVAL || last.velocity === undefined)) {\n const deltaX = input.deltaX - last.deltaX;\n const deltaY = input.deltaY - last.deltaY;\n const v = getVelocity(deltaTime, deltaX, deltaY);\n velocityX = v.x;\n velocityY = v.y;\n velocity = Math.abs(v.x) > Math.abs(v.y) ? v.x : v.y;\n direction = getDirection(deltaX, deltaY);\n session.lastInterval = input;\n }\n else {\n // use latest velocity info if it doesn't overtake a minimum period\n velocity = last.velocity;\n velocityX = last.velocityX;\n velocityY = last.velocityY;\n direction = last.direction;\n }\n input.velocity = velocity;\n input.velocityX = velocityX;\n input.velocityY = velocityY;\n input.direction = direction;\n}\n//# sourceMappingURL=compute-interval-input-data.js.map","import hasParent from \"../utils/has-parent.js\";\nimport { simpleCloneInputData } from \"./simple-clone-input-data.js\";\nimport { getCenter } from \"./get-center.js\";\nimport { getPointDistance } from \"./get-distance.js\";\nimport { getPointAngle } from \"./get-angle.js\";\nimport { getDirection } from \"./get-direction.js\";\nimport { computeDeltaXY } from \"./get-delta-xy.js\";\nimport { getVelocity } from \"./get-velocity.js\";\nimport { getScale } from \"./get-scale.js\";\nimport { getRotation } from \"./get-rotation.js\";\nimport { computeIntervalInputData } from \"./compute-interval-input-data.js\";\n/**\n * extend the data with some usable properties like scale, rotate, velocity etc\n */\nexport function computeInputData(manager, input) {\n const { session } = manager;\n const { pointers } = input;\n const { length: pointersLength } = pointers;\n // store the first input to calculate the distance and direction\n if (!session.firstInput) {\n session.firstInput = simpleCloneInputData(input);\n }\n // to compute scale and rotation we need to store the multiple touches\n if (pointersLength > 1 && !session.firstMultiple) {\n session.firstMultiple = simpleCloneInputData(input);\n }\n else if (pointersLength === 1) {\n session.firstMultiple = false;\n }\n const { firstInput, firstMultiple } = session;\n const offsetCenter = firstMultiple ? firstMultiple.center : firstInput.center;\n const center = (input.center = getCenter(pointers));\n input.timeStamp = Date.now();\n input.deltaTime = input.timeStamp - firstInput.timeStamp;\n input.angle = getPointAngle(offsetCenter, center);\n input.distance = getPointDistance(offsetCenter, center);\n const { deltaX, deltaY } = computeDeltaXY(session, input);\n input.deltaX = deltaX;\n input.deltaY = deltaY;\n input.offsetDirection = getDirection(input.deltaX, input.deltaY);\n const overallVelocity = getVelocity(input.deltaTime, input.deltaX, input.deltaY);\n input.overallVelocityX = overallVelocity.x;\n input.overallVelocityY = overallVelocity.y;\n input.overallVelocity =\n Math.abs(overallVelocity.x) > Math.abs(overallVelocity.y)\n ? overallVelocity.x\n : overallVelocity.y;\n input.scale = firstMultiple ? getScale(firstMultiple.pointers, pointers) : 1;\n input.rotation = firstMultiple ? getRotation(firstMultiple.pointers, pointers) : 0;\n input.maxPointers = !session.prevInput\n ? input.pointers.length\n : input.pointers.length > session.prevInput.maxPointers\n ? input.pointers.length\n : session.prevInput.maxPointers;\n // find the correct target\n let target = manager.element;\n if (hasParent(input.srcEvent.target, target)) {\n target = input.srcEvent.target;\n }\n input.target = target;\n computeIntervalInputData(session, input);\n // All the optional fields have been populated\n return input;\n}\n//# sourceMappingURL=compute-input-data.js.map","import { InputEvent } from \"./input-consts.js\";\nimport { computeInputData } from \"./compute-input-data.js\";\n/**\n * handle input events\n */\nexport function inputHandler(manager, eventType, input) {\n const pointersLen = input.pointers.length;\n const changedPointersLen = input.changedPointers.length;\n const isFirst = eventType & InputEvent.Start && pointersLen - changedPointersLen === 0;\n const isFinal = eventType & (InputEvent.End | InputEvent.Cancel) && pointersLen - changedPointersLen === 0;\n input.isFirst = Boolean(isFirst);\n input.isFinal = Boolean(isFinal);\n if (isFirst) {\n manager.session = {};\n }\n // source event is the normalized value of the domEvents\n // like 'touchstart, mouseup, pointerdown'\n input.eventType = eventType;\n // compute scale, rotation etc\n const processedInput = computeInputData(manager, input);\n // emit secret event\n manager.emit('hammer.input', processedInput);\n manager.recognize(processedInput);\n manager.session.prevInput = processedInput;\n}\n//# sourceMappingURL=input-handler.js.map","import { addEventListeners, removeEventListeners } from \"../utils/event-listeners.js\";\nimport { getWindowForElement } from \"../utils/get-window-for-element.js\";\nimport { inputHandler } from \"./input-handler.js\";\n/**\n * create new input type manager\n */\nexport class Input {\n constructor(manager) {\n this.evEl = '';\n this.evWin = '';\n this.evTarget = '';\n /** smaller wrapper around the handler, for the scope and the enabled state of the manager,\n * so when disabled the input events are completely bypassed.\n */\n this.domHandler = (ev) => {\n if (this.manager.options.enable) {\n this.handler(ev);\n }\n };\n this.manager = manager;\n this.element = manager.element;\n this.target = manager.options.inputTarget || manager.element;\n }\n callback(eventType, input) {\n inputHandler(this.manager, eventType, input);\n }\n // eslint-disable @typescript-eslint/unbound-method\n /**\n * bind the events\n */\n init() {\n addEventListeners(this.element, this.evEl, this.domHandler);\n addEventListeners(this.target, this.evTarget, this.domHandler);\n addEventListeners(getWindowForElement(this.element), this.evWin, this.domHandler);\n }\n /**\n * unbind the events\n */\n destroy() {\n removeEventListeners(this.element, this.evEl, this.domHandler);\n removeEventListeners(this.target, this.evTarget, this.domHandler);\n removeEventListeners(getWindowForElement(this.element), this.evWin, this.domHandler);\n }\n}\n//# sourceMappingURL=input.js.map","import { InputEvent } from \"../input/input-consts.js\";\nimport { Input } from \"../input/input.js\";\nconst POINTER_INPUT_MAP = {\n pointerdown: InputEvent.Start,\n pointermove: InputEvent.Move,\n pointerup: InputEvent.End,\n pointercancel: InputEvent.Cancel,\n pointerout: InputEvent.Cancel\n};\nconst POINTER_ELEMENT_EVENTS = 'pointerdown';\nconst POINTER_WINDOW_EVENTS = 'pointermove pointerup pointercancel';\n/**\n * Pointer events input\n */\nexport class PointerEventInput extends Input {\n constructor(manager) {\n super(manager);\n this.evEl = POINTER_ELEMENT_EVENTS;\n this.evWin = POINTER_WINDOW_EVENTS;\n this.store = this.manager.session.pointerEvents = [];\n this.init();\n }\n /**\n * handle mouse events\n */\n handler(ev) {\n const { store } = this;\n let removePointer = false;\n // @ts-ignore\n const eventType = POINTER_INPUT_MAP[ev.type];\n const pointerType = ev.pointerType;\n const isTouch = pointerType === 'touch';\n // get index of the event in the store\n let storeIndex = store.findIndex((e) => e.pointerId === ev.pointerId);\n // start and mouse must be down\n if (eventType & InputEvent.Start && (ev.buttons || isTouch)) {\n if (storeIndex < 0) {\n store.push(ev);\n storeIndex = store.length - 1;\n }\n }\n else if (eventType & (InputEvent.End | InputEvent.Cancel)) {\n removePointer = true;\n }\n // it not found, so the pointer hasn't been down (so it's probably a hover)\n if (storeIndex < 0) {\n return;\n }\n // update the event in the store\n store[storeIndex] = ev;\n this.callback(eventType, {\n pointers: store,\n changedPointers: [ev],\n eventType,\n pointerType,\n srcEvent: ev\n });\n if (removePointer) {\n // remove from the store\n store.splice(storeIndex, 1);\n }\n }\n}\n//# sourceMappingURL=pointerevent.js.map","/**\n * get a unique id\n */\nlet _uniqueId = 1;\nexport function uniqueId() {\n return _uniqueId++;\n}\n//# sourceMappingURL=unique-id.js.map","import { RecognizerState } from \"./recognizer-state.js\";\n/**\n * get a usable string, used as event postfix\n */\nexport function stateStr(state) {\n if (state & RecognizerState.Cancelled) {\n return 'cancel';\n }\n else if (state & RecognizerState.Ended) {\n return 'end';\n }\n else if (state & RecognizerState.Changed) {\n return 'move';\n }\n else if (state & RecognizerState.Began) {\n return 'start';\n }\n return '';\n}\n//# sourceMappingURL=state-str.js.map","import { RecognizerState } from \"./recognizer-state.js\";\nimport { uniqueId } from \"../utils/unique-id.js\";\nimport { stateStr } from \"./state-str.js\";\n/**\n * Recognizer flow explained; *\n * All recognizers have the initial state of POSSIBLE when a input session starts.\n * The definition of a input session is from the first input until the last input, with all it's movement in it. *\n * Example session for mouse-input: mousedown -> mousemove -> mouseup\n *\n * On each recognizing cycle (see Manager.recognize) the .recognize() method is executed\n * which determines with state it should be.\n *\n * If the recognizer has the state FAILED, CANCELLED or RECOGNIZED (equals ENDED), it is reset to\n * POSSIBLE to give it another change on the next cycle.\n *\n * Possible\n * |\n * +-----+---------------+\n * | |\n * +-----+-----+ |\n * | | |\n * Failed Cancelled |\n * +-------+------+\n * | |\n * Recognized Began\n * |\n * Changed\n * |\n * Ended/Recognized\n */\n/**\n * Recognizer\n * Every recognizer needs to extend from this class.\n */\nexport class Recognizer {\n constructor(options) {\n this.options = options;\n this.id = uniqueId();\n this.state = RecognizerState.Possible;\n this.simultaneous = {};\n this.requireFail = [];\n }\n /**\n * set options\n */\n set(options) {\n Object.assign(this.options, options);\n // also update the touchAction, in case something changed about the directions/enabled state\n this.manager.touchAction.update();\n return this;\n }\n /**\n * recognize simultaneous with an other recognizer.\n */\n recognizeWith(recognizerOrName) {\n if (Array.isArray(recognizerOrName)) {\n for (const item of recognizerOrName) {\n this.recognizeWith(item);\n }\n return this;\n }\n let otherRecognizer;\n if (typeof recognizerOrName === 'string') {\n otherRecognizer = this.manager.get(recognizerOrName);\n if (!otherRecognizer) {\n throw new Error(`Cannot find recognizer ${recognizerOrName}`);\n }\n }\n else {\n otherRecognizer = recognizerOrName;\n }\n const { simultaneous } = this;\n if (!simultaneous[otherRecognizer.id]) {\n simultaneous[otherRecognizer.id] = otherRecognizer;\n otherRecognizer.recognizeWith(this);\n }\n return this;\n }\n /**\n * drop the simultaneous link. it doesnt remove the link on the other recognizer.\n */\n dropRecognizeWith(recognizerOrName) {\n if (Array.isArray(recognizerOrName)) {\n for (const item of recognizerOrName) {\n this.dropRecognizeWith(item);\n }\n return this;\n }\n let otherRecognizer;\n if (typeof recognizerOrName === 'string') {\n otherRecognizer = this.manager.get(recognizerOrName);\n }\n else {\n otherRecognizer = recognizerOrName;\n }\n if (otherRecognizer) {\n delete this.simultaneous[otherRecognizer.id];\n }\n return this;\n }\n /**\n * recognizer can only run when an other is failing\n */\n requireFailure(recognizerOrName) {\n if (Array.isArray(recognizerOrName)) {\n for (const item of recognizerOrName) {\n this.requireFailure(item);\n }\n return this;\n }\n let otherRecognizer;\n if (typeof recognizerOrName === 'string') {\n otherRecognizer = this.manager.get(recognizerOrName);\n if (!otherRecognizer) {\n throw new Error(`Cannot find recognizer ${recognizerOrName}`);\n }\n }\n else {\n otherRecognizer = recognizerOrName;\n }\n const { requireFail } = this;\n if (requireFail.indexOf(otherRecognizer) === -1) {\n requireFail.push(otherRecognizer);\n otherRecognizer.requireFailure(this);\n }\n return this;\n }\n /**\n * drop the requireFailure link. it does not remove the link on the other recognizer.\n */\n dropRequireFailure(recognizerOrName) {\n if (Array.isArray(recognizerOrName)) {\n for (const item of recognizerOrName) {\n this.dropRequireFailure(item);\n }\n return this;\n }\n let otherRecognizer;\n if (typeof recognizerOrName === 'string') {\n otherRecognizer = this.manager.get(recognizerOrName);\n }\n else {\n otherRecognizer = recognizerOrName;\n }\n if (otherRecognizer) {\n const index = this.requireFail.indexOf(otherRecognizer);\n if (index > -1) {\n this.requireFail.splice(index, 1);\n }\n }\n return this;\n }\n /**\n * has require failures boolean\n */\n hasRequireFailures() {\n return Boolean(this.requireFail.find((recognier) => recognier.options.enable));\n }\n /**\n * if the recognizer can recognize simultaneous with an other recognizer\n */\n canRecognizeWith(otherRecognizer) {\n return Boolean(this.simultaneous[otherRecognizer.id]);\n }\n /**\n * You should use `tryEmit` instead of `emit` directly to check\n * that all the needed recognizers has failed before emitting.\n */\n emit(input) {\n // Some recognizers override emit() with their own logic\n if (!input)\n return;\n const { state } = this;\n // 'panstart' and 'panmove'\n if (state < RecognizerState.Ended) {\n this.manager.emit(this.options.event + stateStr(state), input);\n }\n // simple 'eventName' events\n this.manager.emit(this.options.event, input);\n // additional event(panleft, panright, pinchin, pinchout...)\n if (input.additionalEvent) {\n this.manager.emit(input.additionalEvent, input);\n }\n // panend and pancancel\n if (state >= RecognizerState.Ended) {\n this.manager.emit(this.options.event + stateStr(state), input);\n }\n }\n /**\n * Check that all the require failure recognizers has failed,\n * if true, it emits a gesture event,\n * otherwise, setup the state to FAILED.\n */\n tryEmit(input) {\n if (this.canEmit()) {\n this.emit(input);\n }\n else {\n // it's failing anyway\n this.state = RecognizerState.Failed;\n }\n }\n /**\n * can we emit?\n */\n canEmit() {\n let i = 0;\n while (i < this.requireFail.length) {\n if (!(this.requireFail[i].state & (RecognizerState.Failed | RecognizerState.Possible))) {\n return false;\n }\n i++;\n }\n return true;\n }\n /**\n * update the recognizer\n */\n recognize(inputData) {\n // make a new copy of the inputData\n // so we can change the inputData without messing up the other recognizers\n const inputDataClone = { ...inputData };\n // is is enabled and allow recognizing?\n if (!this.options.enable) {\n this.reset();\n this.state = RecognizerState.Failed;\n return;\n }\n // reset when we've reached the end\n if (this.state &\n (RecognizerState.Recognized | RecognizerState.Cancelled | RecognizerState.Failed)) {\n this.state = RecognizerState.Possible;\n }\n this.state = this.process(inputDataClone);\n // the recognizer has recognized a gesture\n // so trigger an event\n if (this.state &\n (RecognizerState.Began |\n RecognizerState.Changed |\n RecognizerState.Ended |\n RecognizerState.Cancelled)) {\n this.tryEmit(inputDataClone);\n }\n }\n /**\n * return the event names that are emitted by this recognizer\n */\n getEventNames() {\n return [this.options.event];\n }\n /**\n * called when the gesture isn't allowed to recognize\n * like when another is being recognized or it is disabled\n */\n reset() { }\n}\n//# sourceMappingURL=recognizer.js.map","import { Recognizer } from \"../recognizer/recognizer.js\";\nimport { RecognizerState } from \"../recognizer/recognizer-state.js\";\nimport { InputEvent } from \"../input/input-consts.js\";\n/**\n * This recognizer is just used as a base for the simple attribute recognizers.\n */\nexport class AttrRecognizer extends Recognizer {\n /**\n * Used to check if it the recognizer receives valid input, like input.distance > 10.\n */\n attrTest(input) {\n const optionPointers = this.options.pointers;\n return optionPointers === 0 || input.pointers.length === optionPointers;\n }\n /**\n * Process the input and return the state for the recognizer\n */\n process(input) {\n const { state } = this;\n const { eventType } = input;\n const isRecognized = state & (RecognizerState.Began | RecognizerState.Changed);\n const isValid = this.attrTest(input);\n // on cancel input and we've recognized before, return STATE_CANCELLED\n if (isRecognized && (eventType & InputEvent.Cancel || !isValid)) {\n return state | RecognizerState.Cancelled;\n }\n else if (isRecognized || isValid) {\n if (eventType & InputEvent.End) {\n return state | RecognizerState.Ended;\n }\n else if (!(state & RecognizerState.Began)) {\n return RecognizerState.Began;\n }\n return state | RecognizerState.Changed;\n }\n return RecognizerState.Failed;\n }\n}\n//# sourceMappingURL=attribute.js.map","/* global setTimeout, clearTimeout */\nimport { Recognizer } from \"../recognizer/recognizer.js\";\nimport { TOUCH_ACTION_MANIPULATION } from \"../touchaction/touchaction-Consts.js\";\nimport { InputEvent } from \"../input/input-consts.js\";\nimport { RecognizerState } from \"../recognizer/recognizer-state.js\";\nimport { getPointDistance } from \"../input/get-distance.js\";\n/**\n * A tap is recognized when the pointer is doing a small tap/click. Multiple taps are recognized if they occur\n * between the given interval and position. The delay option can be used to recognize multi-taps without firing\n * a single tap.\n *\n * The eventData from the emitted event contains the property `tapCount`, which contains the amount of\n * multi-taps being recognized.\n */\nexport class TapRecognizer extends Recognizer {\n constructor(options = {}) {\n super({\n enable: true,\n event: 'tap',\n pointers: 1,\n taps: 1,\n interval: 300,\n time: 250,\n threshold: 9,\n posThreshold: 10,\n ...options\n });\n /** previous time for tap counting */\n this.pTime = null;\n /** previous center for tap counting */\n this.pCenter = null;\n this._timer = null;\n this._input = null;\n this.count = 0;\n }\n getTouchAction() {\n return [TOUCH_ACTION_MANIPULATION];\n }\n process(input) {\n const { options } = this;\n const validPointers = input.pointers.length === options.pointers;\n const validMovement = input.distance < options.threshold;\n const validTouchTime = input.deltaTime < options.time;\n this.reset();\n if (input.eventType & InputEvent.Start && this.count === 0) {\n return this.failTimeout();\n }\n // we only allow little movement\n // and we've reached an end event, so a tap is possible\n if (validMovement && validTouchTime && validPointers) {\n if (input.eventType !== InputEvent.End) {\n return this.failTimeout();\n }\n const validInterval = this.pTime ? input.timeStamp - this.pTime < options.interval : true;\n const validMultiTap = !this.pCenter || getPointDistance(this.pCenter, input.center) < options.posThreshold;\n this.pTime = input.timeStamp;\n this.pCenter = input.center;\n if (!validMultiTap || !validInterval) {\n this.count = 1;\n }\n else {\n this.count += 1;\n }\n this._input = input;\n // if tap count matches we have recognized it,\n // else it has began recognizing...\n const tapCount = this.count % options.taps;\n if (tapCount === 0) {\n // no failing requirements, immediately trigger the tap event\n // or wait as long as the multitap interval to trigger\n if (!this.hasRequireFailures()) {\n return RecognizerState.Recognized;\n }\n this._timer = setTimeout(() => {\n this.state = RecognizerState.Recognized;\n this.tryEmit(this._input);\n }, options.interval);\n return RecognizerState.Began;\n }\n }\n return RecognizerState.Failed;\n }\n failTimeout() {\n this._timer = setTimeout(() => {\n this.state = RecognizerState.Failed;\n }, this.options.interval);\n return RecognizerState.Failed;\n }\n reset() {\n clearTimeout(this._timer);\n }\n emit(input) {\n if (this.state === RecognizerState.Recognized) {\n input.tapCount = this.count;\n this.manager.emit(this.options.event, input);\n }\n }\n}\n//# sourceMappingURL=tap.js.map","import { AttrRecognizer } from \"./attribute.js\";\nimport { InputDirection } from \"../input/input-consts.js\";\nimport { RecognizerState } from \"../recognizer/recognizer-state.js\";\nimport { TOUCH_ACTION_PAN_X, TOUCH_ACTION_PAN_Y } from \"../touchaction/touchaction-Consts.js\";\nconst EVENT_NAMES = ['', 'start', 'move', 'end', 'cancel', 'up', 'down', 'left', 'right'];\n/**\n * Pan\n * Recognized when the pointer is down and moved in the allowed direction.\n */\nexport class PanRecognizer extends AttrRecognizer {\n constructor(options = {}) {\n super({\n enable: true,\n pointers: 1,\n event: 'pan',\n threshold: 10,\n direction: InputDirection.All,\n ...options\n });\n this.pX = null;\n this.pY = null;\n }\n getTouchAction() {\n const { options: { direction } } = this;\n const actions = [];\n if (direction & InputDirection.Horizontal) {\n actions.push(TOUCH_ACTION_PAN_Y);\n }\n if (direction & InputDirection.Vertical) {\n actions.push(TOUCH_ACTION_PAN_X);\n }\n return actions;\n }\n getEventNames() {\n return EVENT_NAMES.map((suffix) => this.options.event + suffix);\n }\n directionTest(input) {\n const { options } = this;\n let hasMoved = true;\n let { distance } = input;\n let { direction } = input;\n const x = input.deltaX;\n const y = input.deltaY;\n // lock to axis?\n if (!(direction & options.direction)) {\n if (options.direction & InputDirection.Horizontal) {\n direction =\n x === 0 ? InputDirection.None : x < 0 ? InputDirection.Left : InputDirection.Right;\n hasMoved = x !== this.pX;\n distance = Math.abs(input.deltaX);\n }\n else {\n direction = y === 0 ? InputDirection.None : y < 0 ? InputDirection.Up : InputDirection.Down;\n hasMoved = y !== this.pY;\n distance = Math.abs(input.deltaY);\n }\n }\n input.direction = direction;\n return hasMoved && distance > options.threshold && Boolean(direction & options.direction);\n }\n attrTest(input) {\n return (super.attrTest(input) &&\n (Boolean(this.state & RecognizerState.Began) ||\n (!(this.state & RecognizerState.Began) && this.directionTest(input))));\n }\n emit(input) {\n this.pX = input.deltaX;\n this.pY = input.deltaY;\n const direction = InputDirection[input.direction].toLowerCase();\n if (direction) {\n input.additionalEvent = this.options.event + direction;\n }\n super.emit(input);\n }\n}\n//# sourceMappingURL=pan.js.map","import { AttrRecognizer } from \"./attribute.js\";\nimport { TOUCH_ACTION_NONE } from \"../touchaction/touchaction-Consts.js\";\nimport { RecognizerState } from \"../recognizer/recognizer-state.js\";\nconst EVENT_NAMES = ['', 'start', 'move', 'end', 'cancel', 'in', 'out'];\n/**\n * Pinch\n * Recognized when two or more pointers are moving toward (zoom-in) or away from each other (zoom-out).\n */\nexport class PinchRecognizer extends AttrRecognizer {\n constructor(options = {}) {\n super({\n enable: true,\n event: 'pinch',\n threshold: 0,\n pointers: 2,\n ...options\n });\n }\n getTouchAction() {\n return [TOUCH_ACTION_NONE];\n }\n getEventNames() {\n return EVENT_NAMES.map((suffix) => this.options.event + suffix);\n }\n attrTest(input) {\n return (super.attrTest(input) &&\n (Math.abs(input.scale - 1) > this.options.threshold ||\n Boolean(this.state & RecognizerState.Began)));\n }\n emit(input) {\n if (input.scale !== 1) {\n const inOut = input.scale < 1 ? 'in' : 'out';\n input.additionalEvent = this.options.event + inOut;\n }\n super.emit(input);\n }\n}\n//# sourceMappingURL=pinch.js.map","// mjolnir.js\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\nexport class Input {\n constructor(element, callback, options) {\n this.element = element;\n this.callback = callback;\n this.options = options;\n }\n}\n//# sourceMappingURL=input.js.map","// mjolnir.js\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\n// Purpose: include this in your module to avoids adding dependencies on\n// micro modules like 'global'\n/* global window, global, document, navigator */\nexport const userAgent = typeof navigator !== 'undefined' && navigator.userAgent ? navigator.userAgent.toLowerCase() : '';\nconst window_ = typeof window !== 'undefined' ? window : global;\nconst global_ = typeof global !== 'undefined' ? global : window;\nconst document_ = typeof document !== 'undefined' ? document : {};\nexport { window_ as window, global_ as global, document_ as document };\n//# sourceMappingURL=globals.js.map","// mjolnir.js\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\nimport { Input } from \"./input.js\";\nimport { userAgent } from \"../utils/globals.js\";\nconst firefox = userAgent.indexOf('firefox') !== -1;\n// Constants for normalizing input delta\nconst WHEEL_DELTA_MAGIC_SCALER = 4.000244140625;\nconst WHEEL_DELTA_PER_LINE = 40;\n// Slow down zoom if shift key is held for more precise zooming\nconst SHIFT_MULTIPLIER = 0.25;\nexport class WheelInput extends Input {\n constructor(element, callback, options) {\n super(element, callback, { enable: true, ...options });\n /* eslint-disable complexity, max-statements */\n this.handleEvent = (event) => {\n if (!this.options.enable) {\n return;\n }\n let value = event.deltaY;\n if (globalThis.WheelEvent) {\n // Firefox doubles the values on retina screens...\n if (firefox && event.deltaMode === globalThis.WheelEvent.DOM_DELTA_PIXEL) {\n value /= globalThis.devicePixelRatio;\n }\n if (event.deltaMode === globalThis.WheelEvent.DOM_DELTA_LINE) {\n value *= WHEEL_DELTA_PER_LINE;\n }\n }\n if (value !== 0 && value % WHEEL_DELTA_MAGIC_SCALER === 0) {\n // This one is definitely a mouse wheel event.\n // Normalize this value to match trackpad.\n value = Math.floor(value / WHEEL_DELTA_MAGIC_SCALER);\n }\n if (event.shiftKey && value) {\n value = value * SHIFT_MULTIPLIER;\n }\n this.callback({\n type: 'wheel',\n center: {\n x: event.clientX,\n y: event.clientY\n },\n delta: -value,\n srcEvent: event,\n pointerType: 'mouse',\n target: event.target\n });\n };\n element.addEventListener('wheel', this.handleEvent, { passive: false });\n }\n destroy() {\n this.element.removeEventListener('wheel', this.handleEvent);\n }\n /**\n * Enable this input (begin processing events)\n * if the specified event type is among those handled by this input.\n */\n enableEventType(eventType, enabled) {\n if (eventType === 'wheel') {\n this.options.enable = enabled;\n }\n }\n}\n//# sourceMappingURL=wheel-input.js.map","// deck.gl\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\n// Note: The numeric values here are matched by shader code in the\n// \"project\" and \"project64\" shader modules. Both places need to be\n// updated.\nimport log from \"../utils/log.js\";\nimport { Pan, InputDirection, Pinch, Tap } from 'mjolnir.js';\n/**\n * The coordinate system that positions/dimensions are defined in.\n */\nexport const COORDINATE_SYSTEM = {\n /**\n * `LNGLAT` if rendering into a geospatial viewport, `CARTESIAN` otherwise\n */\n DEFAULT: -1,\n /**\n * Positions are interpreted as [longitude, latitude, elevation]\n * longitude/latitude are in degrees, elevation is in meters.\n * Dimensions are in meters.\n */\n LNGLAT: 1,\n /**\n * Positions are interpreted as [x, y, z] in meter offsets from the coordinate origin.\n * Dimensions are in meters.\n */\n METER_OFFSETS: 2,\n /**\n * Positions are interpreted as [deltaLng, deltaLat, elevation] from the coordinate origin.\n * deltaLng/deltaLat are in degrees, elevation is in meters.\n * Dimensions are in meters.\n */\n LNGLAT_OFFSETS: 3,\n /**\n * Positions and dimensions are in the common units of the viewport.\n */\n CARTESIAN: 0\n};\n// Deprecated\n/* eslint-disable accessor-pairs */\nObject.defineProperty(COORDINATE_SYSTEM, 'IDENTITY', {\n get: () => {\n log.deprecated('COORDINATE_SYSTEM.IDENTITY', 'COORDINATE_SYSTEM.CARTESIAN')();\n return 0;\n }\n});\n/* eslint-enable accessor-pairs */\n/**\n * How coordinates are transformed from the world space into the common space.\n */\nexport const PROJECTION_MODE = {\n /**\n * Render geospatial data in Web Mercator projection\n */\n WEB_MERCATOR: 1,\n /**\n * Render geospatial data as a 3D globe\n */\n GLOBE: 2,\n /**\n * (Internal use only) Web Mercator projection at high zoom\n */\n WEB_MERCATOR_AUTO_OFFSET: 4,\n /**\n * No transformation\n */\n IDENTITY: 0\n};\nexport const UNIT = {\n common: 0,\n meters: 1,\n pixels: 2\n};\nexport const EVENT_HANDLERS = {\n click: 'onClick',\n dblclick: 'onClick',\n panstart: 'onDragStart',\n panmove: 'onDrag',\n panend: 'onDragEnd'\n};\nexport const RECOGNIZERS = {\n multipan: [Pan, { threshold: 10, direction: InputDirection.Vertical, pointers: 2 }],\n pinch: [Pinch, {}, null, ['multipan']],\n pan: [Pan, { threshold: 1 }, ['pinch'], ['multipan']],\n dblclick: [Tap, { event: 'dblclick', taps: 2 }],\n click: [Tap, { event: 'click' }, null, ['dblclick']]\n};\n/**\n * @deprecated Use string constants directly\n */\nexport const OPERATION = {\n DRAW: 'draw',\n MASK: 'mask',\n TERRAIN: 'terrain'\n};\n//# sourceMappingURL=constants.js.map","import { vec4 } from '@math.gl/core';\n// Helper, avoids low-precision 32 bit matrices from gl-matrix mat4.create()\nexport function createMat4() {\n return [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1];\n}\n// Transforms a vec4 with a projection matrix\nexport function transformVector(matrix, vector) {\n const result = vec4.transformMat4([], vector, matrix);\n vec4.scale(result, result, 1 / result[3]);\n return result;\n}\nexport function mod(value, divisor) {\n const modulus = value % divisor;\n return modulus < 0 ? divisor + modulus : modulus;\n}\nexport function lerp(start, end, step) {\n return step * end + (1 - step) * start;\n}\nexport function clamp(x, min, max) {\n return x < min ? min : x > max ? max : x;\n}\nfunction ieLog2(x) {\n return Math.log(x) * Math.LOG2E;\n}\n// Handle missing log2 in IE 11\nexport const log2 = Math.log2 || ieLog2;\n//# sourceMappingURL=math-utils.js.map","// Replacement for the external assert method to reduce bundle size\n// Note: We don't use the second \"message\" argument in calling code,\n// so no need to support it here\nexport function assert(condition, message) {\n if (!condition) {\n throw new Error(message || '@math.gl/web-mercator: assertion failed.');\n }\n}\n//# sourceMappingURL=assert.js.map","// TODO - THE UTILITIES IN THIS FILE SHOULD BE IMPORTED FROM WEB-MERCATOR-VIEWPORT MODULE\nimport { createMat4, transformVector, clamp, log2 } from \"./math-utils.js\";\nimport { mat4, vec2, vec3 } from '@math.gl/core';\nimport { assert } from \"./assert.js\";\n// CONSTANTS\nconst PI = Math.PI;\nconst PI_4 = PI / 4;\nconst DEGREES_TO_RADIANS = PI / 180;\nconst RADIANS_TO_DEGREES = 180 / PI;\nconst TILE_SIZE = 512;\n// Average circumference (40075 km equatorial, 40007 km meridional)\nconst EARTH_CIRCUMFERENCE = 40.03e6;\n// Latitude that makes a square world, 2 * atan(E ** PI) - PI / 2\nexport const MAX_LATITUDE = 85.051129;\n// Mapbox default altitude\nexport const DEFAULT_ALTITUDE = 1.5;\n/** Logarithimic zoom to linear scale **/\nexport function zoomToScale(zoom) {\n return Math.pow(2, zoom);\n}\n/** Linear scale to logarithimic zoom **/\nexport function scaleToZoom(scale) {\n return log2(scale);\n}\n/**\n * Project [lng,lat] on sphere onto [x,y] on 512*512 Mercator Zoom 0 tile.\n * Performs the nonlinear part of the web mercator projection.\n * Remaining projection is done with 4x4 matrices which also handles\n * perspective.\n *\n * @param lngLat - [lng, lat] coordinates\n * Specifies a point on the sphere to project onto the map.\n * @return [x,y] coordinates.\n */\nexport function lngLatToWorld(lngLat) {\n const [lng, lat] = lngLat;\n assert(Number.isFinite(lng));\n assert(Number.isFinite(lat) && lat >= -90 && lat <= 90, 'invalid latitude');\n const lambda2 = lng * DEGREES_TO_RADIANS;\n const phi2 = lat * DEGREES_TO_RADIANS;\n const x = (TILE_SIZE * (lambda2 + PI)) / (2 * PI);\n const y = (TILE_SIZE * (PI + Math.log(Math.tan(PI_4 + phi2 * 0.5)))) / (2 * PI);\n return [x, y];\n}\n/**\n * Unproject world point [x,y] on map onto {lat, lon} on sphere\n *\n * @param xy - array with [x,y] members\n * representing point on projected map plane\n * @return - array with [x,y] of point on sphere.\n * Has toArray method if you need a GeoJSON Array.\n * Per cartographic tradition, lat and lon are specified as degrees.\n */\nexport function worldToLngLat(xy) {\n const [x, y] = xy;\n const lambda2 = (x / TILE_SIZE) * (2 * PI) - PI;\n const phi2 = 2 * (Math.atan(Math.exp((y / TILE_SIZE) * (2 * PI) - PI)) - PI_4);\n return [lambda2 * RADIANS_TO_DEGREES, phi2 * RADIANS_TO_DEGREES];\n}\n/**\n * Returns the zoom level that gives a 1 meter pixel at a certain latitude\n * 1 = C*cos(y)/2^z/TILE_SIZE = C*cos(y)/2^(z+9)\n */\nexport function getMeterZoom(options) {\n const { latitude } = options;\n assert(Number.isFinite(latitude));\n const latCosine = Math.cos(latitude * DEGREES_TO_RADIANS);\n return scaleToZoom(EARTH_CIRCUMFERENCE * latCosine) - 9;\n}\n/**\n * Calculate the conversion from meter to common units at a given latitude\n * This is a cheaper version of `getDistanceScales`\n * @param latitude center latitude in degrees\n * @returns common units per meter\n */\nexport function unitsPerMeter(latitude) {\n const latCosine = Math.cos(latitude * DEGREES_TO_RADIANS);\n return TILE_SIZE / EARTH_CIRCUMFERENCE / latCosine;\n}\n/**\n * Calculate distance scales in meters around current lat/lon, both for\n * degrees and pixels.\n * In mercator projection mode, the distance scales vary significantly\n * with latitude.\n */\nexport function getDistanceScales(options) {\n const { latitude, longitude, highPrecision = false } = options;\n assert(Number.isFinite(latitude) && Number.isFinite(longitude));\n const worldSize = TILE_SIZE;\n const latCosine = Math.cos(latitude * DEGREES_TO_RADIANS);\n /**\n * Number of pixels occupied by one degree longitude around current lat/lon:\n unitsPerDegreeX = d(lngLatToWorld([lng, lat])[0])/d(lng)\n = scale * TILE_SIZE * DEGREES_TO_RADIANS / (2 * PI)\n unitsPerDegreeY = d(lngLatToWorld([lng, lat])[1])/d(lat)\n = -scale * TILE_SIZE * DEGREES_TO_RADIANS / cos(lat * DEGREES_TO_RADIANS) / (2 * PI)\n */\n const unitsPerDegreeX = worldSize / 360;\n const unitsPerDegreeY = unitsPerDegreeX / latCosine;\n /**\n * Number of pixels occupied by one meter around current lat/lon:\n */\n const altUnitsPerMeter = worldSize / EARTH_CIRCUMFERENCE / latCosine;\n /**\n * LngLat: longitude -> east and latitude -> north (bottom left)\n * UTM meter offset: x -> east and y -> north (bottom left)\n * World space: x -> east and y -> south (top left)\n *\n * Y needs to be flipped when converting delta degree/meter to delta pixels\n */\n const result = {\n unitsPerMeter: [altUnitsPerMeter, altUnitsPerMeter, altUnitsPerMeter],\n metersPerUnit: [1 / altUnitsPerMeter, 1 / altUnitsPerMeter, 1 / altUnitsPerMeter],\n unitsPerDegree: [unitsPerDegreeX, unitsPerDegreeY, altUnitsPerMeter],\n degreesPerUnit: [1 / unitsPerDegreeX, 1 / unitsPerDegreeY, 1 / altUnitsPerMeter]\n };\n /**\n * Taylor series 2nd order for 1/latCosine\n f'(a) * (x - a)\n = d(1/cos(lat * DEGREES_TO_RADIANS))/d(lat) * dLat\n = DEGREES_TO_RADIANS * tan(lat * DEGREES_TO_RADIANS) / cos(lat * DEGREES_TO_RADIANS) * dLat\n */\n if (highPrecision) {\n const latCosine2 = (DEGREES_TO_RADIANS * Math.tan(latitude * DEGREES_TO_RADIANS)) / latCosine;\n const unitsPerDegreeY2 = (unitsPerDegreeX * latCosine2) / 2;\n const altUnitsPerDegree2 = (worldSize / EARTH_CIRCUMFERENCE) * latCosine2;\n const altUnitsPerMeter2 = (altUnitsPerDegree2 / unitsPerDegreeY) * altUnitsPerMeter;\n result.unitsPerDegree2 = [0, unitsPerDegreeY2, altUnitsPerDegree2];\n result.unitsPerMeter2 = [altUnitsPerMeter2, 0, altUnitsPerMeter2];\n }\n // Main results, used for converting meters to latlng deltas and scaling offsets\n return result;\n}\n/**\n * Offset a lng/lat position by meterOffset (northing, easting)\n */\nexport function addMetersToLngLat(lngLatZ, xyz) {\n const [longitude, latitude, z0] = lngLatZ;\n const [x, y, z] = xyz;\n // eslint-disable-next-line no-shadow\n const { unitsPerMeter, unitsPerMeter2 } = getDistanceScales({\n longitude,\n latitude,\n highPrecision: true\n });\n const worldspace = lngLatToWorld(lngLatZ);\n worldspace[0] += x * (unitsPerMeter[0] + unitsPerMeter2[0] * y);\n worldspace[1] += y * (unitsPerMeter[1] + unitsPerMeter2[1] * y);\n const newLngLat = worldToLngLat(worldspace);\n const newZ = (z0 || 0) + (z || 0);\n return Number.isFinite(z0) || Number.isFinite(z) ? [newLngLat[0], newLngLat[1], newZ] : newLngLat;\n}\n/**\n *\n * view and projection matrix creation is intentionally kept compatible with\n * mapbox-gl's implementation to ensure that seamless interoperation\n * with mapbox and react-map-gl. See: https://github.com/mapbox/mapbox-gl-js\n */\nexport function getViewMatrix(options) {\n const { \n // Viewport props\n height, pitch, bearing, altitude, \n // Pre-calculated parameters\n scale, center } = options;\n // VIEW MATRIX: PROJECTS MERCATOR WORLD COORDINATES\n // Note that mercator world coordinates typically need to be flipped\n //\n // Note: As usual, matrix operation orders should be read in reverse\n // since vectors will be multiplied from the right during transformation\n const vm = createMat4();\n // Move camera to altitude (along the pitch & bearing direction)\n mat4.translate(vm, vm, [0, 0, -altitude]);\n // Rotate by bearing, and then by pitch (which tilts the view)\n mat4.rotateX(vm, vm, -pitch * DEGREES_TO_RADIANS);\n mat4.rotateZ(vm, vm, bearing * DEGREES_TO_RADIANS);\n const relativeScale = scale / height;\n mat4.scale(vm, vm, [relativeScale, relativeScale, relativeScale]);\n if (center) {\n mat4.translate(vm, vm, vec3.negate([], center));\n }\n return vm;\n}\n/**\n * Calculates mapbox compatible projection matrix from parameters\n *\n * @param options.width Width of \"viewport\" or window\n * @param options.height Height of \"viewport\" or window\n * @param options.scale Scale at the current zoom\n * @param options.center Offset of the target, vec3 in world space\n * @param options.offset Offset of the focal point, vec2 in screen space\n * @param options.pitch Camera angle in degrees (0 is straight down)\n * @param options.fovy field of view in degrees\n * @param options.altitude if provided, field of view is calculated using `altitudeToFovy()`\n * @param options.nearZMultiplier control z buffer\n * @param options.farZMultiplier control z buffer\n * @returns project parameters object\n */\nexport function getProjectionParameters(options) {\n const { width, height, altitude, pitch = 0, offset, center, scale, nearZMultiplier = 1, farZMultiplier = 1 } = options;\n let { fovy = altitudeToFovy(DEFAULT_ALTITUDE) } = options;\n // For back-compatibility allow field of view to be\n // derived from altitude\n if (altitude !== undefined) {\n fovy = altitudeToFovy(altitude);\n }\n const fovRadians = fovy * DEGREES_TO_RADIANS;\n const pitchRadians = pitch * DEGREES_TO_RADIANS;\n // Distance from camera to the target\n const focalDistance = fovyToAltitude(fovy);\n let cameraToSeaLevelDistance = focalDistance;\n if (center) {\n cameraToSeaLevelDistance += (center[2] * scale) / Math.cos(pitchRadians) / height;\n }\n const fovAboveCenter = fovRadians * (0.5 + (offset ? offset[1] : 0) / height);\n // Find the distance from the center point to the center top\n // in focal distance units using law of sines.\n const topHalfSurfaceDistance = (Math.sin(fovAboveCenter) * cameraToSeaLevelDistance) /\n Math.sin(clamp(Math.PI / 2 - pitchRadians - fovAboveCenter, 0.01, Math.PI - 0.01));\n // Calculate z distance of the farthest fragment that should be rendered.\n const furthestDistance = Math.sin(pitchRadians) * topHalfSurfaceDistance + cameraToSeaLevelDistance;\n // Matches mapbox limit\n const horizonDistance = cameraToSeaLevelDistance * 10;\n // Calculate z value of the farthest fragment that should be rendered.\n const farZ = Math.min(furthestDistance * farZMultiplier, horizonDistance);\n return {\n fov: fovRadians,\n aspect: width / height,\n focalDistance,\n near: nearZMultiplier,\n far: farZ\n };\n}\n/**\n * CALCULATE PROJECTION MATRIX: PROJECTS FROM CAMERA (VIEW) SPACE TO CLIPSPACE\n *\n * To match mapbox's z buffer:\n * - \\<= 0.28: nearZMultiplier: 0.1, farZmultiplier: 1\n * - \\>= 0.29: nearZMultiplier: 1 / height, farZMultiplier: 1.01\n *\n * @param options Viewport options\n * @param options.width Width of \"viewport\" or window\n * @param options.height Height of \"viewport\" or window\n * @param options.scale Scale at the current zoom\n * @param options.center Offset of the target, vec3 in world space\n * @param options.offset Offset of the focal point, vec2 in screen space\n * @param options.pitch Camera angle in degrees (0 is straight down)\n * @param options.fovy field of view in degrees\n * @param options.altitude if provided, field of view is calculated using `altitudeToFovy()`\n * @param options.nearZMultiplier control z buffer\n * @param options.farZMultiplier control z buffer\n * @returns 4x4 projection matrix\n */\nexport function getProjectionMatrix(options) {\n const { fov, aspect, near, far } = getProjectionParameters(options);\n const projectionMatrix = mat4.perspective([], fov, // fov in radians\n aspect, // aspect ratio\n near, // near plane\n far // far plane\n );\n return projectionMatrix;\n}\n/**\n *\n * Convert an altitude to field of view such that the\n * focal distance is equal to the altitude\n *\n * @param altitude - altitude of camera in screen units\n * @return fovy field of view in degrees\n */\nexport function altitudeToFovy(altitude) {\n return 2 * Math.atan(0.5 / altitude) * RADIANS_TO_DEGREES;\n}\n/**\n *\n * Convert an field of view such that the\n * focal distance is equal to the altitude\n *\n * @param fovy - field of view in degrees\n * @return altitude altitude of camera in screen units\n */\nexport function fovyToAltitude(fovy) {\n return 0.5 / Math.tan(0.5 * fovy * DEGREES_TO_RADIANS);\n}\n// Project flat coordinates to pixels on screen.\nexport function worldToPixels(xyz, pixelProjectionMatrix) {\n const [x, y, z = 0] = xyz;\n assert(Number.isFinite(x) && Number.isFinite(y) && Number.isFinite(z));\n return transformVector(pixelProjectionMatrix, [x, y, z, 1]);\n}\n/**\n * Unproject pixels on screen to flat coordinates.\n *\n * @param xyz - pixel coordinate on screen.\n * @param pixelUnprojectionMatrix - unprojection matrix 4x4\n * @param targetZ - if pixel coordinate does not have a 3rd component (depth),\n * targetZ is used as the elevation plane to unproject onto\n * @return [x, y, Z] flat coordinates on 512*512 Mercator Zoom 0 tile.\n */\nexport function pixelsToWorld(xyz, pixelUnprojectionMatrix, targetZ = 0) {\n const [x, y, z] = xyz;\n assert(Number.isFinite(x) && Number.isFinite(y), 'invalid pixel coordinate');\n if (Number.isFinite(z)) {\n // Has depth component\n const coord = transformVector(pixelUnprojectionMatrix, [x, y, z, 1]);\n return coord;\n }\n // since we don't know the correct projected z value for the point,\n // unproject two points to get a line and then find the point on that line with z=0\n const coord0 = transformVector(pixelUnprojectionMatrix, [x, y, 0, 1]);\n const coord1 = transformVector(pixelUnprojectionMatrix, [x, y, 1, 1]);\n const z0 = coord0[2];\n const z1 = coord1[2];\n const t = z0 === z1 ? 0 : ((targetZ || 0) - z0) / (z1 - z0);\n return vec2.lerp([], coord0, coord1, t);\n}\n//# sourceMappingURL=web-mercator-utils.js.map","import { assert } from \"./assert.js\";\nimport { log2, clamp } from \"./math-utils.js\";\nimport { MAX_LATITUDE, lngLatToWorld, worldToLngLat } from \"./web-mercator-utils.js\";\n/**\n * Returns map settings {latitude, longitude, zoom}\n * that will contain the provided corners within the provided width.\n *\n * > _Note: Only supports non-perspective mode._\n *\n * @param options fit bounds parameters\n * @returns - latitude, longitude and zoom\n */\nexport function fitBounds(options) {\n const { width, height, bounds, minExtent = 0, // 0.01 would be about 1000 meters (degree is ~110KM)\n maxZoom = 24, // ~x4,000,000 => About 10 meter extents\n offset = [0, 0] } = options;\n const [[west, south], [east, north]] = bounds;\n const padding = getPaddingObject(options.padding);\n const nw = lngLatToWorld([west, clamp(north, -MAX_LATITUDE, MAX_LATITUDE)]);\n const se = lngLatToWorld([east, clamp(south, -MAX_LATITUDE, MAX_LATITUDE)]);\n // width/height on the Web Mercator plane\n const size = [\n Math.max(Math.abs(se[0] - nw[0]), minExtent),\n Math.max(Math.abs(se[1] - nw[1]), minExtent)\n ];\n const targetSize = [\n width - padding.left - padding.right - Math.abs(offset[0]) * 2,\n height - padding.top - padding.bottom - Math.abs(offset[1]) * 2\n ];\n assert(targetSize[0] > 0 && targetSize[1] > 0);\n // scale = screen pixels per unit on the Web Mercator plane\n const scaleX = targetSize[0] / size[0];\n const scaleY = targetSize[1] / size[1];\n // Find how much we need to shift the center\n const offsetX = (padding.right - padding.left) / 2 / scaleX;\n const offsetY = (padding.top - padding.bottom) / 2 / scaleY;\n const center = [(se[0] + nw[0]) / 2 + offsetX, (se[1] + nw[1]) / 2 + offsetY];\n const centerLngLat = worldToLngLat(center);\n const zoom = Math.min(maxZoom, log2(Math.abs(Math.min(scaleX, scaleY))));\n assert(Number.isFinite(zoom));\n return {\n longitude: centerLngLat[0],\n latitude: centerLngLat[1],\n zoom\n };\n}\n// Helpers\nfunction getPaddingObject(padding = 0) {\n if (typeof padding === 'number') {\n return {\n top: padding,\n bottom: padding,\n left: padding,\n right: padding\n };\n }\n // Make sure all the required properties are set\n assert(Number.isFinite(padding.top) &&\n Number.isFinite(padding.bottom) &&\n Number.isFinite(padding.left) &&\n Number.isFinite(padding.right));\n return padding;\n}\n//# sourceMappingURL=fit-bounds.js.map","/* eslint-disable camelcase */\nimport { vec2 } from '@math.gl/core';\nimport { worldToLngLat } from \"./web-mercator-utils.js\";\nimport { transformVector } from \"./math-utils.js\";\nconst DEGREES_TO_RADIANS = Math.PI / 180;\n/*\n * Returns the quad at the intersection of the frustum and the given z plane\n * @param {WebMercatorViewport} viewport\n * @param {Number} z - elevation in meters\n */\nexport function getBounds(viewport, z = 0) {\n // eslint-disable-next-line @typescript-eslint/unbound-method\n const { width, height, unproject } = viewport;\n const unprojectOps = { targetZ: z };\n const bottomLeft = unproject([0, height], unprojectOps);\n const bottomRight = unproject([width, height], unprojectOps);\n let topLeft;\n let topRight;\n const halfFov = viewport.fovy\n ? 0.5 * viewport.fovy * DEGREES_TO_RADIANS\n : Math.atan(0.5 / viewport.altitude);\n const angleToGround = (90 - viewport.pitch) * DEGREES_TO_RADIANS;\n // The top plane is parallel to the ground if halfFov == angleToGround\n if (halfFov > angleToGround - 0.01) {\n // intersect with the far plane\n topLeft = unprojectOnFarPlane(viewport, 0, z);\n topRight = unprojectOnFarPlane(viewport, width, z);\n }\n else {\n // intersect with the top plane\n topLeft = unproject([0, 0], unprojectOps);\n topRight = unproject([width, 0], unprojectOps);\n }\n return [bottomLeft, bottomRight, topRight, topLeft];\n}\n/*\n * Find a point on the far clipping plane of the viewport\n * @param {WebMercatorViewport} viewport\n * @param {Number} x - projected x in screen space\n * @param {Number} targetZ - the elevation of the point in meters\n */\nfunction unprojectOnFarPlane(viewport, x, targetZ) {\n const { pixelUnprojectionMatrix } = viewport;\n const coord0 = transformVector(pixelUnprojectionMatrix, [x, 0, 1, 1]);\n const coord1 = transformVector(pixelUnprojectionMatrix, [x, viewport.height, 1, 1]);\n const z = targetZ * viewport.distanceScales.unitsPerMeter[2];\n const t = (z - coord0[2]) / (coord1[2] - coord0[2]);\n const coord = vec2.lerp([], coord0, coord1, t);\n const result = worldToLngLat(coord);\n result.push(targetZ);\n return result;\n}\n//# sourceMappingURL=get-bounds.js.map","// deck.gl\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\nexport class TypedArrayManager {\n constructor(options = {}) {\n this._pool = [];\n this.opts = { overAlloc: 2, poolSize: 100 };\n this.setOptions(options);\n }\n setOptions(options) {\n Object.assign(this.opts, options);\n }\n allocate(typedArray, count, { size = 1, type, padding = 0, copy = false, initialize = false, maxCount }) {\n const Type = type || (typedArray && typedArray.constructor) || Float32Array;\n const newSize = count * size + padding;\n if (ArrayBuffer.isView(typedArray)) {\n if (newSize <= typedArray.length) {\n return typedArray;\n }\n if (newSize * typedArray.BYTES_PER_ELEMENT <= typedArray.buffer.byteLength) {\n return new Type(typedArray.buffer, 0, newSize);\n }\n }\n let maxSize = Infinity;\n if (maxCount) {\n maxSize = maxCount * size + padding;\n }\n const newArray = this._allocate(Type, newSize, initialize, maxSize);\n if (typedArray && copy) {\n newArray.set(typedArray);\n }\n else if (!initialize) {\n // Hack - always initialize the first 4 elements. NaNs crash the Attribute validation\n newArray.fill(0, 0, 4);\n }\n this._release(typedArray);\n return newArray;\n }\n release(typedArray) {\n this._release(typedArray);\n }\n _allocate(Type, size, initialize, maxSize) {\n // Allocate at least one element to ensure a valid buffer\n let sizeToAllocate = Math.max(Math.ceil(size * this.opts.overAlloc), 1);\n // Don't over allocate after certain specified number of elements\n if (sizeToAllocate > maxSize) {\n sizeToAllocate = maxSize;\n }\n // Check if available in pool\n const pool = this._pool;\n const byteLength = Type.BYTES_PER_ELEMENT * sizeToAllocate;\n const i = pool.findIndex(b => b.byteLength >= byteLength);\n if (i >= 0) {\n // Create a new array using an existing buffer\n const array = new Type(pool.splice(i, 1)[0], 0, sizeToAllocate);\n if (initialize) {\n // Viewing a buffer with a different type may create NaNs\n array.fill(0);\n }\n return array;\n }\n return new Type(sizeToAllocate);\n }\n _release(typedArray) {\n if (!ArrayBuffer.isView(typedArray)) {\n return;\n }\n const pool = this._pool;\n const { buffer } = typedArray;\n // Save the buffer of the released array into the pool\n // Sort buffers by size\n // TODO - implement binary search?\n const { byteLength } = buffer;\n const i = pool.findIndex(b => b.byteLength >= byteLength);\n if (i < 0) {\n pool.push(buffer);\n }\n else if (i > 0 || pool.length < this.opts.poolSize) {\n pool.splice(i, 0, buffer);\n }\n if (pool.length > this.opts.poolSize) {\n // Drop the smallest one\n pool.shift();\n }\n }\n}\nexport default new TypedArrayManager();\n//# sourceMappingURL=typed-array-manager.js.map","// deck.gl\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\n// Extensions to math.gl library. Intended to be folded back.\nimport typedArrayManager from \"./typed-array-manager.js\";\nimport { Vector3 } from '@math.gl/core';\n// Helper, avoids low-precision 32 bit matrices from gl-matrix mat4.create()\nexport function createMat4() {\n return [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1];\n}\nexport function mod(value, divisor) {\n const modulus = value % divisor;\n return modulus < 0 ? divisor + modulus : modulus;\n}\n// Extract camera vectors (move to math library?)\nexport function getCameraPosition(viewMatrixInverse) {\n // Read the translation from the inverse view matrix\n return [viewMatrixInverse[12], viewMatrixInverse[13], viewMatrixInverse[14]];\n}\n// https://www.gamedevs.org/uploads/fast-extraction-viewing-frustum-planes-from-world-view-projection-matrix.pdf\nexport function getFrustumPlanes(viewProjectionMatrix) {\n return {\n left: getFrustumPlane(viewProjectionMatrix[3] + viewProjectionMatrix[0], viewProjectionMatrix[7] + viewProjectionMatrix[4], viewProjectionMatrix[11] + viewProjectionMatrix[8], viewProjectionMatrix[15] + viewProjectionMatrix[12]),\n right: getFrustumPlane(viewProjectionMatrix[3] - viewProjectionMatrix[0], viewProjectionMatrix[7] - viewProjectionMatrix[4], viewProjectionMatrix[11] - viewProjectionMatrix[8], viewProjectionMatrix[15] - viewProjectionMatrix[12]),\n bottom: getFrustumPlane(viewProjectionMatrix[3] + viewProjectionMatrix[1], viewProjectionMatrix[7] + viewProjectionMatrix[5], viewProjectionMatrix[11] + viewProjectionMatrix[9], viewProjectionMatrix[15] + viewProjectionMatrix[13]),\n top: getFrustumPlane(viewProjectionMatrix[3] - viewProjectionMatrix[1], viewProjectionMatrix[7] - viewProjectionMatrix[5], viewProjectionMatrix[11] - viewProjectionMatrix[9], viewProjectionMatrix[15] - viewProjectionMatrix[13]),\n near: getFrustumPlane(viewProjectionMatrix[3] + viewProjectionMatrix[2], viewProjectionMatrix[7] + viewProjectionMatrix[6], viewProjectionMatrix[11] + viewProjectionMatrix[10], viewProjectionMatrix[15] + viewProjectionMatrix[14]),\n far: getFrustumPlane(viewProjectionMatrix[3] - viewProjectionMatrix[2], viewProjectionMatrix[7] - viewProjectionMatrix[6], viewProjectionMatrix[11] - viewProjectionMatrix[10], viewProjectionMatrix[15] - viewProjectionMatrix[14])\n };\n}\nconst scratchVector = new Vector3();\nfunction getFrustumPlane(a, b, c, d) {\n scratchVector.set(a, b, c);\n const L = scratchVector.len();\n return { distance: d / L, normal: new Vector3(-a / L, -b / L, -c / L) };\n}\n/**\n * Calculate the low part of a WebGL 64 bit float\n * @param x {number} - the input float number\n * @returns {number} - the lower 32 bit of the number\n */\nexport function fp64LowPart(x) {\n return x - Math.fround(x);\n}\nlet scratchArray;\n/**\n * Split a Float64Array into a double-length Float32Array\n * @param typedArray\n * @param options\n * @param options.size - per attribute size\n * @param options.startIndex - start index in the source array\n * @param options.endIndex - end index in the source array\n * @returns {} - high part, low part for each attribute:\n [1xHi, 1yHi, 1zHi, 1xLow, 1yLow, 1zLow, 2xHi, ...]\n */\nexport function toDoublePrecisionArray(typedArray, options) {\n const { size = 1, startIndex = 0 } = options;\n const endIndex = options.endIndex !== undefined ? options.endIndex : typedArray.length;\n const count = (endIndex - startIndex) / size;\n scratchArray = typedArrayManager.allocate(scratchArray, count, {\n type: Float32Array,\n size: size * 2\n });\n let sourceIndex = startIndex;\n let targetIndex = 0;\n while (sourceIndex < endIndex) {\n for (let j = 0; j < size; j++) {\n const value = typedArray[sourceIndex++];\n scratchArray[targetIndex + j] = value;\n scratchArray[targetIndex + j + size] = fp64LowPart(value);\n }\n targetIndex += size * 2;\n }\n return scratchArray.subarray(0, count * size * 2);\n}\nexport function mergeBounds(boundsList) {\n let mergedBounds = null;\n let isMerged = false;\n for (const bounds of boundsList) {\n /* eslint-disable-next-line no-continue */\n if (!bounds)\n continue;\n if (!mergedBounds) {\n mergedBounds = bounds;\n }\n else {\n if (!isMerged) {\n // Copy to avoid mutating input bounds\n mergedBounds = [\n [mergedBounds[0][0], mergedBounds[0][1]],\n [mergedBounds[1][0], mergedBounds[1][1]]\n ];\n isMerged = true;\n }\n mergedBounds[0][0] = Math.min(mergedBounds[0][0], bounds[0][0]);\n mergedBounds[0][1] = Math.min(mergedBounds[0][1], bounds[0][1]);\n mergedBounds[1][0] = Math.max(mergedBounds[1][0], bounds[1][0]);\n mergedBounds[1][1] = Math.max(mergedBounds[1][1], bounds[1][1]);\n }\n }\n return mergedBounds;\n}\n//# sourceMappingURL=math-utils.js.map","// deck.gl\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\nimport log from \"../utils/log.js\";\nimport { createMat4, getCameraPosition, getFrustumPlanes } from \"../utils/math-utils.js\";\nimport { Matrix4, Vector3, equals, clamp, mat4 } from '@math.gl/core';\nimport { getDistanceScales, getMeterZoom, lngLatToWorld, worldToLngLat, worldToPixels, pixelsToWorld } from '@math.gl/web-mercator';\nimport { PROJECTION_MODE } from \"../lib/constants.js\";\nconst DEGREES_TO_RADIANS = Math.PI / 180;\nconst IDENTITY = createMat4();\nconst ZERO_VECTOR = [0, 0, 0];\nconst DEFAULT_DISTANCE_SCALES = {\n unitsPerMeter: [1, 1, 1],\n metersPerUnit: [1, 1, 1]\n};\n// / Helpers\nfunction createProjectionMatrix({ width, height, orthographic, fovyRadians, focalDistance, padding, near, far }) {\n const aspect = width / height;\n const matrix = orthographic\n ? new Matrix4().orthographic({ fovy: fovyRadians, aspect, focalDistance, near, far })\n : new Matrix4().perspective({ fovy: fovyRadians, aspect, near, far });\n if (padding) {\n const { left = 0, right = 0, top = 0, bottom = 0 } = padding;\n const offsetX = clamp((left + width - right) / 2, 0, width) - width / 2;\n const offsetY = clamp((top + height - bottom) / 2, 0, height) - height / 2;\n // pixels to clip space\n matrix[8] -= (offsetX * 2) / width;\n matrix[9] += (offsetY * 2) / height;\n }\n return matrix;\n}\n/**\n * Manages coordinate system transformations.\n *\n * Note: The Viewport is immutable in the sense that it only has accessors.\n * A new viewport instance should be created if any parameters have changed.\n */\nclass Viewport {\n // eslint-disable-next-line complexity\n constructor(opts = {}) {\n this._frustumPlanes = {};\n // @ts-ignore\n this.id = opts.id || this.constructor.displayName || 'viewport';\n this.x = opts.x || 0;\n this.y = opts.y || 0;\n // Silently allow apps to send in w,h = 0,0\n this.width = opts.width || 1;\n this.height = opts.height || 1;\n this.zoom = opts.zoom || 0;\n this.padding = opts.padding;\n this.distanceScales = opts.distanceScales || DEFAULT_DISTANCE_SCALES;\n this.focalDistance = opts.focalDistance || 1;\n this.position = opts.position || ZERO_VECTOR;\n this.modelMatrix = opts.modelMatrix || null;\n const { longitude, latitude } = opts;\n this.isGeospatial = Number.isFinite(latitude) && Number.isFinite(longitude);\n this._initProps(opts);\n this._initMatrices(opts);\n // Bind methods for easy access\n this.equals = this.equals.bind(this);\n this.project = this.project.bind(this);\n this.unproject = this.unproject.bind(this);\n this.projectPosition = this.projectPosition.bind(this);\n this.unprojectPosition = this.unprojectPosition.bind(this);\n this.projectFlat = this.projectFlat.bind(this);\n this.unprojectFlat = this.unprojectFlat.bind(this);\n }\n get subViewports() {\n return null;\n }\n get metersPerPixel() {\n return this.distanceScales.metersPerUnit[2] / this.scale;\n }\n get projectionMode() {\n if (this.isGeospatial) {\n return this.zoom < 12\n ? PROJECTION_MODE.WEB_MERCATOR\n : PROJECTION_MODE.WEB_MERCATOR_AUTO_OFFSET;\n }\n return PROJECTION_MODE.IDENTITY;\n }\n // Two viewports are equal if width and height are identical, and if\n // their view and projection matrices are (approximately) equal.\n equals(viewport) {\n if (!(viewport instanceof Viewport)) {\n return false;\n }\n if (this === viewport) {\n return true;\n }\n return (viewport.width === this.width &&\n viewport.height === this.height &&\n viewport.scale === this.scale &&\n equals(viewport.projectionMatrix, this.projectionMatrix) &&\n equals(viewport.viewMatrix, this.viewMatrix));\n // TODO - check distance scales?\n }\n /**\n * Projects xyz (possibly latitude and longitude) to pixel coordinates in window\n * using viewport projection parameters\n * - [longitude, latitude] to [x, y]\n * - [longitude, latitude, Z] => [x, y, z]\n * Note: By default, returns top-left coordinates for canvas/SVG type render\n *\n * @param {Array} lngLatZ - [lng, lat] or [lng, lat, Z]\n * @param {Object} opts - options\n * @param {Object} opts.topLeft=true - Whether projected coords are top left\n * @return {Array} - [x, y] or [x, y, z] in top left coords\n */\n project(xyz, { topLeft = true } = {}) {\n const worldPosition = this.projectPosition(xyz);\n const coord = worldToPixels(worldPosition, this.pixelProjectionMatrix);\n const [x, y] = coord;\n const y2 = topLeft ? y : this.height - y;\n return xyz.length === 2 ? [x, y2] : [x, y2, coord[2]];\n }\n /**\n * Unproject pixel coordinates on screen onto world coordinates,\n * (possibly [lon, lat]) on map.\n * - [x, y] => [lng, lat]\n * - [x, y, z] => [lng, lat, Z]\n * @param {Array} xyz -\n * @param {Object} opts - options\n * @param {Object} opts.topLeft=true - Whether origin is top left\n * @return {Array|null} - [lng, lat, Z] or [X, Y, Z]\n */\n unproject(xyz, { topLeft = true, targetZ } = {}) {\n const [x, y, z] = xyz;\n const y2 = topLeft ? y : this.height - y;\n const targetZWorld = targetZ && targetZ * this.distanceScales.unitsPerMeter[2];\n const coord = pixelsToWorld([x, y2, z], this.pixelUnprojectionMatrix, targetZWorld);\n const [X, Y, Z] = this.unprojectPosition(coord);\n if (Number.isFinite(z)) {\n return [X, Y, Z];\n }\n return Number.isFinite(targetZ) ? [X, Y, targetZ] : [X, Y];\n }\n // NON_LINEAR PROJECTION HOOKS\n // Used for web meractor projection\n projectPosition(xyz) {\n const [X, Y] = this.projectFlat(xyz);\n const Z = (xyz[2] || 0) * this.distanceScales.unitsPerMeter[2];\n return [X, Y, Z];\n }\n unprojectPosition(xyz) {\n const [X, Y] = this.unprojectFlat(xyz);\n const Z = (xyz[2] || 0) * this.distanceScales.metersPerUnit[2];\n return [X, Y, Z];\n }\n /**\n * Project [lng,lat] on sphere onto [x,y] on 512*512 Mercator Zoom 0 tile.\n * Performs the nonlinear part of the web mercator projection.\n * Remaining projection is done with 4x4 matrices which also handles\n * perspective.\n * @param {Array} lngLat - [lng, lat] coordinates\n * Specifies a point on the sphere to project onto the map.\n * @return {Array} [x,y] coordinates.\n */\n projectFlat(xyz) {\n if (this.isGeospatial) {\n // Shader clamps latitude to +-89.9, see /shaderlib/project/project.glsl.js\n // lngLatToWorld([0, -89.9])[1] = -317.9934163758329\n // lngLatToWorld([0, 89.9])[1] = 829.9934163758271\n const result = lngLatToWorld(xyz);\n result[1] = clamp(result[1], -318, 830);\n return result;\n }\n return xyz;\n }\n /**\n * Unproject world point [x,y] on map onto {lat, lon} on sphere\n * @param {object|Vector} xy - object with {x,y} members\n * representing point on projected map plane\n * @return {GeoCoordinates} - object with {lat,lon} of point on sphere.\n * Has toArray method if you need a GeoJSON Array.\n * Per cartographic tradition, lat and lon are specified as degrees.\n */\n unprojectFlat(xyz) {\n if (this.isGeospatial) {\n return worldToLngLat(xyz);\n }\n return xyz;\n }\n /**\n * Get bounds of the current viewport\n * @return {Array} - [minX, minY, maxX, maxY]\n */\n getBounds(options = {}) {\n const unprojectOption = { targetZ: options.z || 0 };\n const topLeft = this.unproject([0, 0], unprojectOption);\n const topRight = this.unproject([this.width, 0], unprojectOption);\n const bottomLeft = this.unproject([0, this.height], unprojectOption);\n const bottomRight = this.unproject([this.width, this.height], unprojectOption);\n return [\n Math.min(topLeft[0], topRight[0], bottomLeft[0], bottomRight[0]),\n Math.min(topLeft[1], topRight[1], bottomLeft[1], bottomRight[1]),\n Math.max(topLeft[0], topRight[0], bottomLeft[0], bottomRight[0]),\n Math.max(topLeft[1], topRight[1], bottomLeft[1], bottomRight[1])\n ];\n }\n getDistanceScales(coordinateOrigin) {\n if (coordinateOrigin && this.isGeospatial) {\n return getDistanceScales({\n longitude: coordinateOrigin[0],\n latitude: coordinateOrigin[1],\n highPrecision: true\n });\n }\n return this.distanceScales;\n }\n containsPixel({ x, y, width = 1, height = 1 }) {\n return (x < this.x + this.width &&\n this.x < x + width &&\n y < this.y + this.height &&\n this.y < y + height);\n }\n // Extract frustum planes in common space\n getFrustumPlanes() {\n if (this._frustumPlanes.near) {\n // @ts-ignore\n return this._frustumPlanes;\n }\n Object.assign(this._frustumPlanes, getFrustumPlanes(this.viewProjectionMatrix));\n // @ts-ignore\n return this._frustumPlanes;\n }\n // EXPERIMENTAL METHODS\n /**\n * Needed by panning and linear transition\n * Pan the viewport to place a given world coordinate at screen point [x, y]\n *\n * @param {Array} coords - world coordinates\n * @param {Array} pixel - [x,y] coordinates on screen\n * @param {Array} startPixel - [x,y] screen position where pan started (optional, for delta-based panning)\n * @return {Object} props of the new viewport\n */\n panByPosition(coords, pixel, startPixel) {\n return null;\n }\n // INTERNAL METHODS\n /* eslint-disable complexity, max-statements */\n _initProps(opts) {\n const longitude = opts.longitude;\n const latitude = opts.latitude;\n if (this.isGeospatial) {\n if (!Number.isFinite(opts.zoom)) {\n this.zoom = getMeterZoom({ latitude }) + Math.log2(this.focalDistance);\n }\n this.distanceScales = opts.distanceScales || getDistanceScales({ latitude, longitude });\n }\n const scale = Math.pow(2, this.zoom);\n this.scale = scale;\n const { position, modelMatrix } = opts;\n let meterOffset = ZERO_VECTOR;\n if (position) {\n meterOffset = modelMatrix\n ? new Matrix4(modelMatrix).transformAsVector(position, [])\n : position;\n }\n if (this.isGeospatial) {\n // Determine camera center in common space\n const center = this.projectPosition([longitude, latitude, 0]);\n this.center = new Vector3(meterOffset)\n // Convert to pixels in current zoom\n .scale(this.distanceScales.unitsPerMeter)\n .add(center);\n }\n else {\n this.center = this.projectPosition(meterOffset);\n }\n }\n /* eslint-enable complexity, max-statements */\n _initMatrices(opts) {\n const { \n // View matrix\n viewMatrix = IDENTITY, \n // Projection matrix\n projectionMatrix = null, \n // Projection matrix parameters, used if projectionMatrix not supplied\n orthographic = false, fovyRadians, fovy = 75, near = 0.1, // Distance of near clipping plane\n far = 1000, // Distance of far clipping plane\n padding = null, // Center offset in pixels\n focalDistance = 1 } = opts;\n this.viewMatrixUncentered = viewMatrix;\n // Make a centered version of the matrix for projection modes without an offset\n this.viewMatrix = new Matrix4()\n // Apply the uncentered view matrix\n .multiplyRight(viewMatrix)\n // And center it\n .translate(new Vector3(this.center).negate());\n this.projectionMatrix =\n projectionMatrix ||\n createProjectionMatrix({\n width: this.width,\n height: this.height,\n orthographic,\n fovyRadians: fovyRadians || fovy * DEGREES_TO_RADIANS,\n focalDistance,\n padding,\n near,\n far\n });\n // Note: As usual, matrix operations should be applied in \"reverse\" order\n // since vectors will be multiplied in from the right during transformation\n const vpm = createMat4();\n mat4.multiply(vpm, vpm, this.projectionMatrix);\n mat4.multiply(vpm, vpm, this.viewMatrix);\n this.viewProjectionMatrix = vpm;\n // console.log('VPM', this.viewMatrix, this.projectionMatrix, this.viewProjectionMatrix);\n // Calculate inverse view matrix\n this.viewMatrixInverse = mat4.invert([], this.viewMatrix) || this.viewMatrix;\n // Decompose camera parameters\n this.cameraPosition = getCameraPosition(this.viewMatrixInverse);\n /*\n * Builds matrices that converts preprojected lngLats to screen pixels\n * and vice versa.\n * Note: Currently returns bottom-left coordinates!\n * Note: Starts with the GL projection matrix and adds steps to the\n * scale and translate that matrix onto the window.\n * Note: WebGL controls clip space to screen projection with gl.viewport\n * and does not need this step.\n */\n // matrix for conversion from world location to screen (pixel) coordinates\n const viewportMatrix = createMat4(); // matrix from NDC to viewport.\n const pixelProjectionMatrix = createMat4(); // matrix from world space to viewport.\n mat4.scale(viewportMatrix, viewportMatrix, [this.width / 2, -this.height / 2, 1]);\n mat4.translate(viewportMatrix, viewportMatrix, [1, -1, 0]);\n mat4.multiply(pixelProjectionMatrix, viewportMatrix, this.viewProjectionMatrix);\n this.pixelProjectionMatrix = pixelProjectionMatrix;\n this.pixelUnprojectionMatrix = mat4.invert(createMat4(), this.pixelProjectionMatrix);\n if (!this.pixelUnprojectionMatrix) {\n log.warn('Pixel project matrix not invertible')();\n // throw new Error('Pixel project matrix not invertible');\n }\n }\n}\nViewport.displayName = 'Viewport';\nexport default Viewport;\n//# sourceMappingURL=viewport.js.map","// deck.gl\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\n// View and Projection Matrix calculations for mapbox-js style\n// map view properties\nimport Viewport from \"./viewport.js\";\nimport { pixelsToWorld, getViewMatrix, addMetersToLngLat, unitsPerMeter, getProjectionParameters, altitudeToFovy, fovyToAltitude, fitBounds, getBounds } from '@math.gl/web-mercator';\nimport { Matrix4, clamp, vec2 } from '@math.gl/core';\n/**\n * Manages transformations to/from WGS84 coordinates using the Web Mercator Projection.\n */\nclass WebMercatorViewport extends Viewport {\n /* eslint-disable complexity, max-statements */\n constructor(opts = {}) {\n const { latitude = 0, longitude = 0, zoom = 0, pitch = 0, bearing = 0, nearZMultiplier = 0.1, farZMultiplier = 1.01, nearZ, farZ, orthographic = false, projectionMatrix, repeat = false, worldOffset = 0, position, padding, \n // backward compatibility\n // TODO: remove in v9\n legacyMeterSizes = false } = opts;\n let { width, height, altitude = 1.5 } = opts;\n const scale = Math.pow(2, zoom);\n // Silently allow apps to send in 0,0 to facilitate isomorphic render etc\n width = width || 1;\n height = height || 1;\n let fovy;\n let projectionParameters = null;\n if (projectionMatrix) {\n altitude = projectionMatrix[5] / 2;\n fovy = altitudeToFovy(altitude);\n }\n else {\n if (opts.fovy) {\n fovy = opts.fovy;\n altitude = fovyToAltitude(fovy);\n }\n else {\n fovy = altitudeToFovy(altitude);\n }\n let offset;\n if (padding) {\n const { top = 0, bottom = 0 } = padding;\n offset = [0, clamp((top + height - bottom) / 2, 0, height) - height / 2];\n }\n projectionParameters = getProjectionParameters({\n width,\n height,\n scale,\n center: position && [0, 0, position[2] * unitsPerMeter(latitude)],\n offset,\n pitch,\n fovy,\n nearZMultiplier,\n farZMultiplier\n });\n if (Number.isFinite(nearZ)) {\n projectionParameters.near = nearZ;\n }\n if (Number.isFinite(farZ)) {\n projectionParameters.far = farZ;\n }\n }\n // The uncentered matrix allows us two move the center addition to the\n // shader (cheap) which gives a coordinate system that has its center in\n // the layer's center position. This makes rotations and other modelMatrx\n // transforms much more useful.\n let viewMatrixUncentered = getViewMatrix({\n height,\n pitch,\n bearing,\n scale,\n altitude\n });\n if (worldOffset) {\n const viewOffset = new Matrix4().translate([512 * worldOffset, 0, 0]);\n viewMatrixUncentered = viewOffset.multiplyLeft(viewMatrixUncentered);\n }\n super({\n ...opts,\n // x, y,\n width,\n height,\n // view matrix\n viewMatrix: viewMatrixUncentered,\n longitude,\n latitude,\n zoom,\n // projection matrix parameters\n ...projectionParameters,\n fovy,\n focalDistance: altitude\n });\n // Save parameters\n this.latitude = latitude;\n this.longitude = longitude;\n this.zoom = zoom;\n this.pitch = pitch;\n this.bearing = bearing;\n this.altitude = altitude;\n this.fovy = fovy;\n this.orthographic = orthographic;\n this._subViewports = repeat ? [] : null;\n this._pseudoMeters = legacyMeterSizes;\n Object.freeze(this);\n }\n /* eslint-enable complexity, max-statements */\n get subViewports() {\n if (this._subViewports && !this._subViewports.length) {\n // Cache sub viewports so that we only calculate them once\n const bounds = this.getBounds();\n const minOffset = Math.floor((bounds[0] + 180) / 360);\n const maxOffset = Math.ceil((bounds[2] - 180) / 360);\n for (let x = minOffset; x <= maxOffset; x++) {\n const offsetViewport = x\n ? new WebMercatorViewport({\n ...this,\n worldOffset: x\n })\n : this;\n this._subViewports.push(offsetViewport);\n }\n }\n return this._subViewports;\n }\n projectPosition(xyz) {\n if (this._pseudoMeters) {\n // Backward compatibility\n return super.projectPosition(xyz);\n }\n const [X, Y] = this.projectFlat(xyz);\n const Z = (xyz[2] || 0) * unitsPerMeter(xyz[1]);\n return [X, Y, Z];\n }\n unprojectPosition(xyz) {\n if (this._pseudoMeters) {\n // Backward compatibility\n return super.unprojectPosition(xyz);\n }\n const [X, Y] = this.unprojectFlat(xyz);\n const Z = (xyz[2] || 0) / unitsPerMeter(Y);\n return [X, Y, Z];\n }\n /**\n * Add a meter delta to a base lnglat coordinate, returning a new lnglat array\n *\n * Note: Uses simple linear approximation around the viewport center\n * Error increases with size of offset (roughly 1% per 100km)\n *\n * @param {[Number,Number]|[Number,Number,Number]) lngLatZ - base coordinate\n * @param {[Number,Number]|[Number,Number,Number]) xyz - array of meter deltas\n * @return {[Number,Number]|[Number,Number,Number]) array of [lng,lat,z] deltas\n */\n addMetersToLngLat(lngLatZ, xyz) {\n return addMetersToLngLat(lngLatZ, xyz);\n }\n panByPosition(coords, pixel, startPixel) {\n const fromLocation = pixelsToWorld(pixel, this.pixelUnprojectionMatrix);\n const toLocation = this.projectFlat(coords);\n const translate = vec2.add([], toLocation, vec2.negate([], fromLocation));\n const newCenter = vec2.add([], this.center, translate);\n const [longitude, latitude] = this.unprojectFlat(newCenter);\n return { longitude, latitude };\n }\n getBounds(options = {}) {\n // @ts-ignore\n const corners = getBounds(this, options.z || 0);\n return [\n Math.min(corners[0][0], corners[1][0], corners[2][0], corners[3][0]),\n Math.min(corners[0][1], corners[1][1], corners[2][1], corners[3][1]),\n Math.max(corners[0][0], corners[1][0], corners[2][0], corners[3][0]),\n Math.max(corners[0][1], corners[1][1], corners[2][1], corners[3][1])\n ];\n }\n /**\n * Returns a new viewport that fit around the given rectangle.\n * Only supports non-perspective mode.\n */\n fitBounds(\n /** [[lon, lat], [lon, lat]] */\n bounds, options = {}) {\n const { width, height } = this;\n const { longitude, latitude, zoom } = fitBounds({ width, height, bounds, ...options });\n return new WebMercatorViewport({ width, height, longitude, latitude, zoom });\n }\n}\nWebMercatorViewport.displayName = 'WebMercatorViewport';\nexport default WebMercatorViewport;\n//# sourceMappingURL=web-mercator-viewport.js.map","// deck.gl\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\n/**\n * Fast partial deep equal for prop.\n *\n * @param a Prop\n * @param b Prop to compare against `a`\n * @param depth Depth to which to recurse in nested Objects/Arrays. Use 0 (default) for shallow comparison, -1 for infinite depth\n */\n/* eslint-disable complexity */\nexport function deepEqual(a, b, depth) {\n if (a === b) {\n return true;\n }\n if (!depth || !a || !b) {\n return false;\n }\n if (Array.isArray(a)) {\n if (!Array.isArray(b) || a.length !== b.length) {\n return false;\n }\n for (let i = 0; i < a.length; i++) {\n if (!deepEqual(a[i], b[i], depth - 1)) {\n return false;\n }\n }\n return true;\n }\n if (Array.isArray(b)) {\n return false;\n }\n if (typeof a === 'object' && typeof b === 'object') {\n const aKeys = Object.keys(a);\n const bKeys = Object.keys(b);\n if (aKeys.length !== bKeys.length) {\n return false;\n }\n for (const key of aKeys) {\n if (!b.hasOwnProperty(key)) {\n return false;\n }\n if (!deepEqual(a[key], b[key], depth - 1)) {\n return false;\n }\n }\n return true;\n }\n return false;\n}\n//# sourceMappingURL=deep-equal.js.map"],"names":["window_","process_","navigator_","isElectron","mockUserAgent","userAgent","isBrowser","VERSION","getStorage","type","storage","x","LocalStorage","id","defaultConfig","configuration","serialized","serializedConfiguration","formatTime","ms","formatted","leftPad","string","length","padLength","COLOR","BACKGROUND_INCREMENT","getColor","color","addColor","background","autobind","obj","predefined","proto","propNames","object","key","value","name","assert","condition","message","getHiResTimestamp","timestamp","window","process","timeParts","originalConsole","DEFAULT_LOG_CONFIGURATION","noop","cache","ONCE","Log","newLevel","newPriority","enabled","level","setting","oldUsage","newUsage","logLevel","table","columns","getTableHeader","opts","options","normalizeArguments","collapsed","func","normalizeLogLevel","method","args","tag","decorateMessage","resolvedLevel","messageType","time","title","defaultLogger","log","uidCounters","uid","count","Resource","device","props","defaultProps","selectivelyMerge","resource","stats","bytes","mergedProps","Buffer","deducedProps","data","byteOffset","byteLength","arrayBuffer","debugDataLength","getDataTypeInfo","signedType","primitiveType","NORMALIZED_TYPE_MAP","normalized","integer","signed","getNormalizedDataType","signedDataType","dataType","alignTo","size","getDataType","arrayOrType","Constructor","info","entry","getTypedArrayConstructor","getVertexFormatInfo","format","webglOnly","type_","components","decodedType","result","makeVertexFormat","getVertexFormatFromAttribute","typedArray","getCompatibleVertexFormat","vertexType","RADIANS_TO_DEGREES","DEGREES_TO_RADIANS","DEFAULT_CONFIG","config","formatValue","precision","round","isArray","toRadians","degrees","radians","toDegrees","map","clamp","min","max","lerp","a","b","t","ai","equals","epsilon","oldEpsilon","duplicateArray","array","val","MathArray","offset","i","targetArray","targetObject","arrayOrObject","target","endValue","vector","minVector","maxVector","vectors","scale","scalar","valid","validateVector","v","checkNumber","checkVector","callerName","Vector","mathArray","dist","product","EPSILON","ARRAY_TYPE","create","out","glMatrix.ARRAY_TYPE","add","subtract","y","negate","ax","ay","transformMat2","m","transformMat2d","transformMat3","transformMat4","sub","vec","stride","fn","arg","l","vec2_transformMat4AsVector","w","vec3_transformMat4AsVector","z","vec3_transformMat2","vec4_transformMat2","vec4_transformMat3","fromValues","distance","squaredLength","normalize","len","dot","cross","az","bx","by","bz","transformQuat","q","qx","qy","qz","qw","uvx","uvy","uvz","uuvx","uuvy","uuvz","w2","rotateX","rad","p","rotateY","rotateZ","angle","mag","cosine","sqrLen","ORIGIN","ZERO","Vector3","vec3_angle","vec3_cross","origin","vec3_rotateX","vec3_rotateY","vec3_rotateZ","matrix4","vec3_transformMat4","matrix3","vec3_transformMat3","matrix2","quaternion","vec3_transformQuat","Matrix","row","col","columnIndex","firstIndex","columnVector","identity","transpose","a01","a02","a03","a12","a13","a23","invert","a00","a10","a11","a20","a21","a22","a30","a31","a32","a33","b00","b01","b02","b03","b04","b05","b06","b07","b08","b09","b10","b11","det","determinant","b0","b1","b2","b3","b4","b5","b6","b7","b8","b9","multiply","translate","rotate","axis","c","s","b12","b20","b21","b22","glMatrix.EPSILON","getScaling","mat","m11","m12","m13","m21","m22","m23","m31","m32","m33","fromQuat","x2","y2","z2","xx","yx","yy","zx","zy","zz","wx","wy","wz","frustum","left","right","bottom","top","near","far","rl","tb","nf","perspectiveNO","fovy","aspect","f","perspective","orthoNO","lr","bt","ortho","lookAt","eye","center","up","x0","x1","y0","y1","z0","z1","eyex","eyey","eyez","upx","upy","upz","centerx","centery","centerz","aw","ix","iy","iz","iw","INDICES","DEFAULT_FOVY","DEFAULT_ASPECT","DEFAULT_NEAR","DEFAULT_FAR","IDENTITY_MATRIX","Matrix4","getIdentityMatrix","getZeroMatrix","m00","m10","m20","m30","m01","m02","m03","mat4_fromQuat","view","computeInfinitePerspectiveOffCenter","mat4_frustum","mat4_lookAt","mat4_ortho","focalDistance","checkRadians","halfY","mat4_perspective","mat4_determinant","scaleResult","inverseScale0","inverseScale1","inverseScale2","mat4_transpose","mat4_invert","mat4_multiply","mat4_rotateX","mat4_rotateY","mat4_rotateZ","angleXYZ","mat4_rotate","factor","mat4_scale","mat4_translate","vec4_transformMat4","vec2_transformMat4","IDENTITY","possiblyDegrees","column0Row0","column1Row1","column2Row0","column2Row1","column2Row2","column2Row3","column3Row2","COMPUTE_INTERVAL","InputEvent","InputDirection","RecognizerState","TOUCH_ACTION_COMPUTE","TOUCH_ACTION_AUTO","TOUCH_ACTION_MANIPULATION","TOUCH_ACTION_NONE","TOUCH_ACTION_PAN_X","TOUCH_ACTION_PAN_Y","splitStr","str","addEventListeners","types","handler","removeEventListeners","getWindowForElement","element","hasParent","node","parent","ancestor","getCenter","pointers","pointersLength","simpleCloneInputData","input","getPointDistance","p1","p2","getEventDistance","getPointAngle","getEventAngle","getDirection","dx","dy","computeDeltaXY","session","prevDelta","prevInput","getVelocity","deltaTime","getScale","start","end","getRotation","computeIntervalInputData","last","velocity","velocityX","velocityY","direction","deltaX","deltaY","computeInputData","manager","firstInput","firstMultiple","offsetCenter","overallVelocity","inputHandler","eventType","pointersLen","changedPointersLen","isFirst","isFinal","processedInput","Input$1","ev","POINTER_INPUT_MAP","POINTER_ELEMENT_EVENTS","POINTER_WINDOW_EVENTS","PointerEventInput","Input","store","removePointer","pointerType","isTouch","storeIndex","e","_uniqueId","uniqueId","stateStr","state","Recognizer","recognizerOrName","item","otherRecognizer","simultaneous","requireFail","index","recognier","inputData","inputDataClone","AttrRecognizer","optionPointers","isRecognized","isValid","TapRecognizer","validPointers","validMovement","validTouchTime","validInterval","validMultiTap","EVENT_NAMES","PanRecognizer","actions","suffix","hasMoved","PinchRecognizer","inOut","callback","firefox","WHEEL_DELTA_MAGIC_SCALER","WHEEL_DELTA_PER_LINE","SHIFT_MULTIPLIER","WheelInput","event","COORDINATE_SYSTEM","PROJECTION_MODE","UNIT","EVENT_HANDLERS","RECOGNIZERS","Pan","Pinch","Tap","OPERATION","createMat4","transformVector","matrix","vec4.transformMat4","vec4.scale","mod","divisor","modulus","step","ieLog2","log2","PI","PI_4","TILE_SIZE","EARTH_CIRCUMFERENCE","MAX_LATITUDE","DEFAULT_ALTITUDE","zoomToScale","zoom","scaleToZoom","lngLatToWorld","lngLat","lng","lat","lambda2","phi2","worldToLngLat","xy","getMeterZoom","latitude","latCosine","unitsPerMeter","getDistanceScales","longitude","highPrecision","worldSize","unitsPerDegreeX","unitsPerDegreeY","altUnitsPerMeter","latCosine2","unitsPerDegreeY2","altUnitsPerDegree2","altUnitsPerMeter2","addMetersToLngLat","lngLatZ","xyz","unitsPerMeter2","worldspace","newLngLat","newZ","getViewMatrix","height","pitch","bearing","altitude","vm","mat4.translate","mat4.rotateX","mat4.rotateZ","relativeScale","mat4.scale","vec3.negate","getProjectionParameters","width","nearZMultiplier","farZMultiplier","altitudeToFovy","fovRadians","pitchRadians","fovyToAltitude","cameraToSeaLevelDistance","fovAboveCenter","topHalfSurfaceDistance","furthestDistance","horizonDistance","farZ","worldToPixels","pixelProjectionMatrix","pixelsToWorld","pixelUnprojectionMatrix","targetZ","coord0","coord1","vec2.lerp","fitBounds","bounds","minExtent","maxZoom","west","south","east","north","padding","getPaddingObject","nw","se","targetSize","scaleX","scaleY","offsetX","offsetY","centerLngLat","getBounds","viewport","unproject","unprojectOps","bottomLeft","bottomRight","topLeft","topRight","halfFov","angleToGround","unprojectOnFarPlane","coord","TypedArrayManager","copy","initialize","maxCount","Type","newSize","maxSize","newArray","sizeToAllocate","pool","buffer","defaultTypedArrayManager","getCameraPosition","viewMatrixInverse","getFrustumPlanes","viewProjectionMatrix","getFrustumPlane","scratchVector","d","L","fp64LowPart","scratchArray","toDoublePrecisionArray","startIndex","endIndex","typedArrayManager","sourceIndex","targetIndex","j","mergeBounds","boundsList","mergedBounds","isMerged","ZERO_VECTOR","DEFAULT_DISTANCE_SCALES","createProjectionMatrix","orthographic","fovyRadians","Viewport","worldPosition","targetZWorld","X","Y","Z","unprojectOption","coordinateOrigin","coords","pixel","startPixel","position","modelMatrix","meterOffset","viewMatrix","projectionMatrix","vpm","mat4.multiply","mat4.invert","viewportMatrix","WebMercatorViewport","nearZ","repeat","worldOffset","legacyMeterSizes","projectionParameters","viewMatrixUncentered","minOffset","maxOffset","offsetViewport","fromLocation","toLocation","vec2.add","vec2.negate","newCenter","corners","deepEqual","depth","aKeys","bKeys"],"mappings":"AAEA,MAAMA,GAAU,WAEVC,GAAW,WAAW,SAAW,CAAA,EAEjCC,GAAa,WAAW,WAAa,CAAA,ECHpC,SAASC,GAAWC,EAAe,CAQtC,GALI,OAAO,OAAW,KAAe,OAAO,SAAS,OAAS,YAK1D,OAAO,QAAY,KAAuB,QAAQ,UAAW,SAC7D,MAAO,GAIX,MAAMC,EADgB,OAAO,UAAc,KAAe,UAAU,UAEpE,MAAO,GAAQA,GAAaA,EAAU,QAAQ,UAAU,GAAK,EACjE,CCdO,SAASC,IAAY,CAIxB,MAAO,EADP,OAAO,SAAY,UAAY,OAAO,OAAO,IAAM,oBAAsB,CAAC,SAAS,UACjEH,GAAU,CAChC,CCPO,MAAMI,GAA2C,QCDxD,SAASC,GAAWC,EAAM,CACtB,GAAI,CACA,MAAMC,EAAU,OAAOD,CAAI,EACrBE,EAAI,mBACV,OAAAD,EAAQ,QAAQC,EAAGA,CAAC,EACpBD,EAAQ,WAAWC,CAAC,EACbD,CACX,MACU,CACN,OAAO,IACX,CACJ,CAEO,MAAME,EAAa,CACtB,YAAYC,EAAIC,EAAeL,EAAO,iBAAkB,CACpD,KAAK,QAAUD,GAAWC,CAAI,EAC9B,KAAK,GAAKI,EACV,KAAK,OAASC,EACd,KAAK,mBAAkB,CAC3B,CACA,kBAAmB,CACf,OAAO,KAAK,MAChB,CACA,iBAAiBC,EAAe,C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