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":"layer-DPcO4AXQ.js","sources":["../../../../node_modules/.pnpm/@luma.gl+shadertools@9.2.6_@luma.gl+core@9.2.6/node_modules/@luma.gl/shadertools/dist/lib/glsl-utils/shader-utils.js","../../../../node_modules/.pnpm/@luma.gl+shadertools@9.2.6_@luma.gl+core@9.2.6/node_modules/@luma.gl/shadertools/dist/modules/engine/picking/picking.js","../../../../node_modules/.pnpm/@luma.gl+shadertools@9.2.6_@luma.gl+core@9.2.6/node_modules/@luma.gl/shadertools/dist/modules/lighting/lights/lighting-glsl.js","../../../../node_modules/.pnpm/@luma.gl+shadertools@9.2.6_@luma.gl+core@9.2.6/node_modules/@luma.gl/shadertools/dist/modules/lighting/lights/lighting-wgsl.js","../../../../node_modules/.pnpm/@luma.gl+shadertools@9.2.6_@luma.gl+core@9.2.6/node_modules/@luma.gl/shadertools/dist/modules/lighting/lights/lighting.js","../../../../node_modules/.pnpm/@luma.gl+shadertools@9.2.6_@luma.gl+core@9.2.6/node_modules/@luma.gl/shadertools/dist/modules/lighting/phong-material/phong-shaders-glsl.js","../../../../node_modules/.pnpm/@luma.gl+shadertools@9.2.6_@luma.gl+core@9.2.6/node_modules/@luma.gl/shadertools/dist/modules/lighting/phong-material/phong-shaders-wgsl.js","../../../../node_modules/.pnpm/@luma.gl+shadertools@9.2.6_@luma.gl+core@9.2.6/node_modules/@luma.gl/shadertools/dist/modules/lighting/phong-material/phong-material.js","../../../../node_modules/.pnpm/@deck.gl+core@9.2.6/node_modules/@deck.gl/core/dist/shaderlib/project32/project32.js","../../../../node_modules/.pnpm/@deck.gl+core@9.2.6/node_modules/@deck.gl/core/dist/shaderlib/picking/picking.js","../../../../node_modules/.pnpm/@deck.gl+core@9.2.6/node_modules/@deck.gl/core/dist/shaderlib/project/project-functions.js","../../../../node_modules/.pnpm/@luma.gl+engine@9.2.6_@luma.gl+core@9.2.6_@luma.gl+shadertools@9.2.6_@luma.gl+core@9.2.6_/node_modules/@luma.gl/engine/dist/compute/buffer-transform.js","../../../../node_modules/.pnpm/@luma.gl+engine@9.2.6_@luma.gl+core@9.2.6_@luma.gl+shadertools@9.2.6_@luma.gl+core@9.2.6_/node_modules/@luma.gl/engine/dist/geometry/geometry.js","../../../../node_modules/.pnpm/@deck.gl+core@9.2.6/node_modules/@deck.gl/core/dist/lib/attribute/gl-utils.js","../../../../node_modules/.pnpm/@deck.gl+core@9.2.6/node_modules/@deck.gl/core/dist/lib/attribute/data-column.js","../../../../node_modules/.pnpm/@deck.gl+core@9.2.6/node_modules/@deck.gl/core/dist/utils/iterable-utils.js","../../../../node_modules/.pnpm/@deck.gl+core@9.2.6/node_modules/@deck.gl/core/dist/utils/range.js","../../../../node_modules/.pnpm/@deck.gl+core@9.2.6/node_modules/@deck.gl/core/dist/lib/attribute/transition-settings.js","../../../../node_modules/.pnpm/@deck.gl+core@9.2.6/node_modules/@deck.gl/core/dist/lib/attribute/attribute.js","../../../../node_modules/.pnpm/@deck.gl+core@9.2.6/node_modules/@deck.gl/core/dist/utils/array-utils.js","../../../../node_modules/.pnpm/@deck.gl+core@9.2.6/node_modules/@deck.gl/core/dist/transitions/gpu-transition-utils.js","../../../../node_modules/.pnpm/@deck.gl+core@9.2.6/node_modules/@deck.gl/core/dist/transitions/gpu-transition.js","../../../../node_modules/.pnpm/@deck.gl+core@9.2.6/node_modules/@deck.gl/core/dist/transitions/gpu-interpolation-transition.js","../../../../node_modules/.pnpm/@deck.gl+core@9.2.6/node_modules/@deck.gl/core/dist/transitions/gpu-spring-transition.js","../../../../node_modules/.pnpm/@deck.gl+core@9.2.6/node_modules/@deck.gl/core/dist/lib/attribute/attribute-transition-manager.js","../../../../node_modules/.pnpm/@deck.gl+core@9.2.6/node_modules/@deck.gl/core/dist/lib/attribute/attribute-manager.js","../../../../node_modules/.pnpm/@deck.gl+core@9.2.6/node_modules/@deck.gl/core/dist/transitions/cpu-interpolation-transition.js","../../../../node_modules/.pnpm/@deck.gl+core@9.2.6/node_modules/@deck.gl/core/dist/transitions/cpu-spring-transition.js","../../../../node_modules/.pnpm/@deck.gl+core@9.2.6/node_modules/@deck.gl/core/dist/lib/uniform-transition-manager.js","../../../../node_modules/.pnpm/@deck.gl+core@9.2.6/node_modules/@deck.gl/core/dist/lifecycle/props.js","../../../../node_modules/.pnpm/@deck.gl+core@9.2.6/node_modules/@deck.gl/core/dist/utils/count.js","../../../../node_modules/.pnpm/@deck.gl+core@9.2.6/node_modules/@deck.gl/core/dist/utils/texture.js","../../../../node_modules/.pnpm/@deck.gl+core@9.2.6/node_modules/@deck.gl/core/dist/lifecycle/prop-types.js","../../../../node_modules/.pnpm/@deck.gl+core@9.2.6/node_modules/@deck.gl/core/dist/lifecycle/create-props.js","../../../../node_modules/.pnpm/@deck.gl+core@9.2.6/node_modules/@deck.gl/core/dist/lifecycle/component.js","../../../../node_modules/.pnpm/@deck.gl+core@9.2.6/node_modules/@deck.gl/core/dist/lifecycle/component-state.js","../../../../node_modules/.pnpm/@deck.gl+core@9.2.6/node_modules/@deck.gl/core/dist/lib/layer-state.js","../../../../node_modules/.pnpm/@deck.gl+core@9.2.6/node_modules/@deck.gl/core/dist/lib/layer.js"],"sourcesContent":["// luma.gl\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\nconst FS_GLES = /* glsl */ `\\\nout vec4 transform_output;\nvoid main() {\n transform_output = vec4(0);\n}`;\nconst FS300 = `#version 300 es\\n${FS_GLES}`;\n// Prase given glsl line and return qualifier details or null\nexport function getQualifierDetails(line, qualifiers) {\n qualifiers = Array.isArray(qualifiers) ? qualifiers : [qualifiers];\n const words = line.replace(/^\\s+/, '').split(/\\s+/);\n // TODO add support for precession qualifiers (highp, mediump and lowp)\n const [qualifier, type, definition] = words;\n if (!qualifiers.includes(qualifier) || !type || !definition) {\n return null;\n }\n const name = definition.split(';')[0];\n return { qualifier, type, name };\n}\n/**\n * Given the shader input and output variable names,\n * builds and return a pass through fragment shader.\n */\nexport function getPassthroughFS(options) {\n const { input, inputChannels, output } = options || {};\n if (!input) {\n // Default shader\n return FS300;\n }\n if (!inputChannels) {\n throw new Error('inputChannels');\n }\n const inputType = channelCountToType(inputChannels);\n const outputValue = convertToVec4(input, inputChannels);\n return `\\\n#version 300 es\nin ${inputType} ${input};\nout vec4 ${output};\nvoid main() {\n ${output} = ${outputValue};\n}`;\n}\n/** convert glsl type to suffix */\nexport function typeToChannelSuffix(type) {\n // prettier-ignore\n switch (type) {\n case 'float': return 'x';\n case 'vec2': return 'xy';\n case 'vec3': return 'xyz';\n case 'vec4': return 'xyzw';\n default:\n throw new Error(type);\n }\n}\n/** convert glsl type to channel count */\nexport function typeToChannelCount(type) {\n // prettier-ignore\n switch (type) {\n case 'float': return 1;\n case 'vec2': return 2;\n case 'vec3': return 3;\n case 'vec4': return 4;\n default:\n throw new Error(type);\n }\n}\nfunction channelCountToType(channels) {\n // prettier-ignore\n switch (channels) {\n case 1: return 'float';\n case 2: return 'vec2';\n case 3: return 'vec3';\n case 4: return 'vec4';\n default:\n throw new Error(`invalid channels: ${channels}`);\n }\n}\n/** Returns glsl instruction for converting to vec4 */\nexport function convertToVec4(variable, channels) {\n // prettier-ignore\n switch (channels) {\n case 1: return `vec4(${variable}, 0.0, 0.0, 1.0)`;\n case 2: return `vec4(${variable}, 0.0, 1.0)`;\n case 3: return `vec4(${variable}, 1.0)`;\n case 4: return variable;\n default:\n throw new Error(`invalid channels: ${channels}`);\n }\n}\n//# sourceMappingURL=shader-utils.js.map","// luma.gl\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\n// cyan color\nconst DEFAULT_HIGHLIGHT_COLOR = [0, 1, 1, 1];\nconst vs = /* glsl */ `\\\nuniform pickingUniforms {\n float isActive;\n float isAttribute;\n float isHighlightActive;\n float useFloatColors;\n vec3 highlightedObjectColor;\n vec4 highlightColor;\n} picking;\n\nout vec4 picking_vRGBcolor_Avalid;\n\n// Normalize unsigned byte color to 0-1 range\nvec3 picking_normalizeColor(vec3 color) {\n return picking.useFloatColors > 0.5 ? color : color / 255.0;\n}\n\n// Normalize unsigned byte color to 0-1 range\nvec4 picking_normalizeColor(vec4 color) {\n return picking.useFloatColors > 0.5 ? color : color / 255.0;\n}\n\nbool picking_isColorZero(vec3 color) {\n return dot(color, vec3(1.0)) < 0.00001;\n}\n\nbool picking_isColorValid(vec3 color) {\n return dot(color, vec3(1.0)) > 0.00001;\n}\n\n// Check if this vertex is highlighted \nbool isVertexHighlighted(vec3 vertexColor) {\n vec3 highlightedObjectColor = picking_normalizeColor(picking.highlightedObjectColor);\n return\n bool(picking.isHighlightActive) && picking_isColorZero(abs(vertexColor - highlightedObjectColor));\n}\n\n// Set the current picking color\nvoid picking_setPickingColor(vec3 pickingColor) {\n pickingColor = picking_normalizeColor(pickingColor);\n\n if (bool(picking.isActive)) {\n // Use alpha as the validity flag. If pickingColor is [0, 0, 0] fragment is non-pickable\n picking_vRGBcolor_Avalid.a = float(picking_isColorValid(pickingColor));\n\n if (!bool(picking.isAttribute)) {\n // Stores the picking color so that the fragment shader can render it during picking\n picking_vRGBcolor_Avalid.rgb = pickingColor;\n }\n } else {\n // Do the comparison with selected item color in vertex shader as it should mean fewer compares\n picking_vRGBcolor_Avalid.a = float(isVertexHighlighted(pickingColor));\n }\n}\n\nvoid picking_setPickingAttribute(float value) {\n if (bool(picking.isAttribute)) {\n picking_vRGBcolor_Avalid.r = value;\n }\n}\n\nvoid picking_setPickingAttribute(vec2 value) {\n if (bool(picking.isAttribute)) {\n picking_vRGBcolor_Avalid.rg = value;\n }\n}\n\nvoid picking_setPickingAttribute(vec3 value) {\n if (bool(picking.isAttribute)) {\n picking_vRGBcolor_Avalid.rgb = value;\n }\n}\n`;\nconst fs = /* glsl */ `\\\nuniform pickingUniforms {\n float isActive;\n float isAttribute;\n float isHighlightActive;\n float useFloatColors;\n vec3 highlightedObjectColor;\n vec4 highlightColor;\n} picking;\n\nin vec4 picking_vRGBcolor_Avalid;\n\n/*\n * Returns highlight color if this item is selected.\n */\nvec4 picking_filterHighlightColor(vec4 color) {\n // If we are still picking, we don't highlight\n if (picking.isActive > 0.5) {\n return color;\n }\n\n bool selected = bool(picking_vRGBcolor_Avalid.a);\n\n if (selected) {\n // Blend in highlight color based on its alpha value\n float highLightAlpha = picking.highlightColor.a;\n float blendedAlpha = highLightAlpha + color.a * (1.0 - highLightAlpha);\n float highLightRatio = highLightAlpha / blendedAlpha;\n\n vec3 blendedRGB = mix(color.rgb, picking.highlightColor.rgb, highLightRatio);\n return vec4(blendedRGB, blendedAlpha);\n } else {\n return color;\n }\n}\n\n/*\n * Returns picking color if picking enabled else unmodified argument.\n */\nvec4 picking_filterPickingColor(vec4 color) {\n if (bool(picking.isActive)) {\n if (picking_vRGBcolor_Avalid.a == 0.0) {\n discard;\n }\n return picking_vRGBcolor_Avalid;\n }\n return color;\n}\n\n/*\n * Returns picking color if picking is enabled if not\n * highlight color if this item is selected, otherwise unmodified argument.\n */\nvec4 picking_filterColor(vec4 color) {\n vec4 highlightColor = picking_filterHighlightColor(color);\n return picking_filterPickingColor(highlightColor);\n}\n`;\n/**\n * Provides support for color-coding-based picking and highlighting.\n * In particular, supports picking a specific instance in an instanced\n * draw call and highlighting an instance based on its picking color,\n * and correspondingly, supports picking and highlighting groups of\n * primitives with the same picking color in non-instanced draw-calls\n */\nexport const picking = {\n props: {},\n uniforms: {},\n name: 'picking',\n uniformTypes: {\n isActive: 'f32',\n isAttribute: 'f32',\n isHighlightActive: 'f32',\n useFloatColors: 'f32',\n highlightedObjectColor: 'vec3<f32>',\n highlightColor: 'vec4<f32>'\n },\n defaultUniforms: {\n isActive: false,\n isAttribute: false,\n isHighlightActive: false,\n useFloatColors: true,\n highlightedObjectColor: [0, 0, 0],\n highlightColor: DEFAULT_HIGHLIGHT_COLOR\n },\n vs,\n fs,\n getUniforms\n};\nfunction getUniforms(opts = {}, prevUniforms) {\n const uniforms = {};\n if (opts.highlightedObjectColor === undefined) {\n // Unless highlightedObjectColor explicitly null or set, do not update state\n }\n else if (opts.highlightedObjectColor === null) {\n uniforms.isHighlightActive = false;\n }\n else {\n uniforms.isHighlightActive = true;\n const highlightedObjectColor = opts.highlightedObjectColor.slice(0, 3);\n uniforms.highlightedObjectColor = highlightedObjectColor;\n }\n if (opts.highlightColor) {\n const color = Array.from(opts.highlightColor, x => x / 255);\n if (!Number.isFinite(color[3])) {\n color[3] = 1;\n }\n uniforms.highlightColor = color;\n }\n if (opts.isActive !== undefined) {\n uniforms.isActive = Boolean(opts.isActive);\n uniforms.isAttribute = Boolean(opts.isAttribute);\n }\n if (opts.useFloatColors !== undefined) {\n uniforms.useFloatColors = Boolean(opts.useFloatColors);\n }\n return uniforms;\n}\n//# sourceMappingURL=picking.js.map","// luma.gl\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\nexport const lightingUniformsGLSL = /* glsl */ `\\\nprecision highp int;\n\n// #if (defined(SHADER_TYPE_FRAGMENT) && defined(LIGHTING_FRAGMENT)) || (defined(SHADER_TYPE_VERTEX) && defined(LIGHTING_VERTEX))\nstruct AmbientLight {\n vec3 color;\n};\n\nstruct PointLight {\n vec3 color;\n vec3 position;\n vec3 attenuation; // 2nd order x:Constant-y:Linear-z:Exponential\n};\n\nstruct DirectionalLight {\n vec3 color;\n vec3 direction;\n};\n\nuniform lightingUniforms {\n int enabled;\n int lightType;\n\n int directionalLightCount;\n int pointLightCount;\n\n vec3 ambientColor;\n\n vec3 lightColor0;\n vec3 lightPosition0;\n vec3 lightDirection0;\n vec3 lightAttenuation0;\n\n vec3 lightColor1;\n vec3 lightPosition1;\n vec3 lightDirection1;\n vec3 lightAttenuation1;\n\n vec3 lightColor2;\n vec3 lightPosition2;\n vec3 lightDirection2;\n vec3 lightAttenuation2;\n} lighting;\n\nPointLight lighting_getPointLight(int index) {\n switch (index) {\n case 0:\n return PointLight(lighting.lightColor0, lighting.lightPosition0, lighting.lightAttenuation0);\n case 1:\n return PointLight(lighting.lightColor1, lighting.lightPosition1, lighting.lightAttenuation1);\n case 2:\n default: \n return PointLight(lighting.lightColor2, lighting.lightPosition2, lighting.lightAttenuation2);\n }\n}\n\nDirectionalLight lighting_getDirectionalLight(int index) {\n switch (index) {\n case 0:\n return DirectionalLight(lighting.lightColor0, lighting.lightDirection0);\n case 1:\n return DirectionalLight(lighting.lightColor1, lighting.lightDirection1);\n case 2:\n default: \n return DirectionalLight(lighting.lightColor2, lighting.lightDirection2);\n }\n} \n\nfloat getPointLightAttenuation(PointLight pointLight, float distance) {\n return pointLight.attenuation.x\n + pointLight.attenuation.y * distance\n + pointLight.attenuation.z * distance * distance;\n}\n\n// #endif\n`;\n//# sourceMappingURL=lighting-glsl.js.map","// luma.gl\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\nexport const lightingUniformsWGSL = /* wgsl */ `\\\n// #if (defined(SHADER_TYPE_FRAGMENT) && defined(LIGHTING_FRAGMENT)) || (defined(SHADER_TYPE_VERTEX) && defined(LIGHTING_VERTEX))\nstruct AmbientLight {\n color: vec3<f32>,\n};\n\nstruct PointLight {\n color: vec3<f32>,\n position: vec3<f32>,\n attenuation: vec3<f32>, // 2nd order x:Constant-y:Linear-z:Exponential\n};\n\nstruct DirectionalLight {\n color: vec3<f32>,\n direction: vec3<f32>,\n};\n\nstruct lightingUniforms {\n enabled: i32,\n pointLightCount: i32,\n directionalLightCount: i32,\n\n ambientColor: vec3<f32>,\n\n // TODO - support multiple lights by uncommenting arrays below\n lightType: i32,\n lightColor: vec3<f32>,\n lightDirection: vec3<f32>,\n lightPosition: vec3<f32>,\n lightAttenuation: vec3<f32>,\n\n // AmbientLight ambientLight;\n // PointLight pointLight[MAX_LIGHTS];\n // DirectionalLight directionalLight[MAX_LIGHTS];\n};\n\n// Binding 0:1 is reserved for lighting (Note: could go into separate bind group as it is stable across draw calls)\n@binding(1) @group(0) var<uniform> lighting : lightingUniforms;\n\nfn lighting_getPointLight(index: i32) -> PointLight {\n return PointLight(lighting.lightColor, lighting.lightPosition, lighting.lightAttenuation);\n}\n\nfn lighting_getDirectionalLight(index: i32) -> DirectionalLight {\n return DirectionalLight(lighting.lightColor, lighting.lightDirection);\n} \n\nfn getPointLightAttenuation(pointLight: PointLight, distance: f32) -> f32 {\n return pointLight.attenuation.x\n + pointLight.attenuation.y * distance\n + pointLight.attenuation.z * distance * distance;\n}\n`;\n//# sourceMappingURL=lighting-wgsl.js.map","// luma.gl\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\nimport { log } from '@luma.gl/core';\nimport { lightingUniformsGLSL } from \"./lighting-glsl.js\";\nimport { lightingUniformsWGSL } from \"./lighting-wgsl.js\";\n/** Max number of supported lights (in addition to ambient light */\nconst MAX_LIGHTS = 5;\n/** Whether to divide */\nconst COLOR_FACTOR = 255.0;\n/** Shader type field for lights */\n// eslint-disable-next-line no-shadow\nexport var LIGHT_TYPE;\n(function (LIGHT_TYPE) {\n LIGHT_TYPE[LIGHT_TYPE[\"POINT\"] = 0] = \"POINT\";\n LIGHT_TYPE[LIGHT_TYPE[\"DIRECTIONAL\"] = 1] = \"DIRECTIONAL\";\n})(LIGHT_TYPE || (LIGHT_TYPE = {}));\n/** UBO ready lighting module */\nexport const lighting = {\n props: {},\n uniforms: {},\n name: 'lighting',\n defines: {\n // MAX_LIGHTS\n },\n uniformTypes: {\n enabled: 'i32',\n lightType: 'i32',\n directionalLightCount: 'i32',\n pointLightCount: 'i32',\n ambientColor: 'vec3<f32>',\n // TODO define as arrays once we have appropriate uniformTypes\n lightColor0: 'vec3<f32>',\n lightPosition0: 'vec3<f32>',\n // TODO - could combine direction and attenuation\n lightDirection0: 'vec3<f32>',\n lightAttenuation0: 'vec3<f32>',\n lightColor1: 'vec3<f32>',\n lightPosition1: 'vec3<f32>',\n lightDirection1: 'vec3<f32>',\n lightAttenuation1: 'vec3<f32>',\n lightColor2: 'vec3<f32>',\n lightPosition2: 'vec3<f32>',\n lightDirection2: 'vec3<f32>',\n lightAttenuation2: 'vec3<f32>'\n },\n defaultUniforms: {\n enabled: 1,\n lightType: LIGHT_TYPE.POINT,\n directionalLightCount: 0,\n pointLightCount: 0,\n ambientColor: [0.1, 0.1, 0.1],\n lightColor0: [1, 1, 1],\n lightPosition0: [1, 1, 2],\n // TODO - could combine direction and attenuation\n lightDirection0: [1, 1, 1],\n lightAttenuation0: [1, 0, 0],\n lightColor1: [1, 1, 1],\n lightPosition1: [1, 1, 2],\n lightDirection1: [1, 1, 1],\n lightAttenuation1: [1, 0, 0],\n lightColor2: [1, 1, 1],\n lightPosition2: [1, 1, 2],\n lightDirection2: [1, 1, 1],\n lightAttenuation2: [1, 0, 0]\n },\n source: lightingUniformsWGSL,\n vs: lightingUniformsGLSL,\n fs: lightingUniformsGLSL,\n getUniforms\n};\nfunction getUniforms(props, prevUniforms = {}) {\n // Copy props so we can modify\n props = props ? { ...props } : props;\n // TODO legacy\n if (!props) {\n return { ...lighting.defaultUniforms };\n }\n // Support for array of lights. Type of light is detected by type field\n if (props.lights) {\n props = { ...props, ...extractLightTypes(props.lights), lights: undefined };\n }\n // Specify lights separately\n const { ambientLight, pointLights, directionalLights } = props || {};\n const hasLights = ambientLight ||\n (pointLights && pointLights.length > 0) ||\n (directionalLights && directionalLights.length > 0);\n // TODO - this may not be the correct decision\n if (!hasLights) {\n return { ...lighting.defaultUniforms, enabled: 0 };\n }\n const uniforms = {\n ...lighting.defaultUniforms,\n ...prevUniforms,\n ...getLightSourceUniforms({ ambientLight, pointLights, directionalLights })\n };\n if (props.enabled !== undefined) {\n uniforms.enabled = props.enabled ? 1 : 0;\n }\n return uniforms;\n}\nfunction getLightSourceUniforms({ ambientLight, pointLights = [], directionalLights = [] }) {\n const lightSourceUniforms = {};\n lightSourceUniforms.ambientColor = convertColor(ambientLight);\n let currentLight = 0;\n for (const pointLight of pointLights) {\n lightSourceUniforms.lightType = LIGHT_TYPE.POINT;\n const i = currentLight;\n lightSourceUniforms[`lightColor${i}`] = convertColor(pointLight);\n lightSourceUniforms[`lightPosition${i}`] = pointLight.position;\n lightSourceUniforms[`lightAttenuation${i}`] = pointLight.attenuation || [1, 0, 0];\n currentLight++;\n }\n for (const directionalLight of directionalLights) {\n lightSourceUniforms.lightType = LIGHT_TYPE.DIRECTIONAL;\n const i = currentLight;\n lightSourceUniforms[`lightColor${i}`] = convertColor(directionalLight);\n lightSourceUniforms[`lightDirection${i}`] = directionalLight.direction;\n currentLight++;\n }\n if (currentLight > MAX_LIGHTS) {\n log.warn('MAX_LIGHTS exceeded')();\n }\n lightSourceUniforms.directionalLightCount = directionalLights.length;\n lightSourceUniforms.pointLightCount = pointLights.length;\n return lightSourceUniforms;\n}\nfunction extractLightTypes(lights) {\n const lightSources = { pointLights: [], directionalLights: [] };\n for (const light of lights || []) {\n switch (light.type) {\n case 'ambient':\n // Note: Only uses last ambient light\n // TODO - add ambient light sources on CPU?\n lightSources.ambientLight = light;\n break;\n case 'directional':\n lightSources.directionalLights?.push(light);\n break;\n case 'point':\n lightSources.pointLights?.push(light);\n break;\n default:\n // eslint-disable-next-line\n // console.warn(light.type);\n }\n }\n return lightSources;\n}\n/** Take color 0-255 and intensity as input and output 0.0-1.0 range */\nfunction convertColor(colorDef = {}) {\n const { color = [0, 0, 0], intensity = 1.0 } = colorDef;\n return color.map(component => (component * intensity) / COLOR_FACTOR);\n}\n//# sourceMappingURL=lighting.js.map","// luma.gl\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\nexport const PHONG_VS = /* glsl */ `\\\nuniform phongMaterialUniforms {\n uniform float ambient;\n uniform float diffuse;\n uniform float shininess;\n uniform vec3 specularColor;\n} material;\n`;\nexport const PHONG_FS = /* glsl */ `\\\n#define MAX_LIGHTS 3\n\nuniform phongMaterialUniforms {\n uniform float ambient;\n uniform float diffuse;\n uniform float shininess;\n uniform vec3 specularColor;\n} material;\n\nvec3 lighting_getLightColor(vec3 surfaceColor, vec3 light_direction, vec3 view_direction, vec3 normal_worldspace, vec3 color) {\n vec3 halfway_direction = normalize(light_direction + view_direction);\n float lambertian = dot(light_direction, normal_worldspace);\n float specular = 0.0;\n if (lambertian > 0.0) {\n float specular_angle = max(dot(normal_worldspace, halfway_direction), 0.0);\n specular = pow(specular_angle, material.shininess);\n }\n lambertian = max(lambertian, 0.0);\n return (lambertian * material.diffuse * surfaceColor + specular * material.specularColor) * color;\n}\n\nvec3 lighting_getLightColor(vec3 surfaceColor, vec3 cameraPosition, vec3 position_worldspace, vec3 normal_worldspace) {\n vec3 lightColor = surfaceColor;\n\n if (lighting.enabled == 0) {\n return lightColor;\n }\n\n vec3 view_direction = normalize(cameraPosition - position_worldspace);\n lightColor = material.ambient * surfaceColor * lighting.ambientColor;\n\n for (int i = 0; i < lighting.pointLightCount; i++) {\n PointLight pointLight = lighting_getPointLight(i);\n vec3 light_position_worldspace = pointLight.position;\n vec3 light_direction = normalize(light_position_worldspace - position_worldspace);\n float light_attenuation = getPointLightAttenuation(pointLight, distance(light_position_worldspace, position_worldspace));\n lightColor += lighting_getLightColor(surfaceColor, light_direction, view_direction, normal_worldspace, pointLight.color / light_attenuation);\n }\n\n int totalLights = min(MAX_LIGHTS, lighting.pointLightCount + lighting.directionalLightCount);\n for (int i = lighting.pointLightCount; i < totalLights; i++) {\n DirectionalLight directionalLight = lighting_getDirectionalLight(i);\n lightColor += lighting_getLightColor(surfaceColor, -directionalLight.direction, view_direction, normal_worldspace, directionalLight.color);\n }\n \n return lightColor;\n}\n`;\n//# sourceMappingURL=phong-shaders-glsl.js.map","// luma.gl\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\nexport const PHONG_WGSL = /* wgsl */ `\\\nstruct phongMaterialUniforms {\n ambient: f32,\n diffuse: f32,\n shininess: f32,\n specularColor: vec3<f32>,\n};\n\n@binding(2) @group(0) var<uniform> phongMaterial : phongMaterialUniforms;\n\nfn lighting_getLightColor(surfaceColor: vec3<f32>, light_direction: vec3<f32>, view_direction: vec3<f32>, normal_worldspace: vec3<f32>, color: vec3<f32>) -> vec3<f32> {\n let halfway_direction: vec3<f32> = normalize(light_direction + view_direction);\n var lambertian: f32 = dot(light_direction, normal_worldspace);\n var specular: f32 = 0.0;\n if (lambertian > 0.0) {\n let specular_angle = max(dot(normal_worldspace, halfway_direction), 0.0);\n specular = pow(specular_angle, phongMaterial.shininess);\n }\n lambertian = max(lambertian, 0.0);\n return (lambertian * phongMaterial.diffuse * surfaceColor + specular * phongMaterial.specularColor) * color;\n}\n\nfn lighting_getLightColor2(surfaceColor: vec3<f32>, cameraPosition: vec3<f32>, position_worldspace: vec3<f32>, normal_worldspace: vec3<f32>) -> vec3<f32> {\n var lightColor: vec3<f32> = surfaceColor;\n\n if (lighting.enabled == 0) {\n return lightColor;\n }\n\n let view_direction: vec3<f32> = normalize(cameraPosition - position_worldspace);\n lightColor = phongMaterial.ambient * surfaceColor * lighting.ambientColor;\n\n if (lighting.lightType == 0) {\n let pointLight: PointLight = lighting_getPointLight(0);\n let light_position_worldspace: vec3<f32> = pointLight.position;\n let light_direction: vec3<f32> = normalize(light_position_worldspace - position_worldspace);\n lightColor += lighting_getLightColor(surfaceColor, light_direction, view_direction, normal_worldspace, pointLight.color);\n } else if (lighting.lightType == 1) {\n var directionalLight: DirectionalLight = lighting_getDirectionalLight(0);\n lightColor += lighting_getLightColor(surfaceColor, -directionalLight.direction, view_direction, normal_worldspace, directionalLight.color);\n }\n \n return lightColor;\n /*\n for (int i = 0; i < MAX_LIGHTS; i++) {\n if (i >= lighting.pointLightCount) {\n break;\n }\n PointLight pointLight = lighting.pointLight[i];\n vec3 light_position_worldspace = pointLight.position;\n vec3 light_direction = normalize(light_position_worldspace - position_worldspace);\n lightColor += lighting_getLightColor(surfaceColor, light_direction, view_direction, normal_worldspace, pointLight.color);\n }\n\n for (int i = 0; i < MAX_LIGHTS; i++) {\n if (i >= lighting.directionalLightCount) {\n break;\n }\n DirectionalLight directionalLight = lighting.directionalLight[i];\n lightColor += lighting_getLightColor(surfaceColor, -directionalLight.direction, view_direction, normal_worldspace, directionalLight.color);\n }\n */\n}\n\nfn lighting_getSpecularLightColor(cameraPosition: vec3<f32>, position_worldspace: vec3<f32>, normal_worldspace: vec3<f32>) -> vec3<f32>{\n var lightColor = vec3<f32>(0, 0, 0);\n let surfaceColor = vec3<f32>(0, 0, 0);\n\n if (lighting.enabled == 0) {\n let view_direction = normalize(cameraPosition - position_worldspace);\n\n switch (lighting.lightType) {\n case 0, default: {\n let pointLight: PointLight = lighting_getPointLight(0);\n let light_position_worldspace: vec3<f32> = pointLight.position;\n let light_direction: vec3<f32> = normalize(light_position_worldspace - position_worldspace);\n lightColor += lighting_getLightColor(surfaceColor, light_direction, view_direction, normal_worldspace, pointLight.color);\n }\n case 1: {\n let directionalLight: DirectionalLight = lighting_getDirectionalLight(0);\n lightColor += lighting_getLightColor(surfaceColor, -directionalLight.direction, view_direction, normal_worldspace, directionalLight.color);\n }\n }\n }\n return lightColor;\n}\n`;\n// TODO - handle multiple lights\n/**\n for (int i = 0; i < MAX_LIGHTS; i++) {\n if (i >= lighting.pointLightCount) {\n break;\n }\n PointLight pointLight = lighting_getPointLight(i);\n vec3 light_position_worldspace = pointLight.position;\n vec3 light_direction = normalize(light_position_worldspace - position_worldspace);\n lightColor += lighting_getLightColor(surfaceColor, light_direction, view_direction, normal_worldspace, pointLight.color);\n }\n\n for (int i = 0; i < MAX_LIGHTS; i++) {\n if (i >= lighting.directionalLightCount) {\n break;\n }\n PointLight pointLight = lighting_getDirectionalLight(i);\n lightColor += lighting_getLightColor(surfaceColor, -directionalLight.direction, view_direction, normal_worldspace, directionalLight.color);\n }\n }\n /**\n for (int i = 0; i < MAX_LIGHTS; i++) {\n if (i >= lighting.pointLightCount) {\n break;\n }\n PointLight pointLight = lighting_getPointLight(i);\n vec3 light_position_worldspace = pointLight.position;\n vec3 light_direction = normalize(light_position_worldspace - position_worldspace);\n lightColor += lighting_getLightColor(surfaceColor, light_direction, view_direction, normal_worldspace, pointLight.color);\n }\n\n for (int i = 0; i < MAX_LIGHTS; i++) {\n if (i >= lighting.directionalLightCount) {\n break;\n }\n PointLight pointLight = lighting_getDirectionalLight(i);\n lightColor += lighting_getLightColor(surfaceColor, -directionalLight.direction, view_direction, normal_worldspace, directionalLight.color);\n }\n }\n */\n//# sourceMappingURL=phong-shaders-wgsl.js.map","// luma.gl\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\nimport { lighting } from \"../lights/lighting.js\";\nimport { PHONG_WGSL } from \"./phong-shaders-wgsl.js\";\nimport { PHONG_VS, PHONG_FS } from \"./phong-shaders-glsl.js\";\n/** In Phong shading, the normal vector is linearly interpolated across the surface of the polygon from the polygon's vertex normals. */\nexport const phongMaterial = {\n name: 'phongMaterial',\n dependencies: [lighting],\n // Note these are switched between phong and gouraud\n source: PHONG_WGSL,\n vs: PHONG_VS,\n fs: PHONG_FS,\n defines: {\n LIGHTING_FRAGMENT: true\n },\n uniformTypes: {\n ambient: 'f32',\n diffuse: 'f32',\n shininess: 'f32',\n specularColor: 'vec3<f32>'\n },\n defaultUniforms: {\n ambient: 0.35,\n diffuse: 0.6,\n shininess: 32,\n specularColor: [0.15, 0.15, 0.15]\n },\n getUniforms(props) {\n const uniforms = { ...props };\n if (uniforms.specularColor) {\n uniforms.specularColor = uniforms.specularColor.map(x => x / 255);\n }\n return { ...phongMaterial.defaultUniforms, ...uniforms };\n }\n};\n//# sourceMappingURL=phong-material.js.map","// deck.gl\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\nimport project from \"../project/project.js\";\nconst source = /* wgsl */ `\\\n// Define a structure to hold both the clip-space position and the common position.\nstruct ProjectResult {\n clipPosition: vec4<f32>,\n commonPosition: vec4<f32>,\n};\n\n// This function mimics the GLSL version with the 'out' parameter by returning both values.\nfn project_position_to_clipspace_and_commonspace(\n position: vec3<f32>,\n position64Low: vec3<f32>,\n offset: vec3<f32>\n) -> ProjectResult {\n // Compute the projected position.\n let projectedPosition: vec3<f32> = project_position_vec3_f64(position, position64Low);\n\n // Start with the provided offset.\n var finalOffset: vec3<f32> = offset;\n\n // Get whether a rotation is needed and the rotation matrix.\n let rotationResult = project_needs_rotation(projectedPosition);\n\n // If rotation is needed, update the offset.\n if (rotationResult.needsRotation) {\n finalOffset = rotationResult.transform * offset;\n }\n\n // Compute the common position.\n let commonPosition: vec4<f32> = vec4<f32>(projectedPosition + finalOffset, 1.0);\n\n // Convert to clip-space.\n let clipPosition: vec4<f32> = project_common_position_to_clipspace(commonPosition);\n\n return ProjectResult(clipPosition, commonPosition);\n}\n\n// A convenience overload that returns only the clip-space position.\nfn project_position_to_clipspace(\n position: vec3<f32>,\n position64Low: vec3<f32>,\n offset: vec3<f32>\n) -> vec4<f32> {\n return project_position_to_clipspace_and_commonspace(position, position64Low, offset).clipPosition;\n}\n`;\nconst vs = /* glsl */ `\\\nvec4 project_position_to_clipspace(\n vec3 position, vec3 position64Low, vec3 offset, out vec4 commonPosition\n) {\n vec3 projectedPosition = project_position(position, position64Low);\n mat3 rotation;\n if (project_needs_rotation(projectedPosition, rotation)) {\n // offset is specified as ENU\n // when in globe projection, rotate offset so that the ground alighs with the surface of the globe\n offset = rotation * offset;\n }\n commonPosition = vec4(projectedPosition + offset, 1.0);\n return project_common_position_to_clipspace(commonPosition);\n}\n\nvec4 project_position_to_clipspace(\n vec3 position, vec3 position64Low, vec3 offset\n) {\n vec4 commonPosition;\n return project_position_to_clipspace(position, position64Low, offset, commonPosition);\n}\n`;\nexport default {\n name: 'project32',\n dependencies: [project],\n source,\n vs\n};\n//# sourceMappingURL=project32.js.map","// deck.gl\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\nimport { picking } from '@luma.gl/shadertools';\nexport default {\n ...picking,\n defaultUniforms: { ...picking.defaultUniforms, useFloatColors: false },\n inject: {\n 'vs:DECKGL_FILTER_GL_POSITION': `\n // for picking depth values\n picking_setPickingAttribute(position.z / position.w);\n `,\n 'vs:DECKGL_FILTER_COLOR': `\n picking_setPickingColor(geometry.pickingColor);\n `,\n 'fs:DECKGL_FILTER_COLOR': {\n order: 99,\n injection: `\n // use highlight color if this fragment belongs to the selected object.\n color = picking_filterHighlightColor(color);\n\n // use picking color if rendering to picking FBO.\n color = picking_filterPickingColor(color);\n `\n }\n }\n};\n//# sourceMappingURL=picking.js.map","// deck.gl\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\n/**\n * Projection utils\n * TODO: move to Viewport class?\n */\nimport { COORDINATE_SYSTEM } from \"../../lib/constants.js\";\nimport { getOffsetOrigin } from \"./viewport-uniforms.js\";\nimport WebMercatorViewport from \"../../viewports/web-mercator-viewport.js\";\nimport { vec3, vec4 } from '@math.gl/core';\nimport { addMetersToLngLat } from '@math.gl/web-mercator';\nconst DEFAULT_COORDINATE_ORIGIN = [0, 0, 0];\n// In project.glsl, offset modes calculate z differently from LNG_LAT mode.\n// offset modes apply the y adjustment (unitsPerMeter2) when projecting z\n// LNG_LAT mode only use the linear scale.\nfunction lngLatZToWorldPosition(lngLatZ, viewport, offsetMode = false) {\n const p = viewport.projectPosition(lngLatZ);\n // TODO - avoid using instanceof\n if (offsetMode && viewport instanceof WebMercatorViewport) {\n const [longitude, latitude, z = 0] = lngLatZ;\n const distanceScales = viewport.getDistanceScales([longitude, latitude]);\n p[2] = z * distanceScales.unitsPerMeter[2];\n }\n return p;\n}\nfunction normalizeParameters(opts) {\n const { viewport, modelMatrix, coordinateOrigin } = opts;\n let { coordinateSystem, fromCoordinateSystem, fromCoordinateOrigin } = opts;\n if (coordinateSystem === COORDINATE_SYSTEM.DEFAULT) {\n coordinateSystem = viewport.isGeospatial\n ? COORDINATE_SYSTEM.LNGLAT\n : COORDINATE_SYSTEM.CARTESIAN;\n }\n if (fromCoordinateSystem === undefined) {\n fromCoordinateSystem = coordinateSystem;\n }\n if (fromCoordinateOrigin === undefined) {\n fromCoordinateOrigin = coordinateOrigin;\n }\n return {\n viewport,\n coordinateSystem,\n coordinateOrigin,\n modelMatrix,\n fromCoordinateSystem,\n fromCoordinateOrigin\n };\n}\n/** Get the common space position from world coordinates in the given coordinate system */\nexport function getWorldPosition(position, { viewport, modelMatrix, coordinateSystem, coordinateOrigin, offsetMode }) {\n let [x, y, z = 0] = position;\n if (modelMatrix) {\n [x, y, z] = vec4.transformMat4([], [x, y, z, 1.0], modelMatrix);\n }\n switch (coordinateSystem) {\n case COORDINATE_SYSTEM.LNGLAT:\n return lngLatZToWorldPosition([x, y, z], viewport, offsetMode);\n case COORDINATE_SYSTEM.LNGLAT_OFFSETS:\n return lngLatZToWorldPosition([x + coordinateOrigin[0], y + coordinateOrigin[1], z + (coordinateOrigin[2] || 0)], viewport, offsetMode);\n case COORDINATE_SYSTEM.METER_OFFSETS:\n return lngLatZToWorldPosition(addMetersToLngLat(coordinateOrigin, [x, y, z]), viewport, offsetMode);\n case COORDINATE_SYSTEM.CARTESIAN:\n default:\n return viewport.isGeospatial\n ? [x + coordinateOrigin[0], y + coordinateOrigin[1], z + coordinateOrigin[2]]\n : viewport.projectPosition([x, y, z]);\n }\n}\n/**\n * Equivalent to project_position in project.glsl\n * projects a user supplied position to world position directly with or without\n * a reference coordinate system\n */\nexport function projectPosition(position, params) {\n const { viewport, coordinateSystem, coordinateOrigin, modelMatrix, fromCoordinateSystem, fromCoordinateOrigin } = normalizeParameters(params);\n const { autoOffset = true } = params;\n const { geospatialOrigin = DEFAULT_COORDINATE_ORIGIN, shaderCoordinateOrigin = DEFAULT_COORDINATE_ORIGIN, offsetMode = false } = autoOffset ? getOffsetOrigin(viewport, coordinateSystem, coordinateOrigin) : {};\n const worldPosition = getWorldPosition(position, {\n viewport,\n modelMatrix,\n coordinateSystem: fromCoordinateSystem,\n coordinateOrigin: fromCoordinateOrigin,\n offsetMode\n });\n if (offsetMode) {\n const positionCommonSpace = viewport.projectPosition(geospatialOrigin || shaderCoordinateOrigin);\n vec3.sub(worldPosition, worldPosition, positionCommonSpace);\n }\n return worldPosition;\n}\n//# sourceMappingURL=project-functions.js.map","// luma.gl\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\nimport { Buffer } from '@luma.gl/core';\nimport { getPassthroughFS } from '@luma.gl/shadertools';\nimport { Model } from \"../model/model.js\";\n/**\n * Manages a WebGL program (pipeline) for buffer→buffer transforms.\n * @note Only works under WebGL2.\n */\nexport class BufferTransform {\n device;\n model;\n transformFeedback;\n static defaultProps = {\n ...Model.defaultProps,\n outputs: undefined,\n feedbackBuffers: undefined\n };\n static isSupported(device) {\n return device?.info?.type === 'webgl';\n }\n constructor(device, props = BufferTransform.defaultProps) {\n if (!BufferTransform.isSupported(device)) {\n throw new Error('BufferTransform not yet implemented on WebGPU');\n }\n this.device = device;\n this.model = new Model(this.device, {\n id: props.id || 'buffer-transform-model',\n fs: props.fs || getPassthroughFS(),\n topology: props.topology || 'point-list',\n varyings: props.outputs || props.varyings,\n ...props\n });\n this.transformFeedback = this.device.createTransformFeedback({\n layout: this.model.pipeline.shaderLayout,\n // @ts-expect-error TODO\n buffers: props.feedbackBuffers\n });\n this.model.setTransformFeedback(this.transformFeedback);\n Object.seal(this);\n }\n /** Destroy owned resources. */\n destroy() {\n if (this.model) {\n this.model.destroy();\n }\n }\n /** @deprecated Use {@link destroy}. */\n delete() {\n this.destroy();\n }\n /** Run one transform loop. */\n run(options) {\n if (options?.inputBuffers) {\n this.model.setAttributes(options.inputBuffers);\n }\n if (options?.outputBuffers) {\n this.transformFeedback.setBuffers(options.outputBuffers);\n }\n const renderPass = this.device.beginRenderPass(options);\n this.model.draw(renderPass);\n renderPass.end();\n }\n // DEPRECATED METHODS\n /** @deprecated App knows what buffers it is passing in - Returns the {@link Buffer} or {@link BufferRange} for given varying name. */\n getBuffer(varyingName) {\n return this.transformFeedback.getBuffer(varyingName);\n }\n /** @deprecated App knows what buffers it is passing in - Reads the {@link Buffer} or {@link BufferRange} for given varying name. */\n readAsync(varyingName) {\n const result = this.getBuffer(varyingName);\n if (!result) {\n throw new Error('BufferTransform#getBuffer');\n }\n if (result instanceof Buffer) {\n return result.readAsync();\n }\n const { buffer, byteOffset = 0, byteLength = buffer.byteLength } = result;\n return buffer.readAsync(byteOffset, byteLength);\n }\n}\n//# sourceMappingURL=buffer-transform.js.map","// luma.gl\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\nimport { uid } from \"../utils/uid.js\";\nexport class Geometry {\n id;\n /** Determines how vertices are read from the 'vertex' attributes */\n topology;\n vertexCount;\n indices;\n attributes;\n userData = {};\n constructor(props) {\n const { attributes = {}, indices = null, vertexCount = null } = props;\n this.id = props.id || uid('geometry');\n this.topology = props.topology;\n if (indices) {\n this.indices = ArrayBuffer.isView(indices) ? { value: indices, size: 1 } : indices;\n }\n // @ts-expect-error\n this.attributes = {};\n for (const [attributeName, attributeValue] of Object.entries(attributes)) {\n // Wrap \"unwrapped\" arrays and try to autodetect their type\n const attribute = ArrayBuffer.isView(attributeValue)\n ? { value: attributeValue }\n : attributeValue;\n if (!ArrayBuffer.isView(attribute.value)) {\n throw new Error(`${this._print(attributeName)}: must be typed array or object with value as typed array`);\n }\n if ((attributeName === 'POSITION' || attributeName === 'positions') && !attribute.size) {\n attribute.size = 3;\n }\n // Move indices to separate field\n if (attributeName === 'indices') {\n if (this.indices) {\n throw new Error('Multiple indices detected');\n }\n this.indices = attribute;\n }\n else {\n this.attributes[attributeName] = attribute;\n }\n }\n if (this.indices && this.indices['isIndexed'] !== undefined) {\n this.indices = Object.assign({}, this.indices);\n delete this.indices['isIndexed'];\n }\n this.vertexCount = vertexCount || this._calculateVertexCount(this.attributes, this.indices);\n }\n getVertexCount() {\n return this.vertexCount;\n }\n /**\n * Return an object with all attributes plus indices added as a field.\n * TODO Geometry types are a mess\n */\n getAttributes() {\n // @ts-ignore\n return this.indices ? { indices: this.indices, ...this.attributes } : this.attributes;\n }\n // PRIVATE\n _print(attributeName) {\n return `Geometry ${this.id} attribute ${attributeName}`;\n }\n /**\n * GeometryAttribute\n * value: typed array\n * type: indices, vertices, uvs\n * size: elements per vertex\n * target: WebGL buffer type (string or constant)\n *\n * @param attributes\n * @param indices\n * @returns\n */\n _setAttributes(attributes, indices) {\n return this;\n }\n _calculateVertexCount(attributes, indices) {\n if (indices) {\n return indices.value.length;\n }\n let vertexCount = Infinity;\n for (const attribute of Object.values(attributes)) {\n const { value, size, constant } = attribute;\n if (!constant && value && size !== undefined && size >= 1) {\n vertexCount = Math.min(vertexCount, value.length / size);\n }\n }\n // assert(Number.isFinite(vertexCount));\n return vertexCount;\n }\n}\n//# sourceMappingURL=geometry.js.map","// deck.gl\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\nimport { getTypedArrayConstructor, getDataType } from '@luma.gl/core';\nexport function typedArrayFromDataType(type) {\n // Sorted in some order of likelihood to reduce amount of comparisons\n switch (type) {\n case 'float64':\n return Float64Array;\n case 'uint8':\n case 'unorm8':\n return Uint8ClampedArray;\n default:\n return getTypedArrayConstructor(type);\n }\n}\nexport const dataTypeFromTypedArray = getDataType;\nexport function getBufferAttributeLayout(name, accessor, deviceType) {\n // TODO(ibgreen): WebGPU change. Currently we always use normalized 8 bit integers\n const type = deviceType === 'webgpu' && accessor.type === 'uint8' ? 'unorm8' : accessor.type;\n return {\n attribute: name,\n // @ts-expect-error Not all combinations are valid vertex formats; it's up to DataColumn to ensure\n format: accessor.size > 1 ? `${type}x${accessor.size}` : accessor.type,\n byteOffset: accessor.offset || 0\n // Note stride is set on the top level\n };\n}\nexport function getStride(accessor) {\n return accessor.stride || accessor.size * accessor.bytesPerElement;\n}\nexport function bufferLayoutEqual(accessor1, accessor2) {\n return (accessor1.type === accessor2.type &&\n accessor1.size === accessor2.size &&\n getStride(accessor1) === getStride(accessor2) &&\n (accessor1.offset || 0) === (accessor2.offset || 0));\n}\n//# sourceMappingURL=gl-utils.js.map","// deck.gl\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\nimport { Buffer } from '@luma.gl/core';\nimport { typedArrayFromDataType, getBufferAttributeLayout, getStride, dataTypeFromTypedArray } from \"./gl-utils.js\";\nimport typedArrayManager from \"../../utils/typed-array-manager.js\";\nimport { toDoublePrecisionArray } from \"../../utils/math-utils.js\";\nimport log from \"../../utils/log.js\";\nfunction resolveShaderAttribute(baseAccessor, shaderAttributeOptions) {\n if (shaderAttributeOptions.offset) {\n log.removed('shaderAttribute.offset', 'vertexOffset, elementOffset')();\n }\n // All shader attributes share the parent's stride\n const stride = getStride(baseAccessor);\n // `vertexOffset` is used to access the neighboring vertex's value\n // e.g. `nextPositions` in polygon\n const vertexOffset = shaderAttributeOptions.vertexOffset !== undefined\n ? shaderAttributeOptions.vertexOffset\n : baseAccessor.vertexOffset || 0;\n // `elementOffset` is defined when shader attribute's size is smaller than the parent's\n // e.g. `translations` in transform matrix\n const elementOffset = shaderAttributeOptions.elementOffset || 0;\n const offset = \n // offsets defined by the attribute\n vertexOffset * stride +\n elementOffset * baseAccessor.bytesPerElement +\n // offsets defined by external buffers if any\n (baseAccessor.offset || 0);\n return {\n ...shaderAttributeOptions,\n offset,\n stride\n };\n}\nfunction resolveDoublePrecisionShaderAttributes(baseAccessor, shaderAttributeOptions) {\n const resolvedOptions = resolveShaderAttribute(baseAccessor, shaderAttributeOptions);\n return {\n high: resolvedOptions,\n low: {\n ...resolvedOptions,\n offset: resolvedOptions.offset + baseAccessor.size * 4\n }\n };\n}\nexport default class DataColumn {\n /* eslint-disable max-statements */\n constructor(device, opts, state) {\n this._buffer = null;\n this.device = device;\n this.id = opts.id || '';\n this.size = opts.size || 1;\n const logicalType = opts.logicalType || opts.type;\n const doublePrecision = logicalType === 'float64';\n let { defaultValue } = opts;\n defaultValue = Number.isFinite(defaultValue)\n ? [defaultValue]\n : defaultValue || new Array(this.size).fill(0);\n let bufferType;\n if (doublePrecision) {\n bufferType = 'float32';\n }\n else if (!logicalType && opts.isIndexed) {\n bufferType = 'uint32';\n }\n else {\n bufferType = logicalType || 'float32';\n }\n // This is the attribute type defined by the layer\n // If an external buffer is provided, this.type may be overwritten\n // But we always want to use defaultType for allocation\n let defaultType = typedArrayFromDataType(logicalType || bufferType);\n this.doublePrecision = doublePrecision;\n // `fp64: false` tells a double-precision attribute to allocate Float32Arrays\n // by default when using auto-packing. This is more efficient in use cases where\n // high precision is unnecessary, but the `64Low` attribute is still required\n // by the shader.\n if (doublePrecision && opts.fp64 === false) {\n defaultType = Float32Array;\n }\n this.value = null;\n this.settings = {\n ...opts,\n defaultType,\n defaultValue: defaultValue,\n logicalType,\n type: bufferType,\n normalized: bufferType.includes('norm'),\n size: this.size,\n bytesPerElement: defaultType.BYTES_PER_ELEMENT\n };\n this.state = {\n ...state,\n externalBuffer: null,\n bufferAccessor: this.settings,\n allocatedValue: null,\n numInstances: 0,\n bounds: null,\n constant: false\n };\n }\n /* eslint-enable max-statements */\n get isConstant() {\n return this.state.constant;\n }\n get buffer() {\n return this._buffer;\n }\n get byteOffset() {\n const accessor = this.getAccessor();\n if (accessor.vertexOffset) {\n return accessor.vertexOffset * getStride(accessor);\n }\n return 0;\n }\n get numInstances() {\n return this.state.numInstances;\n }\n set numInstances(n) {\n this.state.numInstances = n;\n }\n delete() {\n if (this._buffer) {\n this._buffer.delete();\n this._buffer = null;\n }\n typedArrayManager.release(this.state.allocatedValue);\n }\n getBuffer() {\n if (this.state.constant) {\n return null;\n }\n return this.state.externalBuffer || this._buffer;\n }\n getValue(attributeName = this.id, options = null) {\n const result = {};\n if (this.state.constant) {\n const value = this.value;\n if (options) {\n const shaderAttributeDef = resolveShaderAttribute(this.getAccessor(), options);\n const offset = shaderAttributeDef.offset / value.BYTES_PER_ELEMENT;\n const size = shaderAttributeDef.size || this.size;\n result[attributeName] = value.subarray(offset, offset + size);\n }\n else {\n result[attributeName] = value;\n }\n }\n else {\n result[attributeName] = this.getBuffer();\n }\n if (this.doublePrecision) {\n if (this.value instanceof Float64Array) {\n result[`${attributeName}64Low`] = result[attributeName];\n }\n else {\n // Disable fp64 low part\n result[`${attributeName}64Low`] = new Float32Array(this.size);\n }\n }\n return result;\n }\n _getBufferLayout(attributeName = this.id, options = null) {\n const accessor = this.getAccessor();\n const attributes = [];\n const result = {\n name: this.id,\n byteStride: getStride(accessor),\n attributes\n };\n if (this.doublePrecision) {\n const doubleShaderAttributeDefs = resolveDoublePrecisionShaderAttributes(accessor, options || {});\n attributes.push(getBufferAttributeLayout(attributeName, { ...accessor, ...doubleShaderAttributeDefs.high }, this.device.type), getBufferAttributeLayout(`${attributeName}64Low`, {\n ...accessor,\n ...doubleShaderAttributeDefs.low\n }, this.device.type));\n }\n else if (options) {\n const shaderAttributeDef = resolveShaderAttribute(accessor, options);\n attributes.push(getBufferAttributeLayout(attributeName, { ...accessor, ...shaderAttributeDef }, this.device.type));\n }\n else {\n attributes.push(getBufferAttributeLayout(attributeName, accessor, this.device.type));\n }\n return result;\n }\n setAccessor(accessor) {\n this.state.bufferAccessor = accessor;\n }\n getAccessor() {\n return this.state.bufferAccessor;\n }\n // Returns [min: Array(size), max: Array(size)]\n /* eslint-disable max-depth */\n getBounds() {\n if (this.state.bounds) {\n return this.state.bounds;\n }\n let result = null;\n if (this.state.constant && this.value) {\n const min = Array.from(this.value);\n result = [min, min];\n }\n else {\n const { value, numInstances, size } = this;\n const len = numInstances * size;\n if (value && len && value.length >= len) {\n const min = new Array(size).fill(Infinity);\n const max = new Array(size).fill(-Infinity);\n for (let i = 0; i < len;) {\n for (let j = 0; j < size; j++) {\n const v = value[i++];\n if (v < min[j])\n min[j] = v;\n if (v > max[j])\n max[j] = v;\n }\n }\n result = [min, max];\n }\n }\n this.state.bounds = result;\n return result;\n }\n // returns true if success\n // eslint-disable-next-line max-statements\n setData(data) {\n const { state } = this;\n let opts;\n if (ArrayBuffer.isView(data)) {\n opts = { value: data };\n }\n else if (data instanceof Buffer) {\n opts = { buffer: data };\n }\n else {\n opts = data;\n }\n const accessor = { ...this.settings, ...opts };\n if (ArrayBuffer.isView(opts.value)) {\n if (!opts.type) {\n // Deduce data type\n const is64Bit = this.doublePrecision && opts.value instanceof Float64Array;\n if (is64Bit) {\n accessor.type = 'float32';\n }\n else {\n const type = dataTypeFromTypedArray(opts.value);\n // (lint wants to remove the cast)\n // eslint-disable-next-line\n accessor.type = (accessor.normalized ? type.replace('int', 'norm') : type);\n }\n }\n accessor.bytesPerElement = opts.value.BYTES_PER_ELEMENT;\n accessor.stride = getStride(accessor);\n }\n state.bounds = null; // clear cached bounds\n if (opts.constant) {\n // set constant\n let value = opts.value;\n value = this._normalizeValue(value, [], 0);\n if (this.settings.normalized) {\n value = this.normalizeConstant(value);\n }\n const hasChanged = !state.constant || !this._areValuesEqual(value, this.value);\n if (!hasChanged) {\n return false;\n }\n state.externalBuffer = null;\n state.constant = true;\n this.value = ArrayBuffer.isView(value) ? value : new Float32Array(value);\n }\n else if (opts.buffer) {\n const buffer = opts.buffer;\n state.externalBuffer = buffer;\n state.constant = false;\n this.value = opts.value || null;\n }\n else if (opts.value) {\n this._checkExternalBuffer(opts);\n let value = opts.value;\n state.externalBuffer = null;\n state.constant = false;\n this.value = value;\n let { buffer } = this;\n const stride = getStride(accessor);\n const byteOffset = (accessor.vertexOffset || 0) * stride;\n if (this.doublePrecision && value instanceof Float64Array) {\n value = toDoublePrecisionArray(value, accessor);\n }\n if (this.settings.isIndexed) {\n const ArrayType = this.settings.defaultType;\n if (value.constructor !== ArrayType) {\n // Cast the index buffer to expected type\n value = new ArrayType(value);\n }\n }\n // A small over allocation is used as safety margin\n // Shader attributes may try to access this buffer with bigger offsets\n const requiredBufferSize = value.byteLength + byteOffset + stride * 2;\n if (!buffer || buffer.byteLength < requiredBufferSize) {\n buffer = this._createBuffer(requiredBufferSize);\n }\n buffer.write(value, byteOffset);\n }\n this.setAccessor(accessor);\n return true;\n }\n updateSubBuffer(opts = {}) {\n this.state.bounds = null; // clear cached bounds\n const value = this.value;\n const { startOffset = 0, endOffset } = opts;\n this.buffer.write(this.doublePrecision && value instanceof Float64Array\n ? toDoublePrecisionArray(value, {\n size: this.size,\n startIndex: startOffset,\n endIndex: endOffset\n })\n : value.subarray(startOffset, endOffset), startOffset * value.BYTES_PER_ELEMENT + this.byteOffset);\n }\n allocate(numInstances, copy = false) {\n const { state } = this;\n const oldValue = state.allocatedValue;\n // Allocate at least one element to ensure a valid buffer\n const value = typedArrayManager.allocate(oldValue, numInstances + 1, {\n size: this.size,\n type: this.settings.defaultType,\n copy\n });\n this.value = value;\n const { byteOffset } = this;\n let { buffer } = this;\n if (!buffer || buffer.byteLength < value.byteLength + byteOffset) {\n buffer = this._createBuffer(value.byteLength + byteOffset);\n if (copy && oldValue) {\n // Upload the full existing attribute value to the GPU, so that updateBuffer\n // can choose to only update a partial range.\n // TODO - copy old buffer to new buffer on the GPU\n buffer.write(oldValue instanceof Float64Array ? toDoublePrecisionArray(oldValue, this) : oldValue, byteOffset);\n }\n }\n state.allocatedValue = value;\n state.constant = false;\n state.externalBuffer = null;\n this.setAccessor(this.settings);\n return true;\n }\n // PRIVATE HELPER METHODS\n _checkExternalBuffer(opts) {\n const { value } = opts;\n if (!ArrayBuffer.isView(value)) {\n throw new Error(`Attribute ${this.id} value is not TypedArray`);\n }\n const ArrayType = this.settings.defaultType;\n let illegalArrayType = false;\n if (this.doublePrecision) {\n // not 32bit or 64bit\n illegalArrayType = value.BYTES_PER_ELEMENT < 4;\n }\n if (illegalArrayType) {\n throw new Error(`Attribute ${this.id} does not support ${value.constructor.name}`);\n }\n if (!(value instanceof ArrayType) && this.settings.normalized && !('normalized' in opts)) {\n log.warn(`Attribute ${this.id} is normalized`)();\n }\n }\n // https://developer.mozilla.org/en-US/docs/Web/API/WebGLRenderingContext/vertexAttribPointer\n normalizeConstant(value) {\n /* eslint-disable complexity */\n switch (this.settings.type) {\n case 'snorm8':\n // normalize [-128, 127] to [-1, 1]\n return new Float32Array(value).map(x => ((x + 128) / 255) * 2 - 1);\n case 'snorm16':\n // normalize [-32768, 32767] to [-1, 1]\n return new Float32Array(value).map(x => ((x + 32768) / 65535) * 2 - 1);\n case 'unorm8':\n // normalize [0, 255] to [0, 1]\n return new Float32Array(value).map(x => x / 255);\n case 'unorm16':\n // normalize [0, 65535] to [0, 1]\n return new Float32Array(value).map(x => x / 65535);\n default:\n // No normalization for gl.FLOAT and gl.HALF_FLOAT\n return value;\n }\n }\n /* check user supplied values and apply fallback */\n _normalizeValue(value, out, start) {\n const { defaultValue, size } = this.settings;\n if (Number.isFinite(value)) {\n out[start] = value;\n return out;\n }\n if (!value) {\n let i = size;\n while (--i >= 0) {\n out[start + i] = defaultValue[i];\n }\n return out;\n }\n // Important - switch cases are 5x more performant than a for loop!\n /* eslint-disable no-fallthrough, default-case */\n switch (size) {\n case 4:\n out[start + 3] = Number.isFinite(value[3]) ? value[3] : defaultValue[3];\n case 3:\n out[start + 2] = Number.isFinite(value[2]) ? value[2] : defaultValue[2];\n case 2:\n out[start + 1] = Number.isFinite(value[1]) ? value[1] : defaultValue[1];\n case 1:\n out[start + 0] = Number.isFinite(value[0]) ? value[0] : defaultValue[0];\n break;\n default:\n // In the rare case where the attribute size > 4, do it the slow way\n // This is used for e.g. transform matrices\n let i = size;\n while (--i >= 0) {\n out[start + i] = Number.isFinite(value[i]) ? value[i] : defaultValue[i];\n }\n }\n return out;\n }\n _areValuesEqual(value1, value2) {\n if (!value1 || !value2) {\n return false;\n }\n const { size } = this;\n for (let i = 0; i < size; i++) {\n if (value1[i] !== value2[i]) {\n return false;\n }\n }\n return true;\n }\n _createBuffer(byteLength) {\n if (this._buffer) {\n this._buffer.destroy();\n }\n const { isIndexed, type } = this.settings;\n this._buffer = this.device.createBuffer({\n ...this._buffer?.props,\n id: this.id,\n // TODO(ibgreen) - WebGPU requires COPY_DST and COPY_SRC to allow write / read\n usage: (isIndexed ? Buffer.INDEX : Buffer.VERTEX) | Buffer.COPY_DST,\n indexType: isIndexed ? type : undefined,\n byteLength\n });\n return this._buffer;\n }\n}\n//# sourceMappingURL=data-column.js.map","// deck.gl\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\nconst EMPTY_ARRAY = [];\nconst placeholderArray = [];\n/*\n * Create an Iterable\n * https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols\n * and a \"context\" tracker from the given data\n */\nexport function createIterable(data, startRow = 0, endRow = Infinity) {\n let iterable = EMPTY_ARRAY;\n const objectInfo = {\n index: -1,\n data,\n // visitor can optionally utilize this to avoid constructing a new array for every object\n target: []\n };\n if (!data) {\n iterable = EMPTY_ARRAY;\n }\n else if (typeof data[Symbol.iterator] === 'function') {\n // data is already an iterable\n iterable = data;\n }\n else if (data.length > 0) {\n placeholderArray.length = data.length;\n iterable = placeholderArray;\n }\n if (startRow > 0 || Number.isFinite(endRow)) {\n iterable = (Array.isArray(iterable) ? iterable : Array.from(iterable)).slice(startRow, endRow);\n objectInfo.index = startRow - 1;\n }\n return { iterable, objectInfo };\n}\n/*\n * Returns true if data is an async iterable object\n */\nexport function isAsyncIterable(data) {\n return data && data[Symbol.asyncIterator];\n}\n/*\n * Create an accessor function from a flat buffer that yields the value at each object index\n */\nexport function getAccessorFromBuffer(typedArray, options) {\n const { size, stride, offset, startIndices, nested } = options;\n const bytesPerElement = typedArray.BYTES_PER_ELEMENT;\n const elementStride = stride ? stride / bytesPerElement : size;\n const elementOffset = offset ? offset / bytesPerElement : 0;\n const vertexCount = Math.floor((typedArray.length - elementOffset) / elementStride);\n return (_, { index, target }) => {\n if (!startIndices) {\n const sourceIndex = index * elementStride + elementOffset;\n for (let j = 0; j < size; j++) {\n target[j] = typedArray[sourceIndex + j];\n }\n return target;\n }\n const startIndex = startIndices[index];\n const endIndex = startIndices[index + 1] || vertexCount;\n let result;\n if (nested) {\n result = new Array(endIndex - startIndex);\n for (let i = startIndex; i < endIndex; i++) {\n const sourceIndex = i * elementStride + elementOffset;\n target = new Array(size);\n for (let j = 0; j < size; j++) {\n target[j] = typedArray[sourceIndex + j];\n }\n result[i - startIndex] = target;\n }\n }\n else if (elementStride === size) {\n result = typedArray.subarray(startIndex * size + elementOffset, endIndex * size + elementOffset);\n }\n else {\n result = new typedArray.constructor((endIndex - startIndex) * size);\n let targetIndex = 0;\n for (let i = startIndex; i < endIndex; i++) {\n const sourceIndex = i * elementStride + elementOffset;\n for (let j = 0; j < size; j++) {\n result[targetIndex++] = typedArray[sourceIndex + j];\n }\n }\n }\n return result;\n };\n}\n//# sourceMappingURL=iterable-utils.js.map","// deck.gl\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\n/*\n * range (Array)\n * + start (Number) - the start index (incl.)\n * + end (Number) - the end index (excl.)\n * rangeList (Array) - array of sorted, combined ranges\n */\nexport const EMPTY = [];\nexport const FULL = [[0, Infinity]];\n// Insert a range into a range collection\nexport function add(rangeList, range) {\n // Noop if range collection already covers all\n if (rangeList === FULL) {\n return rangeList;\n }\n // Validate the input range\n if (range[0] < 0) {\n range[0] = 0;\n }\n if (range[0] >= range[1]) {\n return rangeList;\n }\n // TODO - split off to tree-shakable Range class\n const newRangeList = [];\n const len = rangeList.length;\n let insertPosition = 0;\n for (let i = 0; i < len; i++) {\n const range0 = rangeList[i];\n if (range0[1] < range[0]) {\n // the current range is to the left of the new range\n newRangeList.push(range0);\n insertPosition = i + 1;\n }\n else if (range0[0] > range[1]) {\n // the current range is to the right of the new range\n newRangeList.push(range0);\n }\n else {\n range = [Math.min(range0[0], range[0]), Math.max(range0[1], range[1])];\n }\n }\n newRangeList.splice(insertPosition, 0, range);\n return newRangeList;\n}\n//# sourceMappingURL=range.js.map","// deck.gl\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\nconst DEFAULT_TRANSITION_SETTINGS = {\n interpolation: {\n duration: 0,\n easing: t => t\n },\n spring: {\n stiffness: 0.05,\n damping: 0.5\n }\n};\nexport function normalizeTransitionSettings(userSettings, layerSettings) {\n if (!userSettings) {\n return null;\n }\n if (Number.isFinite(userSettings)) {\n userSettings = { type: 'interpolation', duration: userSettings };\n }\n const type = userSettings.type || 'interpolation';\n return {\n ...DEFAULT_TRANSITION_SETTINGS[type],\n ...layerSettings,\n ...userSettings,\n type\n };\n}\n//# sourceMappingURL=transition-settings.js.map","// deck.gl\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\n/* eslint-disable complexity */\nimport DataColumn from \"./data-column.js\";\nimport assert from \"../../utils/assert.js\";\nimport { createIterable, getAccessorFromBuffer } from \"../../utils/iterable-utils.js\";\nimport { fillArray } from \"../../utils/flatten.js\";\nimport * as range from \"../../utils/range.js\";\nimport { bufferLayoutEqual } from \"./gl-utils.js\";\nimport { normalizeTransitionSettings } from \"./transition-settings.js\";\nexport default class Attribute extends DataColumn {\n constructor(device, opts) {\n super(device, opts, {\n startIndices: null,\n lastExternalBuffer: null,\n binaryValue: null,\n binaryAccessor: null,\n needsUpdate: true,\n needsRedraw: false,\n layoutChanged: false,\n updateRanges: range.FULL\n });\n /** Legacy approach to set attribute value - read `isConstant` instead for attribute state */\n this.constant = false;\n // eslint-disable-next-line\n this.settings.update = opts.update || (opts.accessor ? this._autoUpdater : undefined);\n Object.seal(this.settings);\n Object.seal(this.state);\n // Check all fields and generate helpful error messages\n this._validateAttributeUpdaters();\n }\n get startIndices() {\n return this.state.startIndices;\n }\n set startIndices(layout) {\n this.state.startIndices = layout;\n }\n needsUpdate() {\n return this.state.needsUpdate;\n }\n needsRedraw({ clearChangedFlags = false } = {}) {\n const needsRedraw = this.state.needsRedraw;\n this.state.needsRedraw = needsRedraw && !clearChangedFlags;\n return needsRedraw;\n }\n layoutChanged() {\n return this.state.layoutChanged;\n }\n setAccessor(accessor) {\n var _a;\n (_a = this.state).layoutChanged || (_a.layoutChanged = !bufferLayoutEqual(accessor, this.getAccessor()));\n super.setAccessor(accessor);\n }\n getUpdateTriggers() {\n const { accessor } = this.settings;\n // Backards compatibility: allow attribute name to be used as update trigger key\n return [this.id].concat((typeof accessor !== 'function' && accessor) || []);\n }\n supportsTransition() {\n return Boolean(this.settings.transition);\n }\n // Resolve transition settings object if transition is enabled, otherwise `null`\n getTransitionSetting(opts) {\n if (!opts || !this.supportsTransition()) {\n return null;\n }\n const { accessor } = this.settings;\n // TODO: have the layer resolve these transition settings itself?\n const layerSettings = this.settings.transition;\n // these are the transition settings passed in by the user\n const userSettings = Array.isArray(accessor)\n ? // @ts-ignore\n opts[accessor.find(a => opts[a])]\n : // @ts-ignore\n opts[accessor];\n // Shorthand: use duration instead of parameter object\n return normalizeTransitionSettings(userSettings, layerSettings);\n }\n setNeedsUpdate(reason = this.id, dataRange) {\n this.state.needsUpdate = this.state.needsUpdate || reason;\n this.setNeedsRedraw(reason);\n if (dataRange) {\n const { startRow = 0, endRow = Infinity } = dataRange;\n this.state.updateRanges = range.add(this.state.updateRanges, [startRow, endRow]);\n }\n else {\n this.state.updateRanges = range.FULL;\n }\n }\n clearNeedsUpdate() {\n this.state.needsUpdate = false;\n this.state.updateRanges = range.EMPTY;\n }\n setNeedsRedraw(reason = this.id) {\n this.state.needsRedraw = this.state.needsRedraw || reason;\n }\n allocate(numInstances) {\n const { state, settings } = this;\n if (settings.noAlloc) {\n // Data is provided through a Buffer object.\n return false;\n }\n if (settings.update) {\n super.allocate(numInstances, state.updateRanges !== range.FULL);\n return true;\n }\n return false;\n }\n updateBuffer({ numInstances, data, props, context }) {\n if (!this.needsUpdate()) {\n return false;\n }\n const { state: { updateRanges }, settings: { update, noAlloc } } = this;\n let updated = true;\n if (update) {\n // Custom updater - typically for non-instanced layers\n for (const [startRow, endRow] of updateRanges) {\n update.call(context, this, { data, startRow, endRow, props, numInstances });\n }\n if (!this.value) {\n // no value was assigned during update\n }\n else if (this.constant ||\n !this.buffer ||\n this.buffer.byteLength < this.value.byteLength + this.byteOffset) {\n this.setData({\n value: this.value,\n constant: this.constant\n });\n // Setting attribute.constant in updater is a legacy approach that interferes with allocation in the next cycle\n // Respect it here but reset after use\n this.constant = false;\n }\n else {\n for (const [startRow, endRow] of updateRanges) {\n const startOffset = Number.isFinite(startRow) ? this.getVertexOffset(startRow) : 0;\n const endOffset = Number.isFinite(endRow)\n ? this.getVertexOffset(endRow)\n : noAlloc || !Number.isFinite(numInstances)\n ? this.value.length\n : numInstances * this.size;\n super.updateSubBuffer({ startOffset, endOffset });\n }\n }\n this._checkAttributeArray();\n }\n else {\n updated = false;\n }\n this.clearNeedsUpdate();\n this.setNeedsRedraw();\n return updated;\n }\n // Use generic value\n // Returns true if successful\n setConstantValue(context, value) {\n // TODO(ibgreen): WebGPU does not support constant values,\n // they will be emulated as buffers instead for now.\n const isWebGPU = this.device.type === 'webgpu';\n if (isWebGPU || value === undefined || typeof value === 'function') {\n if (isWebGPU && typeof value !== 'function') {\n const normalisedValue = this._normalizeValue(value, [], 0);\n // ensure we trigger an update for the attribute's emulated buffer\n // where webgl would perform the update here\n if (!this._areValuesEqual(normalisedValue, this.value)) {\n this.setNeedsUpdate('WebGPU constant updated');\n }\n }\n return false;\n }\n const transformedValue = this.settings.transform && context ? this.settings.transform.call(context, value) : value;\n const hasChanged = this.setData({ constant: true, value: transformedValue });\n if (hasChanged) {\n this.setNeedsRedraw();\n }\n this.clearNeedsUpdate();\n return true;\n }\n // Use external buffer\n // Returns true if successful\n // eslint-disable-next-line max-statements\n setExternalBuffer(buffer) {\n const { state } = this;\n if (!buffer) {\n state.lastExternalBuffer = null;\n return false;\n }\n this.clearNeedsUpdate();\n if (state.lastExternalBuffer === buffer) {\n return true;\n }\n state.lastExternalBuffer = buffer;\n this.setNeedsRedraw();\n this.setData(buffer);\n return true;\n }\n // Binary value is a typed array packed from mapping the source data with the accessor\n // If the returned value from the accessor is the same as the attribute value, set it directly\n // Otherwise use the auto updater for transform/normalization\n setBinaryValue(buffer, startIndices = null) {\n const { state, settings } = this;\n if (!buffer) {\n state.binaryValue = null;\n state.binaryAccessor = null;\n return false;\n }\n if (settings.noAlloc) {\n // Let the layer handle this\n return false;\n }\n if (state.binaryValue === buffer) {\n this.clearNeedsUpdate();\n return true;\n }\n state.binaryValue = buffer;\n this.setNeedsRedraw();\n const needsUpdate = settings.transform || startIndices !== this.startIndices;\n if (needsUpdate) {\n if (ArrayBuffer.isView(buffer)) {\n buffer = { value: buffer };\n }\n const binaryValue = buffer;\n assert(ArrayBuffer.isView(binaryValue.value), `invalid ${settings.accessor}`);\n const needsNormalize = Boolean(binaryValue.size) && binaryValue.size !== this.size;\n state.binaryAccessor = getAccessorFromBuffer(binaryValue.value, {\n size: binaryValue.size || this.size,\n stride: binaryValue.stride,\n offset: binaryValue.offset,\n startIndices: startIndices,\n nested: needsNormalize\n });\n // Fall through to auto updater\n return false;\n }\n this.clearNeedsUpdate();\n this.setData(buffer);\n return true;\n }\n getVertexOffset(row) {\n const { startIndices } = this;\n const vertexIndex = startIndices\n ? row < startIndices.length\n ? startIndices[row]\n : this.numInstances\n : row;\n return vertexIndex * this.size;\n }\n getValue() {\n const shaderAttributeDefs = this.settings.shaderAttributes;\n const result = super.getValue();\n if (!shaderAttributeDefs) {\n return result;\n }\n for (const shaderAttributeName in shaderAttributeDefs) {\n Object.assign(result, super.getValue(shaderAttributeName, shaderAttributeDefs[shaderAttributeName]));\n }\n return result;\n }\n /** Generate WebGPU-style buffer layout descriptor from this attribute */\n getBufferLayout(\n /** A luma.gl Model-shaped object that supplies additional hint to attribute resolution */\n modelInfo) {\n // Clear change flag\n this.state.layoutChanged = false;\n const shaderAttributeDefs = this.settings.shaderAttributes;\n const result = super._getBufferLayout();\n const { stepMode } = this.settings;\n if (stepMode === 'dynamic') {\n // If model info is provided, use isInstanced flag to determine step mode\n // If no model info is provided, assume it's an instanced model (most common use case)\n result.stepMode = modelInfo ? (modelInfo.isInstanced ? 'instance' : 'vertex') : 'instance';\n }\n else {\n result.stepMode = stepMode ?? 'vertex';\n }\n if (!shaderAttributeDefs) {\n return result;\n }\n for (const shaderAttributeName in shaderAttributeDefs) {\n const map = super._getBufferLayout(shaderAttributeName, shaderAttributeDefs[shaderAttributeName]);\n // @ts-ignore\n result.attributes.push(...map.attributes);\n }\n return result;\n }\n /* eslint-disable max-depth, max-statements */\n _autoUpdater(attribute, { data, startRow, endRow, props, numInstances }) {\n if (attribute.constant) {\n // @ts-ignore TODO(ibgreen) declare context?\n if (this.context.device.type !== 'webgpu') {\n return;\n }\n }\n const { settings, state, value, size, startIndices } = attribute;\n const { accessor, transform } = settings;\n let accessorFunc = state.binaryAccessor ||\n // @ts-ignore\n (typeof accessor === 'function' ? accessor : props[accessor]);\n // TODO(ibgreen) WebGPU needs buffers, generate an accessor function from a constant\n if (typeof accessorFunc !== 'function' && typeof accessor === 'string') {\n accessorFunc = () => props[accessor];\n }\n assert(typeof accessorFunc === 'function', `accessor \"${accessor}\" is not a function`);\n let i = attribute.getVertexOffset(startRow);\n const { iterable, objectInfo } = createIterable(data, startRow, endRow);\n for (const object of iterable) {\n objectInfo.index++;\n let objectValue = accessorFunc(object, objectInfo);\n if (transform) {\n // transform callbacks could be bound to a particular layer instance.\n // always point `this` to the current layer.\n objectValue = transform.call(this, objectValue);\n }\n if (startIndices) {\n const numVertices = (objectInfo.index < startIndices.length - 1\n ? startIndices[objectInfo.index + 1]\n : numInstances) - startIndices[objectInfo.index];\n if (objectValue && Array.isArray(objectValue[0])) {\n let startIndex = i;\n for (const item of objectValue) {\n attribute._normalizeValue(item, value, startIndex);\n startIndex += size;\n }\n }\n else if (objectValue && objectValue.length > size) {\n value.set(objectValue, i);\n }\n else {\n attribute._normalizeValue(objectValue, objectInfo.target, 0);\n fillArray({\n target: value,\n source: objectInfo.target,\n start: i,\n count: numVertices\n });\n }\n i += numVertices * size;\n }\n else {\n attribute._normalizeValue(objectValue, value, i);\n i += size;\n }\n }\n }\n /* eslint-enable max-depth, max-statements */\n // Validate deck.gl level fields\n _validateAttributeUpdaters() {\n const { settings } = this;\n // Check that 'update' is a valid function\n const hasUpdater = settings.noAlloc || typeof settings.update === 'function';\n if (!hasUpdater) {\n throw new Error(`Attribute ${this.id} missing update or accessor`);\n }\n }\n // check that the first few elements of the attribute are reasonable\n /* eslint-disable no-fallthrough */\n _checkAttributeArray() {\n const { value } = this;\n const limit = Math.min(4, this.size);\n if (value && value.length >= limit) {\n let valid = true;\n switch (limit) {\n case 4:\n valid = valid && Number.isFinite(value[3]);\n case 3:\n valid = valid && Number.isFinite(value[2]);\n case 2:\n valid = valid && Number.isFinite(value[1]);\n case 1:\n valid = valid && Number.isFinite(value[0]);\n break;\n default:\n valid = false;\n }\n if (!valid) {\n throw new Error(`Illegal attribute generated for ${this.id}`);\n }\n }\n }\n}\n//# sourceMappingURL=attribute.js.map","// deck.gl\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\n/*\n * Helper function for padArray\n */\nfunction padArrayChunk(options) {\n const { source, target, start = 0, size, getData } = options;\n const end = options.end || target.length;\n const sourceLength = source.length;\n const targetLength = end - start;\n if (sourceLength > targetLength) {\n target.set(source.subarray(0, targetLength), start);\n return;\n }\n target.set(source, start);\n if (!getData) {\n return;\n }\n // source is not large enough to fill target space, call `getData` to get filler data\n let i = sourceLength;\n while (i < targetLength) {\n const datum = getData(i, source);\n for (let j = 0; j < size; j++) {\n target[start + i] = datum[j] || 0;\n i++;\n }\n }\n}\n/*\n * The padArray function stretches a source array to the size of a target array.\n The arrays can have internal structures (like the attributes of PathLayer and\n SolidPolygonLayer), defined by the optional sourceStartIndices and targetStartIndices parameters.\n If the target array is larger, the getData callback is used to fill in the blanks.\n */\nexport function padArray({ source, target, size, getData, sourceStartIndices, targetStartIndices }) {\n if (!sourceStartIndices || !targetStartIndices) {\n // Flat arrays\n padArrayChunk({\n source,\n target,\n size,\n getData\n });\n return target;\n }\n // Arrays have internal structure\n let sourceIndex = 0;\n let targetIndex = 0;\n const getChunkData = getData && ((i, chunk) => getData(i + targetIndex, chunk));\n const n = Math.min(sourceStartIndices.length, targetStartIndices.length);\n for (let i = 1; i < n; i++) {\n const nextSourceIndex = sourceStartIndices[i] * size;\n const nextTargetIndex = targetStartIndices[i] * size;\n padArrayChunk({\n source: source.subarray(sourceIndex, nextSourceIndex),\n target,\n start: targetIndex,\n end: nextTargetIndex,\n size,\n getData: getChunkData\n });\n sourceIndex = nextSourceIndex;\n targetIndex = nextTargetIndex;\n }\n if (targetIndex < target.length) {\n padArrayChunk({\n // @ts-ignore\n source: [],\n target,\n start: targetIndex,\n size,\n getData: getChunkData\n });\n }\n return target;\n}\n//# sourceMappingURL=array-utils.js.map","// deck.gl\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\nimport { padArray } from \"../utils/array-utils.js\";\nimport Attribute from \"../lib/attribute/attribute.js\";\nimport { GL } from '@luma.gl/constants';\n/** Create a new empty attribute with the same settings: type, shader layout etc. */\nexport function cloneAttribute(attribute) {\n // `attribute.settings` is the original options passed when constructing the attribute.\n // This ensures that we set the proper `doublePrecision` flag and shader attributes.\n const { device, settings, value } = attribute;\n const newAttribute = new Attribute(device, settings);\n // Placeholder value - necessary for generating the correct buffer layout\n newAttribute.setData({\n value: value instanceof Float64Array ? new Float64Array(0) : new Float32Array(0),\n normalized: settings.normalized\n });\n return newAttribute;\n}\n/** Returns the GLSL attribute type for the given number of float32 components. */\nexport function getAttributeTypeFromSize(size) {\n switch (size) {\n case 1:\n return 'float';\n case 2:\n return 'vec2';\n case 3:\n return 'vec3';\n case 4:\n return 'vec4';\n default:\n throw new Error(`No defined attribute type for size \"${size}\"`);\n }\n}\n/** Returns the {@link VertexFormat} for the given number of float32 components. */\nexport function getFloat32VertexFormat(size) {\n switch (size) {\n case 1:\n return 'float32';\n case 2:\n return 'float32x2';\n case 3:\n return 'float32x3';\n case 4:\n return 'float32x4';\n default:\n throw new Error('invalid type size');\n }\n}\nexport function cycleBuffers(buffers) {\n buffers.push(buffers.shift());\n}\nexport function getAttributeBufferLength(attribute, numInstances) {\n const { doublePrecision, settings, value, size } = attribute;\n const multiplier = doublePrecision && value instanceof Float64Array ? 2 : 1;\n let maxVertexOffset = 0;\n const { shaderAttributes } = attribute.settings;\n if (shaderAttributes) {\n for (const shaderAttribute of Object.values(shaderAttributes)) {\n maxVertexOffset = Math.max(maxVertexOffset, shaderAttribute.vertexOffset ?? 0);\n }\n }\n return ((settings.noAlloc ? value.length : (numInstances + maxVertexOffset) * size) *\n multiplier);\n}\nexport function matchBuffer({ device, source, target }) {\n if (!target || target.byteLength < source.byteLength) {\n target?.destroy();\n target = device.createBuffer({\n byteLength: source.byteLength,\n usage: source.usage\n });\n }\n return target;\n}\n/* eslint-disable complexity */\n// This helper is used when transitioning attributes from a set of values in one buffer layout\n// to a set of values in a different buffer layout. (Buffer layouts are used when attribute values\n// within a buffer should be grouped for drawElements, like the Polygon layer.) For example, a\n// buffer layout of [3, 4] might have data [A1, A2, A3, B1, B2, B3, B4]. If it needs to transition\n// to a buffer layout of [4, 2], it should produce a buffer, using the transition setting's `enter`\n// function, that looks like this: [A1, A2, A3, A4 (user `enter` fn), B1, B2, 0]. Note: the final\n// 0 in this buffer is because we never shrink buffers, only grow them, for performance reasons.\n//\n// padBuffer may return either the original buffer, or a new buffer if the size of the original\n// was insufficient. Callers are responsible for disposing of the original buffer if needed.\nexport function padBuffer({ device, buffer, attribute, fromLength, toLength, fromStartIndices, getData = x => x }) {\n // TODO: move the precisionMultiplier logic to the attribute when retrieving\n // its `size` and `elementOffset`?\n const precisionMultiplier = attribute.doublePrecision && attribute.value instanceof Float64Array ? 2 : 1;\n const size = attribute.size * precisionMultiplier;\n const byteOffset = attribute.byteOffset;\n // Transform feedback can only write to float varyings\n // Attributes of format unorm8/uint8 (1 byte per element) etc will be padded to float32 (4 bytes per element)\n const targetByteOffset = attribute.settings.bytesPerElement < 4\n ? (byteOffset / attribute.settings.bytesPerElement) * 4\n : byteOffset;\n const toStartIndices = attribute.startIndices;\n const hasStartIndices = fromStartIndices && toStartIndices;\n const isConstant = attribute.isConstant;\n // check if buffer needs to be padded\n if (!hasStartIndices && buffer && fromLength >= toLength) {\n return buffer;\n }\n const ArrayType = attribute.value instanceof Float64Array\n ? Float32Array\n : attribute.value.constructor;\n const toData = isConstant\n ? attribute.value\n : // TODO(v9.1): Avoid non-portable synchronous reads.\n new ArrayType(attribute\n .getBuffer()\n .readSyncWebGL(byteOffset, toLength * ArrayType.BYTES_PER_ELEMENT).buffer);\n if (attribute.settings.normalized && !isConstant) {\n const getter = getData;\n getData = (value, chunk) => attribute.normalizeConstant(getter(value, chunk));\n }\n const getMissingData = isConstant\n ? (i, chunk) => getData(toData, chunk)\n : (i, chunk) => getData(toData.subarray(i + byteOffset, i + byteOffset + size), chunk);\n // TODO(v9.1): Avoid non-portable synchronous reads.\n const source = buffer\n ? new Float32Array(buffer.readSyncWebGL(targetByteOffset, fromLength * 4).buffer)\n : new Float32Array(0);\n const target = new Float32Array(toLength);\n padArray({\n source,\n target,\n sourceStartIndices: fromStartIndices,\n targetStartIndices: toStartIndices,\n size,\n getData: getMissingData\n });\n if (!buffer || buffer.byteLength < target.byteLength + targetByteOffset) {\n buffer?.destroy();\n buffer = device.createBuffer({\n byteLength: target.byteLength + targetByteOffset,\n usage: 35050\n });\n }\n buffer.write(target, targetByteOffset);\n return buffer;\n}\n//# sourceMappingURL=gpu-transition-utils.js.map","// deck.gl\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\nimport Transition from \"./transition.js\";\nimport { cloneAttribute, getAttributeBufferLength } from \"./gpu-transition-utils.js\";\nexport class GPUTransitionBase {\n constructor({ device, attribute, timeline }) {\n this.buffers = [];\n /** The vertex count of the last buffer.\n * Buffer may be larger than the actual length we want to use\n * because we only reallocate buffers when they grow, not when they shrink,\n * due to performance costs */\n this.currentLength = 0;\n this.device = device;\n this.transition = new Transition(timeline);\n this.attribute = attribute;\n this.attributeInTransition = cloneAttribute(attribute);\n this.currentStartIndices = attribute.startIndices;\n }\n get inProgress() {\n return this.transition.inProgress;\n }\n start(transitionSettings, numInstances, duration = Infinity) {\n this.settings = transitionSettings;\n this.currentStartIndices = this.attribute.startIndices;\n this.currentLength = getAttributeBufferLength(this.attribute, numInstances);\n this.transition.start({ ...transitionSettings, duration });\n }\n update() {\n const updated = this.transition.update();\n if (updated) {\n this.onUpdate();\n }\n return updated;\n }\n setBuffer(buffer) {\n this.attributeInTransition.setData({\n buffer,\n normalized: this.attribute.settings.normalized,\n // Retain placeholder value to generate correct shader layout\n value: this.attributeInTransition.value\n });\n }\n cancel() {\n this.transition.cancel();\n }\n delete() {\n this.cancel();\n for (const buffer of this.buffers) {\n buffer.destroy();\n }\n this.buffers.length = 0;\n }\n}\n//# sourceMappingURL=gpu-transition.js.map","// deck.gl\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\nimport { BufferTransform } from '@luma.gl/engine';\nimport { fp64arithmetic } from '@luma.gl/shadertools';\nimport { GL } from '@luma.gl/constants';\nimport { getAttributeTypeFromSize, cycleBuffers, padBuffer, matchBuffer, getFloat32VertexFormat } from \"./gpu-transition-utils.js\";\nimport { GPUTransitionBase } from \"./gpu-transition.js\";\nexport default class GPUInterpolationTransition extends GPUTransitionBase {\n constructor({ device, attribute, timeline }) {\n super({ device, attribute, timeline });\n this.type = 'interpolation';\n this.transform = getTransform(device, attribute);\n }\n start(transitionSettings, numInstances) {\n const prevLength = this.currentLength;\n const prevStartIndices = this.currentStartIndices;\n super.start(transitionSettings, numInstances, transitionSettings.duration);\n if (transitionSettings.duration <= 0) {\n this.transition.cancel();\n return;\n }\n const { buffers, attribute } = this;\n // Alternate between two buffers when new transitions start.\n // Last destination buffer is used as an attribute (from state),\n // And the other buffer is now the current buffer.\n cycleBuffers(buffers);\n buffers[0] = padBuffer({\n device: this.device,\n buffer: buffers[0],\n attribute,\n fromLength: prevLength,\n toLength: this.currentLength,\n fromStartIndices: prevStartIndices,\n getData: transitionSettings.enter\n });\n buffers[1] = matchBuffer({\n device: this.device,\n source: buffers[0],\n target: buffers[1]\n });\n this.setBuffer(buffers[1]);\n const { transform } = this;\n const model = transform.model;\n let vertexCount = Math.floor(this.currentLength / attribute.size);\n if (useFp64(attribute)) {\n vertexCount /= 2;\n }\n model.setVertexCount(vertexCount);\n if (attribute.isConstant) {\n model.setAttributes({ aFrom: buffers[0] });\n model.setConstantAttributes({ aTo: attribute.value });\n }\n else {\n model.setAttributes({\n aFrom: buffers[0],\n aTo: attribute.getBuffer()\n });\n }\n transform.transformFeedback.setBuffers({ vCurrent: buffers[1] });\n }\n onUpdate() {\n const { duration, easing } = this.settings;\n const { time } = this.transition;\n let t = time / duration;\n if (easing) {\n t = easing(t);\n }\n const { model } = this.transform;\n const interpolationProps = { time: t };\n model.shaderInputs.setProps({ interpolation: interpolationProps });\n this.transform.run({ discard: true });\n }\n delete() {\n super.delete();\n this.transform.destroy();\n }\n}\nconst uniformBlock = `\\\nuniform interpolationUniforms {\n float time;\n} interpolation;\n`;\nconst interpolationUniforms = {\n name: 'interpolation',\n vs: uniformBlock,\n uniformTypes: {\n time: 'f32'\n }\n};\nconst vs = `\\\n#version 300 es\n#define SHADER_NAME interpolation-transition-vertex-shader\n\nin ATTRIBUTE_TYPE aFrom;\nin ATTRIBUTE_TYPE aTo;\nout ATTRIBUTE_TYPE vCurrent;\n\nvoid main(void) {\n vCurrent = mix(aFrom, aTo, interpolation.time);\n gl_Position = vec4(0.0);\n}\n`;\nconst vs64 = `\\\n#version 300 es\n#define SHADER_NAME interpolation-transition-vertex-shader\n\nin ATTRIBUTE_TYPE aFrom;\nin ATTRIBUTE_TYPE aFrom64Low;\nin ATTRIBUTE_TYPE aTo;\nin ATTRIBUTE_TYPE aTo64Low;\nout ATTRIBUTE_TYPE vCurrent;\nout ATTRIBUTE_TYPE vCurrent64Low;\n\nvec2 mix_fp64(vec2 a, vec2 b, float x) {\n vec2 range = sub_fp64(b, a);\n return sum_fp64(a, mul_fp64(range, vec2(x, 0.0)));\n}\n\nvoid main(void) {\n for (int i=0; i<ATTRIBUTE_SIZE; i++) {\n vec2 value = mix_fp64(vec2(aFrom[i], aFrom64Low[i]), vec2(aTo[i], aTo64Low[i]), interpolation.time);\n vCurrent[i] = value.x;\n vCurrent64Low[i] = value.y;\n }\n gl_Position = vec4(0.0);\n}\n`;\nfunction useFp64(attribute) {\n return attribute.doublePrecision && attribute.value instanceof Float64Array;\n}\nfunction getTransform(device, attribute) {\n const attributeSize = attribute.size;\n const attributeType = getAttributeTypeFromSize(attributeSize);\n const inputFormat = getFloat32VertexFormat(attributeSize);\n const bufferLayout = attribute.getBufferLayout();\n if (useFp64(attribute)) {\n return new BufferTransform(device, {\n vs: vs64,\n bufferLayout: [\n {\n name: 'aFrom',\n byteStride: 8 * attributeSize,\n attributes: [\n { attribute: 'aFrom', format: inputFormat, byteOffset: 0 },\n { attribute: 'aFrom64Low', format: inputFormat, byteOffset: 4 * attributeSize }\n ]\n },\n {\n name: 'aTo',\n byteStride: 8 * attributeSize,\n attributes: [\n { attribute: 'aTo', format: inputFormat, byteOffset: 0 },\n { attribute: 'aTo64Low', format: inputFormat, byteOffset: 4 * attributeSize }\n ]\n }\n ],\n // @ts-expect-error fp64 module only sets ONE uniform via defaultUniforms\n modules: [fp64arithmetic, interpolationUniforms],\n defines: {\n // @ts-expect-error TODO fix luma type\n ATTRIBUTE_TYPE: attributeType,\n // @ts-expect-error TODO fix luma type\n ATTRIBUTE_SIZE: attributeSize\n },\n // Default uniforms are not set without this\n moduleSettings: {},\n varyings: ['vCurrent', 'vCurrent64Low'],\n bufferMode: 35980,\n disableWarnings: true\n });\n }\n return new BufferTransform(device, {\n vs,\n bufferLayout: [\n { name: 'aFrom', format: inputFormat },\n { name: 'aTo', format: bufferLayout.attributes[0].format }\n ],\n modules: [interpolationUniforms],\n defines: {\n // @ts-expect-error TODO fix luma type\n ATTRIBUTE_TYPE: attributeType\n },\n varyings: ['vCurrent'],\n // TODO investigate why this is needed\n disableWarnings: true\n });\n}\n//# sourceMappingURL=gpu-interpolation-transition.js.map","// deck.gl\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\nimport { BufferTransform } from '@luma.gl/engine';\nimport { padBuffer, matchBuffer, getAttributeTypeFromSize, getFloat32VertexFormat, cycleBuffers } from \"./gpu-transition-utils.js\";\nimport { GPUTransitionBase } from \"./gpu-transition.js\";\nexport default class GPUSpringTransition extends GPUTransitionBase {\n constructor({ device, attribute, timeline }) {\n super({ device, attribute, timeline });\n this.type = 'spring';\n this.texture = getTexture(device);\n this.framebuffer = getFramebuffer(device, this.texture);\n this.transform = getTransform(device, attribute);\n }\n start(transitionSettings, numInstances) {\n const prevLength = this.currentLength;\n const prevStartIndices = this.currentStartIndices;\n super.start(transitionSettings, numInstances);\n const { buffers, attribute } = this;\n for (let i = 0; i < 2; i++) {\n buffers[i] = padBuffer({\n device: this.device,\n buffer: buffers[i],\n attribute,\n fromLength: prevLength,\n toLength: this.currentLength,\n fromStartIndices: prevStartIndices,\n getData: transitionSettings.enter\n });\n }\n buffers[2] = matchBuffer({\n device: this.device,\n source: buffers[0],\n target: buffers[2]\n });\n this.setBuffer(buffers[1]);\n const { model } = this.transform;\n model.setVertexCount(Math.floor(this.currentLength / attribute.size));\n if (attribute.isConstant) {\n model.setConstantAttributes({ aTo: attribute.value });\n }\n else {\n model.setAttributes({ aTo: attribute.getBuffer() });\n }\n }\n onUpdate() {\n const { buffers, transform, framebuffer, transition } = this;\n const settings = this.settings;\n transform.model.setAttributes({\n aPrev: buffers[0],\n aCur: buffers[1]\n });\n transform.transformFeedback.setBuffers({ vNext: buffers[2] });\n const springProps = {\n stiffness: settings.stiffness,\n damping: settings.damping\n };\n transform.model.shaderInputs.setProps({ spring: springProps });\n transform.run({\n framebuffer,\n discard: false,\n parameters: { viewport: [0, 0, 1, 1] },\n clearColor: [0, 0, 0, 0]\n });\n cycleBuffers(buffers);\n this.setBuffer(buffers[1]);\n const isTransitioning = this.device.readPixelsToArrayWebGL(framebuffer)[0] > 0;\n if (!isTransitioning) {\n transition.end();\n }\n }\n delete() {\n super.delete();\n this.transform.destroy();\n this.texture.destroy();\n this.framebuffer.destroy();\n }\n}\nconst uniformBlock = `\\\nuniform springUniforms {\n float damping;\n float stiffness;\n} spring;\n`;\nconst springUniforms = {\n name: 'spring',\n vs: uniformBlock,\n uniformTypes: {\n damping: 'f32',\n stiffness: 'f32'\n }\n};\nconst vs = `\\\n#version 300 es\n#define SHADER_NAME spring-transition-vertex-shader\n\n#define EPSILON 0.00001\n\nin ATTRIBUTE_TYPE aPrev;\nin ATTRIBUTE_TYPE aCur;\nin ATTRIBUTE_TYPE aTo;\nout ATTRIBUTE_TYPE vNext;\nout float vIsTransitioningFlag;\n\nATTRIBUTE_TYPE getNextValue(ATTRIBUTE_TYPE cur, ATTRIBUTE_TYPE prev, ATTRIBUTE_TYPE dest) {\n ATTRIBUTE_TYPE velocity = cur - prev;\n ATTRIBUTE_TYPE delta = dest - cur;\n ATTRIBUTE_TYPE force = delta * spring.stiffness;\n ATTRIBUTE_TYPE resistance = velocity * spring.damping;\n return force - resistance + velocity + cur;\n}\n\nvoid main(void) {\n bool isTransitioning = length(aCur - aPrev) > EPSILON || length(aTo - aCur) > EPSILON;\n vIsTransitioningFlag = isTransitioning ? 1.0 : 0.0;\n\n vNext = getNextValue(aCur, aPrev, aTo);\n gl_Position = vec4(0, 0, 0, 1);\n gl_PointSize = 100.0;\n}\n`;\nconst fs = `\\\n#version 300 es\n#define SHADER_NAME spring-transition-is-transitioning-fragment-shader\n\nin float vIsTransitioningFlag;\n\nout vec4 fragColor;\n\nvoid main(void) {\n if (vIsTransitioningFlag == 0.0) {\n discard;\n }\n fragColor = vec4(1.0);\n}`;\nfunction getTransform(device, attribute) {\n const attributeType = getAttributeTypeFromSize(attribute.size);\n const format = getFloat32VertexFormat(attribute.size);\n return new BufferTransform(device, {\n vs,\n fs,\n bufferLayout: [\n { name: 'aPrev', format },\n { name: 'aCur', format },\n { name: 'aTo', format: attribute.getBufferLayout().attributes[0].format }\n ],\n varyings: ['vNext'],\n modules: [springUniforms],\n // @ts-expect-error TODO fix luma type\n defines: { ATTRIBUTE_TYPE: attributeType },\n parameters: {\n depthCompare: 'always',\n blendColorOperation: 'max',\n blendColorSrcFactor: 'one',\n blendColorDstFactor: 'one',\n blendAlphaOperation: 'max',\n blendAlphaSrcFactor: 'one',\n blendAlphaDstFactor: 'one'\n }\n });\n}\nfunction getTexture(device) {\n return device.createTexture({\n data: new Uint8Array(4),\n format: 'rgba8unorm',\n width: 1,\n height: 1\n });\n}\nfunction getFramebuffer(device, texture) {\n return device.createFramebuffer({\n id: 'spring-transition-is-transitioning-framebuffer',\n width: 1,\n height: 1,\n colorAttachments: [texture]\n });\n}\n//# sourceMappingURL=gpu-spring-transition.js.map","// deck.gl\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\n// deck.gl, MIT license\nimport GPUInterpolationTransition from \"../../transitions/gpu-interpolation-transition.js\";\nimport GPUSpringTransition from \"../../transitions/gpu-spring-transition.js\";\nimport log from \"../../utils/log.js\";\nconst TRANSITION_TYPES = {\n interpolation: GPUInterpolationTransition,\n spring: GPUSpringTransition\n};\nexport default class AttributeTransitionManager {\n constructor(device, { id, timeline }) {\n if (!device)\n throw new Error('AttributeTransitionManager is constructed without device');\n this.id = id;\n this.device = device;\n this.timeline = timeline;\n this.transitions = {};\n this.needsRedraw = false;\n this.numInstances = 1;\n }\n finalize() {\n for (const attributeName in this.transitions) {\n this._removeTransition(attributeName);\n }\n }\n /* Public methods */\n // Called when attribute manager updates\n // Check the latest attributes for updates.\n update({ attributes, transitions, numInstances }) {\n // Transform class will crash if elementCount is 0\n this.numInstances = numInstances || 1;\n for (const attributeName in attributes) {\n const attribute = attributes[attributeName];\n const settings = attribute.getTransitionSetting(transitions);\n // this attribute might not support transitions?\n if (!settings)\n continue; // eslint-disable-line no-continue\n this._updateAttribute(attributeName, attribute, settings);\n }\n for (const attributeName in this.transitions) {\n const attribute = attributes[attributeName];\n if (!attribute || !attribute.getTransitionSetting(transitions)) {\n // Animated attribute has been removed\n this._removeTransition(attributeName);\n }\n }\n }\n // Returns `true` if attribute is transition-enabled\n hasAttribute(attributeName) {\n const transition = this.transitions[attributeName];\n return transition && transition.inProgress;\n }\n // Get all the animated attributes\n getAttributes() {\n const animatedAttributes = {};\n for (const attributeName in this.transitions) {\n const transition = this.transitions[attributeName];\n if (transition.inProgress) {\n animatedAttributes[attributeName] = transition.attributeInTransition;\n }\n }\n return animatedAttributes;\n }\n /* eslint-disable max-statements */\n // Called every render cycle, run transform feedback\n // Returns `true` if anything changes\n run() {\n if (this.numInstances === 0) {\n return false;\n }\n for (const attributeName in this.transitions) {\n const updated = this.transitions[attributeName].update();\n if (updated) {\n this.needsRedraw = true;\n }\n }\n const needsRedraw = this.needsRedraw;\n this.needsRedraw = false;\n return needsRedraw;\n }\n /* eslint-enable max-statements */\n /* Private methods */\n _removeTransition(attributeName) {\n this.transitions[attributeName].delete();\n delete this.transitions[attributeName];\n }\n // Check an attributes for updates\n // Returns a transition object if a new transition is triggered.\n _updateAttribute(attributeName, attribute, settings) {\n const transition = this.transitions[attributeName];\n // an attribute can change transition type when it updates\n // let's remove the transition when that happens so we can create the new transition type\n // TODO: when switching transition types, make sure to carry over the attribute's\n // previous buffers, currentLength, startIndices, etc, to be used as the starting point\n // for the next transition\n let isNew = !transition || transition.type !== settings.type;\n if (isNew) {\n if (transition) {\n this._removeTransition(attributeName);\n }\n const TransitionType = TRANSITION_TYPES[settings.type];\n if (TransitionType) {\n this.transitions[attributeName] = new TransitionType({\n attribute,\n timeline: this.timeline,\n device: this.device\n });\n }\n else {\n log.error(`unsupported transition type '${settings.type}'`)();\n isNew = false;\n }\n }\n if (isNew || attribute.needsRedraw()) {\n this.needsRedraw = true;\n this.transitions[attributeName].start(settings, this.numInstances);\n }\n }\n}\n//# sourceMappingURL=attribute-transition-manager.js.map","// deck.gl\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\n/* eslint-disable guard-for-in */\nimport Attribute from \"./attribute.js\";\nimport log from \"../../utils/log.js\";\nimport memoize from \"../../utils/memoize.js\";\nimport { mergeBounds } from \"../../utils/math-utils.js\";\nimport debug from \"../../debug/index.js\";\nimport AttributeTransitionManager from \"./attribute-transition-manager.js\";\nconst TRACE_INVALIDATE = 'attributeManager.invalidate';\nconst TRACE_UPDATE_START = 'attributeManager.updateStart';\nconst TRACE_UPDATE_END = 'attributeManager.updateEnd';\nconst TRACE_ATTRIBUTE_UPDATE_START = 'attribute.updateStart';\nconst TRACE_ATTRIBUTE_ALLOCATE = 'attribute.allocate';\nconst TRACE_ATTRIBUTE_UPDATE_END = 'attribute.updateEnd';\nexport default class AttributeManager {\n constructor(device, { id = 'attribute-manager', stats, timeline } = {}) {\n this.mergeBoundsMemoized = memoize(mergeBounds);\n this.id = id;\n this.device = device;\n this.attributes = {};\n this.updateTriggers = {};\n this.needsRedraw = true;\n this.userData = {};\n this.stats = stats;\n this.attributeTransitionManager = new AttributeTransitionManager(device, {\n id: `${id}-transitions`,\n timeline\n });\n // For debugging sanity, prevent uninitialized members\n Object.seal(this);\n }\n finalize() {\n for (const attributeName in this.attributes) {\n this.attributes[attributeName].delete();\n }\n this.attributeTransitionManager.finalize();\n }\n // Returns the redraw flag, optionally clearing it.\n // Redraw flag will be set if any attributes attributes changed since\n // flag was last cleared.\n //\n // @param {String} [clearRedrawFlags=false] - whether to clear the flag\n // @return {false|String} - reason a redraw is needed.\n getNeedsRedraw(opts = { clearRedrawFlags: false }) {\n const redraw = this.needsRedraw;\n this.needsRedraw = this.needsRedraw && !opts.clearRedrawFlags;\n return redraw && this.id;\n }\n // Sets the redraw flag.\n // @param {Boolean} redraw=true\n setNeedsRedraw() {\n this.needsRedraw = true;\n }\n // Adds attributes\n add(attributes) {\n this._add(attributes);\n }\n // Adds attributes\n addInstanced(attributes) {\n this._add(attributes, { stepMode: 'instance' });\n }\n /**\n * Removes attributes\n * Takes an array of attribute names and delete them from\n * the attribute map if they exists\n *\n * @example\n * attributeManager.remove(['position']);\n *\n * @param {Object} attributeNameArray - attribute name array (see above)\n */\n remove(attributeNameArray) {\n for (const name of attributeNameArray) {\n if (this.attributes[name] !== undefined) {\n this.attributes[name].delete();\n delete this.attributes[name];\n }\n }\n }\n // Marks an attribute for update\n invalidate(triggerName, dataRange) {\n const invalidatedAttributes = this._invalidateTrigger(triggerName, dataRange);\n // For performance tuning\n debug(TRACE_INVALIDATE, this, triggerName, invalidatedAttributes);\n }\n invalidateAll(dataRange) {\n for (const attributeName in this.attributes) {\n this.attributes[attributeName].setNeedsUpdate(attributeName, dataRange);\n }\n // For performance tuning\n debug(TRACE_INVALIDATE, this, 'all');\n }\n // Ensure all attribute buffers are updated from props or data.\n // eslint-disable-next-line complexity\n update({ data, numInstances, startIndices = null, transitions, props = {}, buffers = {}, context = {} }) {\n // keep track of whether some attributes are updated\n let updated = false;\n debug(TRACE_UPDATE_START, this);\n if (this.stats) {\n this.stats.get('Update Attributes').timeStart();\n }\n for (const attributeName in this.attributes) {\n const attribute = this.attributes[attributeName];\n const accessorName = attribute.settings.accessor;\n attribute.startIndices = startIndices;\n attribute.numInstances = numInstances;\n if (props[attributeName]) {\n log.removed(`props.${attributeName}`, `data.attributes.${attributeName}`)();\n }\n if (attribute.setExternalBuffer(buffers[attributeName])) {\n // Step 1: try update attribute directly from external buffers\n }\n else if (attribute.setBinaryValue(typeof accessorName === 'string' ? buffers[accessorName] : undefined, data.startIndices)) {\n // Step 2: try set packed value from external typed array\n }\n else if (typeof accessorName === 'string' &&\n !buffers[accessorName] &&\n attribute.setConstantValue(context, props[accessorName])) {\n // Step 3: try set constant value from props\n // Note: if buffers[accessorName] is supplied, ignore props[accessorName]\n // This may happen when setBinaryValue falls through to use the auto updater\n }\n else if (attribute.needsUpdate()) {\n // Step 4: update via updater callback\n updated = true;\n this._updateAttribute({\n attribute,\n numInstances,\n data,\n props,\n context\n });\n }\n this.needsRedraw = this.needsRedraw || attribute.needsRedraw();\n }\n if (updated) {\n // Only initiate alloc/update (and logging) if actually needed\n debug(TRACE_UPDATE_END, this, numInstances);\n }\n if (this.stats) {\n this.stats.get('Update Attributes').timeEnd();\n }\n this.attributeTransitionManager.update({\n attributes: this.attributes,\n numInstances,\n transitions\n });\n }\n // Update attribute transition to the current timestamp\n // Returns `true` if any transition is in progress\n updateTransition() {\n const { attributeTransitionManager } = this;\n const transitionUpdated = attributeTransitionManager.run();\n this.needsRedraw = this.needsRedraw || transitionUpdated;\n return transitionUpdated;\n }\n /**\n * Returns all attribute descriptors\n * Note: Format matches luma.gl Model/Program.setAttributes()\n * @return {Object} attributes - descriptors\n */\n getAttributes() {\n return { ...this.attributes, ...this.attributeTransitionManager.getAttributes() };\n }\n /**\n * Computes the spatial bounds of a given set of attributes\n */\n getBounds(attributeNames) {\n const bounds = attributeNames.map(attributeName => this.attributes[attributeName]?.getBounds());\n return this.mergeBoundsMemoized(bounds);\n }\n /**\n * Returns changed attribute descriptors\n * This indicates which WebGLBuffers need to be updated\n * @return {Object} attributes - descriptors\n */\n getChangedAttributes(opts = { clearChangedFlags: false }) {\n const { attributes, attributeTransitionManager } = this;\n const changedAttributes = { ...attributeTransitionManager.getAttributes() };\n for (const attributeName in attributes) {\n const attribute = attributes[attributeName];\n if (attribute.needsRedraw(opts) && !attributeTransitionManager.hasAttribute(attributeName)) {\n changedAttributes[attributeName] = attribute;\n }\n }\n return changedAttributes;\n }\n /** Generate WebGPU-style buffer layout descriptors from all attributes */\n getBufferLayouts(\n /** A luma.gl Model-shaped object that supplies additional hint to attribute resolution */\n modelInfo) {\n return Object.values(this.getAttributes()).map(attribute => attribute.getBufferLayout(modelInfo));\n }\n // PRIVATE METHODS\n /** Register new attributes */\n _add(\n /** A map from attribute name to attribute descriptors */\n attributes, \n /** Additional attribute settings to pass to all attributes */\n overrideOptions) {\n for (const attributeName in attributes) {\n const attribute = attributes[attributeName];\n const props = {\n ...attribute,\n id: attributeName,\n size: (attribute.isIndexed && 1) || attribute.size || 1,\n ...overrideOptions\n };\n // Initialize the attribute descriptor, with WebGL and metadata fields\n this.attributes[attributeName] = new Attribute(this.device, props);\n }\n this._mapUpdateTriggersToAttributes();\n }\n // build updateTrigger name to attribute name mapping\n _mapUpdateTriggersToAttributes() {\n const triggers = {};\n for (const attributeName in this.attributes) {\n const attribute = this.attributes[attributeName];\n attribute.getUpdateTriggers().forEach(triggerName => {\n if (!triggers[triggerName]) {\n triggers[triggerName] = [];\n }\n triggers[triggerName].push(attributeName);\n });\n }\n this.updateTriggers = triggers;\n }\n _invalidateTrigger(triggerName, dataRange) {\n const { attributes, updateTriggers } = this;\n const invalidatedAttributes = updateTriggers[triggerName];\n if (invalidatedAttributes) {\n invalidatedAttributes.forEach(name => {\n const attribute = attributes[name];\n if (attribute) {\n attribute.setNeedsUpdate(attribute.id, dataRange);\n }\n });\n }\n return invalidatedAttributes;\n }\n _updateAttribute(opts) {\n const { attribute, numInstances } = opts;\n debug(TRACE_ATTRIBUTE_UPDATE_START, attribute);\n if (attribute.constant) {\n // The attribute is flagged as constant outside of an update cycle\n // Skip allocation and updater call\n // @ts-ignore value can be set to an array by user but always cast to typed array during attribute update\n attribute.setConstantValue(opts.context, attribute.value);\n return;\n }\n if (attribute.allocate(numInstances)) {\n debug(TRACE_ATTRIBUTE_ALLOCATE, attribute, numInstances);\n }\n // Calls update on any buffers that need update\n const updated = attribute.updateBuffer(opts);\n if (updated) {\n this.needsRedraw = true;\n debug(TRACE_ATTRIBUTE_UPDATE_END, attribute, numInstances);\n }\n }\n}\n//# sourceMappingURL=attribute-manager.js.map","// deck.gl\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\nimport { lerp } from '@math.gl/core';\nimport Transition from \"./transition.js\";\nexport default class CPUInterpolationTransition extends Transition {\n get value() {\n return this._value;\n }\n _onUpdate() {\n const { time, settings: { fromValue, toValue, duration, easing } } = this;\n const t = easing(time / duration);\n this._value = lerp(fromValue, toValue, t);\n }\n}\n//# sourceMappingURL=cpu-interpolation-transition.js.map","// deck.gl\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\nimport Transition from \"./transition.js\";\nconst EPSILON = 1e-5;\n/*\n * Calculate the next value in the spring transition\n * @param prev {Number} - previous value\n * @param cur {Number} - current value\n * @param dest {Number} - destination value\n * @param damping {Number}\n * @param stiffness {Number}\n */\nfunction updateSpringElement(prev, cur, dest, damping, stiffness) {\n const velocity = cur - prev;\n const delta = dest - cur;\n const spring = delta * stiffness;\n const damper = -velocity * damping;\n return spring + damper + velocity + cur;\n}\nfunction updateSpring(prev, cur, dest, damping, stiffness) {\n if (Array.isArray(dest)) {\n const next = [];\n for (let i = 0; i < dest.length; i++) {\n next[i] = updateSpringElement(prev[i], cur[i], dest[i], damping, stiffness);\n }\n return next;\n }\n return updateSpringElement(prev, cur, dest, damping, stiffness);\n}\n/*\n * Calculate the distance between two numbers or two vectors\n */\nfunction distance(value1, value2) {\n if (Array.isArray(value1)) {\n let distanceSquare = 0;\n for (let i = 0; i < value1.length; i++) {\n const d = value1[i] - value2[i];\n distanceSquare += d * d;\n }\n return Math.sqrt(distanceSquare);\n }\n return Math.abs(value1 - value2);\n}\nexport default class CPUSpringTransition extends Transition {\n get value() {\n return this._currValue;\n }\n _onUpdate() {\n // TODO - use timeline\n // const {time} = this;\n const { fromValue, toValue, damping, stiffness } = this.settings;\n const { _prevValue = fromValue, _currValue = fromValue } = this;\n let nextValue = updateSpring(_prevValue, _currValue, toValue, damping, stiffness);\n const delta = distance(nextValue, toValue);\n const velocity = distance(nextValue, _currValue);\n if (delta < EPSILON && velocity < EPSILON) {\n nextValue = toValue;\n this.end();\n }\n this._prevValue = _currValue;\n this._currValue = nextValue;\n }\n}\n//# sourceMappingURL=cpu-spring-transition.js.map","// deck.gl\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\nimport { normalizeTransitionSettings } from \"./attribute/transition-settings.js\";\nimport CPUInterpolationTransition from \"../transitions/cpu-interpolation-transition.js\";\nimport CPUSpringTransition from \"../transitions/cpu-spring-transition.js\";\nimport log from \"../utils/log.js\";\nconst TRANSITION_TYPES = {\n interpolation: CPUInterpolationTransition,\n spring: CPUSpringTransition\n};\nexport default class UniformTransitionManager {\n constructor(timeline) {\n this.transitions = new Map();\n this.timeline = timeline;\n }\n get active() {\n return this.transitions.size > 0;\n }\n add(key, fromValue, toValue, settings) {\n const { transitions } = this;\n if (transitions.has(key)) {\n const transition = transitions.get(key);\n // value may not be available if `update()` has not been called. Fallback to `fromValue`\n const { value = transition.settings.fromValue } = transition;\n // start from interrupted position\n fromValue = value;\n this.remove(key);\n }\n settings = normalizeTransitionSettings(settings);\n if (!settings) {\n return;\n }\n const TransitionType = TRANSITION_TYPES[settings.type];\n if (!TransitionType) {\n log.error(`unsupported transition type '${settings.type}'`)();\n return;\n }\n const transition = new TransitionType(this.timeline);\n transition.start({\n ...settings,\n fromValue,\n toValue\n });\n transitions.set(key, transition);\n }\n remove(key) {\n const { transitions } = this;\n if (transitions.has(key)) {\n transitions.get(key).cancel();\n transitions.delete(key);\n }\n }\n update() {\n const propsInTransition = {};\n for (const [key, transition] of this.transitions) {\n transition.update();\n propsInTransition[key] = transition.value;\n if (!transition.inProgress) {\n // transition ended\n this.remove(key);\n }\n }\n return propsInTransition;\n }\n clear() {\n for (const key of this.transitions.keys()) {\n this.remove(key);\n }\n }\n}\n//# sourceMappingURL=uniform-transition-manager.js.map","// deck.gl\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\nimport { PROP_TYPES_SYMBOL } from \"./constants.js\";\nexport function validateProps(props) {\n const propTypes = props[PROP_TYPES_SYMBOL];\n for (const propName in propTypes) {\n const propType = propTypes[propName];\n const { validate } = propType;\n if (validate && !validate(props[propName], propType)) {\n throw new Error(`Invalid prop ${propName}: ${props[propName]}`);\n }\n }\n}\n// Returns an object with \"change flags\", either false or strings indicating reason for change\nexport function diffProps(props, oldProps) {\n // First check if any props have changed (ignore props that will be examined separately)\n const propsChangedReason = compareProps({\n newProps: props,\n oldProps,\n propTypes: props[PROP_TYPES_SYMBOL],\n ignoreProps: { data: null, updateTriggers: null, extensions: null, transitions: null }\n });\n // Now check if any data related props have changed\n const dataChangedReason = diffDataProps(props, oldProps);\n // Check update triggers to determine if any attributes need regeneration\n // Note - if data has changed, all attributes will need regeneration, so skip this step\n let updateTriggersChangedReason = false;\n if (!dataChangedReason) {\n updateTriggersChangedReason = diffUpdateTriggers(props, oldProps);\n }\n return {\n dataChanged: dataChangedReason,\n propsChanged: propsChangedReason,\n updateTriggersChanged: updateTriggersChangedReason,\n extensionsChanged: diffExtensions(props, oldProps),\n transitionsChanged: diffTransitions(props, oldProps)\n };\n}\nfunction diffTransitions(props, oldProps) {\n if (!props.transitions) {\n return false;\n }\n const result = {};\n const propTypes = props[PROP_TYPES_SYMBOL];\n let changed = false;\n for (const key in props.transitions) {\n const propType = propTypes[key];\n const type = propType && propType.type;\n const isTransitionable = type === 'number' || type === 'color' || type === 'array';\n if (isTransitionable && comparePropValues(props[key], oldProps[key], propType)) {\n result[key] = true;\n changed = true;\n }\n }\n return changed ? result : false;\n}\n/**\n * Performs equality by iterating through keys on an object and returning false\n * when any key has values which are not strictly equal between the arguments.\n * @param {Object} opt.oldProps - object with old key/value pairs\n * @param {Object} opt.newProps - object with new key/value pairs\n * @param {Object} opt.ignoreProps={} - object, keys that should not be compared\n * @returns {null|String} - null when values of all keys are strictly equal.\n * if unequal, returns a string explaining what changed.\n */\n/* eslint-disable max-statements, max-depth, complexity */\n/*\n * Note: for better performance, this function assumes that both oldProps and newProps\n inherit the same prototype (defaultProps). That is, if neither object contains own\n property <key>, assume `oldProps.<key>` and `newProps.<key>` are equal.\n */\nexport function compareProps({ newProps, oldProps, ignoreProps = {}, propTypes = {}, triggerName = 'props' }) {\n // shallow equality => deep equality\n if (oldProps === newProps) {\n return false;\n }\n // TODO - do we need these checks? Should never happen...\n if (typeof newProps !== 'object' || newProps === null) {\n return `${triggerName} changed shallowly`;\n }\n if (typeof oldProps !== 'object' || oldProps === null) {\n return `${triggerName} changed shallowly`;\n }\n // Compare explicitly defined new props against old/default values\n for (const key of Object.keys(newProps)) {\n if (!(key in ignoreProps)) {\n if (!(key in oldProps)) {\n return `${triggerName}.${key} added`;\n }\n const changed = comparePropValues(newProps[key], oldProps[key], propTypes[key]);\n if (changed) {\n return `${triggerName}.${key} ${changed}`;\n }\n }\n }\n // Test if any old props have been dropped\n for (const key of Object.keys(oldProps)) {\n if (!(key in ignoreProps)) {\n if (!(key in newProps)) {\n return `${triggerName}.${key} dropped`;\n }\n if (!Object.hasOwnProperty.call(newProps, key)) {\n // Compare dropped old prop against default value\n const changed = comparePropValues(newProps[key], oldProps[key], propTypes[key]);\n if (changed) {\n return `${triggerName}.${key} ${changed}`;\n }\n }\n }\n }\n return false;\n}\n/* eslint-enable max-statements, max-depth, complexity */\n// HELPERS\nfunction comparePropValues(newProp, oldProp, propType) {\n // If prop type has an equal function, invoke it\n let equal = propType && propType.equal;\n if (equal && !equal(newProp, oldProp, propType)) {\n return 'changed deeply';\n }\n if (!equal) {\n // If object has an equals function, invoke it\n equal = newProp && oldProp && newProp.equals;\n if (equal && !equal.call(newProp, oldProp)) {\n return 'changed deeply';\n }\n }\n if (!equal && oldProp !== newProp) {\n return 'changed shallowly';\n }\n return null;\n}\n// The comparison of the data prop requires special handling\n// the dataComparator should be used if supplied\nfunction diffDataProps(props, oldProps) {\n if (oldProps === null) {\n return 'oldProps is null, initial diff';\n }\n let dataChanged = false;\n // Support optional app defined comparison of data\n const { dataComparator, _dataDiff } = props;\n if (dataComparator) {\n if (!dataComparator(props.data, oldProps.data)) {\n dataChanged = 'Data comparator detected a change';\n }\n // Otherwise, do a shallow equal on props\n }\n else if (props.data !== oldProps.data) {\n dataChanged = 'A new data container was supplied';\n }\n if (dataChanged && _dataDiff) {\n dataChanged = _dataDiff(props.data, oldProps.data) || dataChanged;\n }\n return dataChanged;\n}\n// Checks if any update triggers have changed\n// also calls callback to invalidate attributes accordingly.\nfunction diffUpdateTriggers(props, oldProps) {\n if (oldProps === null) {\n return { all: true };\n }\n // If the 'all' updateTrigger fires, ignore testing others\n if ('all' in props.updateTriggers) {\n const diffReason = diffUpdateTrigger(props, oldProps, 'all');\n if (diffReason) {\n return { all: true };\n }\n }\n const reason = {};\n let changed = false;\n // If the 'all' updateTrigger didn't fire, need to check all others\n for (const triggerName in props.updateTriggers) {\n if (triggerName !== 'all') {\n const diffReason = diffUpdateTrigger(props, oldProps, triggerName);\n if (diffReason) {\n reason[triggerName] = true;\n changed = true;\n }\n }\n }\n return changed ? reason : false;\n}\n// Returns true if any extensions have changed\nfunction diffExtensions(props, oldProps) {\n if (oldProps === null) {\n return true;\n }\n const oldExtensions = oldProps.extensions;\n const { extensions } = props;\n if (extensions === oldExtensions) {\n return false;\n }\n if (!oldExtensions || !extensions) {\n return true;\n }\n if (extensions.length !== oldExtensions.length) {\n return true;\n }\n for (let i = 0; i < extensions.length; i++) {\n if (!extensions[i].equals(oldExtensions[i])) {\n return true;\n }\n }\n return false;\n}\nfunction diffUpdateTrigger(props, oldProps, triggerName) {\n let newTriggers = props.updateTriggers[triggerName];\n newTriggers = newTriggers === undefined || newTriggers === null ? {} : newTriggers;\n let oldTriggers = oldProps.updateTriggers[triggerName];\n oldTriggers = oldTriggers === undefined || oldTriggers === null ? {} : oldTriggers;\n const diffReason = compareProps({\n oldProps: oldTriggers,\n newProps: newTriggers,\n triggerName\n });\n return diffReason;\n}\n//# sourceMappingURL=props.js.map","// deck.gl\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\nconst ERR_NOT_OBJECT = 'count(): argument not an object';\nconst ERR_NOT_CONTAINER = 'count(): argument not a container';\n/**\n * Deduces numer of elements in a JavaScript container.\n * - Auto-deduction for ES6 containers that define a count() method\n * - Auto-deduction for ES6 containers that define a size member\n * - Auto-deduction for Classic Arrays via the built-in length attribute\n * - Also handles objects, although note that this an O(N) operation\n */\nexport function count(container) {\n if (!isObject(container)) {\n throw new Error(ERR_NOT_OBJECT);\n }\n // Check if ES6 collection \"count\" function is available\n if (typeof container.count === 'function') {\n return container.count();\n }\n // Check if ES6 collection \"size\" attribute is set\n if (Number.isFinite(container.size)) {\n return container.size;\n }\n // Check if array length attribute is set\n // Note: checking this last since some ES6 collections (Immutable.js)\n // emit profuse warnings when trying to access `length` attribute\n if (Number.isFinite(container.length)) {\n return container.length;\n }\n // Note that getting the count of an object is O(N)\n if (isPlainObject(container)) {\n return Object.keys(container).length;\n }\n throw new Error(ERR_NOT_CONTAINER);\n}\n/**\n * Checks if argument is a plain object (not a class or array etc)\n * @param {*} value - JavaScript value to be tested\n * @return {Boolean} - true if argument is a plain JavaScript object\n */\nfunction isPlainObject(value) {\n return value !== null && typeof value === 'object' && value.constructor === Object;\n}\n/**\n * Checks if argument is an indexable object (not a primitive value, nor null)\n * @param {*} value - JavaScript value to be tested\n * @return {Boolean} - true if argument is a JavaScript object\n */\nfunction isObject(value) {\n return value !== null && typeof value === 'object';\n}\n//# sourceMappingURL=count.js.map","// deck.gl\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\nimport { Texture } from '@luma.gl/core';\nconst DEFAULT_TEXTURE_PARAMETERS = {\n minFilter: 'linear',\n mipmapFilter: 'linear',\n magFilter: 'linear',\n addressModeU: 'clamp-to-edge',\n addressModeV: 'clamp-to-edge'\n};\n// Track the textures that are created by us. They need to be released when they are no longer used.\nconst internalTextures = {};\n/**\n *\n * @param owner\n * @param device\n * @param image could be one of:\n * - Texture\n * - Browser object: Image, ImageData, ImageData, HTMLCanvasElement, HTMLVideoElement, ImageBitmap\n * - Plain object: {width: <number>, height: <number>, data: <Uint8Array>}\n * @param parameters\n * @returns\n */\nexport function createTexture(owner, device, image, sampler) {\n if (image instanceof Texture) {\n return image;\n }\n else if (image.constructor && image.constructor.name !== 'Object') {\n // Browser object\n image = { data: image };\n }\n let samplerParameters = null;\n if (image.compressed) {\n samplerParameters = {\n minFilter: 'linear',\n mipmapFilter: image.data.length > 1 ? 'nearest' : 'linear'\n };\n }\n const { width, height } = image.data;\n const texture = device.createTexture({\n ...image,\n sampler: {\n ...DEFAULT_TEXTURE_PARAMETERS,\n ...samplerParameters,\n ...sampler\n },\n mipLevels: device.getMipLevelCount(width, height)\n });\n texture.generateMipmapsWebGL();\n // Track this texture\n internalTextures[texture.id] = owner;\n return texture;\n}\nexport function destroyTexture(owner, texture) {\n if (!texture || !(texture instanceof Texture)) {\n return;\n }\n // Only delete the texture if requested by the same layer that created it\n if (internalTextures[texture.id] === owner) {\n texture.delete();\n delete internalTextures[texture.id];\n }\n}\n//# sourceMappingURL=texture.js.map","// deck.gl\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\nimport { createTexture, destroyTexture } from \"../utils/texture.js\";\nimport { deepEqual } from \"../utils/deep-equal.js\";\nconst TYPE_DEFINITIONS = {\n boolean: {\n validate(value, propType) {\n return true;\n },\n equal(value1, value2, propType) {\n return Boolean(value1) === Boolean(value2);\n }\n },\n number: {\n validate(value, propType) {\n return (Number.isFinite(value) &&\n (!('max' in propType) || value <= propType.max) &&\n (!('min' in propType) || value >= propType.min));\n }\n },\n color: {\n validate(value, propType) {\n return ((propType.optional && !value) ||\n (isArray(value) && (value.length === 3 || value.length === 4)));\n },\n equal(value1, value2, propType) {\n return deepEqual(value1, value2, 1);\n }\n },\n accessor: {\n validate(value, propType) {\n const valueType = getTypeOf(value);\n return valueType === 'function' || valueType === getTypeOf(propType.value);\n },\n equal(value1, value2, propType) {\n if (typeof value2 === 'function') {\n return true;\n }\n return deepEqual(value1, value2, 1);\n }\n },\n array: {\n validate(value, propType) {\n return (propType.optional && !value) || isArray(value);\n },\n equal(value1, value2, propType) {\n const { compare } = propType;\n const depth = Number.isInteger(compare) ? compare : compare ? 1 : 0;\n return compare ? deepEqual(value1, value2, depth) : value1 === value2;\n }\n },\n object: {\n equal(value1, value2, propType) {\n if (propType.ignore) {\n return true;\n }\n const { compare } = propType;\n const depth = Number.isInteger(compare) ? compare : compare ? 1 : 0;\n return compare ? deepEqual(value1, value2, depth) : value1 === value2;\n }\n },\n function: {\n validate(value, propType) {\n return (propType.optional && !value) || typeof value === 'function';\n },\n equal(value1, value2, propType) {\n // Backward compatibility - {compare: true} and {ignore: false} are equivalent\n const shouldIgnore = !propType.compare && propType.ignore !== false;\n return shouldIgnore || value1 === value2;\n }\n },\n data: {\n transform: (value, propType, component) => {\n if (!value) {\n return value;\n }\n const { dataTransform } = component.props;\n if (dataTransform) {\n return dataTransform(value);\n }\n // Detect loaders.gl v4 table format\n if (typeof value.shape === 'string' &&\n value.shape.endsWith('-table') &&\n Array.isArray(value.data)) {\n return value.data;\n }\n return value;\n }\n },\n image: {\n transform: (value, propType, component) => {\n const context = component.context;\n if (!context || !context.device) {\n return null;\n }\n return createTexture(component.id, context.device, value, {\n ...propType.parameters,\n ...component.props.textureParameters\n });\n },\n release: (value, propType, component) => {\n destroyTexture(component.id, value);\n }\n }\n};\nexport function parsePropTypes(propDefs) {\n const propTypes = {};\n const defaultProps = {};\n const deprecatedProps = {};\n for (const [propName, propDef] of Object.entries(propDefs)) {\n const deprecated = propDef?.deprecatedFor;\n if (deprecated) {\n deprecatedProps[propName] = Array.isArray(deprecated) ? deprecated : [deprecated];\n }\n else {\n const propType = parsePropType(propName, propDef);\n propTypes[propName] = propType;\n defaultProps[propName] = propType.value;\n }\n }\n return { propTypes, defaultProps, deprecatedProps };\n}\n// Parses one property definition entry. Either contains:\n// * a valid prop type object ({type, ...})\n// * or just a default value, in which case type and name inference is used\nfunction parsePropType(name, propDef) {\n switch (getTypeOf(propDef)) {\n case 'object':\n return normalizePropDefinition(name, propDef);\n case 'array':\n return normalizePropDefinition(name, { type: 'array', value: propDef, compare: false });\n case 'boolean':\n return normalizePropDefinition(name, { type: 'boolean', value: propDef });\n case 'number':\n return normalizePropDefinition(name, { type: 'number', value: propDef });\n case 'function':\n // return guessFunctionType(name, propDef);\n return normalizePropDefinition(name, { type: 'function', value: propDef, compare: true });\n default:\n return { name, type: 'unknown', value: propDef };\n }\n}\nfunction normalizePropDefinition(name, propDef) {\n if (!('type' in propDef)) {\n if (!('value' in propDef)) {\n // If no type and value this object is likely the value\n return { name, type: 'object', value: propDef };\n }\n return { name, type: getTypeOf(propDef.value), ...propDef };\n }\n return { name, ...TYPE_DEFINITIONS[propDef.type], ...propDef };\n}\nfunction isArray(value) {\n return Array.isArray(value) || ArrayBuffer.isView(value);\n}\n// improved version of javascript typeof that can distinguish arrays and null values\nfunction getTypeOf(value) {\n if (isArray(value)) {\n return 'array';\n }\n if (value === null) {\n return 'null';\n }\n return typeof value;\n}\n//# sourceMappingURL=prop-types.js.map","// deck.gl\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\nimport log from \"../utils/log.js\";\nimport { isAsyncIterable } from \"../utils/iterable-utils.js\";\nimport { parsePropTypes } from \"./prop-types.js\";\nimport { COMPONENT_SYMBOL, PROP_TYPES_SYMBOL, DEPRECATED_PROPS_SYMBOL, ASYNC_ORIGINAL_SYMBOL, ASYNC_RESOLVED_SYMBOL, ASYNC_DEFAULTS_SYMBOL } from \"./constants.js\";\nimport Component from \"./component.js\";\n// Create a property object\nexport function createProps(component, propObjects) {\n // Resolve extension value\n let extensions;\n for (let i = propObjects.length - 1; i >= 0; i--) {\n const props = propObjects[i];\n if ('extensions' in props) {\n // @ts-expect-error TS(2339) extensions not defined\n extensions = props.extensions;\n }\n }\n // Create a new prop object with empty default props object\n const propsPrototype = getPropsPrototype(component.constructor, extensions);\n // The true default props object will be found later\n const propsInstance = Object.create(propsPrototype);\n // Props need a back pointer to the owning component\n propsInstance[COMPONENT_SYMBOL] = component;\n // The supplied (original) values for those async props that are set to url strings or Promises.\n // In this case, the actual (i.e. resolved) values are looked up from component.internalState\n propsInstance[ASYNC_ORIGINAL_SYMBOL] = {};\n // Note: the actual (resolved) values for props that are NOT set to urls or Promises.\n // in this case the values are served directly from this map\n propsInstance[ASYNC_RESOLVED_SYMBOL] = {};\n // \"Copy\" all sync props\n for (let i = 0; i < propObjects.length; ++i) {\n const props = propObjects[i];\n // Do not use Object.assign here to avoid Symbols in props overwriting our private fields\n // This might happen if one of the arguments is another props instance\n for (const key in props) {\n propsInstance[key] = props[key];\n }\n }\n // Props must be immutable\n Object.freeze(propsInstance);\n return propsInstance;\n}\nconst MergedDefaultPropsCacheKey = '_mergedDefaultProps';\n// Return precalculated defaultProps and propType objects if available\n// build them if needed\nfunction getPropsPrototype(componentClass, extensions) {\n // Bail out if we're not looking at a component - for two reasons:\n // 1. There's no reason for an ancestor of component to have props\n // 2. If we don't bail out, we'll follow the prototype chain all the way back to the global\n // function prototype and add _mergedDefaultProps to it, which may break other frameworks\n // (e.g. the react-three-fiber reconciler)\n if (!(componentClass instanceof Component.constructor))\n return {};\n // A string that uniquely identifies the extensions involved\n let cacheKey = MergedDefaultPropsCacheKey;\n if (extensions) {\n for (const extension of extensions) {\n const ExtensionClass = extension.constructor;\n if (ExtensionClass) {\n cacheKey += `:${ExtensionClass.extensionName || ExtensionClass.name}`;\n }\n }\n }\n const defaultProps = getOwnProperty(componentClass, cacheKey);\n if (!defaultProps) {\n return (componentClass[cacheKey] = createPropsPrototypeAndTypes(componentClass, extensions || []));\n }\n return defaultProps;\n}\n// Build defaultProps and propType objects by walking component prototype chain\nfunction createPropsPrototypeAndTypes(componentClass, extensions) {\n const parent = componentClass.prototype;\n if (!parent) {\n return null;\n }\n const parentClass = Object.getPrototypeOf(componentClass);\n const parentDefaultProps = getPropsPrototype(parentClass);\n // Parse propTypes from Component.defaultProps\n const componentDefaultProps = getOwnProperty(componentClass, 'defaultProps') || {};\n const componentPropDefs = parsePropTypes(componentDefaultProps);\n // Merged default props object. Order: parent, self, extensions\n const defaultProps = Object.assign(Object.create(null), parentDefaultProps, componentPropDefs.defaultProps);\n // Merged prop type definitions. Order: parent, self, extensions\n const propTypes = Object.assign(Object.create(null), parentDefaultProps?.[PROP_TYPES_SYMBOL], componentPropDefs.propTypes);\n // Merged deprecation list. Order: parent, self, extensions\n const deprecatedProps = Object.assign(Object.create(null), parentDefaultProps?.[DEPRECATED_PROPS_SYMBOL], componentPropDefs.deprecatedProps);\n for (const extension of extensions) {\n const extensionDefaultProps = getPropsPrototype(extension.constructor);\n if (extensionDefaultProps) {\n Object.assign(defaultProps, extensionDefaultProps);\n Object.assign(propTypes, extensionDefaultProps[PROP_TYPES_SYMBOL]);\n Object.assign(deprecatedProps, extensionDefaultProps[DEPRECATED_PROPS_SYMBOL]);\n }\n }\n // Create any necessary property descriptors and create the default prop object\n // Assign merged default props\n createPropsPrototype(defaultProps, componentClass);\n // Add getters/setters for async props\n addAsyncPropsToPropPrototype(defaultProps, propTypes);\n // Add setters for deprecated props\n addDeprecatedPropsToPropPrototype(defaultProps, deprecatedProps);\n // Store the precalculated props\n defaultProps[PROP_TYPES_SYMBOL] = propTypes;\n defaultProps[DEPRECATED_PROPS_SYMBOL] = deprecatedProps;\n // Backwards compatibility\n // TODO: remove access of hidden property from the rest of the code base\n if (extensions.length === 0 && !hasOwnProperty(componentClass, '_propTypes')) {\n componentClass._propTypes = propTypes;\n }\n return defaultProps;\n}\n// Builds a pre-merged default props object that component props can inherit from\nfunction createPropsPrototype(defaultProps, componentClass) {\n // Avoid freezing `id` prop\n const id = getComponentName(componentClass);\n Object.defineProperties(defaultProps, {\n // `id` is treated specially because layer might need to override it\n id: {\n writable: true,\n value: id\n }\n });\n}\nfunction addDeprecatedPropsToPropPrototype(defaultProps, deprecatedProps) {\n for (const propName in deprecatedProps) {\n /* eslint-disable accessor-pairs */\n Object.defineProperty(defaultProps, propName, {\n enumerable: false,\n set(newValue) {\n const nameStr = `${this.id}: ${propName}`;\n for (const newPropName of deprecatedProps[propName]) {\n if (!hasOwnProperty(this, newPropName)) {\n this[newPropName] = newValue;\n }\n }\n log.deprecated(nameStr, deprecatedProps[propName].join('/'))();\n }\n });\n /* eslint-enable accessor-pairs */\n }\n}\n// Create descriptors for overridable props\nfunction addAsyncPropsToPropPrototype(defaultProps, propTypes) {\n const defaultValues = {};\n const descriptors = {};\n // Move async props into shadow values\n for (const propName in propTypes) {\n const propType = propTypes[propName];\n const { name, value } = propType;\n // Note: async is ES7 keyword, can't destructure\n if (propType.async) {\n defaultValues[name] = value;\n descriptors[name] = getDescriptorForAsyncProp(name);\n }\n }\n // Default \"resolved\" values for async props, returned if value not yet resolved/set.\n defaultProps[ASYNC_DEFAULTS_SYMBOL] = defaultValues;\n // Shadowed object, just to make sure \"early indexing\" into the instance does not fail\n defaultProps[ASYNC_ORIGINAL_SYMBOL] = {};\n Object.defineProperties(defaultProps, descriptors);\n}\n// Helper: Configures getter and setter for one async prop\nfunction getDescriptorForAsyncProp(name) {\n return {\n enumerable: true,\n // Save the provided value for async props in a special map\n set(newValue) {\n if (typeof newValue === 'string' ||\n newValue instanceof Promise ||\n isAsyncIterable(newValue)) {\n this[ASYNC_ORIGINAL_SYMBOL][name] = newValue;\n }\n else {\n this[ASYNC_RESOLVED_SYMBOL][name] = newValue;\n }\n },\n // Only the component's state knows the true value of async prop\n get() {\n if (this[ASYNC_RESOLVED_SYMBOL]) {\n // Prop value isn't async, so just return it\n if (name in this[ASYNC_RESOLVED_SYMBOL]) {\n const value = this[ASYNC_RESOLVED_SYMBOL][name];\n return value || this[ASYNC_DEFAULTS_SYMBOL][name];\n }\n if (name in this[ASYNC_ORIGINAL_SYMBOL]) {\n // It's an async prop value: look into component state\n const state = this[COMPONENT_SYMBOL] && this[COMPONENT_SYMBOL].internalState;\n if (state && state.hasAsyncProp(name)) {\n return state.getAsyncProp(name) || this[ASYNC_DEFAULTS_SYMBOL][name];\n }\n }\n }\n // the prop is not supplied, or\n // component not yet initialized/matched, return the component's default value for the prop\n return this[ASYNC_DEFAULTS_SYMBOL][name];\n }\n };\n}\n// HELPER METHODS\nfunction hasOwnProperty(object, prop) {\n return Object.prototype.hasOwnProperty.call(object, prop);\n}\n// Constructors have their super class constructors as prototypes\nfunction getOwnProperty(object, prop) {\n return hasOwnProperty(object, prop) && object[prop];\n}\nfunction getComponentName(componentClass) {\n const componentName = componentClass.componentName;\n if (!componentName) {\n log.warn(`${componentClass.name}.componentName not specified`)();\n }\n return componentName || componentClass.name;\n}\n//# sourceMappingURL=create-props.js.map","// deck.gl\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\nimport { COMPONENT_SYMBOL, PROP_TYPES_SYMBOL, ASYNC_ORIGINAL_SYMBOL, ASYNC_RESOLVED_SYMBOL, ASYNC_DEFAULTS_SYMBOL } from \"./constants.js\";\nimport { createProps } from \"./create-props.js\";\nlet counter = 0;\nclass Component {\n constructor(...propObjects) {\n // Merge supplied props with default props and freeze them.\n /* eslint-disable prefer-spread */\n this.props = createProps(this, propObjects);\n /* eslint-enable prefer-spread */\n this.id = this.props.id; // The layer's id, used for matching with layers from last render cycle\n this.count = counter++; // Keep track of how many layer instances you are generating\n }\n // clone this layer with modified props\n clone(newProps) {\n const { props } = this;\n // Async props cannot be copied with Object.assign, copy them separately\n const asyncProps = {};\n // See async props definition in create-props.js\n for (const key in props[ASYNC_DEFAULTS_SYMBOL]) {\n if (key in props[ASYNC_RESOLVED_SYMBOL]) {\n asyncProps[key] = props[ASYNC_RESOLVED_SYMBOL][key];\n }\n else if (key in props[ASYNC_ORIGINAL_SYMBOL]) {\n asyncProps[key] = props[ASYNC_ORIGINAL_SYMBOL][key];\n }\n }\n // Some custom layer implementation may not support multiple arguments in the constructor\n // @ts-ignore\n return new this.constructor({ ...props, ...asyncProps, ...newProps });\n }\n}\nComponent.componentName = 'Component';\nComponent.defaultProps = {};\nexport default Component;\n//# sourceMappingURL=component.js.map","// deck.gl\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\nimport { isAsyncIterable } from \"../utils/iterable-utils.js\";\nimport { COMPONENT_SYMBOL, PROP_TYPES_SYMBOL, ASYNC_ORIGINAL_SYMBOL, ASYNC_RESOLVED_SYMBOL, ASYNC_DEFAULTS_SYMBOL } from \"./constants.js\";\nconst EMPTY_PROPS = Object.freeze({});\nexport default class ComponentState {\n constructor(component) {\n this.component = component;\n this.asyncProps = {}; // Prop values that the layer sees\n this.onAsyncPropUpdated = () => { };\n this.oldProps = null; // Last props before update\n this.oldAsyncProps = null; // Last props before update, with async values copied.\n }\n finalize() {\n for (const propName in this.asyncProps) {\n const asyncProp = this.asyncProps[propName];\n if (asyncProp && asyncProp.type && asyncProp.type.release) {\n // Release any resources created by transforms\n asyncProp.type.release(asyncProp.resolvedValue, asyncProp.type, this.component);\n }\n }\n this.asyncProps = {};\n this.component = null;\n this.resetOldProps();\n }\n /* Layer-facing props API */\n getOldProps() {\n return this.oldAsyncProps || this.oldProps || EMPTY_PROPS;\n }\n resetOldProps() {\n this.oldAsyncProps = null;\n this.oldProps = this.component ? this.component.props : null;\n }\n // Checks if a prop is overridden\n hasAsyncProp(propName) {\n return propName in this.asyncProps;\n }\n // Returns value of an overriden prop\n getAsyncProp(propName) {\n const asyncProp = this.asyncProps[propName];\n return asyncProp && asyncProp.resolvedValue;\n }\n isAsyncPropLoading(propName) {\n if (propName) {\n const asyncProp = this.asyncProps[propName];\n return Boolean(asyncProp &&\n asyncProp.pendingLoadCount > 0 &&\n asyncProp.pendingLoadCount !== asyncProp.resolvedLoadCount);\n }\n for (const key in this.asyncProps) {\n if (this.isAsyncPropLoading(key)) {\n return true;\n }\n }\n return false;\n }\n // Without changing the original prop value, swap out the data resolution under the hood\n reloadAsyncProp(propName, value) {\n this._watchPromise(propName, Promise.resolve(value));\n }\n // Updates all async/overridden props (when new props come in)\n // Checks if urls have changed, starts loading, or removes override\n setAsyncProps(props) {\n this.component = props[COMPONENT_SYMBOL] || this.component;\n // NOTE: prop param and default values are only support for testing\n const resolvedValues = props[ASYNC_RESOLVED_SYMBOL] || {};\n const originalValues = props[ASYNC_ORIGINAL_SYMBOL] || props;\n const defaultValues = props[ASYNC_DEFAULTS_SYMBOL] || {};\n // TODO - use async props from the layer's prop types\n for (const propName in resolvedValues) {\n const value = resolvedValues[propName];\n this._createAsyncPropData(propName, defaultValues[propName]);\n this._updateAsyncProp(propName, value);\n // Use transformed value\n resolvedValues[propName] = this.getAsyncProp(propName);\n }\n for (const propName in originalValues) {\n const value = originalValues[propName];\n // Makes sure a record exists for this prop\n this._createAsyncPropData(propName, defaultValues[propName]);\n this._updateAsyncProp(propName, value);\n }\n }\n /* Placeholder methods for subclassing */\n _fetch(propName, url) {\n return null;\n }\n _onResolve(propName, value) { } // eslint-disable-line @typescript-eslint/no-empty-function\n _onError(propName, error) { } // eslint-disable-line @typescript-eslint/no-empty-function\n // Intercept strings (URLs) and Promises and activates loading and prop rewriting\n _updateAsyncProp(propName, value) {\n if (!this._didAsyncInputValueChange(propName, value)) {\n return;\n }\n // interpret value string as url and start a new load tracked by a promise\n if (typeof value === 'string') {\n value = this._fetch(propName, value);\n }\n // interprets promise and track the \"loading\"\n if (value instanceof Promise) {\n this._watchPromise(propName, value);\n return;\n }\n if (isAsyncIterable(value)) {\n this._resolveAsyncIterable(propName, value); // eslint-disable-line @typescript-eslint/no-floating-promises\n return;\n }\n // else, normal, non-async value. Just store value for now\n this._setPropValue(propName, value);\n }\n // Whenever async props are changing, we need to make a copy of oldProps\n // otherwise the prop rewriting will affect the value both in props and oldProps.\n // While the copy is relatively expensive, this only happens on load completion.\n _freezeAsyncOldProps() {\n if (!this.oldAsyncProps && this.oldProps) {\n // 1. inherit all synchronous props from oldProps\n // 2. reconfigure the async prop descriptors to fixed values\n this.oldAsyncProps = Object.create(this.oldProps);\n for (const propName in this.asyncProps) {\n Object.defineProperty(this.oldAsyncProps, propName, {\n enumerable: true,\n value: this.oldProps[propName]\n });\n }\n }\n }\n // Checks if an input value actually changed (to avoid reloading/rewatching promises/urls)\n _didAsyncInputValueChange(propName, value) {\n // @ts-ignore\n const asyncProp = this.asyncProps[propName];\n if (value === asyncProp.resolvedValue || value === asyncProp.lastValue) {\n return false;\n }\n asyncProp.lastValue = value;\n return true;\n }\n // Set normal, non-async value\n _setPropValue(propName, value) {\n // Save the current value before overwriting so that diffProps can access both\n this._freezeAsyncOldProps();\n const asyncProp = this.asyncProps[propName];\n if (asyncProp) {\n value = this._postProcessValue(asyncProp, value);\n asyncProp.resolvedValue = value;\n asyncProp.pendingLoadCount++;\n asyncProp.resolvedLoadCount = asyncProp.pendingLoadCount;\n }\n }\n // Set a just resolved async value, calling onAsyncPropUpdates if value changes asynchronously\n _setAsyncPropValue(propName, value, loadCount) {\n // Only update if loadCount is larger or equal to resolvedLoadCount\n // otherwise a more recent load has already completed\n const asyncProp = this.asyncProps[propName];\n if (asyncProp && loadCount >= asyncProp.resolvedLoadCount && value !== undefined) {\n // Save the current value before overwriting so that diffProps can access both\n this._freezeAsyncOldProps();\n asyncProp.resolvedValue = value;\n asyncProp.resolvedLoadCount = loadCount;\n // Call callback to inform listener\n this.onAsyncPropUpdated(propName, value);\n }\n }\n // Tracks a promise, sets the prop when loaded, handles load count\n _watchPromise(propName, promise) {\n const asyncProp = this.asyncProps[propName];\n if (asyncProp) {\n asyncProp.pendingLoadCount++;\n const loadCount = asyncProp.pendingLoadCount;\n promise\n .then(data => {\n if (!this.component) {\n // This component state has been finalized\n return;\n }\n data = this._postProcessValue(asyncProp, data);\n this._setAsyncPropValue(propName, data, loadCount);\n this._onResolve(propName, data);\n })\n .catch(error => {\n this._onError(propName, error);\n });\n }\n }\n async _resolveAsyncIterable(propName, iterable) {\n if (propName !== 'data') {\n // we only support data as async iterable\n this._setPropValue(propName, iterable);\n return;\n }\n const asyncProp = this.asyncProps[propName];\n if (!asyncProp) {\n return;\n }\n asyncProp.pendingLoadCount++;\n const loadCount = asyncProp.pendingLoadCount;\n let data = [];\n let count = 0;\n for await (const chunk of iterable) {\n if (!this.component) {\n // This component state has been finalized\n return;\n }\n // @ts-expect-error (2339) dataTransform is not decared in base component props\n const { dataTransform } = this.component.props;\n if (dataTransform) {\n data = dataTransform(chunk, data);\n }\n else {\n data = data.concat(chunk);\n }\n // Used by the default _dataDiff function\n Object.defineProperty(data, '__diff', {\n enumerable: false,\n value: [{ startRow: count, endRow: data.length }]\n });\n count = data.length;\n this._setAsyncPropValue(propName, data, loadCount);\n }\n this._onResolve(propName, data);\n }\n // Give the app a chance to post process the loaded data\n _postProcessValue(asyncProp, value) {\n const propType = asyncProp.type;\n if (propType && this.component) {\n if (propType.release) {\n propType.release(asyncProp.resolvedValue, propType, this.component);\n }\n if (propType.transform) {\n return propType.transform(value, propType, this.component);\n }\n }\n return value;\n }\n // Creating an asyncProp record if needed\n _createAsyncPropData(propName, defaultValue) {\n const asyncProp = this.asyncProps[propName];\n if (!asyncProp) {\n const propTypes = this.component && this.component.props[PROP_TYPES_SYMBOL];\n // assert(defaultValue !== undefined);\n this.asyncProps[propName] = {\n type: propTypes && propTypes[propName],\n lastValue: null,\n resolvedValue: defaultValue,\n pendingLoadCount: 0,\n resolvedLoadCount: 0\n };\n }\n }\n}\n//# sourceMappingURL=component-state.js.map","// deck.gl\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\n// deck.gl, MIT license\nimport ComponentState from \"../lifecycle/component-state.js\";\nexport default class LayerState extends ComponentState {\n constructor({ attributeManager, layer }) {\n super(layer);\n this.attributeManager = attributeManager;\n this.needsRedraw = true;\n this.needsUpdate = true;\n this.subLayers = null;\n this.usesPickingColorCache = false;\n }\n get layer() {\n return this.component;\n }\n /* Override base Component methods with Layer-specific handling */\n _fetch(propName, url) {\n const layer = this.layer;\n const fetch = layer?.props.fetch;\n if (fetch) {\n return fetch(url, { propName, layer });\n }\n return super._fetch(propName, url);\n }\n _onResolve(propName, value) {\n const layer = this.layer;\n if (layer) {\n const onDataLoad = layer.props.onDataLoad;\n if (propName === 'data' && onDataLoad) {\n onDataLoad(value, { propName, layer });\n }\n }\n }\n _onError(propName, error) {\n const layer = this.layer;\n if (layer) {\n layer.raiseError(error, `loading ${propName} of ${this.layer}`);\n }\n }\n}\n//# sourceMappingURL=layer-state.js.map","// deck.gl\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\n/* eslint-disable react/no-direct-mutation-state */\nimport { Buffer } from '@luma.gl/core';\nimport { WebGLDevice } from '@luma.gl/webgl';\nimport { COORDINATE_SYSTEM } from \"./constants.js\";\nimport AttributeManager from \"./attribute/attribute-manager.js\";\nimport UniformTransitionManager from \"./uniform-transition-manager.js\";\nimport { diffProps, validateProps } from \"../lifecycle/props.js\";\nimport { LIFECYCLE } from \"../lifecycle/constants.js\";\nimport { count } from \"../utils/count.js\";\nimport log from \"../utils/log.js\";\nimport debug from \"../debug/index.js\";\nimport assert from \"../utils/assert.js\";\nimport memoize from \"../utils/memoize.js\";\nimport { mergeShaders } from \"../utils/shader.js\";\nimport { projectPosition, getWorldPosition } from \"../shaderlib/project/project-functions.js\";\nimport typedArrayManager from \"../utils/typed-array-manager.js\";\nimport Component from \"../lifecycle/component.js\";\nimport LayerState from \"./layer-state.js\";\nimport { worldToPixels } from '@math.gl/web-mercator';\nimport { load } from '@loaders.gl/core';\nconst TRACE_CHANGE_FLAG = 'layer.changeFlag';\nconst TRACE_INITIALIZE = 'layer.initialize';\nconst TRACE_UPDATE = 'layer.update';\nconst TRACE_FINALIZE = 'layer.finalize';\nconst TRACE_MATCHED = 'layer.matched';\nconst MAX_PICKING_COLOR_CACHE_SIZE = 2 ** 24 - 1;\nconst EMPTY_ARRAY = Object.freeze([]);\n// Only compare the same two viewports once\nconst areViewportsEqual = memoize(({ oldViewport, viewport }) => {\n return oldViewport.equals(viewport);\n});\nlet pickingColorCache = new Uint8ClampedArray(0);\nconst defaultProps = {\n // data: Special handling for null, see below\n data: { type: 'data', value: EMPTY_ARRAY, async: true },\n dataComparator: { type: 'function', value: null, optional: true },\n _dataDiff: {\n type: 'function',\n // @ts-ignore __diff is not defined on data\n value: data => data && data.__diff,\n optional: true\n },\n dataTransform: { type: 'function', value: null, optional: true },\n onDataLoad: { type: 'function', value: null, optional: true },\n onError: { type: 'function', value: null, optional: true },\n fetch: {\n type: 'function',\n value: (url, { propName, layer, loaders, loadOptions, signal }) => {\n const { resourceManager } = layer.context;\n loadOptions = loadOptions || layer.getLoadOptions();\n loaders = loaders || layer.props.loaders;\n if (signal) {\n loadOptions = {\n ...loadOptions,\n fetch: {\n ...loadOptions?.fetch,\n signal\n }\n };\n }\n let inResourceManager = resourceManager.contains(url);\n if (!inResourceManager && !loadOptions) {\n // If there is no layer-specific load options, then attempt to cache this resource in the data manager\n resourceManager.add({ resourceId: url, data: load(url, loaders), persistent: false });\n inResourceManager = true;\n }\n if (inResourceManager) {\n return resourceManager.subscribe({\n resourceId: url,\n onChange: data => layer.internalState?.reloadAsyncProp(propName, data),\n consumerId: layer.id,\n requestId: propName\n });\n }\n return load(url, loaders, loadOptions);\n }\n },\n updateTriggers: {}, // Update triggers: a core change detection mechanism in deck.gl\n visible: true,\n pickable: false,\n opacity: { type: 'number', min: 0, max: 1, value: 1 },\n operation: 'draw',\n onHover: { type: 'function', value: null, optional: true },\n onClick: { type: 'function', value: null, optional: true },\n onDragStart: { type: 'function', value: null, optional: true },\n onDrag: { type: 'function', value: null, optional: true },\n onDragEnd: { type: 'function', value: null, optional: true },\n coordinateSystem: COORDINATE_SYSTEM.DEFAULT,\n coordinateOrigin: { type: 'array', value: [0, 0, 0], compare: true },\n modelMatrix: { type: 'array', value: null, compare: true, optional: true },\n wrapLongitude: false,\n positionFormat: 'XYZ',\n colorFormat: 'RGBA',\n parameters: { type: 'object', value: {}, optional: true, compare: 2 },\n loadOptions: { type: 'object', value: null, optional: true, ignore: true },\n transitions: null,\n extensions: [],\n loaders: { type: 'array', value: [], optional: true, ignore: true },\n // Offset depth based on layer index to avoid z-fighting.\n // Negative values pull layer towards the camera\n // https://www.opengl.org/archives/resources/faq/technical/polygonoffset.htm\n getPolygonOffset: {\n type: 'function',\n value: ({ layerIndex }) => [0, -layerIndex * 100]\n },\n // Selection/Highlighting\n highlightedObjectIndex: null,\n autoHighlight: false,\n highlightColor: { type: 'accessor', value: [0, 0, 128, 128] }\n};\nclass Layer extends Component {\n constructor() {\n super(...arguments);\n this.internalState = null;\n this.lifecycle = LIFECYCLE.NO_STATE; // Helps track and debug the life cycle of the layers\n this.parent = null;\n }\n static get componentName() {\n return Object.prototype.hasOwnProperty.call(this, 'layerName') ? this.layerName : '';\n }\n get root() {\n // eslint-disable-next-line\n let layer = this;\n while (layer.parent) {\n layer = layer.parent;\n }\n return layer;\n }\n toString() {\n const className = this.constructor.layerName || this.constructor.name;\n return `${className}({id: '${this.props.id}'})`;\n }\n // Public API for users\n /** Projects a point with current view state from the current layer's coordinate system to screen */\n project(xyz) {\n assert(this.internalState);\n const viewport = this.internalState.viewport || this.context.viewport;\n const worldPosition = getWorldPosition(xyz, {\n viewport,\n modelMatrix: this.props.modelMatrix,\n coordinateOrigin: this.props.coordinateOrigin,\n coordinateSystem: this.props.coordinateSystem\n });\n const [x, y, z] = worldToPixels(worldPosition, viewport.pixelProjectionMatrix);\n return xyz.length === 2 ? [x, y] : [x, y, z];\n }\n /** Unprojects a screen pixel to the current view's default coordinate system\n Note: this does not reverse `project`. */\n unproject(xy) {\n assert(this.internalState);\n const viewport = this.internalState.viewport || this.context.viewport;\n return viewport.unproject(xy);\n }\n /** Projects a point with current view state from the current layer's coordinate system to the world space */\n projectPosition(xyz, params) {\n assert(this.internalState);\n const viewport = this.internalState.viewport || this.context.viewport;\n return projectPosition(xyz, {\n viewport,\n modelMatrix: this.props.modelMatrix,\n coordinateOrigin: this.props.coordinateOrigin,\n coordinateSystem: this.props.coordinateSystem,\n ...params\n });\n }\n // Public API for custom layer implementation\n /** `true` if this layer renders other layers */\n get isComposite() {\n return false;\n }\n /** `true` if the layer renders to screen */\n get isDrawable() {\n return true;\n }\n /** Updates selected state members and marks the layer for redraw */\n setState(partialState) {\n this.setChangeFlags({ stateChanged: true });\n Object.assign(this.state, partialState);\n this.setNeedsRedraw();\n }\n /** Sets the redraw flag for this layer, will trigger a redraw next animation frame */\n setNeedsRedraw() {\n if (this.internalState) {\n this.internalState.needsRedraw = true;\n }\n }\n /** Mark this layer as needs a deep update */\n setNeedsUpdate() {\n if (this.internalState) {\n this.context.layerManager.setNeedsUpdate(String(this));\n this.internalState.needsUpdate = true;\n }\n }\n /** Returns true if all async resources are loaded */\n get isLoaded() {\n return this.internalState ? !this.internalState.isAsyncPropLoading() : false;\n }\n /** Returns true if using shader-based WGS84 longitude wrapping */\n get wrapLongitude() {\n return this.props.wrapLongitude;\n }\n /** @deprecated Returns true if the layer is visible in the picking pass */\n isPickable() {\n return this.props.pickable && this.props.visible;\n }\n /** Returns an array of models used by this layer, can be overriden by layer subclass */\n getModels() {\n const state = this.state;\n return (state && (state.models || (state.model && [state.model]))) || [];\n }\n /** Update shader input parameters */\n setShaderModuleProps(...props) {\n for (const model of this.getModels()) {\n model.shaderInputs.setProps(...props);\n }\n }\n /** Returns the attribute manager of this layer */\n getAttributeManager() {\n return this.internalState && this.internalState.attributeManager;\n }\n /** Returns the most recent layer that matched to this state\n (When reacting to an async event, this layer may no longer be the latest) */\n getCurrentLayer() {\n return this.internalState && this.internalState.layer;\n }\n /** Returns the default parse options for async props */\n getLoadOptions() {\n return this.props.loadOptions;\n }\n use64bitPositions() {\n const { coordinateSystem } = this.props;\n return (coordinateSystem === COORDINATE_SYSTEM.DEFAULT ||\n coordinateSystem === COORDINATE_SYSTEM.LNGLAT ||\n coordinateSystem === COORDINATE_SYSTEM.CARTESIAN);\n }\n // Event handling\n onHover(info, pickingEvent) {\n if (this.props.onHover) {\n return this.props.onHover(info, pickingEvent) || false;\n }\n return false;\n }\n onClick(info, pickingEvent) {\n if (this.props.onClick) {\n return this.props.onClick(info, pickingEvent) || false;\n }\n return false;\n }\n // Returns the picking color that doesn't match any subfeature\n // Use if some graphics do not belong to any pickable subfeature\n // @return {Array} - a black color\n nullPickingColor() {\n return [0, 0, 0];\n }\n // Returns the picking color that doesn't match any subfeature\n // Use if some graphics do not belong to any pickable subfeature\n encodePickingColor(i, target = []) {\n target[0] = (i + 1) & 255;\n target[1] = ((i + 1) >> 8) & 255;\n target[2] = (((i + 1) >> 8) >> 8) & 255;\n return target;\n }\n // Returns the index corresponding to a picking color that doesn't match any subfeature\n // @param {Uint8Array} color - color array to be decoded\n // @return {Array} - the decoded picking color\n decodePickingColor(color) {\n assert(color instanceof Uint8Array);\n const [i1, i2, i3] = color;\n // 1 was added to seperate from no selection\n const index = i1 + i2 * 256 + i3 * 65536 - 1;\n return index;\n }\n /** Deduces number of instances. Intention is to support:\n - Explicit setting of numInstances\n - Auto-deduction for ES6 containers that define a size member\n - Auto-deduction for Classic Arrays via the built-in length attribute\n - Auto-deduction via arrays */\n getNumInstances() {\n // First Check if app has provided an explicit value\n if (Number.isFinite(this.props.numInstances)) {\n return this.props.numInstances;\n }\n // Second check if the layer has set its own value\n if (this.state && this.state.numInstances !== undefined) {\n return this.state.numInstances;\n }\n // Use container library to get a count for any ES6 container or object\n return count(this.props.data);\n }\n /** Buffer layout describes how many attribute values are packed for each data object\n The default (null) is one value each object.\n Some data formats (e.g. paths, polygons) have various length. Their buffer layout\n is in the form of [L0, L1, L2, ...] */\n getStartIndices() {\n // First Check if startIndices is provided as an explicit value\n if (this.props.startIndices) {\n return this.props.startIndices;\n }\n // Second check if the layer has set its own value\n if (this.state && this.state.startIndices) {\n return this.state.startIndices;\n }\n return null;\n }\n // Default implementation\n getBounds() {\n return this.getAttributeManager()?.getBounds(['positions', 'instancePositions']);\n }\n getShaders(shaders) {\n shaders = mergeShaders(shaders, {\n disableWarnings: true,\n modules: this.context.defaultShaderModules\n });\n for (const extension of this.props.extensions) {\n shaders = mergeShaders(shaders, extension.getShaders.call(this, extension));\n }\n return shaders;\n }\n /** Controls if updateState should be called. By default returns true if any prop has changed */\n shouldUpdateState(params) {\n return params.changeFlags.propsOrDataChanged;\n }\n /** Default implementation, all attributes will be invalidated and updated when data changes */\n // eslint-disable-next-line complexity\n updateState(params) {\n const attributeManager = this.getAttributeManager();\n const { dataChanged } = params.changeFlags;\n if (dataChanged && attributeManager) {\n if (Array.isArray(dataChanged)) {\n // is partial update\n for (const dataRange of dataChanged) {\n attributeManager.invalidateAll(dataRange);\n }\n }\n else {\n attributeManager.invalidateAll();\n }\n }\n // Enable/disable picking buffer\n if (attributeManager) {\n const { props } = params;\n const hasPickingBuffer = this.internalState.hasPickingBuffer;\n const needsPickingBuffer = Number.isInteger(props.highlightedObjectIndex) ||\n props.pickable ||\n props.extensions.some(extension => extension.getNeedsPickingBuffer.call(this, extension));\n // Only generate picking buffer if needed\n if (hasPickingBuffer !== needsPickingBuffer) {\n this.internalState.hasPickingBuffer = needsPickingBuffer;\n const { pickingColors, instancePickingColors } = attributeManager.attributes;\n const pickingColorsAttribute = pickingColors || instancePickingColors;\n if (pickingColorsAttribute) {\n if (needsPickingBuffer && pickingColorsAttribute.constant) {\n pickingColorsAttribute.constant = false;\n attributeManager.invalidate(pickingColorsAttribute.id);\n }\n if (!pickingColorsAttribute.value && !needsPickingBuffer) {\n pickingColorsAttribute.constant = true;\n pickingColorsAttribute.value = [0, 0, 0];\n }\n }\n }\n }\n }\n /** Called once when layer is no longer matched and state will be discarded. Layers can destroy WebGL resources here. */\n finalizeState(context) {\n for (const model of this.getModels()) {\n model.destroy();\n }\n const attributeManager = this.getAttributeManager();\n if (attributeManager) {\n attributeManager.finalize();\n }\n if (this.context) {\n this.context.resourceManager.unsubscribe({ consumerId: this.id });\n }\n if (this.internalState) {\n this.internalState.uniformTransitions.clear();\n this.internalState.finalize();\n }\n }\n // If state has a model, draw it with supplied uniforms\n draw(opts) {\n for (const model of this.getModels()) {\n model.draw(opts.renderPass);\n }\n }\n // called to populate the info object that is passed to the event handler\n // @return null to cancel event\n getPickingInfo({ info, mode, sourceLayer }) {\n const { index } = info;\n if (index >= 0) {\n // If props.data is an indexable array, get the object\n if (Array.isArray(this.props.data)) {\n info.object = this.props.data[index];\n }\n }\n return info;\n }\n // END LIFECYCLE METHODS\n // / INTERNAL METHODS - called by LayerManager, DeckRenderer and DeckPicker\n /** (Internal) Propagate an error event through the system */\n raiseError(error, message) {\n if (message) {\n // Duplicating error message for backward compatibility, see #7986\n // TODO - revisit in v9\n error = new Error(`${message}: ${error.message}`, { cause: error });\n }\n if (!this.props.onError?.(error)) {\n this.context?.onError?.(error, this);\n }\n }\n /** (Internal) Checks if this layer needs redraw */\n getNeedsRedraw(opts = { clearRedrawFlags: false }) {\n return this._getNeedsRedraw(opts);\n }\n /** (Internal) Checks if this layer needs a deep update */\n needsUpdate() {\n if (!this.internalState) {\n return false;\n }\n // Call subclass lifecycle method\n return (this.internalState.needsUpdate ||\n this.hasUniformTransition() ||\n this.shouldUpdateState(this._getUpdateParams()));\n // End lifecycle method\n }\n /** Checks if this layer has ongoing uniform transition */\n hasUniformTransition() {\n return this.internalState?.uniformTransitions.active || false;\n }\n /** Called when this layer is rendered into the given viewport */\n activateViewport(viewport) {\n if (!this.internalState) {\n return;\n }\n const oldViewport = this.internalState.viewport;\n this.internalState.viewport = viewport;\n if (!oldViewport || !areViewportsEqual({ oldViewport, viewport })) {\n this.setChangeFlags({ viewportChanged: true });\n if (this.isComposite) {\n if (this.needsUpdate()) {\n // Composite layers may add/remove sublayers on viewport change\n // Because we cannot change the layers list during a draw cycle, we don't want to update sublayers right away\n // This will not call update immediately, but mark the layerManager as needs update on the next frame\n this.setNeedsUpdate();\n }\n }\n else {\n this._update();\n }\n }\n }\n /** Default implementation of attribute invalidation, can be redefined */\n invalidateAttribute(name = 'all') {\n const attributeManager = this.getAttributeManager();\n if (!attributeManager) {\n return;\n }\n if (name === 'all') {\n attributeManager.invalidateAll();\n }\n else {\n attributeManager.invalidate(name);\n }\n }\n /** Send updated attributes to the WebGL model */\n updateAttributes(changedAttributes) {\n // If some buffer layout changed\n let bufferLayoutChanged = false;\n for (const id in changedAttributes) {\n if (changedAttributes[id].layoutChanged()) {\n bufferLayoutChanged = true;\n }\n }\n for (const model of this.getModels()) {\n this._setModelAttributes(model, changedAttributes, bufferLayoutChanged);\n }\n }\n /** Recalculate any attributes if needed */\n _updateAttributes() {\n const attributeManager = this.getAttributeManager();\n if (!attributeManager) {\n return;\n }\n const props = this.props;\n // Figure out data length\n const numInstances = this.getNumInstances();\n const startIndices = this.getStartIndices();\n attributeManager.update({\n data: props.data,\n numInstances,\n startIndices,\n props,\n transitions: props.transitions,\n // @ts-ignore (TS2339) property attribute is not present on some acceptable data types\n buffers: props.data.attributes,\n context: this\n });\n const changedAttributes = attributeManager.getChangedAttributes({ clearChangedFlags: true });\n this.updateAttributes(changedAttributes);\n }\n /** Update attribute transitions. This is called in drawLayer, no model updates required. */\n _updateAttributeTransition() {\n const attributeManager = this.getAttributeManager();\n if (attributeManager) {\n attributeManager.updateTransition();\n }\n }\n /** Update uniform (prop) transitions. This is called in updateState, may result in model updates. */\n _updateUniformTransition() {\n // @ts-ignore (TS2339) internalState is alwasy defined when this method is called\n const { uniformTransitions } = this.internalState;\n if (uniformTransitions.active) {\n // clone props\n const propsInTransition = uniformTransitions.update();\n const props = Object.create(this.props);\n for (const key in propsInTransition) {\n Object.defineProperty(props, key, { value: propsInTransition[key] });\n }\n return props;\n }\n return this.props;\n }\n /** Updater for the automatically populated instancePickingColors attribute */\n calculateInstancePickingColors(attribute, { numInstances }) {\n if (attribute.constant) {\n return;\n }\n // calculateInstancePickingColors always generates the same sequence.\n // pickingColorCache saves the largest generated sequence for reuse\n const cacheSize = Math.floor(pickingColorCache.length / 4);\n // Record when using the picking buffer cache, so that layers can always point at the most recently allocated cache\n // @ts-ignore (TS2531) internalState is always defined when this method is called\n this.internalState.usesPickingColorCache = true;\n if (cacheSize < numInstances) {\n if (numInstances > MAX_PICKING_COLOR_CACHE_SIZE) {\n log.warn('Layer has too many data objects. Picking might not be able to distinguish all objects.')();\n }\n pickingColorCache = typedArrayManager.allocate(pickingColorCache, numInstances, {\n size: 4,\n copy: true,\n maxCount: Math.max(numInstances, MAX_PICKING_COLOR_CACHE_SIZE)\n });\n // If the attribute is larger than the cache, resize the cache and populate the missing chunk\n const newCacheSize = Math.floor(pickingColorCache.length / 4);\n const pickingColor = [0, 0, 0];\n for (let i = cacheSize; i < newCacheSize; i++) {\n this.encodePickingColor(i, pickingColor);\n pickingColorCache[i * 4 + 0] = pickingColor[0];\n pickingColorCache[i * 4 + 1] = pickingColor[1];\n pickingColorCache[i * 4 + 2] = pickingColor[2];\n pickingColorCache[i * 4 + 3] = 0;\n }\n }\n attribute.value = pickingColorCache.subarray(0, numInstances * 4);\n }\n /** Apply changed attributes to model */\n _setModelAttributes(model, changedAttributes, bufferLayoutChanged = false) {\n if (!Object.keys(changedAttributes).length) {\n return;\n }\n if (bufferLayoutChanged) {\n // AttributeManager is always defined when this method is called\n const attributeManager = this.getAttributeManager();\n model.setBufferLayout(attributeManager.getBufferLayouts(model));\n // All attributes must be reset after buffer layout change\n changedAttributes = attributeManager.getAttributes();\n }\n // @ts-ignore luma.gl type issue\n const excludeAttributes = model.userData?.excludeAttributes || {};\n const attributeBuffers = {};\n const constantAttributes = {};\n for (const name in changedAttributes) {\n if (excludeAttributes[name]) {\n continue;\n }\n const values = changedAttributes[name].getValue();\n for (const attributeName in values) {\n const value = values[attributeName];\n if (value instanceof Buffer) {\n if (changedAttributes[name].settings.isIndexed) {\n model.setIndexBuffer(value);\n }\n else {\n attributeBuffers[attributeName] = value;\n }\n }\n else if (value) {\n constantAttributes[attributeName] = value;\n }\n }\n }\n // TODO - update buffer map?\n model.setAttributes(attributeBuffers);\n model.setConstantAttributes(constantAttributes);\n }\n /** (Internal) Sets the picking color at the specified index to null picking color. Used for multi-depth picking.\n This method may be overriden by layer implementations */\n disablePickingIndex(objectIndex) {\n const data = this.props.data;\n if (!('attributes' in data)) {\n this._disablePickingIndex(objectIndex);\n return;\n }\n // @ts-ignore (TS2531) this method is only called internally with attributeManager defined\n const { pickingColors, instancePickingColors } = this.getAttributeManager().attributes;\n const colors = pickingColors || instancePickingColors;\n const externalColorAttribute = colors && data.attributes && data.attributes[colors.id];\n if (externalColorAttribute && externalColorAttribute.value) {\n const values = externalColorAttribute.value;\n const objectColor = this.encodePickingColor(objectIndex);\n for (let index = 0; index < data.length; index++) {\n const i = colors.getVertexOffset(index);\n if (values[i] === objectColor[0] &&\n values[i + 1] === objectColor[1] &&\n values[i + 2] === objectColor[2]) {\n this._disablePickingIndex(index);\n }\n }\n }\n else {\n this._disablePickingIndex(objectIndex);\n }\n }\n // TODO - simplify subclassing interface\n _disablePickingIndex(objectIndex) {\n // @ts-ignore (TS2531) this method is only called internally with attributeManager defined\n const { pickingColors, instancePickingColors } = this.getAttributeManager().attributes;\n const colors = pickingColors || instancePickingColors;\n if (!colors) {\n return;\n }\n const start = colors.getVertexOffset(objectIndex);\n const end = colors.getVertexOffset(objectIndex + 1);\n // Fill the sub buffer with 0s, 1 byte per element\n colors.buffer.write(new Uint8Array(end - start), start);\n }\n /** (Internal) Re-enable all picking indices after multi-depth picking */\n restorePickingColors() {\n // @ts-ignore (TS2531) this method is only called internally with attributeManager defined\n const { pickingColors, instancePickingColors } = this.getAttributeManager().attributes;\n const colors = pickingColors || instancePickingColors;\n if (!colors) {\n return;\n }\n // The picking color cache may have been freed and then reallocated. This ensures we read from the currently allocated cache.\n if (\n // @ts-ignore (TS2531) this method is only called internally with internalState defined\n this.internalState.usesPickingColorCache &&\n colors.value.buffer !== pickingColorCache.buffer) {\n colors.value = pickingColorCache.subarray(0, colors.value.length);\n }\n colors.updateSubBuffer({ startOffset: 0 });\n }\n /* eslint-disable max-statements */\n /* (Internal) Called by layer manager when a new layer is found */\n _initialize() {\n assert(!this.internalState); // finalized layer cannot be reused\n assert(Number.isFinite(this.props.coordinateSystem)); // invalid coordinateSystem\n debug(TRACE_INITIALIZE, this);\n const attributeManager = this._getAttributeManager();\n if (attributeManager) {\n // All instanced layers get instancePickingColors attribute by default\n // Their shaders can use it to render a picking scene\n // TODO - this slightly slows down non instanced layers\n attributeManager.addInstanced({\n instancePickingColors: {\n type: 'uint8',\n size: 4,\n noAlloc: true,\n // Updaters are always called with `this` pointing to the layer\n // eslint-disable-next-line @typescript-eslint/unbound-method\n update: this.calculateInstancePickingColors\n }\n });\n }\n this.internalState = new LayerState({\n attributeManager,\n layer: this\n });\n this._clearChangeFlags(); // populate this.internalState.changeFlags\n this.state = {};\n // for backwards compatibility with older layers\n // TODO - remove in next release\n /* eslint-disable accessor-pairs */\n Object.defineProperty(this.state, 'attributeManager', {\n get: () => {\n log.deprecated('layer.state.attributeManager', 'layer.getAttributeManager()')();\n return attributeManager;\n }\n });\n /* eslint-enable accessor-pairs */\n this.internalState.uniformTransitions = new UniformTransitionManager(this.context.timeline);\n this.internalState.onAsyncPropUpdated = this._onAsyncPropUpdated.bind(this);\n // Ensure any async props are updated\n this.internalState.setAsyncProps(this.props);\n // Call subclass lifecycle methods\n this.initializeState(this.context);\n // Initialize extensions\n for (const extension of this.props.extensions) {\n extension.initializeState.call(this, this.context, extension);\n }\n // End subclass lifecycle methods\n // initializeState callback tends to clear state\n this.setChangeFlags({\n dataChanged: 'init',\n propsChanged: 'init',\n viewportChanged: true,\n extensionsChanged: true\n });\n this._update();\n }\n /** (Internal) Called by layer manager to transfer state from an old layer */\n _transferState(oldLayer) {\n debug(TRACE_MATCHED, this, this === oldLayer);\n const { state, internalState } = oldLayer;\n if (this === oldLayer) {\n return;\n }\n // Move internalState\n this.internalState = internalState;\n // Move state\n this.state = state;\n // We keep the state ref on old layers to support async actions\n // oldLayer.state = null;\n // Ensure any async props are updated\n this.internalState.setAsyncProps(this.props);\n this._diffProps(this.props, this.internalState.getOldProps());\n }\n /** (Internal) Called by layer manager when a new layer is added or an existing layer is matched with a new instance */\n _update() {\n // Call subclass lifecycle method\n const stateNeedsUpdate = this.needsUpdate();\n // End lifecycle method\n debug(TRACE_UPDATE, this, stateNeedsUpdate);\n if (!stateNeedsUpdate) {\n return;\n }\n const currentProps = this.props;\n const context = this.context;\n const internalState = this.internalState;\n const currentViewport = context.viewport;\n const propsInTransition = this._updateUniformTransition();\n internalState.propsInTransition = propsInTransition;\n // Overwrite this.context.viewport during update to use the last activated viewport on this layer\n // In multi-view applications, a layer may only be drawn in one of the views\n // Which would make the \"active\" viewport different from the shared context\n context.viewport = internalState.viewport || currentViewport;\n // Overwrite this.props during update to use in-transition prop values\n this.props = propsInTransition;\n try {\n const updateParams = this._getUpdateParams();\n const oldModels = this.getModels();\n // Safely call subclass lifecycle methods\n if (context.device) {\n this.updateState(updateParams);\n }\n else {\n try {\n this.updateState(updateParams);\n }\n catch (error) {\n // ignore error if gl context is missing\n }\n }\n // Execute extension updates\n for (const extension of this.props.extensions) {\n extension.updateState.call(this, updateParams, extension);\n }\n this.setNeedsRedraw();\n // Check if attributes need recalculation\n this._updateAttributes();\n const modelChanged = this.getModels()[0] !== oldModels[0];\n this._postUpdate(updateParams, modelChanged);\n // End subclass lifecycle methods\n }\n finally {\n // Restore shared context\n context.viewport = currentViewport;\n this.props = currentProps;\n this._clearChangeFlags();\n internalState.needsUpdate = false;\n internalState.resetOldProps();\n }\n }\n /* eslint-enable max-statements */\n /** (Internal) Called by manager when layer is about to be disposed\n Note: not guaranteed to be called on application shutdown */\n _finalize() {\n debug(TRACE_FINALIZE, this);\n // Call subclass lifecycle method\n this.finalizeState(this.context);\n // Finalize extensions\n for (const extension of this.props.extensions) {\n extension.finalizeState.call(this, this.context, extension);\n }\n }\n // Calculates uniforms\n _drawLayer({ renderPass, shaderModuleProps = null, uniforms = {}, parameters = {} }) {\n this._updateAttributeTransition();\n const currentProps = this.props;\n const context = this.context;\n // Overwrite this.props during redraw to use in-transition prop values\n // `internalState.propsInTransition` could be missing if `updateState` failed\n // @ts-ignore (TS2339) internalState is alwasy defined when this method is called\n this.props = this.internalState.propsInTransition || currentProps;\n try {\n // TODO/ib - hack move to luma Model.draw\n if (shaderModuleProps) {\n this.setShaderModuleProps(shaderModuleProps);\n }\n // Apply polygon offset to avoid z-fighting\n // TODO - move to draw-layers\n const { getPolygonOffset } = this.props;\n const offsets = (getPolygonOffset && getPolygonOffset(uniforms)) || [0, 0];\n if (context.device instanceof WebGLDevice) {\n context.device.setParametersWebGL({ polygonOffset: offsets });\n }\n for (const model of this.getModels()) {\n if (model.device.type === 'webgpu') {\n // TODO(ibgreen): model.setParameters currently wipes parameters. Semantics TBD.\n model.setParameters({ ...model.parameters, ...parameters });\n }\n else {\n model.setParameters(parameters);\n }\n }\n // Call subclass lifecycle method\n if (context.device instanceof WebGLDevice) {\n context.device.withParametersWebGL(parameters, () => {\n const opts = { renderPass, shaderModuleProps, uniforms, parameters, context };\n // extensions\n for (const extension of this.props.extensions) {\n extension.draw.call(this, opts, extension);\n }\n this.draw(opts);\n });\n }\n else {\n const opts = { renderPass, shaderModuleProps, uniforms, parameters, context };\n // extensions\n for (const extension of this.props.extensions) {\n extension.draw.call(this, opts, extension);\n }\n this.draw(opts);\n }\n }\n finally {\n this.props = currentProps;\n }\n // End lifecycle method\n }\n // Helper methods\n /** Returns the current change flags */\n getChangeFlags() {\n return this.internalState?.changeFlags;\n }\n /* eslint-disable complexity */\n /** Dirty some change flags, will be handled by updateLayer */\n setChangeFlags(flags) {\n if (!this.internalState) {\n return;\n }\n const { changeFlags } = this.internalState;\n /* eslint-disable no-fallthrough, max-depth */\n for (const key in flags) {\n if (flags[key]) {\n let flagChanged = false;\n switch (key) {\n case 'dataChanged':\n // changeFlags.dataChanged may be `false`, a string (reason) or an array of ranges\n const dataChangedReason = flags[key];\n const prevDataChangedReason = changeFlags[key];\n if (dataChangedReason && Array.isArray(prevDataChangedReason)) {\n // Merge partial updates\n changeFlags.dataChanged = Array.isArray(dataChangedReason)\n ? prevDataChangedReason.concat(dataChangedReason)\n : dataChangedReason;\n flagChanged = true;\n }\n default:\n if (!changeFlags[key]) {\n changeFlags[key] = flags[key];\n flagChanged = true;\n }\n }\n if (flagChanged) {\n debug(TRACE_CHANGE_FLAG, this, key, flags);\n }\n }\n }\n /* eslint-enable no-fallthrough, max-depth */\n // Update composite flags\n const propsOrDataChanged = Boolean(changeFlags.dataChanged ||\n changeFlags.updateTriggersChanged ||\n changeFlags.propsChanged ||\n changeFlags.extensionsChanged);\n changeFlags.propsOrDataChanged = propsOrDataChanged;\n changeFlags.somethingChanged =\n propsOrDataChanged || changeFlags.viewportChanged || changeFlags.stateChanged;\n }\n /* eslint-enable complexity */\n /** Clear all changeFlags, typically after an update */\n _clearChangeFlags() {\n // @ts-ignore TS2531 this method can only be called internally with internalState assigned\n this.internalState.changeFlags = {\n dataChanged: false,\n propsChanged: false,\n updateTriggersChanged: false,\n viewportChanged: false,\n stateChanged: false,\n extensionsChanged: false,\n propsOrDataChanged: false,\n somethingChanged: false\n };\n }\n /** Compares the layers props with old props from a matched older layer\n and extracts change flags that describe what has change so that state\n can be update correctly with minimal effort */\n _diffProps(newProps, oldProps) {\n const changeFlags = diffProps(newProps, oldProps);\n // iterate over changedTriggers\n if (changeFlags.updateTriggersChanged) {\n for (const key in changeFlags.updateTriggersChanged) {\n if (changeFlags.updateTriggersChanged[key]) {\n this.invalidateAttribute(key);\n }\n }\n }\n // trigger uniform transitions\n if (changeFlags.transitionsChanged) {\n for (const key in changeFlags.transitionsChanged) {\n // prop changed and transition is enabled\n // @ts-ignore (TS2531) internalState is always defined when this method is called\n this.internalState.uniformTransitions.add(key, oldProps[key], newProps[key], newProps.transitions?.[key]);\n }\n }\n return this.setChangeFlags(changeFlags);\n }\n /** (Internal) called by layer manager to perform extra props validation (in development only) */\n validateProps() {\n validateProps(this.props);\n }\n /** (Internal) Called by deck picker when the hovered object changes to update the auto highlight */\n updateAutoHighlight(info) {\n if (this.props.autoHighlight && !Number.isInteger(this.props.highlightedObjectIndex)) {\n this._updateAutoHighlight(info);\n }\n }\n // May be overriden by subclasses\n // TODO - simplify subclassing interface\n /** Update picking module parameters to highlight the hovered object */\n _updateAutoHighlight(info) {\n const picking = {\n // @ts-ignore\n highlightedObjectColor: info.picked ? info.color : null\n };\n const { highlightColor } = this.props;\n if (info.picked && typeof highlightColor === 'function') {\n // @ts-ignore\n picking.highlightColor = highlightColor(info);\n }\n this.setShaderModuleProps({ picking });\n // setShaderModuleProps does not trigger redraw\n this.setNeedsRedraw();\n }\n /** Create new attribute manager */\n _getAttributeManager() {\n const context = this.context;\n return new AttributeManager(context.device, {\n id: this.props.id,\n stats: context.stats,\n timeline: context.timeline\n });\n }\n // Private methods\n /** Called after updateState to perform common tasks */\n // eslint-disable-next-line complexity\n _postUpdate(updateParams, forceUpdate) {\n const { props, oldProps } = updateParams;\n // Note: Automatic instance count update only works for single layers\n const model = this.state.model;\n if (model?.isInstanced) {\n model.setInstanceCount(this.getNumInstances());\n }\n // Set picking module parameters to match props\n const { autoHighlight, highlightedObjectIndex, highlightColor } = props;\n if (forceUpdate ||\n oldProps.autoHighlight !== autoHighlight ||\n oldProps.highlightedObjectIndex !== highlightedObjectIndex ||\n oldProps.highlightColor !== highlightColor) {\n const picking = {};\n if (Array.isArray(highlightColor)) {\n picking.highlightColor = highlightColor;\n }\n // highlightedObjectIndex will overwrite any settings from auto highlighting.\n // Do not reset unless the value has changed.\n if (forceUpdate ||\n oldProps.autoHighlight !== autoHighlight ||\n highlightedObjectIndex !== oldProps.highlightedObjectIndex) {\n picking.highlightedObjectColor =\n Number.isFinite(highlightedObjectIndex) && highlightedObjectIndex >= 0\n ? this.encodePickingColor(highlightedObjectIndex)\n : null;\n }\n this.setShaderModuleProps({ picking });\n }\n }\n _getUpdateParams() {\n return {\n props: this.props,\n // @ts-ignore TS2531 this method can only be called internally with internalState assigned\n oldProps: this.internalState.getOldProps(),\n context: this.context,\n // @ts-ignore TS2531 this method can only be called internally with internalState assigned\n changeFlags: this.internalState.changeFlags\n };\n }\n /** Checks state of attributes and model */\n _getNeedsRedraw(opts) {\n // this method may be called by the render loop as soon a the layer\n // has been created, so guard against uninitialized state\n if (!this.internalState) {\n return false;\n }\n let redraw = false;\n redraw = redraw || (this.internalState.needsRedraw && this.id);\n // TODO - is attribute manager needed? - Model should be enough.\n const attributeManager = this.getAttributeManager();\n const attributeManagerNeedsRedraw = attributeManager\n ? attributeManager.getNeedsRedraw(opts)\n : false;\n redraw = redraw || attributeManagerNeedsRedraw;\n if (redraw) {\n for (const extension of this.props.extensions) {\n extension.onNeedsRedraw.call(this, extension);\n }\n }\n this.internalState.needsRedraw = this.internalState.needsRedraw && !opts.clearRedrawFlags;\n return redraw;\n }\n /** Callback when asyn prop is loaded */\n _onAsyncPropUpdated() {\n // @ts-ignore TS2531 this method can only be called internally with internalState assigned\n this._diffProps(this.props, this.internalState.getOldProps());\n this.setNeedsUpdate();\n }\n}\nLayer.defaultProps = defaultProps;\nLayer.layerName = 'Layer';\nexport default Layer;\n//# sourceMappingURL=layer.js.map"],"names":["FS_GLES","FS300","getPassthroughFS","options","input","inputChannels","output","inputType","channelCountToType","outputValue","convertToVec4","channels","variable","DEFAULT_HIGHLIGHT_COLOR","vs","fs","picking","getUniforms","opts","prevUniforms","uniforms","highlightedObjectColor","color","x","lightingUniformsGLSL","lightingUniformsWGSL","MAX_LIGHTS","COLOR_FACTOR","LIGHT_TYPE","lighting","props","extractLightTypes","ambientLight","pointLights","directionalLights","getLightSourceUniforms","lightSourceUniforms","convertColor","currentLight","pointLight","i","directionalLight","log","lights","lightSources","light","colorDef","intensity","component","PHONG_VS","PHONG_FS","PHONG_WGSL","phongMaterial","source","project32","project","DEFAULT_COORDINATE_ORIGIN","lngLatZToWorldPosition","lngLatZ","viewport","offsetMode","p","WebMercatorViewport","longitude","latitude","z","distanceScales","normalizeParameters","modelMatrix","coordinateOrigin","coordinateSystem","fromCoordinateSystem","fromCoordinateOrigin","COORDINATE_SYSTEM","getWorldPosition","position","y","vec4.transformMat4","addMetersToLngLat","projectPosition","params","autoOffset","geospatialOrigin","shaderCoordinateOrigin","getOffsetOrigin","worldPosition","positionCommonSpace","vec3.sub","BufferTransform","Model","device","renderPass","varyingName","result","Buffer","buffer","byteOffset","byteLength","Geometry","attributes","indices","vertexCount","uid","attributeName","attributeValue","attribute","value","size","constant","typedArrayFromDataType","type","getTypedArrayConstructor","dataTypeFromTypedArray","getDataType","getBufferAttributeLayout","name","accessor","deviceType","getStride","bufferLayoutEqual","accessor1","accessor2","resolveShaderAttribute","baseAccessor","shaderAttributeOptions","stride","vertexOffset","elementOffset","offset","resolveDoublePrecisionShaderAttributes","resolvedOptions","DataColumn","state","logicalType","doublePrecision","defaultValue","bufferType","defaultType","n","typedArrayManager","shaderAttributeDef","doubleShaderAttributeDefs","min","numInstances","len","max","j","v","data","toDoublePrecisionArray","ArrayType","requiredBufferSize","startOffset","endOffset","copy","oldValue","illegalArrayType","out","start","value1","value2","isIndexed","EMPTY_ARRAY","placeholderArray","createIterable","startRow","endRow","iterable","objectInfo","isAsyncIterable","getAccessorFromBuffer","typedArray","startIndices","nested","bytesPerElement","elementStride","_","index","target","sourceIndex","startIndex","endIndex","targetIndex","EMPTY","FULL","add","rangeList","range","newRangeList","insertPosition","range0","DEFAULT_TRANSITION_SETTINGS","t","normalizeTransitionSettings","userSettings","layerSettings","Attribute","range.FULL","layout","clearChangedFlags","needsRedraw","_a","a","reason","dataRange","range.add","range.EMPTY","settings","context","updateRanges","update","noAlloc","updated","isWebGPU","normalisedValue","transformedValue","binaryValue","assert","needsNormalize","row","shaderAttributeDefs","shaderAttributeName","modelInfo","stepMode","map","transform","accessorFunc","object","objectValue","numVertices","item","fillArray","limit","valid","padArrayChunk","getData","end","sourceLength","targetLength","datum","padArray","sourceStartIndices","targetStartIndices","getChunkData","chunk","nextSourceIndex","nextTargetIndex","cloneAttribute","newAttribute","getAttributeTypeFromSize","getFloat32VertexFormat","cycleBuffers","buffers","getAttributeBufferLength","multiplier","maxVertexOffset","shaderAttributes","shaderAttribute","matchBuffer","padBuffer","fromLength","toLength","fromStartIndices","precisionMultiplier","targetByteOffset","toStartIndices","hasStartIndices","isConstant","toData","getter","getMissingData","GPUTransitionBase","timeline","Transition","transitionSettings","duration","GPUInterpolationTransition","getTransform","prevLength","prevStartIndices","model","useFp64","easing","time","interpolationProps","uniformBlock","interpolationUniforms","vs64","attributeSize","attributeType","inputFormat","bufferLayout","fp64arithmetic","GPUSpringTransition","getTexture","getFramebuffer","framebuffer","transition","springProps","springUniforms","format","texture","TRANSITION_TYPES","AttributeTransitionManager","id","transitions","animatedAttributes","isNew","TransitionType","TRACE_INVALIDATE","TRACE_UPDATE_START","TRACE_UPDATE_END","TRACE_ATTRIBUTE_UPDATE_START","TRACE_ATTRIBUTE_ALLOCATE","TRACE_ATTRIBUTE_UPDATE_END","AttributeManager","stats","memoize","mergeBounds","redraw","attributeNameArray","triggerName","invalidatedAttributes","debug","accessorName","attributeTransitionManager","transitionUpdated","attributeNames","bounds","changedAttributes","overrideOptions","triggers","updateTriggers","CPUInterpolationTransition","fromValue","toValue","lerp","EPSILON","updateSpringElement","prev","cur","dest","damping","stiffness","velocity","spring","damper","updateSpring","next","distance","distanceSquare","d","CPUSpringTransition","_prevValue","_currValue","nextValue","delta","UniformTransitionManager","key","propsInTransition","validateProps","propTypes","PROP_TYPES_SYMBOL","propName","propType","validate","diffProps","oldProps","propsChangedReason","compareProps","dataChangedReason","diffDataProps","updateTriggersChangedReason","diffUpdateTriggers","diffExtensions","diffTransitions","changed","comparePropValues","newProps","ignoreProps","newProp","oldProp","equal","dataChanged","dataComparator","_dataDiff","diffUpdateTrigger","oldExtensions","extensions","newTriggers","oldTriggers","ERR_NOT_OBJECT","ERR_NOT_CONTAINER","count","container","isObject","isPlainObject","DEFAULT_TEXTURE_PARAMETERS","internalTextures","createTexture","owner","image","sampler","Texture","samplerParameters","width","height","destroyTexture","TYPE_DEFINITIONS","isArray","deepEqual","valueType","getTypeOf","compare","depth","dataTransform","parsePropTypes","propDefs","defaultProps","deprecatedProps","propDef","deprecated","parsePropType","normalizePropDefinition","createProps","propObjects","propsPrototype","getPropsPrototype","propsInstance","COMPONENT_SYMBOL","ASYNC_ORIGINAL_SYMBOL","ASYNC_RESOLVED_SYMBOL","MergedDefaultPropsCacheKey","componentClass","Component","cacheKey","extension","ExtensionClass","getOwnProperty","createPropsPrototypeAndTypes","parentClass","parentDefaultProps","componentDefaultProps","componentPropDefs","DEPRECATED_PROPS_SYMBOL","extensionDefaultProps","createPropsPrototype","addAsyncPropsToPropPrototype","addDeprecatedPropsToPropPrototype","hasOwnProperty","getComponentName","newValue","nameStr","newPropName","defaultValues","descriptors","getDescriptorForAsyncProp","ASYNC_DEFAULTS_SYMBOL","prop","componentName","counter","asyncProps","EMPTY_PROPS","ComponentState","asyncProp","resolvedValues","originalValues","url","error","loadCount","promise","LayerState","attributeManager","layer","fetch","onDataLoad","TRACE_CHANGE_FLAG","TRACE_INITIALIZE","TRACE_UPDATE","TRACE_FINALIZE","TRACE_MATCHED","MAX_PICKING_COLOR_CACHE_SIZE","areViewportsEqual","oldViewport","pickingColorCache","loaders","loadOptions","signal","resourceManager","inResourceManager","load","layerIndex","Layer","LIFECYCLE","xyz","worldToPixels","xy","partialState","info","pickingEvent","i1","i2","i3","shaders","mergeShaders","hasPickingBuffer","needsPickingBuffer","pickingColors","instancePickingColors","pickingColorsAttribute","mode","sourceLayer","message","bufferLayoutChanged","uniformTransitions","cacheSize","newCacheSize","pickingColor","excludeAttributes","attributeBuffers","constantAttributes","values","objectIndex","colors","externalColorAttribute","objectColor","oldLayer","internalState","stateNeedsUpdate","currentProps","currentViewport","updateParams","oldModels","modelChanged","shaderModuleProps","parameters","getPolygonOffset","offsets","WebGLDevice","flags","changeFlags","flagChanged","prevDataChangedReason","propsOrDataChanged","highlightColor","forceUpdate","autoHighlight","highlightedObjectIndex","attributeManagerNeedsRedraw"],"mappings":"2jBAGA,MAAMA,GAAqB;AAAA;AAAA;AAAA,GAKrBC,GAAQ;AAAA,EAAoBD,EAAO,GAiBlC,SAASE,GAAiBC,EAAS,CACtC,KAAM,CAAE,MAAAC,EAAO,cAAAC,EAAe,OAAAC,CAAM,EAAKH,GAAW,CAAA,EACpD,GAAI,CAACC,EAED,OAAOH,GAEX,GAAI,CAACI,EACD,MAAM,IAAI,MAAM,eAAe,EAEnC,MAAME,EAAYC,GAAmBH,CAAa,EAC5CI,EAAcC,GAAcN,EAAOC,CAAa,EACtD,MAAO;AAAA,KAENE,CAAS,IAAIH,CAAK;AAAA,WACZE,CAAM;AAAA;AAAA,IAEbA,CAAM,MAAMG,CAAW;AAAA,EAE3B,CAyBA,SAASD,GAAmBG,EAAU,CAElC,OAAQA,EAAQ,CACZ,IAAK,GAAG,MAAO,QACf,IAAK,GAAG,MAAO,OACf,IAAK,GAAG,MAAO,OACf,IAAK,GAAG,MAAO,OACf,QACI,MAAM,IAAI,MAAM,qBAAqBA,CAAQ,EAAE,CAC3D,CACA,CAEO,SAASD,GAAcE,EAAUD,EAAU,CAE9C,OAAQA,EAAQ,CACZ,IAAK,GAAG,MAAO,QAAQC,CAAQ,mBAC/B,IAAK,GAAG,MAAO,QAAQA,CAAQ,cAC/B,IAAK,GAAG,MAAO,QAAQA,CAAQ,SAC/B,IAAK,GAAG,OAAOA,EACf,QACI,MAAM,IAAI,MAAM,qBAAqBD,CAAQ,EAAE,CAC3D,CACA,CCtFA,MAAME,GAA0B,CAAC,EAAG,EAAG,EAAG,CAAC,EACrCC,GAAgB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;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