@xenon-device-management/xenon 2.13.1 → 2.14.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.
- package/README.md +11 -5
- package/lib/package.json +1 -1
- package/lib/public/assets/{AnnotationOverlay-Cvpkk4r9.js → AnnotationOverlay-B_VNtKBH.js} +1 -1
- package/lib/public/assets/{ApiKeyGate-Bhn5ZtVM.js → ApiKeyGate-BwuaMjkX.js} +1 -1
- package/lib/public/assets/{BugReportButton-BA6aEjTC.js → BugReportButton-BAt0_pzq.js} +1 -1
- package/lib/public/assets/DeviceMosaicView-BYaQHhTf.js +2 -0
- package/lib/public/assets/{EmptyState-CgzbuUvO.js → EmptyState-BSjhk_IV.js} +1 -1
- package/lib/public/assets/{FieldGroup-BHc_5qNc.js → FieldGroup-Cb5QZsE1.js} +1 -1
- package/lib/public/assets/{FilterMenu-D7OMGuRc.js → FilterMenu-BAaSlWbW.js} +1 -1
- package/lib/public/assets/{Menu-C173JJ0l.js → Menu-JGGYrSQQ.js} +1 -1
- package/lib/public/assets/{Modal-ChvVUI3B.js → Modal-CFCp3n9d.js} +1 -1
- package/lib/public/assets/{RecordingPage-Dhw4d_O6.js → RecordingPage-CbJj_EBT.js} +1 -1
- package/lib/public/assets/{RecordingsPage-z97ftGK-.js → RecordingsPage-BJeYnygR.js} +2 -2
- package/lib/public/assets/{SegmentedControl-DbXhBGZC.js → SegmentedControl-Bg42Atjy.js} +1 -1
- package/lib/public/assets/{SettingCard-C908GgiI.js → SettingCard-Njz1pUIJ.js} +1 -1
- package/lib/public/assets/{Table-B1DB_ZN-.js → Table-BcTm5xV2.js} +1 -1
- package/lib/public/assets/{activity-Css0xNvp.js → activity-DOVdsfMQ.js} +1 -1
- package/lib/public/assets/{ai-settings-BMQK3-yN.js → ai-settings-CsuJroRf.js} +2 -2
- package/lib/public/assets/{api-keys-CbJ42eDQ.js → api-keys-BKnNSTw9.js} +1 -1
- package/lib/public/assets/{apps-DW1pw2re.js → apps-D0SC6uw6.js} +2 -2
- package/lib/public/assets/{arrow-left-Dpog9L0F.js → arrow-left-MMbTmgoE.js} +1 -1
- package/lib/public/assets/{arrow-right-CsBIlSIw.js → arrow-right-BMfnGmxW.js} +1 -1
- package/lib/public/assets/{arrow-up-right-z1tRQE4R.js → arrow-up-right-DuAftMWB.js} +1 -1
- package/lib/public/assets/{auth-shell-mXiX5vNk.js → auth-shell-nZC2JNDO.js} +2 -2
- package/lib/public/assets/{builds-page-BcFn23bE.js → builds-page-hDCgTwkS.js} +1 -1
- package/lib/public/assets/{button-Cq_zHETv.js → button-Dda4irn_.js} +1 -1
- package/lib/public/assets/{calendar-CKxABX9q.js → calendar-BMr0Q62v.js} +1 -1
- package/lib/public/assets/{check-C7xu-hGU.js → check-CZ9iw9-e.js} +1 -1
- package/lib/public/assets/{chevron-right-BiqfdCGA.js → chevron-right-BRYJJVC9.js} +1 -1
- package/lib/public/assets/{circle-check-CyBjjPxR.js → circle-check-CqAJjQ5O.js} +1 -1
- package/lib/public/assets/{circle-x-6gMRcx6z.js → circle-x-DlDJtnVz.js} +1 -1
- package/lib/public/assets/{clock-U1rDTT1h.js → clock-CpuDKysU.js} +1 -1
- package/lib/public/assets/{copy-BIM0ZX0L.js → copy-CAQydNFe.js} +1 -1
- package/lib/public/assets/device-explorer-CdO6_nrn.js +282 -0
- package/lib/public/assets/{download-DDBRXnAZ.js → download-C9XG6lLv.js} +1 -1
- package/lib/public/assets/{forgot-password-Dpg7yxM8.js → forgot-password-CGnkRgE9.js} +1 -1
- package/lib/public/assets/h264Stream-VQBphYhg.js +26 -0
- package/lib/public/assets/{index-BGBqohfQ.js → index-BbKEXUFH.js} +5 -5
- package/lib/public/assets/{index-BTYMAqNW.css → index-Bxoxt9sV.css} +1 -1
- package/lib/public/assets/{index-BQ2luT7L.js → index-DJGc1M2f.js} +1 -1
- package/lib/public/assets/{input-BvB1cjHE.js → input-Cm0tmSoc.js} +1 -1
- package/lib/public/assets/{line-chart-m78VggnW.js → line-chart-D2DyJCml.js} +1 -1
- package/lib/public/assets/{list-checks-cY7o1QTL.js → list-checks-UWf1GY99.js} +1 -1
- package/lib/public/assets/{lock-loz8txQm.js → lock-CCJv9m_I.js} +1 -1
- package/lib/public/assets/{login-BYOvz4lx.js → login-f8vOVW-U.js} +1 -1
- package/lib/public/assets/maintenance-settings-C1PrkuAH.js +6 -0
- package/lib/public/assets/{monitor-C4HPHb6s.js → monitor-B2jDgwm7.js} +1 -1
- package/lib/public/assets/{mouse-pointer-2-BkdKtCzi.js → mouse-pointer-2-DLI1RtzU.js} +1 -1
- package/lib/public/assets/{network-C5e0MIWo.js → network-ebT86qoi.js} +1 -1
- package/lib/public/assets/{overview-tlu8ijGd.js → overview-C0aykVrd.js} +1 -1
- package/lib/public/assets/{page-header-FXPlo6az.js → page-header-BjzgWz-T.js} +1 -1
- package/lib/public/assets/{play-CWdk0_Sy.js → play-DLG9t8FU.js} +1 -1
- package/lib/public/assets/{plus-B2xCnntV.js → plus-nBFSMu_X.js} +1 -1
- package/lib/public/assets/{profile-page-D080qzr4.js → profile-page-CSl0UYlv.js} +1 -1
- package/lib/public/assets/{reset-password-D3u4Mbvn.js → reset-password-LeOuHqmB.js} +1 -1
- package/lib/public/assets/{runbook-page-hPRZMy7s.js → runbook-page-CMMeQml9.js} +1 -1
- package/lib/public/assets/{select-12RThAXc.js → select-88jHcl-Z.js} +1 -1
- package/lib/public/assets/{selector-detail-redirect-uQwvV7EQ.js → selector-detail-redirect-BbXKJjZM.js} +1 -1
- package/lib/public/assets/{selector-health-page-CThoxDFO.js → selector-health-page-B4rA1Xkv.js} +2 -2
- package/lib/public/assets/session-detail-page-COL_RZxw.js +4 -0
- package/lib/public/assets/settings-GF6ZMSQ6.js +6 -0
- package/lib/public/assets/{stat-tile-B02WEte8.js → stat-tile-BV98e_Sv.js} +1 -1
- package/lib/public/assets/{tablet-Dj30VGZl.js → tablet-BiAsnFDj.js} +1 -1
- package/lib/public/assets/{teams-uL4fjTDR.js → teams-B4-jrr-1.js} +1 -1
- package/lib/public/assets/{trash-2-B54e-TfY.js → trash-2-C5RSuX0e.js} +1 -1
- package/lib/public/assets/{upload-B3k8WCSP.js → upload-BG7_rMXK.js} +1 -1
- package/lib/public/assets/{use-builds-data-BFn90NH3.js → use-builds-data-J-riQYyC.js} +1 -1
- package/lib/public/assets/{use-password-reset-mode-DL2TmWZ0.js → use-password-reset-mode-C8-eH-UG.js} +1 -1
- package/lib/public/assets/{users-CqBuxMlX.js → users-CFba5TSy.js} +1 -1
- package/lib/public/assets/{users-DjQSucKb.js → users-Cp0beJm3.js} +1 -1
- package/lib/public/assets/{video-off-T0rlt0GA.js → video-off-DDsEISjV.js} +1 -1
- package/lib/public/assets/webhook-settings-BGu32vSB.js +1 -0
- package/lib/public/assets/{zap-gBHqutZV.js → zap-l4VaXzq8.js} +1 -1
- package/lib/public/index.html +2 -2
- package/lib/schema.json +19 -46
- package/lib/src/XenonCapabilityManager.js +22 -5
- package/lib/src/app/openapi/control.yaml +71 -20
- package/lib/src/app/openapi/grid.yaml +23 -5
- package/lib/src/app/openapi/platform.yaml +136 -28
- package/lib/src/app/routers/control.js +30 -5
- package/lib/src/app/routers/dashboard.js +29 -1
- package/lib/src/app/routers/grid.js +32 -10
- package/lib/src/app/routers/streamStartConflict.js +3 -0
- package/lib/src/app/routers/streamType.js +7 -2
- package/lib/src/app/routers/webhook.js +8 -4
- package/lib/src/config.js +50 -5
- package/lib/src/dashboard/commands.js +185 -141
- package/lib/src/dashboard/event-manager.js +39 -6
- package/lib/src/data-service/appleFamily.js +43 -0
- package/lib/src/data-service/db.js +11 -0
- package/lib/src/data-service/device-service.js +46 -1
- package/lib/src/data-service/device-store.js +66 -3
- package/lib/src/data-service/deviceClaims.js +37 -0
- package/lib/src/data-service/deviceFieldOwners.js +25 -11
- package/lib/src/data-service/deviceSettings.js +79 -0
- package/lib/src/data-service/prisma-store.js +152 -9
- package/lib/src/data-service/web-config-service.js +43 -92
- package/lib/src/device-managers/AndroidDeviceManager.js +9 -31
- package/lib/src/device-managers/ios/WDAClient.js +44 -43
- package/lib/src/device-managers/shellCommands.js +96 -0
- package/lib/src/device-utils.js +143 -37
- package/lib/src/generated/client/edge.js +17 -3
- package/lib/src/generated/client/index-browser.js +14 -0
- package/lib/src/generated/client/index.d.ts +2054 -379
- package/lib/src/generated/client/index.js +17 -3
- package/lib/src/generated/client/package.json +1 -1
- package/lib/src/generated/client/schema.prisma +35 -7
- package/lib/src/generated/client/wasm.js +14 -0
- package/lib/src/interceptors/CommandInterceptor.js +29 -8
- package/lib/src/interceptors/xenonScripts.js +55 -0
- package/lib/src/interfaces/IPluginArgs.js +1 -2
- package/lib/src/middleware/deviceAccessGuard.js +63 -9
- package/lib/src/plugin.js +15 -1
- package/lib/src/prisma.js +1 -1
- package/lib/src/scripts/database-check.js +124 -0
- package/lib/src/services/AIService.js +99 -0
- package/lib/src/services/CleanupService.js +6 -1
- package/lib/src/services/InterceptorService.js +70 -13
- package/lib/src/services/NetworkConditioningService.js +85 -88
- package/lib/src/services/NotificationService.js +36 -29
- package/lib/src/services/OrphanSweeper.js +5 -0
- package/lib/src/services/PortAllocator.js +5 -0
- package/lib/src/services/ServerManager.js +97 -8
- package/lib/src/services/SessionLifecycleService.js +63 -53
- package/lib/src/services/ShutdownCoordinator.js +33 -0
- package/lib/src/services/TeamService.js +20 -3
- package/lib/src/services/device-access/SessionOwnerResolver.js +26 -0
- package/lib/src/services/device-access/deviceAccessPolicy.js +38 -6
- package/lib/src/services/device-access/leaseHold.js +26 -0
- package/lib/src/services/device-access/ticketActorAccess.js +6 -0
- package/lib/src/services/healing/HealingOrchestrator.js +32 -1
- package/lib/src/services/interceptor/AndroidProxyAdapter.js +18 -0
- package/lib/src/services/interceptor/interceptorOptions.js +44 -0
- package/lib/src/services/lease/activeLeases.js +37 -0
- package/lib/src/services/network/AndroidRadios.js +71 -0
- package/lib/src/services/network/PhoneNetworkLedger.js +184 -0
- package/lib/src/services/network/PhoneNetworkRestore.js +330 -0
- package/lib/src/services/network/adbForPhone.js +60 -0
- package/lib/src/services/network/phoneNetworkLock.js +20 -0
- package/lib/src/services/network/xenonProxy.js +107 -0
- package/lib/src/services/omni-vision/OmniVisionService.js +53 -43
- package/lib/src/services/omni-vision/VisionAssertionService.js +28 -25
- package/lib/src/services/omni-vision/ocrTextMatch.js +105 -0
- package/lib/src/services/omni-vision/screenScale.js +68 -0
- package/lib/src/services/recording/busy-precheck.js +24 -3
- package/lib/src/services/recording/concurrency-gate.js +12 -3
- package/lib/src/services/settings/SelfHealingSwitch.js +70 -0
- package/lib/src/services/settings/labSettings.js +149 -0
- package/lib/src/services/webhookEvents.js +173 -0
- package/lib/test/helpers/fake-adb.js +58 -0
- package/lib/test/helpers/fake-device-table.js +63 -24
- package/lib/test/helpers/scratch-database.js +1 -0
- package/lib/test/unit/TeamService.test.js +3 -0
- package/lib/test/unit/XenonCapabilityManager.spec.js +4 -2
- package/lib/test/unit/apple-family.spec.js +36 -0
- package/lib/test/unit/cleanup-settings-db.spec.js +103 -0
- package/lib/test/unit/cleanup-settings.spec.js +244 -0
- package/lib/test/unit/dashboard-api-paths.spec.js +101 -0
- package/lib/test/unit/dashboard-commands.spec.js +249 -0
- package/lib/test/unit/dashboard-events-team-scope.spec.js +9 -6
- package/lib/test/unit/database-check.spec.js +108 -0
- package/lib/test/unit/default-plugin-args.spec.js +33 -0
- package/lib/test/unit/device-access-lease.spec.js +270 -0
- package/lib/test/unit/device-offline-webhook.spec.js +81 -0
- package/lib/test/unit/device-setting-columns.spec.js +66 -0
- package/lib/test/unit/device-settings-loki.spec.js +87 -0
- package/lib/test/unit/device-settings-survive.spec.js +555 -0
- package/lib/test/unit/device-sync-lost-update.spec.js +5 -0
- package/lib/test/unit/emulator-boot.spec.js +91 -0
- package/lib/test/unit/hub-node-gateway-appium-server.spec.js +48 -0
- package/lib/test/unit/hub-node-same-host.spec.js +5 -0
- package/lib/test/unit/iphone-ipad-only.spec.js +132 -0
- package/lib/test/unit/json-logging-option.spec.js +74 -0
- package/lib/test/unit/lab-settings.spec.js +218 -0
- package/lib/test/unit/lease/allocate-lease-branch.spec.js +22 -0
- package/lib/test/unit/lease/session-lease-proof.spec.js +59 -0
- package/lib/test/unit/lease-held-phone.spec.js +196 -0
- package/lib/test/unit/max-sessions.spec.js +240 -0
- package/lib/test/unit/ocr-text-match.spec.js +44 -0
- package/lib/test/unit/omni-vision-analyze-screen.spec.js +72 -0
- package/lib/test/unit/omni-vision-ios-points.spec.js +161 -0
- package/lib/test/unit/omni-vision-tap-text.spec.js +129 -0
- package/lib/test/unit/omni-vision.spec.js +1 -1
- package/lib/test/unit/partial-config-file.spec.js +114 -0
- package/lib/test/unit/phone-network/boot-clean-up.spec.js +64 -0
- package/lib/test/unit/phone-network/interceptor-options.spec.js +77 -0
- package/lib/test/unit/phone-network/interceptor-proxy-restore.spec.js +145 -0
- package/lib/test/unit/phone-network/network-conditioning.spec.js +145 -0
- package/lib/test/unit/phone-network/phone-network-restore.spec.js +246 -0
- package/lib/test/unit/phone-network/session-end-paths.spec.js +182 -0
- package/lib/test/unit/phone-network/session-start.spec.js +110 -0
- package/lib/test/unit/phone-network/xenon-proxy.spec.js +69 -0
- package/lib/test/unit/plugin.spec.js +3 -3
- package/lib/test/unit/recording-options.spec.js +181 -0
- package/lib/test/unit/schema-required-args.spec.js +21 -16
- package/lib/test/unit/self-healing-boot.spec.js +75 -0
- package/lib/test/unit/self-healing-setting.spec.js +272 -0
- package/lib/test/unit/session-failed-webhook.spec.js +170 -0
- package/lib/test/unit/shell-commands.spec.js +133 -0
- package/lib/test/unit/socketServer.scopedEmit.spec.js +2 -0
- package/lib/test/unit/stream-start-pipelines.spec.js +210 -0
- package/lib/test/unit/stream-status-type.spec.js +4 -0
- package/lib/test/unit/vision-assertion.spec.js +118 -0
- package/lib/test/unit/wda-client-shell.spec.js +133 -0
- package/lib/test/unit/web-config-service.spec.js +79 -0
- package/lib/test/unit/webhook-delivery.spec.js +24 -0
- package/lib/test/unit/webhook-payloads.spec.js +273 -0
- package/lib/test/unit/xenon-execute-scripts.spec.js +138 -0
- package/lib/tsconfig.tsbuildinfo +1 -1
- package/lib/web/src/components/webhook-settings/webhookEventVariables.json +30 -0
- package/package.json +1 -1
- package/prisma/migrations/20261004140000_keep_device_settings/migration.sql +19 -0
- package/prisma/schema.prisma +35 -7
- package/schema.json +19 -46
- package/scripts/generate-types-from-schema.js +7 -2
- package/scripts/lib/always-present-plugin-args.js +42 -0
- package/lib/public/assets/DeviceMosaicView-ChhHnpFQ.js +0 -2
- package/lib/public/assets/device-explorer-DSpAA_t9.js +0 -279
- package/lib/public/assets/maintenance-settings-BxbA7SkB.js +0 -6
- package/lib/public/assets/recording-group-store-B75435xR.js +0 -26
- package/lib/public/assets/session-detail-page-Bc02YjMm.js +0 -4
- package/lib/public/assets/settings-C1VIluuT.js +0 -6
- package/lib/public/assets/webhook-settings-DAHgnJyZ.js +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/overview-
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/overview-C0aykVrd.js","assets/labels-C21SA4JG.js","assets/arrow-right-BMfnGmxW.js","assets/tablet-BiAsnFDj.js","assets/monitor-B2jDgwm7.js","assets/activity-DOVdsfMQ.js","assets/page-header-BjzgWz-T.js","assets/page-header-TkpFo69t.css","assets/device-explorer-CdO6_nrn.js","assets/BugReportButton-BAt0_pzq.js","assets/BugReportButton-CPBjfiv4.css","assets/h264Stream-VQBphYhg.js","assets/button-Dda4irn_.js","assets/utils-CDN07tui.js","assets/button-yDi2prIR.css","assets/select-88jHcl-Z.js","assets/select-_gbV-uJG.css","assets/Menu-JGGYrSQQ.js","assets/index-DJGc1M2f.js","assets/check-CZ9iw9-e.js","assets/Menu-BJJGF7ek.css","assets/Modal-CFCp3n9d.js","assets/Modal-CkhpaXeX.css","assets/FieldGroup-Cb5QZsE1.js","assets/FieldGroup-trY-2qmW.css","assets/clock-CpuDKysU.js","assets/plus-nBFSMu_X.js","assets/copy-CAQydNFe.js","assets/SegmentedControl-Bg42Atjy.js","assets/SegmentedControl-lDNf6HQr.css","assets/Table-BcTm5xV2.js","assets/Table-BIjXN_-_.css","assets/list-checks-UWf1GY99.js","assets/chevron-right-BRYJJVC9.js","assets/mouse-pointer-2-DLI1RtzU.js","assets/zap-l4VaXzq8.js","assets/circle-check-CqAJjQ5O.js","assets/circle-x-DlDJtnVz.js","assets/EmptyState-BSjhk_IV.js","assets/EmptyState-BSDHFxd1.css","assets/input-Cm0tmSoc.js","assets/input-B5edaXfx.css","assets/play-DLG9t8FU.js","assets/download-C9XG6lLv.js","assets/upload-BG7_rMXK.js","assets/arrow-left-MMbTmgoE.js","assets/AnnotationOverlay-B_VNtKBH.js","assets/trash-2-C5RSuX0e.js","assets/lock-CCJv9m_I.js","assets/FilterMenu-BAaSlWbW.js","assets/FilterMenu-D1i9jhjZ.css","assets/device-explorer-CHv1miyr.css","assets/builds-page-hDCgTwkS.js","assets/use-builds-data-J-riQYyC.js","assets/time-D-gjmE1o.js","assets/stat-tile-BV98e_Sv.js","assets/session-detail-page-COL_RZxw.js","assets/arrow-up-right-DuAftMWB.js","assets/line-chart-D2DyJCml.js","assets/line-chart-Bzzc3bMl.css","assets/video-off-DDsEISjV.js","assets/network-ebT86qoi.js","assets/runbook-page-CMMeQml9.js","assets/runbook-page-BFqSC-Ta.css","assets/apps-D0SC6uw6.js","assets/apps-BQKfuN3J.css","assets/webhook-settings-BGu32vSB.js","assets/webhook-settings-CAfLaykw.css","assets/settings-Dep_3kbA.css","assets/settings-GF6ZMSQ6.js","assets/SettingCard-Njz1pUIJ.js","assets/SettingCard-CiKM8yKg.css","assets/calendar-BMr0Q62v.js","assets/ai-settings-CsuJroRf.js","assets/maintenance-settings-C1PrkuAH.js","assets/api-keys-BKnNSTw9.js","assets/teams-B4-jrr-1.js","assets/users-CFba5TSy.js","assets/selector-health-page-B4rA1Xkv.js","assets/view-state-83Z1gFME.js","assets/selector-detail-redirect-BbXKJjZM.js","assets/DeviceMosaicView-BYaQHhTf.js","assets/recordings-BWe1ydXm.js","assets/profile-page-CSl0UYlv.js","assets/users-Cp0beJm3.js","assets/RecordingsPage-BJeYnygR.js","assets/recordings-n-GTW3aT.js","assets/recordings-B2Am-bZy.css","assets/RecordingPage-CbJj_EBT.js","assets/login-f8vOVW-U.js","assets/use-password-reset-mode-C8-eH-UG.js","assets/auth-shell-nZC2JNDO.js","assets/forgot-password-CGnkRgE9.js","assets/reset-password-LeOuHqmB.js"])))=>i.map(i=>d[i]);
|
|
2
2
|
function od(e,t){for(var n=0;n<t.length;n++){const r=t[n];if(typeof r!="string"&&!Array.isArray(r)){for(const i in r)if(i!=="default"&&!(i in e)){const o=Object.getOwnPropertyDescriptor(r,i);o&&Object.defineProperty(e,i,o.get?o:{enumerable:!0,get:()=>r[i]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))r(i);new MutationObserver(i=>{for(const o of i)if(o.type==="childList")for(const s of o.addedNodes)s.tagName==="LINK"&&s.rel==="modulepreload"&&r(s)}).observe(document,{childList:!0,subtree:!0});function n(i){const o={};return i.integrity&&(o.integrity=i.integrity),i.referrerPolicy&&(o.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?o.credentials="include":i.crossOrigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function r(i){if(i.ep)return;i.ep=!0;const o=n(i);fetch(i.href,o)}})();function Cu(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Tu={exports:{}},yr={};/*
|
|
3
3
|
object-assign
|
|
4
4
|
(c) Sindre Sorhus
|
|
@@ -39,7 +39,7 @@ object-assign
|
|
|
39
39
|
Error generating stack: `+o.message+`
|
|
40
40
|
`+o.stack}return{value:e,source:t,stack:i}}function Jo(e,t){try{console.error(t.value)}catch(n){setTimeout(function(){throw n})}}var Qp=typeof WeakMap=="function"?WeakMap:Map;function lf(e,t,n){n=nt(-1,n),n.tag=3,n.payload={element:null};var r=t.value;return n.callback=function(){xi||(xi=!0,is=r),Jo(e,t)},n}function af(e,t,n){n=nt(-1,n),n.tag=3;var r=e.type.getDerivedStateFromError;if(typeof r=="function"){var i=t.value;n.payload=function(){return Jo(e,t),r(i)}}var o=e.stateNode;return o!==null&&typeof o.componentDidCatch=="function"&&(n.callback=function(){typeof r!="function"&&(Le===null?Le=new Set([this]):Le.add(this),Jo(e,t));var s=t.stack;this.componentDidCatch(t.value,{componentStack:s!==null?s:""})}),n}var Gp=typeof WeakSet=="function"?WeakSet:Set;function Ua(e){var t=e.ref;if(t!==null)if(typeof t=="function")try{t(null)}catch(n){st(e,n)}else t.current=null}function Yp(e,t){switch(t.tag){case 0:case 11:case 15:case 22:return;case 1:if(t.flags&256&&e!==null){var n=e.memoizedProps,r=e.memoizedState;e=t.stateNode,t=e.getSnapshotBeforeUpdate(t.elementType===t.type?n:Te(t.type,n),r),e.__reactInternalSnapshotBeforeUpdate=t}return;case 3:t.flags&256&&Qs(t.stateNode.containerInfo);return;case 5:case 6:case 4:case 17:return}throw Error(_(163))}function Xp(e,t,n){switch(n.tag){case 0:case 11:case 15:case 22:if(t=n.updateQueue,t=t!==null?t.lastEffect:null,t!==null){e=t=t.next;do{if((e.tag&3)===3){var r=e.create;e.destroy=r()}e=e.next}while(e!==t)}if(t=n.updateQueue,t=t!==null?t.lastEffect:null,t!==null){e=t=t.next;do{var i=e;r=i.next,i=i.tag,i&4&&i&1&&(gf(n,e),oh(n,e)),e=r}while(e!==t)}return;case 1:e=n.stateNode,n.flags&4&&(t===null?e.componentDidMount():(r=n.elementType===n.type?t.memoizedProps:Te(n.type,t.memoizedProps),e.componentDidUpdate(r,t.memoizedState,e.__reactInternalSnapshotBeforeUpdate))),t=n.updateQueue,t!==null&&wa(n,t,e);return;case 3:if(t=n.updateQueue,t!==null){if(e=null,n.child!==null)switch(n.child.tag){case 5:e=n.child.stateNode;break;case 1:e=n.child.stateNode}wa(n,t,e)}return;case 5:e=n.stateNode,t===null&&n.flags&4&&jc(n.type,n.memoizedProps)&&e.focus();return;case 6:return;case 4:return;case 12:return;case 13:n.memoizedState===null&&(n=n.alternate,n!==null&&(n=n.memoizedState,n!==null&&(n=n.dehydrated,n!==null&&dc(n))));return;case 19:case 17:case 20:case 21:case 23:case 24:return}throw Error(_(163))}function Ba(e,t){for(var n=e;;){if(n.tag===5){var r=n.stateNode;if(t)r=r.style,typeof r.setProperty=="function"?r.setProperty("display","none","important"):r.display="none";else{r=n.stateNode;var i=n.memoizedProps.style;i=i!=null&&i.hasOwnProperty("display")?i.display:null,r.style.display=tc("display",i)}}else if(n.tag===6)n.stateNode.nodeValue=t?"":n.memoizedProps;else if((n.tag!==23&&n.tag!==24||n.memoizedState===null||n===e)&&n.child!==null){n.child.return=n,n=n.child;continue}if(n===e)break;for(;n.sibling===null;){if(n.return===null||n.return===e)return;n=n.return}n.sibling.return=n.return,n=n.sibling}}function za(e,t){if(Rt&&typeof Rt.onCommitFiberUnmount=="function")try{Rt.onCommitFiberUnmount(Gs,t)}catch{}switch(t.tag){case 0:case 11:case 14:case 15:case 22:if(e=t.updateQueue,e!==null&&(e=e.lastEffect,e!==null)){var n=e=e.next;do{var r=n,i=r.destroy;if(r=r.tag,i!==void 0)if(r&4)gf(t,n);else{r=t;try{i()}catch(o){st(r,o)}}n=n.next}while(n!==e)}break;case 1:if(Ua(t),e=t.stateNode,typeof e.componentWillUnmount=="function")try{e.props=t.memoizedProps,e.state=t.memoizedState,e.componentWillUnmount()}catch(o){st(t,o)}break;case 5:Ua(t);break;case 4:uf(e,t)}}function ba(e){e.alternate=null,e.child=null,e.dependencies=null,e.firstEffect=null,e.lastEffect=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.return=null,e.updateQueue=null}function Fa(e){return e.tag===5||e.tag===3||e.tag===4}function Va(e){e:{for(var t=e.return;t!==null;){if(Fa(t))break e;t=t.return}throw Error(_(160))}var n=t;switch(t=n.stateNode,n.tag){case 5:var r=!1;break;case 3:t=t.containerInfo,r=!0;break;case 4:t=t.containerInfo,r=!0;break;default:throw Error(_(161))}n.flags&16&&(er(t,""),n.flags&=-17);e:t:for(n=e;;){for(;n.sibling===null;){if(n.return===null||Fa(n.return)){n=null;break e}n=n.return}for(n.sibling.return=n.return,n=n.sibling;n.tag!==5&&n.tag!==6&&n.tag!==18;){if(n.flags&2||n.child===null||n.tag===4)continue t;n.child.return=n,n=n.child}if(!(n.flags&2)){n=n.stateNode;break e}}r?Zo(e,n,t):es(e,n,t)}function Zo(e,t,n){var r=e.tag,i=r===5||r===6;if(i)e=i?e.stateNode:e.stateNode.instance,t?n.nodeType===8?n.parentNode.insertBefore(e,t):n.insertBefore(e,t):(n.nodeType===8?(t=n.parentNode,t.insertBefore(e,n)):(t=n,t.appendChild(e)),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=si));else if(r!==4&&(e=e.child,e!==null))for(Zo(e,t,n),e=e.sibling;e!==null;)Zo(e,t,n),e=e.sibling}function es(e,t,n){var r=e.tag,i=r===5||r===6;if(i)e=i?e.stateNode:e.stateNode.instance,t?n.insertBefore(e,t):n.appendChild(e);else if(r!==4&&(e=e.child,e!==null))for(es(e,t,n),e=e.sibling;e!==null;)es(e,t,n),e=e.sibling}function uf(e,t){for(var n=t,r=!1,i,o;;){if(!r){r=n.return;e:for(;;){if(r===null)throw Error(_(160));switch(i=r.stateNode,r.tag){case 5:o=!1;break e;case 3:i=i.containerInfo,o=!0;break e;case 4:i=i.containerInfo,o=!0;break e}r=r.return}r=!0}if(n.tag===5||n.tag===6){e:for(var s=e,l=n,a=l;;)if(za(s,a),a.child!==null&&a.tag!==4)a.child.return=a,a=a.child;else{if(a===l)break e;for(;a.sibling===null;){if(a.return===null||a.return===l)break e;a=a.return}a.sibling.return=a.return,a=a.sibling}o?(s=i,l=n.stateNode,s.nodeType===8?s.parentNode.removeChild(l):s.removeChild(l)):i.removeChild(n.stateNode)}else if(n.tag===4){if(n.child!==null){i=n.stateNode.containerInfo,o=!0,n.child.return=n,n=n.child;continue}}else if(za(e,n),n.child!==null){n.child.return=n,n=n.child;continue}if(n===t)break;for(;n.sibling===null;){if(n.return===null||n.return===t)return;n=n.return,n.tag===4&&(r=!1)}n.sibling.return=n.return,n=n.sibling}}function po(e,t){switch(t.tag){case 0:case 11:case 14:case 15:case 22:var n=t.updateQueue;if(n=n!==null?n.lastEffect:null,n!==null){var r=n=n.next;do(r.tag&3)===3&&(e=r.destroy,r.destroy=void 0,e!==void 0&&e()),r=r.next;while(r!==n)}return;case 1:return;case 5:if(n=t.stateNode,n!=null){r=t.memoizedProps;var i=e!==null?e.memoizedProps:r;e=t.type;var o=t.updateQueue;if(t.updateQueue=null,o!==null){for(n[li]=r,e==="input"&&r.type==="radio"&&r.name!=null&&Xu(n,r),jo(e,i),t=jo(e,r),i=0;i<o.length;i+=2){var s=o[i],l=o[i+1];s==="style"?nc(n,l):s==="dangerouslySetInnerHTML"?ec(n,l):s==="children"?er(n,l):Rs(n,s,l,t)}switch(e){case"input":Co(n,r);break;case"textarea":Ju(n,r);break;case"select":e=n._wrapperState.wasMultiple,n._wrapperState.wasMultiple=!!r.multiple,o=r.value,o!=null?Kt(n,!!r.multiple,o,!1):e!==!!r.multiple&&(r.defaultValue!=null?Kt(n,!!r.multiple,r.defaultValue,!0):Kt(n,!!r.multiple,r.multiple?[]:"",!1))}}}return;case 6:if(t.stateNode===null)throw Error(_(162));t.stateNode.nodeValue=t.memoizedProps;return;case 3:n=t.stateNode,n.hydrate&&(n.hydrate=!1,dc(n.containerInfo));return;case 12:return;case 13:t.memoizedState!==null&&(cl=se(),Ba(t.child,!0)),qa(t);return;case 19:qa(t);return;case 17:return;case 23:case 24:Ba(t,t.memoizedState!==null);return}throw Error(_(163))}function qa(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new Gp),t.forEach(function(r){var i=ah.bind(null,e,r);n.has(r)||(n.add(r),r.then(i,i))})}}function Jp(e,t){return e!==null&&(e=e.memoizedState,e===null||e.dehydrated!==null)?(t=t.memoizedState,t!==null&&t.dehydrated===null):!1}var Zp=Math.ceil,ki=jt.ReactCurrentDispatcher,al=jt.ReactCurrentOwner,L=0,ue=null,Y=null,le=0,Ot=0,ts=ht(0),ne=0,Di=null,fn=0,xr=0,dn=0,ul=0,ns=null,cl=0,rs=1/0;function pn(){rs=se()+500}var T=null,xi=!1,is=null,Le=null,dt=!1,Yn=null,$n=90,os=[],ss=[],be=null,Xn=0,ls=null,Wr=-1,Ue=0,Hr=0,Jn=null,Kr=!1;function me(){return L&48?se():Wr!==-1?Wr:Wr=se()}function it(e){if(e=e.mode,!(e&2))return 1;if(!(e&4))return on()===99?1:2;if(Ue===0&&(Ue=fn),zp.transition!==0){Hr!==0&&(Hr=ns!==null?ns.pendingLanes:0),e=Ue;var t=4186112&~Hr;return t&=-t,t===0&&(e=4186112&~e,t=e&-e,t===0&&(t=8192)),t}return e=on(),L&4&&e===98?e=ii(12,Ue):(e=Fd(e),e=ii(e,Ue)),e}function ot(e,t,n){if(50<Xn)throw Xn=0,ls=null,Error(_(185));if(e=Mi(e,t),e===null)return null;Pi(e,t,n),e===ue&&(dn|=t,ne===4&&Zt(e,le));var r=on();t===1?L&8&&!(L&48)?as(e):(_e(e,n),L===0&&(pn(),Me())):(!(L&4)||r!==98&&r!==99||(be===null?be=new Set([e]):be.add(e)),_e(e,n)),ns=e}function Mi(e,t){e.lanes|=t;var n=e.alternate;for(n!==null&&(n.lanes|=t),n=e,e=e.return;e!==null;)e.childLanes|=t,n=e.alternate,n!==null&&(n.childLanes|=t),n=e,e=e.return;return n.tag===3?n.stateNode:null}function _e(e,t){for(var n=e.callbackNode,r=e.suspendedLanes,i=e.pingedLanes,o=e.expirationTimes,s=e.pendingLanes;0<s;){var l=31-ct(s),a=1<<l,u=o[l];if(u===-1){if(!(a&r)||a&i){u=t,$t(a);var m=U;o[l]=10<=m?u+250:6<=m?u+5e3:-1}}else u<=t&&(e.expiredLanes|=a);s&=~a}if(r=ir(e,e===ue?le:0),t=U,r===0)n!==null&&(n!==lo&&Vo(n),e.callbackNode=null,e.callbackPriority=0);else{if(n!==null){if(e.callbackPriority===t)return;n!==lo&&Vo(n)}t===15?(n=as.bind(null,e),$e===null?($e=[n],qr=Ys(Ai,zc)):$e.push(n),n=lo):t===14?n=ar(99,as.bind(null,e)):(n=Vd(t),n=ar(n,cf.bind(null,e))),e.callbackPriority=t,e.callbackNode=n}}function cf(e){if(Wr=-1,Hr=Ue=0,L&48)throw Error(_(327));var t=e.callbackNode;if(mt()&&e.callbackNode!==t)return null;var n=ir(e,e===ue?le:0);if(n===0)return null;var r=n,i=L;L|=16;var o=hf();(ue!==e||le!==r)&&(pn(),en(e,r));do try{nh();break}catch(l){pf(e,l)}while(!0);if(Xs(),ki.current=o,L=i,Y!==null?r=0:(ue=null,le=0,r=ne),fn&dn)en(e,0);else if(r!==0){if(r===2&&(L|=64,e.hydrate&&(e.hydrate=!1,Qs(e.containerInfo)),n=wc(e),n!==0&&(r=Un(e,n))),r===1)throw t=Di,en(e,0),Zt(e,n),_e(e,se()),t;switch(e.finishedWork=e.current.alternate,e.finishedLanes=n,r){case 0:case 1:throw Error(_(345));case 2:xt(e);break;case 3:if(Zt(e,n),(n&62914560)===n&&(r=cl+500-se(),10<r)){if(ir(e,0)!==0)break;if(i=e.suspendedLanes,(i&n)!==n){me(),e.pingedLanes|=e.suspendedLanes&i;break}e.timeoutHandle=fa(xt.bind(null,e),r);break}xt(e);break;case 4:if(Zt(e,n),(n&4186112)===n)break;for(r=e.eventTimes,i=-1;0<n;){var s=31-ct(n);o=1<<s,s=r[s],s>i&&(i=s),n&=~o}if(n=i,n=se()-n,n=(120>n?120:480>n?480:1080>n?1080:1920>n?1920:3e3>n?3e3:4320>n?4320:1960*Zp(n/1960))-n,10<n){e.timeoutHandle=fa(xt.bind(null,e),n);break}xt(e);break;case 5:xt(e);break;default:throw Error(_(329))}}return _e(e,se()),e.callbackNode===t?cf.bind(null,e):null}function Zt(e,t){for(t&=~ul,t&=~dn,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var n=31-ct(t),r=1<<n;e[n]=-1,t&=~r}}function as(e){if(L&48)throw Error(_(327));if(mt(),e===ue&&e.expiredLanes&le){var t=le,n=Un(e,t);fn&dn&&(t=ir(e,t),n=Un(e,t))}else t=ir(e,0),n=Un(e,t);if(e.tag!==0&&n===2&&(L|=64,e.hydrate&&(e.hydrate=!1,Qs(e.containerInfo)),t=wc(e),t!==0&&(n=Un(e,t))),n===1)throw n=Di,en(e,0),Zt(e,t),_e(e,se()),n;return e.finishedWork=e.current.alternate,e.finishedLanes=t,xt(e),_e(e,se()),null}function eh(){if(be!==null){var e=be;be=null,e.forEach(function(t){t.expiredLanes|=24&t.pendingLanes,_e(t,se())})}Me()}function ff(e,t){var n=L;L|=1;try{return e(t)}finally{L=n,L===0&&(pn(),Me())}}function df(e,t){var n=L;L&=-2,L|=8;try{return e(t)}finally{L=n,L===0&&(pn(),Me())}}function Ir(e,t){W(ts,Ot),Ot|=t,fn|=t}function fl(){Ot=ts.current,b(ts)}function en(e,t){e.finishedWork=null,e.finishedLanes=0;var n=e.timeoutHandle;if(n!==-1&&(e.timeoutHandle=-1,Ip(n)),Y!==null)for(n=Y.return;n!==null;){var r=n;switch(r.tag){case 1:r=r.type.childContextTypes,r!=null&&ai();break;case 3:sn(),b(pe),b(ae),tl();break;case 5:el(r);break;case 4:sn();break;case 13:b(q);break;case 19:b(q);break;case 10:Js(r);break;case 23:case 24:fl()}n=n.return}ue=e,Y=pt(e.current,null),le=Ot=fn=t,ne=0,Di=null,ul=dn=xr=0}function pf(e,t){do{var n=Y;try{if(Xs(),Qn.current=wi,mi){for(var r=K.memoizedState;r!==null;){var i=r.queue;i!==null&&(i.pending=null),r=r.next}mi=!1}if(dr=0,te=oe=K=null,Gn=!1,al.current=null,n===null||n.return===null){ne=1,Di=t,Y=null;break}e:{var o=e,s=n.return,l=n,a=t;if(t=le,l.flags|=2048,l.firstEffect=l.lastEffect=null,a!==null&&typeof a=="object"&&typeof a.then=="function"){var u=a;if(!(l.mode&2)){var m=l.alternate;m?(l.updateQueue=m.updateQueue,l.memoizedState=m.memoizedState,l.lanes=m.lanes):(l.updateQueue=null,l.memoizedState=null)}var v=(q.current&1)!==0,h=s;do{var E;if(E=h.tag===13){var x=h.memoizedState;if(x!==null)E=x.dehydrated!==null;else{var k=h.memoizedProps;E=k.fallback===void 0?!1:k.unstable_avoidThisFallback!==!0?!0:!v}}if(E){var c=h.updateQueue;if(c===null){var f=new Set;f.add(u),h.updateQueue=f}else c.add(u);if(!(h.mode&2)){if(h.flags|=64,l.flags|=16384,l.flags&=-2981,l.tag===1)if(l.alternate===null)l.tag=17;else{var d=nt(-1,1);d.tag=2,rt(l,d)}l.lanes|=1;break e}a=void 0,l=t;var g=o.pingCache;if(g===null?(g=o.pingCache=new Qp,a=new Set,g.set(u,a)):(a=g.get(u),a===void 0&&(a=new Set,g.set(u,a))),!a.has(l)){a.add(l);var w=lh.bind(null,o,u,l);u.then(w,w)}h.flags|=4096,h.lanes=t;break e}h=h.return}while(h!==null);a=Error((Ht(l.type)||"A React component")+` suspended while rendering, but no fallback UI was specified.
|
|
41
41
|
|
|
42
|
-
Add a <Suspense fallback=...> component higher in the tree to provide a loading indicator or placeholder to display.`)}ne!==5&&(ne=2),a=ll(a,l),h=s;do{switch(h.tag){case 3:o=a,h.flags|=4096,t&=-t,h.lanes|=t;var P=lf(h,o,t);va(h,P);break e;case 1:o=a;var S=h.type,O=h.stateNode;if(!(h.flags&64)&&(typeof S.getDerivedStateFromError=="function"||O!==null&&typeof O.componentDidCatch=="function"&&(Le===null||!Le.has(O)))){h.flags|=4096,t&=-t,h.lanes|=t;var A=af(h,o,t);va(h,A);break e}}h=h.return}while(h!==null)}yf(n)}catch(N){t=N,Y===n&&n!==null&&(Y=n=n.return);continue}break}while(!0)}function hf(){var e=ki.current;return ki.current=wi,e===null?wi:e}function Un(e,t){var n=L;L|=16;var r=hf();ue===e&&le===t||en(e,t);do try{th();break}catch(i){pf(e,i)}while(!0);if(Xs(),L=n,ki.current=r,Y!==null)throw Error(_(261));return ue=null,le=0,ne}function th(){for(;Y!==null;)mf(Y)}function nh(){for(;Y!==null&&!$p();)mf(Y)}function mf(e){var t=vf(e.alternate,e,Ot);e.memoizedProps=e.pendingProps,t===null?yf(e):Y=t,al.current=null}function yf(e){var t=e;do{var n=t.alternate;if(e=t.return,t.flags&2048){if(n=Kp(t),n!==null){n.flags&=2047,Y=n;return}e!==null&&(e.firstEffect=e.lastEffect=null,e.flags|=2048)}else{if(n=Hp(n,t,Ot),n!==null){Y=n;return}if(n=t,n.tag!==24&&n.tag!==23||n.memoizedState===null||Ot&1073741824||!(n.mode&4)){for(var r=0,i=n.child;i!==null;)r|=i.lanes|i.childLanes,i=i.sibling;n.childLanes=r}e!==null&&!(e.flags&2048)&&(e.firstEffect===null&&(e.firstEffect=t.firstEffect),t.lastEffect!==null&&(e.lastEffect!==null&&(e.lastEffect.nextEffect=t.firstEffect),e.lastEffect=t.lastEffect),1<t.flags&&(e.lastEffect!==null?e.lastEffect.nextEffect=t:e.firstEffect=t,e.lastEffect=t))}if(t=t.sibling,t!==null){Y=t;return}Y=t=e}while(t!==null);ne===0&&(ne=5)}function xt(e){var t=on();return Nt(99,rh.bind(null,e,t)),null}function rh(e,t){do mt();while(Yn!==null);if(L&48)throw Error(_(327));var n=e.finishedWork;if(n===null)return null;if(e.finishedWork=null,e.finishedLanes=0,n===e.current)throw Error(_(177));e.callbackNode=null;var r=n.lanes|n.childLanes,i=r,o=e.pendingLanes&~i;e.pendingLanes=i,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=i,e.mutableReadLanes&=i,e.entangledLanes&=i,i=e.entanglements;for(var s=e.eventTimes,l=e.expirationTimes;0<o;){var a=31-ct(o),u=1<<a;i[a]=0,s[a]=-1,l[a]=-1,o&=~u}if(be!==null&&!(r&24)&&be.has(e)&&be.delete(e),e===ue&&(Y=ue=null,le=0),1<n.flags?n.lastEffect!==null?(n.lastEffect.nextEffect=n,r=n.firstEffect):r=n:r=n.firstEffect,r!==null){if(i=L,L|=32,al.current=null,io=zr,s=ia(),Uo(s)){if("selectionStart"in s)l={start:s.selectionStart,end:s.selectionEnd};else e:if(l=(l=s.ownerDocument)&&l.defaultView||window,(u=l.getSelection&&l.getSelection())&&u.rangeCount!==0){l=u.anchorNode,o=u.anchorOffset,a=u.focusNode,u=u.focusOffset;try{l.nodeType,a.nodeType}catch{l=null;break e}var m=0,v=-1,h=-1,E=0,x=0,k=s,c=null;t:for(;;){for(var f;k!==l||o!==0&&k.nodeType!==3||(v=m+o),k!==a||u!==0&&k.nodeType!==3||(h=m+u),k.nodeType===3&&(m+=k.nodeValue.length),(f=k.firstChild)!==null;)c=k,k=f;for(;;){if(k===s)break t;if(c===l&&++E===o&&(v=m),c===a&&++x===u&&(h=m),(f=k.nextSibling)!==null)break;k=c,c=k.parentNode}k=f}l=v===-1||h===-1?null:{start:v,end:h}}else l=null;l=l||{start:0,end:0}}else l=null;oo={focusedElem:s,selectionRange:l},zr=!1,Jn=null,Kr=!1,T=r;do try{ih()}catch(N){if(T===null)throw Error(_(330));st(T,N),T=T.nextEffect}while(T!==null);Jn=null,T=r;do try{for(s=e;T!==null;){var d=T.flags;if(d&16&&er(T.stateNode,""),d&128){var g=T.alternate;if(g!==null){var w=g.ref;w!==null&&(typeof w=="function"?w(null):w.current=null)}}switch(d&1038){case 2:Va(T),T.flags&=-3;break;case 6:Va(T),T.flags&=-3,po(T.alternate,T);break;case 1024:T.flags&=-1025;break;case 1028:T.flags&=-1025,po(T.alternate,T);break;case 4:po(T.alternate,T);break;case 8:l=T,uf(s,l);var P=l.alternate;ba(l),P!==null&&ba(P)}T=T.nextEffect}}catch(N){if(T===null)throw Error(_(330));st(T,N),T=T.nextEffect}while(T!==null);if(w=oo,g=ia(),d=w.focusedElem,s=w.selectionRange,g!==d&&d&&d.ownerDocument&&Rc(d.ownerDocument.documentElement,d)){for(s!==null&&Uo(d)&&(g=s.start,w=s.end,w===void 0&&(w=g),"selectionStart"in d?(d.selectionStart=g,d.selectionEnd=Math.min(w,d.value.length)):(w=(g=d.ownerDocument||document)&&g.defaultView||window,w.getSelection&&(w=w.getSelection(),l=d.textContent.length,P=Math.min(s.start,l),s=s.end===void 0?P:Math.min(s.end,l),!w.extend&&P>s&&(l=s,s=P,P=l),l=ra(d,P),o=ra(d,s),l&&o&&(w.rangeCount!==1||w.anchorNode!==l.node||w.anchorOffset!==l.offset||w.focusNode!==o.node||w.focusOffset!==o.offset)&&(g=g.createRange(),g.setStart(l.node,l.offset),w.removeAllRanges(),P>s?(w.addRange(g),w.extend(o.node,o.offset)):(g.setEnd(o.node,o.offset),w.addRange(g)))))),g=[],w=d;w=w.parentNode;)w.nodeType===1&&g.push({element:w,left:w.scrollLeft,top:w.scrollTop});for(typeof d.focus=="function"&&d.focus(),d=0;d<g.length;d++)w=g[d],w.element.scrollLeft=w.left,w.element.scrollTop=w.top}zr=!!io,oo=io=null,e.current=n,T=r;do try{for(d=e;T!==null;){var S=T.flags;if(S&36&&Xp(d,T.alternate,T),S&128){g=void 0;var O=T.ref;if(O!==null){var A=T.stateNode;switch(T.tag){case 5:g=A;break;default:g=A}typeof O=="function"?O(g):O.current=g}}T=T.nextEffect}}catch(N){if(T===null)throw Error(_(330));st(T,N),T=T.nextEffect}while(T!==null);T=null,Bp(),L=i}else e.current=n;if(dt)dt=!1,Yn=e,$n=t;else for(T=r;T!==null;)t=T.nextEffect,T.nextEffect=null,T.flags&8&&(S=T,S.sibling=null,S.stateNode=null),T=t;if(r=e.pendingLanes,r===0&&(Le=null),r===1?e===ls?Xn++:(Xn=0,ls=e):Xn=0,n=n.stateNode,Rt&&typeof Rt.onCommitFiberRoot=="function")try{Rt.onCommitFiberRoot(Gs,n,void 0,(n.current.flags&64)===64)}catch{}if(_e(e,se()),xi)throw xi=!1,e=is,is=null,e;return L&8||Me(),null}function ih(){for(;T!==null;){var e=T.alternate;Kr||Jn===null||(T.flags&8?Vl(T,Jn)&&(Kr=!0):T.tag===13&&Jp(e,T)&&Vl(T,Jn)&&(Kr=!0));var t=T.flags;t&256&&Yp(e,T),!(t&512)||dt||(dt=!0,ar(97,function(){return mt(),null})),T=T.nextEffect}}function mt(){if($n!==90){var e=97<$n?97:$n;return $n=90,Nt(e,sh)}return!1}function oh(e,t){os.push(t,e),dt||(dt=!0,ar(97,function(){return mt(),null}))}function gf(e,t){ss.push(t,e),dt||(dt=!0,ar(97,function(){return mt(),null}))}function sh(){if(Yn===null)return!1;var e=Yn;if(Yn=null,L&48)throw Error(_(331));var t=L;L|=32;var n=ss;ss=[];for(var r=0;r<n.length;r+=2){var i=n[r],o=n[r+1],s=i.destroy;if(i.destroy=void 0,typeof s=="function")try{s()}catch(a){if(o===null)throw Error(_(330));st(o,a)}}for(n=os,os=[],r=0;r<n.length;r+=2){i=n[r],o=n[r+1];try{var l=i.create;i.destroy=l()}catch(a){if(o===null)throw Error(_(330));st(o,a)}}for(l=e.current.firstEffect;l!==null;)e=l.nextEffect,l.nextEffect=null,l.flags&8&&(l.sibling=null,l.stateNode=null),l=e;return L=t,Me(),!0}function Wa(e,t,n){t=ll(n,t),t=lf(e,t,1),rt(e,t),t=me(),e=Mi(e,1),e!==null&&(Pi(e,1,t),_e(e,t))}function st(e,t){if(e.tag===3)Wa(e,e,t);else for(var n=e.return;n!==null;){if(n.tag===3){Wa(n,e,t);break}else if(n.tag===1){var r=n.stateNode;if(typeof n.type.getDerivedStateFromError=="function"||typeof r.componentDidCatch=="function"&&(Le===null||!Le.has(r))){e=ll(t,e);var i=af(n,e,1);if(rt(n,i),i=me(),n=Mi(n,1),n!==null)Pi(n,1,i),_e(n,i);else if(typeof r.componentDidCatch=="function"&&(Le===null||!Le.has(r)))try{r.componentDidCatch(t,e)}catch{}break}}n=n.return}}function lh(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),t=me(),e.pingedLanes|=e.suspendedLanes&n,ue===e&&(le&n)===n&&(ne===4||ne===3&&(le&62914560)===le&&500>se()-cl?en(e,0):ul|=n),_e(e,t)}function ah(e,t){var n=e.stateNode;n!==null&&n.delete(t),t=0,t===0&&(t=e.mode,t&2?t&4?(Ue===0&&(Ue=fn),t=Ut(62914560&~Ue),t===0&&(t=4194304)):t=on()===99?1:2:t=1),n=me(),e=Mi(e,t),e!==null&&(Pi(e,t,n),_e(e,n))}var vf;vf=function(e,t,n){var r=t.lanes;if(e!==null)if(e.memoizedProps!==t.pendingProps||pe.current)Pe=!0;else if(n&r)Pe=!!(e.flags&16384);else{switch(Pe=!1,t.tag){case 3:La(t),uo();break;case 5:Ea(t);break;case 1:he(t.type)&&Vr(t);break;case 4:Ho(t,t.stateNode.containerInfo);break;case 10:r=t.memoizedProps.value;var i=t.type._context;W(ui,i._currentValue),i._currentValue=r;break;case 13:if(t.memoizedState!==null)return n&t.child.childLanes?ja(e,t,n):(W(q,q.current&1),t=ze(e,t,n),t!==null?t.sibling:null);W(q,q.current&1);break;case 19:if(r=(n&t.childLanes)!==0,e.flags&64){if(r)return $a(e,t,n);t.flags|=64}if(i=t.memoizedState,i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),W(q,q.current),r)break;return null;case 23:case 24:return t.lanes=0,co(e,t,n)}return ze(e,t,n)}else Pe=!1;switch(t.lanes=0,t.tag){case 2:if(r=t.type,e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2),e=t.pendingProps,i=rn(t,ae.current),Xt(t,n),i=rl(null,t,r,e,i,n),t.flags|=1,typeof i=="object"&&i!==null&&typeof i.render=="function"&&i.$$typeof===void 0){if(t.tag=1,t.memoizedState=null,t.updateQueue=null,he(r)){var o=!0;Vr(t)}else o=!1;t.memoizedState=i.state!==null&&i.state!==void 0?i.state:null,Zs(t);var s=r.getDerivedStateFromProps;typeof s=="function"&&di(t,r,s,e),i.updater=Ii,t.stateNode=i,i._reactInternals=t,Wo(t,r,e,n),t=Yo(null,t,r,!0,o,n)}else t.tag=0,de(null,t,i,n),t=t.child;return t;case 16:i=t.elementType;e:{switch(e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2),e=t.pendingProps,o=i._init,i=o(i._payload),t.type=i,o=t.tag=ch(i),e=Te(i,e),o){case 0:t=Go(null,t,i,e,n);break e;case 1:t=Oa(null,t,i,e,n);break e;case 11:t=Pa(null,t,i,e,n);break e;case 14:t=Na(null,t,i,Te(i.type,e),r,n);break e}throw Error(_(306,i,""))}return t;case 0:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:Te(r,i),Go(e,t,r,i,n);case 1:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:Te(r,i),Oa(e,t,r,i,n);case 3:if(La(t),r=t.updateQueue,e===null||r===null)throw Error(_(282));if(r=t.pendingProps,i=t.memoizedState,i=i!==null?i.element:null,Fc(e,t),ur(t,r,null,n),r=t.memoizedState.element,r===i)uo(),t=ze(e,t,n);else{if(i=t.stateNode,(o=i.hydrate)&&(Xe=Yt(t.stateNode.containerInfo.firstChild),Be=t,o=Ae=!0),o){if(e=i.mutableSourceEagerHydrationData,e!=null)for(i=0;i<e.length;i+=2)o=e[i],o._workInProgressVersionPrimary=e[i+1],Jt.push(o);for(n=Hc(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|1024,n=n.sibling}else de(e,t,r,n),uo();t=t.child}return t;case 5:return Ea(t),e===null&&Ko(t),r=t.type,i=t.pendingProps,o=e!==null?e.memoizedProps:null,s=i.children,bo(r,i)?s=null:o!==null&&bo(r,o)&&(t.flags|=16),nf(e,t),de(e,t,s,n),t.child;case 6:return e===null&&Ko(t),null;case 13:return ja(e,t,n);case 4:return Ho(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=pi(t,null,r,n):de(e,t,r,n),t.child;case 11:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:Te(r,i),Pa(e,t,r,i,n);case 7:return de(e,t,t.pendingProps,n),t.child;case 8:return de(e,t,t.pendingProps.children,n),t.child;case 12:return de(e,t,t.pendingProps.children,n),t.child;case 10:e:{r=t.type._context,i=t.pendingProps,s=t.memoizedProps,o=i.value;var l=t.type._context;if(W(ui,l._currentValue),l._currentValue=o,s!==null)if(l=s.value,o=we(l,o)?0:(typeof r._calculateChangedBits=="function"?r._calculateChangedBits(l,o):1073741823)|0,o===0){if(s.children===i.children&&!pe.current){t=ze(e,t,n);break e}}else for(l=t.child,l!==null&&(l.return=t);l!==null;){var a=l.dependencies;if(a!==null){s=l.child;for(var u=a.firstContext;u!==null;){if(u.context===r&&u.observedBits&o){l.tag===1&&(u=nt(-1,n&-n),u.tag=2,rt(l,u)),l.lanes|=n,u=l.alternate,u!==null&&(u.lanes|=n),bc(l.return,n),a.lanes|=n;break}u=u.next}}else s=l.tag===10&&l.type===t.type?null:l.child;if(s!==null)s.return=l;else for(s=l;s!==null;){if(s===t){s=null;break}if(l=s.sibling,l!==null){l.return=s.return,s=l;break}s=s.return}l=s}de(e,t,i.children,n),t=t.child}return t;case 9:return i=t.type,o=t.pendingProps,r=o.children,Xt(t,n),i=Ee(i,o.unstable_observedBits),r=r(i),t.flags|=1,de(e,t,r,n),t.child;case 14:return i=t.type,o=Te(i,t.pendingProps),o=Te(i.type,o),Na(e,t,i,o,r,n);case 15:return tf(e,t,t.type,t.pendingProps,r,n);case 17:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:Te(r,i),e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2),t.tag=1,he(r)?(e=!0,Vr(t)):e=!1,Xt(t,n),qc(t,r,i),Wo(t,r,i,n),Yo(null,t,r,!0,e,n);case 19:return $a(e,t,n);case 23:return co(e,t,n);case 24:return co(e,t,n)}throw Error(_(156,t.tag))};function uh(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.flags=0,this.lastEffect=this.firstEffect=this.nextEffect=null,this.childLanes=this.lanes=0,this.alternate=null}function ke(e,t,n,r){return new uh(e,t,n,r)}function dl(e){return e=e.prototype,!(!e||!e.isReactComponent)}function ch(e){if(typeof e=="function")return dl(e)?1:0;if(e!=null){if(e=e.$$typeof,e===Ci)return 11;if(e===Ti)return 14}return 2}function pt(e,t){var n=e.alternate;return n===null?(n=ke(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.nextEffect=null,n.firstEffect=null,n.lastEffect=null),n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n}function Qr(e,t,n,r,i,o){var s=2;if(r=e,typeof e=="function")dl(e)&&(s=1);else if(typeof e=="string")s=5;else e:switch(e){case Qe:return tn(n.children,i,o,t);case Qu:s=8,i|=16;break;case Ps:s=8,i|=1;break;case bn:return e=ke(12,n,t,i|8),e.elementType=bn,e.type=bn,e.lanes=o,e;case Fn:return e=ke(13,n,t,i),e.type=Fn,e.elementType=Fn,e.lanes=o,e;case ei:return e=ke(19,n,t,i),e.elementType=ei,e.lanes=o,e;case Is:return pl(n,i,o,t);case _o:return e=ke(24,n,t,i),e.elementType=_o,e.lanes=o,e;default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case Ns:s=10;break e;case Os:s=9;break e;case Ci:s=11;break e;case Ti:s=14;break e;case Ls:s=16,r=null;break e;case js:s=22;break e}throw Error(_(130,e==null?e:typeof e,""))}return t=ke(s,n,t,i),t.elementType=e,t.type=r,t.lanes=o,t}function tn(e,t,n,r){return e=ke(7,e,r,t),e.lanes=n,e}function pl(e,t,n,r){return e=ke(23,e,r,t),e.elementType=Is,e.lanes=n,e}function ho(e,t,n){return e=ke(6,e,null,t),e.lanes=n,e}function mo(e,t,n){return t=ke(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function fh(e,t,n){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.pendingContext=this.context=null,this.hydrate=n,this.callbackNode=null,this.callbackPriority=0,this.eventTimes=Xi(0),this.expirationTimes=Xi(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Xi(0),this.mutableSourceEagerHydrationData=null}function dh(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:Et,key:r==null?null:""+r,children:e,containerInfo:t,implementation:n}}function Ei(e,t,n,r){var i=t.current,o=me(),s=it(i);e:if(n){n=n._reactInternals;t:{if(At(n)!==n||n.tag!==1)throw Error(_(170));var l=n;do{switch(l.tag){case 3:l=l.stateNode.context;break t;case 1:if(he(l.type)){l=l.stateNode.__reactInternalMemoizedMergedChildContext;break t}}l=l.return}while(l!==null);throw Error(_(171))}if(n.tag===1){var a=n.type;if(he(a)){n=Ic(n,a,l);break e}}n=l}else n=ft;return t.context===null?t.context=n:t.pendingContext=n,t=nt(o,s),t.payload={element:e},r=r===void 0?null:r,r!==null&&(t.callback=r),rt(i,t),ot(i,s,o),s}function yo(e){if(e=e.current,!e.child)return null;switch(e.child.tag){case 5:return e.child.stateNode;default:return e.child.stateNode}}function Ha(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function hl(e,t){Ha(e,t),(e=e.alternate)&&Ha(e,t)}function ph(){return null}function ml(e,t,n){var r=n!=null&&n.hydrationOptions!=null&&n.hydrationOptions.mutableSources||null;if(n=new fh(e,t,n!=null&&n.hydrate===!0),t=ke(3,null,null,t===2?7:t===1?3:0),n.current=t,t.stateNode=n,Zs(t),e[cn]=n.current,Nc(e.nodeType===8?e.parentNode:e),r)for(e=0;e<r.length;e++){t=r[e];var i=t._getVersion;i=i(t._source),n.mutableSourceEagerHydrationData==null?n.mutableSourceEagerHydrationData=[t,i]:n.mutableSourceEagerHydrationData.push(t,i)}this._internalRoot=n}ml.prototype.render=function(e){Ei(e,this._internalRoot,null,null)};ml.prototype.unmount=function(){var e=this._internalRoot,t=e.containerInfo;Ei(null,e,null,function(){t[cn]=null})};function Er(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11&&(e.nodeType!==8||e.nodeValue!==" react-mount-point-unstable "))}function hh(e,t){if(t||(t=e?e.nodeType===9?e.documentElement:e.firstChild:null,t=!(!t||t.nodeType!==1||!t.hasAttribute("data-reactroot"))),!t)for(var n;n=e.lastChild;)e.removeChild(n);return new ml(e,0,t?{hydrate:!0}:void 0)}function $i(e,t,n,r,i){var o=n._reactRootContainer;if(o){var s=o._internalRoot;if(typeof i=="function"){var l=i;i=function(){var u=yo(s);l.call(u)}}Ei(t,s,e,i)}else{if(o=n._reactRootContainer=hh(n,r),s=o._internalRoot,typeof i=="function"){var a=i;i=function(){var u=yo(s);a.call(u)}}df(function(){Ei(t,s,e,i)})}return yo(s)}uc=function(e){if(e.tag===13){var t=me();ot(e,4,t),hl(e,4)}};Bs=function(e){if(e.tag===13){var t=me();ot(e,67108864,t),hl(e,67108864)}};cc=function(e){if(e.tag===13){var t=me(),n=it(e);ot(e,n,t),hl(e,n)}};fc=function(e,t){return t()};Ao=function(e,t,n){switch(t){case"input":if(Co(e,n),t=n.name,n.type==="radio"&&t!=null){for(n=e;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll("input[name="+JSON.stringify(""+t)+'][type="radio"]'),t=0;t<n.length;t++){var r=n[t];if(r!==e&&r.form===e.form){var i=ji(r);if(!i)throw Error(_(90));Yu(r),Co(r,i)}}}break;case"textarea":Ju(e,n);break;case"select":t=n.value,t!=null&&Kt(e,!!n.multiple,t,!1)}};Ms=ff;oc=function(e,t,n,r,i){var o=L;L|=4;try{return Nt(98,e.bind(null,t,n,r,i))}finally{L=o,L===0&&(pn(),Me())}};$s=function(){!(L&49)&&(eh(),mt())};sc=function(e,t){var n=L;L|=2;try{return e(t)}finally{L=n,L===0&&(pn(),Me())}};function wf(e,t){var n=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!Er(t))throw Error(_(200));return dh(e,t,null,n)}var mh={Events:[wr,Ft,ji,rc,ic,mt,{current:!1}]},Ln={findFiberByHostInstance:St,bundleType:0,version:"17.0.2",rendererPackageName:"react-dom"},yh={bundleType:Ln.bundleType,version:Ln.version,rendererPackageName:Ln.rendererPackageName,rendererConfig:Ln.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:jt.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return e=ac(e),e===null?null:e.stateNode},findFiberByHostInstance:Ln.findFiberByHostInstance||ph,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Dr=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Dr.isDisabled&&Dr.supportsFiber)try{Gs=Dr.inject(yh),Rt=Dr}catch{}}Se.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=mh;Se.createPortal=wf;Se.findDOMNode=function(e){if(e==null)return null;if(e.nodeType===1)return e;var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(_(188)):Error(_(268,Object.keys(e)));return e=ac(t),e=e===null?null:e.stateNode,e};Se.flushSync=function(e,t){var n=L;if(n&48)return e(t);L|=1;try{if(e)return Nt(99,e.bind(null,t))}finally{L=n,Me()}};Se.hydrate=function(e,t,n){if(!Er(t))throw Error(_(200));return $i(null,e,t,!0,n)};Se.render=function(e,t,n){if(!Er(t))throw Error(_(200));return $i(null,e,t,!1,n)};Se.unmountComponentAtNode=function(e){if(!Er(e))throw Error(_(40));return e._reactRootContainer?(df(function(){$i(null,null,e,!1,function(){e._reactRootContainer=null,e[cn]=null})}),!0):!1};Se.unstable_batchedUpdates=ff;Se.unstable_createPortal=function(e,t){return wf(e,t,2<arguments.length&&arguments[2]!==void 0?arguments[2]:null)};Se.unstable_renderSubtreeIntoContainer=function(e,t,n,r){if(!Er(n))throw Error(_(200));if(e==null||e._reactInternals===void 0)throw Error(_(38));return $i(e,t,n,!1,r)};Se.version="17.0.2";function kf(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(kf)}catch(e){console.error(e)}}kf(),qu.exports=Se;var xf=qu.exports;const Ov=Cu(xf),gh="modulepreload",vh=function(e){return"/xenon/"+e},Ka={},V=function(t,n,r){let i=Promise.resolve();if(n&&n.length>0){document.getElementsByTagName("link");const s=document.querySelector("meta[property=csp-nonce]"),l=(s==null?void 0:s.nonce)||(s==null?void 0:s.getAttribute("nonce"));i=Promise.allSettled(n.map(a=>{if(a=vh(a),a in Ka)return;Ka[a]=!0;const u=a.endsWith(".css"),m=u?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${a}"]${m}`))return;const v=document.createElement("link");if(v.rel=u?"stylesheet":gh,u||(v.as="script"),v.crossOrigin="",v.href=a,l&&v.setAttribute("nonce",l),document.head.appendChild(v),u)return new Promise((h,E)=>{v.addEventListener("load",h),v.addEventListener("error",()=>E(new Error(`Unable to preload CSS for ${a}`)))})}))}function o(s){const l=new Event("vite:preloadError",{cancelable:!0});if(l.payload=s,window.dispatchEvent(l),!l.defaultPrevented)throw s}return i.then(s=>{for(const l of s||[])l.status==="rejected"&&o(l.reason);return t().catch(o)})};/**
|
|
42
|
+
Add a <Suspense fallback=...> component higher in the tree to provide a loading indicator or placeholder to display.`)}ne!==5&&(ne=2),a=ll(a,l),h=s;do{switch(h.tag){case 3:o=a,h.flags|=4096,t&=-t,h.lanes|=t;var P=lf(h,o,t);va(h,P);break e;case 1:o=a;var S=h.type,O=h.stateNode;if(!(h.flags&64)&&(typeof S.getDerivedStateFromError=="function"||O!==null&&typeof O.componentDidCatch=="function"&&(Le===null||!Le.has(O)))){h.flags|=4096,t&=-t,h.lanes|=t;var A=af(h,o,t);va(h,A);break e}}h=h.return}while(h!==null)}yf(n)}catch(N){t=N,Y===n&&n!==null&&(Y=n=n.return);continue}break}while(!0)}function hf(){var e=ki.current;return ki.current=wi,e===null?wi:e}function Un(e,t){var n=L;L|=16;var r=hf();ue===e&&le===t||en(e,t);do try{th();break}catch(i){pf(e,i)}while(!0);if(Xs(),L=n,ki.current=r,Y!==null)throw Error(_(261));return ue=null,le=0,ne}function th(){for(;Y!==null;)mf(Y)}function nh(){for(;Y!==null&&!$p();)mf(Y)}function mf(e){var t=vf(e.alternate,e,Ot);e.memoizedProps=e.pendingProps,t===null?yf(e):Y=t,al.current=null}function yf(e){var t=e;do{var n=t.alternate;if(e=t.return,t.flags&2048){if(n=Kp(t),n!==null){n.flags&=2047,Y=n;return}e!==null&&(e.firstEffect=e.lastEffect=null,e.flags|=2048)}else{if(n=Hp(n,t,Ot),n!==null){Y=n;return}if(n=t,n.tag!==24&&n.tag!==23||n.memoizedState===null||Ot&1073741824||!(n.mode&4)){for(var r=0,i=n.child;i!==null;)r|=i.lanes|i.childLanes,i=i.sibling;n.childLanes=r}e!==null&&!(e.flags&2048)&&(e.firstEffect===null&&(e.firstEffect=t.firstEffect),t.lastEffect!==null&&(e.lastEffect!==null&&(e.lastEffect.nextEffect=t.firstEffect),e.lastEffect=t.lastEffect),1<t.flags&&(e.lastEffect!==null?e.lastEffect.nextEffect=t:e.firstEffect=t,e.lastEffect=t))}if(t=t.sibling,t!==null){Y=t;return}Y=t=e}while(t!==null);ne===0&&(ne=5)}function xt(e){var t=on();return Nt(99,rh.bind(null,e,t)),null}function rh(e,t){do mt();while(Yn!==null);if(L&48)throw Error(_(327));var n=e.finishedWork;if(n===null)return null;if(e.finishedWork=null,e.finishedLanes=0,n===e.current)throw Error(_(177));e.callbackNode=null;var r=n.lanes|n.childLanes,i=r,o=e.pendingLanes&~i;e.pendingLanes=i,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=i,e.mutableReadLanes&=i,e.entangledLanes&=i,i=e.entanglements;for(var s=e.eventTimes,l=e.expirationTimes;0<o;){var a=31-ct(o),u=1<<a;i[a]=0,s[a]=-1,l[a]=-1,o&=~u}if(be!==null&&!(r&24)&&be.has(e)&&be.delete(e),e===ue&&(Y=ue=null,le=0),1<n.flags?n.lastEffect!==null?(n.lastEffect.nextEffect=n,r=n.firstEffect):r=n:r=n.firstEffect,r!==null){if(i=L,L|=32,al.current=null,io=zr,s=ia(),Uo(s)){if("selectionStart"in s)l={start:s.selectionStart,end:s.selectionEnd};else e:if(l=(l=s.ownerDocument)&&l.defaultView||window,(u=l.getSelection&&l.getSelection())&&u.rangeCount!==0){l=u.anchorNode,o=u.anchorOffset,a=u.focusNode,u=u.focusOffset;try{l.nodeType,a.nodeType}catch{l=null;break e}var m=0,v=-1,h=-1,E=0,x=0,k=s,c=null;t:for(;;){for(var f;k!==l||o!==0&&k.nodeType!==3||(v=m+o),k!==a||u!==0&&k.nodeType!==3||(h=m+u),k.nodeType===3&&(m+=k.nodeValue.length),(f=k.firstChild)!==null;)c=k,k=f;for(;;){if(k===s)break t;if(c===l&&++E===o&&(v=m),c===a&&++x===u&&(h=m),(f=k.nextSibling)!==null)break;k=c,c=k.parentNode}k=f}l=v===-1||h===-1?null:{start:v,end:h}}else l=null;l=l||{start:0,end:0}}else l=null;oo={focusedElem:s,selectionRange:l},zr=!1,Jn=null,Kr=!1,T=r;do try{ih()}catch(N){if(T===null)throw Error(_(330));st(T,N),T=T.nextEffect}while(T!==null);Jn=null,T=r;do try{for(s=e;T!==null;){var d=T.flags;if(d&16&&er(T.stateNode,""),d&128){var g=T.alternate;if(g!==null){var w=g.ref;w!==null&&(typeof w=="function"?w(null):w.current=null)}}switch(d&1038){case 2:Va(T),T.flags&=-3;break;case 6:Va(T),T.flags&=-3,po(T.alternate,T);break;case 1024:T.flags&=-1025;break;case 1028:T.flags&=-1025,po(T.alternate,T);break;case 4:po(T.alternate,T);break;case 8:l=T,uf(s,l);var P=l.alternate;ba(l),P!==null&&ba(P)}T=T.nextEffect}}catch(N){if(T===null)throw Error(_(330));st(T,N),T=T.nextEffect}while(T!==null);if(w=oo,g=ia(),d=w.focusedElem,s=w.selectionRange,g!==d&&d&&d.ownerDocument&&Rc(d.ownerDocument.documentElement,d)){for(s!==null&&Uo(d)&&(g=s.start,w=s.end,w===void 0&&(w=g),"selectionStart"in d?(d.selectionStart=g,d.selectionEnd=Math.min(w,d.value.length)):(w=(g=d.ownerDocument||document)&&g.defaultView||window,w.getSelection&&(w=w.getSelection(),l=d.textContent.length,P=Math.min(s.start,l),s=s.end===void 0?P:Math.min(s.end,l),!w.extend&&P>s&&(l=s,s=P,P=l),l=ra(d,P),o=ra(d,s),l&&o&&(w.rangeCount!==1||w.anchorNode!==l.node||w.anchorOffset!==l.offset||w.focusNode!==o.node||w.focusOffset!==o.offset)&&(g=g.createRange(),g.setStart(l.node,l.offset),w.removeAllRanges(),P>s?(w.addRange(g),w.extend(o.node,o.offset)):(g.setEnd(o.node,o.offset),w.addRange(g)))))),g=[],w=d;w=w.parentNode;)w.nodeType===1&&g.push({element:w,left:w.scrollLeft,top:w.scrollTop});for(typeof d.focus=="function"&&d.focus(),d=0;d<g.length;d++)w=g[d],w.element.scrollLeft=w.left,w.element.scrollTop=w.top}zr=!!io,oo=io=null,e.current=n,T=r;do try{for(d=e;T!==null;){var S=T.flags;if(S&36&&Xp(d,T.alternate,T),S&128){g=void 0;var O=T.ref;if(O!==null){var A=T.stateNode;switch(T.tag){case 5:g=A;break;default:g=A}typeof O=="function"?O(g):O.current=g}}T=T.nextEffect}}catch(N){if(T===null)throw Error(_(330));st(T,N),T=T.nextEffect}while(T!==null);T=null,Bp(),L=i}else e.current=n;if(dt)dt=!1,Yn=e,$n=t;else for(T=r;T!==null;)t=T.nextEffect,T.nextEffect=null,T.flags&8&&(S=T,S.sibling=null,S.stateNode=null),T=t;if(r=e.pendingLanes,r===0&&(Le=null),r===1?e===ls?Xn++:(Xn=0,ls=e):Xn=0,n=n.stateNode,Rt&&typeof Rt.onCommitFiberRoot=="function")try{Rt.onCommitFiberRoot(Gs,n,void 0,(n.current.flags&64)===64)}catch{}if(_e(e,se()),xi)throw xi=!1,e=is,is=null,e;return L&8||Me(),null}function ih(){for(;T!==null;){var e=T.alternate;Kr||Jn===null||(T.flags&8?Vl(T,Jn)&&(Kr=!0):T.tag===13&&Jp(e,T)&&Vl(T,Jn)&&(Kr=!0));var t=T.flags;t&256&&Yp(e,T),!(t&512)||dt||(dt=!0,ar(97,function(){return mt(),null})),T=T.nextEffect}}function mt(){if($n!==90){var e=97<$n?97:$n;return $n=90,Nt(e,sh)}return!1}function oh(e,t){os.push(t,e),dt||(dt=!0,ar(97,function(){return mt(),null}))}function gf(e,t){ss.push(t,e),dt||(dt=!0,ar(97,function(){return mt(),null}))}function sh(){if(Yn===null)return!1;var e=Yn;if(Yn=null,L&48)throw Error(_(331));var t=L;L|=32;var n=ss;ss=[];for(var r=0;r<n.length;r+=2){var i=n[r],o=n[r+1],s=i.destroy;if(i.destroy=void 0,typeof s=="function")try{s()}catch(a){if(o===null)throw Error(_(330));st(o,a)}}for(n=os,os=[],r=0;r<n.length;r+=2){i=n[r],o=n[r+1];try{var l=i.create;i.destroy=l()}catch(a){if(o===null)throw Error(_(330));st(o,a)}}for(l=e.current.firstEffect;l!==null;)e=l.nextEffect,l.nextEffect=null,l.flags&8&&(l.sibling=null,l.stateNode=null),l=e;return L=t,Me(),!0}function Wa(e,t,n){t=ll(n,t),t=lf(e,t,1),rt(e,t),t=me(),e=Mi(e,1),e!==null&&(Pi(e,1,t),_e(e,t))}function st(e,t){if(e.tag===3)Wa(e,e,t);else for(var n=e.return;n!==null;){if(n.tag===3){Wa(n,e,t);break}else if(n.tag===1){var r=n.stateNode;if(typeof n.type.getDerivedStateFromError=="function"||typeof r.componentDidCatch=="function"&&(Le===null||!Le.has(r))){e=ll(t,e);var i=af(n,e,1);if(rt(n,i),i=me(),n=Mi(n,1),n!==null)Pi(n,1,i),_e(n,i);else if(typeof r.componentDidCatch=="function"&&(Le===null||!Le.has(r)))try{r.componentDidCatch(t,e)}catch{}break}}n=n.return}}function lh(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),t=me(),e.pingedLanes|=e.suspendedLanes&n,ue===e&&(le&n)===n&&(ne===4||ne===3&&(le&62914560)===le&&500>se()-cl?en(e,0):ul|=n),_e(e,t)}function ah(e,t){var n=e.stateNode;n!==null&&n.delete(t),t=0,t===0&&(t=e.mode,t&2?t&4?(Ue===0&&(Ue=fn),t=Ut(62914560&~Ue),t===0&&(t=4194304)):t=on()===99?1:2:t=1),n=me(),e=Mi(e,t),e!==null&&(Pi(e,t,n),_e(e,n))}var vf;vf=function(e,t,n){var r=t.lanes;if(e!==null)if(e.memoizedProps!==t.pendingProps||pe.current)Pe=!0;else if(n&r)Pe=!!(e.flags&16384);else{switch(Pe=!1,t.tag){case 3:La(t),uo();break;case 5:Ea(t);break;case 1:he(t.type)&&Vr(t);break;case 4:Ho(t,t.stateNode.containerInfo);break;case 10:r=t.memoizedProps.value;var i=t.type._context;W(ui,i._currentValue),i._currentValue=r;break;case 13:if(t.memoizedState!==null)return n&t.child.childLanes?ja(e,t,n):(W(q,q.current&1),t=ze(e,t,n),t!==null?t.sibling:null);W(q,q.current&1);break;case 19:if(r=(n&t.childLanes)!==0,e.flags&64){if(r)return $a(e,t,n);t.flags|=64}if(i=t.memoizedState,i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),W(q,q.current),r)break;return null;case 23:case 24:return t.lanes=0,co(e,t,n)}return ze(e,t,n)}else Pe=!1;switch(t.lanes=0,t.tag){case 2:if(r=t.type,e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2),e=t.pendingProps,i=rn(t,ae.current),Xt(t,n),i=rl(null,t,r,e,i,n),t.flags|=1,typeof i=="object"&&i!==null&&typeof i.render=="function"&&i.$$typeof===void 0){if(t.tag=1,t.memoizedState=null,t.updateQueue=null,he(r)){var o=!0;Vr(t)}else o=!1;t.memoizedState=i.state!==null&&i.state!==void 0?i.state:null,Zs(t);var s=r.getDerivedStateFromProps;typeof s=="function"&&di(t,r,s,e),i.updater=Ii,t.stateNode=i,i._reactInternals=t,Wo(t,r,e,n),t=Yo(null,t,r,!0,o,n)}else t.tag=0,de(null,t,i,n),t=t.child;return t;case 16:i=t.elementType;e:{switch(e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2),e=t.pendingProps,o=i._init,i=o(i._payload),t.type=i,o=t.tag=ch(i),e=Te(i,e),o){case 0:t=Go(null,t,i,e,n);break e;case 1:t=Oa(null,t,i,e,n);break e;case 11:t=Pa(null,t,i,e,n);break e;case 14:t=Na(null,t,i,Te(i.type,e),r,n);break e}throw Error(_(306,i,""))}return t;case 0:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:Te(r,i),Go(e,t,r,i,n);case 1:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:Te(r,i),Oa(e,t,r,i,n);case 3:if(La(t),r=t.updateQueue,e===null||r===null)throw Error(_(282));if(r=t.pendingProps,i=t.memoizedState,i=i!==null?i.element:null,Fc(e,t),ur(t,r,null,n),r=t.memoizedState.element,r===i)uo(),t=ze(e,t,n);else{if(i=t.stateNode,(o=i.hydrate)&&(Xe=Yt(t.stateNode.containerInfo.firstChild),Be=t,o=Ae=!0),o){if(e=i.mutableSourceEagerHydrationData,e!=null)for(i=0;i<e.length;i+=2)o=e[i],o._workInProgressVersionPrimary=e[i+1],Jt.push(o);for(n=Hc(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|1024,n=n.sibling}else de(e,t,r,n),uo();t=t.child}return t;case 5:return Ea(t),e===null&&Ko(t),r=t.type,i=t.pendingProps,o=e!==null?e.memoizedProps:null,s=i.children,bo(r,i)?s=null:o!==null&&bo(r,o)&&(t.flags|=16),nf(e,t),de(e,t,s,n),t.child;case 6:return e===null&&Ko(t),null;case 13:return ja(e,t,n);case 4:return Ho(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=pi(t,null,r,n):de(e,t,r,n),t.child;case 11:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:Te(r,i),Pa(e,t,r,i,n);case 7:return de(e,t,t.pendingProps,n),t.child;case 8:return de(e,t,t.pendingProps.children,n),t.child;case 12:return de(e,t,t.pendingProps.children,n),t.child;case 10:e:{r=t.type._context,i=t.pendingProps,s=t.memoizedProps,o=i.value;var l=t.type._context;if(W(ui,l._currentValue),l._currentValue=o,s!==null)if(l=s.value,o=we(l,o)?0:(typeof r._calculateChangedBits=="function"?r._calculateChangedBits(l,o):1073741823)|0,o===0){if(s.children===i.children&&!pe.current){t=ze(e,t,n);break e}}else for(l=t.child,l!==null&&(l.return=t);l!==null;){var a=l.dependencies;if(a!==null){s=l.child;for(var u=a.firstContext;u!==null;){if(u.context===r&&u.observedBits&o){l.tag===1&&(u=nt(-1,n&-n),u.tag=2,rt(l,u)),l.lanes|=n,u=l.alternate,u!==null&&(u.lanes|=n),bc(l.return,n),a.lanes|=n;break}u=u.next}}else s=l.tag===10&&l.type===t.type?null:l.child;if(s!==null)s.return=l;else for(s=l;s!==null;){if(s===t){s=null;break}if(l=s.sibling,l!==null){l.return=s.return,s=l;break}s=s.return}l=s}de(e,t,i.children,n),t=t.child}return t;case 9:return i=t.type,o=t.pendingProps,r=o.children,Xt(t,n),i=Ee(i,o.unstable_observedBits),r=r(i),t.flags|=1,de(e,t,r,n),t.child;case 14:return i=t.type,o=Te(i,t.pendingProps),o=Te(i.type,o),Na(e,t,i,o,r,n);case 15:return tf(e,t,t.type,t.pendingProps,r,n);case 17:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:Te(r,i),e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2),t.tag=1,he(r)?(e=!0,Vr(t)):e=!1,Xt(t,n),qc(t,r,i),Wo(t,r,i,n),Yo(null,t,r,!0,e,n);case 19:return $a(e,t,n);case 23:return co(e,t,n);case 24:return co(e,t,n)}throw Error(_(156,t.tag))};function uh(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.flags=0,this.lastEffect=this.firstEffect=this.nextEffect=null,this.childLanes=this.lanes=0,this.alternate=null}function ke(e,t,n,r){return new uh(e,t,n,r)}function dl(e){return e=e.prototype,!(!e||!e.isReactComponent)}function ch(e){if(typeof e=="function")return dl(e)?1:0;if(e!=null){if(e=e.$$typeof,e===Ci)return 11;if(e===Ti)return 14}return 2}function pt(e,t){var n=e.alternate;return n===null?(n=ke(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.nextEffect=null,n.firstEffect=null,n.lastEffect=null),n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n}function Qr(e,t,n,r,i,o){var s=2;if(r=e,typeof e=="function")dl(e)&&(s=1);else if(typeof e=="string")s=5;else e:switch(e){case Qe:return tn(n.children,i,o,t);case Qu:s=8,i|=16;break;case Ps:s=8,i|=1;break;case bn:return e=ke(12,n,t,i|8),e.elementType=bn,e.type=bn,e.lanes=o,e;case Fn:return e=ke(13,n,t,i),e.type=Fn,e.elementType=Fn,e.lanes=o,e;case ei:return e=ke(19,n,t,i),e.elementType=ei,e.lanes=o,e;case Is:return pl(n,i,o,t);case _o:return e=ke(24,n,t,i),e.elementType=_o,e.lanes=o,e;default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case Ns:s=10;break e;case Os:s=9;break e;case Ci:s=11;break e;case Ti:s=14;break e;case Ls:s=16,r=null;break e;case js:s=22;break e}throw Error(_(130,e==null?e:typeof e,""))}return t=ke(s,n,t,i),t.elementType=e,t.type=r,t.lanes=o,t}function tn(e,t,n,r){return e=ke(7,e,r,t),e.lanes=n,e}function pl(e,t,n,r){return e=ke(23,e,r,t),e.elementType=Is,e.lanes=n,e}function ho(e,t,n){return e=ke(6,e,null,t),e.lanes=n,e}function mo(e,t,n){return t=ke(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function fh(e,t,n){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.pendingContext=this.context=null,this.hydrate=n,this.callbackNode=null,this.callbackPriority=0,this.eventTimes=Xi(0),this.expirationTimes=Xi(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Xi(0),this.mutableSourceEagerHydrationData=null}function dh(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:Et,key:r==null?null:""+r,children:e,containerInfo:t,implementation:n}}function Ei(e,t,n,r){var i=t.current,o=me(),s=it(i);e:if(n){n=n._reactInternals;t:{if(At(n)!==n||n.tag!==1)throw Error(_(170));var l=n;do{switch(l.tag){case 3:l=l.stateNode.context;break t;case 1:if(he(l.type)){l=l.stateNode.__reactInternalMemoizedMergedChildContext;break t}}l=l.return}while(l!==null);throw Error(_(171))}if(n.tag===1){var a=n.type;if(he(a)){n=Ic(n,a,l);break e}}n=l}else n=ft;return t.context===null?t.context=n:t.pendingContext=n,t=nt(o,s),t.payload={element:e},r=r===void 0?null:r,r!==null&&(t.callback=r),rt(i,t),ot(i,s,o),s}function yo(e){if(e=e.current,!e.child)return null;switch(e.child.tag){case 5:return e.child.stateNode;default:return e.child.stateNode}}function Ha(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function hl(e,t){Ha(e,t),(e=e.alternate)&&Ha(e,t)}function ph(){return null}function ml(e,t,n){var r=n!=null&&n.hydrationOptions!=null&&n.hydrationOptions.mutableSources||null;if(n=new fh(e,t,n!=null&&n.hydrate===!0),t=ke(3,null,null,t===2?7:t===1?3:0),n.current=t,t.stateNode=n,Zs(t),e[cn]=n.current,Nc(e.nodeType===8?e.parentNode:e),r)for(e=0;e<r.length;e++){t=r[e];var i=t._getVersion;i=i(t._source),n.mutableSourceEagerHydrationData==null?n.mutableSourceEagerHydrationData=[t,i]:n.mutableSourceEagerHydrationData.push(t,i)}this._internalRoot=n}ml.prototype.render=function(e){Ei(e,this._internalRoot,null,null)};ml.prototype.unmount=function(){var e=this._internalRoot,t=e.containerInfo;Ei(null,e,null,function(){t[cn]=null})};function Er(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11&&(e.nodeType!==8||e.nodeValue!==" react-mount-point-unstable "))}function hh(e,t){if(t||(t=e?e.nodeType===9?e.documentElement:e.firstChild:null,t=!(!t||t.nodeType!==1||!t.hasAttribute("data-reactroot"))),!t)for(var n;n=e.lastChild;)e.removeChild(n);return new ml(e,0,t?{hydrate:!0}:void 0)}function $i(e,t,n,r,i){var o=n._reactRootContainer;if(o){var s=o._internalRoot;if(typeof i=="function"){var l=i;i=function(){var u=yo(s);l.call(u)}}Ei(t,s,e,i)}else{if(o=n._reactRootContainer=hh(n,r),s=o._internalRoot,typeof i=="function"){var a=i;i=function(){var u=yo(s);a.call(u)}}df(function(){Ei(t,s,e,i)})}return yo(s)}uc=function(e){if(e.tag===13){var t=me();ot(e,4,t),hl(e,4)}};Bs=function(e){if(e.tag===13){var t=me();ot(e,67108864,t),hl(e,67108864)}};cc=function(e){if(e.tag===13){var t=me(),n=it(e);ot(e,n,t),hl(e,n)}};fc=function(e,t){return t()};Ao=function(e,t,n){switch(t){case"input":if(Co(e,n),t=n.name,n.type==="radio"&&t!=null){for(n=e;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll("input[name="+JSON.stringify(""+t)+'][type="radio"]'),t=0;t<n.length;t++){var r=n[t];if(r!==e&&r.form===e.form){var i=ji(r);if(!i)throw Error(_(90));Yu(r),Co(r,i)}}}break;case"textarea":Ju(e,n);break;case"select":t=n.value,t!=null&&Kt(e,!!n.multiple,t,!1)}};Ms=ff;oc=function(e,t,n,r,i){var o=L;L|=4;try{return Nt(98,e.bind(null,t,n,r,i))}finally{L=o,L===0&&(pn(),Me())}};$s=function(){!(L&49)&&(eh(),mt())};sc=function(e,t){var n=L;L|=2;try{return e(t)}finally{L=n,L===0&&(pn(),Me())}};function wf(e,t){var n=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!Er(t))throw Error(_(200));return dh(e,t,null,n)}var mh={Events:[wr,Ft,ji,rc,ic,mt,{current:!1}]},Ln={findFiberByHostInstance:St,bundleType:0,version:"17.0.2",rendererPackageName:"react-dom"},yh={bundleType:Ln.bundleType,version:Ln.version,rendererPackageName:Ln.rendererPackageName,rendererConfig:Ln.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:jt.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return e=ac(e),e===null?null:e.stateNode},findFiberByHostInstance:Ln.findFiberByHostInstance||ph,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Dr=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Dr.isDisabled&&Dr.supportsFiber)try{Gs=Dr.inject(yh),Rt=Dr}catch{}}Se.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=mh;Se.createPortal=wf;Se.findDOMNode=function(e){if(e==null)return null;if(e.nodeType===1)return e;var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(_(188)):Error(_(268,Object.keys(e)));return e=ac(t),e=e===null?null:e.stateNode,e};Se.flushSync=function(e,t){var n=L;if(n&48)return e(t);L|=1;try{if(e)return Nt(99,e.bind(null,t))}finally{L=n,Me()}};Se.hydrate=function(e,t,n){if(!Er(t))throw Error(_(200));return $i(null,e,t,!0,n)};Se.render=function(e,t,n){if(!Er(t))throw Error(_(200));return $i(null,e,t,!1,n)};Se.unmountComponentAtNode=function(e){if(!Er(e))throw Error(_(40));return e._reactRootContainer?(df(function(){$i(null,null,e,!1,function(){e._reactRootContainer=null,e[cn]=null})}),!0):!1};Se.unstable_batchedUpdates=ff;Se.unstable_createPortal=function(e,t){return wf(e,t,2<arguments.length&&arguments[2]!==void 0?arguments[2]:null)};Se.unstable_renderSubtreeIntoContainer=function(e,t,n,r){if(!Er(n))throw Error(_(200));if(e==null||e._reactInternals===void 0)throw Error(_(38));return $i(e,t,n,!1,r)};Se.version="17.0.2";function kf(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(kf)}catch(e){console.error(e)}}kf(),qu.exports=Se;var xf=qu.exports;const Lv=Cu(xf),gh="modulepreload",vh=function(e){return"/xenon/"+e},Ka={},V=function(t,n,r){let i=Promise.resolve();if(n&&n.length>0){document.getElementsByTagName("link");const s=document.querySelector("meta[property=csp-nonce]"),l=(s==null?void 0:s.nonce)||(s==null?void 0:s.getAttribute("nonce"));i=Promise.allSettled(n.map(a=>{if(a=vh(a),a in Ka)return;Ka[a]=!0;const u=a.endsWith(".css"),m=u?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${a}"]${m}`))return;const v=document.createElement("link");if(v.rel=u?"stylesheet":gh,u||(v.as="script"),v.crossOrigin="",v.href=a,l&&v.setAttribute("nonce",l),document.head.appendChild(v),u)return new Promise((h,E)=>{v.addEventListener("load",h),v.addEventListener("error",()=>E(new Error(`Unable to preload CSS for ${a}`)))})}))}function o(s){const l=new Event("vite:preloadError",{cancelable:!0});if(l.payload=s,window.dispatchEvent(l),!l.defaultPrevented)throw s}return i.then(s=>{for(const l of s||[])l.status==="rejected"&&o(l.reason);return t().catch(o)})};/**
|
|
43
43
|
* @remix-run/router v1.23.1
|
|
44
44
|
*
|
|
45
45
|
* Copyright (c) Remix Software Inc.
|
|
@@ -57,7 +57,7 @@ Add a <Suspense fallback=...> component higher in the tree to provide a loading
|
|
|
57
57
|
* LICENSE.md file in the root directory of this source tree.
|
|
58
58
|
*
|
|
59
59
|
* @license MIT
|
|
60
|
-
*/function hr(){return hr=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},hr.apply(this,arguments)}const kl=y.createContext(null),Hh=y.createContext(null),yt=y.createContext(null),Ui=y.createContext(null),qe=y.createContext({outlet:null,matches:[],isDataRoute:!1}),Cf=y.createContext(null);function Kh(e,t){let{relative:n}=t===void 0?{}:t;mn()||Q(!1);let{basename:r,navigator:i}=y.useContext(yt),{hash:o,pathname:s,search:l}=Rf(e,{relative:n}),a=s;return r!=="/"&&(a=s==="/"?r:lt([r,s])),i.createHref({pathname:a,search:l,hash:o})}function mn(){return y.useContext(Ui)!=null}function We(){return mn()||Q(!1),y.useContext(Ui).location}function Tf(e){y.useContext(yt).static||y.useLayoutEffect(e)}function yn(){let{isDataRoute:e}=y.useContext(qe);return e?sm():Qh()}function Qh(){mn()||Q(!1);let e=y.useContext(kl),{basename:t,future:n,navigator:r}=y.useContext(yt),{matches:i}=y.useContext(qe),{pathname:o}=We(),s=JSON.stringify(vl(i,n.v7_relativeSplatPath)),l=y.useRef(!1);return Tf(()=>{l.current=!0}),y.useCallback(function(u,m){if(m===void 0&&(m={}),!l.current)return;if(typeof u=="number"){r.go(u);return}let v=wl(u,JSON.parse(s),o,m.relative==="path");e==null&&t!=="/"&&(v.pathname=v.pathname==="/"?t:lt([t,v.pathname])),(m.replace?r.replace:r.push)(v,m.state,m)},[t,r,s,o,e])}function
|
|
60
|
+
*/function hr(){return hr=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},hr.apply(this,arguments)}const kl=y.createContext(null),Hh=y.createContext(null),yt=y.createContext(null),Ui=y.createContext(null),qe=y.createContext({outlet:null,matches:[],isDataRoute:!1}),Cf=y.createContext(null);function Kh(e,t){let{relative:n}=t===void 0?{}:t;mn()||Q(!1);let{basename:r,navigator:i}=y.useContext(yt),{hash:o,pathname:s,search:l}=Rf(e,{relative:n}),a=s;return r!=="/"&&(a=s==="/"?r:lt([r,s])),i.createHref({pathname:a,search:l,hash:o})}function mn(){return y.useContext(Ui)!=null}function We(){return mn()||Q(!1),y.useContext(Ui).location}function Tf(e){y.useContext(yt).static||y.useLayoutEffect(e)}function yn(){let{isDataRoute:e}=y.useContext(qe);return e?sm():Qh()}function Qh(){mn()||Q(!1);let e=y.useContext(kl),{basename:t,future:n,navigator:r}=y.useContext(yt),{matches:i}=y.useContext(qe),{pathname:o}=We(),s=JSON.stringify(vl(i,n.v7_relativeSplatPath)),l=y.useRef(!1);return Tf(()=>{l.current=!0}),y.useCallback(function(u,m){if(m===void 0&&(m={}),!l.current)return;if(typeof u=="number"){r.go(u);return}let v=wl(u,JSON.parse(s),o,m.relative==="path");e==null&&t!=="/"&&(v.pathname=v.pathname==="/"?t:lt([t,v.pathname])),(m.replace?r.replace:r.push)(v,m.state,m)},[t,r,s,o,e])}function jv(){let{matches:e}=y.useContext(qe),t=e[e.length-1];return t?t.params:{}}function Rf(e,t){let{relative:n}=t===void 0?{}:t,{future:r}=y.useContext(yt),{matches:i}=y.useContext(qe),{pathname:o}=We(),s=JSON.stringify(vl(i,r.v7_relativeSplatPath));return y.useMemo(()=>wl(e,JSON.parse(s),o,n==="path"),[e,s,o,n])}function Gh(e,t){return Yh(e,t)}function Yh(e,t,n,r){mn()||Q(!1);let{navigator:i}=y.useContext(yt),{matches:o}=y.useContext(qe),s=o[o.length-1],l=s?s.params:{};s&&s.pathname;let a=s?s.pathnameBase:"/";s&&s.route;let u=We(),m;if(t){var v;let c=typeof t=="string"?hn(t):t;a==="/"||(v=c.pathname)!=null&&v.startsWith(a)||Q(!1),m=c}else m=u;let h=m.pathname||"/",E=h;if(a!=="/"){let c=a.replace(/^\//,"").split("/");E="/"+h.replace(/^\//,"").split("/").slice(c.length).join("/")}let x=Eh(e,{pathname:E}),k=tm(x&&x.map(c=>Object.assign({},c,{params:Object.assign({},l,c.params),pathname:lt([a,i.encodeLocation?i.encodeLocation(c.pathname).pathname:c.pathname]),pathnameBase:c.pathnameBase==="/"?a:lt([a,i.encodeLocation?i.encodeLocation(c.pathnameBase).pathname:c.pathnameBase])})),o,n,r);return t&&k?y.createElement(Ui.Provider,{value:{location:hr({pathname:"/",search:"",hash:"",state:null,key:"default"},m),navigationType:Je.Pop}},k):k}function Xh(){let e=om(),t=qh(e)?e.status+" "+e.statusText:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null,i={padding:"0.5rem",backgroundColor:"rgba(200,200,200, 0.5)"};return y.createElement(y.Fragment,null,y.createElement("h2",null,"Unexpected Application Error!"),y.createElement("h3",{style:{fontStyle:"italic"}},t),n?y.createElement("pre",{style:i},n):null,null)}const Jh=y.createElement(Xh,null);class Zh extends y.Component{constructor(t){super(t),this.state={location:t.location,revalidation:t.revalidation,error:t.error}}static getDerivedStateFromError(t){return{error:t}}static getDerivedStateFromProps(t,n){return n.location!==t.location||n.revalidation!=="idle"&&t.revalidation==="idle"?{error:t.error,location:t.location,revalidation:t.revalidation}:{error:t.error!==void 0?t.error:n.error,location:n.location,revalidation:t.revalidation||n.revalidation}}componentDidCatch(t,n){console.error("React Router caught the following error during render",t,n)}render(){return this.state.error!==void 0?y.createElement(qe.Provider,{value:this.props.routeContext},y.createElement(Cf.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function em(e){let{routeContext:t,match:n,children:r}=e,i=y.useContext(kl);return i&&i.static&&i.staticContext&&(n.route.errorElement||n.route.ErrorBoundary)&&(i.staticContext._deepestRenderedBoundaryId=n.route.id),y.createElement(qe.Provider,{value:t},r)}function tm(e,t,n,r){var i;if(t===void 0&&(t=[]),n===void 0&&(n=null),r===void 0&&(r=null),e==null){var o;if(!n)return null;if(n.errors)e=n.matches;else if((o=r)!=null&&o.v7_partialHydration&&t.length===0&&!n.initialized&&n.matches.length>0)e=n.matches;else return null}let s=e,l=(i=n)==null?void 0:i.errors;if(l!=null){let m=s.findIndex(v=>v.route.id&&(l==null?void 0:l[v.route.id])!==void 0);m>=0||Q(!1),s=s.slice(0,Math.min(s.length,m+1))}let a=!1,u=-1;if(n&&r&&r.v7_partialHydration)for(let m=0;m<s.length;m++){let v=s[m];if((v.route.HydrateFallback||v.route.hydrateFallbackElement)&&(u=m),v.route.id){let{loaderData:h,errors:E}=n,x=v.route.loader&&h[v.route.id]===void 0&&(!E||E[v.route.id]===void 0);if(v.route.lazy||x){a=!0,u>=0?s=s.slice(0,u+1):s=[s[0]];break}}}return s.reduceRight((m,v,h)=>{let E,x=!1,k=null,c=null;n&&(E=l&&v.route.id?l[v.route.id]:void 0,k=v.route.errorElement||Jh,a&&(u<0&&h===0?(lm("route-fallback"),x=!0,c=null):u===h&&(x=!0,c=v.route.hydrateFallbackElement||null)));let f=t.concat(s.slice(0,h+1)),d=()=>{let g;return E?g=k:x?g=c:v.route.Component?g=y.createElement(v.route.Component,null):v.route.element?g=v.route.element:g=m,y.createElement(em,{match:v,routeContext:{outlet:m,matches:f,isDataRoute:n!=null},children:g})};return n&&(v.route.ErrorBoundary||v.route.errorElement||h===0)?y.createElement(Zh,{location:n.location,revalidation:n.revalidation,component:k,error:E,children:d(),routeContext:{outlet:null,matches:f,isDataRoute:!0}}):d()},null)}var Pf=function(e){return e.UseBlocker="useBlocker",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e}(Pf||{}),Nf=function(e){return e.UseBlocker="useBlocker",e.UseLoaderData="useLoaderData",e.UseActionData="useActionData",e.UseRouteError="useRouteError",e.UseNavigation="useNavigation",e.UseRouteLoaderData="useRouteLoaderData",e.UseMatches="useMatches",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e.UseRouteId="useRouteId",e}(Nf||{});function nm(e){let t=y.useContext(kl);return t||Q(!1),t}function rm(e){let t=y.useContext(Hh);return t||Q(!1),t}function im(e){let t=y.useContext(qe);return t||Q(!1),t}function Of(e){let t=im(),n=t.matches[t.matches.length-1];return n.route.id||Q(!1),n.route.id}function om(){var e;let t=y.useContext(Cf),n=rm(),r=Of();return t!==void 0?t:(e=n.errors)==null?void 0:e[r]}function sm(){let{router:e}=nm(Pf.UseNavigateStable),t=Of(Nf.UseNavigateStable),n=y.useRef(!1);return Tf(()=>{n.current=!0}),y.useCallback(function(i,o){o===void 0&&(o={}),n.current&&(typeof i=="number"?e.navigate(i):e.navigate(i,hr({fromRouteId:t},o)))},[e,t])}const Za={};function lm(e,t,n){Za[e]||(Za[e]=!0)}function am(e,t){e==null||e.v7_startTransition,e==null||e.v7_relativeSplatPath}function Wt(e){let{to:t,replace:n,state:r,relative:i}=e;mn()||Q(!1);let{future:o,static:s}=y.useContext(yt),{matches:l}=y.useContext(qe),{pathname:a}=We(),u=yn(),m=wl(t,vl(l,o.v7_relativeSplatPath),a,i==="path"),v=JSON.stringify(m);return y.useEffect(()=>u(JSON.parse(v),{replace:n,state:r,relative:i}),[u,v,i,n,r]),null}function $(e){Q(!1)}function um(e){let{basename:t="/",children:n=null,location:r,navigationType:i=Je.Pop,navigator:o,static:s=!1,future:l}=e;mn()&&Q(!1);let a=t.replace(/^\/*/,"/"),u=y.useMemo(()=>({basename:a,navigator:o,static:s,future:hr({v7_relativeSplatPath:!1},l)}),[a,l,o,s]);typeof r=="string"&&(r=hn(r));let{pathname:m="/",search:v="",hash:h="",state:E=null,key:x="default"}=r,k=y.useMemo(()=>{let c=gl(m,a);return c==null?null:{location:{pathname:c,search:v,hash:h,state:E,key:x},navigationType:i}},[a,m,v,h,E,x,i]);return k==null?null:y.createElement(yt.Provider,{value:u},y.createElement(Ui.Provider,{children:n,value:k}))}function Lf(e){let{children:t,location:n}=e;return Gh(cs(t),n)}new Promise(()=>{});function cs(e,t){t===void 0&&(t=[]);let n=[];return y.Children.forEach(e,(r,i)=>{if(!y.isValidElement(r))return;let o=[...t,i];if(r.type===y.Fragment){n.push.apply(n,cs(r.props.children,o));return}r.type!==$&&Q(!1),!r.props.index||!r.props.children||Q(!1);let s={id:r.props.id||o.join("-"),caseSensitive:r.props.caseSensitive,element:r.props.element,Component:r.props.Component,index:r.props.index,path:r.props.path,loader:r.props.loader,action:r.props.action,errorElement:r.props.errorElement,ErrorBoundary:r.props.ErrorBoundary,hasErrorBoundary:r.props.ErrorBoundary!=null||r.props.errorElement!=null,shouldRevalidate:r.props.shouldRevalidate,handle:r.props.handle,lazy:r.props.lazy};r.props.children&&(s.children=cs(r.props.children,o)),n.push(s)}),n}/**
|
|
61
61
|
* React Router DOM v6.30.2
|
|
62
62
|
*
|
|
63
63
|
* Copyright (c) Remix Software Inc.
|
|
@@ -66,7 +66,7 @@ Add a <Suspense fallback=...> component higher in the tree to provide a loading
|
|
|
66
66
|
* LICENSE.md file in the root directory of this source tree.
|
|
67
67
|
*
|
|
68
68
|
* @license MIT
|
|
69
|
-
*/function fs(){return fs=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},fs.apply(this,arguments)}function cm(e,t){if(e==null)return{};var n={},r=Object.keys(e),i,o;for(o=0;o<r.length;o++)i=r[o],!(t.indexOf(i)>=0)&&(n[i]=e[i]);return n}function fm(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function dm(e,t){return e.button===0&&(!t||t==="_self")&&!fm(e)}function ds(e){return e===void 0&&(e=""),new URLSearchParams(typeof e=="string"||Array.isArray(e)||e instanceof URLSearchParams?e:Object.keys(e).reduce((t,n)=>{let r=e[n];return t.concat(Array.isArray(r)?r.map(i=>[n,i]):[[n,r]])},[]))}function pm(e,t){let n=ds(e);return t&&t.forEach((r,i)=>{n.has(i)||t.getAll(i).forEach(o=>{n.append(i,o)})}),n}const hm=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","viewTransition"],mm="6";try{window.__reactRouterVersion=mm}catch{}const ym="startTransition",eu=yd[ym];function gm(e){let{basename:t,children:n,future:r,window:i}=e,o=y.useRef();o.current==null&&(o.current=wh({window:i,v5Compat:!0}));let s=o.current,[l,a]=y.useState({action:s.action,location:s.location}),{v7_startTransition:u}=r||{},m=y.useCallback(v=>{u&&eu?eu(()=>a(v)):a(v)},[a,u]);return y.useLayoutEffect(()=>s.listen(m),[s,m]),y.useEffect(()=>am(r),[r]),y.createElement(um,{basename:t,children:n,location:l.location,navigationType:l.action,navigator:s,future:r})}const vm=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",wm=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,
|
|
69
|
+
*/function fs(){return fs=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},fs.apply(this,arguments)}function cm(e,t){if(e==null)return{};var n={},r=Object.keys(e),i,o;for(o=0;o<r.length;o++)i=r[o],!(t.indexOf(i)>=0)&&(n[i]=e[i]);return n}function fm(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function dm(e,t){return e.button===0&&(!t||t==="_self")&&!fm(e)}function ds(e){return e===void 0&&(e=""),new URLSearchParams(typeof e=="string"||Array.isArray(e)||e instanceof URLSearchParams?e:Object.keys(e).reduce((t,n)=>{let r=e[n];return t.concat(Array.isArray(r)?r.map(i=>[n,i]):[[n,r]])},[]))}function pm(e,t){let n=ds(e);return t&&t.forEach((r,i)=>{n.has(i)||t.getAll(i).forEach(o=>{n.append(i,o)})}),n}const hm=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","viewTransition"],mm="6";try{window.__reactRouterVersion=mm}catch{}const ym="startTransition",eu=yd[ym];function gm(e){let{basename:t,children:n,future:r,window:i}=e,o=y.useRef();o.current==null&&(o.current=wh({window:i,v5Compat:!0}));let s=o.current,[l,a]=y.useState({action:s.action,location:s.location}),{v7_startTransition:u}=r||{},m=y.useCallback(v=>{u&&eu?eu(()=>a(v)):a(v)},[a,u]);return y.useLayoutEffect(()=>s.listen(m),[s,m]),y.useEffect(()=>am(r),[r]),y.createElement(um,{basename:t,children:n,location:l.location,navigationType:l.action,navigator:s,future:r})}const vm=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",wm=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Av=y.forwardRef(function(t,n){let{onClick:r,relative:i,reloadDocument:o,replace:s,state:l,target:a,to:u,preventScrollReset:m,viewTransition:v}=t,h=cm(t,hm),{basename:E}=y.useContext(yt),x,k=!1;if(typeof u=="string"&&wm.test(u)&&(x=u,vm))try{let g=new URL(window.location.href),w=u.startsWith("//")?new URL(g.protocol+u):new URL(u),P=gl(w.pathname,E);w.origin===g.origin&&P!=null?u=P+w.search+w.hash:k=!0}catch{}let c=Kh(u,{relative:i}),f=km(u,{replace:s,state:l,target:a,preventScrollReset:m,relative:i,viewTransition:v});function d(g){r&&r(g),g.defaultPrevented||f(g)}return y.createElement("a",fs({},h,{href:x||c,onClick:k||o?r:d,ref:n,target:a}))});var tu;(function(e){e.UseScrollRestoration="useScrollRestoration",e.UseSubmit="useSubmit",e.UseSubmitFetcher="useSubmitFetcher",e.UseFetcher="useFetcher",e.useViewTransitionState="useViewTransitionState"})(tu||(tu={}));var nu;(function(e){e.UseFetcher="useFetcher",e.UseFetchers="useFetchers",e.UseScrollRestoration="useScrollRestoration"})(nu||(nu={}));function km(e,t){let{target:n,replace:r,state:i,preventScrollReset:o,relative:s,viewTransition:l}=t===void 0?{}:t,a=yn(),u=We(),m=Rf(e,{relative:s});return y.useCallback(v=>{if(dm(v,n)){v.preventDefault();let h=r!==void 0?r:_i(u)===_i(m);a(e,{replace:h,state:i,preventScrollReset:o,relative:s,viewTransition:l})}},[u,a,m,r,i,n,e,o,s,l])}function Iv(e){let t=y.useRef(ds(e)),n=y.useRef(!1),r=We(),i=y.useMemo(()=>pm(r.search,n.current?null:t.current),[r.search]),o=yn(),s=y.useCallback((l,a)=>{const u=ds(typeof l=="function"?l(i):l);n.current=!0,o("?"+u,a)},[o,i]);return[i,s]}/**
|
|
70
70
|
* @license lucide-react v0.555.0 - ISC
|
|
71
71
|
*
|
|
72
72
|
* This source code is licensed under the ISC license.
|
|
@@ -216,4 +216,4 @@ Add a <Suspense fallback=...> component higher in the tree to provide a loading
|
|
|
216
216
|
*
|
|
217
217
|
* This source code is licensed under the ISC license.
|
|
218
218
|
* See the LICENSE file in the root directory of this source tree.
|
|
219
|
-
*/const ky=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],xy=B("x",ky),Bi={"X-Appium-Is-Sensitive":"true"},gt="/xenon/api/auth";class iu extends Error{constructor(t,n,r=null){super(t),this.status=n,this.retryAfterSec=r,this.name="LoginError"}}async function Iv(e,t){let n;try{n=await fetch(`${gt}/login`,{method:"POST",credentials:"include",headers:{"Content-Type":"application/json",...Bi},body:JSON.stringify({email:e,password:t})})}catch(r){throw new iu(r.message||"Network error",0)}if(!n.ok){const r=await n.json().catch(()=>({})),i=Number(n.headers.get("Retry-After"));throw new iu(r.error||`Login failed (${n.status})`,n.status,Number.isFinite(i)&&i>0?i:null)}}async function Dv(){try{const e=await fetch(`${gt}/options`,{credentials:"include"});return e.ok?{passwordReset:(await e.json()).passwordReset==="email"?"email":"admin"}:{passwordReset:"admin"}}catch{return{passwordReset:"admin"}}}async function Ey(){await fetch(`${gt}/logout`,{method:"POST",credentials:"include"})}async function _y(){const e=await fetch(`${gt}/me`,{credentials:"include"});if(e.status===401)return null;if(!e.ok)throw new Error(`Failed to fetch /me (${e.status})`);return e.json()}async function Mv(e,t){const n=await fetch(`${gt}/change-password`,{method:"POST",credentials:"include",headers:{"Content-Type":"application/json",...Bi},body:JSON.stringify({oldPassword:e,newPassword:t})});if(!n.ok){const r=await n.json().catch(()=>({}));throw new Error(r.error||`Change password failed (${n.status})`)}}async function $v(e){const t=await fetch(`${gt}/forgot-password`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({email:e})});if(!t.ok&&t.status!==204)throw t.status===429?new Error("Too many attempts — try again later."):new Error(`Request failed (${t.status})`)}async function Uv(e){return(await fetch(`${gt}/reset-password/check`,{method:"POST",headers:{"Content-Type":"application/json",...Bi},body:JSON.stringify({token:e})})).ok}async function Bv(e,t){const n=await fetch(`${gt}/reset-password`,{method:"POST",headers:{"Content-Type":"application/json",...Bi},body:JSON.stringify({token:e,newPassword:t})});if(!n.ok&&n.status!==204){const r=await n.json().catch(()=>({}));throw new Error(r.error||`Reset failed (${n.status})`)}}const Df="xenon-screenshots",He="captures",ps="udid";function Mf(e,t){return t.takenAt-e.takenAt||t.n-e.n}function ou(){const e=new Map;return{persistent:!1,async list(t){return Array.from(e.values()).filter(n=>n.udid===t).sort(Mf)},async put(t){e.set(t.id,t)},async delete(t){t.forEach(n=>e.delete(n))},async clear(t){Array.from(e.values()).filter(n=>n.udid===t).forEach(n=>e.delete(n.id))}}}function su(e){return new Promise((t,n)=>{e.onsuccess=()=>t(e.result),e.onerror=()=>n(e.error)})}function lu(e){return new Promise((t,n)=>{e.oncomplete=()=>t(),e.onerror=()=>n(e.error),e.onabort=()=>n(e.error??new Error("transaction aborted"))})}function Sy(e){return new Promise((t,n)=>{const r=e.open(Df,1);r.onupgradeneeded=()=>{r.result.createObjectStore(He,{keyPath:"id"}).createIndex(ps,"udid")},r.onsuccess=()=>{const i=r.result;i.onversionchange=()=>i.close(),t(i)},r.onerror=()=>n(r.error),r.onblocked=()=>n(new Error("blocked"))})}function Cy(e){const t=async n=>{const r=e.transaction(He,"readwrite");n(r.objectStore(He)),await lu(r)};return{persistent:!0,async list(n){const r=e.transaction(He,"readonly");return(await su(r.objectStore(He).index(ps).getAll(n))).sort(Mf)},put:n=>t(r=>r.put(n)),delete:n=>t(r=>n.forEach(i=>r.delete(i))),async clear(n){const r=e.transaction(He,"readwrite"),i=r.objectStore(He).index(ps);(await su(i.getAllKeys(n))).forEach(s=>r.objectStore(He).delete(s)),await lu(r)}}}function $f(){try{return typeof indexedDB>"u"?void 0:indexedDB}catch{return}}async function Ty(e=$f()){if(!e)return ou();try{return Cy(await Sy(e))}catch{return ou()}}let Gr=null;function zv(){return Gr||(Gr=Ty()),Gr}async function Ry(e=$f(),t=1e3){if(Gr=null,!e)return;const n=new Promise(r=>{try{const i=e.deleteDatabase(Df);i.onsuccess=()=>r(),i.onerror=()=>r(),i.onblocked=()=>r()}catch{r()}});await Promise.race([n,new Promise(r=>setTimeout(r,t))])}const xl="xenon.hadSession";function Py(){try{localStorage.setItem(xl,"1")}catch{}}function Ny(){try{localStorage.removeItem(xl)}catch{}}function Oy(){try{return localStorage.getItem(xl)==="1"}catch{return!1}}const Uf=y.createContext(null);function Ly({children:e}){const[t,n]=y.useState(!0),[r,i]=y.useState(null);async function o(){try{const l=await _y();l&&Py(),i(l)}finally{n(!1)}}async function s(){Ny(),await Promise.all([Ey(),Ry()]),i(null),window.location.href="/xenon/login"}return y.useEffect(()=>{o()},[]),p.jsx(Uf.Provider,{value:{loading:t,me:r,refresh:o,signOut:s},children:e})}function El(){const e=y.useContext(Uf);if(!e)throw new Error("useAuth must be used inside AuthProvider");return e}const De=Object.create(null);De.open="0";De.close="1";De.ping="2";De.pong="3";De.message="4";De.upgrade="5";De.noop="6";const Yr=Object.create(null);Object.keys(De).forEach(e=>{Yr[De[e]]=e});const hs={type:"error",data:"parser error"},Bf=typeof Blob=="function"||typeof Blob<"u"&&Object.prototype.toString.call(Blob)==="[object BlobConstructor]",zf=typeof ArrayBuffer=="function",bf=e=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(e):e&&e.buffer instanceof ArrayBuffer,_l=({type:e,data:t},n,r)=>Bf&&t instanceof Blob?n?r(t):au(t,r):zf&&(t instanceof ArrayBuffer||bf(t))?n?r(t):au(new Blob([t]),r):r(De[e]+(t||"")),au=(e,t)=>{const n=new FileReader;return n.onload=function(){const r=n.result.split(",")[1];t("b"+(r||""))},n.readAsDataURL(e)};function uu(e){return e instanceof Uint8Array?e:e instanceof ArrayBuffer?new Uint8Array(e):new Uint8Array(e.buffer,e.byteOffset,e.byteLength)}let vo;function jy(e,t){if(Bf&&e.data instanceof Blob)return e.data.arrayBuffer().then(uu).then(t);if(zf&&(e.data instanceof ArrayBuffer||bf(e.data)))return t(uu(e.data));_l(e,!1,n=>{vo||(vo=new TextEncoder),t(vo.encode(n))})}const cu="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Bn=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(let e=0;e<cu.length;e++)Bn[cu.charCodeAt(e)]=e;const Ay=e=>{let t=e.length*.75,n=e.length,r,i=0,o,s,l,a;e[e.length-1]==="="&&(t--,e[e.length-2]==="="&&t--);const u=new ArrayBuffer(t),m=new Uint8Array(u);for(r=0;r<n;r+=4)o=Bn[e.charCodeAt(r)],s=Bn[e.charCodeAt(r+1)],l=Bn[e.charCodeAt(r+2)],a=Bn[e.charCodeAt(r+3)],m[i++]=o<<2|s>>4,m[i++]=(s&15)<<4|l>>2,m[i++]=(l&3)<<6|a&63;return u},Iy=typeof ArrayBuffer=="function",Sl=(e,t)=>{if(typeof e!="string")return{type:"message",data:Ff(e,t)};const n=e.charAt(0);return n==="b"?{type:"message",data:Dy(e.substring(1),t)}:Yr[n]?e.length>1?{type:Yr[n],data:e.substring(1)}:{type:Yr[n]}:hs},Dy=(e,t)=>{if(Iy){const n=Ay(e);return Ff(n,t)}else return{base64:!0,data:e}},Ff=(e,t)=>{switch(t){case"blob":return e instanceof Blob?e:new Blob([e]);case"arraybuffer":default:return e instanceof ArrayBuffer?e:e.buffer}},Vf="",My=(e,t)=>{const n=e.length,r=new Array(n);let i=0;e.forEach((o,s)=>{_l(o,!1,l=>{r[s]=l,++i===n&&t(r.join(Vf))})})},$y=(e,t)=>{const n=e.split(Vf),r=[];for(let i=0;i<n.length;i++){const o=Sl(n[i],t);if(r.push(o),o.type==="error")break}return r};function Uy(){return new TransformStream({transform(e,t){jy(e,n=>{const r=n.length;let i;if(r<126)i=new Uint8Array(1),new DataView(i.buffer).setUint8(0,r);else if(r<65536){i=new Uint8Array(3);const o=new DataView(i.buffer);o.setUint8(0,126),o.setUint16(1,r)}else{i=new Uint8Array(9);const o=new DataView(i.buffer);o.setUint8(0,127),o.setBigUint64(1,BigInt(r))}e.data&&typeof e.data!="string"&&(i[0]|=128),t.enqueue(i),t.enqueue(n)})}})}let wo;function Mr(e){return e.reduce((t,n)=>t+n.length,0)}function $r(e,t){if(e[0].length===t)return e.shift();const n=new Uint8Array(t);let r=0;for(let i=0;i<t;i++)n[i]=e[0][r++],r===e[0].length&&(e.shift(),r=0);return e.length&&r<e[0].length&&(e[0]=e[0].slice(r)),n}function By(e,t){wo||(wo=new TextDecoder);const n=[];let r=0,i=-1,o=!1;return new TransformStream({transform(s,l){for(n.push(s);;){if(r===0){if(Mr(n)<1)break;const a=$r(n,1);o=(a[0]&128)===128,i=a[0]&127,i<126?r=3:i===126?r=1:r=2}else if(r===1){if(Mr(n)<2)break;const a=$r(n,2);i=new DataView(a.buffer,a.byteOffset,a.length).getUint16(0),r=3}else if(r===2){if(Mr(n)<8)break;const a=$r(n,8),u=new DataView(a.buffer,a.byteOffset,a.length),m=u.getUint32(0);if(m>Math.pow(2,21)-1){l.enqueue(hs);break}i=m*Math.pow(2,32)+u.getUint32(4),r=3}else{if(Mr(n)<i)break;const a=$r(n,i);l.enqueue(Sl(o?a:wo.decode(a),t)),r=0}if(i===0||i>e){l.enqueue(hs);break}}}})}const qf=4;function G(e){if(e)return zy(e)}function zy(e){for(var t in G.prototype)e[t]=G.prototype[t];return e}G.prototype.on=G.prototype.addEventListener=function(e,t){return this._callbacks=this._callbacks||{},(this._callbacks["$"+e]=this._callbacks["$"+e]||[]).push(t),this};G.prototype.once=function(e,t){function n(){this.off(e,n),t.apply(this,arguments)}return n.fn=t,this.on(e,n),this};G.prototype.off=G.prototype.removeListener=G.prototype.removeAllListeners=G.prototype.removeEventListener=function(e,t){if(this._callbacks=this._callbacks||{},arguments.length==0)return this._callbacks={},this;var n=this._callbacks["$"+e];if(!n)return this;if(arguments.length==1)return delete this._callbacks["$"+e],this;for(var r,i=0;i<n.length;i++)if(r=n[i],r===t||r.fn===t){n.splice(i,1);break}return n.length===0&&delete this._callbacks["$"+e],this};G.prototype.emit=function(e){this._callbacks=this._callbacks||{};for(var t=new Array(arguments.length-1),n=this._callbacks["$"+e],r=1;r<arguments.length;r++)t[r-1]=arguments[r];if(n){n=n.slice(0);for(var r=0,i=n.length;r<i;++r)n[r].apply(this,t)}return this};G.prototype.emitReserved=G.prototype.emit;G.prototype.listeners=function(e){return this._callbacks=this._callbacks||{},this._callbacks["$"+e]||[]};G.prototype.hasListeners=function(e){return!!this.listeners(e).length};const zi=typeof Promise=="function"&&typeof Promise.resolve=="function"?t=>Promise.resolve().then(t):(t,n)=>n(t,0),ve=typeof self<"u"?self:typeof window<"u"?window:Function("return this")(),by="arraybuffer";function Wf(e,...t){return t.reduce((n,r)=>(e.hasOwnProperty(r)&&(n[r]=e[r]),n),{})}const Fy=ve.setTimeout,Vy=ve.clearTimeout;function bi(e,t){t.useNativeTimers?(e.setTimeoutFn=Fy.bind(ve),e.clearTimeoutFn=Vy.bind(ve)):(e.setTimeoutFn=ve.setTimeout.bind(ve),e.clearTimeoutFn=ve.clearTimeout.bind(ve))}const qy=1.33;function Wy(e){return typeof e=="string"?Hy(e):Math.ceil((e.byteLength||e.size)*qy)}function Hy(e){let t=0,n=0;for(let r=0,i=e.length;r<i;r++)t=e.charCodeAt(r),t<128?n+=1:t<2048?n+=2:t<55296||t>=57344?n+=3:(r++,n+=4);return n}function Hf(){return Date.now().toString(36).substring(3)+Math.random().toString(36).substring(2,5)}function Ky(e){let t="";for(let n in e)e.hasOwnProperty(n)&&(t.length&&(t+="&"),t+=encodeURIComponent(n)+"="+encodeURIComponent(e[n]));return t}function Qy(e){let t={},n=e.split("&");for(let r=0,i=n.length;r<i;r++){let o=n[r].split("=");t[decodeURIComponent(o[0])]=decodeURIComponent(o[1])}return t}class Gy extends Error{constructor(t,n,r){super(t),this.description=n,this.context=r,this.type="TransportError"}}class Cl extends G{constructor(t){super(),this.writable=!1,bi(this,t),this.opts=t,this.query=t.query,this.socket=t.socket,this.supportsBinary=!t.forceBase64}onError(t,n,r){return super.emitReserved("error",new Gy(t,n,r)),this}open(){return this.readyState="opening",this.doOpen(),this}close(){return(this.readyState==="opening"||this.readyState==="open")&&(this.doClose(),this.onClose()),this}send(t){this.readyState==="open"&&this.write(t)}onOpen(){this.readyState="open",this.writable=!0,super.emitReserved("open")}onData(t){const n=Sl(t,this.socket.binaryType);this.onPacket(n)}onPacket(t){super.emitReserved("packet",t)}onClose(t){this.readyState="closed",super.emitReserved("close",t)}pause(t){}createUri(t,n={}){return t+"://"+this._hostname()+this._port()+this.opts.path+this._query(n)}_hostname(){const t=this.opts.hostname;return t.indexOf(":")===-1?t:"["+t+"]"}_port(){return this.opts.port&&(this.opts.secure&&Number(this.opts.port)!==443||!this.opts.secure&&Number(this.opts.port)!==80)?":"+this.opts.port:""}_query(t){const n=Ky(t);return n.length?"?"+n:""}}class Yy extends Cl{constructor(){super(...arguments),this._polling=!1}get name(){return"polling"}doOpen(){this._poll()}pause(t){this.readyState="pausing";const n=()=>{this.readyState="paused",t()};if(this._polling||!this.writable){let r=0;this._polling&&(r++,this.once("pollComplete",function(){--r||n()})),this.writable||(r++,this.once("drain",function(){--r||n()}))}else n()}_poll(){this._polling=!0,this.doPoll(),this.emitReserved("poll")}onData(t){const n=r=>{if(this.readyState==="opening"&&r.type==="open"&&this.onOpen(),r.type==="close")return this.onClose({description:"transport closed by the server"}),!1;this.onPacket(r)};$y(t,this.socket.binaryType).forEach(n),this.readyState!=="closed"&&(this._polling=!1,this.emitReserved("pollComplete"),this.readyState==="open"&&this._poll())}doClose(){const t=()=>{this.write([{type:"close"}])};this.readyState==="open"?t():this.once("open",t)}write(t){this.writable=!1,My(t,n=>{this.doWrite(n,()=>{this.writable=!0,this.emitReserved("drain")})})}uri(){const t=this.opts.secure?"https":"http",n=this.query||{};return this.opts.timestampRequests!==!1&&(n[this.opts.timestampParam]=Hf()),!this.supportsBinary&&!n.sid&&(n.b64=1),this.createUri(t,n)}}let Kf=!1;try{Kf=typeof XMLHttpRequest<"u"&&"withCredentials"in new XMLHttpRequest}catch{}const Xy=Kf;function Jy(){}class Zy extends Yy{constructor(t){if(super(t),typeof location<"u"){const n=location.protocol==="https:";let r=location.port;r||(r=n?"443":"80"),this.xd=typeof location<"u"&&t.hostname!==location.hostname||r!==t.port}}doWrite(t,n){const r=this.request({method:"POST",data:t});r.on("success",n),r.on("error",(i,o)=>{this.onError("xhr post error",i,o)})}doPoll(){const t=this.request();t.on("data",this.onData.bind(this)),t.on("error",(n,r)=>{this.onError("xhr poll error",n,r)}),this.pollXhr=t}}class Ie extends G{constructor(t,n,r){super(),this.createRequest=t,bi(this,r),this._opts=r,this._method=r.method||"GET",this._uri=n,this._data=r.data!==void 0?r.data:null,this._create()}_create(){var t;const n=Wf(this._opts,"agent","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","autoUnref");n.xdomain=!!this._opts.xd;const r=this._xhr=this.createRequest(n);try{r.open(this._method,this._uri,!0);try{if(this._opts.extraHeaders){r.setDisableHeaderCheck&&r.setDisableHeaderCheck(!0);for(let i in this._opts.extraHeaders)this._opts.extraHeaders.hasOwnProperty(i)&&r.setRequestHeader(i,this._opts.extraHeaders[i])}}catch{}if(this._method==="POST")try{r.setRequestHeader("Content-type","text/plain;charset=UTF-8")}catch{}try{r.setRequestHeader("Accept","*/*")}catch{}(t=this._opts.cookieJar)===null||t===void 0||t.addCookies(r),"withCredentials"in r&&(r.withCredentials=this._opts.withCredentials),this._opts.requestTimeout&&(r.timeout=this._opts.requestTimeout),r.onreadystatechange=()=>{var i;r.readyState===3&&((i=this._opts.cookieJar)===null||i===void 0||i.parseCookies(r.getResponseHeader("set-cookie"))),r.readyState===4&&(r.status===200||r.status===1223?this._onLoad():this.setTimeoutFn(()=>{this._onError(typeof r.status=="number"?r.status:0)},0))},r.send(this._data)}catch(i){this.setTimeoutFn(()=>{this._onError(i)},0);return}typeof document<"u"&&(this._index=Ie.requestsCount++,Ie.requests[this._index]=this)}_onError(t){this.emitReserved("error",t,this._xhr),this._cleanup(!0)}_cleanup(t){if(!(typeof this._xhr>"u"||this._xhr===null)){if(this._xhr.onreadystatechange=Jy,t)try{this._xhr.abort()}catch{}typeof document<"u"&&delete Ie.requests[this._index],this._xhr=null}}_onLoad(){const t=this._xhr.responseText;t!==null&&(this.emitReserved("data",t),this.emitReserved("success"),this._cleanup())}abort(){this._cleanup()}}Ie.requestsCount=0;Ie.requests={};if(typeof document<"u"){if(typeof attachEvent=="function")attachEvent("onunload",fu);else if(typeof addEventListener=="function"){const e="onpagehide"in ve?"pagehide":"unload";addEventListener(e,fu,!1)}}function fu(){for(let e in Ie.requests)Ie.requests.hasOwnProperty(e)&&Ie.requests[e].abort()}const eg=function(){const e=Qf({xdomain:!1});return e&&e.responseType!==null}();class tg extends Zy{constructor(t){super(t);const n=t&&t.forceBase64;this.supportsBinary=eg&&!n}request(t={}){return Object.assign(t,{xd:this.xd},this.opts),new Ie(Qf,this.uri(),t)}}function Qf(e){const t=e.xdomain;try{if(typeof XMLHttpRequest<"u"&&(!t||Xy))return new XMLHttpRequest}catch{}if(!t)try{return new ve[["Active"].concat("Object").join("X")]("Microsoft.XMLHTTP")}catch{}}const Gf=typeof navigator<"u"&&typeof navigator.product=="string"&&navigator.product.toLowerCase()==="reactnative";class ng extends Cl{get name(){return"websocket"}doOpen(){const t=this.uri(),n=this.opts.protocols,r=Gf?{}:Wf(this.opts,"agent","perMessageDeflate","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","localAddress","protocolVersion","origin","maxPayload","family","checkServerIdentity");this.opts.extraHeaders&&(r.headers=this.opts.extraHeaders);try{this.ws=this.createSocket(t,n,r)}catch(i){return this.emitReserved("error",i)}this.ws.binaryType=this.socket.binaryType,this.addEventListeners()}addEventListeners(){this.ws.onopen=()=>{this.opts.autoUnref&&this.ws._socket.unref(),this.onOpen()},this.ws.onclose=t=>this.onClose({description:"websocket connection closed",context:t}),this.ws.onmessage=t=>this.onData(t.data),this.ws.onerror=t=>this.onError("websocket error",t)}write(t){this.writable=!1;for(let n=0;n<t.length;n++){const r=t[n],i=n===t.length-1;_l(r,this.supportsBinary,o=>{try{this.doWrite(r,o)}catch{}i&&zi(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){typeof this.ws<"u"&&(this.ws.onerror=()=>{},this.ws.close(),this.ws=null)}uri(){const t=this.opts.secure?"wss":"ws",n=this.query||{};return this.opts.timestampRequests&&(n[this.opts.timestampParam]=Hf()),this.supportsBinary||(n.b64=1),this.createUri(t,n)}}const ko=ve.WebSocket||ve.MozWebSocket;class rg extends ng{createSocket(t,n,r){return Gf?new ko(t,n,r):n?new ko(t,n):new ko(t)}doWrite(t,n){this.ws.send(n)}}class ig extends Cl{get name(){return"webtransport"}doOpen(){try{this._transport=new WebTransport(this.createUri("https"),this.opts.transportOptions[this.name])}catch(t){return this.emitReserved("error",t)}this._transport.closed.then(()=>{this.onClose()}).catch(t=>{this.onError("webtransport error",t)}),this._transport.ready.then(()=>{this._transport.createBidirectionalStream().then(t=>{const n=By(Number.MAX_SAFE_INTEGER,this.socket.binaryType),r=t.readable.pipeThrough(n).getReader(),i=Uy();i.readable.pipeTo(t.writable),this._writer=i.writable.getWriter();const o=()=>{r.read().then(({done:l,value:a})=>{l||(this.onPacket(a),o())}).catch(l=>{})};o();const s={type:"open"};this.query.sid&&(s.data=`{"sid":"${this.query.sid}"}`),this._writer.write(s).then(()=>this.onOpen())})})}write(t){this.writable=!1;for(let n=0;n<t.length;n++){const r=t[n],i=n===t.length-1;this._writer.write(r).then(()=>{i&&zi(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){var t;(t=this._transport)===null||t===void 0||t.close()}}const og={websocket:rg,webtransport:ig,polling:tg},sg=/^(?:(?![^:@\/?#]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@\/?#]*)(?::([^:@\/?#]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,lg=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"];function ms(e){if(e.length>8e3)throw"URI too long";const t=e,n=e.indexOf("["),r=e.indexOf("]");n!=-1&&r!=-1&&(e=e.substring(0,n)+e.substring(n,r).replace(/:/g,";")+e.substring(r,e.length));let i=sg.exec(e||""),o={},s=14;for(;s--;)o[lg[s]]=i[s]||"";return n!=-1&&r!=-1&&(o.source=t,o.host=o.host.substring(1,o.host.length-1).replace(/;/g,":"),o.authority=o.authority.replace("[","").replace("]","").replace(/;/g,":"),o.ipv6uri=!0),o.pathNames=ag(o,o.path),o.queryKey=ug(o,o.query),o}function ag(e,t){const n=/\/{2,9}/g,r=t.replace(n,"/").split("/");return(t.slice(0,1)=="/"||t.length===0)&&r.splice(0,1),t.slice(-1)=="/"&&r.splice(r.length-1,1),r}function ug(e,t){const n={};return t.replace(/(?:^|&)([^&=]*)=?([^&]*)/g,function(r,i,o){i&&(n[i]=o)}),n}const ys=typeof addEventListener=="function"&&typeof removeEventListener=="function",Xr=[];ys&&addEventListener("offline",()=>{Xr.forEach(e=>e())},!1);class at extends G{constructor(t,n){if(super(),this.binaryType=by,this.writeBuffer=[],this._prevBufferLen=0,this._pingInterval=-1,this._pingTimeout=-1,this._maxPayload=-1,this._pingTimeoutTime=1/0,t&&typeof t=="object"&&(n=t,t=null),t){const r=ms(t);n.hostname=r.host,n.secure=r.protocol==="https"||r.protocol==="wss",n.port=r.port,r.query&&(n.query=r.query)}else n.host&&(n.hostname=ms(n.host).host);bi(this,n),this.secure=n.secure!=null?n.secure:typeof location<"u"&&location.protocol==="https:",n.hostname&&!n.port&&(n.port=this.secure?"443":"80"),this.hostname=n.hostname||(typeof location<"u"?location.hostname:"localhost"),this.port=n.port||(typeof location<"u"&&location.port?location.port:this.secure?"443":"80"),this.transports=[],this._transportsByName={},n.transports.forEach(r=>{const i=r.prototype.name;this.transports.push(i),this._transportsByName[i]=r}),this.opts=Object.assign({path:"/engine.io",agent:!1,withCredentials:!1,upgrade:!0,timestampParam:"t",rememberUpgrade:!1,addTrailingSlash:!0,rejectUnauthorized:!0,perMessageDeflate:{threshold:1024},transportOptions:{},closeOnBeforeunload:!1},n),this.opts.path=this.opts.path.replace(/\/$/,"")+(this.opts.addTrailingSlash?"/":""),typeof this.opts.query=="string"&&(this.opts.query=Qy(this.opts.query)),ys&&(this.opts.closeOnBeforeunload&&(this._beforeunloadEventListener=()=>{this.transport&&(this.transport.removeAllListeners(),this.transport.close())},addEventListener("beforeunload",this._beforeunloadEventListener,!1)),this.hostname!=="localhost"&&(this._offlineEventListener=()=>{this._onClose("transport close",{description:"network connection lost"})},Xr.push(this._offlineEventListener))),this.opts.withCredentials&&(this._cookieJar=void 0),this._open()}createTransport(t){const n=Object.assign({},this.opts.query);n.EIO=qf,n.transport=t,this.id&&(n.sid=this.id);const r=Object.assign({},this.opts,{query:n,socket:this,hostname:this.hostname,secure:this.secure,port:this.port},this.opts.transportOptions[t]);return new this._transportsByName[t](r)}_open(){if(this.transports.length===0){this.setTimeoutFn(()=>{this.emitReserved("error","No transports available")},0);return}const t=this.opts.rememberUpgrade&&at.priorWebsocketSuccess&&this.transports.indexOf("websocket")!==-1?"websocket":this.transports[0];this.readyState="opening";const n=this.createTransport(t);n.open(),this.setTransport(n)}setTransport(t){this.transport&&this.transport.removeAllListeners(),this.transport=t,t.on("drain",this._onDrain.bind(this)).on("packet",this._onPacket.bind(this)).on("error",this._onError.bind(this)).on("close",n=>this._onClose("transport close",n))}onOpen(){this.readyState="open",at.priorWebsocketSuccess=this.transport.name==="websocket",this.emitReserved("open"),this.flush()}_onPacket(t){if(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing")switch(this.emitReserved("packet",t),this.emitReserved("heartbeat"),t.type){case"open":this.onHandshake(JSON.parse(t.data));break;case"ping":this._sendPacket("pong"),this.emitReserved("ping"),this.emitReserved("pong"),this._resetPingTimeout();break;case"error":const n=new Error("server error");n.code=t.data,this._onError(n);break;case"message":this.emitReserved("data",t.data),this.emitReserved("message",t.data);break}}onHandshake(t){this.emitReserved("handshake",t),this.id=t.sid,this.transport.query.sid=t.sid,this._pingInterval=t.pingInterval,this._pingTimeout=t.pingTimeout,this._maxPayload=t.maxPayload,this.onOpen(),this.readyState!=="closed"&&this._resetPingTimeout()}_resetPingTimeout(){this.clearTimeoutFn(this._pingTimeoutTimer);const t=this._pingInterval+this._pingTimeout;this._pingTimeoutTime=Date.now()+t,this._pingTimeoutTimer=this.setTimeoutFn(()=>{this._onClose("ping timeout")},t),this.opts.autoUnref&&this._pingTimeoutTimer.unref()}_onDrain(){this.writeBuffer.splice(0,this._prevBufferLen),this._prevBufferLen=0,this.writeBuffer.length===0?this.emitReserved("drain"):this.flush()}flush(){if(this.readyState!=="closed"&&this.transport.writable&&!this.upgrading&&this.writeBuffer.length){const t=this._getWritablePackets();this.transport.send(t),this._prevBufferLen=t.length,this.emitReserved("flush")}}_getWritablePackets(){if(!(this._maxPayload&&this.transport.name==="polling"&&this.writeBuffer.length>1))return this.writeBuffer;let n=1;for(let r=0;r<this.writeBuffer.length;r++){const i=this.writeBuffer[r].data;if(i&&(n+=Wy(i)),r>0&&n>this._maxPayload)return this.writeBuffer.slice(0,r);n+=2}return this.writeBuffer}_hasPingExpired(){if(!this._pingTimeoutTime)return!0;const t=Date.now()>this._pingTimeoutTime;return t&&(this._pingTimeoutTime=0,zi(()=>{this._onClose("ping timeout")},this.setTimeoutFn)),t}write(t,n,r){return this._sendPacket("message",t,n,r),this}send(t,n,r){return this._sendPacket("message",t,n,r),this}_sendPacket(t,n,r,i){if(typeof n=="function"&&(i=n,n=void 0),typeof r=="function"&&(i=r,r=null),this.readyState==="closing"||this.readyState==="closed")return;r=r||{},r.compress=r.compress!==!1;const o={type:t,data:n,options:r};this.emitReserved("packetCreate",o),this.writeBuffer.push(o),i&&this.once("flush",i),this.flush()}close(){const t=()=>{this._onClose("forced close"),this.transport.close()},n=()=>{this.off("upgrade",n),this.off("upgradeError",n),t()},r=()=>{this.once("upgrade",n),this.once("upgradeError",n)};return(this.readyState==="opening"||this.readyState==="open")&&(this.readyState="closing",this.writeBuffer.length?this.once("drain",()=>{this.upgrading?r():t()}):this.upgrading?r():t()),this}_onError(t){if(at.priorWebsocketSuccess=!1,this.opts.tryAllTransports&&this.transports.length>1&&this.readyState==="opening")return this.transports.shift(),this._open();this.emitReserved("error",t),this._onClose("transport error",t)}_onClose(t,n){if(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing"){if(this.clearTimeoutFn(this._pingTimeoutTimer),this.transport.removeAllListeners("close"),this.transport.close(),this.transport.removeAllListeners(),ys&&(this._beforeunloadEventListener&&removeEventListener("beforeunload",this._beforeunloadEventListener,!1),this._offlineEventListener)){const r=Xr.indexOf(this._offlineEventListener);r!==-1&&Xr.splice(r,1)}this.readyState="closed",this.id=null,this.emitReserved("close",t,n),this.writeBuffer=[],this._prevBufferLen=0}}}at.protocol=qf;class cg extends at{constructor(){super(...arguments),this._upgrades=[]}onOpen(){if(super.onOpen(),this.readyState==="open"&&this.opts.upgrade)for(let t=0;t<this._upgrades.length;t++)this._probe(this._upgrades[t])}_probe(t){let n=this.createTransport(t),r=!1;at.priorWebsocketSuccess=!1;const i=()=>{r||(n.send([{type:"ping",data:"probe"}]),n.once("packet",v=>{if(!r)if(v.type==="pong"&&v.data==="probe"){if(this.upgrading=!0,this.emitReserved("upgrading",n),!n)return;at.priorWebsocketSuccess=n.name==="websocket",this.transport.pause(()=>{r||this.readyState!=="closed"&&(m(),this.setTransport(n),n.send([{type:"upgrade"}]),this.emitReserved("upgrade",n),n=null,this.upgrading=!1,this.flush())})}else{const h=new Error("probe error");h.transport=n.name,this.emitReserved("upgradeError",h)}}))};function o(){r||(r=!0,m(),n.close(),n=null)}const s=v=>{const h=new Error("probe error: "+v);h.transport=n.name,o(),this.emitReserved("upgradeError",h)};function l(){s("transport closed")}function a(){s("socket closed")}function u(v){n&&v.name!==n.name&&o()}const m=()=>{n.removeListener("open",i),n.removeListener("error",s),n.removeListener("close",l),this.off("close",a),this.off("upgrading",u)};n.once("open",i),n.once("error",s),n.once("close",l),this.once("close",a),this.once("upgrading",u),this._upgrades.indexOf("webtransport")!==-1&&t!=="webtransport"?this.setTimeoutFn(()=>{r||n.open()},200):n.open()}onHandshake(t){this._upgrades=this._filterUpgrades(t.upgrades),super.onHandshake(t)}_filterUpgrades(t){const n=[];for(let r=0;r<t.length;r++)~this.transports.indexOf(t[r])&&n.push(t[r]);return n}}let fg=class extends cg{constructor(t,n={}){const r=typeof t=="object"?t:n;(!r.transports||r.transports&&typeof r.transports[0]=="string")&&(r.transports=(r.transports||["polling","websocket","webtransport"]).map(i=>og[i]).filter(i=>!!i)),super(t,r)}};function dg(e,t="",n){let r=e;n=n||typeof location<"u"&&location,e==null&&(e=n.protocol+"//"+n.host),typeof e=="string"&&(e.charAt(0)==="/"&&(e.charAt(1)==="/"?e=n.protocol+e:e=n.host+e),/^(https?|wss?):\/\//.test(e)||(typeof n<"u"?e=n.protocol+"//"+e:e="https://"+e),r=ms(e)),r.port||(/^(http|ws)$/.test(r.protocol)?r.port="80":/^(http|ws)s$/.test(r.protocol)&&(r.port="443")),r.path=r.path||"/";const o=r.host.indexOf(":")!==-1?"["+r.host+"]":r.host;return r.id=r.protocol+"://"+o+":"+r.port+t,r.href=r.protocol+"://"+o+(n&&n.port===r.port?"":":"+r.port),r}const pg=typeof ArrayBuffer=="function",hg=e=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(e):e.buffer instanceof ArrayBuffer,Yf=Object.prototype.toString,mg=typeof Blob=="function"||typeof Blob<"u"&&Yf.call(Blob)==="[object BlobConstructor]",yg=typeof File=="function"||typeof File<"u"&&Yf.call(File)==="[object FileConstructor]";function Tl(e){return pg&&(e instanceof ArrayBuffer||hg(e))||mg&&e instanceof Blob||yg&&e instanceof File}function Jr(e,t){if(!e||typeof e!="object")return!1;if(Array.isArray(e)){for(let n=0,r=e.length;n<r;n++)if(Jr(e[n]))return!0;return!1}if(Tl(e))return!0;if(e.toJSON&&typeof e.toJSON=="function"&&arguments.length===1)return Jr(e.toJSON(),!0);for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&Jr(e[n]))return!0;return!1}function gg(e){const t=[],n=e.data,r=e;return r.data=gs(n,t),r.attachments=t.length,{packet:r,buffers:t}}function gs(e,t){if(!e)return e;if(Tl(e)){const n={_placeholder:!0,num:t.length};return t.push(e),n}else if(Array.isArray(e)){const n=new Array(e.length);for(let r=0;r<e.length;r++)n[r]=gs(e[r],t);return n}else if(typeof e=="object"&&!(e instanceof Date)){const n={};for(const r in e)Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=gs(e[r],t));return n}return e}function vg(e,t){return e.data=vs(e.data,t),delete e.attachments,e}function vs(e,t){if(!e)return e;if(e&&e._placeholder===!0){if(typeof e.num=="number"&&e.num>=0&&e.num<t.length)return t[e.num];throw new Error("illegal attachments")}else if(Array.isArray(e))for(let n=0;n<e.length;n++)e[n]=vs(e[n],t);else if(typeof e=="object")for(const n in e)Object.prototype.hasOwnProperty.call(e,n)&&(e[n]=vs(e[n],t));return e}const wg=["connect","connect_error","disconnect","disconnecting","newListener","removeListener"];var D;(function(e){e[e.CONNECT=0]="CONNECT",e[e.DISCONNECT=1]="DISCONNECT",e[e.EVENT=2]="EVENT",e[e.ACK=3]="ACK",e[e.CONNECT_ERROR=4]="CONNECT_ERROR",e[e.BINARY_EVENT=5]="BINARY_EVENT",e[e.BINARY_ACK=6]="BINARY_ACK"})(D||(D={}));class kg{constructor(t){this.replacer=t}encode(t){return(t.type===D.EVENT||t.type===D.ACK)&&Jr(t)?this.encodeAsBinary({type:t.type===D.EVENT?D.BINARY_EVENT:D.BINARY_ACK,nsp:t.nsp,data:t.data,id:t.id}):[this.encodeAsString(t)]}encodeAsString(t){let n=""+t.type;return(t.type===D.BINARY_EVENT||t.type===D.BINARY_ACK)&&(n+=t.attachments+"-"),t.nsp&&t.nsp!=="/"&&(n+=t.nsp+","),t.id!=null&&(n+=t.id),t.data!=null&&(n+=JSON.stringify(t.data,this.replacer)),n}encodeAsBinary(t){const n=gg(t),r=this.encodeAsString(n.packet),i=n.buffers;return i.unshift(r),i}}class Rl extends G{constructor(t){super(),this.reviver=t}add(t){let n;if(typeof t=="string"){if(this.reconstructor)throw new Error("got plaintext data when reconstructing a packet");n=this.decodeString(t);const r=n.type===D.BINARY_EVENT;r||n.type===D.BINARY_ACK?(n.type=r?D.EVENT:D.ACK,this.reconstructor=new xg(n),n.attachments===0&&super.emitReserved("decoded",n)):super.emitReserved("decoded",n)}else if(Tl(t)||t.base64)if(this.reconstructor)n=this.reconstructor.takeBinaryData(t),n&&(this.reconstructor=null,super.emitReserved("decoded",n));else throw new Error("got binary data when not reconstructing a packet");else throw new Error("Unknown type: "+t)}decodeString(t){let n=0;const r={type:Number(t.charAt(0))};if(D[r.type]===void 0)throw new Error("unknown packet type "+r.type);if(r.type===D.BINARY_EVENT||r.type===D.BINARY_ACK){const o=n+1;for(;t.charAt(++n)!=="-"&&n!=t.length;);const s=t.substring(o,n);if(s!=Number(s)||t.charAt(n)!=="-")throw new Error("Illegal attachments");r.attachments=Number(s)}if(t.charAt(n+1)==="/"){const o=n+1;for(;++n&&!(t.charAt(n)===","||n===t.length););r.nsp=t.substring(o,n)}else r.nsp="/";const i=t.charAt(n+1);if(i!==""&&Number(i)==i){const o=n+1;for(;++n;){const s=t.charAt(n);if(s==null||Number(s)!=s){--n;break}if(n===t.length)break}r.id=Number(t.substring(o,n+1))}if(t.charAt(++n)){const o=this.tryParse(t.substr(n));if(Rl.isPayloadValid(r.type,o))r.data=o;else throw new Error("invalid payload")}return r}tryParse(t){try{return JSON.parse(t,this.reviver)}catch{return!1}}static isPayloadValid(t,n){switch(t){case D.CONNECT:return du(n);case D.DISCONNECT:return n===void 0;case D.CONNECT_ERROR:return typeof n=="string"||du(n);case D.EVENT:case D.BINARY_EVENT:return Array.isArray(n)&&(typeof n[0]=="number"||typeof n[0]=="string"&&wg.indexOf(n[0])===-1);case D.ACK:case D.BINARY_ACK:return Array.isArray(n)}}destroy(){this.reconstructor&&(this.reconstructor.finishedReconstruction(),this.reconstructor=null)}}class xg{constructor(t){this.packet=t,this.buffers=[],this.reconPack=t}takeBinaryData(t){if(this.buffers.push(t),this.buffers.length===this.reconPack.attachments){const n=vg(this.reconPack,this.buffers);return this.finishedReconstruction(),n}return null}finishedReconstruction(){this.reconPack=null,this.buffers=[]}}function du(e){return Object.prototype.toString.call(e)==="[object Object]"}const Eg=Object.freeze(Object.defineProperty({__proto__:null,Decoder:Rl,Encoder:kg,get PacketType(){return D}},Symbol.toStringTag,{value:"Module"}));function Re(e,t,n){return e.on(t,n),function(){e.off(t,n)}}const _g=Object.freeze({connect:1,connect_error:1,disconnect:1,disconnecting:1,newListener:1,removeListener:1});class Xf extends G{constructor(t,n,r){super(),this.connected=!1,this.recovered=!1,this.receiveBuffer=[],this.sendBuffer=[],this._queue=[],this._queueSeq=0,this.ids=0,this.acks={},this.flags={},this.io=t,this.nsp=n,r&&r.auth&&(this.auth=r.auth),this._opts=Object.assign({},r),this.io._autoConnect&&this.open()}get disconnected(){return!this.connected}subEvents(){if(this.subs)return;const t=this.io;this.subs=[Re(t,"open",this.onopen.bind(this)),Re(t,"packet",this.onpacket.bind(this)),Re(t,"error",this.onerror.bind(this)),Re(t,"close",this.onclose.bind(this))]}get active(){return!!this.subs}connect(){return this.connected?this:(this.subEvents(),this.io._reconnecting||this.io.open(),this.io._readyState==="open"&&this.onopen(),this)}open(){return this.connect()}send(...t){return t.unshift("message"),this.emit.apply(this,t),this}emit(t,...n){var r,i,o;if(_g.hasOwnProperty(t))throw new Error('"'+t.toString()+'" is a reserved event name');if(n.unshift(t),this._opts.retries&&!this.flags.fromQueue&&!this.flags.volatile)return this._addToQueue(n),this;const s={type:D.EVENT,data:n};if(s.options={},s.options.compress=this.flags.compress!==!1,typeof n[n.length-1]=="function"){const m=this.ids++,v=n.pop();this._registerAckCallback(m,v),s.id=m}const l=(i=(r=this.io.engine)===null||r===void 0?void 0:r.transport)===null||i===void 0?void 0:i.writable,a=this.connected&&!(!((o=this.io.engine)===null||o===void 0)&&o._hasPingExpired());return this.flags.volatile&&!l||(a?(this.notifyOutgoingListeners(s),this.packet(s)):this.sendBuffer.push(s)),this.flags={},this}_registerAckCallback(t,n){var r;const i=(r=this.flags.timeout)!==null&&r!==void 0?r:this._opts.ackTimeout;if(i===void 0){this.acks[t]=n;return}const o=this.io.setTimeoutFn(()=>{delete this.acks[t];for(let l=0;l<this.sendBuffer.length;l++)this.sendBuffer[l].id===t&&this.sendBuffer.splice(l,1);n.call(this,new Error("operation has timed out"))},i),s=(...l)=>{this.io.clearTimeoutFn(o),n.apply(this,l)};s.withError=!0,this.acks[t]=s}emitWithAck(t,...n){return new Promise((r,i)=>{const o=(s,l)=>s?i(s):r(l);o.withError=!0,n.push(o),this.emit(t,...n)})}_addToQueue(t){let n;typeof t[t.length-1]=="function"&&(n=t.pop());const r={id:this._queueSeq++,tryCount:0,pending:!1,args:t,flags:Object.assign({fromQueue:!0},this.flags)};t.push((i,...o)=>(this._queue[0],i!==null?r.tryCount>this._opts.retries&&(this._queue.shift(),n&&n(i)):(this._queue.shift(),n&&n(null,...o)),r.pending=!1,this._drainQueue())),this._queue.push(r),this._drainQueue()}_drainQueue(t=!1){if(!this.connected||this._queue.length===0)return;const n=this._queue[0];n.pending&&!t||(n.pending=!0,n.tryCount++,this.flags=n.flags,this.emit.apply(this,n.args))}packet(t){t.nsp=this.nsp,this.io._packet(t)}onopen(){typeof this.auth=="function"?this.auth(t=>{this._sendConnectPacket(t)}):this._sendConnectPacket(this.auth)}_sendConnectPacket(t){this.packet({type:D.CONNECT,data:this._pid?Object.assign({pid:this._pid,offset:this._lastOffset},t):t})}onerror(t){this.connected||this.emitReserved("connect_error",t)}onclose(t,n){this.connected=!1,delete this.id,this.emitReserved("disconnect",t,n),this._clearAcks()}_clearAcks(){Object.keys(this.acks).forEach(t=>{if(!this.sendBuffer.some(r=>String(r.id)===t)){const r=this.acks[t];delete this.acks[t],r.withError&&r.call(this,new Error("socket has been disconnected"))}})}onpacket(t){if(t.nsp===this.nsp)switch(t.type){case D.CONNECT:t.data&&t.data.sid?this.onconnect(t.data.sid,t.data.pid):this.emitReserved("connect_error",new Error("It seems you are trying to reach a Socket.IO server in v2.x with a v3.x client, but they are not compatible (more information here: https://socket.io/docs/v3/migrating-from-2-x-to-3-0/)"));break;case D.EVENT:case D.BINARY_EVENT:this.onevent(t);break;case D.ACK:case D.BINARY_ACK:this.onack(t);break;case D.DISCONNECT:this.ondisconnect();break;case D.CONNECT_ERROR:this.destroy();const r=new Error(t.data.message);r.data=t.data.data,this.emitReserved("connect_error",r);break}}onevent(t){const n=t.data||[];t.id!=null&&n.push(this.ack(t.id)),this.connected?this.emitEvent(n):this.receiveBuffer.push(Object.freeze(n))}emitEvent(t){if(this._anyListeners&&this._anyListeners.length){const n=this._anyListeners.slice();for(const r of n)r.apply(this,t)}super.emit.apply(this,t),this._pid&&t.length&&typeof t[t.length-1]=="string"&&(this._lastOffset=t[t.length-1])}ack(t){const n=this;let r=!1;return function(...i){r||(r=!0,n.packet({type:D.ACK,id:t,data:i}))}}onack(t){const n=this.acks[t.id];typeof n=="function"&&(delete this.acks[t.id],n.withError&&t.data.unshift(null),n.apply(this,t.data))}onconnect(t,n){this.id=t,this.recovered=n&&this._pid===n,this._pid=n,this.connected=!0,this.emitBuffered(),this._drainQueue(!0),this.emitReserved("connect")}emitBuffered(){this.receiveBuffer.forEach(t=>this.emitEvent(t)),this.receiveBuffer=[],this.sendBuffer.forEach(t=>{this.notifyOutgoingListeners(t),this.packet(t)}),this.sendBuffer=[]}ondisconnect(){this.destroy(),this.onclose("io server disconnect")}destroy(){this.subs&&(this.subs.forEach(t=>t()),this.subs=void 0),this.io._destroy(this)}disconnect(){return this.connected&&this.packet({type:D.DISCONNECT}),this.destroy(),this.connected&&this.onclose("io client disconnect"),this}close(){return this.disconnect()}compress(t){return this.flags.compress=t,this}get volatile(){return this.flags.volatile=!0,this}timeout(t){return this.flags.timeout=t,this}onAny(t){return this._anyListeners=this._anyListeners||[],this._anyListeners.push(t),this}prependAny(t){return this._anyListeners=this._anyListeners||[],this._anyListeners.unshift(t),this}offAny(t){if(!this._anyListeners)return this;if(t){const n=this._anyListeners;for(let r=0;r<n.length;r++)if(t===n[r])return n.splice(r,1),this}else this._anyListeners=[];return this}listenersAny(){return this._anyListeners||[]}onAnyOutgoing(t){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.push(t),this}prependAnyOutgoing(t){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.unshift(t),this}offAnyOutgoing(t){if(!this._anyOutgoingListeners)return this;if(t){const n=this._anyOutgoingListeners;for(let r=0;r<n.length;r++)if(t===n[r])return n.splice(r,1),this}else this._anyOutgoingListeners=[];return this}listenersAnyOutgoing(){return this._anyOutgoingListeners||[]}notifyOutgoingListeners(t){if(this._anyOutgoingListeners&&this._anyOutgoingListeners.length){const n=this._anyOutgoingListeners.slice();for(const r of n)r.apply(this,t.data)}}}function gn(e){e=e||{},this.ms=e.min||100,this.max=e.max||1e4,this.factor=e.factor||2,this.jitter=e.jitter>0&&e.jitter<=1?e.jitter:0,this.attempts=0}gn.prototype.duration=function(){var e=this.ms*Math.pow(this.factor,this.attempts++);if(this.jitter){var t=Math.random(),n=Math.floor(t*this.jitter*e);e=Math.floor(t*10)&1?e+n:e-n}return Math.min(e,this.max)|0};gn.prototype.reset=function(){this.attempts=0};gn.prototype.setMin=function(e){this.ms=e};gn.prototype.setMax=function(e){this.max=e};gn.prototype.setJitter=function(e){this.jitter=e};class ws extends G{constructor(t,n){var r;super(),this.nsps={},this.subs=[],t&&typeof t=="object"&&(n=t,t=void 0),n=n||{},n.path=n.path||"/socket.io",this.opts=n,bi(this,n),this.reconnection(n.reconnection!==!1),this.reconnectionAttempts(n.reconnectionAttempts||1/0),this.reconnectionDelay(n.reconnectionDelay||1e3),this.reconnectionDelayMax(n.reconnectionDelayMax||5e3),this.randomizationFactor((r=n.randomizationFactor)!==null&&r!==void 0?r:.5),this.backoff=new gn({min:this.reconnectionDelay(),max:this.reconnectionDelayMax(),jitter:this.randomizationFactor()}),this.timeout(n.timeout==null?2e4:n.timeout),this._readyState="closed",this.uri=t;const i=n.parser||Eg;this.encoder=new i.Encoder,this.decoder=new i.Decoder,this._autoConnect=n.autoConnect!==!1,this._autoConnect&&this.open()}reconnection(t){return arguments.length?(this._reconnection=!!t,t||(this.skipReconnect=!0),this):this._reconnection}reconnectionAttempts(t){return t===void 0?this._reconnectionAttempts:(this._reconnectionAttempts=t,this)}reconnectionDelay(t){var n;return t===void 0?this._reconnectionDelay:(this._reconnectionDelay=t,(n=this.backoff)===null||n===void 0||n.setMin(t),this)}randomizationFactor(t){var n;return t===void 0?this._randomizationFactor:(this._randomizationFactor=t,(n=this.backoff)===null||n===void 0||n.setJitter(t),this)}reconnectionDelayMax(t){var n;return t===void 0?this._reconnectionDelayMax:(this._reconnectionDelayMax=t,(n=this.backoff)===null||n===void 0||n.setMax(t),this)}timeout(t){return arguments.length?(this._timeout=t,this):this._timeout}maybeReconnectOnOpen(){!this._reconnecting&&this._reconnection&&this.backoff.attempts===0&&this.reconnect()}open(t){if(~this._readyState.indexOf("open"))return this;this.engine=new fg(this.uri,this.opts);const n=this.engine,r=this;this._readyState="opening",this.skipReconnect=!1;const i=Re(n,"open",function(){r.onopen(),t&&t()}),o=l=>{this.cleanup(),this._readyState="closed",this.emitReserved("error",l),t?t(l):this.maybeReconnectOnOpen()},s=Re(n,"error",o);if(this._timeout!==!1){const l=this._timeout,a=this.setTimeoutFn(()=>{i(),o(new Error("timeout")),n.close()},l);this.opts.autoUnref&&a.unref(),this.subs.push(()=>{this.clearTimeoutFn(a)})}return this.subs.push(i),this.subs.push(s),this}connect(t){return this.open(t)}onopen(){this.cleanup(),this._readyState="open",this.emitReserved("open");const t=this.engine;this.subs.push(Re(t,"ping",this.onping.bind(this)),Re(t,"data",this.ondata.bind(this)),Re(t,"error",this.onerror.bind(this)),Re(t,"close",this.onclose.bind(this)),Re(this.decoder,"decoded",this.ondecoded.bind(this)))}onping(){this.emitReserved("ping")}ondata(t){try{this.decoder.add(t)}catch(n){this.onclose("parse error",n)}}ondecoded(t){zi(()=>{this.emitReserved("packet",t)},this.setTimeoutFn)}onerror(t){this.emitReserved("error",t)}socket(t,n){let r=this.nsps[t];return r?this._autoConnect&&!r.active&&r.connect():(r=new Xf(this,t,n),this.nsps[t]=r),r}_destroy(t){const n=Object.keys(this.nsps);for(const r of n)if(this.nsps[r].active)return;this._close()}_packet(t){const n=this.encoder.encode(t);for(let r=0;r<n.length;r++)this.engine.write(n[r],t.options)}cleanup(){this.subs.forEach(t=>t()),this.subs.length=0,this.decoder.destroy()}_close(){this.skipReconnect=!0,this._reconnecting=!1,this.onclose("forced close")}disconnect(){return this._close()}onclose(t,n){var r;this.cleanup(),(r=this.engine)===null||r===void 0||r.close(),this.backoff.reset(),this._readyState="closed",this.emitReserved("close",t,n),this._reconnection&&!this.skipReconnect&&this.reconnect()}reconnect(){if(this._reconnecting||this.skipReconnect)return this;const t=this;if(this.backoff.attempts>=this._reconnectionAttempts)this.backoff.reset(),this.emitReserved("reconnect_failed"),this._reconnecting=!1;else{const n=this.backoff.duration();this._reconnecting=!0;const r=this.setTimeoutFn(()=>{t.skipReconnect||(this.emitReserved("reconnect_attempt",t.backoff.attempts),!t.skipReconnect&&t.open(i=>{i?(t._reconnecting=!1,t.reconnect(),this.emitReserved("reconnect_error",i)):t.onreconnect()}))},n);this.opts.autoUnref&&r.unref(),this.subs.push(()=>{this.clearTimeoutFn(r)})}}onreconnect(){const t=this.backoff.attempts;this._reconnecting=!1,this.backoff.reset(),this.emitReserved("reconnect",t)}}const jn={};function Zr(e,t){typeof e=="object"&&(t=e,e=void 0),t=t||{};const n=dg(e,t.path||"/socket.io"),r=n.source,i=n.id,o=n.path,s=jn[i]&&o in jn[i].nsps,l=t.forceNew||t["force new connection"]||t.multiplex===!1||s;let a;return l?a=new ws(r,t):(jn[i]||(jn[i]=new ws(r,t)),a=jn[i]),n.query&&!t.query&&(t.query=n.queryKey),a.socket(n.path,t)}Object.assign(Zr,{Manager:ws,Socket:Xf,io:Zr,connect:Zr});let xo=null;const zn=new Map;function Sg(e,t){const n=zn.get(e);n&&Array.from(n).forEach(r=>r(t))}function Cg(){if(xo)return xo;const e=Zr(window.location.origin,{path:"/socket.io",reconnection:!0,withCredentials:!0});return e.on("connect",()=>{console.log("[Socket] Connected to Hub"),e.emit("register_dashboard")}),e.on("disconnect",()=>{console.log("[Socket] Disconnected from Hub")}),e.onAny((t,n)=>Sg(t,n)),xo=e,e}function Tg(e,t){let n=zn.get(e);return n||(n=new Set,zn.set(e,n)),n.add(t),()=>{const r=zn.get(e);r&&(r.delete(t),r.size===0&&zn.delete(e))}}const Rg=()=>{const[e]=y.useState(Cg),[t,n]=y.useState(e.connected);y.useEffect(()=>{const i=()=>n(!0),o=()=>n(!1);return e.on("connect",i),e.on("disconnect",o),n(e.connected),()=>{e.off("connect",i),e.off("disconnect",o)}},[e]);const r=y.useCallback((i,o)=>Tg(i,o),[]);return{socket:e,isConnected:t,on:r}},Pg=6e4;function Ng(e,t,n,r=!0){if(e)return{tone:"live",label:"Live",title:"Connected to the Xenon server. Updates stream in as they happen."};const i=t??n;if(n-i<Pg)return r?{tone:"reconnecting",label:"Reconnecting…",title:"Lost the connection to the Xenon server. Retrying automatically."}:{tone:"reconnecting",label:"Connecting…",title:"Connecting to the Xenon server."};const o=new Date(i).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"});return{tone:"down",label:`Disconnected · since ${o}`,title:`No connection to the Xenon server since ${o}. What's on screen may be out of date.`}}function Og(){const{isConnected:e}=Rg(),[t,n]=y.useState(null),[r,i]=y.useState(()=>Date.now()),[o,s]=y.useState(e);return y.useEffect(()=>{n(e?null:Date.now()),e&&s(!0)},[e]),y.useEffect(()=>{if(e)return;const l=window.setInterval(()=>i(Date.now()),5e3);return()=>window.clearInterval(l)},[e]),Ng(e,t,r,o)}const Jf="xenon.theme",pu="dark",Zf="(prefers-color-scheme: light)";function Lg(){try{const e=localStorage.getItem(Jf);return e==="light"||e==="system"||e==="dark"?e:pu}catch{return pu}}function ed(e,t){return e==="system"?t?"light":"dark":e}function jg(){return typeof window.matchMedia=="function"&&window.matchMedia(Zf).matches}function td(e){document.documentElement.setAttribute("data-theme",e)}function Ag(e){try{localStorage.setItem(Jf,e)}catch{}td(ed(e,jg()))}function Ig(){const[e,t]=y.useState(Lg);return y.useEffect(()=>{var o;if(e!=="system"||typeof window.matchMedia!="function")return;const r=window.matchMedia(Zf),i=()=>td(ed("system",r.matches));return(o=r.addEventListener)==null||o.call(r,"change",i),()=>{var s;return(s=r.removeEventListener)==null?void 0:s.call(r,"change",i)}},[e]),[e,r=>{Ag(r),t(r)}]}function Dg({className:e,alt:t="Xenon"}){const n="/xenon/";return p.jsxs(p.Fragment,{children:[p.jsx("img",{src:`${n}logo.svg`,alt:t,className:`logo-for-dark ${e??""}`}),p.jsx("img",{src:`${n}logo-light.svg`,alt:t,className:`logo-for-light ${e??""}`})]})}const Mg=[{value:"dark",label:"Dark"},{value:"light",label:"Light"},{value:"system",label:"System"}],$g=()=>{const e=yn(),{me:t,signOut:n}=El(),r=Og(),[i,o]=Ig(),[s,l]=y.useState(!1),a=y.useRef(null),u=((t==null?void 0:t.name)??"A").split(" ").map(h=>h[0]).slice(0,2).join("").toUpperCase(),m=(t==null?void 0:t.role)==="SUPER_ADMIN"?"Super admin":(t==null?void 0:t.role)==="ADMIN"?"Admin":"Member";y.useEffect(()=>{const h=E=>{a.current&&!a.current.contains(E.target)&&l(!1)};return document.addEventListener("mousedown",h),()=>document.removeEventListener("mousedown",h)},[]);const v=()=>window.dispatchEvent(new CustomEvent("xenon.open-command-palette"));return p.jsx("header",{className:"fixed top-0 left-14 right-0 z-20 h-14 border-b border-[var(--border)] bg-[var(--bg)]/80 backdrop-blur-md",children:p.jsxs("div",{className:"flex items-center h-full px-4 gap-4",children:[p.jsx("button",{type:"button",onClick:()=>e("/overview"),className:"flex items-center gap-3 min-w-0 cursor-pointer","aria-label":"Xenon home",children:p.jsx("div",{className:"flex items-center gap-2",children:p.jsx(Dg,{alt:"Xenon Logo",className:"h-8 w-auto object-contain"})})}),p.jsx("div",{className:"flex-1 max-w-xl mx-auto",children:p.jsxs("button",{type:"button",onClick:v,className:"relative w-full h-9 flex items-center text-left","aria-label":"Open command palette",children:[p.jsx("div",{className:"w-full h-9 pl-9 pr-14 rounded-md bg-[var(--surface)] border border-[var(--border)] text-sm text-[var(--text-dim)] hover:border-[var(--border-strong)] hover:text-[var(--text)] transition-colors flex items-center",children:"Search devices, sessions, settings…"}),p.jsx(If,{className:"absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-[var(--text-dim)]"}),p.jsx("kbd",{className:"absolute right-3 top-1/2 -translate-y-1/2 font-mono text-[10px] text-[var(--text-dim)] border border-[var(--border)] rounded px-1.5 py-0.5",children:"⌘K"})]})}),p.jsxs("div",{className:"flex items-center gap-3",children:[p.jsxs("div",{role:"status",title:r.title,className:`flex items-center gap-1.5 px-2.5 py-1 rounded-full border ${r.tone==="live"?"bg-[var(--color-success)]/10 border-[var(--color-success)]/20 text-[var(--color-success)]":r.tone==="reconnecting"?"bg-[var(--amber)]/10 border-[var(--amber)]/25 text-[var(--amber)]":"bg-[var(--red)]/10 border-[var(--red)]/25 text-[var(--red)]"}`,children:[p.jsx("span",{className:`h-1.5 w-1.5 rounded-full bg-current ${r.tone==="live"?"pulse-dot":""}`,"aria-hidden":"true"}),p.jsx("span",{className:"text-[11px] font-medium",children:r.label})]}),p.jsxs("div",{className:"relative",ref:a,children:[p.jsxs("button",{type:"button",className:"flex items-center gap-2 h-9 pl-1.5 pr-2.5 rounded-md border border-[var(--border)] hover:border-[var(--border-strong)] hover:bg-[var(--surface)] transition-colors",onClick:()=>l(h=>!h),"aria-haspopup":"true","aria-expanded":s,children:[p.jsx("span",{className:"h-6 w-6 rounded-full bg-[var(--color-accent)]/15 text-[var(--color-accent)] text-[11px] font-semibold flex items-center justify-center",children:u}),p.jsxs("span",{className:"flex flex-col items-start leading-tight",children:[p.jsx("span",{className:"text-xs text-[var(--text)]",children:(t==null?void 0:t.name)??"Account"}),p.jsx("span",{className:"text-[10px] text-[var(--text-dim)]",children:m})]}),p.jsx(Dm,{className:"h-3.5 w-3.5 text-[var(--text-dim)]"})]}),s&&p.jsxs("div",{className:"absolute top-full right-0 mt-2 w-64 rounded-md border border-[var(--border)] bg-[var(--surface)] shadow-lg overflow-hidden",children:[p.jsxs("div",{className:"px-3 py-2",children:[p.jsx("div",{className:"text-[11px] text-[var(--text-dim)] mb-1",children:"System"}),p.jsxs("div",{className:"flex items-center justify-between text-xs text-[var(--text)]",children:[p.jsx("span",{className:"text-[var(--text-muted)]",children:"Version"}),p.jsxs("span",{className:"font-mono text-[var(--text-muted)]",children:["v","2.13.1"]})]})]}),p.jsx("div",{className:"h-px bg-[var(--border)]"}),p.jsxs("div",{className:"px-3 py-2 flex items-center justify-between gap-2",children:[p.jsx("span",{id:"theme-label",className:"text-xs text-[var(--text-muted)]",children:"Theme"}),p.jsx("div",{className:"seg seg-sm",role:"radiogroup","aria-labelledby":"theme-label",children:Mg.map(h=>p.jsx("button",{type:"button",role:"radio","aria-checked":i===h.value,className:`seg-btn${i===h.value?" seg-btn-active":""}`,onClick:()=>o(h.value),children:h.label},h.value))})]}),p.jsx("div",{className:"h-px bg-[var(--border)]"}),p.jsxs("button",{type:"button",onClick:()=>{l(!1),e("/profile")},className:"w-full flex items-center gap-2 px-3 py-2 text-xs text-[var(--text)] hover:bg-[var(--bg)] text-left",children:[p.jsx(gy,{className:"h-3.5 w-3.5 text-[var(--text-dim)]"}),"Profile"]}),t!=null&&t.authDisabled?p.jsx("p",{className:"px-3 py-2 text-xs text-[var(--text-muted)]",children:"Sign-in is off on this server."}):p.jsxs("button",{type:"button",onClick:()=>{l(!1),n()},className:"w-full flex items-center gap-2 px-3 py-2 text-xs text-[var(--red)] hover:bg-[var(--bg)] text-left",children:[p.jsx(Zm,{className:"h-3.5 w-3.5"}),"Logout"]})]})]})]})]})})};class Ug extends y.Component{constructor(){super(...arguments),this.state={hasError:!1},this.handleReset=()=>{this.setState({hasError:!1}),window.location.reload()}}static getDerivedStateFromError(t){return{hasError:!0,error:t}}componentDidCatch(t,n){console.error("Uncaught error:",t,n)}render(){return this.state.hasError?this.props.fallback||p.jsxs("div",{className:"error-boundary-container",style:{padding:"4rem 2rem",textAlign:"center",display:"flex",flexDirection:"column",alignItems:"center",gap:"1.5rem",color:"var(--text)",background:"var(--bg-main)",minHeight:"100vh"},children:[p.jsx("div",{style:{color:"var(--accent-red)"},children:p.jsx(fy,{size:64})}),p.jsx("h2",{style:{fontSize:"2rem",fontWeight:700,margin:0},children:"Component exception detected"}),p.jsx("p",{style:{color:"var(--text-muted)",maxWidth:"500px",lineHeight:1.6},children:"An unexpected error occurred while rendering this section. Xenon's isolation engine has contained the fault to prevent a total system crash."}),this.state.error&&p.jsx("pre",{style:{background:"rgb(var(--rgb-black) / 0.3)",padding:"1rem",borderRadius:"8px",fontSize:"0.8rem",color:"var(--accent-red)",maxWidth:"80%",overflowX:"auto"},children:this.state.error.message}),p.jsxs("button",{onClick:this.handleReset,style:{background:"var(--color-accent)",color:"var(--secondary)",border:"none",padding:"0.75rem 2rem",borderRadius:"8px",fontWeight:700,cursor:"pointer",display:"flex",alignItems:"center",gap:"0.5rem",transition:"all 0.2s"},onMouseOver:t=>t.currentTarget.style.transform="translateY(-2px)",onMouseOut:t=>t.currentTarget.style.transform="translateY(0)",children:[p.jsx(Af,{size:18}),"Reload application"]})]}):this.props.children}}const Bg=y.lazy(()=>V(()=>import("./overview-tlu8ijGd.js"),__vite__mapDeps([0,1,2,3,4,5,6,7]))),hu=y.lazy(()=>V(()=>import("./device-explorer-DSpAA_t9.js"),__vite__mapDeps([8,6,7,9,10,5,11,1,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,3,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,2,46,47,48,49,50,51]))),mu=y.lazy(()=>V(()=>import("./builds-page-BcFn23bE.js"),__vite__mapDeps([52,53,54,40,13,41,32,12,14,43,1,37,36,33,3,4,55,6,7,15,16,38,39]))),zg=y.lazy(()=>V(()=>import("./session-detail-page-Bc02YjMm.js"),__vite__mapDeps([56,53,54,45,33,1,9,10,37,36,55,27,57,2,58,59,38,39,5,60,43,30,31,21,18,22,61]))),bg=y.lazy(()=>V(()=>import("./runbook-page-hPRZMy7s.js"),__vite__mapDeps([62,45,63]))),Fg=y.lazy(()=>V(()=>import("./apps-DW1pw2re.js"),__vite__mapDeps([64,54,12,13,14,6,7,15,16,21,18,22,23,24,44,19,27,35,43,47,65]))),Vg=y.lazy(()=>V(()=>import("./webhook-settings-DAHgnJyZ.js"),__vite__mapDeps([66,23,24,6,7,47,26,37,36,35,5,67,68])).then(e=>({default:e.WebhookSettings}))),qg=y.lazy(()=>V(()=>import("./settings-C1VIluuT.js"),__vite__mapDeps([69,70,12,13,14,71,21,18,22,6,7,36,25,34,19,5,72,57,68])).then(e=>({default:e.Settings}))),Wg=y.lazy(()=>V(()=>import("./ai-settings-BMQK3-yN.js"),__vite__mapDeps([73,70,12,13,14,71,6,7,48,36,5,68])).then(e=>({default:e.AISettings}))),Hg=y.lazy(()=>V(()=>import("./maintenance-settings-BxbA7SkB.js"),__vite__mapDeps([74,70,12,13,14,71,6,7,47,19,72,68])).then(e=>({default:e.MaintenanceSettings}))),Kg=y.lazy(()=>V(()=>import("./api-keys-CbJ42eDQ.js"),__vite__mapDeps([75,54,30,31,23,24,6,7,21,18,22,12,13,14,40,41,15,16,26,47,19,27,68])).then(e=>({default:e.ApiKeys}))),Qg=y.lazy(()=>V(()=>import("./teams-uL4fjTDR.js"),__vite__mapDeps([76,54,30,31,23,24,6,7,21,18,22,12,13,14,40,41,15,16,77,26,45,47,68])).then(e=>({default:e.Teams}))),Gg=y.lazy(()=>V(()=>import("./selector-health-page-CThoxDFO.js"),__vite__mapDeps([78,6,7,28,29,12,13,14,55,58,59,38,39,40,41,15,16,79,1,21,18,22,19,27]))),Yg=y.lazy(()=>V(()=>import("./selector-detail-redirect-uQwvV7EQ.js"),__vite__mapDeps([80,79]))),Xg=y.lazy(()=>V(()=>import("./DeviceMosaicView-ChhHnpFQ.js"),__vite__mapDeps([81,11,1,36,46,60,26,28,29,82,43,12,13,14,25,6,7]))),Jg=y.lazy(()=>V(()=>import("./profile-page-D080qzr4.js"),__vite__mapDeps([83,6,7,54,15,13,16,27,47]))),Zg=y.lazy(()=>V(()=>import("./users-DjQSucKb.js"),__vite__mapDeps([84,77,54,6,7,12,13,14,40,41,15,16,26,47]))),ev=y.lazy(()=>V(()=>import("./RecordingsPage-z97ftGK-.js"),__vite__mapDeps([85,6,7,30,31,12,13,14,38,39,40,41,49,17,18,19,20,26,50,82,86,87]))),tv=y.lazy(()=>V(()=>import("./RecordingPage-Dhw4d_O6.js"),__vite__mapDeps([88,82,6,7,12,13,14,38,39,21,18,22,17,19,20,46,86,87,45,47,42,43]))),nv=()=>p.jsxs("div",{className:"flex items-center justify-center gap-2 h-full text-xs text-[var(--text-dim)]",children:[p.jsx(Af,{className:"animate-spin",size:14}),p.jsx("span",{children:"Hydrating view…"})]}),rv=()=>p.jsx(Ug,{children:p.jsx(y.Suspense,{fallback:p.jsx(nv,{}),children:p.jsxs(Lf,{children:[p.jsx($,{path:"/",element:p.jsx(Wt,{to:"/overview",replace:!0})}),p.jsx($,{path:"/overview",element:p.jsx(Bg,{})}),p.jsx($,{path:"/devices",element:p.jsx(hu,{})}),p.jsx($,{path:"/devices/:udid/control/:tab?",element:p.jsx(hu,{})}),p.jsx($,{path:"/apps",element:p.jsx(Fg,{})}),p.jsx($,{path:"/sessions",element:p.jsx(Wt,{to:"/builds",replace:!0})}),p.jsx($,{path:"/sessions/*",element:p.jsx(Wt,{to:"/builds",replace:!0})}),p.jsx($,{path:"/builds",element:p.jsx(mu,{})}),p.jsx($,{path:"/builds/:buildId",element:p.jsx(mu,{})}),p.jsx($,{path:"/builds/:buildId/sessions/:sessionId",element:p.jsx(zg,{})}),p.jsx($,{path:"/notifications",element:p.jsx(Vg,{})}),p.jsx($,{path:"/settings",element:p.jsx(qg,{})}),p.jsx($,{path:"/ai-settings",element:p.jsx(Wg,{})}),p.jsx($,{path:"/maintenance",element:p.jsx(Hg,{})}),p.jsx($,{path:"/api-keys",element:p.jsx(Kg,{})}),p.jsx($,{path:"/teams",element:p.jsx(Qg,{})}),p.jsx($,{path:"/users",element:p.jsx(Zg,{})}),p.jsx($,{path:"/selector-health",element:p.jsx(Gg,{})}),p.jsx($,{path:"/selector-health/detail",element:p.jsx(Yg,{})}),p.jsx($,{path:"/devices/live",element:p.jsx(Xg,{})}),p.jsx($,{path:"/recordings",element:p.jsx(ev,{})}),p.jsx($,{path:"/recordings/:groupId",element:p.jsx(tv,{})}),p.jsx($,{path:"/runbooks/:category",element:p.jsx(bg,{})}),p.jsx($,{path:"/profile",element:p.jsx(Jg,{})}),p.jsx($,{path:"*",element:p.jsx(Wt,{to:"/overview",replace:!0})})]})})});let mr=null;function yu(e){mr=e}const iv=new Set(["device_held_by_another_user","device_in_use_by_session"]),ov=new Set(["not_available_through_hub","not_available_for_cloud_phone"]);function sv(e){return!e||typeof e!="object"?!1:iv.has(e.error??"")}const lv=5e3,gu=new Map;function vu(e){if(!mr)return!1;const t=Date.now(),n=gu.get(e)??0;return t-n<lv||(gu.set(e,t),mr(e,"error")),!0}class Pl extends Error{constructor(t,n,r,i=!1){super(t),this.status=n,this.body=r,this.shown=i,this.name="ApiError"}}function av(e){return e instanceof Pl&&e.shown}function wu(e){if(!e||typeof e!="object")return;const{error:t,message:n}=e;return(typeof t!="string"||/^[a-z][a-z0-9_]*$/.test(t))&&typeof n=="string"&&n?n:typeof t=="string"&&t?t:typeof n=="string"&&n?n:void 0}async function Eo(e,t){let n=!1;if(e.status===403){const r=await e.clone().json().catch(()=>({})),i=wu(r)||"You do not have permission for this action.";mr&&(mr(i,"error"),n=!0)}if(e.status===409){const r=await e.clone().json().catch(()=>({}));sv(r)&&(n=vu(r.message||"This device is in use by another user."))}if(e.status===501){const r=await e.clone().json().catch(()=>({}));ov.has(r==null?void 0:r.error)&&r.message&&(n=vu(r.message))}if(e.status===204||e.status===205)return null;if(t&&(e.status<200||e.status>=300)){const r=await e.json().catch(()=>null),i=wu(r)||`Request failed (${e.status})`;throw new Pl(i,e.status,r,n)}return e.json()}class uv{makeGETRequest(t){return fetch(this.formatUrl(t)).then(n=>Eo(n,!1))}makePOSTRequest(t,n,r,i={},o={}){return fetch(this.formatUrl(t),{method:"POST",body:JSON.stringify(r||{}),headers:{"Content-Type":"application/json"},...i}).then(s=>Eo(s,!o.resolveErrors))}makeDELETERequest(t,n={}){return fetch(this.formatUrl(t),{method:"DELETE"}).then(r=>Eo(r,!n.resolveErrors))}formatUrl(t){return`/xenon/api${t}`}}const R=new uv;function cv(e){return e instanceof Pl?`The server rejected the change: ${e.message}`:"Couldn't reach the Xenon server. Check your connection and try again."}function Fv(e,t){av(t)||e(cv(t),"error")}const nd=y.createContext(void 0),Vv=()=>{const e=y.useContext(nd);if(!e)throw new Error("useToast must be used within a ToastProvider");return e},fv=({children:e})=>{const[t,n]=y.useState([]),r=y.useCallback(o=>{n(s=>s.filter(l=>l.id!==o))},[]),i=y.useCallback((o,s="info",l=4e3,a)=>{const u=Math.random().toString(36).substring(2,9);return n(m=>[...m,{id:u,message:o,type:s,duration:l,action:a}]),s!=="loading"&&l>0&&setTimeout(()=>{r(u)},l),u},[r]);return y.useEffect(()=>(yu((o,s="info")=>i(o,s)),()=>yu(null)),[i]),p.jsxs(nd.Provider,{value:{toast:i,removeToast:r},children:[e,p.jsx("div",{className:"toast-container","aria-live":"polite","aria-atomic":"true",role:"status",children:t.map(o=>p.jsxs("div",{className:`toast-item toast-${o.type} animate-slide-in`,children:[p.jsxs("div",{className:"toast-icon",children:[o.type==="success"&&p.jsx(Bm,{size:18}),o.type==="error"&&p.jsx($m,{size:18}),o.type==="info"&&p.jsx(Wm,{size:18}),o.type==="loading"&&p.jsx(Xm,{size:18,className:"animate-spin"})]}),p.jsx("div",{className:"toast-message",children:o.message}),o.action&&p.jsx("button",{className:"toast-action",onClick:()=>{var s;r(o.id),(s=o.action)==null||s.onClick()},children:o.action.label}),p.jsx("button",{className:"toast-close",onClick:()=>r(o.id),"aria-label":`Close ${o.type} notification`,children:p.jsx(xy,{size:14})})]},o.id))})]})},dv=[{id:"overview",label:"Overview",icon:Gm,path:"/overview"},{id:"devices",label:"Devices",icon:uy,path:"/devices"},{id:"live-devices",label:"Live devices",icon:py,path:"/devices/live"},{id:"recordings",label:"Recordings",icon:bm,path:"/recordings"},{id:"apps",label:"Apps",icon:Rm,path:"/apps"},{id:"sessions",label:"Sessions",icon:ty,path:"/builds"},{id:"selector-health",label:"Selector health",icon:Vm,path:"/selector-health"},{id:"notifications",label:"Notifications",icon:Nm,path:"/notifications"},{id:"settings",label:"Settings",icon:oy,path:"/settings",minRole:"ADMIN"},{id:"ai",label:"AI engine",icon:Am,path:"/ai-settings",minRole:"ADMIN"},{id:"maintenance",label:"Maintenance",icon:ly,path:"/maintenance",minRole:"ADMIN"},{id:"teams",label:"Teams",icon:wy,path:"/teams",minRole:"ADMIN"},{id:"users",label:"Users",icon:my,path:"/users",minRole:"ADMIN"},{id:"apikeys",label:"API keys",icon:Km,path:"/api-keys",minRole:"ADMIN"}],ku={SUPER_ADMIN:3,ADMIN:2,MEMBER:1};function pv(e,t){return t?(e?ku[e]??0:0)>=ku[t]:!0}const hv=()=>{const e=yn(),t=We(),{me:n}=El(),r=dv.filter(l=>pv(n==null?void 0:n.role,l.minRole)),i=t.pathname.replace(/\/$/,"")||"/",o=r.filter(l=>i===l.path||i.startsWith(l.path+"/")).sort((l,a)=>a.path.length-l.path.length)[0],s=l=>(o==null?void 0:o.path)===l;return p.jsxs("aside",{className:"fixed inset-y-0 left-0 z-30 w-14 border-r border-[var(--border)] bg-[var(--surface)] flex flex-col items-center py-3",children:[p.jsx("nav",{className:"flex-1 flex flex-col gap-1 w-full items-center",children:r.map(l=>{const a=l.icon,u=s(l.path);return p.jsxs("button",{type:"button",onClick:()=>e(l.path),className:`group relative w-full flex justify-center py-2.5 mx-1 rounded-md transition-colors ${u?"bg-[var(--surface-2)]":"hover:bg-[var(--surface-2)]/60"}`,"aria-label":l.label,"aria-current":u?"page":void 0,children:[p.jsx("span",{className:`absolute left-0 top-1 bottom-1 w-[3px] rounded-r transition-all ${u?"bg-[var(--color-accent)]":"bg-transparent"}`}),p.jsx(a,{className:`h-[18px] w-[18px] transition-colors ${u?"text-[var(--color-accent)]":"text-[var(--text-dim)] group-hover:text-[var(--text)]"}`,strokeWidth:u?2.25:2}),p.jsx("span",{className:"pointer-events-none absolute left-full ml-2 top-1/2 -translate-y-1/2 whitespace-nowrap rounded-md bg-[var(--surface-2)] border border-[var(--border-strong)] px-2 py-1 text-xs text-[var(--text)] opacity-0 group-hover:opacity-100 transition-opacity z-50 shadow-lg",children:l.label})]},l.id)})}),p.jsxs("button",{type:"button",className:"group relative w-full flex justify-center py-2.5 mt-2","aria-label":"API docs",onClick:()=>window.open(window.location.origin+"/xenon/api-docs","_blank"),children:[p.jsx(Lm,{className:"h-[18px] w-[18px] text-[var(--text-dim)] group-hover:text-[var(--text)] transition-colors"}),p.jsx("span",{className:"pointer-events-none absolute left-full ml-2 top-1/2 -translate-y-1/2 whitespace-nowrap rounded-md bg-[var(--surface-2)] border border-[var(--border-strong)] px-2 py-1 text-xs text-[var(--text)] opacity-0 group-hover:opacity-100 transition-opacity z-50 shadow-lg",children:"API docs"})]})]})};class An{static getDevices(){return R.makeGETRequest(`/device?t=${Date.now()}`)}static getPendingSessionsCount(){return R.makeGETRequest("/queue/length")}static getPendingSessions(){return R.makeGETRequest("/queue")}static getQueueSummary(){return R.makeGETRequest("/queue/summary")}static getQueueStatus(t){return R.makeGETRequest(`/queue/status/${t}`)}static getBuilds(){return R.makeGETRequest("/build")}static getSessions(t={}){var i;let r=`/session?t=${Date.now()}`;return t.buildId&&(r+=`&buildId=${encodeURIComponent(t.buildId)}`),t.since&&(r+=`&since=${encodeURIComponent(t.since)}`),t.limit&&(r+=`&limit=${t.limit}`),t.before&&(r+=`&before=${encodeURIComponent(t.before)}`),t.beforeId&&(r+=`&beforeId=${encodeURIComponent(t.beforeId)}`),t.query&&(r+=`&query=${encodeURIComponent(t.query)}`),t.status&&(r+=`&status=${encodeURIComponent(t.status)}`),t.platform&&(r+=`&platform=${encodeURIComponent(t.platform)}`),(i=t.ids)!=null&&i.length&&(r+=`&ids=${t.ids.map(encodeURIComponent).join(",")}`),R.makeGETRequest(r)}static getSessionSummary(t={}){let n=`/session-summary?t=${Date.now()}`;return t.since&&(n+=`&since=${encodeURIComponent(t.since)}`),t.buildId&&(n+=`&buildId=${encodeURIComponent(t.buildId)}`),R.makeGETRequest(n)}static getSession(t){return R.makeGETRequest(`/session/${t}`)}static getSessionLogs(t){return R.makeGETRequest(`/session/${t}/session_log`)}static getDeviceLogs(t){return R.makeGETRequest(`/session/${t}/logs/device`)}static getDebugLogs(t){return R.makeGETRequest(`/session/${t}/logs/debug`)}static getProfilingData(t){return R.makeGETRequest(`/session/${t}/profiling`)}static getSessionMetrics(t){return R.makeGETRequest(`/session/${t}/metrics`)}static omniScan(t){return R.makeGETRequest(`/session/${t}/xenon/omni-scan`)}static omniScanControl(t){return R.makeGETRequest(`/control/${t}/omni-scan`)}static testAiLocator(t,n,r){return R.makePOSTRequest(`/session/${t}/xenon/test-locator`,{},{strategy:n,selector:r})}static getDisplayState(t){return R.makeGETRequest(`/control/${t}/display`)}static getAppiumSession(t){return R.makeGETRequest(`/control/${t}/appium-session`)}static async verifyLocator(t,n,r){const i=t.startsWith("/")?t:`/${t}`,s=await(await fetch(`${i}/session/${n}/xenon/verify-locator`,{method:"POST",credentials:"include",headers:{"Content-Type":"application/json"},body:JSON.stringify(r)})).json().catch(()=>({}));return(s==null?void 0:s.value)??s}static testAiLocatorControl(t,n,r){return R.makePOSTRequest(`/control/${t}/test-locator`,{},{strategy:n,selector:r})}static blockDevice(t,n){return R.makePOSTRequest("/block",{},{udid:t,host:n})}static unblockDevice(t,n){return R.makePOSTRequest("/unblock",{},{udid:t,host:n})}static updateDeviceTags(t,n,r){return R.makePOSTRequest("/device/tags",{},{udid:t,host:n,tags:r})}static async listTeams(){const t=await fetch("/xenon/api/teams",{credentials:"include"});if(!t.ok)throw new Error(`listTeams failed (${t.status})`);return(await t.json()).map(r=>({id:r.id,name:r.name}))}static async setDeviceTeam(t,n){const r=await fetch(`/xenon/api/grid/device/${encodeURIComponent(t)}/team`,{method:"PUT",credentials:"include",headers:{"Content-Type":"application/json"},body:JSON.stringify({teamId:n})});if(!r.ok&&r.status!==204){const i=await r.json().catch(()=>({}));throw new Error(i.error||`setDeviceTeam failed (${r.status})`)}}static getSessionLiveVideoUrl(t){return R.formatUrl(`/session/${t}/live_video`)}static getReservations(){return R.makeGETRequest("/reservation")}static reserveDevice(t,n,r,i,o){return R.makePOSTRequest("/reservation",{},{udid:t,host:n,reservedBy:r,duration:i,reason:o},{},{resolveErrors:!0})}static releaseReservation(t,n){return R.makeDELETERequest(`/reservation/${t}/${encodeURIComponent(n)}`)}static extendReservation(t,n,r){return R.makePOSTRequest(`/reservation/${t}/${encodeURIComponent(n)}/extend`,{},{duration:r})}static getAssetUrl(t){const n=(t??"").replace(/^[\\/]+/,"").split(/[\\/]/);if(n.length!==3||n.some(s=>!s))return"";const[r,i,o]=n;return["screenshots","video","performance"].includes(i)?`/xenon/api/session/${encodeURIComponent(r)}/asset/${i}/${encodeURIComponent(o)}`:""}static tap(t,n,r){return R.makePOSTRequest(`/control/${t}/tap`,{},{x:n,y:r})}static swipe(t,n,r,i,o){return R.makePOSTRequest(`/control/${t}/swipe`,{},{x:n,y:r,endX:i,endY:o})}static typeText(t,n){return R.makePOSTRequest(`/control/${t}/text`,{},{text:n})}static pressKey(t,n){return R.makePOSTRequest(`/control/${t}/keyevent`,{},{keyCode:n})}static getClipboard(t){return R.makeGETRequest(`/control/${t}/clipboard`)}static setClipboard(t,n){return R.makePOSTRequest(`/control/${t}/clipboard`,{},{content:n})}static getScreenshot(t){return R.makeGETRequest(`/control/${t}/screenshot`)}static touchAndHold(t,n,r,i){return R.makePOSTRequest(`/control/${t}/touchAndHold`,{},{x:n,y:r,duration:i})}static lock(t){return R.makePOSTRequest(`/control/${t}/lock`,{},{})}static unlock(t){return R.makePOSTRequest(`/control/${t}/unlock`,{},{})}static installApp(t,n){return R.makePOSTRequest(`/control/${t}/install`,{},{appPath:n})}static startStream(t){return R.makePOSTRequest(`/control/${t}/stream/start`,{},{},{},{resolveErrors:!0})}static stopStream(t){return R.makePOSTRequest(`/control/${t}/stream/stop`,{},{},{keepalive:!0})}static leaveStream(t){return R.makePOSTRequest(`/control/${t}/stream/leave`,{},{},{keepalive:!0})}static uninstallApp(t,n){return R.makePOSTRequest(`/control/${t}/uninstall`,{},{bundleId:n})}static uploadAndInstallApp(t,n){const r=new FormData;return r.append("app",n),fetch(`/xenon/api/control/${t}/upload-install`,{method:"POST",body:r}).then(i=>i.json())}static listApps(t){return R.makeGETRequest(`/control/${t}/apps`)}static getLogs(t){return R.makeGETRequest(`/control/${t}/logs`)}static getApps(){return R.makeGETRequest("/apps")}static uploadApp(t,n=null){const r=new FormData;return r.append("app",t),n&&r.append("teamId",n),fetch("/xenon/api/apps/upload",{method:"POST",body:r}).then(i=>i.json())}static async setAppTeam(t,n){const r=await fetch(`/xenon/api/apps/${encodeURIComponent(t)}/team`,{method:"PUT",credentials:"include",headers:{"Content-Type":"application/json"},body:JSON.stringify({teamId:n})});if(!r.ok){const i=await r.json().catch(()=>({}));throw new Error(i.error||`setAppTeam failed (${r.status})`)}}static deleteApp(t){return R.makeDELETERequest(`/apps/${t}`)}static installRepositoryApp(t,n){return R.makePOSTRequest(`/control/${t}/install-repository-app`,{},{appId:n},{},{resolveErrors:!0})}static executeShell(t,n){return R.makePOSTRequest(`/control/${t}/shell`,{},{command:n},{},{resolveErrors:!0})}static getInspectorSnapshot(t){return R.makeGETRequest(`/control/${t}/inspector/snapshot`)}static getWebhookConfigs(){return R.makeGETRequest("/webhook")}static addWebhookConfig(t,n,r,i){return R.makePOSTRequest("/webhook",{},{url:t,events:n,type:r,payloadTemplate:i})}static deleteWebhookConfig(t){return R.makeDELETERequest(`/webhook/${t}`)}static testWebhook(t,n){return R.makePOSTRequest("/webhook/test",{},{url:t,type:n})}static getGlobalConfig(){return R.makeGETRequest("/config")}static updateGlobalConfig(t){return R.makePOSTRequest("/config",{},t)}static testAIConfig(t){return R.makePOSTRequest("/config/test-ai",{},t,{},{resolveErrors:!0})}static resetMetrics(){return R.makePOSTRequest("/config/reset-metrics",{},{})}static getRecentHealingEvents(t=50){return R.makeGETRequest(`/healing/events?limit=${t}&t=${Date.now()}`)}static getHealingSummary(t=30,n=0){return R.makeGETRequest(`/healing/summary?windowDays=${t}&tz=${n}&t=${Date.now()}`)}static getHealingSelectors(t){const n=new URLSearchParams({tab:t.tab,days:String(t.days),sort:t.sort??"heals",page:String(t.page??1),pageSize:String(t.pageSize??50),t:String(Date.now())});return t.q&&n.set("q",t.q),t.platform&&n.set("platform",t.platform),t.method&&n.set("method",t.method),R.makeGETRequest(`/healing/selectors?${n.toString()}`)}static async getSelectorPanel(t,n,r,i){const o=new URLSearchParams({strategy:t,selector:n,days:String(r),tz:String(i),t:String(Date.now())}),s=await fetch(`/xenon/api/healing/selectors/detail?${o.toString()}`,{credentials:"include"}),l=await s.json().catch(()=>null);return{status:s.status,body:l}}static async postSelectorStateAction(t){const n=await fetch("/xenon/api/healing/selector/state",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)});if(!n.ok){const r=await n.json().catch(()=>({})),i=new Error(r.error??`Selector state action failed (${n.status})`);throw i.status=n.status,i.currentStatus=r.currentStatus??null,i}return n.json()}static sendHealingDigest(t={}){return R.makePOSTRequest("/healing/digest/send",{},t)}static async exportBuild(t,n,r){const i=await fetch(`/xenon/api/build/${encodeURIComponent(t)}/export`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({format:n,...r?{sessionIds:r}:{}})});if(!i.ok){const u=await i.text().catch(()=>i.statusText);throw new Error(`Export failed (${i.status}): ${u||i.statusText}`)}const o=i.headers.get("Content-Disposition")||"",s=/filename="?([^";]+)"?/.exec(o),l=s?s[1]:`build-${t}-sessions.${n}`;return{blob:await i.blob(),filename:l}}}function mv(e){if(!(e instanceof HTMLElement))return!1;if(e.isContentEditable)return!0;const t=e.tagName;return t==="INPUT"||t==="TEXTAREA"||t==="SELECT"}function yv(){const[e,t]=y.useState(!1);return y.useEffect(()=>{const n=i=>{(i.metaKey||i.ctrlKey)&&i.key.toLowerCase()==="k"&&!mv(i.target)&&(i.preventDefault(),t(o=>!o)),i.key==="Escape"&&t(!1)},r=()=>t(!0);return window.addEventListener("keydown",n),window.addEventListener("xenon.open-command-palette",r),()=>{window.removeEventListener("keydown",n),window.removeEventListener("xenon.open-command-palette",r)}},[]),{open:e,setOpen:t}}function xu(e,t){if(!e)return 0;const n=e.toLowerCase(),r=t.toLowerCase();if(r===n)return 1e4;if(r.startsWith(n))return 5e3-(r.length-n.length);let i=0,o=0,s=0;for(let l=0;l<n.length;l++){const a=n[l],u=r.indexOf(a,i);if(u===-1)return 0;u===i?(s+=1,o+=20+s*5):(s=0,o+=10-Math.min(u-i,10)),i=u+1}return Math.max(o,1)}const Eu=[{id:"nav:overview",kind:"nav",label:"Overview",path:"/overview"},{id:"nav:devices",kind:"nav",label:"Devices",path:"/devices"},{id:"nav:live",kind:"nav",label:"Live devices",path:"/devices/live"},{id:"nav:builds",kind:"nav",label:"Sessions",path:"/builds"},{id:"nav:apps",kind:"nav",label:"Apps",path:"/apps"},{id:"nav:selector-health",kind:"nav",label:"Selector health",path:"/selector-health"},{id:"nav:notifications",kind:"nav",label:"Notifications",path:"/notifications"},{id:"nav:settings",kind:"nav",label:"Settings",path:"/settings"},{id:"nav:ai-settings",kind:"nav",label:"AI engine",path:"/ai-settings"},{id:"nav:maintenance",kind:"nav",label:"Maintenance",path:"/maintenance"},{id:"nav:teams",kind:"nav",label:"Teams",path:"/teams"},{id:"nav:api-keys",kind:"nav",label:"API keys",path:"/api-keys"},{id:"nav:users",kind:"nav",label:"Users",path:"/users"},{id:"nav:profile",kind:"nav",label:"Profile",path:"/profile"}];class gv{constructor(){this.devices=[],this.builds=[],this.sessions=[],this.teams=[],this.keys=[],this.apps=[]}setDevices(t){this.devices=t.map(n=>({id:`device:${n.udid}`,kind:"device",label:n.name||n.udid,sub:n.udid,path:`/devices/${n.udid}/control`}))}setBuilds(t){this.builds=t.map(n=>({id:`build:${n.id}`,kind:"build",label:n.name||n.id,sub:typeof n.sessionCount=="number"?`${n.sessionCount} session${n.sessionCount===1?"":"s"}${n.failedCount?` · ${n.failedCount} failed`:""}`:n.id,path:`/builds/${encodeURIComponent(n.id)}`}))}setSessions(t){this.sessions=t.map(n=>({id:`session:${n.id}`,kind:"session",label:n.name||n.id,sub:n.id,path:`/builds?session=${encodeURIComponent(n.id)}`}))}setTeams(t){this.teams=t.map(n=>({id:`team:${n.id}`,kind:"team",label:n.name||n.id,sub:n.id,path:`/teams?team=${encodeURIComponent(n.id)}`}))}setKeys(t){this.keys=t.map(n=>({id:`key:${n.id}`,kind:"key",label:n.name||n.id,sub:n.id,path:`/api-keys?key=${encodeURIComponent(n.id)}`}))}setApps(t){this.apps=t.map(n=>({id:`app:${n.id}`,kind:"app",label:n.name||n.id,sub:n.id,path:`/apps?app=${encodeURIComponent(n.id)}`}))}search(t,n=8){return t.trim()?[...Eu,...this.devices,...this.builds,...this.sessions,...this.teams,...this.keys,...this.apps].map(i=>{const o=xu(t,i.label),s=i.sub?xu(t,i.sub):0;return{it:i,score:Math.max(o,s)}}).filter(i=>i.score>0).sort((i,o)=>o.score-i.score).slice(0,n).map(i=>i.it):Eu.slice(0,n)}}const vv={nav:"Navigation",device:"Devices",build:"Builds",session:"Running sessions",team:"Teams",key:"API keys",app:"Apps"},wv=["nav","device","build","session","team","key","app"],kv=()=>{const{open:e,setOpen:t}=yv(),[n,r]=y.useState(""),[i,o]=y.useState(0),s=yn(),l=y.useRef(new gv),a=y.useRef(null);y.useEffect(()=>{if(!e)return;Promise.all([An.getDevices().catch(()=>[]),An.getSessions().catch(()=>[]),An.getApps().catch(()=>[]),An.listTeams().catch(()=>[]),An.getBuilds().catch(()=>[])]).then(([k,c,f,d,g])=>{Array.isArray(k)&&l.current.setDevices(k),Array.isArray(g)&&l.current.setBuilds(g),Array.isArray(c)&&l.current.setSessions(c),Array.isArray(f)&&l.current.setApps(f),Array.isArray(d)&&l.current.setTeams(d)});const x=setTimeout(()=>{var k;return(k=a.current)==null?void 0:k.focus()},0);return()=>clearTimeout(x)},[e]),y.useEffect(()=>{e||(r(""),o(0))},[e]);const u=y.useMemo(()=>l.current.search(n,8),[n,e]),m=y.useMemo(()=>{const x=new Map;return u.forEach(k=>{const c=x.get(k.kind)||[];c.push(k),x.set(k.kind,c)}),x},[u]),v=y.useCallback(x=>{s(x.path),t(!1)},[s,t]),h=x=>{x.key==="ArrowDown"?(x.preventDefault(),o(k=>Math.min(k+1,Math.max(u.length-1,0)))):x.key==="ArrowUp"?(x.preventDefault(),o(k=>Math.max(k-1,0))):x.key==="Enter"&&(x.preventDefault(),u[i]&&v(u[i]))};if(!e)return null;let E=-1;return p.jsx("div",{className:"cp-overlay",onClick:()=>t(!1),children:p.jsxs("div",{className:"cp",role:"dialog","aria-modal":!0,"aria-label":"Command palette",onClick:x=>x.stopPropagation(),children:[p.jsxs("div",{className:"cp-input-row",children:[p.jsx(If,{size:14}),p.jsx("input",{ref:a,className:"cp-input",placeholder:"Search devices, sessions, settings…",value:n,onChange:x=>{r(x.target.value),o(0)},onKeyDown:h}),p.jsx("span",{className:"cp-esc",children:"ESC"})]}),p.jsxs("div",{className:"cp-results",children:[u.length===0&&p.jsx("div",{className:"cp-empty",children:"No results."}),wv.filter(x=>m.has(x)).map(x=>p.jsxs("div",{className:"cp-group",children:[p.jsx("div",{className:"cp-group-head",children:vv[x]}),m.get(x).map(k=>{E+=1;const c=E===i;return p.jsxs("button",{type:"button",className:`cp-item${c?" cp-item-active":""}`,onMouseEnter:()=>{o(E)},onClick:()=>v(k),children:[p.jsx("span",{className:"cp-item-label",children:k.label}),k.sub&&p.jsx("span",{className:"cp-item-sub",children:k.sub})]},k.id)})]},x))]})]})})};function xv({children:e}){const{loading:t,me:n}=El(),r=We();if(t)return p.jsx("div",{style:{padding:40,textAlign:"center",color:"var(--text-dim)"},children:"Loading…"});if(!n){const i=encodeURIComponent(r.pathname+r.search),o=Oy()?"&reason=expired":"";return p.jsx(Wt,{to:`/login?next=${i}${o}`,replace:!0})}return p.jsx(p.Fragment,{children:e})}const _u="Xenon",Ev={"/overview":"Overview","/devices":"Devices","/devices/live":"Live devices","/recordings":"Recordings","/apps":"Apps","/builds":"Sessions","/selector-health":"Selector health","/selector-health/detail":"Selector health","/notifications":"Notifications","/settings":"Settings","/ai-settings":"AI engine","/maintenance":"Maintenance","/teams":"Teams","/users":"Users","/api-keys":"API keys","/profile":"Profile","/login":"Sign in","/forgot-password":"Forgot password","/reset-password":"Reset password"},rd=new Map;function qv(e,t){t&&rd.set(e,t)}function _v(e){const t=e.replace(/\/+$/,"")||"/";let n=Ev[t];if(!n){let r;if(r=t.match(/^\/devices\/([^/]+)\/control/)){const i=decodeURIComponent(r[1]);n=`${rd.get(i)||i} · Device`}else/^\/builds\/[^/]+\/sessions\//.test(t)?n="Session":/^\/builds\/[^/]+$/.test(t)?n="Sessions":/^\/recordings\/[^/]+$/.test(t)?n="Recording":(r=t.match(/^\/runbooks\/([^/]+)/))?n=`Runbook · ${decodeURIComponent(r[1])}`:t.startsWith("/reset-password/")&&(n="Reset password")}return n?`${n} · ${_u}`:_u}function Sv(){const{pathname:e}=We();return y.useEffect(()=>{document.title=_v(e)},[e]),null}const Cv=y.lazy(()=>V(()=>import("./login-BYOvz4lx.js"),__vite__mapDeps([89,13,90,91,61,48,25,2]))),Tv=y.lazy(()=>V(()=>import("./forgot-password-Dpg7yxM8.js"),__vite__mapDeps([92,90,91,61]))),Su=y.lazy(()=>V(()=>import("./reset-password-D3u4Mbvn.js"),__vite__mapDeps([93,91,61]))),Rv=y.lazy(()=>V(()=>import("./ApiKeyGate-Bhn5ZtVM.js"),[]).then(e=>({default:e.ApiKeyGate})));function Pv(){return p.jsx(fv,{children:p.jsxs("div",{className:"min-h-screen w-full bg-[var(--bg)] text-[var(--text)]",children:[p.jsx(hv,{}),p.jsx($g,{}),p.jsx("main",{className:"pl-14 pt-14 h-screen overflow-y-auto",children:p.jsx(rv,{})}),p.jsx(kv,{})]})})}function Nv(){return p.jsxs(gm,{basename:"/xenon",children:[p.jsx(Sv,{}),p.jsx(Ly,{children:p.jsx(y.Suspense,{fallback:p.jsx("div",{style:{padding:40},children:"Loading…"}),children:p.jsxs(Lf,{children:[p.jsx($,{path:"/login",element:p.jsx(Cv,{})}),p.jsx($,{path:"/forgot-password",element:p.jsx(Tv,{})}),p.jsx($,{path:"/reset-password",element:p.jsx(Su,{})}),p.jsx($,{path:"/reset-password/:token",element:p.jsx(Su,{})}),p.jsx($,{path:"/api-key-gate",element:p.jsx(Rv,{children:p.jsx(Wt,{to:"/overview",replace:!0})})}),p.jsx($,{path:"*",element:p.jsx(xv,{children:p.jsx(Pv,{})})})]})})})]})}xf.render(p.jsx(y.StrictMode,{children:p.jsx(Nv,{})}),document.getElementById("root"));export{sv as $,Af as A,zv as B,$m as C,qv as D,_v as E,av as F,Av as G,Cu as H,Wm as I,Lm as J,Rm as K,iu as L,ty as M,Wt as N,Nm as O,Vm as P,oy as Q,md as R,ly as S,py as T,gy as U,Am as V,Fv as W,An as X,Km as Y,wy as Z,bm as _,We as a,Mv as a0,my as a1,Ov as a2,yd as a3,El as b,B as c,Ny as d,jv as e,Xm as f,$v as g,Dv as h,Lv as i,p as j,Uv as k,Iv as l,Bv as m,Dg as n,Bi as o,Rg as p,uy as q,y as r,Gm as s,Vv as t,yn as u,xy as v,Dm as w,xf as x,fy as y,If as z};
|
|
219
|
+
*/const ky=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],xy=B("x",ky),Bi={"X-Appium-Is-Sensitive":"true"},gt="/xenon/api/auth";class iu extends Error{constructor(t,n,r=null){super(t),this.status=n,this.retryAfterSec=r,this.name="LoginError"}}async function Dv(e,t){let n;try{n=await fetch(`${gt}/login`,{method:"POST",credentials:"include",headers:{"Content-Type":"application/json",...Bi},body:JSON.stringify({email:e,password:t})})}catch(r){throw new iu(r.message||"Network error",0)}if(!n.ok){const r=await n.json().catch(()=>({})),i=Number(n.headers.get("Retry-After"));throw new iu(r.error||`Login failed (${n.status})`,n.status,Number.isFinite(i)&&i>0?i:null)}}async function Mv(){try{const e=await fetch(`${gt}/options`,{credentials:"include"});return e.ok?{passwordReset:(await e.json()).passwordReset==="email"?"email":"admin"}:{passwordReset:"admin"}}catch{return{passwordReset:"admin"}}}async function Ey(){await fetch(`${gt}/logout`,{method:"POST",credentials:"include"})}async function _y(){const e=await fetch(`${gt}/me`,{credentials:"include"});if(e.status===401)return null;if(!e.ok)throw new Error(`Failed to fetch /me (${e.status})`);return e.json()}async function $v(e,t){const n=await fetch(`${gt}/change-password`,{method:"POST",credentials:"include",headers:{"Content-Type":"application/json",...Bi},body:JSON.stringify({oldPassword:e,newPassword:t})});if(!n.ok){const r=await n.json().catch(()=>({}));throw new Error(r.error||`Change password failed (${n.status})`)}}async function Uv(e){const t=await fetch(`${gt}/forgot-password`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({email:e})});if(!t.ok&&t.status!==204)throw t.status===429?new Error("Too many attempts — try again later."):new Error(`Request failed (${t.status})`)}async function Bv(e){return(await fetch(`${gt}/reset-password/check`,{method:"POST",headers:{"Content-Type":"application/json",...Bi},body:JSON.stringify({token:e})})).ok}async function zv(e,t){const n=await fetch(`${gt}/reset-password`,{method:"POST",headers:{"Content-Type":"application/json",...Bi},body:JSON.stringify({token:e,newPassword:t})});if(!n.ok&&n.status!==204){const r=await n.json().catch(()=>({}));throw new Error(r.error||`Reset failed (${n.status})`)}}const Df="xenon-screenshots",He="captures",ps="udid";function Mf(e,t){return t.takenAt-e.takenAt||t.n-e.n}function ou(){const e=new Map;return{persistent:!1,async list(t){return Array.from(e.values()).filter(n=>n.udid===t).sort(Mf)},async put(t){e.set(t.id,t)},async delete(t){t.forEach(n=>e.delete(n))},async clear(t){Array.from(e.values()).filter(n=>n.udid===t).forEach(n=>e.delete(n.id))}}}function su(e){return new Promise((t,n)=>{e.onsuccess=()=>t(e.result),e.onerror=()=>n(e.error)})}function lu(e){return new Promise((t,n)=>{e.oncomplete=()=>t(),e.onerror=()=>n(e.error),e.onabort=()=>n(e.error??new Error("transaction aborted"))})}function Sy(e){return new Promise((t,n)=>{const r=e.open(Df,1);r.onupgradeneeded=()=>{r.result.createObjectStore(He,{keyPath:"id"}).createIndex(ps,"udid")},r.onsuccess=()=>{const i=r.result;i.onversionchange=()=>i.close(),t(i)},r.onerror=()=>n(r.error),r.onblocked=()=>n(new Error("blocked"))})}function Cy(e){const t=async n=>{const r=e.transaction(He,"readwrite");n(r.objectStore(He)),await lu(r)};return{persistent:!0,async list(n){const r=e.transaction(He,"readonly");return(await su(r.objectStore(He).index(ps).getAll(n))).sort(Mf)},put:n=>t(r=>r.put(n)),delete:n=>t(r=>n.forEach(i=>r.delete(i))),async clear(n){const r=e.transaction(He,"readwrite"),i=r.objectStore(He).index(ps);(await su(i.getAllKeys(n))).forEach(s=>r.objectStore(He).delete(s)),await lu(r)}}}function $f(){try{return typeof indexedDB>"u"?void 0:indexedDB}catch{return}}async function Ty(e=$f()){if(!e)return ou();try{return Cy(await Sy(e))}catch{return ou()}}let Gr=null;function bv(){return Gr||(Gr=Ty()),Gr}async function Ry(e=$f(),t=1e3){if(Gr=null,!e)return;const n=new Promise(r=>{try{const i=e.deleteDatabase(Df);i.onsuccess=()=>r(),i.onerror=()=>r(),i.onblocked=()=>r()}catch{r()}});await Promise.race([n,new Promise(r=>setTimeout(r,t))])}const xl="xenon.hadSession";function Py(){try{localStorage.setItem(xl,"1")}catch{}}function Ny(){try{localStorage.removeItem(xl)}catch{}}function Oy(){try{return localStorage.getItem(xl)==="1"}catch{return!1}}const Uf=y.createContext(null);function Ly({children:e}){const[t,n]=y.useState(!0),[r,i]=y.useState(null);async function o(){try{const l=await _y();l&&Py(),i(l)}finally{n(!1)}}async function s(){Ny(),await Promise.all([Ey(),Ry()]),i(null),window.location.href="/xenon/login"}return y.useEffect(()=>{o()},[]),p.jsx(Uf.Provider,{value:{loading:t,me:r,refresh:o,signOut:s},children:e})}function El(){const e=y.useContext(Uf);if(!e)throw new Error("useAuth must be used inside AuthProvider");return e}const De=Object.create(null);De.open="0";De.close="1";De.ping="2";De.pong="3";De.message="4";De.upgrade="5";De.noop="6";const Yr=Object.create(null);Object.keys(De).forEach(e=>{Yr[De[e]]=e});const hs={type:"error",data:"parser error"},Bf=typeof Blob=="function"||typeof Blob<"u"&&Object.prototype.toString.call(Blob)==="[object BlobConstructor]",zf=typeof ArrayBuffer=="function",bf=e=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(e):e&&e.buffer instanceof ArrayBuffer,_l=({type:e,data:t},n,r)=>Bf&&t instanceof Blob?n?r(t):au(t,r):zf&&(t instanceof ArrayBuffer||bf(t))?n?r(t):au(new Blob([t]),r):r(De[e]+(t||"")),au=(e,t)=>{const n=new FileReader;return n.onload=function(){const r=n.result.split(",")[1];t("b"+(r||""))},n.readAsDataURL(e)};function uu(e){return e instanceof Uint8Array?e:e instanceof ArrayBuffer?new Uint8Array(e):new Uint8Array(e.buffer,e.byteOffset,e.byteLength)}let vo;function jy(e,t){if(Bf&&e.data instanceof Blob)return e.data.arrayBuffer().then(uu).then(t);if(zf&&(e.data instanceof ArrayBuffer||bf(e.data)))return t(uu(e.data));_l(e,!1,n=>{vo||(vo=new TextEncoder),t(vo.encode(n))})}const cu="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Bn=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(let e=0;e<cu.length;e++)Bn[cu.charCodeAt(e)]=e;const Ay=e=>{let t=e.length*.75,n=e.length,r,i=0,o,s,l,a;e[e.length-1]==="="&&(t--,e[e.length-2]==="="&&t--);const u=new ArrayBuffer(t),m=new Uint8Array(u);for(r=0;r<n;r+=4)o=Bn[e.charCodeAt(r)],s=Bn[e.charCodeAt(r+1)],l=Bn[e.charCodeAt(r+2)],a=Bn[e.charCodeAt(r+3)],m[i++]=o<<2|s>>4,m[i++]=(s&15)<<4|l>>2,m[i++]=(l&3)<<6|a&63;return u},Iy=typeof ArrayBuffer=="function",Sl=(e,t)=>{if(typeof e!="string")return{type:"message",data:Ff(e,t)};const n=e.charAt(0);return n==="b"?{type:"message",data:Dy(e.substring(1),t)}:Yr[n]?e.length>1?{type:Yr[n],data:e.substring(1)}:{type:Yr[n]}:hs},Dy=(e,t)=>{if(Iy){const n=Ay(e);return Ff(n,t)}else return{base64:!0,data:e}},Ff=(e,t)=>{switch(t){case"blob":return e instanceof Blob?e:new Blob([e]);case"arraybuffer":default:return e instanceof ArrayBuffer?e:e.buffer}},Vf="",My=(e,t)=>{const n=e.length,r=new Array(n);let i=0;e.forEach((o,s)=>{_l(o,!1,l=>{r[s]=l,++i===n&&t(r.join(Vf))})})},$y=(e,t)=>{const n=e.split(Vf),r=[];for(let i=0;i<n.length;i++){const o=Sl(n[i],t);if(r.push(o),o.type==="error")break}return r};function Uy(){return new TransformStream({transform(e,t){jy(e,n=>{const r=n.length;let i;if(r<126)i=new Uint8Array(1),new DataView(i.buffer).setUint8(0,r);else if(r<65536){i=new Uint8Array(3);const o=new DataView(i.buffer);o.setUint8(0,126),o.setUint16(1,r)}else{i=new Uint8Array(9);const o=new DataView(i.buffer);o.setUint8(0,127),o.setBigUint64(1,BigInt(r))}e.data&&typeof e.data!="string"&&(i[0]|=128),t.enqueue(i),t.enqueue(n)})}})}let wo;function Mr(e){return e.reduce((t,n)=>t+n.length,0)}function $r(e,t){if(e[0].length===t)return e.shift();const n=new Uint8Array(t);let r=0;for(let i=0;i<t;i++)n[i]=e[0][r++],r===e[0].length&&(e.shift(),r=0);return e.length&&r<e[0].length&&(e[0]=e[0].slice(r)),n}function By(e,t){wo||(wo=new TextDecoder);const n=[];let r=0,i=-1,o=!1;return new TransformStream({transform(s,l){for(n.push(s);;){if(r===0){if(Mr(n)<1)break;const a=$r(n,1);o=(a[0]&128)===128,i=a[0]&127,i<126?r=3:i===126?r=1:r=2}else if(r===1){if(Mr(n)<2)break;const a=$r(n,2);i=new DataView(a.buffer,a.byteOffset,a.length).getUint16(0),r=3}else if(r===2){if(Mr(n)<8)break;const a=$r(n,8),u=new DataView(a.buffer,a.byteOffset,a.length),m=u.getUint32(0);if(m>Math.pow(2,21)-1){l.enqueue(hs);break}i=m*Math.pow(2,32)+u.getUint32(4),r=3}else{if(Mr(n)<i)break;const a=$r(n,i);l.enqueue(Sl(o?a:wo.decode(a),t)),r=0}if(i===0||i>e){l.enqueue(hs);break}}}})}const qf=4;function G(e){if(e)return zy(e)}function zy(e){for(var t in G.prototype)e[t]=G.prototype[t];return e}G.prototype.on=G.prototype.addEventListener=function(e,t){return this._callbacks=this._callbacks||{},(this._callbacks["$"+e]=this._callbacks["$"+e]||[]).push(t),this};G.prototype.once=function(e,t){function n(){this.off(e,n),t.apply(this,arguments)}return n.fn=t,this.on(e,n),this};G.prototype.off=G.prototype.removeListener=G.prototype.removeAllListeners=G.prototype.removeEventListener=function(e,t){if(this._callbacks=this._callbacks||{},arguments.length==0)return this._callbacks={},this;var n=this._callbacks["$"+e];if(!n)return this;if(arguments.length==1)return delete this._callbacks["$"+e],this;for(var r,i=0;i<n.length;i++)if(r=n[i],r===t||r.fn===t){n.splice(i,1);break}return n.length===0&&delete this._callbacks["$"+e],this};G.prototype.emit=function(e){this._callbacks=this._callbacks||{};for(var t=new Array(arguments.length-1),n=this._callbacks["$"+e],r=1;r<arguments.length;r++)t[r-1]=arguments[r];if(n){n=n.slice(0);for(var r=0,i=n.length;r<i;++r)n[r].apply(this,t)}return this};G.prototype.emitReserved=G.prototype.emit;G.prototype.listeners=function(e){return this._callbacks=this._callbacks||{},this._callbacks["$"+e]||[]};G.prototype.hasListeners=function(e){return!!this.listeners(e).length};const zi=typeof Promise=="function"&&typeof Promise.resolve=="function"?t=>Promise.resolve().then(t):(t,n)=>n(t,0),ve=typeof self<"u"?self:typeof window<"u"?window:Function("return this")(),by="arraybuffer";function Wf(e,...t){return t.reduce((n,r)=>(e.hasOwnProperty(r)&&(n[r]=e[r]),n),{})}const Fy=ve.setTimeout,Vy=ve.clearTimeout;function bi(e,t){t.useNativeTimers?(e.setTimeoutFn=Fy.bind(ve),e.clearTimeoutFn=Vy.bind(ve)):(e.setTimeoutFn=ve.setTimeout.bind(ve),e.clearTimeoutFn=ve.clearTimeout.bind(ve))}const qy=1.33;function Wy(e){return typeof e=="string"?Hy(e):Math.ceil((e.byteLength||e.size)*qy)}function Hy(e){let t=0,n=0;for(let r=0,i=e.length;r<i;r++)t=e.charCodeAt(r),t<128?n+=1:t<2048?n+=2:t<55296||t>=57344?n+=3:(r++,n+=4);return n}function Hf(){return Date.now().toString(36).substring(3)+Math.random().toString(36).substring(2,5)}function Ky(e){let t="";for(let n in e)e.hasOwnProperty(n)&&(t.length&&(t+="&"),t+=encodeURIComponent(n)+"="+encodeURIComponent(e[n]));return t}function Qy(e){let t={},n=e.split("&");for(let r=0,i=n.length;r<i;r++){let o=n[r].split("=");t[decodeURIComponent(o[0])]=decodeURIComponent(o[1])}return t}class Gy extends Error{constructor(t,n,r){super(t),this.description=n,this.context=r,this.type="TransportError"}}class Cl extends G{constructor(t){super(),this.writable=!1,bi(this,t),this.opts=t,this.query=t.query,this.socket=t.socket,this.supportsBinary=!t.forceBase64}onError(t,n,r){return super.emitReserved("error",new Gy(t,n,r)),this}open(){return this.readyState="opening",this.doOpen(),this}close(){return(this.readyState==="opening"||this.readyState==="open")&&(this.doClose(),this.onClose()),this}send(t){this.readyState==="open"&&this.write(t)}onOpen(){this.readyState="open",this.writable=!0,super.emitReserved("open")}onData(t){const n=Sl(t,this.socket.binaryType);this.onPacket(n)}onPacket(t){super.emitReserved("packet",t)}onClose(t){this.readyState="closed",super.emitReserved("close",t)}pause(t){}createUri(t,n={}){return t+"://"+this._hostname()+this._port()+this.opts.path+this._query(n)}_hostname(){const t=this.opts.hostname;return t.indexOf(":")===-1?t:"["+t+"]"}_port(){return this.opts.port&&(this.opts.secure&&Number(this.opts.port)!==443||!this.opts.secure&&Number(this.opts.port)!==80)?":"+this.opts.port:""}_query(t){const n=Ky(t);return n.length?"?"+n:""}}class Yy extends Cl{constructor(){super(...arguments),this._polling=!1}get name(){return"polling"}doOpen(){this._poll()}pause(t){this.readyState="pausing";const n=()=>{this.readyState="paused",t()};if(this._polling||!this.writable){let r=0;this._polling&&(r++,this.once("pollComplete",function(){--r||n()})),this.writable||(r++,this.once("drain",function(){--r||n()}))}else n()}_poll(){this._polling=!0,this.doPoll(),this.emitReserved("poll")}onData(t){const n=r=>{if(this.readyState==="opening"&&r.type==="open"&&this.onOpen(),r.type==="close")return this.onClose({description:"transport closed by the server"}),!1;this.onPacket(r)};$y(t,this.socket.binaryType).forEach(n),this.readyState!=="closed"&&(this._polling=!1,this.emitReserved("pollComplete"),this.readyState==="open"&&this._poll())}doClose(){const t=()=>{this.write([{type:"close"}])};this.readyState==="open"?t():this.once("open",t)}write(t){this.writable=!1,My(t,n=>{this.doWrite(n,()=>{this.writable=!0,this.emitReserved("drain")})})}uri(){const t=this.opts.secure?"https":"http",n=this.query||{};return this.opts.timestampRequests!==!1&&(n[this.opts.timestampParam]=Hf()),!this.supportsBinary&&!n.sid&&(n.b64=1),this.createUri(t,n)}}let Kf=!1;try{Kf=typeof XMLHttpRequest<"u"&&"withCredentials"in new XMLHttpRequest}catch{}const Xy=Kf;function Jy(){}class Zy extends Yy{constructor(t){if(super(t),typeof location<"u"){const n=location.protocol==="https:";let r=location.port;r||(r=n?"443":"80"),this.xd=typeof location<"u"&&t.hostname!==location.hostname||r!==t.port}}doWrite(t,n){const r=this.request({method:"POST",data:t});r.on("success",n),r.on("error",(i,o)=>{this.onError("xhr post error",i,o)})}doPoll(){const t=this.request();t.on("data",this.onData.bind(this)),t.on("error",(n,r)=>{this.onError("xhr poll error",n,r)}),this.pollXhr=t}}class Ie extends G{constructor(t,n,r){super(),this.createRequest=t,bi(this,r),this._opts=r,this._method=r.method||"GET",this._uri=n,this._data=r.data!==void 0?r.data:null,this._create()}_create(){var t;const n=Wf(this._opts,"agent","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","autoUnref");n.xdomain=!!this._opts.xd;const r=this._xhr=this.createRequest(n);try{r.open(this._method,this._uri,!0);try{if(this._opts.extraHeaders){r.setDisableHeaderCheck&&r.setDisableHeaderCheck(!0);for(let i in this._opts.extraHeaders)this._opts.extraHeaders.hasOwnProperty(i)&&r.setRequestHeader(i,this._opts.extraHeaders[i])}}catch{}if(this._method==="POST")try{r.setRequestHeader("Content-type","text/plain;charset=UTF-8")}catch{}try{r.setRequestHeader("Accept","*/*")}catch{}(t=this._opts.cookieJar)===null||t===void 0||t.addCookies(r),"withCredentials"in r&&(r.withCredentials=this._opts.withCredentials),this._opts.requestTimeout&&(r.timeout=this._opts.requestTimeout),r.onreadystatechange=()=>{var i;r.readyState===3&&((i=this._opts.cookieJar)===null||i===void 0||i.parseCookies(r.getResponseHeader("set-cookie"))),r.readyState===4&&(r.status===200||r.status===1223?this._onLoad():this.setTimeoutFn(()=>{this._onError(typeof r.status=="number"?r.status:0)},0))},r.send(this._data)}catch(i){this.setTimeoutFn(()=>{this._onError(i)},0);return}typeof document<"u"&&(this._index=Ie.requestsCount++,Ie.requests[this._index]=this)}_onError(t){this.emitReserved("error",t,this._xhr),this._cleanup(!0)}_cleanup(t){if(!(typeof this._xhr>"u"||this._xhr===null)){if(this._xhr.onreadystatechange=Jy,t)try{this._xhr.abort()}catch{}typeof document<"u"&&delete Ie.requests[this._index],this._xhr=null}}_onLoad(){const t=this._xhr.responseText;t!==null&&(this.emitReserved("data",t),this.emitReserved("success"),this._cleanup())}abort(){this._cleanup()}}Ie.requestsCount=0;Ie.requests={};if(typeof document<"u"){if(typeof attachEvent=="function")attachEvent("onunload",fu);else if(typeof addEventListener=="function"){const e="onpagehide"in ve?"pagehide":"unload";addEventListener(e,fu,!1)}}function fu(){for(let e in Ie.requests)Ie.requests.hasOwnProperty(e)&&Ie.requests[e].abort()}const eg=function(){const e=Qf({xdomain:!1});return e&&e.responseType!==null}();class tg extends Zy{constructor(t){super(t);const n=t&&t.forceBase64;this.supportsBinary=eg&&!n}request(t={}){return Object.assign(t,{xd:this.xd},this.opts),new Ie(Qf,this.uri(),t)}}function Qf(e){const t=e.xdomain;try{if(typeof XMLHttpRequest<"u"&&(!t||Xy))return new XMLHttpRequest}catch{}if(!t)try{return new ve[["Active"].concat("Object").join("X")]("Microsoft.XMLHTTP")}catch{}}const Gf=typeof navigator<"u"&&typeof navigator.product=="string"&&navigator.product.toLowerCase()==="reactnative";class ng extends Cl{get name(){return"websocket"}doOpen(){const t=this.uri(),n=this.opts.protocols,r=Gf?{}:Wf(this.opts,"agent","perMessageDeflate","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","localAddress","protocolVersion","origin","maxPayload","family","checkServerIdentity");this.opts.extraHeaders&&(r.headers=this.opts.extraHeaders);try{this.ws=this.createSocket(t,n,r)}catch(i){return this.emitReserved("error",i)}this.ws.binaryType=this.socket.binaryType,this.addEventListeners()}addEventListeners(){this.ws.onopen=()=>{this.opts.autoUnref&&this.ws._socket.unref(),this.onOpen()},this.ws.onclose=t=>this.onClose({description:"websocket connection closed",context:t}),this.ws.onmessage=t=>this.onData(t.data),this.ws.onerror=t=>this.onError("websocket error",t)}write(t){this.writable=!1;for(let n=0;n<t.length;n++){const r=t[n],i=n===t.length-1;_l(r,this.supportsBinary,o=>{try{this.doWrite(r,o)}catch{}i&&zi(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){typeof this.ws<"u"&&(this.ws.onerror=()=>{},this.ws.close(),this.ws=null)}uri(){const t=this.opts.secure?"wss":"ws",n=this.query||{};return this.opts.timestampRequests&&(n[this.opts.timestampParam]=Hf()),this.supportsBinary||(n.b64=1),this.createUri(t,n)}}const ko=ve.WebSocket||ve.MozWebSocket;class rg extends ng{createSocket(t,n,r){return Gf?new ko(t,n,r):n?new ko(t,n):new ko(t)}doWrite(t,n){this.ws.send(n)}}class ig extends Cl{get name(){return"webtransport"}doOpen(){try{this._transport=new WebTransport(this.createUri("https"),this.opts.transportOptions[this.name])}catch(t){return this.emitReserved("error",t)}this._transport.closed.then(()=>{this.onClose()}).catch(t=>{this.onError("webtransport error",t)}),this._transport.ready.then(()=>{this._transport.createBidirectionalStream().then(t=>{const n=By(Number.MAX_SAFE_INTEGER,this.socket.binaryType),r=t.readable.pipeThrough(n).getReader(),i=Uy();i.readable.pipeTo(t.writable),this._writer=i.writable.getWriter();const o=()=>{r.read().then(({done:l,value:a})=>{l||(this.onPacket(a),o())}).catch(l=>{})};o();const s={type:"open"};this.query.sid&&(s.data=`{"sid":"${this.query.sid}"}`),this._writer.write(s).then(()=>this.onOpen())})})}write(t){this.writable=!1;for(let n=0;n<t.length;n++){const r=t[n],i=n===t.length-1;this._writer.write(r).then(()=>{i&&zi(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){var t;(t=this._transport)===null||t===void 0||t.close()}}const og={websocket:rg,webtransport:ig,polling:tg},sg=/^(?:(?![^:@\/?#]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@\/?#]*)(?::([^:@\/?#]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,lg=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"];function ms(e){if(e.length>8e3)throw"URI too long";const t=e,n=e.indexOf("["),r=e.indexOf("]");n!=-1&&r!=-1&&(e=e.substring(0,n)+e.substring(n,r).replace(/:/g,";")+e.substring(r,e.length));let i=sg.exec(e||""),o={},s=14;for(;s--;)o[lg[s]]=i[s]||"";return n!=-1&&r!=-1&&(o.source=t,o.host=o.host.substring(1,o.host.length-1).replace(/;/g,":"),o.authority=o.authority.replace("[","").replace("]","").replace(/;/g,":"),o.ipv6uri=!0),o.pathNames=ag(o,o.path),o.queryKey=ug(o,o.query),o}function ag(e,t){const n=/\/{2,9}/g,r=t.replace(n,"/").split("/");return(t.slice(0,1)=="/"||t.length===0)&&r.splice(0,1),t.slice(-1)=="/"&&r.splice(r.length-1,1),r}function ug(e,t){const n={};return t.replace(/(?:^|&)([^&=]*)=?([^&]*)/g,function(r,i,o){i&&(n[i]=o)}),n}const ys=typeof addEventListener=="function"&&typeof removeEventListener=="function",Xr=[];ys&&addEventListener("offline",()=>{Xr.forEach(e=>e())},!1);class at extends G{constructor(t,n){if(super(),this.binaryType=by,this.writeBuffer=[],this._prevBufferLen=0,this._pingInterval=-1,this._pingTimeout=-1,this._maxPayload=-1,this._pingTimeoutTime=1/0,t&&typeof t=="object"&&(n=t,t=null),t){const r=ms(t);n.hostname=r.host,n.secure=r.protocol==="https"||r.protocol==="wss",n.port=r.port,r.query&&(n.query=r.query)}else n.host&&(n.hostname=ms(n.host).host);bi(this,n),this.secure=n.secure!=null?n.secure:typeof location<"u"&&location.protocol==="https:",n.hostname&&!n.port&&(n.port=this.secure?"443":"80"),this.hostname=n.hostname||(typeof location<"u"?location.hostname:"localhost"),this.port=n.port||(typeof location<"u"&&location.port?location.port:this.secure?"443":"80"),this.transports=[],this._transportsByName={},n.transports.forEach(r=>{const i=r.prototype.name;this.transports.push(i),this._transportsByName[i]=r}),this.opts=Object.assign({path:"/engine.io",agent:!1,withCredentials:!1,upgrade:!0,timestampParam:"t",rememberUpgrade:!1,addTrailingSlash:!0,rejectUnauthorized:!0,perMessageDeflate:{threshold:1024},transportOptions:{},closeOnBeforeunload:!1},n),this.opts.path=this.opts.path.replace(/\/$/,"")+(this.opts.addTrailingSlash?"/":""),typeof this.opts.query=="string"&&(this.opts.query=Qy(this.opts.query)),ys&&(this.opts.closeOnBeforeunload&&(this._beforeunloadEventListener=()=>{this.transport&&(this.transport.removeAllListeners(),this.transport.close())},addEventListener("beforeunload",this._beforeunloadEventListener,!1)),this.hostname!=="localhost"&&(this._offlineEventListener=()=>{this._onClose("transport close",{description:"network connection lost"})},Xr.push(this._offlineEventListener))),this.opts.withCredentials&&(this._cookieJar=void 0),this._open()}createTransport(t){const n=Object.assign({},this.opts.query);n.EIO=qf,n.transport=t,this.id&&(n.sid=this.id);const r=Object.assign({},this.opts,{query:n,socket:this,hostname:this.hostname,secure:this.secure,port:this.port},this.opts.transportOptions[t]);return new this._transportsByName[t](r)}_open(){if(this.transports.length===0){this.setTimeoutFn(()=>{this.emitReserved("error","No transports available")},0);return}const t=this.opts.rememberUpgrade&&at.priorWebsocketSuccess&&this.transports.indexOf("websocket")!==-1?"websocket":this.transports[0];this.readyState="opening";const n=this.createTransport(t);n.open(),this.setTransport(n)}setTransport(t){this.transport&&this.transport.removeAllListeners(),this.transport=t,t.on("drain",this._onDrain.bind(this)).on("packet",this._onPacket.bind(this)).on("error",this._onError.bind(this)).on("close",n=>this._onClose("transport close",n))}onOpen(){this.readyState="open",at.priorWebsocketSuccess=this.transport.name==="websocket",this.emitReserved("open"),this.flush()}_onPacket(t){if(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing")switch(this.emitReserved("packet",t),this.emitReserved("heartbeat"),t.type){case"open":this.onHandshake(JSON.parse(t.data));break;case"ping":this._sendPacket("pong"),this.emitReserved("ping"),this.emitReserved("pong"),this._resetPingTimeout();break;case"error":const n=new Error("server error");n.code=t.data,this._onError(n);break;case"message":this.emitReserved("data",t.data),this.emitReserved("message",t.data);break}}onHandshake(t){this.emitReserved("handshake",t),this.id=t.sid,this.transport.query.sid=t.sid,this._pingInterval=t.pingInterval,this._pingTimeout=t.pingTimeout,this._maxPayload=t.maxPayload,this.onOpen(),this.readyState!=="closed"&&this._resetPingTimeout()}_resetPingTimeout(){this.clearTimeoutFn(this._pingTimeoutTimer);const t=this._pingInterval+this._pingTimeout;this._pingTimeoutTime=Date.now()+t,this._pingTimeoutTimer=this.setTimeoutFn(()=>{this._onClose("ping timeout")},t),this.opts.autoUnref&&this._pingTimeoutTimer.unref()}_onDrain(){this.writeBuffer.splice(0,this._prevBufferLen),this._prevBufferLen=0,this.writeBuffer.length===0?this.emitReserved("drain"):this.flush()}flush(){if(this.readyState!=="closed"&&this.transport.writable&&!this.upgrading&&this.writeBuffer.length){const t=this._getWritablePackets();this.transport.send(t),this._prevBufferLen=t.length,this.emitReserved("flush")}}_getWritablePackets(){if(!(this._maxPayload&&this.transport.name==="polling"&&this.writeBuffer.length>1))return this.writeBuffer;let n=1;for(let r=0;r<this.writeBuffer.length;r++){const i=this.writeBuffer[r].data;if(i&&(n+=Wy(i)),r>0&&n>this._maxPayload)return this.writeBuffer.slice(0,r);n+=2}return this.writeBuffer}_hasPingExpired(){if(!this._pingTimeoutTime)return!0;const t=Date.now()>this._pingTimeoutTime;return t&&(this._pingTimeoutTime=0,zi(()=>{this._onClose("ping timeout")},this.setTimeoutFn)),t}write(t,n,r){return this._sendPacket("message",t,n,r),this}send(t,n,r){return this._sendPacket("message",t,n,r),this}_sendPacket(t,n,r,i){if(typeof n=="function"&&(i=n,n=void 0),typeof r=="function"&&(i=r,r=null),this.readyState==="closing"||this.readyState==="closed")return;r=r||{},r.compress=r.compress!==!1;const o={type:t,data:n,options:r};this.emitReserved("packetCreate",o),this.writeBuffer.push(o),i&&this.once("flush",i),this.flush()}close(){const t=()=>{this._onClose("forced close"),this.transport.close()},n=()=>{this.off("upgrade",n),this.off("upgradeError",n),t()},r=()=>{this.once("upgrade",n),this.once("upgradeError",n)};return(this.readyState==="opening"||this.readyState==="open")&&(this.readyState="closing",this.writeBuffer.length?this.once("drain",()=>{this.upgrading?r():t()}):this.upgrading?r():t()),this}_onError(t){if(at.priorWebsocketSuccess=!1,this.opts.tryAllTransports&&this.transports.length>1&&this.readyState==="opening")return this.transports.shift(),this._open();this.emitReserved("error",t),this._onClose("transport error",t)}_onClose(t,n){if(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing"){if(this.clearTimeoutFn(this._pingTimeoutTimer),this.transport.removeAllListeners("close"),this.transport.close(),this.transport.removeAllListeners(),ys&&(this._beforeunloadEventListener&&removeEventListener("beforeunload",this._beforeunloadEventListener,!1),this._offlineEventListener)){const r=Xr.indexOf(this._offlineEventListener);r!==-1&&Xr.splice(r,1)}this.readyState="closed",this.id=null,this.emitReserved("close",t,n),this.writeBuffer=[],this._prevBufferLen=0}}}at.protocol=qf;class cg extends at{constructor(){super(...arguments),this._upgrades=[]}onOpen(){if(super.onOpen(),this.readyState==="open"&&this.opts.upgrade)for(let t=0;t<this._upgrades.length;t++)this._probe(this._upgrades[t])}_probe(t){let n=this.createTransport(t),r=!1;at.priorWebsocketSuccess=!1;const i=()=>{r||(n.send([{type:"ping",data:"probe"}]),n.once("packet",v=>{if(!r)if(v.type==="pong"&&v.data==="probe"){if(this.upgrading=!0,this.emitReserved("upgrading",n),!n)return;at.priorWebsocketSuccess=n.name==="websocket",this.transport.pause(()=>{r||this.readyState!=="closed"&&(m(),this.setTransport(n),n.send([{type:"upgrade"}]),this.emitReserved("upgrade",n),n=null,this.upgrading=!1,this.flush())})}else{const h=new Error("probe error");h.transport=n.name,this.emitReserved("upgradeError",h)}}))};function o(){r||(r=!0,m(),n.close(),n=null)}const s=v=>{const h=new Error("probe error: "+v);h.transport=n.name,o(),this.emitReserved("upgradeError",h)};function l(){s("transport closed")}function a(){s("socket closed")}function u(v){n&&v.name!==n.name&&o()}const m=()=>{n.removeListener("open",i),n.removeListener("error",s),n.removeListener("close",l),this.off("close",a),this.off("upgrading",u)};n.once("open",i),n.once("error",s),n.once("close",l),this.once("close",a),this.once("upgrading",u),this._upgrades.indexOf("webtransport")!==-1&&t!=="webtransport"?this.setTimeoutFn(()=>{r||n.open()},200):n.open()}onHandshake(t){this._upgrades=this._filterUpgrades(t.upgrades),super.onHandshake(t)}_filterUpgrades(t){const n=[];for(let r=0;r<t.length;r++)~this.transports.indexOf(t[r])&&n.push(t[r]);return n}}let fg=class extends cg{constructor(t,n={}){const r=typeof t=="object"?t:n;(!r.transports||r.transports&&typeof r.transports[0]=="string")&&(r.transports=(r.transports||["polling","websocket","webtransport"]).map(i=>og[i]).filter(i=>!!i)),super(t,r)}};function dg(e,t="",n){let r=e;n=n||typeof location<"u"&&location,e==null&&(e=n.protocol+"//"+n.host),typeof e=="string"&&(e.charAt(0)==="/"&&(e.charAt(1)==="/"?e=n.protocol+e:e=n.host+e),/^(https?|wss?):\/\//.test(e)||(typeof n<"u"?e=n.protocol+"//"+e:e="https://"+e),r=ms(e)),r.port||(/^(http|ws)$/.test(r.protocol)?r.port="80":/^(http|ws)s$/.test(r.protocol)&&(r.port="443")),r.path=r.path||"/";const o=r.host.indexOf(":")!==-1?"["+r.host+"]":r.host;return r.id=r.protocol+"://"+o+":"+r.port+t,r.href=r.protocol+"://"+o+(n&&n.port===r.port?"":":"+r.port),r}const pg=typeof ArrayBuffer=="function",hg=e=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(e):e.buffer instanceof ArrayBuffer,Yf=Object.prototype.toString,mg=typeof Blob=="function"||typeof Blob<"u"&&Yf.call(Blob)==="[object BlobConstructor]",yg=typeof File=="function"||typeof File<"u"&&Yf.call(File)==="[object FileConstructor]";function Tl(e){return pg&&(e instanceof ArrayBuffer||hg(e))||mg&&e instanceof Blob||yg&&e instanceof File}function Jr(e,t){if(!e||typeof e!="object")return!1;if(Array.isArray(e)){for(let n=0,r=e.length;n<r;n++)if(Jr(e[n]))return!0;return!1}if(Tl(e))return!0;if(e.toJSON&&typeof e.toJSON=="function"&&arguments.length===1)return Jr(e.toJSON(),!0);for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&Jr(e[n]))return!0;return!1}function gg(e){const t=[],n=e.data,r=e;return r.data=gs(n,t),r.attachments=t.length,{packet:r,buffers:t}}function gs(e,t){if(!e)return e;if(Tl(e)){const n={_placeholder:!0,num:t.length};return t.push(e),n}else if(Array.isArray(e)){const n=new Array(e.length);for(let r=0;r<e.length;r++)n[r]=gs(e[r],t);return n}else if(typeof e=="object"&&!(e instanceof Date)){const n={};for(const r in e)Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=gs(e[r],t));return n}return e}function vg(e,t){return e.data=vs(e.data,t),delete e.attachments,e}function vs(e,t){if(!e)return e;if(e&&e._placeholder===!0){if(typeof e.num=="number"&&e.num>=0&&e.num<t.length)return t[e.num];throw new Error("illegal attachments")}else if(Array.isArray(e))for(let n=0;n<e.length;n++)e[n]=vs(e[n],t);else if(typeof e=="object")for(const n in e)Object.prototype.hasOwnProperty.call(e,n)&&(e[n]=vs(e[n],t));return e}const wg=["connect","connect_error","disconnect","disconnecting","newListener","removeListener"];var D;(function(e){e[e.CONNECT=0]="CONNECT",e[e.DISCONNECT=1]="DISCONNECT",e[e.EVENT=2]="EVENT",e[e.ACK=3]="ACK",e[e.CONNECT_ERROR=4]="CONNECT_ERROR",e[e.BINARY_EVENT=5]="BINARY_EVENT",e[e.BINARY_ACK=6]="BINARY_ACK"})(D||(D={}));class kg{constructor(t){this.replacer=t}encode(t){return(t.type===D.EVENT||t.type===D.ACK)&&Jr(t)?this.encodeAsBinary({type:t.type===D.EVENT?D.BINARY_EVENT:D.BINARY_ACK,nsp:t.nsp,data:t.data,id:t.id}):[this.encodeAsString(t)]}encodeAsString(t){let n=""+t.type;return(t.type===D.BINARY_EVENT||t.type===D.BINARY_ACK)&&(n+=t.attachments+"-"),t.nsp&&t.nsp!=="/"&&(n+=t.nsp+","),t.id!=null&&(n+=t.id),t.data!=null&&(n+=JSON.stringify(t.data,this.replacer)),n}encodeAsBinary(t){const n=gg(t),r=this.encodeAsString(n.packet),i=n.buffers;return i.unshift(r),i}}class Rl extends G{constructor(t){super(),this.reviver=t}add(t){let n;if(typeof t=="string"){if(this.reconstructor)throw new Error("got plaintext data when reconstructing a packet");n=this.decodeString(t);const r=n.type===D.BINARY_EVENT;r||n.type===D.BINARY_ACK?(n.type=r?D.EVENT:D.ACK,this.reconstructor=new xg(n),n.attachments===0&&super.emitReserved("decoded",n)):super.emitReserved("decoded",n)}else if(Tl(t)||t.base64)if(this.reconstructor)n=this.reconstructor.takeBinaryData(t),n&&(this.reconstructor=null,super.emitReserved("decoded",n));else throw new Error("got binary data when not reconstructing a packet");else throw new Error("Unknown type: "+t)}decodeString(t){let n=0;const r={type:Number(t.charAt(0))};if(D[r.type]===void 0)throw new Error("unknown packet type "+r.type);if(r.type===D.BINARY_EVENT||r.type===D.BINARY_ACK){const o=n+1;for(;t.charAt(++n)!=="-"&&n!=t.length;);const s=t.substring(o,n);if(s!=Number(s)||t.charAt(n)!=="-")throw new Error("Illegal attachments");r.attachments=Number(s)}if(t.charAt(n+1)==="/"){const o=n+1;for(;++n&&!(t.charAt(n)===","||n===t.length););r.nsp=t.substring(o,n)}else r.nsp="/";const i=t.charAt(n+1);if(i!==""&&Number(i)==i){const o=n+1;for(;++n;){const s=t.charAt(n);if(s==null||Number(s)!=s){--n;break}if(n===t.length)break}r.id=Number(t.substring(o,n+1))}if(t.charAt(++n)){const o=this.tryParse(t.substr(n));if(Rl.isPayloadValid(r.type,o))r.data=o;else throw new Error("invalid payload")}return r}tryParse(t){try{return JSON.parse(t,this.reviver)}catch{return!1}}static isPayloadValid(t,n){switch(t){case D.CONNECT:return du(n);case D.DISCONNECT:return n===void 0;case D.CONNECT_ERROR:return typeof n=="string"||du(n);case D.EVENT:case D.BINARY_EVENT:return Array.isArray(n)&&(typeof n[0]=="number"||typeof n[0]=="string"&&wg.indexOf(n[0])===-1);case D.ACK:case D.BINARY_ACK:return Array.isArray(n)}}destroy(){this.reconstructor&&(this.reconstructor.finishedReconstruction(),this.reconstructor=null)}}class xg{constructor(t){this.packet=t,this.buffers=[],this.reconPack=t}takeBinaryData(t){if(this.buffers.push(t),this.buffers.length===this.reconPack.attachments){const n=vg(this.reconPack,this.buffers);return this.finishedReconstruction(),n}return null}finishedReconstruction(){this.reconPack=null,this.buffers=[]}}function du(e){return Object.prototype.toString.call(e)==="[object Object]"}const Eg=Object.freeze(Object.defineProperty({__proto__:null,Decoder:Rl,Encoder:kg,get PacketType(){return D}},Symbol.toStringTag,{value:"Module"}));function Re(e,t,n){return e.on(t,n),function(){e.off(t,n)}}const _g=Object.freeze({connect:1,connect_error:1,disconnect:1,disconnecting:1,newListener:1,removeListener:1});class Xf extends G{constructor(t,n,r){super(),this.connected=!1,this.recovered=!1,this.receiveBuffer=[],this.sendBuffer=[],this._queue=[],this._queueSeq=0,this.ids=0,this.acks={},this.flags={},this.io=t,this.nsp=n,r&&r.auth&&(this.auth=r.auth),this._opts=Object.assign({},r),this.io._autoConnect&&this.open()}get disconnected(){return!this.connected}subEvents(){if(this.subs)return;const t=this.io;this.subs=[Re(t,"open",this.onopen.bind(this)),Re(t,"packet",this.onpacket.bind(this)),Re(t,"error",this.onerror.bind(this)),Re(t,"close",this.onclose.bind(this))]}get active(){return!!this.subs}connect(){return this.connected?this:(this.subEvents(),this.io._reconnecting||this.io.open(),this.io._readyState==="open"&&this.onopen(),this)}open(){return this.connect()}send(...t){return t.unshift("message"),this.emit.apply(this,t),this}emit(t,...n){var r,i,o;if(_g.hasOwnProperty(t))throw new Error('"'+t.toString()+'" is a reserved event name');if(n.unshift(t),this._opts.retries&&!this.flags.fromQueue&&!this.flags.volatile)return this._addToQueue(n),this;const s={type:D.EVENT,data:n};if(s.options={},s.options.compress=this.flags.compress!==!1,typeof n[n.length-1]=="function"){const m=this.ids++,v=n.pop();this._registerAckCallback(m,v),s.id=m}const l=(i=(r=this.io.engine)===null||r===void 0?void 0:r.transport)===null||i===void 0?void 0:i.writable,a=this.connected&&!(!((o=this.io.engine)===null||o===void 0)&&o._hasPingExpired());return this.flags.volatile&&!l||(a?(this.notifyOutgoingListeners(s),this.packet(s)):this.sendBuffer.push(s)),this.flags={},this}_registerAckCallback(t,n){var r;const i=(r=this.flags.timeout)!==null&&r!==void 0?r:this._opts.ackTimeout;if(i===void 0){this.acks[t]=n;return}const o=this.io.setTimeoutFn(()=>{delete this.acks[t];for(let l=0;l<this.sendBuffer.length;l++)this.sendBuffer[l].id===t&&this.sendBuffer.splice(l,1);n.call(this,new Error("operation has timed out"))},i),s=(...l)=>{this.io.clearTimeoutFn(o),n.apply(this,l)};s.withError=!0,this.acks[t]=s}emitWithAck(t,...n){return new Promise((r,i)=>{const o=(s,l)=>s?i(s):r(l);o.withError=!0,n.push(o),this.emit(t,...n)})}_addToQueue(t){let n;typeof t[t.length-1]=="function"&&(n=t.pop());const r={id:this._queueSeq++,tryCount:0,pending:!1,args:t,flags:Object.assign({fromQueue:!0},this.flags)};t.push((i,...o)=>(this._queue[0],i!==null?r.tryCount>this._opts.retries&&(this._queue.shift(),n&&n(i)):(this._queue.shift(),n&&n(null,...o)),r.pending=!1,this._drainQueue())),this._queue.push(r),this._drainQueue()}_drainQueue(t=!1){if(!this.connected||this._queue.length===0)return;const n=this._queue[0];n.pending&&!t||(n.pending=!0,n.tryCount++,this.flags=n.flags,this.emit.apply(this,n.args))}packet(t){t.nsp=this.nsp,this.io._packet(t)}onopen(){typeof this.auth=="function"?this.auth(t=>{this._sendConnectPacket(t)}):this._sendConnectPacket(this.auth)}_sendConnectPacket(t){this.packet({type:D.CONNECT,data:this._pid?Object.assign({pid:this._pid,offset:this._lastOffset},t):t})}onerror(t){this.connected||this.emitReserved("connect_error",t)}onclose(t,n){this.connected=!1,delete this.id,this.emitReserved("disconnect",t,n),this._clearAcks()}_clearAcks(){Object.keys(this.acks).forEach(t=>{if(!this.sendBuffer.some(r=>String(r.id)===t)){const r=this.acks[t];delete this.acks[t],r.withError&&r.call(this,new Error("socket has been disconnected"))}})}onpacket(t){if(t.nsp===this.nsp)switch(t.type){case D.CONNECT:t.data&&t.data.sid?this.onconnect(t.data.sid,t.data.pid):this.emitReserved("connect_error",new Error("It seems you are trying to reach a Socket.IO server in v2.x with a v3.x client, but they are not compatible (more information here: https://socket.io/docs/v3/migrating-from-2-x-to-3-0/)"));break;case D.EVENT:case D.BINARY_EVENT:this.onevent(t);break;case D.ACK:case D.BINARY_ACK:this.onack(t);break;case D.DISCONNECT:this.ondisconnect();break;case D.CONNECT_ERROR:this.destroy();const r=new Error(t.data.message);r.data=t.data.data,this.emitReserved("connect_error",r);break}}onevent(t){const n=t.data||[];t.id!=null&&n.push(this.ack(t.id)),this.connected?this.emitEvent(n):this.receiveBuffer.push(Object.freeze(n))}emitEvent(t){if(this._anyListeners&&this._anyListeners.length){const n=this._anyListeners.slice();for(const r of n)r.apply(this,t)}super.emit.apply(this,t),this._pid&&t.length&&typeof t[t.length-1]=="string"&&(this._lastOffset=t[t.length-1])}ack(t){const n=this;let r=!1;return function(...i){r||(r=!0,n.packet({type:D.ACK,id:t,data:i}))}}onack(t){const n=this.acks[t.id];typeof n=="function"&&(delete this.acks[t.id],n.withError&&t.data.unshift(null),n.apply(this,t.data))}onconnect(t,n){this.id=t,this.recovered=n&&this._pid===n,this._pid=n,this.connected=!0,this.emitBuffered(),this._drainQueue(!0),this.emitReserved("connect")}emitBuffered(){this.receiveBuffer.forEach(t=>this.emitEvent(t)),this.receiveBuffer=[],this.sendBuffer.forEach(t=>{this.notifyOutgoingListeners(t),this.packet(t)}),this.sendBuffer=[]}ondisconnect(){this.destroy(),this.onclose("io server disconnect")}destroy(){this.subs&&(this.subs.forEach(t=>t()),this.subs=void 0),this.io._destroy(this)}disconnect(){return this.connected&&this.packet({type:D.DISCONNECT}),this.destroy(),this.connected&&this.onclose("io client disconnect"),this}close(){return this.disconnect()}compress(t){return this.flags.compress=t,this}get volatile(){return this.flags.volatile=!0,this}timeout(t){return this.flags.timeout=t,this}onAny(t){return this._anyListeners=this._anyListeners||[],this._anyListeners.push(t),this}prependAny(t){return this._anyListeners=this._anyListeners||[],this._anyListeners.unshift(t),this}offAny(t){if(!this._anyListeners)return this;if(t){const n=this._anyListeners;for(let r=0;r<n.length;r++)if(t===n[r])return n.splice(r,1),this}else this._anyListeners=[];return this}listenersAny(){return this._anyListeners||[]}onAnyOutgoing(t){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.push(t),this}prependAnyOutgoing(t){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.unshift(t),this}offAnyOutgoing(t){if(!this._anyOutgoingListeners)return this;if(t){const n=this._anyOutgoingListeners;for(let r=0;r<n.length;r++)if(t===n[r])return n.splice(r,1),this}else this._anyOutgoingListeners=[];return this}listenersAnyOutgoing(){return this._anyOutgoingListeners||[]}notifyOutgoingListeners(t){if(this._anyOutgoingListeners&&this._anyOutgoingListeners.length){const n=this._anyOutgoingListeners.slice();for(const r of n)r.apply(this,t.data)}}}function gn(e){e=e||{},this.ms=e.min||100,this.max=e.max||1e4,this.factor=e.factor||2,this.jitter=e.jitter>0&&e.jitter<=1?e.jitter:0,this.attempts=0}gn.prototype.duration=function(){var e=this.ms*Math.pow(this.factor,this.attempts++);if(this.jitter){var t=Math.random(),n=Math.floor(t*this.jitter*e);e=Math.floor(t*10)&1?e+n:e-n}return Math.min(e,this.max)|0};gn.prototype.reset=function(){this.attempts=0};gn.prototype.setMin=function(e){this.ms=e};gn.prototype.setMax=function(e){this.max=e};gn.prototype.setJitter=function(e){this.jitter=e};class ws extends G{constructor(t,n){var r;super(),this.nsps={},this.subs=[],t&&typeof t=="object"&&(n=t,t=void 0),n=n||{},n.path=n.path||"/socket.io",this.opts=n,bi(this,n),this.reconnection(n.reconnection!==!1),this.reconnectionAttempts(n.reconnectionAttempts||1/0),this.reconnectionDelay(n.reconnectionDelay||1e3),this.reconnectionDelayMax(n.reconnectionDelayMax||5e3),this.randomizationFactor((r=n.randomizationFactor)!==null&&r!==void 0?r:.5),this.backoff=new gn({min:this.reconnectionDelay(),max:this.reconnectionDelayMax(),jitter:this.randomizationFactor()}),this.timeout(n.timeout==null?2e4:n.timeout),this._readyState="closed",this.uri=t;const i=n.parser||Eg;this.encoder=new i.Encoder,this.decoder=new i.Decoder,this._autoConnect=n.autoConnect!==!1,this._autoConnect&&this.open()}reconnection(t){return arguments.length?(this._reconnection=!!t,t||(this.skipReconnect=!0),this):this._reconnection}reconnectionAttempts(t){return t===void 0?this._reconnectionAttempts:(this._reconnectionAttempts=t,this)}reconnectionDelay(t){var n;return t===void 0?this._reconnectionDelay:(this._reconnectionDelay=t,(n=this.backoff)===null||n===void 0||n.setMin(t),this)}randomizationFactor(t){var n;return t===void 0?this._randomizationFactor:(this._randomizationFactor=t,(n=this.backoff)===null||n===void 0||n.setJitter(t),this)}reconnectionDelayMax(t){var n;return t===void 0?this._reconnectionDelayMax:(this._reconnectionDelayMax=t,(n=this.backoff)===null||n===void 0||n.setMax(t),this)}timeout(t){return arguments.length?(this._timeout=t,this):this._timeout}maybeReconnectOnOpen(){!this._reconnecting&&this._reconnection&&this.backoff.attempts===0&&this.reconnect()}open(t){if(~this._readyState.indexOf("open"))return this;this.engine=new fg(this.uri,this.opts);const n=this.engine,r=this;this._readyState="opening",this.skipReconnect=!1;const i=Re(n,"open",function(){r.onopen(),t&&t()}),o=l=>{this.cleanup(),this._readyState="closed",this.emitReserved("error",l),t?t(l):this.maybeReconnectOnOpen()},s=Re(n,"error",o);if(this._timeout!==!1){const l=this._timeout,a=this.setTimeoutFn(()=>{i(),o(new Error("timeout")),n.close()},l);this.opts.autoUnref&&a.unref(),this.subs.push(()=>{this.clearTimeoutFn(a)})}return this.subs.push(i),this.subs.push(s),this}connect(t){return this.open(t)}onopen(){this.cleanup(),this._readyState="open",this.emitReserved("open");const t=this.engine;this.subs.push(Re(t,"ping",this.onping.bind(this)),Re(t,"data",this.ondata.bind(this)),Re(t,"error",this.onerror.bind(this)),Re(t,"close",this.onclose.bind(this)),Re(this.decoder,"decoded",this.ondecoded.bind(this)))}onping(){this.emitReserved("ping")}ondata(t){try{this.decoder.add(t)}catch(n){this.onclose("parse error",n)}}ondecoded(t){zi(()=>{this.emitReserved("packet",t)},this.setTimeoutFn)}onerror(t){this.emitReserved("error",t)}socket(t,n){let r=this.nsps[t];return r?this._autoConnect&&!r.active&&r.connect():(r=new Xf(this,t,n),this.nsps[t]=r),r}_destroy(t){const n=Object.keys(this.nsps);for(const r of n)if(this.nsps[r].active)return;this._close()}_packet(t){const n=this.encoder.encode(t);for(let r=0;r<n.length;r++)this.engine.write(n[r],t.options)}cleanup(){this.subs.forEach(t=>t()),this.subs.length=0,this.decoder.destroy()}_close(){this.skipReconnect=!0,this._reconnecting=!1,this.onclose("forced close")}disconnect(){return this._close()}onclose(t,n){var r;this.cleanup(),(r=this.engine)===null||r===void 0||r.close(),this.backoff.reset(),this._readyState="closed",this.emitReserved("close",t,n),this._reconnection&&!this.skipReconnect&&this.reconnect()}reconnect(){if(this._reconnecting||this.skipReconnect)return this;const t=this;if(this.backoff.attempts>=this._reconnectionAttempts)this.backoff.reset(),this.emitReserved("reconnect_failed"),this._reconnecting=!1;else{const n=this.backoff.duration();this._reconnecting=!0;const r=this.setTimeoutFn(()=>{t.skipReconnect||(this.emitReserved("reconnect_attempt",t.backoff.attempts),!t.skipReconnect&&t.open(i=>{i?(t._reconnecting=!1,t.reconnect(),this.emitReserved("reconnect_error",i)):t.onreconnect()}))},n);this.opts.autoUnref&&r.unref(),this.subs.push(()=>{this.clearTimeoutFn(r)})}}onreconnect(){const t=this.backoff.attempts;this._reconnecting=!1,this.backoff.reset(),this.emitReserved("reconnect",t)}}const jn={};function Zr(e,t){typeof e=="object"&&(t=e,e=void 0),t=t||{};const n=dg(e,t.path||"/socket.io"),r=n.source,i=n.id,o=n.path,s=jn[i]&&o in jn[i].nsps,l=t.forceNew||t["force new connection"]||t.multiplex===!1||s;let a;return l?a=new ws(r,t):(jn[i]||(jn[i]=new ws(r,t)),a=jn[i]),n.query&&!t.query&&(t.query=n.queryKey),a.socket(n.path,t)}Object.assign(Zr,{Manager:ws,Socket:Xf,io:Zr,connect:Zr});let xo=null;const zn=new Map;function Sg(e,t){const n=zn.get(e);n&&Array.from(n).forEach(r=>r(t))}function Cg(){if(xo)return xo;const e=Zr(window.location.origin,{path:"/socket.io",reconnection:!0,withCredentials:!0});return e.on("connect",()=>{console.log("[Socket] Connected to Hub"),e.emit("register_dashboard")}),e.on("disconnect",()=>{console.log("[Socket] Disconnected from Hub")}),e.onAny((t,n)=>Sg(t,n)),xo=e,e}function Tg(e,t){let n=zn.get(e);return n||(n=new Set,zn.set(e,n)),n.add(t),()=>{const r=zn.get(e);r&&(r.delete(t),r.size===0&&zn.delete(e))}}const Rg=()=>{const[e]=y.useState(Cg),[t,n]=y.useState(e.connected);y.useEffect(()=>{const i=()=>n(!0),o=()=>n(!1);return e.on("connect",i),e.on("disconnect",o),n(e.connected),()=>{e.off("connect",i),e.off("disconnect",o)}},[e]);const r=y.useCallback((i,o)=>Tg(i,o),[]);return{socket:e,isConnected:t,on:r}},Pg=6e4;function Ng(e,t,n,r=!0){if(e)return{tone:"live",label:"Live",title:"Connected to the Xenon server. Updates stream in as they happen."};const i=t??n;if(n-i<Pg)return r?{tone:"reconnecting",label:"Reconnecting…",title:"Lost the connection to the Xenon server. Retrying automatically."}:{tone:"reconnecting",label:"Connecting…",title:"Connecting to the Xenon server."};const o=new Date(i).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"});return{tone:"down",label:`Disconnected · since ${o}`,title:`No connection to the Xenon server since ${o}. What's on screen may be out of date.`}}function Og(){const{isConnected:e}=Rg(),[t,n]=y.useState(null),[r,i]=y.useState(()=>Date.now()),[o,s]=y.useState(e);return y.useEffect(()=>{n(e?null:Date.now()),e&&s(!0)},[e]),y.useEffect(()=>{if(e)return;const l=window.setInterval(()=>i(Date.now()),5e3);return()=>window.clearInterval(l)},[e]),Ng(e,t,r,o)}const Jf="xenon.theme",pu="dark",Zf="(prefers-color-scheme: light)";function Lg(){try{const e=localStorage.getItem(Jf);return e==="light"||e==="system"||e==="dark"?e:pu}catch{return pu}}function ed(e,t){return e==="system"?t?"light":"dark":e}function jg(){return typeof window.matchMedia=="function"&&window.matchMedia(Zf).matches}function td(e){document.documentElement.setAttribute("data-theme",e)}function Ag(e){try{localStorage.setItem(Jf,e)}catch{}td(ed(e,jg()))}function Ig(){const[e,t]=y.useState(Lg);return y.useEffect(()=>{var o;if(e!=="system"||typeof window.matchMedia!="function")return;const r=window.matchMedia(Zf),i=()=>td(ed("system",r.matches));return(o=r.addEventListener)==null||o.call(r,"change",i),()=>{var s;return(s=r.removeEventListener)==null?void 0:s.call(r,"change",i)}},[e]),[e,r=>{Ag(r),t(r)}]}function Dg({className:e,alt:t="Xenon"}){const n="/xenon/";return p.jsxs(p.Fragment,{children:[p.jsx("img",{src:`${n}logo.svg`,alt:t,className:`logo-for-dark ${e??""}`}),p.jsx("img",{src:`${n}logo-light.svg`,alt:t,className:`logo-for-light ${e??""}`})]})}const Mg=[{value:"dark",label:"Dark"},{value:"light",label:"Light"},{value:"system",label:"System"}],$g=()=>{const e=yn(),{me:t,signOut:n}=El(),r=Og(),[i,o]=Ig(),[s,l]=y.useState(!1),a=y.useRef(null),u=((t==null?void 0:t.name)??"A").split(" ").map(h=>h[0]).slice(0,2).join("").toUpperCase(),m=(t==null?void 0:t.role)==="SUPER_ADMIN"?"Super admin":(t==null?void 0:t.role)==="ADMIN"?"Admin":"Member";y.useEffect(()=>{const h=E=>{a.current&&!a.current.contains(E.target)&&l(!1)};return document.addEventListener("mousedown",h),()=>document.removeEventListener("mousedown",h)},[]);const v=()=>window.dispatchEvent(new CustomEvent("xenon.open-command-palette"));return p.jsx("header",{className:"fixed top-0 left-14 right-0 z-20 h-14 border-b border-[var(--border)] bg-[var(--bg)]/80 backdrop-blur-md",children:p.jsxs("div",{className:"flex items-center h-full px-4 gap-4",children:[p.jsx("button",{type:"button",onClick:()=>e("/overview"),className:"flex items-center gap-3 min-w-0 cursor-pointer","aria-label":"Xenon home",children:p.jsx("div",{className:"flex items-center gap-2",children:p.jsx(Dg,{alt:"Xenon Logo",className:"h-8 w-auto object-contain"})})}),p.jsx("div",{className:"flex-1 max-w-xl mx-auto",children:p.jsxs("button",{type:"button",onClick:v,className:"relative w-full h-9 flex items-center text-left","aria-label":"Open command palette",children:[p.jsx("div",{className:"w-full h-9 pl-9 pr-14 rounded-md bg-[var(--surface)] border border-[var(--border)] text-sm text-[var(--text-dim)] hover:border-[var(--border-strong)] hover:text-[var(--text)] transition-colors flex items-center",children:"Search devices, sessions, settings…"}),p.jsx(If,{className:"absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-[var(--text-dim)]"}),p.jsx("kbd",{className:"absolute right-3 top-1/2 -translate-y-1/2 font-mono text-[10px] text-[var(--text-dim)] border border-[var(--border)] rounded px-1.5 py-0.5",children:"⌘K"})]})}),p.jsxs("div",{className:"flex items-center gap-3",children:[p.jsxs("div",{role:"status",title:r.title,className:`flex items-center gap-1.5 px-2.5 py-1 rounded-full border ${r.tone==="live"?"bg-[var(--color-success)]/10 border-[var(--color-success)]/20 text-[var(--color-success)]":r.tone==="reconnecting"?"bg-[var(--amber)]/10 border-[var(--amber)]/25 text-[var(--amber)]":"bg-[var(--red)]/10 border-[var(--red)]/25 text-[var(--red)]"}`,children:[p.jsx("span",{className:`h-1.5 w-1.5 rounded-full bg-current ${r.tone==="live"?"pulse-dot":""}`,"aria-hidden":"true"}),p.jsx("span",{className:"text-[11px] font-medium",children:r.label})]}),p.jsxs("div",{className:"relative",ref:a,children:[p.jsxs("button",{type:"button",className:"flex items-center gap-2 h-9 pl-1.5 pr-2.5 rounded-md border border-[var(--border)] hover:border-[var(--border-strong)] hover:bg-[var(--surface)] transition-colors",onClick:()=>l(h=>!h),"aria-haspopup":"true","aria-expanded":s,children:[p.jsx("span",{className:"h-6 w-6 rounded-full bg-[var(--color-accent)]/15 text-[var(--color-accent)] text-[11px] font-semibold flex items-center justify-center",children:u}),p.jsxs("span",{className:"flex flex-col items-start leading-tight",children:[p.jsx("span",{className:"text-xs text-[var(--text)]",children:(t==null?void 0:t.name)??"Account"}),p.jsx("span",{className:"text-[10px] text-[var(--text-dim)]",children:m})]}),p.jsx(Dm,{className:"h-3.5 w-3.5 text-[var(--text-dim)]"})]}),s&&p.jsxs("div",{className:"absolute top-full right-0 mt-2 w-64 rounded-md border border-[var(--border)] bg-[var(--surface)] shadow-lg overflow-hidden",children:[p.jsxs("div",{className:"px-3 py-2",children:[p.jsx("div",{className:"text-[11px] text-[var(--text-dim)] mb-1",children:"System"}),p.jsxs("div",{className:"flex items-center justify-between text-xs text-[var(--text)]",children:[p.jsx("span",{className:"text-[var(--text-muted)]",children:"Version"}),p.jsxs("span",{className:"font-mono text-[var(--text-muted)]",children:["v","2.14.0"]})]})]}),p.jsx("div",{className:"h-px bg-[var(--border)]"}),p.jsxs("div",{className:"px-3 py-2 flex items-center justify-between gap-2",children:[p.jsx("span",{id:"theme-label",className:"text-xs text-[var(--text-muted)]",children:"Theme"}),p.jsx("div",{className:"seg seg-sm",role:"radiogroup","aria-labelledby":"theme-label",children:Mg.map(h=>p.jsx("button",{type:"button",role:"radio","aria-checked":i===h.value,className:`seg-btn${i===h.value?" seg-btn-active":""}`,onClick:()=>o(h.value),children:h.label},h.value))})]}),p.jsx("div",{className:"h-px bg-[var(--border)]"}),p.jsxs("button",{type:"button",onClick:()=>{l(!1),e("/profile")},className:"w-full flex items-center gap-2 px-3 py-2 text-xs text-[var(--text)] hover:bg-[var(--bg)] text-left",children:[p.jsx(gy,{className:"h-3.5 w-3.5 text-[var(--text-dim)]"}),"Profile"]}),t!=null&&t.authDisabled?p.jsx("p",{className:"px-3 py-2 text-xs text-[var(--text-muted)]",children:"Sign-in is off on this server."}):p.jsxs("button",{type:"button",onClick:()=>{l(!1),n()},className:"w-full flex items-center gap-2 px-3 py-2 text-xs text-[var(--red)] hover:bg-[var(--bg)] text-left",children:[p.jsx(Zm,{className:"h-3.5 w-3.5"}),"Logout"]})]})]})]})]})})};class Ug extends y.Component{constructor(){super(...arguments),this.state={hasError:!1},this.handleReset=()=>{this.setState({hasError:!1}),window.location.reload()}}static getDerivedStateFromError(t){return{hasError:!0,error:t}}componentDidCatch(t,n){console.error("Uncaught error:",t,n)}render(){return this.state.hasError?this.props.fallback||p.jsxs("div",{className:"error-boundary-container",style:{padding:"4rem 2rem",textAlign:"center",display:"flex",flexDirection:"column",alignItems:"center",gap:"1.5rem",color:"var(--text)",background:"var(--bg-main)",minHeight:"100vh"},children:[p.jsx("div",{style:{color:"var(--accent-red)"},children:p.jsx(fy,{size:64})}),p.jsx("h2",{style:{fontSize:"2rem",fontWeight:700,margin:0},children:"Component exception detected"}),p.jsx("p",{style:{color:"var(--text-muted)",maxWidth:"500px",lineHeight:1.6},children:"An unexpected error occurred while rendering this section. Xenon's isolation engine has contained the fault to prevent a total system crash."}),this.state.error&&p.jsx("pre",{style:{background:"rgb(var(--rgb-black) / 0.3)",padding:"1rem",borderRadius:"8px",fontSize:"0.8rem",color:"var(--accent-red)",maxWidth:"80%",overflowX:"auto"},children:this.state.error.message}),p.jsxs("button",{onClick:this.handleReset,style:{background:"var(--color-accent)",color:"var(--secondary)",border:"none",padding:"0.75rem 2rem",borderRadius:"8px",fontWeight:700,cursor:"pointer",display:"flex",alignItems:"center",gap:"0.5rem",transition:"all 0.2s"},onMouseOver:t=>t.currentTarget.style.transform="translateY(-2px)",onMouseOut:t=>t.currentTarget.style.transform="translateY(0)",children:[p.jsx(Af,{size:18}),"Reload application"]})]}):this.props.children}}const Bg=y.lazy(()=>V(()=>import("./overview-C0aykVrd.js"),__vite__mapDeps([0,1,2,3,4,5,6,7]))),hu=y.lazy(()=>V(()=>import("./device-explorer-CdO6_nrn.js"),__vite__mapDeps([8,6,7,9,10,5,11,1,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,3,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,2,46,47,48,49,50,51]))),mu=y.lazy(()=>V(()=>import("./builds-page-hDCgTwkS.js"),__vite__mapDeps([52,53,54,40,13,41,32,12,14,43,1,37,36,33,3,4,55,6,7,15,16,38,39]))),zg=y.lazy(()=>V(()=>import("./session-detail-page-COL_RZxw.js"),__vite__mapDeps([56,53,54,45,33,1,9,10,37,36,55,27,57,2,58,59,38,39,5,60,43,30,31,21,18,22,61]))),bg=y.lazy(()=>V(()=>import("./runbook-page-CMMeQml9.js"),__vite__mapDeps([62,45,63]))),Fg=y.lazy(()=>V(()=>import("./apps-D0SC6uw6.js"),__vite__mapDeps([64,54,12,13,14,6,7,15,16,21,18,22,23,24,44,19,27,35,43,47,65]))),Vg=y.lazy(()=>V(()=>import("./webhook-settings-BGu32vSB.js"),__vite__mapDeps([66,23,24,15,13,16,6,7,47,26,37,36,35,5,67,68])).then(e=>({default:e.WebhookSettings}))),qg=y.lazy(()=>V(()=>import("./settings-GF6ZMSQ6.js"),__vite__mapDeps([69,70,12,13,14,71,21,18,22,6,7,36,25,34,19,5,72,57,68])).then(e=>({default:e.Settings}))),Wg=y.lazy(()=>V(()=>import("./ai-settings-CsuJroRf.js"),__vite__mapDeps([73,70,12,13,14,71,6,7,48,36,5,68])).then(e=>({default:e.AISettings}))),Hg=y.lazy(()=>V(()=>import("./maintenance-settings-C1PrkuAH.js"),__vite__mapDeps([74,70,12,13,14,71,6,7,47,19,72,68])).then(e=>({default:e.MaintenanceSettings}))),Kg=y.lazy(()=>V(()=>import("./api-keys-BKnNSTw9.js"),__vite__mapDeps([75,54,30,31,23,24,6,7,21,18,22,12,13,14,40,41,15,16,26,47,19,27,68])).then(e=>({default:e.ApiKeys}))),Qg=y.lazy(()=>V(()=>import("./teams-B4-jrr-1.js"),__vite__mapDeps([76,54,30,31,23,24,6,7,21,18,22,12,13,14,40,41,15,16,77,26,45,47,68])).then(e=>({default:e.Teams}))),Gg=y.lazy(()=>V(()=>import("./selector-health-page-B4rA1Xkv.js"),__vite__mapDeps([78,6,7,28,29,12,13,14,55,58,59,38,39,40,41,15,16,79,1,21,18,22,19,27]))),Yg=y.lazy(()=>V(()=>import("./selector-detail-redirect-BbXKJjZM.js"),__vite__mapDeps([80,79]))),Xg=y.lazy(()=>V(()=>import("./DeviceMosaicView-BYaQHhTf.js"),__vite__mapDeps([81,11,1,36,46,60,26,28,29,82,43,12,13,14,25,6,7]))),Jg=y.lazy(()=>V(()=>import("./profile-page-CSl0UYlv.js"),__vite__mapDeps([83,6,7,54,15,13,16,27,47]))),Zg=y.lazy(()=>V(()=>import("./users-Cp0beJm3.js"),__vite__mapDeps([84,77,54,6,7,12,13,14,40,41,15,16,26,47]))),ev=y.lazy(()=>V(()=>import("./RecordingsPage-BJeYnygR.js"),__vite__mapDeps([85,6,7,30,31,12,13,14,38,39,40,41,49,17,18,19,20,26,50,82,86,87]))),tv=y.lazy(()=>V(()=>import("./RecordingPage-CbJj_EBT.js"),__vite__mapDeps([88,82,6,7,12,13,14,38,39,21,18,22,17,19,20,46,86,87,45,47,42,43]))),nv=()=>p.jsxs("div",{className:"flex items-center justify-center gap-2 h-full text-xs text-[var(--text-dim)]",children:[p.jsx(Af,{className:"animate-spin",size:14}),p.jsx("span",{children:"Hydrating view…"})]}),rv=()=>p.jsx(Ug,{children:p.jsx(y.Suspense,{fallback:p.jsx(nv,{}),children:p.jsxs(Lf,{children:[p.jsx($,{path:"/",element:p.jsx(Wt,{to:"/overview",replace:!0})}),p.jsx($,{path:"/overview",element:p.jsx(Bg,{})}),p.jsx($,{path:"/devices",element:p.jsx(hu,{})}),p.jsx($,{path:"/devices/:udid/control/:tab?",element:p.jsx(hu,{})}),p.jsx($,{path:"/apps",element:p.jsx(Fg,{})}),p.jsx($,{path:"/sessions",element:p.jsx(Wt,{to:"/builds",replace:!0})}),p.jsx($,{path:"/sessions/*",element:p.jsx(Wt,{to:"/builds",replace:!0})}),p.jsx($,{path:"/builds",element:p.jsx(mu,{})}),p.jsx($,{path:"/builds/:buildId",element:p.jsx(mu,{})}),p.jsx($,{path:"/builds/:buildId/sessions/:sessionId",element:p.jsx(zg,{})}),p.jsx($,{path:"/notifications",element:p.jsx(Vg,{})}),p.jsx($,{path:"/settings",element:p.jsx(qg,{})}),p.jsx($,{path:"/ai-settings",element:p.jsx(Wg,{})}),p.jsx($,{path:"/maintenance",element:p.jsx(Hg,{})}),p.jsx($,{path:"/api-keys",element:p.jsx(Kg,{})}),p.jsx($,{path:"/teams",element:p.jsx(Qg,{})}),p.jsx($,{path:"/users",element:p.jsx(Zg,{})}),p.jsx($,{path:"/selector-health",element:p.jsx(Gg,{})}),p.jsx($,{path:"/selector-health/detail",element:p.jsx(Yg,{})}),p.jsx($,{path:"/devices/live",element:p.jsx(Xg,{})}),p.jsx($,{path:"/recordings",element:p.jsx(ev,{})}),p.jsx($,{path:"/recordings/:groupId",element:p.jsx(tv,{})}),p.jsx($,{path:"/runbooks/:category",element:p.jsx(bg,{})}),p.jsx($,{path:"/profile",element:p.jsx(Jg,{})}),p.jsx($,{path:"*",element:p.jsx(Wt,{to:"/overview",replace:!0})})]})})});let mr=null;function yu(e){mr=e}const iv=new Set(["device_held_by_another_user","device_in_use_by_session"]),ov=new Set(["not_available_through_hub","not_available_for_cloud_phone"]);function sv(e){return!e||typeof e!="object"?!1:iv.has(e.error??"")}const lv=5e3,gu=new Map;function vu(e){if(!mr)return!1;const t=Date.now(),n=gu.get(e)??0;return t-n<lv||(gu.set(e,t),mr(e,"error")),!0}class Pl extends Error{constructor(t,n,r,i=!1){super(t),this.status=n,this.body=r,this.shown=i,this.name="ApiError"}}function av(e){return e instanceof Pl&&e.shown}function wu(e){if(!e||typeof e!="object")return;const{error:t,message:n}=e;return(typeof t!="string"||/^[a-z][a-z0-9_]*$/.test(t))&&typeof n=="string"&&n?n:typeof t=="string"&&t?t:typeof n=="string"&&n?n:void 0}async function Eo(e,t){let n=!1;if(e.status===403){const r=await e.clone().json().catch(()=>({})),i=wu(r)||"You do not have permission for this action.";mr&&(mr(i,"error"),n=!0)}if(e.status===409){const r=await e.clone().json().catch(()=>({}));sv(r)&&(n=vu(r.message||"This device is in use by another user."))}if(e.status===501){const r=await e.clone().json().catch(()=>({}));ov.has(r==null?void 0:r.error)&&r.message&&(n=vu(r.message))}if(e.status===204||e.status===205)return null;if(t&&(e.status<200||e.status>=300)){const r=await e.json().catch(()=>null),i=wu(r)||`Request failed (${e.status})`;throw new Pl(i,e.status,r,n)}return e.json()}class uv{makeGETRequest(t){return fetch(this.formatUrl(t)).then(n=>Eo(n,!1))}makePOSTRequest(t,n,r,i={},o={}){return fetch(this.formatUrl(t),{method:"POST",body:JSON.stringify(r||{}),headers:{"Content-Type":"application/json"},...i}).then(s=>Eo(s,!o.resolveErrors))}makeDELETERequest(t,n={}){return fetch(this.formatUrl(t),{method:"DELETE"}).then(r=>Eo(r,!n.resolveErrors))}formatUrl(t){return`/xenon/api${t}`}}const R=new uv;function cv(e){return e instanceof Pl?`The server rejected the change: ${e.message}`:"Couldn't reach the Xenon server. Check your connection and try again."}function Vv(e,t){av(t)||e(cv(t),"error")}const nd=y.createContext(void 0),qv=()=>{const e=y.useContext(nd);if(!e)throw new Error("useToast must be used within a ToastProvider");return e},fv=({children:e})=>{const[t,n]=y.useState([]),r=y.useCallback(o=>{n(s=>s.filter(l=>l.id!==o))},[]),i=y.useCallback((o,s="info",l=4e3,a)=>{const u=Math.random().toString(36).substring(2,9);return n(m=>[...m,{id:u,message:o,type:s,duration:l,action:a}]),s!=="loading"&&l>0&&setTimeout(()=>{r(u)},l),u},[r]);return y.useEffect(()=>(yu((o,s="info")=>i(o,s)),()=>yu(null)),[i]),p.jsxs(nd.Provider,{value:{toast:i,removeToast:r},children:[e,p.jsx("div",{className:"toast-container","aria-live":"polite","aria-atomic":"true",role:"status",children:t.map(o=>p.jsxs("div",{className:`toast-item toast-${o.type} animate-slide-in`,children:[p.jsxs("div",{className:"toast-icon",children:[o.type==="success"&&p.jsx(Bm,{size:18}),o.type==="error"&&p.jsx($m,{size:18}),o.type==="info"&&p.jsx(Wm,{size:18}),o.type==="loading"&&p.jsx(Xm,{size:18,className:"animate-spin"})]}),p.jsx("div",{className:"toast-message",children:o.message}),o.action&&p.jsx("button",{className:"toast-action",onClick:()=>{var s;r(o.id),(s=o.action)==null||s.onClick()},children:o.action.label}),p.jsx("button",{className:"toast-close",onClick:()=>r(o.id),"aria-label":`Close ${o.type} notification`,children:p.jsx(xy,{size:14})})]},o.id))})]})},dv=[{id:"overview",label:"Overview",icon:Gm,path:"/overview"},{id:"devices",label:"Devices",icon:uy,path:"/devices"},{id:"live-devices",label:"Live devices",icon:py,path:"/devices/live"},{id:"recordings",label:"Recordings",icon:bm,path:"/recordings"},{id:"apps",label:"Apps",icon:Rm,path:"/apps"},{id:"sessions",label:"Sessions",icon:ty,path:"/builds"},{id:"selector-health",label:"Selector health",icon:Vm,path:"/selector-health"},{id:"notifications",label:"Notifications",icon:Nm,path:"/notifications"},{id:"settings",label:"Settings",icon:oy,path:"/settings",minRole:"ADMIN"},{id:"ai",label:"AI engine",icon:Am,path:"/ai-settings",minRole:"ADMIN"},{id:"maintenance",label:"Maintenance",icon:ly,path:"/maintenance",minRole:"ADMIN"},{id:"teams",label:"Teams",icon:wy,path:"/teams",minRole:"ADMIN"},{id:"users",label:"Users",icon:my,path:"/users",minRole:"ADMIN"},{id:"apikeys",label:"API keys",icon:Km,path:"/api-keys",minRole:"ADMIN"}],ku={SUPER_ADMIN:3,ADMIN:2,MEMBER:1};function pv(e,t){return t?(e?ku[e]??0:0)>=ku[t]:!0}const hv=()=>{const e=yn(),t=We(),{me:n}=El(),r=dv.filter(l=>pv(n==null?void 0:n.role,l.minRole)),i=t.pathname.replace(/\/$/,"")||"/",o=r.filter(l=>i===l.path||i.startsWith(l.path+"/")).sort((l,a)=>a.path.length-l.path.length)[0],s=l=>(o==null?void 0:o.path)===l;return p.jsxs("aside",{className:"fixed inset-y-0 left-0 z-30 w-14 border-r border-[var(--border)] bg-[var(--surface)] flex flex-col items-center py-3",children:[p.jsx("nav",{className:"flex-1 flex flex-col gap-1 w-full items-center",children:r.map(l=>{const a=l.icon,u=s(l.path);return p.jsxs("button",{type:"button",onClick:()=>e(l.path),className:`group relative w-full flex justify-center py-2.5 mx-1 rounded-md transition-colors ${u?"bg-[var(--surface-2)]":"hover:bg-[var(--surface-2)]/60"}`,"aria-label":l.label,"aria-current":u?"page":void 0,children:[p.jsx("span",{className:`absolute left-0 top-1 bottom-1 w-[3px] rounded-r transition-all ${u?"bg-[var(--color-accent)]":"bg-transparent"}`}),p.jsx(a,{className:`h-[18px] w-[18px] transition-colors ${u?"text-[var(--color-accent)]":"text-[var(--text-dim)] group-hover:text-[var(--text)]"}`,strokeWidth:u?2.25:2}),p.jsx("span",{className:"pointer-events-none absolute left-full ml-2 top-1/2 -translate-y-1/2 whitespace-nowrap rounded-md bg-[var(--surface-2)] border border-[var(--border-strong)] px-2 py-1 text-xs text-[var(--text)] opacity-0 group-hover:opacity-100 transition-opacity z-50 shadow-lg",children:l.label})]},l.id)})}),p.jsxs("button",{type:"button",className:"group relative w-full flex justify-center py-2.5 mt-2","aria-label":"API docs",onClick:()=>window.open(window.location.origin+"/xenon/api-docs","_blank"),children:[p.jsx(Lm,{className:"h-[18px] w-[18px] text-[var(--text-dim)] group-hover:text-[var(--text)] transition-colors"}),p.jsx("span",{className:"pointer-events-none absolute left-full ml-2 top-1/2 -translate-y-1/2 whitespace-nowrap rounded-md bg-[var(--surface-2)] border border-[var(--border-strong)] px-2 py-1 text-xs text-[var(--text)] opacity-0 group-hover:opacity-100 transition-opacity z-50 shadow-lg",children:"API docs"})]})]})};function mv(){return typeof window<"u"&&typeof window.VideoDecoder<"u"}class An{static getDevices(){return R.makeGETRequest(`/device?t=${Date.now()}`)}static getPendingSessionsCount(){return R.makeGETRequest("/queue/length")}static getPendingSessions(){return R.makeGETRequest("/queue")}static getQueueSummary(){return R.makeGETRequest("/queue/summary")}static getQueueStatus(t){return R.makeGETRequest(`/queue/status/${t}`)}static getBuilds(){return R.makeGETRequest("/build")}static getSessions(t={}){var i;let r=`/session?t=${Date.now()}`;return t.buildId&&(r+=`&buildId=${encodeURIComponent(t.buildId)}`),t.since&&(r+=`&since=${encodeURIComponent(t.since)}`),t.limit&&(r+=`&limit=${t.limit}`),t.before&&(r+=`&before=${encodeURIComponent(t.before)}`),t.beforeId&&(r+=`&beforeId=${encodeURIComponent(t.beforeId)}`),t.query&&(r+=`&query=${encodeURIComponent(t.query)}`),t.status&&(r+=`&status=${encodeURIComponent(t.status)}`),t.platform&&(r+=`&platform=${encodeURIComponent(t.platform)}`),(i=t.ids)!=null&&i.length&&(r+=`&ids=${t.ids.map(encodeURIComponent).join(",")}`),R.makeGETRequest(r)}static getSessionSummary(t={}){let n=`/session-summary?t=${Date.now()}`;return t.since&&(n+=`&since=${encodeURIComponent(t.since)}`),t.buildId&&(n+=`&buildId=${encodeURIComponent(t.buildId)}`),R.makeGETRequest(n)}static getSession(t){return R.makeGETRequest(`/session/${t}`)}static getSessionLogs(t){return R.makeGETRequest(`/session/${t}/session_log`)}static getDeviceLogs(t){return R.makeGETRequest(`/session/${t}/logs/device`)}static getDebugLogs(t){return R.makeGETRequest(`/session/${t}/logs/debug`)}static getProfilingData(t){return R.makeGETRequest(`/session/${t}/profiling`)}static getSessionMetrics(t){return R.makeGETRequest(`/session/${t}/metrics`)}static omniScan(t){return R.makeGETRequest(`/session/${t}/xenon/omni-scan`)}static omniScanControl(t){return R.makeGETRequest(`/control/${t}/omni-scan`)}static testAiLocator(t,n,r){return R.makePOSTRequest(`/session/${t}/xenon/test-locator`,{},{strategy:n,selector:r})}static getDisplayState(t){return R.makeGETRequest(`/control/${t}/display`)}static getAppiumSession(t){return R.makeGETRequest(`/control/${t}/appium-session`)}static async verifyLocator(t,n,r){const i=t.startsWith("/")?t:`/${t}`,s=await(await fetch(`${i}/session/${n}/xenon/verify-locator`,{method:"POST",credentials:"include",headers:{"Content-Type":"application/json"},body:JSON.stringify(r)})).json().catch(()=>({}));return(s==null?void 0:s.value)??s}static testAiLocatorControl(t,n,r){return R.makePOSTRequest(`/control/${t}/test-locator`,{},{strategy:n,selector:r})}static blockDevice(t,n){return R.makePOSTRequest("/block",{},{udid:t,host:n})}static unblockDevice(t,n){return R.makePOSTRequest("/unblock",{},{udid:t,host:n})}static updateDeviceTags(t,n,r){return R.makePOSTRequest("/device/tags",{},{udid:t,host:n,tags:r})}static async listTeams(){const t=await fetch("/xenon/api/teams",{credentials:"include"});if(!t.ok)throw new Error(`listTeams failed (${t.status})`);return(await t.json()).map(r=>({id:r.id,name:r.name}))}static async setDeviceTeam(t,n){const r=await fetch(`/xenon/api/device/${encodeURIComponent(t)}/team`,{method:"PUT",credentials:"include",headers:{"Content-Type":"application/json"},body:JSON.stringify({teamId:n})});if(!r.ok&&r.status!==204){const i=await r.json().catch(()=>({}));throw new Error(i.error||`setDeviceTeam failed (${r.status})`)}}static getSessionLiveVideoUrl(t){return R.formatUrl(`/session/${t}/live_video`)}static getReservations(){return R.makeGETRequest("/reservation")}static reserveDevice(t,n,r,i,o){return R.makePOSTRequest("/reservation",{},{udid:t,host:n,reservedBy:r,duration:i,reason:o},{},{resolveErrors:!0})}static releaseReservation(t,n){return R.makeDELETERequest(`/reservation/${t}/${encodeURIComponent(n)}`)}static extendReservation(t,n,r){return R.makePOSTRequest(`/reservation/${t}/${encodeURIComponent(n)}/extend`,{},{duration:r})}static getAssetUrl(t){const n=(t??"").replace(/^[\\/]+/,"").split(/[\\/]/);if(n.length!==3||n.some(s=>!s))return"";const[r,i,o]=n;return["screenshots","video","performance"].includes(i)?`/xenon/api/session/${encodeURIComponent(r)}/asset/${i}/${encodeURIComponent(o)}`:""}static tap(t,n,r){return R.makePOSTRequest(`/control/${t}/tap`,{},{x:n,y:r})}static swipe(t,n,r,i,o){return R.makePOSTRequest(`/control/${t}/swipe`,{},{x:n,y:r,endX:i,endY:o})}static typeText(t,n){return R.makePOSTRequest(`/control/${t}/text`,{},{text:n})}static pressKey(t,n){return R.makePOSTRequest(`/control/${t}/keyevent`,{},{keyCode:n})}static getClipboard(t){return R.makeGETRequest(`/control/${t}/clipboard`)}static setClipboard(t,n){return R.makePOSTRequest(`/control/${t}/clipboard`,{},{content:n})}static getScreenshot(t){return R.makeGETRequest(`/control/${t}/screenshot`)}static touchAndHold(t,n,r,i){return R.makePOSTRequest(`/control/${t}/touchAndHold`,{},{x:n,y:r,duration:i})}static lock(t){return R.makePOSTRequest(`/control/${t}/lock`,{},{})}static unlock(t){return R.makePOSTRequest(`/control/${t}/unlock`,{},{})}static installApp(t,n){return R.makePOSTRequest(`/control/${t}/install`,{},{appPath:n})}static startStream(t,n={}){const r=n.player??(mv()?void 0:"mjpeg");return R.makePOSTRequest(`/control/${t}/stream/start`,{},r?{player:r}:{},{},{resolveErrors:!0})}static stopStream(t){return R.makePOSTRequest(`/control/${t}/stream/stop`,{},{},{keepalive:!0})}static leaveStream(t){return R.makePOSTRequest(`/control/${t}/stream/leave`,{},{},{keepalive:!0})}static uninstallApp(t,n){return R.makePOSTRequest(`/control/${t}/uninstall`,{},{bundleId:n})}static uploadAndInstallApp(t,n){const r=new FormData;return r.append("app",n),fetch(`/xenon/api/control/${t}/upload-install`,{method:"POST",body:r}).then(i=>i.json())}static listApps(t){return R.makeGETRequest(`/control/${t}/apps`)}static getLogs(t){return R.makeGETRequest(`/control/${t}/logs`)}static getApps(){return R.makeGETRequest("/apps")}static uploadApp(t,n=null){const r=new FormData;return r.append("app",t),n&&r.append("teamId",n),fetch("/xenon/api/apps/upload",{method:"POST",body:r}).then(i=>i.json())}static async setAppTeam(t,n){const r=await fetch(`/xenon/api/apps/${encodeURIComponent(t)}/team`,{method:"PUT",credentials:"include",headers:{"Content-Type":"application/json"},body:JSON.stringify({teamId:n})});if(!r.ok){const i=await r.json().catch(()=>({}));throw new Error(i.error||`setAppTeam failed (${r.status})`)}}static deleteApp(t){return R.makeDELETERequest(`/apps/${t}`)}static installRepositoryApp(t,n){return R.makePOSTRequest(`/control/${t}/install-repository-app`,{},{appId:n},{},{resolveErrors:!0})}static executeShell(t,n){return R.makePOSTRequest(`/control/${t}/shell`,{},{command:n},{},{resolveErrors:!0})}static getInspectorSnapshot(t){return R.makeGETRequest(`/control/${t}/inspector/snapshot`)}static getWebhookConfigs(){return R.makeGETRequest("/webhook")}static addWebhookConfig(t,n,r,i){return R.makePOSTRequest("/webhook",{},{url:t,events:n,type:r,payloadTemplate:i})}static deleteWebhookConfig(t){return R.makeDELETERequest(`/webhook/${t}`)}static testWebhook(t,n,r,i){return R.makePOSTRequest("/webhook/test",{},{url:t,type:n,payloadTemplate:r,event:i})}static getGlobalConfig(){return R.makeGETRequest("/config")}static updateGlobalConfig(t){return R.makePOSTRequest("/config",{},t)}static testAIConfig(t){return R.makePOSTRequest("/config/test-ai",{},t,{},{resolveErrors:!0})}static resetMetrics(){return R.makePOSTRequest("/config/reset-metrics",{},{})}static getRecentHealingEvents(t=50){return R.makeGETRequest(`/healing/events?limit=${t}&t=${Date.now()}`)}static getHealingSummary(t=30,n=0){return R.makeGETRequest(`/healing/summary?windowDays=${t}&tz=${n}&t=${Date.now()}`)}static getHealingSelectors(t){const n=new URLSearchParams({tab:t.tab,days:String(t.days),sort:t.sort??"heals",page:String(t.page??1),pageSize:String(t.pageSize??50),t:String(Date.now())});return t.q&&n.set("q",t.q),t.platform&&n.set("platform",t.platform),t.method&&n.set("method",t.method),R.makeGETRequest(`/healing/selectors?${n.toString()}`)}static async getSelectorPanel(t,n,r,i){const o=new URLSearchParams({strategy:t,selector:n,days:String(r),tz:String(i),t:String(Date.now())}),s=await fetch(`/xenon/api/healing/selectors/detail?${o.toString()}`,{credentials:"include"}),l=await s.json().catch(()=>null);return{status:s.status,body:l}}static async postSelectorStateAction(t){const n=await fetch("/xenon/api/healing/selector/state",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)});if(!n.ok){const r=await n.json().catch(()=>({})),i=new Error(r.error??`Selector state action failed (${n.status})`);throw i.status=n.status,i.currentStatus=r.currentStatus??null,i}return n.json()}static sendHealingDigest(t={}){return R.makePOSTRequest("/healing/digest/send",{},t)}static async exportBuild(t,n,r){const i=await fetch(`/xenon/api/build/${encodeURIComponent(t)}/export`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({format:n,...r?{sessionIds:r}:{}})});if(!i.ok){const u=await i.text().catch(()=>i.statusText);throw new Error(`Export failed (${i.status}): ${u||i.statusText}`)}const o=i.headers.get("Content-Disposition")||"",s=/filename="?([^";]+)"?/.exec(o),l=s?s[1]:`build-${t}-sessions.${n}`;return{blob:await i.blob(),filename:l}}}function yv(e){if(!(e instanceof HTMLElement))return!1;if(e.isContentEditable)return!0;const t=e.tagName;return t==="INPUT"||t==="TEXTAREA"||t==="SELECT"}function gv(){const[e,t]=y.useState(!1);return y.useEffect(()=>{const n=i=>{(i.metaKey||i.ctrlKey)&&i.key.toLowerCase()==="k"&&!yv(i.target)&&(i.preventDefault(),t(o=>!o)),i.key==="Escape"&&t(!1)},r=()=>t(!0);return window.addEventListener("keydown",n),window.addEventListener("xenon.open-command-palette",r),()=>{window.removeEventListener("keydown",n),window.removeEventListener("xenon.open-command-palette",r)}},[]),{open:e,setOpen:t}}function xu(e,t){if(!e)return 0;const n=e.toLowerCase(),r=t.toLowerCase();if(r===n)return 1e4;if(r.startsWith(n))return 5e3-(r.length-n.length);let i=0,o=0,s=0;for(let l=0;l<n.length;l++){const a=n[l],u=r.indexOf(a,i);if(u===-1)return 0;u===i?(s+=1,o+=20+s*5):(s=0,o+=10-Math.min(u-i,10)),i=u+1}return Math.max(o,1)}const Eu=[{id:"nav:overview",kind:"nav",label:"Overview",path:"/overview"},{id:"nav:devices",kind:"nav",label:"Devices",path:"/devices"},{id:"nav:live",kind:"nav",label:"Live devices",path:"/devices/live"},{id:"nav:builds",kind:"nav",label:"Sessions",path:"/builds"},{id:"nav:apps",kind:"nav",label:"Apps",path:"/apps"},{id:"nav:selector-health",kind:"nav",label:"Selector health",path:"/selector-health"},{id:"nav:notifications",kind:"nav",label:"Notifications",path:"/notifications"},{id:"nav:settings",kind:"nav",label:"Settings",path:"/settings"},{id:"nav:ai-settings",kind:"nav",label:"AI engine",path:"/ai-settings"},{id:"nav:maintenance",kind:"nav",label:"Maintenance",path:"/maintenance"},{id:"nav:teams",kind:"nav",label:"Teams",path:"/teams"},{id:"nav:api-keys",kind:"nav",label:"API keys",path:"/api-keys"},{id:"nav:users",kind:"nav",label:"Users",path:"/users"},{id:"nav:profile",kind:"nav",label:"Profile",path:"/profile"}];class vv{constructor(){this.devices=[],this.builds=[],this.sessions=[],this.teams=[],this.keys=[],this.apps=[]}setDevices(t){this.devices=t.map(n=>({id:`device:${n.udid}`,kind:"device",label:n.name||n.udid,sub:n.udid,path:`/devices/${n.udid}/control`}))}setBuilds(t){this.builds=t.map(n=>({id:`build:${n.id}`,kind:"build",label:n.name||n.id,sub:typeof n.sessionCount=="number"?`${n.sessionCount} session${n.sessionCount===1?"":"s"}${n.failedCount?` · ${n.failedCount} failed`:""}`:n.id,path:`/builds/${encodeURIComponent(n.id)}`}))}setSessions(t){this.sessions=t.map(n=>({id:`session:${n.id}`,kind:"session",label:n.name||n.id,sub:n.id,path:`/builds?session=${encodeURIComponent(n.id)}`}))}setTeams(t){this.teams=t.map(n=>({id:`team:${n.id}`,kind:"team",label:n.name||n.id,sub:n.id,path:`/teams?team=${encodeURIComponent(n.id)}`}))}setKeys(t){this.keys=t.map(n=>({id:`key:${n.id}`,kind:"key",label:n.name||n.id,sub:n.id,path:`/api-keys?key=${encodeURIComponent(n.id)}`}))}setApps(t){this.apps=t.map(n=>({id:`app:${n.id}`,kind:"app",label:n.name||n.id,sub:n.id,path:`/apps?app=${encodeURIComponent(n.id)}`}))}search(t,n=8){return t.trim()?[...Eu,...this.devices,...this.builds,...this.sessions,...this.teams,...this.keys,...this.apps].map(i=>{const o=xu(t,i.label),s=i.sub?xu(t,i.sub):0;return{it:i,score:Math.max(o,s)}}).filter(i=>i.score>0).sort((i,o)=>o.score-i.score).slice(0,n).map(i=>i.it):Eu.slice(0,n)}}const wv={nav:"Navigation",device:"Devices",build:"Builds",session:"Running sessions",team:"Teams",key:"API keys",app:"Apps"},kv=["nav","device","build","session","team","key","app"],xv=()=>{const{open:e,setOpen:t}=gv(),[n,r]=y.useState(""),[i,o]=y.useState(0),s=yn(),l=y.useRef(new vv),a=y.useRef(null);y.useEffect(()=>{if(!e)return;Promise.all([An.getDevices().catch(()=>[]),An.getSessions().catch(()=>[]),An.getApps().catch(()=>[]),An.listTeams().catch(()=>[]),An.getBuilds().catch(()=>[])]).then(([k,c,f,d,g])=>{Array.isArray(k)&&l.current.setDevices(k),Array.isArray(g)&&l.current.setBuilds(g),Array.isArray(c)&&l.current.setSessions(c),Array.isArray(f)&&l.current.setApps(f),Array.isArray(d)&&l.current.setTeams(d)});const x=setTimeout(()=>{var k;return(k=a.current)==null?void 0:k.focus()},0);return()=>clearTimeout(x)},[e]),y.useEffect(()=>{e||(r(""),o(0))},[e]);const u=y.useMemo(()=>l.current.search(n,8),[n,e]),m=y.useMemo(()=>{const x=new Map;return u.forEach(k=>{const c=x.get(k.kind)||[];c.push(k),x.set(k.kind,c)}),x},[u]),v=y.useCallback(x=>{s(x.path),t(!1)},[s,t]),h=x=>{x.key==="ArrowDown"?(x.preventDefault(),o(k=>Math.min(k+1,Math.max(u.length-1,0)))):x.key==="ArrowUp"?(x.preventDefault(),o(k=>Math.max(k-1,0))):x.key==="Enter"&&(x.preventDefault(),u[i]&&v(u[i]))};if(!e)return null;let E=-1;return p.jsx("div",{className:"cp-overlay",onClick:()=>t(!1),children:p.jsxs("div",{className:"cp",role:"dialog","aria-modal":!0,"aria-label":"Command palette",onClick:x=>x.stopPropagation(),children:[p.jsxs("div",{className:"cp-input-row",children:[p.jsx(If,{size:14}),p.jsx("input",{ref:a,className:"cp-input",placeholder:"Search devices, sessions, settings…",value:n,onChange:x=>{r(x.target.value),o(0)},onKeyDown:h}),p.jsx("span",{className:"cp-esc",children:"ESC"})]}),p.jsxs("div",{className:"cp-results",children:[u.length===0&&p.jsx("div",{className:"cp-empty",children:"No results."}),kv.filter(x=>m.has(x)).map(x=>p.jsxs("div",{className:"cp-group",children:[p.jsx("div",{className:"cp-group-head",children:wv[x]}),m.get(x).map(k=>{E+=1;const c=E===i;return p.jsxs("button",{type:"button",className:`cp-item${c?" cp-item-active":""}`,onMouseEnter:()=>{o(E)},onClick:()=>v(k),children:[p.jsx("span",{className:"cp-item-label",children:k.label}),k.sub&&p.jsx("span",{className:"cp-item-sub",children:k.sub})]},k.id)})]},x))]})]})})};function Ev({children:e}){const{loading:t,me:n}=El(),r=We();if(t)return p.jsx("div",{style:{padding:40,textAlign:"center",color:"var(--text-dim)"},children:"Loading…"});if(!n){const i=encodeURIComponent(r.pathname+r.search),o=Oy()?"&reason=expired":"";return p.jsx(Wt,{to:`/login?next=${i}${o}`,replace:!0})}return p.jsx(p.Fragment,{children:e})}const _u="Xenon",_v={"/overview":"Overview","/devices":"Devices","/devices/live":"Live devices","/recordings":"Recordings","/apps":"Apps","/builds":"Sessions","/selector-health":"Selector health","/selector-health/detail":"Selector health","/notifications":"Notifications","/settings":"Settings","/ai-settings":"AI engine","/maintenance":"Maintenance","/teams":"Teams","/users":"Users","/api-keys":"API keys","/profile":"Profile","/login":"Sign in","/forgot-password":"Forgot password","/reset-password":"Reset password"},rd=new Map;function Wv(e,t){t&&rd.set(e,t)}function Sv(e){const t=e.replace(/\/+$/,"")||"/";let n=_v[t];if(!n){let r;if(r=t.match(/^\/devices\/([^/]+)\/control/)){const i=decodeURIComponent(r[1]);n=`${rd.get(i)||i} · Device`}else/^\/builds\/[^/]+\/sessions\//.test(t)?n="Session":/^\/builds\/[^/]+$/.test(t)?n="Sessions":/^\/recordings\/[^/]+$/.test(t)?n="Recording":(r=t.match(/^\/runbooks\/([^/]+)/))?n=`Runbook · ${decodeURIComponent(r[1])}`:t.startsWith("/reset-password/")&&(n="Reset password")}return n?`${n} · ${_u}`:_u}function Cv(){const{pathname:e}=We();return y.useEffect(()=>{document.title=Sv(e)},[e]),null}const Tv=y.lazy(()=>V(()=>import("./login-f8vOVW-U.js"),__vite__mapDeps([89,13,90,91,61,48,25,2]))),Rv=y.lazy(()=>V(()=>import("./forgot-password-CGnkRgE9.js"),__vite__mapDeps([92,90,91,61]))),Su=y.lazy(()=>V(()=>import("./reset-password-LeOuHqmB.js"),__vite__mapDeps([93,91,61]))),Pv=y.lazy(()=>V(()=>import("./ApiKeyGate-BwuaMjkX.js"),[]).then(e=>({default:e.ApiKeyGate})));function Nv(){return p.jsx(fv,{children:p.jsxs("div",{className:"min-h-screen w-full bg-[var(--bg)] text-[var(--text)]",children:[p.jsx(hv,{}),p.jsx($g,{}),p.jsx("main",{className:"pl-14 pt-14 h-screen overflow-y-auto",children:p.jsx(rv,{})}),p.jsx(xv,{})]})})}function Ov(){return p.jsxs(gm,{basename:"/xenon",children:[p.jsx(Cv,{}),p.jsx(Ly,{children:p.jsx(y.Suspense,{fallback:p.jsx("div",{style:{padding:40},children:"Loading…"}),children:p.jsxs(Lf,{children:[p.jsx($,{path:"/login",element:p.jsx(Tv,{})}),p.jsx($,{path:"/forgot-password",element:p.jsx(Rv,{})}),p.jsx($,{path:"/reset-password",element:p.jsx(Su,{})}),p.jsx($,{path:"/reset-password/:token",element:p.jsx(Su,{})}),p.jsx($,{path:"/api-key-gate",element:p.jsx(Pv,{children:p.jsx(Wt,{to:"/overview",replace:!0})})}),p.jsx($,{path:"*",element:p.jsx(Ev,{children:p.jsx(Nv,{})})})]})})})]})}xf.render(p.jsx(y.StrictMode,{children:p.jsx(Ov,{})}),document.getElementById("root"));export{bm as $,Af as A,bv as B,$m as C,Wv as D,Sv as E,mv as F,av as G,Iv as H,Wm as I,Cu as J,Lm as K,iu as L,ty as M,Wt as N,Rm as O,Nm as P,Vm as Q,md as R,ly as S,py as T,gy as U,oy as V,Am as W,An as X,Vv as Y,Km as Z,wy as _,We as a,sv as a0,$v as a1,my as a2,Lv as a3,yd as a4,El as b,B as c,Ny as d,Av as e,Xm as f,Uv as g,Mv as h,jv as i,p as j,Bv as k,Dv as l,zv as m,Dg as n,Bi as o,Rg as p,uy as q,y as r,Gm as s,qv as t,yn as u,xy as v,Dm as w,xf as x,fy as y,If as z};
|