tangram-core 0.2.0__cp313-cp313-win_amd64.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 (171) hide show
  1. tangram_core/App.vue +335 -0
  2. tangram_core/__init__.py +5 -0
  3. tangram_core/__main__.py +141 -0
  4. tangram_core/_core.cp313-win_amd64.pyd +0 -0
  5. tangram_core/_core.pyi +38 -0
  6. tangram_core/api.ts +456 -0
  7. tangram_core/backend.py +335 -0
  8. tangram_core/colour.ts +71 -0
  9. tangram_core/config.py +122 -0
  10. tangram_core/dist-frontend/aggregation-layers.js +521 -0
  11. tangram_core/dist-frontend/aggregation-layers.js.map +1 -0
  12. tangram_core/dist-frontend/assets/_commonjsHelpers-CqkleIqs.js +2 -0
  13. tangram_core/dist-frontend/assets/_commonjsHelpers-CqkleIqs.js.map +1 -0
  14. tangram_core/dist-frontend/assets/array-utils-flat-wyE8tIYR.js +11 -0
  15. tangram_core/dist-frontend/assets/array-utils-flat-wyE8tIYR.js.map +1 -0
  16. tangram_core/dist-frontend/assets/assert-hrfsarFU.js +3 -0
  17. tangram_core/dist-frontend/assets/assert-hrfsarFU.js.map +1 -0
  18. tangram_core/dist-frontend/assets/b612-latin-400-italic-DePNXA0a.woff +0 -0
  19. tangram_core/dist-frontend/assets/b612-latin-400-italic-a-4GLPtl.woff2 +0 -0
  20. tangram_core/dist-frontend/assets/b612-latin-400-normal-CC98FVm_.woff2 +0 -0
  21. tangram_core/dist-frontend/assets/b612-latin-400-normal-JbZ7xwUX.woff +0 -0
  22. tangram_core/dist-frontend/assets/b612-latin-700-normal-B_Snq1wd.woff +0 -0
  23. tangram_core/dist-frontend/assets/b612-latin-700-normal-BinQrnoB.woff2 +0 -0
  24. tangram_core/dist-frontend/assets/clip-extension-DTCP51Ak.js +26 -0
  25. tangram_core/dist-frontend/assets/clip-extension-DTCP51Ak.js.map +1 -0
  26. tangram_core/dist-frontend/assets/color-CUNNsFV-.js +17 -0
  27. tangram_core/dist-frontend/assets/color-CUNNsFV-.js.map +1 -0
  28. tangram_core/dist-frontend/assets/cube-geometry-CzJ_uBWa.js +2 -0
  29. tangram_core/dist-frontend/assets/cube-geometry-CzJ_uBWa.js.map +1 -0
  30. tangram_core/dist-frontend/assets/deep-equal-uriyKJca.js +2 -0
  31. tangram_core/dist-frontend/assets/deep-equal-uriyKJca.js.map +1 -0
  32. tangram_core/dist-frontend/assets/fly-to-interpolator-DlKiy9_S.js +2 -0
  33. tangram_core/dist-frontend/assets/fly-to-interpolator-DlKiy9_S.js.map +1 -0
  34. tangram_core/dist-frontend/assets/geojson-layer-CLhXLxdI.js +1010 -0
  35. tangram_core/dist-frontend/assets/geojson-layer-CLhXLxdI.js.map +1 -0
  36. tangram_core/dist-frontend/assets/globe-view-DKhftlA1.js +94 -0
  37. tangram_core/dist-frontend/assets/globe-view-DKhftlA1.js.map +1 -0
  38. tangram_core/dist-frontend/assets/globe-viewport-CPES4D4P.js +2 -0
  39. tangram_core/dist-frontend/assets/globe-viewport-CPES4D4P.js.map +1 -0
  40. tangram_core/dist-frontend/assets/image-loader-ClbNCMXW.js +2 -0
  41. tangram_core/dist-frontend/assets/image-loader-ClbNCMXW.js.map +1 -0
  42. tangram_core/dist-frontend/assets/inconsolata-latin-400-normal-DTZQ6lD6.woff2 +0 -0
  43. tangram_core/dist-frontend/assets/inconsolata-latin-400-normal-HYADljCo.woff +0 -0
  44. tangram_core/dist-frontend/assets/inconsolata-latin-700-normal-ByjKuJjN.woff2 +0 -0
  45. tangram_core/dist-frontend/assets/inconsolata-latin-700-normal-DzgUY3Rl.woff +0 -0
  46. tangram_core/dist-frontend/assets/inconsolata-latin-ext-400-normal-BaHVOdFB.woff2 +0 -0
  47. tangram_core/dist-frontend/assets/inconsolata-latin-ext-400-normal-yvPjCxxx.woff +0 -0
  48. tangram_core/dist-frontend/assets/inconsolata-latin-ext-700-normal-D0Kpgs_9.woff2 +0 -0
  49. tangram_core/dist-frontend/assets/inconsolata-latin-ext-700-normal-Dlt-daqV.woff +0 -0
  50. tangram_core/dist-frontend/assets/inconsolata-vietnamese-400-normal-ByiM2lek.woff +0 -0
  51. tangram_core/dist-frontend/assets/inconsolata-vietnamese-400-normal-DfC_iMic.woff2 +0 -0
  52. tangram_core/dist-frontend/assets/inconsolata-vietnamese-700-normal-DLCFFAUf.woff +0 -0
  53. tangram_core/dist-frontend/assets/inconsolata-vietnamese-700-normal-DuasYmn8.woff2 +0 -0
  54. tangram_core/dist-frontend/assets/index-UPPakSLR.css +1 -0
  55. tangram_core/dist-frontend/assets/index-r8T0kY2p.js +821 -0
  56. tangram_core/dist-frontend/assets/index-r8T0kY2p.js.map +1 -0
  57. tangram_core/dist-frontend/assets/layer-DO63TrsS.js +555 -0
  58. tangram_core/dist-frontend/assets/layer-DO63TrsS.js.map +1 -0
  59. tangram_core/dist-frontend/assets/layer-extension-CZ3zsHuN.js +2 -0
  60. tangram_core/dist-frontend/assets/layer-extension-CZ3zsHuN.js.map +1 -0
  61. tangram_core/dist-frontend/assets/mesh-layers-BSECKarm.js +1123 -0
  62. tangram_core/dist-frontend/assets/mesh-layers-BSECKarm.js.map +1 -0
  63. tangram_core/dist-frontend/assets/orthographic-viewport-CzZmHDEZ.js +2 -0
  64. tangram_core/dist-frontend/assets/orthographic-viewport-CzZmHDEZ.js.map +1 -0
  65. tangram_core/dist-frontend/assets/pick-layers-pass-xhWsgZtf.js +2 -0
  66. tangram_core/dist-frontend/assets/pick-layers-pass-xhWsgZtf.js.map +1 -0
  67. tangram_core/dist-frontend/assets/project-CrvReKGW.js +760 -0
  68. tangram_core/dist-frontend/assets/project-CrvReKGW.js.map +1 -0
  69. tangram_core/dist-frontend/assets/roboto-condensed-cyrillic-400-italic-4qS3_zkX.woff2 +0 -0
  70. tangram_core/dist-frontend/assets/roboto-condensed-cyrillic-400-italic-CDK-EZBY.woff +0 -0
  71. tangram_core/dist-frontend/assets/roboto-condensed-cyrillic-400-normal-Bgns473E.woff +0 -0
  72. tangram_core/dist-frontend/assets/roboto-condensed-cyrillic-400-normal-_T2aQlWs.woff2 +0 -0
  73. tangram_core/dist-frontend/assets/roboto-condensed-cyrillic-500-normal-CvEVpWxD.woff +0 -0
  74. tangram_core/dist-frontend/assets/roboto-condensed-cyrillic-500-normal-s4PklZE0.woff2 +0 -0
  75. tangram_core/dist-frontend/assets/roboto-condensed-cyrillic-700-normal-9RN-Z7cI.woff2 +0 -0
  76. tangram_core/dist-frontend/assets/roboto-condensed-cyrillic-700-normal-BGMkBBYx.woff +0 -0
  77. tangram_core/dist-frontend/assets/roboto-condensed-cyrillic-ext-400-italic-C7erd-g8.woff +0 -0
  78. tangram_core/dist-frontend/assets/roboto-condensed-cyrillic-ext-400-italic-DR5R5TWx.woff2 +0 -0
  79. tangram_core/dist-frontend/assets/roboto-condensed-cyrillic-ext-400-normal-DGo1Ayjq.woff2 +0 -0
  80. tangram_core/dist-frontend/assets/roboto-condensed-cyrillic-ext-400-normal-WtM1l1qc.woff +0 -0
  81. tangram_core/dist-frontend/assets/roboto-condensed-cyrillic-ext-500-normal-C8FNIdXm.woff2 +0 -0
  82. tangram_core/dist-frontend/assets/roboto-condensed-cyrillic-ext-500-normal-TLDmfi3Q.woff +0 -0
  83. tangram_core/dist-frontend/assets/roboto-condensed-cyrillic-ext-700-normal-CTXjXnze.woff2 +0 -0
  84. tangram_core/dist-frontend/assets/roboto-condensed-cyrillic-ext-700-normal-CWPRiRXS.woff +0 -0
  85. tangram_core/dist-frontend/assets/roboto-condensed-greek-400-italic-CR6qj4Z4.woff2 +0 -0
  86. tangram_core/dist-frontend/assets/roboto-condensed-greek-400-italic-DHRaIs10.woff +0 -0
  87. tangram_core/dist-frontend/assets/roboto-condensed-greek-400-normal-D5vBSIyg.woff2 +0 -0
  88. tangram_core/dist-frontend/assets/roboto-condensed-greek-400-normal-FabMgVmk.woff +0 -0
  89. tangram_core/dist-frontend/assets/roboto-condensed-greek-500-normal-BIN62cw9.woff +0 -0
  90. tangram_core/dist-frontend/assets/roboto-condensed-greek-500-normal-Hsn-wDIp.woff2 +0 -0
  91. tangram_core/dist-frontend/assets/roboto-condensed-greek-700-normal-89Up2Xly.woff +0 -0
  92. tangram_core/dist-frontend/assets/roboto-condensed-greek-700-normal-DWMOA2VK.woff2 +0 -0
  93. tangram_core/dist-frontend/assets/roboto-condensed-latin-400-italic-D_BR-3LG.woff2 +0 -0
  94. tangram_core/dist-frontend/assets/roboto-condensed-latin-400-italic-om57GXsO.woff +0 -0
  95. tangram_core/dist-frontend/assets/roboto-condensed-latin-400-normal-BICmKrXV.woff2 +0 -0
  96. tangram_core/dist-frontend/assets/roboto-condensed-latin-400-normal-D2e7XwB1.woff +0 -0
  97. tangram_core/dist-frontend/assets/roboto-condensed-latin-500-normal-3p2daRJW.woff2 +0 -0
  98. tangram_core/dist-frontend/assets/roboto-condensed-latin-500-normal-Dc9bsamC.woff +0 -0
  99. tangram_core/dist-frontend/assets/roboto-condensed-latin-700-normal-BOl6B_hI.woff +0 -0
  100. tangram_core/dist-frontend/assets/roboto-condensed-latin-700-normal-DRbp0YnP.woff2 +0 -0
  101. tangram_core/dist-frontend/assets/roboto-condensed-latin-ext-400-italic-BXrkWnoY.woff +0 -0
  102. tangram_core/dist-frontend/assets/roboto-condensed-latin-ext-400-italic-Bhem1d5z.woff2 +0 -0
  103. tangram_core/dist-frontend/assets/roboto-condensed-latin-ext-400-normal-DT8nEsYA.woff +0 -0
  104. tangram_core/dist-frontend/assets/roboto-condensed-latin-ext-400-normal-OHaX69iP.woff2 +0 -0
  105. tangram_core/dist-frontend/assets/roboto-condensed-latin-ext-500-normal-CcSTXKtO.woff2 +0 -0
  106. tangram_core/dist-frontend/assets/roboto-condensed-latin-ext-500-normal-JgPl2bDS.woff +0 -0
  107. tangram_core/dist-frontend/assets/roboto-condensed-latin-ext-700-normal-B004qtqu.woff2 +0 -0
  108. tangram_core/dist-frontend/assets/roboto-condensed-latin-ext-700-normal-O6H_RRvN.woff +0 -0
  109. tangram_core/dist-frontend/assets/roboto-condensed-vietnamese-400-italic-BwUYFJ2t.woff2 +0 -0
  110. tangram_core/dist-frontend/assets/roboto-condensed-vietnamese-400-italic-DV8QogUk.woff +0 -0
  111. tangram_core/dist-frontend/assets/roboto-condensed-vietnamese-400-normal-0o1laQ-g.woff2 +0 -0
  112. tangram_core/dist-frontend/assets/roboto-condensed-vietnamese-400-normal-CPsdS8_S.woff +0 -0
  113. tangram_core/dist-frontend/assets/roboto-condensed-vietnamese-500-normal-G9shSJ2z.woff +0 -0
  114. tangram_core/dist-frontend/assets/roboto-condensed-vietnamese-500-normal-TFWhjk13.woff2 +0 -0
  115. tangram_core/dist-frontend/assets/roboto-condensed-vietnamese-700-normal-BtNeb9D6.woff +0 -0
  116. tangram_core/dist-frontend/assets/roboto-condensed-vietnamese-700-normal-D35V1G0s.woff2 +0 -0
  117. tangram_core/dist-frontend/assets/shader-BJmsOfPx.js +843 -0
  118. tangram_core/dist-frontend/assets/shader-BJmsOfPx.js.map +1 -0
  119. tangram_core/dist-frontend/assets/solid-polygon-layer-DiarVGxh.js +392 -0
  120. tangram_core/dist-frontend/assets/solid-polygon-layer-DiarVGxh.js.map +1 -0
  121. tangram_core/dist-frontend/assets/tesselator-49Dw9L5A.js +2 -0
  122. tangram_core/dist-frontend/assets/tesselator-49Dw9L5A.js.map +1 -0
  123. tangram_core/dist-frontend/assets/webgl-developer-tools-CZl8qVFg.js +7 -0
  124. tangram_core/dist-frontend/assets/webgl-developer-tools-CZl8qVFg.js.map +1 -0
  125. tangram_core/dist-frontend/assets/webgl-device-BY0-CUP6.js +3 -0
  126. tangram_core/dist-frontend/assets/webgl-device-BY0-CUP6.js.map +1 -0
  127. tangram_core/dist-frontend/assets/widget-BbOeHGj0.js +2 -0
  128. tangram_core/dist-frontend/assets/widget-BbOeHGj0.js.map +1 -0
  129. tangram_core/dist-frontend/core.js +60 -0
  130. tangram_core/dist-frontend/core.js.map +1 -0
  131. tangram_core/dist-frontend/extensions.js +609 -0
  132. tangram_core/dist-frontend/extensions.js.map +1 -0
  133. tangram_core/dist-frontend/favicon.ico +0 -0
  134. tangram_core/dist-frontend/favicon.png +0 -0
  135. tangram_core/dist-frontend/font-awesome.min.css +4 -0
  136. tangram_core/dist-frontend/fonts/FontAwesome.otf +0 -0
  137. tangram_core/dist-frontend/fonts/fontawesome-webfont.eot +0 -0
  138. tangram_core/dist-frontend/fonts/fontawesome-webfont.svg +2671 -0
  139. tangram_core/dist-frontend/fonts/fontawesome-webfont.ttf +0 -0
  140. tangram_core/dist-frontend/fonts/fontawesome-webfont.woff +0 -0
  141. tangram_core/dist-frontend/fonts/fontawesome-webfont.woff2 +0 -0
  142. tangram_core/dist-frontend/geo-layers.js +115 -0
  143. tangram_core/dist-frontend/geo-layers.js.map +1 -0
  144. tangram_core/dist-frontend/index.html +38 -0
  145. tangram_core/dist-frontend/json.js +3 -0
  146. tangram_core/dist-frontend/json.js.map +1 -0
  147. tangram_core/dist-frontend/layers.js +268 -0
  148. tangram_core/dist-frontend/layers.js.map +1 -0
  149. tangram_core/dist-frontend/lit-html.js +7 -0
  150. tangram_core/dist-frontend/lit-html.js.map +1 -0
  151. tangram_core/dist-frontend/mapbox.js +2 -0
  152. tangram_core/dist-frontend/mapbox.js.map +1 -0
  153. tangram_core/dist-frontend/maplibre-gl.js +59 -0
  154. tangram_core/dist-frontend/maplibre-gl.js.map +1 -0
  155. tangram_core/dist-frontend/mesh-layers.js +2 -0
  156. tangram_core/dist-frontend/mesh-layers.js.map +1 -0
  157. tangram_core/dist-frontend/rs1090_wasm.js +813 -0
  158. tangram_core/dist-frontend/rs1090_wasm_bg.wasm +0 -0
  159. tangram_core/dist-frontend/vue.esm-browser.prod.js +13 -0
  160. tangram_core/dist-frontend/widgets.js +3 -0
  161. tangram_core/dist-frontend/widgets.js.map +1 -0
  162. tangram_core/main.ts +16 -0
  163. tangram_core/plugin.py +70 -0
  164. tangram_core/plugin.ts +41 -0
  165. tangram_core/redis.py +89 -0
  166. tangram_core/user.css +114 -0
  167. tangram_core/vite-plugin-tangram.mjs +88 -0
  168. tangram_core-0.2.0.dist-info/METADATA +37 -0
  169. tangram_core-0.2.0.dist-info/RECORD +171 -0
  170. tangram_core-0.2.0.dist-info/WHEEL +4 -0
  171. tangram_core-0.2.0.dist-info/entry_points.txt +2 -0
@@ -0,0 +1 @@
1
+ {"version":3,"mappings":";wvBAGA,SAASA,GAAOC,EAAM,CAClB,MAAMC,EAAYD,EAAK,CAAC,EAClBE,EAAWF,EAAKA,EAAK,OAAS,CAAC,EACrC,OAAQC,IAAc,KAAOC,IAAa,KAASD,IAAc,KAAOC,IAAa,GACzF,CAEA,MAAAC,GAAe,CACX,SAAU,KACV,UAAW,KACX,GAAI,OACJ,KAAM,OACN,OAAQ,GACR,QAAS,GACT,QAAS,GACT,WAAY,CAAC,OAAQ,SAAS,EAC9B,UAAW,CAAC,mBAAoB,sBAAsB,EACtD,SAAUJ,GACV,cAAe,KAAK,KACxB,ECbA,SAASK,IAAe,CAGpB,MAAMC,EACA,QAEAC,EAAkB,WAAW,MAAQ,WAAW,KAAK,QAC3D,GAAIA,GAAmBA,IAAoBD,EACvC,MAAM,IAAI,MAAM,yCAAyCC,CAAe,OAAOD,CAAO,EAAE,EAE5F,OAAKC,IACDC,EAAI,IAAI,EAAG,WAAWF,CAAO,EAAE,EAAC,EAChC,WAAW,KAAO,CACd,GAAG,WAAW,KACd,QAASA,EACT,QAAAA,EACZ,IAAYE,EAEA,iBAAkBC,EAC9B,EACQC,GAAgB,CACZN,GAEA,CAACO,GAAa,CAAE,YAAa,CAAE,iBAAkB,MAAM,CAAE,CAAE,CACvE,CAAS,GAEEL,CACX,CACY,MAACM,GAAUP,GAAY,EC7B5B,MAAMQ,EAAQ,CAQjB,IAAI,YAAa,CACb,OAAOC,GAAkB,CAC7B,CACJ,CAEA,MAAMC,GAASC,GAAS,GAAM,OAAO,SAAa,IAC5CC,GAAe,IAAMF,IAAU,SAAS,aAAe,WAC7D,IAAIG,EAAkB,KAEtB,SAASJ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EAAI,KAElDvH,EAAM,SAAW0b,EAAMlU,EAAU,CAAC0hB,GAAcA,EAAY,EACrDlpB,CACX,CACJ,CACe,MAAMmpB,WAAwB3U,EAAW,CACpD,aAAc,CACV,MAAM,GAAG,SAAS,EAClB,KAAK,gBAAkByU,GACvB,KAAK,WAAa,CACd,mBAAoB,IACpB,uBAAwB,IAAI7O,GAAmB,CAAC,YAAa,WAAY,MAAM,CAAC,CAC5F,EACQ,KAAK,SAAW,KACpB,CACA,SAASpa,EAAO,CACZ,MAAM,SAASA,CAAK,EAEpB,KAAK,WAAa,GAClB,KAAK,YAAc,EACvB,CACJ,CChCA,MAAMopB,WAAkB5T,EAAK,CACzB,YAAYxV,EAAQ,GAAI,CACpB,MAAMA,CAAK,CACf,CACA,gBAAgBqU,EAAW,CACvB,OAAOA,EAAU,KAAO,GAAKkI,GAAsB8M,EACvD,CACA,IAAI,gBAAiB,CACjB,OAAOF,EACX,CACJ,CACAC,GAAU,YAAc","names":["isJSON","text","firstChar","lastChar","jsonLoader","checkVersion","version","existingVersion","log","register","registerLoaders","ImageLoader","VERSION","Adapter","getPageLoadPromise","isPage","isBrowser","isPageLoaded","pageLoadPromise","resolve","uniformBlock","layerUniforms","props","cleanTouchActions","actions","TOUCH_ACTION_NONE","hasPanX","TOUCH_ACTION_PAN_X","hasPanY","TOUCH_ACTION_PAN_Y","TOUCH_ACTION_MANIPULATION","TOUCH_ACTION_AUTO","TouchAction","manager","value","TOUCH_ACTION_COMPUTE","recognizer","VENDOR_PREFIXES","prefixed","obj","property","camelProp","prefix","prop","STOP","FORCED_STOP","defaultOptions","Manager","element","options","PointerEventInput","force","inputData","session","recognizers","curRecognizer","RecognizerState","i","recognizerName","item","existing","recognizerOrName","index","events","handler","handlers","event","splitStr","data","evt","add","name","MOUSE_EVENTS","MoveInput","Input","callback","enable","eventType","enabled","type","KEY_EVENTS","KeyInput","targetElement","ContextmenuInput","DOWN_EVENT","MOVE_EVENT","UP_EVENT","MOUSE_EVENT_BUTTON_LEFT","MOUSE_EVENT_BUTTON_MIDDLE","MOUSE_EVENT_BUTTON_RIGHT","MOUSE_EVENT_BUTTONS_LEFT_MASK","MOUSE_EVENT_BUTTONS_RIGHT_MASK","MOUSE_EVENT_BUTTONS_MIDDLE_MASK","whichButtons","buttons","button","leftButton","middleButton","rightButton","getOffsetPosition","rootElement","center","rect","scaleX","scaleY","offsetCenter","DEFAULT_OPTIONS","EventRegistrar","eventManager","mjolnirEvent","target","once","passive","handlersByElement","opts","entries","entry","insertPosition","srcElement","immediatePropagationStopped","stopPropagation","stopImmediatePropagation","entriesToRemove","normalizeRecognizer","itemArray","RecognizerType","EventManager","HammerManager","recognizeWith","requireFailure","WheelInput","eventName","eventHandler","eventRegistrar","isRecognizerUsed","eh","TILE_SIZE","normalizeViewportProps","width","height","pitch","longitude","latitude","zoom","bearing","mod","minZoom","log2","halfHeightPixels","minLatitude","worldToLngLat","maxLatitude","vertex","vs","fragment","fs","getMemoizedViewportCenterPosition","memoize","getViewportCenterPosition","getMemoizedViewProjectionMatrices","getViewProjectionMatrices","DEFAULT_SHADOW_COLOR","VECTOR_TO_POINT_MATRIX","screenToCommonSpace","xyz","pixelUnprojectionMatrix","x","y","z","coord","pixelsToWorld","viewport","Matrix4","shadowMatrices","projectionMatrices","farZ","corners","pixel","shadowMatrix","viewMatrix","Vector3","positions","corner","projectionMatrix","position","createShadowUniforms","shadowEnabled","projectProps","projectUniforms","project","projectCenters","viewProjectionMatrices","viewProjectionMatrix","viewProjectionMatrixCentered","COORDINATE_SYSTEM","PROJECTION_MODE","uniforms","shadow","DEFAULT_MODULES","geometry","SHADER_HOOKS_GLSL","SHADER_HOOKS_WGSL","getShaderAssembler","language","shaderAssembler","ShaderAssembler","shaderModule","shaderHooks","shaderHook","DEFAULT_LIGHT_COLOR","DEFAULT_LIGHT_INTENSITY","idCount","AmbientLight","color","intensity","DEFAULT_LIGHT_DIRECTION","DirectionalLight","direction","_shadow","ShadowPass","LayersPass","device","shadowMap","depthBuffer","params","pixelRatio","clearColor","layer","layerIndex","effects","otherShaderModuleProps","DEFAULT_AMBIENT_LIGHT_PROPS","DEFAULT_DIRECTIONAL_LIGHT_PROPS","LightingEffect","context","deck","key","lightSource","light","layers","layerFilter","viewports","onViewportActive","views","shadowProps","shadowPass","lightingProps","directionalLight","pointLight","materialProps","lightMatrices","ambientLight","pointLights","directionalLights","channelHandles","animationHandles","Timeline","delay","duration","rate","repeat","channelId","channel","animationHandle","animation","time","channels","animations","animationData","channelHandle","engineTime","offsetTime","totalDuration","requestAnimationFramePolyfill","cancelAnimationFramePolyfill","timerId","statIdCounter","AnimationLoop","error","luma","Stats","reason","appContext","err","timeline","display","animationProps","canvasContext","canvas","useDevicePixels","aspect","wrapperDiv","div","html","Resource","id","consumer","forceUpdate","loadCount","loader","load","result","subscriber","ResourceManager","resourceId","persistent","res","consumerId","requestId","request","resource","onChange","resources","protocol","consumers","oldResource","TRACE_SET_LAYERS","TRACE_ACTIVATE_VIEWPORT","LayerManager","debug","stats","Viewport","redraw","layerNeedsRedraw","layerIds","layerId","newLayers","flatLayers","flatten","module","defaultShaderModules","m","stage","oldLayers","oldLayerMap","oldLayer","generatedLayers","needsUpdate","newLayer","sublayers","LIFECYCLE","ViewManager","controller","viewId","viewMap","view","viewOrViewId","viewState","p","deepEqual","Controller","controllerProps","resolvedProps","oldControllers","invalidateControllers","oldController","hasController","newViews","oldViews","_","PERCENT_OR_PIXELS_REGEX","parsePosition","match","relative","getPosition","extent","View","padding","newProps","ViewConstructor","viewportDimensions","ViewportType","newViewState","dimensions","noop","TRANSITION_EVENTS","DEFAULT_EASING","t","DEFAULT_INTERRUPTION","TransitionManager","transition","interpolator","startProps","endProps","easing","Transition","nextProps","transitionTriggered","currentProps","interruption","transitionDuration","transitionInterpolator","startViewstate","endViewStateProps","initialProps","transitionSettings","NO_TRANSITION_PROPS","DEFAULT_INERTIA","INERTIA_EASING","EVENT_TYPES","pinchEventWorkaround","customEvents","eventStartBlocked","pos","inside","srcEvent","timeout","timer","inertia","scrollZoom","dragPan","dragRotate","doubleClickZoom","touchZoom","touchRotate","keyboard","isInteractive","eventNames","newControllerState","extraProps","interactionState","changed","oldViewState","newStates","alternateMode","endPos","speed","smooth","delta","scale","transitionProps","rotation","_lastPinchEvent","velocityZ","endScale","isZoomOut","funcKey","zoomSpeed","moveSpeed","rotateSpeedX","rotateSpeedY","controllerState","LinearInterpolator","ViewState","state","PITCH_MOUSE_THRESHOLD","PITCH_ACCEL","MapState","altitude","maxZoom","maxPitch","minPitch","startPanLngLat","startZoomLngLat","startRotatePos","startBearing","startPitch","startZoom","normalize","assert","startPos","deltaAngleX","deltaAngleY","newRotation","clamp","zoomedViewport","fromProps","offset","deltaX","deltaY","centerY","startY","deltaScaleX","deltaScaleY","MapController","oldProps","MapView","WebMercatorViewport","DEFAULT_LIGHTING_EFFECT","compareEffects","e1","e2","o1","o2","EffectManager","effect","defaultEffects","e","oldEffectsMap","nextEffects","oldEffect","effectToAdd","removedEffectId","DrawLayersPass","operation","TRACE_RENDER_LAYERS","DeckRenderer","PickLayersPass","layerPass","renderOpts","outputBuffer","renderStats","renderBuffers","buffer","size","texture","NO_PICKED_OBJECT","getClosestObject","pickedColors","decodePickingColor","deviceX","deviceY","deviceRadius","deviceRect","minSquareDistanceToCenter","closestPixelIndex","row","dy","dy2","col","dx","d2","pickedColor","pickedObject","getUniqueObjects","uniqueColors","colorKey","getEmptyPickingInfo","pickInfo","pickedViewport","getViewportFromCoordinates","coordinate","point","processPickInfo","lastPickedInfo","mode","pickedLayer","pickedObjectIndex","affectedLayers","lastPickedPixelIndex","lastPickedLayerId","pickedLayerId","lastPickedLayer","baseInfo","infos","info","getLayerPickingInfo","rootLayer","sourceLayer","DeckPicker","lastPickedViewportId","l","v","depthFBO","pickableLayers","radius","depth","unproject3D","devicePixelRange","devicePixel","cullRect","pickedResult","pickedColors2","maxObjects","leftTop","deviceLeft","deviceTop","rightBottom","deviceRight","deviceBottom","pickInfos","uniquePickedObjects","uniqueInfos","limitMaxObjects","uniqueObjectsInLayer","pickedObjectKey","pass","pickZ","pickingFBO","deviceWidth","deviceHeight","PLACEMENTS","DEFAULT_PLACEMENT","ROOT_CONTAINER_ID","WidgetManager","parentElement","nextWidgets","widget","w","viewportsById","acc","eventHandlerProp","EVENT_HANDLERS","oldWidgetMap","oldWidget","placement","containerId","viewContainer","container","canvasWidth","canvasHeight","visible","defaultStyle","TooltipWidget","Widget","el","getTooltip","displayInfo","WEBGL1_STATIC_EXTENSIONS","getWEBGL_draw_buffers","gl","buffers","getOES_vertex_array_object","vertexArray","getANGLE_instanced_arrays","args","enforceWebGL2","enforce","prototype","contextId","polyfillWebGL1Extensions","boundExtensions","originalGetExtension","extensionName","ext","originalGetSupportedExtensions","LOG_LEVEL","WebGLAdapter","Device","DEFAULT_SPECTOR_PROPS","handle","WebGLDevice","__vitePreload","isWebGL","createCanvasContext","promises","loadWebGLDeveloperTools","loadSpectorJS","results","message","webgl2Adapter","getCursor","isDragging","defaultProps","Deck","_pickRequest","layerHandler","rootHandler","handled","pickedInfo","deviceOrPromise","typedArrayManager","viewManagerNeedsRedraw","layerManagerNeedsRedraw","effectManagerNeedsRedraw","deckRendererNeedsRedraw","redrawReason","resourceIds","method","statKey","cssWidth","cssHeight","newWidth","newHeight","onError","canvasContextUserProps","canvasContextProps","deviceProps","defaultCanvasProps","normalizedViews","emptyInfo","RECOGNIZERS","RecognizerConstructor","requestFailure","optionsOverride","renderOptions","animationLoopStats","metrics","memoryStats","GlobeState","MAX_LATITUDE","GlobeController","GlobeView","GlobeViewport"],"ignoreList":[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47],"sources":["../../../../../../node_modules/.pnpm/@deck.gl+core@9.2.2/node_modules/@deck.gl/core/dist/utils/json-loader.js","../../../../../../node_modules/.pnpm/@deck.gl+core@9.2.2/node_modules/@deck.gl/core/dist/lib/init.js","../../../../../../node_modules/.pnpm/@luma.gl+core@9.2.4/node_modules/@luma.gl/core/dist/adapter/adapter.js","../../../../../../node_modules/.pnpm/@deck.gl+core@9.2.2/node_modules/@deck.gl/core/dist/shaderlib/misc/layer-uniforms.js","../../../../../../node_modules/.pnpm/mjolnir.js@3.0.0/node_modules/mjolnir.js/dist/hammerjs/touchaction/clean-touch-actions.js","../../../../../../node_modules/.pnpm/mjolnir.js@3.0.0/node_modules/mjolnir.js/dist/hammerjs/touchaction/touchaction.js","../../../../../../node_modules/.pnpm/mjolnir.js@3.0.0/node_modules/mjolnir.js/dist/hammerjs/utils/prefixed.js","../../../../../../node_modules/.pnpm/mjolnir.js@3.0.0/node_modules/mjolnir.js/dist/hammerjs/manager.js","../../../../../../node_modules/.pnpm/mjolnir.js@3.0.0/node_modules/mjolnir.js/dist/inputs/move-input.js","../../../../../../node_modules/.pnpm/mjolnir.js@3.0.0/node_modules/mjolnir.js/dist/inputs/key-input.js","../../../../../../node_modules/.pnpm/mjolnir.js@3.0.0/node_modules/mjolnir.js/dist/inputs/contextmenu-input.js","../../../../../../node_modules/.pnpm/mjolnir.js@3.0.0/node_modules/mjolnir.js/dist/utils/event-utils.js","../../../../../../node_modules/.pnpm/mjolnir.js@3.0.0/node_modules/mjolnir.js/dist/utils/event-registrar.js","../../../../../../node_modules/.pnpm/mjolnir.js@3.0.0/node_modules/mjolnir.js/dist/event-manager.js","../../../../../../node_modules/.pnpm/@math.gl+web-mercator@4.1.0/node_modules/@math.gl/web-mercator/dist/normalize-viewport-props.js","../../../../../../node_modules/.pnpm/@deck.gl+core@9.2.2/node_modules/@deck.gl/core/dist/shaderlib/shadow/shadow.js","../../../../../../node_modules/.pnpm/@deck.gl+core@9.2.2/node_modules/@deck.gl/core/dist/shaderlib/index.js","../../../../../../node_modules/.pnpm/@deck.gl+core@9.2.2/node_modules/@deck.gl/core/dist/effects/lighting/ambient-light.js","../../../../../../node_modules/.pnpm/@deck.gl+core@9.2.2/node_modules/@deck.gl/core/dist/effects/lighting/directional-light.js","../../../../../../node_modules/.pnpm/@deck.gl+core@9.2.2/node_modules/@deck.gl/core/dist/passes/shadow-pass.js","../../../../../../node_modules/.pnpm/@deck.gl+core@9.2.2/node_modules/@deck.gl/core/dist/effects/lighting/lighting-effect.js","../../../../../../node_modules/.pnpm/@luma.gl+engine@9.2.4_@luma.gl+core@9.2.4_@luma.gl+shadertools@9.2.4_@luma.gl+core@9.2.4_/node_modules/@luma.gl/engine/dist/animation/timeline.js","../../../../../../node_modules/.pnpm/@luma.gl+engine@9.2.4_@luma.gl+core@9.2.4_@luma.gl+shadertools@9.2.4_@luma.gl+core@9.2.4_/node_modules/@luma.gl/engine/dist/animation-loop/request-animation-frame.js","../../../../../../node_modules/.pnpm/@luma.gl+engine@9.2.4_@luma.gl+core@9.2.4_@luma.gl+shadertools@9.2.4_@luma.gl+core@9.2.4_/node_modules/@luma.gl/engine/dist/animation-loop/animation-loop.js","../../../../../../node_modules/.pnpm/@deck.gl+core@9.2.2/node_modules/@deck.gl/core/dist/lib/resource/resource.js","../../../../../../node_modules/.pnpm/@deck.gl+core@9.2.2/node_modules/@deck.gl/core/dist/lib/resource/resource-manager.js","../../../../../../node_modules/.pnpm/@deck.gl+core@9.2.2/node_modules/@deck.gl/core/dist/lib/layer-manager.js","../../../../../../node_modules/.pnpm/@deck.gl+core@9.2.2/node_modules/@deck.gl/core/dist/lib/view-manager.js","../../../../../../node_modules/.pnpm/@deck.gl+core@9.2.2/node_modules/@deck.gl/core/dist/utils/positions.js","../../../../../../node_modules/.pnpm/@deck.gl+core@9.2.2/node_modules/@deck.gl/core/dist/views/view.js","../../../../../../node_modules/.pnpm/@deck.gl+core@9.2.2/node_modules/@deck.gl/core/dist/controllers/transition-manager.js","../../../../../../node_modules/.pnpm/@deck.gl+core@9.2.2/node_modules/@deck.gl/core/dist/controllers/controller.js","../../../../../../node_modules/.pnpm/@deck.gl+core@9.2.2/node_modules/@deck.gl/core/dist/controllers/view-state.js","../../../../../../node_modules/.pnpm/@deck.gl+core@9.2.2/node_modules/@deck.gl/core/dist/controllers/map-controller.js","../../../../../../node_modules/.pnpm/@deck.gl+core@9.2.2/node_modules/@deck.gl/core/dist/views/map-view.js","../../../../../../node_modules/.pnpm/@deck.gl+core@9.2.2/node_modules/@deck.gl/core/dist/lib/effect-manager.js","../../../../../../node_modules/.pnpm/@deck.gl+core@9.2.2/node_modules/@deck.gl/core/dist/passes/draw-layers-pass.js","../../../../../../node_modules/.pnpm/@deck.gl+core@9.2.2/node_modules/@deck.gl/core/dist/lib/deck-renderer.js","../../../../../../node_modules/.pnpm/@deck.gl+core@9.2.2/node_modules/@deck.gl/core/dist/lib/picking/query-object.js","../../../../../../node_modules/.pnpm/@deck.gl+core@9.2.2/node_modules/@deck.gl/core/dist/lib/picking/pick-info.js","../../../../../../node_modules/.pnpm/@deck.gl+core@9.2.2/node_modules/@deck.gl/core/dist/lib/deck-picker.js","../../../../../../node_modules/.pnpm/@deck.gl+core@9.2.2/node_modules/@deck.gl/core/dist/lib/widget-manager.js","../../../../../../node_modules/.pnpm/@deck.gl+core@9.2.2/node_modules/@deck.gl/core/dist/lib/tooltip-widget.js","../../../../../../node_modules/.pnpm/@luma.gl+webgl@9.2.4_@luma.gl+core@9.2.4/node_modules/@luma.gl/webgl/dist/context/polyfills/polyfill-webgl1-extensions.js","../../../../../../node_modules/.pnpm/@luma.gl+webgl@9.2.4_@luma.gl+core@9.2.4/node_modules/@luma.gl/webgl/dist/adapter/webgl-adapter.js","../../../../../../node_modules/.pnpm/@deck.gl+core@9.2.2/node_modules/@deck.gl/core/dist/lib/deck.js","../../../../../../node_modules/.pnpm/@deck.gl+core@9.2.2/node_modules/@deck.gl/core/dist/controllers/globe-controller.js","../../../../../../node_modules/.pnpm/@deck.gl+core@9.2.2/node_modules/@deck.gl/core/dist/views/globe-view.js"],"sourcesContent":["// deck.gl\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\nfunction isJSON(text) {\n const firstChar = text[0];\n const lastChar = text[text.length - 1];\n return (firstChar === '{' && lastChar === '}') || (firstChar === '[' && lastChar === ']');\n}\n// A light weight version instead of @loaders.gl/json (stream processing etc.)\nexport default {\n dataType: null,\n batchType: null,\n id: 'JSON',\n name: 'JSON',\n module: '',\n version: '',\n options: {},\n extensions: ['json', 'geojson'],\n mimeTypes: ['application/json', 'application/geo+json'],\n testText: isJSON,\n parseTextSync: JSON.parse\n};\n//# sourceMappingURL=json-loader.js.map","// deck.gl\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\nimport { registerLoaders } from '@loaders.gl/core';\nimport { ImageLoader } from '@loaders.gl/images';\nimport log from \"../utils/log.js\";\nimport { register } from \"../debug/index.js\";\nimport jsonLoader from \"../utils/json-loader.js\";\nfunction checkVersion() {\n // Version detection using typescript plugin.\n // Fallback for tests and SSR since global variable is defined by esbuild.\n const version = typeof \"9.2.2\" !== 'undefined'\n ? \"9.2.2\" : globalThis.DECK_VERSION || 'untranspiled source';\n // Note: a `deck` object not created by deck.gl may exist in the global scope\n const existingVersion = globalThis.deck && globalThis.deck.VERSION;\n if (existingVersion && existingVersion !== version) {\n throw new Error(`deck.gl - multiple versions detected: ${existingVersion} vs ${version}`);\n }\n if (!existingVersion) {\n log.log(1, `deck.gl ${version}`)();\n globalThis.deck = {\n ...globalThis.deck,\n VERSION: version,\n version,\n log,\n // experimental\n _registerLoggers: register\n };\n registerLoaders([\n jsonLoader,\n // @ts-expect-error non-standard Loader format\n [ImageLoader, { imagebitmap: { premultiplyAlpha: 'none' } }]\n ]);\n }\n return version;\n}\nexport const VERSION = checkVersion();\n//# sourceMappingURL=init.js.map","// luma.gl\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\nimport { isBrowser } from '@probe.gl/env';\n/**\n * Create and attach devices for a specific backend.\n */\nexport class Adapter {\n /**\n * Page load promise\n * Resolves when the DOM is loaded.\n * @note Since are be limitations on number of `load` event listeners,\n * it is recommended avoid calling this accessor until actually needed.\n * I.e. we don't call it unless you know that you will be looking up a string in the DOM.\n */\n get pageLoaded() {\n return getPageLoadPromise();\n }\n}\n// HELPER FUNCTIONS\nconst isPage = isBrowser() && typeof document !== 'undefined';\nconst isPageLoaded = () => isPage && document.readyState === 'complete';\nlet pageLoadPromise = null;\n/** Returns a promise that resolves when the page is loaded */\nfunction getPageLoadPromise() {\n if (!pageLoadPromise) {\n if (isPageLoaded() || typeof window === 'undefined') {\n pageLoadPromise = Promise.resolve();\n }\n else {\n pageLoadPromise = new Promise(resolve => window.addEventListener('load', () => resolve()));\n }\n }\n return pageLoadPromise;\n}\n//# sourceMappingURL=adapter.js.map","// deck.gl\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\nconst uniformBlock = `\\\nuniform layerUniforms {\n uniform float opacity;\n} layer;\n`;\nexport const layerUniforms = {\n name: 'layer',\n vs: uniformBlock,\n fs: uniformBlock,\n getUniforms: (props) => {\n return {\n // apply gamma to opacity to make it visually \"linear\"\n // TODO - v10: use raw opacity?\n opacity: Math.pow(props.opacity, 1 / 2.2)\n };\n },\n uniformTypes: {\n opacity: 'f32'\n }\n};\n//# sourceMappingURL=layer-uniforms.js.map","import { TOUCH_ACTION_NONE, TOUCH_ACTION_PAN_X, TOUCH_ACTION_PAN_Y, TOUCH_ACTION_MANIPULATION, TOUCH_ACTION_AUTO } from \"./touchaction-Consts.js\";\n/**\n * when the touchActions are collected they are not a valid value, so we need to clean things up. *\n * @returns valid touchAction\n */\nexport default function cleanTouchActions(actions) {\n // none\n if (actions.includes(TOUCH_ACTION_NONE)) {\n return TOUCH_ACTION_NONE;\n }\n const hasPanX = actions.includes(TOUCH_ACTION_PAN_X);\n const hasPanY = actions.includes(TOUCH_ACTION_PAN_Y);\n // if both pan-x and pan-y are set (different recognizers\n // for different directions, e.g. horizontal pan but vertical swipe?)\n // we need none (as otherwise with pan-x pan-y combined none of these\n // recognizers will work, since the browser would handle all panning\n if (hasPanX && hasPanY) {\n return TOUCH_ACTION_NONE;\n }\n // pan-x OR pan-y\n if (hasPanX || hasPanY) {\n return hasPanX ? TOUCH_ACTION_PAN_X : TOUCH_ACTION_PAN_Y;\n }\n // manipulation\n if (actions.includes(TOUCH_ACTION_MANIPULATION)) {\n return TOUCH_ACTION_MANIPULATION;\n }\n return TOUCH_ACTION_AUTO;\n}\n//# sourceMappingURL=clean-touch-actions.js.map","import { TOUCH_ACTION_COMPUTE } from \"./touchaction-Consts.js\";\nimport cleanTouchActions from \"./clean-touch-actions.js\";\n/**\n * Touch Action\n * sets the touchAction property or uses the js alternative\n */\nexport class TouchAction {\n constructor(manager, value) {\n this.actions = '';\n this.manager = manager;\n this.set(value);\n }\n /**\n * set the touchAction value on the element or enable the polyfill\n */\n set(value) {\n // find out the touch-action by the event handlers\n if (value === TOUCH_ACTION_COMPUTE) {\n value = this.compute();\n }\n if (this.manager.element) {\n this.manager.element.style.touchAction = value;\n this.actions = value;\n }\n }\n /**\n * just re-set the touchAction value\n */\n update() {\n this.set(this.manager.options.touchAction);\n }\n /**\n * compute the value for the touchAction property based on the recognizer's settings\n */\n compute() {\n let actions = [];\n for (const recognizer of this.manager.recognizers) {\n if (recognizer.options.enable) {\n actions = actions.concat(recognizer.getTouchAction());\n }\n }\n return cleanTouchActions(actions.join(' '));\n }\n}\n//# sourceMappingURL=touchaction.js.map","const VENDOR_PREFIXES = ['', 'webkit', 'Moz', 'MS', 'ms', 'o'];\n/**\n * get the prefixed property\n * @returns prefixed property name\n */\nexport function prefixed(obj, property) {\n const camelProp = property[0].toUpperCase() + property.slice(1);\n for (const prefix of VENDOR_PREFIXES) {\n const prop = prefix ? prefix + camelProp : property;\n if (prop in obj) {\n return prop;\n }\n }\n return undefined;\n}\n//# sourceMappingURL=prefixed.js.map","import { TouchAction } from \"./touchaction/touchaction.js\";\nimport { PointerEventInput } from \"./inputs/pointerevent.js\";\nimport { splitStr } from \"./utils/split-str.js\";\nimport { prefixed } from \"./utils/prefixed.js\";\nimport { RecognizerState } from \"./recognizer/recognizer-state.js\";\nconst STOP = 1;\nconst FORCED_STOP = 2;\nconst defaultOptions = {\n touchAction: 'compute',\n enable: true,\n inputTarget: null,\n cssProps: {\n /**\n * Disables text selection to improve the dragging gesture. Mainly for desktop browsers.\n */\n userSelect: 'none',\n /**\n * (Webkit) Disable default dragging behavior\n */\n // @ts-ignore\n userDrag: 'none',\n /**\n * (iOS only) Disables the default callout shown when you touch and hold a touch target.\n * When you touch and hold a touch target such as a link, Safari displays\n * a callout containing information about the link. This property allows you to disable that callout.\n */\n // @ts-ignore\n touchCallout: 'none',\n /**\n * (iOS only) Sets the color of the highlight that appears over a link while it's being tapped.\n */\n // @ts-ignore\n tapHighlightColor: 'rgba(0,0,0,0)'\n }\n};\n/**\n * Manager\n */\nexport class Manager {\n constructor(element, options) {\n this.options = {\n ...defaultOptions,\n ...options,\n cssProps: { ...defaultOptions.cssProps, ...options.cssProps },\n inputTarget: options.inputTarget || element\n };\n this.handlers = {};\n this.session = {};\n this.recognizers = [];\n this.oldCssProps = {};\n this.element = element;\n this.input = new PointerEventInput(this);\n this.touchAction = new TouchAction(this, this.options.touchAction);\n this.toggleCssProps(true);\n }\n /**\n * set options\n */\n set(options) {\n Object.assign(this.options, options);\n // Options that need a little more setup\n if (options.touchAction) {\n this.touchAction.update();\n }\n if (options.inputTarget) {\n // Clean up existing event listeners and reinitialize\n this.input.destroy();\n this.input.target = options.inputTarget;\n this.input.init();\n }\n return this;\n }\n /**\n * stop recognizing for this session.\n * This session will be discarded, when a new [input]start event is fired.\n * When forced, the recognizer cycle is stopped immediately.\n */\n stop(force) {\n this.session.stopped = force ? FORCED_STOP : STOP;\n }\n /**\n * run the recognizers!\n * called by the inputHandler function on every movement of the pointers (touches)\n * it walks through all the recognizers and tries to detect the gesture that is being made\n */\n recognize(inputData) {\n const { session } = this;\n if (session.stopped) {\n return;\n }\n // run the touch-action polyfill\n if (this.session.prevented) {\n inputData.srcEvent.preventDefault();\n }\n let recognizer;\n const { recognizers } = this;\n // this holds the recognizer that is being recognized.\n // so the recognizer's state needs to be BEGAN, CHANGED, ENDED or RECOGNIZED\n // if no recognizer is detecting a thing, it is set to `null`\n let { curRecognizer } = session;\n // reset when the last recognizer is recognized\n // or when we're in a new session\n if (!curRecognizer || (curRecognizer && curRecognizer.state & RecognizerState.Recognized)) {\n curRecognizer = session.curRecognizer = null;\n }\n let i = 0;\n while (i < recognizers.length) {\n recognizer = recognizers[i];\n // find out if we are allowed try to recognize the input for this one.\n // 1. allow if the session is NOT forced stopped (see the .stop() method)\n // 2. allow if we still haven't recognized a gesture in this session, or the this recognizer is the one\n // that is being recognized.\n // 3. allow if the recognizer is allowed to run simultaneous with the current recognized recognizer.\n // this can be setup with the `recognizeWith()` method on the recognizer.\n if (session.stopped !== FORCED_STOP && // 1\n (!curRecognizer ||\n recognizer === curRecognizer || // 2\n recognizer.canRecognizeWith(curRecognizer))) {\n // 3\n recognizer.recognize(inputData);\n }\n else {\n recognizer.reset();\n }\n // if the recognizer has been recognizing the input as a valid gesture, we want to store this one as the\n // current active recognizer. but only if we don't already have an active recognizer\n if (!curRecognizer &&\n recognizer.state & (RecognizerState.Began | RecognizerState.Changed | RecognizerState.Ended)) {\n curRecognizer = session.curRecognizer = recognizer;\n }\n i++;\n }\n }\n /**\n * get a recognizer by its event name.\n */\n get(recognizerName) {\n const { recognizers } = this;\n for (let i = 0; i < recognizers.length; i++) {\n if (recognizers[i].options.event === recognizerName) {\n return recognizers[i];\n }\n }\n return null;\n }\n /**\n * add a recognizer to the manager\n * existing recognizers with the same event name will be removed\n */\n add(recognizer) {\n if (Array.isArray(recognizer)) {\n for (const item of recognizer) {\n this.add(item);\n }\n return this;\n }\n // remove existing\n const existing = this.get(recognizer.options.event);\n if (existing) {\n this.remove(existing);\n }\n this.recognizers.push(recognizer);\n recognizer.manager = this;\n this.touchAction.update();\n return recognizer;\n }\n /**\n * remove a recognizer by name or instance\n */\n remove(recognizerOrName) {\n if (Array.isArray(recognizerOrName)) {\n for (const item of recognizerOrName) {\n this.remove(item);\n }\n return this;\n }\n const recognizer = typeof recognizerOrName === 'string' ? this.get(recognizerOrName) : recognizerOrName;\n // let's make sure this recognizer exists\n if (recognizer) {\n const { recognizers } = this;\n const index = recognizers.indexOf(recognizer);\n if (index !== -1) {\n recognizers.splice(index, 1);\n this.touchAction.update();\n }\n }\n return this;\n }\n /**\n * bind event\n */\n on(events, handler) {\n if (!events || !handler) {\n return;\n }\n const { handlers } = this;\n for (const event of splitStr(events)) {\n handlers[event] = handlers[event] || [];\n handlers[event].push(handler);\n }\n }\n /**\n * unbind event, leave hander blank to remove all handlers\n */\n off(events, handler) {\n if (!events) {\n return;\n }\n const { handlers } = this;\n for (const event of splitStr(events)) {\n if (!handler) {\n delete handlers[event];\n }\n else if (handlers[event]) {\n handlers[event].splice(handlers[event].indexOf(handler), 1);\n }\n }\n }\n /**\n * emit event to the listeners\n */\n emit(event, data) {\n // no handlers, so skip it all\n const handlers = this.handlers[event] && this.handlers[event].slice();\n if (!handlers || !handlers.length) {\n return;\n }\n const evt = data;\n evt.type = event;\n evt.preventDefault = function () {\n data.srcEvent.preventDefault();\n };\n let i = 0;\n while (i < handlers.length) {\n handlers[i](evt);\n i++;\n }\n }\n /**\n * destroy the manager and unbinds all events\n * it doesn't unbind dom events, that is the user own responsibility\n */\n destroy() {\n this.toggleCssProps(false);\n this.handlers = {};\n this.session = {};\n this.input.destroy();\n this.element = null;\n }\n /**\n * add/remove the css properties as defined in manager.options.cssProps\n */\n toggleCssProps(add) {\n const { element } = this;\n if (!element) {\n return;\n }\n for (const [name, value] of Object.entries(this.options.cssProps)) {\n const prop = prefixed(element.style, name);\n if (add) {\n this.oldCssProps[prop] = element.style[prop];\n element.style[prop] = value;\n }\n else {\n element.style[prop] = this.oldCssProps[prop] || '';\n }\n }\n if (!add) {\n this.oldCssProps = {};\n }\n }\n}\n//# sourceMappingURL=manager.js.map","// mjolnir.js\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\nimport { Input } from \"./input.js\";\nconst MOUSE_EVENTS = [\n 'mousedown',\n 'mousemove',\n 'mouseup',\n 'mouseover',\n 'mouseout',\n 'mouseleave'\n];\n/**\n * Hammer.js swallows 'move' events (for pointer/touch/mouse)\n * when the pointer is not down. This class sets up a handler\n * specifically for these events to work around this limitation.\n * Note that this could be extended to more intelligently handle\n * move events across input types, e.g. storing multiple simultaneous\n * pointer/touch events, calculating speed/direction, etc.\n */\nexport class MoveInput extends Input {\n constructor(element, callback, options) {\n super(element, callback, { enable: true, ...options });\n this.handleEvent = (event) => {\n this.handleOverEvent(event);\n this.handleOutEvent(event);\n this.handleEnterEvent(event);\n this.handleLeaveEvent(event);\n this.handleMoveEvent(event);\n };\n this.pressed = false;\n const { enable } = this.options;\n this.enableMoveEvent = enable;\n this.enableLeaveEvent = enable;\n this.enableEnterEvent = enable;\n this.enableOutEvent = enable;\n this.enableOverEvent = enable;\n MOUSE_EVENTS.forEach((event) => element.addEventListener(event, this.handleEvent));\n }\n destroy() {\n MOUSE_EVENTS.forEach((event) => this.element.removeEventListener(event, this.handleEvent));\n }\n /**\n * Enable this input (begin processing events)\n * if the specified event type is among those handled by this input.\n */\n enableEventType(eventType, enabled) {\n switch (eventType) {\n case 'pointermove':\n this.enableMoveEvent = enabled;\n break;\n case 'pointerover':\n this.enableOverEvent = enabled;\n break;\n case 'pointerout':\n this.enableOutEvent = enabled;\n break;\n case 'pointerenter':\n this.enableEnterEvent = enabled;\n break;\n case 'pointerleave':\n this.enableLeaveEvent = enabled;\n break;\n default:\n // ignore\n }\n }\n handleOverEvent(event) {\n if (this.enableOverEvent && event.type === 'mouseover') {\n this._emit('pointerover', event);\n }\n }\n handleOutEvent(event) {\n if (this.enableOutEvent && event.type === 'mouseout') {\n this._emit('pointerout', event);\n }\n }\n handleEnterEvent(event) {\n if (this.enableEnterEvent && event.type === 'mouseenter') {\n this._emit('pointerenter', event);\n }\n }\n handleLeaveEvent(event) {\n if (this.enableLeaveEvent && event.type === 'mouseleave') {\n this._emit('pointerleave', event);\n }\n }\n handleMoveEvent(event) {\n if (this.enableMoveEvent) {\n switch (event.type) {\n case 'mousedown':\n if (event.button >= 0) {\n // Button is down\n this.pressed = true;\n }\n break;\n case 'mousemove':\n // Move events use `bottons` to track the button being pressed\n if (event.buttons === 0) {\n // Button is not down\n this.pressed = false;\n }\n if (!this.pressed) {\n // Drag events are emitted by hammer already\n // we just need to emit the move event on hover\n this._emit('pointermove', event);\n }\n break;\n case 'mouseup':\n this.pressed = false;\n break;\n default:\n }\n }\n }\n _emit(type, event) {\n this.callback({\n type,\n center: {\n x: event.clientX,\n y: event.clientY\n },\n srcEvent: event,\n pointerType: 'mouse',\n target: event.target\n });\n }\n}\n//# sourceMappingURL=move-input.js.map","// mjolnir.js\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\nimport { Input } from \"./input.js\";\nconst KEY_EVENTS = ['keydown', 'keyup'];\nexport class KeyInput extends Input {\n constructor(element, callback, options) {\n super(element, callback, { enable: true, tabIndex: 0, ...options });\n this.handleEvent = (event) => {\n // Ignore if focused on text input\n const targetElement = (event.target || event.srcElement);\n if ((targetElement.tagName === 'INPUT' && targetElement.type === 'text') ||\n targetElement.tagName === 'TEXTAREA') {\n return;\n }\n if (this.enableDownEvent && event.type === 'keydown') {\n this.callback({\n type: 'keydown',\n srcEvent: event,\n key: event.key,\n target: event.target\n });\n }\n if (this.enableUpEvent && event.type === 'keyup') {\n this.callback({\n type: 'keyup',\n srcEvent: event,\n key: event.key,\n target: event.target\n });\n }\n };\n this.enableDownEvent = this.options.enable;\n this.enableUpEvent = this.options.enable;\n element.tabIndex = this.options.tabIndex;\n element.style.outline = 'none';\n KEY_EVENTS.forEach((event) => element.addEventListener(event, this.handleEvent));\n }\n destroy() {\n KEY_EVENTS.forEach((event) => this.element.removeEventListener(event, this.handleEvent));\n }\n /**\n * Enable this input (begin processing events)\n * if the specified event type is among those handled by this input.\n */\n enableEventType(eventType, enabled) {\n if (eventType === 'keydown') {\n this.enableDownEvent = enabled;\n }\n if (eventType === 'keyup') {\n this.enableUpEvent = enabled;\n }\n }\n}\n//# sourceMappingURL=key-input.js.map","// mjolnir.js\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\nimport { Input } from \"./input.js\";\nexport class ContextmenuInput extends Input {\n constructor(element, callback, options) {\n super(element, callback, options);\n this.handleEvent = (event) => {\n if (!this.options.enable) {\n return;\n }\n this.callback({\n type: 'contextmenu',\n center: {\n x: event.clientX,\n y: event.clientY\n },\n srcEvent: event,\n pointerType: 'mouse',\n target: event.target\n });\n };\n element.addEventListener('contextmenu', this.handleEvent);\n }\n destroy() {\n this.element.removeEventListener('contextmenu', this.handleEvent);\n }\n /**\n * Enable this input (begin processing events)\n * if the specified event type is among those handled by this input.\n */\n enableEventType(eventType, enabled) {\n if (eventType === 'contextmenu') {\n this.options.enable = enabled;\n }\n }\n}\n//# sourceMappingURL=contextmenu-input.js.map","// mjolnir.js\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\n/* Constants */\nconst DOWN_EVENT = 1;\nconst MOVE_EVENT = 2;\nconst UP_EVENT = 4;\nconst MOUSE_EVENTS = {\n pointerdown: DOWN_EVENT,\n pointermove: MOVE_EVENT,\n pointerup: UP_EVENT,\n mousedown: DOWN_EVENT,\n mousemove: MOVE_EVENT,\n mouseup: UP_EVENT\n};\n// MouseEvent.button https://developer.mozilla.org/en-US/docs/Web/API/MouseEvent/button\nconst MOUSE_EVENT_BUTTON_LEFT = 0;\nconst MOUSE_EVENT_BUTTON_MIDDLE = 1;\nconst MOUSE_EVENT_BUTTON_RIGHT = 2;\n// MouseEvent.buttons https://developer.mozilla.org/en-US/docs/Web/API/MouseEvent/buttons\nconst MOUSE_EVENT_BUTTONS_LEFT_MASK = 1;\nconst MOUSE_EVENT_BUTTONS_RIGHT_MASK = 2;\nconst MOUSE_EVENT_BUTTONS_MIDDLE_MASK = 4;\n/**\n * Extract the involved mouse button\n */\nexport function whichButtons(event) {\n const eventType = MOUSE_EVENTS[event.srcEvent.type];\n if (!eventType) {\n // Not a mouse evet\n return null;\n }\n const { buttons, button } = event.srcEvent;\n let leftButton = false;\n let middleButton = false;\n let rightButton = false;\n if (eventType === MOVE_EVENT) {\n leftButton = Boolean(buttons & MOUSE_EVENT_BUTTONS_LEFT_MASK);\n middleButton = Boolean(buttons & MOUSE_EVENT_BUTTONS_MIDDLE_MASK);\n rightButton = Boolean(buttons & MOUSE_EVENT_BUTTONS_RIGHT_MASK);\n }\n else {\n leftButton = button === MOUSE_EVENT_BUTTON_LEFT;\n middleButton = button === MOUSE_EVENT_BUTTON_MIDDLE;\n rightButton = button === MOUSE_EVENT_BUTTON_RIGHT;\n }\n return { leftButton, middleButton, rightButton };\n}\n/**\n * Calculate event position relative to the root element\n */\nexport function getOffsetPosition(event, rootElement) {\n const center = event.center;\n // `center` is a hammer.js event property\n if (!center) {\n // Not a gestural event\n return null;\n }\n const rect = rootElement.getBoundingClientRect();\n // Fix scale for map affected by a CSS transform.\n // See https://stackoverflow.com/a/26893663/3528533\n const scaleX = rect.width / rootElement.offsetWidth || 1;\n const scaleY = rect.height / rootElement.offsetHeight || 1;\n // Calculate center relative to the root element\n const offsetCenter = {\n x: (center.x - rect.left - rootElement.clientLeft) / scaleX,\n y: (center.y - rect.top - rootElement.clientTop) / scaleY\n };\n return { center, offsetCenter };\n}\n//# sourceMappingURL=event-utils.js.map","// mjolnir.js\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\nimport { whichButtons, getOffsetPosition } from \"./event-utils.js\";\nconst DEFAULT_OPTIONS = {\n srcElement: 'root',\n priority: 0\n};\nexport class EventRegistrar {\n constructor(eventManager, recognizerName) {\n /**\n * Handles hammerjs event\n */\n this.handleEvent = (event) => {\n if (this.isEmpty()) {\n return;\n }\n const mjolnirEvent = this._normalizeEvent(event);\n let target = event.srcEvent.target;\n while (target && target !== mjolnirEvent.rootElement) {\n this._emit(mjolnirEvent, target);\n if (mjolnirEvent.handled) {\n return;\n }\n target = target.parentNode;\n }\n this._emit(mjolnirEvent, 'root');\n };\n this.eventManager = eventManager;\n this.recognizerName = recognizerName;\n this.handlers = [];\n // Element -> handler map\n this.handlersByElement = new Map();\n this._active = false;\n }\n // Returns true if there are no non-passive handlers\n isEmpty() {\n return !this._active;\n }\n add(type, handler, options, once = false, passive = false) {\n const { handlers, handlersByElement } = this;\n const opts = { ...DEFAULT_OPTIONS, ...options };\n let entries = handlersByElement.get(opts.srcElement);\n if (!entries) {\n entries = [];\n handlersByElement.set(opts.srcElement, entries);\n }\n const entry = {\n type,\n handler,\n srcElement: opts.srcElement,\n priority: opts.priority\n };\n if (once) {\n entry.once = true;\n }\n if (passive) {\n entry.passive = true;\n }\n handlers.push(entry);\n this._active = this._active || !entry.passive;\n // Sort handlers by descending priority\n // Handlers with the same priority are excuted in the order of registration\n let insertPosition = entries.length - 1;\n while (insertPosition >= 0) {\n if (entries[insertPosition].priority >= entry.priority) {\n break;\n }\n insertPosition--;\n }\n entries.splice(insertPosition + 1, 0, entry);\n }\n remove(type, handler) {\n const { handlers, handlersByElement } = this;\n for (let i = handlers.length - 1; i >= 0; i--) {\n const entry = handlers[i];\n if (entry.type === type && entry.handler === handler) {\n handlers.splice(i, 1);\n const entries = handlersByElement.get(entry.srcElement);\n entries.splice(entries.indexOf(entry), 1);\n if (entries.length === 0) {\n handlersByElement.delete(entry.srcElement);\n }\n }\n }\n this._active = handlers.some((entry) => !entry.passive);\n }\n /**\n * Invoke handlers on a particular element\n */\n _emit(event, srcElement) {\n const entries = this.handlersByElement.get(srcElement);\n if (entries) {\n let immediatePropagationStopped = false;\n // Prevents the current event from bubbling up\n const stopPropagation = () => {\n event.handled = true;\n };\n // Prevent any remaining listeners from being called\n const stopImmediatePropagation = () => {\n event.handled = true;\n immediatePropagationStopped = true;\n };\n const entriesToRemove = [];\n for (let i = 0; i < entries.length; i++) {\n const { type, handler, once } = entries[i];\n // @ts-ignore\n handler({\n ...event,\n type,\n stopPropagation,\n stopImmediatePropagation\n });\n if (once) {\n entriesToRemove.push(entries[i]);\n }\n if (immediatePropagationStopped) {\n break;\n }\n }\n for (let i = 0; i < entriesToRemove.length; i++) {\n const { type, handler } = entriesToRemove[i];\n this.remove(type, handler);\n }\n }\n }\n /**\n * Normalizes hammerjs and custom events to have predictable fields.\n */\n _normalizeEvent(event) {\n const rootElement = this.eventManager.getElement();\n // @ts-ignore\n return {\n ...event,\n ...whichButtons(event),\n ...getOffsetPosition(event, rootElement),\n preventDefault: () => {\n event.srcEvent.preventDefault();\n },\n stopImmediatePropagation: null,\n stopPropagation: null,\n handled: false,\n rootElement\n };\n }\n}\n//# sourceMappingURL=event-registrar.js.map","// mjolnir.js\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\nimport { Manager as HammerManager } from \"./hammerjs/index.js\";\nimport { WheelInput } from \"./inputs/wheel-input.js\";\nimport { MoveInput } from \"./inputs/move-input.js\";\nimport { KeyInput } from \"./inputs/key-input.js\";\nimport { ContextmenuInput } from \"./inputs/contextmenu-input.js\";\nimport { EventRegistrar } from \"./utils/event-registrar.js\";\nfunction normalizeRecognizer(item) {\n if ('recognizer' in item) {\n return item;\n }\n let recognizer;\n const itemArray = Array.isArray(item) ? [...item] : [item];\n if (typeof itemArray[0] === 'function') {\n // Backward compatibility: v2 / hammerjs style\n const RecognizerType = itemArray.shift();\n const options = itemArray.shift() || {};\n recognizer = new RecognizerType(options);\n }\n else {\n recognizer = itemArray.shift();\n }\n return {\n recognizer,\n recognizeWith: typeof itemArray[0] === 'string' ? [itemArray[0]] : itemArray[0],\n requireFailure: typeof itemArray[1] === 'string' ? [itemArray[1]] : itemArray[1]\n };\n}\n// Unified API for subscribing to events about both\n// basic input events (e.g. 'mousemove', 'touchstart', 'wheel')\n// and gestural input (e.g. 'click', 'tap', 'panstart').\n// Delegates gesture related event registration and handling to Hammer.js.\nexport class EventManager {\n constructor(element = null, options = {}) {\n /**\n * Handle basic events using the 'hammer.input' Hammer.js API:\n * Before running Recognizers, Hammer emits a 'hammer.input' event\n * with the basic event info. This function emits all basic events\n * aliased to the \"class\" of event received.\n * See constants.BASIC_EVENT_CLASSES basic event class definitions.\n */\n this._onBasicInput = (event) => {\n this.manager.emit(event.srcEvent.type, event);\n };\n /**\n * Handle events not supported by Hammer.js,\n * and pipe back out through same (Hammer) channel used by other events.\n */\n this._onOtherEvent = (event) => {\n // console.log('onotherevent', event.type, event)\n this.manager.emit(event.type, event);\n };\n this.options = {\n recognizers: [],\n events: {},\n touchAction: 'compute',\n tabIndex: 0,\n cssProps: {},\n ...options\n };\n this.events = new Map();\n this.element = element;\n if (!element)\n return;\n this.manager = new HammerManager(element, this.options);\n for (const item of this.options.recognizers) {\n const { recognizer, recognizeWith, requireFailure } = normalizeRecognizer(item);\n this.manager.add(recognizer);\n if (recognizeWith) {\n recognizer.recognizeWith(recognizeWith);\n }\n if (requireFailure) {\n recognizer.requireFailure(requireFailure);\n }\n }\n this.manager.on('hammer.input', this._onBasicInput);\n // Handle events not handled by Hammer.js:\n // - mouse wheel\n // - pointer/touch/mouse move\n this.wheelInput = new WheelInput(element, this._onOtherEvent, {\n enable: false\n });\n this.moveInput = new MoveInput(element, this._onOtherEvent, {\n enable: false\n });\n this.keyInput = new KeyInput(element, this._onOtherEvent, {\n enable: false,\n tabIndex: options.tabIndex\n });\n this.contextmenuInput = new ContextmenuInput(element, this._onOtherEvent, {\n enable: false\n });\n // Register all passed events.\n this.on(this.options.events);\n }\n getElement() {\n return this.element;\n }\n // Tear down internal event management implementations.\n destroy() {\n // manager etc. cannot exist if there is no element\n if (!this.element)\n return;\n this.wheelInput.destroy();\n this.moveInput.destroy();\n this.keyInput.destroy();\n this.contextmenuInput.destroy();\n this.manager.destroy();\n }\n /** Register an event handler function to be called on `event` */\n on(event, handler, opts) {\n this._addEventHandler(event, handler, opts, false);\n }\n once(event, handler, opts) {\n this._addEventHandler(event, handler, opts, true);\n }\n watch(event, handler, opts) {\n this._addEventHandler(event, handler, opts, false, true);\n }\n off(event, handler) {\n this._removeEventHandler(event, handler);\n }\n /*\n * Enable/disable recognizer for the given event\n */\n _toggleRecognizer(name, enabled) {\n const { manager } = this;\n if (!manager) {\n return;\n }\n const recognizer = manager.get(name);\n if (recognizer) {\n recognizer.set({ enable: enabled });\n manager.touchAction.update();\n }\n this.wheelInput?.enableEventType(name, enabled);\n this.moveInput?.enableEventType(name, enabled);\n this.keyInput?.enableEventType(name, enabled);\n this.contextmenuInput?.enableEventType(name, enabled);\n }\n /**\n * Process the event registration for a single event + handler.\n */\n _addEventHandler(event, handler, opts, once, passive) {\n if (typeof event !== 'string') {\n // @ts-ignore\n opts = handler;\n // If `event` is a map, call `on()` for each entry.\n for (const [eventName, eventHandler] of Object.entries(event)) {\n this._addEventHandler(eventName, eventHandler, opts, once, passive);\n }\n return;\n }\n const { manager, events } = this;\n if (!manager)\n return;\n let eventRegistrar = events.get(event);\n if (!eventRegistrar) {\n // Enable recognizer for this event.\n const recognizerName = this._getRecognizerName(event) || event;\n eventRegistrar = new EventRegistrar(this, recognizerName);\n events.set(event, eventRegistrar);\n // Listen to the event\n if (manager) {\n manager.on(event, eventRegistrar.handleEvent);\n }\n }\n eventRegistrar.add(event, handler, opts, once, passive);\n if (!eventRegistrar.isEmpty()) {\n this._toggleRecognizer(eventRegistrar.recognizerName, true);\n }\n }\n /**\n * Process the event deregistration for a single event + handler.\n */\n _removeEventHandler(event, handler) {\n if (typeof event !== 'string') {\n // If `event` is a map, call `off()` for each entry.\n for (const [eventName, eventHandler] of Object.entries(event)) {\n this._removeEventHandler(eventName, eventHandler);\n }\n return;\n }\n const { events } = this;\n const eventRegistrar = events.get(event);\n if (!eventRegistrar) {\n return;\n }\n eventRegistrar.remove(event, handler);\n if (eventRegistrar.isEmpty()) {\n const { recognizerName } = eventRegistrar;\n // Disable recognizer if no more handlers are attached to its events\n let isRecognizerUsed = false;\n for (const eh of events.values()) {\n if (eh.recognizerName === recognizerName && !eh.isEmpty()) {\n isRecognizerUsed = true;\n break;\n }\n }\n if (!isRecognizerUsed) {\n this._toggleRecognizer(recognizerName, false);\n }\n }\n }\n _getRecognizerName(event) {\n return this.manager.recognizers.find((recognizer) => {\n return recognizer.getEventNames().includes(event);\n })?.options.event;\n }\n}\n//# sourceMappingURL=event-manager.js.map","import { worldToLngLat } from \"./web-mercator-utils.js\";\nimport { mod, log2 } from \"./math-utils.js\";\n// defined by mapbox-gl\nconst TILE_SIZE = 512;\n/**\n * Apply mathematical constraints to viewport props\n * @param props\n */\n// eslint-disable-next-line complexity\nexport function normalizeViewportProps(props) {\n const { width, height, pitch = 0 } = props;\n let { longitude, latitude, zoom, bearing = 0 } = props;\n // Normalize degrees\n if (longitude < -180 || longitude > 180) {\n longitude = mod(longitude + 180, 360) - 180;\n }\n if (bearing < -180 || bearing > 180) {\n bearing = mod(bearing + 180, 360) - 180;\n }\n // Constrain zoom and shift center at low zoom levels\n const minZoom = log2(height / TILE_SIZE);\n if (zoom <= minZoom) {\n zoom = minZoom;\n latitude = 0;\n }\n else {\n // Eliminate white space above and below the map\n const halfHeightPixels = height / 2 / Math.pow(2, zoom);\n const minLatitude = worldToLngLat([0, halfHeightPixels])[1];\n if (latitude < minLatitude) {\n latitude = minLatitude;\n }\n else {\n const maxLatitude = worldToLngLat([0, TILE_SIZE - halfHeightPixels])[1];\n if (latitude > maxLatitude) {\n latitude = maxLatitude;\n }\n }\n }\n return { width, height, longitude, latitude, zoom, pitch, bearing };\n}\n//# sourceMappingURL=normalize-viewport-props.js.map","// deck.gl\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\nimport { COORDINATE_SYSTEM, PROJECTION_MODE } from \"../../lib/constants.js\";\nimport project from \"../project/project.js\";\nimport { Vector3, Matrix4 } from '@math.gl/core';\nimport memoize from \"../../utils/memoize.js\";\nimport { pixelsToWorld } from '@math.gl/web-mercator';\nconst uniformBlock = /* glsl */ `\nuniform shadowUniforms {\n bool drawShadowMap;\n bool useShadowMap;\n vec4 color;\n highp int lightId;\n float lightCount;\n mat4 viewProjectionMatrix0;\n mat4 viewProjectionMatrix1;\n vec4 projectCenter0;\n vec4 projectCenter1;\n} shadow;\n`;\nconst vertex = /* glsl */ `\nconst int max_lights = 2;\n\nout vec3 shadow_vPosition[max_lights];\n\nvec4 shadow_setVertexPosition(vec4 position_commonspace) {\n mat4 viewProjectionMatrices[max_lights];\n viewProjectionMatrices[0] = shadow.viewProjectionMatrix0;\n viewProjectionMatrices[1] = shadow.viewProjectionMatrix1;\n vec4 projectCenters[max_lights];\n projectCenters[0] = shadow.projectCenter0;\n projectCenters[1] = shadow.projectCenter1;\n\n if (shadow.drawShadowMap) {\n return project_common_position_to_clipspace(position_commonspace, viewProjectionMatrices[shadow.lightId], projectCenters[shadow.lightId]);\n }\n if (shadow.useShadowMap) {\n for (int i = 0; i < max_lights; i++) {\n if(i < int(shadow.lightCount)) {\n vec4 shadowMap_position = project_common_position_to_clipspace(position_commonspace, viewProjectionMatrices[i], projectCenters[i]);\n shadow_vPosition[i] = (shadowMap_position.xyz / shadowMap_position.w + 1.0) / 2.0;\n }\n }\n }\n return gl_Position;\n}\n`;\nconst vs = `\n${uniformBlock}\n${vertex}\n`;\nconst fragment = /* glsl */ `\nconst int max_lights = 2;\nuniform sampler2D shadow_uShadowMap0;\nuniform sampler2D shadow_uShadowMap1;\n\nin vec3 shadow_vPosition[max_lights];\n\nconst vec4 bitPackShift = vec4(1.0, 255.0, 65025.0, 16581375.0);\nconst vec4 bitUnpackShift = 1.0 / bitPackShift;\nconst vec4 bitMask = vec4(1.0 / 255.0, 1.0 / 255.0, 1.0 / 255.0, 0.0);\n\nfloat shadow_getShadowWeight(vec3 position, sampler2D shadowMap) {\n vec4 rgbaDepth = texture(shadowMap, position.xy);\n\n float z = dot(rgbaDepth, bitUnpackShift);\n return smoothstep(0.001, 0.01, position.z - z);\n}\n\nvec4 shadow_filterShadowColor(vec4 color) {\n if (shadow.drawShadowMap) {\n vec4 rgbaDepth = fract(gl_FragCoord.z * bitPackShift);\n rgbaDepth -= rgbaDepth.gbaa * bitMask;\n return rgbaDepth;\n }\n if (shadow.useShadowMap) {\n float shadowAlpha = 0.0;\n shadowAlpha += shadow_getShadowWeight(shadow_vPosition[0], shadow_uShadowMap0);\n if(shadow.lightCount > 1.0) {\n shadowAlpha += shadow_getShadowWeight(shadow_vPosition[1], shadow_uShadowMap1);\n }\n shadowAlpha *= shadow.color.a / shadow.lightCount;\n float blendedAlpha = shadowAlpha + color.a * (1.0 - shadowAlpha);\n\n return vec4(\n mix(color.rgb, shadow.color.rgb, shadowAlpha / blendedAlpha),\n blendedAlpha\n );\n }\n return color;\n}\n`;\nconst fs = `\n${uniformBlock}\n${fragment}\n`;\nconst getMemoizedViewportCenterPosition = memoize(getViewportCenterPosition);\nconst getMemoizedViewProjectionMatrices = memoize(getViewProjectionMatrices);\nconst DEFAULT_SHADOW_COLOR = [0, 0, 0, 1.0];\nconst VECTOR_TO_POINT_MATRIX = [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0];\nfunction screenToCommonSpace(xyz, pixelUnprojectionMatrix) {\n const [x, y, z] = xyz;\n const coord = pixelsToWorld([x, y, z], pixelUnprojectionMatrix);\n if (Number.isFinite(z)) {\n return coord;\n }\n return [coord[0], coord[1], 0];\n}\nfunction getViewportCenterPosition({ viewport, center }) {\n return new Matrix4(viewport.viewProjectionMatrix).invert().transform(center);\n}\nfunction getViewProjectionMatrices({ viewport, shadowMatrices }) {\n const projectionMatrices = [];\n const pixelUnprojectionMatrix = viewport.pixelUnprojectionMatrix;\n const farZ = viewport.isGeospatial ? undefined : 1;\n const corners = [\n [0, 0, farZ], // top left ground\n [viewport.width, 0, farZ], // top right ground\n [0, viewport.height, farZ], // bottom left ground\n [viewport.width, viewport.height, farZ], // bottom right ground\n [0, 0, -1], // top left near\n [viewport.width, 0, -1], // top right near\n [0, viewport.height, -1], // bottom left near\n [viewport.width, viewport.height, -1] // bottom right near\n ].map(pixel => \n // @ts-expect-error z may be undefined\n screenToCommonSpace(pixel, pixelUnprojectionMatrix));\n for (const shadowMatrix of shadowMatrices) {\n const viewMatrix = shadowMatrix.clone().translate(new Vector3(viewport.center).negate());\n const positions = corners.map(corner => viewMatrix.transform(corner));\n const projectionMatrix = new Matrix4().ortho({\n left: Math.min(...positions.map(position => position[0])),\n right: Math.max(...positions.map(position => position[0])),\n bottom: Math.min(...positions.map(position => position[1])),\n top: Math.max(...positions.map(position => position[1])),\n near: Math.min(...positions.map(position => -position[2])),\n far: Math.max(...positions.map(position => -position[2]))\n });\n projectionMatrices.push(projectionMatrix.multiplyRight(shadowMatrix));\n }\n return projectionMatrices;\n}\n/* eslint-disable camelcase */\n// eslint-disable-next-line complexity\nfunction createShadowUniforms(opts) {\n const { shadowEnabled = true, project: projectProps } = opts;\n if (!shadowEnabled || !projectProps || !opts.shadowMatrices || !opts.shadowMatrices.length) {\n return {\n drawShadowMap: false,\n useShadowMap: false,\n shadow_uShadowMap0: opts.dummyShadowMap,\n shadow_uShadowMap1: opts.dummyShadowMap\n };\n }\n const projectUniforms = project.getUniforms(projectProps);\n const center = getMemoizedViewportCenterPosition({\n viewport: projectProps.viewport,\n center: projectUniforms.center\n });\n const projectCenters = [];\n const viewProjectionMatrices = getMemoizedViewProjectionMatrices({\n shadowMatrices: opts.shadowMatrices,\n viewport: projectProps.viewport\n }).slice();\n for (let i = 0; i < opts.shadowMatrices.length; i++) {\n const viewProjectionMatrix = viewProjectionMatrices[i];\n const viewProjectionMatrixCentered = viewProjectionMatrix\n .clone()\n .translate(new Vector3(projectProps.viewport.center).negate());\n if (projectUniforms.coordinateSystem === COORDINATE_SYSTEM.LNGLAT &&\n projectUniforms.projectionMode === PROJECTION_MODE.WEB_MERCATOR) {\n viewProjectionMatrices[i] = viewProjectionMatrixCentered;\n projectCenters[i] = center;\n }\n else {\n viewProjectionMatrices[i] = viewProjectionMatrix\n .clone()\n .multiplyRight(VECTOR_TO_POINT_MATRIX);\n projectCenters[i] = viewProjectionMatrixCentered.transform(center);\n }\n }\n const uniforms = {\n drawShadowMap: Boolean(opts.drawToShadowMap),\n useShadowMap: opts.shadowMaps ? opts.shadowMaps.length > 0 : false,\n color: opts.shadowColor || DEFAULT_SHADOW_COLOR,\n lightId: opts.shadowLightId || 0,\n lightCount: opts.shadowMatrices.length,\n shadow_uShadowMap0: opts.dummyShadowMap,\n shadow_uShadowMap1: opts.dummyShadowMap\n };\n for (let i = 0; i < viewProjectionMatrices.length; i++) {\n uniforms[`viewProjectionMatrix${i}`] = viewProjectionMatrices[i];\n uniforms[`projectCenter${i}`] = projectCenters[i];\n }\n for (let i = 0; i < 2; i++) {\n uniforms[`shadow_uShadowMap${i}`] =\n (opts.shadowMaps && opts.shadowMaps[i]) || opts.dummyShadowMap;\n }\n return uniforms;\n}\nexport default {\n name: 'shadow',\n dependencies: [project],\n vs,\n fs,\n inject: {\n 'vs:DECKGL_FILTER_GL_POSITION': `\n position = shadow_setVertexPosition(geometry.position);\n `,\n 'fs:DECKGL_FILTER_COLOR': `\n color = shadow_filterShadowColor(color);\n `\n },\n getUniforms: createShadowUniforms,\n uniformTypes: {\n drawShadowMap: 'f32',\n useShadowMap: 'f32',\n color: 'vec4<f32>',\n lightId: 'i32',\n lightCount: 'f32',\n viewProjectionMatrix0: 'mat4x4<f32>',\n viewProjectionMatrix1: 'mat4x4<f32>',\n projectCenter0: 'vec4<f32>',\n projectCenter1: 'vec4<f32>'\n }\n};\n//# sourceMappingURL=shadow.js.map","// deck.gl\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\nimport { ShaderAssembler } from '@luma.gl/shadertools';\nimport { gouraudMaterial, phongMaterial } from '@luma.gl/shadertools';\nimport { layerUniforms } from \"./misc/layer-uniforms.js\";\nimport color from \"./color/color.js\";\nimport geometry from \"./misc/geometry.js\";\nimport project from \"./project/project.js\";\nimport project32 from \"./project32/project32.js\";\nimport shadow from \"./shadow/shadow.js\";\nimport picking from \"./picking/picking.js\";\nconst DEFAULT_MODULES = [geometry];\nconst SHADER_HOOKS_GLSL = [\n 'vs:DECKGL_FILTER_SIZE(inout vec3 size, VertexGeometry geometry)',\n 'vs:DECKGL_FILTER_GL_POSITION(inout vec4 position, VertexGeometry geometry)',\n 'vs:DECKGL_FILTER_COLOR(inout vec4 color, VertexGeometry geometry)',\n 'fs:DECKGL_FILTER_COLOR(inout vec4 color, FragmentGeometry geometry)'\n];\nconst SHADER_HOOKS_WGSL = [\n// Not yet supported\n];\nexport function getShaderAssembler(language) {\n const shaderAssembler = ShaderAssembler.getDefaultShaderAssembler();\n for (const shaderModule of DEFAULT_MODULES) {\n shaderAssembler.addDefaultModule(shaderModule);\n }\n // if we're recreating the device we may have changed language\n // and must not inject hooks for the wrong language\n // shaderAssembler.resetShaderHooks();\n shaderAssembler._hookFunctions.length = 0;\n // Add shader hooks based on language\n // TODO(ibgreen) - should the luma shader assembler support both sets of hooks?\n const shaderHooks = language === 'glsl' ? SHADER_HOOKS_GLSL : SHADER_HOOKS_WGSL;\n for (const shaderHook of shaderHooks) {\n shaderAssembler.addShaderHook(shaderHook);\n }\n return shaderAssembler;\n}\nexport { layerUniforms, color, picking, project, project32, gouraudMaterial, phongMaterial, shadow };\n//# sourceMappingURL=index.js.map","// deck.gl\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\nconst DEFAULT_LIGHT_COLOR = [255, 255, 255];\nconst DEFAULT_LIGHT_INTENSITY = 1.0;\nlet idCount = 0;\nexport class AmbientLight {\n constructor(props = {}) {\n this.type = 'ambient';\n const { color = DEFAULT_LIGHT_COLOR } = props;\n const { intensity = DEFAULT_LIGHT_INTENSITY } = props;\n this.id = props.id || `ambient-${idCount++}`;\n this.color = color;\n this.intensity = intensity;\n }\n}\n//# sourceMappingURL=ambient-light.js.map","// deck.gl\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\nimport { Vector3 } from '@math.gl/core';\nconst DEFAULT_LIGHT_COLOR = [255, 255, 255];\nconst DEFAULT_LIGHT_INTENSITY = 1.0;\nconst DEFAULT_LIGHT_DIRECTION = [0.0, 0.0, -1.0];\nlet idCount = 0;\nexport class DirectionalLight {\n constructor(props = {}) {\n this.type = 'directional';\n const { color = DEFAULT_LIGHT_COLOR } = props;\n const { intensity = DEFAULT_LIGHT_INTENSITY } = props;\n const { direction = DEFAULT_LIGHT_DIRECTION } = props;\n const { _shadow = false } = props;\n this.id = props.id || `directional-${idCount++}`;\n this.color = color;\n this.intensity = intensity;\n this.type = 'directional';\n this.direction = new Vector3(direction).normalize().toArray();\n this.shadow = _shadow;\n }\n getProjectedLight(opts) {\n return this;\n }\n}\n//# sourceMappingURL=directional-light.js.map","// deck.gl\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\nimport LayersPass from \"./layers-pass.js\";\nexport default class ShadowPass extends LayersPass {\n constructor(device, props) {\n super(device, props);\n // The shadowMap texture\n const shadowMap = device.createTexture({\n format: 'rgba8unorm',\n width: 1,\n height: 1,\n sampler: {\n minFilter: 'linear',\n magFilter: 'linear',\n addressModeU: 'clamp-to-edge',\n addressModeV: 'clamp-to-edge'\n }\n // TODO - texture API change in luma.gl v9.2\n // mipmaps: true\n });\n const depthBuffer = device.createTexture({ format: 'depth16unorm', width: 1, height: 1 });\n this.fbo = device.createFramebuffer({\n id: 'shadowmap',\n width: 1,\n height: 1,\n colorAttachments: [shadowMap],\n // Depth attachment has to be specified for depth test to work\n depthStencilAttachment: depthBuffer\n });\n }\n delete() {\n if (this.fbo) {\n this.fbo.destroy();\n this.fbo = null;\n }\n }\n getShadowMap() {\n return this.fbo.colorAttachments[0].texture;\n }\n render(params) {\n const target = this.fbo;\n // @ts-expect-error TODO - assuming WebGL context\n const pixelRatio = this.device.canvasContext.cssToDeviceRatio();\n const viewport = params.viewports[0];\n const width = viewport.width * pixelRatio;\n const height = viewport.height * pixelRatio;\n const clearColor = [1, 1, 1, 1];\n if (width !== target.width || height !== target.height) {\n target.resize({ width, height });\n }\n super.render({ ...params, clearColor, target, pass: 'shadow' });\n }\n getLayerParameters(layer, layerIndex, viewport) {\n return {\n ...layer.props.parameters,\n blend: false,\n depthWriteEnabled: true,\n depthCompare: 'less-equal'\n };\n }\n shouldDrawLayer(layer) {\n return layer.props.shadowEnabled !== false;\n }\n getShaderModuleProps(layer, effects, otherShaderModuleProps) {\n return {\n shadow: {\n project: otherShaderModuleProps.project,\n drawToShadowMap: true\n }\n };\n }\n}\n//# sourceMappingURL=shadow-pass.js.map","// deck.gl\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\nimport { AmbientLight } from \"./ambient-light.js\";\nimport { DirectionalLight } from \"./directional-light.js\";\nimport { Matrix4, Vector3 } from '@math.gl/core';\nimport ShadowPass from \"../../passes/shadow-pass.js\";\nimport shadow from \"../../shaderlib/shadow/shadow.js\";\nconst DEFAULT_AMBIENT_LIGHT_PROPS = {\n color: [255, 255, 255],\n intensity: 1.0\n};\nconst DEFAULT_DIRECTIONAL_LIGHT_PROPS = [\n {\n color: [255, 255, 255],\n intensity: 1.0,\n direction: [-1, 3, -1]\n },\n {\n color: [255, 255, 255],\n intensity: 0.9,\n direction: [1, -8, -2.5]\n }\n];\nconst DEFAULT_SHADOW_COLOR = [0, 0, 0, 200 / 255];\n// Class to manage ambient, point and directional light sources in deck\nexport default class LightingEffect {\n constructor(props = {}) {\n this.id = 'lighting-effect';\n this.shadowColor = DEFAULT_SHADOW_COLOR;\n this.shadow = false;\n this.directionalLights = [];\n this.pointLights = [];\n this.shadowPasses = [];\n this.dummyShadowMap = null;\n this.setProps(props);\n }\n setup(context) {\n this.context = context;\n const { device, deck } = context;\n if (this.shadow && !this.dummyShadowMap) {\n this._createShadowPasses(device);\n deck._addDefaultShaderModule(shadow);\n this.dummyShadowMap = device.createTexture({\n width: 1,\n height: 1\n });\n }\n }\n setProps(props) {\n this.ambientLight = undefined;\n this.directionalLights = [];\n this.pointLights = [];\n for (const key in props) {\n const lightSource = props[key];\n switch (lightSource.type) {\n case 'ambient':\n this.ambientLight = lightSource;\n break;\n case 'directional':\n this.directionalLights.push(lightSource);\n break;\n case 'point':\n this.pointLights.push(lightSource);\n break;\n default:\n }\n }\n this._applyDefaultLights();\n this.shadow = this.directionalLights.some(light => light.shadow);\n if (this.context) {\n // Create resources if necessary\n this.setup(this.context);\n }\n this.props = props;\n }\n preRender({ layers, layerFilter, viewports, onViewportActive, views }) {\n if (!this.shadow)\n return;\n // create light matrix every frame to make sure always updated from light source\n this.shadowMatrices = this._calculateMatrices();\n for (let i = 0; i < this.shadowPasses.length; i++) {\n const shadowPass = this.shadowPasses[i];\n shadowPass.render({\n layers,\n layerFilter,\n viewports,\n onViewportActive,\n views,\n shaderModuleProps: {\n shadow: {\n shadowLightId: i,\n dummyShadowMap: this.dummyShadowMap,\n shadowMatrices: this.shadowMatrices\n }\n }\n });\n }\n }\n getShaderModuleProps(layer, otherShaderModuleProps) {\n const shadowProps = this.shadow\n ? {\n project: otherShaderModuleProps.project,\n shadowMaps: this.shadowPasses.map(shadowPass => shadowPass.getShadowMap()),\n dummyShadowMap: this.dummyShadowMap,\n shadowColor: this.shadowColor,\n shadowMatrices: this.shadowMatrices\n }\n : {};\n // when not rendering to screen, turn off lighting by adding empty light source object\n // lights shader module relies on the `lightSources` to turn on/off lighting\n const lightingProps = {\n enabled: true,\n ambientLight: this.ambientLight,\n directionalLights: this.directionalLights.map(directionalLight => directionalLight.getProjectedLight({ layer })),\n pointLights: this.pointLights.map(pointLight => pointLight.getProjectedLight({ layer }))\n };\n // @ts-expect-error material is not a Layer prop\n const materialProps = layer.props.material;\n return {\n shadow: shadowProps,\n lighting: lightingProps,\n phongMaterial: materialProps,\n gouraudMaterial: materialProps\n };\n }\n cleanup(context) {\n for (const shadowPass of this.shadowPasses) {\n shadowPass.delete();\n }\n this.shadowPasses.length = 0;\n if (this.dummyShadowMap) {\n this.dummyShadowMap.destroy();\n this.dummyShadowMap = null;\n context.deck._removeDefaultShaderModule(shadow);\n }\n }\n _calculateMatrices() {\n const lightMatrices = [];\n for (const light of this.directionalLights) {\n const viewMatrix = new Matrix4().lookAt({\n eye: new Vector3(light.direction).negate()\n });\n lightMatrices.push(viewMatrix);\n }\n return lightMatrices;\n }\n _createShadowPasses(device) {\n for (let i = 0; i < this.directionalLights.length; i++) {\n const shadowPass = new ShadowPass(device);\n this.shadowPasses[i] = shadowPass;\n }\n }\n _applyDefaultLights() {\n const { ambientLight, pointLights, directionalLights } = this;\n if (!ambientLight && pointLights.length === 0 && directionalLights.length === 0) {\n this.ambientLight = new AmbientLight(DEFAULT_AMBIENT_LIGHT_PROPS);\n this.directionalLights.push(new DirectionalLight(DEFAULT_DIRECTIONAL_LIGHT_PROPS[0]), new DirectionalLight(DEFAULT_DIRECTIONAL_LIGHT_PROPS[1]));\n }\n }\n}\n//# sourceMappingURL=lighting-effect.js.map","// luma.gl\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\nlet channelHandles = 1;\nlet animationHandles = 1;\nexport class Timeline {\n time = 0;\n channels = new Map();\n animations = new Map();\n playing = false;\n lastEngineTime = -1;\n constructor() { }\n addChannel(props) {\n const { delay = 0, duration = Number.POSITIVE_INFINITY, rate = 1, repeat = 1 } = props;\n const channelId = channelHandles++;\n const channel = {\n time: 0,\n delay,\n duration,\n rate,\n repeat\n };\n this._setChannelTime(channel, this.time);\n this.channels.set(channelId, channel);\n return channelId;\n }\n removeChannel(channelId) {\n this.channels.delete(channelId);\n for (const [animationHandle, animation] of this.animations) {\n if (animation.channel === channelId) {\n this.detachAnimation(animationHandle);\n }\n }\n }\n isFinished(channelId) {\n const channel = this.channels.get(channelId);\n if (channel === undefined) {\n return false;\n }\n return this.time >= channel.delay + channel.duration * channel.repeat;\n }\n getTime(channelId) {\n if (channelId === undefined) {\n return this.time;\n }\n const channel = this.channels.get(channelId);\n if (channel === undefined) {\n return -1;\n }\n return channel.time;\n }\n setTime(time) {\n this.time = Math.max(0, time);\n const channels = this.channels.values();\n for (const channel of channels) {\n this._setChannelTime(channel, this.time);\n }\n const animations = this.animations.values();\n for (const animationData of animations) {\n const { animation, channel } = animationData;\n animation.setTime(this.getTime(channel));\n }\n }\n play() {\n this.playing = true;\n }\n pause() {\n this.playing = false;\n this.lastEngineTime = -1;\n }\n reset() {\n this.setTime(0);\n }\n attachAnimation(animation, channelHandle) {\n const animationHandle = animationHandles++;\n this.animations.set(animationHandle, {\n animation,\n channel: channelHandle\n });\n animation.setTime(this.getTime(channelHandle));\n return animationHandle;\n }\n detachAnimation(channelId) {\n this.animations.delete(channelId);\n }\n update(engineTime) {\n if (this.playing) {\n if (this.lastEngineTime === -1) {\n this.lastEngineTime = engineTime;\n }\n this.setTime(this.time + (engineTime - this.lastEngineTime));\n this.lastEngineTime = engineTime;\n }\n }\n _setChannelTime(channel, time) {\n const offsetTime = time - channel.delay;\n const totalDuration = channel.duration * channel.repeat;\n // Note(Tarek): Don't loop on final repeat.\n if (offsetTime >= totalDuration) {\n channel.time = channel.duration * channel.rate;\n }\n else {\n channel.time = Math.max(0, offsetTime) % channel.duration;\n channel.time *= channel.rate;\n }\n }\n}\n//# sourceMappingURL=timeline.js.map","// luma.gl\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\n/* global window, setTimeout, clearTimeout */\n/** Node.js polyfill for requestAnimationFrame */\n// / <reference types=\"@types/node\" />\nexport function requestAnimationFramePolyfill(callback) {\n return typeof window !== 'undefined' && window.requestAnimationFrame\n ? window.requestAnimationFrame(callback)\n : setTimeout(callback, 1000 / 60);\n}\n/** Node.js polyfill for cancelAnimationFrame */\nexport function cancelAnimationFramePolyfill(timerId) {\n return typeof window !== 'undefined' && window.cancelAnimationFrame\n ? window.cancelAnimationFrame(timerId)\n : clearTimeout(timerId);\n}\n//# sourceMappingURL=request-animation-frame.js.map","// luma.gl\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\nimport { luma } from '@luma.gl/core';\nimport { requestAnimationFramePolyfill, cancelAnimationFramePolyfill } from \"./request-animation-frame.js\";\nimport { Stats } from '@probe.gl/stats';\nlet statIdCounter = 0;\n/** Convenient animation loop */\nexport class AnimationLoop {\n static defaultAnimationLoopProps = {\n device: null,\n onAddHTML: () => '',\n onInitialize: async () => null,\n onRender: () => { },\n onFinalize: () => { },\n onError: error => console.error(error), // eslint-disable-line no-console\n stats: luma.stats.get(`animation-loop-${statIdCounter++}`),\n // view parameters\n autoResizeViewport: false\n };\n device = null;\n canvas = null;\n props;\n animationProps = null;\n timeline = null;\n stats;\n cpuTime;\n gpuTime;\n frameRate;\n display;\n needsRedraw = 'initialized';\n _initialized = false;\n _running = false;\n _animationFrameId = null;\n _nextFramePromise = null;\n _resolveNextFrame = null;\n _cpuStartTime = 0;\n _error = null;\n // _gpuTimeQuery: Query | null = null;\n /*\n * @param {HTMLCanvasElement} canvas - if provided, width and height will be passed to context\n */\n constructor(props) {\n this.props = { ...AnimationLoop.defaultAnimationLoopProps, ...props };\n props = this.props;\n if (!props.device) {\n throw new Error('No device provided');\n }\n // state\n this.stats = props.stats || new Stats({ id: 'animation-loop-stats' });\n this.cpuTime = this.stats.get('CPU Time');\n this.gpuTime = this.stats.get('GPU Time');\n this.frameRate = this.stats.get('Frame Rate');\n this.setProps({ autoResizeViewport: props.autoResizeViewport });\n // Bind methods\n this.start = this.start.bind(this);\n this.stop = this.stop.bind(this);\n this._onMousemove = this._onMousemove.bind(this);\n this._onMouseleave = this._onMouseleave.bind(this);\n }\n destroy() {\n this.stop();\n this._setDisplay(null);\n }\n /** @deprecated Use .destroy() */\n delete() {\n this.destroy();\n }\n reportError(error) {\n this.props.onError(error);\n this._error = error;\n }\n /** Flags this animation loop as needing redraw */\n setNeedsRedraw(reason) {\n this.needsRedraw = this.needsRedraw || reason;\n return this;\n }\n setProps(props) {\n if ('autoResizeViewport' in props) {\n this.props.autoResizeViewport = props.autoResizeViewport || false;\n }\n return this;\n }\n /** Starts a render loop if not already running */\n async start() {\n if (this._running) {\n return this;\n }\n this._running = true;\n try {\n let appContext;\n if (!this._initialized) {\n this._initialized = true;\n // Create the WebGL context\n await this._initDevice();\n this._initialize();\n // Note: onIntialize can return a promise (e.g. in case app needs to load resources)\n await this.props.onInitialize(this._getAnimationProps());\n }\n // check that we haven't been stopped\n if (!this._running) {\n return null;\n }\n // Start the loop\n if (appContext !== false) {\n // cancel any pending renders to ensure only one loop can ever run\n this._cancelAnimationFrame();\n this._requestAnimationFrame();\n }\n return this;\n }\n catch (err) {\n const error = err instanceof Error ? err : new Error('Unknown error');\n this.props.onError(error);\n // this._running = false; // TODO\n throw error;\n }\n }\n /** Stops a render loop if already running, finalizing */\n stop() {\n // console.debug(`Stopping ${this.constructor.name}`);\n if (this._running) {\n // call callback\n // If stop is called immediately, we can end up in a state where props haven't been initialized...\n if (this.animationProps && !this._error) {\n this.props.onFinalize(this.animationProps);\n }\n this._cancelAnimationFrame();\n this._nextFramePromise = null;\n this._resolveNextFrame = null;\n this._running = false;\n }\n return this;\n }\n /** Explicitly draw a frame */\n redraw() {\n if (this.device?.isLost || this._error) {\n return this;\n }\n this._beginFrameTimers();\n this._setupFrame();\n this._updateAnimationProps();\n this._renderFrame(this._getAnimationProps());\n // clear needsRedraw flag\n this._clearNeedsRedraw();\n if (this._resolveNextFrame) {\n this._resolveNextFrame(this);\n this._nextFramePromise = null;\n this._resolveNextFrame = null;\n }\n this._endFrameTimers();\n return this;\n }\n /** Add a timeline, it will be automatically updated by the animation loop. */\n attachTimeline(timeline) {\n this.timeline = timeline;\n return this.timeline;\n }\n /** Remove a timeline */\n detachTimeline() {\n this.timeline = null;\n }\n /** Wait until a render completes */\n waitForRender() {\n this.setNeedsRedraw('waitForRender');\n if (!this._nextFramePromise) {\n this._nextFramePromise = new Promise(resolve => {\n this._resolveNextFrame = resolve;\n });\n }\n return this._nextFramePromise;\n }\n /** TODO - should use device.deviceContext */\n async toDataURL() {\n this.setNeedsRedraw('toDataURL');\n await this.waitForRender();\n if (this.canvas instanceof HTMLCanvasElement) {\n return this.canvas.toDataURL();\n }\n throw new Error('OffscreenCanvas');\n }\n // PRIVATE METHODS\n _initialize() {\n this._startEventHandling();\n // Initialize the callback data\n this._initializeAnimationProps();\n this._updateAnimationProps();\n // Default viewport setup, in case onInitialize wants to render\n this._resizeViewport();\n // this._gpuTimeQuery = Query.isSupported(this.gl, ['timers']) ? new Query(this.gl) : null;\n }\n _setDisplay(display) {\n if (this.display) {\n this.display.destroy();\n this.display.animationLoop = null;\n }\n // store animation loop on the display\n if (display) {\n display.animationLoop = this;\n }\n this.display = display;\n }\n _requestAnimationFrame() {\n if (!this._running) {\n return;\n }\n // VR display has a separate animation frame to sync with headset\n // TODO WebVR API discontinued, replaced by WebXR: https://immersive-web.github.io/webxr/\n // See https://developer.mozilla.org/en-US/docs/Web/API/VRDisplay/requestAnimationFrame\n // if (this.display && this.display.requestAnimationFrame) {\n // this._animationFrameId = this.display.requestAnimationFrame(this._animationFrame.bind(this));\n // }\n this._animationFrameId = requestAnimationFramePolyfill(this._animationFrame.bind(this));\n }\n _cancelAnimationFrame() {\n if (this._animationFrameId === null) {\n return;\n }\n // VR display has a separate animation frame to sync with headset\n // TODO WebVR API discontinued, replaced by WebXR: https://immersive-web.github.io/webxr/\n // See https://developer.mozilla.org/en-US/docs/Web/API/VRDisplay/requestAnimationFrame\n // if (this.display && this.display.cancelAnimationFramePolyfill) {\n // this.display.cancelAnimationFrame(this._animationFrameId);\n // }\n cancelAnimationFramePolyfill(this._animationFrameId);\n this._animationFrameId = null;\n }\n _animationFrame() {\n if (!this._running) {\n return;\n }\n this.redraw();\n this._requestAnimationFrame();\n }\n // Called on each frame, can be overridden to call onRender multiple times\n // to support e.g. stereoscopic rendering\n _renderFrame(animationProps) {\n // Allow e.g. VR display to render multiple frames.\n if (this.display) {\n this.display._renderFrame(animationProps);\n return;\n }\n // call callback\n this.props.onRender(this._getAnimationProps());\n // end callback\n // Submit commands (necessary on WebGPU)\n this.device?.submit();\n }\n _clearNeedsRedraw() {\n this.needsRedraw = false;\n }\n _setupFrame() {\n this._resizeViewport();\n }\n // Initialize the object that will be passed to app callbacks\n _initializeAnimationProps() {\n const canvasContext = this.device?.getDefaultCanvasContext();\n if (!this.device || !canvasContext) {\n throw new Error('loop');\n }\n const canvas = canvasContext?.canvas;\n const useDevicePixels = canvasContext.props.useDevicePixels;\n this.animationProps = {\n animationLoop: this,\n device: this.device,\n canvasContext,\n canvas,\n // @ts-expect-error Deprecated\n useDevicePixels,\n timeline: this.timeline,\n needsRedraw: false,\n // Placeholders\n width: 1,\n height: 1,\n aspect: 1,\n // Animation props\n time: 0,\n startTime: Date.now(),\n engineTime: 0,\n tick: 0,\n tock: 0,\n // Experimental\n _mousePosition: null // Event props\n };\n }\n _getAnimationProps() {\n if (!this.animationProps) {\n throw new Error('animationProps');\n }\n return this.animationProps;\n }\n // Update the context object that will be passed to app callbacks\n _updateAnimationProps() {\n if (!this.animationProps) {\n return;\n }\n // Can this be replaced with canvas context?\n const { width, height, aspect } = this._getSizeAndAspect();\n if (width !== this.animationProps.width || height !== this.animationProps.height) {\n this.setNeedsRedraw('drawing buffer resized');\n }\n if (aspect !== this.animationProps.aspect) {\n this.setNeedsRedraw('drawing buffer aspect changed');\n }\n this.animationProps.width = width;\n this.animationProps.height = height;\n this.animationProps.aspect = aspect;\n this.animationProps.needsRedraw = this.needsRedraw;\n // Update time properties\n this.animationProps.engineTime = Date.now() - this.animationProps.startTime;\n if (this.timeline) {\n this.timeline.update(this.animationProps.engineTime);\n }\n this.animationProps.tick = Math.floor((this.animationProps.time / 1000) * 60);\n this.animationProps.tock++;\n // For back compatibility\n this.animationProps.time = this.timeline\n ? this.timeline.getTime()\n : this.animationProps.engineTime;\n }\n /** Wait for supplied device */\n async _initDevice() {\n this.device = await this.props.device;\n if (!this.device) {\n throw new Error('No device provided');\n }\n this.canvas = this.device.getDefaultCanvasContext().canvas || null;\n // this._createInfoDiv();\n }\n _createInfoDiv() {\n if (this.canvas && this.props.onAddHTML) {\n const wrapperDiv = document.createElement('div');\n document.body.appendChild(wrapperDiv);\n wrapperDiv.style.position = 'relative';\n const div = document.createElement('div');\n div.style.position = 'absolute';\n div.style.left = '10px';\n div.style.bottom = '10px';\n div.style.width = '300px';\n div.style.background = 'white';\n if (this.canvas instanceof HTMLCanvasElement) {\n wrapperDiv.appendChild(this.canvas);\n }\n wrapperDiv.appendChild(div);\n const html = this.props.onAddHTML(div);\n if (html) {\n div.innerHTML = html;\n }\n }\n }\n _getSizeAndAspect() {\n if (!this.device) {\n return { width: 1, height: 1, aspect: 1 };\n }\n // https://webglfundamentals.org/webgl/lessons/webgl-resizing-the-canvas.html\n const [width, height] = this.device?.getDefaultCanvasContext().getDevicePixelSize() || [1, 1];\n // https://webglfundamentals.org/webgl/lessons/webgl-anti-patterns.html\n let aspect = 1;\n const canvas = this.device?.getDefaultCanvasContext().canvas;\n // @ts-expect-error\n if (canvas && canvas.clientHeight) {\n // @ts-expect-error\n aspect = canvas.clientWidth / canvas.clientHeight;\n }\n else if (width > 0 && height > 0) {\n aspect = width / height;\n }\n return { width, height, aspect };\n }\n /** @deprecated Default viewport setup */\n _resizeViewport() {\n // TODO can we use canvas context to code this in a portable way?\n // @ts-expect-error Expose on canvasContext\n if (this.props.autoResizeViewport && this.device.gl) {\n // @ts-expect-error Expose canvasContext\n this.device.gl.viewport(0, 0, \n // @ts-expect-error Expose canvasContext\n this.device.gl.drawingBufferWidth, \n // @ts-expect-error Expose canvasContext\n this.device.gl.drawingBufferHeight);\n }\n }\n _beginFrameTimers() {\n this.frameRate.timeEnd();\n this.frameRate.timeStart();\n // Check if timer for last frame has completed.\n // GPU timer results are never available in the same\n // frame they are captured.\n // if (\n // this._gpuTimeQuery &&\n // this._gpuTimeQuery.isResultAvailable() &&\n // !this._gpuTimeQuery.isTimerDisjoint()\n // ) {\n // this.stats.get('GPU Time').addTime(this._gpuTimeQuery.getTimerMilliseconds());\n // }\n // if (this._gpuTimeQuery) {\n // // GPU time query start\n // this._gpuTimeQuery.beginTimeElapsedQuery();\n // }\n this.cpuTime.timeStart();\n }\n _endFrameTimers() {\n this.cpuTime.timeEnd();\n // if (this._gpuTimeQuery) {\n // // GPU time query end. Results will be available on next frame.\n // this._gpuTimeQuery.end();\n // }\n }\n // Event handling\n _startEventHandling() {\n if (this.canvas) {\n this.canvas.addEventListener('mousemove', this._onMousemove.bind(this));\n this.canvas.addEventListener('mouseleave', this._onMouseleave.bind(this));\n }\n }\n _onMousemove(event) {\n if (event instanceof MouseEvent) {\n this._getAnimationProps()._mousePosition = [event.offsetX, event.offsetY];\n }\n }\n _onMouseleave(event) {\n this._getAnimationProps()._mousePosition = null;\n }\n}\n//# sourceMappingURL=animation-loop.js.map","// deck.gl\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\nimport { load } from '@loaders.gl/core';\nexport default class Resource {\n constructor(id, data, context) {\n this._loadCount = 0;\n this._subscribers = new Set();\n this.id = id;\n this.context = context;\n this.setData(data);\n }\n // consumer: {onChange: Function}\n subscribe(consumer) {\n this._subscribers.add(consumer);\n }\n unsubscribe(consumer) {\n this._subscribers.delete(consumer);\n }\n inUse() {\n return this._subscribers.size > 0;\n }\n delete() {\n // Remove any resources created\n }\n getData() {\n return this.isLoaded\n ? this._error\n ? Promise.reject(this._error)\n : this._content\n : this._loader.then(() => this.getData());\n }\n setData(data, forceUpdate) {\n if (data === this._data && !forceUpdate) {\n return;\n }\n this._data = data;\n const loadCount = ++this._loadCount;\n let loader = data;\n if (typeof data === 'string') {\n loader = load(data);\n }\n if (loader instanceof Promise) {\n this.isLoaded = false;\n this._loader = loader\n .then(result => {\n // check if source has changed\n if (this._loadCount === loadCount) {\n this.isLoaded = true;\n this._error = undefined;\n this._content = result;\n }\n })\n .catch(error => {\n if (this._loadCount === loadCount) {\n this.isLoaded = true;\n this._error = error || true;\n }\n });\n }\n else {\n this.isLoaded = true;\n this._error = undefined;\n this._content = data;\n }\n for (const subscriber of this._subscribers) {\n subscriber.onChange(this.getData());\n }\n }\n}\n//# sourceMappingURL=resource.js.map","// deck.gl\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\nimport Resource from \"./resource.js\";\nexport default class ResourceManager {\n constructor(props) {\n this.protocol = props.protocol || 'resource://';\n this._context = {\n device: props.device,\n // @ts-expect-error\n gl: props.device?.gl,\n resourceManager: this\n };\n this._resources = {};\n this._consumers = {};\n this._pruneRequest = null;\n }\n contains(resourceId) {\n if (resourceId.startsWith(this.protocol)) {\n return true;\n }\n return resourceId in this._resources;\n }\n add({ resourceId, data, forceUpdate = false, persistent = true }) {\n let res = this._resources[resourceId];\n if (res) {\n res.setData(data, forceUpdate);\n }\n else {\n res = new Resource(resourceId, data, this._context);\n this._resources[resourceId] = res;\n }\n // persistent resources can only be removed by calling `remove`\n // non-persistent resources may be released when there are no more consumers\n res.persistent = persistent;\n }\n remove(resourceId) {\n const res = this._resources[resourceId];\n if (res) {\n res.delete();\n delete this._resources[resourceId];\n }\n }\n unsubscribe({ consumerId }) {\n const consumer = this._consumers[consumerId];\n if (consumer) {\n for (const requestId in consumer) {\n const request = consumer[requestId];\n const resource = this._resources[request.resourceId];\n if (resource) {\n resource.unsubscribe(request);\n }\n }\n delete this._consumers[consumerId];\n this.prune();\n }\n }\n subscribe({ resourceId, onChange, consumerId, requestId = 'default' }) {\n const { _resources: resources, protocol } = this;\n if (resourceId.startsWith(protocol)) {\n resourceId = resourceId.replace(protocol, '');\n if (!resources[resourceId]) {\n // Add placeholder. When this resource becomes available, the consumer will be notified.\n this.add({ resourceId, data: null, persistent: false });\n }\n }\n const res = resources[resourceId];\n this._track(consumerId, requestId, res, onChange);\n if (res) {\n return res.getData();\n }\n return undefined;\n }\n prune() {\n if (!this._pruneRequest) {\n // prune() may be called multiple times in the same animation frame.\n // Batch multiple requests together\n // @ts-ignore setTimeout returns NodeJS.Timeout in node\n this._pruneRequest = setTimeout(() => this._prune(), 0);\n }\n }\n finalize() {\n for (const key in this._resources) {\n this._resources[key].delete();\n }\n }\n _track(consumerId, requestId, resource, onChange) {\n const consumers = this._consumers;\n const consumer = (consumers[consumerId] = consumers[consumerId] || {});\n let request = consumer[requestId];\n const oldResource = request && request.resourceId && this._resources[request.resourceId];\n if (oldResource) {\n oldResource.unsubscribe(request);\n this.prune();\n }\n if (resource) {\n if (request) {\n request.onChange = onChange;\n request.resourceId = resource.id;\n }\n else {\n request = {\n onChange,\n resourceId: resource.id\n };\n }\n consumer[requestId] = request;\n resource.subscribe(request);\n }\n }\n _prune() {\n this._pruneRequest = null;\n for (const key of Object.keys(this._resources)) {\n const res = this._resources[key];\n if (!res.persistent && !res.inUse()) {\n res.delete();\n delete this._resources[key];\n }\n }\n }\n}\n//# sourceMappingURL=resource-manager.js.map","// deck.gl\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\nimport { Timeline } from '@luma.gl/engine';\nimport { getShaderAssembler, layerUniforms } from \"../shaderlib/index.js\";\nimport { LIFECYCLE } from \"../lifecycle/constants.js\";\nimport log from \"../utils/log.js\";\nimport debug from \"../debug/index.js\";\nimport { flatten } from \"../utils/flatten.js\";\nimport { Stats } from '@probe.gl/stats';\nimport ResourceManager from \"./resource/resource-manager.js\";\nimport Viewport from \"../viewports/viewport.js\";\nconst TRACE_SET_LAYERS = 'layerManager.setLayers';\nconst TRACE_ACTIVATE_VIEWPORT = 'layerManager.activateViewport';\nexport default class LayerManager {\n /**\n * @param device\n * @param param1\n */\n // eslint-disable-next-line\n constructor(device, props) {\n this._lastRenderedLayers = [];\n this._needsRedraw = false;\n this._needsUpdate = false;\n this._nextLayers = null;\n this._debug = false;\n // This flag is separate from _needsUpdate because it can be set during an update and should trigger another full update\n this._defaultShaderModulesChanged = false;\n //\n // INTERNAL METHODS\n //\n /** Make a viewport \"current\" in layer context, updating viewportChanged flags */\n this.activateViewport = (viewport) => {\n debug(TRACE_ACTIVATE_VIEWPORT, this, viewport);\n if (viewport) {\n this.context.viewport = viewport;\n }\n };\n const { deck, stats, viewport, timeline } = props || {};\n // Currently deck.gl expects the DeckGL.layers array to be different\n // whenever React rerenders. If the same layers array is used, the\n // LayerManager's diffing algorithm will generate a fatal error and\n // break the rendering.\n // `this._lastRenderedLayers` stores the UNFILTERED layers sent\n // down to LayerManager, so that `layers` reference can be compared.\n // If it's the same across two React render calls, the diffing logic\n // will be skipped.\n this.layers = [];\n this.resourceManager = new ResourceManager({ device, protocol: 'deck://' });\n this.context = {\n mousePosition: null,\n userData: {},\n layerManager: this,\n device,\n // @ts-expect-error\n gl: device?.gl,\n deck,\n shaderAssembler: getShaderAssembler(device?.info?.shadingLanguage || 'glsl'),\n defaultShaderModules: [layerUniforms],\n renderPass: undefined,\n stats: stats || new Stats({ id: 'deck.gl' }),\n // Make sure context.viewport is not empty on the first layer initialization\n viewport: viewport || new Viewport({ id: 'DEFAULT-INITIAL-VIEWPORT' }), // Current viewport, exposed to layers for project* function\n timeline: timeline || new Timeline(),\n resourceManager: this.resourceManager,\n onError: undefined\n };\n Object.seal(this);\n }\n /** Method to call when the layer manager is not needed anymore. */\n finalize() {\n this.resourceManager.finalize();\n // Finalize all layers\n for (const layer of this.layers) {\n this._finalizeLayer(layer);\n }\n }\n /** Check if a redraw is needed */\n needsRedraw(opts = { clearRedrawFlags: false }) {\n let redraw = this._needsRedraw;\n if (opts.clearRedrawFlags) {\n this._needsRedraw = false;\n }\n // This layers list doesn't include sublayers, relying on composite layers\n for (const layer of this.layers) {\n // Call every layer to clear their flags\n const layerNeedsRedraw = layer.getNeedsRedraw(opts);\n redraw = redraw || layerNeedsRedraw;\n }\n return redraw;\n }\n /** Check if a deep update of all layers is needed */\n needsUpdate() {\n if (this._nextLayers && this._nextLayers !== this._lastRenderedLayers) {\n // New layers array may be the same as the old one if `setProps` is called by React\n return 'layers changed';\n }\n if (this._defaultShaderModulesChanged) {\n return 'shader modules changed';\n }\n return this._needsUpdate;\n }\n /** Layers will be redrawn (in next animation frame) */\n setNeedsRedraw(reason) {\n this._needsRedraw = this._needsRedraw || reason;\n }\n /** Layers will be updated deeply (in next animation frame)\n Potentially regenerating attributes and sub layers */\n setNeedsUpdate(reason) {\n this._needsUpdate = this._needsUpdate || reason;\n }\n /** Gets a list of currently rendered layers. Optionally filter by id. */\n getLayers({ layerIds } = {}) {\n // Filtering by layerId compares beginning of strings, so that sublayers will be included\n // Dependes on the convention of adding suffixes to the parent's layer name\n return layerIds\n ? this.layers.filter(layer => layerIds.find(layerId => layer.id.indexOf(layerId) === 0))\n : this.layers;\n }\n /** Set props needed for layer rendering and picking. */\n setProps(props) {\n if ('debug' in props) {\n this._debug = props.debug;\n }\n // A way for apps to add data to context that can be accessed in layers\n if ('userData' in props) {\n this.context.userData = props.userData;\n }\n // New layers will be processed in `updateLayers` in the next update cycle\n if ('layers' in props) {\n this._nextLayers = props.layers;\n }\n if ('onError' in props) {\n this.context.onError = props.onError;\n }\n }\n /** Supply a new layer list, initiating sublayer generation and layer matching */\n setLayers(newLayers, reason) {\n debug(TRACE_SET_LAYERS, this, reason, newLayers);\n this._lastRenderedLayers = newLayers;\n const flatLayers = flatten(newLayers, Boolean);\n for (const layer of flatLayers) {\n layer.context = this.context;\n }\n this._updateLayers(this.layers, flatLayers);\n }\n /** Update layers from last cycle if `setNeedsUpdate()` has been called */\n updateLayers() {\n // NOTE: For now, even if only some layer has changed, we update all layers\n // to ensure that layer id maps etc remain consistent even if different\n // sublayers are rendered\n const reason = this.needsUpdate();\n if (reason) {\n this.setNeedsRedraw(`updating layers: ${reason}`);\n // Force a full update\n this.setLayers(this._nextLayers || this._lastRenderedLayers, reason);\n }\n // Updated, clear the backlog\n this._nextLayers = null;\n }\n /** Register a default shader module */\n addDefaultShaderModule(module) {\n const { defaultShaderModules } = this.context;\n if (!defaultShaderModules.find(m => m.name === module.name)) {\n defaultShaderModules.push(module);\n this._defaultShaderModulesChanged = true;\n }\n }\n /** Deregister a default shader module */\n removeDefaultShaderModule(module) {\n const { defaultShaderModules } = this.context;\n const i = defaultShaderModules.findIndex(m => m.name === module.name);\n if (i >= 0) {\n defaultShaderModules.splice(i, 1);\n this._defaultShaderModulesChanged = true;\n }\n }\n _handleError(stage, error, layer) {\n layer.raiseError(error, `${stage} of ${layer}`);\n }\n // TODO - mark layers with exceptions as bad and remove from rendering cycle?\n /** Match all layers, checking for caught errors\n to avoid having an exception in one layer disrupt other layers */\n _updateLayers(oldLayers, newLayers) {\n // Create old layer map\n const oldLayerMap = {};\n for (const oldLayer of oldLayers) {\n if (oldLayerMap[oldLayer.id]) {\n log.warn(`Multiple old layers with same id ${oldLayer.id}`)();\n }\n else {\n oldLayerMap[oldLayer.id] = oldLayer;\n }\n }\n if (this._defaultShaderModulesChanged) {\n for (const layer of oldLayers) {\n layer.setNeedsUpdate();\n layer.setChangeFlags({ extensionsChanged: true });\n }\n this._defaultShaderModulesChanged = false;\n }\n // Allocate array for generated layers\n const generatedLayers = [];\n // Match sublayers\n this._updateSublayersRecursively(newLayers, oldLayerMap, generatedLayers);\n // Finalize unmatched layers\n this._finalizeOldLayers(oldLayerMap);\n let needsUpdate = false;\n for (const layer of generatedLayers) {\n if (layer.hasUniformTransition()) {\n needsUpdate = `Uniform transition in ${layer}`;\n break;\n }\n }\n this._needsUpdate = needsUpdate;\n this.layers = generatedLayers;\n }\n /* eslint-disable complexity,max-statements */\n // Note: adds generated layers to `generatedLayers` array parameter\n _updateSublayersRecursively(newLayers, oldLayerMap, generatedLayers) {\n for (const newLayer of newLayers) {\n newLayer.context = this.context;\n // Given a new coming layer, find its matching old layer (if any)\n const oldLayer = oldLayerMap[newLayer.id];\n if (oldLayer === null) {\n // null, rather than undefined, means this id was originally there\n log.warn(`Multiple new layers with same id ${newLayer.id}`)();\n }\n // Remove the old layer from candidates, as it has been matched with this layer\n oldLayerMap[newLayer.id] = null;\n let sublayers = null;\n // We must not generate exceptions until after layer matching is complete\n try {\n if (this._debug && oldLayer !== newLayer) {\n newLayer.validateProps();\n }\n if (!oldLayer) {\n this._initializeLayer(newLayer);\n }\n else {\n this._transferLayerState(oldLayer, newLayer);\n this._updateLayer(newLayer);\n }\n generatedLayers.push(newLayer);\n // Call layer lifecycle method: render sublayers\n sublayers = newLayer.isComposite ? newLayer.getSubLayers() : null;\n // End layer lifecycle method: render sublayers\n }\n catch (err) {\n this._handleError('matching', err, newLayer); // Record first exception\n }\n if (sublayers) {\n this._updateSublayersRecursively(sublayers, oldLayerMap, generatedLayers);\n }\n }\n }\n /* eslint-enable complexity,max-statements */\n // Finalize any old layers that were not matched\n _finalizeOldLayers(oldLayerMap) {\n for (const layerId in oldLayerMap) {\n const layer = oldLayerMap[layerId];\n if (layer) {\n this._finalizeLayer(layer);\n }\n }\n }\n // / EXCEPTION SAFE LAYER ACCESS\n /** Safely initializes a single layer, calling layer methods */\n _initializeLayer(layer) {\n try {\n layer._initialize();\n layer.lifecycle = LIFECYCLE.INITIALIZED;\n }\n catch (err) {\n this._handleError('initialization', err, layer);\n // TODO - what should the lifecycle state be here? LIFECYCLE.INITIALIZATION_FAILED?\n }\n }\n /** Transfer state from one layer to a newer version */\n _transferLayerState(oldLayer, newLayer) {\n newLayer._transferState(oldLayer);\n newLayer.lifecycle = LIFECYCLE.MATCHED;\n if (newLayer !== oldLayer) {\n oldLayer.lifecycle = LIFECYCLE.AWAITING_GC;\n }\n }\n /** Safely updates a single layer, cleaning all flags */\n _updateLayer(layer) {\n try {\n layer._update();\n }\n catch (err) {\n this._handleError('update', err, layer);\n }\n }\n /** Safely finalizes a single layer, removing all resources */\n _finalizeLayer(layer) {\n this._needsRedraw = this._needsRedraw || `finalized ${layer}`;\n layer.lifecycle = LIFECYCLE.AWAITING_FINALIZATION;\n try {\n layer._finalize();\n layer.lifecycle = LIFECYCLE.FINALIZED;\n }\n catch (err) {\n this._handleError('finalization', err, layer);\n }\n }\n}\n//# sourceMappingURL=layer-manager.js.map","// deck.gl\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\nimport { deepEqual } from \"../utils/deep-equal.js\";\nimport log from \"../utils/log.js\";\nimport { flatten } from \"../utils/flatten.js\";\nexport default class ViewManager {\n constructor(props) {\n // List of view descriptors, gets re-evaluated when width/height changes\n this.views = [];\n this.width = 100;\n this.height = 100;\n this.viewState = {};\n this.controllers = {};\n this.timeline = props.timeline;\n this._viewports = []; // Generated viewports\n this._viewportMap = {};\n this._isUpdating = false;\n this._needsRedraw = 'First render';\n this._needsUpdate = 'Initialize';\n this._eventManager = props.eventManager;\n this._eventCallbacks = {\n onViewStateChange: props.onViewStateChange,\n onInteractionStateChange: props.onInteractionStateChange\n };\n Object.seal(this);\n // Init with default map viewport\n this.setProps(props);\n }\n /** Remove all resources and event listeners */\n finalize() {\n for (const key in this.controllers) {\n const controller = this.controllers[key];\n if (controller) {\n controller.finalize();\n }\n }\n this.controllers = {};\n }\n /** Check if a redraw is needed */\n needsRedraw(opts = { clearRedrawFlags: false }) {\n const redraw = this._needsRedraw;\n if (opts.clearRedrawFlags) {\n this._needsRedraw = false;\n }\n return redraw;\n }\n /** Mark the manager as dirty. Will rebuild all viewports and update controllers. */\n setNeedsUpdate(reason) {\n this._needsUpdate = this._needsUpdate || reason;\n this._needsRedraw = this._needsRedraw || reason;\n }\n /** Checks each viewport for transition updates */\n updateViewStates() {\n for (const viewId in this.controllers) {\n const controller = this.controllers[viewId];\n if (controller) {\n controller.updateTransition();\n }\n }\n }\n /** Get a set of viewports for a given width and height\n * TODO - Intention is for deck.gl to autodeduce width and height and drop the need for props\n * @param rect (object, optional) - filter the viewports\n * + not provided - return all viewports\n * + {x, y} - only return viewports that contain this pixel\n * + {x, y, width, height} - only return viewports that overlap with this rectangle\n */\n getViewports(rect) {\n if (rect) {\n return this._viewports.filter(viewport => viewport.containsPixel(rect));\n }\n return this._viewports;\n }\n /** Get a map of all views */\n getViews() {\n const viewMap = {};\n this.views.forEach(view => {\n viewMap[view.id] = view;\n });\n return viewMap;\n }\n /** Resolves a viewId string to a View */\n getView(viewId) {\n return this.views.find(view => view.id === viewId);\n }\n /** Returns the viewState for a specific viewId. Matches the viewState by\n 1. view.viewStateId\n 2. view.id\n 3. root viewState\n then applies the view's filter if any */\n getViewState(viewOrViewId) {\n const view = typeof viewOrViewId === 'string' ? this.getView(viewOrViewId) : viewOrViewId;\n // Backward compatibility: view state for single view\n const viewState = (view && this.viewState[view.getViewStateId()]) || this.viewState;\n return view ? view.filterViewState(viewState) : viewState;\n }\n getViewport(viewId) {\n return this._viewportMap[viewId];\n }\n /**\n * Unproject pixel coordinates on screen onto world coordinates,\n * (possibly [lon, lat]) on map.\n * - [x, y] => [lng, lat]\n * - [x, y, z] => [lng, lat, Z]\n * @param {Array} xyz -\n * @param {Object} opts - options\n * @param {Object} opts.topLeft=true - Whether origin is top left\n * @return {Array|null} - [lng, lat, Z] or [X, Y, Z]\n */\n unproject(xyz, opts) {\n const viewports = this.getViewports();\n const pixel = { x: xyz[0], y: xyz[1] };\n for (let i = viewports.length - 1; i >= 0; --i) {\n const viewport = viewports[i];\n if (viewport.containsPixel(pixel)) {\n const p = xyz.slice();\n p[0] -= viewport.x;\n p[1] -= viewport.y;\n return viewport.unproject(p, opts);\n }\n }\n return null;\n }\n /** Update the manager with new Deck props */\n setProps(props) {\n if (props.views) {\n this._setViews(props.views);\n }\n if (props.viewState) {\n this._setViewState(props.viewState);\n }\n if ('width' in props || 'height' in props) {\n this._setSize(props.width, props.height);\n }\n // Important: avoid invoking _update() inside itself\n // Nested updates result in unexpected side effects inside _rebuildViewports()\n // when using auto control in pure-js\n if (!this._isUpdating) {\n this._update();\n }\n }\n //\n // PRIVATE METHODS\n //\n _update() {\n this._isUpdating = true;\n // Only rebuild viewports if the update flag is set\n if (this._needsUpdate) {\n this._needsUpdate = false;\n this._rebuildViewports();\n }\n // If viewport transition(s) are triggered during viewports update, controller(s)\n // will immediately call `onViewStateChange` which calls `viewManager.setProps` again.\n if (this._needsUpdate) {\n this._needsUpdate = false;\n this._rebuildViewports();\n }\n this._isUpdating = false;\n }\n _setSize(width, height) {\n if (width !== this.width || height !== this.height) {\n this.width = width;\n this.height = height;\n this.setNeedsUpdate('Size changed');\n }\n }\n // Update the view descriptor list and set change flag if needed\n // Does not actually rebuild the `Viewport`s until `getViewports` is called\n _setViews(views) {\n views = flatten(views, Boolean);\n const viewsChanged = this._diffViews(views, this.views);\n if (viewsChanged) {\n this.setNeedsUpdate('views changed');\n }\n this.views = views;\n }\n _setViewState(viewState) {\n if (viewState) {\n // depth = 3 when comparing viewStates: viewId.position.0\n const viewStateChanged = !deepEqual(viewState, this.viewState, 3);\n if (viewStateChanged) {\n this.setNeedsUpdate('viewState changed');\n }\n this.viewState = viewState;\n }\n else {\n log.warn('missing `viewState` or `initialViewState`')();\n }\n }\n _createController(view, props) {\n const Controller = props.type;\n const controller = new Controller({\n timeline: this.timeline,\n eventManager: this._eventManager,\n // Set an internal callback that calls the prop callback if provided\n onViewStateChange: this._eventCallbacks.onViewStateChange,\n onStateChange: this._eventCallbacks.onInteractionStateChange,\n makeViewport: viewState => this.getView(view.id)?.makeViewport({\n viewState,\n width: this.width,\n height: this.height\n })\n });\n return controller;\n }\n _updateController(view, viewState, viewport, controller) {\n const controllerProps = view.controller;\n if (controllerProps && viewport) {\n const resolvedProps = {\n ...viewState,\n ...controllerProps,\n id: view.id,\n x: viewport.x,\n y: viewport.y,\n width: viewport.width,\n height: viewport.height\n };\n // Create controller if not already existing or if the type of the\n // controller has changed.\n if (!controller || controller.constructor !== controllerProps.type) {\n controller = this._createController(view, resolvedProps);\n }\n if (controller) {\n controller.setProps(resolvedProps);\n }\n return controller;\n }\n return null;\n }\n // Rebuilds viewports from descriptors towards a certain window size\n _rebuildViewports() {\n const { views } = this;\n const oldControllers = this.controllers;\n this._viewports = [];\n this.controllers = {};\n let invalidateControllers = false;\n // Create controllers in reverse order, so that views on top receive events first\n for (let i = views.length; i--;) {\n const view = views[i];\n const viewState = this.getViewState(view);\n const viewport = view.makeViewport({ viewState, width: this.width, height: this.height });\n let oldController = oldControllers[view.id];\n const hasController = Boolean(view.controller);\n if (hasController && !oldController) {\n // When a new controller is added, invalidate all controllers below it so that\n // events are registered in the correct order\n invalidateControllers = true;\n }\n if ((invalidateControllers || !hasController) && oldController) {\n // Remove and reattach invalidated controller\n oldController.finalize();\n oldController = null;\n }\n // Update the controller\n this.controllers[view.id] = this._updateController(view, viewState, viewport, oldController);\n if (viewport) {\n this._viewports.unshift(viewport);\n }\n }\n // Remove unused controllers\n for (const id in oldControllers) {\n const oldController = oldControllers[id];\n if (oldController && !this.controllers[id]) {\n oldController.finalize();\n }\n }\n this._buildViewportMap();\n }\n _buildViewportMap() {\n // Build a view id to view index\n this._viewportMap = {};\n this._viewports.forEach(viewport => {\n if (viewport.id) {\n // TODO - issue warning if multiple viewports use same id\n this._viewportMap[viewport.id] = this._viewportMap[viewport.id] || viewport;\n }\n });\n }\n // Check if viewport array has changed, returns true if any change\n // Note that descriptors can be the same\n _diffViews(newViews, oldViews) {\n if (newViews.length !== oldViews.length) {\n return true;\n }\n return newViews.some((_, i) => !newViews[i].equals(oldViews[i]));\n }\n}\n//# sourceMappingURL=view-manager.js.map","// deck.gl\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\nconst PERCENT_OR_PIXELS_REGEX = /([0-9]+\\.?[0-9]*)(%|px)/;\n// Takes a number or a string of formats `50%`, `33.3%` or `200px`\nexport function parsePosition(value) {\n switch (typeof value) {\n case 'number':\n return {\n position: value,\n relative: false\n };\n case 'string':\n const match = PERCENT_OR_PIXELS_REGEX.exec(value);\n if (match && match.length >= 3) {\n const relative = match[2] === '%';\n const position = parseFloat(match[1]);\n return {\n position: relative ? position / 100 : position,\n relative\n };\n }\n // fallthrough\n default:\n // eslint-disable-line\n throw new Error(`Could not parse position string ${value}`);\n }\n}\nexport function getPosition(position, extent) {\n return position.relative ? Math.round(position.position * extent) : position.position;\n}\n//# sourceMappingURL=positions.js.map","// deck.gl\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\nimport { parsePosition, getPosition } from \"../utils/positions.js\";\nimport { deepEqual } from \"../utils/deep-equal.js\";\nexport default class View {\n constructor(props) {\n const { id, x = 0, y = 0, width = '100%', height = '100%', padding = null } = props;\n // @ts-ignore\n this.id = id || this.constructor.displayName || 'view';\n this.props = { ...props, id: this.id };\n // Extents\n this._x = parsePosition(x);\n this._y = parsePosition(y);\n this._width = parsePosition(width);\n this._height = parsePosition(height);\n this._padding = padding && {\n left: parsePosition(padding.left || 0),\n right: parsePosition(padding.right || 0),\n top: parsePosition(padding.top || 0),\n bottom: parsePosition(padding.bottom || 0)\n };\n // Bind methods for easy access\n this.equals = this.equals.bind(this);\n Object.seal(this);\n }\n equals(view) {\n if (this === view) {\n return true;\n }\n // To correctly compare padding use depth=2\n return this.constructor === view.constructor && deepEqual(this.props, view.props, 2);\n }\n /** Clone this view with modified props */\n clone(newProps) {\n const ViewConstructor = this.constructor;\n return new ViewConstructor({ ...this.props, ...newProps });\n }\n /** Make viewport from canvas dimensions and view state */\n makeViewport({ width, height, viewState }) {\n viewState = this.filterViewState(viewState);\n // Resolve relative viewport dimensions\n const viewportDimensions = this.getDimensions({ width, height });\n if (!viewportDimensions.height || !viewportDimensions.width) {\n return null;\n }\n const ViewportType = this.getViewportType(viewState);\n return new ViewportType({ ...viewState, ...this.props, ...viewportDimensions });\n }\n getViewStateId() {\n const { viewState } = this.props;\n if (typeof viewState === 'string') {\n // if View.viewState is a string, return it\n return viewState;\n }\n return viewState?.id || this.id;\n }\n // Allows view to override (or completely define) viewState\n filterViewState(viewState) {\n if (this.props.viewState && typeof this.props.viewState === 'object') {\n // If we have specified an id, then intent is to override,\n // If not, completely specify the view state\n if (!this.props.viewState.id) {\n return this.props.viewState;\n }\n // Merge in all props from View's viewState, except id\n const newViewState = { ...viewState };\n for (const key in this.props.viewState) {\n if (key !== 'id') {\n newViewState[key] = this.props.viewState[key];\n }\n }\n return newViewState;\n }\n return viewState;\n }\n /** Resolve the dimensions of the view from overall canvas dimensions */\n getDimensions({ width, height }) {\n const dimensions = {\n x: getPosition(this._x, width),\n y: getPosition(this._y, height),\n width: getPosition(this._width, width),\n height: getPosition(this._height, height)\n };\n if (this._padding) {\n dimensions.padding = {\n left: getPosition(this._padding.left, width),\n top: getPosition(this._padding.top, height),\n right: getPosition(this._padding.right, width),\n bottom: getPosition(this._padding.bottom, height)\n };\n }\n return dimensions;\n }\n // Used by sub classes to resolve controller props\n get controller() {\n const opts = this.props.controller;\n if (!opts) {\n return null;\n }\n if (opts === true) {\n return { type: this.ControllerType };\n }\n if (typeof opts === 'function') {\n return { type: opts };\n }\n return { type: this.ControllerType, ...opts };\n }\n}\n//# sourceMappingURL=view.js.map","// deck.gl\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\nimport Transition from \"../transitions/transition.js\";\nconst noop = () => { };\n// Enums cannot be directly exported as they are not transpiled correctly into ES5, see https://github.com/visgl/deck.gl/issues/7130\nexport const TRANSITION_EVENTS = {\n BREAK: 1,\n SNAP_TO_END: 2,\n IGNORE: 3\n};\nconst DEFAULT_EASING = t => t;\nconst DEFAULT_INTERRUPTION = TRANSITION_EVENTS.BREAK;\nexport default class TransitionManager {\n constructor(opts) {\n this._onTransitionUpdate = transition => {\n // NOTE: Be cautious re-ordering statements in this function.\n const { time, settings: { interpolator, startProps, endProps, duration, easing } } = transition;\n const t = easing(time / duration);\n const viewport = interpolator.interpolateProps(startProps, endProps, t);\n // This gurantees all props (e.g. bearing, longitude) are normalized\n // So when viewports are compared they are in same range.\n this.propsInTransition = this.getControllerState({\n ...this.props,\n ...viewport\n }).getViewportProps();\n this.onViewStateChange({\n viewState: this.propsInTransition,\n oldViewState: this.props\n });\n };\n this.getControllerState = opts.getControllerState;\n this.propsInTransition = null;\n this.transition = new Transition(opts.timeline);\n this.onViewStateChange = opts.onViewStateChange || noop;\n this.onStateChange = opts.onStateChange || noop;\n }\n finalize() {\n this.transition.cancel();\n }\n // Returns current transitioned viewport.\n getViewportInTransition() {\n return this.propsInTransition;\n }\n // Process the vewiport change, either ignore or trigger a new transition.\n // Return true if a new transition is triggered, false otherwise.\n processViewStateChange(nextProps) {\n let transitionTriggered = false;\n const currentProps = this.props;\n // Set this.props here as '_triggerTransition' calls '_updateViewport' that uses this.props.\n this.props = nextProps;\n // NOTE: Be cautious re-ordering statements in this function.\n if (!currentProps || this._shouldIgnoreViewportChange(currentProps, nextProps)) {\n return false;\n }\n if (this._isTransitionEnabled(nextProps)) {\n let startProps = currentProps;\n if (this.transition.inProgress) {\n // @ts-expect-error\n const { interruption, endProps } = this.transition.settings;\n startProps = {\n ...currentProps,\n ...(interruption === TRANSITION_EVENTS.SNAP_TO_END\n ? endProps\n : this.propsInTransition || currentProps)\n };\n }\n this._triggerTransition(startProps, nextProps);\n transitionTriggered = true;\n }\n else {\n this.transition.cancel();\n }\n return transitionTriggered;\n }\n updateTransition() {\n this.transition.update();\n }\n // Helper methods\n _isTransitionEnabled(props) {\n const { transitionDuration, transitionInterpolator } = props;\n return ((transitionDuration > 0 || transitionDuration === 'auto') &&\n Boolean(transitionInterpolator));\n }\n _isUpdateDueToCurrentTransition(props) {\n if (this.transition.inProgress && this.propsInTransition) {\n // @ts-expect-error\n return this.transition.settings.interpolator.arePropsEqual(props, this.propsInTransition);\n }\n return false;\n }\n _shouldIgnoreViewportChange(currentProps, nextProps) {\n if (this.transition.inProgress) {\n // @ts-expect-error\n const transitionSettings = this.transition.settings;\n // Ignore update if it is requested to be ignored\n return (transitionSettings.interruption === TRANSITION_EVENTS.IGNORE ||\n // Ignore update if it is due to current active transition.\n this._isUpdateDueToCurrentTransition(nextProps));\n }\n if (this._isTransitionEnabled(nextProps)) {\n // Ignore if none of the viewport props changed.\n return nextProps.transitionInterpolator.arePropsEqual(currentProps, nextProps);\n }\n return true;\n }\n _triggerTransition(startProps, endProps) {\n const startViewstate = this.getControllerState(startProps);\n const endViewStateProps = this.getControllerState(endProps).shortestPathFrom(startViewstate);\n // update transitionDuration for 'auto' mode\n const transitionInterpolator = endProps.transitionInterpolator;\n const duration = transitionInterpolator.getDuration\n ? transitionInterpolator.getDuration(startProps, endProps)\n : endProps.transitionDuration;\n if (duration === 0) {\n return;\n }\n const initialProps = transitionInterpolator.initializeProps(startProps, endViewStateProps);\n this.propsInTransition = {};\n const transitionSettings = {\n duration,\n easing: endProps.transitionEasing || DEFAULT_EASING,\n interpolator: transitionInterpolator,\n interruption: endProps.transitionInterruption || DEFAULT_INTERRUPTION,\n startProps: initialProps.start,\n endProps: initialProps.end,\n onStart: endProps.onTransitionStart,\n onUpdate: this._onTransitionUpdate,\n onInterrupt: this._onTransitionEnd(endProps.onTransitionInterrupt),\n onEnd: this._onTransitionEnd(endProps.onTransitionEnd)\n };\n this.transition.start(transitionSettings);\n this.onStateChange({ inTransition: true });\n this.updateTransition();\n }\n _onTransitionEnd(callback) {\n return transition => {\n this.propsInTransition = null;\n this.onStateChange({\n inTransition: false,\n isZooming: false,\n isPanning: false,\n isRotating: false\n });\n callback?.(transition);\n };\n }\n}\n//# sourceMappingURL=transition-manager.js.map","// deck.gl\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\n/* eslint-disable max-statements, complexity */\nimport TransitionManager from \"./transition-manager.js\";\nimport LinearInterpolator from \"../transitions/linear-interpolator.js\";\nconst NO_TRANSITION_PROPS = {\n transitionDuration: 0\n};\nconst DEFAULT_INERTIA = 300;\nconst INERTIA_EASING = t => 1 - (1 - t) * (1 - t);\nconst EVENT_TYPES = {\n WHEEL: ['wheel'],\n PAN: ['panstart', 'panmove', 'panend'],\n PINCH: ['pinchstart', 'pinchmove', 'pinchend'],\n MULTI_PAN: ['multipanstart', 'multipanmove', 'multipanend'],\n DOUBLE_CLICK: ['dblclick'],\n KEYBOARD: ['keydown']\n};\nconst pinchEventWorkaround = {};\nexport default class Controller {\n constructor(opts) {\n this.state = {};\n this._events = {};\n this._interactionState = {\n isDragging: false\n };\n this._customEvents = [];\n this._eventStartBlocked = null;\n this._panMove = false;\n this.invertPan = false;\n this.dragMode = 'rotate';\n this.inertia = 0;\n this.scrollZoom = true;\n this.dragPan = true;\n this.dragRotate = true;\n this.doubleClickZoom = true;\n this.touchZoom = true;\n this.touchRotate = false;\n this.keyboard = true;\n this.transitionManager = new TransitionManager({\n ...opts,\n getControllerState: props => new this.ControllerState(props),\n onViewStateChange: this._onTransition.bind(this),\n onStateChange: this._setInteractionState.bind(this)\n });\n this.handleEvent = this.handleEvent.bind(this);\n this.eventManager = opts.eventManager;\n this.onViewStateChange = opts.onViewStateChange || (() => { });\n this.onStateChange = opts.onStateChange || (() => { });\n this.makeViewport = opts.makeViewport;\n }\n set events(customEvents) {\n this.toggleEvents(this._customEvents, false);\n this.toggleEvents(customEvents, true);\n this._customEvents = customEvents;\n // Make sure default events are not overwritten\n if (this.props) {\n this.setProps(this.props);\n }\n }\n finalize() {\n for (const eventName in this._events) {\n if (this._events[eventName]) {\n // @ts-ignore (2345) event type string cannot be assifned to enum\n // eslint-disable-next-line @typescript-eslint/unbound-method\n this.eventManager?.off(eventName, this.handleEvent);\n }\n }\n this.transitionManager.finalize();\n }\n /**\n * Callback for events\n */\n handleEvent(event) {\n // Force recalculate controller state\n this._controllerState = undefined;\n const eventStartBlocked = this._eventStartBlocked;\n switch (event.type) {\n case 'panstart':\n return eventStartBlocked ? false : this._onPanStart(event);\n case 'panmove':\n return this._onPan(event);\n case 'panend':\n return this._onPanEnd(event);\n case 'pinchstart':\n return eventStartBlocked ? false : this._onPinchStart(event);\n case 'pinchmove':\n return this._onPinch(event);\n case 'pinchend':\n return this._onPinchEnd(event);\n case 'multipanstart':\n return eventStartBlocked ? false : this._onMultiPanStart(event);\n case 'multipanmove':\n return this._onMultiPan(event);\n case 'multipanend':\n return this._onMultiPanEnd(event);\n case 'dblclick':\n return this._onDoubleClick(event);\n case 'wheel':\n return this._onWheel(event);\n case 'keydown':\n return this._onKeyDown(event);\n default:\n return false;\n }\n }\n /* Event utils */\n // Event object: http://hammerjs.github.io/api/#event-object\n get controllerState() {\n this._controllerState = this._controllerState || new this.ControllerState({\n makeViewport: this.makeViewport,\n ...this.props,\n ...this.state\n });\n return this._controllerState;\n }\n getCenter(event) {\n const { x, y } = this.props;\n const { offsetCenter } = event;\n return [offsetCenter.x - x, offsetCenter.y - y];\n }\n isPointInBounds(pos, event) {\n const { width, height } = this.props;\n if (event && event.handled) {\n return false;\n }\n const inside = pos[0] >= 0 && pos[0] <= width && pos[1] >= 0 && pos[1] <= height;\n if (inside && event) {\n event.stopPropagation();\n }\n return inside;\n }\n isFunctionKeyPressed(event) {\n const { srcEvent } = event;\n return Boolean(srcEvent.metaKey || srcEvent.altKey || srcEvent.ctrlKey || srcEvent.shiftKey);\n }\n isDragging() {\n return this._interactionState.isDragging || false;\n }\n // When a multi-touch event ends, e.g. pinch, not all pointers are lifted at the same time.\n // This triggers a brief `pan` event.\n // Calling this method will temporarily disable *start events to avoid conflicting transitions.\n blockEvents(timeout) {\n /* global setTimeout */\n const timer = setTimeout(() => {\n if (this._eventStartBlocked === timer) {\n this._eventStartBlocked = null;\n }\n }, timeout);\n this._eventStartBlocked = timer;\n }\n /**\n * Extract interactivity options\n */\n setProps(props) {\n if (props.dragMode) {\n this.dragMode = props.dragMode;\n }\n this.props = props;\n if (!('transitionInterpolator' in props)) {\n // Add default transition interpolator\n props.transitionInterpolator = this._getTransitionProps().transitionInterpolator;\n }\n this.transitionManager.processViewStateChange(props);\n const { inertia } = props;\n this.inertia = Number.isFinite(inertia) ? inertia : (inertia === true ? DEFAULT_INERTIA : 0);\n // TODO - make sure these are not reset on every setProps\n const { scrollZoom = true, dragPan = true, dragRotate = true, doubleClickZoom = true, touchZoom = true, touchRotate = false, keyboard = true } = props;\n // Register/unregister events\n const isInteractive = Boolean(this.onViewStateChange);\n this.toggleEvents(EVENT_TYPES.WHEEL, isInteractive && scrollZoom);\n // We always need the pan events to set the correct isDragging state, even if dragPan & dragRotate are both false\n this.toggleEvents(EVENT_TYPES.PAN, isInteractive);\n this.toggleEvents(EVENT_TYPES.PINCH, isInteractive && (touchZoom || touchRotate));\n this.toggleEvents(EVENT_TYPES.MULTI_PAN, isInteractive && touchRotate);\n this.toggleEvents(EVENT_TYPES.DOUBLE_CLICK, isInteractive && doubleClickZoom);\n this.toggleEvents(EVENT_TYPES.KEYBOARD, isInteractive && keyboard);\n // Interaction toggles\n this.scrollZoom = scrollZoom;\n this.dragPan = dragPan;\n this.dragRotate = dragRotate;\n this.doubleClickZoom = doubleClickZoom;\n this.touchZoom = touchZoom;\n this.touchRotate = touchRotate;\n this.keyboard = keyboard;\n }\n updateTransition() {\n this.transitionManager.updateTransition();\n }\n toggleEvents(eventNames, enabled) {\n if (this.eventManager) {\n eventNames.forEach(eventName => {\n if (this._events[eventName] !== enabled) {\n this._events[eventName] = enabled;\n if (enabled) {\n // eslint-disable-next-line @typescript-eslint/unbound-method\n this.eventManager.on(eventName, this.handleEvent);\n }\n else {\n // eslint-disable-next-line @typescript-eslint/unbound-method\n this.eventManager.off(eventName, this.handleEvent);\n }\n }\n });\n }\n }\n // Private Methods\n /* Callback util */\n // formats map state and invokes callback function\n updateViewport(newControllerState, extraProps = null, interactionState = {}) {\n const viewState = { ...newControllerState.getViewportProps(), ...extraProps };\n // TODO - to restore diffing, we need to include interactionState\n const changed = this.controllerState !== newControllerState;\n // const oldViewState = this.controllerState.getViewportProps();\n // const changed = Object.keys(viewState).some(key => oldViewState[key] !== viewState[key]);\n this.state = newControllerState.getState();\n this._setInteractionState(interactionState);\n if (changed) {\n const oldViewState = this.controllerState && this.controllerState.getViewportProps();\n if (this.onViewStateChange) {\n this.onViewStateChange({ viewState, interactionState: this._interactionState, oldViewState, viewId: this.props.id });\n }\n }\n }\n _onTransition(params) {\n this.onViewStateChange({ ...params, interactionState: this._interactionState, viewId: this.props.id });\n }\n _setInteractionState(newStates) {\n Object.assign(this._interactionState, newStates);\n this.onStateChange(this._interactionState);\n }\n /* Event handlers */\n // Default handler for the `panstart` event.\n _onPanStart(event) {\n const pos = this.getCenter(event);\n if (!this.isPointInBounds(pos, event)) {\n return false;\n }\n let alternateMode = this.isFunctionKeyPressed(event) || event.rightButton || false;\n if (this.invertPan || this.dragMode === 'pan') {\n // invertPan is replaced by props.dragMode, keeping for backward compatibility\n alternateMode = !alternateMode;\n }\n const newControllerState = this.controllerState[alternateMode ? 'panStart' : 'rotateStart']({\n pos\n });\n this._panMove = alternateMode;\n this.updateViewport(newControllerState, NO_TRANSITION_PROPS, { isDragging: true });\n return true;\n }\n // Default handler for the `panmove` and `panend` event.\n _onPan(event) {\n if (!this.isDragging()) {\n return false;\n }\n return this._panMove ? this._onPanMove(event) : this._onPanRotate(event);\n }\n _onPanEnd(event) {\n if (!this.isDragging()) {\n return false;\n }\n return this._panMove ? this._onPanMoveEnd(event) : this._onPanRotateEnd(event);\n }\n // Default handler for panning to move.\n // Called by `_onPan` when panning without function key pressed.\n _onPanMove(event) {\n if (!this.dragPan) {\n return false;\n }\n const pos = this.getCenter(event);\n const newControllerState = this.controllerState.pan({ pos });\n this.updateViewport(newControllerState, NO_TRANSITION_PROPS, {\n isDragging: true,\n isPanning: true\n });\n return true;\n }\n _onPanMoveEnd(event) {\n const { inertia } = this;\n if (this.dragPan && inertia && event.velocity) {\n const pos = this.getCenter(event);\n const endPos = [\n pos[0] + (event.velocityX * inertia) / 2,\n pos[1] + (event.velocityY * inertia) / 2\n ];\n const newControllerState = this.controllerState.pan({ pos: endPos }).panEnd();\n this.updateViewport(newControllerState, {\n ...this._getTransitionProps(),\n transitionDuration: inertia,\n transitionEasing: INERTIA_EASING\n }, {\n isDragging: false,\n isPanning: true\n });\n }\n else {\n const newControllerState = this.controllerState.panEnd();\n this.updateViewport(newControllerState, null, {\n isDragging: false,\n isPanning: false\n });\n }\n return true;\n }\n // Default handler for panning to rotate.\n // Called by `_onPan` when panning with function key pressed.\n _onPanRotate(event) {\n if (!this.dragRotate) {\n return false;\n }\n const pos = this.getCenter(event);\n const newControllerState = this.controllerState.rotate({ pos });\n this.updateViewport(newControllerState, NO_TRANSITION_PROPS, {\n isDragging: true,\n isRotating: true\n });\n return true;\n }\n _onPanRotateEnd(event) {\n const { inertia } = this;\n if (this.dragRotate && inertia && event.velocity) {\n const pos = this.getCenter(event);\n const endPos = [\n pos[0] + (event.velocityX * inertia) / 2,\n pos[1] + (event.velocityY * inertia) / 2\n ];\n const newControllerState = this.controllerState.rotate({ pos: endPos }).rotateEnd();\n this.updateViewport(newControllerState, {\n ...this._getTransitionProps(),\n transitionDuration: inertia,\n transitionEasing: INERTIA_EASING\n }, {\n isDragging: false,\n isRotating: true\n });\n }\n else {\n const newControllerState = this.controllerState.rotateEnd();\n this.updateViewport(newControllerState, null, {\n isDragging: false,\n isRotating: false\n });\n }\n return true;\n }\n // Default handler for the `wheel` event.\n _onWheel(event) {\n if (!this.scrollZoom) {\n return false;\n }\n const pos = this.getCenter(event);\n if (!this.isPointInBounds(pos, event)) {\n return false;\n }\n event.srcEvent.preventDefault();\n const { speed = 0.01, smooth = false } = this.scrollZoom === true ? {} : this.scrollZoom;\n const { delta } = event;\n // Map wheel delta to relative scale\n let scale = 2 / (1 + Math.exp(-Math.abs(delta * speed)));\n if (delta < 0 && scale !== 0) {\n scale = 1 / scale;\n }\n const transitionProps = smooth\n ? { ...this._getTransitionProps({ around: pos }), transitionDuration: 250 }\n : NO_TRANSITION_PROPS;\n const newControllerState = this.controllerState.zoom({ pos, scale });\n this.updateViewport(newControllerState, transitionProps, {\n isZooming: true,\n isPanning: true\n });\n return true;\n }\n _onMultiPanStart(event) {\n const pos = this.getCenter(event);\n if (!this.isPointInBounds(pos, event)) {\n return false;\n }\n const newControllerState = this.controllerState.rotateStart({ pos });\n this.updateViewport(newControllerState, NO_TRANSITION_PROPS, { isDragging: true });\n return true;\n }\n _onMultiPan(event) {\n if (!this.touchRotate) {\n return false;\n }\n if (!this.isDragging()) {\n return false;\n }\n const pos = this.getCenter(event);\n pos[0] -= event.deltaX;\n const newControllerState = this.controllerState.rotate({ pos });\n this.updateViewport(newControllerState, NO_TRANSITION_PROPS, {\n isDragging: true,\n isRotating: true\n });\n return true;\n }\n _onMultiPanEnd(event) {\n if (!this.isDragging()) {\n return false;\n }\n const { inertia } = this;\n if (this.touchRotate && inertia && event.velocityY) {\n const pos = this.getCenter(event);\n const endPos = [pos[0], (pos[1] += (event.velocityY * inertia) / 2)];\n const newControllerState = this.controllerState.rotate({ pos: endPos });\n this.updateViewport(newControllerState, {\n ...this._getTransitionProps(),\n transitionDuration: inertia,\n transitionEasing: INERTIA_EASING\n }, {\n isDragging: false,\n isRotating: true\n });\n this.blockEvents(inertia);\n }\n else {\n const newControllerState = this.controllerState.rotateEnd();\n this.updateViewport(newControllerState, null, {\n isDragging: false,\n isRotating: false\n });\n }\n return true;\n }\n // Default handler for the `pinchstart` event.\n _onPinchStart(event) {\n const pos = this.getCenter(event);\n if (!this.isPointInBounds(pos, event)) {\n return false;\n }\n const newControllerState = this.controllerState.zoomStart({ pos }).rotateStart({ pos });\n // hack - hammer's `rotation` field doesn't seem to produce the correct angle\n pinchEventWorkaround._startPinchRotation = event.rotation;\n pinchEventWorkaround._lastPinchEvent = event;\n this.updateViewport(newControllerState, NO_TRANSITION_PROPS, { isDragging: true });\n return true;\n }\n // Default handler for the `pinchmove` and `pinchend` events.\n _onPinch(event) {\n if (!this.touchZoom && !this.touchRotate) {\n return false;\n }\n if (!this.isDragging()) {\n return false;\n }\n let newControllerState = this.controllerState;\n if (this.touchZoom) {\n const { scale } = event;\n const pos = this.getCenter(event);\n newControllerState = newControllerState.zoom({ pos, scale });\n }\n if (this.touchRotate) {\n const { rotation } = event;\n newControllerState = newControllerState.rotate({\n deltaAngleX: pinchEventWorkaround._startPinchRotation - rotation\n });\n }\n this.updateViewport(newControllerState, NO_TRANSITION_PROPS, {\n isDragging: true,\n isPanning: this.touchZoom,\n isZooming: this.touchZoom,\n isRotating: this.touchRotate\n });\n pinchEventWorkaround._lastPinchEvent = event;\n return true;\n }\n _onPinchEnd(event) {\n if (!this.isDragging()) {\n return false;\n }\n const { inertia } = this;\n const { _lastPinchEvent } = pinchEventWorkaround;\n if (this.touchZoom && inertia && _lastPinchEvent && event.scale !== _lastPinchEvent.scale) {\n const pos = this.getCenter(event);\n let newControllerState = this.controllerState.rotateEnd();\n const z = Math.log2(event.scale);\n const velocityZ = (z - Math.log2(_lastPinchEvent.scale)) / (event.deltaTime - _lastPinchEvent.deltaTime);\n const endScale = Math.pow(2, z + (velocityZ * inertia) / 2);\n newControllerState = newControllerState.zoom({ pos, scale: endScale }).zoomEnd();\n this.updateViewport(newControllerState, {\n ...this._getTransitionProps({ around: pos }),\n transitionDuration: inertia,\n transitionEasing: INERTIA_EASING\n }, {\n isDragging: false,\n isPanning: this.touchZoom,\n isZooming: this.touchZoom,\n isRotating: false\n });\n this.blockEvents(inertia);\n }\n else {\n const newControllerState = this.controllerState.zoomEnd().rotateEnd();\n this.updateViewport(newControllerState, null, {\n isDragging: false,\n isPanning: false,\n isZooming: false,\n isRotating: false\n });\n }\n pinchEventWorkaround._startPinchRotation = null;\n pinchEventWorkaround._lastPinchEvent = null;\n return true;\n }\n // Default handler for the `dblclick` event.\n _onDoubleClick(event) {\n if (!this.doubleClickZoom) {\n return false;\n }\n const pos = this.getCenter(event);\n if (!this.isPointInBounds(pos, event)) {\n return false;\n }\n const isZoomOut = this.isFunctionKeyPressed(event);\n const newControllerState = this.controllerState.zoom({ pos, scale: isZoomOut ? 0.5 : 2 });\n this.updateViewport(newControllerState, this._getTransitionProps({ around: pos }), {\n isZooming: true,\n isPanning: true\n });\n this.blockEvents(100);\n return true;\n }\n // Default handler for the `keydown` event\n _onKeyDown(event) {\n if (!this.keyboard) {\n return false;\n }\n const funcKey = this.isFunctionKeyPressed(event);\n // @ts-ignore\n const { zoomSpeed, moveSpeed, rotateSpeedX, rotateSpeedY } = this.keyboard === true ? {} : this.keyboard;\n const { controllerState } = this;\n let newControllerState;\n const interactionState = {};\n switch (event.srcEvent.code) {\n case 'Minus':\n newControllerState = funcKey\n ? controllerState.zoomOut(zoomSpeed).zoomOut(zoomSpeed)\n : controllerState.zoomOut(zoomSpeed);\n interactionState.isZooming = true;\n break;\n case 'Equal':\n newControllerState = funcKey\n ? controllerState.zoomIn(zoomSpeed).zoomIn(zoomSpeed)\n : controllerState.zoomIn(zoomSpeed);\n interactionState.isZooming = true;\n break;\n case 'ArrowLeft':\n if (funcKey) {\n newControllerState = controllerState.rotateLeft(rotateSpeedX);\n interactionState.isRotating = true;\n }\n else {\n newControllerState = controllerState.moveLeft(moveSpeed);\n interactionState.isPanning = true;\n }\n break;\n case 'ArrowRight':\n if (funcKey) {\n newControllerState = controllerState.rotateRight(rotateSpeedX);\n interactionState.isRotating = true;\n }\n else {\n newControllerState = controllerState.moveRight(moveSpeed);\n interactionState.isPanning = true;\n }\n break;\n case 'ArrowUp':\n if (funcKey) {\n newControllerState = controllerState.rotateUp(rotateSpeedY);\n interactionState.isRotating = true;\n }\n else {\n newControllerState = controllerState.moveUp(moveSpeed);\n interactionState.isPanning = true;\n }\n break;\n case 'ArrowDown':\n if (funcKey) {\n newControllerState = controllerState.rotateDown(rotateSpeedY);\n interactionState.isRotating = true;\n }\n else {\n newControllerState = controllerState.moveDown(moveSpeed);\n interactionState.isPanning = true;\n }\n break;\n default:\n return false;\n }\n this.updateViewport(newControllerState, this._getTransitionProps(), interactionState);\n return true;\n }\n _getTransitionProps(opts) {\n const { transition } = this;\n if (!transition || !transition.transitionInterpolator) {\n return NO_TRANSITION_PROPS;\n }\n // Enables Transitions on double-tap and key-down events.\n return opts\n ? {\n ...transition,\n transitionInterpolator: new LinearInterpolator({\n ...opts,\n ...transition.transitionInterpolator.opts,\n makeViewport: this.controllerState.makeViewport\n })\n }\n : transition;\n }\n}\n//# sourceMappingURL=controller.js.map","// deck.gl\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\nexport default class ViewState {\n constructor(props, state) {\n this._viewportProps = this.applyConstraints(props);\n this._state = state;\n }\n getViewportProps() {\n return this._viewportProps;\n }\n getState() {\n return this._state;\n }\n}\n//# sourceMappingURL=view-state.js.map","// deck.gl\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\nimport { clamp } from '@math.gl/core';\nimport Controller from \"./controller.js\";\nimport ViewState from \"./view-state.js\";\nimport { normalizeViewportProps } from '@math.gl/web-mercator';\nimport assert from \"../utils/assert.js\";\nimport LinearInterpolator from \"../transitions/linear-interpolator.js\";\nconst PITCH_MOUSE_THRESHOLD = 5;\nconst PITCH_ACCEL = 1.2;\n/* Utils */\nexport class MapState extends ViewState {\n constructor(options) {\n const { \n /** Mapbox viewport properties */\n /** The width of the viewport */\n width, \n /** The height of the viewport */\n height, \n /** The latitude at the center of the viewport */\n latitude, \n /** The longitude at the center of the viewport */\n longitude, \n /** The tile zoom level of the map. */\n zoom, \n /** The bearing of the viewport in degrees */\n bearing = 0, \n /** The pitch of the viewport in degrees */\n pitch = 0, \n /**\n * Specify the altitude of the viewport camera\n * Unit: map heights, default 1.5\n * Non-public API, see https://github.com/mapbox/mapbox-gl-js/issues/1137\n */\n altitude = 1.5, \n /** Viewport position */\n position = [0, 0, 0], \n /** Viewport constraints */\n maxZoom = 20, minZoom = 0, maxPitch = 60, minPitch = 0, \n /** Interaction states, required to calculate change during transform */\n /* The point on map being grabbed when the operation first started */\n startPanLngLat, \n /* Center of the zoom when the operation first started */\n startZoomLngLat, \n /* Pointer position when rotation started */\n startRotatePos, \n /** Bearing when current perspective rotate operation started */\n startBearing, \n /** Pitch when current perspective rotate operation started */\n startPitch, \n /** Zoom when current zoom operation started */\n startZoom, \n /** Normalize viewport props to fit map height into viewport */\n normalize = true } = options;\n assert(Number.isFinite(longitude)); // `longitude` must be supplied\n assert(Number.isFinite(latitude)); // `latitude` must be supplied\n assert(Number.isFinite(zoom)); // `zoom` must be supplied\n super({\n width,\n height,\n latitude,\n longitude,\n zoom,\n bearing,\n pitch,\n altitude,\n maxZoom,\n minZoom,\n maxPitch,\n minPitch,\n normalize,\n position\n }, {\n startPanLngLat,\n startZoomLngLat,\n startRotatePos,\n startBearing,\n startPitch,\n startZoom\n });\n this.makeViewport = options.makeViewport;\n }\n /**\n * Start panning\n * @param {[Number, Number]} pos - position on screen where the pointer grabs\n */\n panStart({ pos }) {\n return this._getUpdatedState({\n startPanLngLat: this._unproject(pos)\n });\n }\n /**\n * Pan\n * @param {[Number, Number]} pos - position on screen where the pointer is\n * @param {[Number, Number], optional} startPos - where the pointer grabbed at\n * the start of the operation. Must be supplied of `panStart()` was not called\n */\n pan({ pos, startPos }) {\n const startPanLngLat = this.getState().startPanLngLat || this._unproject(startPos);\n if (!startPanLngLat) {\n return this;\n }\n const viewport = this.makeViewport(this.getViewportProps());\n const newProps = viewport.panByPosition(startPanLngLat, pos);\n return this._getUpdatedState(newProps);\n }\n /**\n * End panning\n * Must call if `panStart()` was called\n */\n panEnd() {\n return this._getUpdatedState({\n startPanLngLat: null\n });\n }\n /**\n * Start rotating\n * @param {[Number, Number]} pos - position on screen where the center is\n */\n rotateStart({ pos }) {\n return this._getUpdatedState({\n startRotatePos: pos,\n startBearing: this.getViewportProps().bearing,\n startPitch: this.getViewportProps().pitch\n });\n }\n /**\n * Rotate\n * @param {[Number, Number]} pos - position on screen where the center is\n */\n rotate({ pos, deltaAngleX = 0, deltaAngleY = 0 }) {\n const { startRotatePos, startBearing, startPitch } = this.getState();\n if (!startRotatePos || startBearing === undefined || startPitch === undefined) {\n return this;\n }\n let newRotation;\n if (pos) {\n newRotation = this._getNewRotation(pos, startRotatePos, startPitch, startBearing);\n }\n else {\n newRotation = {\n bearing: startBearing + deltaAngleX,\n pitch: startPitch + deltaAngleY\n };\n }\n return this._getUpdatedState(newRotation);\n }\n /**\n * End rotating\n * Must call if `rotateStart()` was called\n */\n rotateEnd() {\n return this._getUpdatedState({\n startBearing: null,\n startPitch: null\n });\n }\n /**\n * Start zooming\n * @param {[Number, Number]} pos - position on screen where the center is\n */\n zoomStart({ pos }) {\n return this._getUpdatedState({\n startZoomLngLat: this._unproject(pos),\n startZoom: this.getViewportProps().zoom\n });\n }\n /**\n * Zoom\n * @param {[Number, Number]} pos - position on screen where the current center is\n * @param {[Number, Number]} startPos - the center position at\n * the start of the operation. Must be supplied of `zoomStart()` was not called\n * @param {Number} scale - a number between [0, 1] specifying the accumulated\n * relative scale.\n */\n zoom({ pos, startPos, scale }) {\n // Make sure we zoom around the current mouse position rather than map center\n let { startZoom, startZoomLngLat } = this.getState();\n if (!startZoomLngLat) {\n // We have two modes of zoom:\n // scroll zoom that are discrete events (transform from the current zoom level),\n // and pinch zoom that are continuous events (transform from the zoom level when\n // pinch started).\n // If startZoom state is defined, then use the startZoom state;\n // otherwise assume discrete zooming\n startZoom = this.getViewportProps().zoom;\n startZoomLngLat = this._unproject(startPos) || this._unproject(pos);\n }\n if (!startZoomLngLat) {\n return this;\n }\n const { maxZoom, minZoom } = this.getViewportProps();\n let zoom = startZoom + Math.log2(scale);\n zoom = clamp(zoom, minZoom, maxZoom);\n const zoomedViewport = this.makeViewport({ ...this.getViewportProps(), zoom });\n return this._getUpdatedState({\n zoom,\n ...zoomedViewport.panByPosition(startZoomLngLat, pos)\n });\n }\n /**\n * End zooming\n * Must call if `zoomStart()` was called\n */\n zoomEnd() {\n return this._getUpdatedState({\n startZoomLngLat: null,\n startZoom: null\n });\n }\n zoomIn(speed = 2) {\n return this._zoomFromCenter(speed);\n }\n zoomOut(speed = 2) {\n return this._zoomFromCenter(1 / speed);\n }\n moveLeft(speed = 100) {\n return this._panFromCenter([speed, 0]);\n }\n moveRight(speed = 100) {\n return this._panFromCenter([-speed, 0]);\n }\n moveUp(speed = 100) {\n return this._panFromCenter([0, speed]);\n }\n moveDown(speed = 100) {\n return this._panFromCenter([0, -speed]);\n }\n rotateLeft(speed = 15) {\n return this._getUpdatedState({\n bearing: this.getViewportProps().bearing - speed\n });\n }\n rotateRight(speed = 15) {\n return this._getUpdatedState({\n bearing: this.getViewportProps().bearing + speed\n });\n }\n rotateUp(speed = 10) {\n return this._getUpdatedState({\n pitch: this.getViewportProps().pitch + speed\n });\n }\n rotateDown(speed = 10) {\n return this._getUpdatedState({\n pitch: this.getViewportProps().pitch - speed\n });\n }\n shortestPathFrom(viewState) {\n // const endViewStateProps = new this.ControllerState(endProps).shortestPathFrom(startViewstate);\n const fromProps = viewState.getViewportProps();\n const props = { ...this.getViewportProps() };\n const { bearing, longitude } = props;\n if (Math.abs(bearing - fromProps.bearing) > 180) {\n props.bearing = bearing < 0 ? bearing + 360 : bearing - 360;\n }\n if (Math.abs(longitude - fromProps.longitude) > 180) {\n props.longitude = longitude < 0 ? longitude + 360 : longitude - 360;\n }\n return props;\n }\n // Apply any constraints (mathematical or defined by _viewportProps) to map state\n applyConstraints(props) {\n // Ensure zoom is within specified range\n const { maxZoom, minZoom, zoom } = props;\n props.zoom = clamp(zoom, minZoom, maxZoom);\n // Ensure pitch is within specified range\n const { maxPitch, minPitch, pitch } = props;\n props.pitch = clamp(pitch, minPitch, maxPitch);\n // Normalize viewport props to fit map height into viewport\n const { normalize = true } = props;\n if (normalize) {\n Object.assign(props, normalizeViewportProps(props));\n }\n return props;\n }\n /* Private methods */\n _zoomFromCenter(scale) {\n const { width, height } = this.getViewportProps();\n return this.zoom({\n pos: [width / 2, height / 2],\n scale\n });\n }\n _panFromCenter(offset) {\n const { width, height } = this.getViewportProps();\n return this.pan({\n startPos: [width / 2, height / 2],\n pos: [width / 2 + offset[0], height / 2 + offset[1]]\n });\n }\n _getUpdatedState(newProps) {\n // @ts-ignore\n return new this.constructor({\n makeViewport: this.makeViewport,\n ...this.getViewportProps(),\n ...this.getState(),\n ...newProps\n });\n }\n _unproject(pos) {\n const viewport = this.makeViewport(this.getViewportProps());\n // @ts-ignore\n return pos && viewport.unproject(pos);\n }\n _getNewRotation(pos, startPos, startPitch, startBearing) {\n const deltaX = pos[0] - startPos[0];\n const deltaY = pos[1] - startPos[1];\n const centerY = pos[1];\n const startY = startPos[1];\n const { width, height } = this.getViewportProps();\n const deltaScaleX = deltaX / width;\n let deltaScaleY = 0;\n if (deltaY > 0) {\n if (Math.abs(height - startY) > PITCH_MOUSE_THRESHOLD) {\n // Move from 0 to -1 as we drag upwards\n deltaScaleY = (deltaY / (startY - height)) * PITCH_ACCEL;\n }\n }\n else if (deltaY < 0) {\n if (startY > PITCH_MOUSE_THRESHOLD) {\n // Move from 0 to 1 as we drag upwards\n deltaScaleY = 1 - centerY / startY;\n }\n }\n // clamp deltaScaleY to [-1, 1] so that rotation is constrained between minPitch and maxPitch.\n // deltaScaleX does not need to be clamped as bearing does not have constraints.\n deltaScaleY = clamp(deltaScaleY, -1, 1);\n const { minPitch, maxPitch } = this.getViewportProps();\n const bearing = startBearing + 180 * deltaScaleX;\n let pitch = startPitch;\n if (deltaScaleY > 0) {\n // Gradually increase pitch\n pitch = startPitch + deltaScaleY * (maxPitch - startPitch);\n }\n else if (deltaScaleY < 0) {\n // Gradually decrease pitch\n pitch = startPitch - deltaScaleY * (minPitch - startPitch);\n }\n return {\n pitch,\n bearing\n };\n }\n}\nexport default class MapController extends Controller {\n constructor() {\n super(...arguments);\n this.ControllerState = MapState;\n this.transition = {\n transitionDuration: 300,\n transitionInterpolator: new LinearInterpolator({\n transitionProps: {\n compare: ['longitude', 'latitude', 'zoom', 'bearing', 'pitch', 'position'],\n required: ['longitude', 'latitude', 'zoom']\n }\n })\n };\n this.dragMode = 'pan';\n }\n setProps(props) {\n props.position = props.position || [0, 0, 0];\n const oldProps = this.props;\n super.setProps(props);\n const dimensionChanged = !oldProps || oldProps.height !== props.height;\n if (dimensionChanged) {\n // Dimensions changed, normalize the props\n this.updateViewport(new this.ControllerState({\n makeViewport: this.makeViewport,\n ...props,\n ...this.state\n }));\n }\n }\n}\n//# sourceMappingURL=map-controller.js.map","// deck.gl\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\nimport View from \"./view.js\";\nimport WebMercatorViewport from \"../viewports/web-mercator-viewport.js\";\nimport MapController from \"../controllers/map-controller.js\";\nclass MapView extends View {\n constructor(props = {}) {\n super(props);\n }\n getViewportType() {\n return WebMercatorViewport;\n }\n get ControllerType() {\n return MapController;\n }\n}\nMapView.displayName = 'MapView';\nexport default MapView;\n//# sourceMappingURL=map-view.js.map","// deck.gl\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\nimport { deepEqual } from \"../utils/deep-equal.js\";\nimport LightingEffect from \"../effects/lighting/lighting-effect.js\";\nconst DEFAULT_LIGHTING_EFFECT = new LightingEffect();\n/** Sort two effects. Returns 0 if equal, negative if e1 < e2, positive if e1 > e2 */\nfunction compareEffects(e1, e2) {\n const o1 = e1.order ?? Infinity;\n const o2 = e2.order ?? Infinity;\n return o1 - o2;\n}\nexport default class EffectManager {\n constructor(context) {\n this._resolvedEffects = [];\n /** Effect instances and order preference pairs, sorted by order */\n this._defaultEffects = [];\n this.effects = [];\n this._context = context;\n this._needsRedraw = 'Initial render';\n this._setEffects([]);\n }\n /**\n * Register a new default effect, i.e. an effect presents regardless of user supplied props.effects\n */\n addDefaultEffect(effect) {\n const defaultEffects = this._defaultEffects;\n if (!defaultEffects.find(e => e.id === effect.id)) {\n const index = defaultEffects.findIndex(e => compareEffects(e, effect) > 0);\n if (index < 0) {\n defaultEffects.push(effect);\n }\n else {\n defaultEffects.splice(index, 0, effect);\n }\n effect.setup(this._context);\n this._setEffects(this.effects);\n }\n }\n setProps(props) {\n if ('effects' in props) {\n // Compare effects against each other shallowly\n if (!deepEqual(props.effects, this.effects, 1)) {\n this._setEffects(props.effects);\n }\n }\n }\n needsRedraw(opts = { clearRedrawFlags: false }) {\n const redraw = this._needsRedraw;\n if (opts.clearRedrawFlags) {\n this._needsRedraw = false;\n }\n return redraw;\n }\n getEffects() {\n return this._resolvedEffects;\n }\n _setEffects(effects) {\n const oldEffectsMap = {};\n for (const effect of this.effects) {\n oldEffectsMap[effect.id] = effect;\n }\n const nextEffects = [];\n for (const effect of effects) {\n const oldEffect = oldEffectsMap[effect.id];\n let effectToAdd = effect;\n if (oldEffect && oldEffect !== effect) {\n if (oldEffect.setProps) {\n oldEffect.setProps(effect.props);\n effectToAdd = oldEffect;\n }\n else {\n oldEffect.cleanup(this._context);\n }\n }\n else if (!oldEffect) {\n effect.setup(this._context);\n }\n nextEffects.push(effectToAdd);\n delete oldEffectsMap[effect.id];\n }\n for (const removedEffectId in oldEffectsMap) {\n oldEffectsMap[removedEffectId].cleanup(this._context);\n }\n this.effects = nextEffects;\n this._resolvedEffects = nextEffects.concat(this._defaultEffects);\n // Special case for lighting: only add default instance if no LightingEffect is specified\n if (!effects.some(effect => effect instanceof LightingEffect)) {\n this._resolvedEffects.push(DEFAULT_LIGHTING_EFFECT);\n }\n this._needsRedraw = 'effects changed';\n }\n finalize() {\n for (const effect of this._resolvedEffects) {\n effect.cleanup(this._context);\n }\n this.effects.length = 0;\n this._resolvedEffects.length = 0;\n this._defaultEffects.length = 0;\n }\n}\n//# sourceMappingURL=effect-manager.js.map","// deck.gl\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\nimport LayersPass from \"./layers-pass.js\";\nexport default class DrawLayersPass extends LayersPass {\n shouldDrawLayer(layer) {\n const { operation } = layer.props;\n return operation.includes('draw') || operation.includes('terrain');\n }\n}\n//# sourceMappingURL=draw-layers-pass.js.map","// deck.gl\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\nimport debug from \"../debug/index.js\";\nimport DrawLayersPass from \"../passes/draw-layers-pass.js\";\nimport PickLayersPass from \"../passes/pick-layers-pass.js\";\nconst TRACE_RENDER_LAYERS = 'deckRenderer.renderLayers';\nexport default class DeckRenderer {\n constructor(device) {\n this.device = device;\n this.layerFilter = null;\n this.drawPickingColors = false;\n this.drawLayersPass = new DrawLayersPass(device);\n this.pickLayersPass = new PickLayersPass(device);\n this.renderCount = 0;\n this._needsRedraw = 'Initial render';\n this.renderBuffers = [];\n this.lastPostProcessEffect = null;\n }\n setProps(props) {\n if (this.layerFilter !== props.layerFilter) {\n this.layerFilter = props.layerFilter;\n this._needsRedraw = 'layerFilter changed';\n }\n if (this.drawPickingColors !== props.drawPickingColors) {\n this.drawPickingColors = props.drawPickingColors;\n this._needsRedraw = 'drawPickingColors changed';\n }\n }\n renderLayers(opts) {\n if (!opts.viewports.length) {\n return;\n }\n const layerPass = this.drawPickingColors ? this.pickLayersPass : this.drawLayersPass;\n const renderOpts = {\n layerFilter: this.layerFilter,\n isPicking: this.drawPickingColors,\n ...opts\n };\n if (renderOpts.effects) {\n this._preRender(renderOpts.effects, renderOpts);\n }\n const outputBuffer = this.lastPostProcessEffect ? this.renderBuffers[0] : renderOpts.target;\n if (this.lastPostProcessEffect) {\n renderOpts.clearColor = [0, 0, 0, 0];\n renderOpts.clearCanvas = true;\n }\n const renderStats = layerPass.render({ ...renderOpts, target: outputBuffer });\n if (renderOpts.effects) {\n if (this.lastPostProcessEffect) {\n // Interleaved basemap rendering requires clearCanvas to be false\n renderOpts.clearCanvas = opts.clearCanvas === undefined ? true : opts.clearCanvas;\n }\n this._postRender(renderOpts.effects, renderOpts);\n }\n this.renderCount++;\n debug(TRACE_RENDER_LAYERS, this, renderStats, opts);\n }\n needsRedraw(opts = { clearRedrawFlags: false }) {\n const redraw = this._needsRedraw;\n if (opts.clearRedrawFlags) {\n this._needsRedraw = false;\n }\n return redraw;\n }\n finalize() {\n const { renderBuffers } = this;\n for (const buffer of renderBuffers) {\n buffer.delete();\n }\n renderBuffers.length = 0;\n }\n _preRender(effects, opts) {\n this.lastPostProcessEffect = null;\n opts.preRenderStats = opts.preRenderStats || {};\n for (const effect of effects) {\n opts.preRenderStats[effect.id] = effect.preRender(opts);\n if (effect.postRender) {\n this.lastPostProcessEffect = effect.id;\n }\n }\n if (this.lastPostProcessEffect) {\n this._resizeRenderBuffers();\n }\n }\n _resizeRenderBuffers() {\n const { renderBuffers } = this;\n const size = this.device.canvasContext.getDrawingBufferSize();\n const [width, height] = size;\n if (renderBuffers.length === 0) {\n [0, 1].map(i => {\n const texture = this.device.createTexture({\n sampler: { minFilter: 'linear', magFilter: 'linear' },\n width,\n height\n });\n renderBuffers.push(this.device.createFramebuffer({\n id: `deck-renderbuffer-${i}`,\n colorAttachments: [texture]\n }));\n });\n }\n for (const buffer of renderBuffers) {\n buffer.resize(size);\n }\n }\n _postRender(effects, opts) {\n const { renderBuffers } = this;\n const params = {\n ...opts,\n inputBuffer: renderBuffers[0],\n swapBuffer: renderBuffers[1]\n };\n for (const effect of effects) {\n if (effect.postRender) {\n // If not the last post processing effect, unset the target so that\n // it only renders between the swap buffers\n params.target = effect.id === this.lastPostProcessEffect ? opts.target : undefined;\n const buffer = effect.postRender(params);\n // Buffer cannot be null if target is unset\n params.inputBuffer = buffer;\n params.swapBuffer = buffer === renderBuffers[0] ? renderBuffers[1] : renderBuffers[0];\n }\n }\n }\n}\n//# sourceMappingURL=deck-renderer.js.map","// deck.gl\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\nimport log from \"../../utils/log.js\";\nconst NO_PICKED_OBJECT = {\n pickedColor: null,\n pickedObjectIndex: -1\n};\n/* eslint-disable max-depth, max-statements */\n/**\n * Pick at a specified pixel with a tolerance radius\n * Returns the closest object to the pixel in shape `{pickedColor, pickedLayer, pickedObjectIndex}`\n */\nexport function getClosestObject({ pickedColors, decodePickingColor, deviceX, deviceY, deviceRadius, deviceRect }) {\n // Traverse all pixels in picking results and find the one closest to the supplied\n // [deviceX, deviceY]\n const { x, y, width, height } = deviceRect;\n let minSquareDistanceToCenter = deviceRadius * deviceRadius;\n let closestPixelIndex = -1;\n let i = 0;\n for (let row = 0; row < height; row++) {\n const dy = row + y - deviceY;\n const dy2 = dy * dy;\n if (dy2 > minSquareDistanceToCenter) {\n // skip this row\n i += 4 * width;\n }\n else {\n for (let col = 0; col < width; col++) {\n // Decode picked layer from color\n const pickedLayerIndex = pickedColors[i + 3] - 1;\n if (pickedLayerIndex >= 0) {\n const dx = col + x - deviceX;\n const d2 = dx * dx + dy2;\n if (d2 <= minSquareDistanceToCenter) {\n minSquareDistanceToCenter = d2;\n closestPixelIndex = i;\n }\n }\n i += 4;\n }\n }\n }\n if (closestPixelIndex >= 0) {\n // Decode picked object index from color\n const pickedColor = pickedColors.slice(closestPixelIndex, closestPixelIndex + 4);\n const pickedObject = decodePickingColor(pickedColor);\n if (pickedObject) {\n const dy = Math.floor(closestPixelIndex / 4 / width);\n const dx = closestPixelIndex / 4 - dy * width;\n return {\n ...pickedObject,\n pickedColor,\n pickedX: x + dx,\n pickedY: y + dy\n };\n }\n log.error('Picked non-existent layer. Is picking buffer corrupt?')();\n }\n return NO_PICKED_OBJECT;\n}\n/**\n * Examines a picking buffer for unique colors\n * Returns array of unique objects in shape `{x, y, pickedColor, pickedLayer, pickedObjectIndex}`\n */\nexport function getUniqueObjects({ pickedColors, decodePickingColor }) {\n const uniqueColors = new Map();\n // Traverse all pixels in picking results and get unique colors\n if (pickedColors) {\n for (let i = 0; i < pickedColors.length; i += 4) {\n // Decode picked layer from color\n const pickedLayerIndex = pickedColors[i + 3] - 1;\n if (pickedLayerIndex >= 0) {\n const pickedColor = pickedColors.slice(i, i + 4);\n const colorKey = pickedColor.join(',');\n // eslint-disable-next-line\n if (!uniqueColors.has(colorKey)) {\n const pickedObject = decodePickingColor(pickedColor);\n // eslint-disable-next-line\n if (pickedObject) {\n uniqueColors.set(colorKey, {\n ...pickedObject,\n color: pickedColor\n });\n }\n else {\n log.error('Picked non-existent layer. Is picking buffer corrupt?')();\n }\n }\n }\n }\n }\n return Array.from(uniqueColors.values());\n}\n//# sourceMappingURL=query-object.js.map","// deck.gl\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\n/** Generates some basic information of the picking action: x, y, coordinates etc.\n * Regardless if anything is picked\n */\nexport function getEmptyPickingInfo({ pickInfo, viewports, pixelRatio, x, y, z }) {\n // If more than one viewports are used in the picking pass, locate the viewport that\n // drew the picked pixel\n let pickedViewport = viewports[0];\n if (viewports.length > 1) {\n // Find the viewport that contain the picked pixel\n pickedViewport = getViewportFromCoordinates(pickInfo?.pickedViewports || viewports, { x, y });\n }\n let coordinate;\n if (pickedViewport) {\n const point = [x - pickedViewport.x, y - pickedViewport.y];\n if (z !== undefined) {\n point[2] = z;\n }\n coordinate = pickedViewport.unproject(point);\n }\n return {\n color: null,\n layer: null,\n viewport: pickedViewport,\n index: -1,\n picked: false,\n x,\n y,\n pixel: [x, y],\n coordinate,\n devicePixel: pickInfo && 'pickedX' in pickInfo\n ? [pickInfo.pickedX, pickInfo.pickedY]\n : undefined,\n pixelRatio\n };\n}\n/* eslint-disable max-depth */\n/** Generates the picking info of a picking operation */\nexport function processPickInfo(opts) {\n const { pickInfo, lastPickedInfo, mode, layers } = opts;\n const { pickedColor, pickedLayer, pickedObjectIndex } = pickInfo;\n const affectedLayers = pickedLayer ? [pickedLayer] : [];\n if (mode === 'hover') {\n // only invoke onHover events if picked object has changed\n const lastPickedPixelIndex = lastPickedInfo.index;\n const lastPickedLayerId = lastPickedInfo.layerId;\n const pickedLayerId = pickedLayer ? pickedLayer.props.id : null;\n // proceed only if picked object changed\n if (pickedLayerId !== lastPickedLayerId || pickedObjectIndex !== lastPickedPixelIndex) {\n if (pickedLayerId !== lastPickedLayerId) {\n // We cannot store a ref to lastPickedLayer in the context because\n // the state of an outdated layer is no longer valid\n // and the props may have changed\n const lastPickedLayer = layers.find(layer => layer.props.id === lastPickedLayerId);\n if (lastPickedLayer) {\n // Let leave event fire before enter event\n affectedLayers.unshift(lastPickedLayer);\n }\n }\n // Update layer manager context\n lastPickedInfo.layerId = pickedLayerId;\n lastPickedInfo.index = pickedObjectIndex;\n lastPickedInfo.info = null;\n }\n }\n const baseInfo = getEmptyPickingInfo(opts);\n // Use a Map to store all picking infos.\n // The following two forEach loops are the result of\n // https://github.com/visgl/deck.gl/issues/443\n // Please be very careful when changing this pattern\n const infos = new Map();\n // Make sure infos always contain something even if no layer is affected\n infos.set(null, baseInfo);\n affectedLayers.forEach(layer => {\n let info = { ...baseInfo };\n if (layer === pickedLayer) {\n info.color = pickedColor;\n info.index = pickedObjectIndex;\n info.picked = true;\n }\n info = getLayerPickingInfo({ layer, info, mode });\n const rootLayer = info.layer;\n if (layer === pickedLayer && mode === 'hover') {\n lastPickedInfo.info = info;\n }\n // This guarantees that there will be only one copy of info for\n // one composite layer\n infos.set(rootLayer.id, info);\n if (mode === 'hover') {\n rootLayer.updateAutoHighlight(info);\n }\n });\n return infos;\n}\n/** Walk up the layer composite chain to populate the info object */\nexport function getLayerPickingInfo({ layer, info, mode }) {\n while (layer && info) {\n // For a composite layer, sourceLayer will point to the sublayer\n // where the event originates from.\n // It provides additional context for the composite layer's\n // getPickingInfo() method to populate the info object\n const sourceLayer = info.layer || null;\n info.sourceLayer = sourceLayer;\n info.layer = layer;\n // layer.pickLayer() function requires a non-null ```layer.state```\n // object to function properly. So the layer referenced here\n // must be the \"current\" layer, not an \"out-dated\" / \"invalidated\" layer\n info = layer.getPickingInfo({ info, mode, sourceLayer });\n layer = layer.parent;\n }\n return info;\n}\n/** Indentifies which viewport, if any corresponds to x and y\n If multiple viewports contain the target pixel, last viewport drawn is returend\n Returns first viewport if no match */\nfunction getViewportFromCoordinates(viewports, pixel) {\n // find the last viewport that contains the pixel\n for (let i = viewports.length - 1; i >= 0; i--) {\n const viewport = viewports[i];\n if (viewport.containsPixel(pixel)) {\n return viewport;\n }\n }\n return viewports[0];\n}\n//# sourceMappingURL=pick-info.js.map","// deck.gl\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\nimport PickLayersPass from \"../passes/pick-layers-pass.js\";\nimport { getClosestObject, getUniqueObjects } from \"./picking/query-object.js\";\nimport { processPickInfo, getLayerPickingInfo, getEmptyPickingInfo } from \"./picking/pick-info.js\";\n/** Manages picking in a Deck context */\nexport default class DeckPicker {\n constructor(device) {\n this._pickable = true;\n this.device = device;\n this.pickLayersPass = new PickLayersPass(device);\n this.lastPickedInfo = {\n index: -1,\n layerId: null,\n info: null\n };\n }\n setProps(props) {\n if ('layerFilter' in props) {\n this.layerFilter = props.layerFilter;\n }\n if ('_pickable' in props) {\n this._pickable = props._pickable;\n }\n }\n finalize() {\n if (this.pickingFBO) {\n this.pickingFBO.destroy();\n }\n if (this.depthFBO) {\n this.depthFBO.destroy();\n }\n }\n /**\n * Pick the closest info at given coordinate\n * @returns Promise that resolves with picking info\n */\n pickObjectAsync(opts) {\n return this._pickClosestObjectAsync(opts);\n }\n /**\n * Picks a list of unique infos within a bounding box\n * @returns Promise that resolves to all unique infos within a bounding box\n */\n pickObjectsAsync(opts) {\n return this._pickVisibleObjectsAsync(opts);\n }\n /**\n * Pick the closest info at given coordinate\n * @returns picking info\n * @deprecated WebGL only - use pickObjectAsync instead\n */\n pickObject(opts) {\n return this._pickClosestObject(opts);\n }\n /**\n * Get all unique infos within a bounding box\n * @returns all unique infos within a bounding box\n * @deprecated WebGL only - use pickObjectAsync instead\n */\n pickObjects(opts) {\n return this._pickVisibleObjects(opts);\n }\n // Returns a new picking info object by assuming the last picked object is still picked\n getLastPickedObject({ x, y, layers, viewports }, lastPickedInfo = this.lastPickedInfo.info) {\n const lastPickedLayerId = lastPickedInfo && lastPickedInfo.layer && lastPickedInfo.layer.id;\n const lastPickedViewportId = lastPickedInfo && lastPickedInfo.viewport && lastPickedInfo.viewport.id;\n const layer = lastPickedLayerId ? layers.find(l => l.id === lastPickedLayerId) : null;\n const viewport = (lastPickedViewportId && viewports.find(v => v.id === lastPickedViewportId)) || viewports[0];\n const coordinate = viewport && viewport.unproject([x - viewport.x, y - viewport.y]);\n const info = {\n x,\n y,\n viewport,\n coordinate,\n layer\n };\n return { ...lastPickedInfo, ...info };\n }\n // Private\n /** Ensures that picking framebuffer exists and matches the canvas size */\n _resizeBuffer() {\n // Create a frame buffer if not already available\n if (!this.pickingFBO) {\n this.pickingFBO = this.device.createFramebuffer({\n colorAttachments: ['rgba8unorm'],\n depthStencilAttachment: 'depth16unorm'\n });\n if (this.device.isTextureFormatRenderable('rgba32float')) {\n const depthFBO = this.device.createFramebuffer({\n colorAttachments: ['rgba32float'],\n depthStencilAttachment: 'depth16unorm'\n });\n this.depthFBO = depthFBO;\n }\n }\n // Resize it to current canvas size (this is a noop if size hasn't changed)\n const { canvas } = this.device.getDefaultCanvasContext();\n this.pickingFBO?.resize({ width: canvas.width, height: canvas.height });\n this.depthFBO?.resize({ width: canvas.width, height: canvas.height });\n }\n /** Preliminary filtering of the layers list. Skid picking pass if no layer is pickable. */\n _getPickable(layers) {\n if (this._pickable === false) {\n return null;\n }\n const pickableLayers = layers.filter(layer => this.pickLayersPass.shouldDrawLayer(layer) && !layer.isComposite);\n return pickableLayers.length ? pickableLayers : null;\n }\n /**\n * Pick the closest object at the given coordinate\n */\n // eslint-disable-next-line max-statements,complexity\n async _pickClosestObjectAsync({ layers, views, viewports, x, y, radius = 0, depth = 1, mode = 'query', unproject3D, onViewportActive, effects }) {\n // @ts-expect-error TODO - assuming WebGL context\n const pixelRatio = this.device.canvasContext.cssToDeviceRatio();\n const pickableLayers = this._getPickable(layers);\n if (!pickableLayers || viewports.length === 0) {\n return {\n result: [],\n emptyInfo: getEmptyPickingInfo({ viewports, x, y, pixelRatio })\n };\n }\n this._resizeBuffer();\n // Convert from canvas top-left to WebGL bottom-left coordinates\n // Top-left coordinates [x, y] to bottom-left coordinates [deviceX, deviceY]\n // And compensate for pixelRatio\n // @ts-expect-error TODO - assuming WebGL context\n const devicePixelRange = this.device.canvasContext.cssToDevicePixels([x, y], true);\n const devicePixel = [\n devicePixelRange.x + Math.floor(devicePixelRange.width / 2),\n devicePixelRange.y + Math.floor(devicePixelRange.height / 2)\n ];\n const deviceRadius = Math.round(radius * pixelRatio);\n const { width, height } = this.pickingFBO;\n const deviceRect = this._getPickingRect({\n deviceX: devicePixel[0],\n deviceY: devicePixel[1],\n deviceRadius,\n deviceWidth: width,\n deviceHeight: height\n });\n const cullRect = {\n x: x - radius,\n y: y - radius,\n width: radius * 2 + 1,\n height: radius * 2 + 1\n };\n let infos;\n const result = [];\n const affectedLayers = new Set();\n for (let i = 0; i < depth; i++) {\n let pickInfo;\n if (deviceRect) {\n const pickedResult = this._drawAndSample({\n layers: pickableLayers,\n views,\n viewports,\n onViewportActive,\n deviceRect,\n cullRect,\n effects,\n pass: `picking:${mode}`\n });\n pickInfo = getClosestObject({\n ...pickedResult,\n deviceX: devicePixel[0],\n deviceY: devicePixel[1],\n deviceRadius,\n deviceRect\n });\n }\n else {\n pickInfo = {\n pickedColor: null,\n pickedObjectIndex: -1\n };\n }\n let z;\n if (pickInfo.pickedLayer && unproject3D && this.depthFBO) {\n const { pickedColors: pickedColors2 } = this._drawAndSample({\n layers: [pickInfo.pickedLayer],\n views,\n viewports,\n onViewportActive,\n deviceRect: {\n x: pickInfo.pickedX,\n y: pickInfo.pickedY,\n width: 1,\n height: 1\n },\n cullRect,\n effects,\n pass: `picking:${mode}:z`\n }, true);\n // picked value is in common space (pixels) from the camera target (viewport.position)\n // convert it to meters from the ground\n if (pickedColors2[3]) {\n z = pickedColors2[0];\n }\n }\n // Only exclude if we need to run picking again.\n // We need to run picking again if an object is detected AND\n // we have not exhausted the requested depth.\n if (pickInfo.pickedLayer && i + 1 < depth) {\n affectedLayers.add(pickInfo.pickedLayer);\n pickInfo.pickedLayer.disablePickingIndex(pickInfo.pickedObjectIndex);\n }\n // This logic needs to run even if no object is picked.\n infos = processPickInfo({\n pickInfo,\n lastPickedInfo: this.lastPickedInfo,\n mode,\n layers: pickableLayers,\n viewports,\n x,\n y,\n z,\n pixelRatio\n });\n for (const info of infos.values()) {\n if (info.layer) {\n result.push(info);\n }\n }\n // If no object is picked stop.\n if (!pickInfo.pickedColor) {\n break;\n }\n }\n // reset only affected buffers\n for (const layer of affectedLayers) {\n layer.restorePickingColors();\n }\n return { result, emptyInfo: infos.get(null) };\n }\n /**\n * Pick the closest object at the given coordinate\n * @deprecated WebGL only\n */\n // eslint-disable-next-line max-statements,complexity\n _pickClosestObject({ layers, views, viewports, x, y, radius = 0, depth = 1, mode = 'query', unproject3D, onViewportActive, effects }) {\n // @ts-expect-error TODO - assuming WebGL context\n const pixelRatio = this.device.canvasContext.cssToDeviceRatio();\n const pickableLayers = this._getPickable(layers);\n if (!pickableLayers || viewports.length === 0) {\n return {\n result: [],\n emptyInfo: getEmptyPickingInfo({ viewports, x, y, pixelRatio })\n };\n }\n this._resizeBuffer();\n // Convert from canvas top-left to WebGL bottom-left coordinates\n // Top-left coordinates [x, y] to bottom-left coordinates [deviceX, deviceY]\n // And compensate for pixelRatio\n // @ts-expect-error TODO - assuming WebGL context\n const devicePixelRange = this.device.canvasContext.cssToDevicePixels([x, y], true);\n const devicePixel = [\n devicePixelRange.x + Math.floor(devicePixelRange.width / 2),\n devicePixelRange.y + Math.floor(devicePixelRange.height / 2)\n ];\n const deviceRadius = Math.round(radius * pixelRatio);\n const { width, height } = this.pickingFBO;\n const deviceRect = this._getPickingRect({\n deviceX: devicePixel[0],\n deviceY: devicePixel[1],\n deviceRadius,\n deviceWidth: width,\n deviceHeight: height\n });\n const cullRect = {\n x: x - radius,\n y: y - radius,\n width: radius * 2 + 1,\n height: radius * 2 + 1\n };\n let infos;\n const result = [];\n const affectedLayers = new Set();\n for (let i = 0; i < depth; i++) {\n let pickInfo;\n if (deviceRect) {\n const pickedResult = this._drawAndSample({\n layers: pickableLayers,\n views,\n viewports,\n onViewportActive,\n deviceRect,\n cullRect,\n effects,\n pass: `picking:${mode}`\n });\n pickInfo = getClosestObject({\n ...pickedResult,\n deviceX: devicePixel[0],\n deviceY: devicePixel[1],\n deviceRadius,\n deviceRect\n });\n }\n else {\n pickInfo = {\n pickedColor: null,\n pickedObjectIndex: -1\n };\n }\n let z;\n if (pickInfo.pickedLayer && unproject3D && this.depthFBO) {\n const { pickedColors: pickedColors2 } = this._drawAndSample({\n layers: [pickInfo.pickedLayer],\n views,\n viewports,\n onViewportActive,\n deviceRect: {\n x: pickInfo.pickedX,\n y: pickInfo.pickedY,\n width: 1,\n height: 1\n },\n cullRect,\n effects,\n pass: `picking:${mode}:z`\n }, true);\n // picked value is in common space (pixels) from the camera target (viewport.position)\n // convert it to meters from the ground\n if (pickedColors2[3]) {\n z = pickedColors2[0];\n }\n }\n // Only exclude if we need to run picking again.\n // We need to run picking again if an object is detected AND\n // we have not exhausted the requested depth.\n if (pickInfo.pickedLayer && i + 1 < depth) {\n affectedLayers.add(pickInfo.pickedLayer);\n pickInfo.pickedLayer.disablePickingIndex(pickInfo.pickedObjectIndex);\n }\n // This logic needs to run even if no object is picked.\n infos = processPickInfo({\n pickInfo,\n lastPickedInfo: this.lastPickedInfo,\n mode,\n layers: pickableLayers,\n viewports,\n x,\n y,\n z,\n pixelRatio\n });\n for (const info of infos.values()) {\n if (info.layer) {\n result.push(info);\n }\n }\n // If no object is picked stop.\n if (!pickInfo.pickedColor) {\n break;\n }\n }\n // reset only affected buffers\n for (const layer of affectedLayers) {\n layer.restorePickingColors();\n }\n return { result, emptyInfo: infos.get(null) };\n }\n /**\n * Pick all objects within the given bounding box\n */\n // eslint-disable-next-line max-statements\n async _pickVisibleObjectsAsync({ layers, views, viewports, x, y, width = 1, height = 1, mode = 'query', maxObjects = null, onViewportActive, effects }) {\n const pickableLayers = this._getPickable(layers);\n if (!pickableLayers || viewports.length === 0) {\n return [];\n }\n this._resizeBuffer();\n // Convert from canvas top-left to WebGL bottom-left coordinates\n // And compensate for pixelRatio\n // @ts-expect-error TODO - assuming WebGL context\n const pixelRatio = this.device.canvasContext.cssToDeviceRatio();\n // @ts-expect-error TODO - assuming WebGL context\n const leftTop = this.device.canvasContext.cssToDevicePixels([x, y], true);\n // take left and top (y inverted in device pixels) from start location\n const deviceLeft = leftTop.x;\n const deviceTop = leftTop.y + leftTop.height;\n // take right and bottom (y inverted in device pixels) from end location\n // @ts-expect-error TODO - assuming WebGL context\n const rightBottom = this.device.canvasContext.cssToDevicePixels([x + width, y + height], true);\n const deviceRight = rightBottom.x + rightBottom.width;\n const deviceBottom = rightBottom.y;\n const deviceRect = {\n x: deviceLeft,\n y: deviceBottom,\n // deviceTop and deviceRight represent the first pixel outside the desired rect\n width: deviceRight - deviceLeft,\n height: deviceTop - deviceBottom\n };\n const pickedResult = this._drawAndSample({\n layers: pickableLayers,\n views,\n viewports,\n onViewportActive,\n deviceRect,\n cullRect: { x, y, width, height },\n effects,\n pass: `picking:${mode}`\n });\n const pickInfos = getUniqueObjects(pickedResult);\n // `getUniqueObjects` dedup by picked color\n // However different picked color may be linked to the same picked object, e.g. stroke and fill of the same polygon\n // picked from different sub layers of a GeoJsonLayer\n // Here after resolving the picked index with `layer.getPickingInfo`, we need to dedup again by unique picked objects\n const uniquePickedObjects = new Map();\n const uniqueInfos = [];\n const limitMaxObjects = Number.isFinite(maxObjects);\n for (let i = 0; i < pickInfos.length; i++) {\n if (limitMaxObjects && uniqueInfos.length >= maxObjects) {\n break;\n }\n const pickInfo = pickInfos[i];\n let info = {\n color: pickInfo.pickedColor,\n layer: null,\n index: pickInfo.pickedObjectIndex,\n picked: true,\n x,\n y,\n pixelRatio\n };\n info = getLayerPickingInfo({ layer: pickInfo.pickedLayer, info, mode });\n // info.layer is always populated because it's a picked pixel\n const pickedLayerId = info.layer.id;\n if (!uniquePickedObjects.has(pickedLayerId)) {\n uniquePickedObjects.set(pickedLayerId, new Set());\n }\n const uniqueObjectsInLayer = uniquePickedObjects.get(pickedLayerId);\n // info.object may be null if the layer is using non-iterable data.\n // Fall back to using index as identifier.\n const pickedObjectKey = info.object ?? info.index;\n if (!uniqueObjectsInLayer.has(pickedObjectKey)) {\n uniqueObjectsInLayer.add(pickedObjectKey);\n uniqueInfos.push(info);\n }\n }\n return uniqueInfos;\n }\n /**\n * Pick all objects within the given bounding box\n * @deprecated WebGL only\n */\n // eslint-disable-next-line max-statements\n _pickVisibleObjects({ layers, views, viewports, x, y, width = 1, height = 1, mode = 'query', maxObjects = null, onViewportActive, effects }) {\n const pickableLayers = this._getPickable(layers);\n if (!pickableLayers || viewports.length === 0) {\n return [];\n }\n this._resizeBuffer();\n // Convert from canvas top-left to WebGL bottom-left coordinates\n // And compensate for pixelRatio\n // @ts-expect-error TODO - assuming WebGL context\n const pixelRatio = this.device.canvasContext.cssToDeviceRatio();\n // @ts-expect-error TODO - assuming WebGL context\n const leftTop = this.device.canvasContext.cssToDevicePixels([x, y], true);\n // take left and top (y inverted in device pixels) from start location\n const deviceLeft = leftTop.x;\n const deviceTop = leftTop.y + leftTop.height;\n // take right and bottom (y inverted in device pixels) from end location\n // @ts-expect-error TODO - assuming WebGL context\n const rightBottom = this.device.canvasContext.cssToDevicePixels([x + width, y + height], true);\n const deviceRight = rightBottom.x + rightBottom.width;\n const deviceBottom = rightBottom.y;\n const deviceRect = {\n x: deviceLeft,\n y: deviceBottom,\n // deviceTop and deviceRight represent the first pixel outside the desired rect\n width: deviceRight - deviceLeft,\n height: deviceTop - deviceBottom\n };\n const pickedResult = this._drawAndSample({\n layers: pickableLayers,\n views,\n viewports,\n onViewportActive,\n deviceRect,\n cullRect: { x, y, width, height },\n effects,\n pass: `picking:${mode}`\n });\n const pickInfos = getUniqueObjects(pickedResult);\n // `getUniqueObjects` dedup by picked color\n // However different picked color may be linked to the same picked object, e.g. stroke and fill of the same polygon\n // picked from different sub layers of a GeoJsonLayer\n // Here after resolving the picked index with `layer.getPickingInfo`, we need to dedup again by unique picked objects\n const uniquePickedObjects = new Map();\n const uniqueInfos = [];\n const limitMaxObjects = Number.isFinite(maxObjects);\n for (let i = 0; i < pickInfos.length; i++) {\n if (limitMaxObjects && uniqueInfos.length >= maxObjects) {\n break;\n }\n const pickInfo = pickInfos[i];\n let info = {\n color: pickInfo.pickedColor,\n layer: null,\n index: pickInfo.pickedObjectIndex,\n picked: true,\n x,\n y,\n pixelRatio\n };\n info = getLayerPickingInfo({ layer: pickInfo.pickedLayer, info, mode });\n // info.layer is always populated because it's a picked pixel\n const pickedLayerId = info.layer.id;\n if (!uniquePickedObjects.has(pickedLayerId)) {\n uniquePickedObjects.set(pickedLayerId, new Set());\n }\n const uniqueObjectsInLayer = uniquePickedObjects.get(pickedLayerId);\n // info.object may be null if the layer is using non-iterable data.\n // Fall back to using index as identifier.\n const pickedObjectKey = info.object ?? info.index;\n if (!uniqueObjectsInLayer.has(pickedObjectKey)) {\n uniqueObjectsInLayer.add(pickedObjectKey);\n uniqueInfos.push(info);\n }\n }\n return uniqueInfos;\n }\n // Note: Implementation of the overloaded signatures above, TSDoc is on the signatures\n async _drawAndSampleAsync({ layers, views, viewports, onViewportActive, deviceRect, cullRect, effects, pass }, pickZ = false) {\n const pickingFBO = pickZ ? this.depthFBO : this.pickingFBO;\n const opts = {\n layers,\n layerFilter: this.layerFilter,\n views,\n viewports,\n onViewportActive,\n pickingFBO,\n deviceRect,\n cullRect,\n effects,\n pass,\n pickZ,\n preRenderStats: {},\n isPicking: true\n };\n for (const effect of effects) {\n if (effect.useInPicking) {\n opts.preRenderStats[effect.id] = effect.preRender(opts);\n }\n }\n const { decodePickingColor } = this.pickLayersPass.render(opts);\n // Read from an already rendered picking buffer\n // Returns an Uint8ClampedArray of picked pixels\n const { x, y, width, height } = deviceRect;\n const pickedColors = new (pickZ ? Float32Array : Uint8Array)(width * height * 4);\n this.device.readPixelsToArrayWebGL(pickingFBO, {\n sourceX: x,\n sourceY: y,\n sourceWidth: width,\n sourceHeight: height,\n target: pickedColors\n });\n return { pickedColors, decodePickingColor };\n }\n // Note: Implementation of the overloaded signatures above, TSDoc is on the signatures\n _drawAndSample({ layers, views, viewports, onViewportActive, deviceRect, cullRect, effects, pass }, pickZ = false) {\n const pickingFBO = pickZ ? this.depthFBO : this.pickingFBO;\n const opts = {\n layers,\n layerFilter: this.layerFilter,\n views,\n viewports,\n onViewportActive,\n pickingFBO,\n deviceRect,\n cullRect,\n effects,\n pass,\n pickZ,\n preRenderStats: {},\n isPicking: true\n };\n for (const effect of effects) {\n if (effect.useInPicking) {\n opts.preRenderStats[effect.id] = effect.preRender(opts);\n }\n }\n const { decodePickingColor } = this.pickLayersPass.render(opts);\n // Read from an already rendered picking buffer\n // Returns an Uint8ClampedArray of picked pixels\n const { x, y, width, height } = deviceRect;\n const pickedColors = new (pickZ ? Float32Array : Uint8Array)(width * height * 4);\n this.device.readPixelsToArrayWebGL(pickingFBO, {\n sourceX: x,\n sourceY: y,\n sourceWidth: width,\n sourceHeight: height,\n target: pickedColors\n });\n return { pickedColors, decodePickingColor };\n }\n /**\n * Calculate a picking rect centered on deviceX and deviceY and clipped to device\n * @returns null if pixel is outside of device\n */\n _getPickingRect({ deviceX, deviceY, deviceRadius, deviceWidth, deviceHeight }) {\n // Create a box of size `radius * 2 + 1` centered at [deviceX, deviceY]\n const x = Math.max(0, deviceX - deviceRadius);\n const y = Math.max(0, deviceY - deviceRadius);\n const width = Math.min(deviceWidth, deviceX + deviceRadius + 1) - x;\n const height = Math.min(deviceHeight, deviceY + deviceRadius + 1) - y;\n // x, y out of bounds.\n if (width <= 0 || height <= 0) {\n return null;\n }\n return { x, y, width, height };\n }\n}\n//# sourceMappingURL=deck-picker.js.map","// deck.gl\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\nimport { EVENT_HANDLERS } from \"./constants.js\";\nimport { deepEqual } from \"../utils/deep-equal.js\";\nconst PLACEMENTS = {\n 'top-left': { top: 0, left: 0 },\n 'top-right': { top: 0, right: 0 },\n 'bottom-left': { bottom: 0, left: 0 },\n 'bottom-right': { bottom: 0, right: 0 },\n fill: { top: 0, left: 0, bottom: 0, right: 0 }\n};\nconst DEFAULT_PLACEMENT = 'top-left';\nconst ROOT_CONTAINER_ID = '__root';\nexport class WidgetManager {\n constructor({ deck, parentElement }) {\n /** Widgets added via the imperative API */\n this.defaultWidgets = [];\n /** Widgets received from the declarative API */\n this.widgets = [];\n /** Resolved widgets from both imperative and declarative APIs */\n this.resolvedWidgets = [];\n /** Mounted HTML containers */\n this.containers = {};\n /** Viewport provided to widget on redraw */\n this.lastViewports = {};\n this.deck = deck;\n parentElement?.classList.add('deck-widget-container');\n this.parentElement = parentElement;\n }\n getWidgets() {\n return this.resolvedWidgets;\n }\n /** Declarative API to configure widgets */\n setProps(props) {\n if (props.widgets && !deepEqual(props.widgets, this.widgets, 1)) {\n // Allow application to supply null widgets\n const nextWidgets = props.widgets.filter(Boolean);\n this._setWidgets(nextWidgets);\n }\n }\n finalize() {\n for (const widget of this.getWidgets()) {\n this._removeWidget(widget);\n }\n this.defaultWidgets.length = 0;\n this.resolvedWidgets.length = 0;\n for (const id in this.containers) {\n this.containers[id].remove();\n }\n }\n /** Imperative API. Widgets added this way are not affected by the declarative prop. */\n addDefault(widget) {\n if (!this.defaultWidgets.find(w => w.id === widget.id)) {\n this._addWidget(widget);\n this.defaultWidgets.push(widget);\n // Update widget list\n this._setWidgets(this.widgets);\n }\n }\n onRedraw({ viewports, layers }) {\n const viewportsById = viewports.reduce((acc, v) => {\n acc[v.id] = v;\n return acc;\n }, {});\n for (const widget of this.getWidgets()) {\n const { viewId } = widget;\n if (viewId) {\n // Attached to a specific view\n const viewport = viewportsById[viewId];\n if (viewport) {\n if (widget.onViewportChange) {\n widget.onViewportChange(viewport);\n }\n widget.onRedraw?.({ viewports: [viewport], layers });\n }\n }\n else {\n // Not attached to a specific view\n if (widget.onViewportChange) {\n for (const viewport of viewports) {\n widget.onViewportChange(viewport);\n }\n }\n widget.onRedraw?.({ viewports, layers });\n }\n }\n this.lastViewports = viewportsById;\n this._updateContainers();\n }\n onHover(info, event) {\n for (const widget of this.getWidgets()) {\n const { viewId } = widget;\n if (!viewId || viewId === info.viewport?.id) {\n widget.onHover?.(info, event);\n }\n }\n }\n onEvent(info, event) {\n const eventHandlerProp = EVENT_HANDLERS[event.type];\n if (!eventHandlerProp) {\n return;\n }\n for (const widget of this.getWidgets()) {\n const { viewId } = widget;\n if (!viewId || viewId === info.viewport?.id) {\n widget[eventHandlerProp]?.(info, event);\n }\n }\n }\n // INTERNAL METHODS\n /**\n * Resolve widgets from the declarative prop\n * Initialize new widgets and remove old ones\n * Update props of existing widgets\n */\n _setWidgets(nextWidgets) {\n const oldWidgetMap = {};\n for (const widget of this.resolvedWidgets) {\n oldWidgetMap[widget.id] = widget;\n }\n // Clear and rebuild the list\n this.resolvedWidgets.length = 0;\n // Add all default widgets\n for (const widget of this.defaultWidgets) {\n oldWidgetMap[widget.id] = null;\n this.resolvedWidgets.push(widget);\n }\n for (let widget of nextWidgets) {\n const oldWidget = oldWidgetMap[widget.id];\n if (!oldWidget) {\n // Widget is new\n this._addWidget(widget);\n }\n else if (\n // Widget placement changed\n oldWidget.viewId !== widget.viewId ||\n oldWidget.placement !== widget.placement) {\n this._removeWidget(oldWidget);\n this._addWidget(widget);\n }\n else if (widget !== oldWidget) {\n // Widget props changed\n oldWidget.setProps(widget.props);\n widget = oldWidget;\n }\n // mark as matched\n oldWidgetMap[widget.id] = null;\n this.resolvedWidgets.push(widget);\n }\n for (const id in oldWidgetMap) {\n const oldWidget = oldWidgetMap[id];\n if (oldWidget) {\n // No longer exists\n this._removeWidget(oldWidget);\n }\n }\n this.widgets = nextWidgets;\n }\n /** Initialize new widget */\n _addWidget(widget) {\n const { viewId = null, placement = DEFAULT_PLACEMENT } = widget;\n widget.widgetManager = this;\n widget.deck = this.deck;\n // Create an attach the HTML root element\n widget.rootElement = widget._onAdd({ deck: this.deck, viewId });\n if (widget.rootElement) {\n this._getContainer(viewId, placement).append(widget.rootElement);\n }\n widget.updateHTML();\n }\n /** Destroy an old widget */\n _removeWidget(widget) {\n widget.onRemove?.();\n if (widget.rootElement) {\n widget.rootElement.remove();\n }\n widget.rootElement = undefined;\n widget.deck = undefined;\n widget.widgetManager = undefined;\n }\n /** Get a container element based on view and placement */\n _getContainer(viewId, placement) {\n const containerId = viewId || ROOT_CONTAINER_ID;\n let viewContainer = this.containers[containerId];\n if (!viewContainer) {\n viewContainer = document.createElement('div');\n viewContainer.style.pointerEvents = 'none';\n viewContainer.style.position = 'absolute';\n viewContainer.style.overflow = 'hidden';\n this.parentElement?.append(viewContainer);\n this.containers[containerId] = viewContainer;\n }\n let container = viewContainer.querySelector(`.${placement}`);\n if (!container) {\n container = globalThis.document.createElement('div');\n container.className = placement;\n container.style.position = 'absolute';\n container.style.zIndex = '2';\n Object.assign(container.style, PLACEMENTS[placement]);\n viewContainer.append(container);\n }\n return container;\n }\n _updateContainers() {\n const canvasWidth = this.deck.width;\n const canvasHeight = this.deck.height;\n for (const id in this.containers) {\n const viewport = this.lastViewports[id] || null;\n const visible = id === ROOT_CONTAINER_ID || viewport;\n const container = this.containers[id];\n if (visible) {\n container.style.display = 'block';\n // Align the container with the view\n container.style.left = `${viewport ? viewport.x : 0}px`;\n container.style.top = `${viewport ? viewport.y : 0}px`;\n container.style.width = `${viewport ? viewport.width : canvasWidth}px`;\n container.style.height = `${viewport ? viewport.height : canvasHeight}px`;\n }\n else {\n container.style.display = 'none';\n }\n }\n }\n}\n//# sourceMappingURL=widget-manager.js.map","// deck.gl\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\nimport { Widget } from \"./widget.js\";\n/* global document */\nconst defaultStyle = {\n zIndex: '1',\n position: 'absolute',\n pointerEvents: 'none',\n color: '#a0a7b4',\n backgroundColor: '#29323c',\n padding: '10px',\n top: '0',\n left: '0',\n display: 'none'\n};\nexport class TooltipWidget extends Widget {\n constructor(props = {}) {\n super(props);\n this.id = 'default-tooltip';\n this.placement = 'fill';\n this.className = 'deck-tooltip';\n this.isVisible = false;\n this.setProps(props);\n }\n // TODO(ib) - does this really need to be overridden?\n onCreateRootElement() {\n const el = document.createElement('div');\n el.className = this.className;\n Object.assign(el.style, defaultStyle);\n return el;\n }\n onRenderHTML(rootElement) { }\n onViewportChange(viewport) {\n if (this.isVisible && viewport.id === this.lastViewport?.id && viewport !== this.lastViewport) {\n // Camera has moved, clear tooltip\n this.setTooltip(null);\n }\n }\n onHover(info) {\n const { deck } = this;\n const getTooltip = deck && deck.props.getTooltip;\n if (!getTooltip) {\n return;\n }\n const displayInfo = getTooltip(info);\n this.lastViewport = info.viewport;\n this.setTooltip(displayInfo, info.x, info.y);\n }\n setTooltip(displayInfo, x, y) {\n const el = this.rootElement;\n if (!el) {\n return;\n }\n if (typeof displayInfo === 'string') {\n el.innerText = displayInfo;\n }\n else if (!displayInfo) {\n this.isVisible = false;\n el.style.display = 'none';\n return;\n }\n else {\n if (displayInfo.text) {\n el.innerText = displayInfo.text;\n }\n if (displayInfo.html) {\n el.innerHTML = displayInfo.html;\n }\n if (displayInfo.className) {\n el.className = displayInfo.className;\n }\n }\n this.isVisible = true;\n el.style.display = 'block';\n el.style.transform = `translate(${x}px, ${y}px)`;\n if (displayInfo && typeof displayInfo === 'object' && 'style' in displayInfo) {\n Object.assign(el.style, displayInfo.style);\n }\n }\n}\nTooltipWidget.defaultProps = {\n ...Widget.defaultProps\n};\n//# sourceMappingURL=tooltip-widget.js.map","// luma.gl\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\n// Goal is to make WebGL2 contexts look like WebGL1\n// @note Partly inspired by with some older code from the `regl` library\n/* eslint-disable camelcase */\nimport { GL } from '@luma.gl/constants';\n// webgl1 extensions natively supported by webgl2\nconst WEBGL1_STATIC_EXTENSIONS = {\n WEBGL_depth_texture: {\n UNSIGNED_INT_24_8_WEBGL: 34042\n },\n OES_element_index_uint: {},\n OES_texture_float: {},\n OES_texture_half_float: {\n // @ts-expect-error different numbers?\n HALF_FLOAT_OES: 5131\n },\n EXT_color_buffer_float: {},\n OES_standard_derivatives: {\n FRAGMENT_SHADER_DERIVATIVE_HINT_OES: 35723\n },\n EXT_frag_depth: {},\n EXT_blend_minmax: {\n MIN_EXT: 32775,\n MAX_EXT: 32776\n },\n EXT_shader_texture_lod: {}\n};\nconst getWEBGL_draw_buffers = (gl) => ({\n drawBuffersWEBGL(buffers) {\n return gl.drawBuffers(buffers);\n },\n COLOR_ATTACHMENT0_WEBGL: 36064,\n COLOR_ATTACHMENT1_WEBGL: 36065,\n COLOR_ATTACHMENT2_WEBGL: 36066,\n COLOR_ATTACHMENT3_WEBGL: 36067\n}); // - too many fields\nconst getOES_vertex_array_object = (gl) => ({\n VERTEX_ARRAY_BINDING_OES: 34229,\n createVertexArrayOES() {\n return gl.createVertexArray();\n },\n deleteVertexArrayOES(vertexArray) {\n return gl.deleteVertexArray(vertexArray);\n },\n isVertexArrayOES(vertexArray) {\n return gl.isVertexArray(vertexArray);\n },\n bindVertexArrayOES(vertexArray) {\n return gl.bindVertexArray(vertexArray);\n }\n});\nconst getANGLE_instanced_arrays = (gl) => ({\n VERTEX_ATTRIB_ARRAY_DIVISOR_ANGLE: 0x88fe,\n drawArraysInstancedANGLE(...args) {\n return gl.drawArraysInstanced(...args);\n },\n drawElementsInstancedANGLE(...args) {\n return gl.drawElementsInstanced(...args);\n },\n vertexAttribDivisorANGLE(...args) {\n return gl.vertexAttribDivisor(...args);\n }\n});\n/**\n * Make browser return WebGL2 contexts even if WebGL1 contexts are requested\n * @param enforce\n * @returns\n */\nexport function enforceWebGL2(enforce = true) {\n const prototype = HTMLCanvasElement.prototype;\n if (!enforce && prototype.originalGetContext) {\n // Reset the original getContext function\n prototype.getContext = prototype.originalGetContext;\n prototype.originalGetContext = undefined;\n return;\n }\n // Store the original getContext function\n prototype.originalGetContext = prototype.getContext;\n // Override the getContext function\n prototype.getContext = function (contextId, options) {\n // Attempt to force WebGL2 for all WebGL1 contexts\n if (contextId === 'webgl' || contextId === 'experimental-webgl') {\n const context = this.originalGetContext('webgl2', options);\n // Work around test mocking\n if (context instanceof HTMLElement) {\n polyfillWebGL1Extensions(context);\n }\n return context;\n }\n // For any other type, return the original context\n return this.originalGetContext(contextId, options);\n };\n}\n/** Install WebGL1-only extensions on WebGL2 contexts */\nexport function polyfillWebGL1Extensions(gl) {\n // Enable, to support float and half-float textures\n gl.getExtension('EXT_color_buffer_float');\n // WebGL1 extensions implemented using WebGL2 APIs\n const boundExtensions = {\n ...WEBGL1_STATIC_EXTENSIONS,\n WEBGL_disjoint_timer_query: gl.getExtension('EXT_disjoint_timer_query_webgl2'),\n WEBGL_draw_buffers: getWEBGL_draw_buffers(gl),\n OES_vertex_array_object: getOES_vertex_array_object(gl),\n ANGLE_instanced_arrays: getANGLE_instanced_arrays(gl)\n };\n // Override gl.getExtension\n // eslint-disable-next-line @typescript-eslint/unbound-method\n const originalGetExtension = gl.getExtension;\n gl.getExtension = function (extensionName) {\n const ext = originalGetExtension.call(gl, extensionName);\n if (ext) {\n return ext;\n }\n // Injected extensions\n if (extensionName in boundExtensions) {\n // @ts-ignore TODO string index\n return boundExtensions[extensionName];\n }\n return null;\n };\n // Override gl.getSupportedExtensions\n // eslint-disable-next-line @typescript-eslint/unbound-method\n const originalGetSupportedExtensions = gl.getSupportedExtensions;\n gl.getSupportedExtensions = function () {\n const extensions = originalGetSupportedExtensions.apply(gl) || [];\n return extensions?.concat(Object.keys(boundExtensions));\n };\n}\n// Update unsized WebGL1 formats to sized WebGL2 formats\n// todo move to texture format file\n// export function getInternalFormat(gl: WebGL2RenderingContext, format: GL, type: GL): GL {\n// // webgl2 texture formats\n// // https://webgl2fundamentals.org/webgl/lessons/webgl-data-textures.html\n// switch (format) {\n// case GL.DEPTH_COMPONENT:\n// return GL.DEPTH_COMPONENT24;\n// case GL.DEPTH_STENCIL:\n// return GL.DEPTH24_STENCIL8;\n// case GL.RGBA:\n// return type === GL.HALF_FLOAT ? GL.RGBA16F : GL.RGBA32F;\n// case GL.RGB:\n// return type === GL.HALF_FLOAT ? GL.RGB16F : GL.RGB32F;\n// default:\n// return format;\n// }\n// }\n/*\n// texture type to update on the fly\nexport function getTextureType(gl: WebGL2RenderingContext, type: GL): GL {\n if (type === HALF_FLOAT_OES) {\n return GL.HALF_FLOAT;\n }\n return type;\n}\n\n // And texImage2D to convert the internalFormat to webgl2.\n const webgl2 = this;\n const origTexImage = gl.texImage2D;\n gl.texImage2D = function (target, miplevel, iformat, a, typeFor6, c, d, typeFor9, f) {\n if (arguments.length == 6) {\n var ifmt = webgl2.getInternalFormat(gl, iformat, typeFor6);\n origTexImage.apply(gl, [target, miplevel, ifmt, a, webgl.getTextureType(gl, typeFor6), c]);\n } else {\n // arguments.length == 9\n var ifmt = webgl2.getInternalFormat(gl, iformat, typeFor9);\n origTexImage.apply(gl, [\n target,\n miplevel,\n ifmt,\n a,\n typeFor6,\n c,\n d,\n webgl2.getTextureType(gl, typeFor9),\n f\n ]);\n }\n };\n};\n*/\n//# sourceMappingURL=polyfill-webgl1-extensions.js.map","// luma.gl\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\nimport { Adapter, Device, log } from '@luma.gl/core';\nimport { enforceWebGL2 } from \"../context/polyfills/polyfill-webgl1-extensions.js\";\nimport { loadSpectorJS, DEFAULT_SPECTOR_PROPS } from \"../context/debug/spector.js\";\nimport { loadWebGLDeveloperTools } from \"../context/debug/webgl-developer-tools.js\";\nconst LOG_LEVEL = 1;\nexport class WebGLAdapter extends Adapter {\n /** type of device's created by this adapter */\n type = 'webgl';\n constructor() {\n super();\n // Add spector default props to device default props, so that runtime settings are observed\n Device.defaultProps = { ...Device.defaultProps, ...DEFAULT_SPECTOR_PROPS };\n }\n /** Force any created WebGL contexts to be WebGL2 contexts, polyfilled with WebGL1 extensions */\n enforceWebGL2(enable) {\n enforceWebGL2(enable);\n }\n /** Check if WebGL 2 is available */\n isSupported() {\n return typeof WebGL2RenderingContext !== 'undefined';\n }\n isDeviceHandle(handle) {\n // WebGL\n if (typeof WebGL2RenderingContext !== 'undefined' && handle instanceof WebGL2RenderingContext) {\n return true;\n }\n if (typeof WebGLRenderingContext !== 'undefined' && handle instanceof WebGLRenderingContext) {\n log.warn('WebGL1 is not supported', handle)();\n }\n return false;\n }\n /**\n * Get a device instance from a GL context\n * Creates a WebGLCanvasContext against the contexts canvas\n * @note autoResize will be disabled, assuming that whoever created the external context will be handling resizes.\n * @param gl\n * @returns\n */\n async attach(gl, props = {}) {\n const { WebGLDevice } = await import(\"./webgl-device.js\");\n if (gl instanceof WebGLDevice) {\n return gl;\n }\n // @ts-expect-error\n if (gl?.device instanceof WebGLDevice) {\n // @ts-expect-error\n return gl.device;\n }\n if (!isWebGL(gl)) {\n throw new Error('Invalid WebGL2RenderingContext');\n }\n const createCanvasContext = props.createCanvasContext === true ? {} : props.createCanvasContext;\n // We create a new device using the provided WebGL context and its canvas\n // Assume that whoever created the external context will be handling resizes.\n return new WebGLDevice({\n ...props,\n _handle: gl,\n createCanvasContext: { canvas: gl.canvas, autoResize: false, ...createCanvasContext }\n });\n }\n async create(props = {}) {\n const { WebGLDevice } = await import(\"./webgl-device.js\");\n log.groupCollapsed(LOG_LEVEL, 'WebGLDevice created')();\n try {\n const promises = [];\n // Load webgl and spector debug scripts from CDN if requested\n if (props.debugWebGL || props.debug) {\n promises.push(loadWebGLDeveloperTools());\n }\n if (props.debugSpectorJS) {\n promises.push(loadSpectorJS(props));\n }\n // Wait for all the loads to settle before creating the context.\n // The Device.create() functions are async, so in contrast to the constructor, we can `await` here.\n const results = await Promise.allSettled(promises);\n for (const result of results) {\n if (result.status === 'rejected') {\n log.error(`Failed to initialize debug libraries ${result.reason}`)();\n }\n }\n const device = new WebGLDevice(props);\n // Log some debug info about the newly created context\n const message = `\\\n${device._reused ? 'Reusing' : 'Created'} device with WebGL2 ${device.props.debug ? 'debug ' : ''}context: \\\n${device.info.vendor}, ${device.info.renderer} for canvas: ${device.canvasContext.id}`;\n log.probe(LOG_LEVEL, message)();\n log.table(LOG_LEVEL, device.info)();\n return device;\n }\n finally {\n log.groupEnd(LOG_LEVEL)();\n }\n }\n}\n/** Check if supplied parameter is a WebGL2RenderingContext */\nfunction isWebGL(gl) {\n if (typeof WebGL2RenderingContext !== 'undefined' && gl instanceof WebGL2RenderingContext) {\n return true;\n }\n // Look for debug contexts, headless gl etc\n return Boolean(gl && Number.isFinite(gl._version));\n}\nexport const webgl2Adapter = new WebGLAdapter();\n//# sourceMappingURL=webgl-adapter.js.map","// deck.gl\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\nimport LayerManager from \"./layer-manager.js\";\nimport ViewManager from \"./view-manager.js\";\nimport MapView from \"../views/map-view.js\";\nimport EffectManager from \"./effect-manager.js\";\nimport DeckRenderer from \"./deck-renderer.js\";\nimport DeckPicker from \"./deck-picker.js\";\nimport { WidgetManager } from \"./widget-manager.js\";\nimport { TooltipWidget } from \"./tooltip-widget.js\";\nimport log from \"../utils/log.js\";\nimport { deepEqual } from \"../utils/deep-equal.js\";\nimport typedArrayManager from \"../utils/typed-array-manager.js\";\nimport { VERSION } from \"./init.js\";\nimport { luma } from '@luma.gl/core';\nimport { webgl2Adapter } from '@luma.gl/webgl';\nimport { Timeline } from '@luma.gl/engine';\nimport { AnimationLoop } from '@luma.gl/engine';\nimport { GL } from '@luma.gl/constants';\nimport { Stats } from '@probe.gl/stats';\nimport { EventManager } from 'mjolnir.js';\nimport assert from \"../utils/assert.js\";\nimport { EVENT_HANDLERS, RECOGNIZERS } from \"./constants.js\";\n/* global document */\n// eslint-disable-next-line @typescript-eslint/no-empty-function\nfunction noop() { }\nconst getCursor = ({ isDragging }) => (isDragging ? 'grabbing' : 'grab');\nconst defaultProps = {\n id: '',\n width: '100%',\n height: '100%',\n style: null,\n viewState: null,\n initialViewState: null,\n pickingRadius: 0,\n layerFilter: null,\n parameters: {},\n parent: null,\n device: null,\n deviceProps: {},\n gl: null,\n canvas: null,\n layers: [],\n effects: [],\n views: null,\n controller: null, // Rely on external controller, e.g. react-map-gl\n useDevicePixels: true,\n touchAction: 'none',\n eventRecognizerOptions: {},\n _framebuffer: null,\n _animate: false,\n _pickable: true,\n _typedArrayManagerProps: {},\n _customRender: null,\n widgets: [],\n onDeviceInitialized: noop,\n onWebGLInitialized: noop,\n onResize: noop,\n onViewStateChange: noop,\n onInteractionStateChange: noop,\n onBeforeRender: noop,\n onAfterRender: noop,\n onLoad: noop,\n onError: (error) => log.error(error.message, error.cause)(),\n onHover: null,\n onClick: null,\n onDragStart: null,\n onDrag: null,\n onDragEnd: null,\n _onMetrics: null,\n getCursor,\n getTooltip: null,\n debug: false,\n drawPickingColors: false\n};\n/* eslint-disable max-statements */\nclass Deck {\n constructor(props) {\n this.width = 0;\n this.height = 0;\n // Allows attaching arbitrary data to the instance\n this.userData = {};\n this.device = null;\n this.canvas = null;\n this.viewManager = null;\n this.layerManager = null;\n this.effectManager = null;\n this.deckRenderer = null;\n this.deckPicker = null;\n this.eventManager = null;\n this.widgetManager = null;\n this.tooltip = null;\n this.animationLoop = null;\n this.cursorState = {\n isHovering: false,\n isDragging: false\n };\n this.stats = new Stats({ id: 'deck.gl' });\n this.metrics = {\n fps: 0,\n setPropsTime: 0,\n updateAttributesTime: 0,\n framesRedrawn: 0,\n pickTime: 0,\n pickCount: 0,\n gpuTime: 0,\n gpuTimePerFrame: 0,\n cpuTime: 0,\n cpuTimePerFrame: 0,\n bufferMemory: 0,\n textureMemory: 0,\n renderbufferMemory: 0,\n gpuMemory: 0\n };\n this._metricsCounter = 0;\n this._needsRedraw = 'Initial render';\n this._pickRequest = {\n mode: 'hover',\n x: -1,\n y: -1,\n radius: 0,\n event: null\n };\n /**\n * Pick and store the object under the pointer on `pointerdown`.\n * This object is reused for subsequent `onClick` and `onDrag*` callbacks.\n */\n this._lastPointerDownInfo = null;\n // The `pointermove` event may fire multiple times in between two animation frames,\n // it's a waste of time to run picking without rerender. Instead we save the last pick\n // request and only do it once on the next animation frame.\n /** Internal use only: event handler for pointerdown */\n this._onPointerMove = (event) => {\n const { _pickRequest } = this;\n if (event.type === 'pointerleave') {\n _pickRequest.x = -1;\n _pickRequest.y = -1;\n _pickRequest.radius = 0;\n }\n else if (event.leftButton || event.rightButton) {\n // Do not trigger onHover callbacks if mouse button is down.\n return;\n }\n else {\n const pos = event.offsetCenter;\n // Do not trigger callbacks when click/hover position is invalid. Doing so will cause a\n // assertion error when attempting to unproject the position.\n if (!pos) {\n return;\n }\n _pickRequest.x = pos.x;\n _pickRequest.y = pos.y;\n _pickRequest.radius = this.props.pickingRadius;\n }\n if (this.layerManager) {\n this.layerManager.context.mousePosition = { x: _pickRequest.x, y: _pickRequest.y };\n }\n _pickRequest.event = event;\n };\n /** Internal use only: event handler for click & drag */\n this._onEvent = (event) => {\n const eventHandlerProp = EVENT_HANDLERS[event.type];\n const pos = event.offsetCenter;\n if (!eventHandlerProp || !pos || !this.layerManager) {\n return;\n }\n // Reuse last picked object\n const layers = this.layerManager.getLayers();\n const info = this.deckPicker.getLastPickedObject({\n x: pos.x,\n y: pos.y,\n layers,\n viewports: this.getViewports(pos)\n }, this._lastPointerDownInfo);\n const { layer } = info;\n const layerHandler = layer && (layer[eventHandlerProp] || layer.props[eventHandlerProp]);\n const rootHandler = this.props[eventHandlerProp];\n let handled = false;\n if (layerHandler) {\n handled = layerHandler.call(layer, info, event);\n }\n if (!handled) {\n rootHandler?.(info, event);\n this.widgetManager.onEvent(info, event);\n }\n };\n /** Internal use only: evnet handler for pointerdown */\n this._onPointerDown = (event) => {\n // TODO(ibgreen) Picking not yet supported on WebGPU\n if (this.device?.type === 'webgpu') {\n return;\n }\n const pos = event.offsetCenter;\n const pickedInfo = this._pick('pickObject', 'pickObject Time', {\n x: pos.x,\n y: pos.y,\n radius: this.props.pickingRadius\n });\n this._lastPointerDownInfo = pickedInfo.result[0] || pickedInfo.emptyInfo;\n };\n // @ts-ignore views\n this.props = { ...defaultProps, ...props };\n props = this.props;\n if (props.viewState && props.initialViewState) {\n log.warn('View state tracking is disabled. Use either `initialViewState` for auto update or `viewState` for manual update.')();\n }\n this.viewState = this.props.initialViewState;\n // See if we already have a device\n if (props.device) {\n this.device = props.device;\n }\n let deviceOrPromise = this.device;\n // Attach a new luma.gl device to a WebGL2 context if supplied\n if (!deviceOrPromise && props.gl) {\n if (props.gl instanceof WebGLRenderingContext) {\n log.error('WebGL1 context not supported.')();\n }\n deviceOrPromise = webgl2Adapter.attach(props.gl, this.props.deviceProps);\n }\n // Create a new device\n if (!deviceOrPromise) {\n deviceOrPromise = this._createDevice(props);\n }\n this.animationLoop = this._createAnimationLoop(deviceOrPromise, props);\n this.setProps(props);\n // UNSAFE/experimental prop: only set at initialization to avoid performance hit\n if (props._typedArrayManagerProps) {\n typedArrayManager.setOptions(props._typedArrayManagerProps);\n }\n this.animationLoop.start();\n }\n /** Stop rendering and dispose all resources */\n finalize() {\n this.animationLoop?.stop();\n this.animationLoop?.destroy();\n this.animationLoop = null;\n this._lastPointerDownInfo = null;\n this.layerManager?.finalize();\n this.layerManager = null;\n this.viewManager?.finalize();\n this.viewManager = null;\n this.effectManager?.finalize();\n this.effectManager = null;\n this.deckRenderer?.finalize();\n this.deckRenderer = null;\n this.deckPicker?.finalize();\n this.deckPicker = null;\n this.eventManager?.destroy();\n this.eventManager = null;\n this.widgetManager?.finalize();\n this.widgetManager = null;\n if (!this.props.canvas && !this.props.device && !this.props.gl && this.canvas) {\n // remove internally created canvas\n this.canvas.parentElement?.removeChild(this.canvas);\n this.canvas = null;\n }\n }\n /** Partially update props */\n setProps(props) {\n this.stats.get('setProps Time').timeStart();\n if ('onLayerHover' in props) {\n log.removed('onLayerHover', 'onHover')();\n }\n if ('onLayerClick' in props) {\n log.removed('onLayerClick', 'onClick')();\n }\n if (props.initialViewState &&\n // depth = 3 when comparing viewStates: viewId.position.0\n !deepEqual(this.props.initialViewState, props.initialViewState, 3)) {\n // Overwrite internal view state\n this.viewState = props.initialViewState;\n }\n // Merge with existing props\n Object.assign(this.props, props);\n // Update CSS size of canvas\n this._setCanvasSize(this.props);\n // We need to overwrite CSS style width and height with actual, numeric values\n const resolvedProps = Object.create(this.props);\n Object.assign(resolvedProps, {\n views: this._getViews(),\n width: this.width,\n height: this.height,\n viewState: this._getViewState()\n });\n if (props.device && props.device.id !== this.device?.id) {\n this.animationLoop?.stop();\n if (this.canvas !== props.device.canvasContext?.canvas) {\n // remove old canvas if new one being used and de-register events\n // TODO (ck): We might not own this canvas depending it's source, so removing it from the\n // DOM here might be a bit unexpected but it should be ok for most users.\n this.canvas?.remove();\n this.eventManager?.destroy();\n // ensure we will re-attach ourselves after createDevice callbacks\n this.canvas = null;\n }\n log.log(`recreating animation loop for new device! id=${props.device.id}`)();\n this.animationLoop = this._createAnimationLoop(props.device, props);\n this.animationLoop.start();\n }\n // Update the animation loop\n this.animationLoop?.setProps(resolvedProps);\n if (props.useDevicePixels !== undefined &&\n this.device?.canvasContext?.canvas instanceof HTMLCanvasElement) {\n // TODO: It would be much cleaner if CanvasContext had a setProps method\n this.device.canvasContext.props.useDevicePixels = props.useDevicePixels;\n const canvas = this.device.canvasContext.canvas;\n const entry = {\n target: canvas,\n contentBoxSize: [{ inlineSize: canvas.clientWidth, blockSize: canvas.clientHeight }],\n devicePixelContentBoxSize: [\n { inlineSize: canvas.clientWidth, blockSize: canvas.clientHeight }\n ],\n borderBoxSize: [{ inlineSize: canvas.clientWidth, blockSize: canvas.clientHeight }]\n };\n // Access the protected _handleResize method through the canvas context\n this.device.canvasContext._handleResize([entry]);\n }\n // If initialized, update sub manager props\n if (this.layerManager) {\n this.viewManager.setProps(resolvedProps);\n // Make sure that any new layer gets initialized with the current viewport\n this.layerManager.activateViewport(this.getViewports()[0]);\n this.layerManager.setProps(resolvedProps);\n this.effectManager.setProps(resolvedProps);\n this.deckRenderer.setProps(resolvedProps);\n this.deckPicker.setProps(resolvedProps);\n this.widgetManager.setProps(resolvedProps);\n }\n this.stats.get('setProps Time').timeEnd();\n }\n // Public API\n /**\n * Check if a redraw is needed\n * @returns `false` or a string summarizing the redraw reason\n */\n needsRedraw(opts = { clearRedrawFlags: false }) {\n if (!this.layerManager) {\n // Not initialized or already finalized\n return false;\n }\n if (this.props._animate) {\n return 'Deck._animate';\n }\n let redraw = this._needsRedraw;\n if (opts.clearRedrawFlags) {\n this._needsRedraw = false;\n }\n const viewManagerNeedsRedraw = this.viewManager.needsRedraw(opts);\n const layerManagerNeedsRedraw = this.layerManager.needsRedraw(opts);\n const effectManagerNeedsRedraw = this.effectManager.needsRedraw(opts);\n const deckRendererNeedsRedraw = this.deckRenderer.needsRedraw(opts);\n redraw =\n redraw ||\n viewManagerNeedsRedraw ||\n layerManagerNeedsRedraw ||\n effectManagerNeedsRedraw ||\n deckRendererNeedsRedraw;\n return redraw;\n }\n /**\n * Redraw the GL context\n * @param reason If not provided, only redraw if deemed necessary. Otherwise redraw regardless of internal states.\n * @returns\n */\n redraw(reason) {\n if (!this.layerManager) {\n // Not yet initialized\n return;\n }\n // Check if we need to redraw\n let redrawReason = this.needsRedraw({ clearRedrawFlags: true });\n // User-supplied should take precedent, however the redraw flags get cleared regardless\n redrawReason = reason || redrawReason;\n if (!redrawReason) {\n return;\n }\n this.stats.get('Redraw Count').incrementCount();\n if (this.props._customRender) {\n this.props._customRender(redrawReason);\n }\n else {\n this._drawLayers(redrawReason);\n }\n }\n /** Flag indicating that the Deck instance has initialized its resources and it's safe to call public methods. */\n get isInitialized() {\n return this.viewManager !== null;\n }\n /** Get a list of views that are currently rendered */\n getViews() {\n assert(this.viewManager);\n return this.viewManager.views;\n }\n /** Get a list of viewports that are currently rendered.\n * @param rect If provided, only returns viewports within the given bounding box.\n */\n getViewports(rect) {\n assert(this.viewManager);\n return this.viewManager.getViewports(rect);\n }\n /** Get the current canvas element. */\n getCanvas() {\n return this.canvas;\n }\n /** Query the object rendered on top at a given point */\n pickObject(opts) {\n const infos = this._pick('pickObject', 'pickObject Time', opts).result;\n return infos.length ? infos[0] : null;\n }\n /* Query all rendered objects at a given point */\n pickMultipleObjects(opts) {\n opts.depth = opts.depth || 10;\n return this._pick('pickObject', 'pickMultipleObjects Time', opts).result;\n }\n /* Query all objects rendered on top within a bounding box */\n pickObjects(opts) {\n return this._pick('pickObjects', 'pickObjects Time', opts);\n }\n /** Experimental\n * Add a global resource for sharing among layers\n */\n _addResources(resources, forceUpdate = false) {\n for (const id in resources) {\n this.layerManager.resourceManager.add({ resourceId: id, data: resources[id], forceUpdate });\n }\n }\n /** Experimental\n * Remove a global resource\n */\n _removeResources(resourceIds) {\n for (const id of resourceIds) {\n this.layerManager.resourceManager.remove(id);\n }\n }\n /** Experimental\n * Register a default effect. Effects will be sorted by order, those with a low order will be rendered first\n */\n _addDefaultEffect(effect) {\n this.effectManager.addDefaultEffect(effect);\n }\n _addDefaultShaderModule(module) {\n this.layerManager.addDefaultShaderModule(module);\n }\n _removeDefaultShaderModule(module) {\n this.layerManager?.removeDefaultShaderModule(module);\n }\n _pick(method, statKey, opts) {\n assert(this.deckPicker);\n const { stats } = this;\n stats.get('Pick Count').incrementCount();\n stats.get(statKey).timeStart();\n const infos = this.deckPicker[method]({\n // layerManager, viewManager and effectManager are always defined if deckPicker is\n layers: this.layerManager.getLayers(opts),\n views: this.viewManager.getViews(),\n viewports: this.getViewports(opts),\n onViewportActive: this.layerManager.activateViewport,\n effects: this.effectManager.getEffects(),\n ...opts\n });\n stats.get(statKey).timeEnd();\n return infos;\n }\n /** Resolve props.canvas to element */\n _createCanvas(props) {\n let canvas = props.canvas;\n // TODO EventManager should accept element id\n if (typeof canvas === 'string') {\n canvas = document.getElementById(canvas);\n assert(canvas);\n }\n if (!canvas) {\n canvas = document.createElement('canvas');\n canvas.id = props.id || 'deckgl-overlay';\n // TODO this is a hack, investigate why these are not set for the picking\n // tests\n if (props.width && typeof props.width === 'number') {\n canvas.width = props.width;\n }\n if (props.height && typeof props.height === 'number') {\n canvas.height = props.height;\n }\n const parent = props.parent || document.body;\n parent.appendChild(canvas);\n }\n Object.assign(canvas.style, props.style);\n return canvas;\n }\n /** Updates canvas width and/or height, if provided as props */\n _setCanvasSize(props) {\n if (!this.canvas) {\n return;\n }\n const { width, height } = props;\n // Set size ONLY if props are being provided, otherwise let canvas be layouted freely\n if (width || width === 0) {\n const cssWidth = Number.isFinite(width) ? `${width}px` : width;\n this.canvas.style.width = cssWidth;\n }\n if (height || height === 0) {\n const cssHeight = Number.isFinite(height) ? `${height}px` : height;\n // Note: position==='absolute' required for height 100% to work\n this.canvas.style.position = props.style?.position || 'absolute';\n this.canvas.style.height = cssHeight;\n }\n }\n /** If canvas size has changed, reads out the new size and update */\n _updateCanvasSize() {\n const { canvas } = this;\n if (!canvas) {\n return;\n }\n // Fallback to width/height when clientWidth/clientHeight are undefined (OffscreenCanvas).\n const newWidth = canvas.clientWidth ?? canvas.width;\n const newHeight = canvas.clientHeight ?? canvas.height;\n if (newWidth !== this.width || newHeight !== this.height) {\n // @ts-expect-error private assign to read-only property\n this.width = newWidth;\n // @ts-expect-error private assign to read-only property\n this.height = newHeight;\n this.viewManager?.setProps({ width: newWidth, height: newHeight });\n // Make sure that any new layer gets initialized with the current viewport\n this.layerManager?.activateViewport(this.getViewports()[0]);\n this.props.onResize({ width: newWidth, height: newHeight });\n }\n }\n _createAnimationLoop(deviceOrPromise, props) {\n const { \n // width,\n // height,\n gl, \n // debug,\n onError\n // onBeforeRender,\n // onAfterRender,\n } = props;\n return new AnimationLoop({\n device: deviceOrPromise,\n // TODO v9\n autoResizeDrawingBuffer: !gl, // do not auto resize external context\n autoResizeViewport: false,\n // @ts-expect-error luma.gl needs to accept Promise<void> return value\n onInitialize: context => this._setDevice(context.device),\n onRender: this._onRenderFrame.bind(this),\n // @ts-expect-error typing mismatch: AnimationLoop does not accept onError:null\n onError\n // onBeforeRender,\n // onAfterRender,\n });\n }\n // Create a device from the deviceProps, assigning required defaults\n _createDevice(props) {\n const canvasContextUserProps = this.props.deviceProps?.createCanvasContext;\n const canvasContextProps = typeof canvasContextUserProps === 'object' ? canvasContextUserProps : undefined;\n // In deck.gl v9, Deck always bundles and adds a webgl2Adapter.\n // This behavior is expected to change in deck.gl v10 to support WebGPU only builds.\n const deviceProps = { adapters: [], ...props.deviceProps };\n if (!deviceProps.adapters.includes(webgl2Adapter)) {\n deviceProps.adapters.push(webgl2Adapter);\n }\n const defaultCanvasProps = {\n // we must use 'premultiplied' canvas for webgpu to enable transparency and match shaders\n alphaMode: this.props.deviceProps?.type === 'webgpu' ? 'premultiplied' : undefined\n };\n // Create the \"best\" device supported from the registered adapters\n return luma.createDevice({\n // luma by default throws if a device is already attached\n // asynchronous device creation could happen after finalize() is called\n // TODO - createDevice should support AbortController?\n _reuseDevices: true,\n // tests can't handle WebGPU devices yet so we force WebGL2 unless overridden\n type: 'webgl',\n ...deviceProps,\n // In deck.gl v10 we may emphasize multi canvas support and unwind this prop wrapping\n createCanvasContext: {\n ...defaultCanvasProps,\n ...canvasContextProps,\n canvas: this._createCanvas(props),\n useDevicePixels: this.props.useDevicePixels,\n autoResize: true\n }\n });\n }\n // Get the most relevant view state: props.viewState, if supplied, shadows internal viewState\n // TODO: For backwards compatibility ensure numeric width and height is added to the viewState\n _getViewState() {\n return this.props.viewState || this.viewState;\n }\n // Get the view descriptor list\n _getViews() {\n const { views } = this.props;\n const normalizedViews = Array.isArray(views)\n ? views\n : // If null, default to a full screen map view port\n views\n ? [views]\n : [new MapView({ id: 'default-view' })];\n if (normalizedViews.length && this.props.controller) {\n // Backward compatibility: support controller prop\n normalizedViews[0].props.controller = this.props.controller;\n }\n return normalizedViews;\n }\n _onContextLost() {\n const { onError } = this.props;\n if (this.animationLoop && onError) {\n onError(new Error('WebGL context is lost'));\n }\n }\n /** Actually run picking */\n _pickAndCallback() {\n if (this.device?.type === 'webgpu') {\n return;\n }\n const { _pickRequest } = this;\n if (_pickRequest.event) {\n // Perform picking\n const { result, emptyInfo } = this._pick('pickObject', 'pickObject Time', _pickRequest);\n this.cursorState.isHovering = result.length > 0;\n // There are 4 possible scenarios:\n // result is [outInfo, pickedInfo] (moved from one pickable layer to another)\n // result is [outInfo] (moved outside of a pickable layer)\n // result is [pickedInfo] (moved into or over a pickable layer)\n // result is [] (nothing is or was picked)\n //\n // `layer.props.onHover` should be called on all affected layers (out/over)\n // `deck.props.onHover` should be called with the picked info if any, or empty info otherwise\n // `deck.props.getTooltip` should be called with the picked info if any, or empty info otherwise\n // Execute callbacks\n let pickedInfo = emptyInfo;\n let handled = false;\n for (const info of result) {\n pickedInfo = info;\n handled = info.layer?.onHover(info, _pickRequest.event) || handled;\n }\n if (!handled) {\n this.props.onHover?.(pickedInfo, _pickRequest.event);\n this.widgetManager.onHover(pickedInfo, _pickRequest.event);\n }\n // Clear pending pickRequest\n _pickRequest.event = null;\n }\n }\n _updateCursor() {\n const container = this.props.parent || this.canvas;\n if (container) {\n container.style.cursor = this.props.getCursor(this.cursorState);\n }\n }\n _setDevice(device) {\n this.device = device;\n if (!this.animationLoop) {\n // finalize() has been called\n return;\n }\n // if external context...\n if (!this.canvas) {\n this.canvas = this.device.canvasContext?.canvas;\n // external canvas may not be in DOM\n if (!this.canvas.isConnected && this.props.parent) {\n this.props.parent.insertBefore(this.canvas, this.props.parent.firstChild);\n }\n // TODO v9\n // ts-expect-error - Currently luma.gl v9 does not expose these options\n // All WebGLDevice contexts are instrumented, but it seems the device\n // should have a method to start state tracking even if not enabled?\n // instrumentGLContext(this.device.gl, {enable: true, copyState: true});\n }\n if (this.device.type === 'webgl') {\n this.device.setParametersWebGL({\n blend: true,\n blendFunc: [770, 771, 1, 771],\n polygonOffsetFill: true,\n depthTest: true,\n depthFunc: 515\n });\n }\n this.props.onDeviceInitialized(this.device);\n if (this.device.type === 'webgl') {\n // Legacy callback - warn?\n // @ts-expect-error gl is not visible on Device base class\n this.props.onWebGLInitialized(this.device.gl);\n }\n // timeline for transitions\n const timeline = new Timeline();\n timeline.play();\n this.animationLoop.attachTimeline(timeline);\n this.eventManager = new EventManager(this.props.parent || this.canvas, {\n touchAction: this.props.touchAction,\n recognizers: Object.keys(RECOGNIZERS).map((eventName) => {\n // Resolve recognizer settings\n const [RecognizerConstructor, defaultOptions, recognizeWith, requestFailure] = RECOGNIZERS[eventName];\n const optionsOverride = this.props.eventRecognizerOptions?.[eventName];\n const options = { ...defaultOptions, ...optionsOverride, event: eventName };\n return {\n recognizer: new RecognizerConstructor(options),\n recognizeWith,\n requestFailure\n };\n }),\n events: {\n pointerdown: this._onPointerDown,\n pointermove: this._onPointerMove,\n pointerleave: this._onPointerMove\n }\n });\n for (const eventType in EVENT_HANDLERS) {\n this.eventManager.on(eventType, this._onEvent);\n }\n this.viewManager = new ViewManager({\n timeline,\n eventManager: this.eventManager,\n onViewStateChange: this._onViewStateChange.bind(this),\n onInteractionStateChange: this._onInteractionStateChange.bind(this),\n views: this._getViews(),\n viewState: this._getViewState(),\n width: this.width,\n height: this.height\n });\n // viewManager must be initialized before layerManager\n // layerManager depends on viewport created by viewManager.\n const viewport = this.viewManager.getViewports()[0];\n // Note: avoid React setState due GL animation loop / setState timing issue\n this.layerManager = new LayerManager(this.device, {\n deck: this,\n stats: this.stats,\n viewport,\n timeline\n });\n this.effectManager = new EffectManager({\n deck: this,\n device: this.device\n });\n this.deckRenderer = new DeckRenderer(this.device);\n this.deckPicker = new DeckPicker(this.device);\n this.widgetManager = new WidgetManager({\n deck: this,\n parentElement: this.canvas?.parentElement\n });\n this.widgetManager.addDefault(new TooltipWidget());\n this.setProps(this.props);\n this._updateCanvasSize();\n this.props.onLoad();\n }\n /** Internal only: default render function (redraw all layers and views) */\n _drawLayers(redrawReason, renderOptions) {\n const { device, gl } = this.layerManager.context;\n this.props.onBeforeRender({ device, gl });\n const opts = {\n target: this.props._framebuffer,\n layers: this.layerManager.getLayers(),\n viewports: this.viewManager.getViewports(),\n onViewportActive: this.layerManager.activateViewport,\n views: this.viewManager.getViews(),\n pass: 'screen',\n effects: this.effectManager.getEffects(),\n ...renderOptions\n };\n this.deckRenderer?.renderLayers(opts);\n if (opts.pass === 'screen') {\n // This method could be called when drawing to picking buffer, texture etc.\n // Only when drawing to screen, update all widgets (UI components)\n this.widgetManager.onRedraw({\n viewports: opts.viewports,\n layers: opts.layers\n });\n }\n this.props.onAfterRender({ device, gl });\n }\n // Callbacks\n _onRenderFrame() {\n this._getFrameStats();\n // Log perf stats every second\n if (this._metricsCounter++ % 60 === 0) {\n this._getMetrics();\n this.stats.reset();\n log.table(4, this.metrics)();\n // Experimental: report metrics\n if (this.props._onMetrics) {\n this.props._onMetrics(this.metrics);\n }\n }\n this._updateCanvasSize();\n this._updateCursor();\n // Update layers if needed (e.g. some async prop has loaded)\n // Note: This can trigger a redraw\n this.layerManager.updateLayers();\n // Perform picking request if any\n // TODO(ibgreen): Picking not yet supported on WebGPU\n if (this.device?.type !== 'webgpu') {\n this._pickAndCallback();\n }\n // Redraw if necessary\n this.redraw();\n // Update viewport transition if needed\n // Note: this can trigger `onViewStateChange`, and affect layers\n // We want to defer these changes to the next frame\n if (this.viewManager) {\n this.viewManager.updateViewStates();\n }\n }\n // Callbacks\n _onViewStateChange(params) {\n // Let app know that view state is changing, and give it a chance to change it\n const viewState = this.props.onViewStateChange(params) || params.viewState;\n // If initialViewState was set on creation, auto track position\n if (this.viewState) {\n this.viewState = { ...this.viewState, [params.viewId]: viewState };\n if (!this.props.viewState) {\n // Apply internal view state\n if (this.viewManager) {\n this.viewManager.setProps({ viewState: this.viewState });\n }\n }\n }\n }\n _onInteractionStateChange(interactionState) {\n this.cursorState.isDragging = interactionState.isDragging || false;\n this.props.onInteractionStateChange(interactionState);\n }\n _getFrameStats() {\n const { stats } = this;\n stats.get('frameRate').timeEnd();\n stats.get('frameRate').timeStart();\n // Get individual stats from luma.gl so reset works\n const animationLoopStats = this.animationLoop.stats;\n stats.get('GPU Time').addTime(animationLoopStats.get('GPU Time').lastTiming);\n stats.get('CPU Time').addTime(animationLoopStats.get('CPU Time').lastTiming);\n }\n _getMetrics() {\n const { metrics, stats } = this;\n metrics.fps = stats.get('frameRate').getHz();\n metrics.setPropsTime = stats.get('setProps Time').time;\n metrics.updateAttributesTime = stats.get('Update Attributes').time;\n metrics.framesRedrawn = stats.get('Redraw Count').count;\n metrics.pickTime =\n stats.get('pickObject Time').time +\n stats.get('pickMultipleObjects Time').time +\n stats.get('pickObjects Time').time;\n metrics.pickCount = stats.get('Pick Count').count;\n // Luma stats\n metrics.gpuTime = stats.get('GPU Time').time;\n metrics.cpuTime = stats.get('CPU Time').time;\n metrics.gpuTimePerFrame = stats.get('GPU Time').getAverageTime();\n metrics.cpuTimePerFrame = stats.get('CPU Time').getAverageTime();\n const memoryStats = luma.stats.get('Memory Usage');\n metrics.bufferMemory = memoryStats.get('Buffer Memory').count;\n metrics.textureMemory = memoryStats.get('Texture Memory').count;\n metrics.renderbufferMemory = memoryStats.get('Renderbuffer Memory').count;\n metrics.gpuMemory = memoryStats.get('GPU Memory').count;\n }\n}\nDeck.defaultProps = defaultProps;\n// This is used to defeat tree shaking of init.js\n// https://github.com/visgl/deck.gl/issues/3213\nDeck.VERSION = VERSION;\nexport default Deck;\n//# sourceMappingURL=deck.js.map","// deck.gl\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\nimport { clamp } from '@math.gl/core';\nimport Controller from \"./controller.js\";\nimport { MapState } from \"./map-controller.js\";\nimport { mod } from \"../utils/math-utils.js\";\nimport LinearInterpolator from \"../transitions/linear-interpolator.js\";\nimport { MAX_LATITUDE } from '@math.gl/web-mercator';\nclass GlobeState extends MapState {\n // Apply any constraints (mathematical or defined by _viewportProps) to map state\n applyConstraints(props) {\n // Ensure zoom is within specified range\n const { maxZoom, minZoom, zoom } = props;\n props.zoom = clamp(zoom, minZoom, maxZoom);\n const { longitude, latitude } = props;\n if (longitude < -180 || longitude > 180) {\n props.longitude = mod(longitude + 180, 360) - 180;\n }\n props.latitude = clamp(latitude, -MAX_LATITUDE, MAX_LATITUDE);\n return props;\n }\n}\nexport default class GlobeController extends Controller {\n constructor() {\n super(...arguments);\n this.ControllerState = GlobeState;\n this.transition = {\n transitionDuration: 300,\n transitionInterpolator: new LinearInterpolator(['longitude', 'latitude', 'zoom'])\n };\n this.dragMode = 'pan';\n }\n setProps(props) {\n super.setProps(props);\n // TODO - support pitching?\n this.dragRotate = false;\n this.touchRotate = false;\n }\n}\n//# sourceMappingURL=globe-controller.js.map","// deck.gl\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\nimport View from \"./view.js\";\nimport GlobeViewport from \"../viewports/globe-viewport.js\";\nimport WebMercatorViewport from \"../viewports/web-mercator-viewport.js\";\nimport GlobeController from \"../controllers/globe-controller.js\";\nclass GlobeView extends View {\n constructor(props = {}) {\n super(props);\n }\n getViewportType(viewState) {\n return viewState.zoom > 12 ? WebMercatorViewport : GlobeViewport;\n }\n get ControllerType() {\n return GlobeController;\n }\n}\nGlobeView.displayName = 'GlobeView';\nexport default GlobeView;\n//# sourceMappingURL=globe-view.js.map"],"file":"globe-view-DKhftlA1.js"}