gps-plus-slam-app-framework 1.0.6 → 1.1.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 (198) hide show
  1. package/LICENSE +4 -4
  2. package/README.md +310 -115
  3. package/dist/accuracy-circles-DEKr0Hoh.d.ts +43 -0
  4. package/dist/{app-selectors-CHt7DLuq.d.ts → app-selectors-CR9OWodf.d.ts} +8 -10
  5. package/dist/ar/camera-blit-capture.d.ts +1 -1
  6. package/dist/ar/capability-checker.d.ts +2 -0
  7. package/dist/ar/capability-checker.js +25 -0
  8. package/dist/ar/capture-failure-tracker.d.ts +1 -1
  9. package/dist/ar/chromium-camera-access-workaround.d.ts +2 -2
  10. package/dist/ar/chromium-camera-access-workaround.js +197 -8
  11. package/dist/ar/depth-sampler.d.ts +2 -2
  12. package/dist/ar/enable-gps-ar.d.ts +2 -0
  13. package/dist/ar/enable-gps-ar.js +137 -0
  14. package/dist/ar/frame-loop.d.ts +2 -0
  15. package/dist/ar/frame-loop.js +63 -0
  16. package/dist/ar/image-capture.d.ts +1 -1
  17. package/dist/ar/image-capture.js +1 -1
  18. package/dist/ar/index.d.ts +16 -12
  19. package/dist/ar/index.js +8 -4
  20. package/dist/ar/replay-scene.d.ts +1 -1
  21. package/dist/ar/scene-node-names.d.ts +1 -1
  22. package/dist/ar/webxr-session.d.ts +4 -4
  23. package/dist/ar/webxr-session.js +173 -93
  24. package/dist/ar/xr-camera-texture.d.ts +1 -1
  25. package/dist/ar/xr-error-handler.d.ts +1 -1
  26. package/dist/ar/xr-frame-loop.d.ts +2 -0
  27. package/dist/ar/xr-frame-loop.js +69 -0
  28. package/dist/ar-world-group-alignment-Dn4rQk_c.d.ts +43 -0
  29. package/dist/capability-checker-BTCmZRL4.d.ts +43 -0
  30. package/dist/chromium-camera-access-workaround-MifIwK9x.d.ts +137 -0
  31. package/dist/core/index.d.ts +2 -2
  32. package/dist/core/index.js +2 -2
  33. package/dist/create-slam-app-store-B76AGaI0.d.ts +371 -0
  34. package/dist/{depth-sampler-BNCtnEoP.d.ts → depth-sampler-CqrkRr2N.d.ts} +1 -1
  35. package/dist/enable-gps-ar-DNbO0zbg.d.ts +95 -0
  36. package/dist/{file-system-DD5TczSO.d.ts → file-system-TIsDfamK.d.ts} +32 -2
  37. package/dist/frame-conversions-D2EYjeNa.d.ts +54 -0
  38. package/dist/frame-loop-BTeRpDm4.d.ts +47 -0
  39. package/dist/frustum-visibility-DGnJqls0.d.ts +58 -0
  40. package/dist/{fused-path-DtqCSqJh.d.ts → fused-path-BdVHmDW9.d.ts} +1 -1
  41. package/dist/geo/h3-proximity.d.ts +1 -1
  42. package/dist/geo/index.d.ts +1 -1
  43. package/dist/{geo-types-Xx-LVcnw.d.ts → geo-types-clgzl8b5.d.ts} +16 -1
  44. package/dist/{gps-GKc6_Cly.d.ts → gps-B7AlMPz5.d.ts} +1 -1
  45. package/dist/gps-anchor-CISLPQIb.d.ts +59 -0
  46. package/dist/{gps-ar-pose-sampler-D_Zso40V.d.ts → gps-ar-pose-sampler-BypXZUqC.d.ts} +1 -1
  47. package/dist/{gps-event-coordinator-fwvmVfku.d.ts → gps-event-coordinator-BKVZbS1M.d.ts} +3 -3
  48. package/dist/gps-event-markers-BlHq3jYV.d.ts +103 -0
  49. package/dist/hit-test-reticle-BGXOxrUh.d.ts +45 -0
  50. package/dist/{image-capture-2pKjYUS6.d.ts → image-capture-BXZUmj7j.d.ts} +1 -1
  51. package/dist/index--ldLph4V.d.ts +2 -0
  52. package/dist/index-22v8MXJX.d.ts +23 -0
  53. package/dist/index-BB2KEWbN2.d.ts +37 -0
  54. package/dist/index.d.ts +64 -52
  55. package/dist/index.js +21 -8
  56. package/dist/{leaflet-map-overlay-CQZcnxbc.d.ts → leaflet-map-overlay-jNt-kcUr.d.ts} +22 -11
  57. package/dist/{logger-B81iwxx0.d.ts → logger-BZ44Dhd3.d.ts} +7 -1
  58. package/dist/map-data-BGIBM5rv.d.ts +49 -0
  59. package/dist/map-overlay-draw-DcGs9UV3.d.ts +42 -0
  60. package/dist/{null-storage-backend-C0TiwwzQ.d.ts → null-storage-backend-BPQJSaMw.d.ts} +2 -2
  61. package/dist/{opfs-storage-backend-Gt3rd76D.d.ts → opfs-storage-backend-u4QKvgvP.d.ts} +2 -2
  62. package/dist/{permission-checker-Cu3nbH1S.d.ts → permission-checker-CfV7INCa.d.ts} +41 -1
  63. package/dist/persistence-middleware-xB5sTllJ.d.ts +55 -0
  64. package/dist/{recording-options-BYUFX8iU.d.ts → recording-options-BSFpBSZH.d.ts} +10 -4
  65. package/dist/{recording-replayer-BFhFs7Mc.d.ts → recording-replayer-CTL2cUE0.d.ts} +2 -2
  66. package/dist/{recording-slice-BiktUIWF.d.ts → recording-slice-Cb888P6d.d.ts} +2 -2
  67. package/dist/{replay-engine-B88Va62x.d.ts → replay-engine-B-5GIZtc.d.ts} +1 -1
  68. package/dist/{replay-scene-DtUm6bsr.d.ts → replay-scene-DkNfldPh.d.ts} +3 -3
  69. package/dist/sensors/gps-error-handler.d.ts +1 -1
  70. package/dist/sensors/gps.d.ts +1 -1
  71. package/dist/sensors/gps.js +2 -2
  72. package/dist/sensors/index.d.ts +3 -3
  73. package/dist/sensors/index.js +1 -1
  74. package/dist/sensors/permission-checker.d.ts +2 -2
  75. package/dist/sensors/permission-checker.js +79 -1
  76. package/dist/session-disposers-M-oashRH.js +57 -0
  77. package/dist/state/app-selectors.d.ts +2 -2
  78. package/dist/state/app-selectors.js +33 -3
  79. package/dist/state/combined-root-state.d.ts +2 -0
  80. package/dist/state/combined-root-state.js +1 -0
  81. package/dist/state/create-slam-app-store.d.ts +1 -1
  82. package/dist/state/create-slam-app-store.js +27 -13
  83. package/dist/state/gps-ar-pose-sampler.d.ts +3 -3
  84. package/dist/state/gps-event-coordinator.d.ts +1 -1
  85. package/dist/state/index.d.ts +17 -16
  86. package/dist/state/index.js +6 -4
  87. package/dist/state/persistence-middleware.d.ts +2 -2
  88. package/dist/state/persistence-middleware.js +43 -9
  89. package/dist/state/recording-options.d.ts +1 -1
  90. package/dist/state/recording-replayer.d.ts +2 -2
  91. package/dist/state/recording-slice.d.ts +1 -1
  92. package/dist/state/replay-engine.d.ts +1 -1
  93. package/dist/state/store-subscribers.d.ts +2 -2
  94. package/dist/state/store-subscribers.js +38 -12
  95. package/dist/state/subscribe-to-selector.d.ts +1 -1
  96. package/dist/state/tracking-quality.d.ts +2 -0
  97. package/dist/state/tracking-quality.js +723 -0
  98. package/dist/state/tracking-slice.d.ts +2 -0
  99. package/dist/state/tracking-slice.js +147 -0
  100. package/dist/state-BkIfpiyA.js +87 -0
  101. package/dist/storage/file-system-utils.d.ts +1 -1
  102. package/dist/storage/file-system.d.ts +2 -2
  103. package/dist/storage/file-system.js +52 -1
  104. package/dist/storage/index.d.ts +8 -8
  105. package/dist/storage/null-storage-backend.d.ts +1 -1
  106. package/dist/storage/opfs-storage-backend.d.ts +1 -1
  107. package/dist/storage/opfs-storage.d.ts +1 -1
  108. package/dist/storage/storage-backend.d.ts +1 -1
  109. package/dist/storage/zip-export.d.ts +1 -1
  110. package/dist/storage/zip-reader.d.ts +1 -1
  111. package/dist/storage/zip-reader.js +8 -4
  112. package/dist/{storage-backend-yVnuWGTr.d.ts → storage-backend-yDSKafAQ.d.ts} +1 -1
  113. package/dist/{store-subscribers-DKKHld49.d.ts → store-subscribers-swlbtg_z.d.ts} +31 -6
  114. package/dist/{subscribe-to-selector-ghDKYtap.d.ts → subscribe-to-selector--KQpgLXG.d.ts} +1 -1
  115. package/dist/test-utils/browser-mocks.d.ts +1 -1
  116. package/dist/test-utils/zip-round-trip-helpers.d.ts +7 -1
  117. package/dist/test-utils/zip-round-trip-helpers.js +2 -1
  118. package/dist/tracking-slice-CDREeoZ_.d.ts +86 -0
  119. package/dist/types/ar-types.d.ts +1 -1
  120. package/dist/types/geo-types.d.ts +2 -2
  121. package/dist/types/index.d.ts +3 -3
  122. package/dist/utils/concurrency.d.ts +1 -1
  123. package/dist/utils/failure-tracker.d.ts +1 -1
  124. package/dist/utils/format-file-size.d.ts +1 -1
  125. package/dist/utils/fused-path.d.ts +1 -1
  126. package/dist/utils/index.d.ts +6 -6
  127. package/dist/utils/list-formatter.d.ts +1 -1
  128. package/dist/utils/logger.d.ts +1 -1
  129. package/dist/utils/logger.js +68 -8
  130. package/dist/visualization/accuracy-circles.d.ts +2 -0
  131. package/dist/visualization/accuracy-circles.js +57 -0
  132. package/dist/visualization/alignment-lerper.d.ts +1 -1
  133. package/dist/visualization/ar-world-group-alignment.d.ts +2 -0
  134. package/dist/visualization/ar-world-group-alignment.js +51 -0
  135. package/dist/visualization/camera-follower.d.ts +1 -1
  136. package/dist/visualization/css3d-renderer-manager.d.ts +1 -1
  137. package/dist/visualization/frame-conversions.d.ts +2 -0
  138. package/dist/visualization/frame-conversions.js +88 -0
  139. package/dist/visualization/frustum-visibility.d.ts +2 -0
  140. package/dist/visualization/frustum-visibility.js +139 -0
  141. package/dist/visualization/gps-anchor.d.ts +2 -0
  142. package/dist/visualization/gps-anchor.js +217 -0
  143. package/dist/visualization/gps-compass-cubes.d.ts +1 -1
  144. package/dist/visualization/gps-event-markers.d.ts +2 -2
  145. package/dist/visualization/gps-event-markers.js +69 -2
  146. package/dist/visualization/hit-test-reticle.d.ts +2 -0
  147. package/dist/visualization/hit-test-reticle.js +81 -0
  148. package/dist/visualization/index.d.ts +19 -12
  149. package/dist/visualization/index.js +9 -2
  150. package/dist/visualization/leaflet-map-overlay.d.ts +1 -1
  151. package/dist/visualization/leaflet-map-overlay.js +33 -79
  152. package/dist/visualization/lerp-utils.d.ts +1 -1
  153. package/dist/visualization/map-data.d.ts +2 -0
  154. package/dist/visualization/map-data.js +33 -0
  155. package/dist/visualization/map-overlay-draw.d.ts +2 -0
  156. package/dist/visualization/map-overlay-draw.js +107 -0
  157. package/dist/visualization/map-overlay.d.ts +1 -1
  158. package/dist/visualization/three-dispose.d.ts +1 -1
  159. package/dist/visualization/vis-colors.d.ts +1 -1
  160. package/dist/webxr-nue-basis-BbdqhqY6.js +54 -0
  161. package/dist/{webxr-session-COlSrXdL.d.ts → webxr-session-BnArFCew.d.ts} +76 -14
  162. package/dist/xr-frame-loop-BKckC7xC.d.ts +70 -0
  163. package/dist/{zip-reader-KgJEXbca.d.ts → zip-reader-B2lzN8F5.d.ts} +5 -0
  164. package/package.json +16 -16
  165. package/dist/ar/tracking-state.d.ts +0 -2
  166. package/dist/ar/tracking-state.js +0 -164
  167. package/dist/chromium-camera-access-workaround-CU5zSKNr.d.ts +0 -61
  168. package/dist/combined-root-state-B3SvPNjU.d.ts +0 -6
  169. package/dist/create-slam-app-store-DBm7g2Zd.d.ts +0 -85
  170. package/dist/gps-anchored-mesh-manager-CovAFK4g.d.ts +0 -56
  171. package/dist/gps-event-markers-sVyO9utS.d.ts +0 -67
  172. package/dist/persistence-middleware-z-75iisb.d.ts +0 -31
  173. package/dist/tracking-state-B9QfuZCg.d.ts +0 -101
  174. package/dist/visualization/gps-anchored-mesh-manager.d.ts +0 -2
  175. package/dist/visualization/gps-anchored-mesh-manager.js +0 -128
  176. /package/dist/{alignment-lerper-D9BeDwZX.d.ts → alignment-lerper-CCZJf-Xb.d.ts} +0 -0
  177. /package/dist/{ar-types-B-ORgk6Z.d.ts → ar-types-isPsQptb.d.ts} +0 -0
  178. /package/dist/{camera-blit-capture-DHuyrrxr.d.ts → camera-blit-capture-75WWa9Xb.d.ts} +0 -0
  179. /package/dist/{camera-follower-BMqPddxx.d.ts → camera-follower-B-nS1sr6.d.ts} +0 -0
  180. /package/dist/{capture-failure-tracker-2Q6oI2uQ.d.ts → capture-failure-tracker-D4HYJNOj.d.ts} +0 -0
  181. /package/dist/{concurrency-p6gB30fT.d.ts → concurrency-Bsmv53qw.d.ts} +0 -0
  182. /package/dist/{css3d-renderer-manager-rgLMVAvd.d.ts → css3d-renderer-manager-EDED3nvg.d.ts} +0 -0
  183. /package/dist/{failure-tracker-1sQ_Cgyw.d.ts → failure-tracker-D7ELffm0.d.ts} +0 -0
  184. /package/dist/{file-system-utils-BH8FdyIu.d.ts → file-system-utils-BH6uIs2i.d.ts} +0 -0
  185. /package/dist/{format-file-size-onGq0k1Q.d.ts → format-file-size-B7gJb3Md.d.ts} +0 -0
  186. /package/dist/{gps-compass-cubes-jRIJMOuh.d.ts → gps-compass-cubes-Ys6Hf1nc.d.ts} +0 -0
  187. /package/dist/{gps-error-handler-CH1S528z.d.ts → gps-error-handler-BLDhUlw5.d.ts} +0 -0
  188. /package/dist/{h3-proximity-GwesPTFT.d.ts → h3-proximity-DJnghtir.d.ts} +0 -0
  189. /package/dist/{lerp-utils-CZgQlrmu.d.ts → lerp-utils-DNcSmKVX.d.ts} +0 -0
  190. /package/dist/{list-formatter-DKQQVLcl.d.ts → list-formatter-CsqcU4v5.d.ts} +0 -0
  191. /package/dist/{map-overlay-C9ifl_4-.d.ts → map-overlay-yrFsUtGv.d.ts} +0 -0
  192. /package/dist/{opfs-storage-Dlq1I_Gb.d.ts → opfs-storage-LsLY6VZV.d.ts} +0 -0
  193. /package/dist/{scene-node-names-DPsaE2z3.d.ts → scene-node-names-IHW7HR4S.d.ts} +0 -0
  194. /package/dist/{three-dispose-qt_r5wR1.d.ts → three-dispose-WTBAfaWU.d.ts} +0 -0
  195. /package/dist/{vis-colors-BKkdTIKb.d.ts → vis-colors-Djnyg_UH.d.ts} +0 -0
  196. /package/dist/{xr-camera-texture-BbukNE79.d.ts → xr-camera-texture-BU5YvKAM.d.ts} +0 -0
  197. /package/dist/{xr-error-handler-DTHfmvrl.d.ts → xr-error-handler-DcUFshNF.d.ts} +0 -0
  198. /package/dist/{zip-export-BjrQPv0X.d.ts → zip-export-C0_ErAqT.d.ts} +0 -0
@@ -1,7 +1,6 @@
1
- import { r as SlamAppRootState } from "./create-slam-app-store-DBm7g2Zd.js";
2
- import { t as CombinedRootState } from "./combined-root-state-B3SvPNjU.js";
1
+ import { L as CombinedRootState, r as SlamAppRootState } from "./create-slam-app-store-B76AGaI0.js";
3
2
  import * as _$gps_plus_slam_js0 from "gps-plus-slam-js";
4
- import { GpsPoint, LatLong, Matrix4, Quaternion, ReferencePoint, Vector3 } from "gps-plus-slam-js";
3
+ import { ArImageCapture, GpsPoint, LatLong, Matrix4, Quaternion, Vector3 } from "gps-plus-slam-js";
5
4
  import * as _$_reduxjs_toolkit0 from "@reduxjs/toolkit";
6
5
 
7
6
  //#region ../src/state/app-selectors.d.ts
@@ -115,20 +114,19 @@ declare const selectZeroReference: ((state: SlamAppRootState & {}) => LatLong |
115
114
  memoize: typeof _$_reduxjs_toolkit0.weakMapMemoize;
116
115
  argsMemoize: typeof _$_reduxjs_toolkit0.weakMapMemoize;
117
116
  };
118
- /** User-defined reference points for ground truth validation. */
119
- declare const selectReferencePoints: ((state: SlamAppRootState & {}) => readonly ReferencePoint[]) & {
117
+ declare const selectFrameTilesInWebXR: ((state: SlamAppRootState & {}) => readonly ArImageCapture[]) & {
120
118
  clearCache: () => void;
121
119
  resultsCount: () => number;
122
120
  resetResultsCount: () => void;
123
121
  } & {
124
- resultFunc: (resultFuncArgs_0: _$gps_plus_slam_js0.GpsModel | null) => readonly ReferencePoint[];
125
- memoizedResultFunc: ((resultFuncArgs_0: _$gps_plus_slam_js0.GpsModel | null) => readonly ReferencePoint[]) & {
122
+ resultFunc: (resultFuncArgs_0: ArImageCapture[] | undefined) => readonly ArImageCapture[];
123
+ memoizedResultFunc: ((resultFuncArgs_0: ArImageCapture[] | undefined) => readonly ArImageCapture[]) & {
126
124
  clearCache: () => void;
127
125
  resultsCount: () => number;
128
126
  resetResultsCount: () => void;
129
127
  };
130
- lastResult: () => readonly ReferencePoint[];
131
- dependencies: [(state: CombinedRootState) => _$gps_plus_slam_js0.GpsModel | null];
128
+ lastResult: () => readonly ArImageCapture[];
129
+ dependencies: [(state: CombinedRootState) => ArImageCapture[] | undefined];
132
130
  recomputations: () => number;
133
131
  resetRecomputations: () => void;
134
132
  dependencyRecomputations: () => number;
@@ -138,4 +136,4 @@ declare const selectReferencePoints: ((state: SlamAppRootState & {}) => readonly
138
136
  argsMemoize: typeof _$_reduxjs_toolkit0.weakMapMemoize;
139
137
  };
140
138
  //#endregion
141
- export { selectReferencePoints as a, selectOdometryRotations as i, selectGpsPositions as n, selectZeroReference as o, selectOdometryPositions as r, selectAlignmentMatrix as t };
139
+ export { selectOdometryRotations as a, selectOdometryPositions as i, selectFrameTilesInWebXR as n, selectZeroReference as o, selectGpsPositions as r, selectAlignmentMatrix as t };
@@ -1,2 +1,2 @@
1
- import { i as computeCaptureSize, n as CameraBlitCaptureConfig, r as DEFAULT_BLIT_CONFIG, t as CameraBlitCapture } from "../camera-blit-capture-DHuyrrxr.js";
1
+ import { i as computeCaptureSize, n as CameraBlitCaptureConfig, r as DEFAULT_BLIT_CONFIG, t as CameraBlitCapture } from "../camera-blit-capture-75WWa9Xb.js";
2
2
  export { CameraBlitCapture, CameraBlitCaptureConfig, DEFAULT_BLIT_CONFIG, computeCaptureSize };
@@ -0,0 +1,2 @@
1
+ import { i as isFullySupported, n as CapabilitySupport, r as capabilityMessage, t as CapabilityMessageOptions } from "../capability-checker-BTCmZRL4.js";
2
+ export { CapabilityMessageOptions, CapabilitySupport, capabilityMessage, isFullySupported };
@@ -0,0 +1,25 @@
1
+ //#region ../src/ar/capability-checker.ts
2
+ /** True only when both AR and GPS are available — the demo can run. */
3
+ function isFullySupported(support) {
4
+ return support.webxr && support.geolocation;
5
+ }
6
+ /**
7
+ * Build the capability-gated message shown when the demo cannot run. Names
8
+ * exactly which capabilities are missing so the user understands *why*, and
9
+ * always points them at the supported environment (an AR phone, outdoors).
10
+ * Returns `null` when everything is supported (no message needed).
11
+ *
12
+ * The trailing "to try …" clause is app-specific and supplied via
13
+ * `options.contextLabel`; without it the message ends neutrally at
14
+ * "…outdoors.".
15
+ */
16
+ function capabilityMessage(support, options = {}) {
17
+ if (isFullySupported(support)) return null;
18
+ const missing = [];
19
+ if (!support.webxr) missing.push("WebXR augmented reality");
20
+ if (!support.geolocation) missing.push("GPS / geolocation");
21
+ const suffix = options.contextLabel ? `, to try ${options.contextLabel}` : "";
22
+ return `This demo needs ${missing.join(" and ")}, which this device or browser does not provide. Open it on an AR-capable phone (e.g. Chrome on Android with ARCore), outdoors${suffix}.`;
23
+ }
24
+ //#endregion
25
+ export { capabilityMessage, isFullySupported };
@@ -1,2 +1,2 @@
1
- import { a as createCaptureFailureTracker, i as DEFAULT_CAPTURE_TRACKER_CONFIG, n as CaptureFailureTracker, r as CaptureFailureTrackerConfig, t as CAPTURE_FAILURE_WARNING } from "../capture-failure-tracker-2Q6oI2uQ.js";
1
+ import { a as createCaptureFailureTracker, i as DEFAULT_CAPTURE_TRACKER_CONFIG, n as CaptureFailureTracker, r as CaptureFailureTrackerConfig, t as CAPTURE_FAILURE_WARNING } from "../capture-failure-tracker-D4HYJNOj.js";
2
2
  export { CAPTURE_FAILURE_WARNING, CaptureFailureTracker, CaptureFailureTrackerConfig, DEFAULT_CAPTURE_TRACKER_CONFIG, createCaptureFailureTracker };
@@ -1,2 +1,2 @@
1
- import { n as applyChromiumProjectionLayerWorkaround, t as ChromiumProjectionLayerWorkaroundResult } from "../chromium-camera-access-workaround-CU5zSKNr.js";
2
- export { ChromiumProjectionLayerWorkaroundResult, applyChromiumProjectionLayerWorkaround };
1
+ import { a as applyChromiumProjectionLayerWorkaround, i as ChromiumProjectionLayerWorkaroundResult, n as BASELAYER_WINDOW_MIN, o as needsBaseLayerPersistence, r as ChromeVersion, s as parseChromeVersion, t as BASELAYER_WINDOW_MAX } from "../chromium-camera-access-workaround-MifIwK9x.js";
2
+ export { BASELAYER_WINDOW_MAX, BASELAYER_WINDOW_MIN, ChromeVersion, ChromiumProjectionLayerWorkaroundResult, applyChromiumProjectionLayerWorkaround, needsBaseLayerPersistence, parseChromeVersion };
@@ -1,20 +1,207 @@
1
+ import { createLogger } from "../utils/logger.js";
1
2
  //#region ../src/ar/chromium-camera-access-workaround.ts
2
3
  /**
4
+ * Chromium WebXR camera-access tab-crash workaround.
5
+ *
6
+ * Background:
7
+ * Requesting `camera-access` as an optional WebXR feature on Android Chrome
8
+ * 147+ causes a fatal renderer-process crash (`CrRendererMain`) 1–2 seconds
9
+ * after entering AR. The crash reproduces in the upstream three.js
10
+ * `webxr_ar_hittest.html` example with `optionalFeatures: ['camera-access']`
11
+ * added — i.e. it is not specific to this app's session setup. See:
12
+ *
13
+ * - GpsPlusSlamJs_Docs/docs/2026-04-22-camera-access-reproducer-plan.md
14
+ * - GpsPlusSlamJs_Docs/docs/2026-06-04-camera-access-crash-regression-chrome-148.md
15
+ * - https://github.com/mrdoob/three.js/issues/33404
16
+ * - https://issues.chromium.org/issues/507508099 (root-cause, marked Fixed)
17
+ *
18
+ * There is NOT a single crash here — the Chromium tracker notes the crash on
19
+ * Chrome 147 is different from the crash on 148+, and the simple workaround
20
+ * below only helped on a subset of versions. The empirically-verified
21
+ * (on-device) timeline is:
22
+ *
23
+ * - 147 : deleting `createProjectionLayer` / `layers` forces three.js onto
24
+ * `XRWebGLLayer` and sidesteps the crash (deletes-only is sufficient).
25
+ * - 148.0.7778.12 .. 149.0.7821 : the delete-only trick is NOT sufficient on
26
+ * its own. An ADDITIONAL patch is needed: persist the `baseLayer`
27
+ * reference across `XRSession.prototype.updateRenderState` so three.js's
28
+ * later `depthNear`/`depthFar` update does not drop the active
29
+ * `glBaseLayer`. (Confirmed on-device on `148.0.7778.215`: BOTH the
30
+ * deletes and the baseLayer patch are required for the page not to
31
+ * crash. Earlier 148 builds (`< .7778.12`) are below the window per the
32
+ * tracker, which reported delete-only worked there.)
33
+ * - > 149.0.7821 (incl. Chrome 150) : the delete-only path is STILL required
34
+ * (confirmed on-device: Chrome 150 only stops crashing when the deletes
35
+ * are applied), but the extra baseLayer-persistence patch is NOT needed.
36
+ * The earlier assumption that Chromium fully fixed this on patched
37
+ * builds did not hold on real devices, so we no longer skip the
38
+ * workaround on "patched" Chrome.
39
+ *
40
+ * Resulting policy (see {@link applyChromiumProjectionLayerWorkaround}):
41
+ * - ALWAYS apply the deletes (every Chrome build, and unknown/non-Chromium
42
+ * environments — restoring the original always-on behavior).
43
+ * - Apply the baseLayer-persistence patch ONLY when a detected Chrome build
44
+ * falls inside the affected window
45
+ * [{@link BASELAYER_WINDOW_MIN} .. {@link BASELAYER_WINDOW_MAX}].
46
+ *
47
+ * Caveats:
48
+ * - This is a Chromium-specific hack and the upstream comment explicitly
49
+ * warns it "might break webxr on other devices" — keep it opt-in.
50
+ * - Must run BEFORE any WebXR session setup. Three.js reads these prototype
51
+ * members lazily when the first session starts, so calling this at app
52
+ * bootstrap (before `initAR()`) is sufficient.
53
+ * - Idempotent: safe to call repeatedly. Safe on environments where the
54
+ * prototypes do not exist (e.g. desktop browsers, jsdom).
55
+ */
56
+ const log = createLogger("chromium-camera-access");
57
+ /** Marker set on our patched `updateRenderState` so we never double-wrap it. */
58
+ const BASE_LAYER_PATCH_MARKER = "__gpsBaseLayerPersistencePatch";
59
+ /**
60
+ * Inclusive lower bound of the Chrome window that additionally needs the
61
+ * `baseLayer`-persistence patch (on top of the deletes).
62
+ *
63
+ * Set to `148.0.7778.12`, the issue tracker's figure for when the delete-only
64
+ * trick stopped being sufficient. On-device confirmation: `148.0.7778.215`
65
+ * (well inside this window) crashes with deletes-only and needs BOTH patches.
66
+ * Earlier 148 builds (`< .7778.12`) and all of Chrome 147 stay below this
67
+ * bound (deletes-only) per the documented timeline — we have no on-device
68
+ * evidence that they need the baseLayer patch, so we do not apply it there.
69
+ */
70
+ const BASELAYER_WINDOW_MIN = [
71
+ 148,
72
+ 0,
73
+ 7778,
74
+ 12
75
+ ];
76
+ /**
77
+ * Inclusive upper bound of the Chrome window that additionally needs the
78
+ * `baseLayer`-persistence patch. The crash is fixed after `149.0.7819.0` and
79
+ * the camera image is correctly populated after `149.0.7821.0`; above this
80
+ * build the extra patch is no longer required (the deletes still are — see
81
+ * the module header and the on-device matrix for Chrome 150).
82
+ *
83
+ * @see https://github.com/mrdoob/three.js/issues/33404
84
+ */
85
+ const BASELAYER_WINDOW_MAX = [
86
+ 149,
87
+ 0,
88
+ 7821,
89
+ 0
90
+ ];
91
+ /**
92
+ * Parse a Chrome/Chromium version from a user-agent string.
93
+ *
94
+ * Matches the `Chrome/<major>.<minor>.<build>.<patch>` token (and the iOS
95
+ * `CriOS/...` variant). Returns null for non-Chromium user agents.
96
+ */
97
+ function parseChromeVersion(userAgent) {
98
+ const match = /(?:Chrome|CriOS)\/(\d+)\.(\d+)\.(\d+)\.(\d+)/.exec(userAgent);
99
+ if (!match) return null;
100
+ return [
101
+ Number(match[1]),
102
+ Number(match[2]),
103
+ Number(match[3]),
104
+ Number(match[4])
105
+ ];
106
+ }
107
+ /** Lexicographically compare two version tuples: returns true if `a` > `b`. */
108
+ function isVersionAfter(a, b) {
109
+ for (let i = 0; i < a.length; i++) {
110
+ const av = a[i] ?? 0;
111
+ const bv = b[i] ?? 0;
112
+ if (av !== bv) return av > bv;
113
+ }
114
+ return false;
115
+ }
116
+ /** True if `a` >= `b` (lexicographic). */
117
+ function isVersionAtLeast(a, b) {
118
+ return !isVersionAfter(b, a);
119
+ }
120
+ /**
121
+ * True when the detected Chrome build falls inside the affected window
122
+ * [{@link BASELAYER_WINDOW_MIN} .. {@link BASELAYER_WINDOW_MAX}] (inclusive)
123
+ * and therefore additionally needs the `baseLayer`-persistence patch. Outside
124
+ * the window (including non-Chromium user agents) returns false — only the
125
+ * deletes are needed there.
126
+ */
127
+ function needsBaseLayerPersistence(userAgent) {
128
+ const version = parseChromeVersion(userAgent);
129
+ if (version === null) return false;
130
+ return isVersionAtLeast(version, BASELAYER_WINDOW_MIN) && isVersionAtLeast(BASELAYER_WINDOW_MAX, version);
131
+ }
132
+ function getUserAgent() {
133
+ return globalThis.navigator?.userAgent ?? "";
134
+ }
135
+ /**
136
+ * Wrap `XRSession.prototype.updateRenderState` so the `baseLayer` reference is
137
+ * persisted across calls. Three.js calls `updateRenderState({ depthNear,
138
+ * depthFar })` after the base layer was set; on affected Chrome builds that
139
+ * second call drops the active `glBaseLayer`, which leads to the crash on
140
+ * camera-texture access. Re-supplying the last-seen `baseLayer` keeps it
141
+ * alive.
142
+ *
143
+ * The last-seen `baseLayer` is tracked **per `XRSession` instance** via a
144
+ * `WeakMap` keyed on the call's `this`. A single shared variable would leak a
145
+ * previous session's `baseLayer` into a later session: an `XRWebGLLayer` is
146
+ * bound to the session it was created for, so re-supplying a stale layer to a
147
+ * different session throws `InvalidStateError`. Keying per session also lets
148
+ * the entries be garbage-collected with their sessions.
149
+ *
150
+ * Idempotent: a marker on the wrapper prevents double-wrapping.
151
+ *
152
+ * @returns true if the prototype was wrapped on this call.
153
+ */
154
+ function patchUpdateRenderStateForBaseLayerPersistence() {
155
+ const session = globalThis.XRSession;
156
+ const original = session?.prototype.updateRenderState;
157
+ if (!session || typeof original !== "function") return false;
158
+ if (original[BASE_LAYER_PATCH_MARKER]) return false;
159
+ const lastBaseLayerBySession = /* @__PURE__ */ new WeakMap();
160
+ const patched = function(rawInit) {
161
+ const init = typeof rawInit === "object" && rawInit !== null ? rawInit : {};
162
+ if (typeof this !== "object" || this === null) return original.call(this, init);
163
+ if (init.baseLayer !== void 0) lastBaseLayerBySession.set(this, init.baseLayer);
164
+ const remembered = lastBaseLayerBySession.get(this);
165
+ return original.call(this, remembered !== void 0 ? {
166
+ ...init,
167
+ baseLayer: remembered
168
+ } : init);
169
+ };
170
+ patched[BASE_LAYER_PATCH_MARKER] = true;
171
+ session.prototype.updateRenderState = patched;
172
+ return true;
173
+ }
174
+ /**
3
175
  * Apply the Chromium camera-access tab-crash workaround.
4
176
  *
5
- * Removes `XRWebGLBinding.prototype.createProjectionLayer` (three.js r184)
6
- * and `XRRenderState.prototype.layers` (three.js r158) so three.js falls
7
- * back to `XRWebGLLayer`, which avoids the renderer-process crash that
8
- * happens when both projection layers and `camera-access` are enabled.
177
+ * Policy (derived from on-device testing — see the module header):
178
+ *
179
+ * - ALWAYS removes `XRWebGLBinding.prototype.createProjectionLayer`
180
+ * (three.js r184) and `XRRenderState.prototype.layers` (three.js r158) so
181
+ * three.js falls back to `XRWebGLLayer`. This is required on every affected
182
+ * Chrome build observed so far, including Chrome 150, and is also applied
183
+ * on unknown/non-Chromium environments (restoring the original always-on
184
+ * behavior).
185
+ * - ADDITIONALLY persists the `baseLayer` across
186
+ * `XRSession.prototype.updateRenderState`, but ONLY when a detected Chrome
187
+ * build falls inside the affected window
188
+ * [{@link BASELAYER_WINDOW_MIN} .. {@link BASELAYER_WINDOW_MAX}]. Outside
189
+ * that window the extra patch is unnecessary (and is skipped on unknown
190
+ * environments to avoid touching projection-layer devices like Quest).
9
191
  *
10
192
  * Call once during bootstrap, before any `requestSession()` call.
11
193
  *
12
- * @returns which prototype members were actually deleted on this call.
194
+ * @param options.userAgent override the detected user agent (for testing).
195
+ * @returns which prototype members were actually changed on this call.
13
196
  */
14
- function applyChromiumProjectionLayerWorkaround() {
197
+ function applyChromiumProjectionLayerWorkaround(options) {
198
+ const userAgent = options?.userAgent ?? getUserAgent();
199
+ const version = parseChromeVersion(userAgent);
15
200
  const result = {
16
201
  deletedCreateProjectionLayer: false,
17
- deletedRenderStateLayers: false
202
+ deletedRenderStateLayers: false,
203
+ patchedUpdateRenderState: false,
204
+ detectedChromeVersion: version ? version.join(".") : null
18
205
  };
19
206
  const binding = globalThis.XRWebGLBinding;
20
207
  if (binding && "createProjectionLayer" in binding.prototype) {
@@ -26,7 +213,9 @@ function applyChromiumProjectionLayerWorkaround() {
26
213
  delete renderState.prototype.layers;
27
214
  result.deletedRenderStateLayers = true;
28
215
  }
216
+ if (needsBaseLayerPersistence(userAgent)) result.patchedUpdateRenderState = patchUpdateRenderStateForBaseLayerPersistence();
217
+ log.info("applied workaround", result);
29
218
  return result;
30
219
  }
31
220
  //#endregion
32
- export { applyChromiumProjectionLayerWorkaround };
221
+ export { BASELAYER_WINDOW_MAX, BASELAYER_WINDOW_MIN, applyChromiumProjectionLayerWorkaround, needsBaseLayerPersistence, parseChromeVersion };
@@ -1,3 +1,3 @@
1
- import { i as DepthSample } from "../ar-types-B-ORgk6Z.js";
2
- import { i as DepthSamplerConfig, n as DepthSampler, r as DepthSamplerCallbacks, t as DepthInfo } from "../depth-sampler-BNCtnEoP.js";
1
+ import { i as DepthSample } from "../ar-types-isPsQptb.js";
2
+ import { i as DepthSamplerConfig, n as DepthSampler, r as DepthSamplerCallbacks, t as DepthInfo } from "../depth-sampler-CqrkRr2N.js";
3
3
  export { DepthInfo, DepthSample, DepthSampler, DepthSamplerCallbacks, DepthSamplerConfig };
@@ -0,0 +1,2 @@
1
+ import { a as EnableGpsArState, i as EnableGpsArResult, n as EnableGpsArController, o as EnableGpsArStatus, r as EnableGpsArDeps, s as createEnableGpsArController, t as EnableGpsArConfig } from "../enable-gps-ar-DNbO0zbg.js";
2
+ export { EnableGpsArConfig, EnableGpsArController, EnableGpsArDeps, EnableGpsArResult, EnableGpsArState, EnableGpsArStatus, createEnableGpsArController };
@@ -0,0 +1,137 @@
1
+ import { createLogger } from "../utils/logger.js";
2
+ import { requestGeolocationPermission, requestOrientationPermission, requestWebXRWithDepthPermission } from "../sensors/permission-checker.js";
3
+ import { startGpsWatch, startOrientationWatch, stopGpsWatch, stopOrientationWatch } from "../sensors/gps.js";
4
+ import { endARSession, initAR, isWebXRSupported } from "./webxr-session.js";
5
+ //#region ../src/ar/enable-gps-ar.ts
6
+ const log = createLogger("EnableGpsAr");
7
+ const defaultDeps = {
8
+ isWebXRSupported,
9
+ requestGeolocationPermission,
10
+ requestOrientationPermission,
11
+ requestWebXRWithDepthPermission,
12
+ startGpsWatch,
13
+ startOrientationWatch,
14
+ initAR,
15
+ stopGpsWatch,
16
+ stopOrientationWatch,
17
+ endARSession
18
+ };
19
+ /**
20
+ * Create an "Enable GPS AR" controller. Pass partial `deps` in tests to inject
21
+ * fakes; production callers use the defaults.
22
+ */
23
+ function createEnableGpsArController(deps = {}) {
24
+ const resolved = {
25
+ ...defaultDeps,
26
+ ...deps
27
+ };
28
+ let state = { status: "checking" };
29
+ const listeners = /* @__PURE__ */ new Set();
30
+ let gpsWatchActive = false;
31
+ let orientationWatchActive = false;
32
+ function setState(next) {
33
+ state = next;
34
+ for (const listener of [...listeners]) try {
35
+ listener(state);
36
+ } catch (err) {
37
+ log.error("State listener threw; continuing dispatch:", err);
38
+ }
39
+ }
40
+ async function refreshSupport() {
41
+ if (state.status === "starting" || state.status === "running" || state.status === "stopping") return;
42
+ setState({ status: "checking" });
43
+ const supported = await probeSupport();
44
+ if (state.status !== "checking") return;
45
+ setState({ status: supported ? "ready" : "unsupported" });
46
+ }
47
+ async function probeSupport() {
48
+ try {
49
+ return await resolved.isWebXRSupported();
50
+ } catch {
51
+ return false;
52
+ }
53
+ }
54
+ /**
55
+ * Request the configured permissions. Returns an error message when a
56
+ * *blocking* permission (geolocation, or depth when opted in) is not granted,
57
+ * or `null` on success. Orientation is best-effort and never blocks.
58
+ */
59
+ async function requestPermissions(config) {
60
+ const geolocation = await resolved.requestGeolocationPermission();
61
+ if (geolocation.granted !== true) return geolocation.error ?? "Location permission is required for GPS AR.";
62
+ try {
63
+ await resolved.requestOrientationPermission();
64
+ } catch {}
65
+ if (config.requestDepth) {
66
+ const depth = await resolved.requestWebXRWithDepthPermission();
67
+ if (depth.granted !== true) return depth.error ?? "Depth (3D map) permission was denied.";
68
+ }
69
+ return null;
70
+ }
71
+ async function enable(config) {
72
+ if (state.status === "starting" || state.status === "running" || state.status === "stopping") return {
73
+ ok: false,
74
+ error: "AR is already starting, running or stopping."
75
+ };
76
+ setState({ status: "starting" });
77
+ try {
78
+ const permissionError = await requestPermissions(config);
79
+ if (permissionError !== null) return fail(permissionError);
80
+ await resolved.initAR(config.container, config.isolationOptions, { requestHitTest: config.requestHitTest });
81
+ if (config.onGpsPosition) {
82
+ resolved.startGpsWatch(config.onGpsPosition);
83
+ gpsWatchActive = true;
84
+ }
85
+ if (config.onOrientation) {
86
+ resolved.startOrientationWatch(config.onOrientation);
87
+ orientationWatchActive = true;
88
+ }
89
+ setState({ status: "running" });
90
+ return { ok: true };
91
+ } catch (err) {
92
+ return fail(err instanceof Error ? err.message : String(err));
93
+ }
94
+ }
95
+ function fail(error) {
96
+ setState({
97
+ status: "error",
98
+ error
99
+ });
100
+ return {
101
+ ok: false,
102
+ error
103
+ };
104
+ }
105
+ async function disable() {
106
+ if (state.status !== "running") return;
107
+ setState({ status: "stopping" });
108
+ if (gpsWatchActive) {
109
+ resolved.stopGpsWatch();
110
+ gpsWatchActive = false;
111
+ }
112
+ if (orientationWatchActive) {
113
+ resolved.stopOrientationWatch();
114
+ orientationWatchActive = false;
115
+ }
116
+ try {
117
+ await resolved.endARSession();
118
+ } catch (err) {
119
+ log.error("endARSession threw during disable; continuing teardown:", err);
120
+ }
121
+ setState({ status: "ready" });
122
+ }
123
+ return {
124
+ getState: () => state,
125
+ subscribe: (listener) => {
126
+ listeners.add(listener);
127
+ return () => {
128
+ listeners.delete(listener);
129
+ };
130
+ },
131
+ refreshSupport,
132
+ enable,
133
+ disable
134
+ };
135
+ }
136
+ //#endregion
137
+ export { createEnableGpsArController };
@@ -0,0 +1,2 @@
1
+ import { i as runFrameUpdates, n as clearFrameUpdates, r as registerFrameUpdate, t as FrameUpdate } from "../frame-loop-BTeRpDm4.js";
2
+ export { FrameUpdate, clearFrameUpdates, registerFrameUpdate, runFrameUpdates };
@@ -0,0 +1,63 @@
1
+ import { createLogger } from "../utils/logger.js";
2
+ //#region ../src/ar/frame-loop.ts
3
+ /**
4
+ * Per-frame callback registry. The WebXR session owns the single
5
+ * `renderer.setAnimationLoop(...)` hook for the page; components that need
6
+ * a per-frame tick register here and the session's `onXRFrame` invokes
7
+ * `runFrameUpdates(dt, elapsed)` once per frame.
8
+ *
9
+ * Plain functions, not a class: there is exactly one frame loop per session
10
+ * and singletons-of-singletons add no value. See
11
+ * `2026-05-13-ecs-migration-plan.md` for the design rationale and the
12
+ * rules new `FrameUpdate` bodies must follow (pure function of `dt` plus
13
+ * selectors; no direct Redux dispatch from inside a tick).
14
+ */
15
+ const log = createLogger("FrameLoop");
16
+ const updates = /* @__PURE__ */ new Set();
17
+ /**
18
+ * Register a per-frame callback. Returns an unregister function.
19
+ *
20
+ * Registration is idempotent — calling with the same `fn` twice is a no-op
21
+ * (it remains a single entry in the underlying `Set`).
22
+ */
23
+ function registerFrameUpdate(fn) {
24
+ updates.add(fn);
25
+ return () => {
26
+ updates.delete(fn);
27
+ };
28
+ }
29
+ /**
30
+ * Invoke all registered callbacks. Called by the WebXR session's
31
+ * `onXRFrame` once per frame with the XR-derived `dt` (seconds since the
32
+ * previous frame; 0 on the first frame after a reset) and `elapsed`
33
+ * (seconds since the session started).
34
+ *
35
+ * The set is snapshotted before iterating so that
36
+ * `registerFrameUpdate` / unregister calls made by a handler during the
37
+ * same frame are deferred to the next tick. Iterating the live `Set`
38
+ * would otherwise skip a not-yet-visited entry that an earlier handler
39
+ * unregistered — a hard-to-debug source of non-determinism.
40
+ *
41
+ * Each callback is invoked in its own `try/catch` so a throwing handler is
42
+ * isolated: it cannot abort the remaining callbacks nor propagate up through
43
+ * `onXRFrame` and kill the scene render for the whole frame. Failures are
44
+ * logged and the loop continues — mirrored by `runXrFrameUpdates`.
45
+ */
46
+ function runFrameUpdates(dt, elapsed) {
47
+ const snapshot = Array.from(updates);
48
+ for (const fn of snapshot) try {
49
+ fn(dt, elapsed);
50
+ } catch (error) {
51
+ log.error("A registered FrameUpdate threw; continuing the loop", error);
52
+ }
53
+ }
54
+ /**
55
+ * Clear all registrations. Called from `resetWebXRState()` so a fresh
56
+ * session starts with an empty registry (any callbacks from the previous
57
+ * session are dropped along with their owning components).
58
+ */
59
+ function clearFrameUpdates() {
60
+ updates.clear();
61
+ }
62
+ //#endregion
63
+ export { clearFrameUpdates, registerFrameUpdate, runFrameUpdates };
@@ -1,2 +1,2 @@
1
- import { a as ImageCaptureManager, i as ImageCaptureConfig, n as DEFAULT_CAPTURE_CONFIG, o as MIN_VALID_IMAGE_BYTES, r as ImageCaptureCallbacks, t as CapturedImage } from "../image-capture-2pKjYUS6.js";
1
+ import { a as ImageCaptureManager, i as ImageCaptureConfig, n as DEFAULT_CAPTURE_CONFIG, o as MIN_VALID_IMAGE_BYTES, r as ImageCaptureCallbacks, t as CapturedImage } from "../image-capture-BXZUmj7j.js";
2
2
  export { CapturedImage, DEFAULT_CAPTURE_CONFIG, ImageCaptureCallbacks, ImageCaptureConfig, ImageCaptureManager, MIN_VALID_IMAGE_BYTES };
@@ -92,7 +92,7 @@ var ImageCaptureManager = class {
92
92
  if (!pose) return;
93
93
  this.captureInProgress = true;
94
94
  this.lastCaptureTime = time;
95
- const timestamp = Date.now();
95
+ const timestamp = performance.timeOrigin + time;
96
96
  const screenRotation = this.callbacks.getScreenRotation();
97
97
  const frameIndex = ++this.frameCount;
98
98
  this.captureTimeoutId = setTimeout(() => {
@@ -1,12 +1,16 @@
1
- import { i as computeCaptureSize, n as CameraBlitCaptureConfig, r as DEFAULT_BLIT_CONFIG, t as CameraBlitCapture } from "../camera-blit-capture-DHuyrrxr.js";
2
- import { a as createCaptureFailureTracker, i as DEFAULT_CAPTURE_TRACKER_CONFIG, n as CaptureFailureTracker, r as CaptureFailureTrackerConfig, t as CAPTURE_FAILURE_WARNING } from "../capture-failure-tracker-2Q6oI2uQ.js";
3
- import { n as applyChromiumProjectionLayerWorkaround, t as ChromiumProjectionLayerWorkaroundResult } from "../chromium-camera-access-workaround-CU5zSKNr.js";
4
- import { i as DepthSamplerConfig, n as DepthSampler, r as DepthSamplerCallbacks, t as DepthInfo } from "../depth-sampler-BNCtnEoP.js";
5
- import { a as ImageCaptureManager, i as ImageCaptureConfig, n as DEFAULT_CAPTURE_CONFIG, o as MIN_VALID_IMAGE_BYTES, r as ImageCaptureCallbacks, t as CapturedImage } from "../image-capture-2pKjYUS6.js";
6
- import { a as getCameraFollower, c as getReplayState, d as updateOrbitTarget, i as getAlignmentLerper, l as initReplayScene, n as ReplaySceneState, o as getCameraMode, r as disposeReplayScene, t as CameraMode, u as toggleCameraMode } from "../replay-scene-DtUm6bsr.js";
7
- import { t as SCENE_NODE } from "../scene-node-names-DPsaE2z3.js";
8
- import { a as TrackingStateManager, i as TrackingStateCallbacks, r as TrackingState, t as DeviceOrientation } from "../tracking-state-B9QfuZCg.js";
9
- import { i as acquireCameraTexture, n as RendererLike, r as XRCameraLike, t as CameraTextureResult } from "../xr-camera-texture-BbukNE79.js";
10
- import { A as setTrackingLostCallback, D as setImageCaptureCallback, E as setFrameCallback, F as stopDepthCapture, I as stopImageCapture, N as startDepthCapture, P as startImageCapture, T as setDepthCaptureCallback, d as getDepthSampleCount, f as getImageCaptureFrameCount, g as initAR, i as endARSession, k as setTrackingCallbacks, p as getLiveCss3dManager } from "../webxr-session-COlSrXdL.js";
11
- import { n as XR_ERROR_MESSAGE_UNKNOWN, r as getXrErrorMessage, t as XR_ERROR_MESSAGES } from "../xr-error-handler-DTHfmvrl.js";
12
- export { CAPTURE_FAILURE_WARNING, CameraBlitCapture, type CameraBlitCaptureConfig, type CameraMode, type CameraTextureResult, type CaptureFailureTracker, type CaptureFailureTrackerConfig, type CapturedImage, type ChromiumProjectionLayerWorkaroundResult, DEFAULT_BLIT_CONFIG, DEFAULT_CAPTURE_CONFIG, DEFAULT_CAPTURE_TRACKER_CONFIG, type DepthInfo, DepthSampler, type DepthSamplerCallbacks, type DepthSamplerConfig, type DeviceOrientation, type ImageCaptureCallbacks, type ImageCaptureConfig, ImageCaptureManager, MIN_VALID_IMAGE_BYTES, type RendererLike, type ReplaySceneState, SCENE_NODE, TrackingState, type TrackingStateCallbacks, TrackingStateManager, type XRCameraLike, XR_ERROR_MESSAGES, XR_ERROR_MESSAGE_UNKNOWN, acquireCameraTexture, applyChromiumProjectionLayerWorkaround, computeCaptureSize, createCaptureFailureTracker, disposeReplayScene, endARSession, getAlignmentLerper, getCameraFollower, getCameraMode, getDepthSampleCount, getImageCaptureFrameCount, getLiveCss3dManager, getReplayState, getXrErrorMessage, initAR, initReplayScene, setDepthCaptureCallback, setFrameCallback, setImageCaptureCallback, setTrackingCallbacks, setTrackingLostCallback, startDepthCapture, startImageCapture, stopDepthCapture, stopImageCapture, toggleCameraMode, updateOrbitTarget };
1
+ import { i as computeCaptureSize, n as CameraBlitCaptureConfig, r as DEFAULT_BLIT_CONFIG, t as CameraBlitCapture } from "../camera-blit-capture-75WWa9Xb.js";
2
+ import { i as isFullySupported, n as CapabilitySupport, r as capabilityMessage, t as CapabilityMessageOptions } from "../capability-checker-BTCmZRL4.js";
3
+ import { a as createCaptureFailureTracker, i as DEFAULT_CAPTURE_TRACKER_CONFIG, n as CaptureFailureTracker, r as CaptureFailureTrackerConfig, t as CAPTURE_FAILURE_WARNING } from "../capture-failure-tracker-D4HYJNOj.js";
4
+ import { a as applyChromiumProjectionLayerWorkaround, i as ChromiumProjectionLayerWorkaroundResult, n as BASELAYER_WINDOW_MIN, o as needsBaseLayerPersistence, r as ChromeVersion, s as parseChromeVersion, t as BASELAYER_WINDOW_MAX } from "../chromium-camera-access-workaround-MifIwK9x.js";
5
+ import { i as DepthSamplerConfig, n as DepthSampler, r as DepthSamplerCallbacks, t as DepthInfo } from "../depth-sampler-CqrkRr2N.js";
6
+ import { a as ImageCaptureManager, i as ImageCaptureConfig, n as DEFAULT_CAPTURE_CONFIG, o as MIN_VALID_IMAGE_BYTES, r as ImageCaptureCallbacks, t as CapturedImage } from "../image-capture-BXZUmj7j.js";
7
+ import { i as acquireCameraTexture, n as RendererLike, r as XRCameraLike, t as CameraTextureResult } from "../xr-camera-texture-BU5YvKAM.js";
8
+ import { D as setDepthCaptureCallback, I as startDepthCapture, L as startImageCapture, M as setTrackingLostCallback, O as setFrameCallback, P as setTrackingStore, R as stopDepthCapture, d as getCamera, f as getCurrentArPose, g as getScene, h as getLiveCss3dManager, j as setTrackingCallbacks, k as setImageCaptureCallback, m as getImageCaptureFrameCount, o as endARSession, p as getDepthSampleCount, t as SessionFeatureOptions, u as getArWorldGroup, v as initAR, z as stopImageCapture } from "../webxr-session-BnArFCew.js";
9
+ import { a as EnableGpsArState, i as EnableGpsArResult, n as EnableGpsArController, o as EnableGpsArStatus, r as EnableGpsArDeps, s as createEnableGpsArController, t as EnableGpsArConfig } from "../enable-gps-ar-DNbO0zbg.js";
10
+ import { r as registerFrameUpdate, t as FrameUpdate } from "../frame-loop-BTeRpDm4.js";
11
+ import { i as registerXrFrameUpdate, n as XrFrameUpdate, t as XrFrameContext } from "../xr-frame-loop-BKckC7xC.js";
12
+ import { a as getCameraFollower, c as getReplayState, d as updateOrbitTarget, i as getAlignmentLerper, l as initReplayScene, n as ReplaySceneState, o as getCameraMode, r as disposeReplayScene, t as CameraMode, u as toggleCameraMode } from "../replay-scene-DkNfldPh.js";
13
+ import { t as SCENE_NODE } from "../scene-node-names-IHW7HR4S.js";
14
+ import { t as WEBXR_TO_NUE } from "../index-22v8MXJX.js";
15
+ import { n as XR_ERROR_MESSAGE_UNKNOWN, r as getXrErrorMessage, t as XR_ERROR_MESSAGES } from "../xr-error-handler-DcUFshNF.js";
16
+ export { BASELAYER_WINDOW_MAX, BASELAYER_WINDOW_MIN, CAPTURE_FAILURE_WARNING, CameraBlitCapture, CameraBlitCaptureConfig, CameraMode, CameraTextureResult, CapabilityMessageOptions, CapabilitySupport, CaptureFailureTracker, CaptureFailureTrackerConfig, CapturedImage, ChromeVersion, ChromiumProjectionLayerWorkaroundResult, DEFAULT_BLIT_CONFIG, DEFAULT_CAPTURE_CONFIG, DEFAULT_CAPTURE_TRACKER_CONFIG, DepthInfo, DepthSampler, DepthSamplerCallbacks, DepthSamplerConfig, EnableGpsArConfig, EnableGpsArController, EnableGpsArDeps, EnableGpsArResult, EnableGpsArState, EnableGpsArStatus, FrameUpdate, ImageCaptureCallbacks, ImageCaptureConfig, ImageCaptureManager, MIN_VALID_IMAGE_BYTES, RendererLike, ReplaySceneState, SCENE_NODE, SessionFeatureOptions, WEBXR_TO_NUE, XRCameraLike, XR_ERROR_MESSAGES, XR_ERROR_MESSAGE_UNKNOWN, XrFrameContext, XrFrameUpdate, acquireCameraTexture, applyChromiumProjectionLayerWorkaround, capabilityMessage, computeCaptureSize, createCaptureFailureTracker, createEnableGpsArController, disposeReplayScene, endARSession, getAlignmentLerper, getArWorldGroup, getCamera, getCameraFollower, getCameraMode, getCurrentArPose, getDepthSampleCount, getImageCaptureFrameCount, getLiveCss3dManager, getReplayState, getScene, getXrErrorMessage, initAR, initReplayScene, isFullySupported, needsBaseLayerPersistence, parseChromeVersion, registerFrameUpdate, registerXrFrameUpdate, setDepthCaptureCallback, setFrameCallback, setImageCaptureCallback, setTrackingCallbacks, setTrackingLostCallback, setTrackingStore, startDepthCapture, startImageCapture, stopDepthCapture, stopImageCapture, toggleCameraMode, updateOrbitTarget };
package/dist/ar/index.js CHANGED
@@ -1,12 +1,16 @@
1
1
  import { CameraBlitCapture, DEFAULT_BLIT_CONFIG, computeCaptureSize } from "./camera-blit-capture.js";
2
- import { applyChromiumProjectionLayerWorkaround } from "./chromium-camera-access-workaround.js";
2
+ import { capabilityMessage, isFullySupported } from "./capability-checker.js";
3
+ import { BASELAYER_WINDOW_MAX, BASELAYER_WINDOW_MIN, applyChromiumProjectionLayerWorkaround, needsBaseLayerPersistence, parseChromeVersion } from "./chromium-camera-access-workaround.js";
3
4
  import { CAPTURE_FAILURE_WARNING, DEFAULT_CAPTURE_TRACKER_CONFIG, createCaptureFailureTracker } from "./capture-failure-tracker.js";
4
5
  import { DepthSampler } from "./depth-sampler.js";
6
+ import { registerFrameUpdate } from "./frame-loop.js";
7
+ import { registerXrFrameUpdate } from "./xr-frame-loop.js";
8
+ import { t as WEBXR_TO_NUE } from "../webxr-nue-basis-BbdqhqY6.js";
5
9
  import { DEFAULT_CAPTURE_CONFIG, ImageCaptureManager, MIN_VALID_IMAGE_BYTES } from "./image-capture.js";
6
- import { TrackingState, TrackingStateManager } from "./tracking-state.js";
7
10
  import { acquireCameraTexture } from "./xr-camera-texture.js";
8
11
  import { SCENE_NODE } from "./scene-node-names.js";
9
- import { endARSession, getDepthSampleCount, getImageCaptureFrameCount, getLiveCss3dManager, initAR, setDepthCaptureCallback, setFrameCallback, setImageCaptureCallback, setTrackingCallbacks, setTrackingLostCallback, startDepthCapture, startImageCapture, stopDepthCapture, stopImageCapture } from "./webxr-session.js";
12
+ import { endARSession, getArWorldGroup, getCamera, getCurrentArPose, getDepthSampleCount, getImageCaptureFrameCount, getLiveCss3dManager, getScene, initAR, setDepthCaptureCallback, setFrameCallback, setImageCaptureCallback, setTrackingCallbacks, setTrackingLostCallback, setTrackingStore, startDepthCapture, startImageCapture, stopDepthCapture, stopImageCapture } from "./webxr-session.js";
13
+ import { createEnableGpsArController } from "./enable-gps-ar.js";
10
14
  import { disposeReplayScene, getAlignmentLerper, getCameraFollower, getCameraMode, getReplayState, initReplayScene, toggleCameraMode, updateOrbitTarget } from "./replay-scene.js";
11
15
  import { XR_ERROR_MESSAGES, XR_ERROR_MESSAGE_UNKNOWN, getXrErrorMessage } from "./xr-error-handler.js";
12
- export { CAPTURE_FAILURE_WARNING, CameraBlitCapture, DEFAULT_BLIT_CONFIG, DEFAULT_CAPTURE_CONFIG, DEFAULT_CAPTURE_TRACKER_CONFIG, DepthSampler, ImageCaptureManager, MIN_VALID_IMAGE_BYTES, SCENE_NODE, TrackingState, TrackingStateManager, XR_ERROR_MESSAGES, XR_ERROR_MESSAGE_UNKNOWN, acquireCameraTexture, applyChromiumProjectionLayerWorkaround, computeCaptureSize, createCaptureFailureTracker, disposeReplayScene, endARSession, getAlignmentLerper, getCameraFollower, getCameraMode, getDepthSampleCount, getImageCaptureFrameCount, getLiveCss3dManager, getReplayState, getXrErrorMessage, initAR, initReplayScene, setDepthCaptureCallback, setFrameCallback, setImageCaptureCallback, setTrackingCallbacks, setTrackingLostCallback, startDepthCapture, startImageCapture, stopDepthCapture, stopImageCapture, toggleCameraMode, updateOrbitTarget };
16
+ export { BASELAYER_WINDOW_MAX, BASELAYER_WINDOW_MIN, CAPTURE_FAILURE_WARNING, CameraBlitCapture, DEFAULT_BLIT_CONFIG, DEFAULT_CAPTURE_CONFIG, DEFAULT_CAPTURE_TRACKER_CONFIG, DepthSampler, ImageCaptureManager, MIN_VALID_IMAGE_BYTES, SCENE_NODE, WEBXR_TO_NUE, XR_ERROR_MESSAGES, XR_ERROR_MESSAGE_UNKNOWN, acquireCameraTexture, applyChromiumProjectionLayerWorkaround, capabilityMessage, computeCaptureSize, createCaptureFailureTracker, createEnableGpsArController, disposeReplayScene, endARSession, getAlignmentLerper, getArWorldGroup, getCamera, getCameraFollower, getCameraMode, getCurrentArPose, getDepthSampleCount, getImageCaptureFrameCount, getLiveCss3dManager, getReplayState, getScene, getXrErrorMessage, initAR, initReplayScene, isFullySupported, needsBaseLayerPersistence, parseChromeVersion, registerFrameUpdate, registerXrFrameUpdate, setDepthCaptureCallback, setFrameCallback, setImageCaptureCallback, setTrackingCallbacks, setTrackingLostCallback, setTrackingStore, startDepthCapture, startImageCapture, stopDepthCapture, stopImageCapture, toggleCameraMode, updateOrbitTarget };
@@ -1,2 +1,2 @@
1
- import { a as getCameraFollower, c as getReplayState, d as updateOrbitTarget, i as getAlignmentLerper, l as initReplayScene, n as ReplaySceneState, o as getCameraMode, r as disposeReplayScene, s as getCss3dManager, t as CameraMode, u as toggleCameraMode } from "../replay-scene-DtUm6bsr.js";
1
+ import { a as getCameraFollower, c as getReplayState, d as updateOrbitTarget, i as getAlignmentLerper, l as initReplayScene, n as ReplaySceneState, o as getCameraMode, r as disposeReplayScene, s as getCss3dManager, t as CameraMode, u as toggleCameraMode } from "../replay-scene-DkNfldPh.js";
2
2
  export { CameraMode, ReplaySceneState, disposeReplayScene, getAlignmentLerper, getCameraFollower, getCameraMode, getCss3dManager, getReplayState, initReplayScene, toggleCameraMode, updateOrbitTarget };
@@ -1,2 +1,2 @@
1
- import { t as SCENE_NODE } from "../scene-node-names-DPsaE2z3.js";
1
+ import { t as SCENE_NODE } from "../scene-node-names-IHW7HR4S.js";
2
2
  export { SCENE_NODE };