@protobase/ui 0.113.0 → 0.114.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (206) hide show
  1. package/dist/account/messages.d.ts +2 -2
  2. package/dist/app/app.d.ts +4 -1
  3. package/dist/app/app.js +9 -7
  4. package/dist/app/change-confirm/messages.d.ts +2 -2
  5. package/dist/app/charts/messages.d.ts +2 -2
  6. package/dist/app/confirm-sign-in-messages.d.ts +2 -2
  7. package/dist/app/create/messages.d.ts +2 -2
  8. package/dist/app/delete/messages.d.ts +2 -2
  9. package/dist/app/displays/messages.d.ts +2 -2
  10. package/dist/app/displays/virtual-cards.js +1 -0
  11. package/dist/app/embedded-list/messages.d.ts +2 -2
  12. package/dist/app/export/messages.d.ts +2 -2
  13. package/dist/app/field-messages.d.ts +2 -2
  14. package/dist/app/field-types/workflow/messages.d.ts +2 -2
  15. package/dist/app/field-types/workflow-page/messages.d.ts +2 -2
  16. package/dist/app/field-types/workflow-run/messages.d.ts +2 -2
  17. package/dist/app/field-types/workflow-status/messages.d.ts +2 -2
  18. package/dist/app/file-viewers/messages.d.ts +2 -2
  19. package/dist/app/first-frame.d.ts +13 -0
  20. package/dist/app/first-frame.js +23 -0
  21. package/dist/app/focus/messages.d.ts +2 -2
  22. package/dist/app/gallery/gallery-layout.d.ts +2 -2
  23. package/dist/app/gallery/messages.d.ts +2 -2
  24. package/dist/app/hand-order/messages.d.ts +2 -2
  25. package/dist/app/import/messages.d.ts +2 -2
  26. package/dist/app/index.html +0 -17
  27. package/dist/app/list-messages.d.ts +2 -2
  28. package/dist/app/main.js +19 -7
  29. package/dist/app/messages.d.ts +2 -2
  30. package/dist/app/pages/messages.d.ts +2 -2
  31. package/dist/app/record-chart/messages.d.ts +2 -2
  32. package/dist/app/record-messages.d.ts +2 -2
  33. package/dist/app/record-mode/shown-layout.d.ts +1 -1
  34. package/dist/app/record-row/messages.d.ts +2 -2
  35. package/dist/app/record-row/record-row.d.ts +3 -2
  36. package/dist/app/record-row/record-row.js +43 -27
  37. package/dist/app/record-row/row-window.d.ts +11 -0
  38. package/dist/app/record-row/row-window.js +15 -2
  39. package/dist/app/refresh-mark.d.ts +2 -1
  40. package/dist/app/refresh-mark.js +3 -1
  41. package/dist/app/related-cards/messages.d.ts +2 -2
  42. package/dist/app/reveal-when-loaded.d.ts +8 -2
  43. package/dist/app/reveal-when-loaded.js +12 -5
  44. package/dist/app/runtime/messages.d.ts +2 -2
  45. package/dist/app/saved/messages.d.ts +2 -2
  46. package/dist/app/searches/messages.d.ts +2 -2
  47. package/dist/app/splash-hold.d.ts +0 -1
  48. package/dist/app/splash-hold.js +1 -1
  49. package/dist/app/start-screen.d.ts +0 -9
  50. package/dist/app/start-screen.js +1 -10
  51. package/dist/app/ui-ready.d.ts +11 -0
  52. package/dist/app/ui-ready.js +12 -0
  53. package/dist/app-shell/app-shell.js +3 -1
  54. package/dist/app-shell/close-sidebar.d.ts +10 -0
  55. package/dist/app-shell/close-sidebar.js +17 -0
  56. package/dist/app-shell/drawer.d.ts +7 -1
  57. package/dist/app-shell/drawer.js +26 -7
  58. package/dist/app-shell/index.d.ts +2 -1
  59. package/dist/app-shell/index.js +2 -1
  60. package/dist/app-shell/messages.d.ts +2 -2
  61. package/dist/app-shell/top-bar.js +4 -4
  62. package/dist/assistant-dock/messages.d.ts +2 -2
  63. package/dist/auth/messages.d.ts +2 -2
  64. package/dist/calls/messages.d.ts +2 -2
  65. package/dist/compact-table/messages.d.ts +2 -2
  66. package/dist/data/query-keys.d.ts +6 -0
  67. package/dist/data/query-keys.js +10 -0
  68. package/dist/data/start-cache/cached-plugins.d.ts +6 -0
  69. package/dist/data/start-cache/cached-plugins.js +10 -0
  70. package/dist/data-grid/column-spec.d.ts +1 -1
  71. package/dist/data-grid/data-grid.js +1 -0
  72. package/dist/data-grid/messages.d.ts +2 -2
  73. package/dist/data-grid/row-source.d.ts +5 -0
  74. package/dist/data-grid/use-paged-rows.d.ts +5 -3
  75. package/dist/data-grid/use-paged-rows.js +21 -6
  76. package/dist/filter-panel/messages.d.ts +2 -2
  77. package/dist/focus-page/messages.d.ts +2 -2
  78. package/dist/index.d.ts +4 -1
  79. package/dist/index.js +4 -1
  80. package/dist/invitations/messages.d.ts +2 -2
  81. package/dist/live/grid-loader.d.ts +1 -0
  82. package/dist/live/grid-loader.js +3 -1
  83. package/dist/live/use-live-rows.js +1 -0
  84. package/dist/mailbox/messages.d.ts +2 -2
  85. package/dist/mocks/customers.d.ts +1 -1
  86. package/dist/mocks/invoices.d.ts +1 -1
  87. package/dist/mocks/orders.d.ts +3 -3
  88. package/dist/notifications/bell/messages.d.ts +2 -2
  89. package/dist/organizations/members-page.js +13 -7
  90. package/dist/organizations/messages.d.ts +2 -2
  91. package/dist/organizations/use-organizations.d.ts +4 -1
  92. package/dist/organizations/use-organizations.js +25 -19
  93. package/dist/package.js +1 -1
  94. package/dist/plugins/plugin-source.d.ts +24 -4
  95. package/dist/plugins/plugin-source.js +48 -14
  96. package/dist/plugins/use-plugin-loads.d.ts +3 -1
  97. package/dist/plugins/use-plugin-loads.js +24 -7
  98. package/dist/primitives/messages.d.ts +2 -2
  99. package/dist/primitives/skeleton.js +1 -0
  100. package/dist/record-view/messages.d.ts +2 -2
  101. package/dist/roles/use-active-role.d.ts +4 -1
  102. package/dist/roles/use-active-role.js +18 -13
  103. package/dist/shell/assets/api-provider-BJJrOoO4.js +2 -0
  104. package/dist/shell/assets/app-VoTi41IN.js +16 -0
  105. package/dist/shell/assets/badge-OU9hb6yQ.js +2 -0
  106. package/dist/shell/assets/checkbox-DFfK432Y.js +2 -0
  107. package/dist/shell/assets/createLucideIcon-DGm8SdFI.js +2 -0
  108. package/dist/shell/assets/display-value-CIH2qfgQ.js +2 -0
  109. package/dist/shell/assets/{field-badge-3QmjR1r3.js → field-badge-DX2Mc_fH.js} +2 -2
  110. package/dist/shell/assets/{graph-view-BcbWbnHO.js → graph-view-CY9LPr0B.js} +2 -2
  111. package/dist/shell/assets/{html-viewer-tGtSpy9M.js → html-viewer-BPGMH_GA.js} +2 -2
  112. package/dist/shell/assets/{in-place-form-B0EkP4B1.js → in-place-form-RWSQGEg4.js} +2 -2
  113. package/dist/shell/assets/index-Bzb-O7ER.js +2 -0
  114. package/dist/shell/assets/index-HnFovy2Q.css +2 -0
  115. package/dist/shell/assets/{intl-cache-bXVNV0Yq.js → intl-cache-D4doUjK1.js} +2 -2
  116. package/dist/shell/assets/{lib-d3-interpolate-Cl0dHO4f.js → lib-d3-interpolate-D3u38iyJ.js} +2 -2
  117. package/dist/shell/assets/{lib-d3-transition-DUHAGQ8z.js → lib-d3-transition-BUpPvFvt.js} +2 -2
  118. package/dist/shell/assets/{lib-d3-zoom-gQh2osrj.js → lib-d3-zoom-BF7SPKNh.js} +2 -2
  119. package/dist/shell/assets/{lib-vis.gl-react-maplibre-CU7gWYjg.js → lib-vis.gl-react-maplibre-C7-0xNFC.js} +2 -2
  120. package/dist/shell/assets/{lib-xyflow-react-DGg_5r7u.js → lib-xyflow-react-CKyW7szC.js} +2 -2
  121. package/dist/shell/assets/maplibre-9ViQO48S.js +2 -0
  122. package/dist/shell/assets/{markdown-content-DHKbAJjx.js → markdown-content-DTB9RQDs.js} +2 -2
  123. package/dist/shell/assets/{record-map-nGRmsk6x.js → record-map-CVqCWtfe.js} +2 -2
  124. package/dist/shell/assets/{records-map-D2flyaz3.js → records-map-ClYSxrVR.js} +2 -2
  125. package/dist/shell/assets/{run-trace-view-DfrAPeum.js → run-trace-view-CN16MiXg.js} +2 -2
  126. package/dist/shell/assets/search-picker-BGpvJQRD.js +2 -0
  127. package/dist/shell/assets/shared-protobase-ui-BC8LqGQB.js +2 -0
  128. package/dist/shell/assets/step-catalog-CZY0ZpCC.js +2 -0
  129. package/dist/shell/assets/step-panel-DhD80lsJ.js +2 -0
  130. package/dist/shell/assets/use-app-address-B4Uk3nWy.js +2 -0
  131. package/dist/shell/assets/{use-meta-BqEqOLNe.js → use-meta-D5kYywHm.js} +2 -2
  132. package/dist/shell/assets/{use-sibling-page-CiuiG-Tz.js → use-sibling-page-BJ81HcOP.js} +3 -3
  133. package/dist/shell/assets/value-badge-Dpd8dRqq.js +2 -0
  134. package/dist/shell/assets/{vendor-WWp_xlp2.js → vendor-3etemhgS.js} +4 -4
  135. package/dist/shell/assets/{workflow-canvas-DMP7SDWX.js → workflow-canvas-C1nGpi5w.js} +2 -2
  136. package/dist/shell/assets/{workflow-graph-editor-xpV8_qEl.js → workflow-graph-editor-DAJa4lq6.js} +2 -2
  137. package/dist/shell/assets/workflow-workbench-HramVZEJ.js +4 -0
  138. package/dist/shell/assets/{workflows-Bku4o2su.js → workflows-DlvOln9v.js} +2 -2
  139. package/dist/shell/assets/{workflows-start-kl7rSSay.js → workflows-start-QUKfwFqf.js} +2 -2
  140. package/dist/shell/index.html +16 -19
  141. package/dist/shell/protobase.shell.json +2 -2
  142. package/dist/shell/protobase.sw.js +2 -2
  143. package/dist/shell-source-maps/assets/api-provider-BJJrOoO4.js.map +1 -0
  144. package/dist/shell-source-maps/assets/app-VoTi41IN.js.map +1 -0
  145. package/dist/shell-source-maps/assets/{badge-ChHXC28D.js.map → badge-OU9hb6yQ.js.map} +1 -1
  146. package/dist/shell-source-maps/assets/{checkbox-COOOlJPG.js.map → checkbox-DFfK432Y.js.map} +1 -1
  147. package/dist/shell-source-maps/assets/createLucideIcon-DGm8SdFI.js.map +1 -0
  148. package/dist/shell-source-maps/assets/display-value-CIH2qfgQ.js.map +1 -0
  149. package/dist/shell-source-maps/assets/{field-badge-3QmjR1r3.js.map → field-badge-DX2Mc_fH.js.map} +1 -1
  150. package/dist/shell-source-maps/assets/{graph-view-BcbWbnHO.js.map → graph-view-CY9LPr0B.js.map} +1 -1
  151. package/dist/shell-source-maps/assets/{html-viewer-tGtSpy9M.js.map → html-viewer-BPGMH_GA.js.map} +1 -1
  152. package/dist/shell-source-maps/assets/{in-place-form-B0EkP4B1.js.map → in-place-form-RWSQGEg4.js.map} +1 -1
  153. package/dist/shell-source-maps/assets/index-Bzb-O7ER.js.map +1 -0
  154. package/dist/shell-source-maps/assets/{intl-cache-bXVNV0Yq.js.map → intl-cache-D4doUjK1.js.map} +1 -1
  155. package/dist/shell-source-maps/assets/{lib-d3-interpolate-Cl0dHO4f.js.map → lib-d3-interpolate-D3u38iyJ.js.map} +1 -1
  156. package/dist/shell-source-maps/assets/{lib-d3-transition-DUHAGQ8z.js.map → lib-d3-transition-BUpPvFvt.js.map} +1 -1
  157. package/dist/shell-source-maps/assets/{lib-d3-zoom-gQh2osrj.js.map → lib-d3-zoom-BF7SPKNh.js.map} +1 -1
  158. package/dist/shell-source-maps/assets/{lib-vis.gl-react-maplibre-CU7gWYjg.js.map → lib-vis.gl-react-maplibre-C7-0xNFC.js.map} +1 -1
  159. package/dist/shell-source-maps/assets/{lib-xyflow-react-DGg_5r7u.js.map → lib-xyflow-react-CKyW7szC.js.map} +1 -1
  160. package/dist/shell-source-maps/assets/{maplibre-Y7X50Jfk.js.map → maplibre-9ViQO48S.js.map} +1 -1
  161. package/dist/shell-source-maps/assets/{markdown-content-DHKbAJjx.js.map → markdown-content-DTB9RQDs.js.map} +1 -1
  162. package/dist/shell-source-maps/assets/{record-map-nGRmsk6x.js.map → record-map-CVqCWtfe.js.map} +1 -1
  163. package/dist/shell-source-maps/assets/{records-map-D2flyaz3.js.map → records-map-ClYSxrVR.js.map} +1 -1
  164. package/dist/shell-source-maps/assets/{run-trace-view-DfrAPeum.js.map → run-trace-view-CN16MiXg.js.map} +1 -1
  165. package/dist/shell-source-maps/assets/{search-picker-CJcJetBh.js.map → search-picker-BGpvJQRD.js.map} +1 -1
  166. package/dist/shell-source-maps/assets/shared-protobase-ui-BC8LqGQB.js.map +1 -0
  167. package/dist/shell-source-maps/assets/{step-catalog-ZvQOXfSh.js.map → step-catalog-CZY0ZpCC.js.map} +1 -1
  168. package/dist/shell-source-maps/assets/{step-panel-B1yHz7OC.js.map → step-panel-DhD80lsJ.js.map} +1 -1
  169. package/dist/shell-source-maps/assets/{use-app-address-B6k3dkV0.js.map → use-app-address-B4Uk3nWy.js.map} +1 -1
  170. package/dist/shell-source-maps/assets/{use-meta-BqEqOLNe.js.map → use-meta-D5kYywHm.js.map} +1 -1
  171. package/dist/shell-source-maps/assets/{use-sibling-page-CiuiG-Tz.js.map → use-sibling-page-BJ81HcOP.js.map} +1 -1
  172. package/dist/shell-source-maps/assets/{value-badge-BKLV4otJ.js.map → value-badge-Dpd8dRqq.js.map} +1 -1
  173. package/dist/shell-source-maps/assets/{vendor-WWp_xlp2.js.map → vendor-3etemhgS.js.map} +1 -1
  174. package/dist/shell-source-maps/assets/{workflow-canvas-DMP7SDWX.js.map → workflow-canvas-C1nGpi5w.js.map} +1 -1
  175. package/dist/shell-source-maps/assets/{workflow-graph-editor-xpV8_qEl.js.map → workflow-graph-editor-DAJa4lq6.js.map} +1 -1
  176. package/dist/shell-source-maps/assets/{workflow-workbench-Djdd_ODh.js.map → workflow-workbench-HramVZEJ.js.map} +1 -1
  177. package/dist/shell-source-maps/assets/{workflows-Bku4o2su.js.map → workflows-DlvOln9v.js.map} +1 -1
  178. package/dist/shell-source-maps/assets/{workflows-start-kl7rSSay.js.map → workflows-start-QUKfwFqf.js.map} +1 -1
  179. package/dist/status/messages.d.ts +2 -2
  180. package/dist/styles.css +14 -0
  181. package/dist/users/messages.d.ts +2 -2
  182. package/package.json +5 -5
  183. package/dist/app/hold-start-for-first-loads.d.ts +0 -12
  184. package/dist/app/hold-start-for-first-loads.js +0 -43
  185. package/dist/shell/assets/api-provider-CcDtTh0D.js +0 -2
  186. package/dist/shell/assets/app-DG30qs8Q.js +0 -16
  187. package/dist/shell/assets/badge-ChHXC28D.js +0 -2
  188. package/dist/shell/assets/checkbox-COOOlJPG.js +0 -2
  189. package/dist/shell/assets/display-value-fDiKbfJO.js +0 -2
  190. package/dist/shell/assets/index-BkCaPeOq.css +0 -2
  191. package/dist/shell/assets/index-CZ013UoE.js +0 -2
  192. package/dist/shell/assets/maplibre-Y7X50Jfk.js +0 -2
  193. package/dist/shell/assets/messages-ClKBpZlk.js +0 -2
  194. package/dist/shell/assets/search-picker-CJcJetBh.js +0 -2
  195. package/dist/shell/assets/shared-protobase-ui-CVwqj5Cp.js +0 -2
  196. package/dist/shell/assets/step-catalog-ZvQOXfSh.js +0 -2
  197. package/dist/shell/assets/step-panel-B1yHz7OC.js +0 -2
  198. package/dist/shell/assets/use-app-address-B6k3dkV0.js +0 -2
  199. package/dist/shell/assets/value-badge-BKLV4otJ.js +0 -2
  200. package/dist/shell/assets/workflow-workbench-Djdd_ODh.js +0 -4
  201. package/dist/shell-source-maps/assets/api-provider-CcDtTh0D.js.map +0 -1
  202. package/dist/shell-source-maps/assets/app-DG30qs8Q.js.map +0 -1
  203. package/dist/shell-source-maps/assets/display-value-fDiKbfJO.js.map +0 -1
  204. package/dist/shell-source-maps/assets/index-CZ013UoE.js.map +0 -1
  205. package/dist/shell-source-maps/assets/messages-ClKBpZlk.js.map +0 -1
  206. package/dist/shell-source-maps/assets/shared-protobase-ui-CVwqj5Cp.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"mappings":";6nBAGaA,EAAAC,EAA2B,cAAc,IAAI,EA8B1D,SAAgBC,GAAS,CACrB,IAAMC,GAAA,EAAOC,cAAWJ,CAAkB,CAAC,EAAE,KACvCK,GAAA,EAAaD,cAAWE,CAAU,EAIxC,SAHwBC,gBACb,CAAE,GAAGJ,EAAM,QAASE,GAAY,GAAI,GAC5C,CAACF,EAAME,CAAU,CACC,CACzB,CClCA,SAAgBG,EAAe,EAAG,EAAG,CACjC,IAAMC,EAAK,MAAM,QAAQC,CAAC,EAAIA,EAAE,GAAKA,EAAIA,EAAE,EAAI,EACzCC,EAAK,MAAM,QAAQD,CAAC,EAAIA,EAAE,GAAKA,EAAIA,EAAE,EAAI,EACzCE,EAAK,MAAM,QAAQC,CAAC,EAAIA,EAAE,GAAKA,EAAIA,EAAE,EAAI,EACzCC,EAAK,MAAM,QAAQD,CAAC,EAA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ACjD1J,EAAI,YAAY0J,CAAE,CAE1B,CACJ,CAEJ,EAAG,CAAC1J,CAAG,CAAC,EAEMA,GAAOA,EAAI,OAASA,EAAI,SAAS0J,CAAE,EAE7C,GAAI,CACAe,EAAYzK,EAAK0J,EAAIrJ,EAAO6J,EAAS,OAAO,CAChD,OACO/E,EAAO,CACV,QAAQ,KAAKA,CAAK,CACtB,MAGA+F,EAAYlL,EAAK0J,EAAIrJ,CAAK,EAI9B,MADA,GAAS,QAAUA,EACZ,IACX","names":["MountedMapsContext","import_react","useMap","maps","useContext","currentMap","MapContext","useMemo","arePointsEqual","ax","a","ay","bx","b","by","deepEqual","i","aKeys","bKeys","key","getTransformLike","map","transformToViewState","tr","applyViewStateToTransform","v","props","changes","LngLat","updateConstraint","nextRange","currentRange","setMax","setMin","updateZoomConstraint","updatePitchConstraint","refProps","normalizeStyle","style","layerIndex","layer","layers","normalizedLayer","layerRef","propName","DEFAULT_STYLE","DEFAULT_SETTINGS","pointerEvents","cameraEvents","otherEvents","settingNames","handlerNames","Maplibre","cb","MapClass","container","oldProps","settingsChanged","sizeChanged","viewStateChanged","that","oldContainer","resizeObserver","initialViewState","mapOptions","mapStyle","viewState","getContext","mapWithCameraUpdate","eventName","nextProps","canvas","didUpdateZoom","currProps","didUpdatePitch","nextValue","constraintsChanged","options","styleDiffing","light","projection","sky","terrain","newValue","point","interactiveLayerIds","eventType","wasHovering","features","isHovering","skipMethods","createRef","mapInstance","result","getMethodNames","proto","obj","useIsomorphicLayoutEffect","useLayoutEffect","useEffect","setGlobals","RTLTextPlugin","mapLib","pluginUrl","error","lazy","maxParallelImageRequests","workerCount","workerUrl","_Map","mountedMapsContext","setMapInstance","useState","containerRef","useRef","contextValue","isMounted","maplibre","__vitePreload","n","module","mapboxgl","onError","ref","Map","unitlessNumber","applyReactStyle","element","styles","value","compareClassNames","prevClassName","nextClassName","prevClassList","getClassList","nextClassList","diff","c","className","Marker","memo","forwardRef","thisRef","marker","hasChildren","el","mk","evt","longitude","latitude","offset","draggable","rotation","rotationAlignment","pitchAlignment","popup","classNameDiff","createPortal","useControl","context","ctrl","onCreate","opts","arg3","arg2","arg1","onAdd","onRemove","_NavigationControl","NavigationControl","assert","condition","message","sourceCounter","createSource","id","updateSource","prevProps","changedKey","changedKeyCount","type","source","Source","propsRef","setStyleLoaded","forceUpdate","version","allLayers","child","cloneElement","updateLayer","beforeId","layout","prevLayout","paint","prevPaint","filter","minzoom","maxzoom","createLayer","layerCounter","Layer"],"ignoreList":[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16],"sources":["../../../../../node_modules/.bun/@vis.gl+react-maplibre@8.1.3+469c9e9bb8e20606/node_modules/@vis.gl/react-maplibre/dist/components/use-map.js","../../../../../node_modules/.bun/@vis.gl+react-maplibre@8.1.3+469c9e9bb8e20606/node_modules/@vis.gl/react-maplibre/dist/utils/deep-equal.js","../../../../../node_modules/.bun/@vis.gl+react-maplibre@8.1.3+469c9e9bb8e20606/node_modules/@vis.gl/react-maplibre/dist/utils/transform.js","../../../../../node_modules/.bun/@vis.gl+react-maplibre@8.1.3+469c9e9bb8e20606/node_modules/@vis.gl/react-maplibre/dist/utils/style-utils.js","../../../../../node_modules/.bun/@vis.gl+react-maplibre@8.1.3+469c9e9bb8e20606/node_modules/@vis.gl/react-maplibre/dist/maplibre/maplibre.js","../../../../../node_modules/.bun/@vis.gl+react-maplibre@8.1.3+469c9e9bb8e20606/node_modules/@vis.gl/react-maplibre/dist/maplibre/create-ref.js","../../../../../node_modules/.bun/@vis.gl+react-maplibre@8.1.3+469c9e9bb8e20606/node_modules/@vis.gl/react-maplibre/dist/utils/use-isomorphic-layout-effect.js","../../../../../node_modules/.bun/@vis.gl+react-maplibre@8.1.3+469c9e9bb8e20606/node_modules/@vis.gl/react-maplibre/dist/utils/set-globals.js","../../../../../node_modules/.bun/@vis.gl+react-maplibre@8.1.3+469c9e9bb8e20606/node_modules/@vis.gl/react-maplibre/dist/components/map.js","../../../../../node_modules/.bun/@vis.gl+react-maplibre@8.1.3+469c9e9bb8e20606/node_modules/@vis.gl/react-maplibre/dist/utils/apply-react-style.js","../../../../../node_modules/.bun/@vis.gl+react-maplibre@8.1.3+469c9e9bb8e20606/node_modules/@vis.gl/react-maplibre/dist/utils/compare-class-names.js","../../../../../node_modules/.bun/@vis.gl+react-maplibre@8.1.3+469c9e9bb8e20606/node_modules/@vis.gl/react-maplibre/dist/components/marker.js","../../../../../node_modules/.bun/@vis.gl+react-maplibre@8.1.3+469c9e9bb8e20606/node_modules/@vis.gl/react-maplibre/dist/components/use-control.js","../../../../../node_modules/.bun/@vis.gl+react-maplibre@8.1.3+469c9e9bb8e20606/node_modules/@vis.gl/react-maplibre/dist/components/navigation-control.js","../../../../../node_modules/.bun/@vis.gl+react-maplibre@8.1.3+469c9e9bb8e20606/node_modules/@vis.gl/react-maplibre/dist/utils/assert.js","../../../../../node_modules/.bun/@vis.gl+react-maplibre@8.1.3+469c9e9bb8e20606/node_modules/@vis.gl/react-maplibre/dist/components/source.js","../../../../../node_modules/.bun/@vis.gl+react-maplibre@8.1.3+469c9e9bb8e20606/node_modules/@vis.gl/react-maplibre/dist/components/layer.js"],"sourcesContent":["import * as React from 'react';\nimport { useState, useCallback, useMemo, useContext } from 'react';\nimport { MapContext } from \"./map.js\";\nexport const MountedMapsContext = React.createContext(null);\nexport const MapProvider = props => {\n const [maps, setMaps] = useState({});\n const onMapMount = useCallback((map, id = 'default') => {\n setMaps(currMaps => {\n if (id === 'current') {\n throw new Error(\"'current' cannot be used as map id\");\n }\n if (currMaps[id]) {\n throw new Error(`Multiple maps with the same id: ${id}`);\n }\n return { ...currMaps, [id]: map };\n });\n }, []);\n const onMapUnmount = useCallback((id = 'default') => {\n setMaps(currMaps => {\n if (currMaps[id]) {\n const nextMaps = { ...currMaps };\n delete nextMaps[id];\n return nextMaps;\n }\n return currMaps;\n });\n }, []);\n return (React.createElement(MountedMapsContext.Provider, { value: {\n maps,\n onMapMount,\n onMapUnmount\n } }, props.children));\n};\nexport function useMap() {\n const maps = useContext(MountedMapsContext)?.maps;\n const currentMap = useContext(MapContext);\n const mapsWithCurrent = useMemo(() => {\n return { ...maps, current: currentMap?.map };\n }, [maps, currentMap]);\n return mapsWithCurrent;\n}\n//# sourceMappingURL=use-map.js.map","/**\n * Compare two points\n * @param a\n * @param b\n * @returns true if the points are equal\n */\nexport function arePointsEqual(a, b) {\n const ax = Array.isArray(a) ? a[0] : a ? a.x : 0;\n const ay = Array.isArray(a) ? a[1] : a ? a.y : 0;\n const bx = Array.isArray(b) ? b[0] : b ? b.x : 0;\n const by = Array.isArray(b) ? b[1] : b ? b.y : 0;\n return ax === bx && ay === by;\n}\n/* eslint-disable complexity */\n/**\n * Compare any two objects\n * @param a\n * @param b\n * @returns true if the objects are deep equal\n */\nexport function deepEqual(a, b) {\n if (a === b) {\n return true;\n }\n if (!a || !b) {\n return false;\n }\n if (Array.isArray(a)) {\n if (!Array.isArray(b) || a.length !== b.length) {\n return false;\n }\n for (let i = 0; i < a.length; i++) {\n if (!deepEqual(a[i], b[i])) {\n return false;\n }\n }\n return true;\n }\n else if (Array.isArray(b)) {\n return false;\n }\n if (typeof a === 'object' && typeof b === 'object') {\n const aKeys = Object.keys(a);\n const bKeys = Object.keys(b);\n if (aKeys.length !== bKeys.length) {\n return false;\n }\n for (const key of aKeys) {\n if (!b.hasOwnProperty(key)) {\n return false;\n }\n if (!deepEqual(a[key], b[key])) {\n return false;\n }\n }\n return true;\n }\n return false;\n}\n//# sourceMappingURL=deep-equal.js.map","import { deepEqual } from \"./deep-equal.js\";\n/**\n * maplibre-gl v6 removed the public `map.transform` property in favor of\n * discrete getters. Reconstruct a TransformLike snapshot from those getters\n * so it works across maplibre-gl v4/v5/v6.\n */\nexport function getTransformLike(map) {\n return {\n center: map.getCenter(),\n zoom: map.getZoom(),\n bearing: map.getBearing(),\n pitch: map.getPitch(),\n // @ts-ignore getCenterElevation does not exist before v5.0.0\n elevation: map.getCenterElevation?.() ?? 0,\n padding: map.getPadding()\n };\n}\n/**\n * Capture a transform's current state\n * @param transform\n * @returns descriptor of the view state\n */\nexport function transformToViewState(tr) {\n return {\n longitude: tr.center.lng,\n latitude: tr.center.lat,\n zoom: tr.zoom,\n pitch: tr.pitch,\n bearing: tr.bearing,\n padding: tr.padding\n };\n}\n/* eslint-disable complexity */\n/**\n * Applies requested view state to a transform\n * @returns an object containing detected changes\n */\nexport function applyViewStateToTransform(\n/** An object that describes Maplibre's camera state */\ntr, \n/** Props from Map component */\nprops) {\n const v = props.viewState || props;\n const changes = {};\n if ('longitude' in v &&\n 'latitude' in v &&\n (v.longitude !== tr.center.lng || v.latitude !== tr.center.lat)) {\n const LngLat = tr.center.constructor;\n // @ts-expect-error we should not import LngLat class from maplibre-gl because we don't know the source of mapLib\n changes.center = new LngLat(v.longitude, v.latitude);\n }\n if ('zoom' in v && v.zoom !== tr.zoom) {\n changes.zoom = v.zoom;\n }\n if ('bearing' in v && v.bearing !== tr.bearing) {\n changes.bearing = v.bearing;\n }\n if ('pitch' in v && v.pitch !== tr.pitch) {\n changes.pitch = v.pitch;\n }\n if (v.padding && tr.padding && !deepEqual(v.padding, tr.padding)) {\n changes.padding = v.padding;\n }\n return changes;\n}\n/**\n * Update a min/max constraint pair in the right order to avoid\n * temporarily setting min > max (which maplibre rejects).\n * @param nextRange - the desired constraint range\n * @param currentRange - the current constraint range\n * @param setMin - setter for the minimum value\n * @param setMax - setter for the maximum value\n */\nfunction updateConstraint(nextRange, currentRange, setMin, setMax) {\n if (nextRange.min === currentRange.min && nextRange.max === currentRange.max) {\n return false;\n }\n // When moving up (min increasing), update max first to make room\n if (nextRange.min >= currentRange.min) {\n if (nextRange.max !== currentRange.max) {\n setMax(nextRange.max);\n }\n if (nextRange.min !== currentRange.min) {\n setMin(nextRange.min);\n }\n }\n else {\n // When moving down (min decreasing), update min first to make room\n if (nextRange.min !== currentRange.min) {\n setMin(nextRange.min);\n }\n if (nextRange.max !== currentRange.max) {\n setMax(nextRange.max);\n }\n }\n return true;\n}\nexport function updateZoomConstraint(map, nextRange, currentRange) {\n return updateConstraint(nextRange, currentRange, v => map.setMinZoom(v), v => map.setMaxZoom(v));\n}\nexport function updatePitchConstraint(map, nextRange, currentRange) {\n return updateConstraint(nextRange, currentRange, v => map.setMinPitch(v), v => map.setMaxPitch(v));\n}\n//# sourceMappingURL=transform.js.map","const refProps = ['type', 'source', 'source-layer', 'minzoom', 'maxzoom', 'filter', 'layout'];\n// Prepare a map style object for diffing\n// If immutable - convert to plain object\n// Work around some issues in older styles that would fail Mapbox's diffing\nexport function normalizeStyle(style) {\n if (!style) {\n return null;\n }\n if (typeof style === 'string') {\n return style;\n }\n if ('toJS' in style) {\n style = style.toJS();\n }\n if (!style.layers) {\n return style;\n }\n const layerIndex = {};\n for (const layer of style.layers) {\n layerIndex[layer.id] = layer;\n }\n const layers = style.layers.map(layer => {\n let normalizedLayer = null;\n if ('interactive' in layer) {\n normalizedLayer = Object.assign({}, layer);\n // Breaks style diffing :(\n // @ts-ignore legacy field not typed\n delete normalizedLayer.interactive;\n }\n // Style diffing doesn't work with refs so expand them out manually before diffing.\n // @ts-ignore legacy field not typed\n const layerRef = layerIndex[layer.ref];\n if (layerRef) {\n normalizedLayer = normalizedLayer || Object.assign({}, layer);\n // @ts-ignore\n delete normalizedLayer.ref;\n // https://github.com/mapbox/mapbox-gl-js/blob/master/src/style-spec/deref.js\n for (const propName of refProps) {\n if (propName in layerRef) {\n normalizedLayer[propName] = layerRef[propName];\n }\n }\n }\n return normalizedLayer || layer;\n });\n // Do not mutate the style object provided by the user\n return { ...style, layers };\n}\n//# sourceMappingURL=style-utils.js.map","import { transformToViewState, applyViewStateToTransform, getTransformLike, updateZoomConstraint, updatePitchConstraint } from \"../utils/transform.js\";\nimport { normalizeStyle } from \"../utils/style-utils.js\";\nimport { deepEqual } from \"../utils/deep-equal.js\";\nconst DEFAULT_STYLE = { version: 8, sources: {}, layers: [] };\nconst DEFAULT_SETTINGS = {\n minZoom: 0,\n maxZoom: 22,\n minPitch: 0,\n maxPitch: 85,\n maxBounds: [-180, -85.051129, 180, 85.051129],\n projection: 'mercator',\n renderWorldCopies: true\n};\nconst pointerEvents = {\n mousedown: 'onMouseDown',\n mouseup: 'onMouseUp',\n mouseover: 'onMouseOver',\n mousemove: 'onMouseMove',\n click: 'onClick',\n dblclick: 'onDblClick',\n mouseenter: 'onMouseEnter',\n mouseleave: 'onMouseLeave',\n mouseout: 'onMouseOut',\n contextmenu: 'onContextMenu',\n touchstart: 'onTouchStart',\n touchend: 'onTouchEnd',\n touchmove: 'onTouchMove',\n touchcancel: 'onTouchCancel'\n};\nconst cameraEvents = {\n movestart: 'onMoveStart',\n move: 'onMove',\n moveend: 'onMoveEnd',\n dragstart: 'onDragStart',\n drag: 'onDrag',\n dragend: 'onDragEnd',\n zoomstart: 'onZoomStart',\n zoom: 'onZoom',\n zoomend: 'onZoomEnd',\n rotatestart: 'onRotateStart',\n rotate: 'onRotate',\n rotateend: 'onRotateEnd',\n pitchstart: 'onPitchStart',\n pitch: 'onPitch',\n pitchend: 'onPitchEnd'\n};\nconst otherEvents = {\n wheel: 'onWheel',\n boxzoomstart: 'onBoxZoomStart',\n boxzoomend: 'onBoxZoomEnd',\n boxzoomcancel: 'onBoxZoomCancel',\n resize: 'onResize',\n load: 'onLoad',\n render: 'onRender',\n idle: 'onIdle',\n remove: 'onRemove',\n data: 'onData',\n styledata: 'onStyleData',\n sourcedata: 'onSourceData',\n error: 'onError'\n};\nconst settingNames = ['maxBounds', 'projection', 'renderWorldCopies'];\nconst handlerNames = [\n 'scrollZoom',\n 'boxZoom',\n 'dragRotate',\n 'dragPan',\n 'keyboard',\n 'doubleClickZoom',\n 'touchZoomRotate',\n 'touchPitch'\n];\n/**\n * A wrapper for mapbox-gl's Map class\n */\nclass Maplibre {\n constructor(MapClass, props, container) {\n // mapboxgl.Map instance\n this._map = null;\n // Internal states\n this._internalUpdate = false;\n this._hoveredFeatures = null;\n this._propsedCameraUpdate = null;\n this._styleComponents = {};\n this._onEvent = (e) => {\n // @ts-ignore\n const cb = this.props[otherEvents[e.type]];\n if (cb) {\n cb(e);\n }\n else if (e.type === 'error') {\n console.error(e.error); // eslint-disable-line\n }\n };\n this._onCameraEvent = (e) => {\n if (this._internalUpdate) {\n return;\n }\n e.viewState = this._propsedCameraUpdate || transformToViewState(getTransformLike(this._map));\n // @ts-ignore\n const cb = this.props[cameraEvents[e.type]];\n if (cb) {\n cb(e);\n }\n };\n this._onCameraUpdate = (tr) => {\n if (this._internalUpdate) {\n return tr;\n }\n this._propsedCameraUpdate = transformToViewState(tr);\n return applyViewStateToTransform(tr, this.props);\n };\n this._onPointerEvent = (e) => {\n if (e.type === 'mousemove' || e.type === 'mouseout') {\n this._updateHover(e);\n }\n // @ts-ignore\n const cb = this.props[pointerEvents[e.type]];\n if (cb) {\n if (this.props.interactiveLayerIds && e.type !== 'mouseover' && e.type !== 'mouseout') {\n e.features = this._hoveredFeatures || this._queryRenderedFeatures(e.point);\n }\n cb(e);\n delete e.features;\n }\n };\n this._MapClass = MapClass;\n this.props = props;\n this._initialize(container);\n }\n get map() {\n return this._map;\n }\n setProps(props) {\n const oldProps = this.props;\n this.props = props;\n const settingsChanged = this._updateSettings(props, oldProps);\n const sizeChanged = this._updateSize(props);\n const viewStateChanged = this._updateViewState(props);\n this._updateStyle(props, oldProps);\n this._updateStyleComponents(props);\n this._updateHandlers(props, oldProps);\n // If 1) view state has changed to match props and\n // 2) the props change is not triggered by map events,\n // it's driven by an external state change. Redraw immediately\n if (settingsChanged || sizeChanged || (viewStateChanged && !this._map.isMoving())) {\n this.redraw();\n }\n }\n static reuse(props, container) {\n const that = Maplibre.savedMaps.pop();\n if (!that) {\n return null;\n }\n const map = that.map;\n // When reusing the saved map, we need to reparent the map(canvas) and other child nodes\n // intoto the new container from the props.\n // Step 1: reparenting child nodes from old container to new container\n const oldContainer = map.getContainer();\n container.className = oldContainer.className;\n while (oldContainer.childNodes.length > 0) {\n container.appendChild(oldContainer.childNodes[0]);\n }\n // Step 2: replace the internal container with new container from the react component\n // @ts-ignore\n map._container = container;\n // With maplibre-gl as mapLib, map uses ResizeObserver to observe when its container resizes.\n // When reusing the saved map, we need to disconnect the observer and observe the new container.\n // Step 3: telling the ResizeObserver to disconnect and observe the new container\n // @ts-ignore\n const resizeObserver = map._resizeObserver;\n if (resizeObserver) {\n resizeObserver.disconnect();\n resizeObserver.observe(container);\n }\n // Step 4: apply new props\n that.setProps({ ...props, styleDiffing: false });\n map.resize();\n const { initialViewState } = props;\n if (initialViewState) {\n if (initialViewState.bounds) {\n map.fitBounds(initialViewState.bounds, { ...initialViewState.fitBoundsOptions, duration: 0 });\n }\n else {\n that._updateViewState(initialViewState);\n }\n }\n // Simulate load event\n if (map.isStyleLoaded()) {\n map.fire('load');\n }\n else {\n map.once('style.load', () => map.fire('load'));\n }\n // Force reload\n // @ts-ignore\n map._update();\n return that;\n }\n /* eslint-disable complexity,max-statements */\n _initialize(container) {\n const { props } = this;\n const { mapStyle = DEFAULT_STYLE } = props;\n const mapOptions = {\n ...props,\n ...props.initialViewState,\n container,\n style: normalizeStyle(mapStyle)\n };\n const viewState = mapOptions.initialViewState || mapOptions.viewState || mapOptions;\n Object.assign(mapOptions, {\n center: [viewState.longitude || 0, viewState.latitude || 0],\n zoom: viewState.zoom || 0,\n pitch: viewState.pitch || 0,\n bearing: viewState.bearing || 0\n });\n if (props.gl) {\n // eslint-disable-next-line\n const getContext = HTMLCanvasElement.prototype.getContext;\n // Hijack canvas.getContext to return our own WebGLContext\n // This will be called inside the mapboxgl.Map constructor\n // @ts-expect-error\n HTMLCanvasElement.prototype.getContext = () => {\n // Unhijack immediately\n HTMLCanvasElement.prototype.getContext = getContext;\n return props.gl;\n };\n }\n const map = new this._MapClass(mapOptions);\n // Props that are not part of constructor options\n if (viewState.padding) {\n map.setPadding(viewState.padding);\n }\n if (props.cursor) {\n map.getCanvas().style.cursor = props.cursor;\n }\n // add listeners\n const mapWithCameraUpdate = map;\n if (typeof mapWithCameraUpdate.setTransformCameraUpdate === 'function') {\n // maplibre-gl v6+\n mapWithCameraUpdate.setTransformCameraUpdate(this._onCameraUpdate);\n }\n else {\n mapWithCameraUpdate.transformCameraUpdate = this._onCameraUpdate;\n }\n map.on('style.load', () => {\n // Map style has changed, this would have wiped out all settings from props\n this._styleComponents = {\n light: map.getLight(),\n sky: map.getSky(),\n // @ts-ignore getProjection() does not exist in v4\n projection: map.getProjection?.(),\n terrain: map.getTerrain()\n };\n this._updateStyleComponents(this.props);\n });\n map.on('sourcedata', () => {\n // Some sources have loaded, we may need them to attach terrain\n this._updateStyleComponents(this.props);\n });\n for (const eventName in pointerEvents) {\n map.on(eventName, this._onPointerEvent);\n }\n for (const eventName in cameraEvents) {\n map.on(eventName, this._onCameraEvent);\n }\n for (const eventName in otherEvents) {\n map.on(eventName, this._onEvent);\n }\n this._map = map;\n }\n /* eslint-enable complexity,max-statements */\n recycle() {\n // Clean up unnecessary elements before storing for reuse.\n const container = this.map.getContainer();\n const children = container.querySelector('[mapboxgl-children]');\n children?.remove();\n Maplibre.savedMaps.push(this);\n }\n destroy() {\n this._map.remove();\n }\n // Force redraw the map now. Typically resize() and jumpTo() is reflected in the next\n // render cycle, which is managed by Mapbox's animation loop.\n // This removes the synchronization issue caused by requestAnimationFrame.\n redraw() {\n const map = this._map;\n // map._render will throw error if style does not exist\n // https://github.com/mapbox/mapbox-gl-js/blob/fb9fc316da14e99ff4368f3e4faa3888fb43c513\n // /src/ui/map.js#L1834\n if (map.style) {\n // cancel the scheduled update\n if (map._frame) {\n map._frame.cancel();\n map._frame = null;\n }\n // the order is important - render() may schedule another update\n map._render();\n }\n }\n /* Trigger map resize if size is controlled\n @param {object} nextProps\n @returns {bool} true if size has changed\n */\n _updateSize(nextProps) {\n // Check if size is controlled\n const { viewState } = nextProps;\n if (viewState) {\n const map = this._map;\n const canvas = map.getCanvas();\n if (viewState.width !== canvas.clientWidth || viewState.height !== canvas.clientHeight) {\n map.resize();\n return true;\n }\n }\n return false;\n }\n // Adapted from map.jumpTo\n /* Update camera to match props\n @param {object} nextProps\n @param {bool} triggerEvents - should fire camera events\n @returns {bool} true if anything is changed\n */\n _updateViewState(nextProps) {\n const map = this._map;\n const tr = getTransformLike(map);\n const isMoving = map.isMoving();\n // Avoid manipulating the real transform when interaction/animation is ongoing\n // as it would interfere with Mapbox's handlers\n if (!isMoving) {\n const changes = applyViewStateToTransform(tr, nextProps);\n if (Object.keys(changes).length > 0) {\n this._internalUpdate = true;\n map.jumpTo(changes);\n this._internalUpdate = false;\n return true;\n }\n }\n return false;\n }\n /* Update camera constraints to match props\n @param {object} nextProps\n @param {object} currProps\n @returns {bool} true if anything is changed\n */\n _updateConstraints(nextProps, currProps) {\n const didUpdateZoom = updateZoomConstraint(this._map, {\n min: nextProps.minZoom ?? DEFAULT_SETTINGS.minZoom,\n max: nextProps.maxZoom ?? DEFAULT_SETTINGS.maxZoom\n }, {\n min: currProps.minZoom ?? DEFAULT_SETTINGS.minZoom,\n max: currProps.maxZoom ?? DEFAULT_SETTINGS.maxZoom\n });\n const didUpdatePitch = updatePitchConstraint(this._map, {\n min: nextProps.minPitch ?? DEFAULT_SETTINGS.minPitch,\n max: nextProps.maxPitch ?? DEFAULT_SETTINGS.maxPitch\n }, {\n min: currProps.minPitch ?? DEFAULT_SETTINGS.minPitch,\n max: currProps.maxPitch ?? DEFAULT_SETTINGS.maxPitch\n });\n return didUpdateZoom || didUpdatePitch;\n }\n /* Update camera constraints and projection settings to match props\n @param {object} nextProps\n @param {object} currProps\n @returns {bool} true if anything is changed\n */\n _updateSettings(nextProps, currProps) {\n const map = this._map;\n let settingsChanged = false;\n for (const propName of settingNames) {\n const propPresent = propName in nextProps || propName in currProps;\n if (propPresent && !deepEqual(nextProps[propName], currProps[propName])) {\n settingsChanged = true;\n const nextValue = propName in nextProps ? nextProps[propName] : DEFAULT_SETTINGS[propName];\n const setter = map[`set${propName[0].toUpperCase()}${propName.slice(1)}`];\n setter?.call(map, nextValue);\n }\n }\n const constraintsChanged = this._updateConstraints(nextProps, currProps);\n return settingsChanged || constraintsChanged;\n }\n /* Update map style to match props */\n _updateStyle(nextProps, currProps) {\n if (nextProps.cursor !== currProps.cursor) {\n this._map.getCanvas().style.cursor = nextProps.cursor || '';\n }\n if (nextProps.mapStyle !== currProps.mapStyle) {\n const { mapStyle = DEFAULT_STYLE, styleDiffing = true } = nextProps;\n const options = {\n diff: styleDiffing\n };\n if ('localIdeographFontFamily' in nextProps) {\n // @ts-ignore Mapbox specific prop\n options.localIdeographFontFamily = nextProps.localIdeographFontFamily;\n }\n this._map.setStyle(normalizeStyle(mapStyle), options);\n }\n }\n /* Update fog, light, projection and terrain to match props\n * These props are special because\n * 1. They can not be applied right away. Certain conditions (style loaded, source loaded, etc.) must be met\n * 2. They can be overwritten by mapStyle\n */\n _updateStyleComponents({ light, projection, sky, terrain }) {\n const map = this._map;\n const currProps = this._styleComponents;\n // We can safely manipulate map style once it's loaded\n if (map.style?._loaded) {\n if (light && !deepEqual(light, currProps.light)) {\n currProps.light = light;\n map.setLight(light);\n }\n if (projection &&\n !deepEqual(projection, currProps.projection) &&\n projection !== currProps.projection?.type) {\n currProps.projection = typeof projection === 'string' ? { type: projection } : projection;\n // @ts-ignore setProjection does not exist in v4\n map.setProjection?.(currProps.projection);\n }\n if (sky && !deepEqual(sky, currProps.sky)) {\n currProps.sky = sky;\n map.setSky(sky);\n }\n if (terrain !== undefined && !deepEqual(terrain, currProps.terrain)) {\n if (!terrain || map.getSource(terrain.source)) {\n currProps.terrain = terrain;\n map.setTerrain(terrain);\n }\n }\n }\n }\n /* Update interaction handlers to match props */\n _updateHandlers(nextProps, currProps) {\n const map = this._map;\n for (const propName of handlerNames) {\n const newValue = nextProps[propName] ?? true;\n const oldValue = currProps[propName] ?? true;\n if (!deepEqual(newValue, oldValue)) {\n if (newValue) {\n map[propName].enable(newValue);\n }\n else {\n map[propName].disable();\n }\n }\n }\n }\n _queryRenderedFeatures(point) {\n const map = this._map;\n const { interactiveLayerIds = [] } = this.props;\n try {\n return map.queryRenderedFeatures(point, {\n layers: interactiveLayerIds.filter(map.getLayer.bind(map))\n });\n }\n catch {\n // May fail if style is not loaded\n return [];\n }\n }\n _updateHover(e) {\n const { props } = this;\n const shouldTrackHoveredFeatures = props.interactiveLayerIds && (props.onMouseMove || props.onMouseEnter || props.onMouseLeave);\n if (shouldTrackHoveredFeatures) {\n const eventType = e.type;\n const wasHovering = this._hoveredFeatures?.length > 0;\n const features = this._queryRenderedFeatures(e.point);\n const isHovering = features.length > 0;\n if (!isHovering && wasHovering) {\n e.type = 'mouseleave';\n this._onPointerEvent(e);\n }\n this._hoveredFeatures = features;\n if (isHovering && !wasHovering) {\n e.type = 'mouseenter';\n this._onPointerEvent(e);\n }\n e.type = eventType;\n }\n else {\n this._hoveredFeatures = null;\n }\n }\n}\nMaplibre.savedMaps = [];\nexport default Maplibre;\n//# sourceMappingURL=maplibre.js.map","/** These methods may break the react binding if called directly */\nconst skipMethods = [\n 'setMaxBounds',\n 'setMinZoom',\n 'setMaxZoom',\n 'setMinPitch',\n 'setMaxPitch',\n 'setRenderWorldCopies',\n 'setProjection',\n 'setStyle',\n 'addSource',\n 'removeSource',\n 'addLayer',\n 'removeLayer',\n 'setLayerZoomRange',\n 'setFilter',\n 'setPaintProperty',\n 'setLayoutProperty',\n 'setLight',\n 'setTerrain',\n 'setFog',\n 'remove'\n];\nexport default function createRef(mapInstance) {\n if (!mapInstance) {\n return null;\n }\n const map = mapInstance.map;\n const result = {\n getMap: () => map\n };\n for (const key of getMethodNames(map)) {\n // @ts-expect-error\n if (!(key in result) && !skipMethods.includes(key)) {\n result[key] = map[key].bind(map);\n }\n }\n return result;\n}\nfunction getMethodNames(obj) {\n const result = new Set();\n let proto = obj;\n while (proto) {\n for (const key of Object.getOwnPropertyNames(proto)) {\n if (key[0] !== '_' &&\n typeof obj[key] === 'function' &&\n key !== 'fire' &&\n key !== 'setEventedParent') {\n result.add(key);\n }\n }\n proto = Object.getPrototypeOf(proto);\n }\n return Array.from(result);\n}\n//# sourceMappingURL=create-ref.js.map","// From https://github.com/streamich/react-use/blob/master/src/useIsomorphicLayoutEffect.ts\n// useLayoutEffect but does not trigger warning in server-side rendering\nimport { useEffect, useLayoutEffect } from 'react';\nconst useIsomorphicLayoutEffect = typeof document !== 'undefined' ? useLayoutEffect : useEffect;\nexport default useIsomorphicLayoutEffect;\n//# sourceMappingURL=use-isomorphic-layout-effect.js.map","export default function setGlobals(mapLib, props) {\n const { RTLTextPlugin, maxParallelImageRequests, workerCount, workerUrl } = props;\n if (RTLTextPlugin &&\n mapLib.getRTLTextPluginStatus &&\n mapLib.getRTLTextPluginStatus() === 'unavailable') {\n const { pluginUrl, lazy = true } = typeof RTLTextPlugin === 'string' ? { pluginUrl: RTLTextPlugin } : RTLTextPlugin;\n mapLib.setRTLTextPlugin(pluginUrl, (error) => {\n if (error) {\n // eslint-disable-next-line\n console.error(error);\n }\n }, lazy);\n }\n if (maxParallelImageRequests !== undefined) {\n mapLib.setMaxParallelImageRequests(maxParallelImageRequests);\n }\n if (workerCount !== undefined) {\n mapLib.setWorkerCount(workerCount);\n }\n if (workerUrl !== undefined) {\n mapLib.setWorkerUrl(workerUrl);\n }\n}\n//# sourceMappingURL=set-globals.js.map","import * as React from 'react';\nimport { useState, useRef, useEffect, useContext, useMemo, useImperativeHandle } from 'react';\nimport { MountedMapsContext } from \"./use-map.js\";\nimport Maplibre from \"../maplibre/maplibre.js\";\nimport createRef from \"../maplibre/create-ref.js\";\nimport useIsomorphicLayoutEffect from \"../utils/use-isomorphic-layout-effect.js\";\nimport setGlobals from \"../utils/set-globals.js\";\nexport const MapContext = React.createContext(null);\nfunction _Map(props, ref) {\n const mountedMapsContext = useContext(MountedMapsContext);\n const [mapInstance, setMapInstance] = useState(null);\n const containerRef = useRef();\n const { current: contextValue } = useRef({ mapLib: null, map: null });\n useEffect(() => {\n const mapLib = props.mapLib;\n let isMounted = true;\n let maplibre;\n Promise.resolve(mapLib || import('maplibre-gl'))\n .then((module) => {\n if (!isMounted) {\n return;\n }\n if (!module) {\n throw new Error('Invalid mapLib');\n }\n const mapboxgl = 'Map' in module ? module : module.default;\n if (!mapboxgl.Map) {\n throw new Error('Invalid mapLib');\n }\n setGlobals(mapboxgl, props);\n if (props.reuseMaps) {\n maplibre = Maplibre.reuse(props, containerRef.current);\n }\n if (!maplibre) {\n maplibre = new Maplibre(mapboxgl.Map, props, containerRef.current);\n }\n contextValue.map = createRef(maplibre);\n contextValue.mapLib = mapboxgl;\n setMapInstance(maplibre);\n mountedMapsContext?.onMapMount(contextValue.map, props.id);\n })\n .catch(error => {\n const { onError } = props;\n if (onError) {\n onError({\n type: 'error',\n target: null,\n originalEvent: null,\n error\n });\n }\n else {\n console.error(error); // eslint-disable-line\n }\n });\n return () => {\n isMounted = false;\n if (maplibre) {\n mountedMapsContext?.onMapUnmount(props.id);\n if (props.reuseMaps) {\n maplibre.recycle();\n }\n else {\n maplibre.destroy();\n }\n }\n };\n }, []);\n useIsomorphicLayoutEffect(() => {\n if (mapInstance) {\n mapInstance.setProps(props);\n }\n });\n useImperativeHandle(ref, () => contextValue.map, [mapInstance]);\n const style = useMemo(() => ({\n position: 'relative',\n width: '100%',\n height: '100%',\n ...props.style\n }), [props.style]);\n const CHILD_CONTAINER_STYLE = {\n height: '100%'\n };\n return (React.createElement(\"div\", { id: props.id, ref: containerRef, style: style }, mapInstance && (React.createElement(MapContext.Provider, { value: contextValue },\n React.createElement(\"div\", { \"mapboxgl-children\": \"\", style: CHILD_CONTAINER_STYLE }, props.children)))));\n}\nexport const Map = React.forwardRef(_Map);\n//# sourceMappingURL=map.js.map","// This is a simplified version of\n// https://github.com/facebook/react/blob/4131af3e4bf52f3a003537ec95a1655147c81270/src/renderers/dom/shared/CSSPropertyOperations.js#L62\nconst unitlessNumber = /box|flex|grid|column|lineHeight|fontWeight|opacity|order|tabSize|zIndex/;\nexport function applyReactStyle(element, styles) {\n if (!element || !styles) {\n return;\n }\n const style = element.style;\n for (const key in styles) {\n const value = styles[key];\n if (Number.isFinite(value) && !unitlessNumber.test(key)) {\n style[key] = `${value}px`;\n }\n else {\n style[key] = value;\n }\n }\n}\n//# sourceMappingURL=apply-react-style.js.map","/** Compare two classNames string and return the difference */\nexport function compareClassNames(prevClassName, nextClassName) {\n if (prevClassName === nextClassName) {\n return null;\n }\n const prevClassList = getClassList(prevClassName);\n const nextClassList = getClassList(nextClassName);\n const diff = [];\n for (const c of nextClassList) {\n if (!prevClassList.has(c)) {\n diff.push(c);\n }\n }\n for (const c of prevClassList) {\n if (!nextClassList.has(c)) {\n diff.push(c);\n }\n }\n return diff.length === 0 ? null : diff;\n}\nfunction getClassList(className) {\n return new Set(className ? className.trim().split(/\\s+/) : []);\n}\n//# sourceMappingURL=compare-class-names.js.map","/* global document */\nimport * as React from 'react';\nimport { createPortal } from 'react-dom';\nimport { useImperativeHandle, useEffect, useMemo, useRef, useContext, forwardRef, memo } from 'react';\nimport { applyReactStyle } from \"../utils/apply-react-style.js\";\nimport { MapContext } from \"./map.js\";\nimport { arePointsEqual } from \"../utils/deep-equal.js\";\nimport { compareClassNames } from \"../utils/compare-class-names.js\";\n/* eslint-disable complexity,max-statements */\nexport const Marker = memo(forwardRef((props, ref) => {\n const { map, mapLib } = useContext(MapContext);\n const thisRef = useRef({ props });\n const marker = useMemo(() => {\n let hasChildren = false;\n React.Children.forEach(props.children, el => {\n if (el) {\n hasChildren = true;\n }\n });\n const options = {\n ...props,\n element: hasChildren ? document.createElement('div') : undefined\n };\n const mk = new mapLib.Marker(options);\n mk.setLngLat([props.longitude, props.latitude]);\n mk.getElement().addEventListener('click', (e) => {\n thisRef.current.props.onClick?.({\n type: 'click',\n target: mk,\n originalEvent: e\n });\n });\n mk.on('dragstart', e => {\n const evt = e;\n evt.lngLat = marker.getLngLat();\n thisRef.current.props.onDragStart?.(evt);\n });\n mk.on('drag', e => {\n const evt = e;\n evt.lngLat = marker.getLngLat();\n thisRef.current.props.onDrag?.(evt);\n });\n mk.on('dragend', e => {\n const evt = e;\n evt.lngLat = marker.getLngLat();\n thisRef.current.props.onDragEnd?.(evt);\n });\n return mk;\n }, []);\n useEffect(() => {\n marker.addTo(map.getMap());\n return () => {\n marker.remove();\n };\n }, []);\n const { longitude, latitude, offset, style, draggable = false, popup = null, rotation = 0, rotationAlignment = 'auto', pitchAlignment = 'auto' } = props;\n useEffect(() => {\n applyReactStyle(marker.getElement(), style);\n }, [style]);\n useImperativeHandle(ref, () => marker, []);\n const oldProps = thisRef.current.props;\n if (marker.getLngLat().lng !== longitude || marker.getLngLat().lat !== latitude) {\n marker.setLngLat([longitude, latitude]);\n }\n if (offset && !arePointsEqual(marker.getOffset(), offset)) {\n marker.setOffset(offset);\n }\n if (marker.isDraggable() !== draggable) {\n marker.setDraggable(draggable);\n }\n if (marker.getRotation() !== rotation) {\n marker.setRotation(rotation);\n }\n if (marker.getRotationAlignment() !== rotationAlignment) {\n marker.setRotationAlignment(rotationAlignment);\n }\n if (marker.getPitchAlignment() !== pitchAlignment) {\n marker.setPitchAlignment(pitchAlignment);\n }\n if (marker.getPopup() !== popup) {\n marker.setPopup(popup);\n }\n const classNameDiff = compareClassNames(oldProps.className, props.className);\n if (classNameDiff) {\n for (const c of classNameDiff) {\n marker.toggleClassName(c);\n }\n }\n thisRef.current.props = props;\n return createPortal(props.children, marker.getElement());\n}));\n//# sourceMappingURL=marker.js.map","import { useContext, useMemo, useEffect } from 'react';\nimport { MapContext } from \"./map.js\";\nexport function useControl(onCreate, arg1, arg2, arg3) {\n const context = useContext(MapContext);\n const ctrl = useMemo(() => onCreate(context), []);\n useEffect(() => {\n const opts = (arg3 || arg2 || arg1);\n const onAdd = typeof arg1 === 'function' && typeof arg2 === 'function' ? arg1 : null;\n const onRemove = typeof arg2 === 'function' ? arg2 : typeof arg1 === 'function' ? arg1 : null;\n const { map } = context;\n if (!map.hasControl(ctrl)) {\n map.addControl(ctrl, opts?.position);\n if (onAdd) {\n onAdd(context);\n }\n }\n return () => {\n if (onRemove) {\n onRemove(context);\n }\n // Map might have been removed (parent effects are destroyed before child ones)\n if (map.hasControl(ctrl)) {\n map.removeControl(ctrl);\n }\n };\n }, []);\n return ctrl;\n}\n//# sourceMappingURL=use-control.js.map","import { useEffect, memo } from 'react';\nimport { applyReactStyle } from \"../utils/apply-react-style.js\";\nimport { useControl } from \"./use-control.js\";\nfunction _NavigationControl(props) {\n const ctrl = useControl(({ mapLib }) => new mapLib.NavigationControl(props), {\n position: props.position\n });\n useEffect(() => {\n applyReactStyle(ctrl._container, props.style);\n }, [props.style]);\n return null;\n}\nexport const NavigationControl = memo(_NavigationControl);\n//# sourceMappingURL=navigation-control.js.map","export default function assert(condition, message) {\n if (!condition) {\n throw new Error(message);\n }\n}\n//# sourceMappingURL=assert.js.map","import * as React from 'react';\nimport { useContext, useEffect, useMemo, useState, useRef, cloneElement } from 'react';\nimport { MapContext } from \"./map.js\";\nimport assert from \"../utils/assert.js\";\nimport { deepEqual } from \"../utils/deep-equal.js\";\nlet sourceCounter = 0;\nfunction createSource(map, id, props) {\n // @ts-ignore\n if (map.style && map.style._loaded) {\n const options = { ...props };\n delete options.id;\n delete options.children;\n // @ts-ignore\n map.addSource(id, options);\n return map.getSource(id);\n }\n return null;\n}\n/* eslint-disable complexity */\nfunction updateSource(source, props, prevProps) {\n assert(props.id === prevProps.id, 'source id changed');\n assert(props.type === prevProps.type, 'source type changed');\n let changedKey = '';\n let changedKeyCount = 0;\n for (const key in props) {\n if (key !== 'children' && key !== 'id' && !deepEqual(prevProps[key], props[key])) {\n changedKey = key;\n changedKeyCount++;\n }\n }\n if (!changedKeyCount) {\n return;\n }\n const type = props.type;\n if (type === 'geojson') {\n source.setData(props.data);\n }\n else if (type === 'image') {\n source.updateImage({\n url: props.url,\n coordinates: props.coordinates\n });\n }\n else {\n switch (changedKey) {\n case 'coordinates':\n // @ts-ignore\n source.setCoordinates?.(props.coordinates);\n break;\n case 'url':\n // @ts-ignore\n source.setUrl?.(props.url);\n break;\n case 'tiles':\n // @ts-ignore\n source.setTiles?.(props.tiles);\n break;\n default:\n // eslint-disable-next-line\n console.warn(`Unable to update <Source> prop: ${changedKey}`);\n }\n }\n}\n/* eslint-enable complexity */\nexport function Source(props) {\n const map = useContext(MapContext).map.getMap();\n const propsRef = useRef(props);\n const [, setStyleLoaded] = useState(0);\n const id = useMemo(() => props.id || `jsx-source-${sourceCounter++}`, []);\n useEffect(() => {\n if (map) {\n /* global setTimeout */\n const forceUpdate = () => setTimeout(() => setStyleLoaded(version => version + 1), 0);\n map.on('styledata', forceUpdate);\n forceUpdate();\n return () => {\n map.off('styledata', forceUpdate);\n // @ts-ignore\n if (map.style && map.style._loaded && map.getSource(id)) {\n // Parent effects are destroyed before child ones, see\n // https://github.com/facebook/react/issues/16728\n // Source can only be removed after all child layers are removed\n const allLayers = map.getStyle()?.layers;\n if (allLayers) {\n for (const layer of allLayers) {\n // @ts-ignore (2339) source does not exist on all layer types\n if (layer.source === id) {\n map.removeLayer(layer.id);\n }\n }\n }\n map.removeSource(id);\n }\n };\n }\n return undefined;\n }, [map]);\n // @ts-ignore\n let source = map && map.style && map.getSource(id);\n if (source) {\n updateSource(source, props, propsRef.current);\n }\n else {\n source = createSource(map, id, props);\n }\n propsRef.current = props;\n return ((source &&\n React.Children.map(props.children, child => child &&\n cloneElement(child, {\n source: id\n }))) ||\n null);\n}\n//# sourceMappingURL=source.js.map","import { useContext, useEffect, useMemo, useState, useRef } from 'react';\nimport { MapContext } from \"./map.js\";\nimport assert from \"../utils/assert.js\";\nimport { deepEqual } from \"../utils/deep-equal.js\";\n/* eslint-disable complexity, max-statements */\nfunction updateLayer(map, id, props, prevProps) {\n assert(props.id === prevProps.id, 'layer id changed');\n assert(props.type === prevProps.type, 'layer type changed');\n if (props.type === 'custom' || prevProps.type === 'custom') {\n return;\n }\n // @ts-ignore filter does not exist in some Layer types\n const { layout = {}, paint = {}, filter, minzoom, maxzoom, beforeId } = props;\n if (beforeId !== prevProps.beforeId) {\n map.moveLayer(id, beforeId);\n }\n if (layout !== prevProps.layout) {\n const prevLayout = prevProps.layout || {};\n for (const key in layout) {\n if (!deepEqual(layout[key], prevLayout[key])) {\n map.setLayoutProperty(id, key, layout[key]);\n }\n }\n for (const key in prevLayout) {\n if (!layout.hasOwnProperty(key)) {\n map.setLayoutProperty(id, key, undefined);\n }\n }\n }\n if (paint !== prevProps.paint) {\n const prevPaint = prevProps.paint || {};\n for (const key in paint) {\n if (!deepEqual(paint[key], prevPaint[key])) {\n map.setPaintProperty(id, key, paint[key]);\n }\n }\n for (const key in prevPaint) {\n if (!paint.hasOwnProperty(key)) {\n map.setPaintProperty(id, key, undefined);\n }\n }\n }\n // @ts-ignore filter does not exist in some Layer types\n if (!deepEqual(filter, prevProps.filter)) {\n map.setFilter(id, filter);\n }\n if (minzoom !== prevProps.minzoom || maxzoom !== prevProps.maxzoom) {\n map.setLayerZoomRange(id, minzoom, maxzoom);\n }\n}\nfunction createLayer(map, id, props) {\n // @ts-ignore\n if (map.style && map.style._loaded && (!('source' in props) || map.getSource(props.source))) {\n const options = { ...props, id };\n delete options.beforeId;\n // @ts-ignore\n map.addLayer(options, props.beforeId);\n }\n}\n/* eslint-enable complexity, max-statements */\nlet layerCounter = 0;\nexport function Layer(props) {\n const map = useContext(MapContext).map.getMap();\n const propsRef = useRef(props);\n const [, setStyleLoaded] = useState(0);\n const id = useMemo(() => props.id || `jsx-layer-${layerCounter++}`, []);\n useEffect(() => {\n if (map) {\n const forceUpdate = () => setStyleLoaded(version => version + 1);\n map.on('styledata', forceUpdate);\n forceUpdate();\n return () => {\n map.off('styledata', forceUpdate);\n // @ts-ignore\n if (map.style && map.style._loaded && map.getLayer(id)) {\n map.removeLayer(id);\n }\n };\n }\n return undefined;\n }, [map]);\n // @ts-ignore\n const layer = map && map.style && map.getLayer(id);\n if (layer) {\n try {\n updateLayer(map, id, props, propsRef.current);\n }\n catch (error) {\n console.warn(error); // eslint-disable-line\n }\n }\n else {\n createLayer(map, id, props);\n }\n // Store last rendered props\n propsRef.current = props;\n return null;\n}\n//# sourceMappingURL=layer.js.map"],"file":"lib-vis.gl-react-maplibre-CU7gWYjg.js","debugId":"94ee0598-8e0a-4dbb-ba46-3c68ce0721ca"}
1
+ {"version":3,"mappings":";6nBAGaA,EAAAC,EAA2B,cAAc,IAAI,EA8B1D,SAAgBC,GAAS,CACrB,IAAMC,GAAA,EAAOC,cAAWJ,CAAkB,CAAC,EAAE,KACvCK,GAAA,EAAaD,cAAWE,CAAU,EAIxC,SAHwBC,gBACb,CAAE,GAAGJ,EAAM,QAASE,GAAY,GAAI,GAC5C,CAACF,EAAME,CAAU,CACC,CACzB,CClCA,SAAgBG,EAAe,EAAG,EAAG,CACjC,IAAMC,EAAK,MAAM,QAAQC,CAAC,EAAIA,EAAE,GAAKA,EAAIA,EAAE,EAAI,EACzCC,EAAK,MAAM,QAAQD,CAAC,EAAIA,EAAE,GAAKA,EAAIA,EAAE,EAAI,EACzCE,EAAK,MAAM,QAAQC,CAAC,EAAIA,EAAE,GAAKA,EAAIA,EAAE,EAAI,EACzCC,EAAK,MAAM,QAAQD,CAAC,EAAIA,EAAE,GAAKA,EAAIA,EAAE,EAAI,EAC/C,OAAOJ,IAAOG,GAAMD,IAAOG,CAC/B,CAQA,SAAgBC,EAAU,EAAG,EAAG,CAC5B,GAAIL,IAAMG,EACN,MAAO,GAEX,GAAI,CAACH,GAAK,CAACG,EACP,MAAO,GAEX,GAAI,MAAM,QAAQH,CAAC,EAAG,CAClB,GAAI,CAAC,MAAM,QAAQG,CAAC,GAAKH,EAAE,SAAWG,EAAE,OACpC,MAAO,GAEX,IAAK,IAAIG,EAAI,EAAGA,EAAIN,EAAE,OAAQ,IAC1B,GAAI,CAACK,EAAUL,EAAEM,GAAIH,EAAEG,EAAE,EACrB,MAAO,GAGf,MAAO,EACX,CACK,GAAI,MAAM,QAAQH,CAAC,EACpB,MAAO,GAEX,GAAI,OAAOH,GAAM,UAAY,OAAOG,GAAM,SAAU,CAChD,IAAMI,EAAQ,OAAO,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AAI,UAAUK,EAAM,MAAM,GAAI,CACzF,IAAMmD,EAAU,CAAE,GAAGnD,EAAO,IAAG,EAC/B,OAAOmD,EAAQ,SAEfxD,EAAI,SAASwD,EAASnD,EAAM,QAAQ,CACxC,CACJ,CAEA,IAAI8K,EAAe,EACnB,SAAgBC,EAAM,EAAO,CACzB,IAAMpL,GAAA,EAAMjB,cAAWE,CAAU,CAAC,CAAC,IAAI,OAAO,EACxCiL,GAAA,EAAWrE,UAAOxF,CAAK,EACvB,EAAG8J,IAAA,EAAkBxE,YAAS,CAAC,EAC/B+D,GAAA,EAAKxK,eAAcmB,EAAM,IAAM,aAAa,MAAkB,CAAC,CAAC,EAkBtE,IAjBA,EAAAzB,EAAA,eAAgB,CACZ,GAAIoB,EAAK,CACL,IAAMoK,MAAoBD,EAAe,GAAWE,EAAU,CAAC,EAG/D,OAFArK,EAAI,GAAG,YAAaoK,CAAW,EAC/BA,EAAY,MACC,CACTpK,EAAI,IAAI,YAAaoK,CAAW,EAE5BpK,EAAI,OAASA,EAAI,MAAM,SAAWA,EAAI,SAAS0J,CAAE,GACjD1J,EAAI,YAAY0J,CAAE,CAE1B,CACJ,CAEJ,EAAG,CAAC1J,CAAG,CAAC,EAEMA,GAAOA,EAAI,OAASA,EAAI,SAAS0J,CAAE,EAE7C,GAAI,CACAe,EAAYzK,EAAK0J,EAAIrJ,EAAO6J,EAAS,OAAO,CAChD,OACO/E,EAAO,CACV,QAAQ,KAAKA,CAAK,CACtB,MAGA+F,EAAYlL,EAAK0J,EAAIrJ,CAAK,EAI9B,MADA,GAAS,QAAUA,EACZ,IACX","names":["MountedMapsContext","import_react","useMap","maps","useContext","currentMap","MapContext","useMemo","arePointsEqual","ax","a","ay","bx","b","by","deepEqual","i","aKeys","bKeys","key","getTransformLike","map","transformToViewState","tr","applyViewStateToTransform","v","props","changes","LngLat","updateConstraint","nextRange","currentRange","setMax","setMin","updateZoomConstraint","updatePitchConstraint","refProps","normalizeStyle","style","layerIndex","layer","layers","normalizedLayer","layerRef","propName","DEFAULT_STYLE","DEFAULT_SETTINGS","pointerEvents","cameraEvents","otherEvents","settingNames","handlerNames","Maplibre","cb","MapClass","container","oldProps","settingsChanged","sizeChanged","viewStateChanged","that","oldContainer","resizeObserver","initialViewState","mapOptions","mapStyle","viewState","getContext","mapWithCameraUpdate","eventName","nextProps","canvas","didUpdateZoom","currProps","didUpdatePitch","nextValue","constraintsChanged","options","styleDiffing","light","projection","sky","terrain","newValue","point","interactiveLayerIds","eventType","wasHovering","features","isHovering","skipMethods","createRef","mapInstance","result","getMethodNames","proto","obj","useIsomorphicLayoutEffect","useLayoutEffect","useEffect","setGlobals","RTLTextPlugin","mapLib","pluginUrl","error","lazy","maxParallelImageRequests","workerCount","workerUrl","_Map","mountedMapsContext","setMapInstance","useState","containerRef","useRef","contextValue","isMounted","maplibre","__vitePreload","n","module","mapboxgl","onError","ref","Map","unitlessNumber","applyReactStyle","element","styles","value","compareClassNames","prevClassName","nextClassName","prevClassList","getClassList","nextClassList","diff","c","className","Marker","memo","forwardRef","thisRef","marker","hasChildren","el","mk","evt","longitude","latitude","offset","draggable","rotation","rotationAlignment","pitchAlignment","popup","classNameDiff","createPortal","useControl","context","ctrl","onCreate","opts","arg3","arg2","arg1","onAdd","onRemove","_NavigationControl","NavigationControl","assert","condition","message","sourceCounter","createSource","id","updateSource","prevProps","changedKey","changedKeyCount","type","source","Source","propsRef","setStyleLoaded","forceUpdate","version","allLayers","child","cloneElement","updateLayer","beforeId","layout","prevLayout","paint","prevPaint","filter","minzoom","maxzoom","createLayer","layerCounter","Layer"],"ignoreList":[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16],"sources":["../../../../../node_modules/.bun/@vis.gl+react-maplibre@8.1.3+469c9e9bb8e20606/node_modules/@vis.gl/react-maplibre/dist/components/use-map.js","../../../../../node_modules/.bun/@vis.gl+react-maplibre@8.1.3+469c9e9bb8e20606/node_modules/@vis.gl/react-maplibre/dist/utils/deep-equal.js","../../../../../node_modules/.bun/@vis.gl+react-maplibre@8.1.3+469c9e9bb8e20606/node_modules/@vis.gl/react-maplibre/dist/utils/transform.js","../../../../../node_modules/.bun/@vis.gl+react-maplibre@8.1.3+469c9e9bb8e20606/node_modules/@vis.gl/react-maplibre/dist/utils/style-utils.js","../../../../../node_modules/.bun/@vis.gl+react-maplibre@8.1.3+469c9e9bb8e20606/node_modules/@vis.gl/react-maplibre/dist/maplibre/maplibre.js","../../../../../node_modules/.bun/@vis.gl+react-maplibre@8.1.3+469c9e9bb8e20606/node_modules/@vis.gl/react-maplibre/dist/maplibre/create-ref.js","../../../../../node_modules/.bun/@vis.gl+react-maplibre@8.1.3+469c9e9bb8e20606/node_modules/@vis.gl/react-maplibre/dist/utils/use-isomorphic-layout-effect.js","../../../../../node_modules/.bun/@vis.gl+react-maplibre@8.1.3+469c9e9bb8e20606/node_modules/@vis.gl/react-maplibre/dist/utils/set-globals.js","../../../../../node_modules/.bun/@vis.gl+react-maplibre@8.1.3+469c9e9bb8e20606/node_modules/@vis.gl/react-maplibre/dist/components/map.js","../../../../../node_modules/.bun/@vis.gl+react-maplibre@8.1.3+469c9e9bb8e20606/node_modules/@vis.gl/react-maplibre/dist/utils/apply-react-style.js","../../../../../node_modules/.bun/@vis.gl+react-maplibre@8.1.3+469c9e9bb8e20606/node_modules/@vis.gl/react-maplibre/dist/utils/compare-class-names.js","../../../../../node_modules/.bun/@vis.gl+react-maplibre@8.1.3+469c9e9bb8e20606/node_modules/@vis.gl/react-maplibre/dist/components/marker.js","../../../../../node_modules/.bun/@vis.gl+react-maplibre@8.1.3+469c9e9bb8e20606/node_modules/@vis.gl/react-maplibre/dist/components/use-control.js","../../../../../node_modules/.bun/@vis.gl+react-maplibre@8.1.3+469c9e9bb8e20606/node_modules/@vis.gl/react-maplibre/dist/components/navigation-control.js","../../../../../node_modules/.bun/@vis.gl+react-maplibre@8.1.3+469c9e9bb8e20606/node_modules/@vis.gl/react-maplibre/dist/utils/assert.js","../../../../../node_modules/.bun/@vis.gl+react-maplibre@8.1.3+469c9e9bb8e20606/node_modules/@vis.gl/react-maplibre/dist/components/source.js","../../../../../node_modules/.bun/@vis.gl+react-maplibre@8.1.3+469c9e9bb8e20606/node_modules/@vis.gl/react-maplibre/dist/components/layer.js"],"sourcesContent":["import * as React from 'react';\nimport { useState, useCallback, useMemo, useContext } from 'react';\nimport { MapContext } from \"./map.js\";\nexport const MountedMapsContext = React.createContext(null);\nexport const MapProvider = props => {\n const [maps, setMaps] = useState({});\n const onMapMount = useCallback((map, id = 'default') => {\n setMaps(currMaps => {\n if (id === 'current') {\n throw new Error(\"'current' cannot be used as map id\");\n }\n if (currMaps[id]) {\n throw new Error(`Multiple maps with the same id: ${id}`);\n }\n return { ...currMaps, [id]: map };\n });\n }, []);\n const onMapUnmount = useCallback((id = 'default') => {\n setMaps(currMaps => {\n if (currMaps[id]) {\n const nextMaps = { ...currMaps };\n delete nextMaps[id];\n return nextMaps;\n }\n return currMaps;\n });\n }, []);\n return (React.createElement(MountedMapsContext.Provider, { value: {\n maps,\n onMapMount,\n onMapUnmount\n } }, props.children));\n};\nexport function useMap() {\n const maps = useContext(MountedMapsContext)?.maps;\n const currentMap = useContext(MapContext);\n const mapsWithCurrent = useMemo(() => {\n return { ...maps, current: currentMap?.map };\n }, [maps, currentMap]);\n return mapsWithCurrent;\n}\n//# sourceMappingURL=use-map.js.map","/**\n * Compare two points\n * @param a\n * @param b\n * @returns true if the points are equal\n */\nexport function arePointsEqual(a, b) {\n const ax = Array.isArray(a) ? a[0] : a ? a.x : 0;\n const ay = Array.isArray(a) ? a[1] : a ? a.y : 0;\n const bx = Array.isArray(b) ? b[0] : b ? b.x : 0;\n const by = Array.isArray(b) ? b[1] : b ? b.y : 0;\n return ax === bx && ay === by;\n}\n/* eslint-disable complexity */\n/**\n * Compare any two objects\n * @param a\n * @param b\n * @returns true if the objects are deep equal\n */\nexport function deepEqual(a, b) {\n if (a === b) {\n return true;\n }\n if (!a || !b) {\n return false;\n }\n if (Array.isArray(a)) {\n if (!Array.isArray(b) || a.length !== b.length) {\n return false;\n }\n for (let i = 0; i < a.length; i++) {\n if (!deepEqual(a[i], b[i])) {\n return false;\n }\n }\n return true;\n }\n else if (Array.isArray(b)) {\n return false;\n }\n if (typeof a === 'object' && typeof b === 'object') {\n const aKeys = Object.keys(a);\n const bKeys = Object.keys(b);\n if (aKeys.length !== bKeys.length) {\n return false;\n }\n for (const key of aKeys) {\n if (!b.hasOwnProperty(key)) {\n return false;\n }\n if (!deepEqual(a[key], b[key])) {\n return false;\n }\n }\n return true;\n }\n return false;\n}\n//# sourceMappingURL=deep-equal.js.map","import { deepEqual } from \"./deep-equal.js\";\n/**\n * maplibre-gl v6 removed the public `map.transform` property in favor of\n * discrete getters. Reconstruct a TransformLike snapshot from those getters\n * so it works across maplibre-gl v4/v5/v6.\n */\nexport function getTransformLike(map) {\n return {\n center: map.getCenter(),\n zoom: map.getZoom(),\n bearing: map.getBearing(),\n pitch: map.getPitch(),\n // @ts-ignore getCenterElevation does not exist before v5.0.0\n elevation: map.getCenterElevation?.() ?? 0,\n padding: map.getPadding()\n };\n}\n/**\n * Capture a transform's current state\n * @param transform\n * @returns descriptor of the view state\n */\nexport function transformToViewState(tr) {\n return {\n longitude: tr.center.lng,\n latitude: tr.center.lat,\n zoom: tr.zoom,\n pitch: tr.pitch,\n bearing: tr.bearing,\n padding: tr.padding\n };\n}\n/* eslint-disable complexity */\n/**\n * Applies requested view state to a transform\n * @returns an object containing detected changes\n */\nexport function applyViewStateToTransform(\n/** An object that describes Maplibre's camera state */\ntr, \n/** Props from Map component */\nprops) {\n const v = props.viewState || props;\n const changes = {};\n if ('longitude' in v &&\n 'latitude' in v &&\n (v.longitude !== tr.center.lng || v.latitude !== tr.center.lat)) {\n const LngLat = tr.center.constructor;\n // @ts-expect-error we should not import LngLat class from maplibre-gl because we don't know the source of mapLib\n changes.center = new LngLat(v.longitude, v.latitude);\n }\n if ('zoom' in v && v.zoom !== tr.zoom) {\n changes.zoom = v.zoom;\n }\n if ('bearing' in v && v.bearing !== tr.bearing) {\n changes.bearing = v.bearing;\n }\n if ('pitch' in v && v.pitch !== tr.pitch) {\n changes.pitch = v.pitch;\n }\n if (v.padding && tr.padding && !deepEqual(v.padding, tr.padding)) {\n changes.padding = v.padding;\n }\n return changes;\n}\n/**\n * Update a min/max constraint pair in the right order to avoid\n * temporarily setting min > max (which maplibre rejects).\n * @param nextRange - the desired constraint range\n * @param currentRange - the current constraint range\n * @param setMin - setter for the minimum value\n * @param setMax - setter for the maximum value\n */\nfunction updateConstraint(nextRange, currentRange, setMin, setMax) {\n if (nextRange.min === currentRange.min && nextRange.max === currentRange.max) {\n return false;\n }\n // When moving up (min increasing), update max first to make room\n if (nextRange.min >= currentRange.min) {\n if (nextRange.max !== currentRange.max) {\n setMax(nextRange.max);\n }\n if (nextRange.min !== currentRange.min) {\n setMin(nextRange.min);\n }\n }\n else {\n // When moving down (min decreasing), update min first to make room\n if (nextRange.min !== currentRange.min) {\n setMin(nextRange.min);\n }\n if (nextRange.max !== currentRange.max) {\n setMax(nextRange.max);\n }\n }\n return true;\n}\nexport function updateZoomConstraint(map, nextRange, currentRange) {\n return updateConstraint(nextRange, currentRange, v => map.setMinZoom(v), v => map.setMaxZoom(v));\n}\nexport function updatePitchConstraint(map, nextRange, currentRange) {\n return updateConstraint(nextRange, currentRange, v => map.setMinPitch(v), v => map.setMaxPitch(v));\n}\n//# sourceMappingURL=transform.js.map","const refProps = ['type', 'source', 'source-layer', 'minzoom', 'maxzoom', 'filter', 'layout'];\n// Prepare a map style object for diffing\n// If immutable - convert to plain object\n// Work around some issues in older styles that would fail Mapbox's diffing\nexport function normalizeStyle(style) {\n if (!style) {\n return null;\n }\n if (typeof style === 'string') {\n return style;\n }\n if ('toJS' in style) {\n style = style.toJS();\n }\n if (!style.layers) {\n return style;\n }\n const layerIndex = {};\n for (const layer of style.layers) {\n layerIndex[layer.id] = layer;\n }\n const layers = style.layers.map(layer => {\n let normalizedLayer = null;\n if ('interactive' in layer) {\n normalizedLayer = Object.assign({}, layer);\n // Breaks style diffing :(\n // @ts-ignore legacy field not typed\n delete normalizedLayer.interactive;\n }\n // Style diffing doesn't work with refs so expand them out manually before diffing.\n // @ts-ignore legacy field not typed\n const layerRef = layerIndex[layer.ref];\n if (layerRef) {\n normalizedLayer = normalizedLayer || Object.assign({}, layer);\n // @ts-ignore\n delete normalizedLayer.ref;\n // https://github.com/mapbox/mapbox-gl-js/blob/master/src/style-spec/deref.js\n for (const propName of refProps) {\n if (propName in layerRef) {\n normalizedLayer[propName] = layerRef[propName];\n }\n }\n }\n return normalizedLayer || layer;\n });\n // Do not mutate the style object provided by the user\n return { ...style, layers };\n}\n//# sourceMappingURL=style-utils.js.map","import { transformToViewState, applyViewStateToTransform, getTransformLike, updateZoomConstraint, updatePitchConstraint } from \"../utils/transform.js\";\nimport { normalizeStyle } from \"../utils/style-utils.js\";\nimport { deepEqual } from \"../utils/deep-equal.js\";\nconst DEFAULT_STYLE = { version: 8, sources: {}, layers: [] };\nconst DEFAULT_SETTINGS = {\n minZoom: 0,\n maxZoom: 22,\n minPitch: 0,\n maxPitch: 85,\n maxBounds: [-180, -85.051129, 180, 85.051129],\n projection: 'mercator',\n renderWorldCopies: true\n};\nconst pointerEvents = {\n mousedown: 'onMouseDown',\n mouseup: 'onMouseUp',\n mouseover: 'onMouseOver',\n mousemove: 'onMouseMove',\n click: 'onClick',\n dblclick: 'onDblClick',\n mouseenter: 'onMouseEnter',\n mouseleave: 'onMouseLeave',\n mouseout: 'onMouseOut',\n contextmenu: 'onContextMenu',\n touchstart: 'onTouchStart',\n touchend: 'onTouchEnd',\n touchmove: 'onTouchMove',\n touchcancel: 'onTouchCancel'\n};\nconst cameraEvents = {\n movestart: 'onMoveStart',\n move: 'onMove',\n moveend: 'onMoveEnd',\n dragstart: 'onDragStart',\n drag: 'onDrag',\n dragend: 'onDragEnd',\n zoomstart: 'onZoomStart',\n zoom: 'onZoom',\n zoomend: 'onZoomEnd',\n rotatestart: 'onRotateStart',\n rotate: 'onRotate',\n rotateend: 'onRotateEnd',\n pitchstart: 'onPitchStart',\n pitch: 'onPitch',\n pitchend: 'onPitchEnd'\n};\nconst otherEvents = {\n wheel: 'onWheel',\n boxzoomstart: 'onBoxZoomStart',\n boxzoomend: 'onBoxZoomEnd',\n boxzoomcancel: 'onBoxZoomCancel',\n resize: 'onResize',\n load: 'onLoad',\n render: 'onRender',\n idle: 'onIdle',\n remove: 'onRemove',\n data: 'onData',\n styledata: 'onStyleData',\n sourcedata: 'onSourceData',\n error: 'onError'\n};\nconst settingNames = ['maxBounds', 'projection', 'renderWorldCopies'];\nconst handlerNames = [\n 'scrollZoom',\n 'boxZoom',\n 'dragRotate',\n 'dragPan',\n 'keyboard',\n 'doubleClickZoom',\n 'touchZoomRotate',\n 'touchPitch'\n];\n/**\n * A wrapper for mapbox-gl's Map class\n */\nclass Maplibre {\n constructor(MapClass, props, container) {\n // mapboxgl.Map instance\n this._map = null;\n // Internal states\n this._internalUpdate = false;\n this._hoveredFeatures = null;\n this._propsedCameraUpdate = null;\n this._styleComponents = {};\n this._onEvent = (e) => {\n // @ts-ignore\n const cb = this.props[otherEvents[e.type]];\n if (cb) {\n cb(e);\n }\n else if (e.type === 'error') {\n console.error(e.error); // eslint-disable-line\n }\n };\n this._onCameraEvent = (e) => {\n if (this._internalUpdate) {\n return;\n }\n e.viewState = this._propsedCameraUpdate || transformToViewState(getTransformLike(this._map));\n // @ts-ignore\n const cb = this.props[cameraEvents[e.type]];\n if (cb) {\n cb(e);\n }\n };\n this._onCameraUpdate = (tr) => {\n if (this._internalUpdate) {\n return tr;\n }\n this._propsedCameraUpdate = transformToViewState(tr);\n return applyViewStateToTransform(tr, this.props);\n };\n this._onPointerEvent = (e) => {\n if (e.type === 'mousemove' || e.type === 'mouseout') {\n this._updateHover(e);\n }\n // @ts-ignore\n const cb = this.props[pointerEvents[e.type]];\n if (cb) {\n if (this.props.interactiveLayerIds && e.type !== 'mouseover' && e.type !== 'mouseout') {\n e.features = this._hoveredFeatures || this._queryRenderedFeatures(e.point);\n }\n cb(e);\n delete e.features;\n }\n };\n this._MapClass = MapClass;\n this.props = props;\n this._initialize(container);\n }\n get map() {\n return this._map;\n }\n setProps(props) {\n const oldProps = this.props;\n this.props = props;\n const settingsChanged = this._updateSettings(props, oldProps);\n const sizeChanged = this._updateSize(props);\n const viewStateChanged = this._updateViewState(props);\n this._updateStyle(props, oldProps);\n this._updateStyleComponents(props);\n this._updateHandlers(props, oldProps);\n // If 1) view state has changed to match props and\n // 2) the props change is not triggered by map events,\n // it's driven by an external state change. Redraw immediately\n if (settingsChanged || sizeChanged || (viewStateChanged && !this._map.isMoving())) {\n this.redraw();\n }\n }\n static reuse(props, container) {\n const that = Maplibre.savedMaps.pop();\n if (!that) {\n return null;\n }\n const map = that.map;\n // When reusing the saved map, we need to reparent the map(canvas) and other child nodes\n // intoto the new container from the props.\n // Step 1: reparenting child nodes from old container to new container\n const oldContainer = map.getContainer();\n container.className = oldContainer.className;\n while (oldContainer.childNodes.length > 0) {\n container.appendChild(oldContainer.childNodes[0]);\n }\n // Step 2: replace the internal container with new container from the react component\n // @ts-ignore\n map._container = container;\n // With maplibre-gl as mapLib, map uses ResizeObserver to observe when its container resizes.\n // When reusing the saved map, we need to disconnect the observer and observe the new container.\n // Step 3: telling the ResizeObserver to disconnect and observe the new container\n // @ts-ignore\n const resizeObserver = map._resizeObserver;\n if (resizeObserver) {\n resizeObserver.disconnect();\n resizeObserver.observe(container);\n }\n // Step 4: apply new props\n that.setProps({ ...props, styleDiffing: false });\n map.resize();\n const { initialViewState } = props;\n if (initialViewState) {\n if (initialViewState.bounds) {\n map.fitBounds(initialViewState.bounds, { ...initialViewState.fitBoundsOptions, duration: 0 });\n }\n else {\n that._updateViewState(initialViewState);\n }\n }\n // Simulate load event\n if (map.isStyleLoaded()) {\n map.fire('load');\n }\n else {\n map.once('style.load', () => map.fire('load'));\n }\n // Force reload\n // @ts-ignore\n map._update();\n return that;\n }\n /* eslint-disable complexity,max-statements */\n _initialize(container) {\n const { props } = this;\n const { mapStyle = DEFAULT_STYLE } = props;\n const mapOptions = {\n ...props,\n ...props.initialViewState,\n container,\n style: normalizeStyle(mapStyle)\n };\n const viewState = mapOptions.initialViewState || mapOptions.viewState || mapOptions;\n Object.assign(mapOptions, {\n center: [viewState.longitude || 0, viewState.latitude || 0],\n zoom: viewState.zoom || 0,\n pitch: viewState.pitch || 0,\n bearing: viewState.bearing || 0\n });\n if (props.gl) {\n // eslint-disable-next-line\n const getContext = HTMLCanvasElement.prototype.getContext;\n // Hijack canvas.getContext to return our own WebGLContext\n // This will be called inside the mapboxgl.Map constructor\n // @ts-expect-error\n HTMLCanvasElement.prototype.getContext = () => {\n // Unhijack immediately\n HTMLCanvasElement.prototype.getContext = getContext;\n return props.gl;\n };\n }\n const map = new this._MapClass(mapOptions);\n // Props that are not part of constructor options\n if (viewState.padding) {\n map.setPadding(viewState.padding);\n }\n if (props.cursor) {\n map.getCanvas().style.cursor = props.cursor;\n }\n // add listeners\n const mapWithCameraUpdate = map;\n if (typeof mapWithCameraUpdate.setTransformCameraUpdate === 'function') {\n // maplibre-gl v6+\n mapWithCameraUpdate.setTransformCameraUpdate(this._onCameraUpdate);\n }\n else {\n mapWithCameraUpdate.transformCameraUpdate = this._onCameraUpdate;\n }\n map.on('style.load', () => {\n // Map style has changed, this would have wiped out all settings from props\n this._styleComponents = {\n light: map.getLight(),\n sky: map.getSky(),\n // @ts-ignore getProjection() does not exist in v4\n projection: map.getProjection?.(),\n terrain: map.getTerrain()\n };\n this._updateStyleComponents(this.props);\n });\n map.on('sourcedata', () => {\n // Some sources have loaded, we may need them to attach terrain\n this._updateStyleComponents(this.props);\n });\n for (const eventName in pointerEvents) {\n map.on(eventName, this._onPointerEvent);\n }\n for (const eventName in cameraEvents) {\n map.on(eventName, this._onCameraEvent);\n }\n for (const eventName in otherEvents) {\n map.on(eventName, this._onEvent);\n }\n this._map = map;\n }\n /* eslint-enable complexity,max-statements */\n recycle() {\n // Clean up unnecessary elements before storing for reuse.\n const container = this.map.getContainer();\n const children = container.querySelector('[mapboxgl-children]');\n children?.remove();\n Maplibre.savedMaps.push(this);\n }\n destroy() {\n this._map.remove();\n }\n // Force redraw the map now. Typically resize() and jumpTo() is reflected in the next\n // render cycle, which is managed by Mapbox's animation loop.\n // This removes the synchronization issue caused by requestAnimationFrame.\n redraw() {\n const map = this._map;\n // map._render will throw error if style does not exist\n // https://github.com/mapbox/mapbox-gl-js/blob/fb9fc316da14e99ff4368f3e4faa3888fb43c513\n // /src/ui/map.js#L1834\n if (map.style) {\n // cancel the scheduled update\n if (map._frame) {\n map._frame.cancel();\n map._frame = null;\n }\n // the order is important - render() may schedule another update\n map._render();\n }\n }\n /* Trigger map resize if size is controlled\n @param {object} nextProps\n @returns {bool} true if size has changed\n */\n _updateSize(nextProps) {\n // Check if size is controlled\n const { viewState } = nextProps;\n if (viewState) {\n const map = this._map;\n const canvas = map.getCanvas();\n if (viewState.width !== canvas.clientWidth || viewState.height !== canvas.clientHeight) {\n map.resize();\n return true;\n }\n }\n return false;\n }\n // Adapted from map.jumpTo\n /* Update camera to match props\n @param {object} nextProps\n @param {bool} triggerEvents - should fire camera events\n @returns {bool} true if anything is changed\n */\n _updateViewState(nextProps) {\n const map = this._map;\n const tr = getTransformLike(map);\n const isMoving = map.isMoving();\n // Avoid manipulating the real transform when interaction/animation is ongoing\n // as it would interfere with Mapbox's handlers\n if (!isMoving) {\n const changes = applyViewStateToTransform(tr, nextProps);\n if (Object.keys(changes).length > 0) {\n this._internalUpdate = true;\n map.jumpTo(changes);\n this._internalUpdate = false;\n return true;\n }\n }\n return false;\n }\n /* Update camera constraints to match props\n @param {object} nextProps\n @param {object} currProps\n @returns {bool} true if anything is changed\n */\n _updateConstraints(nextProps, currProps) {\n const didUpdateZoom = updateZoomConstraint(this._map, {\n min: nextProps.minZoom ?? DEFAULT_SETTINGS.minZoom,\n max: nextProps.maxZoom ?? DEFAULT_SETTINGS.maxZoom\n }, {\n min: currProps.minZoom ?? DEFAULT_SETTINGS.minZoom,\n max: currProps.maxZoom ?? DEFAULT_SETTINGS.maxZoom\n });\n const didUpdatePitch = updatePitchConstraint(this._map, {\n min: nextProps.minPitch ?? DEFAULT_SETTINGS.minPitch,\n max: nextProps.maxPitch ?? DEFAULT_SETTINGS.maxPitch\n }, {\n min: currProps.minPitch ?? DEFAULT_SETTINGS.minPitch,\n max: currProps.maxPitch ?? DEFAULT_SETTINGS.maxPitch\n });\n return didUpdateZoom || didUpdatePitch;\n }\n /* Update camera constraints and projection settings to match props\n @param {object} nextProps\n @param {object} currProps\n @returns {bool} true if anything is changed\n */\n _updateSettings(nextProps, currProps) {\n const map = this._map;\n let settingsChanged = false;\n for (const propName of settingNames) {\n const propPresent = propName in nextProps || propName in currProps;\n if (propPresent && !deepEqual(nextProps[propName], currProps[propName])) {\n settingsChanged = true;\n const nextValue = propName in nextProps ? nextProps[propName] : DEFAULT_SETTINGS[propName];\n const setter = map[`set${propName[0].toUpperCase()}${propName.slice(1)}`];\n setter?.call(map, nextValue);\n }\n }\n const constraintsChanged = this._updateConstraints(nextProps, currProps);\n return settingsChanged || constraintsChanged;\n }\n /* Update map style to match props */\n _updateStyle(nextProps, currProps) {\n if (nextProps.cursor !== currProps.cursor) {\n this._map.getCanvas().style.cursor = nextProps.cursor || '';\n }\n if (nextProps.mapStyle !== currProps.mapStyle) {\n const { mapStyle = DEFAULT_STYLE, styleDiffing = true } = nextProps;\n const options = {\n diff: styleDiffing\n };\n if ('localIdeographFontFamily' in nextProps) {\n // @ts-ignore Mapbox specific prop\n options.localIdeographFontFamily = nextProps.localIdeographFontFamily;\n }\n this._map.setStyle(normalizeStyle(mapStyle), options);\n }\n }\n /* Update fog, light, projection and terrain to match props\n * These props are special because\n * 1. They can not be applied right away. Certain conditions (style loaded, source loaded, etc.) must be met\n * 2. They can be overwritten by mapStyle\n */\n _updateStyleComponents({ light, projection, sky, terrain }) {\n const map = this._map;\n const currProps = this._styleComponents;\n // We can safely manipulate map style once it's loaded\n if (map.style?._loaded) {\n if (light && !deepEqual(light, currProps.light)) {\n currProps.light = light;\n map.setLight(light);\n }\n if (projection &&\n !deepEqual(projection, currProps.projection) &&\n projection !== currProps.projection?.type) {\n currProps.projection = typeof projection === 'string' ? { type: projection } : projection;\n // @ts-ignore setProjection does not exist in v4\n map.setProjection?.(currProps.projection);\n }\n if (sky && !deepEqual(sky, currProps.sky)) {\n currProps.sky = sky;\n map.setSky(sky);\n }\n if (terrain !== undefined && !deepEqual(terrain, currProps.terrain)) {\n if (!terrain || map.getSource(terrain.source)) {\n currProps.terrain = terrain;\n map.setTerrain(terrain);\n }\n }\n }\n }\n /* Update interaction handlers to match props */\n _updateHandlers(nextProps, currProps) {\n const map = this._map;\n for (const propName of handlerNames) {\n const newValue = nextProps[propName] ?? true;\n const oldValue = currProps[propName] ?? true;\n if (!deepEqual(newValue, oldValue)) {\n if (newValue) {\n map[propName].enable(newValue);\n }\n else {\n map[propName].disable();\n }\n }\n }\n }\n _queryRenderedFeatures(point) {\n const map = this._map;\n const { interactiveLayerIds = [] } = this.props;\n try {\n return map.queryRenderedFeatures(point, {\n layers: interactiveLayerIds.filter(map.getLayer.bind(map))\n });\n }\n catch {\n // May fail if style is not loaded\n return [];\n }\n }\n _updateHover(e) {\n const { props } = this;\n const shouldTrackHoveredFeatures = props.interactiveLayerIds && (props.onMouseMove || props.onMouseEnter || props.onMouseLeave);\n if (shouldTrackHoveredFeatures) {\n const eventType = e.type;\n const wasHovering = this._hoveredFeatures?.length > 0;\n const features = this._queryRenderedFeatures(e.point);\n const isHovering = features.length > 0;\n if (!isHovering && wasHovering) {\n e.type = 'mouseleave';\n this._onPointerEvent(e);\n }\n this._hoveredFeatures = features;\n if (isHovering && !wasHovering) {\n e.type = 'mouseenter';\n this._onPointerEvent(e);\n }\n e.type = eventType;\n }\n else {\n this._hoveredFeatures = null;\n }\n }\n}\nMaplibre.savedMaps = [];\nexport default Maplibre;\n//# sourceMappingURL=maplibre.js.map","/** These methods may break the react binding if called directly */\nconst skipMethods = [\n 'setMaxBounds',\n 'setMinZoom',\n 'setMaxZoom',\n 'setMinPitch',\n 'setMaxPitch',\n 'setRenderWorldCopies',\n 'setProjection',\n 'setStyle',\n 'addSource',\n 'removeSource',\n 'addLayer',\n 'removeLayer',\n 'setLayerZoomRange',\n 'setFilter',\n 'setPaintProperty',\n 'setLayoutProperty',\n 'setLight',\n 'setTerrain',\n 'setFog',\n 'remove'\n];\nexport default function createRef(mapInstance) {\n if (!mapInstance) {\n return null;\n }\n const map = mapInstance.map;\n const result = {\n getMap: () => map\n };\n for (const key of getMethodNames(map)) {\n // @ts-expect-error\n if (!(key in result) && !skipMethods.includes(key)) {\n result[key] = map[key].bind(map);\n }\n }\n return result;\n}\nfunction getMethodNames(obj) {\n const result = new Set();\n let proto = obj;\n while (proto) {\n for (const key of Object.getOwnPropertyNames(proto)) {\n if (key[0] !== '_' &&\n typeof obj[key] === 'function' &&\n key !== 'fire' &&\n key !== 'setEventedParent') {\n result.add(key);\n }\n }\n proto = Object.getPrototypeOf(proto);\n }\n return Array.from(result);\n}\n//# sourceMappingURL=create-ref.js.map","// From https://github.com/streamich/react-use/blob/master/src/useIsomorphicLayoutEffect.ts\n// useLayoutEffect but does not trigger warning in server-side rendering\nimport { useEffect, useLayoutEffect } from 'react';\nconst useIsomorphicLayoutEffect = typeof document !== 'undefined' ? useLayoutEffect : useEffect;\nexport default useIsomorphicLayoutEffect;\n//# sourceMappingURL=use-isomorphic-layout-effect.js.map","export default function setGlobals(mapLib, props) {\n const { RTLTextPlugin, maxParallelImageRequests, workerCount, workerUrl } = props;\n if (RTLTextPlugin &&\n mapLib.getRTLTextPluginStatus &&\n mapLib.getRTLTextPluginStatus() === 'unavailable') {\n const { pluginUrl, lazy = true } = typeof RTLTextPlugin === 'string' ? { pluginUrl: RTLTextPlugin } : RTLTextPlugin;\n mapLib.setRTLTextPlugin(pluginUrl, (error) => {\n if (error) {\n // eslint-disable-next-line\n console.error(error);\n }\n }, lazy);\n }\n if (maxParallelImageRequests !== undefined) {\n mapLib.setMaxParallelImageRequests(maxParallelImageRequests);\n }\n if (workerCount !== undefined) {\n mapLib.setWorkerCount(workerCount);\n }\n if (workerUrl !== undefined) {\n mapLib.setWorkerUrl(workerUrl);\n }\n}\n//# sourceMappingURL=set-globals.js.map","import * as React from 'react';\nimport { useState, useRef, useEffect, useContext, useMemo, useImperativeHandle } from 'react';\nimport { MountedMapsContext } from \"./use-map.js\";\nimport Maplibre from \"../maplibre/maplibre.js\";\nimport createRef from \"../maplibre/create-ref.js\";\nimport useIsomorphicLayoutEffect from \"../utils/use-isomorphic-layout-effect.js\";\nimport setGlobals from \"../utils/set-globals.js\";\nexport const MapContext = React.createContext(null);\nfunction _Map(props, ref) {\n const mountedMapsContext = useContext(MountedMapsContext);\n const [mapInstance, setMapInstance] = useState(null);\n const containerRef = useRef();\n const { current: contextValue } = useRef({ mapLib: null, map: null });\n useEffect(() => {\n const mapLib = props.mapLib;\n let isMounted = true;\n let maplibre;\n Promise.resolve(mapLib || import('maplibre-gl'))\n .then((module) => {\n if (!isMounted) {\n return;\n }\n if (!module) {\n throw new Error('Invalid mapLib');\n }\n const mapboxgl = 'Map' in module ? module : module.default;\n if (!mapboxgl.Map) {\n throw new Error('Invalid mapLib');\n }\n setGlobals(mapboxgl, props);\n if (props.reuseMaps) {\n maplibre = Maplibre.reuse(props, containerRef.current);\n }\n if (!maplibre) {\n maplibre = new Maplibre(mapboxgl.Map, props, containerRef.current);\n }\n contextValue.map = createRef(maplibre);\n contextValue.mapLib = mapboxgl;\n setMapInstance(maplibre);\n mountedMapsContext?.onMapMount(contextValue.map, props.id);\n })\n .catch(error => {\n const { onError } = props;\n if (onError) {\n onError({\n type: 'error',\n target: null,\n originalEvent: null,\n error\n });\n }\n else {\n console.error(error); // eslint-disable-line\n }\n });\n return () => {\n isMounted = false;\n if (maplibre) {\n mountedMapsContext?.onMapUnmount(props.id);\n if (props.reuseMaps) {\n maplibre.recycle();\n }\n else {\n maplibre.destroy();\n }\n }\n };\n }, []);\n useIsomorphicLayoutEffect(() => {\n if (mapInstance) {\n mapInstance.setProps(props);\n }\n });\n useImperativeHandle(ref, () => contextValue.map, [mapInstance]);\n const style = useMemo(() => ({\n position: 'relative',\n width: '100%',\n height: '100%',\n ...props.style\n }), [props.style]);\n const CHILD_CONTAINER_STYLE = {\n height: '100%'\n };\n return (React.createElement(\"div\", { id: props.id, ref: containerRef, style: style }, mapInstance && (React.createElement(MapContext.Provider, { value: contextValue },\n React.createElement(\"div\", { \"mapboxgl-children\": \"\", style: CHILD_CONTAINER_STYLE }, props.children)))));\n}\nexport const Map = React.forwardRef(_Map);\n//# sourceMappingURL=map.js.map","// This is a simplified version of\n// https://github.com/facebook/react/blob/4131af3e4bf52f3a003537ec95a1655147c81270/src/renderers/dom/shared/CSSPropertyOperations.js#L62\nconst unitlessNumber = /box|flex|grid|column|lineHeight|fontWeight|opacity|order|tabSize|zIndex/;\nexport function applyReactStyle(element, styles) {\n if (!element || !styles) {\n return;\n }\n const style = element.style;\n for (const key in styles) {\n const value = styles[key];\n if (Number.isFinite(value) && !unitlessNumber.test(key)) {\n style[key] = `${value}px`;\n }\n else {\n style[key] = value;\n }\n }\n}\n//# sourceMappingURL=apply-react-style.js.map","/** Compare two classNames string and return the difference */\nexport function compareClassNames(prevClassName, nextClassName) {\n if (prevClassName === nextClassName) {\n return null;\n }\n const prevClassList = getClassList(prevClassName);\n const nextClassList = getClassList(nextClassName);\n const diff = [];\n for (const c of nextClassList) {\n if (!prevClassList.has(c)) {\n diff.push(c);\n }\n }\n for (const c of prevClassList) {\n if (!nextClassList.has(c)) {\n diff.push(c);\n }\n }\n return diff.length === 0 ? null : diff;\n}\nfunction getClassList(className) {\n return new Set(className ? className.trim().split(/\\s+/) : []);\n}\n//# sourceMappingURL=compare-class-names.js.map","/* global document */\nimport * as React from 'react';\nimport { createPortal } from 'react-dom';\nimport { useImperativeHandle, useEffect, useMemo, useRef, useContext, forwardRef, memo } from 'react';\nimport { applyReactStyle } from \"../utils/apply-react-style.js\";\nimport { MapContext } from \"./map.js\";\nimport { arePointsEqual } from \"../utils/deep-equal.js\";\nimport { compareClassNames } from \"../utils/compare-class-names.js\";\n/* eslint-disable complexity,max-statements */\nexport const Marker = memo(forwardRef((props, ref) => {\n const { map, mapLib } = useContext(MapContext);\n const thisRef = useRef({ props });\n const marker = useMemo(() => {\n let hasChildren = false;\n React.Children.forEach(props.children, el => {\n if (el) {\n hasChildren = true;\n }\n });\n const options = {\n ...props,\n element: hasChildren ? document.createElement('div') : undefined\n };\n const mk = new mapLib.Marker(options);\n mk.setLngLat([props.longitude, props.latitude]);\n mk.getElement().addEventListener('click', (e) => {\n thisRef.current.props.onClick?.({\n type: 'click',\n target: mk,\n originalEvent: e\n });\n });\n mk.on('dragstart', e => {\n const evt = e;\n evt.lngLat = marker.getLngLat();\n thisRef.current.props.onDragStart?.(evt);\n });\n mk.on('drag', e => {\n const evt = e;\n evt.lngLat = marker.getLngLat();\n thisRef.current.props.onDrag?.(evt);\n });\n mk.on('dragend', e => {\n const evt = e;\n evt.lngLat = marker.getLngLat();\n thisRef.current.props.onDragEnd?.(evt);\n });\n return mk;\n }, []);\n useEffect(() => {\n marker.addTo(map.getMap());\n return () => {\n marker.remove();\n };\n }, []);\n const { longitude, latitude, offset, style, draggable = false, popup = null, rotation = 0, rotationAlignment = 'auto', pitchAlignment = 'auto' } = props;\n useEffect(() => {\n applyReactStyle(marker.getElement(), style);\n }, [style]);\n useImperativeHandle(ref, () => marker, []);\n const oldProps = thisRef.current.props;\n if (marker.getLngLat().lng !== longitude || marker.getLngLat().lat !== latitude) {\n marker.setLngLat([longitude, latitude]);\n }\n if (offset && !arePointsEqual(marker.getOffset(), offset)) {\n marker.setOffset(offset);\n }\n if (marker.isDraggable() !== draggable) {\n marker.setDraggable(draggable);\n }\n if (marker.getRotation() !== rotation) {\n marker.setRotation(rotation);\n }\n if (marker.getRotationAlignment() !== rotationAlignment) {\n marker.setRotationAlignment(rotationAlignment);\n }\n if (marker.getPitchAlignment() !== pitchAlignment) {\n marker.setPitchAlignment(pitchAlignment);\n }\n if (marker.getPopup() !== popup) {\n marker.setPopup(popup);\n }\n const classNameDiff = compareClassNames(oldProps.className, props.className);\n if (classNameDiff) {\n for (const c of classNameDiff) {\n marker.toggleClassName(c);\n }\n }\n thisRef.current.props = props;\n return createPortal(props.children, marker.getElement());\n}));\n//# sourceMappingURL=marker.js.map","import { useContext, useMemo, useEffect } from 'react';\nimport { MapContext } from \"./map.js\";\nexport function useControl(onCreate, arg1, arg2, arg3) {\n const context = useContext(MapContext);\n const ctrl = useMemo(() => onCreate(context), []);\n useEffect(() => {\n const opts = (arg3 || arg2 || arg1);\n const onAdd = typeof arg1 === 'function' && typeof arg2 === 'function' ? arg1 : null;\n const onRemove = typeof arg2 === 'function' ? arg2 : typeof arg1 === 'function' ? arg1 : null;\n const { map } = context;\n if (!map.hasControl(ctrl)) {\n map.addControl(ctrl, opts?.position);\n if (onAdd) {\n onAdd(context);\n }\n }\n return () => {\n if (onRemove) {\n onRemove(context);\n }\n // Map might have been removed (parent effects are destroyed before child ones)\n if (map.hasControl(ctrl)) {\n map.removeControl(ctrl);\n }\n };\n }, []);\n return ctrl;\n}\n//# sourceMappingURL=use-control.js.map","import { useEffect, memo } from 'react';\nimport { applyReactStyle } from \"../utils/apply-react-style.js\";\nimport { useControl } from \"./use-control.js\";\nfunction _NavigationControl(props) {\n const ctrl = useControl(({ mapLib }) => new mapLib.NavigationControl(props), {\n position: props.position\n });\n useEffect(() => {\n applyReactStyle(ctrl._container, props.style);\n }, [props.style]);\n return null;\n}\nexport const NavigationControl = memo(_NavigationControl);\n//# sourceMappingURL=navigation-control.js.map","export default function assert(condition, message) {\n if (!condition) {\n throw new Error(message);\n }\n}\n//# sourceMappingURL=assert.js.map","import * as React from 'react';\nimport { useContext, useEffect, useMemo, useState, useRef, cloneElement } from 'react';\nimport { MapContext } from \"./map.js\";\nimport assert from \"../utils/assert.js\";\nimport { deepEqual } from \"../utils/deep-equal.js\";\nlet sourceCounter = 0;\nfunction createSource(map, id, props) {\n // @ts-ignore\n if (map.style && map.style._loaded) {\n const options = { ...props };\n delete options.id;\n delete options.children;\n // @ts-ignore\n map.addSource(id, options);\n return map.getSource(id);\n }\n return null;\n}\n/* eslint-disable complexity */\nfunction updateSource(source, props, prevProps) {\n assert(props.id === prevProps.id, 'source id changed');\n assert(props.type === prevProps.type, 'source type changed');\n let changedKey = '';\n let changedKeyCount = 0;\n for (const key in props) {\n if (key !== 'children' && key !== 'id' && !deepEqual(prevProps[key], props[key])) {\n changedKey = key;\n changedKeyCount++;\n }\n }\n if (!changedKeyCount) {\n return;\n }\n const type = props.type;\n if (type === 'geojson') {\n source.setData(props.data);\n }\n else if (type === 'image') {\n source.updateImage({\n url: props.url,\n coordinates: props.coordinates\n });\n }\n else {\n switch (changedKey) {\n case 'coordinates':\n // @ts-ignore\n source.setCoordinates?.(props.coordinates);\n break;\n case 'url':\n // @ts-ignore\n source.setUrl?.(props.url);\n break;\n case 'tiles':\n // @ts-ignore\n source.setTiles?.(props.tiles);\n break;\n default:\n // eslint-disable-next-line\n console.warn(`Unable to update <Source> prop: ${changedKey}`);\n }\n }\n}\n/* eslint-enable complexity */\nexport function Source(props) {\n const map = useContext(MapContext).map.getMap();\n const propsRef = useRef(props);\n const [, setStyleLoaded] = useState(0);\n const id = useMemo(() => props.id || `jsx-source-${sourceCounter++}`, []);\n useEffect(() => {\n if (map) {\n /* global setTimeout */\n const forceUpdate = () => setTimeout(() => setStyleLoaded(version => version + 1), 0);\n map.on('styledata', forceUpdate);\n forceUpdate();\n return () => {\n map.off('styledata', forceUpdate);\n // @ts-ignore\n if (map.style && map.style._loaded && map.getSource(id)) {\n // Parent effects are destroyed before child ones, see\n // https://github.com/facebook/react/issues/16728\n // Source can only be removed after all child layers are removed\n const allLayers = map.getStyle()?.layers;\n if (allLayers) {\n for (const layer of allLayers) {\n // @ts-ignore (2339) source does not exist on all layer types\n if (layer.source === id) {\n map.removeLayer(layer.id);\n }\n }\n }\n map.removeSource(id);\n }\n };\n }\n return undefined;\n }, [map]);\n // @ts-ignore\n let source = map && map.style && map.getSource(id);\n if (source) {\n updateSource(source, props, propsRef.current);\n }\n else {\n source = createSource(map, id, props);\n }\n propsRef.current = props;\n return ((source &&\n React.Children.map(props.children, child => child &&\n cloneElement(child, {\n source: id\n }))) ||\n null);\n}\n//# sourceMappingURL=source.js.map","import { useContext, useEffect, useMemo, useState, useRef } from 'react';\nimport { MapContext } from \"./map.js\";\nimport assert from \"../utils/assert.js\";\nimport { deepEqual } from \"../utils/deep-equal.js\";\n/* eslint-disable complexity, max-statements */\nfunction updateLayer(map, id, props, prevProps) {\n assert(props.id === prevProps.id, 'layer id changed');\n assert(props.type === prevProps.type, 'layer type changed');\n if (props.type === 'custom' || prevProps.type === 'custom') {\n return;\n }\n // @ts-ignore filter does not exist in some Layer types\n const { layout = {}, paint = {}, filter, minzoom, maxzoom, beforeId } = props;\n if (beforeId !== prevProps.beforeId) {\n map.moveLayer(id, beforeId);\n }\n if (layout !== prevProps.layout) {\n const prevLayout = prevProps.layout || {};\n for (const key in layout) {\n if (!deepEqual(layout[key], prevLayout[key])) {\n map.setLayoutProperty(id, key, layout[key]);\n }\n }\n for (const key in prevLayout) {\n if (!layout.hasOwnProperty(key)) {\n map.setLayoutProperty(id, key, undefined);\n }\n }\n }\n if (paint !== prevProps.paint) {\n const prevPaint = prevProps.paint || {};\n for (const key in paint) {\n if (!deepEqual(paint[key], prevPaint[key])) {\n map.setPaintProperty(id, key, paint[key]);\n }\n }\n for (const key in prevPaint) {\n if (!paint.hasOwnProperty(key)) {\n map.setPaintProperty(id, key, undefined);\n }\n }\n }\n // @ts-ignore filter does not exist in some Layer types\n if (!deepEqual(filter, prevProps.filter)) {\n map.setFilter(id, filter);\n }\n if (minzoom !== prevProps.minzoom || maxzoom !== prevProps.maxzoom) {\n map.setLayerZoomRange(id, minzoom, maxzoom);\n }\n}\nfunction createLayer(map, id, props) {\n // @ts-ignore\n if (map.style && map.style._loaded && (!('source' in props) || map.getSource(props.source))) {\n const options = { ...props, id };\n delete options.beforeId;\n // @ts-ignore\n map.addLayer(options, props.beforeId);\n }\n}\n/* eslint-enable complexity, max-statements */\nlet layerCounter = 0;\nexport function Layer(props) {\n const map = useContext(MapContext).map.getMap();\n const propsRef = useRef(props);\n const [, setStyleLoaded] = useState(0);\n const id = useMemo(() => props.id || `jsx-layer-${layerCounter++}`, []);\n useEffect(() => {\n if (map) {\n const forceUpdate = () => setStyleLoaded(version => version + 1);\n map.on('styledata', forceUpdate);\n forceUpdate();\n return () => {\n map.off('styledata', forceUpdate);\n // @ts-ignore\n if (map.style && map.style._loaded && map.getLayer(id)) {\n map.removeLayer(id);\n }\n };\n }\n return undefined;\n }, [map]);\n // @ts-ignore\n const layer = map && map.style && map.getLayer(id);\n if (layer) {\n try {\n updateLayer(map, id, props, propsRef.current);\n }\n catch (error) {\n console.warn(error); // eslint-disable-line\n }\n }\n else {\n createLayer(map, id, props);\n }\n // Store last rendered props\n propsRef.current = props;\n return null;\n}\n//# sourceMappingURL=layer.js.map"],"file":"lib-vis.gl-react-maplibre-C7-0xNFC.js","debugId":"bbfb4c4d-1427-4234-9b21-f00bb5c20b43"}