uomtiles 0.1.2 → 0.1.3

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 (303) hide show
  1. package/.output/nitro.json +1 -1
  2. package/.output/public/_nuxt/7KYNy7kZ.js +1 -0
  3. package/.output/public/_nuxt/7Rgc2iDI2.js +1 -0
  4. package/.output/public/_nuxt/BA52uD81.js +1 -0
  5. package/.output/public/_nuxt/{CU486JdV2.js → BHSn2vP72.js} +2 -2
  6. package/.output/public/_nuxt/BRsHq3Fz2.js +1 -0
  7. package/.output/public/_nuxt/Bh2Uv1S7.js +1 -0
  8. package/.output/public/_nuxt/BiRI-vq-.js +1 -0
  9. package/.output/public/_nuxt/Bpc1HTfh.js +1 -0
  10. package/.output/public/_nuxt/C-b4mqsD.js +1 -0
  11. package/.output/public/_nuxt/C5Y76DD6.js +1 -0
  12. package/.output/public/_nuxt/CD84FXNW.js +1 -0
  13. package/.output/public/_nuxt/CGkIG2vL2.js +1 -0
  14. package/.output/public/_nuxt/CM9IbYJz.js +1 -0
  15. package/.output/public/_nuxt/CUJ4QmLF.js +1 -0
  16. package/.output/public/_nuxt/CUQ3MZqI.js +1 -0
  17. package/.output/public/_nuxt/CVwoxklV.js +1 -0
  18. package/.output/public/_nuxt/CeHZqNQ0.js +1 -0
  19. package/.output/public/_nuxt/CkfS_Wbu.js +3 -0
  20. package/.output/public/_nuxt/CoPjdBwX.js +1 -0
  21. package/.output/public/_nuxt/CxkDmpVY.js +1 -0
  22. package/.output/public/_nuxt/CzRdWh7s2.js +1 -0
  23. package/.output/public/_nuxt/D-IOtyQX.js +1 -0
  24. package/.output/public/_nuxt/D3Us7gX72.js +1 -0
  25. package/.output/public/_nuxt/{DaQqwE3R.js → D8GHPYwQ.js} +44 -44
  26. package/.output/public/_nuxt/DLIy3f3M.js +1 -0
  27. package/.output/public/_nuxt/{CovBj6WN.js → DQ8r1OSk.js} +1 -1
  28. package/.output/public/_nuxt/D_9SjQFe.js +1 -0
  29. package/.output/public/_nuxt/D_Ggu6R_2.js +1 -0
  30. package/.output/public/_nuxt/{Q79ec-Ro.js → DnVJUY7B.js} +1 -1
  31. package/.output/public/_nuxt/{Bd1EvHmY.js → DuGgjt-h2.js} +1 -1
  32. package/.output/public/_nuxt/GEOST6As.js +1 -0
  33. package/.output/public/_nuxt/{DpIPeY5m.js → GqgcWtrL.js} +1 -1
  34. package/.output/public/_nuxt/{0hm88Oke.js → Hbp_Okvs.js} +1 -1
  35. package/.output/public/_nuxt/JdUwgqKv.js +1 -0
  36. package/.output/public/_nuxt/KttxEAyP2.js +1 -0
  37. package/.output/public/_nuxt/L0GXeO1Y2.js +1 -0
  38. package/.output/public/_nuxt/builds/latest.json +1 -1
  39. package/.output/public/_nuxt/builds/meta/ad8f3148-5aa4-4a0f-8e7a-e55147c5de1a.json +1 -0
  40. package/.output/public/_nuxt/entry.U-KS0GEu.css +1 -0
  41. package/.output/public/_nuxt/sMWyPZfC2.js +1 -0
  42. package/.output/public/_nuxt/zUWhKXtw2.js +1 -0
  43. package/.output/server/chunks/_/antigravity-nfz.mjs +629 -0
  44. package/.output/server/chunks/_/antigravity-nfz.mjs.map +1 -0
  45. package/.output/server/chunks/_/config.mjs +1 -1
  46. package/.output/server/chunks/_/file-workspace.mjs +1 -1
  47. package/.output/server/chunks/_/map-layer-update-manager.mjs +770 -0
  48. package/.output/server/chunks/_/map-layer-update-manager.mjs.map +1 -0
  49. package/.output/server/chunks/_/map-service.mjs +1 -1
  50. package/.output/server/chunks/_/uom-auth.mjs +1 -1
  51. package/.output/server/chunks/build/{CompletedTaskSelect-CKTpyHS3.mjs → CompletedTaskSelect-Ba03kTs9.mjs} +6 -7
  52. package/.output/server/chunks/build/{CompletedTaskSelect-CKTpyHS3.mjs.map → CompletedTaskSelect-Ba03kTs9.mjs.map} +1 -1
  53. package/.output/server/chunks/build/{Empty-BGIn09cL.mjs → Empty-CKvANuoV.mjs} +4 -103
  54. package/.output/server/chunks/build/Empty-CKvANuoV.mjs.map +1 -0
  55. package/.output/server/chunks/build/{FormField-DnJWfrKE.mjs → FormField-BJHVyy1m.mjs} +4 -35
  56. package/.output/server/chunks/build/FormField-BJHVyy1m.mjs.map +1 -0
  57. package/.output/server/chunks/build/{Input-AdlINKtJ.mjs → Input-DnAric-z.mjs} +1 -1
  58. package/.output/server/chunks/build/{Input-AdlINKtJ.mjs.map → Input-DnAric-z.mjs.map} +1 -1
  59. package/.output/server/chunks/build/MapLayerControl-DpNmYvcU.mjs +5720 -0
  60. package/.output/server/chunks/build/MapLayerControl-DpNmYvcU.mjs.map +1 -0
  61. package/.output/server/chunks/build/{Modal-CozaqIp1.mjs → Modal-BLhN9Eg2.mjs} +4 -18
  62. package/.output/server/chunks/build/{Modal-CozaqIp1.mjs.map → Modal-BLhN9Eg2.mjs.map} +1 -1
  63. package/.output/server/chunks/build/{OnlineMap-cFSicmkV.mjs → OnlineMap-B-sCfHkC.mjs} +6 -3
  64. package/.output/server/chunks/build/OnlineMap-B-sCfHkC.mjs.map +1 -0
  65. package/.output/server/chunks/build/{Pagination-GvNCxmOW.mjs → Pagination-CUzoLc_-.mjs} +1 -1
  66. package/.output/server/chunks/build/{Pagination-GvNCxmOW.mjs.map → Pagination-CUzoLc_-.mjs.map} +1 -1
  67. package/.output/server/chunks/build/Skeleton-CHp-GjOx.mjs +59 -0
  68. package/.output/server/chunks/build/Skeleton-CHp-GjOx.mjs.map +1 -0
  69. package/.output/server/chunks/build/{Slider-zQx1c7hB.mjs → Slider-CrIUK3pl.mjs} +5 -5
  70. package/.output/server/chunks/build/{Slider-zQx1c7hB.mjs.map → Slider-CrIUK3pl.mjs.map} +1 -1
  71. package/.output/server/chunks/build/{MapBaseLayerTabs-CRl5Zwlr.mjs → Tabs-cdLsZZoL.mjs} +429 -931
  72. package/.output/server/chunks/build/Tabs-cdLsZZoL.mjs.map +1 -0
  73. package/.output/server/chunks/build/{Tooltip-DNUdH4oF.mjs → Tooltip-DExIlyhu.mjs} +4 -195
  74. package/.output/server/chunks/build/Tooltip-DExIlyhu.mjs.map +1 -0
  75. package/.output/server/chunks/build/{advanced-5ZGMUBqC.mjs → advanced-DaSpS8Px.mjs} +31 -34
  76. package/.output/server/chunks/build/advanced-DaSpS8Px.mjs.map +1 -0
  77. package/.output/server/chunks/build/{compare-CtgF4Anj.mjs → compare-DaE10Dhp.mjs} +56 -37
  78. package/.output/server/chunks/build/compare-DaE10Dhp.mjs.map +1 -0
  79. package/.output/server/chunks/build/cookie-CziAmOf1.mjs +175 -0
  80. package/.output/server/chunks/build/cookie-CziAmOf1.mjs.map +1 -0
  81. package/.output/server/chunks/build/{dashboard-GneN-WPG.mjs → dashboard-Dq8mphss.mjs} +12 -6
  82. package/.output/server/chunks/build/{dashboard-GneN-WPG.mjs.map → dashboard-Dq8mphss.mjs.map} +1 -1
  83. package/.output/server/chunks/build/{details-CgufnL1d.mjs → details-DCNvSBgn.mjs} +5 -4
  84. package/.output/server/chunks/build/{details-CgufnL1d.mjs.map → details-DCNvSBgn.mjs.map} +1 -1
  85. package/.output/server/chunks/build/error-404-D9aQjJRn.mjs +1 -1
  86. package/.output/server/chunks/build/error-500-BNyA3wrb.mjs +1 -1
  87. package/.output/server/chunks/build/file-workspace-DMzPuPyG.mjs +104 -0
  88. package/.output/server/chunks/build/file-workspace-DMzPuPyG.mjs.map +1 -0
  89. package/.output/server/chunks/build/{interval-9B2MrM2e.mjs → interval-i5OZnTaK.mjs} +2 -2
  90. package/.output/server/chunks/build/{interval-9B2MrM2e.mjs.map → interval-i5OZnTaK.mjs.map} +1 -1
  91. package/.output/server/chunks/build/layers-50nqoWES.mjs +553 -0
  92. package/.output/server/chunks/build/layers-50nqoWES.mjs.map +1 -0
  93. package/.output/server/chunks/build/{login-Cf5EiCE4.mjs → login-BHSHtO-R.mjs} +6 -5
  94. package/.output/server/chunks/build/{login-Cf5EiCE4.mjs.map → login-BHSHtO-R.mjs.map} +1 -1
  95. package/.output/server/chunks/build/map-layers-C3HJoCLw.mjs +86 -0
  96. package/.output/server/chunks/build/map-layers-C3HJoCLw.mjs.map +1 -0
  97. package/.output/server/chunks/build/{DashboardSidebarToggle-CUI9NSow.mjs → overlay-BS4_B29H.mjs} +411 -4
  98. package/.output/server/chunks/build/overlay-BS4_B29H.mjs.map +1 -0
  99. package/.output/server/chunks/build/pages-5yYRS5nX.mjs +37 -0
  100. package/.output/server/chunks/build/pages-5yYRS5nX.mjs.map +1 -0
  101. package/.output/server/chunks/build/{pages-0c5sp_lv.mjs → pages-DfOPr0fC.mjs} +21 -21
  102. package/.output/server/chunks/build/pages-DfOPr0fC.mjs.map +1 -0
  103. package/.output/server/chunks/build/{services-BB49kSpd.mjs → services-DWlDpsbi.mjs} +45 -41
  104. package/.output/server/chunks/build/{services-BB49kSpd.mjs.map → services-DWlDpsbi.mjs.map} +1 -1
  105. package/.output/server/chunks/build/{tasks-BRcMLuRW.mjs → tasks-4b6D39Uy.mjs} +44 -100
  106. package/.output/server/chunks/build/{tasks-BRcMLuRW.mjs.map → tasks-4b6D39Uy.mjs.map} +1 -1
  107. package/.output/server/chunks/build/{tasks-Aa8PwjVL.mjs → tasks-BPPx2UMG.mjs} +10 -6
  108. package/.output/server/chunks/build/tasks-BPPx2UMG.mjs.map +1 -0
  109. package/.output/server/chunks/nitro/nitro.mjs +303 -244
  110. package/.output/server/chunks/routes/api/map/layers/_overlayLayer/update.get.mjs +29 -0
  111. package/.output/server/chunks/routes/api/map/layers/_overlayLayer/update.get.mjs.map +1 -0
  112. package/.output/server/chunks/routes/api/map/layers/_overlayLayer/update.post.mjs +31 -0
  113. package/.output/server/chunks/routes/api/map/layers/_overlayLayer/update.post.mjs.map +1 -0
  114. package/.output/server/chunks/routes/api/map/layers/_overlayLayer_.get.mjs +39 -0
  115. package/.output/server/chunks/routes/api/map/layers/_overlayLayer_.get.mjs.map +1 -0
  116. package/.output/server/chunks/routes/api/map/layers/status.get.mjs +60 -0
  117. package/.output/server/chunks/routes/api/map/layers/status.get.mjs.map +1 -0
  118. package/.output/server/chunks/routes/api/map/live/status.get.mjs +1 -1
  119. package/.output/server/chunks/routes/api/map/online/_layerGroup/_zoom/_tileX/_tileY_.get.mjs +1 -1
  120. package/.output/server/chunks/routes/api/map/online-root/_layerGroup/_rootX/_rootY_.get.mjs +1 -1
  121. package/.output/server/chunks/routes/api/workspace/_filename/analysis.get.mjs +1 -1
  122. package/.output/server/chunks/routes/api/workspace/_filename/download.get.mjs +1 -1
  123. package/.output/server/chunks/routes/api/workspace/_filename/export/_format_.get.mjs +1 -1
  124. package/.output/server/chunks/routes/api/workspace/_filename/export-estimate.get.mjs +1 -1
  125. package/.output/server/chunks/routes/api/workspace/_filename/tile.get.mjs +1 -1
  126. package/.output/server/chunks/routes/api/workspace/_filename/tiles.get.mjs +1 -1
  127. package/.output/server/chunks/routes/api/workspace/_filename_.delete.mjs +1 -1
  128. package/.output/server/chunks/routes/api/workspace/compare/batch.get.mjs +1 -1
  129. package/.output/server/chunks/routes/api/workspace/files.post.mjs +1 -1
  130. package/.output/server/chunks/routes/api/workspace/stop.post.mjs +1 -1
  131. package/.output/server/chunks/routes/api/workspace/tasks.post.mjs +2 -2
  132. package/.output/server/chunks/routes/renderer.mjs +3 -3
  133. package/.output/server/chunks/routes/services/wms.get.mjs +1 -1
  134. package/.output/server/chunks/routes/services/wmts.get.mjs +1 -1
  135. package/.output/server/chunks/virtual/entry.mjs +320 -443
  136. package/.output/server/chunks/virtual/entry.mjs.map +1 -1
  137. package/.output/server/chunks/virtual/precomputed.mjs +1 -1
  138. package/.output/server/chunks/virtual/styles.mjs +1 -1
  139. package/.output/server/node_modules/undici/index.js +234 -0
  140. package/.output/server/node_modules/undici/lib/api/abort-signal.js +59 -0
  141. package/.output/server/node_modules/undici/lib/api/api-connect.js +110 -0
  142. package/.output/server/node_modules/undici/lib/api/api-pipeline.js +252 -0
  143. package/.output/server/node_modules/undici/lib/api/api-request.js +214 -0
  144. package/.output/server/node_modules/undici/lib/api/api-stream.js +209 -0
  145. package/.output/server/node_modules/undici/lib/api/api-upgrade.js +111 -0
  146. package/.output/server/node_modules/undici/lib/api/index.js +7 -0
  147. package/.output/server/node_modules/undici/lib/api/readable.js +580 -0
  148. package/.output/server/node_modules/undici/lib/cache/memory-cache-store.js +279 -0
  149. package/.output/server/node_modules/undici/lib/cache/sqlite-cache-store.js +467 -0
  150. package/.output/server/node_modules/undici/lib/core/connect.js +153 -0
  151. package/.output/server/node_modules/undici/lib/core/constants.js +143 -0
  152. package/.output/server/node_modules/undici/lib/core/diagnostics.js +227 -0
  153. package/.output/server/node_modules/undici/lib/core/errors.js +477 -0
  154. package/.output/server/node_modules/undici/lib/core/request.js +464 -0
  155. package/.output/server/node_modules/undici/lib/core/socks5-client.js +422 -0
  156. package/.output/server/node_modules/undici/lib/core/socks5-utils.js +212 -0
  157. package/.output/server/node_modules/undici/lib/core/symbols.js +75 -0
  158. package/.output/server/node_modules/undici/lib/core/tree.js +160 -0
  159. package/.output/server/node_modules/undici/lib/core/util.js +992 -0
  160. package/.output/server/node_modules/undici/lib/dispatcher/agent.js +158 -0
  161. package/.output/server/node_modules/undici/lib/dispatcher/balanced-pool.js +219 -0
  162. package/.output/server/node_modules/undici/lib/dispatcher/client-h1.js +1731 -0
  163. package/.output/server/node_modules/undici/lib/dispatcher/client-h2.js +995 -0
  164. package/.output/server/node_modules/undici/lib/dispatcher/client.js +664 -0
  165. package/.output/server/node_modules/undici/lib/dispatcher/dispatcher-base.js +184 -0
  166. package/.output/server/node_modules/undici/lib/dispatcher/dispatcher.js +48 -0
  167. package/.output/server/node_modules/undici/lib/dispatcher/env-http-proxy-agent.js +146 -0
  168. package/.output/server/node_modules/undici/lib/dispatcher/fixed-queue.js +135 -0
  169. package/.output/server/node_modules/undici/lib/dispatcher/h2c-client.js +51 -0
  170. package/.output/server/node_modules/undici/lib/dispatcher/pool-base.js +214 -0
  171. package/.output/server/node_modules/undici/lib/dispatcher/pool.js +118 -0
  172. package/.output/server/node_modules/undici/lib/dispatcher/proxy-agent.js +319 -0
  173. package/.output/server/node_modules/undici/lib/dispatcher/retry-agent.js +35 -0
  174. package/.output/server/node_modules/undici/lib/dispatcher/round-robin-pool.js +137 -0
  175. package/.output/server/node_modules/undici/lib/dispatcher/socks5-proxy-agent.js +260 -0
  176. package/.output/server/node_modules/undici/lib/encoding/index.js +33 -0
  177. package/.output/server/node_modules/undici/lib/global.js +59 -0
  178. package/.output/server/node_modules/undici/lib/handler/cache-handler.js +760 -0
  179. package/.output/server/node_modules/undici/lib/handler/cache-revalidation-handler.js +124 -0
  180. package/.output/server/node_modules/undici/lib/handler/decorator-handler.js +67 -0
  181. package/.output/server/node_modules/undici/lib/handler/deduplication-handler.js +460 -0
  182. package/.output/server/node_modules/undici/lib/handler/redirect-handler.js +238 -0
  183. package/.output/server/node_modules/undici/lib/handler/retry-handler.js +418 -0
  184. package/.output/server/node_modules/undici/lib/handler/unwrap-handler.js +106 -0
  185. package/.output/server/node_modules/undici/lib/handler/wrap-handler.js +105 -0
  186. package/.output/server/node_modules/undici/lib/interceptor/cache.js +602 -0
  187. package/.output/server/node_modules/undici/lib/interceptor/decompress.js +259 -0
  188. package/.output/server/node_modules/undici/lib/interceptor/deduplicate.js +117 -0
  189. package/.output/server/node_modules/undici/lib/interceptor/dns.js +571 -0
  190. package/.output/server/node_modules/undici/lib/interceptor/dump.js +112 -0
  191. package/.output/server/node_modules/undici/lib/interceptor/redirect.js +21 -0
  192. package/.output/server/node_modules/undici/lib/interceptor/response-error.js +95 -0
  193. package/.output/server/node_modules/undici/lib/interceptor/retry.js +19 -0
  194. package/.output/server/node_modules/undici/lib/llhttp/constants.js +531 -0
  195. package/.output/server/node_modules/undici/lib/llhttp/llhttp-wasm.js +15 -0
  196. package/.output/server/node_modules/undici/lib/llhttp/llhttp_simd-wasm.js +15 -0
  197. package/.output/server/node_modules/undici/lib/llhttp/utils.js +12 -0
  198. package/.output/server/node_modules/undici/lib/mock/mock-agent.js +232 -0
  199. package/.output/server/node_modules/undici/lib/mock/mock-call-history.js +248 -0
  200. package/.output/server/node_modules/undici/lib/mock/mock-client.js +68 -0
  201. package/.output/server/node_modules/undici/lib/mock/mock-errors.js +29 -0
  202. package/.output/server/node_modules/undici/lib/mock/mock-interceptor.js +209 -0
  203. package/.output/server/node_modules/undici/lib/mock/mock-pool.js +68 -0
  204. package/.output/server/node_modules/undici/lib/mock/mock-symbols.js +32 -0
  205. package/.output/server/node_modules/undici/lib/mock/mock-utils.js +486 -0
  206. package/.output/server/node_modules/undici/lib/mock/pending-interceptors-formatter.js +43 -0
  207. package/.output/server/node_modules/undici/lib/mock/snapshot-agent.js +353 -0
  208. package/.output/server/node_modules/undici/lib/mock/snapshot-recorder.js +588 -0
  209. package/.output/server/node_modules/undici/lib/mock/snapshot-utils.js +158 -0
  210. package/.output/server/node_modules/undici/lib/util/cache.js +676 -0
  211. package/.output/server/node_modules/undici/lib/util/date.js +670 -0
  212. package/.output/server/node_modules/undici/lib/util/promise.js +28 -0
  213. package/.output/server/node_modules/undici/lib/util/runtime-features.js +124 -0
  214. package/.output/server/node_modules/undici/lib/util/stats.js +32 -0
  215. package/.output/server/node_modules/undici/lib/util/timers.js +425 -0
  216. package/.output/server/node_modules/undici/lib/web/cache/cache.js +864 -0
  217. package/.output/server/node_modules/undici/lib/web/cache/cachestorage.js +152 -0
  218. package/.output/server/node_modules/undici/lib/web/cache/util.js +45 -0
  219. package/.output/server/node_modules/undici/lib/web/cookies/constants.js +12 -0
  220. package/.output/server/node_modules/undici/lib/web/cookies/index.js +199 -0
  221. package/.output/server/node_modules/undici/lib/web/cookies/parse.js +314 -0
  222. package/.output/server/node_modules/undici/lib/web/cookies/util.js +352 -0
  223. package/.output/server/node_modules/undici/lib/web/eventsource/eventsource-stream.js +399 -0
  224. package/.output/server/node_modules/undici/lib/web/eventsource/eventsource.js +501 -0
  225. package/.output/server/node_modules/undici/lib/web/eventsource/util.js +29 -0
  226. package/.output/server/node_modules/undici/lib/web/fetch/body.js +509 -0
  227. package/.output/server/node_modules/undici/lib/web/fetch/constants.js +131 -0
  228. package/.output/server/node_modules/undici/lib/web/fetch/data-url.js +596 -0
  229. package/.output/server/node_modules/undici/lib/web/fetch/formdata-parser.js +586 -0
  230. package/.output/server/node_modules/undici/lib/web/fetch/formdata.js +259 -0
  231. package/.output/server/node_modules/undici/lib/web/fetch/global.js +40 -0
  232. package/.output/server/node_modules/undici/lib/web/fetch/headers.js +719 -0
  233. package/.output/server/node_modules/undici/lib/web/fetch/index.js +2413 -0
  234. package/.output/server/node_modules/undici/lib/web/fetch/request.js +1115 -0
  235. package/.output/server/node_modules/undici/lib/web/fetch/response.js +641 -0
  236. package/.output/server/node_modules/undici/lib/web/fetch/util.js +1522 -0
  237. package/.output/server/node_modules/undici/lib/web/infra/index.js +229 -0
  238. package/.output/server/node_modules/undici/lib/web/subresource-integrity/subresource-integrity.js +307 -0
  239. package/.output/server/node_modules/undici/lib/web/webidl/index.js +1006 -0
  240. package/.output/server/node_modules/undici/lib/web/websocket/connection.js +329 -0
  241. package/.output/server/node_modules/undici/lib/web/websocket/constants.js +126 -0
  242. package/.output/server/node_modules/undici/lib/web/websocket/events.js +331 -0
  243. package/.output/server/node_modules/undici/lib/web/websocket/frame.js +133 -0
  244. package/.output/server/node_modules/undici/lib/web/websocket/permessage-deflate.js +100 -0
  245. package/.output/server/node_modules/undici/lib/web/websocket/receiver.js +507 -0
  246. package/.output/server/node_modules/undici/lib/web/websocket/sender.js +109 -0
  247. package/.output/server/node_modules/undici/lib/web/websocket/stream/websocketerror.js +104 -0
  248. package/.output/server/node_modules/undici/lib/web/websocket/stream/websocketstream.js +498 -0
  249. package/.output/server/node_modules/undici/lib/web/websocket/util.js +347 -0
  250. package/.output/server/node_modules/undici/lib/web/websocket/websocket.js +758 -0
  251. package/.output/server/node_modules/undici/package.json +152 -0
  252. package/.output/server/package.json +2 -1
  253. package/LICENSE +201 -2
  254. package/README.md +17 -4
  255. package/dist/package.json +3 -2
  256. package/dist/shared/antigravity-schema.js +45 -0
  257. package/dist/shared/dji-grid.js +62 -0
  258. package/dist/shared/types/map-layers.js +2 -0
  259. package/dist/src/cli.js +63 -5
  260. package/dist/src/core/dji-snapshot.js +135 -0
  261. package/dist/src/core/map-layer-paths.js +11 -0
  262. package/dist/src/map-layer-update.js +646 -0
  263. package/package.json +3 -2
  264. package/.output/public/_nuxt/BNfSclJ4.js +0 -1
  265. package/.output/public/_nuxt/BYzlinOr2.js +0 -1
  266. package/.output/public/_nuxt/Be4dNlar.js +0 -1
  267. package/.output/public/_nuxt/C7fHMLd7.js +0 -1
  268. package/.output/public/_nuxt/CNs_Ozdc.js +0 -1
  269. package/.output/public/_nuxt/CQ8inUdm.js +0 -1
  270. package/.output/public/_nuxt/Cc_JfSB1.js +0 -1
  271. package/.output/public/_nuxt/CyZDc0eO2.js +0 -1
  272. package/.output/public/_nuxt/CzFefJH0.js +0 -1
  273. package/.output/public/_nuxt/D-t0hXHB.js +0 -1
  274. package/.output/public/_nuxt/D3Pl7yw22.js +0 -1
  275. package/.output/public/_nuxt/D4gbGuiW.js +0 -1
  276. package/.output/public/_nuxt/DDp9lK3g.js +0 -1
  277. package/.output/public/_nuxt/DIIXHC50.js +0 -1
  278. package/.output/public/_nuxt/DWFUvzz0.js +0 -1
  279. package/.output/public/_nuxt/D_VoD6-f.js +0 -1
  280. package/.output/public/_nuxt/DfXX-x_z.js +0 -1
  281. package/.output/public/_nuxt/Dgyf2aNY.js +0 -1
  282. package/.output/public/_nuxt/GM5myUL22.js +0 -1
  283. package/.output/public/_nuxt/IC4wc76W.js +0 -1
  284. package/.output/public/_nuxt/IfL46N3Z.js +0 -1
  285. package/.output/public/_nuxt/KEU2l6zJ.js +0 -3
  286. package/.output/public/_nuxt/SEETjfdJ.js +0 -1
  287. package/.output/public/_nuxt/builds/meta/2c4adba2-91b5-44e4-91d3-50a61695207b.json +0 -1
  288. package/.output/public/_nuxt/entry.CZ_dkjcs.css +0 -1
  289. package/.output/public/_nuxt/nGp0t_eD.js +0 -1
  290. package/.output/server/chunks/build/Alert-DHVVSgdD.mjs +0 -1074
  291. package/.output/server/chunks/build/Alert-DHVVSgdD.mjs.map +0 -1
  292. package/.output/server/chunks/build/DashboardSidebarToggle-CUI9NSow.mjs.map +0 -1
  293. package/.output/server/chunks/build/Empty-BGIn09cL.mjs.map +0 -1
  294. package/.output/server/chunks/build/FocusScope-DNZVMnza.mjs +0 -207
  295. package/.output/server/chunks/build/FocusScope-DNZVMnza.mjs.map +0 -1
  296. package/.output/server/chunks/build/FormField-DnJWfrKE.mjs.map +0 -1
  297. package/.output/server/chunks/build/MapBaseLayerTabs-CRl5Zwlr.mjs.map +0 -1
  298. package/.output/server/chunks/build/OnlineMap-cFSicmkV.mjs.map +0 -1
  299. package/.output/server/chunks/build/Tooltip-DNUdH4oF.mjs.map +0 -1
  300. package/.output/server/chunks/build/advanced-5ZGMUBqC.mjs.map +0 -1
  301. package/.output/server/chunks/build/compare-CtgF4Anj.mjs.map +0 -1
  302. package/.output/server/chunks/build/pages-0c5sp_lv.mjs.map +0 -1
  303. package/.output/server/chunks/build/tasks-Aa8PwjVL.mjs.map +0 -1
@@ -0,0 +1,629 @@
1
+ import { u as useRuntimeConfig } from '../nitro/nitro.mjs';
2
+ import { stat, readFile } from 'node:fs/promises';
3
+ import { createHash } from 'node:crypto';
4
+ import { s as serverDataDirectory } from './data-directory.mjs';
5
+ import { DatabaseSync } from 'node:sqlite';
6
+ import { resolve } from 'node:path';
7
+
8
+ const MAP_LAYER_SNAPSHOT_FILENAMES = {
9
+ dji: "dji-nfz.json",
10
+ antigravity: "antigravity-nfz.sqlite"
11
+ };
12
+ function resolveMapLayerSnapshotPath(options) {
13
+ var _a;
14
+ const explicitPath = (_a = options.explicitPath) == null ? void 0 : _a.trim();
15
+ if (explicitPath) return resolve(explicitPath);
16
+ return resolve(options.dataDir, "map-layers", options.filename);
17
+ }
18
+
19
+ const DJI_ENDPOINT = "https://flysafe-api.dji.com/api/qep/geo/feedback/areas/in_rectangle";
20
+ const DJI_LEVELS = "0,1,2,3,7,8,10";
21
+ const DJI_COVERAGE = { west: -180, south: -90, east: 180, north: 90 };
22
+ const DJI_ROW_DEGREES = 5;
23
+ const DJI_TARGET_DIAGONAL_KM = 780;
24
+ const DJI_OVERLAP_DEGREES = 0.01;
25
+ const DJI_SATURATION_LIMIT = 1e3;
26
+ const DJI_MAX_SPLIT_DEPTH = 8;
27
+ function makeDjiBaseGrid() {
28
+ const cells = [];
29
+ let row = 0;
30
+ for (let south = DJI_COVERAGE.south; south < DJI_COVERAGE.north - 1e-10; south += DJI_ROW_DEGREES, row++) {
31
+ const north = Math.min(DJI_COVERAGE.north, south + DJI_ROW_DEGREES);
32
+ const verticalKm = (north - south) * 111.2;
33
+ const horizontalKm = Math.sqrt(Math.max(1, DJI_TARGET_DIAGONAL_KM ** 2 - verticalKm ** 2));
34
+ const maxCosine = Math.max(Math.cos(south * Math.PI / 180), Math.cos(north * Math.PI / 180), 0.02);
35
+ const longitudeDegrees = Math.min(60, horizontalKm / (111.32 * maxCosine));
36
+ let column = 0;
37
+ for (let west = DJI_COVERAGE.west; west < DJI_COVERAGE.east - 1e-10; west += longitudeDegrees, column++) {
38
+ const east = Math.min(DJI_COVERAGE.east, west + longitudeDegrees);
39
+ cells.push({
40
+ id: `r${String(row).padStart(3, "0")}_c${String(column).padStart(3, "0")}`,
41
+ depth: 0,
42
+ bounds: [
43
+ Math.max(DJI_COVERAGE.west, west - DJI_OVERLAP_DEGREES),
44
+ Math.max(DJI_COVERAGE.south, south - DJI_OVERLAP_DEGREES),
45
+ Math.min(DJI_COVERAGE.east, east + DJI_OVERLAP_DEGREES),
46
+ Math.min(DJI_COVERAGE.north, north + DJI_OVERLAP_DEGREES)
47
+ ]
48
+ });
49
+ }
50
+ }
51
+ return cells;
52
+ }
53
+ function splitDjiCell(cell) {
54
+ const [west, south, east, north] = cell.bounds;
55
+ const middleLongitude = (west + east) / 2;
56
+ const middleLatitude = (south + north) / 2;
57
+ if (middleLongitude === west || middleLongitude === east || middleLatitude === south || middleLatitude === north) {
58
+ throw new Error(`Cannot split saturated DJI cell: ${cell.id}`);
59
+ }
60
+ const quadrants = [
61
+ [west, south, middleLongitude, middleLatitude],
62
+ [middleLongitude, south, east, middleLatitude],
63
+ [west, middleLatitude, middleLongitude, north],
64
+ [middleLongitude, middleLatitude, east, north]
65
+ ];
66
+ return quadrants.map(([childWest, childSouth, childEast, childNorth], quadrant) => ({
67
+ id: cell.depth === 0 ? `${cell.id}_splitq${quadrant}` : `${cell.id}q${quadrant}`,
68
+ parentId: cell.id,
69
+ depth: cell.depth + 1,
70
+ bounds: [
71
+ Math.max(west, childWest - DJI_OVERLAP_DEGREES),
72
+ Math.max(south, childSouth - DJI_OVERLAP_DEGREES),
73
+ Math.min(east, childEast + DJI_OVERLAP_DEGREES),
74
+ Math.min(north, childNorth + DJI_OVERLAP_DEGREES)
75
+ ]
76
+ }));
77
+ }
78
+ function djiBoundsEqual(left, right, tolerance = 1e-10) {
79
+ return left.length === 4 && right.length === 4 && left.every((value, index) => Math.abs(value - right[index]) <= tolerance);
80
+ }
81
+
82
+ function parseDjiSnapshot(contents) {
83
+ const parsed = JSON.parse(contents);
84
+ if (!isRecord$1(parsed) || parsed.formatVersion !== 2 || parsed.source !== "DJI FlySafe" || parsed.scope !== "global") invalidSnapshot();
85
+ if (!isIsoDate(parsed.startedAt) || !isIsoDate(parsed.completedAt) || parsed.fetchedAt !== parsed.completedAt) invalidSnapshot();
86
+ if (Date.parse(parsed.startedAt) > Date.parse(parsed.completedAt)) invalidSnapshot();
87
+ const coverage = parsed.coverage;
88
+ if (!isRecord$1(coverage) || coverage.west !== DJI_COVERAGE.west || coverage.south !== DJI_COVERAGE.south || coverage.east !== DJI_COVERAGE.east || coverage.north !== DJI_COVERAGE.north) invalidSnapshot();
89
+ const query = parsed.query;
90
+ if (!isRecord$1(query) || query.algorithmVersion !== "global-adaptive-grid-v1" || query.endpoint !== DJI_ENDPOINT || query.zonesMode !== "flysafe_website" || query.drone !== "dji-mavic-3" || query.levels !== DJI_LEVELS) invalidSnapshot();
91
+ if (query.rowDegrees !== DJI_ROW_DEGREES || query.targetDiagonalKm !== DJI_TARGET_DIAGONAL_KM || query.overlapDegrees !== DJI_OVERLAP_DEGREES || query.saturationLimit !== DJI_SATURATION_LIMIT || query.maxSplitDepth !== DJI_MAX_SPLIT_DEPTH) invalidSnapshot();
92
+ if (!positiveInteger(query.queryCount) || !positiveInteger(query.baseQueryCount) || !nonNegativeInteger(query.recursiveQueryCount)) invalidSnapshot();
93
+ if (!nonNegativeInteger(query.saturatedQueryCount) || !nonNegativeInteger(query.maximumLeafResultCount) || query.allLeafQueriesBelowSaturationLimit !== true) invalidSnapshot();
94
+ if (!nonNegativeInteger(query.occurrenceCount) || !nonNegativeInteger(query.uniqueAreaCount) || !nonNegativeInteger(query.duplicateOccurrences) || query.conflictingDuplicateCount !== 0 || !nonNegativeInteger(query.resumedQueryCount) || query.resumedQueryCount > query.queryCount) invalidSnapshot();
95
+ if (!Array.isArray(query.queries) || query.queryCount !== query.queries.length || query.queryCount !== query.baseQueryCount + query.recursiveQueryCount) invalidSnapshot();
96
+ if (!Array.isArray(parsed.areas) || query.uniqueAreaCount !== parsed.areas.length || query.duplicateOccurrences !== query.occurrenceCount - query.uniqueAreaCount) invalidSnapshot();
97
+ if (typeof parsed.areasSha256 !== "string" || !/^[0-9a-f]{64}$/.test(parsed.areasSha256)) invalidSnapshot();
98
+ if (createHash("sha256").update(JSON.stringify(parsed.areas)).digest("hex") !== parsed.areasSha256) invalidSnapshot();
99
+ const queryIds = /* @__PURE__ */ new Set();
100
+ const summaries = [];
101
+ let saturatedCount = 0;
102
+ let maximumLeafResultCount = 0;
103
+ let baseQueryCount = 0;
104
+ let occurrenceCount = 0;
105
+ for (const summary of query.queries) {
106
+ if (!isQuerySummary(summary) || queryIds.has(summary.id) || summary.depth > DJI_MAX_SPLIT_DEPTH) invalidSnapshot();
107
+ queryIds.add(summary.id);
108
+ summaries.push(summary);
109
+ occurrenceCount += summary.resultCount;
110
+ if (summary.depth === 0) baseQueryCount++;
111
+ if (summary.saturated) {
112
+ if (summary.resultCount < query.saturationLimit) invalidSnapshot();
113
+ saturatedCount++;
114
+ } else {
115
+ if (summary.resultCount >= query.saturationLimit) invalidSnapshot();
116
+ maximumLeafResultCount = Math.max(maximumLeafResultCount, summary.resultCount);
117
+ }
118
+ }
119
+ if (baseQueryCount !== query.baseQueryCount || summaries.length - baseQueryCount !== query.recursiveQueryCount || occurrenceCount !== query.occurrenceCount) invalidSnapshot();
120
+ if (saturatedCount !== query.saturatedQueryCount || maximumLeafResultCount !== query.maximumLeafResultCount) invalidSnapshot();
121
+ const summariesById = new Map(summaries.map((summary) => [summary.id, summary]));
122
+ const expectedBaseCells = makeDjiBaseGrid();
123
+ if (query.baseQueryCount !== expectedBaseCells.length) invalidSnapshot();
124
+ for (const expected of expectedBaseCells) {
125
+ const actual = summariesById.get(expected.id);
126
+ if (!actual || actual.depth !== 0 || actual.parentId !== void 0 || !djiBoundsEqual(actual.bounds, expected.bounds)) invalidSnapshot();
127
+ }
128
+ for (const summary of summaries) {
129
+ if (summary.depth === 0) continue;
130
+ const parent = summary.parentId ? summariesById.get(summary.parentId) : void 0;
131
+ if (!(parent == null ? void 0 : parent.saturated) || parent.depth + 1 !== summary.depth) invalidSnapshot();
132
+ }
133
+ for (const parent of summaries) {
134
+ const children = summaries.filter((summary) => summary.parentId === parent.id);
135
+ if (!parent.saturated) {
136
+ if (children.length) invalidSnapshot();
137
+ continue;
138
+ }
139
+ const expectedChildren = splitDjiCell(parent);
140
+ if (children.length !== expectedChildren.length) invalidSnapshot();
141
+ for (const expected of expectedChildren) {
142
+ const actual = summariesById.get(expected.id);
143
+ if (!actual || actual.parentId !== parent.id || actual.depth !== expected.depth || !djiBoundsEqual(actual.bounds, expected.bounds)) invalidSnapshot();
144
+ }
145
+ }
146
+ const areaIds = /* @__PURE__ */ new Set();
147
+ for (const area of parsed.areas) {
148
+ if (!isRecord$1(area) || area.area_id === null || area.area_id === void 0 || String(area.area_id).trim() === "") invalidSnapshot();
149
+ const id = String(area.area_id);
150
+ if (areaIds.has(id)) invalidSnapshot();
151
+ areaIds.add(id);
152
+ }
153
+ return parsed;
154
+ }
155
+ function isQuerySummary(value) {
156
+ if (!isRecord$1(value) || typeof value.id !== "string" || !value.id || !nonNegativeInteger(value.depth) || !nonNegativeInteger(value.resultCount) || typeof value.saturated !== "boolean") return false;
157
+ if (value.parentId !== void 0 && (typeof value.parentId !== "string" || !value.parentId)) return false;
158
+ if (!Array.isArray(value.bounds) || value.bounds.length !== 4 || !value.bounds.every((item) => typeof item === "number" && Number.isFinite(item))) return false;
159
+ const [west, south, east, north] = value.bounds;
160
+ return west >= -180 && east <= 180 && south >= -90 && north <= 90 && west < east && south < north;
161
+ }
162
+ function isIsoDate(value) {
163
+ return typeof value === "string" && Number.isFinite(Date.parse(value)) && new Date(value).toISOString() === value;
164
+ }
165
+ function positiveInteger(value) {
166
+ return Number.isInteger(value) && Number(value) > 0;
167
+ }
168
+ function nonNegativeInteger(value) {
169
+ return Number.isInteger(value) && Number(value) >= 0;
170
+ }
171
+ function isRecord$1(value) {
172
+ return Boolean(value) && typeof value === "object" && !Array.isArray(value);
173
+ }
174
+ function invalidSnapshot() {
175
+ throw new Error("DJI Flysafe \u5FEB\u7167\u683C\u5F0F\u6216\u5B8C\u6574\u6027\u6821\u9A8C\u5931\u8D25");
176
+ }
177
+
178
+ function djiAreaFeatureCounts(areas) {
179
+ let candidateCount = 0;
180
+ let featureCount = 0;
181
+ if (!Array.isArray(areas)) return { candidateCount, featureCount, droppedFeatureCount: candidateCount };
182
+ for (const rawArea of areas) {
183
+ if (!isRecord(rawArea)) continue;
184
+ const area = rawArea;
185
+ const subAreas = Array.isArray(area.sub_areas) && area.sub_areas.length ? area.sub_areas.filter(isRecord) : [area];
186
+ candidateCount += subAreas.length;
187
+ featureCount += subAreas.filter(hasDjiGeometry).length;
188
+ }
189
+ return { candidateCount, featureCount, droppedFeatureCount: candidateCount - featureCount };
190
+ }
191
+ function djiAreasToFeatureCollection(areas) {
192
+ var _a, _b, _c;
193
+ const features = [];
194
+ if (!Array.isArray(areas)) return collection("dji-nfz", features);
195
+ for (const rawArea of areas) {
196
+ if (!isRecord(rawArea)) continue;
197
+ const area = rawArea;
198
+ const subAreas = Array.isArray(area.sub_areas) && area.sub_areas.length ? area.sub_areas.filter(isRecord) : [area];
199
+ for (const [index, subArea] of subAreas.entries()) {
200
+ const coordinates = djiGeometry(subArea);
201
+ if (!coordinates) continue;
202
+ const level = (_a = finiteNumber(subArea.level)) != null ? _a : finiteNumber(area.level);
203
+ const height = finiteNumber(subArea.height);
204
+ const sourceAreaId = String((_b = area.area_id) != null ? _b : "unknown");
205
+ const time = timeProperties(area.begin_at, area.end_at);
206
+ const properties = {
207
+ id: `${sourceAreaId}:${index}`,
208
+ sourceAreaId,
209
+ source: "dji-nfz",
210
+ name: cleanText(area.name) || "DJI \u98DE\u884C\u9650\u5236\u533A",
211
+ category: djiCategory(level, height),
212
+ color: safeColor((_c = subArea.color) != null ? _c : area.color, djiColor(level, height)),
213
+ ...level === void 0 ? {} : { level },
214
+ ...finiteNumber(area.type) === void 0 ? {} : { sourceTypeCode: finiteNumber(area.type) },
215
+ ...cleanText(area.description) ? { description: cleanText(area.description) } : {},
216
+ ...cleanText(area.country) ? { countryCode: cleanText(area.country) } : {},
217
+ ...cleanText(area.city) ? { city: cleanText(area.city) } : {},
218
+ ...height === void 0 || height <= 0 ? {} : { upperLimit: height, upperReference: "AGL" },
219
+ isPermanent: !time.startsAt && !time.endsAt,
220
+ ...time
221
+ };
222
+ features.push({ type: "Feature", properties, geometry: { type: "Polygon", coordinates } });
223
+ }
224
+ }
225
+ return collection("dji-nfz", features);
226
+ }
227
+ function antigravityRowsToFeatureCollection(rows, version) {
228
+ var _a;
229
+ const features = [];
230
+ for (const row of rows) {
231
+ const coordinates = row.geometry_type === "Circle" ? circlePolygon(row.center_lon, row.center_lat, row.radius) : parsePolygon(row.coordinates);
232
+ if (!coordinates) continue;
233
+ const category = antigravityCategory(row.restriction_type);
234
+ const description = antigravityDescription(row.message, row.reason);
235
+ features.push({
236
+ type: "Feature",
237
+ properties: {
238
+ id: String(row.id),
239
+ sourceAreaId: String(row.id),
240
+ source: "antigravity-nfz",
241
+ name: ((_a = row.zone_name) == null ? void 0 : _a.trim()) || "Antigravity \u533A\u57DF",
242
+ category,
243
+ color: antigravityColor(category),
244
+ sourceTypeCode: row.restriction_type,
245
+ ...description ? { description } : {},
246
+ ...row.lower_limit === null ? {} : { lowerLimit: row.lower_limit },
247
+ ...row.upper_limit === null ? {} : { upperLimit: row.upper_limit },
248
+ ...row.lower_reference ? { lowerReference: row.lower_reference } : {},
249
+ ...row.upper_reference ? { upperReference: row.upper_reference } : {},
250
+ isPermanent: Boolean(row.is_permanent),
251
+ ...row.start_date_time ? { startsAt: row.start_date_time } : {},
252
+ ...row.end_date_time ? { endsAt: row.end_date_time } : {}
253
+ },
254
+ geometry: { type: "Polygon", coordinates }
255
+ });
256
+ }
257
+ return collection("antigravity-nfz", features, version);
258
+ }
259
+ function circlePolygon(longitude, latitude, radiusMeters, segments = 64) {
260
+ const lon = finiteNumber(longitude);
261
+ const lat = finiteNumber(latitude);
262
+ const radius = finiteNumber(radiusMeters);
263
+ if (lon === void 0 || lat === void 0 || radius === void 0 || radius <= 0 || Math.abs(lat) >= 89.9) return null;
264
+ const earthRadius = 63710088e-1;
265
+ const angularDistance = radius / earthRadius;
266
+ const latitudeRadians = lat * Math.PI / 180;
267
+ const longitudeRadians = lon * Math.PI / 180;
268
+ const ring = [];
269
+ for (let index = 0; index <= segments; index++) {
270
+ const bearing = index / segments * Math.PI * 2;
271
+ const pointLatitude = Math.asin(
272
+ Math.sin(latitudeRadians) * Math.cos(angularDistance) + Math.cos(latitudeRadians) * Math.sin(angularDistance) * Math.cos(bearing)
273
+ );
274
+ const pointLongitude = longitudeRadians + Math.atan2(
275
+ Math.sin(bearing) * Math.sin(angularDistance) * Math.cos(latitudeRadians),
276
+ Math.cos(angularDistance) - Math.sin(latitudeRadians) * Math.sin(pointLatitude)
277
+ );
278
+ ring.push([pointLongitude * 180 / Math.PI, pointLatitude * 180 / Math.PI]);
279
+ }
280
+ return [ring];
281
+ }
282
+ function djiGeometry(area) {
283
+ const polygon = parsePolygonValue(area.polygon_points);
284
+ if (polygon) return polygon;
285
+ return circlePolygon(area.lng, area.lat, area.radius);
286
+ }
287
+ function hasDjiGeometry(area) {
288
+ if (hasPolygonValue(area.polygon_points)) return true;
289
+ const lon = finiteNumber(area.lng);
290
+ const lat = finiteNumber(area.lat);
291
+ const radius = finiteNumber(area.radius);
292
+ return lon !== void 0 && lat !== void 0 && radius !== void 0 && radius > 0 && Math.abs(lat) < 89.9;
293
+ }
294
+ function parsePolygon(value) {
295
+ if (!value) return null;
296
+ try {
297
+ return parsePolygonValue(JSON.parse(value));
298
+ } catch {
299
+ return null;
300
+ }
301
+ }
302
+ function parsePolygonValue(value) {
303
+ if (!Array.isArray(value)) return null;
304
+ const rings = value.every(isPosition) ? [value] : value;
305
+ if (!Array.isArray(rings) || !rings.length) return null;
306
+ const normalized = [];
307
+ for (const candidate of rings) {
308
+ if (!Array.isArray(candidate)) return null;
309
+ const ring = candidate.filter(isPosition).map((position) => [Number(position[0]), Number(position[1])]);
310
+ if (ring.length < 3) continue;
311
+ const first = ring[0];
312
+ const last = ring.at(-1);
313
+ if (first[0] !== last[0] || first[1] !== last[1]) ring.push([...first]);
314
+ normalized.push(ring);
315
+ }
316
+ return normalized.length ? normalized : null;
317
+ }
318
+ function hasPolygonValue(value) {
319
+ if (!Array.isArray(value)) return false;
320
+ const rings = value.every(isPosition) ? [value] : value;
321
+ return Array.isArray(rings) && rings.some((candidate) => Array.isArray(candidate) && candidate.filter(isPosition).length >= 3);
322
+ }
323
+ function isPosition(value) {
324
+ return Array.isArray(value) && value.length >= 2 && [Number(value[0]), Number(value[1])].every(Number.isFinite);
325
+ }
326
+ function djiCategory(level, height) {
327
+ if (level === 0) return "warning";
328
+ if (level === 1) return "authorization";
329
+ if (level === 2) return height && height > 0 ? "altitude" : "restricted";
330
+ if (level === 3) return "enhanced-warning";
331
+ if (level === 5) return "recommended";
332
+ if (level === 7) return "regulatory-restricted";
333
+ if (level === 8) return "approved";
334
+ if (level === 10) return "special-altitude";
335
+ return "other";
336
+ }
337
+ function djiColor(level, height) {
338
+ if (level === 0) return "#ffcc00";
339
+ if (level === 1) return "#1088f2";
340
+ if (level === 2) return height && height > 0 ? "#979797" : "#de4329";
341
+ if (level === 3) return "#ee8815";
342
+ if (level === 5 || level === 8) return "#00be00";
343
+ if (level === 7) return "#37c4db";
344
+ if (level === 10) return "#377a26";
345
+ return "#6b7280";
346
+ }
347
+ function antigravityCategory(restrictionType) {
348
+ if (restrictionType === 1) return "altitude";
349
+ if (restrictionType === 2) return "warning";
350
+ if (restrictionType === 3) return "restricted";
351
+ return "other";
352
+ }
353
+ function antigravityColor(category) {
354
+ if (category === "restricted") return "#c83e43";
355
+ if (category === "altitude") return "#d89216";
356
+ if (category === "warning") return "#287bb5";
357
+ return "#6b7280";
358
+ }
359
+ function timeProperties(begin, end) {
360
+ const startsAt = timestamp(begin);
361
+ const endsAt = timestamp(end);
362
+ return { ...startsAt ? { startsAt } : {}, ...endsAt ? { endsAt } : {} };
363
+ }
364
+ function antigravityDescription(message, reason) {
365
+ var _a;
366
+ const fallback = cleanText(reason);
367
+ const raw = cleanText(message);
368
+ if (!raw) return fallback;
369
+ try {
370
+ const values = JSON.parse(raw);
371
+ if (!Array.isArray(values)) return fallback;
372
+ const localized = values.filter(isRecord).map((value) => {
373
+ var _a2;
374
+ return {
375
+ language: ((_a2 = cleanText(value.language_code)) == null ? void 0 : _a2.replace("_", "-").toLowerCase()) || "",
376
+ text: cleanText(value.template) || cleanText(value.content)
377
+ };
378
+ }).filter((value) => Boolean(value.text)).sort((left, right) => languagePriority(left.language) - languagePriority(right.language));
379
+ return ((_a = localized[0]) == null ? void 0 : _a.text) || fallback;
380
+ } catch {
381
+ return raw || fallback;
382
+ }
383
+ }
384
+ function languagePriority(language) {
385
+ if (language === "zh-cn") return 0;
386
+ if (language === "zh-tw") return 1;
387
+ if (language.startsWith("zh")) return 2;
388
+ if (language.startsWith("en")) return 3;
389
+ return 4;
390
+ }
391
+ function timestamp(value) {
392
+ const numeric = finiteNumber(value);
393
+ if (numeric === void 0 || numeric <= 0) return void 0;
394
+ const date = new Date(numeric < 1e12 ? numeric * 1e3 : numeric);
395
+ return Number.isFinite(date.valueOf()) ? date.toISOString() : void 0;
396
+ }
397
+ function finiteNumber(value) {
398
+ const numeric = typeof value === "number" ? value : typeof value === "string" && value.trim() ? Number(value) : NaN;
399
+ return Number.isFinite(numeric) ? numeric : void 0;
400
+ }
401
+ function cleanText(value) {
402
+ return typeof value === "string" && value.trim() ? value.trim() : void 0;
403
+ }
404
+ function safeColor(value, fallback) {
405
+ return typeof value === "string" && /^#[0-9a-f]{6}$/i.test(value) ? value : fallback;
406
+ }
407
+ function isRecord(value) {
408
+ return Boolean(value) && typeof value === "object" && !Array.isArray(value);
409
+ }
410
+ function collection(source, features, version) {
411
+ return {
412
+ type: "FeatureCollection",
413
+ features,
414
+ metadata: { source, fetchedAt: (/* @__PURE__ */ new Date()).toISOString(), ...version ? { version } : {} }
415
+ };
416
+ }
417
+
418
+ let cache = null;
419
+ let featureCache = null;
420
+ async function getDjiNfzInfo() {
421
+ const snapshot = await loadSnapshot();
422
+ const counts = djiAreaFeatureCounts(snapshot.areas);
423
+ return {
424
+ areaCount: snapshot.areas.length,
425
+ featureCount: counts.featureCount,
426
+ droppedFeatureCount: counts.droppedFeatureCount,
427
+ areasSha256: snapshot.areasSha256,
428
+ version: djiSnapshotVersion(snapshot.fetchedAt),
429
+ releasedAt: snapshot.fetchedAt
430
+ };
431
+ }
432
+ async function getDjiNfz() {
433
+ return collectionFor(await loadSnapshot());
434
+ }
435
+ function collectionFor(snapshot) {
436
+ if (!featureCache || featureCache.snapshot !== snapshot) {
437
+ const collection = djiAreasToFeatureCollection(snapshot.areas);
438
+ collection.metadata = {
439
+ source: "dji-nfz",
440
+ fetchedAt: snapshot.fetchedAt,
441
+ version: djiSnapshotVersion(snapshot.fetchedAt)
442
+ };
443
+ featureCache = { snapshot, collection };
444
+ }
445
+ return featureCache.collection;
446
+ }
447
+ async function loadSnapshot() {
448
+ const config = useRuntimeConfig();
449
+ const path = resolveMapLayerSnapshotPath({
450
+ explicitPath: String(config.djiNfzPath || ""),
451
+ dataDir: serverDataDirectory(),
452
+ filename: MAP_LAYER_SNAPSHOT_FILENAMES.dji
453
+ });
454
+ const file = await stat(path, { bigint: true });
455
+ if (!file.isFile() || file.size <= BigInt(0) || file.size > BigInt(128 * 1024 * 1024)) throw new Error("DJI Flysafe \u5FEB\u7167\u6587\u4EF6\u5F02\u5E38");
456
+ if (!cache || cache.path !== path || cache.modifiedAtNanoseconds !== file.mtimeNs) {
457
+ const snapshot = readFile(path, "utf8").then(parseDjiSnapshot);
458
+ const next = { path, modifiedAtNanoseconds: file.mtimeNs, snapshot };
459
+ snapshot.catch(() => {
460
+ if (cache === next) cache = null;
461
+ });
462
+ cache = next;
463
+ }
464
+ return cache.snapshot;
465
+ }
466
+ function djiSnapshotVersion(fetchedAt) {
467
+ return fetchedAt;
468
+ }
469
+
470
+ const ANTIGRAVITY_VERSION_ROW_COLUMNS = [
471
+ "version_code",
472
+ "released_time",
473
+ "expired_time"
474
+ ];
475
+ const ANTIGRAVITY_FENCE_ROW_COLUMNS = [
476
+ "id",
477
+ "zone_name",
478
+ "restriction_type",
479
+ "lower_limit",
480
+ "lower_reference",
481
+ "upper_limit",
482
+ "upper_reference",
483
+ "is_permanent",
484
+ "start_date_time",
485
+ "end_date_time",
486
+ "geometry_type",
487
+ "center_lat",
488
+ "center_lon",
489
+ "radius",
490
+ "coordinates",
491
+ "reason",
492
+ "message"
493
+ ];
494
+ const ANTIGRAVITY_VERSION_SCHEMA_COLUMNS = [
495
+ "id",
496
+ ...ANTIGRAVITY_VERSION_ROW_COLUMNS,
497
+ "is_deleted"
498
+ ];
499
+ const ANTIGRAVITY_FENCE_SCHEMA_COLUMNS = [
500
+ ...ANTIGRAVITY_FENCE_ROW_COLUMNS,
501
+ "is_valid",
502
+ "is_deleted"
503
+ ];
504
+ const ANTIGRAVITY_VERSION_ROW_PROJECTION = ANTIGRAVITY_VERSION_ROW_COLUMNS.join(", ");
505
+ const ANTIGRAVITY_FENCE_ROW_PROJECTION = ANTIGRAVITY_FENCE_ROW_COLUMNS.join(", ");
506
+ function assertAntigravityDatabaseSchema(database) {
507
+ try {
508
+ database.prepare(`SELECT ${ANTIGRAVITY_VERSION_SCHEMA_COLUMNS.join(", ")} FROM version LIMIT 0`).all();
509
+ database.prepare(`SELECT ${ANTIGRAVITY_FENCE_SCHEMA_COLUMNS.join(", ")} FROM fences LIMIT 0`).all();
510
+ } catch (error) {
511
+ throw new Error("Antigravity \u6570\u636E\u5E93\u7ED3\u6784\u4E0D\u517C\u5BB9", { cause: error });
512
+ }
513
+ }
514
+
515
+ let cachedStore = null;
516
+ let pendingStore = null;
517
+ async function getAntigravityNfzInfo() {
518
+ var _a;
519
+ const store = await loadStore();
520
+ return {
521
+ featureCount: Number(((_a = store.database.prepare("SELECT COUNT(*) AS count FROM fences WHERE is_valid = 1 AND is_deleted = 0").get()) == null ? void 0 : _a.count) || 0),
522
+ sqliteSha256: store.sqliteSha256,
523
+ version: store.version.version_code || void 0,
524
+ releasedAt: store.version.released_time || void 0,
525
+ expiresAt: store.version.expired_time || void 0
526
+ };
527
+ }
528
+ async function getAntigravityNfz() {
529
+ const store = await loadStore();
530
+ const rows = store.database.prepare(`
531
+ SELECT ${ANTIGRAVITY_FENCE_ROW_PROJECTION}
532
+ FROM fences
533
+ WHERE is_valid = 1 AND is_deleted = 0
534
+ ORDER BY restriction_type DESC, id ASC
535
+ `).all();
536
+ return antigravityRowsToFeatureCollection(rows, store.version.version_code || void 0);
537
+ }
538
+ async function loadStore() {
539
+ const config = useRuntimeConfig();
540
+ const sourcePath = resolveMapLayerSnapshotPath({
541
+ explicitPath: String(config.antigravityNfzPath || ""),
542
+ dataDir: serverDataDirectory(),
543
+ filename: MAP_LAYER_SNAPSHOT_FILENAMES.antigravity
544
+ });
545
+ const identity = await sourceIdentity(sourcePath);
546
+ if (cachedStore && sameIdentity(cachedStore.identity, identity)) return cachedStore.store;
547
+ if (pendingStore) {
548
+ if (sameIdentity(pendingStore.identity, identity)) return pendingStore.promise;
549
+ try {
550
+ await pendingStore.promise;
551
+ } catch {
552
+ }
553
+ return loadStore();
554
+ }
555
+ const promise = replaceStore(identity);
556
+ const pending = { identity, promise };
557
+ pendingStore = pending;
558
+ try {
559
+ return await promise;
560
+ } finally {
561
+ if (pendingStore === pending) pendingStore = null;
562
+ }
563
+ }
564
+ async function replaceStore(identity) {
565
+ const store = await openStore(identity);
566
+ let currentIdentity;
567
+ try {
568
+ currentIdentity = await sourceIdentity(identity.path);
569
+ } catch (error) {
570
+ closeStore(store);
571
+ throw error;
572
+ }
573
+ if (!sameIdentity(identity, currentIdentity)) {
574
+ closeStore(store);
575
+ throw new Error("Antigravity \u6570\u636E\u6E90\u5728\u52A0\u8F7D\u671F\u95F4\u5DF2\u66F4\u65B0\uFF0C\u8BF7\u91CD\u8BD5");
576
+ }
577
+ const previous = cachedStore;
578
+ cachedStore = { identity, store };
579
+ if (previous && previous.store !== store) setImmediate(() => closeStore(previous.store));
580
+ return store;
581
+ }
582
+ async function openStore(identity) {
583
+ return openValidatedDatabase(identity.path);
584
+ }
585
+ async function openValidatedDatabase(databasePath) {
586
+ const sqliteContents = await readFile(databasePath);
587
+ const sqliteSha256 = createHash("sha256").update(sqliteContents).digest("hex");
588
+ const database = new DatabaseSync(databasePath, { readOnly: true });
589
+ try {
590
+ const integrity = database.prepare("PRAGMA quick_check").get();
591
+ if (integrity.quick_check !== "ok") throw new Error("Antigravity \u6570\u636E\u5E93\u6821\u9A8C\u5931\u8D25");
592
+ assertAntigravityDatabaseSchema(database);
593
+ const version = database.prepare(`
594
+ SELECT ${ANTIGRAVITY_VERSION_ROW_PROJECTION}
595
+ FROM version WHERE COALESCE(is_deleted, 0) = 0
596
+ ORDER BY id DESC LIMIT 1
597
+ `).get();
598
+ return { database, version: version || { version_code: null, released_time: null, expired_time: null }, sqliteSha256 };
599
+ } catch (error) {
600
+ closeStore({ database, version: { version_code: null, released_time: null, expired_time: null }, sqliteSha256 });
601
+ throw error;
602
+ }
603
+ }
604
+ async function sourceIdentity(path) {
605
+ const file = await stat(path, { bigint: true });
606
+ if (!file.isFile() || file.size <= BigInt(0) || file.size > BigInt(128 * 1024 * 1024)) {
607
+ throw new Error("Antigravity \u6570\u636E\u6E90\u6587\u4EF6\u5F02\u5E38");
608
+ }
609
+ return {
610
+ path,
611
+ device: file.dev,
612
+ inode: file.ino,
613
+ size: file.size,
614
+ modifiedAtNanoseconds: file.mtimeNs,
615
+ changedAtNanoseconds: file.ctimeNs
616
+ };
617
+ }
618
+ function sameIdentity(left, right) {
619
+ return left.path === right.path && left.device === right.device && left.inode === right.inode && left.size === right.size && left.modifiedAtNanoseconds === right.modifiedAtNanoseconds && left.changedAtNanoseconds === right.changedAtNanoseconds;
620
+ }
621
+ function closeStore(store) {
622
+ try {
623
+ store.database.close();
624
+ } catch {
625
+ }
626
+ }
627
+
628
+ export { DJI_MAX_SPLIT_DEPTH as D, MAP_LAYER_SNAPSHOT_FILENAMES as M, getAntigravityNfz as a, DJI_SATURATION_LIMIT as b, DJI_OVERLAP_DEGREES as c, DJI_TARGET_DIAGONAL_KM as d, DJI_ROW_DEGREES as e, DJI_LEVELS as f, getDjiNfz as g, DJI_ENDPOINT as h, DJI_COVERAGE as i, assertAntigravityDatabaseSchema as j, getDjiNfzInfo as k, getAntigravityNfzInfo as l, makeDjiBaseGrid as m, parseDjiSnapshot as p, splitDjiCell as s };
629
+ //# sourceMappingURL=antigravity-nfz.mjs.map