@nathanclaire/edge-telemetry-sdk 4.0.0 → 5.0.1
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.
- package/LICENSE +21 -0
- package/README.md +185 -30
- package/dist/appLifecycle-DS_fEclk.cjs +2 -0
- package/dist/appLifecycle-DS_fEclk.cjs.map +1 -0
- package/dist/{appLifecycle-DQErzJIR.js → appLifecycle-PffQ4vC1.js} +5 -3
- package/dist/appLifecycle-PffQ4vC1.js.map +1 -0
- package/dist/autoTaps.native-By9I4Kr2.cjs +2 -0
- package/dist/autoTaps.native-By9I4Kr2.cjs.map +1 -0
- package/dist/autoTaps.native-DQCXevD7.js +66 -0
- package/dist/autoTaps.native-DQCXevD7.js.map +1 -0
- package/dist/crashHandler.web-6KvedEB-.cjs +2 -0
- package/dist/crashHandler.web-6KvedEB-.cjs.map +1 -0
- package/dist/crashHandler.web-BUlSXYoS.js +30 -0
- package/dist/crashHandler.web-BUlSXYoS.js.map +1 -0
- package/dist/crashHandlerNative.native-CFVQ5UcO.cjs +2 -0
- package/dist/crashHandlerNative.native-CFVQ5UcO.cjs.map +1 -0
- package/dist/{crashHandlerNative.native-FupMnr1U.js → crashHandlerNative.native-DsCRd-oN.js} +13 -13
- package/dist/crashHandlerNative.native-DsCRd-oN.js.map +1 -0
- package/dist/deviceInfo.native-D5gNBG7m.cjs +2 -0
- package/dist/{deviceInfo.native-BoeTZcD6.cjs.map → deviceInfo.native-D5gNBG7m.cjs.map} +1 -1
- package/dist/deviceInfo.native-DiiHrnI3.js +53 -0
- package/dist/{deviceInfo.native-BJ-3Jj1T.js.map → deviceInfo.native-DiiHrnI3.js.map} +1 -1
- package/dist/{deviceInfo.web-BFB1-pcA.js → deviceInfo.web-BHsjVveq.js} +3 -3
- package/dist/{deviceInfo.web-BFB1-pcA.js.map → deviceInfo.web-BHsjVveq.js.map} +1 -1
- package/dist/{deviceInfo.web-3L3IDQQA.cjs → deviceInfo.web-DGCUHAnv.cjs} +2 -2
- package/dist/{deviceInfo.web-3L3IDQQA.cjs.map → deviceInfo.web-DGCUHAnv.cjs.map} +1 -1
- package/dist/deviceState.native-BEysbZ6O.js +58 -0
- package/dist/deviceState.native-BEysbZ6O.js.map +1 -0
- package/dist/deviceState.native-CrQMy11_.cjs +2 -0
- package/dist/deviceState.native-CrQMy11_.cjs.map +1 -0
- package/dist/deviceState.web-ByaQm9Ry.js +14 -0
- package/dist/deviceState.web-ByaQm9Ry.js.map +1 -0
- package/dist/deviceState.web-CSfUgHDU.cjs +2 -0
- package/dist/deviceState.web-CSfUgHDU.cjs.map +1 -0
- package/dist/frameTracker-9j0en6Zm.cjs +2 -0
- package/dist/frameTracker-9j0en6Zm.cjs.map +1 -0
- package/dist/{frameTracker-DdB8W_kC.js → frameTracker-BzXnxSkb.js} +18 -19
- package/dist/frameTracker-BzXnxSkb.js.map +1 -0
- package/dist/{httpAttributes-BrrtM8zh.js → httpAttributes-BWXOr4eP.js} +1 -1
- package/dist/{httpAttributes-BrrtM8zh.js.map → httpAttributes-BWXOr4eP.js.map} +1 -1
- package/dist/{httpAttributes-D0m6UID7.cjs → httpAttributes-COY0_kiF.cjs} +1 -1
- package/dist/{httpAttributes-D0m6UID7.cjs.map → httpAttributes-COY0_kiF.cjs.map} +1 -1
- package/dist/index.native.cjs +1 -1
- package/dist/index.native.cjs.map +1 -1
- package/dist/index.native.d.ts +1 -1
- package/dist/index.native.js +128 -71
- package/dist/index.native.js.map +1 -1
- package/dist/index.web.cjs +1 -1
- package/dist/index.web.cjs.map +1 -1
- package/dist/index.web.d.ts +1 -1
- package/dist/index.web.js +51 -38
- package/dist/index.web.js.map +1 -1
- package/dist/{interactionWeb.web-CJAviVQ7.js → interactionWeb.web-BWBjmovb.js} +8 -8
- package/dist/{interactionWeb.web-CJAviVQ7.js.map → interactionWeb.web-BWBjmovb.js.map} +1 -1
- package/dist/interactionWeb.web-CKDJLD9r.cjs +2 -0
- package/dist/{interactionWeb.web-Bl_cZlgh.cjs.map → interactionWeb.web-CKDJLD9r.cjs.map} +1 -1
- package/dist/{interceptFetchWeb.web-UXC2Lb6X.js → interceptFetchWeb.web-DjSR_Rft.js} +18 -17
- package/dist/interceptFetchWeb.web-DjSR_Rft.js.map +1 -0
- package/dist/interceptFetchWeb.web-ZHw6IQkU.cjs +2 -0
- package/dist/{interceptFetchWeb.web-UXC2Lb6X.js.map → interceptFetchWeb.web-ZHw6IQkU.cjs.map} +1 -1
- package/dist/{interceptHttpNative.native-BVpFuoNB.cjs → interceptHttpNative.native-C5scIcgY.cjs} +2 -2
- package/dist/{interceptHttpNative.native-BVpFuoNB.cjs.map → interceptHttpNative.native-C5scIcgY.cjs.map} +1 -1
- package/dist/{interceptHttpNative.native-rX-lPNST.js → interceptHttpNative.native-vF_Fksjk.js} +2 -2
- package/dist/{interceptHttpNative.native-rX-lPNST.js.map → interceptHttpNative.native-vF_Fksjk.js.map} +1 -1
- package/dist/{loadingTime-Bhomd9qq.cjs → loadingTime-Cj5Oh8lT.cjs} +1 -1
- package/dist/{loadingTime-Bhomd9qq.cjs.map → loadingTime-Cj5Oh8lT.cjs.map} +1 -1
- package/dist/{loadingTime-ZkYvFijA.js → loadingTime-DMc0zTY8.js} +1 -1
- package/dist/{loadingTime-ZkYvFijA.js.map → loadingTime-DMc0zTY8.js.map} +1 -1
- package/dist/memoryNative.native-CK3QFVjY.cjs +2 -0
- package/dist/memoryNative.native-CK3QFVjY.cjs.map +1 -0
- package/dist/{memoryNative.native-C42h9SjK.js → memoryNative.native-DkA6f7id.js} +12 -12
- package/dist/memoryNative.native-DkA6f7id.js.map +1 -0
- package/dist/nativeSender-Dt1HLaLi.js +37 -0
- package/dist/nativeSender-Dt1HLaLi.js.map +1 -0
- package/dist/nativeSender-hCgUa7Vz.cjs +2 -0
- package/dist/nativeSender-hCgUa7Vz.cjs.map +1 -0
- package/dist/navigationRef-CVIv0aIK.js +30 -0
- package/dist/navigationRef-CVIv0aIK.js.map +1 -0
- package/dist/navigationRef-CfIbeXX8.cjs +2 -0
- package/dist/navigationRef-CfIbeXX8.cjs.map +1 -0
- package/dist/navigationWeb.web-CRHpr5zl.js +51 -0
- package/dist/navigationWeb.web-CRHpr5zl.js.map +1 -0
- package/dist/navigationWeb.web-DwWjL80b.cjs +2 -0
- package/dist/navigationWeb.web-DwWjL80b.cjs.map +1 -0
- package/dist/{networkChange-CUO1hRLj.cjs → networkChange-2FGIQM-N.cjs} +2 -2
- package/dist/networkChange-2FGIQM-N.cjs.map +1 -0
- package/dist/{networkChange-D39hdSb0.js → networkChange-QA0893vW.js} +2 -2
- package/dist/networkChange-QA0893vW.js.map +1 -0
- package/dist/networkInfo.native-CcJ3JVRF.js +31 -0
- package/dist/networkInfo.native-CcJ3JVRF.js.map +1 -0
- package/dist/networkInfo.native-whB2wf6a.cjs +2 -0
- package/dist/networkInfo.native-whB2wf6a.cjs.map +1 -0
- package/dist/{networkInfo.web-B2YlLNsI.js → networkInfo.web-CcUpXMUK.js} +2 -2
- package/dist/networkInfo.web-CcUpXMUK.js.map +1 -0
- package/dist/{networkInfo.web-PltJTHsy.cjs → networkInfo.web-DfO-BUFx.cjs} +2 -2
- package/dist/networkInfo.web-DfO-BUFx.cjs.map +1 -0
- package/dist/react-bqe7KPOf.cjs +4 -0
- package/dist/react-bqe7KPOf.cjs.map +1 -0
- package/dist/react-urNtDGTL.js +413 -0
- package/dist/react-urNtDGTL.js.map +1 -0
- package/dist/runtimeReady.native-CxFl1rQR.js +35 -0
- package/dist/runtimeReady.native-CxFl1rQR.js.map +1 -0
- package/dist/runtimeReady.native-zueSbsEv.cjs +2 -0
- package/dist/runtimeReady.native-zueSbsEv.cjs.map +1 -0
- package/dist/{runtimeReady.web-C8fdIbVR.js → runtimeReady.web-JuE239Tg.js} +2 -2
- package/dist/{runtimeReady.web-C8fdIbVR.js.map → runtimeReady.web-JuE239Tg.js.map} +1 -1
- package/dist/{runtimeReady.web-DHW682RN.cjs → runtimeReady.web-vhAJFU61.cjs} +2 -2
- package/dist/{runtimeReady.web-DHW682RN.cjs.map → runtimeReady.web-vhAJFU61.cjs.map} +1 -1
- package/dist/{seedRuntimeReady-Cz8nOKoo.js → seedRuntimeReady-BlRdf3pR.js} +2 -2
- package/dist/{seedRuntimeReady-Cz8nOKoo.js.map → seedRuntimeReady-BlRdf3pR.js.map} +1 -1
- package/dist/seedRuntimeReady-CbjqbWCd.cjs +2 -0
- package/dist/{seedRuntimeReady-BKwkBEAF.cjs.map → seedRuntimeReady-CbjqbWCd.cjs.map} +1 -1
- package/dist/src/adapters/appLifecycle.d.ts +3 -3
- package/dist/src/adapters/batch.d.ts +44 -0
- package/dist/src/adapters/crashCapture.d.ts +5 -1
- package/dist/src/adapters/deviceState.d.ts +9 -0
- package/dist/src/adapters/frameAggregate.d.ts +15 -13
- package/dist/src/adapters/frameTracker.d.ts +1 -1
- package/dist/src/adapters/hangDetector.d.ts +41 -0
- package/dist/src/adapters/manualSpans.d.ts +41 -0
- package/dist/src/adapters/native/autoTaps.native.d.ts +15 -0
- package/dist/src/adapters/native/deviceState.native.d.ts +15 -0
- package/dist/src/adapters/native/memoryNative.native.d.ts +3 -3
- package/dist/src/adapters/native/networkInfo.native.d.ts +1 -1
- package/dist/src/adapters/native/runtimeReady.native.d.ts +16 -0
- package/dist/src/adapters/navigationRef.d.ts +17 -9
- package/dist/src/adapters/networkChange.d.ts +2 -2
- package/dist/src/adapters/traceManager.d.ts +18 -5
- package/dist/src/adapters/uiInteraction.d.ts +1 -1
- package/dist/src/adapters/viewManager.d.ts +24 -8
- package/dist/src/adapters/web/deviceState.web.d.ts +10 -0
- package/dist/src/adapters/web/navigationWeb.web.d.ts +6 -10
- package/dist/src/adapters/web/webVitals.web.d.ts +7 -0
- package/dist/src/adapters/xhrIntercept.d.ts +2 -0
- package/dist/src/core/breadcrumbs.d.ts +10 -0
- package/dist/src/core/telemetry.d.ts +139 -29
- package/dist/src/core/userProfile.d.ts +7 -0
- package/dist/src/createTelemetry.native.d.ts +3 -1
- package/dist/src/createTelemetry.web.d.ts +2 -1
- package/dist/src/golden.helper.d.ts +4 -0
- package/dist/src/index.base.d.ts +80 -6
- package/dist/src/index.native.d.ts +4 -61
- package/dist/src/index.web.d.ts +4 -51
- package/dist/src/react.d.ts +45 -0
- package/dist/src/telemetryNative.native.d.ts +79 -0
- package/dist/src/telemetryWeb.web.d.ts +59 -0
- package/dist/{store.native-TPqXngmF.cjs → store.native-BbS76uWV.cjs} +1 -1
- package/dist/{store.native-TPqXngmF.cjs.map → store.native-BbS76uWV.cjs.map} +1 -1
- package/dist/{store.native-BYBJcy6o.js → store.native-MlWyGgBp.js} +1 -1
- package/dist/{store.native-BYBJcy6o.js.map → store.native-MlWyGgBp.js.map} +1 -1
- package/dist/{store.web-CvqqN-_Z.cjs → store.web-BzKaP57Z.cjs} +1 -1
- package/dist/{store.web-CvqqN-_Z.cjs.map → store.web-BzKaP57Z.cjs.map} +1 -1
- package/dist/{store.web-DJAlN0nc.js → store.web-rhh0NOfs.js} +1 -1
- package/dist/{store.web-DJAlN0nc.js.map → store.web-rhh0NOfs.js.map} +1 -1
- package/dist/telemetry-60sfWkh0.js +1754 -0
- package/dist/telemetry-60sfWkh0.js.map +1 -0
- package/dist/telemetry-CW63glwb.cjs +2 -0
- package/dist/telemetry-CW63glwb.cjs.map +1 -0
- package/dist/{uiInteraction-DAqxxz0q.js → uiInteraction-BIDOMcrL.js} +39 -34
- package/dist/{uiInteraction-DAqxxz0q.js.map → uiInteraction-BIDOMcrL.js.map} +1 -1
- package/dist/uiInteraction-DxlwCVSn.cjs +2 -0
- package/dist/{uiInteraction-CdzvEI1p.cjs.map → uiInteraction-DxlwCVSn.cjs.map} +1 -1
- package/dist/{viewport-Dd85GUNO.cjs → viewport-9JcVIXYF.cjs} +1 -1
- package/dist/{viewport-Dd85GUNO.cjs.map → viewport-9JcVIXYF.cjs.map} +1 -1
- package/dist/{viewport-Dzmt5QwK.js → viewport-GWTEBt2K.js} +1 -1
- package/dist/{viewport-Dzmt5QwK.js.map → viewport-GWTEBt2K.js.map} +1 -1
- package/dist/{web-vitals.attribution-CVCPiX-h.cjs → web-vitals.attribution-DAvBvdng.cjs} +1 -1
- package/dist/{web-vitals.attribution-CVCPiX-h.cjs.map → web-vitals.attribution-DAvBvdng.cjs.map} +1 -1
- package/dist/{web-vitals.attribution-xw9N5MKQ.js → web-vitals.attribution-DcoMtvlY.js} +1 -1
- package/dist/{web-vitals.attribution-xw9N5MKQ.js.map → web-vitals.attribution-DcoMtvlY.js.map} +1 -1
- package/dist/webSender-DA087xb5.cjs +2 -0
- package/dist/webSender-DA087xb5.cjs.map +1 -0
- package/dist/webSender-g4rs5TIg.js +44 -0
- package/dist/webSender-g4rs5TIg.js.map +1 -0
- package/dist/{webVitals.web-CNIpsKlA.js → webVitals.web-DRTDK6s5.js} +39 -24
- package/dist/webVitals.web-DRTDK6s5.js.map +1 -0
- package/dist/webVitals.web-DvScDIjX.cjs +2 -0
- package/dist/webVitals.web-DvScDIjX.cjs.map +1 -0
- package/dist/{xhrIntercept-BNiA41Mj.js → xhrIntercept-9uAkQh3N.js} +16 -14
- package/dist/xhrIntercept-9uAkQh3N.js.map +1 -0
- package/dist/xhrIntercept-xG1Yl5RI.cjs +2 -0
- package/dist/xhrIntercept-xG1Yl5RI.cjs.map +1 -0
- package/docs/migration-v4.md +1 -1
- package/docs/migration-v5.md +178 -0
- package/package.json +12 -4
- package/dist/appLifecycle-CECgRVu_.cjs +0 -2
- package/dist/appLifecycle-CECgRVu_.cjs.map +0 -1
- package/dist/appLifecycle-DQErzJIR.js.map +0 -1
- package/dist/batch-CwoO7noL.js +0 -56
- package/dist/batch-CwoO7noL.js.map +0 -1
- package/dist/batch-DNu8Xr9T.cjs +0 -2
- package/dist/batch-DNu8Xr9T.cjs.map +0 -1
- package/dist/crashCapture-BOJ8nSAZ.cjs +0 -4
- package/dist/crashCapture-BOJ8nSAZ.cjs.map +0 -1
- package/dist/crashCapture-BW8WuyaU.js +0 -70
- package/dist/crashCapture-BW8WuyaU.js.map +0 -1
- package/dist/crashHandler.web-8F_k2veo.js +0 -29
- package/dist/crashHandler.web-8F_k2veo.js.map +0 -1
- package/dist/crashHandler.web-CWmF56mJ.cjs +0 -2
- package/dist/crashHandler.web-CWmF56mJ.cjs.map +0 -1
- package/dist/crashHandlerNative.native-C2kSikDt.cjs +0 -2
- package/dist/crashHandlerNative.native-C2kSikDt.cjs.map +0 -1
- package/dist/crashHandlerNative.native-FupMnr1U.js.map +0 -1
- package/dist/deviceInfo.native-BJ-3Jj1T.js +0 -53
- package/dist/deviceInfo.native-BoeTZcD6.cjs +0 -2
- package/dist/frameTracker-CHG6sIx9.cjs +0 -2
- package/dist/frameTracker-CHG6sIx9.cjs.map +0 -1
- package/dist/frameTracker-DdB8W_kC.js.map +0 -1
- package/dist/index-BtLlV1HA.js +0 -57
- package/dist/index-BtLlV1HA.js.map +0 -1
- package/dist/index-C2XQ-EYw.js +0 -1122
- package/dist/index-C2XQ-EYw.js.map +0 -1
- package/dist/index-CXsVZY35.cjs +0 -2
- package/dist/index-CXsVZY35.cjs.map +0 -1
- package/dist/index-DLquF88M.cjs +0 -2
- package/dist/index-DLquF88M.cjs.map +0 -1
- package/dist/interactionWeb.web-Bl_cZlgh.cjs +0 -2
- package/dist/interceptFetchWeb.web-T88kO-bE.cjs +0 -2
- package/dist/interceptFetchWeb.web-T88kO-bE.cjs.map +0 -1
- package/dist/memoryNative.native-C42h9SjK.js.map +0 -1
- package/dist/memoryNative.native-CA-7w9w1.cjs +0 -2
- package/dist/memoryNative.native-CA-7w9w1.cjs.map +0 -1
- package/dist/memoryStore-BIGZmmfD.cjs +0 -2
- package/dist/memoryStore-BIGZmmfD.cjs.map +0 -1
- package/dist/memoryStore-F5I-GQKM.js +0 -193
- package/dist/memoryStore-F5I-GQKM.js.map +0 -1
- package/dist/nativeSender-CfQaRuDK.cjs +0 -2
- package/dist/nativeSender-CfQaRuDK.cjs.map +0 -1
- package/dist/nativeSender-pgVSIv-X.js +0 -59
- package/dist/nativeSender-pgVSIv-X.js.map +0 -1
- package/dist/navigationRef-BzYbs8cm.js +0 -28
- package/dist/navigationRef-BzYbs8cm.js.map +0 -1
- package/dist/navigationRef-C-_qhb43.cjs +0 -2
- package/dist/navigationRef-C-_qhb43.cjs.map +0 -1
- package/dist/navigationTracker-BmywA_Bg.js +0 -19
- package/dist/navigationTracker-BmywA_Bg.js.map +0 -1
- package/dist/navigationTracker-HkwVyywz.cjs +0 -2
- package/dist/navigationTracker-HkwVyywz.cjs.map +0 -1
- package/dist/navigationWeb.web-CW_z7Ca4.cjs +0 -2
- package/dist/navigationWeb.web-CW_z7Ca4.cjs.map +0 -1
- package/dist/navigationWeb.web-CcwgKuIZ.js +0 -55
- package/dist/navigationWeb.web-CcwgKuIZ.js.map +0 -1
- package/dist/networkChange-CUO1hRLj.cjs.map +0 -1
- package/dist/networkChange-D39hdSb0.js.map +0 -1
- package/dist/networkInfo.native-CGrx9cnH.js +0 -343
- package/dist/networkInfo.native-CGrx9cnH.js.map +0 -1
- package/dist/networkInfo.native-YVySdv3S.cjs +0 -2
- package/dist/networkInfo.native-YVySdv3S.cjs.map +0 -1
- package/dist/networkInfo.web-B2YlLNsI.js.map +0 -1
- package/dist/networkInfo.web-PltJTHsy.cjs.map +0 -1
- package/dist/runtimeReady.native-Bh7EcYmK.js +0 -14
- package/dist/runtimeReady.native-Bh7EcYmK.js.map +0 -1
- package/dist/runtimeReady.native-jUmuE1lV.cjs +0 -2
- package/dist/runtimeReady.native-jUmuE1lV.cjs.map +0 -1
- package/dist/seedRuntimeReady-BKwkBEAF.cjs +0 -2
- package/dist/src/adapters/navigationTracker.d.ts +0 -6
- package/dist/src/adapters/screenTiming.d.ts +0 -15
- package/dist/telemetry-ByDJIz_9.js +0 -1280
- package/dist/telemetry-ByDJIz_9.js.map +0 -1
- package/dist/telemetry-CrU7i1Jc.cjs +0 -2
- package/dist/telemetry-CrU7i1Jc.cjs.map +0 -1
- package/dist/uiInteraction-CdzvEI1p.cjs +0 -2
- package/dist/webSender-BIwslfpT.js +0 -63
- package/dist/webSender-BIwslfpT.js.map +0 -1
- package/dist/webSender-CVtE4sOF.cjs +0 -2
- package/dist/webSender-CVtE4sOF.cjs.map +0 -1
- package/dist/webVitals.web-CNIpsKlA.js.map +0 -1
- package/dist/webVitals.web-DpWJ-iYp.cjs +0 -2
- package/dist/webVitals.web-DpWJ-iYp.cjs.map +0 -1
- package/dist/xhrIntercept-BADex6Cq.cjs +0 -2
- package/dist/xhrIntercept-BADex6Cq.cjs.map +0 -1
- package/dist/xhrIntercept-BNiA41Mj.js.map +0 -1
|
@@ -0,0 +1,413 @@
|
|
|
1
|
+
import { Component as T, useEffect as k } from "react";
|
|
2
|
+
let f = !1;
|
|
3
|
+
function j(r) {
|
|
4
|
+
f = r;
|
|
5
|
+
}
|
|
6
|
+
const u = {
|
|
7
|
+
log: (...r) => {
|
|
8
|
+
f && console.log(...r);
|
|
9
|
+
},
|
|
10
|
+
warn: (...r) => {
|
|
11
|
+
f && console.warn(...r);
|
|
12
|
+
},
|
|
13
|
+
error: (...r) => {
|
|
14
|
+
f && console.error(...r);
|
|
15
|
+
}
|
|
16
|
+
};
|
|
17
|
+
function d() {
|
|
18
|
+
const r = globalThis.__DEV__;
|
|
19
|
+
if (typeof r == "boolean") return r;
|
|
20
|
+
const t = globalThis.process?.env?.NODE_ENV;
|
|
21
|
+
return t !== void 0 && t !== "production";
|
|
22
|
+
}
|
|
23
|
+
class L {
|
|
24
|
+
/** Run `fn` against the core now if it is resolved, else once it is. Never throws or rejects. */
|
|
25
|
+
now(t, e) {
|
|
26
|
+
const n = (s) => {
|
|
27
|
+
u.warn(`${e} failed:`, s);
|
|
28
|
+
};
|
|
29
|
+
try {
|
|
30
|
+
return (this.resolved ? Promise.resolve(t(this.resolved)) : this.instancePromise.then(t)).then(() => {
|
|
31
|
+
}, n);
|
|
32
|
+
} catch (s) {
|
|
33
|
+
return n(s), Promise.resolve();
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* "This screen is usable now" (#171). Synchronous, no arguments: it marks the **current**
|
|
38
|
+
* view, so your name and the SDK's cannot disagree. The time is taken now; the view is
|
|
39
|
+
* chosen one macrotask later, so a mark from a new screen's mount effect lands on that
|
|
40
|
+
* screen even though the navigation that opened it settles behind it. The `view` row then
|
|
41
|
+
* carries `view.ready_time` and `view.ready_outcome`. First mark per view wins. Before init
|
|
42
|
+
* the mark is buffered and lands on the initial view.
|
|
43
|
+
*/
|
|
44
|
+
markScreenReady() {
|
|
45
|
+
const t = Date.now();
|
|
46
|
+
this.now((e) => {
|
|
47
|
+
setTimeout(() => e.views.markReady(t), 0);
|
|
48
|
+
}, "markScreenReady");
|
|
49
|
+
}
|
|
50
|
+
// ---------- Consent (#172) ----------
|
|
51
|
+
/**
|
|
52
|
+
* Stop collecting, and keep nothing: the queue, the offline store and the session record
|
|
53
|
+
* are dropped, every timer stops, and the network patches pass through untouched. The flag
|
|
54
|
+
* is off before this returns. Survives only this process — persist the user's choice
|
|
55
|
+
* yourself and construct with `enabled: false` next launch.
|
|
56
|
+
*/
|
|
57
|
+
disable() {
|
|
58
|
+
this.now((t) => t.disable(), "disable");
|
|
59
|
+
}
|
|
60
|
+
/** Resume collection. A session that expired while disabled rotates. */
|
|
61
|
+
enable() {
|
|
62
|
+
this.now((t) => t.enable(), "enable");
|
|
63
|
+
}
|
|
64
|
+
// ---------- Sibling parity (#167) ----------
|
|
65
|
+
/** Ship your own number. `unit` → `metric.unit`. The SDK's metric names are reserved; a non-finite value is dropped. */
|
|
66
|
+
async recordMetric(t, e, n, s) {
|
|
67
|
+
return (await this.instancePromise).recordMetric(t, e, n, s);
|
|
68
|
+
}
|
|
69
|
+
/** Add a step to the trail of 20 that rides `app.crash` and `app.hang`. Name ≤64, ≤8 data keys, values ≤255. */
|
|
70
|
+
async addBreadcrumb(t, e) {
|
|
71
|
+
(await this.instancePromise).addBreadcrumb(t, e);
|
|
72
|
+
}
|
|
73
|
+
/** End the current session and start a fresh one — e.g. on logout. `session.reason: manual`. */
|
|
74
|
+
async startNewSession() {
|
|
75
|
+
return (await this.instancePromise).startNewSession();
|
|
76
|
+
}
|
|
77
|
+
// ---------- Manual spans (#164) ----------
|
|
78
|
+
/**
|
|
79
|
+
* Time a journey: one `task.complete` row when the handle is ended. Synchronous — the
|
|
80
|
+
* trace keys, `view.id` and `session.id` freeze here. A span joins the live action's
|
|
81
|
+
* root, else mints a `custom` one; requests inside it parent to that root, not the span.
|
|
82
|
+
* Starting a name that is already open supersedes it. Blank names and a 33rd open span
|
|
83
|
+
* are inert. Misuse never throws.
|
|
84
|
+
*/
|
|
85
|
+
startSpan(t, e) {
|
|
86
|
+
const n = Date.now();
|
|
87
|
+
let s, a = !1, o = !1;
|
|
88
|
+
const i = this.now((c) => {
|
|
89
|
+
s = c.startSpan(t, e, n), o = !0;
|
|
90
|
+
}, "startSpan");
|
|
91
|
+
return {
|
|
92
|
+
end: (c) => {
|
|
93
|
+
if (a) return;
|
|
94
|
+
a = !0;
|
|
95
|
+
const S = Date.now(), h = () => this.now((P) => s && P.endSpan(t, c?.outcome ?? "completed", c?.attributes, S, s, c?.reason), "span.end");
|
|
96
|
+
o ? h() : i.then(h);
|
|
97
|
+
}
|
|
98
|
+
};
|
|
99
|
+
}
|
|
100
|
+
/**
|
|
101
|
+
* `startSpan` + `end` around `fn`, sync or async. A throw (or rejection) ends the span
|
|
102
|
+
* `failed` and is rethrown untouched — no `app.error` is emitted; your catch decides.
|
|
103
|
+
*/
|
|
104
|
+
withSpan(t, e, n) {
|
|
105
|
+
const s = this.startSpan(t, n);
|
|
106
|
+
let a;
|
|
107
|
+
try {
|
|
108
|
+
a = e();
|
|
109
|
+
} catch (o) {
|
|
110
|
+
throw s.end({ outcome: "failed" }), o;
|
|
111
|
+
}
|
|
112
|
+
return a && typeof a.then == "function" ? a.then(
|
|
113
|
+
(o) => (s.end(), o),
|
|
114
|
+
(o) => {
|
|
115
|
+
throw s.end({ outcome: "failed" }), o;
|
|
116
|
+
}
|
|
117
|
+
) : (s.end(), a);
|
|
118
|
+
}
|
|
119
|
+
/**
|
|
120
|
+
* Close an open span by name — for a journey that ends in a different component. `reason`
|
|
121
|
+
* becomes `task.failure_reason` on a `failed` end (#179).
|
|
122
|
+
*/
|
|
123
|
+
endSpan(t, e = "completed", n, s) {
|
|
124
|
+
const a = Date.now();
|
|
125
|
+
this.now((o) => o.endSpan(t, e, n, a, void 0, s), "endSpan");
|
|
126
|
+
}
|
|
127
|
+
async log(t, e) {
|
|
128
|
+
const n = await this.instancePromise;
|
|
129
|
+
if (t === "app.crash") {
|
|
130
|
+
u.warn("app.crash is SDK-owned (§4.7); routing to app.error — use captureError()");
|
|
131
|
+
const s = e?.["error.message"] ?? e?.message ?? e?.["crash.message"];
|
|
132
|
+
return n.captureError(s, e);
|
|
133
|
+
}
|
|
134
|
+
return n.log(t, e);
|
|
135
|
+
}
|
|
136
|
+
async flush() {
|
|
137
|
+
return (await this.instancePromise).flush();
|
|
138
|
+
}
|
|
139
|
+
async shutdown() {
|
|
140
|
+
return (await this.instancePromise).shutdown();
|
|
141
|
+
}
|
|
142
|
+
/**
|
|
143
|
+
* React Navigation → rung 2 of the name ladder, on **both** builds (§4.5.1, #96).
|
|
144
|
+
* `getCurrentRoute()` is a navigation-tree API that works identically on RN-Web, so a
|
|
145
|
+
* consumer wires navigation once and gets the same `view.name` on web and native.
|
|
146
|
+
*/
|
|
147
|
+
async attachNavigation(t) {
|
|
148
|
+
if (u.log("Attaching navigation tracker"), !t) {
|
|
149
|
+
u.warn("Navigation reference is undefined. Cannot attach navigation tracker.");
|
|
150
|
+
return;
|
|
151
|
+
}
|
|
152
|
+
const e = await this.instancePromise, { NavigationRefTracker: n } = await import("./navigationRef-CVIv0aIK.js");
|
|
153
|
+
new n(e).attach(t);
|
|
154
|
+
}
|
|
155
|
+
/**
|
|
156
|
+
* §4.7 — report a handled error as `app.error`. Accepts `unknown`, so a `catch` block
|
|
157
|
+
* that received a string or an axios rejection object needs no narrowing first.
|
|
158
|
+
* There is no public path to `app.crash`, by design (#100).
|
|
159
|
+
*/
|
|
160
|
+
async captureError(t, e) {
|
|
161
|
+
return (await this.instancePromise).captureError(t, e);
|
|
162
|
+
}
|
|
163
|
+
/**
|
|
164
|
+
* `<EdgeErrorBoundary>`'s path (#166) — `app.error` with `error.source: boundary` and the
|
|
165
|
+
* component stack. Not for host code: `captureError()` is the public way to report.
|
|
166
|
+
* @internal
|
|
167
|
+
*/
|
|
168
|
+
async captureBoundaryError(t, e) {
|
|
169
|
+
const n = await this.instancePromise, { capComponentStack: s } = await Promise.resolve().then(() => M), a = e ? { "error.component_stack": s(e) } : void 0;
|
|
170
|
+
return n.captureError(t, a, "boundary");
|
|
171
|
+
}
|
|
172
|
+
// ---------- User Profile Management ----------
|
|
173
|
+
async setUserId(t) {
|
|
174
|
+
(await this.instancePromise).setUserId(t);
|
|
175
|
+
}
|
|
176
|
+
async setUserProfile(t) {
|
|
177
|
+
(await this.instancePromise).setUserProfile(t);
|
|
178
|
+
}
|
|
179
|
+
async setUserDetails(t) {
|
|
180
|
+
(await this.instancePromise).setUserDetails(t);
|
|
181
|
+
}
|
|
182
|
+
async updateUserProfile(t) {
|
|
183
|
+
(await this.instancePromise).updateUserProfile(t);
|
|
184
|
+
}
|
|
185
|
+
async getUserProfile() {
|
|
186
|
+
return (await this.instancePromise).getUserProfile();
|
|
187
|
+
}
|
|
188
|
+
async clearUserProfile() {
|
|
189
|
+
(await this.instancePromise).clearUserProfile();
|
|
190
|
+
}
|
|
191
|
+
async setUserName(t, e, n) {
|
|
192
|
+
(await this.instancePromise).setUserName(t, e, n);
|
|
193
|
+
}
|
|
194
|
+
async setUserContact(t, e) {
|
|
195
|
+
(await this.instancePromise).setUserContact(t, e);
|
|
196
|
+
}
|
|
197
|
+
// EdgeRum-style identify(): emits `user.profile.update`, the **only** event carrying
|
|
198
|
+
// `user.name` / `.email` / `.phone` / `user.custom.*` (§4.10, #107).
|
|
199
|
+
// `userId` is optional and sets the consumer-owned `user.id` the profile upserts on —
|
|
200
|
+
// omit it and `user.id` is untouched; the SDK still never mints one (§3.2).
|
|
201
|
+
async identify(t) {
|
|
202
|
+
return (await this.instancePromise).identify(t);
|
|
203
|
+
}
|
|
204
|
+
}
|
|
205
|
+
const O = "traceparent";
|
|
206
|
+
function A(r) {
|
|
207
|
+
if (typeof r != "string") return;
|
|
208
|
+
const t = r.trim();
|
|
209
|
+
if (!(!t || /[\s/?#@*:]/.test(t)))
|
|
210
|
+
try {
|
|
211
|
+
return new URL(`http://${t}`).hostname || void 0;
|
|
212
|
+
} catch {
|
|
213
|
+
return;
|
|
214
|
+
}
|
|
215
|
+
}
|
|
216
|
+
function I(r) {
|
|
217
|
+
const t = /* @__PURE__ */ new Set();
|
|
218
|
+
if (r == null) return t;
|
|
219
|
+
if (!Array.isArray(r)) {
|
|
220
|
+
if (d()) throw new Error("traceHostAllowlist must be an array of bare hosts");
|
|
221
|
+
return u.warn("Telemetry: traceHostAllowlist must be an array of bare hosts — ignored"), t;
|
|
222
|
+
}
|
|
223
|
+
for (const e of r) {
|
|
224
|
+
const n = A(e);
|
|
225
|
+
if (n) {
|
|
226
|
+
t.add(n);
|
|
227
|
+
continue;
|
|
228
|
+
}
|
|
229
|
+
if (d())
|
|
230
|
+
throw new Error(
|
|
231
|
+
`traceHostAllowlist: "${String(e)}" is not a bare host (no scheme, path, port or wildcard)`
|
|
232
|
+
);
|
|
233
|
+
u.warn(`Telemetry: traceHostAllowlist entry "${String(e)}" is not a bare host — dropped`);
|
|
234
|
+
}
|
|
235
|
+
return t;
|
|
236
|
+
}
|
|
237
|
+
function x(r, t) {
|
|
238
|
+
if (r.size === 0) return !1;
|
|
239
|
+
const e = globalThis.location?.href;
|
|
240
|
+
try {
|
|
241
|
+
return r.has((e ? new URL(t, e) : new URL(t)).hostname);
|
|
242
|
+
} catch {
|
|
243
|
+
return !1;
|
|
244
|
+
}
|
|
245
|
+
}
|
|
246
|
+
function z(r) {
|
|
247
|
+
if (typeof r != "string") return;
|
|
248
|
+
const t = /^00-([0-9a-f]{32})-([0-9a-f]{16})-[0-9a-f]{2}$/.exec(r.trim());
|
|
249
|
+
if (!(!t || /^0+$/.test(t[1]) || /^0+$/.test(t[2])))
|
|
250
|
+
return { traceId: t[1], spanId: t[2] };
|
|
251
|
+
}
|
|
252
|
+
function K(r, t) {
|
|
253
|
+
return `00-${r}-${t}-01`;
|
|
254
|
+
}
|
|
255
|
+
function w(r, t) {
|
|
256
|
+
if (r) {
|
|
257
|
+
if (Array.isArray(r))
|
|
258
|
+
for (const e of r) e && t(String(e[0]), String(e[1]));
|
|
259
|
+
else if (typeof r.forEach == "function")
|
|
260
|
+
r.forEach((e, n) => t(String(n), String(e)));
|
|
261
|
+
else if (typeof r == "object")
|
|
262
|
+
for (const [e, n] of Object.entries(r)) t(e, String(n));
|
|
263
|
+
}
|
|
264
|
+
}
|
|
265
|
+
function X(r, t) {
|
|
266
|
+
let e;
|
|
267
|
+
return w(r, (n, s) => {
|
|
268
|
+
n.toLowerCase() === t && (e = s);
|
|
269
|
+
}), e;
|
|
270
|
+
}
|
|
271
|
+
function V(r, t, e) {
|
|
272
|
+
const n = [];
|
|
273
|
+
return w(r, (s, a) => n.push([s, a])), n.push([t, e]), n;
|
|
274
|
+
}
|
|
275
|
+
function W(r = {}) {
|
|
276
|
+
const t = new Map(Object.entries(r.seed ?? {})), e = r.unavailable === !0, n = (o) => {
|
|
277
|
+
if (e) return { status: "unavailable" };
|
|
278
|
+
const i = t.get(o);
|
|
279
|
+
return i === void 0 ? { status: "miss" } : { status: "hit", value: i };
|
|
280
|
+
}, s = (o, i) => e ? { status: "unavailable" } : (t.set(o, i), { status: "ok" }), a = (o) => e ? { status: "unavailable" } : (t.delete(o), { status: "ok" });
|
|
281
|
+
return r.async ? {
|
|
282
|
+
sync: !1,
|
|
283
|
+
get: async (o) => n(o),
|
|
284
|
+
set: async (o, i) => s(o, i),
|
|
285
|
+
remove: async (o) => a(o)
|
|
286
|
+
} : { sync: !0, get: n, set: s, remove: a };
|
|
287
|
+
}
|
|
288
|
+
const U = 255, C = 1e3, y = 2e3, D = 200, p = `
|
|
289
|
+
… [truncated]`;
|
|
290
|
+
function l(r, t, e = !1) {
|
|
291
|
+
if (r.length <= t) return r;
|
|
292
|
+
let n = r.slice(0, t - p.length);
|
|
293
|
+
if (e) {
|
|
294
|
+
const s = n.lastIndexOf(`
|
|
295
|
+
`);
|
|
296
|
+
s > 0 && (n = n.slice(0, s));
|
|
297
|
+
}
|
|
298
|
+
return n + p;
|
|
299
|
+
}
|
|
300
|
+
const _ = (r) => l(r, y, !0), g = /* @__PURE__ */ new WeakSet();
|
|
301
|
+
function b(r) {
|
|
302
|
+
r !== null && (typeof r == "object" || typeof r == "function") && g.add(r);
|
|
303
|
+
}
|
|
304
|
+
function v(r) {
|
|
305
|
+
return r !== null && (typeof r == "object" || typeof r == "function") && g.has(r);
|
|
306
|
+
}
|
|
307
|
+
function E(r) {
|
|
308
|
+
const t = r?.name;
|
|
309
|
+
return typeof t == "string" && t !== "" ? t : "Error";
|
|
310
|
+
}
|
|
311
|
+
function R(r, t) {
|
|
312
|
+
if (typeof r == "string" && r !== "") return r;
|
|
313
|
+
const e = r?.message;
|
|
314
|
+
if (typeof e == "string" && e !== "") return e;
|
|
315
|
+
if (!(t == null || t === ""))
|
|
316
|
+
return String(t);
|
|
317
|
+
}
|
|
318
|
+
let m = !1;
|
|
319
|
+
function B() {
|
|
320
|
+
m || !d() || (m = !0, console.warn(
|
|
321
|
+
"[edge-telemetry] Error.stackTraceLimit is the engine default (10 frames on V8), which truncates crash stacks well before the SDK's 2000-char cap. Set `Error.stackTraceLimit = 50` in your app's entry file — the SDK will not set it for you."
|
|
322
|
+
));
|
|
323
|
+
}
|
|
324
|
+
function N(r, t, e = {}) {
|
|
325
|
+
const n = {
|
|
326
|
+
"error.type": l(E(t), U),
|
|
327
|
+
"error.source": r
|
|
328
|
+
}, s = R(t, e.fallbackMessage);
|
|
329
|
+
s !== void 0 && (n["error.message"] = l(s, C));
|
|
330
|
+
const a = t?.stack;
|
|
331
|
+
return typeof a == "string" && a !== "" && (n["error.stacktrace"] = l(a, y, !0), B()), e.fatal !== void 0 && (n["error.fatal"] = e.fatal), n;
|
|
332
|
+
}
|
|
333
|
+
function H(r, t = console) {
|
|
334
|
+
const e = t.error.bind(t), n = t.warn.bind(t);
|
|
335
|
+
let s = !1;
|
|
336
|
+
const a = (o, i) => (...c) => {
|
|
337
|
+
if (!s && !c.some(v)) {
|
|
338
|
+
s = !0;
|
|
339
|
+
try {
|
|
340
|
+
o(c.map(String).join(" "));
|
|
341
|
+
} finally {
|
|
342
|
+
s = !1;
|
|
343
|
+
}
|
|
344
|
+
}
|
|
345
|
+
i(...c);
|
|
346
|
+
};
|
|
347
|
+
return t.error = a(
|
|
348
|
+
(o) => r.captureError(o, void 0, "console"),
|
|
349
|
+
e
|
|
350
|
+
), t.warn = a(
|
|
351
|
+
// Capped here, not at the ring: 20 uncapped React warnings would put kilobytes of
|
|
352
|
+
// `error.breadcrumbs` on every `app.crash`, which is the budget this split exists to protect.
|
|
353
|
+
(o) => r.addBreadcrumb("console.warn", { message: l(o, D) }),
|
|
354
|
+
n
|
|
355
|
+
), () => {
|
|
356
|
+
t.error = e, t.warn = n;
|
|
357
|
+
};
|
|
358
|
+
}
|
|
359
|
+
const M = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
360
|
+
__proto__: null,
|
|
361
|
+
buildErrorAttributes: N,
|
|
362
|
+
capComponentStack: _,
|
|
363
|
+
captureConsole: H,
|
|
364
|
+
errorType: E,
|
|
365
|
+
isBoundaryCaught: v,
|
|
366
|
+
markBoundaryCaught: b
|
|
367
|
+
}, Symbol.toStringTag, { value: "Module" }));
|
|
368
|
+
class F extends T {
|
|
369
|
+
constructor() {
|
|
370
|
+
super(...arguments), this.state = { error: void 0, failed: !1 }, this.resetError = () => this.setState({ error: void 0, failed: !1 });
|
|
371
|
+
}
|
|
372
|
+
static getDerivedStateFromError(t) {
|
|
373
|
+
return b(t), { error: t, failed: !0 };
|
|
374
|
+
}
|
|
375
|
+
componentDidCatch(t, e) {
|
|
376
|
+
this.props.telemetry.captureBoundaryError(t, e?.componentStack).catch((n) => u.warn("EdgeErrorBoundary: report failed:", n));
|
|
377
|
+
try {
|
|
378
|
+
this.props.onError?.(t, e);
|
|
379
|
+
} catch (n) {
|
|
380
|
+
u.warn("EdgeErrorBoundary: onError threw:", n);
|
|
381
|
+
}
|
|
382
|
+
}
|
|
383
|
+
render() {
|
|
384
|
+
if (!this.state.failed) return this.props.children ?? null;
|
|
385
|
+
const { fallback: t } = this.props;
|
|
386
|
+
return typeof t == "function" ? t({ error: this.state.error, resetError: this.resetError }) : t ?? null;
|
|
387
|
+
}
|
|
388
|
+
}
|
|
389
|
+
function G(r, t = !0) {
|
|
390
|
+
k(() => {
|
|
391
|
+
t && r.markScreenReady();
|
|
392
|
+
}, [r, t]);
|
|
393
|
+
}
|
|
394
|
+
export {
|
|
395
|
+
F as E,
|
|
396
|
+
L as T,
|
|
397
|
+
x as a,
|
|
398
|
+
N as b,
|
|
399
|
+
H as c,
|
|
400
|
+
u as d,
|
|
401
|
+
d as e,
|
|
402
|
+
K as f,
|
|
403
|
+
O as g,
|
|
404
|
+
v as i,
|
|
405
|
+
W as m,
|
|
406
|
+
I as n,
|
|
407
|
+
z as p,
|
|
408
|
+
X as r,
|
|
409
|
+
j as s,
|
|
410
|
+
G as u,
|
|
411
|
+
V as w
|
|
412
|
+
};
|
|
413
|
+
//# sourceMappingURL=react-urNtDGTL.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"react-urNtDGTL.js","sources":["../src/core/debug.ts","../src/index.base.ts","../src/adapters/traceHeader.ts","../src/core/memoryStore.ts","../src/adapters/crashCapture.ts","../src/react.ts"],"sourcesContent":["// SDK-internal debug gate (#23, Workstream E). Silent by default so v3 never spams the\n// host app's console; `createTelemetry({ debug: true })` flips it on. Gates log AND\n// warn/error — nothing prints unless debug is enabled.\nlet enabled = false;\n\nexport function setDebug(on: boolean): void {\n enabled = on;\n}\n\nexport const debug = {\n log: (...args: any[]) => { if (enabled) console.log(...args); },\n warn: (...args: any[]) => { if (enabled) console.warn(...args); },\n error: (...args: any[]) => { if (enabled) console.error(...args); },\n};\n\n/**\n * `__DEV__` on RN, `NODE_ENV` elsewhere. Dev-only *config* diagnostics (a malformed\n * allowlist, the `Error.stackTraceLimit` advisory) surface through this rather than the\n * `debug` gate above: they are wiring mistakes the consumer has to see while building,\n * and `debug: true` is exactly what a consumer with a wiring mistake has not set.\n */\nexport function isDev(): boolean {\n const dev = (globalThis as any).__DEV__;\n if (typeof dev === \"boolean\") return dev;\n const env = (globalThis as any).process?.env?.NODE_ENV;\n return env !== undefined && env !== \"production\";\n}\n","// Shared delegation base for TelemetryWeb / TelemetryNative.\n// Both platform classes lazily build a core `Telemetry` behind `instancePromise`\n// and forward every public call to it; these methods are identical across platforms.\n// Platform-specific capture (getDeviceInfo, track*, screen) stays in the subclasses\n// because each imports a different platform adapter.\n\nimport { debug } from \"./core/debug\";\nimport type { Telemetry } from \"./core/telemetry\";\nimport type { TaskOutcome } from \"./adapters/manualSpans\";\n\n/** What `startSpan()` returns. `end()` is idempotent, never throws, and returns nothing to await. */\nexport type SpanHandle = {\n /** `reason` becomes `task.failure_reason` on a `failed` end, and is ignored otherwise (#179). */\n end(opts?: { outcome?: TaskOutcome; reason?: string; attributes?: Record<string, unknown> }): void;\n};\n\ntype ProfileInput = {\n userId?: string;\n /** @deprecated Removed in v6 — use `identify({ name })`. */\n fullName?: string;\n /** @deprecated Removed in v6 — never reaches the wire (§3.4). */\n firstName?: string;\n /** @deprecated Removed in v6 — never reaches the wire (§3.4). */\n lastName?: string;\n email?: string;\n phone?: string;\n /** @deprecated Removed in v6 — never reaches the wire (§3.4). */\n avatar?: string;\n customAttributes?: Record<string, any>;\n};\n\nexport abstract class TelemetryBase {\n protected instancePromise!: Promise<any>;\n /**\n * The resolved core, once `instancePromise` settles — set by each entry. The synchronous\n * methods (`startSpan`, native `trackTap`) cannot afford an `await` before they read the\n * world: the host navigates on the very next line (§4.6's mint/emit split). Before it is\n * set they fall back to emit-time identity.\n */\n protected resolved?: Telemetry;\n\n /** Run `fn` against the core now if it is resolved, else once it is. Never throws or rejects. */\n private now(fn: (inst: Telemetry) => unknown, what: string): Promise<void> {\n const swallow = (err: unknown) => { debug.warn(`${what} failed:`, err); };\n try {\n return (this.resolved ? Promise.resolve(fn(this.resolved)) : this.instancePromise.then(fn))\n .then(() => undefined, swallow);\n } catch (err) { swallow(err); return Promise.resolve(); }\n }\n\n /**\n * \"This screen is usable now\" (#171). Synchronous, no arguments: it marks the **current**\n * view, so your name and the SDK's cannot disagree. The time is taken now; the view is\n * chosen one macrotask later, so a mark from a new screen's mount effect lands on that\n * screen even though the navigation that opened it settles behind it. The `view` row then\n * carries `view.ready_time` and `view.ready_outcome`. First mark per view wins. Before init\n * the mark is buffered and lands on the initial view.\n */\n markScreenReady(): void {\n const at = Date.now();\n this.now((inst) => { setTimeout(() => inst.views.markReady(at), 0); }, \"markScreenReady\");\n }\n\n // ---------- Consent (#172) ----------\n\n /**\n * Stop collecting, and keep nothing: the queue, the offline store and the session record\n * are dropped, every timer stops, and the network patches pass through untouched. The flag\n * is off before this returns. Survives only this process — persist the user's choice\n * yourself and construct with `enabled: false` next launch.\n */\n disable(): void {\n this.now((inst) => inst.disable(), \"disable\");\n }\n\n /** Resume collection. A session that expired while disabled rotates. */\n enable(): void {\n this.now((inst) => inst.enable(), \"enable\");\n }\n\n // ---------- Sibling parity (#167) ----------\n\n /** Ship your own number. `unit` → `metric.unit`. The SDK's metric names are reserved; a non-finite value is dropped. */\n async recordMetric(name: string, value: number, attributes?: Record<string, any>, opts?: { unit?: string }) {\n const inst = await this.instancePromise;\n return inst.recordMetric(name, value, attributes, opts);\n }\n\n /** Add a step to the trail of 20 that rides `app.crash` and `app.hang`. Name ≤64, ≤8 data keys, values ≤255. */\n async addBreadcrumb(name: string, data?: Record<string, unknown>) {\n const inst = await this.instancePromise;\n inst.addBreadcrumb(name, data);\n }\n\n /** End the current session and start a fresh one — e.g. on logout. `session.reason: manual`. */\n async startNewSession() {\n const inst = await this.instancePromise;\n return inst.startNewSession();\n }\n\n // ---------- Manual spans (#164) ----------\n\n /**\n * Time a journey: one `task.complete` row when the handle is ended. Synchronous — the\n * trace keys, `view.id` and `session.id` freeze here. A span joins the live action's\n * root, else mints a `custom` one; requests inside it parent to that root, not the span.\n * Starting a name that is already open supersedes it. Blank names and a 33rd open span\n * are inert. Misuse never throws.\n */\n startSpan(name: string, attributes?: Record<string, unknown>): SpanHandle {\n const at = Date.now();\n let span: unknown;\n let ended = false;\n let startRan = false;\n const started = this.now((inst) => { span = inst.startSpan(name, attributes, at); startRan = true; }, \"startSpan\");\n return {\n end: (opts) => {\n if (ended) return;\n ended = true;\n const endAt = Date.now();\n const close = () => this.now((inst) => span && inst.endSpan(name, opts?.outcome ?? \"completed\", opts?.attributes, endAt, span as any, opts?.reason), \"span.end\");\n // A pre-init start is still queued when `resolved` lands; an end in that gap\n // must wait for it, or it sees no span. Otherwise close now, in call order.\n if (startRan) close(); else void started.then(close);\n },\n };\n }\n\n /**\n * `startSpan` + `end` around `fn`, sync or async. A throw (or rejection) ends the span\n * `failed` and is rethrown untouched — no `app.error` is emitted; your catch decides.\n */\n withSpan<T>(name: string, fn: () => T, attributes?: Record<string, unknown>): T {\n const span = this.startSpan(name, attributes);\n let result: T;\n try {\n result = fn();\n } catch (err) {\n span.end({ outcome: \"failed\" });\n throw err;\n }\n if (result && typeof (result as any).then === \"function\") {\n return (result as any).then(\n (v: unknown) => { span.end(); return v; },\n (err: unknown) => { span.end({ outcome: \"failed\" }); throw err; },\n );\n }\n span.end();\n return result;\n }\n\n /**\n * Close an open span by name — for a journey that ends in a different component. `reason`\n * becomes `task.failure_reason` on a `failed` end (#179).\n */\n endSpan(name: string, outcome: TaskOutcome = \"completed\", attributes?: Record<string, unknown>, reason?: string): void {\n const at = Date.now();\n this.now((inst) => inst.endSpan(name, outcome, attributes, at, undefined, reason), \"endSpan\");\n }\n\n async log(event: string, data?: Record<string, any>) {\n const inst = await this.instancePromise;\n // §4.7 — **there is no public path to `app.crash`.** It is the one name an unfiltered\n // `COUNT(event_name='app.crash') / sessions` is read from, so a consumer's own code\n // must not be able to manufacture rows in it. Routed to `app.error` rather than\n // dropped: a reported error is data, it just isn't a crash. (#100)\n if (event === \"app.crash\") {\n debug.warn(\"app.crash is SDK-owned (§4.7); routing to app.error — use captureError()\");\n // The whole bag still rides as context; this only decides which key gets promoted\n // to `error.message`. `crash.message` is here for v3 callers the rename stranded.\n const message = data?.[\"error.message\"] ?? data?.[\"message\"] ?? data?.[\"crash.message\"];\n return inst.captureError(message, data);\n }\n return inst.log(event, data);\n }\n\n async flush() {\n const inst = await this.instancePromise;\n return inst.flush();\n }\n\n async shutdown() {\n const inst = await this.instancePromise;\n return inst.shutdown();\n }\n\n /**\n * React Navigation → rung 2 of the name ladder, on **both** builds (§4.5.1, #96).\n * `getCurrentRoute()` is a navigation-tree API that works identically on RN-Web, so a\n * consumer wires navigation once and gets the same `view.name` on web and native.\n */\n async attachNavigation(navigationRef: any) {\n debug.log(\"Attaching navigation tracker\");\n if (!navigationRef) {\n debug.warn(\"Navigation reference is undefined. Cannot attach navigation tracker.\");\n return;\n }\n const inst = await this.instancePromise;\n const { NavigationRefTracker } = await import(\"./adapters/navigationRef\");\n new NavigationRefTracker(inst).attach(navigationRef);\n }\n\n /**\n * §4.7 — report a handled error as `app.error`. Accepts `unknown`, so a `catch` block\n * that received a string or an axios rejection object needs no narrowing first.\n * There is no public path to `app.crash`, by design (#100).\n */\n async captureError(error: unknown, context?: Record<string, any>) {\n const inst = await this.instancePromise;\n return inst.captureError(error, context);\n }\n\n /**\n * `<EdgeErrorBoundary>`'s path (#166) — `app.error` with `error.source: boundary` and the\n * component stack. Not for host code: `captureError()` is the public way to report.\n * @internal\n */\n async captureBoundaryError(error: unknown, componentStack?: string | null) {\n const inst = await this.instancePromise;\n const { capComponentStack } = await import(\"./adapters/crashCapture\");\n const context = componentStack ? { \"error.component_stack\": capComponentStack(componentStack) } : undefined;\n return inst.captureError(error, context, \"boundary\");\n }\n\n /**\n * Wired per entry (#160): each build imports its own crash handler. Shared code importing\n * the native one is what made the web build resolve it at runtime and reject.\n */\n abstract trackErrors(options?: { captureConsole?: boolean }): Promise<void>;\n\n // ---------- User Profile Management ----------\n\n async setUserId(id: string) {\n const inst = await this.instancePromise;\n inst.setUserId(id);\n }\n\n async setUserProfile(profile: ProfileInput) {\n const inst = await this.instancePromise;\n inst.setUserProfile(profile);\n }\n\n async setUserDetails(details: ProfileInput) {\n const inst = await this.instancePromise;\n inst.setUserDetails(details);\n }\n\n async updateUserProfile(updates: ProfileInput) {\n const inst = await this.instancePromise;\n inst.updateUserProfile(updates);\n }\n\n async getUserProfile() {\n const inst = await this.instancePromise;\n return inst.getUserProfile();\n }\n\n async clearUserProfile() {\n const inst = await this.instancePromise;\n inst.clearUserProfile();\n }\n\n async setUserName(fullName: string, firstName?: string, lastName?: string) {\n const inst = await this.instancePromise;\n inst.setUserName(fullName, firstName, lastName);\n }\n\n async setUserContact(email?: string, phone?: string) {\n const inst = await this.instancePromise;\n inst.setUserContact(email, phone);\n }\n\n // EdgeRum-style identify(): emits `user.profile.update`, the **only** event carrying\n // `user.name` / `.email` / `.phone` / `user.custom.*` (§4.10, #107).\n // `userId` is optional and sets the consumer-owned `user.id` the profile upserts on —\n // omit it and `user.id` is untouched; the SDK still never mints one (§3.2).\n async identify(profile: { userId?: string; name?: string; email?: string; phone?: string; avatar?: string; customAttributes?: Record<string, any> }) {\n const inst = await this.instancePromise;\n return inst.identify(profile);\n }\n}\n","// Distributed trace header injection (§6.4/§6.5, #99) — the pure half: allowlist\n// normalization, `traceparent` parse/format and header reading. Shared by both builds; the\n// stateful half (attribution, which decides *which* `injected_*` rung fires) lives on\n// TraceManager, which owns the carrier.\n//\n// **`traceparent` only. No `b3`, no `tracestate`, ever.** The SDK reads exactly one header\n// name, for exactly one purpose (a presence check), and writes exactly one header name. That\n// is a sentence a consumer must be able to state during a security review, so it is enforced\n// by there being no other header name anywhere in this file.\n\nimport { debug, isDev } from \"../core/debug\";\n\n/** Lowercase on purpose: header names are compared case-insensitively (§6.4). */\nexport const TRACEPARENT = \"traceparent\";\n\n/** §6.5's ladder. Precedence is declaration order; **absent means not traced**. */\nexport type TraceOutcome =\n | \"skipped_off_allowlist\"\n | \"skipped_no_cors\" // fetch-only: `mode` is a concept XHR cannot express\n | \"skipped_consumer_set\" // consumer header present and **unparseable**\n | \"adopted\" // consumer header present and **valid**\n | \"injected_attributed\"\n | \"injected_expired\"\n | \"injected_unattributed\";\n\n// A malformed allowlist entry throws in dev and is dropped in production (§6.4) — a stated\n// divergence from Android's unconditional `require`, because a RUM SDK crashing a shipped\n// banking app over a config typo is the one failure worse than no tracing at all. `isDev`\n// itself lives in core/debug, shared with §4.8's stackTraceLimit advisory.\n\n/**\n * A **bare host**: no scheme, no path, no port, no wildcard. Ports are ignored by matching\n * too — ⚠ a deliberate mismatch with `http.host`, which keeps the port. Do not join them.\n *\n * `new URL()` does the punycode fold, so a unicode entry and a unicode URL land on the same\n * ASCII string. An IPv6 literal contains `:` and is therefore rejected; bare hosts only.\n */\nfunction normalizeHost(entry: unknown): string | undefined {\n if (typeof entry !== \"string\") return undefined;\n const raw = entry.trim();\n if (!raw || /[\\s/?#@*:]/.test(raw)) return undefined;\n try {\n const host = new URL(`http://${raw}`).hostname;\n return host || undefined;\n } catch {\n return undefined;\n }\n}\n\n/**\n * Constructor-only, exact match, empty by default — v4 is **dark on upgrade**, so nobody's\n * CORS breaks until they opt in. Listing a host is the consumer's assertion that that host\n * allows the header; that is why regexes and predicates were rejected rather than deferred.\n */\nexport function normalizeAllowlist(entries: unknown): ReadonlySet<string> {\n const out = new Set<string>();\n if (entries === undefined || entries === null) return out;\n if (!Array.isArray(entries)) {\n if (isDev()) throw new Error(\"traceHostAllowlist must be an array of bare hosts\");\n debug.warn(\"Telemetry: traceHostAllowlist must be an array of bare hosts — ignored\");\n return out;\n }\n for (const entry of entries) {\n const host = normalizeHost(entry);\n if (host) { out.add(host); continue; }\n if (isDev()) {\n throw new Error(\n `traceHostAllowlist: \"${String(entry)}\" is not a bare host (no scheme, path, port or wildcard)`\n );\n }\n debug.warn(`Telemetry: traceHostAllowlist entry \"${String(entry)}\" is not a bare host — dropped`);\n }\n return out;\n}\n\n/** Matching is on `hostname` — **ports ignored**, exact-only, no wildcards, no same-origin exemption. */\nexport function allowsHost(allowlist: ReadonlySet<string>, url: string): boolean {\n if (allowlist.size === 0) return false;\n const base = (globalThis as any).location?.href;\n try {\n return allowlist.has((base ? new URL(url, base) : new URL(url)).hostname);\n } catch {\n return false; // a relative URL with no base has no host to allow\n }\n}\n\n/**\n * W3C `traceparent`, version `00`. Used for exactly one decision: is the consumer's own\n * header valid (`adopted`) or not (`skipped_consumer_set`)? An all-zero trace-id or span-id\n * is invalid by the spec. ⚠ Its price, said out loud: Android *repairs* a malformed consumer\n * header; §6.4's never-strip forbids that here, so it goes out broken and is unattributed on\n * both ends — visible in the outcome distribution rather than silently fixed.\n */\nexport function parseTraceparent(value: string | null | undefined): { traceId: string; spanId: string } | undefined {\n if (typeof value !== \"string\") return undefined;\n const m = /^00-([0-9a-f]{32})-([0-9a-f]{16})-[0-9a-f]{2}$/.exec(value.trim());\n if (!m || /^0+$/.test(m[1]) || /^0+$/.test(m[2])) return undefined;\n return { traceId: m[1], spanId: m[2] };\n}\n\n/** Flags are always `01`: an unsampled session injects no header at all, not a `flags=00` id. */\nexport function formatTraceparent(traceId: string, spanId: string): string {\n return `00-${traceId}-${spanId}-01`;\n}\n\n/** Walks every `HeadersInit` shape without needing a `Headers` constructor to exist. */\nfunction forEachHeader(headers: unknown, fn: (name: string, value: string) => void): void {\n if (!headers) return;\n if (Array.isArray(headers)) {\n for (const pair of headers) if (pair) fn(String(pair[0]), String(pair[1]));\n } else if (typeof (headers as any).forEach === \"function\") {\n (headers as any).forEach((v: string, k: string) => fn(String(k), String(v))); // Headers\n } else if (typeof headers === \"object\") {\n for (const [k, v] of Object.entries(headers as object)) fn(k, String(v));\n }\n}\n\n/** Presence check only — the one purpose §6.4's read-scope invariant permits. */\nexport function readHeader(headers: unknown, name: string): string | undefined {\n let found: string | undefined;\n forEachHeader(headers, (k, v) => { if (k.toLowerCase() === name) found = v; });\n return found;\n}\n\n/**\n * A **copy** with our header appended. The consumer's `Headers`/`Request`/object is never\n * mutated, which is how never-strip is satisfied by construction rather than by discipline.\n * An array of pairs is a valid `HeadersInit` everywhere, so no `Headers` global is required.\n */\nexport function withHeader(headers: unknown, name: string, value: string): [string, string][] {\n const out: [string, string][] = [];\n forEachHeader(headers, (k, v) => out.push([k, v]));\n out.push([name, value]);\n return out;\n}\n","import type { AsyncStore, Store, StoreRead, StoreWrite, SyncStore } from \"./store\";\n\nexport type MemoryStoreOpts = {\n /** Mirror the native build's Promise-returning shape instead of the web build's. */\n async?: boolean;\n /** Behave like incognito / a full disk: every call reports `unavailable`. */\n unavailable?: boolean;\n /** Pre-seeded contents. */\n seed?: Record<string, string>;\n};\n\n/**\n * In-memory Store (#89). A production-shaped seam that tests get to use, not a\n * test-only affordance — it ships, and it is the right injection for a consumer\n * that wants telemetry state to die with the process.\n *\n * Configurable to either build's shape so the sync/async asymmetry can be tested\n * deliberately rather than assumed away.\n */\nexport function memoryStore(opts: MemoryStoreOpts & { async: true }): AsyncStore;\nexport function memoryStore(opts?: MemoryStoreOpts & { async?: false }): SyncStore;\nexport function memoryStore(opts: MemoryStoreOpts = {}): Store {\n const map = new Map<string, string>(Object.entries(opts.seed ?? {}));\n const unavailable = opts.unavailable === true;\n\n const get = (key: string): StoreRead => {\n if (unavailable) return { status: \"unavailable\" };\n const value = map.get(key);\n return value === undefined ? { status: \"miss\" } : { status: \"hit\", value };\n };\n const set = (key: string, value: string): StoreWrite => {\n if (unavailable) return { status: \"unavailable\" };\n map.set(key, value);\n return { status: \"ok\" };\n };\n const remove = (key: string): StoreWrite => {\n if (unavailable) return { status: \"unavailable\" };\n map.delete(key);\n return { status: \"ok\" };\n };\n\n return opts.async\n ? {\n sync: false,\n get: async k => get(k),\n set: async (k, v) => set(k, v),\n remove: async k => remove(k),\n }\n : { sync: true, get, set, remove };\n}\n","/**\n * §4.7 — the error surface. Two event names, not one: `app.crash` is unhandled /\n * fatal-ish, `app.error` is handled or non-fatal, so\n * `COUNT(event_name='app.crash') / sessions` is a crash-free rate with no `WHERE`\n * clause anyone can forget. All five v3 `crash.*` keys are retired for dotted\n * `error.*`, and both explicit wire nulls go with them. #100\n */\n\nimport { isDev } from \"../core/debug\";\n\n/** `error.source` — a full re-cut of v3's `crash.cause`, not a rename. 5 values. */\nexport type ErrorSource =\n | \"global_handler\"\n | \"unhandled_rejection\"\n | \"cross_origin\" // web only: window.onerror with error === undefined\n | \"console\" // now on app.error\n | \"reported\" // captureError()\n | \"boundary\"; // <EdgeErrorBoundary> (#166) — on app.error, never app.crash\n\n// §4.7 caps. The stacktrace's 2000 is a tuning knob, not a contractual constant —\n// it may be tight for Hermes, where the bytecode offset is the whole signal.\nconst TYPE_MAX = 255;\nconst MESSAGE_MAX = 1000;\nconst STACK_MAX = 2000;\n/** Breadcrumb text is not an error payload — 20 of these ride every `app.crash`. */\nconst CRUMB_MAX = 200;\n\n/** Marked inline: no key, countable with a `LIKE`, zero schema. */\nconst TRUNCATED = \"\\n… [truncated]\";\n\n/**\n * Drops the tail, never the head — the top frames *are* the grouping input.\n *\n * ⚠ `frameBoundary` is not cosmetic. On Hermes `line` is a constant 1 and the bytecode\n * offset carries the location, so a cut mid-frame turns `at p (address at bundle:1:132161)`\n * into `…bundle:1:13` — which resolves to a **different, wrong** place rather than failing.\n */\nfunction cap(value: string, max: number, frameBoundary = false): string {\n if (value.length <= max) return value;\n let cut = value.slice(0, max - TRUNCATED.length);\n if (frameBoundary) {\n const nl = cut.lastIndexOf(\"\\n\");\n if (nl > 0) cut = cut.slice(0, nl);\n }\n return cut + TRUNCATED;\n}\n\n/** `error.component_stack` (#166): raw, same 2000 cap, cut on a line boundary like a stack. */\nexport const capComponentStack = (stack: string): string => cap(stack, STACK_MAX, true);\n\n/**\n * Errors an `<EdgeErrorBoundary>` has caught, filled in `getDerivedStateFromError` — the render\n * phase, before React's own reporting runs. The global handlers and `captureConsole` skip\n * these, so a boundary-caught error is **one row**, not two or three (#166). Module-level so\n * every boundary and every `Telemetry` in the process share it; a `WeakSet`, so it holds\n * nothing alive. A thrown primitive cannot be a key and is not deduped.\n */\nconst boundaryCaught = new WeakSet<object>();\nexport function markBoundaryCaught(error: unknown): void {\n if (error !== null && (typeof error === \"object\" || typeof error === \"function\")) boundaryCaught.add(error);\n}\nexport function isBoundaryCaught(error: unknown): boolean {\n return error !== null && (typeof error === \"object\" || typeof error === \"function\") && boundaryCaught.has(error);\n}\n\n/**\n * `error.type` is read from `error.name` **only, never `constructor.name`**: RN production\n * bundles minify class names, so `class PaymentError extends Error {}` would report as `\"a\"`\n * — not merely unreadable but *unstable across builds*, refragmenting grouping on every\n * deploy. `error.name` is a string literal in the author's source. Un-named classes report\n * `\"Error\"`: low cardinality, but honest.\n */\nexport function errorType(error: unknown): string {\n const name = (error as any)?.name;\n return typeof name === \"string\" && name !== \"\" ? name : \"Error\";\n}\n\n/**\n * Half of real `catch` blocks receive a string or an axios rejection object, not an Error, so\n * `fallbackMessage` is consulted **only** when the thrown value carries nothing usable.\n */\nfunction errorMessage(error: unknown, fallbackMessage?: unknown): string | undefined {\n if (typeof error === \"string\" && error !== \"\") return error;\n const m = (error as any)?.message;\n if (typeof m === \"string\" && m !== \"\") return m;\n if (fallbackMessage === undefined || fallbackMessage === null || fallbackMessage === \"\") return undefined;\n return String(fallbackMessage);\n}\n\n/**\n * §4.8's second consumer wiring step, said **once per process and only in dev**.\n *\n * RN 0.81.4 sets `Error.stackTraceLimit` nowhere, so V8's default of **10 frames** governs —\n * not the 2000-char cap, which holds ~26. Ten frames of an `unhandledrejection` can be\n * entirely library internals.\n *\n * ⚠ The SDK **never assigns it**. Raising it globally is an invisible mutation of the\n * consumer's runtime that makes every `new Error()` in their app more expensive and\n * unattributable to us — so this is an advisory, and the consumer's own line of code.\n *\n * Not behind `debug()`: a consumer who has not wired this up is precisely a consumer who\n * has not set `debug: true`. Same reasoning as §6.4's dev throw, one rung quieter — and the\n * one carve-out from the no-bare-console rule, recorded as such in CLAUDE.md.\n */\nlet advised = false;\nfunction adviseStackTraceLimit(): void {\n // The flag is set only when the advice is actually *said*: burning it on a call made\n // before `__DEV__` is defined would silence a dev app for the rest of the process.\n if (advised || !isDev()) return;\n advised = true;\n console.warn(\n \"[edge-telemetry] Error.stackTraceLimit is the engine default (10 frames on V8), which \" +\n \"truncates crash stacks well before the SDK's 2000-char cap. Set `Error.stackTraceLimit = 50` \" +\n \"in your app's entry file — the SDK will not set it for you.\",\n );\n}\n\n/**\n * The `error.*` block for both event names. `error.handled` does not exist — the event name\n * carries that bit, and carrying both is a denormalization that can disagree. `error.fatal`\n * is passed only by the native build (§4.7: on web nothing is fatal).\n */\nexport function buildErrorAttributes(\n source: ErrorSource,\n error: unknown,\n opts: { fallbackMessage?: unknown; fatal?: boolean } = {},\n): Record<string, any> {\n const attrs: Record<string, any> = {\n \"error.type\": cap(errorType(error), TYPE_MAX),\n \"error.source\": source,\n };\n\n const message = errorMessage(error, opts.fallbackMessage);\n if (message !== undefined) attrs[\"error.message\"] = cap(message, MESSAGE_MAX);\n\n const stack = (error as any)?.stack;\n if (typeof stack === \"string\" && stack !== \"\") {\n attrs[\"error.stacktrace\"] = cap(stack, STACK_MAX, true);\n // Here rather than at init: this is the one chokepoint every captured stack passes\n // through, so the advice arrives when a dev has a real, already-truncated stack in front\n // of them — and #23's \"construct → log → flush is silent by default\" stays intact.\n adviseStackTraceLimit();\n }\n\n if (opts.fatal !== undefined) attrs[\"error.fatal\"] = opts.fatal;\n return attrs;\n}\n\n/** What `captureConsole` needs of a `Telemetry` — structural. */\ntype ErrorSink = {\n captureError(error: unknown, context?: Record<string, any>, source?: ErrorSource): unknown;\n addBreadcrumb(name: string, data?: Record<string, any>): void;\n};\n\n/**\n * Patch console.error → `app.error` (source `console`) and console.warn → a **breadcrumb**.\n * `ConsoleWarn` is deleted outright: React's own dev-mode warnings were the dominant\n * contributor to v3's crash count, which is what made \"is my app crashing more?\"\n * unanswerable. Opt-*in* now — `captureConsole` defaults off (§4.7).\n *\n * Returns a restore fn. A reentrancy guard keeps the SDK's own console writes during\n * logging from re-capturing.\n */\nexport function captureConsole(\n telemetry: ErrorSink,\n target: Pick<Console, \"error\" | \"warn\"> = console,\n): () => void {\n const origError = target.error.bind(target);\n const origWarn = target.warn.bind(target);\n let inside = false;\n\n const guarded = (emit: (text: string) => void, orig: (...a: any[]) => void) =>\n (...args: any[]) => {\n // React reports a caught error to console.error *with* the error object; the boundary\n // already emitted it (#166).\n if (!inside && !args.some(isBoundaryCaught)) {\n inside = true;\n try {\n emit(args.map(String).join(\" \"));\n } finally {\n inside = false;\n }\n }\n orig(...args);\n };\n\n // Through captureError, not log(), so the `error.fatal` platform rule stays in one place.\n target.error = guarded(\n (text) => telemetry.captureError(text, undefined, \"console\"),\n origError,\n );\n target.warn = guarded(\n // Capped here, not at the ring: 20 uncapped React warnings would put kilobytes of\n // `error.breadcrumbs` on every `app.crash`, which is the budget this split exists to protect.\n (text) => telemetry.addBreadcrumb(\"console.warn\", { message: cap(text, CRUMB_MAX) }),\n origWarn,\n );\n\n return () => { target.error = origError; target.warn = origWarn; };\n}\n","// The React module (#166, decision #144) — on the main entry, no subpath, no Provider, no\n// context: the telemetry instance is a prop. `createElement`, not JSX, so the build emits no\n// `react/jsx-runtime` import for the externalization list to miss.\n\nimport { Component, useEffect, type ErrorInfo, type ReactNode } from \"react\";\nimport { debug } from \"./core/debug\";\nimport { markBoundaryCaught } from \"./adapters/crashCapture\";\n\ntype BoundaryTelemetry = { captureBoundaryError(error: unknown, componentStack?: string | null): Promise<unknown> };\n\nexport type EdgeErrorBoundaryProps = {\n telemetry: BoundaryTelemetry;\n children?: ReactNode;\n /** Rendered in place of the failed subtree: a node, or a render function given the error and a reset. */\n fallback?: ReactNode | ((props: { error: unknown; resetError: () => void }) => ReactNode);\n /** Runs after the SDK's emit. A throw here is swallowed — your handler cannot break the boundary. */\n onError?: (error: unknown, info: ErrorInfo) => void;\n};\n\n/**\n * Reports a caught render error as `app.error`, `error.source: boundary` — **never**\n * `app.crash`: the boundary handled it — exactly once. The error is marked in\n * `getDerivedStateFromError`, before React's own reporting, so `captureConsole` and the\n * global handlers skip it.\n */\nexport class EdgeErrorBoundary extends Component<EdgeErrorBoundaryProps, { error?: unknown; failed: boolean }> {\n state = { error: undefined as unknown, failed: false };\n\n static getDerivedStateFromError(error: unknown) {\n markBoundaryCaught(error);\n return { error, failed: true };\n }\n\n componentDidCatch(error: unknown, info: ErrorInfo) {\n this.props.telemetry.captureBoundaryError(error, info?.componentStack)\n .catch((err) => debug.warn(\"EdgeErrorBoundary: report failed:\", err));\n try {\n this.props.onError?.(error, info);\n } catch (err) {\n debug.warn(\"EdgeErrorBoundary: onError threw:\", err);\n }\n }\n\n resetError = () => this.setState({ error: undefined, failed: false });\n\n render() {\n if (!this.state.failed) return this.props.children ?? null;\n const { fallback } = this.props;\n return typeof fallback === \"function\"\n ? (fallback as (p: { error: unknown; resetError: () => void }) => ReactNode)({ error: this.state.error, resetError: this.resetError })\n : fallback ?? null;\n }\n}\n\n\n/**\n * Marks the current screen ready (#171) once `ready` is truthy — `useScreenReady(telemetry,\n * !loading)`. First mark per view wins, so re-renders and a `ready` that flips back are harmless.\n */\nexport function useScreenReady(telemetry: { markScreenReady(): void }, ready: unknown = true): void {\n useEffect(() => {\n if (ready) telemetry.markScreenReady();\n }, [telemetry, ready]);\n}\n"],"names":["enabled","setDebug","on","debug","args","isDev","dev","env","TelemetryBase","fn","what","swallow","err","at","inst","name","value","attributes","opts","data","span","ended","startRan","started","endAt","close","result","v","outcome","reason","event","message","navigationRef","NavigationRefTracker","error","context","componentStack","capComponentStack","crashCapture","id","profile","details","updates","fullName","firstName","lastName","email","phone","TRACEPARENT","normalizeHost","entry","raw","normalizeAllowlist","entries","out","host","allowsHost","allowlist","url","base","parseTraceparent","m","formatTraceparent","traceId","spanId","forEachHeader","headers","pair","k","readHeader","found","withHeader","memoryStore","map","unavailable","get","key","set","remove","TYPE_MAX","MESSAGE_MAX","STACK_MAX","CRUMB_MAX","TRUNCATED","cap","max","frameBoundary","cut","nl","stack","boundaryCaught","markBoundaryCaught","isBoundaryCaught","errorType","errorMessage","fallbackMessage","advised","adviseStackTraceLimit","buildErrorAttributes","source","attrs","captureConsole","telemetry","target","origError","origWarn","inside","guarded","emit","orig","text","EdgeErrorBoundary","Component","info","fallback","useScreenReady","ready","useEffect"],"mappings":";AAGA,IAAIA,IAAU;AAEP,SAASC,EAASC,GAAmB;AAC1C,EAAAF,IAAUE;AACZ;AAEO,MAAMC,IAAQ;AAAA,EACnB,KAAK,IAAIC,MAAgB;AAAE,IAAIJ,KAAS,QAAQ,IAAI,GAAGI,CAAI;AAAA,EAAG;AAAA,EAC9D,MAAM,IAAIA,MAAgB;AAAE,IAAIJ,KAAS,QAAQ,KAAK,GAAGI,CAAI;AAAA,EAAG;AAAA,EAChE,OAAO,IAAIA,MAAgB;AAAE,IAAIJ,KAAS,QAAQ,MAAM,GAAGI,CAAI;AAAA,EAAG;AACpE;AAQO,SAASC,IAAiB;AAC/B,QAAMC,IAAO,WAAmB;AAChC,MAAI,OAAOA,KAAQ,UAAW,QAAOA;AACrC,QAAMC,IAAO,WAAmB,SAAS,KAAK;AAC9C,SAAOA,MAAQ,UAAaA,MAAQ;AACtC;ACKO,MAAeC,EAAc;AAAA;AAAA,EAWxB,IAAIC,GAAkCC,GAA6B;AACvE,UAAMC,IAAU,CAACC,MAAiB;AAAE,MAAAT,EAAM,KAAK,GAAGO,CAAI,YAAYE,CAAG;AAAA,IAAG;AACx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AAA;AAAA,EACzB,GAAG,CAACd,GAAWc,CAAK,CAAC;AACzB;"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
function i(e) {
|
|
2
|
+
if (typeof e != "number" || !(e > 0)) return;
|
|
3
|
+
if (e > 1e12) return e;
|
|
4
|
+
const r = globalThis.performance?.now?.();
|
|
5
|
+
return typeof r == "number" ? Date.now() - r + e : void 0;
|
|
6
|
+
}
|
|
7
|
+
function u() {
|
|
8
|
+
return i(globalThis.performance?.rnStartupTiming?.startTime);
|
|
9
|
+
}
|
|
10
|
+
function n() {
|
|
11
|
+
return i(globalThis.performance?.rnStartupTiming?.executeJavaScriptBundleEntryPointEnd);
|
|
12
|
+
}
|
|
13
|
+
async function a() {
|
|
14
|
+
const e = n();
|
|
15
|
+
return e !== void 0 ? e : (await new Promise((r) => {
|
|
16
|
+
setTimeout(r, 0)?.unref?.();
|
|
17
|
+
}), n());
|
|
18
|
+
}
|
|
19
|
+
async function m() {
|
|
20
|
+
for (let e = 0; e <= 100; e++) {
|
|
21
|
+
const r = globalThis.performance?.rnStartupTiming;
|
|
22
|
+
if (typeof r?.startTime != "number") return;
|
|
23
|
+
if (typeof r.endTime == "number" && r.endTime >= r.startTime) return r.endTime - r.startTime;
|
|
24
|
+
await new Promise((t) => {
|
|
25
|
+
setTimeout(t, 100)?.unref?.();
|
|
26
|
+
});
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
export {
|
|
30
|
+
u as processStartAt,
|
|
31
|
+
a as runtimeReadyAt,
|
|
32
|
+
m as startupDurationMs,
|
|
33
|
+
i as toEpoch
|
|
34
|
+
};
|
|
35
|
+
//# sourceMappingURL=runtimeReady.native-CxFl1rQR.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"runtimeReady.native-CxFl1rQR.js","sources":["../src/adapters/native/runtimeReady.native.ts"],"sourcesContent":["// The native half of §4.5.2's `initial_load` seed. `performance.rnStartupTiming` is a\n// natively-anchored process-start marker that needs no native module; the bundle-evaluated\n// entry is the one §4.3 pins `app.start.js_ready_ms` to, and this reuses it rather than\n// inventing a second definition of \"the runtime is ready\".\n//\n// ⚠ Absent on the Old Architecture and on runtimes that omit it. Absent resolves to\n// `undefined`, which releases the gate — a marker that never arrives must not make every\n// launch report `abandoned`.\n\ntype StartupTiming = { startTime?: unknown; endTime?: unknown; executeJavaScriptBundleEntryPointEnd?: unknown };\ntype Perf = { now?: () => number; rnStartupTiming?: StartupTiming };\n\n/**\n * The markers are stamped on the native monotonic clock — iOS `CACurrentMediaTime()`, Android\n * `SystemClock.uptimeMillis()` — the same clock `performance.now()` reads, not epoch. Shifted\n * onto `Date.now()`'s timeline here so every caller can compare them with wall time.\n * ponytail: a value already past 1e12 is taken as epoch (31 years of uptime is not a device).\n */\nexport function toEpoch(t: unknown): number | undefined {\n if (typeof t !== \"number\" || !(t > 0)) return undefined;\n if (t > 1e12) return t;\n const now = (globalThis as { performance?: Perf }).performance?.now?.();\n return typeof now === \"number\" ? Date.now() - now + t : undefined;\n}\n\n/** Epoch ms of process start (#171's initial-view anchor), or undefined where unpublished. */\nexport function processStartAt(): number | undefined {\n return toEpoch((globalThis as { performance?: Perf }).performance?.rnStartupTiming?.startTime);\n}\n\nfunction read(): number | undefined {\n // `performance` is a native-only global here and the field is absent on the Old\n // Architecture, so it is read defensively rather than typed as present.\n return toEpoch((globalThis as { performance?: Perf }).performance?.rnStartupTiming?.executeJavaScriptBundleEntryPointEnd);\n}\n\nexport async function runtimeReadyAt(): Promise<number | undefined> {\n const early = read();\n if (early !== undefined) return early;\n\n // `executeJavaScriptBundleEntryPointEnd` is stamped only once the bundle entry point has\n // finished, and the common wiring constructs the SDK at module scope — i.e. inside that\n // entry point, before the field exists. One turn of the event loop is after it by\n // construction, so re-read once rather than reporting \"no marker\" to every real app.\n await new Promise<void>((resolve) => {\n const timer = setTimeout(resolve, 0);\n (timer as { unref?: () => void })?.unref?.();\n });\n return read();\n}\n\n/**\n * `app.start.duration_ms` (#179, catalogue app_start.yaml): process start → first display, read\n * as `rnStartupTiming.endTime − startTime` (both on the native monotonic clock). `endTime` is\n * stamped when the first content appears, usually after a module-scope init, so it is polled\n * every 100 ms for up to 10 s. No marker at all (Old Architecture) resolves `undefined` at once.\n */\nexport async function startupDurationMs(): Promise<number | undefined> {\n for (let i = 0; i <= 100; i++) {\n const t = (globalThis as { performance?: Perf }).performance?.rnStartupTiming;\n if (typeof t?.startTime !== \"number\") return undefined;\n if (typeof t.endTime === \"number\" && t.endTime >= t.startTime) return t.endTime - t.startTime;\n await new Promise<void>((resolve) => {\n const timer = setTimeout(resolve, 100);\n (timer as { unref?: () => void })?.unref?.();\n });\n }\n return undefined;\n}\n"],"names":["toEpoch","t","now","processStartAt","read","runtimeReadyAt","early","resolve","startupDurationMs","i"],"mappings":"AAkBO,SAASA,EAAQC,GAAgC;AACpD,MAAI,OAAOA,KAAM,YAAY,EAAEA,IAAI,GAAI;AACvC,MAAIA,IAAI,KAAM,QAAOA;AACrB,QAAMC,IAAO,WAAsC,aAAa,MAAA;AAChE,SAAO,OAAOA,KAAQ,WAAW,KAAK,QAAQA,IAAMD,IAAI;AAC5D;AAGO,SAASE,IAAqC;AACjD,SAAOH,EAAS,WAAsC,aAAa,iBAAiB,SAAS;AACjG;AAEA,SAASI,IAA2B;AAGhC,SAAOJ,EAAS,WAAsC,aAAa,iBAAiB,oCAAoC;AAC5H;AAEA,eAAsBK,IAA8C;AAChE,QAAMC,IAAQF,EAAA;AACd,SAAIE,MAAU,SAAkBA,KAMhC,MAAM,IAAI,QAAc,CAACC,MAAY;AAEhC,IADa,WAAWA,GAAS,CAAC,GACA,QAAA;AAAA,EACvC,CAAC,GACMH,EAAA;AACX;AAQA,eAAsBI,IAAiD;AACnE,WAASC,IAAI,GAAGA,KAAK,KAAKA,KAAK;AAC3B,UAAMR,IAAK,WAAsC,aAAa;AAC9D,QAAI,OAAOA,GAAG,aAAc,SAAU;AACtC,QAAI,OAAOA,EAAE,WAAY,YAAYA,EAAE,WAAWA,EAAE,UAAW,QAAOA,EAAE,UAAUA,EAAE;AACpF,UAAM,IAAI,QAAc,CAACM,MAAY;AAEhC,MADa,WAAWA,GAAS,GAAG,GACF,QAAA;AAAA,IACvC,CAAC;AAAA,EACL;AAEJ;"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});function r(t){if(typeof t!="number"||!(t>0))return;if(t>1e12)return t;const e=globalThis.performance?.now?.();return typeof e=="number"?Date.now()-e+t:void 0}function o(){return r(globalThis.performance?.rnStartupTiming?.startTime)}function i(){return r(globalThis.performance?.rnStartupTiming?.executeJavaScriptBundleEntryPointEnd)}async function u(){const t=i();return t!==void 0?t:(await new Promise(e=>{setTimeout(e,0)?.unref?.()}),i())}async function a(){for(let t=0;t<=100;t++){const e=globalThis.performance?.rnStartupTiming;if(typeof e?.startTime!="number")return;if(typeof e.endTime=="number"&&e.endTime>=e.startTime)return e.endTime-e.startTime;await new Promise(n=>{setTimeout(n,100)?.unref?.()})}}exports.processStartAt=o;exports.runtimeReadyAt=u;exports.startupDurationMs=a;exports.toEpoch=r;
|
|
2
|
+
//# sourceMappingURL=runtimeReady.native-zueSbsEv.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"runtimeReady.native-zueSbsEv.cjs","sources":["../src/adapters/native/runtimeReady.native.ts"],"sourcesContent":["// The native half of §4.5.2's `initial_load` seed. `performance.rnStartupTiming` is a\n// natively-anchored process-start marker that needs no native module; the bundle-evaluated\n// entry is the one §4.3 pins `app.start.js_ready_ms` to, and this reuses it rather than\n// inventing a second definition of \"the runtime is ready\".\n//\n// ⚠ Absent on the Old Architecture and on runtimes that omit it. Absent resolves to\n// `undefined`, which releases the gate — a marker that never arrives must not make every\n// launch report `abandoned`.\n\ntype StartupTiming = { startTime?: unknown; endTime?: unknown; executeJavaScriptBundleEntryPointEnd?: unknown };\ntype Perf = { now?: () => number; rnStartupTiming?: StartupTiming };\n\n/**\n * The markers are stamped on the native monotonic clock — iOS `CACurrentMediaTime()`, Android\n * `SystemClock.uptimeMillis()` — the same clock `performance.now()` reads, not epoch. Shifted\n * onto `Date.now()`'s timeline here so every caller can compare them with wall time.\n * ponytail: a value already past 1e12 is taken as epoch (31 years of uptime is not a device).\n */\nexport function toEpoch(t: unknown): number | undefined {\n if (typeof t !== \"number\" || !(t > 0)) return undefined;\n if (t > 1e12) return t;\n const now = (globalThis as { performance?: Perf }).performance?.now?.();\n return typeof now === \"number\" ? Date.now() - now + t : undefined;\n}\n\n/** Epoch ms of process start (#171's initial-view anchor), or undefined where unpublished. */\nexport function processStartAt(): number | undefined {\n return toEpoch((globalThis as { performance?: Perf }).performance?.rnStartupTiming?.startTime);\n}\n\nfunction read(): number | undefined {\n // `performance` is a native-only global here and the field is absent on the Old\n // Architecture, so it is read defensively rather than typed as present.\n return toEpoch((globalThis as { performance?: Perf }).performance?.rnStartupTiming?.executeJavaScriptBundleEntryPointEnd);\n}\n\nexport async function runtimeReadyAt(): Promise<number | undefined> {\n const early = read();\n if (early !== undefined) return early;\n\n // `executeJavaScriptBundleEntryPointEnd` is stamped only once the bundle entry point has\n // finished, and the common wiring constructs the SDK at module scope — i.e. inside that\n // entry point, before the field exists. One turn of the event loop is after it by\n // construction, so re-read once rather than reporting \"no marker\" to every real app.\n await new Promise<void>((resolve) => {\n const timer = setTimeout(resolve, 0);\n (timer as { unref?: () => void })?.unref?.();\n });\n return read();\n}\n\n/**\n * `app.start.duration_ms` (#179, catalogue app_start.yaml): process start → first display, read\n * as `rnStartupTiming.endTime − startTime` (both on the native monotonic clock). `endTime` is\n * stamped when the first content appears, usually after a module-scope init, so it is polled\n * every 100 ms for up to 10 s. No marker at all (Old Architecture) resolves `undefined` at once.\n */\nexport async function startupDurationMs(): Promise<number | undefined> {\n for (let i = 0; i <= 100; i++) {\n const t = (globalThis as { performance?: Perf }).performance?.rnStartupTiming;\n if (typeof t?.startTime !== \"number\") return undefined;\n if (typeof t.endTime === \"number\" && t.endTime >= t.startTime) return t.endTime - t.startTime;\n await new Promise<void>((resolve) => {\n const timer = setTimeout(resolve, 100);\n (timer as { unref?: () => void })?.unref?.();\n });\n }\n return undefined;\n}\n"],"names":["toEpoch","now","processStartAt","read","runtimeReadyAt","early","resolve","startupDurationMs","i","t"],"mappings":"gFAkBO,SAASA,EAAQ,EAAgC,CACpD,GAAI,OAAO,GAAM,UAAY,EAAE,EAAI,GAAI,OACvC,GAAI,EAAI,KAAM,OAAO,EACrB,MAAMC,EAAO,WAAsC,aAAa,MAAA,EAChE,OAAO,OAAOA,GAAQ,SAAW,KAAK,MAAQA,EAAM,EAAI,MAC5D,CAGO,SAASC,GAAqC,CACjD,OAAOF,EAAS,WAAsC,aAAa,iBAAiB,SAAS,CACjG,CAEA,SAASG,GAA2B,CAGhC,OAAOH,EAAS,WAAsC,aAAa,iBAAiB,oCAAoC,CAC5H,CAEA,eAAsBI,GAA8C,CAChE,MAAMC,EAAQF,EAAA,EACd,OAAIE,IAAU,OAAkBA,GAMhC,MAAM,IAAI,QAAeC,GAAY,CACnB,WAAWA,EAAS,CAAC,GACA,QAAA,CACvC,CAAC,EACMH,EAAA,EACX,CAQA,eAAsBI,GAAiD,CACnE,QAASC,EAAI,EAAGA,GAAK,IAAKA,IAAK,CAC3B,MAAMC,EAAK,WAAsC,aAAa,gBAC9D,GAAI,OAAOA,GAAG,WAAc,SAAU,OACtC,GAAI,OAAOA,EAAE,SAAY,UAAYA,EAAE,SAAWA,EAAE,UAAW,OAAOA,EAAE,QAAUA,EAAE,UACpF,MAAM,IAAI,QAAeH,GAAY,CACnB,WAAWA,EAAS,GAAG,GACF,QAAA,CACvC,CAAC,CACL,CAEJ"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { L as d } from "./loadingTime-
|
|
1
|
+
import { L as d } from "./loadingTime-DMc0zTY8.js";
|
|
2
2
|
function o() {
|
|
3
3
|
if (typeof performance > "u") return;
|
|
4
4
|
const e = performance.getEntriesByType?.("navigation")?.[0];
|
|
@@ -22,4 +22,4 @@ function m() {
|
|
|
22
22
|
export {
|
|
23
23
|
m as runtimeReadyAt
|
|
24
24
|
};
|
|
25
|
-
//# sourceMappingURL=runtimeReady.web-
|
|
25
|
+
//# sourceMappingURL=runtimeReady.web-JuE239Tg.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"runtimeReady.web-
|
|
1
|
+
{"version":3,"file":"runtimeReady.web-JuE239Tg.js","sources":["../src/adapters/web/runtimeReady.web.ts"],"sourcesContent":["// The web half of §4.5.2's `initial_load` seed: the launch view is busy until the document's\n// own load marker, then settles. `loadEventEnd` is the platform's answer to \"the runtime is\n// ready\"; the SDK does not invent one.\n//\n// ⚠ Web's `initial_load` is systematically LARGER than native's — it includes DNS, TLS and\n// document download where native reads a bundle off local disk. Cross-platform `initial_load`\n// comparison is not apples-to-apples (§4.5.2); within-platform release comparison is fine.\n\nimport { LOADING_TIME_CAP_MS } from \"../loadingTime\";\n\n/** Epoch ms of `loadEventEnd`, or undefined where the entry is unavailable. */\nfunction readMarker(): number | undefined {\n if (typeof performance === \"undefined\") return undefined;\n const nav = performance.getEntriesByType?.(\"navigation\")?.[0] as PerformanceNavigationTiming | undefined;\n // Navigation-timing values are relative to timeOrigin; the settle module works in epoch ms.\n if (nav && nav.loadEventEnd > 0) return performance.timeOrigin + nav.loadEventEnd;\n // `performance.timing` is the removed-but-still-shipped legacy API; not in lib.dom's types.\n const legacy = (performance as unknown as { timing?: { loadEventEnd?: number } }).timing?.loadEventEnd;\n return typeof legacy === \"number\" && legacy > 0 ? legacy : undefined;\n}\n\n/**\n * Resolves once the marker is known — `undefined` when the platform has none to give, which\n * releases the gate rather than leaving every launch reporting `abandoned` (§4.5.2).\n */\nexport function runtimeReadyAt(): Promise<number | undefined> {\n if (typeof window === \"undefined\") return Promise.resolve(undefined);\n\n const early = readMarker();\n if (early !== undefined) return Promise.resolve(early);\n // Already loaded but the entry is missing (an old browser, a same-document navigation):\n // nothing more is coming, so release rather than wait forever.\n if (typeof document !== \"undefined\" && document.readyState === \"complete\") {\n return Promise.resolve(undefined);\n }\n\n return new Promise((resolve) => {\n let settled = false;\n const finish = (at?: number) => { if (!settled) { settled = true; resolve(at); } };\n\n window.addEventListener(\"load\", () => {\n // `loadEventEnd` is stamped *after* the load handlers run, so it is still 0 inside\n // one of them. Now is a truthful marker either way — we are in the load event.\n finish(readMarker() ?? Date.now());\n }, { once: true });\n\n // A `load` that never fires — a stalled subresource, a runtime with no such event —\n // would otherwise leave the gate shut forever and make every launch report\n // `abandoned`, which is the exact failure this module exists to avoid. Past the cap\n // the launch view is capped anyway, so there is nothing left to wait for.\n const timer = setTimeout(() => finish(undefined), LOADING_TIME_CAP_MS);\n (timer as any)?.unref?.(); // never hold a Node process open for a marker\n });\n}\n"],"names":["readMarker","nav","legacy","runtimeReadyAt","early","resolve","settled","finish","at","LOADING_TIME_CAP_MS"],"mappings":";AAWA,SAASA,IAAiC;AACtC,MAAI,OAAO,cAAgB,IAAa;AACxC,QAAMC,IAAM,YAAY,mBAAmB,YAAY,IAAI,CAAC;AAE5D,MAAIA,KAAOA,EAAI,eAAe,EAAG,QAAO,YAAY,aAAaA,EAAI;AAErE,QAAMC,IAAU,YAAkE,QAAQ;AAC1F,SAAO,OAAOA,KAAW,YAAYA,IAAS,IAAIA,IAAS;AAC/D;AAMO,SAASC,IAA8C;AAC1D,MAAI,OAAO,SAAW,IAAa,QAAO,QAAQ,QAAQ,MAAS;AAEnE,QAAMC,IAAQJ,EAAA;AACd,SAAII,MAAU,SAAkB,QAAQ,QAAQA,CAAK,IAGjD,OAAO,WAAa,OAAe,SAAS,eAAe,aACpD,QAAQ,QAAQ,MAAS,IAG7B,IAAI,QAAQ,CAACC,MAAY;AAC5B,QAAIC,IAAU;AACd,UAAMC,IAAS,CAACC,MAAgB;AAAE,MAAKF,MAAWA,IAAU,IAAMD,EAAQG,CAAE;AAAA,IAAK;AAEjF,WAAO,iBAAiB,QAAQ,MAAM;AAGlC,MAAAD,EAAOP,EAAA,KAAgB,KAAK,IAAA,CAAK;AAAA,IACrC,GAAG,EAAE,MAAM,IAAM,GAMH,WAAW,MAAMO,EAAO,MAAS,GAAGE,CAAmB,GACrD,QAAA;AAAA,EACpB,CAAC;AACL;"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const d=require("./loadingTime-
|
|
2
|
-
//# sourceMappingURL=runtimeReady.web-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const d=require("./loadingTime-Cj5Oh8lT.cjs");function o(){if(typeof performance>"u")return;const e=performance.getEntriesByType?.("navigation")?.[0];if(e&&e.loadEventEnd>0)return performance.timeOrigin+e.loadEventEnd;const n=performance.timing?.loadEventEnd;return typeof n=="number"&&n>0?n:void 0}function a(){if(typeof window>"u")return Promise.resolve(void 0);const e=o();return e!==void 0?Promise.resolve(e):typeof document<"u"&&document.readyState==="complete"?Promise.resolve(void 0):new Promise(n=>{let t=!1;const r=i=>{t||(t=!0,n(i))};window.addEventListener("load",()=>{r(o()??Date.now())},{once:!0}),setTimeout(()=>r(void 0),d.LOADING_TIME_CAP_MS)?.unref?.()})}exports.runtimeReadyAt=a;
|
|
2
|
+
//# sourceMappingURL=runtimeReady.web-vhAJFU61.cjs.map
|