@hotmeshio/long-tail 0.10.11 → 0.10.13
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/build/api/escalations/list.d.ts +1 -0
- package/build/api/escalations/list.js +1 -0
- package/build/api/escalations/metadata.d.ts +11 -0
- package/build/api/escalations/metadata.js +27 -7
- package/build/api/scan-codes/config.d.ts +22 -0
- package/build/api/scan-codes/config.js +136 -0
- package/build/api/scan-codes/execute.d.ts +9 -0
- package/build/api/scan-codes/execute.js +372 -0
- package/build/api/scan-codes/index.d.ts +2 -0
- package/build/api/scan-codes/index.js +14 -0
- package/build/lib/db/schemas/026_scan_codes.sql +51 -0
- package/build/lib/db/schemas/027_scan_codes_reindex.sql +23 -0
- package/build/lib/events/system-events.js +4 -0
- package/build/modules/features.d.ts +8 -0
- package/build/modules/features.js +1 -0
- package/build/routes/escalations/list.js +1 -0
- package/build/routes/index.js +2 -0
- package/build/routes/scan-codes.d.ts +2 -0
- package/build/routes/scan-codes.js +138 -0
- package/build/sdk/index.d.ts +4 -0
- package/build/services/escalation/crud.d.ts +1 -1
- package/build/services/escalation/crud.js +4 -2
- package/build/services/escalation/queries.d.ts +1 -0
- package/build/services/escalation/queries.js +2 -0
- package/build/services/escalation/sql.d.ts +11 -6
- package/build/services/escalation/sql.js +20 -20
- package/build/services/scan-code/index.d.ts +4 -0
- package/build/services/scan-code/index.js +21 -0
- package/build/services/scan-code/parse.d.ts +35 -0
- package/build/services/scan-code/parse.js +108 -0
- package/build/services/scan-code/read.d.ts +5 -0
- package/build/services/scan-code/read.js +50 -0
- package/build/services/scan-code/sql.d.ts +10 -0
- package/build/services/scan-code/sql.js +57 -0
- package/build/services/scan-code/validate.d.ts +12 -0
- package/build/services/scan-code/validate.js +78 -0
- package/build/services/scan-code/write.d.ts +26 -0
- package/build/services/scan-code/write.js +71 -0
- package/build/shared/form-validation/index.d.ts +1 -0
- package/build/shared/form-validation/index.js +1 -0
- package/build/shared/form-validation/x-lt-transition.d.ts +47 -0
- package/build/shared/form-validation/x-lt-transition.js +65 -0
- package/build/system/mcp-servers/admin/index.d.ts +1 -0
- package/build/system/mcp-servers/admin/index.js +5 -2
- package/build/system/mcp-servers/admin/scan-codes.d.ts +10 -0
- package/build/system/mcp-servers/admin/scan-codes.js +111 -0
- package/build/system/mcp-servers/admin/schemas.d.ts +232 -14
- package/build/system/mcp-servers/admin/schemas.js +50 -0
- package/build/system/seed/tool-manifests-admin.d.ts +1380 -0
- package/build/system/seed/tool-manifests-admin.js +6 -0
- package/build/tsconfig.tsbuildinfo +1 -1
- package/build/types/events.d.ts +9 -0
- package/build/types/index.d.ts +2 -0
- package/build/types/index.js +10 -1
- package/build/types/scan-code.d.ts +183 -0
- package/build/types/scan-code.js +80 -0
- package/build/types/startup.d.ts +6 -0
- package/dashboard/dist/assets/{AdminDashboard-CkTbRfY9.js → AdminDashboard-Bv3pHBzn.js} +2 -2
- package/dashboard/dist/assets/{AdminDashboard-CkTbRfY9.js.map → AdminDashboard-Bv3pHBzn.js.map} +1 -1
- package/dashboard/dist/assets/{AgentConfigPage-Cm8FRpXi.js → AgentConfigPage-Dk2zlvDb.js} +6 -6
- package/dashboard/dist/assets/{AgentConfigPage-Cm8FRpXi.js.map → AgentConfigPage-Dk2zlvDb.js.map} +1 -1
- package/dashboard/dist/assets/{AgentDetailPage-sQ1-UT46.js → AgentDetailPage-DUno6EGs.js} +2 -2
- package/dashboard/dist/assets/{AgentDetailPage-sQ1-UT46.js.map → AgentDetailPage-DUno6EGs.js.map} +1 -1
- package/dashboard/dist/assets/{AgentsPage-bSx_mdae.js → AgentsPage-CToVu1qj.js} +2 -2
- package/dashboard/dist/assets/{AgentsPage-bSx_mdae.js.map → AgentsPage-CToVu1qj.js.map} +1 -1
- package/dashboard/dist/assets/{AutoGrowTextarea-y-oNY51_.js → AutoGrowTextarea-DgEQeRQw.js} +2 -2
- package/dashboard/dist/assets/{AutoGrowTextarea-y-oNY51_.js.map → AutoGrowTextarea-DgEQeRQw.js.map} +1 -1
- package/dashboard/dist/assets/{AvailableEscalationsPage-8pMC7Xv6.js → AvailableEscalationsPage-DldboL4W.js} +2 -2
- package/dashboard/dist/assets/{AvailableEscalationsPage-8pMC7Xv6.js.map → AvailableEscalationsPage-DldboL4W.js.map} +1 -1
- package/dashboard/dist/assets/BotPicker-DQOpVB4M.js +2 -0
- package/dashboard/dist/assets/{BotPicker-C4uGH2x9.js.map → BotPicker-DQOpVB4M.js.map} +1 -1
- package/dashboard/dist/assets/{CapabilitiesPage-BRoOeKcc.js → CapabilitiesPage-Dmf46PUJ.js} +2 -2
- package/dashboard/dist/assets/{CapabilitiesPage-BRoOeKcc.js.map → CapabilitiesPage-Dmf46PUJ.js.map} +1 -1
- package/dashboard/dist/assets/{CollapsibleSection-CIj8Adc9.js → CollapsibleSection-CDADefUY.js} +2 -2
- package/dashboard/dist/assets/{CollapsibleSection-CIj8Adc9.js.map → CollapsibleSection-CDADefUY.js.map} +1 -1
- package/dashboard/dist/assets/{ConfirmDeleteModal-Ugi_9Ukq.js → ConfirmDeleteModal-CQsJUzEa.js} +2 -2
- package/dashboard/dist/assets/{ConfirmDeleteModal-Ugi_9Ukq.js.map → ConfirmDeleteModal-CQsJUzEa.js.map} +1 -1
- package/dashboard/dist/assets/{CopyableId-GUEdiiL5.js → CopyableId-4Lqlc5cU.js} +2 -2
- package/dashboard/dist/assets/{CopyableId-GUEdiiL5.js.map → CopyableId-4Lqlc5cU.js.map} +1 -1
- package/dashboard/dist/assets/{CountdownTimer-D3t0XMhE.js → CountdownTimer-DPjIkerB.js} +2 -2
- package/dashboard/dist/assets/{CountdownTimer-D3t0XMhE.js.map → CountdownTimer-DPjIkerB.js.map} +1 -1
- package/dashboard/dist/assets/{CredentialsPage-B73Si6K1.js → CredentialsPage-8LIEvomi.js} +2 -2
- package/dashboard/dist/assets/{CredentialsPage-B73Si6K1.js.map → CredentialsPage-8LIEvomi.js.map} +1 -1
- package/dashboard/dist/assets/{CronLabel-Ca1aHolt.js → CronLabel-CK3WSsM5.js} +2 -2
- package/dashboard/dist/assets/{CronLabel-Ca1aHolt.js.map → CronLabel-CK3WSsM5.js.map} +1 -1
- package/dashboard/dist/assets/{CustomDurationPicker-_9E9x1YN.js → CustomDurationPicker-FPmlA6cE.js} +2 -2
- package/dashboard/dist/assets/{CustomDurationPicker-_9E9x1YN.js.map → CustomDurationPicker-FPmlA6cE.js.map} +1 -1
- package/dashboard/dist/assets/{DataTable-BTu2AaEl.js → DataTable-Bir0Xs1p.js} +2 -2
- package/dashboard/dist/assets/{DataTable-BTu2AaEl.js.map → DataTable-Bir0Xs1p.js.map} +1 -1
- package/dashboard/dist/assets/{DropZone-NYn6TWHz.js → DropZone-CL9gA7pu.js} +2 -2
- package/dashboard/dist/assets/{DropZone-NYn6TWHz.js.map → DropZone-CL9gA7pu.js.map} +1 -1
- package/dashboard/dist/assets/{ElapsedCell-karxia93.js → ElapsedCell-BZVkVxE0.js} +2 -2
- package/dashboard/dist/assets/{ElapsedCell-karxia93.js.map → ElapsedCell-BZVkVxE0.js.map} +1 -1
- package/dashboard/dist/assets/{EmptyState-BcsfPq9T.js → EmptyState-lpUFYfun.js} +2 -2
- package/dashboard/dist/assets/{EmptyState-BcsfPq9T.js.map → EmptyState-lpUFYfun.js.map} +1 -1
- package/dashboard/dist/assets/{EscalationListSchemaPage-CDaNmbUA.js → EscalationListSchemaPage-kYLdUtZX.js} +3 -3
- package/dashboard/dist/assets/{EscalationListSchemaPage-CDaNmbUA.js.map → EscalationListSchemaPage-kYLdUtZX.js.map} +1 -1
- package/dashboard/dist/assets/{EscalationSchemaPage-k-2hFT2t.js → EscalationSchemaPage-kUmCDivo.js} +3 -3
- package/dashboard/dist/assets/{EscalationSchemaPage-k-2hFT2t.js.map → EscalationSchemaPage-kUmCDivo.js.map} +1 -1
- package/dashboard/dist/assets/{EscalationsOverview-C1e7IPn_.js → EscalationsOverview-D17auO-m.js} +2 -2
- package/dashboard/dist/assets/{EscalationsOverview-C1e7IPn_.js.map → EscalationsOverview-D17auO-m.js.map} +1 -1
- package/dashboard/dist/assets/{EventTable-CIrrtL7_.js → EventTable-CwPWl163.js} +2 -2
- package/dashboard/dist/assets/{EventTable-CIrrtL7_.js.map → EventTable-CwPWl163.js.map} +1 -1
- package/dashboard/dist/assets/{FilterBar-CzjtH74v.js → FilterBar-D7GghUsU.js} +2 -2
- package/dashboard/dist/assets/{FilterBar-CzjtH74v.js.map → FilterBar-D7GghUsU.js.map} +1 -1
- package/dashboard/dist/assets/{GraphInvokePage-LMpWw8z1.js → GraphInvokePage-D11uOnZi.js} +2 -2
- package/dashboard/dist/assets/{GraphInvokePage-LMpWw8z1.js.map → GraphInvokePage-D11uOnZi.js.map} +1 -1
- package/dashboard/dist/assets/{HomePage-Kl2DBG6l.js → HomePage-Bcq10Bxx.js} +2 -2
- package/dashboard/dist/assets/{HomePage-Kl2DBG6l.js.map → HomePage-Bcq10Bxx.js.map} +1 -1
- package/dashboard/dist/assets/ListToolbar-IPXsTb3Q.js +2 -0
- package/dashboard/dist/assets/{ListToolbar-B2fub0DY.js.map → ListToolbar-IPXsTb3Q.js.map} +1 -1
- package/dashboard/dist/assets/{McpOverview-odYnCZCC.js → McpOverview-Dx2j0KkF.js} +2 -2
- package/dashboard/dist/assets/{McpOverview-odYnCZCC.js.map → McpOverview-Dx2j0KkF.js.map} +1 -1
- package/dashboard/dist/assets/{McpQueryDetailPage-BtqwHUAg.js → McpQueryDetailPage-CzF_bna8.js} +3 -3
- package/dashboard/dist/assets/{McpQueryDetailPage-BtqwHUAg.js.map → McpQueryDetailPage-CzF_bna8.js.map} +1 -1
- package/dashboard/dist/assets/{McpQueryPage-CPkVwNIK.js → McpQueryPage-CNsuiw_q.js} +2 -2
- package/dashboard/dist/assets/{McpQueryPage-CPkVwNIK.js.map → McpQueryPage-CNsuiw_q.js.map} +1 -1
- package/dashboard/dist/assets/{McpRunDetailPage-D-Rz9MRw.js → McpRunDetailPage-BJguEMS0.js} +2 -2
- package/dashboard/dist/assets/{McpRunDetailPage-D-Rz9MRw.js.map → McpRunDetailPage-BJguEMS0.js.map} +1 -1
- package/dashboard/dist/assets/{McpRunsPage-rdpZ2yMh.js → McpRunsPage-CK96s3Nt.js} +2 -2
- package/dashboard/dist/assets/{McpRunsPage-rdpZ2yMh.js.map → McpRunsPage-CK96s3Nt.js.map} +1 -1
- package/dashboard/dist/assets/{Modal-Dr1Xy0j0.js → Modal-BU7No9NH.js} +2 -2
- package/dashboard/dist/assets/{Modal-Dr1Xy0j0.js.map → Modal-BU7No9NH.js.map} +1 -1
- package/dashboard/dist/assets/{NamespacePill-GwO-WfhX.js → NamespacePill-B9Vc_Pz2.js} +2 -2
- package/dashboard/dist/assets/{NamespacePill-GwO-WfhX.js.map → NamespacePill-B9Vc_Pz2.js.map} +1 -1
- package/dashboard/dist/assets/{OperationsPage-DlyGLPAs.js → OperationsPage-DvWrLuH6.js} +2 -2
- package/dashboard/dist/assets/{OperationsPage-DlyGLPAs.js.map → OperationsPage-DvWrLuH6.js.map} +1 -1
- package/dashboard/dist/assets/{OperatorDashboard-Csei5vj-.js → OperatorDashboard-C-jE0IRA.js} +2 -2
- package/dashboard/dist/assets/{OperatorDashboard-Csei5vj-.js.map → OperatorDashboard-C-jE0IRA.js.map} +1 -1
- package/dashboard/dist/assets/{PageHeader-Bo9BU9pK.js → PageHeader-Ce4GcIYo.js} +2 -2
- package/dashboard/dist/assets/{PageHeader-Bo9BU9pK.js.map → PageHeader-Ce4GcIYo.js.map} +1 -1
- package/dashboard/dist/assets/{PageHeaderWithStats-8_5cOSKL.js → PageHeaderWithStats-Ck0KZvXD.js} +2 -2
- package/dashboard/dist/assets/{PageHeaderWithStats-8_5cOSKL.js.map → PageHeaderWithStats-Ck0KZvXD.js.map} +1 -1
- package/dashboard/dist/assets/{PersonaDetailPage--ZL6Or6v.js → PersonaDetailPage-CJ6jqo7h.js} +2 -2
- package/dashboard/dist/assets/{PersonaDetailPage--ZL6Or6v.js.map → PersonaDetailPage-CJ6jqo7h.js.map} +1 -1
- package/dashboard/dist/assets/{PersonasPage-Bdcoay3P.js → PersonasPage-D8hL3kL5.js} +2 -2
- package/dashboard/dist/assets/{PersonasPage-Bdcoay3P.js.map → PersonasPage-D8hL3kL5.js.map} +1 -1
- package/dashboard/dist/assets/{PriorityBadge-CCERr9vQ.js → PriorityBadge-BETdj4M-.js} +2 -2
- package/dashboard/dist/assets/{PriorityBadge-CCERr9vQ.js.map → PriorityBadge-BETdj4M-.js.map} +1 -1
- package/dashboard/dist/assets/{ProcessDetailPage-HrmVQq7S.js → ProcessDetailPage-Vnx8Z5_y.js} +2 -2
- package/dashboard/dist/assets/{ProcessDetailPage-HrmVQq7S.js.map → ProcessDetailPage-Vnx8Z5_y.js.map} +1 -1
- package/dashboard/dist/assets/{ProcessesListPage-_xmj6Bo-.js → ProcessesListPage-DRYtvS3N.js} +2 -2
- package/dashboard/dist/assets/{ProcessesListPage-_xmj6Bo-.js.map → ProcessesListPage-DRYtvS3N.js.map} +1 -1
- package/dashboard/dist/assets/{RoleDetailPage-C0ju2-4K.js → RoleDetailPage-BKkUvTO-.js} +3 -3
- package/dashboard/dist/assets/{RoleDetailPage-C0ju2-4K.js.map → RoleDetailPage-BKkUvTO-.js.map} +1 -1
- package/dashboard/dist/assets/{RolePill-CQlnEWkK.js → RolePill-CnuBPhPw.js} +2 -2
- package/dashboard/dist/assets/{RolePill-CQlnEWkK.js.map → RolePill-CnuBPhPw.js.map} +1 -1
- package/dashboard/dist/assets/{RolesPage-CKluVSpB.js → RolesPage-BHzWK9n6.js} +2 -2
- package/dashboard/dist/assets/{RolesPage-CKluVSpB.js.map → RolesPage-BHzWK9n6.js.map} +1 -1
- package/dashboard/dist/assets/{RowActions-BA9L9djf.js → RowActions-eYrzgQSj.js} +2 -2
- package/dashboard/dist/assets/{RowActions-BA9L9djf.js.map → RowActions-eYrzgQSj.js.map} +1 -1
- package/dashboard/dist/assets/{RunAsSelector-DdfecQ1U.js → RunAsSelector-CS3KQ-BF.js} +2 -2
- package/dashboard/dist/assets/{RunAsSelector-DdfecQ1U.js.map → RunAsSelector-CS3KQ-BF.js.map} +1 -1
- package/dashboard/dist/assets/ScanCodesPage-BW4P4zWf.js +2 -0
- package/dashboard/dist/assets/ScanCodesPage-BW4P4zWf.js.map +1 -0
- package/dashboard/dist/assets/ScanSchemeDetailPage-BLykA4j-.js +2 -0
- package/dashboard/dist/assets/ScanSchemeDetailPage-BLykA4j-.js.map +1 -0
- package/dashboard/dist/assets/{ScopeBadge-BBYkevuR.js → ScopeBadge-BUpYpS3x.js} +2 -2
- package/dashboard/dist/assets/{ScopeBadge-BBYkevuR.js.map → ScopeBadge-BUpYpS3x.js.map} +1 -1
- package/dashboard/dist/assets/{StatCard-Ca-ngCaD.js → StatCard-BXQ8dD9Y.js} +2 -2
- package/dashboard/dist/assets/{StatCard-Ca-ngCaD.js.map → StatCard-BXQ8dD9Y.js.map} +1 -1
- package/dashboard/dist/assets/{StatusBadge-BwUvykDo.js → StatusBadge-DkgllZHv.js} +2 -2
- package/dashboard/dist/assets/{StatusBadge-BwUvykDo.js.map → StatusBadge-DkgllZHv.js.map} +1 -1
- package/dashboard/dist/assets/{StickyPagination-cLddIdtT.js → StickyPagination-hMrnLXde.js} +2 -2
- package/dashboard/dist/assets/{StickyPagination-cLddIdtT.js.map → StickyPagination-hMrnLXde.js.map} +1 -1
- package/dashboard/dist/assets/{StreamMessageDetail-CZXWDawC.js → StreamMessageDetail-DyJyZwBl.js} +2 -2
- package/dashboard/dist/assets/{StreamMessageDetail-CZXWDawC.js.map → StreamMessageDetail-DyJyZwBl.js.map} +1 -1
- package/dashboard/dist/assets/{SwimlaneTimeline-fWY0gaf3.js → SwimlaneTimeline-BlzV74V5.js} +2 -2
- package/dashboard/dist/assets/{SwimlaneTimeline-fWY0gaf3.js.map → SwimlaneTimeline-BlzV74V5.js.map} +1 -1
- package/dashboard/dist/assets/{TagInput-CDKbslLx.js → TagInput-BbZ25nNe.js} +2 -2
- package/dashboard/dist/assets/{TagInput-CDKbslLx.js.map → TagInput-BbZ25nNe.js.map} +1 -1
- package/dashboard/dist/assets/{TaskDetailPage-BjE4G2yn.js → TaskDetailPage-B0p_Z4J_.js} +2 -2
- package/dashboard/dist/assets/{TaskDetailPage-BjE4G2yn.js.map → TaskDetailPage-B0p_Z4J_.js.map} +1 -1
- package/dashboard/dist/assets/{TaskQueuePill-G3RuYRNZ.js → TaskQueuePill-D0QKBrN3.js} +2 -2
- package/dashboard/dist/assets/{TaskQueuePill-G3RuYRNZ.js.map → TaskQueuePill-D0QKBrN3.js.map} +1 -1
- package/dashboard/dist/assets/{TasksListPage-KAhmCWB2.js → TasksListPage-CiGR2QiQ.js} +2 -2
- package/dashboard/dist/assets/{TasksListPage-KAhmCWB2.js.map → TasksListPage-CiGR2QiQ.js.map} +1 -1
- package/dashboard/dist/assets/TimeAgo-D_DA9ucC.js +2 -0
- package/dashboard/dist/assets/{TimeAgo-C_H2TyZw.js.map → TimeAgo-D_DA9ucC.js.map} +1 -1
- package/dashboard/dist/assets/{TimestampCell-COG_4Flg.js → TimestampCell-C7rkC9nh.js} +2 -2
- package/dashboard/dist/assets/{TimestampCell-COG_4Flg.js.map → TimestampCell-C7rkC9nh.js.map} +1 -1
- package/dashboard/dist/assets/{ToolPill-ChSyRJZC.js → ToolPill-8xY9rkoc.js} +2 -2
- package/dashboard/dist/assets/{ToolPill-ChSyRJZC.js.map → ToolPill-8xY9rkoc.js.map} +1 -1
- package/dashboard/dist/assets/{ToolTestPanel-BPdJECW0.js → ToolTestPanel-E8efYGYs.js} +2 -2
- package/dashboard/dist/assets/{ToolTestPanel-BPdJECW0.js.map → ToolTestPanel-E8efYGYs.js.map} +1 -1
- package/dashboard/dist/assets/{TopicDetailPage-DAqx5JqA.js → TopicDetailPage-B455XrRc.js} +3 -3
- package/dashboard/dist/assets/{TopicDetailPage-DAqx5JqA.js.map → TopicDetailPage-B455XrRc.js.map} +1 -1
- package/dashboard/dist/assets/TopicsPage-1VAc29Qw.js +2 -0
- package/dashboard/dist/assets/{TopicsPage-DoGqAdPm.js.map → TopicsPage-1VAc29Qw.js.map} +1 -1
- package/dashboard/dist/assets/UserName-DikzjQHJ.js +2 -0
- package/dashboard/dist/assets/{UserName-CKO_rk1R.js.map → UserName-DikzjQHJ.js.map} +1 -1
- package/dashboard/dist/assets/{WorkflowExecutionPage-D3VQ9iQV.js → WorkflowExecutionPage-C15GSAoe.js} +2 -2
- package/dashboard/dist/assets/{WorkflowExecutionPage-D3VQ9iQV.js.map → WorkflowExecutionPage-C15GSAoe.js.map} +1 -1
- package/dashboard/dist/assets/{WorkflowPill-CNbwug5p.js → WorkflowPill-Da406nEj.js} +2 -2
- package/dashboard/dist/assets/{WorkflowPill-CNbwug5p.js.map → WorkflowPill-Da406nEj.js.map} +1 -1
- package/dashboard/dist/assets/{WorkflowsDashboard-DdJ86We6.js → WorkflowsDashboard-BMQd_0tW.js} +2 -2
- package/dashboard/dist/assets/{WorkflowsDashboard-DdJ86We6.js.map → WorkflowsDashboard-BMQd_0tW.js.map} +1 -1
- package/dashboard/dist/assets/{WorkflowsOverview-ZfFBzePp.js → WorkflowsOverview-CdxjVifp.js} +2 -2
- package/dashboard/dist/assets/{WorkflowsOverview-ZfFBzePp.js.map → WorkflowsOverview-CdxjVifp.js.map} +1 -1
- package/dashboard/dist/assets/{YamlWorkflowDetailPage-4bd5yXdA.js → YamlWorkflowDetailPage-DNVffIXa.js} +13 -13
- package/dashboard/dist/assets/{YamlWorkflowDetailPage-4bd5yXdA.js.map → YamlWorkflowDetailPage-DNVffIXa.js.map} +1 -1
- package/dashboard/dist/assets/{YamlWorkflowsPage-iHPNXjQj.js → YamlWorkflowsPage-BGP8wuos.js} +2 -2
- package/dashboard/dist/assets/{YamlWorkflowsPage-iHPNXjQj.js.map → YamlWorkflowsPage-BGP8wuos.js.map} +1 -1
- package/dashboard/dist/assets/{agents-DjD5U3Wb.js → agents-BZJLIJ4h.js} +2 -2
- package/dashboard/dist/assets/{agents-DjD5U3Wb.js.map → agents-BZJLIJ4h.js.map} +1 -1
- package/dashboard/dist/assets/{bots-DiljVapH.js → bots-ClLcDGJb.js} +2 -2
- package/dashboard/dist/assets/{bots-DiljVapH.js.map → bots-ClLcDGJb.js.map} +1 -1
- package/dashboard/dist/assets/capabilities-IaCcS7ge.js +2 -0
- package/dashboard/dist/assets/{capabilities-DV_5ghHT.js.map → capabilities-IaCcS7ge.js.map} +1 -1
- package/dashboard/dist/assets/{controlplane-BKMvfWCB.js → controlplane-Zi4m_MSx.js} +2 -2
- package/dashboard/dist/assets/{controlplane-BKMvfWCB.js.map → controlplane-Zi4m_MSx.js.map} +1 -1
- package/dashboard/dist/assets/{escalation-columns-BQpCaJId.js → escalation-columns-BY2mg9DY.js} +2 -2
- package/dashboard/dist/assets/{escalation-columns-BQpCaJId.js.map → escalation-columns-BY2mg9DY.js.map} +1 -1
- package/dashboard/dist/assets/{index-Tx_ETzcH.js → index-BqGnhkh0.js} +2 -2
- package/dashboard/dist/assets/{index-Tx_ETzcH.js.map → index-BqGnhkh0.js.map} +1 -1
- package/dashboard/dist/assets/index-BzkE48xJ.js +6 -0
- package/dashboard/dist/assets/index-BzkE48xJ.js.map +1 -0
- package/dashboard/dist/assets/{index-CI8rrKjx.js → index-C3o4OisO.js} +2 -2
- package/dashboard/dist/assets/{index-CI8rrKjx.js.map → index-C3o4OisO.js.map} +1 -1
- package/dashboard/dist/assets/{index-BO-7S9Xw.js → index-CJu2PBNx.js} +2 -2
- package/dashboard/dist/assets/{index-BO-7S9Xw.js.map → index-CJu2PBNx.js.map} +1 -1
- package/dashboard/dist/assets/{index-CItsikDw.js → index-CLmZaNTK.js} +2 -2
- package/dashboard/dist/assets/{index-CItsikDw.js.map → index-CLmZaNTK.js.map} +1 -1
- package/dashboard/dist/assets/index-CfAi1OsI.js +65 -0
- package/dashboard/dist/assets/index-CfAi1OsI.js.map +1 -0
- package/dashboard/dist/assets/{index-BaV3l0UE.js → index-CmnNqpWg.js} +2 -2
- package/dashboard/dist/assets/{index-BaV3l0UE.js.map → index-CmnNqpWg.js.map} +1 -1
- package/dashboard/dist/assets/{index-nIrYejxe.js → index-CvNBdkB1.js} +3 -3
- package/dashboard/dist/assets/{index-nIrYejxe.js.map → index-CvNBdkB1.js.map} +1 -1
- package/dashboard/dist/assets/{index-xZqQxqu2.js → index-D0zFReGL.js} +2 -2
- package/dashboard/dist/assets/{index-xZqQxqu2.js.map → index-D0zFReGL.js.map} +1 -1
- package/dashboard/dist/assets/{index-CStR4uIU.js → index-Dldi3Q3M.js} +2 -2
- package/dashboard/dist/assets/{index-CStR4uIU.js.map → index-Dldi3Q3M.js.map} +1 -1
- package/dashboard/dist/assets/{index-DhATO1cS.js → index-kiKZresb.js} +2 -2
- package/dashboard/dist/assets/{index-DhATO1cS.js.map → index-kiKZresb.js.map} +1 -1
- package/dashboard/dist/assets/index-mKcQGi2B.js +3 -0
- package/dashboard/dist/assets/index-mKcQGi2B.js.map +1 -0
- package/dashboard/dist/assets/{index-BsOxMMmb.js → index-yGNt29V9.js} +2 -2
- package/dashboard/dist/assets/{index-BsOxMMmb.js.map → index-yGNt29V9.js.map} +1 -1
- package/dashboard/dist/assets/index-zQiUPfxA.css +1 -0
- package/dashboard/dist/assets/{knowledge-BocTnSiA.js → knowledge-DWLxGTib.js} +2 -2
- package/dashboard/dist/assets/{knowledge-BocTnSiA.js.map → knowledge-DWLxGTib.js.map} +1 -1
- package/dashboard/dist/assets/{mcp-C1KBjKQ_.js → mcp-B6AARZ2I.js} +2 -2
- package/dashboard/dist/assets/{mcp-C1KBjKQ_.js.map → mcp-B6AARZ2I.js.map} +1 -1
- package/dashboard/dist/assets/{mcp-query-B3cjukkA.js → mcp-query-DrkvBU3a.js} +2 -2
- package/dashboard/dist/assets/{mcp-query-B3cjukkA.js.map → mcp-query-DrkvBU3a.js.map} +1 -1
- package/dashboard/dist/assets/{personas-DiA2bJaX.js → personas-Cmz2SAEU.js} +2 -2
- package/dashboard/dist/assets/{personas-DiA2bJaX.js.map → personas-Cmz2SAEU.js.map} +1 -1
- package/dashboard/dist/assets/{pipelines-Dt2d2EFR.js → pipelines-CSgfVCMy.js} +2 -2
- package/dashboard/dist/assets/{pipelines-Dt2d2EFR.js.map → pipelines-CSgfVCMy.js.map} +1 -1
- package/dashboard/dist/assets/{tasks-cDh2hNml.js → tasks-UOtUkDk-.js} +2 -2
- package/dashboard/dist/assets/{tasks-cDh2hNml.js.map → tasks-UOtUkDk-.js.map} +1 -1
- package/dashboard/dist/assets/{topics-yFlGF-u1.js → topics-Df5hGh6o.js} +2 -2
- package/dashboard/dist/assets/{topics-yFlGF-u1.js.map → topics-Df5hGh6o.js.map} +1 -1
- package/dashboard/dist/assets/{useDebouncedValue-BA5S7V54.js → useDebouncedValue-C4P2jQuh.js} +2 -2
- package/dashboard/dist/assets/{useDebouncedValue-BA5S7V54.js.map → useDebouncedValue-C4P2jQuh.js.map} +1 -1
- package/dashboard/dist/assets/{useEventHooks-D2R_ckS8.js → useEventHooks-PDbuSJ12.js} +2 -2
- package/dashboard/dist/assets/{useEventHooks-D2R_ckS8.js.map → useEventHooks-PDbuSJ12.js.map} +1 -1
- package/dashboard/dist/assets/{useFilterParams-B7suPsIK.js → useFilterParams-crmlBw_l.js} +2 -2
- package/dashboard/dist/assets/{useFilterParams-B7suPsIK.js.map → useFilterParams-crmlBw_l.js.map} +1 -1
- package/dashboard/dist/assets/{useNamespace-u-V1GVUD.js → useNamespace-tZSOlge3.js} +2 -2
- package/dashboard/dist/assets/{useNamespace-u-V1GVUD.js.map → useNamespace-tZSOlge3.js.map} +1 -1
- package/dashboard/dist/assets/{useYamlActivityEvents-BhOZeqgE.js → useYamlActivityEvents-CINLzE32.js} +2 -2
- package/dashboard/dist/assets/{useYamlActivityEvents-BhOZeqgE.js.map → useYamlActivityEvents-CINLzE32.js.map} +1 -1
- package/dashboard/dist/assets/{users-BoXPwdee.js → users-G8qwyZKS.js} +2 -2
- package/dashboard/dist/assets/{users-BoXPwdee.js.map → users-G8qwyZKS.js.map} +1 -1
- package/dashboard/dist/assets/{vendor-icons-D71XjkNy.js → vendor-icons-BpZiWH2f.js} +135 -130
- package/dashboard/dist/assets/vendor-icons-BpZiWH2f.js.map +1 -0
- package/dashboard/dist/assets/{vendor-query-B2UbickB.js → vendor-query-RUZdMvN6.js} +2 -2
- package/dashboard/dist/assets/{vendor-query-B2UbickB.js.map → vendor-query-RUZdMvN6.js.map} +1 -1
- package/dashboard/dist/assets/{vendor-react-C1YOyCSV.js → vendor-react-CdqEC2zv.js} +2 -2
- package/dashboard/dist/assets/{vendor-react-C1YOyCSV.js.map → vendor-react-CdqEC2zv.js.map} +1 -1
- package/dashboard/dist/assets/{workflows-mCoyKuLZ.js → workflows-DbPqi1TW.js} +2 -2
- package/dashboard/dist/assets/{workflows-mCoyKuLZ.js.map → workflows-DbPqi1TW.js.map} +1 -1
- package/dashboard/dist/assets/{yaml-workflows-CWxXGDpn.js → yaml-workflows-DozD8hpR.js} +2 -2
- package/dashboard/dist/assets/{yaml-workflows-CWxXGDpn.js.map → yaml-workflows-DozD8hpR.js.map} +1 -1
- package/dashboard/dist/index.html +5 -5
- package/docs/hitl/x-lt-transition.md +105 -0
- package/docs/scan-codes.md +243 -0
- package/package.json +2 -2
- package/dashboard/dist/assets/BotPicker-C4uGH2x9.js +0 -2
- package/dashboard/dist/assets/ListToolbar-B2fub0DY.js +0 -2
- package/dashboard/dist/assets/TimeAgo-C_H2TyZw.js +0 -2
- package/dashboard/dist/assets/TopicsPage-DoGqAdPm.js +0 -2
- package/dashboard/dist/assets/UserName-CKO_rk1R.js +0 -2
- package/dashboard/dist/assets/capabilities-DV_5ghHT.js +0 -2
- package/dashboard/dist/assets/index-B-WkiNRN.js +0 -6
- package/dashboard/dist/assets/index-B-WkiNRN.js.map +0 -1
- package/dashboard/dist/assets/index-DbTD-dio.js +0 -63
- package/dashboard/dist/assets/index-DbTD-dio.js.map +0 -1
- package/dashboard/dist/assets/index-DnlsDaAw.css +0 -1
- package/dashboard/dist/assets/index-kzIIeVbx.js +0 -5
- package/dashboard/dist/assets/index-kzIIeVbx.js.map +0 -1
- package/dashboard/dist/assets/vendor-icons-D71XjkNy.js.map +0 -1
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./ProcessesListPage-DRYtvS3N.js","./vendor-query-RUZdMvN6.js","./tasks-UOtUkDk-.js","./workflows-DbPqi1TW.js","./useEventHooks-PDbuSJ12.js","./useFilterParams-crmlBw_l.js","./vendor-react-CdqEC2zv.js","./useDebouncedValue-C4P2jQuh.js","./api-path-u2Jf9QXS.js","./DataTable-Bir0Xs1p.js","./EmptyState-lpUFYfun.js","./TimestampCell-C7rkC9nh.js","./StickyPagination-hMrnLXde.js","./FilterBar-D7GghUsU.js","./vendor-icons-BpZiWH2f.js","./PageHeader-Ce4GcIYo.js","./ListToolbar-IPXsTb3Q.js","./WorkflowPill-Da406nEj.js","./ProcessDetailPage-Vnx8Z5_y.js","./PageHeaderWithStats-Ck0KZvXD.js","./StatusBadge-DkgllZHv.js","./RolePill-CnuBPhPw.js","./UserName-DikzjQHJ.js","./users-G8qwyZKS.js","./McpOverview-Dx2j0KkF.js","./mcp-B6AARZ2I.js","./pipelines-CSgfVCMy.js","./yaml-workflows-DozD8hpR.js","./controlplane-Zi4m_MSx.js","./StatCard-BXQ8dD9Y.js","./McpRunsPage-CK96s3Nt.js","./useNamespace-tZSOlge3.js","./ElapsedCell-BZVkVxE0.js","./RowActions-eYrzgQSj.js","./McpRunDetailPage-BJguEMS0.js","./CopyableId-4Lqlc5cU.js","./CollapsibleSection-CDADefUY.js","./EventTable-CwPWl163.js","./SwimlaneTimeline-BlzV74V5.js","./StreamMessageDetail-DyJyZwBl.js","./McpQueryPage-CNsuiw_q.js","./mcp-query-DrkvBU3a.js","./McpQueryDetailPage-CzF_bna8.js","./TagInput-BbZ25nNe.js","./useYamlActivityEvents-CINLzE32.js","./helpers-DzO-OGPe.js","./RunAsSelector-CS3KQ-BF.js","./BotPicker-DQOpVB4M.js","./bots-ClLcDGJb.js","./ToolPill-8xY9rkoc.js","./TimeAgo-D_DA9ucC.js","./EscalationsOverview-D17auO-m.js","./AvailableEscalationsPage-DldboL4W.js","./task-queues-7-sHKPsN.js","./CustomDurationPicker-FPmlA6cE.js","./Modal-BU7No9NH.js","./constants-BHkpVaqx.js","./escalation-columns-BY2mg9DY.js","./PriorityBadge-BETdj4M-.js","./CountdownTimer-DPjIkerB.js","./OperatorDashboard-C-jE0IRA.js","./index-mKcQGi2B.js","./WorkflowsOverview-CdxjVifp.js","./index-BzkE48xJ.js","./NamespacePill-B9Vc_Pz2.js","./WorkflowsDashboard-BMQd_0tW.js","./YamlWorkflowsPage-BGP8wuos.js","./GraphInvokePage-D11uOnZi.js","./YamlWorkflowDetailPage-DNVffIXa.js","./TasksListPage-CiGR2QiQ.js","./TaskDetailPage-B0p_Z4J_.js","./WorkflowExecutionPage-C15GSAoe.js","./AdminDashboard-Bv3pHBzn.js","./index-yGNt29V9.js","./TaskQueuePill-D0QKBrN3.js","./index-CvNBdkB1.js","./ConfirmDeleteModal-CQsJUzEa.js","./index-CmnNqpWg.js","./ToolTestPanel-E8efYGYs.js","./index-C3o4OisO.js","./index-CLmZaNTK.js","./personas-Cmz2SAEU.js","./ScopeBadge-BUpYpS3x.js","./RolesPage-BHzWK9n6.js","./RoleDetailPage-BKkUvTO-.js","./AutoGrowTextarea-DgEQeRQw.js","./PersonasPage-D8hL3kL5.js","./PersonaDetailPage-CJ6jqo7h.js","./EscalationSchemaPage-kUmCDivo.js","./EscalationListSchemaPage-kYLdUtZX.js","./ScanCodesPage-BW4P4zWf.js","./ScanSchemeDetailPage-BLykA4j-.js","./index-Dldi3Q3M.js","./OperationsPage-DvWrLuH6.js","./index-CJu2PBNx.js","./index-kiKZresb.js","./CredentialsPage-8LIEvomi.js","./index-BqGnhkh0.js","./DropZone-CL9gA7pu.js","./index-D0zFReGL.js","./knowledge-DWLxGTib.js","./HomePage-Bcq10Bxx.js","./AgentsPage-CToVu1qj.js","./agents-BZJLIJ4h.js","./AgentDetailPage-DUno6EGs.js","./CronLabel-CK3WSsM5.js","./AgentConfigPage-Dk2zlvDb.js","./capabilities-IaCcS7ge.js","./topics-Df5hGh6o.js","./CapabilitiesPage-Dmf46PUJ.js","./TopicsPage-1VAc29Qw.js","./TopicDetailPage-B455XrRc.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
var P_=Object.defineProperty;var $_=(i,t,r)=>t in i?P_(i,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):i[t]=r;var A=(i,t,r)=>$_(i,typeof t!="symbol"?t+"":t,r);import{r as I_,a as T,j as y,u as ot,b as st,c as dt,g as H_,Q as G_,d as F_}from"./vendor-query-RUZdMvN6.js";import{r as V_,u as yo,a as mn,L as $i,N as Hs,b as J1,c as Kn,O as Ls,d as Y_,R as K_}from"./vendor-react-CdqEC2zv.js";import{X as Cn,E as X_,S as J_,a as iu,M as Q_,C as Q1,b as Fh,I as Vh,R as Z1,B as W1,U as Z_,c as W_,L as ew,d as tw,Z as nw,P as qy,e as eb,f as rw,g as By,h as Ly,i as zy,j as iw,W as xd,k as sw,l as aw,F as ow,m as lw,n as cw,D as uw,N as fw,o as hw,p as dw,q as tb,r as nb,s as mw,t as pw,u as yw,v as gw,w as bw,G as vw,T as xw,x as _w,y as ww,z as Sw}from"./vendor-icons-BpZiWH2f.js";(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const l of document.querySelectorAll('link[rel="modulepreload"]'))s(l);new MutationObserver(l=>{for(const c of l)if(c.type==="childList")for(const d of c.addedNodes)d.tagName==="LINK"&&d.rel==="modulepreload"&&s(d)}).observe(document,{childList:!0,subtree:!0});function r(l){const c={};return l.integrity&&(c.integrity=l.integrity),l.referrerPolicy&&(c.referrerPolicy=l.referrerPolicy),l.crossOrigin==="use-credentials"?c.credentials="include":l.crossOrigin==="anonymous"?c.credentials="omit":c.credentials="same-origin",c}function s(l){if(l.ep)return;l.ep=!0;const c=r(l);fetch(l.href,c)}})();var Oh={exports:{}},Ga={},Ah={exports:{}},jh={};/**
|
|
3
|
+
* @license React
|
|
4
|
+
* scheduler.production.js
|
|
5
|
+
*
|
|
6
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
7
|
+
*
|
|
8
|
+
* This source code is licensed under the MIT license found in the
|
|
9
|
+
* LICENSE file in the root directory of this source tree.
|
|
10
|
+
*/var Uy;function Ew(){return Uy||(Uy=1,(function(i){function t(F,ae){var de=F.length;F.push(ae);e:for(;0<de;){var Oe=de-1>>>1,le=F[Oe];if(0<l(le,ae))F[Oe]=ae,F[de]=le,de=Oe;else break e}}function r(F){return F.length===0?null:F[0]}function s(F){if(F.length===0)return null;var ae=F[0],de=F.pop();if(de!==ae){F[0]=de;e:for(var Oe=0,le=F.length,we=le>>>1;Oe<we;){var Se=2*(Oe+1)-1,Ne=F[Se],be=Se+1,at=F[be];if(0>l(Ne,de))be<le&&0>l(at,Ne)?(F[Oe]=at,F[be]=de,Oe=be):(F[Oe]=Ne,F[Se]=de,Oe=Se);else if(be<le&&0>l(at,de))F[Oe]=at,F[be]=de,Oe=be;else break e}}return ae}function l(F,ae){var de=F.sortIndex-ae.sortIndex;return de!==0?de:F.id-ae.id}if(i.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var c=performance;i.unstable_now=function(){return c.now()}}else{var d=Date,p=d.now();i.unstable_now=function(){return d.now()-p}}var g=[],f=[],m=1,b=null,v=3,_=!1,w=!1,S=!1,C=!1,L=typeof setTimeout=="function"?setTimeout:null,z=typeof clearTimeout=="function"?clearTimeout:null,se=typeof setImmediate<"u"?setImmediate:null;function oe(F){for(var ae=r(f);ae!==null;){if(ae.callback===null)s(f);else if(ae.startTime<=F)s(f),ae.sortIndex=ae.expirationTime,t(g,ae);else break;ae=r(f)}}function M(F){if(S=!1,oe(F),!w)if(r(g)!==null)w=!0,B||(B=!0,X());else{var ae=r(f);ae!==null&&Te(M,ae.startTime-F)}}var B=!1,te=-1,K=5,P=-1;function Y(){return C?!0:!(i.unstable_now()-P<K)}function W(){if(C=!1,B){var F=i.unstable_now();P=F;var ae=!0;try{e:{w=!1,S&&(S=!1,z(te),te=-1),_=!0;var de=v;try{t:{for(oe(F),b=r(g);b!==null&&!(b.expirationTime>F&&Y());){var Oe=b.callback;if(typeof Oe=="function"){b.callback=null,v=b.priorityLevel;var le=Oe(b.expirationTime<=F);if(F=i.unstable_now(),typeof le=="function"){b.callback=le,oe(F),ae=!0;break t}b===r(g)&&s(g),oe(F)}else s(g);b=r(g)}if(b!==null)ae=!0;else{var we=r(f);we!==null&&Te(M,we.startTime-F),ae=!1}}break e}finally{b=null,v=de,_=!1}ae=void 0}}finally{ae?X():B=!1}}}var X;if(typeof se=="function")X=function(){se(W)};else if(typeof MessageChannel<"u"){var he=new MessageChannel,_e=he.port2;he.port1.onmessage=W,X=function(){_e.postMessage(null)}}else X=function(){L(W,0)};function Te(F,ae){te=L(function(){F(i.unstable_now())},ae)}i.unstable_IdlePriority=5,i.unstable_ImmediatePriority=1,i.unstable_LowPriority=4,i.unstable_NormalPriority=3,i.unstable_Profiling=null,i.unstable_UserBlockingPriority=2,i.unstable_cancelCallback=function(F){F.callback=null},i.unstable_forceFrameRate=function(F){0>F||125<F?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):K=0<F?Math.floor(1e3/F):5},i.unstable_getCurrentPriorityLevel=function(){return v},i.unstable_next=function(F){switch(v){case 1:case 2:case 3:var ae=3;break;default:ae=v}var de=v;v=ae;try{return F()}finally{v=de}},i.unstable_requestPaint=function(){C=!0},i.unstable_runWithPriority=function(F,ae){switch(F){case 1:case 2:case 3:case 4:case 5:break;default:F=3}var de=v;v=F;try{return ae()}finally{v=de}},i.unstable_scheduleCallback=function(F,ae,de){var Oe=i.unstable_now();switch(typeof de=="object"&&de!==null?(de=de.delay,de=typeof de=="number"&&0<de?Oe+de:Oe):de=Oe,F){case 1:var le=-1;break;case 2:le=250;break;case 5:le=1073741823;break;case 4:le=1e4;break;default:le=5e3}return le=de+le,F={id:m++,callback:ae,priorityLevel:F,startTime:de,expirationTime:le,sortIndex:-1},de>Oe?(F.sortIndex=de,t(f,F),r(g)===null&&F===r(f)&&(S?(z(te),te=-1):S=!0,Te(M,de-Oe))):(F.sortIndex=le,t(g,F),w||_||(w=!0,B||(B=!0,X()))),F},i.unstable_shouldYield=Y,i.unstable_wrapCallback=function(F){var ae=v;return function(){var de=v;v=ae;try{return F.apply(this,arguments)}finally{v=de}}}})(jh)),jh}var Py;function Ow(){return Py||(Py=1,Ah.exports=Ew()),Ah.exports}/**
|
|
11
|
+
* @license React
|
|
12
|
+
* react-dom-client.production.js
|
|
13
|
+
*
|
|
14
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
15
|
+
*
|
|
16
|
+
* This source code is licensed under the MIT license found in the
|
|
17
|
+
* LICENSE file in the root directory of this source tree.
|
|
18
|
+
*/var $y;function Aw(){if($y)return Ga;$y=1;var i=Ow(),t=I_(),r=V_();function s(e){var n="https://react.dev/errors/"+e;if(1<arguments.length){n+="?args[]="+encodeURIComponent(arguments[1]);for(var a=2;a<arguments.length;a++)n+="&args[]="+encodeURIComponent(arguments[a])}return"Minified React error #"+e+"; visit "+n+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function l(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function c(e){var n=e,a=e;if(e.alternate)for(;n.return;)n=n.return;else{e=n;do n=e,(n.flags&4098)!==0&&(a=n.return),e=n.return;while(e)}return n.tag===3?a:null}function d(e){if(e.tag===13){var n=e.memoizedState;if(n===null&&(e=e.alternate,e!==null&&(n=e.memoizedState)),n!==null)return n.dehydrated}return null}function p(e){if(e.tag===31){var n=e.memoizedState;if(n===null&&(e=e.alternate,e!==null&&(n=e.memoizedState)),n!==null)return n.dehydrated}return null}function g(e){if(c(e)!==e)throw Error(s(188))}function f(e){var n=e.alternate;if(!n){if(n=c(e),n===null)throw Error(s(188));return n!==e?null:e}for(var a=e,o=n;;){var u=a.return;if(u===null)break;var h=u.alternate;if(h===null){if(o=u.return,o!==null){a=o;continue}break}if(u.child===h.child){for(h=u.child;h;){if(h===a)return g(u),e;if(h===o)return g(u),n;h=h.sibling}throw Error(s(188))}if(a.return!==o.return)a=u,o=h;else{for(var x=!1,E=u.child;E;){if(E===a){x=!0,a=u,o=h;break}if(E===o){x=!0,o=u,a=h;break}E=E.sibling}if(!x){for(E=h.child;E;){if(E===a){x=!0,a=h,o=u;break}if(E===o){x=!0,o=h,a=u;break}E=E.sibling}if(!x)throw Error(s(189))}}if(a.alternate!==o)throw Error(s(190))}if(a.tag!==3)throw Error(s(188));return a.stateNode.current===a?e:n}function m(e){var n=e.tag;if(n===5||n===26||n===27||n===6)return e;for(e=e.child;e!==null;){if(n=m(e),n!==null)return n;e=e.sibling}return null}var b=Object.assign,v=Symbol.for("react.element"),_=Symbol.for("react.transitional.element"),w=Symbol.for("react.portal"),S=Symbol.for("react.fragment"),C=Symbol.for("react.strict_mode"),L=Symbol.for("react.profiler"),z=Symbol.for("react.consumer"),se=Symbol.for("react.context"),oe=Symbol.for("react.forward_ref"),M=Symbol.for("react.suspense"),B=Symbol.for("react.suspense_list"),te=Symbol.for("react.memo"),K=Symbol.for("react.lazy"),P=Symbol.for("react.activity"),Y=Symbol.for("react.memo_cache_sentinel"),W=Symbol.iterator;function X(e){return e===null||typeof e!="object"?null:(e=W&&e[W]||e["@@iterator"],typeof e=="function"?e:null)}var he=Symbol.for("react.client.reference");function _e(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===he?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case S:return"Fragment";case L:return"Profiler";case C:return"StrictMode";case M:return"Suspense";case B:return"SuspenseList";case P:return"Activity"}if(typeof e=="object")switch(e.$$typeof){case w:return"Portal";case se:return e.displayName||"Context";case z:return(e._context.displayName||"Context")+".Consumer";case oe:var n=e.render;return e=e.displayName,e||(e=n.displayName||n.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case te:return n=e.displayName||null,n!==null?n:_e(e.type)||"Memo";case K:n=e._payload,e=e._init;try{return _e(e(n))}catch{}}return null}var Te=Array.isArray,F=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,ae=r.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,de={pending:!1,data:null,method:null,action:null},Oe=[],le=-1;function we(e){return{current:e}}function Se(e){0>le||(e.current=Oe[le],Oe[le]=null,le--)}function Ne(e,n){le++,Oe[le]=e.current,e.current=n}var be=we(null),at=we(null),Ht=we(null),Rt=we(null);function Dt(e,n){switch(Ne(Ht,n),Ne(at,e),Ne(be,null),n.nodeType){case 9:case 11:e=(e=n.documentElement)&&(e=e.namespaceURI)?iy(e):0;break;default:if(e=n.tagName,n=n.namespaceURI)n=iy(n),e=sy(n,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}Se(be),Ne(be,e)}function ke(){Se(be),Se(at),Se(Ht)}function qt(e){e.memoizedState!==null&&Ne(Rt,e);var n=be.current,a=sy(n,e.type);n!==a&&(Ne(at,e),Ne(be,a))}function di(e){at.current===e&&(Se(be),Se(at)),Rt.current===e&&(Se(Rt),Pa._currentValue=de)}var Gi,mi;function gn(e){if(Gi===void 0)try{throw Error()}catch(a){var n=a.stack.trim().match(/\n( *(at )?)/);Gi=n&&n[1]||"",mi=-1<a.stack.indexOf(`
|
|
19
|
+
at`)?" (<anonymous>)":-1<a.stack.indexOf("@")?"@unknown:0:0":""}return`
|
|
20
|
+
`+Gi+e+mi}var Fi=!1;function Ar(e,n){if(!e||Fi)return"";Fi=!0;var a=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var o={DetermineComponentFrameRoot:function(){try{if(n){var re=function(){throw Error()};if(Object.defineProperty(re.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(re,[])}catch(J){var G=J}Reflect.construct(e,[],re)}else{try{re.call()}catch(J){G=J}e.call(re.prototype)}}else{try{throw Error()}catch(J){G=J}(re=e())&&typeof re.catch=="function"&&re.catch(function(){})}}catch(J){if(J&&G&&typeof J.stack=="string")return[J.stack,G.stack]}return[null,null]}};o.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var u=Object.getOwnPropertyDescriptor(o.DetermineComponentFrameRoot,"name");u&&u.configurable&&Object.defineProperty(o.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var h=o.DetermineComponentFrameRoot(),x=h[0],E=h[1];if(x&&E){var R=x.split(`
|
|
21
|
+
`),H=E.split(`
|
|
22
|
+
`);for(u=o=0;o<R.length&&!R[o].includes("DetermineComponentFrameRoot");)o++;for(;u<H.length&&!H[u].includes("DetermineComponentFrameRoot");)u++;if(o===R.length||u===H.length)for(o=R.length-1,u=H.length-1;1<=o&&0<=u&&R[o]!==H[u];)u--;for(;1<=o&&0<=u;o--,u--)if(R[o]!==H[u]){if(o!==1||u!==1)do if(o--,u--,0>u||R[o]!==H[u]){var Q=`
|
|
23
|
+
`+R[o].replace(" at new "," at ");return e.displayName&&Q.includes("<anonymous>")&&(Q=Q.replace("<anonymous>",e.displayName)),Q}while(1<=o&&0<=u);break}}}finally{Fi=!1,Error.prepareStackTrace=a}return(a=e?e.displayName||e.name:"")?gn(a):""}function Eo(e,n){switch(e.tag){case 26:case 27:case 5:return gn(e.type);case 16:return gn("Lazy");case 13:return e.child!==n&&n!==null?gn("Suspense Fallback"):gn("Suspense");case 19:return gn("SuspenseList");case 0:case 15:return Ar(e.type,!1);case 11:return Ar(e.type.render,!1);case 1:return Ar(e.type,!0);case 31:return gn("Activity");default:return""}}function Oo(e){try{var n="",a=null;do n+=Eo(e,a),a=e,e=e.return;while(e);return n}catch(o){return`
|
|
24
|
+
Error generating stack: `+o.message+`
|
|
25
|
+
`+o.stack}}var Js=Object.prototype.hasOwnProperty,Qs=i.unstable_scheduleCallback,Wn=i.unstable_cancelCallback,Ao=i.unstable_shouldYield,Vi=i.unstable_requestPaint,tt=i.unstable_now,mu=i.unstable_getCurrentPriorityLevel,jo=i.unstable_ImmediatePriority,To=i.unstable_UserBlockingPriority,Yi=i.unstable_NormalPriority,pu=i.unstable_LowPriority,No=i.unstable_IdlePriority,yu=i.log,ko=i.unstable_setDisableYieldValue,pi=null,mt=null;function Jt(e){if(typeof yu=="function"&&ko(e),mt&&typeof mt.setStrictMode=="function")try{mt.setStrictMode(pi,e)}catch{}}var Bt=Math.clz32?Math.clz32:Ki,Zs=Math.log,Ws=Math.LN2;function Ki(e){return e>>>=0,e===0?32:31-(Zs(e)/Ws|0)|0}var jr=256,er=262144,Tr=4194304;function Mn(e){var n=e&42;if(n!==0)return n;switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return e&261888;case 262144:case 524288:case 1048576:case 2097152:return e&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return e&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function yi(e,n,a){var o=e.pendingLanes;if(o===0)return 0;var u=0,h=e.suspendedLanes,x=e.pingedLanes;e=e.warmLanes;var E=o&134217727;return E!==0?(o=E&~h,o!==0?u=Mn(o):(x&=E,x!==0?u=Mn(x):a||(a=E&~e,a!==0&&(u=Mn(a))))):(E=o&~h,E!==0?u=Mn(E):x!==0?u=Mn(x):a||(a=o&~e,a!==0&&(u=Mn(a)))),u===0?0:n!==0&&n!==u&&(n&h)===0&&(h=u&-u,a=n&-n,h>=a||h===32&&(a&4194048)!==0)?n:u}function gi(e,n){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&n)===0}function ea(e,n){switch(e){case 1:case 2:case 4:case 8:case 64:return n+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return n+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function Xi(){var e=Tr;return Tr<<=1,(Tr&62914560)===0&&(Tr=4194304),e}function Nr(e){for(var n=[],a=0;31>a;a++)n.push(e);return n}function Rn(e,n){e.pendingLanes|=n,n!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function kr(e,n,a,o,u,h){var x=e.pendingLanes;e.pendingLanes=a,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=a,e.entangledLanes&=a,e.errorRecoveryDisabledLanes&=a,e.shellSuspendCounter=0;var E=e.entanglements,R=e.expirationTimes,H=e.hiddenUpdates;for(a=x&~a;0<a;){var Q=31-Bt(a),re=1<<Q;E[Q]=0,R[Q]=-1;var G=H[Q];if(G!==null)for(H[Q]=null,Q=0;Q<G.length;Q++){var J=G[Q];J!==null&&(J.lane&=-536870913)}a&=~re}o!==0&&Cr(e,o,0),h!==0&&u===0&&e.tag!==0&&(e.suspendedLanes|=h&~(x&~n))}function Cr(e,n,a){e.pendingLanes|=n,e.suspendedLanes&=~n;var o=31-Bt(n);e.entangledLanes|=n,e.entanglements[o]=e.entanglements[o]|1073741824|a&261930}function bi(e,n){var a=e.entangledLanes|=n;for(e=e.entanglements;a;){var o=31-Bt(a),u=1<<o;u&n|e[o]&n&&(e[o]|=n),a&=~u}}function Mr(e,n){var a=n&-n;return a=(a&42)!==0?1:tr(a),(a&(e.suspendedLanes|n))!==0?0:a}function tr(e){switch(e){case 2:e=1;break;case 8:e=4;break;case 32:e=16;break;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:e=128;break;case 268435456:e=134217728;break;default:e=0}return e}function vi(e){return e&=-e,2<e?8<e?(e&134217727)!==0?32:268435456:8:2}function ta(){var e=ae.p;return e!==0?e:(e=window.event,e===void 0?32:Ty(e.type))}function Co(e,n){var a=ae.p;try{return ae.p=e,n()}finally{ae.p=a}}var Hn=Math.random().toString(36).slice(2),Je="__reactFiber$"+Hn,lt="__reactProps$"+Hn,Qt="__reactContainer$"+Hn,xi="__reactEvents$"+Hn,na="__reactListeners$"+Hn,Mo="__reactHandles$"+Hn,Ro="__reactResources$"+Hn,St="__reactMarker$"+Hn;function Ji(e){delete e[Je],delete e[lt],delete e[xi],delete e[na],delete e[Mo]}function O(e){var n=e[Je];if(n)return n;for(var a=e.parentNode;a;){if(n=a[Qt]||a[Je]){if(a=n.alternate,n.child!==null||a!==null&&a.child!==null)for(e=hy(e);e!==null;){if(a=e[Je])return a;e=hy(e)}return n}e=a,a=e.parentNode}return null}function N(e){if(e=e[Je]||e[Qt]){var n=e.tag;if(n===5||n===6||n===13||n===31||n===26||n===27||n===3)return e}return null}function j(e){var n=e.tag;if(n===5||n===26||n===27||n===6)return e.stateNode;throw Error(s(33))}function k(e){var n=e[Ro];return n||(n=e[Ro]={hoistableStyles:new Map,hoistableScripts:new Map}),n}function D(e){e[St]=!0}var $=new Set,ne={};function ie(e,n){V(e,n),V(e+"Capture",n)}function V(e,n){for(ne[e]=n,e=0;e<n.length;e++)$.add(n[e])}var ee=RegExp("^[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD][:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$"),pe={},Re={};function Ze(e){return Js.call(Re,e)?!0:Js.call(pe,e)?!1:ee.test(e)?Re[e]=!0:(pe[e]=!0,!1)}function Lt(e,n,a){if(Ze(n))if(a===null)e.removeAttribute(n);else{switch(typeof a){case"undefined":case"function":case"symbol":e.removeAttribute(n);return;case"boolean":var o=n.toLowerCase().slice(0,5);if(o!=="data-"&&o!=="aria-"){e.removeAttribute(n);return}}e.setAttribute(n,""+a)}}function Dn(e,n,a){if(a===null)e.removeAttribute(n);else{switch(typeof a){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(n);return}e.setAttribute(n,""+a)}}function nr(e,n,a,o){if(o===null)e.removeAttribute(a);else{switch(typeof o){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(a);return}e.setAttributeNS(n,a,""+o)}}function bn(e){switch(typeof e){case"bigint":case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function Jd(e){var n=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(n==="checkbox"||n==="radio")}function Rv(e,n,a){var o=Object.getOwnPropertyDescriptor(e.constructor.prototype,n);if(!e.hasOwnProperty(n)&&typeof o<"u"&&typeof o.get=="function"&&typeof o.set=="function"){var u=o.get,h=o.set;return Object.defineProperty(e,n,{configurable:!0,get:function(){return u.call(this)},set:function(x){a=""+x,h.call(this,x)}}),Object.defineProperty(e,n,{enumerable:o.enumerable}),{getValue:function(){return a},setValue:function(x){a=""+x},stopTracking:function(){e._valueTracker=null,delete e[n]}}}}function gu(e){if(!e._valueTracker){var n=Jd(e)?"checked":"value";e._valueTracker=Rv(e,n,""+e[n])}}function Qd(e){if(!e)return!1;var n=e._valueTracker;if(!n)return!0;var a=n.getValue(),o="";return e&&(o=Jd(e)?e.checked?"true":"false":e.value),e=o,e!==a?(n.setValue(e),!0):!1}function Do(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}var Dv=/[\n"\\]/g;function vn(e){return e.replace(Dv,function(n){return"\\"+n.charCodeAt(0).toString(16)+" "})}function bu(e,n,a,o,u,h,x,E){e.name="",x!=null&&typeof x!="function"&&typeof x!="symbol"&&typeof x!="boolean"?e.type=x:e.removeAttribute("type"),n!=null?x==="number"?(n===0&&e.value===""||e.value!=n)&&(e.value=""+bn(n)):e.value!==""+bn(n)&&(e.value=""+bn(n)):x!=="submit"&&x!=="reset"||e.removeAttribute("value"),n!=null?vu(e,x,bn(n)):a!=null?vu(e,x,bn(a)):o!=null&&e.removeAttribute("value"),u==null&&h!=null&&(e.defaultChecked=!!h),u!=null&&(e.checked=u&&typeof u!="function"&&typeof u!="symbol"),E!=null&&typeof E!="function"&&typeof E!="symbol"&&typeof E!="boolean"?e.name=""+bn(E):e.removeAttribute("name")}function Zd(e,n,a,o,u,h,x,E){if(h!=null&&typeof h!="function"&&typeof h!="symbol"&&typeof h!="boolean"&&(e.type=h),n!=null||a!=null){if(!(h!=="submit"&&h!=="reset"||n!=null)){gu(e);return}a=a!=null?""+bn(a):"",n=n!=null?""+bn(n):a,E||n===e.value||(e.value=n),e.defaultValue=n}o=o??u,o=typeof o!="function"&&typeof o!="symbol"&&!!o,e.checked=E?e.checked:!!o,e.defaultChecked=!!o,x!=null&&typeof x!="function"&&typeof x!="symbol"&&typeof x!="boolean"&&(e.name=x),gu(e)}function vu(e,n,a){n==="number"&&Do(e.ownerDocument)===e||e.defaultValue===""+a||(e.defaultValue=""+a)}function Qi(e,n,a,o){if(e=e.options,n){n={};for(var u=0;u<a.length;u++)n["$"+a[u]]=!0;for(a=0;a<e.length;a++)u=n.hasOwnProperty("$"+e[a].value),e[a].selected!==u&&(e[a].selected=u),u&&o&&(e[a].defaultSelected=!0)}else{for(a=""+bn(a),n=null,u=0;u<e.length;u++){if(e[u].value===a){e[u].selected=!0,o&&(e[u].defaultSelected=!0);return}n!==null||e[u].disabled||(n=e[u])}n!==null&&(n.selected=!0)}}function Wd(e,n,a){if(n!=null&&(n=""+bn(n),n!==e.value&&(e.value=n),a==null)){e.defaultValue!==n&&(e.defaultValue=n);return}e.defaultValue=a!=null?""+bn(a):""}function em(e,n,a,o){if(n==null){if(o!=null){if(a!=null)throw Error(s(92));if(Te(o)){if(1<o.length)throw Error(s(93));o=o[0]}a=o}a==null&&(a=""),n=a}a=bn(n),e.defaultValue=a,o=e.textContent,o===a&&o!==""&&o!==null&&(e.value=o),gu(e)}function Zi(e,n){if(n){var a=e.firstChild;if(a&&a===e.lastChild&&a.nodeType===3){a.nodeValue=n;return}}e.textContent=n}var qv=new Set("animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp".split(" "));function tm(e,n,a){var o=n.indexOf("--")===0;a==null||typeof a=="boolean"||a===""?o?e.setProperty(n,""):n==="float"?e.cssFloat="":e[n]="":o?e.setProperty(n,a):typeof a!="number"||a===0||qv.has(n)?n==="float"?e.cssFloat=a:e[n]=(""+a).trim():e[n]=a+"px"}function nm(e,n,a){if(n!=null&&typeof n!="object")throw Error(s(62));if(e=e.style,a!=null){for(var o in a)!a.hasOwnProperty(o)||n!=null&&n.hasOwnProperty(o)||(o.indexOf("--")===0?e.setProperty(o,""):o==="float"?e.cssFloat="":e[o]="");for(var u in n)o=n[u],n.hasOwnProperty(u)&&a[u]!==o&&tm(e,u,o)}else for(var h in n)n.hasOwnProperty(h)&&tm(e,h,n[h])}function xu(e){if(e.indexOf("-")===-1)return!1;switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var Bv=new Map([["acceptCharset","accept-charset"],["htmlFor","for"],["httpEquiv","http-equiv"],["crossOrigin","crossorigin"],["accentHeight","accent-height"],["alignmentBaseline","alignment-baseline"],["arabicForm","arabic-form"],["baselineShift","baseline-shift"],["capHeight","cap-height"],["clipPath","clip-path"],["clipRule","clip-rule"],["colorInterpolation","color-interpolation"],["colorInterpolationFilters","color-interpolation-filters"],["colorProfile","color-profile"],["colorRendering","color-rendering"],["dominantBaseline","dominant-baseline"],["enableBackground","enable-background"],["fillOpacity","fill-opacity"],["fillRule","fill-rule"],["floodColor","flood-color"],["floodOpacity","flood-opacity"],["fontFamily","font-family"],["fontSize","font-size"],["fontSizeAdjust","font-size-adjust"],["fontStretch","font-stretch"],["fontStyle","font-style"],["fontVariant","font-variant"],["fontWeight","font-weight"],["glyphName","glyph-name"],["glyphOrientationHorizontal","glyph-orientation-horizontal"],["glyphOrientationVertical","glyph-orientation-vertical"],["horizAdvX","horiz-adv-x"],["horizOriginX","horiz-origin-x"],["imageRendering","image-rendering"],["letterSpacing","letter-spacing"],["lightingColor","lighting-color"],["markerEnd","marker-end"],["markerMid","marker-mid"],["markerStart","marker-start"],["overlinePosition","overline-position"],["overlineThickness","overline-thickness"],["paintOrder","paint-order"],["panose-1","panose-1"],["pointerEvents","pointer-events"],["renderingIntent","rendering-intent"],["shapeRendering","shape-rendering"],["stopColor","stop-color"],["stopOpacity","stop-opacity"],["strikethroughPosition","strikethrough-position"],["strikethroughThickness","strikethrough-thickness"],["strokeDasharray","stroke-dasharray"],["strokeDashoffset","stroke-dashoffset"],["strokeLinecap","stroke-linecap"],["strokeLinejoin","stroke-linejoin"],["strokeMiterlimit","stroke-miterlimit"],["strokeOpacity","stroke-opacity"],["strokeWidth","stroke-width"],["textAnchor","text-anchor"],["textDecoration","text-decoration"],["textRendering","text-rendering"],["transformOrigin","transform-origin"],["underlinePosition","underline-position"],["underlineThickness","underline-thickness"],["unicodeBidi","unicode-bidi"],["unicodeRange","unicode-range"],["unitsPerEm","units-per-em"],["vAlphabetic","v-alphabetic"],["vHanging","v-hanging"],["vIdeographic","v-ideographic"],["vMathematical","v-mathematical"],["vectorEffect","vector-effect"],["vertAdvY","vert-adv-y"],["vertOriginX","vert-origin-x"],["vertOriginY","vert-origin-y"],["wordSpacing","word-spacing"],["writingMode","writing-mode"],["xmlnsXlink","xmlns:xlink"],["xHeight","x-height"]]),Lv=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i;function qo(e){return Lv.test(""+e)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":e}function rr(){}var _u=null;function wu(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Wi=null,es=null;function rm(e){var n=N(e);if(n&&(e=n.stateNode)){var a=e[lt]||null;e:switch(e=n.stateNode,n.type){case"input":if(bu(e,a.value,a.defaultValue,a.defaultValue,a.checked,a.defaultChecked,a.type,a.name),n=a.name,a.type==="radio"&&n!=null){for(a=e;a.parentNode;)a=a.parentNode;for(a=a.querySelectorAll('input[name="'+vn(""+n)+'"][type="radio"]'),n=0;n<a.length;n++){var o=a[n];if(o!==e&&o.form===e.form){var u=o[lt]||null;if(!u)throw Error(s(90));bu(o,u.value,u.defaultValue,u.defaultValue,u.checked,u.defaultChecked,u.type,u.name)}}for(n=0;n<a.length;n++)o=a[n],o.form===e.form&&Qd(o)}break e;case"textarea":Wd(e,a.value,a.defaultValue);break e;case"select":n=a.value,n!=null&&Qi(e,!!a.multiple,n,!1)}}}var Su=!1;function im(e,n,a){if(Su)return e(n,a);Su=!0;try{var o=e(n);return o}finally{if(Su=!1,(Wi!==null||es!==null)&&(wl(),Wi&&(n=Wi,e=es,es=Wi=null,rm(n),e)))for(n=0;n<e.length;n++)rm(e[n])}}function ra(e,n){var a=e.stateNode;if(a===null)return null;var o=a[lt]||null;if(o===null)return null;a=o[n];e:switch(n){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(o=!o.disabled)||(e=e.type,o=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!o;break e;default:e=!1}if(e)return null;if(a&&typeof a!="function")throw Error(s(231,n,typeof a));return a}var ir=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Eu=!1;if(ir)try{var ia={};Object.defineProperty(ia,"passive",{get:function(){Eu=!0}}),window.addEventListener("test",ia,ia),window.removeEventListener("test",ia,ia)}catch{Eu=!1}var Rr=null,Ou=null,Bo=null;function sm(){if(Bo)return Bo;var e,n=Ou,a=n.length,o,u="value"in Rr?Rr.value:Rr.textContent,h=u.length;for(e=0;e<a&&n[e]===u[e];e++);var x=a-e;for(o=1;o<=x&&n[a-o]===u[h-o];o++);return Bo=u.slice(e,1<o?1-o:void 0)}function Lo(e){var n=e.keyCode;return"charCode"in e?(e=e.charCode,e===0&&n===13&&(e=13)):e=n,e===10&&(e=13),32<=e||e===13?e:0}function zo(){return!0}function am(){return!1}function Gt(e){function n(a,o,u,h,x){this._reactName=a,this._targetInst=u,this.type=o,this.nativeEvent=h,this.target=x,this.currentTarget=null;for(var E in e)e.hasOwnProperty(E)&&(a=e[E],this[E]=a?a(h):h[E]);return this.isDefaultPrevented=(h.defaultPrevented!=null?h.defaultPrevented:h.returnValue===!1)?zo:am,this.isPropagationStopped=am,this}return b(n.prototype,{preventDefault:function(){this.defaultPrevented=!0;var a=this.nativeEvent;a&&(a.preventDefault?a.preventDefault():typeof a.returnValue!="unknown"&&(a.returnValue=!1),this.isDefaultPrevented=zo)},stopPropagation:function(){var a=this.nativeEvent;a&&(a.stopPropagation?a.stopPropagation():typeof a.cancelBubble!="unknown"&&(a.cancelBubble=!0),this.isPropagationStopped=zo)},persist:function(){},isPersistent:zo}),n}var _i={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Uo=Gt(_i),sa=b({},_i,{view:0,detail:0}),zv=Gt(sa),Au,ju,aa,Po=b({},sa,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Nu,button:0,buttons:0,relatedTarget:function(e){return e.relatedTarget===void 0?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return"movementX"in e?e.movementX:(e!==aa&&(aa&&e.type==="mousemove"?(Au=e.screenX-aa.screenX,ju=e.screenY-aa.screenY):ju=Au=0,aa=e),Au)},movementY:function(e){return"movementY"in e?e.movementY:ju}}),om=Gt(Po),Uv=b({},Po,{dataTransfer:0}),Pv=Gt(Uv),$v=b({},sa,{relatedTarget:0}),Tu=Gt($v),Iv=b({},_i,{animationName:0,elapsedTime:0,pseudoElement:0}),Hv=Gt(Iv),Gv=b({},_i,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),Fv=Gt(Gv),Vv=b({},_i,{data:0}),lm=Gt(Vv),Yv={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Kv={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},Xv={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Jv(e){var n=this.nativeEvent;return n.getModifierState?n.getModifierState(e):(e=Xv[e])?!!n[e]:!1}function Nu(){return Jv}var Qv=b({},sa,{key:function(e){if(e.key){var n=Yv[e.key]||e.key;if(n!=="Unidentified")return n}return e.type==="keypress"?(e=Lo(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?Kv[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Nu,charCode:function(e){return e.type==="keypress"?Lo(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?Lo(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),Zv=Gt(Qv),Wv=b({},Po,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),cm=Gt(Wv),ex=b({},sa,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Nu}),tx=Gt(ex),nx=b({},_i,{propertyName:0,elapsedTime:0,pseudoElement:0}),rx=Gt(nx),ix=b({},Po,{deltaX:function(e){return"deltaX"in e?e.deltaX:"wheelDeltaX"in e?-e.wheelDeltaX:0},deltaY:function(e){return"deltaY"in e?e.deltaY:"wheelDeltaY"in e?-e.wheelDeltaY:"wheelDelta"in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0}),sx=Gt(ix),ax=b({},_i,{newState:0,oldState:0}),ox=Gt(ax),lx=[9,13,27,32],ku=ir&&"CompositionEvent"in window,oa=null;ir&&"documentMode"in document&&(oa=document.documentMode);var cx=ir&&"TextEvent"in window&&!oa,um=ir&&(!ku||oa&&8<oa&&11>=oa),fm=" ",hm=!1;function dm(e,n){switch(e){case"keyup":return lx.indexOf(n.keyCode)!==-1;case"keydown":return n.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function mm(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var ts=!1;function ux(e,n){switch(e){case"compositionend":return mm(n);case"keypress":return n.which!==32?null:(hm=!0,fm);case"textInput":return e=n.data,e===fm&&hm?null:e;default:return null}}function fx(e,n){if(ts)return e==="compositionend"||!ku&&dm(e,n)?(e=sm(),Bo=Ou=Rr=null,ts=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(n.ctrlKey||n.altKey||n.metaKey)||n.ctrlKey&&n.altKey){if(n.char&&1<n.char.length)return n.char;if(n.which)return String.fromCharCode(n.which)}return null;case"compositionend":return um&&n.locale!=="ko"?null:n.data;default:return null}}var hx={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function pm(e){var n=e&&e.nodeName&&e.nodeName.toLowerCase();return n==="input"?!!hx[e.type]:n==="textarea"}function ym(e,n,a,o){Wi?es?es.push(o):es=[o]:Wi=o,n=Nl(n,"onChange"),0<n.length&&(a=new Uo("onChange","change",null,a,o),e.push({event:a,listeners:n}))}var la=null,ca=null;function dx(e){Zp(e,0)}function $o(e){var n=j(e);if(Qd(n))return e}function gm(e,n){if(e==="change")return n}var bm=!1;if(ir){var Cu;if(ir){var Mu="oninput"in document;if(!Mu){var vm=document.createElement("div");vm.setAttribute("oninput","return;"),Mu=typeof vm.oninput=="function"}Cu=Mu}else Cu=!1;bm=Cu&&(!document.documentMode||9<document.documentMode)}function xm(){la&&(la.detachEvent("onpropertychange",_m),ca=la=null)}function _m(e){if(e.propertyName==="value"&&$o(ca)){var n=[];ym(n,ca,e,wu(e)),im(dx,n)}}function mx(e,n,a){e==="focusin"?(xm(),la=n,ca=a,la.attachEvent("onpropertychange",_m)):e==="focusout"&&xm()}function px(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return $o(ca)}function yx(e,n){if(e==="click")return $o(n)}function gx(e,n){if(e==="input"||e==="change")return $o(n)}function bx(e,n){return e===n&&(e!==0||1/e===1/n)||e!==e&&n!==n}var Zt=typeof Object.is=="function"?Object.is:bx;function ua(e,n){if(Zt(e,n))return!0;if(typeof e!="object"||e===null||typeof n!="object"||n===null)return!1;var a=Object.keys(e),o=Object.keys(n);if(a.length!==o.length)return!1;for(o=0;o<a.length;o++){var u=a[o];if(!Js.call(n,u)||!Zt(e[u],n[u]))return!1}return!0}function wm(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Sm(e,n){var a=wm(e);e=0;for(var o;a;){if(a.nodeType===3){if(o=e+a.textContent.length,e<=n&&o>=n)return{node:a,offset:n-e};e=o}e:{for(;a;){if(a.nextSibling){a=a.nextSibling;break e}a=a.parentNode}a=void 0}a=wm(a)}}function Em(e,n){return e&&n?e===n?!0:e&&e.nodeType===3?!1:n&&n.nodeType===3?Em(e,n.parentNode):"contains"in e?e.contains(n):e.compareDocumentPosition?!!(e.compareDocumentPosition(n)&16):!1:!1}function Om(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var n=Do(e.document);n instanceof e.HTMLIFrameElement;){try{var a=typeof n.contentWindow.location.href=="string"}catch{a=!1}if(a)e=n.contentWindow;else break;n=Do(e.document)}return n}function Ru(e){var n=e&&e.nodeName&&e.nodeName.toLowerCase();return n&&(n==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||n==="textarea"||e.contentEditable==="true")}var vx=ir&&"documentMode"in document&&11>=document.documentMode,ns=null,Du=null,fa=null,qu=!1;function Am(e,n,a){var o=a.window===a?a.document:a.nodeType===9?a:a.ownerDocument;qu||ns==null||ns!==Do(o)||(o=ns,"selectionStart"in o&&Ru(o)?o={start:o.selectionStart,end:o.selectionEnd}:(o=(o.ownerDocument&&o.ownerDocument.defaultView||window).getSelection(),o={anchorNode:o.anchorNode,anchorOffset:o.anchorOffset,focusNode:o.focusNode,focusOffset:o.focusOffset}),fa&&ua(fa,o)||(fa=o,o=Nl(Du,"onSelect"),0<o.length&&(n=new Uo("onSelect","select",null,n,a),e.push({event:n,listeners:o}),n.target=ns)))}function wi(e,n){var a={};return a[e.toLowerCase()]=n.toLowerCase(),a["Webkit"+e]="webkit"+n,a["Moz"+e]="moz"+n,a}var rs={animationend:wi("Animation","AnimationEnd"),animationiteration:wi("Animation","AnimationIteration"),animationstart:wi("Animation","AnimationStart"),transitionrun:wi("Transition","TransitionRun"),transitionstart:wi("Transition","TransitionStart"),transitioncancel:wi("Transition","TransitionCancel"),transitionend:wi("Transition","TransitionEnd")},Bu={},jm={};ir&&(jm=document.createElement("div").style,"AnimationEvent"in window||(delete rs.animationend.animation,delete rs.animationiteration.animation,delete rs.animationstart.animation),"TransitionEvent"in window||delete rs.transitionend.transition);function Si(e){if(Bu[e])return Bu[e];if(!rs[e])return e;var n=rs[e],a;for(a in n)if(n.hasOwnProperty(a)&&a in jm)return Bu[e]=n[a];return e}var Tm=Si("animationend"),Nm=Si("animationiteration"),km=Si("animationstart"),xx=Si("transitionrun"),_x=Si("transitionstart"),wx=Si("transitioncancel"),Cm=Si("transitionend"),Mm=new Map,Lu="abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");Lu.push("scrollEnd");function qn(e,n){Mm.set(e,n),ie(n,[e])}var Io=typeof reportError=="function"?reportError:function(e){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var n=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof e=="object"&&e!==null&&typeof e.message=="string"?String(e.message):String(e),error:e});if(!window.dispatchEvent(n))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",e);return}console.error(e)},xn=[],is=0,zu=0;function Ho(){for(var e=is,n=zu=is=0;n<e;){var a=xn[n];xn[n++]=null;var o=xn[n];xn[n++]=null;var u=xn[n];xn[n++]=null;var h=xn[n];if(xn[n++]=null,o!==null&&u!==null){var x=o.pending;x===null?u.next=u:(u.next=x.next,x.next=u),o.pending=u}h!==0&&Rm(a,u,h)}}function Go(e,n,a,o){xn[is++]=e,xn[is++]=n,xn[is++]=a,xn[is++]=o,zu|=o,e.lanes|=o,e=e.alternate,e!==null&&(e.lanes|=o)}function Uu(e,n,a,o){return Go(e,n,a,o),Fo(e)}function Ei(e,n){return Go(e,null,null,n),Fo(e)}function Rm(e,n,a){e.lanes|=a;var o=e.alternate;o!==null&&(o.lanes|=a);for(var u=!1,h=e.return;h!==null;)h.childLanes|=a,o=h.alternate,o!==null&&(o.childLanes|=a),h.tag===22&&(e=h.stateNode,e===null||e._visibility&1||(u=!0)),e=h,h=h.return;return e.tag===3?(h=e.stateNode,u&&n!==null&&(u=31-Bt(a),e=h.hiddenUpdates,o=e[u],o===null?e[u]=[n]:o.push(n),n.lane=a|536870912),h):null}function Fo(e){if(50<Ra)throw Ra=0,Xf=null,Error(s(185));for(var n=e.return;n!==null;)e=n,n=e.return;return e.tag===3?e.stateNode:null}var ss={};function Sx(e,n,a,o){this.tag=e,this.key=a,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=n,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=o,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Wt(e,n,a,o){return new Sx(e,n,a,o)}function Pu(e){return e=e.prototype,!(!e||!e.isReactComponent)}function sr(e,n){var a=e.alternate;return a===null?(a=Wt(e.tag,n,e.key,e.mode),a.elementType=e.elementType,a.type=e.type,a.stateNode=e.stateNode,a.alternate=e,e.alternate=a):(a.pendingProps=n,a.type=e.type,a.flags=0,a.subtreeFlags=0,a.deletions=null),a.flags=e.flags&65011712,a.childLanes=e.childLanes,a.lanes=e.lanes,a.child=e.child,a.memoizedProps=e.memoizedProps,a.memoizedState=e.memoizedState,a.updateQueue=e.updateQueue,n=e.dependencies,a.dependencies=n===null?null:{lanes:n.lanes,firstContext:n.firstContext},a.sibling=e.sibling,a.index=e.index,a.ref=e.ref,a.refCleanup=e.refCleanup,a}function Dm(e,n){e.flags&=65011714;var a=e.alternate;return a===null?(e.childLanes=0,e.lanes=n,e.child=null,e.subtreeFlags=0,e.memoizedProps=null,e.memoizedState=null,e.updateQueue=null,e.dependencies=null,e.stateNode=null):(e.childLanes=a.childLanes,e.lanes=a.lanes,e.child=a.child,e.subtreeFlags=0,e.deletions=null,e.memoizedProps=a.memoizedProps,e.memoizedState=a.memoizedState,e.updateQueue=a.updateQueue,e.type=a.type,n=a.dependencies,e.dependencies=n===null?null:{lanes:n.lanes,firstContext:n.firstContext}),e}function Vo(e,n,a,o,u,h){var x=0;if(o=e,typeof e=="function")Pu(e)&&(x=1);else if(typeof e=="string")x=T_(e,a,be.current)?26:e==="html"||e==="head"||e==="body"?27:5;else e:switch(e){case P:return e=Wt(31,a,n,u),e.elementType=P,e.lanes=h,e;case S:return Oi(a.children,u,h,n);case C:x=8,u|=24;break;case L:return e=Wt(12,a,n,u|2),e.elementType=L,e.lanes=h,e;case M:return e=Wt(13,a,n,u),e.elementType=M,e.lanes=h,e;case B:return e=Wt(19,a,n,u),e.elementType=B,e.lanes=h,e;default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case se:x=10;break e;case z:x=9;break e;case oe:x=11;break e;case te:x=14;break e;case K:x=16,o=null;break e}x=29,a=Error(s(130,e===null?"null":typeof e,"")),o=null}return n=Wt(x,a,n,u),n.elementType=e,n.type=o,n.lanes=h,n}function Oi(e,n,a,o){return e=Wt(7,e,o,n),e.lanes=a,e}function $u(e,n,a){return e=Wt(6,e,null,n),e.lanes=a,e}function qm(e){var n=Wt(18,null,null,0);return n.stateNode=e,n}function Iu(e,n,a){return n=Wt(4,e.children!==null?e.children:[],e.key,n),n.lanes=a,n.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},n}var Bm=new WeakMap;function _n(e,n){if(typeof e=="object"&&e!==null){var a=Bm.get(e);return a!==void 0?a:(n={value:e,source:n,stack:Oo(n)},Bm.set(e,n),n)}return{value:e,source:n,stack:Oo(n)}}var as=[],os=0,Yo=null,ha=0,wn=[],Sn=0,Dr=null,Gn=1,Fn="";function ar(e,n){as[os++]=ha,as[os++]=Yo,Yo=e,ha=n}function Lm(e,n,a){wn[Sn++]=Gn,wn[Sn++]=Fn,wn[Sn++]=Dr,Dr=e;var o=Gn;e=Fn;var u=32-Bt(o)-1;o&=~(1<<u),a+=1;var h=32-Bt(n)+u;if(30<h){var x=u-u%5;h=(o&(1<<x)-1).toString(32),o>>=x,u-=x,Gn=1<<32-Bt(n)+u|a<<u|o,Fn=h+e}else Gn=1<<h|a<<u|o,Fn=e}function Hu(e){e.return!==null&&(ar(e,1),Lm(e,1,0))}function Gu(e){for(;e===Yo;)Yo=as[--os],as[os]=null,ha=as[--os],as[os]=null;for(;e===Dr;)Dr=wn[--Sn],wn[Sn]=null,Fn=wn[--Sn],wn[Sn]=null,Gn=wn[--Sn],wn[Sn]=null}function zm(e,n){wn[Sn++]=Gn,wn[Sn++]=Fn,wn[Sn++]=Dr,Gn=n.id,Fn=n.overflow,Dr=e}var Tt=null,We=null,ze=!1,qr=null,En=!1,Fu=Error(s(519));function Br(e){var n=Error(s(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw da(_n(n,e)),Fu}function Um(e){var n=e.stateNode,a=e.type,o=e.memoizedProps;switch(n[Je]=e,n[lt]=o,a){case"dialog":qe("cancel",n),qe("close",n);break;case"iframe":case"object":case"embed":qe("load",n);break;case"video":case"audio":for(a=0;a<qa.length;a++)qe(qa[a],n);break;case"source":qe("error",n);break;case"img":case"image":case"link":qe("error",n),qe("load",n);break;case"details":qe("toggle",n);break;case"input":qe("invalid",n),Zd(n,o.value,o.defaultValue,o.checked,o.defaultChecked,o.type,o.name,!0);break;case"select":qe("invalid",n);break;case"textarea":qe("invalid",n),em(n,o.value,o.defaultValue,o.children)}a=o.children,typeof a!="string"&&typeof a!="number"&&typeof a!="bigint"||n.textContent===""+a||o.suppressHydrationWarning===!0||ny(n.textContent,a)?(o.popover!=null&&(qe("beforetoggle",n),qe("toggle",n)),o.onScroll!=null&&qe("scroll",n),o.onScrollEnd!=null&&qe("scrollend",n),o.onClick!=null&&(n.onclick=rr),n=!0):n=!1,n||Br(e,!0)}function Pm(e){for(Tt=e.return;Tt;)switch(Tt.tag){case 5:case 31:case 13:En=!1;return;case 27:case 3:En=!0;return;default:Tt=Tt.return}}function ls(e){if(e!==Tt)return!1;if(!ze)return Pm(e),ze=!0,!1;var n=e.tag,a;if((a=n!==3&&n!==27)&&((a=n===5)&&(a=e.type,a=!(a!=="form"&&a!=="button")||uh(e.type,e.memoizedProps)),a=!a),a&&We&&Br(e),Pm(e),n===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(s(317));We=fy(e)}else if(n===31){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(s(317));We=fy(e)}else n===27?(n=We,Jr(e.type)?(e=ph,ph=null,We=e):We=n):We=Tt?An(e.stateNode.nextSibling):null;return!0}function Ai(){We=Tt=null,ze=!1}function Vu(){var e=qr;return e!==null&&(Kt===null?Kt=e:Kt.push.apply(Kt,e),qr=null),e}function da(e){qr===null?qr=[e]:qr.push(e)}var Yu=we(null),ji=null,or=null;function Lr(e,n,a){Ne(Yu,n._currentValue),n._currentValue=a}function lr(e){e._currentValue=Yu.current,Se(Yu)}function Ku(e,n,a){for(;e!==null;){var o=e.alternate;if((e.childLanes&n)!==n?(e.childLanes|=n,o!==null&&(o.childLanes|=n)):o!==null&&(o.childLanes&n)!==n&&(o.childLanes|=n),e===a)break;e=e.return}}function Xu(e,n,a,o){var u=e.child;for(u!==null&&(u.return=e);u!==null;){var h=u.dependencies;if(h!==null){var x=u.child;h=h.firstContext;e:for(;h!==null;){var E=h;h=u;for(var R=0;R<n.length;R++)if(E.context===n[R]){h.lanes|=a,E=h.alternate,E!==null&&(E.lanes|=a),Ku(h.return,a,e),o||(x=null);break e}h=E.next}}else if(u.tag===18){if(x=u.return,x===null)throw Error(s(341));x.lanes|=a,h=x.alternate,h!==null&&(h.lanes|=a),Ku(x,a,e),x=null}else x=u.child;if(x!==null)x.return=u;else for(x=u;x!==null;){if(x===e){x=null;break}if(u=x.sibling,u!==null){u.return=x.return,x=u;break}x=x.return}u=x}}function cs(e,n,a,o){e=null;for(var u=n,h=!1;u!==null;){if(!h){if((u.flags&524288)!==0)h=!0;else if((u.flags&262144)!==0)break}if(u.tag===10){var x=u.alternate;if(x===null)throw Error(s(387));if(x=x.memoizedProps,x!==null){var E=u.type;Zt(u.pendingProps.value,x.value)||(e!==null?e.push(E):e=[E])}}else if(u===Rt.current){if(x=u.alternate,x===null)throw Error(s(387));x.memoizedState.memoizedState!==u.memoizedState.memoizedState&&(e!==null?e.push(Pa):e=[Pa])}u=u.return}e!==null&&Xu(n,e,a,o),n.flags|=262144}function Ko(e){for(e=e.firstContext;e!==null;){if(!Zt(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function Ti(e){ji=e,or=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function Nt(e){return $m(ji,e)}function Xo(e,n){return ji===null&&Ti(e),$m(e,n)}function $m(e,n){var a=n._currentValue;if(n={context:n,memoizedValue:a,next:null},or===null){if(e===null)throw Error(s(308));or=n,e.dependencies={lanes:0,firstContext:n},e.flags|=524288}else or=or.next=n;return a}var Ex=typeof AbortController<"u"?AbortController:function(){var e=[],n=this.signal={aborted:!1,addEventListener:function(a,o){e.push(o)}};this.abort=function(){n.aborted=!0,e.forEach(function(a){return a()})}},Ox=i.unstable_scheduleCallback,Ax=i.unstable_NormalPriority,bt={$$typeof:se,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Ju(){return{controller:new Ex,data:new Map,refCount:0}}function ma(e){e.refCount--,e.refCount===0&&Ox(Ax,function(){e.controller.abort()})}var pa=null,Qu=0,us=0,fs=null;function jx(e,n){if(pa===null){var a=pa=[];Qu=0,us=th(),fs={status:"pending",value:void 0,then:function(o){a.push(o)}}}return Qu++,n.then(Im,Im),n}function Im(){if(--Qu===0&&pa!==null){fs!==null&&(fs.status="fulfilled");var e=pa;pa=null,us=0,fs=null;for(var n=0;n<e.length;n++)(0,e[n])()}}function Tx(e,n){var a=[],o={status:"pending",value:null,reason:null,then:function(u){a.push(u)}};return e.then(function(){o.status="fulfilled",o.value=n;for(var u=0;u<a.length;u++)(0,a[u])(n)},function(u){for(o.status="rejected",o.reason=u,u=0;u<a.length;u++)(0,a[u])(void 0)}),o}var Hm=F.S;F.S=function(e,n){Ap=tt(),typeof n=="object"&&n!==null&&typeof n.then=="function"&&jx(e,n),Hm!==null&&Hm(e,n)};var Ni=we(null);function Zu(){var e=Ni.current;return e!==null?e:Qe.pooledCache}function Jo(e,n){n===null?Ne(Ni,Ni.current):Ne(Ni,n.pool)}function Gm(){var e=Zu();return e===null?null:{parent:bt._currentValue,pool:e}}var hs=Error(s(460)),Wu=Error(s(474)),Qo=Error(s(542)),Zo={then:function(){}};function Fm(e){return e=e.status,e==="fulfilled"||e==="rejected"}function Vm(e,n,a){switch(a=e[a],a===void 0?e.push(n):a!==n&&(n.then(rr,rr),n=a),n.status){case"fulfilled":return n.value;case"rejected":throw e=n.reason,Km(e),e;default:if(typeof n.status=="string")n.then(rr,rr);else{if(e=Qe,e!==null&&100<e.shellSuspendCounter)throw Error(s(482));e=n,e.status="pending",e.then(function(o){if(n.status==="pending"){var u=n;u.status="fulfilled",u.value=o}},function(o){if(n.status==="pending"){var u=n;u.status="rejected",u.reason=o}})}switch(n.status){case"fulfilled":return n.value;case"rejected":throw e=n.reason,Km(e),e}throw Ci=n,hs}}function ki(e){try{var n=e._init;return n(e._payload)}catch(a){throw a!==null&&typeof a=="object"&&typeof a.then=="function"?(Ci=a,hs):a}}var Ci=null;function Ym(){if(Ci===null)throw Error(s(459));var e=Ci;return Ci=null,e}function Km(e){if(e===hs||e===Qo)throw Error(s(483))}var ds=null,ya=0;function Wo(e){var n=ya;return ya+=1,ds===null&&(ds=[]),Vm(ds,e,n)}function ga(e,n){n=n.props.ref,e.ref=n!==void 0?n:null}function el(e,n){throw n.$$typeof===v?Error(s(525)):(e=Object.prototype.toString.call(n),Error(s(31,e==="[object Object]"?"object with keys {"+Object.keys(n).join(", ")+"}":e)))}function Xm(e){function n(U,q){if(e){var I=U.deletions;I===null?(U.deletions=[q],U.flags|=16):I.push(q)}}function a(U,q){if(!e)return null;for(;q!==null;)n(U,q),q=q.sibling;return null}function o(U){for(var q=new Map;U!==null;)U.key!==null?q.set(U.key,U):q.set(U.index,U),U=U.sibling;return q}function u(U,q){return U=sr(U,q),U.index=0,U.sibling=null,U}function h(U,q,I){return U.index=I,e?(I=U.alternate,I!==null?(I=I.index,I<q?(U.flags|=67108866,q):I):(U.flags|=67108866,q)):(U.flags|=1048576,q)}function x(U){return e&&U.alternate===null&&(U.flags|=67108866),U}function E(U,q,I,Z){return q===null||q.tag!==6?(q=$u(I,U.mode,Z),q.return=U,q):(q=u(q,I),q.return=U,q)}function R(U,q,I,Z){var ve=I.type;return ve===S?Q(U,q,I.props.children,Z,I.key):q!==null&&(q.elementType===ve||typeof ve=="object"&&ve!==null&&ve.$$typeof===K&&ki(ve)===q.type)?(q=u(q,I.props),ga(q,I),q.return=U,q):(q=Vo(I.type,I.key,I.props,null,U.mode,Z),ga(q,I),q.return=U,q)}function H(U,q,I,Z){return q===null||q.tag!==4||q.stateNode.containerInfo!==I.containerInfo||q.stateNode.implementation!==I.implementation?(q=Iu(I,U.mode,Z),q.return=U,q):(q=u(q,I.children||[]),q.return=U,q)}function Q(U,q,I,Z,ve){return q===null||q.tag!==7?(q=Oi(I,U.mode,Z,ve),q.return=U,q):(q=u(q,I),q.return=U,q)}function re(U,q,I){if(typeof q=="string"&&q!==""||typeof q=="number"||typeof q=="bigint")return q=$u(""+q,U.mode,I),q.return=U,q;if(typeof q=="object"&&q!==null){switch(q.$$typeof){case _:return I=Vo(q.type,q.key,q.props,null,U.mode,I),ga(I,q),I.return=U,I;case w:return q=Iu(q,U.mode,I),q.return=U,q;case K:return q=ki(q),re(U,q,I)}if(Te(q)||X(q))return q=Oi(q,U.mode,I,null),q.return=U,q;if(typeof q.then=="function")return re(U,Wo(q),I);if(q.$$typeof===se)return re(U,Xo(U,q),I);el(U,q)}return null}function G(U,q,I,Z){var ve=q!==null?q.key:null;if(typeof I=="string"&&I!==""||typeof I=="number"||typeof I=="bigint")return ve!==null?null:E(U,q,""+I,Z);if(typeof I=="object"&&I!==null){switch(I.$$typeof){case _:return I.key===ve?R(U,q,I,Z):null;case w:return I.key===ve?H(U,q,I,Z):null;case K:return I=ki(I),G(U,q,I,Z)}if(Te(I)||X(I))return ve!==null?null:Q(U,q,I,Z,null);if(typeof I.then=="function")return G(U,q,Wo(I),Z);if(I.$$typeof===se)return G(U,q,Xo(U,I),Z);el(U,I)}return null}function J(U,q,I,Z,ve){if(typeof Z=="string"&&Z!==""||typeof Z=="number"||typeof Z=="bigint")return U=U.get(I)||null,E(q,U,""+Z,ve);if(typeof Z=="object"&&Z!==null){switch(Z.$$typeof){case _:return U=U.get(Z.key===null?I:Z.key)||null,R(q,U,Z,ve);case w:return U=U.get(Z.key===null?I:Z.key)||null,H(q,U,Z,ve);case K:return Z=ki(Z),J(U,q,I,Z,ve)}if(Te(Z)||X(Z))return U=U.get(I)||null,Q(q,U,Z,ve,null);if(typeof Z.then=="function")return J(U,q,I,Wo(Z),ve);if(Z.$$typeof===se)return J(U,q,I,Xo(q,Z),ve);el(q,Z)}return null}function ye(U,q,I,Z){for(var ve=null,$e=null,ge=q,Me=q=0,Le=null;ge!==null&&Me<I.length;Me++){ge.index>Me?(Le=ge,ge=null):Le=ge.sibling;var Ie=G(U,ge,I[Me],Z);if(Ie===null){ge===null&&(ge=Le);break}e&&ge&&Ie.alternate===null&&n(U,ge),q=h(Ie,q,Me),$e===null?ve=Ie:$e.sibling=Ie,$e=Ie,ge=Le}if(Me===I.length)return a(U,ge),ze&&ar(U,Me),ve;if(ge===null){for(;Me<I.length;Me++)ge=re(U,I[Me],Z),ge!==null&&(q=h(ge,q,Me),$e===null?ve=ge:$e.sibling=ge,$e=ge);return ze&&ar(U,Me),ve}for(ge=o(ge);Me<I.length;Me++)Le=J(ge,U,Me,I[Me],Z),Le!==null&&(e&&Le.alternate!==null&&ge.delete(Le.key===null?Me:Le.key),q=h(Le,q,Me),$e===null?ve=Le:$e.sibling=Le,$e=Le);return e&&ge.forEach(function(ti){return n(U,ti)}),ze&&ar(U,Me),ve}function Ae(U,q,I,Z){if(I==null)throw Error(s(151));for(var ve=null,$e=null,ge=q,Me=q=0,Le=null,Ie=I.next();ge!==null&&!Ie.done;Me++,Ie=I.next()){ge.index>Me?(Le=ge,ge=null):Le=ge.sibling;var ti=G(U,ge,Ie.value,Z);if(ti===null){ge===null&&(ge=Le);break}e&&ge&&ti.alternate===null&&n(U,ge),q=h(ti,q,Me),$e===null?ve=ti:$e.sibling=ti,$e=ti,ge=Le}if(Ie.done)return a(U,ge),ze&&ar(U,Me),ve;if(ge===null){for(;!Ie.done;Me++,Ie=I.next())Ie=re(U,Ie.value,Z),Ie!==null&&(q=h(Ie,q,Me),$e===null?ve=Ie:$e.sibling=Ie,$e=Ie);return ze&&ar(U,Me),ve}for(ge=o(ge);!Ie.done;Me++,Ie=I.next())Ie=J(ge,U,Me,Ie.value,Z),Ie!==null&&(e&&Ie.alternate!==null&&ge.delete(Ie.key===null?Me:Ie.key),q=h(Ie,q,Me),$e===null?ve=Ie:$e.sibling=Ie,$e=Ie);return e&&ge.forEach(function(U_){return n(U,U_)}),ze&&ar(U,Me),ve}function Xe(U,q,I,Z){if(typeof I=="object"&&I!==null&&I.type===S&&I.key===null&&(I=I.props.children),typeof I=="object"&&I!==null){switch(I.$$typeof){case _:e:{for(var ve=I.key;q!==null;){if(q.key===ve){if(ve=I.type,ve===S){if(q.tag===7){a(U,q.sibling),Z=u(q,I.props.children),Z.return=U,U=Z;break e}}else if(q.elementType===ve||typeof ve=="object"&&ve!==null&&ve.$$typeof===K&&ki(ve)===q.type){a(U,q.sibling),Z=u(q,I.props),ga(Z,I),Z.return=U,U=Z;break e}a(U,q);break}else n(U,q);q=q.sibling}I.type===S?(Z=Oi(I.props.children,U.mode,Z,I.key),Z.return=U,U=Z):(Z=Vo(I.type,I.key,I.props,null,U.mode,Z),ga(Z,I),Z.return=U,U=Z)}return x(U);case w:e:{for(ve=I.key;q!==null;){if(q.key===ve)if(q.tag===4&&q.stateNode.containerInfo===I.containerInfo&&q.stateNode.implementation===I.implementation){a(U,q.sibling),Z=u(q,I.children||[]),Z.return=U,U=Z;break e}else{a(U,q);break}else n(U,q);q=q.sibling}Z=Iu(I,U.mode,Z),Z.return=U,U=Z}return x(U);case K:return I=ki(I),Xe(U,q,I,Z)}if(Te(I))return ye(U,q,I,Z);if(X(I)){if(ve=X(I),typeof ve!="function")throw Error(s(150));return I=ve.call(I),Ae(U,q,I,Z)}if(typeof I.then=="function")return Xe(U,q,Wo(I),Z);if(I.$$typeof===se)return Xe(U,q,Xo(U,I),Z);el(U,I)}return typeof I=="string"&&I!==""||typeof I=="number"||typeof I=="bigint"?(I=""+I,q!==null&&q.tag===6?(a(U,q.sibling),Z=u(q,I),Z.return=U,U=Z):(a(U,q),Z=$u(I,U.mode,Z),Z.return=U,U=Z),x(U)):a(U,q)}return function(U,q,I,Z){try{ya=0;var ve=Xe(U,q,I,Z);return ds=null,ve}catch(ge){if(ge===hs||ge===Qo)throw ge;var $e=Wt(29,ge,null,U.mode);return $e.lanes=Z,$e.return=U,$e}finally{}}}var Mi=Xm(!0),Jm=Xm(!1),zr=!1;function ef(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function tf(e,n){e=e.updateQueue,n.updateQueue===e&&(n.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,callbacks:null})}function Ur(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function Pr(e,n,a){var o=e.updateQueue;if(o===null)return null;if(o=o.shared,(He&2)!==0){var u=o.pending;return u===null?n.next=n:(n.next=u.next,u.next=n),o.pending=n,n=Fo(e),Rm(e,null,a),n}return Go(e,o,n,a),Fo(e)}function ba(e,n,a){if(n=n.updateQueue,n!==null&&(n=n.shared,(a&4194048)!==0)){var o=n.lanes;o&=e.pendingLanes,a|=o,n.lanes=a,bi(e,a)}}function nf(e,n){var a=e.updateQueue,o=e.alternate;if(o!==null&&(o=o.updateQueue,a===o)){var u=null,h=null;if(a=a.firstBaseUpdate,a!==null){do{var x={lane:a.lane,tag:a.tag,payload:a.payload,callback:null,next:null};h===null?u=h=x:h=h.next=x,a=a.next}while(a!==null);h===null?u=h=n:h=h.next=n}else u=h=n;a={baseState:o.baseState,firstBaseUpdate:u,lastBaseUpdate:h,shared:o.shared,callbacks:o.callbacks},e.updateQueue=a;return}e=a.lastBaseUpdate,e===null?a.firstBaseUpdate=n:e.next=n,a.lastBaseUpdate=n}var rf=!1;function va(){if(rf){var e=fs;if(e!==null)throw e}}function xa(e,n,a,o){rf=!1;var u=e.updateQueue;zr=!1;var h=u.firstBaseUpdate,x=u.lastBaseUpdate,E=u.shared.pending;if(E!==null){u.shared.pending=null;var R=E,H=R.next;R.next=null,x===null?h=H:x.next=H,x=R;var Q=e.alternate;Q!==null&&(Q=Q.updateQueue,E=Q.lastBaseUpdate,E!==x&&(E===null?Q.firstBaseUpdate=H:E.next=H,Q.lastBaseUpdate=R))}if(h!==null){var re=u.baseState;x=0,Q=H=R=null,E=h;do{var G=E.lane&-536870913,J=G!==E.lane;if(J?(Be&G)===G:(o&G)===G){G!==0&&G===us&&(rf=!0),Q!==null&&(Q=Q.next={lane:0,tag:E.tag,payload:E.payload,callback:null,next:null});e:{var ye=e,Ae=E;G=n;var Xe=a;switch(Ae.tag){case 1:if(ye=Ae.payload,typeof ye=="function"){re=ye.call(Xe,re,G);break e}re=ye;break e;case 3:ye.flags=ye.flags&-65537|128;case 0:if(ye=Ae.payload,G=typeof ye=="function"?ye.call(Xe,re,G):ye,G==null)break e;re=b({},re,G);break e;case 2:zr=!0}}G=E.callback,G!==null&&(e.flags|=64,J&&(e.flags|=8192),J=u.callbacks,J===null?u.callbacks=[G]:J.push(G))}else J={lane:G,tag:E.tag,payload:E.payload,callback:E.callback,next:null},Q===null?(H=Q=J,R=re):Q=Q.next=J,x|=G;if(E=E.next,E===null){if(E=u.shared.pending,E===null)break;J=E,E=J.next,J.next=null,u.lastBaseUpdate=J,u.shared.pending=null}}while(!0);Q===null&&(R=re),u.baseState=R,u.firstBaseUpdate=H,u.lastBaseUpdate=Q,h===null&&(u.shared.lanes=0),Fr|=x,e.lanes=x,e.memoizedState=re}}function Qm(e,n){if(typeof e!="function")throw Error(s(191,e));e.call(n)}function Zm(e,n){var a=e.callbacks;if(a!==null)for(e.callbacks=null,e=0;e<a.length;e++)Qm(a[e],n)}var ms=we(null),tl=we(0);function Wm(e,n){e=gr,Ne(tl,e),Ne(ms,n),gr=e|n.baseLanes}function sf(){Ne(tl,gr),Ne(ms,ms.current)}function af(){gr=tl.current,Se(ms),Se(tl)}var en=we(null),On=null;function $r(e){var n=e.alternate;Ne(pt,pt.current&1),Ne(en,e),On===null&&(n===null||ms.current!==null||n.memoizedState!==null)&&(On=e)}function of(e){Ne(pt,pt.current),Ne(en,e),On===null&&(On=e)}function e0(e){e.tag===22?(Ne(pt,pt.current),Ne(en,e),On===null&&(On=e)):Ir()}function Ir(){Ne(pt,pt.current),Ne(en,en.current)}function tn(e){Se(en),On===e&&(On=null),Se(pt)}var pt=we(0);function nl(e){for(var n=e;n!==null;){if(n.tag===13){var a=n.memoizedState;if(a!==null&&(a=a.dehydrated,a===null||dh(a)||mh(a)))return n}else if(n.tag===19&&(n.memoizedProps.revealOrder==="forwards"||n.memoizedProps.revealOrder==="backwards"||n.memoizedProps.revealOrder==="unstable_legacy-backwards"||n.memoizedProps.revealOrder==="together")){if((n.flags&128)!==0)return n}else if(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 null;n=n.return}n.sibling.return=n.return,n=n.sibling}return null}var cr=0,Ce=null,Ye=null,vt=null,rl=!1,ps=!1,Ri=!1,il=0,_a=0,ys=null,Nx=0;function ct(){throw Error(s(321))}function lf(e,n){if(n===null)return!1;for(var a=0;a<n.length&&a<e.length;a++)if(!Zt(e[a],n[a]))return!1;return!0}function cf(e,n,a,o,u,h){return cr=h,Ce=n,n.memoizedState=null,n.updateQueue=null,n.lanes=0,F.H=e===null||e.memoizedState===null?L0:Ef,Ri=!1,h=a(o,u),Ri=!1,ps&&(h=n0(n,a,o,u)),t0(e),h}function t0(e){F.H=Ea;var n=Ye!==null&&Ye.next!==null;if(cr=0,vt=Ye=Ce=null,rl=!1,_a=0,ys=null,n)throw Error(s(300));e===null||xt||(e=e.dependencies,e!==null&&Ko(e)&&(xt=!0))}function n0(e,n,a,o){Ce=e;var u=0;do{if(ps&&(ys=null),_a=0,ps=!1,25<=u)throw Error(s(301));if(u+=1,vt=Ye=null,e.updateQueue!=null){var h=e.updateQueue;h.lastEffect=null,h.events=null,h.stores=null,h.memoCache!=null&&(h.memoCache.index=0)}F.H=z0,h=n(a,o)}while(ps);return h}function kx(){var e=F.H,n=e.useState()[0];return n=typeof n.then=="function"?wa(n):n,e=e.useState()[0],(Ye!==null?Ye.memoizedState:null)!==e&&(Ce.flags|=1024),n}function uf(){var e=il!==0;return il=0,e}function ff(e,n,a){n.updateQueue=e.updateQueue,n.flags&=-2053,e.lanes&=~a}function hf(e){if(rl){for(e=e.memoizedState;e!==null;){var n=e.queue;n!==null&&(n.pending=null),e=e.next}rl=!1}cr=0,vt=Ye=Ce=null,ps=!1,_a=il=0,ys=null}function zt(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return vt===null?Ce.memoizedState=vt=e:vt=vt.next=e,vt}function yt(){if(Ye===null){var e=Ce.alternate;e=e!==null?e.memoizedState:null}else e=Ye.next;var n=vt===null?Ce.memoizedState:vt.next;if(n!==null)vt=n,Ye=e;else{if(e===null)throw Ce.alternate===null?Error(s(467)):Error(s(310));Ye=e,e={memoizedState:Ye.memoizedState,baseState:Ye.baseState,baseQueue:Ye.baseQueue,queue:Ye.queue,next:null},vt===null?Ce.memoizedState=vt=e:vt=vt.next=e}return vt}function sl(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function wa(e){var n=_a;return _a+=1,ys===null&&(ys=[]),e=Vm(ys,e,n),n=Ce,(vt===null?n.memoizedState:vt.next)===null&&(n=n.alternate,F.H=n===null||n.memoizedState===null?L0:Ef),e}function al(e){if(e!==null&&typeof e=="object"){if(typeof e.then=="function")return wa(e);if(e.$$typeof===se)return Nt(e)}throw Error(s(438,String(e)))}function df(e){var n=null,a=Ce.updateQueue;if(a!==null&&(n=a.memoCache),n==null){var o=Ce.alternate;o!==null&&(o=o.updateQueue,o!==null&&(o=o.memoCache,o!=null&&(n={data:o.data.map(function(u){return u.slice()}),index:0})))}if(n==null&&(n={data:[],index:0}),a===null&&(a=sl(),Ce.updateQueue=a),a.memoCache=n,a=n.data[n.index],a===void 0)for(a=n.data[n.index]=Array(e),o=0;o<e;o++)a[o]=Y;return n.index++,a}function ur(e,n){return typeof n=="function"?n(e):n}function ol(e){var n=yt();return mf(n,Ye,e)}function mf(e,n,a){var o=e.queue;if(o===null)throw Error(s(311));o.lastRenderedReducer=a;var u=e.baseQueue,h=o.pending;if(h!==null){if(u!==null){var x=u.next;u.next=h.next,h.next=x}n.baseQueue=u=h,o.pending=null}if(h=e.baseState,u===null)e.memoizedState=h;else{n=u.next;var E=x=null,R=null,H=n,Q=!1;do{var re=H.lane&-536870913;if(re!==H.lane?(Be&re)===re:(cr&re)===re){var G=H.revertLane;if(G===0)R!==null&&(R=R.next={lane:0,revertLane:0,gesture:null,action:H.action,hasEagerState:H.hasEagerState,eagerState:H.eagerState,next:null}),re===us&&(Q=!0);else if((cr&G)===G){H=H.next,G===us&&(Q=!0);continue}else re={lane:0,revertLane:H.revertLane,gesture:null,action:H.action,hasEagerState:H.hasEagerState,eagerState:H.eagerState,next:null},R===null?(E=R=re,x=h):R=R.next=re,Ce.lanes|=G,Fr|=G;re=H.action,Ri&&a(h,re),h=H.hasEagerState?H.eagerState:a(h,re)}else G={lane:re,revertLane:H.revertLane,gesture:H.gesture,action:H.action,hasEagerState:H.hasEagerState,eagerState:H.eagerState,next:null},R===null?(E=R=G,x=h):R=R.next=G,Ce.lanes|=re,Fr|=re;H=H.next}while(H!==null&&H!==n);if(R===null?x=h:R.next=E,!Zt(h,e.memoizedState)&&(xt=!0,Q&&(a=fs,a!==null)))throw a;e.memoizedState=h,e.baseState=x,e.baseQueue=R,o.lastRenderedState=h}return u===null&&(o.lanes=0),[e.memoizedState,o.dispatch]}function pf(e){var n=yt(),a=n.queue;if(a===null)throw Error(s(311));a.lastRenderedReducer=e;var o=a.dispatch,u=a.pending,h=n.memoizedState;if(u!==null){a.pending=null;var x=u=u.next;do h=e(h,x.action),x=x.next;while(x!==u);Zt(h,n.memoizedState)||(xt=!0),n.memoizedState=h,n.baseQueue===null&&(n.baseState=h),a.lastRenderedState=h}return[h,o]}function r0(e,n,a){var o=Ce,u=yt(),h=ze;if(h){if(a===void 0)throw Error(s(407));a=a()}else a=n();var x=!Zt((Ye||u).memoizedState,a);if(x&&(u.memoizedState=a,xt=!0),u=u.queue,bf(a0.bind(null,o,u,e),[e]),u.getSnapshot!==n||x||vt!==null&&vt.memoizedState.tag&1){if(o.flags|=2048,gs(9,{destroy:void 0},s0.bind(null,o,u,a,n),null),Qe===null)throw Error(s(349));h||(cr&127)!==0||i0(o,n,a)}return a}function i0(e,n,a){e.flags|=16384,e={getSnapshot:n,value:a},n=Ce.updateQueue,n===null?(n=sl(),Ce.updateQueue=n,n.stores=[e]):(a=n.stores,a===null?n.stores=[e]:a.push(e))}function s0(e,n,a,o){n.value=a,n.getSnapshot=o,o0(n)&&l0(e)}function a0(e,n,a){return a(function(){o0(n)&&l0(e)})}function o0(e){var n=e.getSnapshot;e=e.value;try{var a=n();return!Zt(e,a)}catch{return!0}}function l0(e){var n=Ei(e,2);n!==null&&Xt(n,e,2)}function yf(e){var n=zt();if(typeof e=="function"){var a=e;if(e=a(),Ri){Jt(!0);try{a()}finally{Jt(!1)}}}return n.memoizedState=n.baseState=e,n.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:ur,lastRenderedState:e},n}function c0(e,n,a,o){return e.baseState=a,mf(e,Ye,typeof o=="function"?o:ur)}function Cx(e,n,a,o,u){if(ul(e))throw Error(s(485));if(e=n.action,e!==null){var h={payload:u,action:e,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(x){h.listeners.push(x)}};F.T!==null?a(!0):h.isTransition=!1,o(h),a=n.pending,a===null?(h.next=n.pending=h,u0(n,h)):(h.next=a.next,n.pending=a.next=h)}}function u0(e,n){var a=n.action,o=n.payload,u=e.state;if(n.isTransition){var h=F.T,x={};F.T=x;try{var E=a(u,o),R=F.S;R!==null&&R(x,E),f0(e,n,E)}catch(H){gf(e,n,H)}finally{h!==null&&x.types!==null&&(h.types=x.types),F.T=h}}else try{h=a(u,o),f0(e,n,h)}catch(H){gf(e,n,H)}}function f0(e,n,a){a!==null&&typeof a=="object"&&typeof a.then=="function"?a.then(function(o){h0(e,n,o)},function(o){return gf(e,n,o)}):h0(e,n,a)}function h0(e,n,a){n.status="fulfilled",n.value=a,d0(n),e.state=a,n=e.pending,n!==null&&(a=n.next,a===n?e.pending=null:(a=a.next,n.next=a,u0(e,a)))}function gf(e,n,a){var o=e.pending;if(e.pending=null,o!==null){o=o.next;do n.status="rejected",n.reason=a,d0(n),n=n.next;while(n!==o)}e.action=null}function d0(e){e=e.listeners;for(var n=0;n<e.length;n++)(0,e[n])()}function m0(e,n){return n}function p0(e,n){if(ze){var a=Qe.formState;if(a!==null){e:{var o=Ce;if(ze){if(We){t:{for(var u=We,h=En;u.nodeType!==8;){if(!h){u=null;break t}if(u=An(u.nextSibling),u===null){u=null;break t}}h=u.data,u=h==="F!"||h==="F"?u:null}if(u){We=An(u.nextSibling),o=u.data==="F!";break e}}Br(o)}o=!1}o&&(n=a[0])}}return a=zt(),a.memoizedState=a.baseState=n,o={pending:null,lanes:0,dispatch:null,lastRenderedReducer:m0,lastRenderedState:n},a.queue=o,a=D0.bind(null,Ce,o),o.dispatch=a,o=yf(!1),h=Sf.bind(null,Ce,!1,o.queue),o=zt(),u={state:n,dispatch:null,action:e,pending:null},o.queue=u,a=Cx.bind(null,Ce,u,h,a),u.dispatch=a,o.memoizedState=e,[n,a,!1]}function y0(e){var n=yt();return g0(n,Ye,e)}function g0(e,n,a){if(n=mf(e,n,m0)[0],e=ol(ur)[0],typeof n=="object"&&n!==null&&typeof n.then=="function")try{var o=wa(n)}catch(x){throw x===hs?Qo:x}else o=n;n=yt();var u=n.queue,h=u.dispatch;return a!==n.memoizedState&&(Ce.flags|=2048,gs(9,{destroy:void 0},Mx.bind(null,u,a),null)),[o,h,e]}function Mx(e,n){e.action=n}function b0(e){var n=yt(),a=Ye;if(a!==null)return g0(n,a,e);yt(),n=n.memoizedState,a=yt();var o=a.queue.dispatch;return a.memoizedState=e,[n,o,!1]}function gs(e,n,a,o){return e={tag:e,create:a,deps:o,inst:n,next:null},n=Ce.updateQueue,n===null&&(n=sl(),Ce.updateQueue=n),a=n.lastEffect,a===null?n.lastEffect=e.next=e:(o=a.next,a.next=e,e.next=o,n.lastEffect=e),e}function v0(){return yt().memoizedState}function ll(e,n,a,o){var u=zt();Ce.flags|=e,u.memoizedState=gs(1|n,{destroy:void 0},a,o===void 0?null:o)}function cl(e,n,a,o){var u=yt();o=o===void 0?null:o;var h=u.memoizedState.inst;Ye!==null&&o!==null&&lf(o,Ye.memoizedState.deps)?u.memoizedState=gs(n,h,a,o):(Ce.flags|=e,u.memoizedState=gs(1|n,h,a,o))}function x0(e,n){ll(8390656,8,e,n)}function bf(e,n){cl(2048,8,e,n)}function Rx(e){Ce.flags|=4;var n=Ce.updateQueue;if(n===null)n=sl(),Ce.updateQueue=n,n.events=[e];else{var a=n.events;a===null?n.events=[e]:a.push(e)}}function _0(e){var n=yt().memoizedState;return Rx({ref:n,nextImpl:e}),function(){if((He&2)!==0)throw Error(s(440));return n.impl.apply(void 0,arguments)}}function w0(e,n){return cl(4,2,e,n)}function S0(e,n){return cl(4,4,e,n)}function E0(e,n){if(typeof n=="function"){e=e();var a=n(e);return function(){typeof a=="function"?a():n(null)}}if(n!=null)return e=e(),n.current=e,function(){n.current=null}}function O0(e,n,a){a=a!=null?a.concat([e]):null,cl(4,4,E0.bind(null,n,e),a)}function vf(){}function A0(e,n){var a=yt();n=n===void 0?null:n;var o=a.memoizedState;return n!==null&&lf(n,o[1])?o[0]:(a.memoizedState=[e,n],e)}function j0(e,n){var a=yt();n=n===void 0?null:n;var o=a.memoizedState;if(n!==null&&lf(n,o[1]))return o[0];if(o=e(),Ri){Jt(!0);try{e()}finally{Jt(!1)}}return a.memoizedState=[o,n],o}function xf(e,n,a){return a===void 0||(cr&1073741824)!==0&&(Be&261930)===0?e.memoizedState=n:(e.memoizedState=a,e=Tp(),Ce.lanes|=e,Fr|=e,a)}function T0(e,n,a,o){return Zt(a,n)?a:ms.current!==null?(e=xf(e,a,o),Zt(e,n)||(xt=!0),e):(cr&42)===0||(cr&1073741824)!==0&&(Be&261930)===0?(xt=!0,e.memoizedState=a):(e=Tp(),Ce.lanes|=e,Fr|=e,n)}function N0(e,n,a,o,u){var h=ae.p;ae.p=h!==0&&8>h?h:8;var x=F.T,E={};F.T=E,Sf(e,!1,n,a);try{var R=u(),H=F.S;if(H!==null&&H(E,R),R!==null&&typeof R=="object"&&typeof R.then=="function"){var Q=Tx(R,o);Sa(e,n,Q,sn(e))}else Sa(e,n,o,sn(e))}catch(re){Sa(e,n,{then:function(){},status:"rejected",reason:re},sn())}finally{ae.p=h,x!==null&&E.types!==null&&(x.types=E.types),F.T=x}}function Dx(){}function _f(e,n,a,o){if(e.tag!==5)throw Error(s(476));var u=k0(e).queue;N0(e,u,n,de,a===null?Dx:function(){return C0(e),a(o)})}function k0(e){var n=e.memoizedState;if(n!==null)return n;n={memoizedState:de,baseState:de,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:ur,lastRenderedState:de},next:null};var a={};return n.next={memoizedState:a,baseState:a,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:ur,lastRenderedState:a},next:null},e.memoizedState=n,e=e.alternate,e!==null&&(e.memoizedState=n),n}function C0(e){var n=k0(e);n.next===null&&(n=e.alternate.memoizedState),Sa(e,n.next.queue,{},sn())}function wf(){return Nt(Pa)}function M0(){return yt().memoizedState}function R0(){return yt().memoizedState}function qx(e){for(var n=e.return;n!==null;){switch(n.tag){case 24:case 3:var a=sn();e=Ur(a);var o=Pr(n,e,a);o!==null&&(Xt(o,n,a),ba(o,n,a)),n={cache:Ju()},e.payload=n;return}n=n.return}}function Bx(e,n,a){var o=sn();a={lane:o,revertLane:0,gesture:null,action:a,hasEagerState:!1,eagerState:null,next:null},ul(e)?q0(n,a):(a=Uu(e,n,a,o),a!==null&&(Xt(a,e,o),B0(a,n,o)))}function D0(e,n,a){var o=sn();Sa(e,n,a,o)}function Sa(e,n,a,o){var u={lane:o,revertLane:0,gesture:null,action:a,hasEagerState:!1,eagerState:null,next:null};if(ul(e))q0(n,u);else{var h=e.alternate;if(e.lanes===0&&(h===null||h.lanes===0)&&(h=n.lastRenderedReducer,h!==null))try{var x=n.lastRenderedState,E=h(x,a);if(u.hasEagerState=!0,u.eagerState=E,Zt(E,x))return Go(e,n,u,0),Qe===null&&Ho(),!1}catch{}finally{}if(a=Uu(e,n,u,o),a!==null)return Xt(a,e,o),B0(a,n,o),!0}return!1}function Sf(e,n,a,o){if(o={lane:2,revertLane:th(),gesture:null,action:o,hasEagerState:!1,eagerState:null,next:null},ul(e)){if(n)throw Error(s(479))}else n=Uu(e,a,o,2),n!==null&&Xt(n,e,2)}function ul(e){var n=e.alternate;return e===Ce||n!==null&&n===Ce}function q0(e,n){ps=rl=!0;var a=e.pending;a===null?n.next=n:(n.next=a.next,a.next=n),e.pending=n}function B0(e,n,a){if((a&4194048)!==0){var o=n.lanes;o&=e.pendingLanes,a|=o,n.lanes=a,bi(e,a)}}var Ea={readContext:Nt,use:al,useCallback:ct,useContext:ct,useEffect:ct,useImperativeHandle:ct,useLayoutEffect:ct,useInsertionEffect:ct,useMemo:ct,useReducer:ct,useRef:ct,useState:ct,useDebugValue:ct,useDeferredValue:ct,useTransition:ct,useSyncExternalStore:ct,useId:ct,useHostTransitionStatus:ct,useFormState:ct,useActionState:ct,useOptimistic:ct,useMemoCache:ct,useCacheRefresh:ct};Ea.useEffectEvent=ct;var L0={readContext:Nt,use:al,useCallback:function(e,n){return zt().memoizedState=[e,n===void 0?null:n],e},useContext:Nt,useEffect:x0,useImperativeHandle:function(e,n,a){a=a!=null?a.concat([e]):null,ll(4194308,4,E0.bind(null,n,e),a)},useLayoutEffect:function(e,n){return ll(4194308,4,e,n)},useInsertionEffect:function(e,n){ll(4,2,e,n)},useMemo:function(e,n){var a=zt();n=n===void 0?null:n;var o=e();if(Ri){Jt(!0);try{e()}finally{Jt(!1)}}return a.memoizedState=[o,n],o},useReducer:function(e,n,a){var o=zt();if(a!==void 0){var u=a(n);if(Ri){Jt(!0);try{a(n)}finally{Jt(!1)}}}else u=n;return o.memoizedState=o.baseState=u,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:u},o.queue=e,e=e.dispatch=Bx.bind(null,Ce,e),[o.memoizedState,e]},useRef:function(e){var n=zt();return e={current:e},n.memoizedState=e},useState:function(e){e=yf(e);var n=e.queue,a=D0.bind(null,Ce,n);return n.dispatch=a,[e.memoizedState,a]},useDebugValue:vf,useDeferredValue:function(e,n){var a=zt();return xf(a,e,n)},useTransition:function(){var e=yf(!1);return e=N0.bind(null,Ce,e.queue,!0,!1),zt().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,n,a){var o=Ce,u=zt();if(ze){if(a===void 0)throw Error(s(407));a=a()}else{if(a=n(),Qe===null)throw Error(s(349));(Be&127)!==0||i0(o,n,a)}u.memoizedState=a;var h={value:a,getSnapshot:n};return u.queue=h,x0(a0.bind(null,o,h,e),[e]),o.flags|=2048,gs(9,{destroy:void 0},s0.bind(null,o,h,a,n),null),a},useId:function(){var e=zt(),n=Qe.identifierPrefix;if(ze){var a=Fn,o=Gn;a=(o&~(1<<32-Bt(o)-1)).toString(32)+a,n="_"+n+"R_"+a,a=il++,0<a&&(n+="H"+a.toString(32)),n+="_"}else a=Nx++,n="_"+n+"r_"+a.toString(32)+"_";return e.memoizedState=n},useHostTransitionStatus:wf,useFormState:p0,useActionState:p0,useOptimistic:function(e){var n=zt();n.memoizedState=n.baseState=e;var a={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return n.queue=a,n=Sf.bind(null,Ce,!0,a),a.dispatch=n,[e,n]},useMemoCache:df,useCacheRefresh:function(){return zt().memoizedState=qx.bind(null,Ce)},useEffectEvent:function(e){var n=zt(),a={impl:e};return n.memoizedState=a,function(){if((He&2)!==0)throw Error(s(440));return a.impl.apply(void 0,arguments)}}},Ef={readContext:Nt,use:al,useCallback:A0,useContext:Nt,useEffect:bf,useImperativeHandle:O0,useInsertionEffect:w0,useLayoutEffect:S0,useMemo:j0,useReducer:ol,useRef:v0,useState:function(){return ol(ur)},useDebugValue:vf,useDeferredValue:function(e,n){var a=yt();return T0(a,Ye.memoizedState,e,n)},useTransition:function(){var e=ol(ur)[0],n=yt().memoizedState;return[typeof e=="boolean"?e:wa(e),n]},useSyncExternalStore:r0,useId:M0,useHostTransitionStatus:wf,useFormState:y0,useActionState:y0,useOptimistic:function(e,n){var a=yt();return c0(a,Ye,e,n)},useMemoCache:df,useCacheRefresh:R0};Ef.useEffectEvent=_0;var z0={readContext:Nt,use:al,useCallback:A0,useContext:Nt,useEffect:bf,useImperativeHandle:O0,useInsertionEffect:w0,useLayoutEffect:S0,useMemo:j0,useReducer:pf,useRef:v0,useState:function(){return pf(ur)},useDebugValue:vf,useDeferredValue:function(e,n){var a=yt();return Ye===null?xf(a,e,n):T0(a,Ye.memoizedState,e,n)},useTransition:function(){var e=pf(ur)[0],n=yt().memoizedState;return[typeof e=="boolean"?e:wa(e),n]},useSyncExternalStore:r0,useId:M0,useHostTransitionStatus:wf,useFormState:b0,useActionState:b0,useOptimistic:function(e,n){var a=yt();return Ye!==null?c0(a,Ye,e,n):(a.baseState=e,[e,a.queue.dispatch])},useMemoCache:df,useCacheRefresh:R0};z0.useEffectEvent=_0;function Of(e,n,a,o){n=e.memoizedState,a=a(o,n),a=a==null?n:b({},n,a),e.memoizedState=a,e.lanes===0&&(e.updateQueue.baseState=a)}var Af={enqueueSetState:function(e,n,a){e=e._reactInternals;var o=sn(),u=Ur(o);u.payload=n,a!=null&&(u.callback=a),n=Pr(e,u,o),n!==null&&(Xt(n,e,o),ba(n,e,o))},enqueueReplaceState:function(e,n,a){e=e._reactInternals;var o=sn(),u=Ur(o);u.tag=1,u.payload=n,a!=null&&(u.callback=a),n=Pr(e,u,o),n!==null&&(Xt(n,e,o),ba(n,e,o))},enqueueForceUpdate:function(e,n){e=e._reactInternals;var a=sn(),o=Ur(a);o.tag=2,n!=null&&(o.callback=n),n=Pr(e,o,a),n!==null&&(Xt(n,e,a),ba(n,e,a))}};function U0(e,n,a,o,u,h,x){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(o,h,x):n.prototype&&n.prototype.isPureReactComponent?!ua(a,o)||!ua(u,h):!0}function P0(e,n,a,o){e=n.state,typeof n.componentWillReceiveProps=="function"&&n.componentWillReceiveProps(a,o),typeof n.UNSAFE_componentWillReceiveProps=="function"&&n.UNSAFE_componentWillReceiveProps(a,o),n.state!==e&&Af.enqueueReplaceState(n,n.state,null)}function Di(e,n){var a=n;if("ref"in n){a={};for(var o in n)o!=="ref"&&(a[o]=n[o])}if(e=e.defaultProps){a===n&&(a=b({},a));for(var u in e)a[u]===void 0&&(a[u]=e[u])}return a}function $0(e){Io(e)}function I0(e){console.error(e)}function H0(e){Io(e)}function fl(e,n){try{var a=e.onUncaughtError;a(n.value,{componentStack:n.stack})}catch(o){setTimeout(function(){throw o})}}function G0(e,n,a){try{var o=e.onCaughtError;o(a.value,{componentStack:a.stack,errorBoundary:n.tag===1?n.stateNode:null})}catch(u){setTimeout(function(){throw u})}}function jf(e,n,a){return a=Ur(a),a.tag=3,a.payload={element:null},a.callback=function(){fl(e,n)},a}function F0(e){return e=Ur(e),e.tag=3,e}function V0(e,n,a,o){var u=a.type.getDerivedStateFromError;if(typeof u=="function"){var h=o.value;e.payload=function(){return u(h)},e.callback=function(){G0(n,a,o)}}var x=a.stateNode;x!==null&&typeof x.componentDidCatch=="function"&&(e.callback=function(){G0(n,a,o),typeof u!="function"&&(Vr===null?Vr=new Set([this]):Vr.add(this));var E=o.stack;this.componentDidCatch(o.value,{componentStack:E!==null?E:""})})}function Lx(e,n,a,o,u){if(a.flags|=32768,o!==null&&typeof o=="object"&&typeof o.then=="function"){if(n=a.alternate,n!==null&&cs(n,a,u,!0),a=en.current,a!==null){switch(a.tag){case 31:case 13:return On===null?Sl():a.alternate===null&&ut===0&&(ut=3),a.flags&=-257,a.flags|=65536,a.lanes=u,o===Zo?a.flags|=16384:(n=a.updateQueue,n===null?a.updateQueue=new Set([o]):n.add(o),Zf(e,o,u)),!1;case 22:return a.flags|=65536,o===Zo?a.flags|=16384:(n=a.updateQueue,n===null?(n={transitions:null,markerInstances:null,retryQueue:new Set([o])},a.updateQueue=n):(a=n.retryQueue,a===null?n.retryQueue=new Set([o]):a.add(o)),Zf(e,o,u)),!1}throw Error(s(435,a.tag))}return Zf(e,o,u),Sl(),!1}if(ze)return n=en.current,n!==null?((n.flags&65536)===0&&(n.flags|=256),n.flags|=65536,n.lanes=u,o!==Fu&&(e=Error(s(422),{cause:o}),da(_n(e,a)))):(o!==Fu&&(n=Error(s(423),{cause:o}),da(_n(n,a))),e=e.current.alternate,e.flags|=65536,u&=-u,e.lanes|=u,o=_n(o,a),u=jf(e.stateNode,o,u),nf(e,u),ut!==4&&(ut=2)),!1;var h=Error(s(520),{cause:o});if(h=_n(h,a),Ma===null?Ma=[h]:Ma.push(h),ut!==4&&(ut=2),n===null)return!0;o=_n(o,a),a=n;do{switch(a.tag){case 3:return a.flags|=65536,e=u&-u,a.lanes|=e,e=jf(a.stateNode,o,e),nf(a,e),!1;case 1:if(n=a.type,h=a.stateNode,(a.flags&128)===0&&(typeof n.getDerivedStateFromError=="function"||h!==null&&typeof h.componentDidCatch=="function"&&(Vr===null||!Vr.has(h))))return a.flags|=65536,u&=-u,a.lanes|=u,u=F0(u),V0(u,e,a,o),nf(a,u),!1}a=a.return}while(a!==null);return!1}var Tf=Error(s(461)),xt=!1;function kt(e,n,a,o){n.child=e===null?Jm(n,null,a,o):Mi(n,e.child,a,o)}function Y0(e,n,a,o,u){a=a.render;var h=n.ref;if("ref"in o){var x={};for(var E in o)E!=="ref"&&(x[E]=o[E])}else x=o;return Ti(n),o=cf(e,n,a,x,h,u),E=uf(),e!==null&&!xt?(ff(e,n,u),fr(e,n,u)):(ze&&E&&Hu(n),n.flags|=1,kt(e,n,o,u),n.child)}function K0(e,n,a,o,u){if(e===null){var h=a.type;return typeof h=="function"&&!Pu(h)&&h.defaultProps===void 0&&a.compare===null?(n.tag=15,n.type=h,X0(e,n,h,o,u)):(e=Vo(a.type,null,o,n,n.mode,u),e.ref=n.ref,e.return=n,n.child=e)}if(h=e.child,!Bf(e,u)){var x=h.memoizedProps;if(a=a.compare,a=a!==null?a:ua,a(x,o)&&e.ref===n.ref)return fr(e,n,u)}return n.flags|=1,e=sr(h,o),e.ref=n.ref,e.return=n,n.child=e}function X0(e,n,a,o,u){if(e!==null){var h=e.memoizedProps;if(ua(h,o)&&e.ref===n.ref)if(xt=!1,n.pendingProps=o=h,Bf(e,u))(e.flags&131072)!==0&&(xt=!0);else return n.lanes=e.lanes,fr(e,n,u)}return Nf(e,n,a,o,u)}function J0(e,n,a,o){var u=o.children,h=e!==null?e.memoizedState:null;if(e===null&&n.stateNode===null&&(n.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),o.mode==="hidden"){if((n.flags&128)!==0){if(h=h!==null?h.baseLanes|a:a,e!==null){for(o=n.child=e.child,u=0;o!==null;)u=u|o.lanes|o.childLanes,o=o.sibling;o=u&~h}else o=0,n.child=null;return Q0(e,n,h,a,o)}if((a&536870912)!==0)n.memoizedState={baseLanes:0,cachePool:null},e!==null&&Jo(n,h!==null?h.cachePool:null),h!==null?Wm(n,h):sf(),e0(n);else return o=n.lanes=536870912,Q0(e,n,h!==null?h.baseLanes|a:a,a,o)}else h!==null?(Jo(n,h.cachePool),Wm(n,h),Ir(),n.memoizedState=null):(e!==null&&Jo(n,null),sf(),Ir());return kt(e,n,u,a),n.child}function Oa(e,n){return e!==null&&e.tag===22||n.stateNode!==null||(n.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),n.sibling}function Q0(e,n,a,o,u){var h=Zu();return h=h===null?null:{parent:bt._currentValue,pool:h},n.memoizedState={baseLanes:a,cachePool:h},e!==null&&Jo(n,null),sf(),e0(n),e!==null&&cs(e,n,o,!0),n.childLanes=u,null}function hl(e,n){return n=ml({mode:n.mode,children:n.children},e.mode),n.ref=e.ref,e.child=n,n.return=e,n}function Z0(e,n,a){return Mi(n,e.child,null,a),e=hl(n,n.pendingProps),e.flags|=2,tn(n),n.memoizedState=null,e}function zx(e,n,a){var o=n.pendingProps,u=(n.flags&128)!==0;if(n.flags&=-129,e===null){if(ze){if(o.mode==="hidden")return e=hl(n,o),n.lanes=536870912,Oa(null,e);if(of(n),(e=We)?(e=uy(e,En),e=e!==null&&e.data==="&"?e:null,e!==null&&(n.memoizedState={dehydrated:e,treeContext:Dr!==null?{id:Gn,overflow:Fn}:null,retryLane:536870912,hydrationErrors:null},a=qm(e),a.return=n,n.child=a,Tt=n,We=null)):e=null,e===null)throw Br(n);return n.lanes=536870912,null}return hl(n,o)}var h=e.memoizedState;if(h!==null){var x=h.dehydrated;if(of(n),u)if(n.flags&256)n.flags&=-257,n=Z0(e,n,a);else if(n.memoizedState!==null)n.child=e.child,n.flags|=128,n=null;else throw Error(s(558));else if(xt||cs(e,n,a,!1),u=(a&e.childLanes)!==0,xt||u){if(o=Qe,o!==null&&(x=Mr(o,a),x!==0&&x!==h.retryLane))throw h.retryLane=x,Ei(e,x),Xt(o,e,x),Tf;Sl(),n=Z0(e,n,a)}else e=h.treeContext,We=An(x.nextSibling),Tt=n,ze=!0,qr=null,En=!1,e!==null&&zm(n,e),n=hl(n,o),n.flags|=4096;return n}return e=sr(e.child,{mode:o.mode,children:o.children}),e.ref=n.ref,n.child=e,e.return=n,e}function dl(e,n){var a=n.ref;if(a===null)e!==null&&e.ref!==null&&(n.flags|=4194816);else{if(typeof a!="function"&&typeof a!="object")throw Error(s(284));(e===null||e.ref!==a)&&(n.flags|=4194816)}}function Nf(e,n,a,o,u){return Ti(n),a=cf(e,n,a,o,void 0,u),o=uf(),e!==null&&!xt?(ff(e,n,u),fr(e,n,u)):(ze&&o&&Hu(n),n.flags|=1,kt(e,n,a,u),n.child)}function W0(e,n,a,o,u,h){return Ti(n),n.updateQueue=null,a=n0(n,o,a,u),t0(e),o=uf(),e!==null&&!xt?(ff(e,n,h),fr(e,n,h)):(ze&&o&&Hu(n),n.flags|=1,kt(e,n,a,h),n.child)}function ep(e,n,a,o,u){if(Ti(n),n.stateNode===null){var h=ss,x=a.contextType;typeof x=="object"&&x!==null&&(h=Nt(x)),h=new a(o,h),n.memoizedState=h.state!==null&&h.state!==void 0?h.state:null,h.updater=Af,n.stateNode=h,h._reactInternals=n,h=n.stateNode,h.props=o,h.state=n.memoizedState,h.refs={},ef(n),x=a.contextType,h.context=typeof x=="object"&&x!==null?Nt(x):ss,h.state=n.memoizedState,x=a.getDerivedStateFromProps,typeof x=="function"&&(Of(n,a,x,o),h.state=n.memoizedState),typeof a.getDerivedStateFromProps=="function"||typeof h.getSnapshotBeforeUpdate=="function"||typeof h.UNSAFE_componentWillMount!="function"&&typeof h.componentWillMount!="function"||(x=h.state,typeof h.componentWillMount=="function"&&h.componentWillMount(),typeof h.UNSAFE_componentWillMount=="function"&&h.UNSAFE_componentWillMount(),x!==h.state&&Af.enqueueReplaceState(h,h.state,null),xa(n,o,h,u),va(),h.state=n.memoizedState),typeof h.componentDidMount=="function"&&(n.flags|=4194308),o=!0}else if(e===null){h=n.stateNode;var E=n.memoizedProps,R=Di(a,E);h.props=R;var H=h.context,Q=a.contextType;x=ss,typeof Q=="object"&&Q!==null&&(x=Nt(Q));var re=a.getDerivedStateFromProps;Q=typeof re=="function"||typeof h.getSnapshotBeforeUpdate=="function",E=n.pendingProps!==E,Q||typeof h.UNSAFE_componentWillReceiveProps!="function"&&typeof h.componentWillReceiveProps!="function"||(E||H!==x)&&P0(n,h,o,x),zr=!1;var G=n.memoizedState;h.state=G,xa(n,o,h,u),va(),H=n.memoizedState,E||G!==H||zr?(typeof re=="function"&&(Of(n,a,re,o),H=n.memoizedState),(R=zr||U0(n,a,R,o,G,H,x))?(Q||typeof h.UNSAFE_componentWillMount!="function"&&typeof h.componentWillMount!="function"||(typeof h.componentWillMount=="function"&&h.componentWillMount(),typeof h.UNSAFE_componentWillMount=="function"&&h.UNSAFE_componentWillMount()),typeof h.componentDidMount=="function"&&(n.flags|=4194308)):(typeof h.componentDidMount=="function"&&(n.flags|=4194308),n.memoizedProps=o,n.memoizedState=H),h.props=o,h.state=H,h.context=x,o=R):(typeof h.componentDidMount=="function"&&(n.flags|=4194308),o=!1)}else{h=n.stateNode,tf(e,n),x=n.memoizedProps,Q=Di(a,x),h.props=Q,re=n.pendingProps,G=h.context,H=a.contextType,R=ss,typeof H=="object"&&H!==null&&(R=Nt(H)),E=a.getDerivedStateFromProps,(H=typeof E=="function"||typeof h.getSnapshotBeforeUpdate=="function")||typeof h.UNSAFE_componentWillReceiveProps!="function"&&typeof h.componentWillReceiveProps!="function"||(x!==re||G!==R)&&P0(n,h,o,R),zr=!1,G=n.memoizedState,h.state=G,xa(n,o,h,u),va();var J=n.memoizedState;x!==re||G!==J||zr||e!==null&&e.dependencies!==null&&Ko(e.dependencies)?(typeof E=="function"&&(Of(n,a,E,o),J=n.memoizedState),(Q=zr||U0(n,a,Q,o,G,J,R)||e!==null&&e.dependencies!==null&&Ko(e.dependencies))?(H||typeof h.UNSAFE_componentWillUpdate!="function"&&typeof h.componentWillUpdate!="function"||(typeof h.componentWillUpdate=="function"&&h.componentWillUpdate(o,J,R),typeof h.UNSAFE_componentWillUpdate=="function"&&h.UNSAFE_componentWillUpdate(o,J,R)),typeof h.componentDidUpdate=="function"&&(n.flags|=4),typeof h.getSnapshotBeforeUpdate=="function"&&(n.flags|=1024)):(typeof h.componentDidUpdate!="function"||x===e.memoizedProps&&G===e.memoizedState||(n.flags|=4),typeof h.getSnapshotBeforeUpdate!="function"||x===e.memoizedProps&&G===e.memoizedState||(n.flags|=1024),n.memoizedProps=o,n.memoizedState=J),h.props=o,h.state=J,h.context=R,o=Q):(typeof h.componentDidUpdate!="function"||x===e.memoizedProps&&G===e.memoizedState||(n.flags|=4),typeof h.getSnapshotBeforeUpdate!="function"||x===e.memoizedProps&&G===e.memoizedState||(n.flags|=1024),o=!1)}return h=o,dl(e,n),o=(n.flags&128)!==0,h||o?(h=n.stateNode,a=o&&typeof a.getDerivedStateFromError!="function"?null:h.render(),n.flags|=1,e!==null&&o?(n.child=Mi(n,e.child,null,u),n.child=Mi(n,null,a,u)):kt(e,n,a,u),n.memoizedState=h.state,e=n.child):e=fr(e,n,u),e}function tp(e,n,a,o){return Ai(),n.flags|=256,kt(e,n,a,o),n.child}var kf={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Cf(e){return{baseLanes:e,cachePool:Gm()}}function Mf(e,n,a){return e=e!==null?e.childLanes&~a:0,n&&(e|=rn),e}function np(e,n,a){var o=n.pendingProps,u=!1,h=(n.flags&128)!==0,x;if((x=h)||(x=e!==null&&e.memoizedState===null?!1:(pt.current&2)!==0),x&&(u=!0,n.flags&=-129),x=(n.flags&32)!==0,n.flags&=-33,e===null){if(ze){if(u?$r(n):Ir(),(e=We)?(e=uy(e,En),e=e!==null&&e.data!=="&"?e:null,e!==null&&(n.memoizedState={dehydrated:e,treeContext:Dr!==null?{id:Gn,overflow:Fn}:null,retryLane:536870912,hydrationErrors:null},a=qm(e),a.return=n,n.child=a,Tt=n,We=null)):e=null,e===null)throw Br(n);return mh(e)?n.lanes=32:n.lanes=536870912,null}var E=o.children;return o=o.fallback,u?(Ir(),u=n.mode,E=ml({mode:"hidden",children:E},u),o=Oi(o,u,a,null),E.return=n,o.return=n,E.sibling=o,n.child=E,o=n.child,o.memoizedState=Cf(a),o.childLanes=Mf(e,x,a),n.memoizedState=kf,Oa(null,o)):($r(n),Rf(n,E))}var R=e.memoizedState;if(R!==null&&(E=R.dehydrated,E!==null)){if(h)n.flags&256?($r(n),n.flags&=-257,n=Df(e,n,a)):n.memoizedState!==null?(Ir(),n.child=e.child,n.flags|=128,n=null):(Ir(),E=o.fallback,u=n.mode,o=ml({mode:"visible",children:o.children},u),E=Oi(E,u,a,null),E.flags|=2,o.return=n,E.return=n,o.sibling=E,n.child=o,Mi(n,e.child,null,a),o=n.child,o.memoizedState=Cf(a),o.childLanes=Mf(e,x,a),n.memoizedState=kf,n=Oa(null,o));else if($r(n),mh(E)){if(x=E.nextSibling&&E.nextSibling.dataset,x)var H=x.dgst;x=H,o=Error(s(419)),o.stack="",o.digest=x,da({value:o,source:null,stack:null}),n=Df(e,n,a)}else if(xt||cs(e,n,a,!1),x=(a&e.childLanes)!==0,xt||x){if(x=Qe,x!==null&&(o=Mr(x,a),o!==0&&o!==R.retryLane))throw R.retryLane=o,Ei(e,o),Xt(x,e,o),Tf;dh(E)||Sl(),n=Df(e,n,a)}else dh(E)?(n.flags|=192,n.child=e.child,n=null):(e=R.treeContext,We=An(E.nextSibling),Tt=n,ze=!0,qr=null,En=!1,e!==null&&zm(n,e),n=Rf(n,o.children),n.flags|=4096);return n}return u?(Ir(),E=o.fallback,u=n.mode,R=e.child,H=R.sibling,o=sr(R,{mode:"hidden",children:o.children}),o.subtreeFlags=R.subtreeFlags&65011712,H!==null?E=sr(H,E):(E=Oi(E,u,a,null),E.flags|=2),E.return=n,o.return=n,o.sibling=E,n.child=o,Oa(null,o),o=n.child,E=e.child.memoizedState,E===null?E=Cf(a):(u=E.cachePool,u!==null?(R=bt._currentValue,u=u.parent!==R?{parent:R,pool:R}:u):u=Gm(),E={baseLanes:E.baseLanes|a,cachePool:u}),o.memoizedState=E,o.childLanes=Mf(e,x,a),n.memoizedState=kf,Oa(e.child,o)):($r(n),a=e.child,e=a.sibling,a=sr(a,{mode:"visible",children:o.children}),a.return=n,a.sibling=null,e!==null&&(x=n.deletions,x===null?(n.deletions=[e],n.flags|=16):x.push(e)),n.child=a,n.memoizedState=null,a)}function Rf(e,n){return n=ml({mode:"visible",children:n},e.mode),n.return=e,e.child=n}function ml(e,n){return e=Wt(22,e,null,n),e.lanes=0,e}function Df(e,n,a){return Mi(n,e.child,null,a),e=Rf(n,n.pendingProps.children),e.flags|=2,n.memoizedState=null,e}function rp(e,n,a){e.lanes|=n;var o=e.alternate;o!==null&&(o.lanes|=n),Ku(e.return,n,a)}function qf(e,n,a,o,u,h){var x=e.memoizedState;x===null?e.memoizedState={isBackwards:n,rendering:null,renderingStartTime:0,last:o,tail:a,tailMode:u,treeForkCount:h}:(x.isBackwards=n,x.rendering=null,x.renderingStartTime=0,x.last=o,x.tail=a,x.tailMode=u,x.treeForkCount=h)}function ip(e,n,a){var o=n.pendingProps,u=o.revealOrder,h=o.tail;o=o.children;var x=pt.current,E=(x&2)!==0;if(E?(x=x&1|2,n.flags|=128):x&=1,Ne(pt,x),kt(e,n,o,a),o=ze?ha:0,!E&&e!==null&&(e.flags&128)!==0)e:for(e=n.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&rp(e,a,n);else if(e.tag===19)rp(e,a,n);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===n)break e;for(;e.sibling===null;){if(e.return===null||e.return===n)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}switch(u){case"forwards":for(a=n.child,u=null;a!==null;)e=a.alternate,e!==null&&nl(e)===null&&(u=a),a=a.sibling;a=u,a===null?(u=n.child,n.child=null):(u=a.sibling,a.sibling=null),qf(n,!1,u,a,h,o);break;case"backwards":case"unstable_legacy-backwards":for(a=null,u=n.child,n.child=null;u!==null;){if(e=u.alternate,e!==null&&nl(e)===null){n.child=u;break}e=u.sibling,u.sibling=a,a=u,u=e}qf(n,!0,a,null,h,o);break;case"together":qf(n,!1,null,null,void 0,o);break;default:n.memoizedState=null}return n.child}function fr(e,n,a){if(e!==null&&(n.dependencies=e.dependencies),Fr|=n.lanes,(a&n.childLanes)===0)if(e!==null){if(cs(e,n,a,!1),(a&n.childLanes)===0)return null}else return null;if(e!==null&&n.child!==e.child)throw Error(s(153));if(n.child!==null){for(e=n.child,a=sr(e,e.pendingProps),n.child=a,a.return=n;e.sibling!==null;)e=e.sibling,a=a.sibling=sr(e,e.pendingProps),a.return=n;a.sibling=null}return n.child}function Bf(e,n){return(e.lanes&n)!==0?!0:(e=e.dependencies,!!(e!==null&&Ko(e)))}function Ux(e,n,a){switch(n.tag){case 3:Dt(n,n.stateNode.containerInfo),Lr(n,bt,e.memoizedState.cache),Ai();break;case 27:case 5:qt(n);break;case 4:Dt(n,n.stateNode.containerInfo);break;case 10:Lr(n,n.type,n.memoizedProps.value);break;case 31:if(n.memoizedState!==null)return n.flags|=128,of(n),null;break;case 13:var o=n.memoizedState;if(o!==null)return o.dehydrated!==null?($r(n),n.flags|=128,null):(a&n.child.childLanes)!==0?np(e,n,a):($r(n),e=fr(e,n,a),e!==null?e.sibling:null);$r(n);break;case 19:var u=(e.flags&128)!==0;if(o=(a&n.childLanes)!==0,o||(cs(e,n,a,!1),o=(a&n.childLanes)!==0),u){if(o)return ip(e,n,a);n.flags|=128}if(u=n.memoizedState,u!==null&&(u.rendering=null,u.tail=null,u.lastEffect=null),Ne(pt,pt.current),o)break;return null;case 22:return n.lanes=0,J0(e,n,a,n.pendingProps);case 24:Lr(n,bt,e.memoizedState.cache)}return fr(e,n,a)}function sp(e,n,a){if(e!==null)if(e.memoizedProps!==n.pendingProps)xt=!0;else{if(!Bf(e,a)&&(n.flags&128)===0)return xt=!1,Ux(e,n,a);xt=(e.flags&131072)!==0}else xt=!1,ze&&(n.flags&1048576)!==0&&Lm(n,ha,n.index);switch(n.lanes=0,n.tag){case 16:e:{var o=n.pendingProps;if(e=ki(n.elementType),n.type=e,typeof e=="function")Pu(e)?(o=Di(e,o),n.tag=1,n=ep(null,n,e,o,a)):(n.tag=0,n=Nf(null,n,e,o,a));else{if(e!=null){var u=e.$$typeof;if(u===oe){n.tag=11,n=Y0(null,n,e,o,a);break e}else if(u===te){n.tag=14,n=K0(null,n,e,o,a);break e}}throw n=_e(e)||e,Error(s(306,n,""))}}return n;case 0:return Nf(e,n,n.type,n.pendingProps,a);case 1:return o=n.type,u=Di(o,n.pendingProps),ep(e,n,o,u,a);case 3:e:{if(Dt(n,n.stateNode.containerInfo),e===null)throw Error(s(387));o=n.pendingProps;var h=n.memoizedState;u=h.element,tf(e,n),xa(n,o,null,a);var x=n.memoizedState;if(o=x.cache,Lr(n,bt,o),o!==h.cache&&Xu(n,[bt],a,!0),va(),o=x.element,h.isDehydrated)if(h={element:o,isDehydrated:!1,cache:x.cache},n.updateQueue.baseState=h,n.memoizedState=h,n.flags&256){n=tp(e,n,o,a);break e}else if(o!==u){u=_n(Error(s(424)),n),da(u),n=tp(e,n,o,a);break e}else{switch(e=n.stateNode.containerInfo,e.nodeType){case 9:e=e.body;break;default:e=e.nodeName==="HTML"?e.ownerDocument.body:e}for(We=An(e.firstChild),Tt=n,ze=!0,qr=null,En=!0,a=Jm(n,null,o,a),n.child=a;a;)a.flags=a.flags&-3|4096,a=a.sibling}else{if(Ai(),o===u){n=fr(e,n,a);break e}kt(e,n,o,a)}n=n.child}return n;case 26:return dl(e,n),e===null?(a=yy(n.type,null,n.pendingProps,null))?n.memoizedState=a:ze||(a=n.type,e=n.pendingProps,o=kl(Ht.current).createElement(a),o[Je]=n,o[lt]=e,Ct(o,a,e),D(o),n.stateNode=o):n.memoizedState=yy(n.type,e.memoizedProps,n.pendingProps,e.memoizedState),null;case 27:return qt(n),e===null&&ze&&(o=n.stateNode=dy(n.type,n.pendingProps,Ht.current),Tt=n,En=!0,u=We,Jr(n.type)?(ph=u,We=An(o.firstChild)):We=u),kt(e,n,n.pendingProps.children,a),dl(e,n),e===null&&(n.flags|=4194304),n.child;case 5:return e===null&&ze&&((u=o=We)&&(o=p_(o,n.type,n.pendingProps,En),o!==null?(n.stateNode=o,Tt=n,We=An(o.firstChild),En=!1,u=!0):u=!1),u||Br(n)),qt(n),u=n.type,h=n.pendingProps,x=e!==null?e.memoizedProps:null,o=h.children,uh(u,h)?o=null:x!==null&&uh(u,x)&&(n.flags|=32),n.memoizedState!==null&&(u=cf(e,n,kx,null,null,a),Pa._currentValue=u),dl(e,n),kt(e,n,o,a),n.child;case 6:return e===null&&ze&&((e=a=We)&&(a=y_(a,n.pendingProps,En),a!==null?(n.stateNode=a,Tt=n,We=null,e=!0):e=!1),e||Br(n)),null;case 13:return np(e,n,a);case 4:return Dt(n,n.stateNode.containerInfo),o=n.pendingProps,e===null?n.child=Mi(n,null,o,a):kt(e,n,o,a),n.child;case 11:return Y0(e,n,n.type,n.pendingProps,a);case 7:return kt(e,n,n.pendingProps,a),n.child;case 8:return kt(e,n,n.pendingProps.children,a),n.child;case 12:return kt(e,n,n.pendingProps.children,a),n.child;case 10:return o=n.pendingProps,Lr(n,n.type,o.value),kt(e,n,o.children,a),n.child;case 9:return u=n.type._context,o=n.pendingProps.children,Ti(n),u=Nt(u),o=o(u),n.flags|=1,kt(e,n,o,a),n.child;case 14:return K0(e,n,n.type,n.pendingProps,a);case 15:return X0(e,n,n.type,n.pendingProps,a);case 19:return ip(e,n,a);case 31:return zx(e,n,a);case 22:return J0(e,n,a,n.pendingProps);case 24:return Ti(n),o=Nt(bt),e===null?(u=Zu(),u===null&&(u=Qe,h=Ju(),u.pooledCache=h,h.refCount++,h!==null&&(u.pooledCacheLanes|=a),u=h),n.memoizedState={parent:o,cache:u},ef(n),Lr(n,bt,u)):((e.lanes&a)!==0&&(tf(e,n),xa(n,null,null,a),va()),u=e.memoizedState,h=n.memoizedState,u.parent!==o?(u={parent:o,cache:o},n.memoizedState=u,n.lanes===0&&(n.memoizedState=n.updateQueue.baseState=u),Lr(n,bt,o)):(o=h.cache,Lr(n,bt,o),o!==u.cache&&Xu(n,[bt],a,!0))),kt(e,n,n.pendingProps.children,a),n.child;case 29:throw n.pendingProps}throw Error(s(156,n.tag))}function hr(e){e.flags|=4}function Lf(e,n,a,o,u){if((n=(e.mode&32)!==0)&&(n=!1),n){if(e.flags|=16777216,(u&335544128)===u)if(e.stateNode.complete)e.flags|=8192;else if(Mp())e.flags|=8192;else throw Ci=Zo,Wu}else e.flags&=-16777217}function ap(e,n){if(n.type!=="stylesheet"||(n.state.loading&4)!==0)e.flags&=-16777217;else if(e.flags|=16777216,!_y(n))if(Mp())e.flags|=8192;else throw Ci=Zo,Wu}function pl(e,n){n!==null&&(e.flags|=4),e.flags&16384&&(n=e.tag!==22?Xi():536870912,e.lanes|=n,_s|=n)}function Aa(e,n){if(!ze)switch(e.tailMode){case"hidden":n=e.tail;for(var a=null;n!==null;)n.alternate!==null&&(a=n),n=n.sibling;a===null?e.tail=null:a.sibling=null;break;case"collapsed":a=e.tail;for(var o=null;a!==null;)a.alternate!==null&&(o=a),a=a.sibling;o===null?n||e.tail===null?e.tail=null:e.tail.sibling=null:o.sibling=null}}function et(e){var n=e.alternate!==null&&e.alternate.child===e.child,a=0,o=0;if(n)for(var u=e.child;u!==null;)a|=u.lanes|u.childLanes,o|=u.subtreeFlags&65011712,o|=u.flags&65011712,u.return=e,u=u.sibling;else for(u=e.child;u!==null;)a|=u.lanes|u.childLanes,o|=u.subtreeFlags,o|=u.flags,u.return=e,u=u.sibling;return e.subtreeFlags|=o,e.childLanes=a,n}function Px(e,n,a){var o=n.pendingProps;switch(Gu(n),n.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return et(n),null;case 1:return et(n),null;case 3:return a=n.stateNode,o=null,e!==null&&(o=e.memoizedState.cache),n.memoizedState.cache!==o&&(n.flags|=2048),lr(bt),ke(),a.pendingContext&&(a.context=a.pendingContext,a.pendingContext=null),(e===null||e.child===null)&&(ls(n)?hr(n):e===null||e.memoizedState.isDehydrated&&(n.flags&256)===0||(n.flags|=1024,Vu())),et(n),null;case 26:var u=n.type,h=n.memoizedState;return e===null?(hr(n),h!==null?(et(n),ap(n,h)):(et(n),Lf(n,u,null,o,a))):h?h!==e.memoizedState?(hr(n),et(n),ap(n,h)):(et(n),n.flags&=-16777217):(e=e.memoizedProps,e!==o&&hr(n),et(n),Lf(n,u,e,o,a)),null;case 27:if(di(n),a=Ht.current,u=n.type,e!==null&&n.stateNode!=null)e.memoizedProps!==o&&hr(n);else{if(!o){if(n.stateNode===null)throw Error(s(166));return et(n),null}e=be.current,ls(n)?Um(n):(e=dy(u,o,a),n.stateNode=e,hr(n))}return et(n),null;case 5:if(di(n),u=n.type,e!==null&&n.stateNode!=null)e.memoizedProps!==o&&hr(n);else{if(!o){if(n.stateNode===null)throw Error(s(166));return et(n),null}if(h=be.current,ls(n))Um(n);else{var x=kl(Ht.current);switch(h){case 1:h=x.createElementNS("http://www.w3.org/2000/svg",u);break;case 2:h=x.createElementNS("http://www.w3.org/1998/Math/MathML",u);break;default:switch(u){case"svg":h=x.createElementNS("http://www.w3.org/2000/svg",u);break;case"math":h=x.createElementNS("http://www.w3.org/1998/Math/MathML",u);break;case"script":h=x.createElement("div"),h.innerHTML="<script><\/script>",h=h.removeChild(h.firstChild);break;case"select":h=typeof o.is=="string"?x.createElement("select",{is:o.is}):x.createElement("select"),o.multiple?h.multiple=!0:o.size&&(h.size=o.size);break;default:h=typeof o.is=="string"?x.createElement(u,{is:o.is}):x.createElement(u)}}h[Je]=n,h[lt]=o;e:for(x=n.child;x!==null;){if(x.tag===5||x.tag===6)h.appendChild(x.stateNode);else if(x.tag!==4&&x.tag!==27&&x.child!==null){x.child.return=x,x=x.child;continue}if(x===n)break e;for(;x.sibling===null;){if(x.return===null||x.return===n)break e;x=x.return}x.sibling.return=x.return,x=x.sibling}n.stateNode=h;e:switch(Ct(h,u,o),u){case"button":case"input":case"select":case"textarea":o=!!o.autoFocus;break e;case"img":o=!0;break e;default:o=!1}o&&hr(n)}}return et(n),Lf(n,n.type,e===null?null:e.memoizedProps,n.pendingProps,a),null;case 6:if(e&&n.stateNode!=null)e.memoizedProps!==o&&hr(n);else{if(typeof o!="string"&&n.stateNode===null)throw Error(s(166));if(e=Ht.current,ls(n)){if(e=n.stateNode,a=n.memoizedProps,o=null,u=Tt,u!==null)switch(u.tag){case 27:case 5:o=u.memoizedProps}e[Je]=n,e=!!(e.nodeValue===a||o!==null&&o.suppressHydrationWarning===!0||ny(e.nodeValue,a)),e||Br(n,!0)}else e=kl(e).createTextNode(o),e[Je]=n,n.stateNode=e}return et(n),null;case 31:if(a=n.memoizedState,e===null||e.memoizedState!==null){if(o=ls(n),a!==null){if(e===null){if(!o)throw Error(s(318));if(e=n.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(s(557));e[Je]=n}else Ai(),(n.flags&128)===0&&(n.memoizedState=null),n.flags|=4;et(n),e=!1}else a=Vu(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=a),e=!0;if(!e)return n.flags&256?(tn(n),n):(tn(n),null);if((n.flags&128)!==0)throw Error(s(558))}return et(n),null;case 13:if(o=n.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(u=ls(n),o!==null&&o.dehydrated!==null){if(e===null){if(!u)throw Error(s(318));if(u=n.memoizedState,u=u!==null?u.dehydrated:null,!u)throw Error(s(317));u[Je]=n}else Ai(),(n.flags&128)===0&&(n.memoizedState=null),n.flags|=4;et(n),u=!1}else u=Vu(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=u),u=!0;if(!u)return n.flags&256?(tn(n),n):(tn(n),null)}return tn(n),(n.flags&128)!==0?(n.lanes=a,n):(a=o!==null,e=e!==null&&e.memoizedState!==null,a&&(o=n.child,u=null,o.alternate!==null&&o.alternate.memoizedState!==null&&o.alternate.memoizedState.cachePool!==null&&(u=o.alternate.memoizedState.cachePool.pool),h=null,o.memoizedState!==null&&o.memoizedState.cachePool!==null&&(h=o.memoizedState.cachePool.pool),h!==u&&(o.flags|=2048)),a!==e&&a&&(n.child.flags|=8192),pl(n,n.updateQueue),et(n),null);case 4:return ke(),e===null&&sh(n.stateNode.containerInfo),et(n),null;case 10:return lr(n.type),et(n),null;case 19:if(Se(pt),o=n.memoizedState,o===null)return et(n),null;if(u=(n.flags&128)!==0,h=o.rendering,h===null)if(u)Aa(o,!1);else{if(ut!==0||e!==null&&(e.flags&128)!==0)for(e=n.child;e!==null;){if(h=nl(e),h!==null){for(n.flags|=128,Aa(o,!1),e=h.updateQueue,n.updateQueue=e,pl(n,e),n.subtreeFlags=0,e=a,a=n.child;a!==null;)Dm(a,e),a=a.sibling;return Ne(pt,pt.current&1|2),ze&&ar(n,o.treeForkCount),n.child}e=e.sibling}o.tail!==null&&tt()>xl&&(n.flags|=128,u=!0,Aa(o,!1),n.lanes=4194304)}else{if(!u)if(e=nl(h),e!==null){if(n.flags|=128,u=!0,e=e.updateQueue,n.updateQueue=e,pl(n,e),Aa(o,!0),o.tail===null&&o.tailMode==="hidden"&&!h.alternate&&!ze)return et(n),null}else 2*tt()-o.renderingStartTime>xl&&a!==536870912&&(n.flags|=128,u=!0,Aa(o,!1),n.lanes=4194304);o.isBackwards?(h.sibling=n.child,n.child=h):(e=o.last,e!==null?e.sibling=h:n.child=h,o.last=h)}return o.tail!==null?(e=o.tail,o.rendering=e,o.tail=e.sibling,o.renderingStartTime=tt(),e.sibling=null,a=pt.current,Ne(pt,u?a&1|2:a&1),ze&&ar(n,o.treeForkCount),e):(et(n),null);case 22:case 23:return tn(n),af(),o=n.memoizedState!==null,e!==null?e.memoizedState!==null!==o&&(n.flags|=8192):o&&(n.flags|=8192),o?(a&536870912)!==0&&(n.flags&128)===0&&(et(n),n.subtreeFlags&6&&(n.flags|=8192)):et(n),a=n.updateQueue,a!==null&&pl(n,a.retryQueue),a=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(a=e.memoizedState.cachePool.pool),o=null,n.memoizedState!==null&&n.memoizedState.cachePool!==null&&(o=n.memoizedState.cachePool.pool),o!==a&&(n.flags|=2048),e!==null&&Se(Ni),null;case 24:return a=null,e!==null&&(a=e.memoizedState.cache),n.memoizedState.cache!==a&&(n.flags|=2048),lr(bt),et(n),null;case 25:return null;case 30:return null}throw Error(s(156,n.tag))}function $x(e,n){switch(Gu(n),n.tag){case 1:return e=n.flags,e&65536?(n.flags=e&-65537|128,n):null;case 3:return lr(bt),ke(),e=n.flags,(e&65536)!==0&&(e&128)===0?(n.flags=e&-65537|128,n):null;case 26:case 27:case 5:return di(n),null;case 31:if(n.memoizedState!==null){if(tn(n),n.alternate===null)throw Error(s(340));Ai()}return e=n.flags,e&65536?(n.flags=e&-65537|128,n):null;case 13:if(tn(n),e=n.memoizedState,e!==null&&e.dehydrated!==null){if(n.alternate===null)throw Error(s(340));Ai()}return e=n.flags,e&65536?(n.flags=e&-65537|128,n):null;case 19:return Se(pt),null;case 4:return ke(),null;case 10:return lr(n.type),null;case 22:case 23:return tn(n),af(),e!==null&&Se(Ni),e=n.flags,e&65536?(n.flags=e&-65537|128,n):null;case 24:return lr(bt),null;case 25:return null;default:return null}}function op(e,n){switch(Gu(n),n.tag){case 3:lr(bt),ke();break;case 26:case 27:case 5:di(n);break;case 4:ke();break;case 31:n.memoizedState!==null&&tn(n);break;case 13:tn(n);break;case 19:Se(pt);break;case 10:lr(n.type);break;case 22:case 23:tn(n),af(),e!==null&&Se(Ni);break;case 24:lr(bt)}}function ja(e,n){try{var a=n.updateQueue,o=a!==null?a.lastEffect:null;if(o!==null){var u=o.next;a=u;do{if((a.tag&e)===e){o=void 0;var h=a.create,x=a.inst;o=h(),x.destroy=o}a=a.next}while(a!==u)}}catch(E){Fe(n,n.return,E)}}function Hr(e,n,a){try{var o=n.updateQueue,u=o!==null?o.lastEffect:null;if(u!==null){var h=u.next;o=h;do{if((o.tag&e)===e){var x=o.inst,E=x.destroy;if(E!==void 0){x.destroy=void 0,u=n;var R=a,H=E;try{H()}catch(Q){Fe(u,R,Q)}}}o=o.next}while(o!==h)}}catch(Q){Fe(n,n.return,Q)}}function lp(e){var n=e.updateQueue;if(n!==null){var a=e.stateNode;try{Zm(n,a)}catch(o){Fe(e,e.return,o)}}}function cp(e,n,a){a.props=Di(e.type,e.memoizedProps),a.state=e.memoizedState;try{a.componentWillUnmount()}catch(o){Fe(e,n,o)}}function Ta(e,n){try{var a=e.ref;if(a!==null){switch(e.tag){case 26:case 27:case 5:var o=e.stateNode;break;case 30:o=e.stateNode;break;default:o=e.stateNode}typeof a=="function"?e.refCleanup=a(o):a.current=o}}catch(u){Fe(e,n,u)}}function Vn(e,n){var a=e.ref,o=e.refCleanup;if(a!==null)if(typeof o=="function")try{o()}catch(u){Fe(e,n,u)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof a=="function")try{a(null)}catch(u){Fe(e,n,u)}else a.current=null}function up(e){var n=e.type,a=e.memoizedProps,o=e.stateNode;try{e:switch(n){case"button":case"input":case"select":case"textarea":a.autoFocus&&o.focus();break e;case"img":a.src?o.src=a.src:a.srcSet&&(o.srcset=a.srcSet)}}catch(u){Fe(e,e.return,u)}}function zf(e,n,a){try{var o=e.stateNode;c_(o,e.type,a,n),o[lt]=n}catch(u){Fe(e,e.return,u)}}function fp(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&Jr(e.type)||e.tag===4}function Uf(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||fp(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.tag===27&&Jr(e.type)||e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function Pf(e,n,a){var o=e.tag;if(o===5||o===6)e=e.stateNode,n?(a.nodeType===9?a.body:a.nodeName==="HTML"?a.ownerDocument.body:a).insertBefore(e,n):(n=a.nodeType===9?a.body:a.nodeName==="HTML"?a.ownerDocument.body:a,n.appendChild(e),a=a._reactRootContainer,a!=null||n.onclick!==null||(n.onclick=rr));else if(o!==4&&(o===27&&Jr(e.type)&&(a=e.stateNode,n=null),e=e.child,e!==null))for(Pf(e,n,a),e=e.sibling;e!==null;)Pf(e,n,a),e=e.sibling}function yl(e,n,a){var o=e.tag;if(o===5||o===6)e=e.stateNode,n?a.insertBefore(e,n):a.appendChild(e);else if(o!==4&&(o===27&&Jr(e.type)&&(a=e.stateNode),e=e.child,e!==null))for(yl(e,n,a),e=e.sibling;e!==null;)yl(e,n,a),e=e.sibling}function hp(e){var n=e.stateNode,a=e.memoizedProps;try{for(var o=e.type,u=n.attributes;u.length;)n.removeAttributeNode(u[0]);Ct(n,o,a),n[Je]=e,n[lt]=a}catch(h){Fe(e,e.return,h)}}var dr=!1,_t=!1,$f=!1,dp=typeof WeakSet=="function"?WeakSet:Set,Ot=null;function Ix(e,n){if(e=e.containerInfo,lh=Ll,e=Om(e),Ru(e)){if("selectionStart"in e)var a={start:e.selectionStart,end:e.selectionEnd};else e:{a=(a=e.ownerDocument)&&a.defaultView||window;var o=a.getSelection&&a.getSelection();if(o&&o.rangeCount!==0){a=o.anchorNode;var u=o.anchorOffset,h=o.focusNode;o=o.focusOffset;try{a.nodeType,h.nodeType}catch{a=null;break e}var x=0,E=-1,R=-1,H=0,Q=0,re=e,G=null;t:for(;;){for(var J;re!==a||u!==0&&re.nodeType!==3||(E=x+u),re!==h||o!==0&&re.nodeType!==3||(R=x+o),re.nodeType===3&&(x+=re.nodeValue.length),(J=re.firstChild)!==null;)G=re,re=J;for(;;){if(re===e)break t;if(G===a&&++H===u&&(E=x),G===h&&++Q===o&&(R=x),(J=re.nextSibling)!==null)break;re=G,G=re.parentNode}re=J}a=E===-1||R===-1?null:{start:E,end:R}}else a=null}a=a||{start:0,end:0}}else a=null;for(ch={focusedElem:e,selectionRange:a},Ll=!1,Ot=n;Ot!==null;)if(n=Ot,e=n.child,(n.subtreeFlags&1028)!==0&&e!==null)e.return=n,Ot=e;else for(;Ot!==null;){switch(n=Ot,h=n.alternate,e=n.flags,n.tag){case 0:if((e&4)!==0&&(e=n.updateQueue,e=e!==null?e.events:null,e!==null))for(a=0;a<e.length;a++)u=e[a],u.ref.impl=u.nextImpl;break;case 11:case 15:break;case 1:if((e&1024)!==0&&h!==null){e=void 0,a=n,u=h.memoizedProps,h=h.memoizedState,o=a.stateNode;try{var ye=Di(a.type,u);e=o.getSnapshotBeforeUpdate(ye,h),o.__reactInternalSnapshotBeforeUpdate=e}catch(Ae){Fe(a,a.return,Ae)}}break;case 3:if((e&1024)!==0){if(e=n.stateNode.containerInfo,a=e.nodeType,a===9)hh(e);else if(a===1)switch(e.nodeName){case"HEAD":case"HTML":case"BODY":hh(e);break;default:e.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((e&1024)!==0)throw Error(s(163))}if(e=n.sibling,e!==null){e.return=n.return,Ot=e;break}Ot=n.return}}function mp(e,n,a){var o=a.flags;switch(a.tag){case 0:case 11:case 15:pr(e,a),o&4&&ja(5,a);break;case 1:if(pr(e,a),o&4)if(e=a.stateNode,n===null)try{e.componentDidMount()}catch(x){Fe(a,a.return,x)}else{var u=Di(a.type,n.memoizedProps);n=n.memoizedState;try{e.componentDidUpdate(u,n,e.__reactInternalSnapshotBeforeUpdate)}catch(x){Fe(a,a.return,x)}}o&64&&lp(a),o&512&&Ta(a,a.return);break;case 3:if(pr(e,a),o&64&&(e=a.updateQueue,e!==null)){if(n=null,a.child!==null)switch(a.child.tag){case 27:case 5:n=a.child.stateNode;break;case 1:n=a.child.stateNode}try{Zm(e,n)}catch(x){Fe(a,a.return,x)}}break;case 27:n===null&&o&4&&hp(a);case 26:case 5:pr(e,a),n===null&&o&4&&up(a),o&512&&Ta(a,a.return);break;case 12:pr(e,a);break;case 31:pr(e,a),o&4&&gp(e,a);break;case 13:pr(e,a),o&4&&bp(e,a),o&64&&(e=a.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(a=Qx.bind(null,a),g_(e,a))));break;case 22:if(o=a.memoizedState!==null||dr,!o){n=n!==null&&n.memoizedState!==null||_t,u=dr;var h=_t;dr=o,(_t=n)&&!h?yr(e,a,(a.subtreeFlags&8772)!==0):pr(e,a),dr=u,_t=h}break;case 30:break;default:pr(e,a)}}function pp(e){var n=e.alternate;n!==null&&(e.alternate=null,pp(n)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(n=e.stateNode,n!==null&&Ji(n)),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}var nt=null,Ft=!1;function mr(e,n,a){for(a=a.child;a!==null;)yp(e,n,a),a=a.sibling}function yp(e,n,a){if(mt&&typeof mt.onCommitFiberUnmount=="function")try{mt.onCommitFiberUnmount(pi,a)}catch{}switch(a.tag){case 26:_t||Vn(a,n),mr(e,n,a),a.memoizedState?a.memoizedState.count--:a.stateNode&&(a=a.stateNode,a.parentNode.removeChild(a));break;case 27:_t||Vn(a,n);var o=nt,u=Ft;Jr(a.type)&&(nt=a.stateNode,Ft=!1),mr(e,n,a),La(a.stateNode),nt=o,Ft=u;break;case 5:_t||Vn(a,n);case 6:if(o=nt,u=Ft,nt=null,mr(e,n,a),nt=o,Ft=u,nt!==null)if(Ft)try{(nt.nodeType===9?nt.body:nt.nodeName==="HTML"?nt.ownerDocument.body:nt).removeChild(a.stateNode)}catch(h){Fe(a,n,h)}else try{nt.removeChild(a.stateNode)}catch(h){Fe(a,n,h)}break;case 18:nt!==null&&(Ft?(e=nt,ly(e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,a.stateNode),Ns(e)):ly(nt,a.stateNode));break;case 4:o=nt,u=Ft,nt=a.stateNode.containerInfo,Ft=!0,mr(e,n,a),nt=o,Ft=u;break;case 0:case 11:case 14:case 15:Hr(2,a,n),_t||Hr(4,a,n),mr(e,n,a);break;case 1:_t||(Vn(a,n),o=a.stateNode,typeof o.componentWillUnmount=="function"&&cp(a,n,o)),mr(e,n,a);break;case 21:mr(e,n,a);break;case 22:_t=(o=_t)||a.memoizedState!==null,mr(e,n,a),_t=o;break;default:mr(e,n,a)}}function gp(e,n){if(n.memoizedState===null&&(e=n.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{Ns(e)}catch(a){Fe(n,n.return,a)}}}function bp(e,n){if(n.memoizedState===null&&(e=n.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{Ns(e)}catch(a){Fe(n,n.return,a)}}function Hx(e){switch(e.tag){case 31:case 13:case 19:var n=e.stateNode;return n===null&&(n=e.stateNode=new dp),n;case 22:return e=e.stateNode,n=e._retryCache,n===null&&(n=e._retryCache=new dp),n;default:throw Error(s(435,e.tag))}}function gl(e,n){var a=Hx(e);n.forEach(function(o){if(!a.has(o)){a.add(o);var u=Zx.bind(null,e,o);o.then(u,u)}})}function Vt(e,n){var a=n.deletions;if(a!==null)for(var o=0;o<a.length;o++){var u=a[o],h=e,x=n,E=x;e:for(;E!==null;){switch(E.tag){case 27:if(Jr(E.type)){nt=E.stateNode,Ft=!1;break e}break;case 5:nt=E.stateNode,Ft=!1;break e;case 3:case 4:nt=E.stateNode.containerInfo,Ft=!0;break e}E=E.return}if(nt===null)throw Error(s(160));yp(h,x,u),nt=null,Ft=!1,h=u.alternate,h!==null&&(h.return=null),u.return=null}if(n.subtreeFlags&13886)for(n=n.child;n!==null;)vp(n,e),n=n.sibling}var Bn=null;function vp(e,n){var a=e.alternate,o=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:Vt(n,e),Yt(e),o&4&&(Hr(3,e,e.return),ja(3,e),Hr(5,e,e.return));break;case 1:Vt(n,e),Yt(e),o&512&&(_t||a===null||Vn(a,a.return)),o&64&&dr&&(e=e.updateQueue,e!==null&&(o=e.callbacks,o!==null&&(a=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=a===null?o:a.concat(o))));break;case 26:var u=Bn;if(Vt(n,e),Yt(e),o&512&&(_t||a===null||Vn(a,a.return)),o&4){var h=a!==null?a.memoizedState:null;if(o=e.memoizedState,a===null)if(o===null)if(e.stateNode===null){e:{o=e.type,a=e.memoizedProps,u=u.ownerDocument||u;t:switch(o){case"title":h=u.getElementsByTagName("title")[0],(!h||h[St]||h[Je]||h.namespaceURI==="http://www.w3.org/2000/svg"||h.hasAttribute("itemprop"))&&(h=u.createElement(o),u.head.insertBefore(h,u.querySelector("head > title"))),Ct(h,o,a),h[Je]=e,D(h),o=h;break e;case"link":var x=vy("link","href",u).get(o+(a.href||""));if(x){for(var E=0;E<x.length;E++)if(h=x[E],h.getAttribute("href")===(a.href==null||a.href===""?null:a.href)&&h.getAttribute("rel")===(a.rel==null?null:a.rel)&&h.getAttribute("title")===(a.title==null?null:a.title)&&h.getAttribute("crossorigin")===(a.crossOrigin==null?null:a.crossOrigin)){x.splice(E,1);break t}}h=u.createElement(o),Ct(h,o,a),u.head.appendChild(h);break;case"meta":if(x=vy("meta","content",u).get(o+(a.content||""))){for(E=0;E<x.length;E++)if(h=x[E],h.getAttribute("content")===(a.content==null?null:""+a.content)&&h.getAttribute("name")===(a.name==null?null:a.name)&&h.getAttribute("property")===(a.property==null?null:a.property)&&h.getAttribute("http-equiv")===(a.httpEquiv==null?null:a.httpEquiv)&&h.getAttribute("charset")===(a.charSet==null?null:a.charSet)){x.splice(E,1);break t}}h=u.createElement(o),Ct(h,o,a),u.head.appendChild(h);break;default:throw Error(s(468,o))}h[Je]=e,D(h),o=h}e.stateNode=o}else xy(u,e.type,e.stateNode);else e.stateNode=by(u,o,e.memoizedProps);else h!==o?(h===null?a.stateNode!==null&&(a=a.stateNode,a.parentNode.removeChild(a)):h.count--,o===null?xy(u,e.type,e.stateNode):by(u,o,e.memoizedProps)):o===null&&e.stateNode!==null&&zf(e,e.memoizedProps,a.memoizedProps)}break;case 27:Vt(n,e),Yt(e),o&512&&(_t||a===null||Vn(a,a.return)),a!==null&&o&4&&zf(e,e.memoizedProps,a.memoizedProps);break;case 5:if(Vt(n,e),Yt(e),o&512&&(_t||a===null||Vn(a,a.return)),e.flags&32){u=e.stateNode;try{Zi(u,"")}catch(ye){Fe(e,e.return,ye)}}o&4&&e.stateNode!=null&&(u=e.memoizedProps,zf(e,u,a!==null?a.memoizedProps:u)),o&1024&&($f=!0);break;case 6:if(Vt(n,e),Yt(e),o&4){if(e.stateNode===null)throw Error(s(162));o=e.memoizedProps,a=e.stateNode;try{a.nodeValue=o}catch(ye){Fe(e,e.return,ye)}}break;case 3:if(Rl=null,u=Bn,Bn=Cl(n.containerInfo),Vt(n,e),Bn=u,Yt(e),o&4&&a!==null&&a.memoizedState.isDehydrated)try{Ns(n.containerInfo)}catch(ye){Fe(e,e.return,ye)}$f&&($f=!1,xp(e));break;case 4:o=Bn,Bn=Cl(e.stateNode.containerInfo),Vt(n,e),Yt(e),Bn=o;break;case 12:Vt(n,e),Yt(e);break;case 31:Vt(n,e),Yt(e),o&4&&(o=e.updateQueue,o!==null&&(e.updateQueue=null,gl(e,o)));break;case 13:Vt(n,e),Yt(e),e.child.flags&8192&&e.memoizedState!==null!=(a!==null&&a.memoizedState!==null)&&(vl=tt()),o&4&&(o=e.updateQueue,o!==null&&(e.updateQueue=null,gl(e,o)));break;case 22:u=e.memoizedState!==null;var R=a!==null&&a.memoizedState!==null,H=dr,Q=_t;if(dr=H||u,_t=Q||R,Vt(n,e),_t=Q,dr=H,Yt(e),o&8192)e:for(n=e.stateNode,n._visibility=u?n._visibility&-2:n._visibility|1,u&&(a===null||R||dr||_t||qi(e)),a=null,n=e;;){if(n.tag===5||n.tag===26){if(a===null){R=a=n;try{if(h=R.stateNode,u)x=h.style,typeof x.setProperty=="function"?x.setProperty("display","none","important"):x.display="none";else{E=R.stateNode;var re=R.memoizedProps.style,G=re!=null&&re.hasOwnProperty("display")?re.display:null;E.style.display=G==null||typeof G=="boolean"?"":(""+G).trim()}}catch(ye){Fe(R,R.return,ye)}}}else if(n.tag===6){if(a===null){R=n;try{R.stateNode.nodeValue=u?"":R.memoizedProps}catch(ye){Fe(R,R.return,ye)}}}else if(n.tag===18){if(a===null){R=n;try{var J=R.stateNode;u?cy(J,!0):cy(R.stateNode,!1)}catch(ye){Fe(R,R.return,ye)}}}else if((n.tag!==22&&n.tag!==23||n.memoizedState===null||n===e)&&n.child!==null){n.child.return=n,n=n.child;continue}if(n===e)break e;for(;n.sibling===null;){if(n.return===null||n.return===e)break e;a===n&&(a=null),n=n.return}a===n&&(a=null),n.sibling.return=n.return,n=n.sibling}o&4&&(o=e.updateQueue,o!==null&&(a=o.retryQueue,a!==null&&(o.retryQueue=null,gl(e,a))));break;case 19:Vt(n,e),Yt(e),o&4&&(o=e.updateQueue,o!==null&&(e.updateQueue=null,gl(e,o)));break;case 30:break;case 21:break;default:Vt(n,e),Yt(e)}}function Yt(e){var n=e.flags;if(n&2){try{for(var a,o=e.return;o!==null;){if(fp(o)){a=o;break}o=o.return}if(a==null)throw Error(s(160));switch(a.tag){case 27:var u=a.stateNode,h=Uf(e);yl(e,h,u);break;case 5:var x=a.stateNode;a.flags&32&&(Zi(x,""),a.flags&=-33);var E=Uf(e);yl(e,E,x);break;case 3:case 4:var R=a.stateNode.containerInfo,H=Uf(e);Pf(e,H,R);break;default:throw Error(s(161))}}catch(Q){Fe(e,e.return,Q)}e.flags&=-3}n&4096&&(e.flags&=-4097)}function xp(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var n=e;xp(n),n.tag===5&&n.flags&1024&&n.stateNode.reset(),e=e.sibling}}function pr(e,n){if(n.subtreeFlags&8772)for(n=n.child;n!==null;)mp(e,n.alternate,n),n=n.sibling}function qi(e){for(e=e.child;e!==null;){var n=e;switch(n.tag){case 0:case 11:case 14:case 15:Hr(4,n,n.return),qi(n);break;case 1:Vn(n,n.return);var a=n.stateNode;typeof a.componentWillUnmount=="function"&&cp(n,n.return,a),qi(n);break;case 27:La(n.stateNode);case 26:case 5:Vn(n,n.return),qi(n);break;case 22:n.memoizedState===null&&qi(n);break;case 30:qi(n);break;default:qi(n)}e=e.sibling}}function yr(e,n,a){for(a=a&&(n.subtreeFlags&8772)!==0,n=n.child;n!==null;){var o=n.alternate,u=e,h=n,x=h.flags;switch(h.tag){case 0:case 11:case 15:yr(u,h,a),ja(4,h);break;case 1:if(yr(u,h,a),o=h,u=o.stateNode,typeof u.componentDidMount=="function")try{u.componentDidMount()}catch(H){Fe(o,o.return,H)}if(o=h,u=o.updateQueue,u!==null){var E=o.stateNode;try{var R=u.shared.hiddenCallbacks;if(R!==null)for(u.shared.hiddenCallbacks=null,u=0;u<R.length;u++)Qm(R[u],E)}catch(H){Fe(o,o.return,H)}}a&&x&64&&lp(h),Ta(h,h.return);break;case 27:hp(h);case 26:case 5:yr(u,h,a),a&&o===null&&x&4&&up(h),Ta(h,h.return);break;case 12:yr(u,h,a);break;case 31:yr(u,h,a),a&&x&4&&gp(u,h);break;case 13:yr(u,h,a),a&&x&4&&bp(u,h);break;case 22:h.memoizedState===null&&yr(u,h,a),Ta(h,h.return);break;case 30:break;default:yr(u,h,a)}n=n.sibling}}function If(e,n){var a=null;e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(a=e.memoizedState.cachePool.pool),e=null,n.memoizedState!==null&&n.memoizedState.cachePool!==null&&(e=n.memoizedState.cachePool.pool),e!==a&&(e!=null&&e.refCount++,a!=null&&ma(a))}function Hf(e,n){e=null,n.alternate!==null&&(e=n.alternate.memoizedState.cache),n=n.memoizedState.cache,n!==e&&(n.refCount++,e!=null&&ma(e))}function Ln(e,n,a,o){if(n.subtreeFlags&10256)for(n=n.child;n!==null;)_p(e,n,a,o),n=n.sibling}function _p(e,n,a,o){var u=n.flags;switch(n.tag){case 0:case 11:case 15:Ln(e,n,a,o),u&2048&&ja(9,n);break;case 1:Ln(e,n,a,o);break;case 3:Ln(e,n,a,o),u&2048&&(e=null,n.alternate!==null&&(e=n.alternate.memoizedState.cache),n=n.memoizedState.cache,n!==e&&(n.refCount++,e!=null&&ma(e)));break;case 12:if(u&2048){Ln(e,n,a,o),e=n.stateNode;try{var h=n.memoizedProps,x=h.id,E=h.onPostCommit;typeof E=="function"&&E(x,n.alternate===null?"mount":"update",e.passiveEffectDuration,-0)}catch(R){Fe(n,n.return,R)}}else Ln(e,n,a,o);break;case 31:Ln(e,n,a,o);break;case 13:Ln(e,n,a,o);break;case 23:break;case 22:h=n.stateNode,x=n.alternate,n.memoizedState!==null?h._visibility&2?Ln(e,n,a,o):Na(e,n):h._visibility&2?Ln(e,n,a,o):(h._visibility|=2,bs(e,n,a,o,(n.subtreeFlags&10256)!==0||!1)),u&2048&&If(x,n);break;case 24:Ln(e,n,a,o),u&2048&&Hf(n.alternate,n);break;default:Ln(e,n,a,o)}}function bs(e,n,a,o,u){for(u=u&&((n.subtreeFlags&10256)!==0||!1),n=n.child;n!==null;){var h=e,x=n,E=a,R=o,H=x.flags;switch(x.tag){case 0:case 11:case 15:bs(h,x,E,R,u),ja(8,x);break;case 23:break;case 22:var Q=x.stateNode;x.memoizedState!==null?Q._visibility&2?bs(h,x,E,R,u):Na(h,x):(Q._visibility|=2,bs(h,x,E,R,u)),u&&H&2048&&If(x.alternate,x);break;case 24:bs(h,x,E,R,u),u&&H&2048&&Hf(x.alternate,x);break;default:bs(h,x,E,R,u)}n=n.sibling}}function Na(e,n){if(n.subtreeFlags&10256)for(n=n.child;n!==null;){var a=e,o=n,u=o.flags;switch(o.tag){case 22:Na(a,o),u&2048&&If(o.alternate,o);break;case 24:Na(a,o),u&2048&&Hf(o.alternate,o);break;default:Na(a,o)}n=n.sibling}}var ka=8192;function vs(e,n,a){if(e.subtreeFlags&ka)for(e=e.child;e!==null;)wp(e,n,a),e=e.sibling}function wp(e,n,a){switch(e.tag){case 26:vs(e,n,a),e.flags&ka&&e.memoizedState!==null&&N_(a,Bn,e.memoizedState,e.memoizedProps);break;case 5:vs(e,n,a);break;case 3:case 4:var o=Bn;Bn=Cl(e.stateNode.containerInfo),vs(e,n,a),Bn=o;break;case 22:e.memoizedState===null&&(o=e.alternate,o!==null&&o.memoizedState!==null?(o=ka,ka=16777216,vs(e,n,a),ka=o):vs(e,n,a));break;default:vs(e,n,a)}}function Sp(e){var n=e.alternate;if(n!==null&&(e=n.child,e!==null)){n.child=null;do n=e.sibling,e.sibling=null,e=n;while(e!==null)}}function Ca(e){var n=e.deletions;if((e.flags&16)!==0){if(n!==null)for(var a=0;a<n.length;a++){var o=n[a];Ot=o,Op(o,e)}Sp(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)Ep(e),e=e.sibling}function Ep(e){switch(e.tag){case 0:case 11:case 15:Ca(e),e.flags&2048&&Hr(9,e,e.return);break;case 3:Ca(e);break;case 12:Ca(e);break;case 22:var n=e.stateNode;e.memoizedState!==null&&n._visibility&2&&(e.return===null||e.return.tag!==13)?(n._visibility&=-3,bl(e)):Ca(e);break;default:Ca(e)}}function bl(e){var n=e.deletions;if((e.flags&16)!==0){if(n!==null)for(var a=0;a<n.length;a++){var o=n[a];Ot=o,Op(o,e)}Sp(e)}for(e=e.child;e!==null;){switch(n=e,n.tag){case 0:case 11:case 15:Hr(8,n,n.return),bl(n);break;case 22:a=n.stateNode,a._visibility&2&&(a._visibility&=-3,bl(n));break;default:bl(n)}e=e.sibling}}function Op(e,n){for(;Ot!==null;){var a=Ot;switch(a.tag){case 0:case 11:case 15:Hr(8,a,n);break;case 23:case 22:if(a.memoizedState!==null&&a.memoizedState.cachePool!==null){var o=a.memoizedState.cachePool.pool;o!=null&&o.refCount++}break;case 24:ma(a.memoizedState.cache)}if(o=a.child,o!==null)o.return=a,Ot=o;else e:for(a=e;Ot!==null;){o=Ot;var u=o.sibling,h=o.return;if(pp(o),o===a){Ot=null;break e}if(u!==null){u.return=h,Ot=u;break e}Ot=h}}}var Gx={getCacheForType:function(e){var n=Nt(bt),a=n.data.get(e);return a===void 0&&(a=e(),n.data.set(e,a)),a},cacheSignal:function(){return Nt(bt).controller.signal}},Fx=typeof WeakMap=="function"?WeakMap:Map,He=0,Qe=null,De=null,Be=0,Ge=0,nn=null,Gr=!1,xs=!1,Gf=!1,gr=0,ut=0,Fr=0,Bi=0,Ff=0,rn=0,_s=0,Ma=null,Kt=null,Vf=!1,vl=0,Ap=0,xl=1/0,_l=null,Vr=null,Et=0,Yr=null,ws=null,br=0,Yf=0,Kf=null,jp=null,Ra=0,Xf=null;function sn(){return(He&2)!==0&&Be!==0?Be&-Be:F.T!==null?th():ta()}function Tp(){if(rn===0)if((Be&536870912)===0||ze){var e=er;er<<=1,(er&3932160)===0&&(er=262144),rn=e}else rn=536870912;return e=en.current,e!==null&&(e.flags|=32),rn}function Xt(e,n,a){(e===Qe&&(Ge===2||Ge===9)||e.cancelPendingCommit!==null)&&(Ss(e,0),Kr(e,Be,rn,!1)),Rn(e,a),((He&2)===0||e!==Qe)&&(e===Qe&&((He&2)===0&&(Bi|=a),ut===4&&Kr(e,Be,rn,!1)),Yn(e))}function Np(e,n,a){if((He&6)!==0)throw Error(s(327));var o=!a&&(n&127)===0&&(n&e.expiredLanes)===0||gi(e,n),u=o?Kx(e,n):Qf(e,n,!0),h=o;do{if(u===0){xs&&!o&&Kr(e,n,0,!1);break}else{if(a=e.current.alternate,h&&!Vx(a)){u=Qf(e,n,!1),h=!1;continue}if(u===2){if(h=n,e.errorRecoveryDisabledLanes&h)var x=0;else x=e.pendingLanes&-536870913,x=x!==0?x:x&536870912?536870912:0;if(x!==0){n=x;e:{var E=e;u=Ma;var R=E.current.memoizedState.isDehydrated;if(R&&(Ss(E,x).flags|=256),x=Qf(E,x,!1),x!==2){if(Gf&&!R){E.errorRecoveryDisabledLanes|=h,Bi|=h,u=4;break e}h=Kt,Kt=u,h!==null&&(Kt===null?Kt=h:Kt.push.apply(Kt,h))}u=x}if(h=!1,u!==2)continue}}if(u===1){Ss(e,0),Kr(e,n,0,!0);break}e:{switch(o=e,h=u,h){case 0:case 1:throw Error(s(345));case 4:if((n&4194048)!==n)break;case 6:Kr(o,n,rn,!Gr);break e;case 2:Kt=null;break;case 3:case 5:break;default:throw Error(s(329))}if((n&62914560)===n&&(u=vl+300-tt(),10<u)){if(Kr(o,n,rn,!Gr),yi(o,0,!0)!==0)break e;br=n,o.timeoutHandle=ay(kp.bind(null,o,a,Kt,_l,Vf,n,rn,Bi,_s,Gr,h,"Throttled",-0,0),u);break e}kp(o,a,Kt,_l,Vf,n,rn,Bi,_s,Gr,h,null,-0,0)}}break}while(!0);Yn(e)}function kp(e,n,a,o,u,h,x,E,R,H,Q,re,G,J){if(e.timeoutHandle=-1,re=n.subtreeFlags,re&8192||(re&16785408)===16785408){re={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:rr},wp(n,h,re);var ye=(h&62914560)===h?vl-tt():(h&4194048)===h?Ap-tt():0;if(ye=k_(re,ye),ye!==null){br=h,e.cancelPendingCommit=ye(zp.bind(null,e,n,h,a,o,u,x,E,R,Q,re,null,G,J)),Kr(e,h,x,!H);return}}zp(e,n,h,a,o,u,x,E,R)}function Vx(e){for(var n=e;;){var a=n.tag;if((a===0||a===11||a===15)&&n.flags&16384&&(a=n.updateQueue,a!==null&&(a=a.stores,a!==null)))for(var o=0;o<a.length;o++){var u=a[o],h=u.getSnapshot;u=u.value;try{if(!Zt(h(),u))return!1}catch{return!1}}if(a=n.child,n.subtreeFlags&16384&&a!==null)a.return=n,n=a;else{if(n===e)break;for(;n.sibling===null;){if(n.return===null||n.return===e)return!0;n=n.return}n.sibling.return=n.return,n=n.sibling}}return!0}function Kr(e,n,a,o){n&=~Ff,n&=~Bi,e.suspendedLanes|=n,e.pingedLanes&=~n,o&&(e.warmLanes|=n),o=e.expirationTimes;for(var u=n;0<u;){var h=31-Bt(u),x=1<<h;o[h]=-1,u&=~x}a!==0&&Cr(e,a,n)}function wl(){return(He&6)===0?(Da(0),!1):!0}function Jf(){if(De!==null){if(Ge===0)var e=De.return;else e=De,or=ji=null,hf(e),ds=null,ya=0,e=De;for(;e!==null;)op(e.alternate,e),e=e.return;De=null}}function Ss(e,n){var a=e.timeoutHandle;a!==-1&&(e.timeoutHandle=-1,h_(a)),a=e.cancelPendingCommit,a!==null&&(e.cancelPendingCommit=null,a()),br=0,Jf(),Qe=e,De=a=sr(e.current,null),Be=n,Ge=0,nn=null,Gr=!1,xs=gi(e,n),Gf=!1,_s=rn=Ff=Bi=Fr=ut=0,Kt=Ma=null,Vf=!1,(n&8)!==0&&(n|=n&32);var o=e.entangledLanes;if(o!==0)for(e=e.entanglements,o&=n;0<o;){var u=31-Bt(o),h=1<<u;n|=e[u],o&=~h}return gr=n,Ho(),a}function Cp(e,n){Ce=null,F.H=Ea,n===hs||n===Qo?(n=Ym(),Ge=3):n===Wu?(n=Ym(),Ge=4):Ge=n===Tf?8:n!==null&&typeof n=="object"&&typeof n.then=="function"?6:1,nn=n,De===null&&(ut=1,fl(e,_n(n,e.current)))}function Mp(){var e=en.current;return e===null?!0:(Be&4194048)===Be?On===null:(Be&62914560)===Be||(Be&536870912)!==0?e===On:!1}function Rp(){var e=F.H;return F.H=Ea,e===null?Ea:e}function Dp(){var e=F.A;return F.A=Gx,e}function Sl(){ut=4,Gr||(Be&4194048)!==Be&&en.current!==null||(xs=!0),(Fr&134217727)===0&&(Bi&134217727)===0||Qe===null||Kr(Qe,Be,rn,!1)}function Qf(e,n,a){var o=He;He|=2;var u=Rp(),h=Dp();(Qe!==e||Be!==n)&&(_l=null,Ss(e,n)),n=!1;var x=ut;e:do try{if(Ge!==0&&De!==null){var E=De,R=nn;switch(Ge){case 8:Jf(),x=6;break e;case 3:case 2:case 9:case 6:en.current===null&&(n=!0);var H=Ge;if(Ge=0,nn=null,Es(e,E,R,H),a&&xs){x=0;break e}break;default:H=Ge,Ge=0,nn=null,Es(e,E,R,H)}}Yx(),x=ut;break}catch(Q){Cp(e,Q)}while(!0);return n&&e.shellSuspendCounter++,or=ji=null,He=o,F.H=u,F.A=h,De===null&&(Qe=null,Be=0,Ho()),x}function Yx(){for(;De!==null;)qp(De)}function Kx(e,n){var a=He;He|=2;var o=Rp(),u=Dp();Qe!==e||Be!==n?(_l=null,xl=tt()+500,Ss(e,n)):xs=gi(e,n);e:do try{if(Ge!==0&&De!==null){n=De;var h=nn;t:switch(Ge){case 1:Ge=0,nn=null,Es(e,n,h,1);break;case 2:case 9:if(Fm(h)){Ge=0,nn=null,Bp(n);break}n=function(){Ge!==2&&Ge!==9||Qe!==e||(Ge=7),Yn(e)},h.then(n,n);break e;case 3:Ge=7;break e;case 4:Ge=5;break e;case 7:Fm(h)?(Ge=0,nn=null,Bp(n)):(Ge=0,nn=null,Es(e,n,h,7));break;case 5:var x=null;switch(De.tag){case 26:x=De.memoizedState;case 5:case 27:var E=De;if(x?_y(x):E.stateNode.complete){Ge=0,nn=null;var R=E.sibling;if(R!==null)De=R;else{var H=E.return;H!==null?(De=H,El(H)):De=null}break t}}Ge=0,nn=null,Es(e,n,h,5);break;case 6:Ge=0,nn=null,Es(e,n,h,6);break;case 8:Jf(),ut=6;break e;default:throw Error(s(462))}}Xx();break}catch(Q){Cp(e,Q)}while(!0);return or=ji=null,F.H=o,F.A=u,He=a,De!==null?0:(Qe=null,Be=0,Ho(),ut)}function Xx(){for(;De!==null&&!Ao();)qp(De)}function qp(e){var n=sp(e.alternate,e,gr);e.memoizedProps=e.pendingProps,n===null?El(e):De=n}function Bp(e){var n=e,a=n.alternate;switch(n.tag){case 15:case 0:n=W0(a,n,n.pendingProps,n.type,void 0,Be);break;case 11:n=W0(a,n,n.pendingProps,n.type.render,n.ref,Be);break;case 5:hf(n);default:op(a,n),n=De=Dm(n,gr),n=sp(a,n,gr)}e.memoizedProps=e.pendingProps,n===null?El(e):De=n}function Es(e,n,a,o){or=ji=null,hf(n),ds=null,ya=0;var u=n.return;try{if(Lx(e,u,n,a,Be)){ut=1,fl(e,_n(a,e.current)),De=null;return}}catch(h){if(u!==null)throw De=u,h;ut=1,fl(e,_n(a,e.current)),De=null;return}n.flags&32768?(ze||o===1?e=!0:xs||(Be&536870912)!==0?e=!1:(Gr=e=!0,(o===2||o===9||o===3||o===6)&&(o=en.current,o!==null&&o.tag===13&&(o.flags|=16384))),Lp(n,e)):El(n)}function El(e){var n=e;do{if((n.flags&32768)!==0){Lp(n,Gr);return}e=n.return;var a=Px(n.alternate,n,gr);if(a!==null){De=a;return}if(n=n.sibling,n!==null){De=n;return}De=n=e}while(n!==null);ut===0&&(ut=5)}function Lp(e,n){do{var a=$x(e.alternate,e);if(a!==null){a.flags&=32767,De=a;return}if(a=e.return,a!==null&&(a.flags|=32768,a.subtreeFlags=0,a.deletions=null),!n&&(e=e.sibling,e!==null)){De=e;return}De=e=a}while(e!==null);ut=6,De=null}function zp(e,n,a,o,u,h,x,E,R){e.cancelPendingCommit=null;do Ol();while(Et!==0);if((He&6)!==0)throw Error(s(327));if(n!==null){if(n===e.current)throw Error(s(177));if(h=n.lanes|n.childLanes,h|=zu,kr(e,a,h,x,E,R),e===Qe&&(De=Qe=null,Be=0),ws=n,Yr=e,br=a,Yf=h,Kf=u,jp=o,(n.subtreeFlags&10256)!==0||(n.flags&10256)!==0?(e.callbackNode=null,e.callbackPriority=0,Wx(Yi,function(){return Hp(),null})):(e.callbackNode=null,e.callbackPriority=0),o=(n.flags&13878)!==0,(n.subtreeFlags&13878)!==0||o){o=F.T,F.T=null,u=ae.p,ae.p=2,x=He,He|=4;try{Ix(e,n,a)}finally{He=x,ae.p=u,F.T=o}}Et=1,Up(),Pp(),$p()}}function Up(){if(Et===1){Et=0;var e=Yr,n=ws,a=(n.flags&13878)!==0;if((n.subtreeFlags&13878)!==0||a){a=F.T,F.T=null;var o=ae.p;ae.p=2;var u=He;He|=4;try{vp(n,e);var h=ch,x=Om(e.containerInfo),E=h.focusedElem,R=h.selectionRange;if(x!==E&&E&&E.ownerDocument&&Em(E.ownerDocument.documentElement,E)){if(R!==null&&Ru(E)){var H=R.start,Q=R.end;if(Q===void 0&&(Q=H),"selectionStart"in E)E.selectionStart=H,E.selectionEnd=Math.min(Q,E.value.length);else{var re=E.ownerDocument||document,G=re&&re.defaultView||window;if(G.getSelection){var J=G.getSelection(),ye=E.textContent.length,Ae=Math.min(R.start,ye),Xe=R.end===void 0?Ae:Math.min(R.end,ye);!J.extend&&Ae>Xe&&(x=Xe,Xe=Ae,Ae=x);var U=Sm(E,Ae),q=Sm(E,Xe);if(U&&q&&(J.rangeCount!==1||J.anchorNode!==U.node||J.anchorOffset!==U.offset||J.focusNode!==q.node||J.focusOffset!==q.offset)){var I=re.createRange();I.setStart(U.node,U.offset),J.removeAllRanges(),Ae>Xe?(J.addRange(I),J.extend(q.node,q.offset)):(I.setEnd(q.node,q.offset),J.addRange(I))}}}}for(re=[],J=E;J=J.parentNode;)J.nodeType===1&&re.push({element:J,left:J.scrollLeft,top:J.scrollTop});for(typeof E.focus=="function"&&E.focus(),E=0;E<re.length;E++){var Z=re[E];Z.element.scrollLeft=Z.left,Z.element.scrollTop=Z.top}}Ll=!!lh,ch=lh=null}finally{He=u,ae.p=o,F.T=a}}e.current=n,Et=2}}function Pp(){if(Et===2){Et=0;var e=Yr,n=ws,a=(n.flags&8772)!==0;if((n.subtreeFlags&8772)!==0||a){a=F.T,F.T=null;var o=ae.p;ae.p=2;var u=He;He|=4;try{mp(e,n.alternate,n)}finally{He=u,ae.p=o,F.T=a}}Et=3}}function $p(){if(Et===4||Et===3){Et=0,Vi();var e=Yr,n=ws,a=br,o=jp;(n.subtreeFlags&10256)!==0||(n.flags&10256)!==0?Et=5:(Et=0,ws=Yr=null,Ip(e,e.pendingLanes));var u=e.pendingLanes;if(u===0&&(Vr=null),vi(a),n=n.stateNode,mt&&typeof mt.onCommitFiberRoot=="function")try{mt.onCommitFiberRoot(pi,n,void 0,(n.current.flags&128)===128)}catch{}if(o!==null){n=F.T,u=ae.p,ae.p=2,F.T=null;try{for(var h=e.onRecoverableError,x=0;x<o.length;x++){var E=o[x];h(E.value,{componentStack:E.stack})}}finally{F.T=n,ae.p=u}}(br&3)!==0&&Ol(),Yn(e),u=e.pendingLanes,(a&261930)!==0&&(u&42)!==0?e===Xf?Ra++:(Ra=0,Xf=e):Ra=0,Da(0)}}function Ip(e,n){(e.pooledCacheLanes&=n)===0&&(n=e.pooledCache,n!=null&&(e.pooledCache=null,ma(n)))}function Ol(){return Up(),Pp(),$p(),Hp()}function Hp(){if(Et!==5)return!1;var e=Yr,n=Yf;Yf=0;var a=vi(br),o=F.T,u=ae.p;try{ae.p=32>a?32:a,F.T=null,a=Kf,Kf=null;var h=Yr,x=br;if(Et=0,ws=Yr=null,br=0,(He&6)!==0)throw Error(s(331));var E=He;if(He|=4,Ep(h.current),_p(h,h.current,x,a),He=E,Da(0,!1),mt&&typeof mt.onPostCommitFiberRoot=="function")try{mt.onPostCommitFiberRoot(pi,h)}catch{}return!0}finally{ae.p=u,F.T=o,Ip(e,n)}}function Gp(e,n,a){n=_n(a,n),n=jf(e.stateNode,n,2),e=Pr(e,n,2),e!==null&&(Rn(e,2),Yn(e))}function Fe(e,n,a){if(e.tag===3)Gp(e,e,a);else for(;n!==null;){if(n.tag===3){Gp(n,e,a);break}else if(n.tag===1){var o=n.stateNode;if(typeof n.type.getDerivedStateFromError=="function"||typeof o.componentDidCatch=="function"&&(Vr===null||!Vr.has(o))){e=_n(a,e),a=F0(2),o=Pr(n,a,2),o!==null&&(V0(a,o,n,e),Rn(o,2),Yn(o));break}}n=n.return}}function Zf(e,n,a){var o=e.pingCache;if(o===null){o=e.pingCache=new Fx;var u=new Set;o.set(n,u)}else u=o.get(n),u===void 0&&(u=new Set,o.set(n,u));u.has(a)||(Gf=!0,u.add(a),e=Jx.bind(null,e,n,a),n.then(e,e))}function Jx(e,n,a){var o=e.pingCache;o!==null&&o.delete(n),e.pingedLanes|=e.suspendedLanes&a,e.warmLanes&=~a,Qe===e&&(Be&a)===a&&(ut===4||ut===3&&(Be&62914560)===Be&&300>tt()-vl?(He&2)===0&&Ss(e,0):Ff|=a,_s===Be&&(_s=0)),Yn(e)}function Fp(e,n){n===0&&(n=Xi()),e=Ei(e,n),e!==null&&(Rn(e,n),Yn(e))}function Qx(e){var n=e.memoizedState,a=0;n!==null&&(a=n.retryLane),Fp(e,a)}function Zx(e,n){var a=0;switch(e.tag){case 31:case 13:var o=e.stateNode,u=e.memoizedState;u!==null&&(a=u.retryLane);break;case 19:o=e.stateNode;break;case 22:o=e.stateNode._retryCache;break;default:throw Error(s(314))}o!==null&&o.delete(n),Fp(e,a)}function Wx(e,n){return Qs(e,n)}var Al=null,Os=null,Wf=!1,jl=!1,eh=!1,Xr=0;function Yn(e){e!==Os&&e.next===null&&(Os===null?Al=Os=e:Os=Os.next=e),jl=!0,Wf||(Wf=!0,t_())}function Da(e,n){if(!eh&&jl){eh=!0;do for(var a=!1,o=Al;o!==null;){if(e!==0){var u=o.pendingLanes;if(u===0)var h=0;else{var x=o.suspendedLanes,E=o.pingedLanes;h=(1<<31-Bt(42|e)+1)-1,h&=u&~(x&~E),h=h&201326741?h&201326741|1:h?h|2:0}h!==0&&(a=!0,Xp(o,h))}else h=Be,h=yi(o,o===Qe?h:0,o.cancelPendingCommit!==null||o.timeoutHandle!==-1),(h&3)===0||gi(o,h)||(a=!0,Xp(o,h));o=o.next}while(a);eh=!1}}function e_(){Vp()}function Vp(){jl=Wf=!1;var e=0;Xr!==0&&f_()&&(e=Xr);for(var n=tt(),a=null,o=Al;o!==null;){var u=o.next,h=Yp(o,n);h===0?(o.next=null,a===null?Al=u:a.next=u,u===null&&(Os=a)):(a=o,(e!==0||(h&3)!==0)&&(jl=!0)),o=u}Et!==0&&Et!==5||Da(e),Xr!==0&&(Xr=0)}function Yp(e,n){for(var a=e.suspendedLanes,o=e.pingedLanes,u=e.expirationTimes,h=e.pendingLanes&-62914561;0<h;){var x=31-Bt(h),E=1<<x,R=u[x];R===-1?((E&a)===0||(E&o)!==0)&&(u[x]=ea(E,n)):R<=n&&(e.expiredLanes|=E),h&=~E}if(n=Qe,a=Be,a=yi(e,e===n?a:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),o=e.callbackNode,a===0||e===n&&(Ge===2||Ge===9)||e.cancelPendingCommit!==null)return o!==null&&o!==null&&Wn(o),e.callbackNode=null,e.callbackPriority=0;if((a&3)===0||gi(e,a)){if(n=a&-a,n===e.callbackPriority)return n;switch(o!==null&&Wn(o),vi(a)){case 2:case 8:a=To;break;case 32:a=Yi;break;case 268435456:a=No;break;default:a=Yi}return o=Kp.bind(null,e),a=Qs(a,o),e.callbackPriority=n,e.callbackNode=a,n}return o!==null&&o!==null&&Wn(o),e.callbackPriority=2,e.callbackNode=null,2}function Kp(e,n){if(Et!==0&&Et!==5)return e.callbackNode=null,e.callbackPriority=0,null;var a=e.callbackNode;if(Ol()&&e.callbackNode!==a)return null;var o=Be;return o=yi(e,e===Qe?o:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),o===0?null:(Np(e,o,n),Yp(e,tt()),e.callbackNode!=null&&e.callbackNode===a?Kp.bind(null,e):null)}function Xp(e,n){if(Ol())return null;Np(e,n,!0)}function t_(){d_(function(){(He&6)!==0?Qs(jo,e_):Vp()})}function th(){if(Xr===0){var e=us;e===0&&(e=jr,jr<<=1,(jr&261888)===0&&(jr=256)),Xr=e}return Xr}function Jp(e){return e==null||typeof e=="symbol"||typeof e=="boolean"?null:typeof e=="function"?e:qo(""+e)}function Qp(e,n){var a=n.ownerDocument.createElement("input");return a.name=n.name,a.value=n.value,e.id&&a.setAttribute("form",e.id),n.parentNode.insertBefore(a,n),e=new FormData(e),a.parentNode.removeChild(a),e}function n_(e,n,a,o,u){if(n==="submit"&&a&&a.stateNode===u){var h=Jp((u[lt]||null).action),x=o.submitter;x&&(n=(n=x[lt]||null)?Jp(n.formAction):x.getAttribute("formAction"),n!==null&&(h=n,x=null));var E=new Uo("action","action",null,o,u);e.push({event:E,listeners:[{instance:null,listener:function(){if(o.defaultPrevented){if(Xr!==0){var R=x?Qp(u,x):new FormData(u);_f(a,{pending:!0,data:R,method:u.method,action:h},null,R)}}else typeof h=="function"&&(E.preventDefault(),R=x?Qp(u,x):new FormData(u),_f(a,{pending:!0,data:R,method:u.method,action:h},h,R))},currentTarget:u}]})}}for(var nh=0;nh<Lu.length;nh++){var rh=Lu[nh],r_=rh.toLowerCase(),i_=rh[0].toUpperCase()+rh.slice(1);qn(r_,"on"+i_)}qn(Tm,"onAnimationEnd"),qn(Nm,"onAnimationIteration"),qn(km,"onAnimationStart"),qn("dblclick","onDoubleClick"),qn("focusin","onFocus"),qn("focusout","onBlur"),qn(xx,"onTransitionRun"),qn(_x,"onTransitionStart"),qn(wx,"onTransitionCancel"),qn(Cm,"onTransitionEnd"),V("onMouseEnter",["mouseout","mouseover"]),V("onMouseLeave",["mouseout","mouseover"]),V("onPointerEnter",["pointerout","pointerover"]),V("onPointerLeave",["pointerout","pointerover"]),ie("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),ie("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),ie("onBeforeInput",["compositionend","keypress","textInput","paste"]),ie("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),ie("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),ie("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var qa="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),s_=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(qa));function Zp(e,n){n=(n&4)!==0;for(var a=0;a<e.length;a++){var o=e[a],u=o.event;o=o.listeners;e:{var h=void 0;if(n)for(var x=o.length-1;0<=x;x--){var E=o[x],R=E.instance,H=E.currentTarget;if(E=E.listener,R!==h&&u.isPropagationStopped())break e;h=E,u.currentTarget=H;try{h(u)}catch(Q){Io(Q)}u.currentTarget=null,h=R}else for(x=0;x<o.length;x++){if(E=o[x],R=E.instance,H=E.currentTarget,E=E.listener,R!==h&&u.isPropagationStopped())break e;h=E,u.currentTarget=H;try{h(u)}catch(Q){Io(Q)}u.currentTarget=null,h=R}}}}function qe(e,n){var a=n[xi];a===void 0&&(a=n[xi]=new Set);var o=e+"__bubble";a.has(o)||(Wp(n,e,2,!1),a.add(o))}function ih(e,n,a){var o=0;n&&(o|=4),Wp(a,e,o,n)}var Tl="_reactListening"+Math.random().toString(36).slice(2);function sh(e){if(!e[Tl]){e[Tl]=!0,$.forEach(function(a){a!=="selectionchange"&&(s_.has(a)||ih(a,!1,e),ih(a,!0,e))});var n=e.nodeType===9?e:e.ownerDocument;n===null||n[Tl]||(n[Tl]=!0,ih("selectionchange",!1,n))}}function Wp(e,n,a,o){switch(Ty(n)){case 2:var u=R_;break;case 8:u=D_;break;default:u=xh}a=u.bind(null,n,a,e),u=void 0,!Eu||n!=="touchstart"&&n!=="touchmove"&&n!=="wheel"||(u=!0),o?u!==void 0?e.addEventListener(n,a,{capture:!0,passive:u}):e.addEventListener(n,a,!0):u!==void 0?e.addEventListener(n,a,{passive:u}):e.addEventListener(n,a,!1)}function ah(e,n,a,o,u){var h=o;if((n&1)===0&&(n&2)===0&&o!==null)e:for(;;){if(o===null)return;var x=o.tag;if(x===3||x===4){var E=o.stateNode.containerInfo;if(E===u)break;if(x===4)for(x=o.return;x!==null;){var R=x.tag;if((R===3||R===4)&&x.stateNode.containerInfo===u)return;x=x.return}for(;E!==null;){if(x=O(E),x===null)return;if(R=x.tag,R===5||R===6||R===26||R===27){o=h=x;continue e}E=E.parentNode}}o=o.return}im(function(){var H=h,Q=wu(a),re=[];e:{var G=Mm.get(e);if(G!==void 0){var J=Uo,ye=e;switch(e){case"keypress":if(Lo(a)===0)break e;case"keydown":case"keyup":J=Zv;break;case"focusin":ye="focus",J=Tu;break;case"focusout":ye="blur",J=Tu;break;case"beforeblur":case"afterblur":J=Tu;break;case"click":if(a.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":J=om;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":J=Pv;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":J=tx;break;case Tm:case Nm:case km:J=Hv;break;case Cm:J=rx;break;case"scroll":case"scrollend":J=zv;break;case"wheel":J=sx;break;case"copy":case"cut":case"paste":J=Fv;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":J=cm;break;case"toggle":case"beforetoggle":J=ox}var Ae=(n&4)!==0,Xe=!Ae&&(e==="scroll"||e==="scrollend"),U=Ae?G!==null?G+"Capture":null:G;Ae=[];for(var q=H,I;q!==null;){var Z=q;if(I=Z.stateNode,Z=Z.tag,Z!==5&&Z!==26&&Z!==27||I===null||U===null||(Z=ra(q,U),Z!=null&&Ae.push(Ba(q,Z,I))),Xe)break;q=q.return}0<Ae.length&&(G=new J(G,ye,null,a,Q),re.push({event:G,listeners:Ae}))}}if((n&7)===0){e:{if(G=e==="mouseover"||e==="pointerover",J=e==="mouseout"||e==="pointerout",G&&a!==_u&&(ye=a.relatedTarget||a.fromElement)&&(O(ye)||ye[Qt]))break e;if((J||G)&&(G=Q.window===Q?Q:(G=Q.ownerDocument)?G.defaultView||G.parentWindow:window,J?(ye=a.relatedTarget||a.toElement,J=H,ye=ye?O(ye):null,ye!==null&&(Xe=c(ye),Ae=ye.tag,ye!==Xe||Ae!==5&&Ae!==27&&Ae!==6)&&(ye=null)):(J=null,ye=H),J!==ye)){if(Ae=om,Z="onMouseLeave",U="onMouseEnter",q="mouse",(e==="pointerout"||e==="pointerover")&&(Ae=cm,Z="onPointerLeave",U="onPointerEnter",q="pointer"),Xe=J==null?G:j(J),I=ye==null?G:j(ye),G=new Ae(Z,q+"leave",J,a,Q),G.target=Xe,G.relatedTarget=I,Z=null,O(Q)===H&&(Ae=new Ae(U,q+"enter",ye,a,Q),Ae.target=I,Ae.relatedTarget=Xe,Z=Ae),Xe=Z,J&&ye)t:{for(Ae=a_,U=J,q=ye,I=0,Z=U;Z;Z=Ae(Z))I++;Z=0;for(var ve=q;ve;ve=Ae(ve))Z++;for(;0<I-Z;)U=Ae(U),I--;for(;0<Z-I;)q=Ae(q),Z--;for(;I--;){if(U===q||q!==null&&U===q.alternate){Ae=U;break t}U=Ae(U),q=Ae(q)}Ae=null}else Ae=null;J!==null&&ey(re,G,J,Ae,!1),ye!==null&&Xe!==null&&ey(re,Xe,ye,Ae,!0)}}e:{if(G=H?j(H):window,J=G.nodeName&&G.nodeName.toLowerCase(),J==="select"||J==="input"&&G.type==="file")var $e=gm;else if(pm(G))if(bm)$e=gx;else{$e=px;var ge=mx}else J=G.nodeName,!J||J.toLowerCase()!=="input"||G.type!=="checkbox"&&G.type!=="radio"?H&&xu(H.elementType)&&($e=gm):$e=yx;if($e&&($e=$e(e,H))){ym(re,$e,a,Q);break e}ge&&ge(e,G,H),e==="focusout"&&H&&G.type==="number"&&H.memoizedProps.value!=null&&vu(G,"number",G.value)}switch(ge=H?j(H):window,e){case"focusin":(pm(ge)||ge.contentEditable==="true")&&(ns=ge,Du=H,fa=null);break;case"focusout":fa=Du=ns=null;break;case"mousedown":qu=!0;break;case"contextmenu":case"mouseup":case"dragend":qu=!1,Am(re,a,Q);break;case"selectionchange":if(vx)break;case"keydown":case"keyup":Am(re,a,Q)}var Me;if(ku)e:{switch(e){case"compositionstart":var Le="onCompositionStart";break e;case"compositionend":Le="onCompositionEnd";break e;case"compositionupdate":Le="onCompositionUpdate";break e}Le=void 0}else ts?dm(e,a)&&(Le="onCompositionEnd"):e==="keydown"&&a.keyCode===229&&(Le="onCompositionStart");Le&&(um&&a.locale!=="ko"&&(ts||Le!=="onCompositionStart"?Le==="onCompositionEnd"&&ts&&(Me=sm()):(Rr=Q,Ou="value"in Rr?Rr.value:Rr.textContent,ts=!0)),ge=Nl(H,Le),0<ge.length&&(Le=new lm(Le,e,null,a,Q),re.push({event:Le,listeners:ge}),Me?Le.data=Me:(Me=mm(a),Me!==null&&(Le.data=Me)))),(Me=cx?ux(e,a):fx(e,a))&&(Le=Nl(H,"onBeforeInput"),0<Le.length&&(ge=new lm("onBeforeInput","beforeinput",null,a,Q),re.push({event:ge,listeners:Le}),ge.data=Me)),n_(re,e,H,a,Q)}Zp(re,n)})}function Ba(e,n,a){return{instance:e,listener:n,currentTarget:a}}function Nl(e,n){for(var a=n+"Capture",o=[];e!==null;){var u=e,h=u.stateNode;if(u=u.tag,u!==5&&u!==26&&u!==27||h===null||(u=ra(e,a),u!=null&&o.unshift(Ba(e,u,h)),u=ra(e,n),u!=null&&o.push(Ba(e,u,h))),e.tag===3)return o;e=e.return}return[]}function a_(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function ey(e,n,a,o,u){for(var h=n._reactName,x=[];a!==null&&a!==o;){var E=a,R=E.alternate,H=E.stateNode;if(E=E.tag,R!==null&&R===o)break;E!==5&&E!==26&&E!==27||H===null||(R=H,u?(H=ra(a,h),H!=null&&x.unshift(Ba(a,H,R))):u||(H=ra(a,h),H!=null&&x.push(Ba(a,H,R)))),a=a.return}x.length!==0&&e.push({event:n,listeners:x})}var o_=/\r\n?/g,l_=/\u0000|\uFFFD/g;function ty(e){return(typeof e=="string"?e:""+e).replace(o_,`
|
|
26
|
+
`).replace(l_,"")}function ny(e,n){return n=ty(n),ty(e)===n}function Ke(e,n,a,o,u,h){switch(a){case"children":typeof o=="string"?n==="body"||n==="textarea"&&o===""||Zi(e,o):(typeof o=="number"||typeof o=="bigint")&&n!=="body"&&Zi(e,""+o);break;case"className":Dn(e,"class",o);break;case"tabIndex":Dn(e,"tabindex",o);break;case"dir":case"role":case"viewBox":case"width":case"height":Dn(e,a,o);break;case"style":nm(e,o,h);break;case"data":if(n!=="object"){Dn(e,"data",o);break}case"src":case"href":if(o===""&&(n!=="a"||a!=="href")){e.removeAttribute(a);break}if(o==null||typeof o=="function"||typeof o=="symbol"||typeof o=="boolean"){e.removeAttribute(a);break}o=qo(""+o),e.setAttribute(a,o);break;case"action":case"formAction":if(typeof o=="function"){e.setAttribute(a,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof h=="function"&&(a==="formAction"?(n!=="input"&&Ke(e,n,"name",u.name,u,null),Ke(e,n,"formEncType",u.formEncType,u,null),Ke(e,n,"formMethod",u.formMethod,u,null),Ke(e,n,"formTarget",u.formTarget,u,null)):(Ke(e,n,"encType",u.encType,u,null),Ke(e,n,"method",u.method,u,null),Ke(e,n,"target",u.target,u,null)));if(o==null||typeof o=="symbol"||typeof o=="boolean"){e.removeAttribute(a);break}o=qo(""+o),e.setAttribute(a,o);break;case"onClick":o!=null&&(e.onclick=rr);break;case"onScroll":o!=null&&qe("scroll",e);break;case"onScrollEnd":o!=null&&qe("scrollend",e);break;case"dangerouslySetInnerHTML":if(o!=null){if(typeof o!="object"||!("__html"in o))throw Error(s(61));if(a=o.__html,a!=null){if(u.children!=null)throw Error(s(60));e.innerHTML=a}}break;case"multiple":e.multiple=o&&typeof o!="function"&&typeof o!="symbol";break;case"muted":e.muted=o&&typeof o!="function"&&typeof o!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(o==null||typeof o=="function"||typeof o=="boolean"||typeof o=="symbol"){e.removeAttribute("xlink:href");break}a=qo(""+o),e.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",a);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":o!=null&&typeof o!="function"&&typeof o!="symbol"?e.setAttribute(a,""+o):e.removeAttribute(a);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":o&&typeof o!="function"&&typeof o!="symbol"?e.setAttribute(a,""):e.removeAttribute(a);break;case"capture":case"download":o===!0?e.setAttribute(a,""):o!==!1&&o!=null&&typeof o!="function"&&typeof o!="symbol"?e.setAttribute(a,o):e.removeAttribute(a);break;case"cols":case"rows":case"size":case"span":o!=null&&typeof o!="function"&&typeof o!="symbol"&&!isNaN(o)&&1<=o?e.setAttribute(a,o):e.removeAttribute(a);break;case"rowSpan":case"start":o==null||typeof o=="function"||typeof o=="symbol"||isNaN(o)?e.removeAttribute(a):e.setAttribute(a,o);break;case"popover":qe("beforetoggle",e),qe("toggle",e),Lt(e,"popover",o);break;case"xlinkActuate":nr(e,"http://www.w3.org/1999/xlink","xlink:actuate",o);break;case"xlinkArcrole":nr(e,"http://www.w3.org/1999/xlink","xlink:arcrole",o);break;case"xlinkRole":nr(e,"http://www.w3.org/1999/xlink","xlink:role",o);break;case"xlinkShow":nr(e,"http://www.w3.org/1999/xlink","xlink:show",o);break;case"xlinkTitle":nr(e,"http://www.w3.org/1999/xlink","xlink:title",o);break;case"xlinkType":nr(e,"http://www.w3.org/1999/xlink","xlink:type",o);break;case"xmlBase":nr(e,"http://www.w3.org/XML/1998/namespace","xml:base",o);break;case"xmlLang":nr(e,"http://www.w3.org/XML/1998/namespace","xml:lang",o);break;case"xmlSpace":nr(e,"http://www.w3.org/XML/1998/namespace","xml:space",o);break;case"is":Lt(e,"is",o);break;case"innerText":case"textContent":break;default:(!(2<a.length)||a[0]!=="o"&&a[0]!=="O"||a[1]!=="n"&&a[1]!=="N")&&(a=Bv.get(a)||a,Lt(e,a,o))}}function oh(e,n,a,o,u,h){switch(a){case"style":nm(e,o,h);break;case"dangerouslySetInnerHTML":if(o!=null){if(typeof o!="object"||!("__html"in o))throw Error(s(61));if(a=o.__html,a!=null){if(u.children!=null)throw Error(s(60));e.innerHTML=a}}break;case"children":typeof o=="string"?Zi(e,o):(typeof o=="number"||typeof o=="bigint")&&Zi(e,""+o);break;case"onScroll":o!=null&&qe("scroll",e);break;case"onScrollEnd":o!=null&&qe("scrollend",e);break;case"onClick":o!=null&&(e.onclick=rr);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!ne.hasOwnProperty(a))e:{if(a[0]==="o"&&a[1]==="n"&&(u=a.endsWith("Capture"),n=a.slice(2,u?a.length-7:void 0),h=e[lt]||null,h=h!=null?h[a]:null,typeof h=="function"&&e.removeEventListener(n,h,u),typeof o=="function")){typeof h!="function"&&h!==null&&(a in e?e[a]=null:e.hasAttribute(a)&&e.removeAttribute(a)),e.addEventListener(n,o,u);break e}a in e?e[a]=o:o===!0?e.setAttribute(a,""):Lt(e,a,o)}}}function Ct(e,n,a){switch(n){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":qe("error",e),qe("load",e);var o=!1,u=!1,h;for(h in a)if(a.hasOwnProperty(h)){var x=a[h];if(x!=null)switch(h){case"src":o=!0;break;case"srcSet":u=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(s(137,n));default:Ke(e,n,h,x,a,null)}}u&&Ke(e,n,"srcSet",a.srcSet,a,null),o&&Ke(e,n,"src",a.src,a,null);return;case"input":qe("invalid",e);var E=h=x=u=null,R=null,H=null;for(o in a)if(a.hasOwnProperty(o)){var Q=a[o];if(Q!=null)switch(o){case"name":u=Q;break;case"type":x=Q;break;case"checked":R=Q;break;case"defaultChecked":H=Q;break;case"value":h=Q;break;case"defaultValue":E=Q;break;case"children":case"dangerouslySetInnerHTML":if(Q!=null)throw Error(s(137,n));break;default:Ke(e,n,o,Q,a,null)}}Zd(e,h,E,R,H,x,u,!1);return;case"select":qe("invalid",e),o=x=h=null;for(u in a)if(a.hasOwnProperty(u)&&(E=a[u],E!=null))switch(u){case"value":h=E;break;case"defaultValue":x=E;break;case"multiple":o=E;default:Ke(e,n,u,E,a,null)}n=h,a=x,e.multiple=!!o,n!=null?Qi(e,!!o,n,!1):a!=null&&Qi(e,!!o,a,!0);return;case"textarea":qe("invalid",e),h=u=o=null;for(x in a)if(a.hasOwnProperty(x)&&(E=a[x],E!=null))switch(x){case"value":o=E;break;case"defaultValue":u=E;break;case"children":h=E;break;case"dangerouslySetInnerHTML":if(E!=null)throw Error(s(91));break;default:Ke(e,n,x,E,a,null)}em(e,o,u,h);return;case"option":for(R in a)if(a.hasOwnProperty(R)&&(o=a[R],o!=null))switch(R){case"selected":e.selected=o&&typeof o!="function"&&typeof o!="symbol";break;default:Ke(e,n,R,o,a,null)}return;case"dialog":qe("beforetoggle",e),qe("toggle",e),qe("cancel",e),qe("close",e);break;case"iframe":case"object":qe("load",e);break;case"video":case"audio":for(o=0;o<qa.length;o++)qe(qa[o],e);break;case"image":qe("error",e),qe("load",e);break;case"details":qe("toggle",e);break;case"embed":case"source":case"link":qe("error",e),qe("load",e);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(H in a)if(a.hasOwnProperty(H)&&(o=a[H],o!=null))switch(H){case"children":case"dangerouslySetInnerHTML":throw Error(s(137,n));default:Ke(e,n,H,o,a,null)}return;default:if(xu(n)){for(Q in a)a.hasOwnProperty(Q)&&(o=a[Q],o!==void 0&&oh(e,n,Q,o,a,void 0));return}}for(E in a)a.hasOwnProperty(E)&&(o=a[E],o!=null&&Ke(e,n,E,o,a,null))}function c_(e,n,a,o){switch(n){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var u=null,h=null,x=null,E=null,R=null,H=null,Q=null;for(J in a){var re=a[J];if(a.hasOwnProperty(J)&&re!=null)switch(J){case"checked":break;case"value":break;case"defaultValue":R=re;default:o.hasOwnProperty(J)||Ke(e,n,J,null,o,re)}}for(var G in o){var J=o[G];if(re=a[G],o.hasOwnProperty(G)&&(J!=null||re!=null))switch(G){case"type":h=J;break;case"name":u=J;break;case"checked":H=J;break;case"defaultChecked":Q=J;break;case"value":x=J;break;case"defaultValue":E=J;break;case"children":case"dangerouslySetInnerHTML":if(J!=null)throw Error(s(137,n));break;default:J!==re&&Ke(e,n,G,J,o,re)}}bu(e,x,E,R,H,Q,h,u);return;case"select":J=x=E=G=null;for(h in a)if(R=a[h],a.hasOwnProperty(h)&&R!=null)switch(h){case"value":break;case"multiple":J=R;default:o.hasOwnProperty(h)||Ke(e,n,h,null,o,R)}for(u in o)if(h=o[u],R=a[u],o.hasOwnProperty(u)&&(h!=null||R!=null))switch(u){case"value":G=h;break;case"defaultValue":E=h;break;case"multiple":x=h;default:h!==R&&Ke(e,n,u,h,o,R)}n=E,a=x,o=J,G!=null?Qi(e,!!a,G,!1):!!o!=!!a&&(n!=null?Qi(e,!!a,n,!0):Qi(e,!!a,a?[]:"",!1));return;case"textarea":J=G=null;for(E in a)if(u=a[E],a.hasOwnProperty(E)&&u!=null&&!o.hasOwnProperty(E))switch(E){case"value":break;case"children":break;default:Ke(e,n,E,null,o,u)}for(x in o)if(u=o[x],h=a[x],o.hasOwnProperty(x)&&(u!=null||h!=null))switch(x){case"value":G=u;break;case"defaultValue":J=u;break;case"children":break;case"dangerouslySetInnerHTML":if(u!=null)throw Error(s(91));break;default:u!==h&&Ke(e,n,x,u,o,h)}Wd(e,G,J);return;case"option":for(var ye in a)if(G=a[ye],a.hasOwnProperty(ye)&&G!=null&&!o.hasOwnProperty(ye))switch(ye){case"selected":e.selected=!1;break;default:Ke(e,n,ye,null,o,G)}for(R in o)if(G=o[R],J=a[R],o.hasOwnProperty(R)&&G!==J&&(G!=null||J!=null))switch(R){case"selected":e.selected=G&&typeof G!="function"&&typeof G!="symbol";break;default:Ke(e,n,R,G,o,J)}return;case"img":case"link":case"area":case"base":case"br":case"col":case"embed":case"hr":case"keygen":case"meta":case"param":case"source":case"track":case"wbr":case"menuitem":for(var Ae in a)G=a[Ae],a.hasOwnProperty(Ae)&&G!=null&&!o.hasOwnProperty(Ae)&&Ke(e,n,Ae,null,o,G);for(H in o)if(G=o[H],J=a[H],o.hasOwnProperty(H)&&G!==J&&(G!=null||J!=null))switch(H){case"children":case"dangerouslySetInnerHTML":if(G!=null)throw Error(s(137,n));break;default:Ke(e,n,H,G,o,J)}return;default:if(xu(n)){for(var Xe in a)G=a[Xe],a.hasOwnProperty(Xe)&&G!==void 0&&!o.hasOwnProperty(Xe)&&oh(e,n,Xe,void 0,o,G);for(Q in o)G=o[Q],J=a[Q],!o.hasOwnProperty(Q)||G===J||G===void 0&&J===void 0||oh(e,n,Q,G,o,J);return}}for(var U in a)G=a[U],a.hasOwnProperty(U)&&G!=null&&!o.hasOwnProperty(U)&&Ke(e,n,U,null,o,G);for(re in o)G=o[re],J=a[re],!o.hasOwnProperty(re)||G===J||G==null&&J==null||Ke(e,n,re,G,o,J)}function ry(e){switch(e){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function u_(){if(typeof performance.getEntriesByType=="function"){for(var e=0,n=0,a=performance.getEntriesByType("resource"),o=0;o<a.length;o++){var u=a[o],h=u.transferSize,x=u.initiatorType,E=u.duration;if(h&&E&&ry(x)){for(x=0,E=u.responseEnd,o+=1;o<a.length;o++){var R=a[o],H=R.startTime;if(H>E)break;var Q=R.transferSize,re=R.initiatorType;Q&&ry(re)&&(R=R.responseEnd,x+=Q*(R<E?1:(E-H)/(R-H)))}if(--o,n+=8*(h+x)/(u.duration/1e3),e++,10<e)break}}if(0<e)return n/e/1e6}return navigator.connection&&(e=navigator.connection.downlink,typeof e=="number")?e:5}var lh=null,ch=null;function kl(e){return e.nodeType===9?e:e.ownerDocument}function iy(e){switch(e){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function sy(e,n){if(e===0)switch(n){case"svg":return 1;case"math":return 2;default:return 0}return e===1&&n==="foreignObject"?0:e}function uh(e,n){return e==="textarea"||e==="noscript"||typeof n.children=="string"||typeof n.children=="number"||typeof n.children=="bigint"||typeof n.dangerouslySetInnerHTML=="object"&&n.dangerouslySetInnerHTML!==null&&n.dangerouslySetInnerHTML.__html!=null}var fh=null;function f_(){var e=window.event;return e&&e.type==="popstate"?e===fh?!1:(fh=e,!0):(fh=null,!1)}var ay=typeof setTimeout=="function"?setTimeout:void 0,h_=typeof clearTimeout=="function"?clearTimeout:void 0,oy=typeof Promise=="function"?Promise:void 0,d_=typeof queueMicrotask=="function"?queueMicrotask:typeof oy<"u"?function(e){return oy.resolve(null).then(e).catch(m_)}:ay;function m_(e){setTimeout(function(){throw e})}function Jr(e){return e==="head"}function ly(e,n){var a=n,o=0;do{var u=a.nextSibling;if(e.removeChild(a),u&&u.nodeType===8)if(a=u.data,a==="/$"||a==="/&"){if(o===0){e.removeChild(u),Ns(n);return}o--}else if(a==="$"||a==="$?"||a==="$~"||a==="$!"||a==="&")o++;else if(a==="html")La(e.ownerDocument.documentElement);else if(a==="head"){a=e.ownerDocument.head,La(a);for(var h=a.firstChild;h;){var x=h.nextSibling,E=h.nodeName;h[St]||E==="SCRIPT"||E==="STYLE"||E==="LINK"&&h.rel.toLowerCase()==="stylesheet"||a.removeChild(h),h=x}}else a==="body"&&La(e.ownerDocument.body);a=u}while(a);Ns(n)}function cy(e,n){var a=e;e=0;do{var o=a.nextSibling;if(a.nodeType===1?n?(a._stashedDisplay=a.style.display,a.style.display="none"):(a.style.display=a._stashedDisplay||"",a.getAttribute("style")===""&&a.removeAttribute("style")):a.nodeType===3&&(n?(a._stashedText=a.nodeValue,a.nodeValue=""):a.nodeValue=a._stashedText||""),o&&o.nodeType===8)if(a=o.data,a==="/$"){if(e===0)break;e--}else a!=="$"&&a!=="$?"&&a!=="$~"&&a!=="$!"||e++;a=o}while(a)}function hh(e){var n=e.firstChild;for(n&&n.nodeType===10&&(n=n.nextSibling);n;){var a=n;switch(n=n.nextSibling,a.nodeName){case"HTML":case"HEAD":case"BODY":hh(a),Ji(a);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(a.rel.toLowerCase()==="stylesheet")continue}e.removeChild(a)}}function p_(e,n,a,o){for(;e.nodeType===1;){var u=a;if(e.nodeName.toLowerCase()!==n.toLowerCase()){if(!o&&(e.nodeName!=="INPUT"||e.type!=="hidden"))break}else if(o){if(!e[St])switch(n){case"meta":if(!e.hasAttribute("itemprop"))break;return e;case"link":if(h=e.getAttribute("rel"),h==="stylesheet"&&e.hasAttribute("data-precedence"))break;if(h!==u.rel||e.getAttribute("href")!==(u.href==null||u.href===""?null:u.href)||e.getAttribute("crossorigin")!==(u.crossOrigin==null?null:u.crossOrigin)||e.getAttribute("title")!==(u.title==null?null:u.title))break;return e;case"style":if(e.hasAttribute("data-precedence"))break;return e;case"script":if(h=e.getAttribute("src"),(h!==(u.src==null?null:u.src)||e.getAttribute("type")!==(u.type==null?null:u.type)||e.getAttribute("crossorigin")!==(u.crossOrigin==null?null:u.crossOrigin))&&h&&e.hasAttribute("async")&&!e.hasAttribute("itemprop"))break;return e;default:return e}}else if(n==="input"&&e.type==="hidden"){var h=u.name==null?null:""+u.name;if(u.type==="hidden"&&e.getAttribute("name")===h)return e}else return e;if(e=An(e.nextSibling),e===null)break}return null}function y_(e,n,a){if(n==="")return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!a||(e=An(e.nextSibling),e===null))return null;return e}function uy(e,n){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!n||(e=An(e.nextSibling),e===null))return null;return e}function dh(e){return e.data==="$?"||e.data==="$~"}function mh(e){return e.data==="$!"||e.data==="$?"&&e.ownerDocument.readyState!=="loading"}function g_(e,n){var a=e.ownerDocument;if(e.data==="$~")e._reactRetry=n;else if(e.data!=="$?"||a.readyState!=="loading")n();else{var o=function(){n(),a.removeEventListener("DOMContentLoaded",o)};a.addEventListener("DOMContentLoaded",o),e._reactRetry=o}}function An(e){for(;e!=null;e=e.nextSibling){var n=e.nodeType;if(n===1||n===3)break;if(n===8){if(n=e.data,n==="$"||n==="$!"||n==="$?"||n==="$~"||n==="&"||n==="F!"||n==="F")break;if(n==="/$"||n==="/&")return null}}return e}var ph=null;function fy(e){e=e.nextSibling;for(var n=0;e;){if(e.nodeType===8){var a=e.data;if(a==="/$"||a==="/&"){if(n===0)return An(e.nextSibling);n--}else a!=="$"&&a!=="$!"&&a!=="$?"&&a!=="$~"&&a!=="&"||n++}e=e.nextSibling}return null}function hy(e){e=e.previousSibling;for(var n=0;e;){if(e.nodeType===8){var a=e.data;if(a==="$"||a==="$!"||a==="$?"||a==="$~"||a==="&"){if(n===0)return e;n--}else a!=="/$"&&a!=="/&"||n++}e=e.previousSibling}return null}function dy(e,n,a){switch(n=kl(a),e){case"html":if(e=n.documentElement,!e)throw Error(s(452));return e;case"head":if(e=n.head,!e)throw Error(s(453));return e;case"body":if(e=n.body,!e)throw Error(s(454));return e;default:throw Error(s(451))}}function La(e){for(var n=e.attributes;n.length;)e.removeAttributeNode(n[0]);Ji(e)}var jn=new Map,my=new Set;function Cl(e){return typeof e.getRootNode=="function"?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var vr=ae.d;ae.d={f:b_,r:v_,D:x_,C:__,L:w_,m:S_,X:O_,S:E_,M:A_};function b_(){var e=vr.f(),n=wl();return e||n}function v_(e){var n=N(e);n!==null&&n.tag===5&&n.type==="form"?C0(n):vr.r(e)}var As=typeof document>"u"?null:document;function py(e,n,a){var o=As;if(o&&typeof n=="string"&&n){var u=vn(n);u='link[rel="'+e+'"][href="'+u+'"]',typeof a=="string"&&(u+='[crossorigin="'+a+'"]'),my.has(u)||(my.add(u),e={rel:e,crossOrigin:a,href:n},o.querySelector(u)===null&&(n=o.createElement("link"),Ct(n,"link",e),D(n),o.head.appendChild(n)))}}function x_(e){vr.D(e),py("dns-prefetch",e,null)}function __(e,n){vr.C(e,n),py("preconnect",e,n)}function w_(e,n,a){vr.L(e,n,a);var o=As;if(o&&e&&n){var u='link[rel="preload"][as="'+vn(n)+'"]';n==="image"&&a&&a.imageSrcSet?(u+='[imagesrcset="'+vn(a.imageSrcSet)+'"]',typeof a.imageSizes=="string"&&(u+='[imagesizes="'+vn(a.imageSizes)+'"]')):u+='[href="'+vn(e)+'"]';var h=u;switch(n){case"style":h=js(e);break;case"script":h=Ts(e)}jn.has(h)||(e=b({rel:"preload",href:n==="image"&&a&&a.imageSrcSet?void 0:e,as:n},a),jn.set(h,e),o.querySelector(u)!==null||n==="style"&&o.querySelector(za(h))||n==="script"&&o.querySelector(Ua(h))||(n=o.createElement("link"),Ct(n,"link",e),D(n),o.head.appendChild(n)))}}function S_(e,n){vr.m(e,n);var a=As;if(a&&e){var o=n&&typeof n.as=="string"?n.as:"script",u='link[rel="modulepreload"][as="'+vn(o)+'"][href="'+vn(e)+'"]',h=u;switch(o){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":h=Ts(e)}if(!jn.has(h)&&(e=b({rel:"modulepreload",href:e},n),jn.set(h,e),a.querySelector(u)===null)){switch(o){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(a.querySelector(Ua(h)))return}o=a.createElement("link"),Ct(o,"link",e),D(o),a.head.appendChild(o)}}}function E_(e,n,a){vr.S(e,n,a);var o=As;if(o&&e){var u=k(o).hoistableStyles,h=js(e);n=n||"default";var x=u.get(h);if(!x){var E={loading:0,preload:null};if(x=o.querySelector(za(h)))E.loading=5;else{e=b({rel:"stylesheet",href:e,"data-precedence":n},a),(a=jn.get(h))&&yh(e,a);var R=x=o.createElement("link");D(R),Ct(R,"link",e),R._p=new Promise(function(H,Q){R.onload=H,R.onerror=Q}),R.addEventListener("load",function(){E.loading|=1}),R.addEventListener("error",function(){E.loading|=2}),E.loading|=4,Ml(x,n,o)}x={type:"stylesheet",instance:x,count:1,state:E},u.set(h,x)}}}function O_(e,n){vr.X(e,n);var a=As;if(a&&e){var o=k(a).hoistableScripts,u=Ts(e),h=o.get(u);h||(h=a.querySelector(Ua(u)),h||(e=b({src:e,async:!0},n),(n=jn.get(u))&&gh(e,n),h=a.createElement("script"),D(h),Ct(h,"link",e),a.head.appendChild(h)),h={type:"script",instance:h,count:1,state:null},o.set(u,h))}}function A_(e,n){vr.M(e,n);var a=As;if(a&&e){var o=k(a).hoistableScripts,u=Ts(e),h=o.get(u);h||(h=a.querySelector(Ua(u)),h||(e=b({src:e,async:!0,type:"module"},n),(n=jn.get(u))&&gh(e,n),h=a.createElement("script"),D(h),Ct(h,"link",e),a.head.appendChild(h)),h={type:"script",instance:h,count:1,state:null},o.set(u,h))}}function yy(e,n,a,o){var u=(u=Ht.current)?Cl(u):null;if(!u)throw Error(s(446));switch(e){case"meta":case"title":return null;case"style":return typeof a.precedence=="string"&&typeof a.href=="string"?(n=js(a.href),a=k(u).hoistableStyles,o=a.get(n),o||(o={type:"style",instance:null,count:0,state:null},a.set(n,o)),o):{type:"void",instance:null,count:0,state:null};case"link":if(a.rel==="stylesheet"&&typeof a.href=="string"&&typeof a.precedence=="string"){e=js(a.href);var h=k(u).hoistableStyles,x=h.get(e);if(x||(u=u.ownerDocument||u,x={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},h.set(e,x),(h=u.querySelector(za(e)))&&!h._p&&(x.instance=h,x.state.loading=5),jn.has(e)||(a={rel:"preload",as:"style",href:a.href,crossOrigin:a.crossOrigin,integrity:a.integrity,media:a.media,hrefLang:a.hrefLang,referrerPolicy:a.referrerPolicy},jn.set(e,a),h||j_(u,e,a,x.state))),n&&o===null)throw Error(s(528,""));return x}if(n&&o!==null)throw Error(s(529,""));return null;case"script":return n=a.async,a=a.src,typeof a=="string"&&n&&typeof n!="function"&&typeof n!="symbol"?(n=Ts(a),a=k(u).hoistableScripts,o=a.get(n),o||(o={type:"script",instance:null,count:0,state:null},a.set(n,o)),o):{type:"void",instance:null,count:0,state:null};default:throw Error(s(444,e))}}function js(e){return'href="'+vn(e)+'"'}function za(e){return'link[rel="stylesheet"]['+e+"]"}function gy(e){return b({},e,{"data-precedence":e.precedence,precedence:null})}function j_(e,n,a,o){e.querySelector('link[rel="preload"][as="style"]['+n+"]")?o.loading=1:(n=e.createElement("link"),o.preload=n,n.addEventListener("load",function(){return o.loading|=1}),n.addEventListener("error",function(){return o.loading|=2}),Ct(n,"link",a),D(n),e.head.appendChild(n))}function Ts(e){return'[src="'+vn(e)+'"]'}function Ua(e){return"script[async]"+e}function by(e,n,a){if(n.count++,n.instance===null)switch(n.type){case"style":var o=e.querySelector('style[data-href~="'+vn(a.href)+'"]');if(o)return n.instance=o,D(o),o;var u=b({},a,{"data-href":a.href,"data-precedence":a.precedence,href:null,precedence:null});return o=(e.ownerDocument||e).createElement("style"),D(o),Ct(o,"style",u),Ml(o,a.precedence,e),n.instance=o;case"stylesheet":u=js(a.href);var h=e.querySelector(za(u));if(h)return n.state.loading|=4,n.instance=h,D(h),h;o=gy(a),(u=jn.get(u))&&yh(o,u),h=(e.ownerDocument||e).createElement("link"),D(h);var x=h;return x._p=new Promise(function(E,R){x.onload=E,x.onerror=R}),Ct(h,"link",o),n.state.loading|=4,Ml(h,a.precedence,e),n.instance=h;case"script":return h=Ts(a.src),(u=e.querySelector(Ua(h)))?(n.instance=u,D(u),u):(o=a,(u=jn.get(h))&&(o=b({},a),gh(o,u)),e=e.ownerDocument||e,u=e.createElement("script"),D(u),Ct(u,"link",o),e.head.appendChild(u),n.instance=u);case"void":return null;default:throw Error(s(443,n.type))}else n.type==="stylesheet"&&(n.state.loading&4)===0&&(o=n.instance,n.state.loading|=4,Ml(o,a.precedence,e));return n.instance}function Ml(e,n,a){for(var o=a.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),u=o.length?o[o.length-1]:null,h=u,x=0;x<o.length;x++){var E=o[x];if(E.dataset.precedence===n)h=E;else if(h!==u)break}h?h.parentNode.insertBefore(e,h.nextSibling):(n=a.nodeType===9?a.head:a,n.insertBefore(e,n.firstChild))}function yh(e,n){e.crossOrigin==null&&(e.crossOrigin=n.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=n.referrerPolicy),e.title==null&&(e.title=n.title)}function gh(e,n){e.crossOrigin==null&&(e.crossOrigin=n.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=n.referrerPolicy),e.integrity==null&&(e.integrity=n.integrity)}var Rl=null;function vy(e,n,a){if(Rl===null){var o=new Map,u=Rl=new Map;u.set(a,o)}else u=Rl,o=u.get(a),o||(o=new Map,u.set(a,o));if(o.has(e))return o;for(o.set(e,null),a=a.getElementsByTagName(e),u=0;u<a.length;u++){var h=a[u];if(!(h[St]||h[Je]||e==="link"&&h.getAttribute("rel")==="stylesheet")&&h.namespaceURI!=="http://www.w3.org/2000/svg"){var x=h.getAttribute(n)||"";x=e+x;var E=o.get(x);E?E.push(h):o.set(x,[h])}}return o}function xy(e,n,a){e=e.ownerDocument||e,e.head.insertBefore(a,n==="title"?e.querySelector("head > title"):null)}function T_(e,n,a){if(a===1||n.itemProp!=null)return!1;switch(e){case"meta":case"title":return!0;case"style":if(typeof n.precedence!="string"||typeof n.href!="string"||n.href==="")break;return!0;case"link":if(typeof n.rel!="string"||typeof n.href!="string"||n.href===""||n.onLoad||n.onError)break;switch(n.rel){case"stylesheet":return e=n.disabled,typeof n.precedence=="string"&&e==null;default:return!0}case"script":if(n.async&&typeof n.async!="function"&&typeof n.async!="symbol"&&!n.onLoad&&!n.onError&&n.src&&typeof n.src=="string")return!0}return!1}function _y(e){return!(e.type==="stylesheet"&&(e.state.loading&3)===0)}function N_(e,n,a,o){if(a.type==="stylesheet"&&(typeof o.media!="string"||matchMedia(o.media).matches!==!1)&&(a.state.loading&4)===0){if(a.instance===null){var u=js(o.href),h=n.querySelector(za(u));if(h){n=h._p,n!==null&&typeof n=="object"&&typeof n.then=="function"&&(e.count++,e=Dl.bind(e),n.then(e,e)),a.state.loading|=4,a.instance=h,D(h);return}h=n.ownerDocument||n,o=gy(o),(u=jn.get(u))&&yh(o,u),h=h.createElement("link"),D(h);var x=h;x._p=new Promise(function(E,R){x.onload=E,x.onerror=R}),Ct(h,"link",o),a.instance=h}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(a,n),(n=a.state.preload)&&(a.state.loading&3)===0&&(e.count++,a=Dl.bind(e),n.addEventListener("load",a),n.addEventListener("error",a))}}var bh=0;function k_(e,n){return e.stylesheets&&e.count===0&&Bl(e,e.stylesheets),0<e.count||0<e.imgCount?function(a){var o=setTimeout(function(){if(e.stylesheets&&Bl(e,e.stylesheets),e.unsuspend){var h=e.unsuspend;e.unsuspend=null,h()}},6e4+n);0<e.imgBytes&&bh===0&&(bh=62500*u_());var u=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&Bl(e,e.stylesheets),e.unsuspend)){var h=e.unsuspend;e.unsuspend=null,h()}},(e.imgBytes>bh?50:800)+n);return e.unsuspend=a,function(){e.unsuspend=null,clearTimeout(o),clearTimeout(u)}}:null}function Dl(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Bl(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var ql=null;function Bl(e,n){e.stylesheets=null,e.unsuspend!==null&&(e.count++,ql=new Map,n.forEach(C_,e),ql=null,Dl.call(e))}function C_(e,n){if(!(n.state.loading&4)){var a=ql.get(e);if(a)var o=a.get(null);else{a=new Map,ql.set(e,a);for(var u=e.querySelectorAll("link[data-precedence],style[data-precedence]"),h=0;h<u.length;h++){var x=u[h];(x.nodeName==="LINK"||x.getAttribute("media")!=="not all")&&(a.set(x.dataset.precedence,x),o=x)}o&&a.set(null,o)}u=n.instance,x=u.getAttribute("data-precedence"),h=a.get(x)||o,h===o&&a.set(null,u),a.set(x,u),this.count++,o=Dl.bind(this),u.addEventListener("load",o),u.addEventListener("error",o),h?h.parentNode.insertBefore(u,h.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(u,e.firstChild)),n.state.loading|=4}}var Pa={$$typeof:se,Provider:null,Consumer:null,_currentValue:de,_currentValue2:de,_threadCount:0};function M_(e,n,a,o,u,h,x,E,R){this.tag=1,this.containerInfo=e,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=Nr(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Nr(0),this.hiddenUpdates=Nr(null),this.identifierPrefix=o,this.onUncaughtError=u,this.onCaughtError=h,this.onRecoverableError=x,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=R,this.incompleteTransitions=new Map}function wy(e,n,a,o,u,h,x,E,R,H,Q,re){return e=new M_(e,n,a,x,R,H,Q,re,E),n=1,h===!0&&(n|=24),h=Wt(3,null,null,n),e.current=h,h.stateNode=e,n=Ju(),n.refCount++,e.pooledCache=n,n.refCount++,h.memoizedState={element:o,isDehydrated:a,cache:n},ef(h),e}function Sy(e){return e?(e=ss,e):ss}function Ey(e,n,a,o,u,h){u=Sy(u),o.context===null?o.context=u:o.pendingContext=u,o=Ur(n),o.payload={element:a},h=h===void 0?null:h,h!==null&&(o.callback=h),a=Pr(e,o,n),a!==null&&(Xt(a,e,n),ba(a,e,n))}function Oy(e,n){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var a=e.retryLane;e.retryLane=a!==0&&a<n?a:n}}function vh(e,n){Oy(e,n),(e=e.alternate)&&Oy(e,n)}function Ay(e){if(e.tag===13||e.tag===31){var n=Ei(e,67108864);n!==null&&Xt(n,e,67108864),vh(e,67108864)}}function jy(e){if(e.tag===13||e.tag===31){var n=sn();n=tr(n);var a=Ei(e,n);a!==null&&Xt(a,e,n),vh(e,n)}}var Ll=!0;function R_(e,n,a,o){var u=F.T;F.T=null;var h=ae.p;try{ae.p=2,xh(e,n,a,o)}finally{ae.p=h,F.T=u}}function D_(e,n,a,o){var u=F.T;F.T=null;var h=ae.p;try{ae.p=8,xh(e,n,a,o)}finally{ae.p=h,F.T=u}}function xh(e,n,a,o){if(Ll){var u=_h(o);if(u===null)ah(e,n,o,zl,a),Ny(e,o);else if(B_(u,e,n,a,o))o.stopPropagation();else if(Ny(e,o),n&4&&-1<q_.indexOf(e)){for(;u!==null;){var h=N(u);if(h!==null)switch(h.tag){case 3:if(h=h.stateNode,h.current.memoizedState.isDehydrated){var x=Mn(h.pendingLanes);if(x!==0){var E=h;for(E.pendingLanes|=2,E.entangledLanes|=2;x;){var R=1<<31-Bt(x);E.entanglements[1]|=R,x&=~R}Yn(h),(He&6)===0&&(xl=tt()+500,Da(0))}}break;case 31:case 13:E=Ei(h,2),E!==null&&Xt(E,h,2),wl(),vh(h,2)}if(h=_h(o),h===null&&ah(e,n,o,zl,a),h===u)break;u=h}u!==null&&o.stopPropagation()}else ah(e,n,o,null,a)}}function _h(e){return e=wu(e),wh(e)}var zl=null;function wh(e){if(zl=null,e=O(e),e!==null){var n=c(e);if(n===null)e=null;else{var a=n.tag;if(a===13){if(e=d(n),e!==null)return e;e=null}else if(a===31){if(e=p(n),e!==null)return e;e=null}else if(a===3){if(n.stateNode.current.memoizedState.isDehydrated)return n.tag===3?n.stateNode.containerInfo:null;e=null}else n!==e&&(e=null)}}return zl=e,null}function Ty(e){switch(e){case"beforetoggle":case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"toggle":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 2;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch(mu()){case jo:return 2;case To:return 8;case Yi:case pu:return 32;case No:return 268435456;default:return 32}default:return 32}}var Sh=!1,Qr=null,Zr=null,Wr=null,$a=new Map,Ia=new Map,ei=[],q_="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset".split(" ");function Ny(e,n){switch(e){case"focusin":case"focusout":Qr=null;break;case"dragenter":case"dragleave":Zr=null;break;case"mouseover":case"mouseout":Wr=null;break;case"pointerover":case"pointerout":$a.delete(n.pointerId);break;case"gotpointercapture":case"lostpointercapture":Ia.delete(n.pointerId)}}function Ha(e,n,a,o,u,h){return e===null||e.nativeEvent!==h?(e={blockedOn:n,domEventName:a,eventSystemFlags:o,nativeEvent:h,targetContainers:[u]},n!==null&&(n=N(n),n!==null&&Ay(n)),e):(e.eventSystemFlags|=o,n=e.targetContainers,u!==null&&n.indexOf(u)===-1&&n.push(u),e)}function B_(e,n,a,o,u){switch(n){case"focusin":return Qr=Ha(Qr,e,n,a,o,u),!0;case"dragenter":return Zr=Ha(Zr,e,n,a,o,u),!0;case"mouseover":return Wr=Ha(Wr,e,n,a,o,u),!0;case"pointerover":var h=u.pointerId;return $a.set(h,Ha($a.get(h)||null,e,n,a,o,u)),!0;case"gotpointercapture":return h=u.pointerId,Ia.set(h,Ha(Ia.get(h)||null,e,n,a,o,u)),!0}return!1}function ky(e){var n=O(e.target);if(n!==null){var a=c(n);if(a!==null){if(n=a.tag,n===13){if(n=d(a),n!==null){e.blockedOn=n,Co(e.priority,function(){jy(a)});return}}else if(n===31){if(n=p(a),n!==null){e.blockedOn=n,Co(e.priority,function(){jy(a)});return}}else if(n===3&&a.stateNode.current.memoizedState.isDehydrated){e.blockedOn=a.tag===3?a.stateNode.containerInfo:null;return}}}e.blockedOn=null}function Ul(e){if(e.blockedOn!==null)return!1;for(var n=e.targetContainers;0<n.length;){var a=_h(e.nativeEvent);if(a===null){a=e.nativeEvent;var o=new a.constructor(a.type,a);_u=o,a.target.dispatchEvent(o),_u=null}else return n=N(a),n!==null&&Ay(n),e.blockedOn=a,!1;n.shift()}return!0}function Cy(e,n,a){Ul(e)&&a.delete(n)}function L_(){Sh=!1,Qr!==null&&Ul(Qr)&&(Qr=null),Zr!==null&&Ul(Zr)&&(Zr=null),Wr!==null&&Ul(Wr)&&(Wr=null),$a.forEach(Cy),Ia.forEach(Cy)}function Pl(e,n){e.blockedOn===n&&(e.blockedOn=null,Sh||(Sh=!0,i.unstable_scheduleCallback(i.unstable_NormalPriority,L_)))}var $l=null;function My(e){$l!==e&&($l=e,i.unstable_scheduleCallback(i.unstable_NormalPriority,function(){$l===e&&($l=null);for(var n=0;n<e.length;n+=3){var a=e[n],o=e[n+1],u=e[n+2];if(typeof o!="function"){if(wh(o||a)===null)continue;break}var h=N(a);h!==null&&(e.splice(n,3),n-=3,_f(h,{pending:!0,data:u,method:a.method,action:o},o,u))}}))}function Ns(e){function n(R){return Pl(R,e)}Qr!==null&&Pl(Qr,e),Zr!==null&&Pl(Zr,e),Wr!==null&&Pl(Wr,e),$a.forEach(n),Ia.forEach(n);for(var a=0;a<ei.length;a++){var o=ei[a];o.blockedOn===e&&(o.blockedOn=null)}for(;0<ei.length&&(a=ei[0],a.blockedOn===null);)ky(a),a.blockedOn===null&&ei.shift();if(a=(e.ownerDocument||e).$$reactFormReplay,a!=null)for(o=0;o<a.length;o+=3){var u=a[o],h=a[o+1],x=u[lt]||null;if(typeof h=="function")x||My(a);else if(x){var E=null;if(h&&h.hasAttribute("formAction")){if(u=h,x=h[lt]||null)E=x.formAction;else if(wh(u)!==null)continue}else E=x.action;typeof E=="function"?a[o+1]=E:(a.splice(o,3),o-=3),My(a)}}}function Ry(){function e(h){h.canIntercept&&h.info==="react-transition"&&h.intercept({handler:function(){return new Promise(function(x){return u=x})},focusReset:"manual",scroll:"manual"})}function n(){u!==null&&(u(),u=null),o||setTimeout(a,20)}function a(){if(!o&&!navigation.transition){var h=navigation.currentEntry;h&&h.url!=null&&navigation.navigate(h.url,{state:h.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var o=!1,u=null;return navigation.addEventListener("navigate",e),navigation.addEventListener("navigatesuccess",n),navigation.addEventListener("navigateerror",n),setTimeout(a,100),function(){o=!0,navigation.removeEventListener("navigate",e),navigation.removeEventListener("navigatesuccess",n),navigation.removeEventListener("navigateerror",n),u!==null&&(u(),u=null)}}}function Eh(e){this._internalRoot=e}Il.prototype.render=Eh.prototype.render=function(e){var n=this._internalRoot;if(n===null)throw Error(s(409));var a=n.current,o=sn();Ey(a,o,e,n,null,null)},Il.prototype.unmount=Eh.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var n=e.containerInfo;Ey(e.current,2,null,e,null,null),wl(),n[Qt]=null}};function Il(e){this._internalRoot=e}Il.prototype.unstable_scheduleHydration=function(e){if(e){var n=ta();e={blockedOn:null,target:e,priority:n};for(var a=0;a<ei.length&&n!==0&&n<ei[a].priority;a++);ei.splice(a,0,e),a===0&&ky(e)}};var Dy=t.version;if(Dy!=="19.2.4")throw Error(s(527,Dy,"19.2.4"));ae.findDOMNode=function(e){var n=e._reactInternals;if(n===void 0)throw typeof e.render=="function"?Error(s(188)):(e=Object.keys(e).join(","),Error(s(268,e)));return e=f(n),e=e!==null?m(e):null,e=e===null?null:e.stateNode,e};var z_={bundleType:0,version:"19.2.4",rendererPackageName:"react-dom",currentDispatcherRef:F,reconcilerVersion:"19.2.4"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Hl=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Hl.isDisabled&&Hl.supportsFiber)try{pi=Hl.inject(z_),mt=Hl}catch{}}return Ga.createRoot=function(e,n){if(!l(e))throw Error(s(299));var a=!1,o="",u=$0,h=I0,x=H0;return n!=null&&(n.unstable_strictMode===!0&&(a=!0),n.identifierPrefix!==void 0&&(o=n.identifierPrefix),n.onUncaughtError!==void 0&&(u=n.onUncaughtError),n.onCaughtError!==void 0&&(h=n.onCaughtError),n.onRecoverableError!==void 0&&(x=n.onRecoverableError)),n=wy(e,1,!1,null,null,a,o,null,u,h,x,Ry),e[Qt]=n.current,sh(e),new Eh(n)},Ga.hydrateRoot=function(e,n,a){if(!l(e))throw Error(s(299));var o=!1,u="",h=$0,x=I0,E=H0,R=null;return a!=null&&(a.unstable_strictMode===!0&&(o=!0),a.identifierPrefix!==void 0&&(u=a.identifierPrefix),a.onUncaughtError!==void 0&&(h=a.onUncaughtError),a.onCaughtError!==void 0&&(x=a.onCaughtError),a.onRecoverableError!==void 0&&(E=a.onRecoverableError),a.formState!==void 0&&(R=a.formState)),n=wy(e,1,!0,n,a??null,o,u,R,h,x,E,Ry),n.context=Sy(null),a=n.current,o=sn(),o=tr(o),u=Ur(o),u.callback=null,Pr(a,u,o),a=o,n.current.lanes=a,Rn(n,a),Yn(n),e[Qt]=n.current,sh(e),new Il(n)},Ga.version="19.2.4",Ga}var Iy;function jw(){if(Iy)return Oh.exports;Iy=1;function i(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(i)}catch(t){console.error(t)}}return i(),Oh.exports=Aw(),Oh.exports}var Tw=jw();const Nw="modulepreload",kw=function(i,t){return new URL(i,t).href},Hy={},je=function(t,r,s){let l=Promise.resolve();if(r&&r.length>0){let d=function(m){return Promise.all(m.map(b=>Promise.resolve(b).then(v=>({status:"fulfilled",value:v}),v=>({status:"rejected",reason:v}))))};const p=document.getElementsByTagName("link"),g=document.querySelector("meta[property=csp-nonce]"),f=(g==null?void 0:g.nonce)||(g==null?void 0:g.getAttribute("nonce"));l=d(r.map(m=>{if(m=kw(m,s),m in Hy)return;Hy[m]=!0;const b=m.endsWith(".css"),v=b?'[rel="stylesheet"]':"";if(!!s)for(let S=p.length-1;S>=0;S--){const C=p[S];if(C.href===m&&(!b||C.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${m}"]${v}`))return;const w=document.createElement("link");if(w.rel=b?"stylesheet":Nw,b||(w.as="script"),w.crossOrigin="",w.href=m,f&&w.setAttribute("nonce",f),document.head.appendChild(w),b)return new Promise((S,C)=>{w.addEventListener("load",S),w.addEventListener("error",()=>C(new Error(`Unable to preload CSS for ${m}`)))})}))}function c(d){const p=new Event("vite:preloadError",{cancelable:!0});if(p.payload=d,window.dispatchEvent(p),!p.defaultPrevented)throw d}return l.then(d=>{for(const p of d||[])p.status==="rejected"&&c(p.reason);return t().catch(c)})};function _d(i){try{const t=i.split(".");if(t.length!==3)return null;const r=atob(t[1].replace(/-/g,"+").replace(/_/g,"/"));return JSON.parse(r)}catch{return null}}function rb(i){const t=_d(i);return!t||typeof t.exp!="number"?null:t.exp}function wd(i,t=0){const r=rb(i);return r===null?!0:Date.now()/1e3>=r-t}const Mt=window.__LT_BASE__??"",Yh=`${Mt}/api`;class Cw extends Error{constructor(t,r,s){super(t),this.status=r,this.body=s,this.name="ApiError"}}let si=null;function Gl(i){si=i}function ib(){return si}async function Gy(){const i=sessionStorage.getItem("lt_credentials");if(!i)return null;try{const{username:t,password:r}=JSON.parse(i),s=await fetch(`${Yh}/auth/login`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({username:t,password:r})});if(!s.ok)return null;const l=await s.json();return l.token&&l.user&&sessionStorage.setItem("lt_user_info",JSON.stringify({displayName:l.user.display_name,username:l.user.external_id})),l.token??null}catch{return null}}let ni=null;async function Ee(i,t={}){const r={"Content-Type":"application/json",...t.headers};if(si){if(wd(si)){ni||(ni=Gy().finally(()=>{ni=null}));const l=await ni;if(l)si=l,window.dispatchEvent(new CustomEvent("auth:refreshed",{detail:{token:l}}));else throw window.dispatchEvent(new CustomEvent("auth:unauthorized")),new Error("Session expired")}r.Authorization=`Bearer ${si}`}let s=await fetch(`${Yh}${i}`,{...t,headers:r});if(s.status===401&&si){ni||(ni=Gy().finally(()=>{ni=null}));const l=await ni;if(l&&(si=l,window.dispatchEvent(new CustomEvent("auth:refreshed",{detail:{token:l}})),r.Authorization=`Bearer ${l}`,s=await fetch(`${Yh}${i}`,{...t,headers:r})),s.status===401)throw window.dispatchEvent(new CustomEvent("auth:unauthorized")),new Error("Session expired")}else if(s.status===401)throw window.dispatchEvent(new CustomEvent("auth:unauthorized")),new Error("Session expired");if(!s.ok){const l=await s.json().catch(()=>({error:s.statusText}));throw new Cw(l.message||l.error||s.statusText,s.status,l)}return s.json()}const sb=T.createContext(null),Mw=300;function Th(i,t){if(wd(i))return null;const r=_d(i);if(!r)return null;const s=t??(()=>{try{const l=sessionStorage.getItem("lt_user_info");return l?JSON.parse(l):null}catch{return null}})();return{userId:r.userId,displayName:(s==null?void 0:s.displayName)??null,username:(s==null?void 0:s.username)??null,roles:r.roles??[]}}function Rw({children:i}){const[t,r]=T.useState(()=>{const b=sessionStorage.getItem("lt_token");return b?wd(b)?(sessionStorage.removeItem("lt_token"),null):(Gl(b),Th(b)):null}),s=T.useRef(void 0),l=T.useCallback(b=>{clearTimeout(s.current);const v=rb(b);if(!v)return;const _=(v-Mw)*1e3-Date.now();_<=0||(s.current=setTimeout(async()=>{try{const w=_d(b);if(w!=null&&w.sso){const oe=await fetch(`${Mt}/api/auth/sso`,{method:"POST"});if(!oe.ok)return;const M=await oe.json();M.token&&window.dispatchEvent(new CustomEvent("auth:refreshed",{detail:{token:M.token}}));return}const S=sessionStorage.getItem("lt_credentials");if(!S)return;const{username:C,password:L}=JSON.parse(S),z=await fetch(`${Mt}/api/auth/login`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({username:C,password:L})});if(!z.ok)return;const se=await z.json();se.token&&window.dispatchEvent(new CustomEvent("auth:refreshed",{detail:{token:se.token}}))}catch{}},_))},[]),c=T.useCallback((b,v,_)=>{const w={displayName:(_==null?void 0:_.displayName)??null,username:(_==null?void 0:_.username)??(v==null?void 0:v.username)??null},S=Th(b,w);S&&(Gl(b),sessionStorage.setItem("lt_token",b),sessionStorage.setItem("lt_user_info",JSON.stringify(w)),v&&sessionStorage.setItem("lt_credentials",JSON.stringify(v)),r(S),l(b))},[l]),d=T.useCallback(()=>{clearTimeout(s.current);const b=sessionStorage.getItem("lt_sso_logout_url");Gl(null),sessionStorage.removeItem("lt_token"),sessionStorage.removeItem("lt_credentials"),sessionStorage.removeItem("lt_user_info"),sessionStorage.removeItem("lt_sso_logout_url"),r(null),b&&(window.location.href=b)},[]);T.useEffect(()=>{const b=()=>d(),v=_=>{var C;const w=(C=_.detail)==null?void 0:C.token;if(!w)return;const S=Th(w);S&&(Gl(w),sessionStorage.setItem("lt_token",w),r(S),l(w))};return window.addEventListener("auth:unauthorized",b),window.addEventListener("auth:refreshed",v),()=>{window.removeEventListener("auth:unauthorized",b),window.removeEventListener("auth:refreshed",v)}},[d,l]),T.useEffect(()=>{const b=sessionStorage.getItem("lt_token");return b&&t&&l(b),()=>clearTimeout(s.current)},[]);const p=(t==null?void 0:t.roles.some(b=>b.type==="superadmin"))??!1,g=T.useCallback(b=>(t==null?void 0:t.roles.some(v=>v.role===b))??!1,[t]),f=T.useCallback(b=>(t==null?void 0:t.roles.some(v=>v.type===b))??!1,[t]),m=(t==null?void 0:t.roles.map(b=>b.role))??[];return y.jsx(sb.Provider,{value:{user:t,isAuthenticated:!!t,isSuperAdmin:p,login:c,logout:d,hasRole:g,hasRoleType:f,userRoleNames:m},children:i})}function pn(){const i=T.useContext(sb);if(!i)throw new Error("useAuth must be used within AuthProvider");return i}const hn=new Uint8Array(0),Hi=new TextEncoder,un=new TextDecoder;function Dw(...i){let t=0;for(let l=0;l<i.length;l++)t+=i[l].length;const r=new Uint8Array(t);let s=0;for(let l=0;l<i.length;l++)r.set(i[l],s),s+=i[l].length;return r}function so(...i){const t=[];for(let r=0;r<i.length;r++)t.push(Hi.encode(i[r]));return t.length===0?hn:t.length===1?t[0]:Dw(...t)}function Fy(i){return!i||i.length===0?"":un.decode(i)}const Vy="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ",Yy=36,qw=0xcfd41b9100000,Ky=33,Bw=333,Xy=22;function Lw(i){for(let t=0;t<i.length;t++)i[t]=Math.floor(Math.random()*255)}function zw(i){var t;(t=globalThis==null?void 0:globalThis.crypto)!=null&&t.getRandomValues?globalThis.crypto.getRandomValues(i):Lw(i)}class Uw{constructor(){A(this,"buf");A(this,"seq");A(this,"inc");A(this,"inited");this.buf=new Uint8Array(Xy),this.inited=!1}init(){this.inited=!0,this.setPre(),this.initSeqAndInc(),this.fillSeq()}initSeqAndInc(){this.seq=Math.floor(Math.random()*qw),this.inc=Math.floor(Math.random()*(Bw-Ky)+Ky)}setPre(){const t=new Uint8Array(12);zw(t);for(let r=0;r<12;r++){const s=t[r]%36;this.buf[r]=Vy.charCodeAt(s)}}fillSeq(){let t=this.seq;for(let r=Xy-1;r>=12;r--)this.buf[r]=Vy.charCodeAt(t%Yy),t=Math.floor(t/Yy)}next(){return this.inited||this.init(),this.seq+=this.inc,this.seq>0xcfd41b9100000&&(this.setPre(),this.initSeqAndInc()),this.fillSeq(),String.fromCharCode.apply(String,this.buf)}reset(){this.init()}}const fi=new Uw;var _r;(function(i){i.Disconnect="disconnect",i.Reconnect="reconnect",i.Update="update",i.LDM="ldm",i.Error="error"})(_r||(_r={}));var zs;(function(i){i.Reconnecting="reconnecting",i.PingTimer="pingTimer",i.StaleConnection="staleConnection",i.ClientInitiatedReconnect="client initiated reconnect"})(zs||(zs={}));var ce;(function(i){i.ApiError="BAD API",i.BadAuthentication="BAD_AUTHENTICATION",i.BadCreds="BAD_CREDS",i.BadHeader="BAD_HEADER",i.BadJson="BAD_JSON",i.BadPayload="BAD_PAYLOAD",i.BadSubject="BAD_SUBJECT",i.Cancelled="CANCELLED",i.ConnectionClosed="CONNECTION_CLOSED",i.ConnectionDraining="CONNECTION_DRAINING",i.ConnectionRefused="CONNECTION_REFUSED",i.ConnectionTimeout="CONNECTION_TIMEOUT",i.Disconnect="DISCONNECT",i.InvalidOption="INVALID_OPTION",i.InvalidPayload="INVALID_PAYLOAD",i.MaxPayloadExceeded="MAX_PAYLOAD_EXCEEDED",i.NoResponders="503",i.NotFunction="NOT_FUNC",i.RequestError="REQUEST_ERROR",i.ServerOptionNotAvailable="SERVER_OPT_NA",i.SubClosed="SUB_CLOSED",i.SubDraining="SUB_DRAINING",i.Timeout="TIMEOUT",i.Tls="TLS",i.Unknown="UNKNOWN_ERROR",i.WssRequired="WSS_REQUIRED",i.JetStreamInvalidAck="JESTREAM_INVALID_ACK",i.JetStream404NoMessages="404",i.JetStream408RequestTimeout="408",i.JetStream409MaxAckPendingExceeded="409",i.JetStream409="409",i.JetStreamNotEnabled="503",i.JetStreamIdleHeartBeat="IDLE_HEARTBEAT",i.AuthorizationViolation="AUTHORIZATION_VIOLATION",i.AuthenticationExpired="AUTHENTICATION_EXPIRED",i.ProtocolError="NATS_PROTOCOL_ERR",i.PermissionsViolation="PERMISSIONS_VIOLATION",i.AuthenticationTimeout="AUTHENTICATION_TIMEOUT",i.AccountExpired="ACCOUNT_EXPIRED"})(ce||(ce={}));function Pw(i){return typeof i.code=="string"}class ab{constructor(){A(this,"messages");this.messages=new Map,this.messages.set(ce.InvalidPayload,"Invalid payload type - payloads can be 'binary', 'string', or 'json'"),this.messages.set(ce.BadJson,"Bad JSON"),this.messages.set(ce.WssRequired,"TLS is required, therefore a secure websocket connection is also required")}static getMessage(t){return $w.getMessage(t)}getMessage(t){return this.messages.get(t)||t}}const $w=new ab;class me extends Error{constructor(r,s,l){super(r);A(this,"name");A(this,"message");A(this,"code");A(this,"permissionContext");A(this,"chainedError");A(this,"api_error");this.name="NatsError",this.message=r,this.code=s,this.chainedError=l}static errorForCode(r,s){const l=ab.getMessage(r);return new me(l,r,s)}isAuthError(){return this.code===ce.AuthenticationExpired||this.code===ce.AuthorizationViolation||this.code===ce.AccountExpired}isAuthTimeout(){return this.code===ce.AuthenticationTimeout}isPermissionError(){return this.code===ce.PermissionsViolation}isProtocolError(){return this.code===ce.ProtocolError}isJetStreamError(){return this.api_error!==void 0}jsError(){return this.api_error?this.api_error:null}}var ln;(function(i){i[i.Exact=0]="Exact",i[i.CanonicalMIME=1]="CanonicalMIME",i[i.IgnoreCase=2]="IgnoreCase"})(ln||(ln={}));var $n;(function(i){i.Timer="timer",i.Count="count",i.JitterTimer="jitterTimer",i.SentinelMsg="sentinelMsg"})($n||($n={}));var ao;(function(i){i.STATS="io.nats.micro.v1.stats_response",i.INFO="io.nats.micro.v1.info_response",i.PING="io.nats.micro.v1.ping_response"})(ao||(ao={}));const Vc="Nats-Service-Error",Yc="Nats-Service-Error-Code";class Kc extends Error{constructor(r,s){super(s);A(this,"code");this.code=r}static isServiceError(r){return Kc.toServiceError(r)!==null}static toServiceError(r){var l,c;const s=((l=r==null?void 0:r.headers)==null?void 0:l.get(Yc))||"";if(s!==""){const d=parseInt(s)||400,p=((c=r==null?void 0:r.headers)==null?void 0:c.get(Vc))||"";return new Kc(d,p.length?p:s)}return null}}function wr(i=""){if(i=i||"_INBOX",typeof i!="string")throw new Error("prefix must be a string");return i.split(".").forEach(t=>{if(t==="*"||t===">")throw new Error(`inbox prefixes cannot have wildcards '${i}'`)}),`${i}.${fi.next()}`}const Kh="127.0.0.1";var ai;(function(i){i.PING="PING",i.STATS="STATS",i.INFO="INFO"})(ai||(ai={}));function su(i,...t){for(let r=0;r<t.length;r++){const s=t[r];Object.keys(s).forEach(function(l){i[l]=s[l]})}return i}function Fl(i){return un.decode(i).replace(/\n/g,"␊").replace(/\r/g,"␍")}function Gs(i,t=!0){const r=t?me.errorForCode(ce.Timeout):null;let s,l;const c=new Promise((d,p)=>{s={cancel:()=>{l&&clearTimeout(l)}},l=setTimeout(()=>{p(r===null?me.errorForCode(ce.Timeout):r)},i)});return Object.assign(c,s)}function Ys(i=0){let t;const r=new Promise(s=>{const l=setTimeout(()=>{s()},i);t={cancel:()=>{l&&clearTimeout(l)}}});return Object.assign(r,t)}function it(){let i={};const t=new Promise((r,s)=>{i={resolve:r,reject:s}});return Object.assign(t,i)}function ob(i){for(let t=i.length-1;t>0;t--){const r=Math.floor(Math.random()*(t+1));[i[t],i[r]]=[i[r],i[t]]}return i}function Iw(i){return i===0?0:Math.floor(i/2+Math.random()*i)}function Sd(i=[0,250,250,500,500,3e3,5e3]){Array.isArray(i)||(i=[0,250,250,500,500,3e3,5e3]);const t=i.length-1;return{backoff(r){return Iw(r>t?i[t]:i[r])}}}function rt(i){return i*1e6}function Ed(i){return Math.floor(i/1e6)}function Jy(i){let s=!0;const l=new Array(i.length);for(let c=0;c<i.length;c++){let d=i.charCodeAt(c);if(d===58||d<33||d>126)throw new me(`'${i[c]}' is not a valid character for a header key`,ce.BadHeader);s&&97<=d&&d<=122?d-=32:!s&&65<=d&&d<=90&&(d+=32),l[c]=d,s=d==45}return String.fromCharCode(...l)}function Sr(i=0,t=""){if(i===0&&t!==""||i>0&&t==="")throw new Error("setting status requires both code and description");return new oi(i,t)}const Nh="NATS/1.0";class oi{constructor(t=0,r=""){A(this,"_code");A(this,"headers");A(this,"_description");this._code=t,this._description=r,this.headers=new Map}[Symbol.iterator](){return this.headers.entries()}size(){return this.headers.size}equals(t){if(t&&this.headers.size===t.headers.size&&this._code===t._code){for(const[r,s]of this.headers){const l=t.values(r);if(s.length!==l.length)return!1;const c=[...s].sort(),d=[...l].sort();for(let p=0;p<c.length;p++)if(c[p]!==d[p])return!1}return!0}return!1}static decode(t){const r=new oi,l=un.decode(t).split(`\r
|
|
27
|
+
`),c=l[0];if(c!==Nh){let d=c.replace(Nh,"").trim();if(d.length>0){r._code=parseInt(d,10),isNaN(r._code)&&(r._code=0);const p=r._code.toString();d=d.replace(p,""),r._description=d.trim()}}return l.length>=1&&l.slice(1).map(d=>{if(d){const p=d.indexOf(":");if(p>-1){const g=d.slice(0,p),f=d.slice(p+1).trim();r.append(g,f)}}}),r}toString(){if(this.headers.size===0&&this._code===0)return"";let t=Nh;this._code>0&&this._description!==""&&(t+=` ${this._code} ${this._description}`);for(const[r,s]of this.headers)for(let l=0;l<s.length;l++)t=`${t}\r
|
|
28
|
+
${r}: ${s[l]}`;return`${t}\r
|
|
29
|
+
\r
|
|
30
|
+
`}encode(){return Hi.encode(this.toString())}static validHeaderValue(t){if(/[\r\n]/.test(t))throw new me("invalid header value - \\r and \\n are not allowed.",ce.BadHeader);return t.trim()}keys(){const t=[];for(const r of this.headers.keys())t.push(r);return t}findKeys(t,r=ln.Exact){const s=this.keys();switch(r){case ln.Exact:return s.filter(l=>l===t);case ln.CanonicalMIME:return t=Jy(t),s.filter(l=>l===t);default:{const l=t.toLowerCase();return s.filter(c=>l===c.toLowerCase())}}}get(t,r=ln.Exact){const s=this.findKeys(t,r);if(s.length){const l=this.headers.get(s[0]);if(l)return Array.isArray(l)?l[0]:l}return""}last(t,r=ln.Exact){const s=this.findKeys(t,r);if(s.length){const l=this.headers.get(s[0]);if(l)return Array.isArray(l)?l[l.length-1]:l}return""}has(t,r=ln.Exact){return this.findKeys(t,r).length>0}set(t,r,s=ln.Exact){this.delete(t,s),this.append(t,r,s)}append(t,r,s=ln.Exact){const l=Jy(t);s===ln.CanonicalMIME&&(t=l);const c=this.findKeys(t,s);t=c.length>0?c[0]:t;const d=oi.validHeaderValue(r);let p=this.headers.get(t);p||(p=[],this.headers.set(t,p)),p.push(d)}values(t,r=ln.Exact){const s=[];return this.findKeys(t,r).forEach(c=>{const d=this.headers.get(c);d&&s.push(...d)}),s}delete(t,r=ln.Exact){this.findKeys(t,r).forEach(l=>{this.headers.delete(l)})}get hasError(){return this._code>=300}get status(){return`${this._code} ${this._description}`.trim()}toRecord(){const t={};return this.keys().forEach(r=>{t[r]=this.values(r)}),t}get code(){return this._code}get description(){return this._description}static fromRecord(t){const r=new oi;for(const s in t)r.headers.set(s,t[s]);return r}}function Xh(){return{encode(i){return Hi.encode(i)},decode(i){return un.decode(i)}}}function In(i){return{encode(t){try{return t===void 0&&(t=null),Hi.encode(JSON.stringify(t))}catch(r){throw me.errorForCode(ce.BadJson,r)}},decode(t){try{return JSON.parse(un.decode(t),i)}catch(r){throw me.errorForCode(ce.BadJson,r)}}}}function lb(i){var t;return i&&i.data.length===0&&((t=i.headers)==null?void 0:t.code)===503?me.errorForCode(ce.NoResponders):null}class Od{constructor(t,r,s){A(this,"_headers");A(this,"_msg");A(this,"_rdata");A(this,"_reply");A(this,"_subject");A(this,"publisher");this._msg=t,this._rdata=r,this.publisher=s}get subject(){return this._subject?this._subject:(this._subject=un.decode(this._msg.subject),this._subject)}get reply(){return this._reply?this._reply:(this._reply=un.decode(this._msg.reply),this._reply)}get sid(){return this._msg.sid}get headers(){if(this._msg.hdr>-1&&!this._headers){const t=this._rdata.subarray(0,this._msg.hdr);this._headers=oi.decode(t)}return this._headers}get data(){return this._rdata?this._msg.hdr>-1?this._rdata.subarray(this._msg.hdr):this._rdata:new Uint8Array(0)}respond(t=hn,r){return this.reply?(this.publisher.publish(this.reply,t,r),!0):!1}size(){var l;const t=this._msg.subject.length,r=((l=this._msg.reply)==null?void 0:l.length)||0,s=this._msg.size===-1?0:this._msg.size;return t+r+s}json(t){return In(t).decode(this.data)}string(){return un.decode(this.data)}requestInfo(){var r;const t=(r=this.headers)==null?void 0:r.get("Nats-Request-Info");return t?JSON.parse(t,function(s,l){return(s==="start"||s==="stop")&&l!==""?new Date(Date.parse(l)):l}):null}}A(Od,"jc");function Us(i){return au("durable",i)}function Pt(i){return au("stream",i)}function au(i,t=""){if(t==="")throw Error(`${i} name required`);return[".","*",">","/","\\"," "," ",`
|
|
31
|
+
`,"\r"].forEach(s=>{if(t.indexOf(s)!==-1){switch(s){case`
|
|
32
|
+
`:s="\\n";break;case"\r":s="\\r";break;case" ":s="\\t";break}throw Error(`invalid ${i} name - ${i} name cannot contain '${s}'`)}}),""}function no(i,t=""){if(t==="")throw Error(`${i} name required`);const r=Hw(t);if(r.length)throw new Error(`invalid ${i} name - ${i} name ${r}`)}function Hw(i=""){if(i==="")throw Error("name required");const t=/^[-\w]+$/g;if(i.match(t)===null){for(const s of i.split(""))if(s.match(t)===null)return`cannot contain '${s}'`}return""}function Jh(i){if(i.data.length>0)return!1;const t=i.headers;return t?t.code>=100&&t.code<200:!1}function Qh(i){var t;return Jh(i)&&((t=i.headers)==null?void 0:t.description)==="Idle Heartbeat"}function Gw(i,t,r){const s=Sr(i,t),l={hdr:1,sid:0,size:0},c=new Od(l,hn,{});return c._headers=s,c._subject=r,c}function Ps(i){if(i.data.length!==0)return null;const t=i.headers;return t?cb(t.code,t.description):null}var Nn;(function(i){i.MaxBatchExceeded="exceeded maxrequestbatch of",i.MaxExpiresExceeded="exceeded maxrequestexpires of",i.MaxBytesExceeded="exceeded maxrequestmaxbytes of",i.MaxMessageSizeExceeded="message size exceeds maxbytes",i.PushConsumer="consumer is push based",i.MaxWaitingExceeded="exceeded maxwaiting",i.IdleHeartbeatMissed="idle heartbeats missed",i.ConsumerDeleted="consumer deleted"})(Nn||(Nn={}));function Fw(i){return i.code!==ce.JetStream409?!1:[Nn.MaxBatchExceeded,Nn.MaxExpiresExceeded,Nn.MaxBytesExceeded,Nn.MaxMessageSizeExceeded,Nn.PushConsumer,Nn.IdleHeartbeatMissed,Nn.ConsumerDeleted].find(r=>i.message.indexOf(r)!==-1)!==void 0}function cb(i,t=""){if(i<300)return null;switch(t=t.toLowerCase(),i){case 404:return new me(t,ce.JetStream404NoMessages);case 408:return new me(t,ce.JetStream408RequestTimeout);case 409:{const r=t.startsWith(Nn.IdleHeartbeatMissed)?ce.JetStreamIdleHeartBeat:ce.JetStream409;return new me(t,r)}case 503:return me.errorForCode(ce.JetStreamNotEnabled,new Error(t));default:return t===""&&(t=ce.Unknown),new me(t,`${i}`)}}class jt{constructor(){A(this,"inflight");A(this,"processed");A(this,"received");A(this,"noIterator");A(this,"iterClosed");A(this,"done");A(this,"signal");A(this,"yields");A(this,"filtered");A(this,"pendingFiltered");A(this,"ingestionFilterFn");A(this,"protocolFilterFn");A(this,"dispatchedFn");A(this,"ctx");A(this,"_data");A(this,"err");A(this,"time");A(this,"yielding");this.inflight=0,this.filtered=0,this.pendingFiltered=0,this.processed=0,this.received=0,this.noIterator=!1,this.done=!1,this.signal=it(),this.yields=[],this.iterClosed=it(),this.time=0,this.yielding=!1}[Symbol.asyncIterator](){return this.iterate()}push(t){if(this.done)return;if(typeof t=="function"){this.yields.push(t),this.signal.resolve();return}const{ingest:r,protocol:s}=this.ingestionFilterFn?this.ingestionFilterFn(t,this.ctx||this):{ingest:!0,protocol:!1};r&&(s&&(this.filtered++,this.pendingFiltered++),this.yields.push(t),this.signal.resolve())}async*iterate(){if(this.noIterator)throw new me("unsupported iterator",ce.ApiError);if(this.yielding)throw new me("already yielding",ce.ApiError);this.yielding=!0;try{for(;;){if(this.yields.length===0&&await this.signal,this.err)throw this.err;const t=this.yields;this.inflight=t.length,this.yields=[];for(let r=0;r<t.length;r++){if(typeof t[r]=="function"){const l=t[r];try{l()}catch(c){throw c}if(this.err)throw this.err;continue}if(this.protocolFilterFn?this.protocolFilterFn(t[r]):!0){this.processed++;const l=Date.now();yield t[r],this.time=Date.now()-l,this.dispatchedFn&&t[r]&&this.dispatchedFn(t[r])}else this.pendingFiltered--;this.inflight--}if(this.done)break;this.yields.length===0&&(t.length=0,this.yields=t,this.signal=it())}}finally{this.stop()}}stop(t){this.done||(this.err=t,this.done=!0,this.signal.resolve(),this.iterClosed.resolve(t))}getProcessed(){return this.noIterator?this.received:this.processed}getPending(){return this.yields.length+this.inflight-this.pendingFiltered}getReceived(){return this.received-this.filtered}}class Ad{constructor(t,r,s={maxOut:2}){A(this,"interval");A(this,"maxOut");A(this,"cancelAfter");A(this,"timer");A(this,"autoCancelTimer");A(this,"last");A(this,"missed");A(this,"count");A(this,"callback");this.interval=t,this.maxOut=(s==null?void 0:s.maxOut)||2,this.cancelAfter=(s==null?void 0:s.cancelAfter)||0,this.last=Date.now(),this.missed=0,this.count=0,this.callback=r,this._schedule()}cancel(){this.autoCancelTimer&&clearTimeout(this.autoCancelTimer),this.timer&&clearInterval(this.timer),this.timer=0,this.autoCancelTimer=0,this.missed=0}work(){this.last=Date.now(),this.missed=0}_change(t,r=0,s=2){this.interval=t,this.maxOut=s,this.cancelAfter=r,this.restart()}restart(){this.cancel(),this._schedule()}_schedule(){this.cancelAfter>0&&(this.autoCancelTimer=setTimeout(()=>{this.cancel()},this.cancelAfter)),this.timer=setInterval(()=>{if(this.count++,Date.now()-this.last>this.interval&&this.missed++,this.missed>=this.maxOut)try{this.callback(this.missed)===!0&&this.cancel()}catch(t){console.log(t)}},this.interval)}}var Zh;(function(i){i.Limits="limits",i.Interest="interest",i.Workqueue="workqueue"})(Zh||(Zh={}));var uo;(function(i){i.Old="old",i.New="new"})(uo||(uo={}));var Wh;(function(i){i.File="file",i.Memory="memory"})(Wh||(Wh={}));var gt;(function(i){i.All="all",i.Last="last",i.New="new",i.StartSequence="by_start_sequence",i.StartTime="by_start_time",i.LastPerSubject="last_per_subject"})(gt||(gt={}));var At;(function(i){i.None="none",i.All="all",i.Explicit="explicit",i.NotSet=""})(At||(At={}));var Fs;(function(i){i.Instant="instant",i.Original="original"})(Fs||(Fs={}));var hi;(function(i){i.None="none",i.S2="s2"})(hi||(hi={}));var Xc;(function(i){i.CreateOrUpdate="",i.Update="update",i.Create="create"})(Xc||(Xc={}));function Vw(i,t={}){return Object.assign({name:i,deliver_policy:gt.All,ack_policy:At.Explicit,ack_wait:rt(30*1e3),replay_policy:Fs.Instant},t)}var Qy;(function(i){i.API="api_audit",i.StreamAction="stream_action",i.ConsumerAction="consumer_action",i.SnapshotCreate="snapshot_create",i.SnapshotComplete="snapshot_complete",i.RestoreCreate="restore_create",i.RestoreComplete="restore_complete",i.MaxDeliver="max_deliver",i.Terminated="terminated",i.Ack="consumer_ack",i.StreamLeaderElected="stream_leader_elected",i.StreamQuorumLost="stream_quorum_lost",i.ConsumerLeaderElected="consumer_leader_elected",i.ConsumerQuorumLost="consumer_quorum_lost"})(Qy||(Qy={}));var It;(function(i){i.StreamSourceHdr="Nats-Stream-Source",i.LastConsumerSeqHdr="Nats-Last-Consumer",i.LastStreamSeqHdr="Nats-Last-Stream",i.ConsumerStalledHdr="Nats-Consumer-Stalled",i.MessageSizeHdr="Nats-Msg-Size",i.RollupHdr="Nats-Rollup",i.RollupValueSubject="sub",i.RollupValueAll="all",i.PendingMessagesHdr="Nats-Pending-Messages",i.PendingBytesHdr="Nats-Pending-Bytes"})(It||(It={}));var Un;(function(i){i.LastValue="",i.AllHistory="history",i.UpdatesOnly="updates"})(Un||(Un={}));var Bs;(function(i){i.Stream="Nats-Stream",i.Sequence="Nats-Sequence",i.TimeStamp="Nats-Time-Stamp",i.Subject="Nats-Subject"})(Bs||(Bs={}));var Zy;(function(i){i.Stream="Nats-Stream",i.Subject="Nats-Subject",i.Sequence="Nats-Sequence",i.LastSequence="Nats-Last-Sequence",i.Size="Nats-Msg-Size"})(Zy||(Zy={}));const cn="KV_";class Yw{constructor(t){A(this,"config");A(this,"ordered");A(this,"mack");A(this,"stream");A(this,"callbackFn");A(this,"max");A(this,"qname");A(this,"isBind");A(this,"filters");this.stream="",this.mack=!1,this.ordered=!1,this.config=Vw("",t||{})}getOpts(){var r;const t={};if(t.config=Object.assign({},this.config),t.config.filter_subject&&(this.filterSubject(t.config.filter_subject),t.config.filter_subject=void 0),t.config.filter_subjects&&((r=t.config.filter_subjects)==null||r.forEach(s=>{this.filterSubject(s)}),t.config.filter_subjects=void 0),t.mack=this.mack,t.stream=this.stream,t.callbackFn=this.callbackFn,t.max=this.max,t.queue=this.qname,t.ordered=this.ordered,t.config.ack_policy=t.ordered?At.None:t.config.ack_policy,t.isBind=t.isBind||!1,this.filters)switch(this.filters.length){case 0:break;case 1:t.config.filter_subject=this.filters[0];break;default:t.config.filter_subjects=this.filters}return t}description(t){return this.config.description=t,this}deliverTo(t){return this.config.deliver_subject=t,this}durable(t){return Us(t),this.config.durable_name=t,this}startSequence(t){if(t<=0)throw new Error("sequence must be greater than 0");return this.config.deliver_policy=gt.StartSequence,this.config.opt_start_seq=t,this}startTime(t){return this.config.deliver_policy=gt.StartTime,this.config.opt_start_time=t.toISOString(),this}deliverAll(){return this.config.deliver_policy=gt.All,this}deliverLastPerSubject(){return this.config.deliver_policy=gt.LastPerSubject,this}deliverLast(){return this.config.deliver_policy=gt.Last,this}deliverNew(){return this.config.deliver_policy=gt.New,this}startAtTimeDelta(t){return this.startTime(new Date(Date.now()-t)),this}headersOnly(){return this.config.headers_only=!0,this}ackNone(){return this.config.ack_policy=At.None,this}ackAll(){return this.config.ack_policy=At.All,this}ackExplicit(){return this.config.ack_policy=At.Explicit,this}ackWait(t){return this.config.ack_wait=rt(t),this}maxDeliver(t){return this.config.max_deliver=t,this}filterSubject(t){return this.filters=this.filters||[],this.filters.push(t),this}replayInstantly(){return this.config.replay_policy=Fs.Instant,this}replayOriginal(){return this.config.replay_policy=Fs.Original,this}sample(t){if(t=Math.trunc(t),t<0||t>100)throw new Error("value must be between 0-100");return this.config.sample_freq=`${t}%`,this}limit(t){return this.config.rate_limit_bps=t,this}maxWaiting(t){return this.config.max_waiting=t,this}maxAckPending(t){return this.config.max_ack_pending=t,this}idleHeartbeat(t){return this.config.idle_heartbeat=rt(t),this}flowControl(){return this.config.flow_control=!0,this}deliverGroup(t){return this.queue(t),this}manualAck(){return this.mack=!0,this}maxMessages(t){return this.max=t,this}callback(t){return this.callbackFn=t,this}queue(t){return this.qname=t,this.config.deliver_group=t,this}orderedConsumer(){return this.ordered=!0,this}bind(t,r){return this.stream=t,this.config.durable_name=r,this.isBind=!0,this}bindStream(t){return this.stream=t,this}inactiveEphemeralThreshold(t){return this.config.inactive_threshold=rt(t),this}maxPullBatch(t){return this.config.max_batch=t,this}maxPullRequestExpires(t){return this.config.max_expires=rt(t),this}memory(){return this.config.mem_storage=!0,this}numReplicas(t){return this.config.num_replicas=t,this}consumerName(t){return this.config.name=t,this}}function li(i){return new Yw(i)}function Wy(i){return typeof i.getOpts=="function"}class Kw{static encode(t){if(typeof t=="string")return btoa(t);const r=Array.from(t);return btoa(String.fromCharCode(...r))}static decode(t,r=!1){const s=atob(t);return r?Uint8Array.from(s,l=>l.charCodeAt(0)):s}}class $s{static encode(t){return $s.toB64URLEncoding(Kw.encode(t))}static decode(t,r=!1){return $s.decode($s.fromB64URLEncoding(t),r)}static toB64URLEncoding(t){return t.replace(/\+/g,"-").replace(/\//g,"_")}static fromB64URLEncoding(t){return t.replace(/_/g,"/").replace(/-/g,"+")}}class Vs{constructor(){A(this,"buffers");A(this,"byteLength");this.buffers=[],this.byteLength=0}static concat(...t){let r=0;for(let c=0;c<t.length;c++)r+=t[c].length;const s=new Uint8Array(r);let l=0;for(let c=0;c<t.length;c++)s.set(t[c],l),l+=t[c].length;return s}static fromAscii(t){return t||(t=""),Hi.encode(t)}static toAscii(t){return un.decode(t)}reset(){this.buffers.length=0,this.byteLength=0}pack(){if(this.buffers.length>1){const t=new Uint8Array(this.byteLength);let r=0;for(let s=0;s<this.buffers.length;s++)t.set(this.buffers[s],r),r+=this.buffers[s].length;this.buffers.length=0,this.buffers.push(t)}}shift(){if(this.buffers.length){const t=this.buffers.shift();if(t)return this.byteLength-=t.length,t}return new Uint8Array(0)}drain(t){if(this.buffers.length){this.pack();const r=this.buffers.pop();if(r){const s=this.byteLength;(t===void 0||t>s)&&(t=s);const l=r.subarray(0,t);return s>t&&this.buffers.push(r.subarray(t)),this.byteLength=s-t,l}}return new Uint8Array(0)}fill(t,...r){t&&(this.buffers.push(t),this.byteLength+=t.length);for(let s=0;s<r.length;s++)r[s]&&r[s].length&&(this.buffers.push(r[s]),this.byteLength+=r[s].length)}peek(){return this.buffers.length?(this.pack(),this.buffers[0]):new Uint8Array(0)}size(){return this.byteLength}length(){return this.buffers.length}}function Xw(i,t){return t.forEach(function(r){r&&typeof r!="string"&&!Array.isArray(r)&&Object.keys(r).forEach(function(s){if(s!=="default"&&!(s in i)){var l=Object.getOwnPropertyDescriptor(r,s);Object.defineProperty(i,s,l.get?l:{enumerable:!0,get:function(){return r[s]}})}})}),Object.freeze(i)}var Jw=typeof global<"u"?global:typeof self<"u"?self:typeof window<"u"?window:{},Fa=Jw.performance||{};Fa.now||Fa.mozNow||Fa.msNow||Fa.oNow||Fa.webkitNow;var eg={versions:{}},Qw=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Zw(i){if(i.__esModule)return i;var t=Object.defineProperty({},"__esModule",{value:!0});return Object.keys(i).forEach(function(r){var s=Object.getOwnPropertyDescriptor(i,r);Object.defineProperty(t,r,s.get?s:{enumerable:!0,get:function(){return i[r]}})}),t}var kh,ou={exports:{}},tg={},ng=Zw(Xw({__proto__:null,default:tg},[tg]));kh=ou,(function(){var i="input is invalid type",t=typeof window=="object",r=t?window:{};r.JS_SHA256_NO_WINDOW&&(t=!1);var s=!t&&typeof self=="object",l=!r.JS_SHA256_NO_NODE_JS&&eg.versions&&eg.versions.node;l?r=Qw:s&&(r=self);var c=!r.JS_SHA256_NO_COMMON_JS&&kh.exports,d=!r.JS_SHA256_NO_ARRAY_BUFFER&&typeof ArrayBuffer<"u",p="0123456789abcdef".split(""),g=[-2147483648,8388608,32768,128],f=[24,16,8,0],m=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298],b=["hex","array","digest","arrayBuffer"],v=[];!r.JS_SHA256_NO_NODE_JS&&Array.isArray||(Array.isArray=function(M){return Object.prototype.toString.call(M)==="[object Array]"}),!d||!r.JS_SHA256_NO_ARRAY_BUFFER_IS_VIEW&&ArrayBuffer.isView||(ArrayBuffer.isView=function(M){return typeof M=="object"&&M.buffer&&M.buffer.constructor===ArrayBuffer});var _=function(M,B){return function(te){return new z(B,!0).update(te)[M]()}},w=function(M){var B=_("hex",M);l&&(B=S(B,M)),B.create=function(){return new z(M)},B.update=function(P){return B.create().update(P)};for(var te=0;te<b.length;++te){var K=b[te];B[K]=_(K,M)}return B},S=function(M,B){var te,K=ng,P=ng.Buffer,Y=B?"sha224":"sha256";return te=P.from&&!r.JS_SHA256_NO_BUFFER_FROM?P.from:function(W){return new P(W)},function(W){if(typeof W=="string")return K.createHash(Y).update(W,"utf8").digest("hex");if(W==null)throw new Error(i);return W.constructor===ArrayBuffer&&(W=new Uint8Array(W)),Array.isArray(W)||ArrayBuffer.isView(W)||W.constructor===P?K.createHash(Y).update(te(W)).digest("hex"):M(W)}},C=function(M,B){return function(te,K){return new se(te,B,!0).update(K)[M]()}},L=function(M){var B=C("hex",M);B.create=function(P){return new se(P,M)},B.update=function(P,Y){return B.create(P).update(Y)};for(var te=0;te<b.length;++te){var K=b[te];B[K]=C(K,M)}return B};function z(M,B){B?(v[0]=v[16]=v[1]=v[2]=v[3]=v[4]=v[5]=v[6]=v[7]=v[8]=v[9]=v[10]=v[11]=v[12]=v[13]=v[14]=v[15]=0,this.blocks=v):this.blocks=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],M?(this.h0=3238371032,this.h1=914150663,this.h2=812702999,this.h3=4144912697,this.h4=4290775857,this.h5=1750603025,this.h6=1694076839,this.h7=3204075428):(this.h0=1779033703,this.h1=3144134277,this.h2=1013904242,this.h3=2773480762,this.h4=1359893119,this.h5=2600822924,this.h6=528734635,this.h7=1541459225),this.block=this.start=this.bytes=this.hBytes=0,this.finalized=this.hashed=!1,this.first=!0,this.is224=M}function se(M,B,te){var K,P=typeof M;if(P==="string"){var Y,W=[],X=M.length,he=0;for(K=0;K<X;++K)(Y=M.charCodeAt(K))<128?W[he++]=Y:Y<2048?(W[he++]=192|Y>>>6,W[he++]=128|63&Y):Y<55296||Y>=57344?(W[he++]=224|Y>>>12,W[he++]=128|Y>>>6&63,W[he++]=128|63&Y):(Y=65536+((1023&Y)<<10|1023&M.charCodeAt(++K)),W[he++]=240|Y>>>18,W[he++]=128|Y>>>12&63,W[he++]=128|Y>>>6&63,W[he++]=128|63&Y);M=W}else{if(P!=="object")throw new Error(i);if(M===null)throw new Error(i);if(d&&M.constructor===ArrayBuffer)M=new Uint8Array(M);else if(!(Array.isArray(M)||d&&ArrayBuffer.isView(M)))throw new Error(i)}M.length>64&&(M=new z(B,!0).update(M).array());var _e=[],Te=[];for(K=0;K<64;++K){var F=M[K]||0;_e[K]=92^F,Te[K]=54^F}z.call(this,B,te),this.update(Te),this.oKeyPad=_e,this.inner=!0,this.sharedMemory=te}z.prototype.update=function(M){if(!this.finalized){var B,te=typeof M;if(te!=="string"){if(te!=="object")throw new Error(i);if(M===null)throw new Error(i);if(d&&M.constructor===ArrayBuffer)M=new Uint8Array(M);else if(!(Array.isArray(M)||d&&ArrayBuffer.isView(M)))throw new Error(i);B=!0}for(var K,P,Y=0,W=M.length,X=this.blocks;Y<W;){if(this.hashed&&(this.hashed=!1,X[0]=this.block,this.block=X[16]=X[1]=X[2]=X[3]=X[4]=X[5]=X[6]=X[7]=X[8]=X[9]=X[10]=X[11]=X[12]=X[13]=X[14]=X[15]=0),B)for(P=this.start;Y<W&&P<64;++Y)X[P>>>2]|=M[Y]<<f[3&P++];else for(P=this.start;Y<W&&P<64;++Y)(K=M.charCodeAt(Y))<128?X[P>>>2]|=K<<f[3&P++]:K<2048?(X[P>>>2]|=(192|K>>>6)<<f[3&P++],X[P>>>2]|=(128|63&K)<<f[3&P++]):K<55296||K>=57344?(X[P>>>2]|=(224|K>>>12)<<f[3&P++],X[P>>>2]|=(128|K>>>6&63)<<f[3&P++],X[P>>>2]|=(128|63&K)<<f[3&P++]):(K=65536+((1023&K)<<10|1023&M.charCodeAt(++Y)),X[P>>>2]|=(240|K>>>18)<<f[3&P++],X[P>>>2]|=(128|K>>>12&63)<<f[3&P++],X[P>>>2]|=(128|K>>>6&63)<<f[3&P++],X[P>>>2]|=(128|63&K)<<f[3&P++]);this.lastByteIndex=P,this.bytes+=P-this.start,P>=64?(this.block=X[16],this.start=P-64,this.hash(),this.hashed=!0):this.start=P}return this.bytes>4294967295&&(this.hBytes+=this.bytes/4294967296|0,this.bytes=this.bytes%4294967296),this}},z.prototype.finalize=function(){if(!this.finalized){this.finalized=!0;var M=this.blocks,B=this.lastByteIndex;M[16]=this.block,M[B>>>2]|=g[3&B],this.block=M[16],B>=56&&(this.hashed||this.hash(),M[0]=this.block,M[16]=M[1]=M[2]=M[3]=M[4]=M[5]=M[6]=M[7]=M[8]=M[9]=M[10]=M[11]=M[12]=M[13]=M[14]=M[15]=0),M[14]=this.hBytes<<3|this.bytes>>>29,M[15]=this.bytes<<3,this.hash()}},z.prototype.hash=function(){var M,B,te,K,P,Y,W,X,he,_e=this.h0,Te=this.h1,F=this.h2,ae=this.h3,de=this.h4,Oe=this.h5,le=this.h6,we=this.h7,Se=this.blocks;for(M=16;M<64;++M)B=((P=Se[M-15])>>>7|P<<25)^(P>>>18|P<<14)^P>>>3,te=((P=Se[M-2])>>>17|P<<15)^(P>>>19|P<<13)^P>>>10,Se[M]=Se[M-16]+B+Se[M-7]+te|0;for(he=Te&F,M=0;M<64;M+=4)this.first?(this.is224?(Y=300032,we=(P=Se[0]-1413257819)-150054599|0,ae=P+24177077|0):(Y=704751109,we=(P=Se[0]-210244248)-1521486534|0,ae=P+143694565|0),this.first=!1):(B=(_e>>>2|_e<<30)^(_e>>>13|_e<<19)^(_e>>>22|_e<<10),K=(Y=_e&Te)^_e&F^he,we=ae+(P=we+(te=(de>>>6|de<<26)^(de>>>11|de<<21)^(de>>>25|de<<7))+(de&Oe^~de&le)+m[M]+Se[M])|0,ae=P+(B+K)|0),B=(ae>>>2|ae<<30)^(ae>>>13|ae<<19)^(ae>>>22|ae<<10),K=(W=ae&_e)^ae&Te^Y,le=F+(P=le+(te=(we>>>6|we<<26)^(we>>>11|we<<21)^(we>>>25|we<<7))+(we&de^~we&Oe)+m[M+1]+Se[M+1])|0,B=((F=P+(B+K)|0)>>>2|F<<30)^(F>>>13|F<<19)^(F>>>22|F<<10),K=(X=F&ae)^F&_e^W,Oe=Te+(P=Oe+(te=(le>>>6|le<<26)^(le>>>11|le<<21)^(le>>>25|le<<7))+(le&we^~le&de)+m[M+2]+Se[M+2])|0,B=((Te=P+(B+K)|0)>>>2|Te<<30)^(Te>>>13|Te<<19)^(Te>>>22|Te<<10),K=(he=Te&F)^Te&ae^X,de=_e+(P=de+(te=(Oe>>>6|Oe<<26)^(Oe>>>11|Oe<<21)^(Oe>>>25|Oe<<7))+(Oe&le^~Oe&we)+m[M+3]+Se[M+3])|0,_e=P+(B+K)|0,this.chromeBugWorkAround=!0;this.h0=this.h0+_e|0,this.h1=this.h1+Te|0,this.h2=this.h2+F|0,this.h3=this.h3+ae|0,this.h4=this.h4+de|0,this.h5=this.h5+Oe|0,this.h6=this.h6+le|0,this.h7=this.h7+we|0},z.prototype.hex=function(){this.finalize();var M=this.h0,B=this.h1,te=this.h2,K=this.h3,P=this.h4,Y=this.h5,W=this.h6,X=this.h7,he=p[M>>>28&15]+p[M>>>24&15]+p[M>>>20&15]+p[M>>>16&15]+p[M>>>12&15]+p[M>>>8&15]+p[M>>>4&15]+p[15&M]+p[B>>>28&15]+p[B>>>24&15]+p[B>>>20&15]+p[B>>>16&15]+p[B>>>12&15]+p[B>>>8&15]+p[B>>>4&15]+p[15&B]+p[te>>>28&15]+p[te>>>24&15]+p[te>>>20&15]+p[te>>>16&15]+p[te>>>12&15]+p[te>>>8&15]+p[te>>>4&15]+p[15&te]+p[K>>>28&15]+p[K>>>24&15]+p[K>>>20&15]+p[K>>>16&15]+p[K>>>12&15]+p[K>>>8&15]+p[K>>>4&15]+p[15&K]+p[P>>>28&15]+p[P>>>24&15]+p[P>>>20&15]+p[P>>>16&15]+p[P>>>12&15]+p[P>>>8&15]+p[P>>>4&15]+p[15&P]+p[Y>>>28&15]+p[Y>>>24&15]+p[Y>>>20&15]+p[Y>>>16&15]+p[Y>>>12&15]+p[Y>>>8&15]+p[Y>>>4&15]+p[15&Y]+p[W>>>28&15]+p[W>>>24&15]+p[W>>>20&15]+p[W>>>16&15]+p[W>>>12&15]+p[W>>>8&15]+p[W>>>4&15]+p[15&W];return this.is224||(he+=p[X>>>28&15]+p[X>>>24&15]+p[X>>>20&15]+p[X>>>16&15]+p[X>>>12&15]+p[X>>>8&15]+p[X>>>4&15]+p[15&X]),he},z.prototype.toString=z.prototype.hex,z.prototype.digest=function(){this.finalize();var M=this.h0,B=this.h1,te=this.h2,K=this.h3,P=this.h4,Y=this.h5,W=this.h6,X=this.h7,he=[M>>>24&255,M>>>16&255,M>>>8&255,255&M,B>>>24&255,B>>>16&255,B>>>8&255,255&B,te>>>24&255,te>>>16&255,te>>>8&255,255&te,K>>>24&255,K>>>16&255,K>>>8&255,255&K,P>>>24&255,P>>>16&255,P>>>8&255,255&P,Y>>>24&255,Y>>>16&255,Y>>>8&255,255&Y,W>>>24&255,W>>>16&255,W>>>8&255,255&W];return this.is224||he.push(X>>>24&255,X>>>16&255,X>>>8&255,255&X),he},z.prototype.array=z.prototype.digest,z.prototype.arrayBuffer=function(){this.finalize();var M=new ArrayBuffer(this.is224?28:32),B=new DataView(M);return B.setUint32(0,this.h0),B.setUint32(4,this.h1),B.setUint32(8,this.h2),B.setUint32(12,this.h3),B.setUint32(16,this.h4),B.setUint32(20,this.h5),B.setUint32(24,this.h6),this.is224||B.setUint32(28,this.h7),M},se.prototype=new z,se.prototype.finalize=function(){if(z.prototype.finalize.call(this),this.inner){this.inner=!1;var M=this.array();z.call(this,this.is224,this.sharedMemory),this.update(this.oKeyPad),this.update(M),z.prototype.finalize.call(this)}};var oe=w();oe.sha256=oe,oe.sha224=w(!0),oe.sha256.hmac=L(),oe.sha224.hmac=L(!0),c?kh.exports=oe:(r.sha256=oe.sha256,r.sha224=oe.sha224)})();ou.exports;ou.exports.sha224;var rg=ou.exports.sha256;function ed(i){return iS(i)}function Ww(i){if(!/^[0-9A-Fa-f]+$/.test(i))return!1;const r=/^[0-9A-F]+$/.test(i),s=/^[0-9a-f]+$/.test(i);return r||s?i.length%2===0:!1}function eS(i){return/^[A-Za-z0-9\-_]*(={0,2})?$/.test(i)||/^[A-Za-z0-9+/]*(={0,2})?$/.test(i)}function tS(i){return Ww(i)?"hex":eS(i)?"b64":""}function nS(i){if(i.length%2!==0)throw new Error("hex string must have an even length");const t=new Uint8Array(i.length/2);for(let r=0;r<i.length;r+=2)t[r/2]=parseInt(i.substring(r,r+2),16);return t}function rS(i){i=i.replace(/-/g,"+"),i=i.replace(/_/g,"/");const t=atob(i);return Uint8Array.from(t,r=>r.charCodeAt(0))}function iS(i){switch(tS(i)){case"hex":return nS(i);case"b64":return rS(i)}return null}function sS(i,t){const r=typeof i=="string"?ed(i):i,s=typeof t=="string"?ed(t):t;if(r===null||s===null||r.length!==s.length)return!1;for(let l=0;l<r.length;l++)if(r[l]!==s[l])return!1;return!0}class ub{constructor(t,r,s=!0){A(this,"token");A(this,"received");A(this,"ctx");A(this,"requestSubject");A(this,"mux");this.mux=t,this.requestSubject=r,this.received=0,this.token=fi.next(),s&&(this.ctx=new Error)}}class aS extends ub{constructor(r,s,l={maxWait:1e3}){super(r,s);A(this,"callback");A(this,"done");A(this,"timer");A(this,"max");A(this,"opts");if(this.opts=l,typeof this.opts.callback!="function")throw new Error("callback is required");this.callback=this.opts.callback,this.max=typeof l.maxMessages=="number"&&l.maxMessages>0?l.maxMessages:-1,this.done=it(),this.done.then(()=>{this.callback(null,null)}),this.timer=setTimeout(()=>{this.cancel()},l.maxWait)}cancel(r){r&&this.callback(r,null),clearTimeout(this.timer),this.mux.cancel(this),this.done.resolve()}resolver(r,s){r?(this.ctx&&(r.stack+=`
|
|
33
|
+
|
|
34
|
+
${this.ctx.stack}`),this.cancel(r)):(this.callback(null,s),this.opts.strategy===$n.Count&&(this.max--,this.max===0&&this.cancel()),this.opts.strategy===$n.JitterTimer&&(clearTimeout(this.timer),this.timer=setTimeout(()=>{this.cancel()},this.opts.jitter||300)),this.opts.strategy===$n.SentinelMsg&&s&&s.data.length===0&&this.cancel())}}class fb extends ub{constructor(r,s,l={timeout:1e3},c=!0){super(r,s,c);A(this,"deferred");A(this,"timer");this.deferred=it(),this.timer=Gs(l.timeout,c)}resolver(r,s){this.timer&&this.timer.cancel(),r?(this.ctx&&(r.stack+=`
|
|
35
|
+
|
|
36
|
+
${this.ctx.stack}`),this.deferred.reject(r)):this.deferred.resolve(s),this.cancel()}cancel(r){this.timer&&this.timer.cancel(),this.mux.cancel(this),this.deferred.reject(r||me.errorForCode(ce.Cancelled))}}const oS="$JS.API";function lS(i){return i=i||{},i.domain&&(i.apiPrefix=`$JS.${i.domain}.API`,delete i.domain),su({apiPrefix:oS,timeout:5e3},i)}class go{constructor(t,r){A(this,"nc");A(this,"opts");A(this,"prefix");A(this,"timeout");A(this,"jc");this.nc=t,this.opts=lS(r),this._parseOpts(),this.prefix=this.opts.apiPrefix,this.timeout=this.opts.timeout,this.jc=In()}getOptions(){return Object.assign({},this.opts)}_parseOpts(){let t=this.opts.apiPrefix;if(!t||t.length===0)throw new Error("invalid empty prefix");t[t.length-1]==="."&&(t=t.substr(0,t.length-1)),this.opts.apiPrefix=t}async _request(t,r=null,s){s=s||{},s.timeout=this.timeout;let l=hn;r&&(l=this.jc.encode(r));let{retries:c}=s;c=c||1,c=c===-1?Number.MAX_SAFE_INTEGER:c;const d=Sd();for(let p=0;p<c;p++)try{const g=await this.nc.request(t,l,s);return this.parseJsResponse(g)}catch(g){const f=g;if((f.code==="503"||f.code===ce.Timeout)&&p+1<c)await Ys(d.backoff(p));else throw g}}async findStream(t){const r={subject:t},l=await this._request(`${this.prefix}.STREAM.NAMES`,r);if(!l.streams||l.streams.length!==1)throw new Error("no stream matches subject");return l.streams[0]}getConnection(){return this.nc}parseJsResponse(t){const r=this.jc.decode(t.data),s=r;if(s.error){const l=cb(s.error.code,s.error.description);if(l!==null)throw l.api_error=s.error,l}return r}}class ro{constructor(t,r,s,l){A(this,"err");A(this,"offset");A(this,"pageInfo");A(this,"subject");A(this,"jsm");A(this,"filter");A(this,"payload");if(!t)throw new Error("subject is required");this.subject=t,this.jsm=s,this.offset=0,this.pageInfo={},this.filter=r,this.payload=l||{}}async next(){if(this.err)return[];if(this.pageInfo&&this.offset>=this.pageInfo.total)return[];const t={offset:this.offset};this.payload&&Object.assign(t,this.payload);try{const r=await this.jsm._request(this.subject,t,{timeout:this.jsm.timeout});this.pageInfo=r;const s=this.countResponse(r);return s===0?[]:(this.offset+=s,this.filter(r))}catch(r){throw this.err=r,r}}countResponse(t){var r,s,l;switch(t==null?void 0:t.type){case"io.nats.jetstream.api.v1.stream_names_response":case"io.nats.jetstream.api.v1.stream_list_response":return((r=t.streams)==null?void 0:r.length)||0;case"io.nats.jetstream.api.v1.consumer_list_response":return((s=t.consumers)==null?void 0:s.length)||0;default:return console.error(`jslister.ts: unknown API response for paged output: ${t==null?void 0:t.type}`),((l=t.streams)==null?void 0:l.length)||0}return 0}async*[Symbol.asyncIterator](){let t=await this.next();for(;t.length>0;){for(const r of t)yield r;t=await this.next()}}}function Ii(i=""){const t=i.match(/(\d+).(\d+).(\d+)/);if(t)return{major:parseInt(t[1]),minor:parseInt(t[2]),micro:parseInt(t[3])};throw new Error(`'${i}' is not a semver value`)}function td(i,t){return i.major<t.major?-1:i.major>t.major?1:i.minor<t.minor?-1:i.minor>t.minor?1:i.micro<t.micro?-1:i.micro>t.micro?1:0}var Pe;(function(i){i.JS_KV="js_kv",i.JS_OBJECTSTORE="js_objectstore",i.JS_PULL_MAX_BYTES="js_pull_max_bytes",i.JS_NEW_CONSUMER_CREATE_API="js_new_consumer_create",i.JS_ALLOW_DIRECT="js_allow_direct",i.JS_MULTIPLE_CONSUMER_FILTER="js_multiple_consumer_filter",i.JS_SIMPLIFICATION="js_simplification",i.JS_STREAM_CONSUMER_METADATA="js_stream_consumer_metadata",i.JS_CONSUMER_FILTER_SUBJECTS="js_consumer_filter_subjects",i.JS_STREAM_FIRST_SEQ="js_stream_first_seq",i.JS_STREAM_SUBJECT_TRANSFORM="js_stream_subject_transform",i.JS_STREAM_SOURCE_SUBJECT_TRANSFORM="js_stream_source_subject_transform",i.JS_STREAM_COMPRESSION="js_stream_compression",i.JS_DEFAULT_CONSUMER_LIMITS="js_default_consumer_limits",i.JS_BATCH_DIRECT_GET="js_batch_direct_get"})(Pe||(Pe={}));class cS{constructor(t){A(this,"server");A(this,"features");A(this,"disabled");this.features=new Map,this.disabled=[],this.update(t)}resetDisabled(){this.disabled.length=0,this.update(this.server)}disable(t){this.disabled.push(t),this.update(this.server)}isDisabled(t){return this.disabled.indexOf(t)!==-1}update(t){typeof t=="string"&&(t=Ii(t)),this.server=t,this.set(Pe.JS_KV,"2.6.2"),this.set(Pe.JS_OBJECTSTORE,"2.6.3"),this.set(Pe.JS_PULL_MAX_BYTES,"2.8.3"),this.set(Pe.JS_NEW_CONSUMER_CREATE_API,"2.9.0"),this.set(Pe.JS_ALLOW_DIRECT,"2.9.0"),this.set(Pe.JS_MULTIPLE_CONSUMER_FILTER,"2.10.0"),this.set(Pe.JS_SIMPLIFICATION,"2.9.4"),this.set(Pe.JS_STREAM_CONSUMER_METADATA,"2.10.0"),this.set(Pe.JS_CONSUMER_FILTER_SUBJECTS,"2.10.0"),this.set(Pe.JS_STREAM_FIRST_SEQ,"2.10.0"),this.set(Pe.JS_STREAM_SUBJECT_TRANSFORM,"2.10.0"),this.set(Pe.JS_STREAM_SOURCE_SUBJECT_TRANSFORM,"2.10.0"),this.set(Pe.JS_STREAM_COMPRESSION,"2.10.0"),this.set(Pe.JS_DEFAULT_CONSUMER_LIMITS,"2.10.0"),this.set(Pe.JS_BATCH_DIRECT_GET,"2.11.0"),this.disabled.forEach(r=>{this.features.delete(r)})}set(t,r){this.features.set(t,{min:r,ok:td(this.server,Ii(r))>=0})}get(t){return this.features.get(t)||{min:"unknown",ok:!1}}supports(t){var r;return((r=this.get(t))==null?void 0:r.ok)||!1}require(t){return typeof t=="string"&&(t=Ii(t)),td(this.server,t)>=0}}class Jc extends go{constructor(t,r){super(t,r)}async add(t,r,s=Xc.Create){if(Pt(t),r.deliver_group&&r.flow_control)throw new Error("jetstream flow control is not supported with queue groups");if(r.deliver_group&&r.idle_heartbeat)throw new Error("jetstream idle heartbeat is not supported with queue groups");const l={};l.config=r,l.stream_name=t,l.action=s,l.config.durable_name&&Us(l.config.durable_name);const c=this.nc;let{min:d,ok:p}=c.features.get(Pe.JS_NEW_CONSUMER_CREATE_API);const g=r.name===""?void 0:r.name;if(g&&!p)throw new Error(`consumer 'name' requires server ${d}`);if(g)try{au("name",g)}catch(v){const _=v.message,w=_.indexOf("cannot contain");throw w!==-1?new Error(`consumer 'name' ${_.substring(w)}`):v}let f,m="";if(Array.isArray(r.filter_subjects)){const{min:v,ok:_}=c.features.get(Pe.JS_MULTIPLE_CONSUMER_FILTER);if(!_)throw new Error(`consumer 'filter_subjects' requires server ${v}`);p=!1}if(r.metadata){const{min:v,ok:_}=c.features.get(Pe.JS_STREAM_CONSUMER_METADATA);if(!_)throw new Error(`consumer 'metadata' requires server ${v}`)}if(p&&(m=r.name??r.durable_name??""),m!==""){let v=r.filter_subject??void 0;v===">"&&(v=void 0),f=v!==void 0?`${this.prefix}.CONSUMER.CREATE.${t}.${m}.${v}`:`${this.prefix}.CONSUMER.CREATE.${t}.${m}`}else f=r.durable_name?`${this.prefix}.CONSUMER.DURABLE.CREATE.${t}.${r.durable_name}`:`${this.prefix}.CONSUMER.CREATE.${t}`;return await this._request(f,l)}async update(t,r,s){const l=await this.info(t,r),c=s;return this.add(t,Object.assign(l.config,c),Xc.Update)}async info(t,r){return Pt(t),Us(r),await this._request(`${this.prefix}.CONSUMER.INFO.${t}.${r}`)}async delete(t,r){return Pt(t),Us(r),(await this._request(`${this.prefix}.CONSUMER.DELETE.${t}.${r}`)).success}list(t){Pt(t);const r=l=>l.consumers,s=`${this.prefix}.CONSUMER.LIST.${t}`;return new ro(s,r,this)}pause(t,r,s){const l=`${this.prefix}.CONSUMER.PAUSE.${t}.${r}`,c={pause_until:s.toISOString()};return this._request(l,c)}resume(t,r){return this.pause(t,r,new Date(0))}}function ks(i,t,r=!1){if(r===!0&&!i)throw me.errorForCode(ce.ApiError,new Error(`${t} is not a function`));if(i&&typeof i!="function")throw me.errorForCode(ce.ApiError,new Error(`${t} is not a function`))}class uS extends jt{constructor(r,s,l){super();A(this,"sub");A(this,"adapter");A(this,"subIterDone");ks(l.adapter,"adapter",!0),this.adapter=l.adapter,l.callback&&ks(l.callback,"callback"),this.noIterator=typeof l.callback=="function",l.ingestionFilterFn&&(ks(l.ingestionFilterFn,"ingestionFilterFn"),this.ingestionFilterFn=l.ingestionFilterFn),l.protocolFilterFn&&(ks(l.protocolFilterFn,"protocolFilterFn"),this.protocolFilterFn=l.protocolFilterFn),l.dispatchedFn&&(ks(l.dispatchedFn,"dispatchedFn"),this.dispatchedFn=l.dispatchedFn),l.cleanupFn&&ks(l.cleanupFn,"cleanupFn");let c=(m,b)=>{this.callback(m,b)};if(l.callback){const m=l.callback;c=(b,v)=>{const[_,w]=this.adapter(b,v);if(_){m(_,null);return}const{ingest:S}=this.ingestionFilterFn?this.ingestionFilterFn(w,this):{ingest:!0};S&&(!this.protocolFilterFn||this.protocolFilterFn(w))&&(m(_,w),this.dispatchedFn&&w&&this.dispatchedFn(w))}}const{max:d,queue:p,timeout:g}=l,f={queue:p,timeout:g,callback:c};d&&d>0&&(f.max=d),this.sub=r.subscribe(s,f),l.cleanupFn&&(this.sub.cleanupFn=l.cleanupFn),this.noIterator||this.iterClosed.then(()=>{this.unsubscribe()}),this.subIterDone=it(),Promise.all([this.sub.closed,this.iterClosed]).then(()=>{this.subIterDone.resolve()}).catch(()=>{this.subIterDone.resolve()}),(async m=>{await m.closed,this.stop()})(this.sub).then().catch()}unsubscribe(r){this.sub.unsubscribe(r)}drain(){return this.sub.drain()}isDraining(){return this.sub.isDraining()}isClosed(){return this.sub.isClosed()}callback(r,s){this.sub.cancelTimeout();const[l,c]=this.adapter(r,s);l&&this.stop(l),c&&this.push(c)}getSubject(){return this.sub.getSubject()}getReceived(){return this.sub.getReceived()}getProcessed(){return this.sub.getProcessed()}getPending(){return this.sub.getPending()}getID(){return this.sub.getID()}getMax(){return this.sub.getMax()}get closed(){return this.sub.closed}}let fn;function fS(i){fn=i}function hb(){return fn!==void 0&&fn.defaultPort!==void 0?fn.defaultPort:4222}function Ch(){return fn!==void 0&&fn.urlParseFn?fn.urlParseFn:void 0}function hS(){if(!fn||typeof fn.factory!="function")throw new Error("transport fn is not set");return fn.factory()}function nd(){return fn!==void 0&&fn.dnsResolveFn?fn.dnsResolveFn:void 0}const Uc=`\r
|
|
37
|
+
`,Qc=Vs.fromAscii(Uc),dS=new Uint8Array(Qc)[0],mS=new Uint8Array(Qc)[1];function pS(i){for(let t=0;t<i.length;t++){const r=t+1;if(i.byteLength>r&&i[t]===dS&&i[r]===mS)return r+1}return 0}function yS(i){const t=pS(i);if(t>0){const s=new Uint8Array(i).slice(0,t);return un.decode(s)}return""}const gS=4,db=48,bS=65,vS=97;function xS(i,t,r,s){const l=new Uint8Array(16);return[0,0,0,0,0,0,0,0,0,0,255,255].forEach((d,p)=>{l[p]=d}),l[12]=i,l[13]=t,l[14]=r,l[15]=s,l}function rd(i){return _S(i)!==void 0}function _S(i){for(let t=0;t<i.length;t++)switch(i[t]){case".":return mb(i);case":":return wS(i)}}function mb(i){const t=new Uint8Array(4);for(let r=0;r<4;r++){if(i.length===0)return;if(r>0){if(i[0]!==".")return;i=i.substring(1)}const{n:s,c:l,ok:c}=SS(i);if(!c||s>255)return;i=i.substring(l),t[r]=s}return xS(t[0],t[1],t[2],t[3])}function wS(i){const t=new Uint8Array(16);let r=-1;if(i.length>=2&&i[0]===":"&&i[1]===":"&&(r=0,i=i.substring(2),i.length===0))return t;let s=0;for(;s<16;){const{n:l,c,ok:d}=ES(i);if(!d||l>65535)return;if(c<i.length&&i[c]==="."){if(r<0&&s!=12||s+4>16)return;const p=mb(i);if(p===void 0)return;t[s]=p[12],t[s+1]=p[13],t[s+2]=p[14],t[s+3]=p[15],i="",s+=gS;break}if(t[s]=l>>8,t[s+1]=l,s+=2,i=i.substring(c),i.length===0)break;if(i[0]!==":"||i.length==1)return;if(i=i.substring(1),i[0]===":"){if(r>=0)return;if(r=s,i=i.substring(1),i.length===0)break}}if(i.length===0){if(s<16){if(r<0)return;const l=16-s;for(let c=s-1;c>=r;c--)t[c+l]=t[c];for(let c=r+l-1;c>=r;c--)t[c]=0}else if(r>=0)return;return t}}function SS(i){let t=0,r=0;for(t=0;t<i.length&&48<=i.charCodeAt(t)&&i.charCodeAt(t)<=57;t++)if(r=r*10+(i.charCodeAt(t)-db),r>=16777215)return{n:16777215,c:t,ok:!1};return t===0?{n:0,c:0,ok:!1}:{n:r,c:t,ok:!0}}function ES(i){let t=0,r=0;for(r=0;r<i.length;r++){if(48<=i.charCodeAt(r)&&i.charCodeAt(r)<=57)t*=16,t+=i.charCodeAt(r)-db;else if(97<=i.charCodeAt(r)&&i.charCodeAt(r)<=102)t*=16,t+=i.charCodeAt(r)-vS+10;else if(65<=i.charCodeAt(r)&&i.charCodeAt(r)<=70)t*=16,t+=i.charCodeAt(r)-bS+10;else break;if(t>=16777215)return{n:0,c:r,ok:!1}}return r===0?{n:0,c:r,ok:!1}:{n:t,c:r,ok:!0}}function OS(i){return i.indexOf("[")!==-1||i.indexOf("::")!==-1?!1:i.indexOf(".")!==-1||i.split(":").length<=2}function id(i){return!OS(i)}function AS(i){const t="::FFFF:",r=i.toUpperCase().indexOf(t);if(r!==-1&&i.indexOf(".")!==-1){let s=i.substring(r+t.length);return s=s.replace("[",""),s.replace("]","")}return i}function jS(i){i=i.trim(),i.match(/^(.*:\/\/)(.*)/m)&&(i=i.replace(/^(.*:\/\/)(.*)/gm,"$2")),i=AS(i),id(i)&&i.indexOf("[")===-1&&(i=`[${i}]`);const t=id(i)?i.match(/(]:)(\d+)/):i.match(/(:)(\d+)/),r=t&&t.length===3&&t[1]&&t[2]?parseInt(t[2]):4222,s=r===80?"https":"http",l=new URL(`${s}://${i}`);l.port=`${r}`;let c=l.hostname;return c.charAt(0)==="["&&(c=c.substring(1,c.length-1)),{listen:l.host,hostname:c,port:r}}class oo{constructor(t,r=!1){A(this,"src");A(this,"listen");A(this,"hostname");A(this,"port");A(this,"didConnect");A(this,"reconnects");A(this,"lastConnect");A(this,"gossiped");A(this,"tlsName");A(this,"resolves");this.src=t,this.tlsName="";const s=jS(t);this.listen=s.listen,this.hostname=s.hostname,this.port=s.port,this.didConnect=!1,this.reconnects=0,this.lastConnect=0,this.gossiped=r}toString(){return this.listen}async resolve(t){if(!t.fn||t.resolve===!1)return[this];const r=[];if(rd(this.hostname))return[this];{const s=await t.fn(this.hostname);t.debug&&console.log(`resolve ${this.hostname} = ${s.join(",")}`);for(const l of s){const c=this.port===80?"https":"http",d=new URL(`${c}://${id(l)?"["+l+"]":l}`);d.port=`${this.port}`;const p=new oo(d.host,!1);p.tlsName=this.hostname,r.push(p)}}return t.randomize&&ob(r),this.resolves=r,r}}class TS{constructor(t=[],r={}){A(this,"firstSelect");A(this,"servers");A(this,"currentServer");A(this,"tlsName");A(this,"randomize");this.firstSelect=!0,this.servers=[],this.tlsName="",this.randomize=r.randomize||!1;const s=Ch();t&&(t.forEach(l=>{l=s?s(l):l,this.servers.push(new oo(l))}),this.randomize&&(this.servers=ob(this.servers))),this.servers.length===0&&this.addServer(`${Kh}:${hb()}`,!1),this.currentServer=this.servers[0]}clear(){this.servers.length=0}updateTLSName(){const t=this.getCurrentServer();rd(t.hostname)||(this.tlsName=t.hostname,this.servers.forEach(r=>{r.gossiped&&(r.tlsName=this.tlsName)}))}getCurrentServer(){return this.currentServer}addServer(t,r=!1){const s=Ch();t=s?s(t):t;const l=new oo(t,r);rd(l.hostname)&&(l.tlsName=this.tlsName),this.servers.push(l)}selectServer(){if(this.firstSelect)return this.firstSelect=!1,this.currentServer;const t=this.servers.shift();return t&&(this.servers.push(t),this.currentServer=t),t}removeCurrentServer(){this.removeServer(this.currentServer)}removeServer(t){if(t){const r=this.servers.indexOf(t);this.servers.splice(r,1)}}length(){return this.servers.length}next(){return this.servers.length?this.servers[0]:void 0}getServers(){return this.servers}update(t,r){const s=[];let l=[];const c=Ch(),d=new Map;t.connect_urls&&t.connect_urls.length>0&&t.connect_urls.forEach(g=>{g=c?c(g,r):g;const f=new oo(g,!0);d.set(g,f)});const p=[];return this.servers.forEach((g,f)=>{const m=g.listen;g.gossiped&&this.currentServer.listen!==m&&d.get(m)===void 0&&p.push(f),d.delete(m)}),p.reverse(),p.forEach(g=>{const f=this.servers.splice(g,1);l=l.concat(f[0].listen)}),d.forEach((g,f)=>{this.servers.push(g),s.push(f)}),{added:s,deleted:l}}}class NS{constructor(){A(this,"baseInbox");A(this,"reqs");this.reqs=new Map}size(){return this.reqs.size}init(t){return this.baseInbox=`${wr(t)}.`,this.baseInbox}add(t){isNaN(t.received)||(t.received=0),this.reqs.set(t.token,t)}get(t){return this.reqs.get(t)}cancel(t){this.reqs.delete(t.token)}getToken(t){const r=t.subject||"";return r.indexOf(this.baseInbox)===0?r.substring(this.baseInbox.length):null}all(){return Array.from(this.reqs.values())}handleError(t,r){if(r&&r.permissionContext){if(t)return this.all().forEach(l=>{l.resolver(r,{})}),!0;const s=r.permissionContext;if(s.operation==="publish"){const l=this.all().find(c=>c.requestSubject===s.subject);if(l)return l.resolver(r,{}),!0}}return!1}dispatcher(){return(t,r)=>{const s=this.getToken(r);if(s){const l=this.get(s);l&&(t===null&&r.headers&&(t=lb(r)),l.resolver(t,r))}}}close(){const t=me.errorForCode(ce.Timeout);this.reqs.forEach(r=>{r.resolver(t,{})})}}class kS{constructor(t,r,s){A(this,"ph");A(this,"interval");A(this,"maxOut");A(this,"timer");A(this,"pendings");this.ph=t,this.interval=r,this.maxOut=s,this.pendings=[]}start(){this.cancel(),this._schedule()}cancel(t){this.timer&&(clearTimeout(this.timer),this.timer=void 0),this._reset(),t&&this.ph.disconnect()}_schedule(){this.timer=setTimeout(()=>{if(this.ph.dispatchStatus({type:zs.PingTimer,data:`${this.pendings.length+1}`}),this.pendings.length===this.maxOut){this.cancel(!0);return}const t=it();this.ph.flush(t).then(()=>{this._reset()}).catch(()=>{this.cancel()}),this.pendings.push(t),this._schedule()},this.interval)}_reset(){this.pendings=this.pendings.filter(t=>(t.resolve(),!1))}}class CS extends Error{constructor(t){super(t),this.name="AssertionError"}}function MS(i,t="Assertion failed."){if(!i)throw new CS(t)}const ig=32*1024,Mh=2**32-2;function Vl(i,t,r=0){const s=t.byteLength-r;return i.byteLength>s&&(i=i.subarray(0,s)),t.set(i,r),i.byteLength}class Rh{constructor(t){A(this,"_buf");A(this,"_off");if(this._off=0,t==null){this._buf=new Uint8Array(0);return}this._buf=new Uint8Array(t)}bytes(t={copy:!0}){return t.copy===!1?this._buf.subarray(this._off):this._buf.slice(this._off)}empty(){return this._buf.byteLength<=this._off}get length(){return this._buf.byteLength-this._off}get capacity(){return this._buf.buffer.byteLength}truncate(t){if(t===0){this.reset();return}if(t<0||t>this.length)throw Error("bytes.Buffer: truncation out of range");this._reslice(this._off+t)}reset(){this._reslice(0),this._off=0}_tryGrowByReslice(t){const r=this._buf.byteLength;return t<=this.capacity-r?(this._reslice(r+t),r):-1}_reslice(t){MS(t<=this._buf.buffer.byteLength),this._buf=new Uint8Array(this._buf.buffer,0,t)}readByte(){const t=new Uint8Array(1);return this.read(t)?t[0]:null}read(t){if(this.empty())return this.reset(),t.byteLength===0?0:null;const r=Vl(this._buf.subarray(this._off),t);return this._off+=r,r}writeByte(t){return this.write(Uint8Array.of(t))}writeString(t){return this.write(Hi.encode(t))}write(t){const r=this._grow(t.byteLength);return Vl(t,this._buf,r)}_grow(t){const r=this.length;r===0&&this._off!==0&&this.reset();const s=this._tryGrowByReslice(t);if(s>=0)return s;const l=this.capacity;if(t<=Math.floor(l/2)-r)Vl(this._buf.subarray(this._off),this._buf);else{if(l+t>Mh)throw new Error("The buffer cannot be grown beyond the maximum size.");{const c=new Uint8Array(Math.min(2*l+t,Mh));Vl(this._buf.subarray(this._off),c),this._buf=c}}return this._off=0,this._reslice(Math.min(r+t,Mh)),r}grow(t){if(t<0)throw Error("Buffer._grow: negative count");const r=this._grow(t);this._reslice(r)}readFrom(t){let r=0;const s=new Uint8Array(ig);for(;;){const l=this.capacity-this.length<ig,c=l?s:new Uint8Array(this._buf.buffer,this.length),d=t.read(c);if(d===null)return r;l?this.write(c.subarray(0,d)):this._reslice(this.length+d),r+=d}}}var $t;(function(i){i[i.OK=0]="OK",i[i.ERR=1]="ERR",i[i.MSG=2]="MSG",i[i.INFO=3]="INFO",i[i.PING=4]="PING",i[i.PONG=5]="PONG"})($t||($t={}));function sg(){const i={};return i.sid=-1,i.hdr=-1,i.size=-1,i}const RS=48;class ag{constructor(t){A(this,"dispatcher");A(this,"state");A(this,"as");A(this,"drop");A(this,"hdr");A(this,"ma");A(this,"argBuf");A(this,"msgBuf");this.dispatcher=t,this.state=ue.OP_START,this.as=0,this.drop=0,this.hdr=0}parse(t){let r;for(r=0;r<t.length;r++){const s=t[r];switch(this.state){case ue.OP_START:switch(s){case fe.M:case fe.m:this.state=ue.OP_M,this.hdr=-1,this.ma=sg();break;case fe.H:case fe.h:this.state=ue.OP_H,this.hdr=0,this.ma=sg();break;case fe.P:case fe.p:this.state=ue.OP_P;break;case fe.PLUS:this.state=ue.OP_PLUS;break;case fe.MINUS:this.state=ue.OP_MINUS;break;case fe.I:case fe.i:this.state=ue.OP_I;break;default:throw this.fail(t.subarray(r))}break;case ue.OP_H:switch(s){case fe.M:case fe.m:this.state=ue.OP_M;break;default:throw this.fail(t.subarray(r))}break;case ue.OP_M:switch(s){case fe.S:case fe.s:this.state=ue.OP_MS;break;default:throw this.fail(t.subarray(r))}break;case ue.OP_MS:switch(s){case fe.G:case fe.g:this.state=ue.OP_MSG;break;default:throw this.fail(t.subarray(r))}break;case ue.OP_MSG:switch(s){case fe.SPACE:case fe.TAB:this.state=ue.OP_MSG_SPC;break;default:throw this.fail(t.subarray(r))}break;case ue.OP_MSG_SPC:switch(s){case fe.SPACE:case fe.TAB:continue;default:this.state=ue.MSG_ARG,this.as=r}break;case ue.MSG_ARG:switch(s){case fe.CR:this.drop=1;break;case fe.NL:{const l=this.argBuf?this.argBuf.bytes():t.subarray(this.as,r-this.drop);this.processMsgArgs(l),this.drop=0,this.as=r+1,this.state=ue.MSG_PAYLOAD,r=this.as+this.ma.size-1;break}default:this.argBuf&&this.argBuf.writeByte(s)}break;case ue.MSG_PAYLOAD:if(this.msgBuf)if(this.msgBuf.length>=this.ma.size){const l=this.msgBuf.bytes({copy:!1});this.dispatcher.push({kind:$t.MSG,msg:this.ma,data:l}),this.argBuf=void 0,this.msgBuf=void 0,this.state=ue.MSG_END}else{let l=this.ma.size-this.msgBuf.length;const c=t.length-r;c<l&&(l=c),l>0?(this.msgBuf.write(t.subarray(r,r+l)),r=r+l-1):this.msgBuf.writeByte(s)}else r-this.as>=this.ma.size&&(this.dispatcher.push({kind:$t.MSG,msg:this.ma,data:t.subarray(this.as,r)}),this.argBuf=void 0,this.msgBuf=void 0,this.state=ue.MSG_END);break;case ue.MSG_END:switch(s){case fe.NL:this.drop=0,this.as=r+1,this.state=ue.OP_START;break;default:continue}break;case ue.OP_PLUS:switch(s){case fe.O:case fe.o:this.state=ue.OP_PLUS_O;break;default:throw this.fail(t.subarray(r))}break;case ue.OP_PLUS_O:switch(s){case fe.K:case fe.k:this.state=ue.OP_PLUS_OK;break;default:throw this.fail(t.subarray(r))}break;case ue.OP_PLUS_OK:switch(s){case fe.NL:this.dispatcher.push({kind:$t.OK}),this.drop=0,this.state=ue.OP_START;break}break;case ue.OP_MINUS:switch(s){case fe.E:case fe.e:this.state=ue.OP_MINUS_E;break;default:throw this.fail(t.subarray(r))}break;case ue.OP_MINUS_E:switch(s){case fe.R:case fe.r:this.state=ue.OP_MINUS_ER;break;default:throw this.fail(t.subarray(r))}break;case ue.OP_MINUS_ER:switch(s){case fe.R:case fe.r:this.state=ue.OP_MINUS_ERR;break;default:throw this.fail(t.subarray(r))}break;case ue.OP_MINUS_ERR:switch(s){case fe.SPACE:case fe.TAB:this.state=ue.OP_MINUS_ERR_SPC;break;default:throw this.fail(t.subarray(r))}break;case ue.OP_MINUS_ERR_SPC:switch(s){case fe.SPACE:case fe.TAB:continue;default:this.state=ue.MINUS_ERR_ARG,this.as=r}break;case ue.MINUS_ERR_ARG:switch(s){case fe.CR:this.drop=1;break;case fe.NL:{let l;this.argBuf?(l=this.argBuf.bytes(),this.argBuf=void 0):l=t.subarray(this.as,r-this.drop),this.dispatcher.push({kind:$t.ERR,data:l}),this.drop=0,this.as=r+1,this.state=ue.OP_START;break}default:this.argBuf&&this.argBuf.write(Uint8Array.of(s))}break;case ue.OP_P:switch(s){case fe.I:case fe.i:this.state=ue.OP_PI;break;case fe.O:case fe.o:this.state=ue.OP_PO;break;default:throw this.fail(t.subarray(r))}break;case ue.OP_PO:switch(s){case fe.N:case fe.n:this.state=ue.OP_PON;break;default:throw this.fail(t.subarray(r))}break;case ue.OP_PON:switch(s){case fe.G:case fe.g:this.state=ue.OP_PONG;break;default:throw this.fail(t.subarray(r))}break;case ue.OP_PONG:switch(s){case fe.NL:this.dispatcher.push({kind:$t.PONG}),this.drop=0,this.state=ue.OP_START;break}break;case ue.OP_PI:switch(s){case fe.N:case fe.n:this.state=ue.OP_PIN;break;default:throw this.fail(t.subarray(r))}break;case ue.OP_PIN:switch(s){case fe.G:case fe.g:this.state=ue.OP_PING;break;default:throw this.fail(t.subarray(r))}break;case ue.OP_PING:switch(s){case fe.NL:this.dispatcher.push({kind:$t.PING}),this.drop=0,this.state=ue.OP_START;break}break;case ue.OP_I:switch(s){case fe.N:case fe.n:this.state=ue.OP_IN;break;default:throw this.fail(t.subarray(r))}break;case ue.OP_IN:switch(s){case fe.F:case fe.f:this.state=ue.OP_INF;break;default:throw this.fail(t.subarray(r))}break;case ue.OP_INF:switch(s){case fe.O:case fe.o:this.state=ue.OP_INFO;break;default:throw this.fail(t.subarray(r))}break;case ue.OP_INFO:switch(s){case fe.SPACE:case fe.TAB:this.state=ue.OP_INFO_SPC;break;default:throw this.fail(t.subarray(r))}break;case ue.OP_INFO_SPC:switch(s){case fe.SPACE:case fe.TAB:continue;default:this.state=ue.INFO_ARG,this.as=r}break;case ue.INFO_ARG:switch(s){case fe.CR:this.drop=1;break;case fe.NL:{let l;this.argBuf?(l=this.argBuf.bytes(),this.argBuf=void 0):l=t.subarray(this.as,r-this.drop),this.dispatcher.push({kind:$t.INFO,data:l}),this.drop=0,this.as=r+1,this.state=ue.OP_START;break}default:this.argBuf&&this.argBuf.writeByte(s)}break;default:throw this.fail(t.subarray(r))}}(this.state===ue.MSG_ARG||this.state===ue.MINUS_ERR_ARG||this.state===ue.INFO_ARG)&&!this.argBuf&&(this.argBuf=new Rh(t.subarray(this.as,r-this.drop))),this.state===ue.MSG_PAYLOAD&&!this.msgBuf&&(this.argBuf||this.cloneMsgArg(),this.msgBuf=new Rh(t.subarray(this.as)))}cloneMsgArg(){const t=this.ma.subject.length,r=this.ma.reply?this.ma.reply.length:0,s=new Uint8Array(t+r);s.set(this.ma.subject),this.ma.reply&&s.set(this.ma.reply,t),this.argBuf=new Rh(s),this.ma.subject=s.subarray(0,t),this.ma.reply&&(this.ma.reply=s.subarray(t))}processMsgArgs(t){if(this.hdr>=0)return this.processHeaderMsgArgs(t);const r=[];let s=-1;for(let l=0;l<t.length;l++)switch(t[l]){case fe.SPACE:case fe.TAB:case fe.CR:case fe.NL:s>=0&&(r.push(t.subarray(s,l)),s=-1);break;default:s<0&&(s=l)}switch(s>=0&&r.push(t.subarray(s)),r.length){case 3:this.ma.subject=r[0],this.ma.sid=this.protoParseInt(r[1]),this.ma.reply=void 0,this.ma.size=this.protoParseInt(r[2]);break;case 4:this.ma.subject=r[0],this.ma.sid=this.protoParseInt(r[1]),this.ma.reply=r[2],this.ma.size=this.protoParseInt(r[3]);break;default:throw this.fail(t,"processMsgArgs Parse Error")}if(this.ma.sid<0)throw this.fail(t,"processMsgArgs Bad or Missing Sid Error");if(this.ma.size<0)throw this.fail(t,"processMsgArgs Bad or Missing Size Error")}fail(t,r=""){return r?r=`${r} [${this.state}]`:r=`parse error [${this.state}]`,new Error(`${r}: ${un.decode(t)}`)}processHeaderMsgArgs(t){const r=[];let s=-1;for(let l=0;l<t.length;l++)switch(t[l]){case fe.SPACE:case fe.TAB:case fe.CR:case fe.NL:s>=0&&(r.push(t.subarray(s,l)),s=-1);break;default:s<0&&(s=l)}switch(s>=0&&r.push(t.subarray(s)),r.length){case 4:this.ma.subject=r[0],this.ma.sid=this.protoParseInt(r[1]),this.ma.reply=void 0,this.ma.hdr=this.protoParseInt(r[2]),this.ma.size=this.protoParseInt(r[3]);break;case 5:this.ma.subject=r[0],this.ma.sid=this.protoParseInt(r[1]),this.ma.reply=r[2],this.ma.hdr=this.protoParseInt(r[3]),this.ma.size=this.protoParseInt(r[4]);break;default:throw this.fail(t,"processHeaderMsgArgs Parse Error")}if(this.ma.sid<0)throw this.fail(t,"processHeaderMsgArgs Bad or Missing Sid Error");if(this.ma.hdr<0||this.ma.hdr>this.ma.size)throw this.fail(t,"processHeaderMsgArgs Bad or Missing Header Size Error");if(this.ma.size<0)throw this.fail(t,"processHeaderMsgArgs Bad or Missing Size Error")}protoParseInt(t){if(t.length===0)return-1;let r=0;for(let s=0;s<t.length;s++){if(t[s]<48||t[s]>57)return-1;r=r*10+(t[s]-RS)}return r}}var ue;(function(i){i[i.OP_START=0]="OP_START",i[i.OP_PLUS=1]="OP_PLUS",i[i.OP_PLUS_O=2]="OP_PLUS_O",i[i.OP_PLUS_OK=3]="OP_PLUS_OK",i[i.OP_MINUS=4]="OP_MINUS",i[i.OP_MINUS_E=5]="OP_MINUS_E",i[i.OP_MINUS_ER=6]="OP_MINUS_ER",i[i.OP_MINUS_ERR=7]="OP_MINUS_ERR",i[i.OP_MINUS_ERR_SPC=8]="OP_MINUS_ERR_SPC",i[i.MINUS_ERR_ARG=9]="MINUS_ERR_ARG",i[i.OP_M=10]="OP_M",i[i.OP_MS=11]="OP_MS",i[i.OP_MSG=12]="OP_MSG",i[i.OP_MSG_SPC=13]="OP_MSG_SPC",i[i.MSG_ARG=14]="MSG_ARG",i[i.MSG_PAYLOAD=15]="MSG_PAYLOAD",i[i.MSG_END=16]="MSG_END",i[i.OP_H=17]="OP_H",i[i.OP_P=18]="OP_P",i[i.OP_PI=19]="OP_PI",i[i.OP_PIN=20]="OP_PIN",i[i.OP_PING=21]="OP_PING",i[i.OP_PO=22]="OP_PO",i[i.OP_PON=23]="OP_PON",i[i.OP_PONG=24]="OP_PONG",i[i.OP_I=25]="OP_I",i[i.OP_IN=26]="OP_IN",i[i.OP_INF=27]="OP_INF",i[i.OP_INFO=28]="OP_INFO",i[i.OP_INFO_SPC=29]="OP_INFO_SPC",i[i.INFO_ARG=30]="INFO_ARG"})(ue||(ue={}));var fe;(function(i){i[i.CR=13]="CR",i[i.E=69]="E",i[i.e=101]="e",i[i.F=70]="F",i[i.f=102]="f",i[i.G=71]="G",i[i.g=103]="g",i[i.H=72]="H",i[i.h=104]="h",i[i.I=73]="I",i[i.i=105]="i",i[i.K=75]="K",i[i.k=107]="k",i[i.M=77]="M",i[i.m=109]="m",i[i.MINUS=45]="MINUS",i[i.N=78]="N",i[i.n=110]="n",i[i.NL=10]="NL",i[i.O=79]="O",i[i.o=111]="o",i[i.P=80]="P",i[i.p=112]="p",i[i.PLUS=43]="PLUS",i[i.R=82]="R",i[i.r=114]="r",i[i.S=83]="S",i[i.s=115]="s",i[i.SPACE=32]="SPACE",i[i.TAB=9]="TAB"})(fe||(fe={}));(function(i){var t=function(O,N){this.hi=O|0,this.lo=N|0},r=function(O){var N,j=new Float64Array(16);if(O)for(N=0;N<O.length;N++)j[N]=O[N];return j},s=function(){throw new Error("no PRNG")},l=new Uint8Array(16),c=new Uint8Array(32);c[0]=9;var d=r(),p=r([1]),g=r([56129,1]),f=r([30883,4953,19914,30187,55467,16705,2637,112,59544,30585,16505,36039,65139,11119,27886,20995]),m=r([61785,9906,39828,60374,45398,33411,5274,224,53552,61171,33010,6542,64743,22239,55772,9222]),b=r([54554,36645,11616,51542,42930,38181,51040,26924,56412,64982,57905,49316,21502,52590,14035,8553]),v=r([26200,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214]),_=r([41136,18958,6951,50414,58488,44335,6150,12099,55207,15867,153,11085,57099,20417,9344,11139]);function w(O,N){return O<<N|O>>>32-N}function S(O,N){var j=O[N+3]&255;return j=j<<8|O[N+2]&255,j=j<<8|O[N+1]&255,j<<8|O[N+0]&255}function C(O,N){var j=O[N]<<24|O[N+1]<<16|O[N+2]<<8|O[N+3],k=O[N+4]<<24|O[N+5]<<16|O[N+6]<<8|O[N+7];return new t(j,k)}function L(O,N,j){var k;for(k=0;k<4;k++)O[N+k]=j&255,j>>>=8}function z(O,N,j){O[N]=j.hi>>24&255,O[N+1]=j.hi>>16&255,O[N+2]=j.hi>>8&255,O[N+3]=j.hi&255,O[N+4]=j.lo>>24&255,O[N+5]=j.lo>>16&255,O[N+6]=j.lo>>8&255,O[N+7]=j.lo&255}function se(O,N,j,k,D){var $,ne=0;for($=0;$<D;$++)ne|=O[N+$]^j[k+$];return(1&ne-1>>>8)-1}function oe(O,N,j,k){return se(O,N,j,k,16)}function M(O,N,j,k){return se(O,N,j,k,32)}function B(O,N,j,k,D){var $=new Uint32Array(16),ne=new Uint32Array(16),ie=new Uint32Array(16),V=new Uint32Array(4),ee,pe,Re;for(ee=0;ee<4;ee++)ne[5*ee]=S(k,4*ee),ne[1+ee]=S(j,4*ee),ne[6+ee]=S(N,4*ee),ne[11+ee]=S(j,16+4*ee);for(ee=0;ee<16;ee++)ie[ee]=ne[ee];for(ee=0;ee<20;ee++){for(pe=0;pe<4;pe++){for(Re=0;Re<4;Re++)V[Re]=ne[(5*pe+4*Re)%16];for(V[1]^=w(V[0]+V[3]|0,7),V[2]^=w(V[1]+V[0]|0,9),V[3]^=w(V[2]+V[1]|0,13),V[0]^=w(V[3]+V[2]|0,18),Re=0;Re<4;Re++)$[4*pe+(pe+Re)%4]=V[Re]}for(Re=0;Re<16;Re++)ne[Re]=$[Re]}if(D){for(ee=0;ee<16;ee++)ne[ee]=ne[ee]+ie[ee]|0;for(ee=0;ee<4;ee++)ne[5*ee]=ne[5*ee]-S(k,4*ee)|0,ne[6+ee]=ne[6+ee]-S(N,4*ee)|0;for(ee=0;ee<4;ee++)L(O,4*ee,ne[5*ee]),L(O,16+4*ee,ne[6+ee])}else for(ee=0;ee<16;ee++)L(O,4*ee,ne[ee]+ie[ee]|0)}function te(O,N,j,k){return B(O,N,j,k,!1),0}function K(O,N,j,k){return B(O,N,j,k,!0),0}var P=new Uint8Array([101,120,112,97,110,100,32,51,50,45,98,121,116,101,32,107]);function Y(O,N,j,k,D,$,ne){var ie=new Uint8Array(16),V=new Uint8Array(64),ee,pe;if(!D)return 0;for(pe=0;pe<16;pe++)ie[pe]=0;for(pe=0;pe<8;pe++)ie[pe]=$[pe];for(;D>=64;){for(te(V,ie,ne,P),pe=0;pe<64;pe++)O[N+pe]=(j?j[k+pe]:0)^V[pe];for(ee=1,pe=8;pe<16;pe++)ee=ee+(ie[pe]&255)|0,ie[pe]=ee&255,ee>>>=8;D-=64,N+=64,j&&(k+=64)}if(D>0)for(te(V,ie,ne,P),pe=0;pe<D;pe++)O[N+pe]=(j?j[k+pe]:0)^V[pe];return 0}function W(O,N,j,k,D){return Y(O,N,null,0,j,k,D)}function X(O,N,j,k,D){var $=new Uint8Array(32);return K($,k,D,P),W(O,N,j,k.subarray(16),$)}function he(O,N,j,k,D,$,ne){var ie=new Uint8Array(32);return K(ie,$,ne,P),Y(O,N,j,k,D,$.subarray(16),ie)}function _e(O,N){var j,k=0;for(j=0;j<17;j++)k=k+(O[j]+N[j]|0)|0,O[j]=k&255,k>>>=8}var Te=new Uint32Array([5,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,252]);function F(O,N,j,k,D,$){var ne,ie,V,ee,pe=new Uint32Array(17),Re=new Uint32Array(17),Ze=new Uint32Array(17),Lt=new Uint32Array(17),Dn=new Uint32Array(17);for(V=0;V<17;V++)Re[V]=Ze[V]=0;for(V=0;V<16;V++)Re[V]=$[V];for(Re[3]&=15,Re[4]&=252,Re[7]&=15,Re[8]&=252,Re[11]&=15,Re[12]&=252,Re[15]&=15;D>0;){for(V=0;V<17;V++)Lt[V]=0;for(V=0;V<16&&V<D;++V)Lt[V]=j[k+V];for(Lt[V]=1,k+=V,D-=V,_e(Ze,Lt),ie=0;ie<17;ie++)for(pe[ie]=0,V=0;V<17;V++)pe[ie]=pe[ie]+Ze[V]*(V<=ie?Re[ie-V]:320*Re[ie+17-V]|0)|0|0;for(ie=0;ie<17;ie++)Ze[ie]=pe[ie];for(ee=0,V=0;V<16;V++)ee=ee+Ze[V]|0,Ze[V]=ee&255,ee>>>=8;for(ee=ee+Ze[16]|0,Ze[16]=ee&3,ee=5*(ee>>>2)|0,V=0;V<16;V++)ee=ee+Ze[V]|0,Ze[V]=ee&255,ee>>>=8;ee=ee+Ze[16]|0,Ze[16]=ee}for(V=0;V<17;V++)Dn[V]=Ze[V];for(_e(Ze,Te),ne=-(Ze[16]>>>7)|0,V=0;V<17;V++)Ze[V]^=ne&(Dn[V]^Ze[V]);for(V=0;V<16;V++)Lt[V]=$[V+16];for(Lt[16]=0,_e(Ze,Lt),V=0;V<16;V++)O[N+V]=Ze[V];return 0}function ae(O,N,j,k,D,$){var ne=new Uint8Array(16);return F(ne,0,j,k,D,$),oe(O,N,ne,0)}function de(O,N,j,k,D){var $;if(j<32)return-1;for(he(O,0,N,0,j,k,D),F(O,16,O,32,j-32,O),$=0;$<16;$++)O[$]=0;return 0}function Oe(O,N,j,k,D){var $,ne=new Uint8Array(32);if(j<32||(X(ne,0,32,k,D),ae(N,16,N,32,j-32,ne)!==0))return-1;for(he(O,0,N,0,j,k,D),$=0;$<32;$++)O[$]=0;return 0}function le(O,N){var j;for(j=0;j<16;j++)O[j]=N[j]|0}function we(O){var N,j;for(j=0;j<16;j++)O[j]+=65536,N=Math.floor(O[j]/65536),O[(j+1)*(j<15?1:0)]+=N-1+37*(N-1)*(j===15?1:0),O[j]-=N*65536}function Se(O,N,j){for(var k,D=~(j-1),$=0;$<16;$++)k=D&(O[$]^N[$]),O[$]^=k,N[$]^=k}function Ne(O,N){var j,k,D,$=r(),ne=r();for(j=0;j<16;j++)ne[j]=N[j];for(we(ne),we(ne),we(ne),k=0;k<2;k++){for($[0]=ne[0]-65517,j=1;j<15;j++)$[j]=ne[j]-65535-($[j-1]>>16&1),$[j-1]&=65535;$[15]=ne[15]-32767-($[14]>>16&1),D=$[15]>>16&1,$[14]&=65535,Se(ne,$,1-D)}for(j=0;j<16;j++)O[2*j]=ne[j]&255,O[2*j+1]=ne[j]>>8}function be(O,N){var j=new Uint8Array(32),k=new Uint8Array(32);return Ne(j,O),Ne(k,N),M(j,0,k,0)}function at(O){var N=new Uint8Array(32);return Ne(N,O),N[0]&1}function Ht(O,N){var j;for(j=0;j<16;j++)O[j]=N[2*j]+(N[2*j+1]<<8);O[15]&=32767}function Rt(O,N,j){var k;for(k=0;k<16;k++)O[k]=N[k]+j[k]|0}function Dt(O,N,j){var k;for(k=0;k<16;k++)O[k]=N[k]-j[k]|0}function ke(O,N,j){var k,D,$=new Float64Array(31);for(k=0;k<31;k++)$[k]=0;for(k=0;k<16;k++)for(D=0;D<16;D++)$[k+D]+=N[k]*j[D];for(k=0;k<15;k++)$[k]+=38*$[k+16];for(k=0;k<16;k++)O[k]=$[k];we(O),we(O)}function qt(O,N){ke(O,N,N)}function di(O,N){var j=r(),k;for(k=0;k<16;k++)j[k]=N[k];for(k=253;k>=0;k--)qt(j,j),k!==2&&k!==4&&ke(j,j,N);for(k=0;k<16;k++)O[k]=j[k]}function Gi(O,N){var j=r(),k;for(k=0;k<16;k++)j[k]=N[k];for(k=250;k>=0;k--)qt(j,j),k!==1&&ke(j,j,N);for(k=0;k<16;k++)O[k]=j[k]}function mi(O,N,j){var k=new Uint8Array(32),D=new Float64Array(80),$,ne,ie=r(),V=r(),ee=r(),pe=r(),Re=r(),Ze=r();for(ne=0;ne<31;ne++)k[ne]=N[ne];for(k[31]=N[31]&127|64,k[0]&=248,Ht(D,j),ne=0;ne<16;ne++)V[ne]=D[ne],pe[ne]=ie[ne]=ee[ne]=0;for(ie[0]=pe[0]=1,ne=254;ne>=0;--ne)$=k[ne>>>3]>>>(ne&7)&1,Se(ie,V,$),Se(ee,pe,$),Rt(Re,ie,ee),Dt(ie,ie,ee),Rt(ee,V,pe),Dt(V,V,pe),qt(pe,Re),qt(Ze,ie),ke(ie,ee,ie),ke(ee,V,Re),Rt(Re,ie,ee),Dt(ie,ie,ee),qt(V,ie),Dt(ee,pe,Ze),ke(ie,ee,g),Rt(ie,ie,pe),ke(ee,ee,ie),ke(ie,pe,Ze),ke(pe,V,D),qt(V,Re),Se(ie,V,$),Se(ee,pe,$);for(ne=0;ne<16;ne++)D[ne+16]=ie[ne],D[ne+32]=ee[ne],D[ne+48]=V[ne],D[ne+64]=pe[ne];var Lt=D.subarray(32),Dn=D.subarray(16);return di(Lt,Lt),ke(Dn,Dn,Lt),Ne(O,Dn),0}function gn(O,N){return mi(O,N,c)}function Fi(O,N){return s(N,32),gn(O,N)}function Ar(O,N,j){var k=new Uint8Array(32);return mi(k,j,N),K(O,l,k,P)}var Eo=de,Oo=Oe;function Js(O,N,j,k,D,$){var ne=new Uint8Array(32);return Ar(ne,D,$),Eo(O,N,j,k,ne)}function Qs(O,N,j,k,D,$){var ne=new Uint8Array(32);return Ar(ne,D,$),Oo(O,N,j,k,ne)}function Wn(){var O=0,N=0,j=0,k=0,D=65535,$,ne,ie;for(ie=0;ie<arguments.length;ie++)$=arguments[ie].lo,ne=arguments[ie].hi,O+=$&D,N+=$>>>16,j+=ne&D,k+=ne>>>16;return N+=O>>>16,j+=N>>>16,k+=j>>>16,new t(j&D|k<<16,O&D|N<<16)}function Ao(O,N){return new t(O.hi>>>N,O.lo>>>N|O.hi<<32-N)}function Vi(){var O=0,N=0,j;for(j=0;j<arguments.length;j++)O^=arguments[j].lo,N^=arguments[j].hi;return new t(N,O)}function tt(O,N){var j,k,D=32-N;return N<32?(j=O.hi>>>N|O.lo<<D,k=O.lo>>>N|O.hi<<D):N<64&&(j=O.lo>>>N|O.hi<<D,k=O.hi>>>N|O.lo<<D),new t(j,k)}function mu(O,N,j){var k=O.hi&N.hi^~O.hi&j.hi,D=O.lo&N.lo^~O.lo&j.lo;return new t(k,D)}function jo(O,N,j){var k=O.hi&N.hi^O.hi&j.hi^N.hi&j.hi,D=O.lo&N.lo^O.lo&j.lo^N.lo&j.lo;return new t(k,D)}function To(O){return Vi(tt(O,28),tt(O,34),tt(O,39))}function Yi(O){return Vi(tt(O,14),tt(O,18),tt(O,41))}function pu(O){return Vi(tt(O,1),tt(O,8),Ao(O,7))}function No(O){return Vi(tt(O,19),tt(O,61),Ao(O,6))}var yu=[new t(1116352408,3609767458),new t(1899447441,602891725),new t(3049323471,3964484399),new t(3921009573,2173295548),new t(961987163,4081628472),new t(1508970993,3053834265),new t(2453635748,2937671579),new t(2870763221,3664609560),new t(3624381080,2734883394),new t(310598401,1164996542),new t(607225278,1323610764),new t(1426881987,3590304994),new t(1925078388,4068182383),new t(2162078206,991336113),new t(2614888103,633803317),new t(3248222580,3479774868),new t(3835390401,2666613458),new t(4022224774,944711139),new t(264347078,2341262773),new t(604807628,2007800933),new t(770255983,1495990901),new t(1249150122,1856431235),new t(1555081692,3175218132),new t(1996064986,2198950837),new t(2554220882,3999719339),new t(2821834349,766784016),new t(2952996808,2566594879),new t(3210313671,3203337956),new t(3336571891,1034457026),new t(3584528711,2466948901),new t(113926993,3758326383),new t(338241895,168717936),new t(666307205,1188179964),new t(773529912,1546045734),new t(1294757372,1522805485),new t(1396182291,2643833823),new t(1695183700,2343527390),new t(1986661051,1014477480),new t(2177026350,1206759142),new t(2456956037,344077627),new t(2730485921,1290863460),new t(2820302411,3158454273),new t(3259730800,3505952657),new t(3345764771,106217008),new t(3516065817,3606008344),new t(3600352804,1432725776),new t(4094571909,1467031594),new t(275423344,851169720),new t(430227734,3100823752),new t(506948616,1363258195),new t(659060556,3750685593),new t(883997877,3785050280),new t(958139571,3318307427),new t(1322822218,3812723403),new t(1537002063,2003034995),new t(1747873779,3602036899),new t(1955562222,1575990012),new t(2024104815,1125592928),new t(2227730452,2716904306),new t(2361852424,442776044),new t(2428436474,593698344),new t(2756734187,3733110249),new t(3204031479,2999351573),new t(3329325298,3815920427),new t(3391569614,3928383900),new t(3515267271,566280711),new t(3940187606,3454069534),new t(4118630271,4000239992),new t(116418474,1914138554),new t(174292421,2731055270),new t(289380356,3203993006),new t(460393269,320620315),new t(685471733,587496836),new t(852142971,1086792851),new t(1017036298,365543100),new t(1126000580,2618297676),new t(1288033470,3409855158),new t(1501505948,4234509866),new t(1607167915,987167468),new t(1816402316,1246189591)];function ko(O,N,j){var k=[],D=[],$=[],ne=[],ie,V,ee;for(V=0;V<8;V++)k[V]=$[V]=C(O,8*V);for(var pe=0;j>=128;){for(V=0;V<16;V++)ne[V]=C(N,8*V+pe);for(V=0;V<80;V++){for(ee=0;ee<8;ee++)D[ee]=$[ee];for(ie=Wn($[7],Yi($[4]),mu($[4],$[5],$[6]),yu[V],ne[V%16]),D[7]=Wn(ie,To($[0]),jo($[0],$[1],$[2])),D[3]=Wn(D[3],ie),ee=0;ee<8;ee++)$[(ee+1)%8]=D[ee];if(V%16===15)for(ee=0;ee<16;ee++)ne[ee]=Wn(ne[ee],ne[(ee+9)%16],pu(ne[(ee+1)%16]),No(ne[(ee+14)%16]))}for(V=0;V<8;V++)$[V]=Wn($[V],k[V]),k[V]=$[V];pe+=128,j-=128}for(V=0;V<8;V++)z(O,8*V,k[V]);return j}var pi=new Uint8Array([106,9,230,103,243,188,201,8,187,103,174,133,132,202,167,59,60,110,243,114,254,148,248,43,165,79,245,58,95,29,54,241,81,14,82,127,173,230,130,209,155,5,104,140,43,62,108,31,31,131,217,171,251,65,189,107,91,224,205,25,19,126,33,121]);function mt(O,N,j){var k=new Uint8Array(64),D=new Uint8Array(256),$,ne=j;for($=0;$<64;$++)k[$]=pi[$];for(ko(k,N,j),j%=128,$=0;$<256;$++)D[$]=0;for($=0;$<j;$++)D[$]=N[ne-j+$];for(D[j]=128,j=256-128*(j<112?1:0),D[j-9]=0,z(D,j-8,new t(ne/536870912|0,ne<<3)),ko(k,D,j),$=0;$<64;$++)O[$]=k[$];return 0}function Jt(O,N){var j=r(),k=r(),D=r(),$=r(),ne=r(),ie=r(),V=r(),ee=r(),pe=r();Dt(j,O[1],O[0]),Dt(pe,N[1],N[0]),ke(j,j,pe),Rt(k,O[0],O[1]),Rt(pe,N[0],N[1]),ke(k,k,pe),ke(D,O[3],N[3]),ke(D,D,m),ke($,O[2],N[2]),Rt($,$,$),Dt(ne,k,j),Dt(ie,$,D),Rt(V,$,D),Rt(ee,k,j),ke(O[0],ne,ie),ke(O[1],ee,V),ke(O[2],V,ie),ke(O[3],ne,ee)}function Bt(O,N,j){var k;for(k=0;k<4;k++)Se(O[k],N[k],j)}function Zs(O,N){var j=r(),k=r(),D=r();di(D,N[2]),ke(j,N[0],D),ke(k,N[1],D),Ne(O,k),O[31]^=at(j)<<7}function Ws(O,N,j){var k,D;for(le(O[0],d),le(O[1],p),le(O[2],p),le(O[3],d),D=255;D>=0;--D)k=j[D/8|0]>>(D&7)&1,Bt(O,N,k),Jt(N,O),Jt(O,O),Bt(O,N,k)}function Ki(O,N){var j=[r(),r(),r(),r()];le(j[0],b),le(j[1],v),le(j[2],p),ke(j[3],b,v),Ws(O,j,N)}function jr(O,N,j){var k=new Uint8Array(64),D=[r(),r(),r(),r()],$;for(j||s(N,32),mt(k,N,32),k[0]&=248,k[31]&=127,k[31]|=64,Ki(D,k),Zs(O,D),$=0;$<32;$++)N[$+32]=O[$];return 0}var er=new Float64Array([237,211,245,92,26,99,18,88,214,156,247,162,222,249,222,20,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,16]);function Tr(O,N){var j,k,D,$;for(k=63;k>=32;--k){for(j=0,D=k-32,$=k-12;D<$;++D)N[D]+=j-16*N[k]*er[D-(k-32)],j=Math.floor((N[D]+128)/256),N[D]-=j*256;N[D]+=j,N[k]=0}for(j=0,D=0;D<32;D++)N[D]+=j-(N[31]>>4)*er[D],j=N[D]>>8,N[D]&=255;for(D=0;D<32;D++)N[D]-=j*er[D];for(k=0;k<32;k++)N[k+1]+=N[k]>>8,O[k]=N[k]&255}function Mn(O){var N=new Float64Array(64),j;for(j=0;j<64;j++)N[j]=O[j];for(j=0;j<64;j++)O[j]=0;Tr(O,N)}function yi(O,N,j,k){var D=new Uint8Array(64),$=new Uint8Array(64),ne=new Uint8Array(64),ie,V,ee=new Float64Array(64),pe=[r(),r(),r(),r()];mt(D,k,32),D[0]&=248,D[31]&=127,D[31]|=64;var Re=j+64;for(ie=0;ie<j;ie++)O[64+ie]=N[ie];for(ie=0;ie<32;ie++)O[32+ie]=D[32+ie];for(mt(ne,O.subarray(32),j+32),Mn(ne),Ki(pe,ne),Zs(O,pe),ie=32;ie<64;ie++)O[ie]=k[ie];for(mt($,O,j+64),Mn($),ie=0;ie<64;ie++)ee[ie]=0;for(ie=0;ie<32;ie++)ee[ie]=ne[ie];for(ie=0;ie<32;ie++)for(V=0;V<32;V++)ee[ie+V]+=$[ie]*D[V];return Tr(O.subarray(32),ee),Re}function gi(O,N){var j=r(),k=r(),D=r(),$=r(),ne=r(),ie=r(),V=r();return le(O[2],p),Ht(O[1],N),qt(D,O[1]),ke($,D,f),Dt(D,D,O[2]),Rt($,O[2],$),qt(ne,$),qt(ie,ne),ke(V,ie,ne),ke(j,V,D),ke(j,j,$),Gi(j,j),ke(j,j,D),ke(j,j,$),ke(j,j,$),ke(O[0],j,$),qt(k,O[0]),ke(k,k,$),be(k,D)&&ke(O[0],O[0],_),qt(k,O[0]),ke(k,k,$),be(k,D)?-1:(at(O[0])===N[31]>>7&&Dt(O[0],d,O[0]),ke(O[3],O[0],O[1]),0)}function ea(O,N,j,k){var D,$=new Uint8Array(32),ne=new Uint8Array(64),ie=[r(),r(),r(),r()],V=[r(),r(),r(),r()];if(j<64||gi(V,k))return-1;for(D=0;D<j;D++)O[D]=N[D];for(D=0;D<32;D++)O[D+32]=k[D];if(mt(ne,O,j),Mn(ne),Ws(ie,V,ne),Ki(V,N.subarray(32)),Jt(ie,V),Zs($,ie),j-=64,M(N,0,$,0)){for(D=0;D<j;D++)O[D]=0;return-1}for(D=0;D<j;D++)O[D]=N[D+64];return j}var Xi=32,Nr=24,Rn=32,kr=16,Cr=32,bi=32,Mr=32,tr=32,vi=32,ta=Nr,Co=Rn,Hn=kr,Je=64,lt=32,Qt=64,xi=32,na=64;i.lowlevel={crypto_core_hsalsa20:K,crypto_stream_xor:he,crypto_stream:X,crypto_stream_salsa20_xor:Y,crypto_stream_salsa20:W,crypto_onetimeauth:F,crypto_onetimeauth_verify:ae,crypto_verify_16:oe,crypto_verify_32:M,crypto_secretbox:de,crypto_secretbox_open:Oe,crypto_scalarmult:mi,crypto_scalarmult_base:gn,crypto_box_beforenm:Ar,crypto_box_afternm:Eo,crypto_box:Js,crypto_box_open:Qs,crypto_box_keypair:Fi,crypto_hash:mt,crypto_sign:yi,crypto_sign_keypair:jr,crypto_sign_open:ea,crypto_secretbox_KEYBYTES:Xi,crypto_secretbox_NONCEBYTES:Nr,crypto_secretbox_ZEROBYTES:Rn,crypto_secretbox_BOXZEROBYTES:kr,crypto_scalarmult_BYTES:Cr,crypto_scalarmult_SCALARBYTES:bi,crypto_box_PUBLICKEYBYTES:Mr,crypto_box_SECRETKEYBYTES:tr,crypto_box_BEFORENMBYTES:vi,crypto_box_NONCEBYTES:ta,crypto_box_ZEROBYTES:Co,crypto_box_BOXZEROBYTES:Hn,crypto_sign_BYTES:Je,crypto_sign_PUBLICKEYBYTES:lt,crypto_sign_SECRETKEYBYTES:Qt,crypto_sign_SEEDBYTES:xi,crypto_hash_BYTES:na,gf:r,D:f,L:er,pack25519:Ne,unpack25519:Ht,M:ke,A:Rt,S:qt,Z:Dt,pow2523:Gi,add:Jt,set25519:le,modL:Tr,scalarmult:Ws,scalarbase:Ki};function Mo(O,N){if(O.length!==Xi)throw new Error("bad key size");if(N.length!==Nr)throw new Error("bad nonce size")}function Ro(O,N){if(O.length!==Mr)throw new Error("bad public key size");if(N.length!==tr)throw new Error("bad secret key size")}function St(){for(var O=0;O<arguments.length;O++)if(!(arguments[O]instanceof Uint8Array))throw new TypeError("unexpected type, use Uint8Array")}function Ji(O){for(var N=0;N<O.length;N++)O[N]=0}i.randomBytes=function(O){var N=new Uint8Array(O);return s(N,O),N},i.secretbox=function(O,N,j){St(O,N,j),Mo(j,N);for(var k=new Uint8Array(Rn+O.length),D=new Uint8Array(k.length),$=0;$<O.length;$++)k[$+Rn]=O[$];return de(D,k,k.length,N,j),D.subarray(kr)},i.secretbox.open=function(O,N,j){St(O,N,j),Mo(j,N);for(var k=new Uint8Array(kr+O.length),D=new Uint8Array(k.length),$=0;$<O.length;$++)k[$+kr]=O[$];return k.length<32||Oe(D,k,k.length,N,j)!==0?null:D.subarray(Rn)},i.secretbox.keyLength=Xi,i.secretbox.nonceLength=Nr,i.secretbox.overheadLength=kr,i.scalarMult=function(O,N){if(St(O,N),O.length!==bi)throw new Error("bad n size");if(N.length!==Cr)throw new Error("bad p size");var j=new Uint8Array(Cr);return mi(j,O,N),j},i.scalarMult.base=function(O){if(St(O),O.length!==bi)throw new Error("bad n size");var N=new Uint8Array(Cr);return gn(N,O),N},i.scalarMult.scalarLength=bi,i.scalarMult.groupElementLength=Cr,i.box=function(O,N,j,k){var D=i.box.before(j,k);return i.secretbox(O,N,D)},i.box.before=function(O,N){St(O,N),Ro(O,N);var j=new Uint8Array(vi);return Ar(j,O,N),j},i.box.after=i.secretbox,i.box.open=function(O,N,j,k){var D=i.box.before(j,k);return i.secretbox.open(O,N,D)},i.box.open.after=i.secretbox.open,i.box.keyPair=function(){var O=new Uint8Array(Mr),N=new Uint8Array(tr);return Fi(O,N),{publicKey:O,secretKey:N}},i.box.keyPair.fromSecretKey=function(O){if(St(O),O.length!==tr)throw new Error("bad secret key size");var N=new Uint8Array(Mr);return gn(N,O),{publicKey:N,secretKey:new Uint8Array(O)}},i.box.publicKeyLength=Mr,i.box.secretKeyLength=tr,i.box.sharedKeyLength=vi,i.box.nonceLength=ta,i.box.overheadLength=i.secretbox.overheadLength,i.sign=function(O,N){if(St(O,N),N.length!==Qt)throw new Error("bad secret key size");var j=new Uint8Array(Je+O.length);return yi(j,O,O.length,N),j},i.sign.open=function(O,N){if(St(O,N),N.length!==lt)throw new Error("bad public key size");var j=new Uint8Array(O.length),k=ea(j,O,O.length,N);if(k<0)return null;for(var D=new Uint8Array(k),$=0;$<D.length;$++)D[$]=j[$];return D},i.sign.detached=function(O,N){for(var j=i.sign(O,N),k=new Uint8Array(Je),D=0;D<k.length;D++)k[D]=j[D];return k},i.sign.detached.verify=function(O,N,j){if(St(O,N,j),N.length!==Je)throw new Error("bad signature size");if(j.length!==lt)throw new Error("bad public key size");var k=new Uint8Array(Je+O.length),D=new Uint8Array(Je+O.length),$;for($=0;$<Je;$++)k[$]=N[$];for($=0;$<O.length;$++)k[$+Je]=O[$];return ea(D,k,k.length,j)>=0},i.sign.keyPair=function(){var O=new Uint8Array(lt),N=new Uint8Array(Qt);return jr(O,N),{publicKey:O,secretKey:N}},i.sign.keyPair.fromSecretKey=function(O){if(St(O),O.length!==Qt)throw new Error("bad secret key size");for(var N=new Uint8Array(lt),j=0;j<N.length;j++)N[j]=O[32+j];return{publicKey:N,secretKey:new Uint8Array(O)}},i.sign.keyPair.fromSeed=function(O){if(St(O),O.length!==xi)throw new Error("bad seed size");for(var N=new Uint8Array(lt),j=new Uint8Array(Qt),k=0;k<32;k++)j[k]=O[k];return jr(N,j,!0),{publicKey:N,secretKey:j}},i.sign.publicKeyLength=lt,i.sign.secretKeyLength=Qt,i.sign.seedLength=xi,i.sign.signatureLength=Je,i.hash=function(O){St(O);var N=new Uint8Array(na);return mt(N,O,O.length),N},i.hash.hashLength=na,i.verify=function(O,N){return St(O,N),O.length===0||N.length===0||O.length!==N.length?!1:se(O,0,N,0,O.length)===0},i.setPRNG=function(O){s=O},(function(){var O=typeof globalThis<"u"?globalThis.crypto||globalThis.msCrypto:null;if(O&&O.getRandomValues){var N=65536;i.setPRNG(function(j,k){var D,$=new Uint8Array(k);for(D=0;D<k;D+=N)O.getRandomValues($.subarray(D,D+Math.min(k-D,N)));for(D=0;D<k;D++)j[D]=$[D];Ji($)})}else typeof require<"u"&&(O=require("crypto"),O&&O.randomBytes&&i.setPRNG(function(j,k){var D,$=O.randomBytes(k);for(D=0;D<k;D++)j[D]=$[D];Ji($)}))})()})(typeof module<"u"&&module.exports?module.exports:globalThis.nacl=globalThis.nacl||{});const Yl=typeof module<"u"&&module.exports?module.exports:globalThis.nacl;Yl.sign.keyPair.fromSeed,Yl.sign.detached,Yl.sign.detached.verify,Yl.randomBytes;var og;(function(i){i.InvalidPrefixByte="nkeys: invalid prefix byte",i.InvalidKey="nkeys: invalid key",i.InvalidPublicKey="nkeys: invalid public key",i.InvalidSeedLen="nkeys: invalid seed length",i.InvalidSeed="nkeys: invalid seed",i.InvalidEncoding="nkeys: invalid encoded key",i.InvalidSignature="nkeys: signature verification failed",i.CannotSign="nkeys: cannot sign, no private key available",i.PublicKeyOnly="nkeys: no seed or private key available",i.InvalidChecksum="nkeys: invalid checksum",i.SerializationError="nkeys: serialization error",i.ApiError="nkeys: api error",i.ClearedPair="nkeys: pair is cleared"})(og||(og={}));var lg;(function(i){i[i.Seed=144]="Seed",i[i.Private=120]="Private",i[i.Operator=112]="Operator",i[i.Server=104]="Server",i[i.Cluster=16]="Cluster",i[i.Account=0]="Account",i[i.User=160]="User"})(lg||(lg={}));function DS(i){return t=>{let r={};return i.forEach(s=>{const l=s(t)||{};r=Object.assign(r,l)}),r}}function qS(){return()=>{}}function BS(i,t){return()=>{const r=typeof i=="function"?i():i,s=typeof t=="function"?t():t;return{user:r,pass:s}}}function LS(i){return()=>({auth_token:typeof i=="function"?i():i})}const pb=120*1e3,zS=2,yb=2*1e3;function US(){return{maxPingOut:2,maxReconnectAttempts:10,noRandomize:!1,pedantic:!1,pingInterval:pb,reconnect:!0,reconnectJitter:100,reconnectJitterTLS:1e3,reconnectTimeWait:yb,tls:void 0,verbose:!1,waitOnFirstConnect:!1,ignoreAuthErrorAbort:!1}}function PS(i){const t=[];return typeof i.authenticator=="function"&&t.push(i.authenticator),Array.isArray(i.authenticator)&&t.push(...i.authenticator),i.token&&t.push(LS(i.token)),i.user&&t.push(BS(i.user,i.pass)),t.length===0?qS():DS(t)}function $S(i){const t=`${Kh}:${hb()}`;if(i=i||{servers:[t]},i.servers=i.servers||[],typeof i.servers=="string"&&(i.servers=[i.servers]),i.servers.length>0&&i.port)throw new me("port and servers options are mutually exclusive",ce.InvalidOption);i.servers.length===0&&i.port&&(i.servers=[`${Kh}:${i.port}`]),i.servers&&i.servers.length===0&&(i.servers=[t]);const r=su(US(),i);if(r.authenticator=PS(r),["reconnectDelayHandler","authenticator"].forEach(s=>{if(r[s]&&typeof r[s]!="function")throw new me(`${s} option should be a function`,ce.NotFunction)}),r.reconnectDelayHandler||(r.reconnectDelayHandler=()=>{let s=r.tls?r.reconnectJitterTLS:r.reconnectJitter;return s&&(s++,s=Math.floor(Math.random()*s)),r.reconnectTimeWait+s}),r.inboxPrefix)try{wr(r.inboxPrefix)}catch(s){throw new me(s.message,ce.ApiError)}if(r.resolve===void 0&&(r.resolve=typeof nd()=="function"),r.resolve&&typeof nd()!="function")throw new me("'resolve' is not supported on this client",ce.InvalidOption);return r}function IS(i,t){const{proto:r,tls_required:s,tls_available:l}=i;if((r===void 0||r<1)&&t.noEcho)throw new me("noEcho",ce.ServerOptionNotAvailable);const c=s||l||!1;if(t.tls&&!c)throw new me("tls",ce.ServerOptionNotAvailable)}const HS=1024*32,GS=/^INFO\s+([^\r\n]+)\r\n/i,FS=so(`PONG\r
|
|
38
|
+
`),cg=so(`PING\r
|
|
39
|
+
`);class VS{constructor(t,r,s){A(this,"echo");A(this,"no_responders");A(this,"protocol");A(this,"verbose");A(this,"pedantic");A(this,"jwt");A(this,"nkey");A(this,"sig");A(this,"user");A(this,"pass");A(this,"auth_token");A(this,"tls_required");A(this,"name");A(this,"lang");A(this,"version");A(this,"headers");this.protocol=1,this.version=t.version,this.lang=t.lang,this.echo=r.noEcho?!1:void 0,this.verbose=r.verbose,this.pedantic=r.pedantic,this.tls_required=r.tls?!0:void 0,this.name=r.name;const l=(r&&typeof r.authenticator=="function"?r.authenticator(s):{})||{};su(this,l)}}class gb extends jt{constructor(r,s,l={}){var d;super();A(this,"sid");A(this,"queue");A(this,"draining");A(this,"max");A(this,"subject");A(this,"drained");A(this,"protocol");A(this,"timer");A(this,"info");A(this,"cleanupFn");A(this,"closed");A(this,"requestSubject");su(this,l),this.protocol=r,this.subject=s,this.draining=!1,this.noIterator=typeof l.callback=="function",this.closed=it();const c=!((d=r.options)!=null&&d.noAsyncTraces);l.timeout&&(this.timer=Gs(l.timeout,c),this.timer.then(()=>{this.timer=void 0}).catch(p=>{this.stop(p),this.noIterator&&this.callback(p,{})})),this.noIterator||this.iterClosed.then(()=>{this.closed.resolve(),this.unsubscribe()})}setPrePostHandlers(r){if(this.noIterator){const s=this.callback,l=r.ingestionFilterFn?r.ingestionFilterFn:()=>({ingest:!0,protocol:!1}),c=r.protocolFilterFn?r.protocolFilterFn:()=>!0,d=r.dispatchedFn?r.dispatchedFn:()=>{};this.callback=(p,g)=>{const{ingest:f}=l(g);f&&c(g)&&(s(p,g),d(g))}}else this.protocolFilterFn=r.protocolFilterFn,this.dispatchedFn=r.dispatchedFn}callback(r,s){this.cancelTimeout(),r?this.stop(r):this.push(s)}close(){if(!this.isClosed()){this.cancelTimeout();const r=()=>{if(this.stop(),this.cleanupFn)try{this.cleanupFn(this,this.info)}catch{}this.closed.resolve()};this.noIterator?r():this.push(r)}}unsubscribe(r){this.protocol.unsubscribe(this,r)}cancelTimeout(){this.timer&&(this.timer.cancel(),this.timer=void 0)}drain(){return this.protocol.isClosed()?Promise.reject(me.errorForCode(ce.ConnectionClosed)):this.isClosed()?Promise.reject(me.errorForCode(ce.SubClosed)):(this.drained||(this.draining=!0,this.protocol.unsub(this),this.drained=this.protocol.flush(it()).then(()=>{this.protocol.subscriptions.cancel(this)}).catch(()=>{this.protocol.subscriptions.cancel(this)})),this.drained)}isDraining(){return this.draining}isClosed(){return this.done}getSubject(){return this.subject}getMax(){return this.max}getID(){return this.sid}}class YS{constructor(){A(this,"mux");A(this,"subs");A(this,"sidCounter");this.sidCounter=0,this.mux=null,this.subs=new Map}size(){return this.subs.size}add(t){return this.sidCounter++,t.sid=this.sidCounter,this.subs.set(t.sid,t),t}setMux(t){return this.mux=t,t}getMux(){return this.mux}get(t){return this.subs.get(t)}resub(t){return this.sidCounter++,this.subs.delete(t.sid),t.sid=this.sidCounter,this.subs.set(t.sid,t),t}all(){return Array.from(this.subs.values())}cancel(t){t&&(t.close(),this.subs.delete(t.sid))}handleError(t){if(t&&t.permissionContext){const r=t.permissionContext,s=this.all();let l;if(r.operation==="subscription"&&(l=s.find(c=>c.subject===r.subject&&c.queue===r.queue)),r.operation==="publish"&&(l=s.find(c=>c.requestSubject===r.subject)),l)return l.callback(t,{}),l.close(),this.subs.delete(l.sid),l!==this.mux}return!1}close(){this.subs.forEach(t=>{t.close()})}}class Zc{constructor(t,r){A(this,"connected");A(this,"connectedOnce");A(this,"infoReceived");A(this,"info");A(this,"muxSubscriptions");A(this,"options");A(this,"outbound");A(this,"pongs");A(this,"subscriptions");A(this,"transport");A(this,"noMorePublishing");A(this,"connectError");A(this,"publisher");A(this,"_closed");A(this,"closed");A(this,"listeners");A(this,"heartbeats");A(this,"parser");A(this,"outMsgs");A(this,"inMsgs");A(this,"outBytes");A(this,"inBytes");A(this,"pendingLimit");A(this,"lastError");A(this,"abortReconnect");A(this,"whyClosed");A(this,"servers");A(this,"server");A(this,"features");A(this,"connectPromise");this._closed=!1,this.connected=!1,this.connectedOnce=!1,this.infoReceived=!1,this.noMorePublishing=!1,this.abortReconnect=!1,this.listeners=[],this.pendingLimit=HS,this.outMsgs=0,this.inMsgs=0,this.outBytes=0,this.inBytes=0,this.options=t,this.publisher=r,this.subscriptions=new YS,this.muxSubscriptions=new NS,this.outbound=new Vs,this.pongs=[],this.whyClosed="",this.pendingLimit=t.pendingLimit||this.pendingLimit,this.features=new cS({major:0,minor:0,micro:0}),this.connectPromise=null;const s=typeof t.servers=="string"?[t.servers]:t.servers;this.servers=new TS(s,{randomize:!t.noRandomize}),this.closed=it(),this.parser=new ag(this),this.heartbeats=new kS(this,this.options.pingInterval||pb,this.options.maxPingOut||zS)}resetOutbound(){this.outbound.reset();const t=this.pongs;this.pongs=[];const r=me.errorForCode(ce.Disconnect);r.stack="",t.forEach(s=>{s.reject(r)}),this.parser=new ag(this),this.infoReceived=!1}dispatchStatus(t){this.listeners.forEach(r=>{r.push(t)})}status(){const t=new jt;return this.listeners.push(t),t}prepare(){this.transport&&this.transport.discard(),this.info=void 0,this.resetOutbound();const t=it();return t.catch(()=>{}),this.pongs.unshift(t),this.connectError=r=>{t.reject(r)},this.transport=hS(),this.transport.closed().then(async r=>{if(this.connected=!1,!this.isClosed()){await this.disconnected(this.transport.closeError||this.lastError);return}}),t}disconnect(){this.dispatchStatus({type:zs.StaleConnection,data:""}),this.transport.disconnect()}reconnect(){return this.connected&&(this.dispatchStatus({type:zs.ClientInitiatedReconnect,data:""}),this.transport.disconnect()),Promise.resolve()}async disconnected(t){this.dispatchStatus({type:_r.Disconnect,data:this.servers.getCurrentServer().toString()}),this.options.reconnect?await this.dialLoop().then(()=>{var r;this.dispatchStatus({type:_r.Reconnect,data:this.servers.getCurrentServer().toString()}),((r=this.lastError)==null?void 0:r.code)===ce.AuthenticationExpired&&(this.lastError=void 0)}).catch(r=>{this._close(r)}):await this._close(t)}async dial(t){const r=this.prepare();let s;try{s=Gs(this.options.timeout||2e4);const l=this.transport.connect(t,this.options);await Promise.race([l,s]),(async()=>{try{for await(const c of this.transport)this.parser.parse(c)}catch(c){console.log("reader closed",c)}})().then()}catch(l){r.reject(l)}try{await Promise.race([s,r]),s&&s.cancel(),this.connected=!0,this.connectError=void 0,this.sendSubscriptions(),this.connectedOnce=!0,this.server.didConnect=!0,this.server.reconnects=0,this.flushPending(),this.heartbeats.start()}catch(l){throw s&&s.cancel(),await this.transport.close(l),l}}async _doDial(t){const{resolve:r}=this.options,s=await t.resolve({fn:nd(),debug:this.options.debug,randomize:!this.options.noRandomize,resolve:r});let l=null;for(const c of s)try{l=null,this.dispatchStatus({type:zs.Reconnecting,data:c.toString()}),await this.dial(c);return}catch(d){l=d}throw l}dialLoop(){return this.connectPromise===null&&(this.connectPromise=this.dodialLoop(),this.connectPromise.then(()=>{}).catch(()=>{}).finally(()=>{this.connectPromise=null})),this.connectPromise}async dodialLoop(){let t;for(;;){this._closed&&this.servers.clear();const r=this.options.reconnectDelayHandler?this.options.reconnectDelayHandler():yb;let s=r;const l=this.selectServer();if(!l||this.abortReconnect)throw t||(this.lastError?this.lastError:me.errorForCode(ce.ConnectionRefused));const c=Date.now();if(l.lastConnect===0||l.lastConnect+r<=c){l.lastConnect=Date.now();try{await this._doDial(l);break}catch(d){if(t=d,!this.connectedOnce){if(this.options.waitOnFirstConnect)continue;this.servers.removeCurrentServer()}l.reconnects++;const p=this.options.maxReconnectAttempts||0;p!==-1&&l.reconnects>=p&&this.servers.removeCurrentServer()}}else s=Math.min(s,l.lastConnect+r-c),await Ys(s)}}static async connect(t,r){const s=new Zc(t,r);return await s.dialLoop(),s}static toError(t){const r=t?t.toLowerCase():"";if(r.indexOf("permissions violation")!==-1){const s=new me(t,ce.PermissionsViolation),l=t.match(/(Publish|Subscription) to "(\S+)"/);if(l){s.permissionContext={operation:l[1].toLowerCase(),subject:l[2],queue:void 0};const c=t.match(/using queue "(\S+)"/);c&&(s.permissionContext.queue=c[1])}return s}else return r.indexOf("authorization violation")!==-1?new me(t,ce.AuthorizationViolation):r.indexOf("user authentication expired")!==-1?new me(t,ce.AuthenticationExpired):r.indexOf("account authentication expired")!=-1?new me(t,ce.AccountExpired):r.indexOf("authentication timeout")!==-1?new me(t,ce.AuthenticationTimeout):new me(t,ce.ProtocolError)}processMsg(t,r){if(this.inMsgs++,this.inBytes+=r.length,!this.subscriptions.sidCounter)return;const s=this.subscriptions.get(t.sid);s&&(s.received+=1,s.callback&&s.callback(null,new Od(t,r,this)),s.max!==void 0&&s.received>=s.max&&s.unsubscribe())}processError(t){const r=Fy(t),s=Zc.toError(r),l={type:_r.Error,data:s.code};if(s.isPermissionError()){let c=!1;if(s.permissionContext){l.permissionContext=s.permissionContext;const d=this.subscriptions.getMux();c=(d==null?void 0:d.subject)===s.permissionContext.subject}this.subscriptions.handleError(s),this.muxSubscriptions.handleError(c,s),c&&this.subscriptions.setMux(null)}this.dispatchStatus(l),this.handleError(s)}handleError(t){t.isAuthError()?this.handleAuthError(t):t.isProtocolError()?this.lastError=t:t.isAuthTimeout()&&(this.lastError=t),t.isPermissionError()||(this.lastError=t)}handleAuthError(t){this.lastError&&t.code===this.lastError.code&&this.options.ignoreAuthErrorAbort===!1&&(this.abortReconnect=!0),this.connectError?this.connectError(t):this.disconnect()}processPing(){this.transport.send(FS)}processPong(){const t=this.pongs.shift();t&&t.resolve()}processInfo(t){const r=JSON.parse(Fy(t));this.info=r;const s=this.options&&this.options.ignoreClusterUpdates?void 0:this.servers.update(r,this.transport.isEncrypted());if(!this.infoReceived){this.features.update(Ii(r.version)),this.infoReceived=!0,this.transport.isEncrypted()&&this.servers.updateTLSName();const{version:c,lang:d}=this.transport;try{const p=new VS({version:c,lang:d},this.options,r.nonce);r.headers&&(p.headers=!0,p.no_responders=!0);const g=JSON.stringify(p);this.transport.send(so(`CONNECT ${g}${Uc}`)),this.transport.send(cg)}catch(p){this._close(p)}}s&&this.dispatchStatus({type:_r.Update,data:s}),(r.ldm!==void 0?r.ldm:!1)&&this.dispatchStatus({type:_r.LDM,data:this.servers.getCurrentServer().toString()})}push(t){switch(t.kind){case $t.MSG:{const{msg:r,data:s}=t;this.processMsg(r,s);break}case $t.OK:break;case $t.ERR:this.processError(t.data);break;case $t.PING:this.processPing();break;case $t.PONG:this.processPong();break;case $t.INFO:this.processInfo(t.data);break}}sendCommand(t,...r){const s=this.outbound.length();let l;typeof t=="string"?l=so(t):l=t,this.outbound.fill(l,...r),s===0?queueMicrotask(()=>{this.flushPending()}):this.outbound.size()>=this.pendingLimit&&this.flushPending()}publish(t,r=hn,s){let l;if(r instanceof Uint8Array)l=r;else if(typeof r=="string")l=Hi.encode(r);else throw me.errorForCode(ce.BadPayload);let c=l.length;s=s||{},s.reply=s.reply||"";let d=hn,p=0;if(s.headers){if(this.info&&!this.info.headers)throw new me("headers",ce.ServerOptionNotAvailable);d=s.headers.encode(),p=d.length,c=l.length+p}if(this.info&&c>this.info.max_payload)throw me.errorForCode(ce.MaxPayloadExceeded);this.outBytes+=c,this.outMsgs++;let g;s.headers?(s.reply?g=`HPUB ${t} ${s.reply} ${p} ${c}\r
|
|
40
|
+
`:g=`HPUB ${t} ${p} ${c}\r
|
|
41
|
+
`,this.sendCommand(g,d,l,Qc)):(s.reply?g=`PUB ${t} ${s.reply} ${c}\r
|
|
42
|
+
`:g=`PUB ${t} ${c}\r
|
|
43
|
+
`,this.sendCommand(g,l,Qc))}request(t){return this.initMux(),this.muxSubscriptions.add(t),t}subscribe(t){return this.subscriptions.add(t),this._subunsub(t),t}_sub(t){t.queue?this.sendCommand(`SUB ${t.subject} ${t.queue} ${t.sid}\r
|
|
44
|
+
`):this.sendCommand(`SUB ${t.subject} ${t.sid}\r
|
|
45
|
+
`)}_subunsub(t){return this._sub(t),t.max&&this.unsubscribe(t,t.max),t}unsubscribe(t,r){this.unsub(t,r),(t.max===void 0||t.received>=t.max)&&this.subscriptions.cancel(t)}unsub(t,r){!t||this.isClosed()||(r?this.sendCommand(`UNSUB ${t.sid} ${r}\r
|
|
46
|
+
`):this.sendCommand(`UNSUB ${t.sid}\r
|
|
47
|
+
`),t.max=r)}resub(t,r){!t||this.isClosed()||(this.unsub(t),t.subject=r,this.subscriptions.resub(t),this._sub(t))}flush(t){return t||(t=it()),this.pongs.push(t),this.outbound.fill(cg),this.flushPending(),t}sendSubscriptions(){const t=[];this.subscriptions.all().forEach(r=>{const s=r;s.queue?t.push(`SUB ${s.subject} ${s.queue} ${s.sid}${Uc}`):t.push(`SUB ${s.subject} ${s.sid}${Uc}`)}),t.length&&this.transport.send(so(t.join("")))}async _close(t){this._closed||(this.whyClosed=new Error("close trace").stack||"",this.heartbeats.cancel(),this.connectError&&(this.connectError(t),this.connectError=void 0),this.muxSubscriptions.close(),this.subscriptions.close(),this.listeners.forEach(r=>{r.stop()}),this._closed=!0,await this.transport.close(t),await this.closed.resolve(t))}close(){return this._close()}isClosed(){return this._closed}drain(){const t=this.subscriptions.all(),r=[];return t.forEach(s=>{r.push(s.drain())}),Promise.all(r).then(async()=>(this.noMorePublishing=!0,await this.flush(),this.close())).catch(()=>{})}flushPending(){if(!(!this.infoReceived||!this.connected)&&this.outbound.size()){const t=this.outbound.drain();this.transport.send(t)}}initMux(){if(!this.subscriptions.getMux()){const r=this.muxSubscriptions.init(this.options.inboxPrefix),s=new gb(this,`${r}*`);s.callback=this.muxSubscriptions.dispatcher(),this.subscriptions.setMux(s),this.subscribe(s)}}selectServer(){const t=this.servers.selectServer();if(t!==void 0)return this.server=t,this.server}getServer(){return this.server}}const KS="$SRV";class ug{constructor(t){A(this,"msg");this.msg=t}get data(){return this.msg.data}get sid(){return this.msg.sid}get subject(){return this.msg.subject}get reply(){return this.msg.reply||""}get headers(){return this.msg.headers}respond(t,r){return this.msg.respond(t,r)}respondError(t,r,s,l){var c,d;return l=l||{},l.headers=l.headers||Sr(),(c=l.headers)==null||c.set(Yc,`${t}`),(d=l.headers)==null||d.set(Vc,r),this.msg.respond(s,l)}json(t){return this.msg.json(t)}string(){return this.msg.string()}}class fo{constructor(t,r="",s=""){A(this,"subject");A(this,"queue");A(this,"srv");r!==""&&JS("service group",r);let l="";if(t instanceof bo)this.srv=t,l="";else if(t instanceof fo){const c=t;this.srv=c.srv,s===""&&c.queue!==""&&(s=c.queue),l=c.subject}else throw new Error("unknown ServiceGroup type");this.subject=this.calcSubject(l,r),this.queue=s}calcSubject(t,r=""){return r===""?t:t!==""?`${t}.${r}`:r}addEndpoint(t="",r){r=r||{subject:t};const s=typeof r=="function"?{handler:r,subject:t}:r;no("endpoint",t);let{subject:l,handler:c,metadata:d,queue:p}=s;l=l||t,p=p||this.queue,XS("endpoint subject",l),l=this.calcSubject(this.subject,l);const g={name:t,subject:l,queue:p,handler:c,metadata:d};return this.srv._addEndpoint(g)}addGroup(t="",r=""){return new fo(this,t,r)}}function XS(i,t){if(t==="")throw new Error(`${i} cannot be empty`);if(t.indexOf(" ")!==-1)throw new Error(`${i} cannot contain spaces: '${t}'`);const r=t.split(".");r.forEach((s,l)=>{if(s===">"&&l!==r.length-1)throw new Error(`${i} cannot have internal '>': '${t}'`)})}function JS(i,t){if(t.indexOf(" ")!==-1)throw new Error(`${i} cannot contain spaces: '${t}'`);t.split(".").forEach(s=>{if(s===">")throw new Error(`${i} name cannot contain internal '>': '${t}'`)})}class bo{constructor(t,r={name:"",version:""}){A(this,"nc");A(this,"_id");A(this,"config");A(this,"handlers");A(this,"internal");A(this,"_stopped");A(this,"_done");A(this,"started");this.nc=t,this.config=Object.assign({},r),this.config.queue||(this.config.queue="q"),no("name",this.config.name),no("queue",this.config.queue),Ii(this.config.version),this._id=fi.next(),this.internal=[],this._done=it(),this._stopped=!1,this.handlers=[],this.started=new Date().toISOString(),this.reset(),this.nc.closed().then(()=>{this.close().catch()}).catch(s=>{this.close(s).catch()})}static controlSubject(t,r="",s="",l){const c=l??KS;return r===""&&s===""?`${c}.${t}`:(no("control subject name",r),s!==""?(no("control subject id",s),`${c}.${t}.${r}.${s}`):`${c}.${t}.${r}`)}get subjects(){return this.handlers.filter(t=>t.internal===!1).map(t=>t.subject)}get id(){return this._id}get name(){return this.config.name}get description(){return this.config.description??""}get version(){return this.config.version}get metadata(){return this.config.metadata}errorToHeader(t){const r=Sr();if(t instanceof Kc){const s=t;r.set(Vc,s.message),r.set(Yc,`${s.code}`)}else r.set(Vc,t.message),r.set(Yc,"500");return r}setupHandler(t,r=!1){const s=r?"":t.queue?t.queue:this.config.queue,{name:l,subject:c,handler:d}=t,p=t;p.internal=r,r&&this.internal.push(p),p.stats=new QS(l,c,s),p.queue=s;const g=d?(f,m)=>{if(f){this.close(f);return}const b=Date.now();try{d(f,new ug(m))}catch(v){p.stats.countError(v),m==null||m.respond(hn,{headers:this.errorToHeader(v)})}finally{p.stats.countLatency(b)}}:void 0;return p.sub=this.nc.subscribe(c,{callback:g,queue:s}),p.sub.closed.then(()=>{this._stopped||this.close(new Error(`required subscription ${t.subject} stopped`)).catch()}).catch(f=>{if(!this._stopped){const m=new Error(`required subscription ${t.subject} errored: ${f.message}`);m.stack=f.stack,this.close(m).catch()}}),p}info(){return{type:ao.INFO,name:this.name,id:this.id,version:this.version,description:this.description,metadata:this.metadata,endpoints:this.endpoints()}}endpoints(){return this.handlers.map(t=>{const{subject:r,metadata:s,name:l,queue:c}=t;return{subject:r,metadata:s,name:l,queue_group:c}})}async stats(){const t=[];for(const r of this.handlers){if(typeof this.config.statsHandler=="function")try{r.stats.data=await this.config.statsHandler(r)}catch(s){r.stats.countError(s)}t.push(r.stats.stats(r.qi))}return{type:ao.STATS,name:this.name,id:this.id,version:this.version,started:this.started,metadata:this.metadata,endpoints:t}}addInternalHandler(t,r){const s=`${t}`.toUpperCase();this._doAddInternalHandler(`${s}-all`,t,r),this._doAddInternalHandler(`${s}-kind`,t,r,this.name),this._doAddInternalHandler(`${s}`,t,r,this.name,this.id)}_doAddInternalHandler(t,r,s,l="",c=""){const d={};d.name=t,d.subject=bo.controlSubject(r,l,c),d.handler=s,this.setupHandler(d,!0)}start(){const t=In(),r=(d,p)=>d?(this.close(d),Promise.reject(d)):this.stats().then(g=>(p==null||p.respond(t.encode(g)),Promise.resolve())),s=(d,p)=>d?(this.close(d),Promise.reject(d)):(p==null||p.respond(t.encode(this.info())),Promise.resolve()),l=t.encode(this.ping()),c=(d,p)=>d?(this.close(d).then().catch(),Promise.reject(d)):(p.respond(l),Promise.resolve());return this.addInternalHandler(ai.PING,c),this.addInternalHandler(ai.STATS,r),this.addInternalHandler(ai.INFO,s),this.handlers.forEach(d=>{const{subject:p}=d;typeof p=="string"&&d.handler!==null&&this.setupHandler(d)}),Promise.resolve(this)}close(t){if(this._stopped)return this._done;this._stopped=!0;let r=[];return this.nc.isClosed()||(r=this.handlers.concat(this.internal).map(s=>s.sub.drain())),Promise.allSettled(r).then(()=>{this._done.resolve(t||null)}),this._done}get stopped(){return this._done}get isStopped(){return this._stopped}stop(t){return this.close(t)}ping(){return{type:ao.PING,name:this.name,id:this.id,version:this.version,metadata:this.metadata}}reset(){if(this.started=new Date().toISOString(),this.handlers)for(const t of this.handlers)t.stats.reset(t.qi)}addGroup(t,r){return new fo(this,t,r)}addEndpoint(t,r){return new fo(this).addEndpoint(t,r)}_addEndpoint(t){const r=new jt;r.noIterator=typeof t.handler=="function",r.noIterator||(t.handler=(l,c)=>{l?this.stop(l).catch():r.push(new ug(c))},r.iterClosed.then(()=>{this.close().catch()}));const s=this.setupHandler(t,!1);return s.qi=r,this.handlers.push(s),r}}class QS{constructor(t,r,s=""){A(this,"name");A(this,"subject");A(this,"average_processing_time");A(this,"num_requests");A(this,"processing_time");A(this,"num_errors");A(this,"last_error");A(this,"data");A(this,"metadata");A(this,"queue");this.name=t,this.subject=r,this.average_processing_time=0,this.num_errors=0,this.num_requests=0,this.processing_time=0,this.queue=s}reset(t){this.num_requests=0,this.processing_time=0,this.average_processing_time=0,this.num_errors=0,this.last_error=void 0,this.data=void 0;const r=t;r&&(r.time=0,r.processed=0)}countLatency(t){this.num_requests++,this.processing_time+=rt(Date.now()-t),this.average_processing_time=Math.round(this.processing_time/this.num_requests)}countError(t){this.num_errors++,this.last_error=t.message}_stats(){const{name:t,subject:r,average_processing_time:s,num_errors:l,num_requests:c,processing_time:d,last_error:p,data:g,queue:f}=this;return{name:t,subject:r,average_processing_time:s,num_errors:l,num_requests:c,processing_time:d,last_error:p,data:g,queue_group:f}}stats(t){const r=t;return(r==null?void 0:r.noIterator)===!1&&(this.processing_time=rt(r.time),this.num_requests=r.processed,this.average_processing_time=this.processing_time>0&&this.num_requests>0?this.processing_time/this.num_requests:0),this._stats()}}class ZS{constructor(t,r={strategy:$n.JitterTimer,maxWait:2e3},s){A(this,"nc");A(this,"prefix");A(this,"opts");this.nc=t,this.prefix=s,this.opts=r}ping(t="",r=""){return this.q(ai.PING,t,r)}stats(t="",r=""){return this.q(ai.STATS,t,r)}info(t="",r=""){return this.q(ai.INFO,t,r)}async q(t,r="",s=""){const l=new jt,c=In(),d=bo.controlSubject(t,r,s,this.prefix),p=await this.nc.requestMany(d,hn,this.opts);return(async()=>{for await(const g of p)try{const f=c.decode(g.data);l.push(f)}catch(f){l.push(()=>{l.stop(f)})}l.push(()=>{l.stop()})})().catch(g=>{l.stop(g)}),l}}function bb(){return{key:{encode(i){return i},decode(i){return i}},value:{encode(i){return i},decode(i){return i}}}}function WS(){return{replicas:1,history:1,timeout:2e3,max_bytes:-1,maxValueSize:-1,codec:bb(),storage:Wh.File}}const Wc="KV-Operation",fg="$KV",e2=/^[-/=.\w]+$/,t2=/^[-/=.>*\w]+$/,n2=/^[-\w]+$/;function r2(i){if(i.startsWith(".")||i.endsWith(".")||!e2.test(i))throw new Error(`invalid key: ${i}`)}function i2(i){if(i.startsWith(".")||i.endsWith(".")||!t2.test(i))throw new Error(`invalid key: ${i}`)}function s2(i){if(i.startsWith(".")||i.endsWith("."))throw new Error(`invalid key: ${i}`);const t=i.split(".");let r=!1;for(let s=0;s<t.length;s++)switch(t[s]){case"*":r=!0;break;case">":if(s!==t.length-1)throw new Error(`invalid key: ${i}`);r=!0;break}return r}function Pc(i){if(!n2.test(i))throw new Error(`invalid bucket name: ${i}`)}var Xn;(function(i){i.MsgIdHdr="Nats-Msg-Id",i.ExpectedStreamHdr="Nats-Expected-Stream",i.ExpectedLastSeqHdr="Nats-Expected-Last-Sequence",i.ExpectedLastMsgIdHdr="Nats-Expected-Last-Msg-Id",i.ExpectedLastSubjectSequenceHdr="Nats-Expected-Last-Subject-Sequence"})(Xn||(Xn={}));class ho{constructor(t,r,s){A(this,"js");A(this,"jsm");A(this,"stream");A(this,"bucket");A(this,"direct");A(this,"codec");A(this,"prefix");A(this,"editPrefix");A(this,"useJsPrefix");A(this,"_prefixLen");A(this,"validateKey",r2);A(this,"validateSearchKey",i2);A(this,"hasWildcards",s2);Pc(t),this.js=r,this.jsm=s,this.bucket=t,this.prefix=fg,this.editPrefix="",this.useJsPrefix=!1,this._prefixLen=0}static async create(t,r,s={}){Pc(r);const l=await t.jetstreamManager(),c=new ho(r,t,l);return await c.init(s),c}static async bind(t,r,s={}){const l=await t.jetstreamManager(),c={config:{allow_direct:s.allow_direct}};Pc(r);const d=new ho(r,t,l);return c.config.name=s.streamName??d.bucketName(),Object.assign(d,c),d.stream=c.config.name,d.codec=s.codec||bb(),d.direct=c.config.allow_direct??!1,d.initializePrefixes(c),d}async init(t={}){const r=Object.assign(WS(),t);this.codec=r.codec;const s={};this.stream=s.name=t.streamName??this.bucketName(),s.retention=Zh.Limits,s.max_msgs_per_subject=r.history,r.maxBucketSize&&(r.max_bytes=r.maxBucketSize),r.max_bytes&&(s.max_bytes=r.max_bytes),s.max_msg_size=r.maxValueSize,s.storage=r.storage;const l=t.placementCluster??"";if(l&&(t.placement={},t.placement.cluster=l,t.placement.tags=[]),t.placement&&(s.placement=t.placement),t.republish&&(s.republish=t.republish),t.description&&(s.description=t.description),t.mirror){const b=Object.assign({},t.mirror);b.name.startsWith(cn)||(b.name=`${cn}${b.name}`),s.mirror=b,s.mirror_direct=!0}else if(t.sources){const b=t.sources.map(v=>{const _=Object.assign({},v),w=_.name.startsWith(cn)?_.name.substring(cn.length):_.name;return _.name.startsWith(cn)||(_.name=`${cn}${_.name}`),!v.external&&w!==this.bucket&&(_.subject_transforms=[{src:`$KV.${w}.>`,dest:`$KV.${this.bucket}.>`}]),_});s.sources=b,s.subjects=[this.subjectForBucket()]}else s.subjects=[this.subjectForBucket()];t.metadata&&(s.metadata=t.metadata),typeof t.compression=="boolean"&&(s.compression=t.compression?hi.S2:hi.None);const c=this.js.nc,d=c.getServerVersion(),p=d?td(d,Ii("2.7.2"))>=0:!1;s.discard=p?uo.New:uo.Old;const{ok:g,min:f}=c.features.get(Pe.JS_ALLOW_DIRECT);if(!g&&t.allow_direct===!0){const b=d?`${d.major}.${d.minor}.${d.micro}`:"unknown";return Promise.reject(new Error(`allow_direct is not available on server version ${b} - requires ${f}`))}t.allow_direct=typeof t.allow_direct=="boolean"?t.allow_direct:g,s.allow_direct=t.allow_direct,this.direct=s.allow_direct,s.num_replicas=r.replicas,r.ttl&&(s.max_age=rt(r.ttl)),s.allow_rollup_hdrs=!0;let m;try{m=await this.jsm.streams.info(s.name),!m.config.allow_direct&&this.direct===!0&&(this.direct=!1)}catch(b){if(b.message==="stream not found")m=await this.jsm.streams.add(s);else throw b}this.initializePrefixes(m)}initializePrefixes(t){this._prefixLen=0,this.prefix=`$KV.${this.bucket}`,this.useJsPrefix=this.js.apiPrefix!=="$JS.API";const{mirror:r}=t.config;if(r){let s=r.name;if(s.startsWith(cn)&&(s=s.substring(cn.length)),r.external&&r.external.api!==""){const l=r.name.substring(cn.length);this.useJsPrefix=!1,this.prefix=`$KV.${l}`,this.editPrefix=`${r.external.api}.$KV.${s}`}else this.editPrefix=this.prefix}}bucketName(){return this.stream??`${cn}${this.bucket}`}subjectForBucket(){return`${this.prefix}.${this.bucket}.>`}subjectForKey(t,r=!1){const s=[];return r?(this.useJsPrefix&&s.push(this.js.apiPrefix),this.editPrefix!==""?s.push(this.editPrefix):s.push(this.prefix)):this.prefix&&s.push(this.prefix),s.push(t),s.join(".")}fullKeyName(t){return this.prefix!==""?`${this.prefix}.${t}`:`${fg}.${this.bucket}.${t}`}get prefixLen(){return this._prefixLen===0&&(this._prefixLen=this.prefix.length+1),this._prefixLen}encodeKey(t){const r=[];for(const s of t.split("."))switch(s){case">":case"*":r.push(s);break;default:r.push(this.codec.key.encode(s));break}return r.join(".")}decodeKey(t){const r=[];for(const s of t.split("."))switch(s){case">":case"*":r.push(s);break;default:r.push(this.codec.key.decode(s));break}return r.join(".")}close(){return Promise.resolve()}dataLen(t,r){const s=r&&r.get(It.MessageSizeHdr)||"";return s!==""?parseInt(s,10):t.length}smToEntry(t){return new x2(this.bucket,this.prefixLen,t)}jmToEntry(t){const r=this.decodeKey(t.subject.substring(this.prefixLen));return new _2(this.bucket,r,t)}async create(t,r){var c;let s;try{const d=await this.put(t,r,{previousSeq:0});return Promise.resolve(d)}catch(d){if(s=d,((c=d==null?void 0:d.api_error)==null?void 0:c.err_code)!==10071)return Promise.reject(d)}let l=0;try{const d=await this.get(t);return(d==null?void 0:d.operation)==="DEL"||(d==null?void 0:d.operation)==="PURGE"?(l=d!==null?d.revision:0,this.update(t,r,l)):Promise.reject(s)}catch(d){return Promise.reject(d)}}update(t,r,s){if(s<=0)throw new Error("version must be greater than 0");return this.put(t,r,{previousSeq:s})}async put(t,r,s={}){var d,p;const l=this.encodeKey(t);this.validateKey(l);const c={};if(s.previousSeq!==void 0){const g=Sr();c.headers=g,g.set(Xn.ExpectedLastSubjectSequenceHdr,`${s.previousSeq}`)}try{return(await this.js.publish(this.subjectForKey(l,!0),r,c)).seq}catch(g){const f=g;return f.isJetStreamError()?(f.message=(d=f.api_error)==null?void 0:d.description,f.code=`${(p=f.api_error)==null?void 0:p.code}`,Promise.reject(f)):Promise.reject(g)}}async get(t,r){const s=this.encodeKey(t);this.validateKey(s);let l={last_by_subj:this.subjectForKey(s)};r&&r.revision>0&&(l={seq:r.revision});let c;try{this.direct?c=await this.jsm.direct.getMessage(this.bucketName(),l):c=await this.jsm.streams.getMessage(this.bucketName(),l);const d=this.smToEntry(c);return d.key!==s?null:d}catch(d){if(d.code===ce.JetStream404NoMessages)return null;throw d}}purge(t,r){return this._deleteOrPurge(t,"PURGE",r)}delete(t,r){return this._deleteOrPurge(t,"DEL",r)}async purgeDeletes(t=1800*1e3){const r=it(),s=[],l=await this.watch({key:">",initializedFn:()=>{r.resolve()}});(async()=>{for await(const g of l)(g.operation==="DEL"||g.operation==="PURGE")&&s.push(g)})().then(),await r,l.stop();const c=Date.now()-t,d=s.map(g=>{const f=this.subjectForKey(g.key);return g.created.getTime()>=c?this.jsm.streams.purge(this.stream,{filter:f,keep:1}):this.jsm.streams.purge(this.stream,{filter:f,keep:0})}),p=await Promise.all(d);return p.unshift({success:!0,purged:0}),p.reduce((g,f)=>(g.purged+=f.purged,g))}async _deleteOrPurge(t,r,s){if(!this.hasWildcards(t))return this._doDeleteOrPurge(t,r,s);const l=await this.keys(t),c=[];for await(const d of l)c.push(this._doDeleteOrPurge(d,r)),c.length===100&&(await Promise.all(c),c.length=0);c.length>0&&await Promise.all(c)}async _doDeleteOrPurge(t,r,s){const l=this.encodeKey(t);this.validateKey(l);const c=Sr();c.set(Wc,r),r==="PURGE"&&c.set(It.RollupHdr,It.RollupValueSubject),s!=null&&s.previousSeq&&c.set(Xn.ExpectedLastSubjectSequenceHdr,`${s.previousSeq}`),await this.js.publish(this.subjectForKey(l,!0),hn,{headers:c})}_buildCC(t,r,s={}){let c=(Array.isArray(t)?t:[t]).map(g=>{const f=this.encodeKey(g);return this.validateSearchKey(g),this.fullKeyName(f)}),d=gt.LastPerSubject;r===Un.AllHistory&&(d=gt.All),r===Un.UpdatesOnly&&(d=gt.New);let p;return c.length===1&&(p=c[0],c=void 0),Object.assign({deliver_policy:d,ack_policy:At.None,filter_subjects:c,filter_subject:p,flow_control:!0,idle_heartbeat:rt(5*1e3)},s)}remove(t){return this.purge(t)}async history(t={}){const r=t.key??">",s=new jt,l={};l.headers_only=t.headers_only||!1;let c;c=()=>{s.stop()};let d=0;const p=this._buildCC(r,Un.AllHistory,l),g=p.filter_subject,f=li(p);f.bindStream(this.stream),f.orderedConsumer(),f.callback((b,v)=>{if(b){s.stop(b);return}if(v){const _=this.jmToEntry(v);s.push(_),s.received++,(c&&d>0&&s.received>=d||v.info.pending===0)&&(s.push(c),c=void 0)}});const m=await this.js.subscribe(g,f);if(c){const{info:{last:b}}=m,v=b.num_pending+b.delivered.consumer_seq;if(v===0||s.received>=v)try{c()}catch(_){s.stop(_)}finally{c=void 0}else d=v}return s._data=m,s.iterClosed.then(()=>{m.unsubscribe()}),m.closed.then(()=>{s.stop()}).catch(b=>{s.stop(b)}),s}canSetWatcherName(){const r=this.js.nc,{ok:s}=r.features.get(Pe.JS_NEW_CONSUMER_CREATE_API);return s}async watch(t={}){const r=t.key??">",s=new jt,l={};l.headers_only=t.headers_only||!1;let c=Un.LastValue;t.include===Un.AllHistory?c=Un.AllHistory:t.include===Un.UpdatesOnly&&(c=Un.UpdatesOnly);const d=t.ignoreDeletes===!0;let p=t.initializedFn,g=0;const f=this._buildCC(r,c,l),m=f.filter_subject,b=li(f);this.canSetWatcherName()&&b.consumerName(fi.next()),b.bindStream(this.stream),t.resumeFromRevision&&t.resumeFromRevision>0&&b.startSequence(t.resumeFromRevision),b.orderedConsumer(),b.callback((_,w)=>{if(_){s.stop(_);return}if(w){const S=this.jmToEntry(w);if(d&&S.operation==="DEL")return;s.push(S),s.received++,p&&(g>0&&s.received>=g||w.info.pending===0)&&(s.push(p),p=void 0)}});const v=await this.js.subscribe(m,b);if(p){const{info:{last:_}}=v,w=_.num_pending+_.delivered.consumer_seq;if(w===0||s.received>=w)try{p()}catch(S){s.stop(S)}finally{p=void 0}else g=w}return s._data=v,s.iterClosed.then(()=>{v.unsubscribe()}),v.closed.then(()=>{s.stop()}).catch(_=>{s.stop(_)}),s}async keys(t=">"){const r=new jt,s=this._buildCC(t,Un.LastValue,{headers_only:!0}),l=Array.isArray(t)?">":s.filter_subject,c=li(s);c.bindStream(this.stream),c.orderedConsumer();const d=await this.js.subscribe(l,c);return(async()=>{var g;for await(const f of d){const m=(g=f.headers)==null?void 0:g.get(Wc);if(m!=="DEL"&&m!=="PURGE"){const b=this.decodeKey(f.subject.substring(this.prefixLen));r.push(b)}f.info.pending===0&&d.unsubscribe()}})().then(()=>{r.stop()}).catch(g=>{r.stop(g)}),d.info.last.num_pending===0&&d.unsubscribe(),r}purgeBucket(t){return this.jsm.streams.purge(this.bucketName(),t)}destroy(){return this.jsm.streams.delete(this.bucketName())}async status(){var c;const r=((c=this.js.nc.info)==null?void 0:c.cluster)??"",s=this.bucketName(),l=await this.jsm.streams.info(s);return new vb(l,r)}}class vb{constructor(t,r=""){A(this,"si");A(this,"cluster");this.si=t,this.cluster=r}get bucket(){return this.si.config.name.startsWith(cn)?this.si.config.name.substring(cn.length):this.si.config.name}get values(){return this.si.state.messages}get history(){return this.si.config.max_msgs_per_subject}get ttl(){return Ed(this.si.config.max_age)}get bucket_location(){return this.cluster}get backingStore(){return this.si.config.storage}get storage(){return this.si.config.storage}get replicas(){return this.si.config.num_replicas}get description(){return this.si.config.description??""}get maxBucketSize(){return this.si.config.max_bytes}get maxValueSize(){return this.si.config.max_msg_size}get max_bytes(){return this.si.config.max_bytes}get placement(){return this.si.config.placement||{cluster:"",tags:[]}}get placementCluster(){var t;return((t=this.si.config.placement)==null?void 0:t.cluster)??""}get republish(){return this.si.config.republish??{src:"",dest:""}}get streamInfo(){return this.si}get size(){return this.si.state.bytes}get metadata(){return this.si.config.metadata??{}}get compression(){return this.si.config.compression?this.si.config.compression!==hi.None:!1}}const jd="OBJ_",hg="SHA-256=";function a2(i){return Pc(i),`${jd}${i}`}function o2(i){return i.startsWith(jd)?i.substring(4):i}class sd{constructor(t){A(this,"si");A(this,"backingStore");this.si=t,this.backingStore="JetStream"}get bucket(){return o2(this.si.config.name)}get description(){return this.si.config.description??""}get ttl(){return this.si.config.max_age}get storage(){return this.si.config.storage}get replicas(){return this.si.config.num_replicas}get sealed(){return this.si.config.sealed}get size(){return this.si.state.bytes}get streamInfo(){return this.si}get metadata(){return this.si.config.metadata}get compression(){return this.si.config.compression?this.si.config.compression!==hi.None:!1}}function Kl(i){if(i===void 0)return;const{domain:t}=i;if(t===void 0)return i;const r=Object.assign({},i);if(delete r.domain,t==="")return r;if(r.external)throw new Error("domain and external are both set");return r.external={api:`$JS.${t}.API`},r}var Tn;(function(i){i[i.Unset=-1]="Unset",i[i.Consume=0]="Consume",i[i.Fetch=1]="Fetch"})(Tn||(Tn={}));var Jn;(function(i){i.HeartbeatsMissed="heartbeats_missed",i.ConsumerNotFound="consumer_not_found",i.StreamNotFound="stream_not_found",i.ConsumerDeleted="consumer_deleted",i.OrderedConsumerRecreated="ordered_consumer_recreated",i.NoResponders="no_responders"})(Jn||(Jn={}));var Is;(function(i){i.DebugEvent="debug",i.Discard="discard",i.Reset="reset",i.Next="next"})(Is||(Is={}));const dg=Uint8Array.of(43,65,67,75),l2=Uint8Array.of(45,78,65,75),Va=Uint8Array.of(43,87,80,73),c2=Uint8Array.of(43,78,88,84),u2=Uint8Array.of(43,84,69,82,77),f2=Uint8Array.of(32);function mo(i,t=5e3){return new T2(i,t)}class Dh extends jt{constructor(r,s,l=!1){super();A(this,"consumer");A(this,"opts");A(this,"sub");A(this,"monitor");A(this,"pending");A(this,"inbox");A(this,"refilling");A(this,"pong");A(this,"callback");A(this,"timeout");A(this,"cleanupHandler");A(this,"listeners");A(this,"statusIterator");A(this,"forOrderedConsumer");A(this,"resetHandler");A(this,"abortOnMissingResource");A(this,"bind");A(this,"inBackOff");this.consumer=r;const c=s;this.opts=this.parseOptions(s,l),this.callback=c.callback||null,this.noIterator=typeof this.callback=="function",this.monitor=null,this.pong=null,this.pending={msgs:0,bytes:0,requests:0},this.refilling=l,this.timeout=null,this.inbox=wr(r.api.nc.options.inboxPrefix),this.listeners=[],this.forOrderedConsumer=!1,this.abortOnMissingResource=c.abort_on_missing_resource===!0,this.bind=c.bind===!0,this.inBackOff=!1,this.start()}start(){const{max_messages:r,max_bytes:s,idle_heartbeat:l,threshold_bytes:c,threshold_messages:d}=this.opts;this.closed().then(g=>{if(this.cleanupHandler)try{this.cleanupHandler(g)}catch{}});const{sub:p}=this;p&&p.unsubscribe(),this.sub=this.consumer.api.nc.subscribe(this.inbox,{callback:(g,f)=>{var b,v,_,w;if(g){this.stop(g);return}if((b=this.monitor)==null||b.work(),f.subject===this.inbox){if(Qh(f))return;const S=(v=f.headers)==null?void 0:v.code,C=((w=(_=f.headers)==null?void 0:_.description)==null?void 0:w.toLowerCase())||"unknown",{msgsLeft:L,bytesLeft:z}=this.parseDiscard(f.headers);if(L>0||z>0)this.pending.msgs-=L,this.pending.bytes-=z,this.pending.requests--,this.notify(Is.Discard,{msgsLeft:L,bytesLeft:z});else if(S===400){this.stop(new me(C,`${S}`));return}else if(S===409&&C==="consumer deleted"){if(this.notify(Jn.ConsumerDeleted,`${S} ${C}`),!this.refilling||this.abortOnMissingResource){const se=new me(C,`${S}`);this.stop(se);return}}else if(S===503){if(this.notify(Jn.NoResponders,`${S} No Responders`),!this.refilling||this.abortOnMissingResource){const se=new me("no responders",`${S}`);this.stop(se);return}}else this.notify(Is.DebugEvent,`${S} ${C}`)}else this._push(mo(f,this.consumer.api.timeout)),this.received++,this.pending.msgs&&this.pending.msgs--,this.pending.bytes&&(this.pending.bytes-=f.size());if(this.pending.msgs===0&&this.pending.bytes===0&&(this.pending.requests=0),this.refilling){if(r&&this.pending.msgs<=d||s&&this.pending.bytes<=c){const S=this.pullOptions();this.pull(S)}}else this.pending.requests===0&&this._push(()=>{this.stop()})}}),this.sub.closed.then(()=>{this.sub.draining&&this._push(()=>{this.stop()})}),l&&(this.monitor=new Ad(l,g=>(this.notify(Jn.HeartbeatsMissed,g),this.resetPending().then(()=>{}).catch(()=>{}),!1),{maxOut:2})),(async()=>{var f;const g=this.consumer.api.nc.status();this.statusIterator=g;for await(const m of g)switch(m.type){case _r.Disconnect:(f=this.monitor)==null||f.cancel();break;case _r.Reconnect:this.resetPending().then(b=>{var v;b&&((v=this.monitor)==null||v.restart())}).catch(()=>{});break}})(),this.pull(this.pullOptions())}_push(r){if(!this.callback)super.push(r);else{const s=typeof r=="function"?r:null;try{s?s():this.callback(r)}catch(l){this.stop(l)}}}notify(r,s){this.listeners.length>0&&this.listeners.forEach(l=>{l.done||l.push({type:r,data:s})})}resetPending(){return this.bind?this.resetPendingNoInfo():this.resetPendingWithInfo()}resetPendingNoInfo(){return this.pending.msgs=0,this.pending.bytes=0,this.pending.requests=0,this.pull(this.pullOptions()),Promise.resolve(!0)}async resetPendingWithInfo(){if(this.inBackOff)return!1;let r=0,s=0;const l=Sd([this.opts.expires]);let c=0;for(;;){if(this.done)return!1;if(this.consumer.api.nc.isClosed())return console.error("aborting resetPending - connection is closed"),!1;try{return await this.consumer.info(),this.inBackOff=!1,r=0,this.pending.msgs=0,this.pending.bytes=0,this.pending.requests=0,this.pull(this.pullOptions()),!0}catch(d){if(d.message==="stream not found"){if(s++,this.notify(Jn.StreamNotFound,s),!this.refilling||this.abortOnMissingResource)return this.stop(d),!1}else if(d.message==="consumer not found"){if(r++,this.notify(Jn.ConsumerNotFound,r),this.resetHandler)try{this.resetHandler()}catch{}if(!this.refilling||this.abortOnMissingResource)return this.stop(d),!1;if(this.forOrderedConsumer)return!1}else r=0,s=0;this.inBackOff=!0;const p=l.backoff(c),g=Ys(p);await Promise.race([g,this.consumer.api.nc.closed()]),g.cancel(),c++}}}pull(r){this.pending.bytes+=r.max_bytes??0,this.pending.msgs+=r.batch??0,this.pending.requests++;const s=this.consumer.api.nc;this._push(()=>{s.publish(`${this.consumer.api.prefix}.CONSUMER.MSG.NEXT.${this.consumer.stream}.${this.consumer.name}`,this.consumer.api.jc.encode(r),{reply:this.inbox}),this.notify(Is.Next,r)})}pullOptions(){const r=this.opts.max_messages-this.pending.msgs,s=this.opts.max_bytes-this.pending.bytes,l=rt(this.opts.idle_heartbeat),c=rt(this.opts.expires);return{batch:r,max_bytes:s,idle_heartbeat:l,expires:c}}parseDiscard(r){const s={msgsLeft:0,bytesLeft:0},l=r==null?void 0:r.get(It.PendingMessagesHdr);l&&(s.msgsLeft=parseInt(l));const c=r==null?void 0:r.get(It.PendingBytesHdr);return c&&(s.bytesLeft=parseInt(c)),s}trackTimeout(r){this.timeout=r}close(){return this.stop(),this.iterClosed}closed(){return this.iterClosed}clearTimers(){var r,s;(r=this.monitor)==null||r.cancel(),this.monitor=null,(s=this.timeout)==null||s.cancel(),this.timeout=null}setCleanupHandler(r){this.cleanupHandler=r}stop(r){var s,l;this.done||((s=this.sub)==null||s.unsubscribe(),this.clearTimers(),(l=this.statusIterator)==null||l.stop(),this._push(()=>{super.stop(r),this.listeners.forEach(c=>{c.stop()})}))}parseOptions(r,s=!1){const l=r||{};if(l.max_messages=l.max_messages||0,l.max_bytes=l.max_bytes||0,l.max_messages!==0&&l.max_bytes!==0)throw new Error("only specify one of max_messages or max_bytes");if(l.max_messages===0&&(l.max_messages=100),l.expires=l.expires||3e4,l.expires<1e3)throw new Error("expires should be at least 1000ms");if(l.idle_heartbeat=l.idle_heartbeat||l.expires/2,l.idle_heartbeat=l.idle_heartbeat>3e4?3e4:l.idle_heartbeat,s){const c=Math.round(l.max_messages*.75)||1;l.threshold_messages=l.threshold_messages||c;const d=Math.round(l.max_bytes*.75)||1;l.threshold_bytes=l.threshold_bytes||d}return l}status(){const r=new jt;return this.listeners.push(r),Promise.resolve(r)}}class h2 extends jt{constructor(){super();A(this,"src");A(this,"listeners");this.listeners=[]}setSource(r){this.src&&(this.src.resetHandler=void 0,this.src.setCleanupHandler(),this.src.stop()),this.src=r,this.src.setCleanupHandler(s=>{this.stop(s||void 0)}),(async()=>{const s=await this.src.status();for await(const l of s)this.notify(l.type,l.data)})().catch(()=>{})}notify(r,s){this.listeners.length>0&&this.listeners.forEach(l=>{l.done||l.push({type:r,data:s})})}stop(r){var s;this.done||((s=this.src)==null||s.stop(r),super.stop(r),this.listeners.forEach(l=>{l.stop()}))}close(){return this.stop(),this.iterClosed}closed(){return this.iterClosed}status(){const r=new jt;return this.listeners.push(r),Promise.resolve(r)}}class ad{constructor(t,r){A(this,"api");A(this,"_info");A(this,"stream");A(this,"name");this.api=t,this._info=r,this.stream=r.stream_name,this.name=r.name}consume(t={max_messages:100,expires:3e4}){return Promise.resolve(new Dh(this,t,!0))}fetch(t={max_messages:100,expires:3e4}){const r=new Dh(this,t,!1),s=Math.round(r.opts.expires*1.05),l=Gs(s);return r.closed().catch(()=>{}).finally(()=>{l.cancel()}),l.catch(()=>{r.close().catch()}),r.trackTimeout(l),Promise.resolve(r)}next(t={expires:3e4}){const r=it(),s=t;s.max_messages=1;const l=new Dh(this,s,!1),c=Math.round(l.opts.expires*1.05);c>=6e4&&(async()=>{for await(const p of await l.status())if(p.type===Jn.HeartbeatsMissed&&p.data>=2){r.reject(new Error("consumer missed heartbeats"));break}})().catch(),(async()=>{for await(const p of l){r.resolve(p);break}})().catch(()=>{});const d=Gs(c);return l.closed().then(p=>{p?r.reject(p):r.resolve(null)}).catch(p=>{r.reject(p)}).finally(()=>{d.cancel()}),d.catch(p=>{r.resolve(null),l.close().catch()}),l.trackTimeout(d),r}delete(){const{stream_name:t,name:r}=this._info;return this.api.delete(t,r)}info(t=!1){if(t)return Promise.resolve(this._info);const{stream_name:r,name:s}=this._info;return this.api.info(r,s).then(l=>(this._info=l,this._info))}}class d2{constructor(t,r,s={}){A(this,"api");A(this,"consumerOpts");A(this,"consumer");A(this,"opts");A(this,"cursor");A(this,"stream");A(this,"namePrefix");A(this,"serial");A(this,"currentConsumer");A(this,"userCallback");A(this,"iter");A(this,"type");A(this,"startSeq");A(this,"maxInitialReset");this.api=t,this.stream=r,this.cursor={stream_seq:1,deliver_seq:0},this.namePrefix=fi.next(),typeof s.name_prefix=="string"&&(au("name_prefix",s.name_prefix),this.namePrefix=s.name_prefix+this.namePrefix),this.serial=0,this.currentConsumer=null,this.userCallback=null,this.iter=null,this.type=Tn.Unset,this.consumerOpts=s,this.maxInitialReset=30,this.startSeq=this.consumerOpts.opt_start_seq||0,this.cursor.stream_seq=this.startSeq>0?this.startSeq-1:0}getConsumerOpts(t){this.serial++;const r=`${this.namePrefix}_${this.serial}`;t=t===0?1:t;const s={name:r,deliver_policy:gt.StartSequence,opt_start_seq:t,ack_policy:At.None,inactive_threshold:rt(300*1e3),num_replicas:1};return this.consumerOpts.headers_only===!0&&(s.headers_only=!0),Array.isArray(this.consumerOpts.filterSubjects)&&(s.filter_subjects=this.consumerOpts.filterSubjects),typeof this.consumerOpts.filterSubjects=="string"&&(s.filter_subject=this.consumerOpts.filterSubjects),this.consumerOpts.replay_policy&&(s.replay_policy=this.consumerOpts.replay_policy),t===this.startSeq+1&&(s.deliver_policy=this.consumerOpts.deliver_policy||gt.StartSequence,(this.consumerOpts.deliver_policy===gt.LastPerSubject||this.consumerOpts.deliver_policy===gt.New||this.consumerOpts.deliver_policy===gt.Last)&&(delete s.opt_start_seq,s.deliver_policy=this.consumerOpts.deliver_policy),s.deliver_policy===gt.LastPerSubject&&typeof s.filter_subjects>"u"&&typeof s.filter_subject>"u"&&(s.filter_subject=">"),this.consumerOpts.opt_start_time&&(delete s.opt_start_seq,s.deliver_policy=gt.StartTime,s.opt_start_time=this.consumerOpts.opt_start_time),this.consumerOpts.inactive_threshold&&(s.inactive_threshold=rt(this.consumerOpts.inactive_threshold))),s}async resetConsumer(t=0){var d,p,g,f,m;fi.next();const r=this.serial===0;(d=this.consumer)==null||d.delete().catch(()=>{}),t=t===0?1:t,this.cursor.deliver_seq=0;const s=this.getConsumerOpts(t);s.max_deliver=1,s.mem_storage=!0;const l=Sd([((p=this.opts)==null?void 0:p.expires)||3e4]);let c;for(let b=0;;b++)try{c=await this.api.add(this.stream,s),(g=this.iter)==null||g.notify(Jn.OrderedConsumerRecreated,c.name);break}catch(v){if(v.message==="stream not found"&&((f=this.iter)==null||f.notify(Jn.StreamNotFound,b),this.type===Tn.Fetch||this.opts.abort_on_missing_resource===!0))return(m=this.iter)==null||m.stop(v),Promise.reject(v);if(r&&b>=this.maxInitialReset)throw v;await Ys(l.backoff(b+1))}return c}internalHandler(t){return r=>{var l;if(this.serial!==t)return;const s=r.info.deliverySequence;if(s!==this.cursor.deliver_seq+1){this.notifyOrderedResetAndReset();return}this.cursor.deliver_seq=s,this.cursor.stream_seq=r.info.streamSequence,this.userCallback?this.userCallback(r):(l=this.iter)==null||l.push(r)}}async reset(t={max_messages:100,expires:3e4},r){var g,f;r=r||{};const s=r.fromFetch||!1,l=r.orderedReset||!1;if(this.type===Tn.Fetch&&l){(g=this.iter)==null||g.src.stop(),await((f=this.iter)==null?void 0:f.closed()),this.currentConsumer=null;return}(this.currentConsumer===null||l)&&(this.currentConsumer=await this.resetConsumer(this.cursor.stream_seq+1)),(this.iter===null||s)&&(this.iter=new h2),this.consumer=new ad(this.api,this.currentConsumer);const c=t;c.callback=this.internalHandler(this.serial);let d=null;this.type===Tn.Fetch&&s?d=await this.consumer.fetch(t):this.type===Tn.Consume&&(d=await this.consumer.consume(t));const p=d;p.forOrderedConsumer=!0,p.resetHandler=()=>{this.notifyOrderedResetAndReset()},this.iter.setSource(p)}notifyOrderedResetAndReset(){var t;(t=this.iter)==null||t.notify(Is.Reset,""),this.reset(this.opts,{orderedReset:!0})}async consume(t={max_messages:100,expires:3e4}){if(t.bind)return Promise.reject(new Error("bind is not supported"));if(this.type===Tn.Fetch)return Promise.reject(new Error("ordered consumer initialized as fetch"));if(this.type===Tn.Consume)return Promise.reject(new Error("ordered consumer doesn't support concurrent consume"));const{callback:s}=t;return s&&(this.userCallback=s),this.type=Tn.Consume,this.opts=t,await this.reset(t),this.iter}async fetch(t={max_messages:100,expires:3e4}){var l;if(t.bind)return Promise.reject(new Error("bind is not supported"));if(this.type===Tn.Consume)return Promise.reject(new Error("ordered consumer already initialized as consume"));if(((l=this.iter)==null?void 0:l.done)===!1)return Promise.reject(new Error("ordered consumer doesn't support concurrent fetch"));const{callback:s}=t;return s&&(this.userCallback=s),this.type=Tn.Fetch,this.opts=t,await this.reset(t,{fromFetch:!0}),this.iter}async next(t={expires:3e4}){const r=t;if(r.bind)return Promise.reject(new Error("bind is not supported"));r.max_messages=1;const s=it();return r.callback=c=>{this.userCallback=null,s.resolve(c)},(await this.fetch(r)).iterClosed.then(c=>{c&&s.reject(c),s.resolve(null)}).catch(c=>{s.reject(c)}),s}delete(){return this.currentConsumer?this.api.delete(this.stream,this.currentConsumer.name).then(t=>Promise.resolve(t)).catch(t=>Promise.reject(t)).finally(()=>{this.currentConsumer=null}):Promise.resolve(!1)}async info(t){return this.currentConsumer==null?(this.currentConsumer=await this.resetConsumer(this.startSeq),Promise.resolve(this.currentConsumer)):t&&this.currentConsumer?Promise.resolve(this.currentConsumer):this.api.info(this.stream,this.currentConsumer.name)}}class od{constructor(t){A(this,"api");A(this,"notified");this.api=t,this.notified=!1}checkVersion(){const t=this.api.nc.features.get(Pe.JS_SIMPLIFICATION);return t.ok?Promise.resolve():Promise.reject(new Error(`consumers framework is only supported on servers ${t.min} or better`))}getPullConsumerFor(t){if(t.config.deliver_subject!==void 0)throw new Error("push consumer not supported");return new ad(this.api,t)}async get(t,r={}){return typeof r=="object"?this.ordered(t,r):(await this.checkVersion(),this.api.info(t,r).then(s=>s.config.deliver_subject!==void 0?Promise.reject(new Error("push consumer not supported")):new ad(this.api,s)).catch(s=>Promise.reject(s)))}async ordered(t,r){await this.checkVersion();const s=this.api;return new Td(s.nc,s.opts).info(t).then(c=>Promise.resolve(new d2(this.api,t,r))).catch(c=>Promise.reject(c))}}class lu{constructor(t,r){A(this,"api");A(this,"_info");this.api=t,this._info=r}get name(){return this._info.config.name}alternates(){return this.info().then(t=>t.alternates?t.alternates:[])}async best(){if(await this.info(),this._info.alternates){const t=await this.api.info(this._info.alternates[0].name);return new lu(this.api,t)}else return this}info(t=!1,r){return t?Promise.resolve(this._info):this.api.info(this.name,r).then(s=>(this._info=s,this._info))}getConsumerFromInfo(t){return new od(new Jc(this.api.nc,this.api.opts)).getPullConsumerFor(t)}getConsumer(t){return new od(new Jc(this.api.nc,this.api.opts)).get(this.name,t)}getMessage(t){return this.api.getMessage(this.name,t)}deleteMessage(t,r){return this.api.deleteMessage(this.name,t,r)}}class Td extends go{constructor(t,r){super(t,r)}checkStreamConfigVersions(t){const r=this.nc;if(t.metadata){const{min:l,ok:c}=r.features.get(Pe.JS_STREAM_CONSUMER_METADATA);if(!c)throw new Error(`stream 'metadata' requires server ${l}`)}if(t.first_seq){const{min:l,ok:c}=r.features.get(Pe.JS_STREAM_FIRST_SEQ);if(!c)throw new Error(`stream 'first_seq' requires server ${l}`)}if(t.subject_transform){const{min:l,ok:c}=r.features.get(Pe.JS_STREAM_SUBJECT_TRANSFORM);if(!c)throw new Error(`stream 'subject_transform' requires server ${l}`)}if(t.compression){const{min:l,ok:c}=r.features.get(Pe.JS_STREAM_COMPRESSION);if(!c)throw new Error(`stream 'compression' requires server ${l}`)}if(t.consumer_limits){const{min:l,ok:c}=r.features.get(Pe.JS_DEFAULT_CONSUMER_LIMITS);if(!c)throw new Error(`stream 'consumer_limits' requires server ${l}`)}function s(l,c){var p;if((((p=c==null?void 0:c.subject_transforms)==null?void 0:p.length)||0)>0){const{min:g,ok:f}=r.features.get(Pe.JS_STREAM_SOURCE_SUBJECT_TRANSFORM);if(!f)throw new Error(`${l} 'subject_transforms' requires server ${g}`)}}t.sources&&t.sources.forEach(l=>{s("stream sources",l)}),t.mirror&&s("stream mirror",t.mirror)}async add(t={}){var l;this.checkStreamConfigVersions(t),Pt(t.name),t.mirror=Kl(t.mirror),t.sources=(l=t.sources)==null?void 0:l.map(Kl);const s=await this._request(`${this.prefix}.STREAM.CREATE.${t.name}`,t);return this._fixInfo(s),s}async delete(t){return Pt(t),(await this._request(`${this.prefix}.STREAM.DELETE.${t}`)).success}async update(t,r={}){var p;if(typeof t=="object"){const g=t;t=g.name,r=g,console.trace("\x1B[33m >> streams.update(config: StreamConfig) api changed to streams.update(name: string, config: StreamUpdateConfig) - this shim will be removed - update your code. \x1B[0m")}this.checkStreamConfigVersions(r),Pt(t);const s=await this.info(t),l=Object.assign(s.config,r);l.mirror=Kl(l.mirror),l.sources=(p=l.sources)==null?void 0:p.map(Kl);const d=await this._request(`${this.prefix}.STREAM.UPDATE.${t}`,l);return this._fixInfo(d),d}async info(t,r){Pt(t);const s=`${this.prefix}.STREAM.INFO.${t}`;let c=await this._request(s,r),{total:d,limit:p}=c,g=c.state.subjects?Object.getOwnPropertyNames(c.state.subjects).length:1;if(d&&d>g){const f=[c],m=r||{};let b=0;for(;d>g;){b++,m.offset=p*b;const _=await this._request(s,m);d=_.total,f.push(_);const w=Object.getOwnPropertyNames(_.state.subjects).length;if(g+=w,w<p)break}let v={};for(let _=0;_<f.length;_++)c=f[_],c.state.subjects&&(v=Object.assign(v,c.state.subjects));c.offset=0,c.total=0,c.limit=0,c.state.subjects=v}return this._fixInfo(c),c}list(t=""){const r=t!=null&&t.length?{subject:t}:{},s=c=>{const d=c;return d.streams.forEach(p=>{this._fixInfo(p)}),d.streams},l=`${this.prefix}.STREAM.LIST`;return new ro(l,s,this,r)}_fixInfo(t){t.config.sealed=t.config.sealed||!1,t.config.deny_delete=t.config.deny_delete||!1,t.config.deny_purge=t.config.deny_purge||!1,t.config.allow_rollup_hdrs=t.config.allow_rollup_hdrs||!1}async purge(t,r){if(r){const{keep:l,seq:c}=r;if(typeof l=="number"&&typeof c=="number")throw new Error("can specify one of keep or seq")}return Pt(t),await this._request(`${this.prefix}.STREAM.PURGE.${t}`,r)}async deleteMessage(t,r,s=!0){Pt(t);const l={seq:r};return s||(l.no_erase=!0),(await this._request(`${this.prefix}.STREAM.MSG.DELETE.${t}`,l)).success}async getMessage(t,r){Pt(t);const l=await this._request(`${this.prefix}.STREAM.MSG.GET.${t}`,r);return new xb(l)}find(t){return this.findStream(t)}listKvs(){const t=s=>{var g;const c=s.streams.filter(f=>f.config.name.startsWith(cn));c.forEach(f=>{this._fixInfo(f)});let d="";return c.length&&(d=((g=this.nc.info)==null?void 0:g.cluster)??""),c.map(f=>new vb(f,d))},r=`${this.prefix}.STREAM.LIST`;return new ro(r,t,this)}listObjectStores(){const t=s=>{const c=s.streams.filter(p=>p.config.name.startsWith(jd));return c.forEach(p=>{this._fixInfo(p)}),c.map(p=>new sd(p))},r=`${this.prefix}.STREAM.LIST`;return new ro(r,t,this)}names(t=""){const r=t!=null&&t.length?{subject:t}:{},s=c=>c.streams,l=`${this.prefix}.STREAM.NAMES`;return new ro(l,s,this,r)}async get(t){const r=await this.info(t);return Promise.resolve(new lu(this,r))}}class m2 extends go{constructor(t,r){super(t,r)}async getMessage(t,r){Pt(t);let s=r;const{last_by_subj:l}=s;l&&(s=null);const c=s?this.jc.encode(s):hn,d=this.opts.apiPrefix||"$JS.API",p=l?`${d}.DIRECT.GET.${t}.${l}`:`${d}.DIRECT.GET.${t}`,g=await this.nc.request(p,c,{timeout:this.timeout}),f=Ps(g);if(f)return Promise.reject(f);const m=new ld(g);return Promise.resolve(m)}async getBatch(t,r){Pt(t);const l=`${this.opts.apiPrefix||"$JS.API"}.DIRECT.GET.${t}`;if(!Array.isArray(r.multi_last)||r.multi_last.length===0)return Promise.reject("multi_last is required");const c=JSON.stringify(r,(g,f)=>g==="up_to_time"&&f instanceof Date?f.toISOString():f),d=new jt,p=await this.nc.requestMany(l,c,{strategy:$n.SentinelMsg});return(async()=>{var b,v,_;let g=!1,f=!1,m;for await(const w of p){if(!g){g=!0;const S=((b=w.headers)==null?void 0:b.code)||0;if(S!==0&&S<200||S>299){m=(v=w.headers)==null?void 0:v.description.toLowerCase();break}if(((_=w.headers)==null?void 0:_.get("Nats-Num-Pending"))===""){f=!0;break}}if(w.data.length===0)break;d.push(new ld(w))}d.push(()=>{if(f)throw new Error("batch direct get not supported by the server");if(m)throw new Error(`bad request: ${m}`);d.stop()})})(),Promise.resolve(d)}}class ld{constructor(t){A(this,"data");A(this,"header");if(!t.headers)throw new Error("headers expected");this.data=t.data,this.header=t.headers}get subject(){return this.header.last(Bs.Subject)}get seq(){const t=this.header.last(Bs.Sequence);return typeof t=="string"?parseInt(t):0}get time(){return new Date(Date.parse(this.timestamp))}get timestamp(){return this.header.last(Bs.TimeStamp)}get stream(){return this.header.last(Bs.Stream)}json(t){return In(t).decode(this.data)}string(){return un.decode(this.data)}}A(ld,"jc");class p2 extends go{constructor(r,s){super(r,s);A(this,"streams");A(this,"consumers");A(this,"direct");this.streams=new Td(r,s),this.consumers=new Jc(r,s),this.direct=new m2(r,s)}async getAccountInfo(){return await this._request(`${this.prefix}.INFO`)}jetstream(){return this.nc.jetstream(this.getOptions())}advisories(){const r=new jt;return this.nc.subscribe("$JS.EVENT.ADVISORY.>",{callback:(s,l)=>{if(s)throw s;try{const c=this.parseJsResponse(l),d=c.type.split("."),p=d[d.length-1];r.push({kind:p,data:c})}catch(c){r.stop(c)}}}),r}}class xb{constructor(t){A(this,"_header");A(this,"smr");this.smr=t}get subject(){return this.smr.message.subject}get seq(){return this.smr.message.seq}get timestamp(){return this.smr.message.time}get time(){return new Date(Date.parse(this.timestamp))}get data(){return this.smr.message.data?this._parse(this.smr.message.data):hn}get header(){if(!this._header)if(this.smr.message.hdrs){const t=this._parse(this.smr.message.hdrs);this._header=oi.decode(t)}else this._header=Sr();return this._header}_parse(t){const r=atob(t),s=r.length,l=new Uint8Array(s);for(let c=0;c<s;c++)l[c]=r.charCodeAt(c);return l}json(t){return In(t).decode(this.data)}string(){return un.decode(this.data)}}A(xb,"jc");class y2{constructor(t){A(this,"api");this.api=t}get(t){return this.api.info(t).then(r=>new lu(this.api,r))}}class qh{constructor(t){A(this,"info");A(this,"hdrs");this.info=t}get name(){return this.info.name}get description(){return this.info.description??""}get headers(){return this.hdrs||(this.hdrs=oi.fromRecord(this.info.headers||{})),this.hdrs}get options(){return this.info.options}get bucket(){return this.info.bucket}get chunks(){return this.info.chunks}get deleted(){return this.info.deleted??!1}get digest(){return this.info.digest}get mtime(){return this.info.mtime}get nuid(){return this.info.nuid}get size(){return this.info.size}get revision(){return this.info.revision}get metadata(){return this.info.metadata||{}}isLink(){var t,r;return((t=this.info.options)==null?void 0:t.link)!==void 0&&((r=this.info.options)==null?void 0:r.link)!==null}}function mg(i){const t={name:i.name,description:i.description??"",options:i.options,metadata:i.metadata};if(i.headers){const r=i.headers;t.headers=r.toRecord()}return t}function g2(){return new ReadableStream({pull(i){i.enqueue(new Uint8Array(0)),i.close()}})}class lo{constructor(t,r,s){A(this,"jsm");A(this,"js");A(this,"stream");A(this,"name");this.name=t,this.jsm=r,this.js=s}_checkNotEmpty(t){return!t||t.length===0?{name:t,error:new Error("name cannot be empty")}:{name:t}}async info(t){const r=await this.rawInfo(t);return r?new qh(r):null}async list(){const t=[],r=await this.watch({ignoreDeletes:!0,includeHistory:!0});for await(const s of r){if(s===null)break;t.push(s)}return Promise.resolve(t)}async rawInfo(t){const{name:r,error:s}=this._checkNotEmpty(t);if(s)return Promise.reject(s);const l=this._metaSubject(r);try{const c=await this.jsm.streams.getMessage(this.stream,{last_by_subj:l}),p=In().decode(c.data);return p.revision=c.seq,p}catch(c){return c.code==="404"?null:Promise.reject(c)}}async _si(t){try{return await this.jsm.streams.info(this.stream,t)}catch(r){return r.code==="404"?null:Promise.reject(r)}}async seal(){let t=await this._si();return t===null?Promise.reject(new Error("object store not found")):(t.config.sealed=!0,t=await this.jsm.streams.update(this.stream,t.config),Promise.resolve(new sd(t)))}async status(t){const r=await this._si(t);return r===null?Promise.reject(new Error("object store not found")):Promise.resolve(new sd(r))}destroy(){return this.jsm.streams.delete(this.stream)}async _put(t,r,s){var oe;const l=this.js.getOptions();s=s||{timeout:l.timeout},s.timeout=s.timeout||l.timeout,s.previousRevision=s.previousRevision??void 0;const{timeout:c,previousRevision:d}=s,p=this.js.nc.info,g=(p==null?void 0:p.max_payload)||1024;t=t||{},t.options=t.options||{};let f=((oe=t.options)==null?void 0:oe.max_chunk_size)||128*1024;f=f>g?g:f,t.options.max_chunk_size=f;const m=await this.info(t.name),{name:b,error:v}=this._checkNotEmpty(t.name);if(v)return Promise.reject(v);const _=fi.next(),w=this._chunkSubject(_),S=this._metaSubject(b),C=Object.assign({bucket:this.name,nuid:_,size:0,chunks:0},mg(t)),L=it(),z=[],se=new Vs;try{const M=r?r.getReader():null,B=rg.create();for(;;){const{done:te,value:K}=M?await M.read():{done:!0,value:void 0};if(te){if(se.size()>0){const X=se.drain();B.update(X),C.chunks++,C.size+=X.length,z.push(this.js.publish(w,X,{timeout:c}))}await Promise.all(z),z.length=0,C.mtime=new Date().toISOString();const P=$s.encode(B.digest());C.digest=`${hg}${P}`,C.deleted=!1;const Y=Sr();typeof d=="number"&&Y.set(Xn.ExpectedLastSubjectSequenceHdr,`${d}`),Y.set(It.RollupHdr,It.RollupValueSubject);const W=await this.js.publish(S,In().encode(C),{headers:Y,timeout:c});if(C.revision=W.seq,m)try{await this.jsm.streams.purge(this.stream,{filter:`$O.${this.name}.C.${m.nuid}`})}catch{}L.resolve(new qh(C));break}if(K)for(se.fill(K);se.size()>f;){C.chunks++,C.size+=f;const P=se.drain(t.options.max_chunk_size);B.update(P),z.push(this.js.publish(w,P,{timeout:c}))}}}catch(M){await this.jsm.streams.purge(this.stream,{filter:w}),L.reject(M)}return L}putBlob(t,r,s){function l(c){return new ReadableStream({pull(d){d.enqueue(c),d.close()}})}return r===null&&(r=new Uint8Array(0)),this.put(t,l(r),s)}put(t,r,s){var l;return(l=t==null?void 0:t.options)!=null&&l.link?Promise.reject(new Error("link cannot be set when putting the object in bucket")):this._put(t,r,s)}async getBlob(t){async function r(c){const d=new Vs,p=c.getReader();for(;;){const{done:g,value:f}=await p.read();if(g)return d.drain();f&&f.length&&d.fill(f)}}const s=await this.get(t);if(s===null)return Promise.resolve(null);const l=await Promise.all([s.error,r(s.data)]);return l[0]?Promise.reject(l[0]):Promise.resolve(l[1])}async get(t){const r=await this.rawInfo(t);if(r===null||r.deleted)return Promise.resolve(null);if(r.options&&r.options.link){const b=r.options.link.name||"";if(b==="")throw new Error("link is a bucket");return(r.options.link.bucket!==this.name?await lo.create(this.js,r.options.link.bucket):this).get(b)}if(!r.digest.startsWith(hg))return Promise.reject(new Error(`unknown digest type: ${r.digest}`));const s=ed(r.digest.substring(8));if(s===null)return Promise.reject(new Error(`unable to parse digest: ${r.digest}`));const l=it(),c={info:new qh(r),error:l};if(r.size===0)return c.data=g2(),l.resolve(null),Promise.resolve(c);let d;const p=li();p.orderedConsumer();const g=rg.create(),f=`$O.${this.name}.C.${r.nuid}`,m=await this.js.subscribe(f,p);return(async()=>{for await(const b of m)b.data.length>0&&(g.update(b.data),d.enqueue(b.data)),b.info.pending===0&&(sS(s,g.digest())?d.close():d.error(new Error(`received a corrupt object, digests do not match received: ${r.digest} calculated ${s}`)),m.unsubscribe())})().then(()=>{l.resolve()}).catch(b=>{d.error(b),l.reject(b)}),c.data=new ReadableStream({start(b){d=b},cancel(){m.unsubscribe()}}),c}linkStore(t,r){if(!(r instanceof lo))return Promise.reject("bucket required");const s=r,{name:l,error:c}=this._checkNotEmpty(t);if(c)return Promise.reject(c);const d={name:l,options:{link:{bucket:s.name}}};return this._put(d,null)}async link(t,r){const{name:s,error:l}=this._checkNotEmpty(t);if(l)return Promise.reject(l);if(r.deleted)return Promise.reject(new Error("src object is deleted"));if(r.isLink())return Promise.reject(new Error("src object is a link"));const c=await this.rawInfo(t);if(c!==null&&!c.deleted)return Promise.reject(new Error("an object already exists with that name"));const d={bucket:r.bucket,name:r.name},p={name:s,bucket:r.bucket,options:{link:d}};await this.js.publish(this._metaSubject(t),JSON.stringify(p));const g=await this.info(t);return Promise.resolve(g)}async delete(t){const r=await this.rawInfo(t);if(r===null)return Promise.resolve({purged:0,success:!1});r.deleted=!0,r.size=0,r.chunks=0,r.digest="";const s=In(),l=Sr();return l.set(It.RollupHdr,It.RollupValueSubject),await this.js.publish(this._metaSubject(r.name),s.encode(r),{headers:l}),this.jsm.streams.purge(this.stream,{filter:this._chunkSubject(r.nuid)})}async update(t,r={}){const s=await this.rawInfo(t);if(s===null)return Promise.reject(new Error("object not found"));if(s.deleted)return Promise.reject(new Error("cannot update meta for a deleted object"));r.name=r.name??s.name;const{name:l,error:c}=this._checkNotEmpty(r.name);if(c)return Promise.reject(c);if(t!==r.name){const g=await this.info(r.name);if(g&&!g.deleted)return Promise.reject(new Error("an object already exists with that name"))}r.name=l;const d=Object.assign({},s,mg(r)),p=await this.js.publish(this._metaSubject(d.name),JSON.stringify(d));return t!==r.name&&await this.jsm.streams.purge(this.stream,{filter:this._metaSubject(t)}),Promise.resolve(p)}async watch(t={}){t.includeHistory=t.includeHistory??!1,t.ignoreDeletes=t.ignoreDeletes??!1;let r=!1;const s=new jt,l=this._metaSubjectAll();try{await this.jsm.streams.getMessage(this.stream,{last_by_subj:l})}catch(g){g.code==="404"?(s.push(null),r=!0):s.stop(g)}const c=In(),d=li();d.orderedConsumer(),t.includeHistory?d.deliverLastPerSubject():(r=!0,d.deliverNew()),d.callback((g,f)=>{var m;if(g){s.stop(g);return}if(f!==null){const b=c.decode(f.data);b.deleted&&t.ignoreDeletes===!0||s.push(b),((m=f.info)==null?void 0:m.pending)===0&&!r&&(r=!0,s.push(null))}});const p=await this.js.subscribe(l,d);return s._data=p,s.iterClosed.then(()=>{p.unsubscribe()}),p.closed.then(()=>{s.stop()}).catch(g=>{s.stop(g)}),s}_chunkSubject(t){return`$O.${this.name}.C.${t}`}_metaSubject(t){return`$O.${this.name}.M.${$s.encode(t)}`}_metaSubjectAll(){return`$O.${this.name}.M.>`}async init(t={}){try{this.stream=a2(this.name)}catch(l){return Promise.reject(l)}const r=(t==null?void 0:t.ttl)||0;delete t.ttl;const s=Object.assign({max_age:r},t);s.name=this.stream,s.num_replicas=t.replicas??1,s.allow_direct=!0,s.allow_rollup_hdrs=!0,s.discard=uo.New,s.subjects=[`$O.${this.name}.C.>`,`$O.${this.name}.M.>`],t.placement&&(s.placement=t.placement),t.metadata&&(s.metadata=t.metadata),typeof t.compression=="boolean"&&(s.compression=t.compression?hi.S2:hi.None);try{await this.jsm.streams.info(s.name)}catch(l){l.message==="stream not found"&&await this.jsm.streams.add(s)}}static async create(t,r,s={}){const l=await t.jetstreamManager(),c=new lo(r,l,t);return await c.init(s),Promise.resolve(c)}}class b2{constructor(t){A(this,"js");this.js=t}kv(t,r={}){const s=this.js,{ok:l,min:c}=s.nc.features.get(Pe.JS_KV);return l?r.bindOnly?ho.bind(this.js,t,r):ho.create(this.js,t,r):Promise.reject(new Error(`kv is only supported on servers ${c} or better`))}os(t,r={}){var d;if(typeof((d=crypto==null?void 0:crypto.subtle)==null?void 0:d.digest)!="function")return Promise.reject(new Error("objectstore: unable to calculate hashes - crypto.subtle.digest with sha256 support is required"));const s=this.js,{ok:l,min:c}=s.nc.features.get(Pe.JS_OBJECTSTORE);return l?lo.create(this.js,t,r):Promise.reject(new Error(`objectstore is only supported on servers ${c} or better`))}}class Nd extends go{constructor(r,s){super(r,s);A(this,"consumers");A(this,"streams");A(this,"consumerAPI");A(this,"streamAPI");this.consumerAPI=new Jc(r,s),this.streamAPI=new Td(r,s),this.consumers=new od(this.consumerAPI),this.streams=new y2(this.streamAPI)}jetstreamManager(r){r===void 0&&(r=this.opts.checkAPI);const s=Object.assign({},this.opts,{checkAPI:r});return this.nc.jetstreamManager(s)}get apiPrefix(){return this.prefix}get views(){return new b2(this)}async publish(r,s=hn,l){l=l||{},l.expect=l.expect||{};const c=(l==null?void 0:l.headers)||Sr();l&&(l.msgID&&c.set(Xn.MsgIdHdr,l.msgID),l.expect.lastMsgID&&c.set(Xn.ExpectedLastMsgIdHdr,l.expect.lastMsgID),l.expect.streamName&&c.set(Xn.ExpectedStreamHdr,l.expect.streamName),typeof l.expect.lastSequence=="number"&&c.set(Xn.ExpectedLastSeqHdr,`${l.expect.lastSequence}`),typeof l.expect.lastSubjectSequence=="number"&&c.set(Xn.ExpectedLastSubjectSequenceHdr,`${l.expect.lastSubjectSequence}`));const d=l.timeout||this.timeout,p={};d&&(p.timeout=d),l&&(p.headers=c);let{retries:g,retry_delay:f}=l;g=g||1,f=f||250;let m;for(let v=0;v<g;v++)try{m=await this.nc.request(r,s,p);break}catch(_){if(_.code==="503"&&v+1<g)await Ys(f);else throw _}const b=this.parseJsResponse(m);if(b.stream==="")throw me.errorForCode(ce.JetStreamInvalidAck);return b.duplicate=b.duplicate?b.duplicate:!1,b}async pull(r,s,l=0){Pt(r),Us(s);let c=this.timeout;l>c&&(c=l),l=l<0?0:rt(l);const d={batch:1,no_wait:l===0,expires:l},p=await this.nc.request(`${this.prefix}.CONSUMER.MSG.NEXT.${r}.${s}`,this.jc.encode(d),{noMux:!0,timeout:c}),g=Ps(p);if(g)throw g;return mo(p,this.timeout)}fetch(r,s,l={}){Pt(r),Us(s);let c=null;const d=(l.max_bytes??0)>0;let p=0;const g=d?l.max_bytes:0;let f=null;const m={};if(m.batch=l.batch||1,g){const z=this.nc.features.get(Pe.JS_PULL_MAX_BYTES);if(!z.ok)throw new Error(`max_bytes is only supported on servers ${z.min} or better`);m.max_bytes=g}m.no_wait=l.no_wait||!1,m.no_wait&&m.expires&&(m.expires=0);const b=l.expires||0;if(b&&(m.expires=rt(b)),b===0&&m.no_wait===!1)throw new Error("expires or no_wait is required");const v=l.idle_heartbeat||0;v&&(m.idle_heartbeat=rt(v),l.delay_heartbeat===!0&&(m.idle_heartbeat=rt(v*4)));const _=new jt,w=m.batch;let S=0;_.protocolFilterFn=(z,se=!1)=>Qh(z.msg)?(f==null||f.work(),!1):!0,_.dispatchedFn=z=>{if(z){if(d&&(p+=z.data.length),S++,c&&z.info.pending===0)return;(_.getPending()===1&&z.info.pending===0||w===S||g>0&&p>=g)&&_.stop()}};const C=wr(this.nc.options.inboxPrefix),L=this.nc.subscribe(C,{max:l.batch,callback:(z,se)=>{z===null&&(z=Ps(se)),z!==null?(c&&(c.cancel(),c=null),Pw(z)?_.stop(wb(z)===null?void 0:z):_.stop(z)):(f==null||f.work(),_.received++,_.push(mo(se,this.timeout)))}});return b&&(c=Gs(b),c.catch(()=>{L.isClosed()||(L.drain().catch(()=>{}),c=null),f&&f.cancel()})),(async()=>{try{v&&(f=new Ad(v,z=>(_.push(()=>{_.err=new me(`${Nn.IdleHeartbeatMissed}: ${z}`,ce.JetStreamIdleHeartBeat)}),!0)))}catch{}await L.closed,c!==null&&(c.cancel(),c=null),f&&f.cancel(),_.stop()})().catch(),this.nc.publish(`${this.prefix}.CONSUMER.MSG.NEXT.${r}.${s}`,this.jc.encode(m),{reply:C}),_}async pullSubscribe(r,s=li()){const l=await this._processOptions(r,s);if(l.ordered)throw new Error("pull subscribers cannot be be ordered");if(l.config.deliver_subject)throw new Error("consumer info specifies deliver_subject - pull consumers cannot have deliver_subject set");const c=l.config.ack_policy;if(c===At.None||c===At.All)throw new Error("ack policy for pull consumers must be explicit");const d=this._buildTypedSubscriptionOpts(l),p=new w2(this,l.deliver,d);p.info=l;try{await this._maybeCreateConsumer(l)}catch(g){throw p.unsubscribe(),g}return p}async subscribe(r,s=li()){const l=await this._processOptions(r,s);if(!l.isBind&&!l.config.deliver_subject)throw new Error("push consumer requires deliver_subject");const c=this._buildTypedSubscriptionOpts(l),d=new _b(this,l.deliver,c);d.info=l;try{await this._maybeCreateConsumer(l)}catch(p){throw d.unsubscribe(),p}return d._maybeSetupHbMonitoring(),d}async _processOptions(r,s=li()){const l=Wy(s)?s.getOpts():s;if(l.isBind=Wy(s)?s.isBind:!1,l.flow_control={heartbeat_count:0,fc_count:0,consumer_restarts:0},l.ordered){if(l.ordered_consumer_sequence={stream_seq:0,delivery_seq:0},l.config.ack_policy!==At.NotSet&&l.config.ack_policy!==At.None)throw new me("ordered consumer: ack_policy can only be set to 'none'",ce.ApiError);if(l.config.durable_name&&l.config.durable_name.length>0)throw new me("ordered consumer: durable_name cannot be set",ce.ApiError);if(l.config.deliver_subject&&l.config.deliver_subject.length>0)throw new me("ordered consumer: deliver_subject cannot be set",ce.ApiError);if(l.config.max_deliver!==void 0&&l.config.max_deliver>1)throw new me("ordered consumer: max_deliver cannot be set",ce.ApiError);if(l.config.deliver_group&&l.config.deliver_group.length>0)throw new me("ordered consumer: deliver_group cannot be set",ce.ApiError);l.config.deliver_subject=wr(this.nc.options.inboxPrefix),l.config.ack_policy=At.None,l.config.max_deliver=1,l.config.flow_control=!0,l.config.idle_heartbeat=l.config.idle_heartbeat||rt(5e3),l.config.ack_wait=rt(1320*60*1e3),l.config.mem_storage=!0,l.config.num_replicas=1}if(l.config.ack_policy===At.NotSet&&(l.config.ack_policy=At.All),l.api=this,l.config=l.config||{},l.stream=l.stream?l.stream:await this.findStream(r),l.attached=!1,l.config.durable_name)try{const c=await this.consumerAPI.info(l.stream,l.config.durable_name);if(c){if(c.config.filter_subject&&c.config.filter_subject!==r)throw new Error("subject does not match consumer");const d=l.config.deliver_group??"";if(d===""&&c.push_bound===!0)throw new Error("duplicate subscription");const p=c.config.deliver_group??"";if(d!==p)throw p===""?new Error("durable requires no queue group"):new Error(`durable requires queue group '${p}'`);l.last=c,l.config=c.config,l.attached=!0,l.config.durable_name||(l.name=c.name)}}catch(c){if(c.code!=="404")throw c}return!l.attached&&l.config.filter_subject===void 0&&l.config.filter_subjects===void 0&&(l.config.filter_subject=r),l.deliver=l.config.deliver_subject||wr(this.nc.options.inboxPrefix),l}_buildTypedSubscriptionOpts(r){const s={};return s.adapter=S2(r.callbackFn===void 0,this.timeout),s.ingestionFilterFn=Nd.ingestionFn(r.ordered),s.protocolFilterFn=(l,c=!1)=>{const d=l;return Jh(d.msg)?(c||d.msg.respond(),!1):!0},!r.mack&&r.config.ack_policy!==At.None&&(s.dispatchedFn=A2),r.callbackFn&&(s.callback=r.callbackFn),s.max=r.max||0,s.queue=r.queue,s}async _maybeCreateConsumer(r){if(r.attached)return;if(r.isBind)throw new Error(`unable to bind - durable consumer ${r.config.durable_name} doesn't exist in ${r.stream}`);r.config=Object.assign({deliver_policy:gt.All,ack_policy:At.Explicit,ack_wait:rt(30*1e3),replay_policy:Fs.Instant},r.config);const s=await this.consumerAPI.add(r.stream,r.config);if(Array.isArray(r.config.filter_subjects&&!Array.isArray(s.config.filter_subjects)))throw new Error("jetstream server doesn't support consumers with multiple filter subjects");r.name=s.name,r.config=s.config,r.last=s}static ingestionFn(r){return(s,l)=>{var g;const c=l;if(!s)return{ingest:!1,protocol:!1};const d=s;if(Ps(d.msg)||(g=c.monitor)==null||g.work(),Qh(d.msg)){const f=r?c._checkHbOrderConsumer(d.msg):!0;return r||c.info.flow_control.heartbeat_count++,{ingest:f,protocol:!0}}else if(Jh(d.msg))return c.info.flow_control.fc_count++,{ingest:!0,protocol:!0};return{ingest:r?c._checkOrderedConsumer(s):!0,protocol:!1}}}}class kd{constructor(t){A(this,"options");A(this,"protocol");A(this,"draining");A(this,"listeners");A(this,"_services");this.draining=!1,this.options=$S(t),this.listeners=[]}static connect(t={}){return new Promise((r,s)=>{const l=new kd(t);Zc.connect(l.options,l).then(c=>{l.protocol=c,(async function(){for await(const d of c.status())l.listeners.forEach(p=>{p.push(d)})})(),r(l)}).catch(c=>{s(c)})})}closed(){return this.protocol.closed}async close(){await this.protocol.close()}_check(t,r,s){if(this.isClosed())throw me.errorForCode(ce.ConnectionClosed);if(r&&this.isDraining()||s&&this.protocol.noMorePublishing)throw me.errorForCode(ce.ConnectionDraining);if(t=t||"",t.length===0)throw me.errorForCode(ce.BadSubject)}publish(t,r,s){this._check(t,!1,!0),this.protocol.publish(t,r,s)}publishMessage(t){return this.publish(t.subject,t.data,{reply:t.reply,headers:t.headers})}respondMessage(t){return t.reply?(this.publish(t.reply,t.data,{reply:t.reply,headers:t.headers}),!0):!1}subscribe(t,r={}){this._check(t,!0,!1);const s=new gb(this.protocol,t,r);return this.protocol.subscribe(s),s}_resub(t,r,s){this._check(r,!0,!1);const l=t;l.max=s,s&&(l.max=s+l.received),this.protocol.resub(l,r)}requestMany(t,r=hn,s={maxWait:1e3,maxMessages:-1}){const l=!this.protocol.options.noAsyncTraces;try{this._check(t,!0,!0)}catch(g){return Promise.reject(g)}if(s.strategy=s.strategy||$n.Timer,s.maxWait=s.maxWait||1e3,s.maxWait<1)return Promise.reject(new me("timeout",ce.InvalidOption));const c=new jt;function d(g){c.push(()=>{c.stop(g)})}function p(g,f){g||f===null?d(g===null?void 0:g):c.push(f)}if(s.noMux){const g=l?new Error().stack:null;let f=typeof s.maxMessages=="number"&&s.maxMessages>0?s.maxMessages:-1;const m=this.subscribe(wr(this.options.inboxPrefix),{callback:(w,S)=>{var C,L;if(((C=S==null?void 0:S.data)==null?void 0:C.length)===0&&((L=S==null?void 0:S.headers)==null?void 0:L.status)===ce.NoResponders&&(w=me.errorForCode(ce.NoResponders)),w){g&&(w.stack+=`
|
|
48
|
+
|
|
49
|
+
${g}`),b(w);return}p(null,S),s.strategy===$n.Count&&(f--,f===0&&b()),s.strategy===$n.JitterTimer&&(_(),v=setTimeout(()=>{b()},300)),s.strategy===$n.SentinelMsg&&S&&S.data.length===0&&b()}});m.requestSubject=t,m.closed.then(()=>{d()}).catch(w=>{c.stop(w)});const b=w=>{w&&c.push(()=>{throw w}),_(),m.drain().then(()=>{d()}).catch(S=>{d()})};c.iterClosed.then(()=>{_(),m==null||m.unsubscribe()}).catch(w=>{_(),m==null||m.unsubscribe()});try{this.publish(t,r,{reply:m.getSubject()})}catch(w){b(w)}let v=setTimeout(()=>{b()},s.maxWait);const _=()=>{v&&clearTimeout(v)}}else{const g=s;g.callback=p,c.iterClosed.then(()=>{f.cancel()}).catch(m=>{f.cancel(m)});const f=new aS(this.protocol.muxSubscriptions,t,g);this.protocol.request(f);try{this.publish(t,r,{reply:`${this.protocol.muxSubscriptions.baseInbox}${f.token}`,headers:s.headers})}catch(m){f.cancel(m)}}return Promise.resolve(c)}request(t,r,s={timeout:1e3,noMux:!1}){try{this._check(t,!0,!0)}catch(c){return Promise.reject(c)}const l=!this.protocol.options.noAsyncTraces;if(s.timeout=s.timeout||1e3,s.timeout<1)return Promise.reject(new me("timeout",ce.InvalidOption));if(!s.noMux&&s.reply)return Promise.reject(new me("reply can only be used with noMux",ce.InvalidOption));if(s.noMux){const c=s.reply?s.reply:wr(this.options.inboxPrefix),d=it(),p=l?new Error:null,g=this.subscribe(c,{max:1,timeout:s.timeout,callback:(f,m)=>{f?(p&&f.code!==ce.Timeout&&(f.stack+=`
|
|
50
|
+
|
|
51
|
+
${p.stack}`),g.unsubscribe(),d.reject(f)):(f=lb(m),f?(p&&(f.stack+=`
|
|
52
|
+
|
|
53
|
+
${p.stack}`),d.reject(f)):d.resolve(m))}});return g.requestSubject=t,this.protocol.publish(t,r,{reply:c,headers:s.headers}),d}else{const c=new fb(this.protocol.muxSubscriptions,t,s,l);this.protocol.request(c);try{this.publish(t,r,{reply:`${this.protocol.muxSubscriptions.baseInbox}${c.token}`,headers:s.headers})}catch(p){c.cancel(p)}const d=Promise.race([c.timer,c.deferred]);return d.catch(()=>{c.cancel()}),d}}flush(){return this.isClosed()?Promise.reject(me.errorForCode(ce.ConnectionClosed)):this.protocol.flush()}drain(){return this.isClosed()?Promise.reject(me.errorForCode(ce.ConnectionClosed)):this.isDraining()?Promise.reject(me.errorForCode(ce.ConnectionDraining)):(this.draining=!0,this.protocol.drain())}isClosed(){return this.protocol.isClosed()}isDraining(){return this.draining}getServer(){const t=this.protocol.getServer();return t?t.listen:""}status(){const t=new jt;return t.iterClosed.then(()=>{const r=this.listeners.indexOf(t);this.listeners.splice(r,1)}),this.listeners.push(t),t}get info(){return this.protocol.isClosed()?void 0:this.protocol.info}async context(){return(await this.request("$SYS.REQ.USER.INFO")).json((r,s)=>r==="time"?new Date(Date.parse(s)):s)}stats(){return{inBytes:this.protocol.inBytes,outBytes:this.protocol.outBytes,inMsgs:this.protocol.inMsgs,outMsgs:this.protocol.outMsgs}}async jetstreamManager(t={}){const r=new p2(this,t);if(t.checkAPI!==!1)try{await r.getAccountInfo()}catch(s){const l=s;throw l.code===ce.NoResponders&&(l.code=ce.JetStreamNotEnabled),l}return r}jetstream(t={}){return new Nd(this,t)}getServerVersion(){const t=this.info;return t?Ii(t.version):void 0}async rtt(){if(!this.protocol._closed&&!this.protocol.connected)throw me.errorForCode(ce.Disconnect);const t=Date.now();return await this.flush(),Date.now()-t}get features(){return this.protocol.features}get services(){return this._services||(this._services=new v2(this)),this._services}reconnect(){return this.isClosed()?Promise.reject(me.errorForCode(ce.ConnectionClosed)):this.isDraining()?Promise.reject(me.errorForCode(ce.ConnectionDraining)):this.protocol.reconnect()}}class v2{constructor(t){A(this,"nc");this.nc=t}add(t){try{return new bo(this.nc,t).start()}catch(r){return Promise.reject(r)}}client(t,r){return new ZS(this.nc,t,r)}}class x2{constructor(t,r,s){A(this,"bucket");A(this,"sm");A(this,"prefixLen");this.bucket=t,this.prefixLen=r,this.sm=s}get key(){return this.sm.subject.substring(this.prefixLen)}get value(){return this.sm.data}get delta(){return 0}get created(){return this.sm.time}get revision(){return this.sm.seq}get operation(){return this.sm.header.get(Wc)||"PUT"}get length(){const t=this.sm.header.get(It.MessageSizeHdr)||"";return t!==""?parseInt(t,10):this.sm.data.length}json(){return this.sm.json()}string(){return this.sm.string()}}class _2{constructor(t,r,s){A(this,"bucket");A(this,"key");A(this,"sm");this.bucket=t,this.key=r,this.sm=s}get value(){return this.sm.data}get created(){return new Date(Ed(this.sm.info.timestampNanos))}get revision(){return this.sm.seq}get operation(){var t;return((t=this.sm.headers)==null?void 0:t.get(Wc))||"PUT"}get delta(){return this.sm.info.pending}get length(){var r;const t=((r=this.sm.headers)==null?void 0:r.get(It.MessageSizeHdr))||"";return t!==""?parseInt(t,10):this.sm.data.length}json(){return this.sm.json()}string(){return this.sm.string()}}class _b extends uS{constructor(r,s,l){super(r.nc,s,l);A(this,"js");A(this,"monitor");this.js=r,this.monitor=null,this.sub.closed.then(()=>{this.monitor&&this.monitor.cancel()})}set info(r){this.sub.info=r}get info(){return this.sub.info}_resetOrderedConsumer(r){if(this.info===null||this.sub.isClosed())return;const s=wr(this.js.nc.options.inboxPrefix);this.js.nc._resub(this.sub,s);const c=this.info;c.config.name=fi.next(),c.ordered_consumer_sequence.delivery_seq=0,c.flow_control.heartbeat_count=0,c.flow_control.fc_count=0,c.flow_control.consumer_restarts++,c.deliver=s,c.config.deliver_subject=s,c.config.deliver_policy=gt.StartSequence,c.config.opt_start_seq=r;const d={};d.stream_name=this.info.stream,d.config=c.config;const p=`${c.api.prefix}.CONSUMER.CREATE.${c.stream}`;this.js._request(p,d,{retries:-1}).then(g=>{const f=g,m=this.sub.info;m.last=f,this.info.config=f.config,this.info.name=f.name}).catch(g=>{const f=new me(`unable to recreate ordered consumer ${c.stream} at seq ${r}`,ce.RequestError,g);this.sub.callback(f,{})})}_maybeSetupHbMonitoring(){var s,l;const r=((l=(s=this.info)==null?void 0:s.config)==null?void 0:l.idle_heartbeat)||0;r&&this._setupHbMonitoring(Ed(r))}_setupHbMonitoring(r,s=0){const l={cancelAfter:0,maxOut:2};s&&(l.cancelAfter=s);const c=this.sub,d=p=>{var m,b,v,_;const g=Gw(409,`${Nn.IdleHeartbeatMissed}: ${p}`,this.sub.subject);if(!((m=this.info)==null?void 0:m.ordered))this.sub.callback(null,g);else{if(!this.js.nc.protocol.connected)return!1;const w=((v=(b=this.info)==null?void 0:b.ordered_consumer_sequence)==null?void 0:v.stream_seq)||0;return this._resetOrderedConsumer(w+1),(_=this.monitor)==null||_.restart(),!1}return!c.noIterator};this.monitor=new Ad(r,d,l)}_checkHbOrderConsumer(r){const s=r.headers.get(It.ConsumerStalledHdr);s!==""&&this.js.nc.publish(s);const l=parseInt(r.headers.get(It.LastConsumerSeqHdr),10),c=this.info.ordered_consumer_sequence;return this.info.flow_control.heartbeat_count++,l!==c.delivery_seq&&this._resetOrderedConsumer(c.stream_seq+1),!1}_checkOrderedConsumer(r){const s=this.info.ordered_consumer_sequence,l=r.info.streamSequence,c=r.info.deliverySequence;return c!=s.delivery_seq+1?(this._resetOrderedConsumer(s.stream_seq+1),!1):(s.delivery_seq=c,s.stream_seq=l,!0)}async destroy(){this.isClosed()||await this.drain();const r=this.sub.info,s=r.config.durable_name||r.name,l=`${r.api.prefix}.CONSUMER.DELETE.${r.stream}.${s}`;await r.api._request(l)}async consumerInfo(){const r=this.sub.info,s=r.config.durable_name||r.name,l=`${r.api.prefix}.CONSUMER.INFO.${r.stream}.${s}`,c=await r.api._request(l);return r.last=c,c}}class w2 extends _b{constructor(t,r,s){super(t,r,s)}pull(t={batch:1}){const{stream:r,config:s,name:l}=this.sub.info,c=s.durable_name??l,d={};if(d.batch=t.batch||1,d.no_wait=t.no_wait||!1,(t.max_bytes??0)>0){const f=this.js.nc.features.get(Pe.JS_PULL_MAX_BYTES);if(!f.ok)throw new Error(`max_bytes is only supported on servers ${f.min} or better`);d.max_bytes=t.max_bytes}let p=0;t.expires&&t.expires>0&&(p=t.expires,d.expires=rt(p));let g=0;if(t.idle_heartbeat&&t.idle_heartbeat>0&&(g=t.idle_heartbeat,d.idle_heartbeat=rt(g)),g&&p===0)throw new Error("idle_heartbeat requires expires");if(g>p)throw new Error("expires must be greater than idle_heartbeat");if(this.info){this.monitor&&this.monitor.cancel(),p&&g&&(this.monitor?this.monitor._change(g,p):this._setupHbMonitoring(g,p));const f=this.info.api,m=`${f.prefix}.CONSUMER.MSG.NEXT.${r}.${c}`,b=this.sub.subject;f.nc.publish(m,f.jc.encode(d),{reply:b})}}}function S2(i,t){return i?O2(t):E2(t)}function E2(i){return(t,r)=>t?[t,null]:(t=Ps(r),t?[t,null]:[null,mo(r,i)])}function O2(i){return(t,r)=>{if(t)return[t,null];const s=Ps(r);return s!==null?[wb(s),null]:[null,mo(r,i)]}}function wb(i){if(i!==null)switch(i.code){case ce.JetStream404NoMessages:case ce.JetStream408RequestTimeout:return null;case ce.JetStream409:return Fw(i)?i:null;default:return i}return null}function A2(i){i&&i.ack()}function j2(i){const t=i.split(".");if(t.length===9&&t.splice(2,0,"_",""),t.length<11||t[0]!=="$JS"||t[1]!=="ACK")throw new Error("not js message");const r={};return r.domain=t[2]==="_"?"":t[2],r.account_hash=t[3],r.stream=t[4],r.consumer=t[5],r.deliveryCount=parseInt(t[6],10),r.redeliveryCount=r.deliveryCount,r.redelivered=r.deliveryCount>1,r.streamSequence=parseInt(t[7],10),r.deliverySequence=parseInt(t[8],10),r.timestampNanos=parseInt(t[9],10),r.pending=parseInt(t[10],10),r}class T2{constructor(t,r){A(this,"msg");A(this,"di");A(this,"didAck");A(this,"timeout");this.msg=t,this.didAck=!1,this.timeout=r}get subject(){return this.msg.subject}get sid(){return this.msg.sid}get data(){return this.msg.data}get headers(){return this.msg.headers}get info(){return this.di||(this.di=j2(this.reply)),this.di}get redelivered(){return this.info.deliveryCount>1}get reply(){return this.msg.reply||""}get seq(){return this.info.streamSequence}doAck(t){this.didAck||(this.didAck=!this.isWIP(t),this.msg.respond(t))}isWIP(t){return t.length===4&&t[0]===Va[0]&&t[1]===Va[1]&&t[2]===Va[2]&&t[3]===Va[3]}async ackAck(t){var s;t=t||{},t.timeout=t.timeout||this.timeout;const r=it();if(this.didAck)r.resolve(!1);else if(this.didAck=!0,this.msg.reply){const c=this.msg.publisher,d=!((s=c.options)!=null&&s.noAsyncTraces),p=new fb(c.muxSubscriptions,this.msg.reply,{timeout:t.timeout},d);c.request(p);try{c.publish(this.msg.reply,dg,{reply:`${c.muxSubscriptions.baseInbox}${p.token}`})}catch(g){p.cancel(g)}try{await Promise.race([p.timer,p.deferred]),r.resolve(!0)}catch(g){p.cancel(g),r.reject(g)}}else r.resolve(!1);return r}ack(){this.doAck(dg)}nak(t){let r=l2;t&&(r=Xh().encode(`-NAK ${JSON.stringify({delay:rt(t)})}`)),this.doAck(r)}working(){this.doAck(Va)}next(t,r={batch:1}){const s={};s.batch=r.batch||1,s.no_wait=r.no_wait||!1,r.expires&&r.expires>0&&(s.expires=rt(r.expires));const l=In().encode(s),c=Vs.concat(c2,f2,l),d=t?{reply:t}:void 0;this.msg.respond(c,d)}term(t=""){let r=u2;(t==null?void 0:t.length)>0&&(r=Xh().encode(`+TERM ${t}`)),this.doAck(r)}json(){return this.msg.json()}string(){return this.msg.string()}}const N2="1.30.3",k2="nats.ws";class C2{constructor(){A(this,"version");A(this,"lang");A(this,"closeError");A(this,"connected");A(this,"done");A(this,"socket");A(this,"options");A(this,"socketClosed");A(this,"encrypted");A(this,"peeked");A(this,"yields");A(this,"signal");A(this,"closedNotification");this.version=N2,this.lang=k2,this.connected=!1,this.done=!1,this.socketClosed=!1,this.encrypted=!1,this.peeked=!1,this.yields=[],this.signal=it(),this.closedNotification=it()}async connect(t,r){const s=it();if(r.tls)return s.reject(new me("tls",ce.InvalidOption)),s;this.options=r;const l=t.src;if(r.wsFactory){const{socket:c,encrypted:d}=await r.wsFactory(t.src,r);this.socket=c,this.encrypted=d}else this.encrypted=l.indexOf("wss://")===0,this.socket=new WebSocket(l);return this.socket.binaryType="arraybuffer",this.socket.onopen=()=>{this.isDiscarded()},this.socket.onmessage=c=>{if(this.isDiscarded())return;if(this.yields.push(new Uint8Array(c.data)),this.peeked){this.signal.resolve();return}const d=Vs.concat(...this.yields),p=yS(d);if(p!==""){const g=GS.exec(p);if(!g){r.debug&&console.error("!!!",Fl(d)),s.reject(new Error("unexpected response from server"));return}try{const f=JSON.parse(g[1]);IS(f,this.options),this.peeked=!0,this.connected=!0,this.signal.resolve(),s.resolve()}catch(f){s.reject(f);return}}},this.socket.onclose=c=>{if(this.isDiscarded())return;this.socketClosed=!0;let d;this.done||(c.wasClean||(d=new Error(c.reason)),this._closed(d))},this.socket.onerror=c=>{if(this.isDiscarded())return;const d=c,p=new me(d.message,ce.Unknown,new Error(d.error));s.reject(p)},s}disconnect(){this._closed(void 0,!0)}async _closed(t,r=!0){if(!this.isDiscarded()&&this.connected&&!this.done){if(this.closeError=t,!t)for(;!this.socketClosed&&this.socket.bufferedAmount>0;)await Ys(100);this.done=!0;try{this.socket.close(t?1002:1e3,t?t.message:void 0)}catch{}r&&this.closedNotification.resolve(t)}}get isClosed(){return this.done}[Symbol.asyncIterator](){return this.iterate()}async*iterate(){for(;;){if(this.isDiscarded())return;this.yields.length===0&&await this.signal;const t=this.yields;this.yields=[];for(let r=0;r<t.length;r++)this.options.debug&&console.info(`> ${Fl(t[r])}`),yield t[r];if(this.done)break;this.yields.length===0&&(t.length=0,this.yields=t,this.signal=it())}}isEncrypted(){return this.connected&&this.encrypted}send(t){if(!this.isDiscarded())try{this.socket.send(t.buffer),this.options.debug&&console.info(`< ${Fl(t)}`);return}catch(r){this.options.debug&&console.error(`!!! ${Fl(t)}: ${r}`)}}close(t){return this._closed(t,!1)}closed(){return this.closedNotification}isDiscarded(){return this.done?(this.discard(),!0):!1}discard(){var t;this.done=!0;try{(t=this.socket)==null||t.close()}catch{}}}function M2(i,t){/^(.*:\/\/)(.*)/.test(i)||(typeof t=="boolean"?i=`${t===!0?"https":"http"}://${i}`:i=`https://${i}`);let s=new URL(i);const l=s.protocol.toLowerCase();l==="ws:"&&(t=!1),l==="wss:"&&(t=!0),l!=="https:"&&l!=="http"&&(i=i.replace(/^(.*:\/\/)(.*)/gm,"$2"),s=new URL(`http://${i}`));let c,d;const p=s.hostname,g=s.pathname,f=s.search||"";switch(l){case"http:":case"ws:":case"nats:":d=s.port||"80",c="ws:";break;case"https:":case"wss:":case"tls:":d=s.port||"443",c="wss:";break;default:d=s.port||t===!0?"443":"80",c=t===!0?"wss:":"ws:";break}return`${c}//${p}:${d}${g}${f}`}function R2(i={}){return fS({defaultPort:443,urlParseFn:M2,factory:()=>new C2}),kd.connect(i)}const D2=null,q2=null,B2="lt.events";function Sb(i,t){const r=i.split("."),s=t.split(".");for(let l=0;l<s.length;l++){const c=s[l];if(c===">")return!0;if(l>=r.length||c!=="*"&&c!==r[l])return!1}return r.length===s.length}const Ks=T.createContext({connected:!1,subscribe:()=>()=>{}});function L2(){const{connected:i}=T.useContext(Ks);return{connected:i}}function HT(i,t){const{subscribe:r}=T.useContext(Ks),s=T.useRef(t);s.current=t,T.useEffect(()=>r(i,c=>s.current(c)),[r,i])}function Cd(i,t){const{subscribe:r}=T.useContext(Ks),s=T.useRef(t);s.current=t;const l=i.join(","),c=T.useMemo(()=>l.split(",").filter(Boolean),[l]);T.useEffect(()=>{const d=g=>s.current(g),p=c.map(g=>r(g,d));return()=>p.forEach(g=>g())},[r,c])}const z2=T.createContext({connected:!1,subscribe:()=>()=>{}}),U2=Xh();function P2({children:i,url:t,token:r}){const s=T.useRef(null),[l,c]=T.useState(!1),d=T.useRef(null),p=T.useRef(new Map),g=T.useRef(new Map),f=T.useCallback((_,w)=>{(async()=>{for await(const S of w)try{if(!Sb(S.subject,_))continue;const C=JSON.parse(U2.decode(S.data)),L=p.current.get(_);if(!L)continue;for(const z of L)try{z(C)}catch{}}catch{}})()},[]),m=T.useCallback(_=>{var S;const w=s.current;if(!(!w||(S=w.isClosed)!=null&&S.call(w)||g.current.has(_)))try{const C=w.subscribe(_);g.current.set(_,C),f(_,C)}catch{}},[f]),b=T.useCallback((_,w)=>{const S=p.current;return S.has(_)||S.set(_,new Set),S.get(_).add(w),m(_),()=>{const C=S.get(_);if(C&&(C.delete(w),C.size===0)){S.delete(_);const L=g.current.get(_);if(L){g.current.delete(_);try{L.unsubscribe()}catch{}}}}},[m]),v=T.useCallback(async()=>{try{if(s.current)return;const _=t||D2;if(!_){console.error("[lt-nats] no NATS WebSocket URL configured — set NATS_WS_URL on the server");return}const w=await R2({servers:_,token:r||q2||void 0,reconnect:!0,maxReconnectAttempts:-1,reconnectTimeWait:2e3});s.current=w,c(!0);for(const S of p.current.keys())m(S);(async()=>{for await(const S of w.status())S.type==="disconnect"||S.type==="error"?c(!1):S.type==="reconnect"&&c(!0)})()}catch{c(!1),d.current=setTimeout(v,3e3)}},[m]);return T.useEffect(()=>(v(),()=>{d.current&&clearTimeout(d.current);for(const _ of g.current.values())try{_.unsubscribe()}catch{}g.current.clear(),s.current&&(s.current.close().catch(()=>{}),s.current=null),c(!1)}),[v]),y.jsx(z2.Provider,{value:{connected:l,subscribe:b},children:y.jsx(Ks.Provider,{value:{connected:l,subscribe:b},children:i})})}const Zn=Object.create(null);Zn.open="0";Zn.close="1";Zn.ping="2";Zn.pong="3";Zn.message="4";Zn.upgrade="5";Zn.noop="6";const $c=Object.create(null);Object.keys(Zn).forEach(i=>{$c[Zn[i]]=i});const cd={type:"error",data:"parser error"},Eb=typeof Blob=="function"||typeof Blob<"u"&&Object.prototype.toString.call(Blob)==="[object BlobConstructor]",Ob=typeof ArrayBuffer=="function",Ab=i=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(i):i&&i.buffer instanceof ArrayBuffer,Md=({type:i,data:t},r,s)=>Eb&&t instanceof Blob?r?s(t):pg(t,s):Ob&&(t instanceof ArrayBuffer||Ab(t))?r?s(t):pg(new Blob([t]),s):s(Zn[i]+(t||"")),pg=(i,t)=>{const r=new FileReader;return r.onload=function(){const s=r.result.split(",")[1];t("b"+(s||""))},r.readAsDataURL(i)};function yg(i){return i instanceof Uint8Array?i:i instanceof ArrayBuffer?new Uint8Array(i):new Uint8Array(i.buffer,i.byteOffset,i.byteLength)}let Bh;function $2(i,t){if(Eb&&i.data instanceof Blob)return i.data.arrayBuffer().then(yg).then(t);if(Ob&&(i.data instanceof ArrayBuffer||Ab(i.data)))return t(yg(i.data));Md(i,!1,r=>{Bh||(Bh=new TextEncoder),t(Bh.encode(r))})}const gg="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",io=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(let i=0;i<gg.length;i++)io[gg.charCodeAt(i)]=i;const I2=i=>{let t=i.length*.75,r=i.length,s,l=0,c,d,p,g;i[i.length-1]==="="&&(t--,i[i.length-2]==="="&&t--);const f=new ArrayBuffer(t),m=new Uint8Array(f);for(s=0;s<r;s+=4)c=io[i.charCodeAt(s)],d=io[i.charCodeAt(s+1)],p=io[i.charCodeAt(s+2)],g=io[i.charCodeAt(s+3)],m[l++]=c<<2|d>>4,m[l++]=(d&15)<<4|p>>2,m[l++]=(p&3)<<6|g&63;return f},H2=typeof ArrayBuffer=="function",Rd=(i,t)=>{if(typeof i!="string")return{type:"message",data:jb(i,t)};const r=i.charAt(0);return r==="b"?{type:"message",data:G2(i.substring(1),t)}:$c[r]?i.length>1?{type:$c[r],data:i.substring(1)}:{type:$c[r]}:cd},G2=(i,t)=>{if(H2){const r=I2(i);return jb(r,t)}else return{base64:!0,data:i}},jb=(i,t)=>{switch(t){case"blob":return i instanceof Blob?i:new Blob([i]);case"arraybuffer":default:return i instanceof ArrayBuffer?i:i.buffer}},Tb="",F2=(i,t)=>{const r=i.length,s=new Array(r);let l=0;i.forEach((c,d)=>{Md(c,!1,p=>{s[d]=p,++l===r&&t(s.join(Tb))})})},V2=(i,t)=>{const r=i.split(Tb),s=[];for(let l=0;l<r.length;l++){const c=Rd(r[l],t);if(s.push(c),c.type==="error")break}return s};function Y2(){return new TransformStream({transform(i,t){$2(i,r=>{const s=r.length;let l;if(s<126)l=new Uint8Array(1),new DataView(l.buffer).setUint8(0,s);else if(s<65536){l=new Uint8Array(3);const c=new DataView(l.buffer);c.setUint8(0,126),c.setUint16(1,s)}else{l=new Uint8Array(9);const c=new DataView(l.buffer);c.setUint8(0,127),c.setBigUint64(1,BigInt(s))}i.data&&typeof i.data!="string"&&(l[0]|=128),t.enqueue(l),t.enqueue(r)})}})}let Lh;function Xl(i){return i.reduce((t,r)=>t+r.length,0)}function Jl(i,t){if(i[0].length===t)return i.shift();const r=new Uint8Array(t);let s=0;for(let l=0;l<t;l++)r[l]=i[0][s++],s===i[0].length&&(i.shift(),s=0);return i.length&&s<i[0].length&&(i[0]=i[0].slice(s)),r}function K2(i,t){Lh||(Lh=new TextDecoder);const r=[];let s=0,l=-1,c=!1;return new TransformStream({transform(d,p){for(r.push(d);;){if(s===0){if(Xl(r)<1)break;const g=Jl(r,1);c=(g[0]&128)===128,l=g[0]&127,l<126?s=3:l===126?s=1:s=2}else if(s===1){if(Xl(r)<2)break;const g=Jl(r,2);l=new DataView(g.buffer,g.byteOffset,g.length).getUint16(0),s=3}else if(s===2){if(Xl(r)<8)break;const g=Jl(r,8),f=new DataView(g.buffer,g.byteOffset,g.length),m=f.getUint32(0);if(m>Math.pow(2,21)-1){p.enqueue(cd);break}l=m*Math.pow(2,32)+f.getUint32(4),s=3}else{if(Xl(r)<l)break;const g=Jl(r,l);p.enqueue(Rd(c?g:Lh.decode(g),t)),s=0}if(l===0||l>i){p.enqueue(cd);break}}}})}const Nb=4;function wt(i){if(i)return X2(i)}function X2(i){for(var t in wt.prototype)i[t]=wt.prototype[t];return i}wt.prototype.on=wt.prototype.addEventListener=function(i,t){return this._callbacks=this._callbacks||{},(this._callbacks["$"+i]=this._callbacks["$"+i]||[]).push(t),this};wt.prototype.once=function(i,t){function r(){this.off(i,r),t.apply(this,arguments)}return r.fn=t,this.on(i,r),this};wt.prototype.off=wt.prototype.removeListener=wt.prototype.removeAllListeners=wt.prototype.removeEventListener=function(i,t){if(this._callbacks=this._callbacks||{},arguments.length==0)return this._callbacks={},this;var r=this._callbacks["$"+i];if(!r)return this;if(arguments.length==1)return delete this._callbacks["$"+i],this;for(var s,l=0;l<r.length;l++)if(s=r[l],s===t||s.fn===t){r.splice(l,1);break}return r.length===0&&delete this._callbacks["$"+i],this};wt.prototype.emit=function(i){this._callbacks=this._callbacks||{};for(var t=new Array(arguments.length-1),r=this._callbacks["$"+i],s=1;s<arguments.length;s++)t[s-1]=arguments[s];if(r){r=r.slice(0);for(var s=0,l=r.length;s<l;++s)r[s].apply(this,t)}return this};wt.prototype.emitReserved=wt.prototype.emit;wt.prototype.listeners=function(i){return this._callbacks=this._callbacks||{},this._callbacks["$"+i]||[]};wt.prototype.hasListeners=function(i){return!!this.listeners(i).length};const cu=typeof Promise=="function"&&typeof Promise.resolve=="function"?t=>Promise.resolve().then(t):(t,r)=>r(t,0),kn=typeof self<"u"?self:typeof window<"u"?window:Function("return this")(),J2="arraybuffer";function kb(i,...t){return t.reduce((r,s)=>(i.hasOwnProperty(s)&&(r[s]=i[s]),r),{})}const Q2=kn.setTimeout,Z2=kn.clearTimeout;function uu(i,t){t.useNativeTimers?(i.setTimeoutFn=Q2.bind(kn),i.clearTimeoutFn=Z2.bind(kn)):(i.setTimeoutFn=kn.setTimeout.bind(kn),i.clearTimeoutFn=kn.clearTimeout.bind(kn))}const W2=1.33;function eE(i){return typeof i=="string"?tE(i):Math.ceil((i.byteLength||i.size)*W2)}function tE(i){let t=0,r=0;for(let s=0,l=i.length;s<l;s++)t=i.charCodeAt(s),t<128?r+=1:t<2048?r+=2:t<55296||t>=57344?r+=3:(s++,r+=4);return r}function Cb(){return Date.now().toString(36).substring(3)+Math.random().toString(36).substring(2,5)}function nE(i){let t="";for(let r in i)i.hasOwnProperty(r)&&(t.length&&(t+="&"),t+=encodeURIComponent(r)+"="+encodeURIComponent(i[r]));return t}function rE(i){let t={},r=i.split("&");for(let s=0,l=r.length;s<l;s++){let c=r[s].split("=");t[decodeURIComponent(c[0])]=decodeURIComponent(c[1])}return t}class iE extends Error{constructor(t,r,s){super(t),this.description=r,this.context=s,this.type="TransportError"}}class Dd extends wt{constructor(t){super(),this.writable=!1,uu(this,t),this.opts=t,this.query=t.query,this.socket=t.socket,this.supportsBinary=!t.forceBase64}onError(t,r,s){return super.emitReserved("error",new iE(t,r,s)),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 r=Rd(t,this.socket.binaryType);this.onPacket(r)}onPacket(t){super.emitReserved("packet",t)}onClose(t){this.readyState="closed",super.emitReserved("close",t)}pause(t){}createUri(t,r={}){return t+"://"+this._hostname()+this._port()+this.opts.path+this._query(r)}_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 r=nE(t);return r.length?"?"+r:""}}class sE extends Dd{constructor(){super(...arguments),this._polling=!1}get name(){return"polling"}doOpen(){this._poll()}pause(t){this.readyState="pausing";const r=()=>{this.readyState="paused",t()};if(this._polling||!this.writable){let s=0;this._polling&&(s++,this.once("pollComplete",function(){--s||r()})),this.writable||(s++,this.once("drain",function(){--s||r()}))}else r()}_poll(){this._polling=!0,this.doPoll(),this.emitReserved("poll")}onData(t){const r=s=>{if(this.readyState==="opening"&&s.type==="open"&&this.onOpen(),s.type==="close")return this.onClose({description:"transport closed by the server"}),!1;this.onPacket(s)};V2(t,this.socket.binaryType).forEach(r),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,F2(t,r=>{this.doWrite(r,()=>{this.writable=!0,this.emitReserved("drain")})})}uri(){const t=this.opts.secure?"https":"http",r=this.query||{};return this.opts.timestampRequests!==!1&&(r[this.opts.timestampParam]=Cb()),!this.supportsBinary&&!r.sid&&(r.b64=1),this.createUri(t,r)}}let Mb=!1;try{Mb=typeof XMLHttpRequest<"u"&&"withCredentials"in new XMLHttpRequest}catch{}const aE=Mb;function oE(){}class lE extends sE{constructor(t){if(super(t),typeof location<"u"){const r=location.protocol==="https:";let s=location.port;s||(s=r?"443":"80"),this.xd=typeof location<"u"&&t.hostname!==location.hostname||s!==t.port}}doWrite(t,r){const s=this.request({method:"POST",data:t});s.on("success",r),s.on("error",(l,c)=>{this.onError("xhr post error",l,c)})}doPoll(){const t=this.request();t.on("data",this.onData.bind(this)),t.on("error",(r,s)=>{this.onError("xhr poll error",r,s)}),this.pollXhr=t}}class Qn extends wt{constructor(t,r,s){super(),this.createRequest=t,uu(this,s),this._opts=s,this._method=s.method||"GET",this._uri=r,this._data=s.data!==void 0?s.data:null,this._create()}_create(){var t;const r=kb(this._opts,"agent","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","autoUnref");r.xdomain=!!this._opts.xd;const s=this._xhr=this.createRequest(r);try{s.open(this._method,this._uri,!0);try{if(this._opts.extraHeaders){s.setDisableHeaderCheck&&s.setDisableHeaderCheck(!0);for(let l in this._opts.extraHeaders)this._opts.extraHeaders.hasOwnProperty(l)&&s.setRequestHeader(l,this._opts.extraHeaders[l])}}catch{}if(this._method==="POST")try{s.setRequestHeader("Content-type","text/plain;charset=UTF-8")}catch{}try{s.setRequestHeader("Accept","*/*")}catch{}(t=this._opts.cookieJar)===null||t===void 0||t.addCookies(s),"withCredentials"in s&&(s.withCredentials=this._opts.withCredentials),this._opts.requestTimeout&&(s.timeout=this._opts.requestTimeout),s.onreadystatechange=()=>{var l;s.readyState===3&&((l=this._opts.cookieJar)===null||l===void 0||l.parseCookies(s.getResponseHeader("set-cookie"))),s.readyState===4&&(s.status===200||s.status===1223?this._onLoad():this.setTimeoutFn(()=>{this._onError(typeof s.status=="number"?s.status:0)},0))},s.send(this._data)}catch(l){this.setTimeoutFn(()=>{this._onError(l)},0);return}typeof document<"u"&&(this._index=Qn.requestsCount++,Qn.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=oE,t)try{this._xhr.abort()}catch{}typeof document<"u"&&delete Qn.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()}}Qn.requestsCount=0;Qn.requests={};if(typeof document<"u"){if(typeof attachEvent=="function")attachEvent("onunload",bg);else if(typeof addEventListener=="function"){const i="onpagehide"in kn?"pagehide":"unload";addEventListener(i,bg,!1)}}function bg(){for(let i in Qn.requests)Qn.requests.hasOwnProperty(i)&&Qn.requests[i].abort()}const cE=(function(){const i=Rb({xdomain:!1});return i&&i.responseType!==null})();class uE extends lE{constructor(t){super(t);const r=t&&t.forceBase64;this.supportsBinary=cE&&!r}request(t={}){return Object.assign(t,{xd:this.xd},this.opts),new Qn(Rb,this.uri(),t)}}function Rb(i){const t=i.xdomain;try{if(typeof XMLHttpRequest<"u"&&(!t||aE))return new XMLHttpRequest}catch{}if(!t)try{return new kn[["Active"].concat("Object").join("X")]("Microsoft.XMLHTTP")}catch{}}const Db=typeof navigator<"u"&&typeof navigator.product=="string"&&navigator.product.toLowerCase()==="reactnative";class fE extends Dd{get name(){return"websocket"}doOpen(){const t=this.uri(),r=this.opts.protocols,s=Db?{}:kb(this.opts,"agent","perMessageDeflate","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","localAddress","protocolVersion","origin","maxPayload","family","checkServerIdentity");this.opts.extraHeaders&&(s.headers=this.opts.extraHeaders);try{this.ws=this.createSocket(t,r,s)}catch(l){return this.emitReserved("error",l)}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 r=0;r<t.length;r++){const s=t[r],l=r===t.length-1;Md(s,this.supportsBinary,c=>{try{this.doWrite(s,c)}catch{}l&&cu(()=>{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",r=this.query||{};return this.opts.timestampRequests&&(r[this.opts.timestampParam]=Cb()),this.supportsBinary||(r.b64=1),this.createUri(t,r)}}const zh=kn.WebSocket||kn.MozWebSocket;class hE extends fE{createSocket(t,r,s){return Db?new zh(t,r,s):r?new zh(t,r):new zh(t)}doWrite(t,r){this.ws.send(r)}}class dE extends Dd{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 r=K2(Number.MAX_SAFE_INTEGER,this.socket.binaryType),s=t.readable.pipeThrough(r).getReader(),l=Y2();l.readable.pipeTo(t.writable),this._writer=l.writable.getWriter();const c=()=>{s.read().then(({done:p,value:g})=>{p||(this.onPacket(g),c())}).catch(p=>{})};c();const d={type:"open"};this.query.sid&&(d.data=`{"sid":"${this.query.sid}"}`),this._writer.write(d).then(()=>this.onOpen())})})}write(t){this.writable=!1;for(let r=0;r<t.length;r++){const s=t[r],l=r===t.length-1;this._writer.write(s).then(()=>{l&&cu(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){var t;(t=this._transport)===null||t===void 0||t.close()}}const mE={websocket:hE,webtransport:dE,polling:uE},pE=/^(?:(?![^:@\/?#]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@\/?#]*)(?::([^:@\/?#]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,yE=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"];function ud(i){if(i.length>8e3)throw"URI too long";const t=i,r=i.indexOf("["),s=i.indexOf("]");r!=-1&&s!=-1&&(i=i.substring(0,r)+i.substring(r,s).replace(/:/g,";")+i.substring(s,i.length));let l=pE.exec(i||""),c={},d=14;for(;d--;)c[yE[d]]=l[d]||"";return r!=-1&&s!=-1&&(c.source=t,c.host=c.host.substring(1,c.host.length-1).replace(/;/g,":"),c.authority=c.authority.replace("[","").replace("]","").replace(/;/g,":"),c.ipv6uri=!0),c.pathNames=gE(c,c.path),c.queryKey=bE(c,c.query),c}function gE(i,t){const r=/\/{2,9}/g,s=t.replace(r,"/").split("/");return(t.slice(0,1)=="/"||t.length===0)&&s.splice(0,1),t.slice(-1)=="/"&&s.splice(s.length-1,1),s}function bE(i,t){const r={};return t.replace(/(?:^|&)([^&=]*)=?([^&]*)/g,function(s,l,c){l&&(r[l]=c)}),r}const fd=typeof addEventListener=="function"&&typeof removeEventListener=="function",Ic=[];fd&&addEventListener("offline",()=>{Ic.forEach(i=>i())},!1);class ci extends wt{constructor(t,r){if(super(),this.binaryType=J2,this.writeBuffer=[],this._prevBufferLen=0,this._pingInterval=-1,this._pingTimeout=-1,this._maxPayload=-1,this._pingTimeoutTime=1/0,t&&typeof t=="object"&&(r=t,t=null),t){const s=ud(t);r.hostname=s.host,r.secure=s.protocol==="https"||s.protocol==="wss",r.port=s.port,s.query&&(r.query=s.query)}else r.host&&(r.hostname=ud(r.host).host);uu(this,r),this.secure=r.secure!=null?r.secure:typeof location<"u"&&location.protocol==="https:",r.hostname&&!r.port&&(r.port=this.secure?"443":"80"),this.hostname=r.hostname||(typeof location<"u"?location.hostname:"localhost"),this.port=r.port||(typeof location<"u"&&location.port?location.port:this.secure?"443":"80"),this.transports=[],this._transportsByName={},r.transports.forEach(s=>{const l=s.prototype.name;this.transports.push(l),this._transportsByName[l]=s}),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},r),this.opts.path=this.opts.path.replace(/\/$/,"")+(this.opts.addTrailingSlash?"/":""),typeof this.opts.query=="string"&&(this.opts.query=rE(this.opts.query)),fd&&(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"})},Ic.push(this._offlineEventListener))),this.opts.withCredentials&&(this._cookieJar=void 0),this._open()}createTransport(t){const r=Object.assign({},this.opts.query);r.EIO=Nb,r.transport=t,this.id&&(r.sid=this.id);const s=Object.assign({},this.opts,{query:r,socket:this,hostname:this.hostname,secure:this.secure,port:this.port},this.opts.transportOptions[t]);return new this._transportsByName[t](s)}_open(){if(this.transports.length===0){this.setTimeoutFn(()=>{this.emitReserved("error","No transports available")},0);return}const t=this.opts.rememberUpgrade&&ci.priorWebsocketSuccess&&this.transports.indexOf("websocket")!==-1?"websocket":this.transports[0];this.readyState="opening";const r=this.createTransport(t);r.open(),this.setTransport(r)}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",r=>this._onClose("transport close",r))}onOpen(){this.readyState="open",ci.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 r=new Error("server error");r.code=t.data,this._onError(r);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 r=1;for(let s=0;s<this.writeBuffer.length;s++){const l=this.writeBuffer[s].data;if(l&&(r+=eE(l)),s>0&&r>this._maxPayload)return this.writeBuffer.slice(0,s);r+=2}return this.writeBuffer}_hasPingExpired(){if(!this._pingTimeoutTime)return!0;const t=Date.now()>this._pingTimeoutTime;return t&&(this._pingTimeoutTime=0,cu(()=>{this._onClose("ping timeout")},this.setTimeoutFn)),t}write(t,r,s){return this._sendPacket("message",t,r,s),this}send(t,r,s){return this._sendPacket("message",t,r,s),this}_sendPacket(t,r,s,l){if(typeof r=="function"&&(l=r,r=void 0),typeof s=="function"&&(l=s,s=null),this.readyState==="closing"||this.readyState==="closed")return;s=s||{},s.compress=s.compress!==!1;const c={type:t,data:r,options:s};this.emitReserved("packetCreate",c),this.writeBuffer.push(c),l&&this.once("flush",l),this.flush()}close(){const t=()=>{this._onClose("forced close"),this.transport.close()},r=()=>{this.off("upgrade",r),this.off("upgradeError",r),t()},s=()=>{this.once("upgrade",r),this.once("upgradeError",r)};return(this.readyState==="opening"||this.readyState==="open")&&(this.readyState="closing",this.writeBuffer.length?this.once("drain",()=>{this.upgrading?s():t()}):this.upgrading?s():t()),this}_onError(t){if(ci.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,r){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(),fd&&(this._beforeunloadEventListener&&removeEventListener("beforeunload",this._beforeunloadEventListener,!1),this._offlineEventListener)){const s=Ic.indexOf(this._offlineEventListener);s!==-1&&Ic.splice(s,1)}this.readyState="closed",this.id=null,this.emitReserved("close",t,r),this.writeBuffer=[],this._prevBufferLen=0}}}ci.protocol=Nb;class vE extends ci{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 r=this.createTransport(t),s=!1;ci.priorWebsocketSuccess=!1;const l=()=>{s||(r.send([{type:"ping",data:"probe"}]),r.once("packet",b=>{if(!s)if(b.type==="pong"&&b.data==="probe"){if(this.upgrading=!0,this.emitReserved("upgrading",r),!r)return;ci.priorWebsocketSuccess=r.name==="websocket",this.transport.pause(()=>{s||this.readyState!=="closed"&&(m(),this.setTransport(r),r.send([{type:"upgrade"}]),this.emitReserved("upgrade",r),r=null,this.upgrading=!1,this.flush())})}else{const v=new Error("probe error");v.transport=r.name,this.emitReserved("upgradeError",v)}}))};function c(){s||(s=!0,m(),r.close(),r=null)}const d=b=>{const v=new Error("probe error: "+b);v.transport=r.name,c(),this.emitReserved("upgradeError",v)};function p(){d("transport closed")}function g(){d("socket closed")}function f(b){r&&b.name!==r.name&&c()}const m=()=>{r.removeListener("open",l),r.removeListener("error",d),r.removeListener("close",p),this.off("close",g),this.off("upgrading",f)};r.once("open",l),r.once("error",d),r.once("close",p),this.once("close",g),this.once("upgrading",f),this._upgrades.indexOf("webtransport")!==-1&&t!=="webtransport"?this.setTimeoutFn(()=>{s||r.open()},200):r.open()}onHandshake(t){this._upgrades=this._filterUpgrades(t.upgrades),super.onHandshake(t)}_filterUpgrades(t){const r=[];for(let s=0;s<t.length;s++)~this.transports.indexOf(t[s])&&r.push(t[s]);return r}}let xE=class extends vE{constructor(t,r={}){const s=typeof t=="object"?t:r;(!s.transports||s.transports&&typeof s.transports[0]=="string")&&(s.transports=(s.transports||["polling","websocket","webtransport"]).map(l=>mE[l]).filter(l=>!!l)),super(t,s)}};function _E(i,t="",r){let s=i;r=r||typeof location<"u"&&location,i==null&&(i=r.protocol+"//"+r.host),typeof i=="string"&&(i.charAt(0)==="/"&&(i.charAt(1)==="/"?i=r.protocol+i:i=r.host+i),/^(https?|wss?):\/\//.test(i)||(typeof r<"u"?i=r.protocol+"//"+i:i="https://"+i),s=ud(i)),s.port||(/^(http|ws)$/.test(s.protocol)?s.port="80":/^(http|ws)s$/.test(s.protocol)&&(s.port="443")),s.path=s.path||"/";const c=s.host.indexOf(":")!==-1?"["+s.host+"]":s.host;return s.id=s.protocol+"://"+c+":"+s.port+t,s.href=s.protocol+"://"+c+(r&&r.port===s.port?"":":"+s.port),s}const wE=typeof ArrayBuffer=="function",SE=i=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(i):i.buffer instanceof ArrayBuffer,qb=Object.prototype.toString,EE=typeof Blob=="function"||typeof Blob<"u"&&qb.call(Blob)==="[object BlobConstructor]",OE=typeof File=="function"||typeof File<"u"&&qb.call(File)==="[object FileConstructor]";function qd(i){return wE&&(i instanceof ArrayBuffer||SE(i))||EE&&i instanceof Blob||OE&&i instanceof File}function Hc(i,t){if(!i||typeof i!="object")return!1;if(Array.isArray(i)){for(let r=0,s=i.length;r<s;r++)if(Hc(i[r]))return!0;return!1}if(qd(i))return!0;if(i.toJSON&&typeof i.toJSON=="function"&&arguments.length===1)return Hc(i.toJSON(),!0);for(const r in i)if(Object.prototype.hasOwnProperty.call(i,r)&&Hc(i[r]))return!0;return!1}function AE(i){const t=[],r=i.data,s=i;return s.data=hd(r,t),s.attachments=t.length,{packet:s,buffers:t}}function hd(i,t){if(!i)return i;if(qd(i)){const r={_placeholder:!0,num:t.length};return t.push(i),r}else if(Array.isArray(i)){const r=new Array(i.length);for(let s=0;s<i.length;s++)r[s]=hd(i[s],t);return r}else if(typeof i=="object"&&!(i instanceof Date)){const r={};for(const s in i)Object.prototype.hasOwnProperty.call(i,s)&&(r[s]=hd(i[s],t));return r}return i}function jE(i,t){return i.data=dd(i.data,t),delete i.attachments,i}function dd(i,t){if(!i)return i;if(i&&i._placeholder===!0){if(typeof i.num=="number"&&i.num>=0&&i.num<t.length)return t[i.num];throw new Error("illegal attachments")}else if(Array.isArray(i))for(let r=0;r<i.length;r++)i[r]=dd(i[r],t);else if(typeof i=="object")for(const r in i)Object.prototype.hasOwnProperty.call(i,r)&&(i[r]=dd(i[r],t));return i}const TE=["connect","connect_error","disconnect","disconnecting","newListener","removeListener"];var Ue;(function(i){i[i.CONNECT=0]="CONNECT",i[i.DISCONNECT=1]="DISCONNECT",i[i.EVENT=2]="EVENT",i[i.ACK=3]="ACK",i[i.CONNECT_ERROR=4]="CONNECT_ERROR",i[i.BINARY_EVENT=5]="BINARY_EVENT",i[i.BINARY_ACK=6]="BINARY_ACK"})(Ue||(Ue={}));class NE{constructor(t){this.replacer=t}encode(t){return(t.type===Ue.EVENT||t.type===Ue.ACK)&&Hc(t)?this.encodeAsBinary({type:t.type===Ue.EVENT?Ue.BINARY_EVENT:Ue.BINARY_ACK,nsp:t.nsp,data:t.data,id:t.id}):[this.encodeAsString(t)]}encodeAsString(t){let r=""+t.type;return(t.type===Ue.BINARY_EVENT||t.type===Ue.BINARY_ACK)&&(r+=t.attachments+"-"),t.nsp&&t.nsp!=="/"&&(r+=t.nsp+","),t.id!=null&&(r+=t.id),t.data!=null&&(r+=JSON.stringify(t.data,this.replacer)),r}encodeAsBinary(t){const r=AE(t),s=this.encodeAsString(r.packet),l=r.buffers;return l.unshift(s),l}}class Bd extends wt{constructor(t){super(),this.opts=Object.assign({reviver:void 0,maxAttachments:10},typeof t=="function"?{reviver:t}:t)}add(t){let r;if(typeof t=="string"){if(this.reconstructor)throw new Error("got plaintext data when reconstructing a packet");r=this.decodeString(t);const s=r.type===Ue.BINARY_EVENT;s||r.type===Ue.BINARY_ACK?(r.type=s?Ue.EVENT:Ue.ACK,this.reconstructor=new kE(r),r.attachments===0&&super.emitReserved("decoded",r)):super.emitReserved("decoded",r)}else if(qd(t)||t.base64)if(this.reconstructor)r=this.reconstructor.takeBinaryData(t),r&&(this.reconstructor=null,super.emitReserved("decoded",r));else throw new Error("got binary data when not reconstructing a packet");else throw new Error("Unknown type: "+t)}decodeString(t){let r=0;const s={type:Number(t.charAt(0))};if(Ue[s.type]===void 0)throw new Error("unknown packet type "+s.type);if(s.type===Ue.BINARY_EVENT||s.type===Ue.BINARY_ACK){const c=r+1;for(;t.charAt(++r)!=="-"&&r!=t.length;);const d=t.substring(c,r);if(d!=Number(d)||t.charAt(r)!=="-")throw new Error("Illegal attachments");const p=Number(d);if(!CE(p)||p<0)throw new Error("Illegal attachments");if(p>this.opts.maxAttachments)throw new Error("too many attachments");s.attachments=p}if(t.charAt(r+1)==="/"){const c=r+1;for(;++r&&!(t.charAt(r)===","||r===t.length););s.nsp=t.substring(c,r)}else s.nsp="/";const l=t.charAt(r+1);if(l!==""&&Number(l)==l){const c=r+1;for(;++r;){const d=t.charAt(r);if(d==null||Number(d)!=d){--r;break}if(r===t.length)break}s.id=Number(t.substring(c,r+1))}if(t.charAt(++r)){const c=this.tryParse(t.substr(r));if(Bd.isPayloadValid(s.type,c))s.data=c;else throw new Error("invalid payload")}return s}tryParse(t){try{return JSON.parse(t,this.opts.reviver)}catch{return!1}}static isPayloadValid(t,r){switch(t){case Ue.CONNECT:return vg(r);case Ue.DISCONNECT:return r===void 0;case Ue.CONNECT_ERROR:return typeof r=="string"||vg(r);case Ue.EVENT:case Ue.BINARY_EVENT:return Array.isArray(r)&&(typeof r[0]=="number"||typeof r[0]=="string"&&TE.indexOf(r[0])===-1);case Ue.ACK:case Ue.BINARY_ACK:return Array.isArray(r)}}destroy(){this.reconstructor&&(this.reconstructor.finishedReconstruction(),this.reconstructor=null)}}class kE{constructor(t){this.packet=t,this.buffers=[],this.reconPack=t}takeBinaryData(t){if(this.buffers.push(t),this.buffers.length===this.reconPack.attachments){const r=jE(this.reconPack,this.buffers);return this.finishedReconstruction(),r}return null}finishedReconstruction(){this.reconPack=null,this.buffers=[]}}const CE=Number.isInteger||function(i){return typeof i=="number"&&isFinite(i)&&Math.floor(i)===i};function vg(i){return Object.prototype.toString.call(i)==="[object Object]"}const ME=Object.freeze(Object.defineProperty({__proto__:null,Decoder:Bd,Encoder:NE,get PacketType(){return Ue}},Symbol.toStringTag,{value:"Module"}));function Pn(i,t,r){return i.on(t,r),function(){i.off(t,r)}}const RE=Object.freeze({connect:1,connect_error:1,disconnect:1,disconnecting:1,newListener:1,removeListener:1});class Bb extends wt{constructor(t,r,s){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=r,s&&s.auth&&(this.auth=s.auth),this._opts=Object.assign({},s),this.io._autoConnect&&this.open()}get disconnected(){return!this.connected}subEvents(){if(this.subs)return;const t=this.io;this.subs=[Pn(t,"open",this.onopen.bind(this)),Pn(t,"packet",this.onpacket.bind(this)),Pn(t,"error",this.onerror.bind(this)),Pn(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,...r){var s,l,c;if(RE.hasOwnProperty(t))throw new Error('"'+t.toString()+'" is a reserved event name');if(r.unshift(t),this._opts.retries&&!this.flags.fromQueue&&!this.flags.volatile)return this._addToQueue(r),this;const d={type:Ue.EVENT,data:r};if(d.options={},d.options.compress=this.flags.compress!==!1,typeof r[r.length-1]=="function"){const m=this.ids++,b=r.pop();this._registerAckCallback(m,b),d.id=m}const p=(l=(s=this.io.engine)===null||s===void 0?void 0:s.transport)===null||l===void 0?void 0:l.writable,g=this.connected&&!(!((c=this.io.engine)===null||c===void 0)&&c._hasPingExpired());return this.flags.volatile&&!p||(g?(this.notifyOutgoingListeners(d),this.packet(d)):this.sendBuffer.push(d)),this.flags={},this}_registerAckCallback(t,r){var s;const l=(s=this.flags.timeout)!==null&&s!==void 0?s:this._opts.ackTimeout;if(l===void 0){this.acks[t]=r;return}const c=this.io.setTimeoutFn(()=>{delete this.acks[t];for(let p=0;p<this.sendBuffer.length;p++)this.sendBuffer[p].id===t&&this.sendBuffer.splice(p,1);r.call(this,new Error("operation has timed out"))},l),d=(...p)=>{this.io.clearTimeoutFn(c),r.apply(this,p)};d.withError=!0,this.acks[t]=d}emitWithAck(t,...r){return new Promise((s,l)=>{const c=(d,p)=>d?l(d):s(p);c.withError=!0,r.push(c),this.emit(t,...r)})}_addToQueue(t){let r;typeof t[t.length-1]=="function"&&(r=t.pop());const s={id:this._queueSeq++,tryCount:0,pending:!1,args:t,flags:Object.assign({fromQueue:!0},this.flags)};t.push((l,...c)=>(this._queue[0],l!==null?s.tryCount>this._opts.retries&&(this._queue.shift(),r&&r(l)):(this._queue.shift(),r&&r(null,...c)),s.pending=!1,this._drainQueue())),this._queue.push(s),this._drainQueue()}_drainQueue(t=!1){if(!this.connected||this._queue.length===0)return;const r=this._queue[0];r.pending&&!t||(r.pending=!0,r.tryCount++,this.flags=r.flags,this.emit.apply(this,r.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:Ue.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,r){this.connected=!1,delete this.id,this.emitReserved("disconnect",t,r),this._clearAcks()}_clearAcks(){Object.keys(this.acks).forEach(t=>{if(!this.sendBuffer.some(s=>String(s.id)===t)){const s=this.acks[t];delete this.acks[t],s.withError&&s.call(this,new Error("socket has been disconnected"))}})}onpacket(t){if(t.nsp===this.nsp)switch(t.type){case Ue.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 Ue.EVENT:case Ue.BINARY_EVENT:this.onevent(t);break;case Ue.ACK:case Ue.BINARY_ACK:this.onack(t);break;case Ue.DISCONNECT:this.ondisconnect();break;case Ue.CONNECT_ERROR:this.destroy();const s=new Error(t.data.message);s.data=t.data.data,this.emitReserved("connect_error",s);break}}onevent(t){const r=t.data||[];t.id!=null&&r.push(this.ack(t.id)),this.connected?this.emitEvent(r):this.receiveBuffer.push(Object.freeze(r))}emitEvent(t){if(this._anyListeners&&this._anyListeners.length){const r=this._anyListeners.slice();for(const s of r)s.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 r=this;let s=!1;return function(...l){s||(s=!0,r.packet({type:Ue.ACK,id:t,data:l}))}}onack(t){const r=this.acks[t.id];typeof r=="function"&&(delete this.acks[t.id],r.withError&&t.data.unshift(null),r.apply(this,t.data))}onconnect(t,r){this.id=t,this.recovered=r&&this._pid===r,this._pid=r,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:Ue.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 r=this._anyListeners;for(let s=0;s<r.length;s++)if(t===r[s])return r.splice(s,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 r=this._anyOutgoingListeners;for(let s=0;s<r.length;s++)if(t===r[s])return r.splice(s,1),this}else this._anyOutgoingListeners=[];return this}listenersAnyOutgoing(){return this._anyOutgoingListeners||[]}notifyOutgoingListeners(t){if(this._anyOutgoingListeners&&this._anyOutgoingListeners.length){const r=this._anyOutgoingListeners.slice();for(const s of r)s.apply(this,t.data)}}}function Xs(i){i=i||{},this.ms=i.min||100,this.max=i.max||1e4,this.factor=i.factor||2,this.jitter=i.jitter>0&&i.jitter<=1?i.jitter:0,this.attempts=0}Xs.prototype.duration=function(){var i=this.ms*Math.pow(this.factor,this.attempts++);if(this.jitter){var t=Math.random(),r=Math.floor(t*this.jitter*i);i=(Math.floor(t*10)&1)==0?i-r:i+r}return Math.min(i,this.max)|0};Xs.prototype.reset=function(){this.attempts=0};Xs.prototype.setMin=function(i){this.ms=i};Xs.prototype.setMax=function(i){this.max=i};Xs.prototype.setJitter=function(i){this.jitter=i};class md extends wt{constructor(t,r){var s;super(),this.nsps={},this.subs=[],t&&typeof t=="object"&&(r=t,t=void 0),r=r||{},r.path=r.path||"/socket.io",this.opts=r,uu(this,r),this.reconnection(r.reconnection!==!1),this.reconnectionAttempts(r.reconnectionAttempts||1/0),this.reconnectionDelay(r.reconnectionDelay||1e3),this.reconnectionDelayMax(r.reconnectionDelayMax||5e3),this.randomizationFactor((s=r.randomizationFactor)!==null&&s!==void 0?s:.5),this.backoff=new Xs({min:this.reconnectionDelay(),max:this.reconnectionDelayMax(),jitter:this.randomizationFactor()}),this.timeout(r.timeout==null?2e4:r.timeout),this._readyState="closed",this.uri=t;const l=r.parser||ME;this.encoder=new l.Encoder,this.decoder=new l.Decoder,this._autoConnect=r.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 r;return t===void 0?this._reconnectionDelay:(this._reconnectionDelay=t,(r=this.backoff)===null||r===void 0||r.setMin(t),this)}randomizationFactor(t){var r;return t===void 0?this._randomizationFactor:(this._randomizationFactor=t,(r=this.backoff)===null||r===void 0||r.setJitter(t),this)}reconnectionDelayMax(t){var r;return t===void 0?this._reconnectionDelayMax:(this._reconnectionDelayMax=t,(r=this.backoff)===null||r===void 0||r.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 xE(this.uri,this.opts);const r=this.engine,s=this;this._readyState="opening",this.skipReconnect=!1;const l=Pn(r,"open",function(){s.onopen(),t&&t()}),c=p=>{this.cleanup(),this._readyState="closed",this.emitReserved("error",p),t?t(p):this.maybeReconnectOnOpen()},d=Pn(r,"error",c);if(this._timeout!==!1){const p=this._timeout,g=this.setTimeoutFn(()=>{l(),c(new Error("timeout")),r.close()},p);this.opts.autoUnref&&g.unref(),this.subs.push(()=>{this.clearTimeoutFn(g)})}return this.subs.push(l),this.subs.push(d),this}connect(t){return this.open(t)}onopen(){this.cleanup(),this._readyState="open",this.emitReserved("open");const t=this.engine;this.subs.push(Pn(t,"ping",this.onping.bind(this)),Pn(t,"data",this.ondata.bind(this)),Pn(t,"error",this.onerror.bind(this)),Pn(t,"close",this.onclose.bind(this)),Pn(this.decoder,"decoded",this.ondecoded.bind(this)))}onping(){this.emitReserved("ping")}ondata(t){try{this.decoder.add(t)}catch(r){this.onclose("parse error",r)}}ondecoded(t){cu(()=>{this.emitReserved("packet",t)},this.setTimeoutFn)}onerror(t){this.emitReserved("error",t)}socket(t,r){let s=this.nsps[t];return s?this._autoConnect&&!s.active&&s.connect():(s=new Bb(this,t,r),this.nsps[t]=s),s}_destroy(t){const r=Object.keys(this.nsps);for(const s of r)if(this.nsps[s].active)return;this._close()}_packet(t){const r=this.encoder.encode(t);for(let s=0;s<r.length;s++)this.engine.write(r[s],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,r){var s;this.cleanup(),(s=this.engine)===null||s===void 0||s.close(),this.backoff.reset(),this._readyState="closed",this.emitReserved("close",t,r),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 r=this.backoff.duration();this._reconnecting=!0;const s=this.setTimeoutFn(()=>{t.skipReconnect||(this.emitReserved("reconnect_attempt",t.backoff.attempts),!t.skipReconnect&&t.open(l=>{l?(t._reconnecting=!1,t.reconnect(),this.emitReserved("reconnect_error",l)):t.onreconnect()}))},r);this.opts.autoUnref&&s.unref(),this.subs.push(()=>{this.clearTimeoutFn(s)})}}onreconnect(){const t=this.backoff.attempts;this._reconnecting=!1,this.backoff.reset(),this.emitReserved("reconnect",t)}}const Ya={};function Gc(i,t){typeof i=="object"&&(t=i,i=void 0),t=t||{};const r=_E(i,t.path||"/socket.io"),s=r.source,l=r.id,c=r.path,d=Ya[l]&&c in Ya[l].nsps,p=t.forceNew||t["force new connection"]||t.multiplex===!1||d;let g;return p?g=new md(s,t):(Ya[l]||(Ya[l]=new md(s,t)),g=Ya[l]),r.query&&!t.query&&(t.query=r.queryKey),g.socket(r.path,t)}Object.assign(Gc,{Manager:md,Socket:Bb,io:Gc,connect:Gc});const DE=T.createContext({connected:!1,subscribe:()=>()=>{}});function qE({children:i}){const t=T.useRef(null),[r,s]=T.useState(!1),l=T.useRef(new Map),c=T.useCallback((p,g)=>{var m;const f=l.current;return f.has(p)||(f.set(p,new Set),(m=t.current)==null||m.emit("lt.subscribe",p)),f.get(p).add(g),()=>{var v;const b=f.get(p);b&&(b.delete(g),b.size===0&&(f.delete(p),(v=t.current)==null||v.emit("lt.unsubscribe",p)))}},[]),d=T.useCallback((p,g)=>{for(const[f,m]of l.current)if(Sb(p,f))for(const b of m)try{b(g)}catch{}},[]);return T.useEffect(()=>{const p=ib(),g=Gc({path:`${Mt}/socket.io`,transports:["polling","websocket"],upgrade:!0,reconnection:!0,reconnectionAttempts:1/0,reconnectionDelay:2e3,...p?{auth:{token:p}}:{}});return t.current=g,console.log("[lt-socketio] connecting..."),g.on("connect",()=>{console.log("[lt-socketio] connected, id:",g.id),s(!0);for(const f of l.current.keys())g.emit("lt.subscribe",f)}),g.on("disconnect",f=>{console.log("[lt-socketio] disconnected:",f),s(!1)}),g.on("connect_error",f=>{console.warn("[lt-socketio] connect error:",f.message),s(!1)}),g.onAny((f,m)=>{if(f.startsWith("lt."))try{const b=typeof m=="string"?JSON.parse(m):m;d(f,b)}catch{}}),()=>{g.removeAllListeners(),g.disconnect(),t.current=null,s(!1)}},[d]),y.jsx(DE.Provider,{value:{connected:r,subscribe:c},children:y.jsx(Ks.Provider,{value:{connected:r,subscribe:c},children:i})})}function BE({children:i}){const[t,r]=T.useState(null),[s,l]=T.useState({url:null,token:null});return T.useEffect(()=>{let c=!1;async function d(){var p;try{console.log("[lt-transport] detecting event transport...");const g=await fetch(`${Mt}/api/settings`);if(!g.ok){console.warn("[lt-transport] settings fetch failed, falling back to socketio"),c||r("socketio");return}const f=await g.json(),m=(p=f==null?void 0:f.events)==null?void 0:p.transport;if(console.log("[lt-transport] server reports:",m),!c){if(m==="nats"){let b=f.events.natsWsUrl??null,v=null;const _=ib();if(_)try{const w=await fetch(`${Mt}/api/nats-credentials`,{headers:{Authorization:`Bearer ${_}`}});if(w.ok){const S=await w.json();b=S.natsWsUrl??b,v=S.natsToken??null}}catch{console.warn("[lt-transport] failed to fetch NATS credentials")}l({url:b,token:v})}r(m==="nats"?"nats":"socketio")}}catch(g){console.warn("[lt-transport] settings fetch error, falling back to socketio",g),c||r("socketio")}}return d(),()=>{c=!0}},[]),t==="nats"?y.jsx(P2,{url:s.url,token:s.token,children:i}):t==="socketio"?y.jsx(qE,{children:i}):y.jsx(y.Fragment,{children:i})}const Ld="lt_view_as",zd="lt_ai_override",pd="lt_graph_enabled",Ud="lt_scan_override";function Lb(){try{const i=localStorage.getItem(zd);if(i==="true")return!0;if(i==="false")return!1}catch{}return null}function LE(i){try{localStorage.setItem(zd,String(i))}catch{}}function zE(){try{localStorage.removeItem(zd)}catch{}}function Pd(){try{const i=localStorage.getItem(Ld);if(i==="admin"||i==="engineer"||i==="operator")return i}catch{}return null}function UE(i){try{localStorage.setItem(Ld,i)}catch{}window.location.reload()}function yd(){try{localStorage.removeItem(Ld)}catch{}window.location.reload()}function zb(){try{return localStorage.getItem(pd)==="true"}catch{return!1}}function PE(i){try{i?localStorage.setItem(pd,"true"):localStorage.removeItem(pd)}catch{}}function Ub(){try{const i=localStorage.getItem(Ud);if(i==="true")return!0;if(i==="false")return!1}catch{}return null}function $E(i){try{localStorage.setItem(Ud,String(i))}catch{}}function IE(){try{localStorage.removeItem(Ud)}catch{}}function Pb(){const{isSuperAdmin:i,hasRoleType:t,hasRole:r}=pn(),s=Pd(),l=i||r("engineer"),c=t("admin"),d=i||t("admin");return{isBuilder:s?!1:l,isOps:s?s==="admin"||s==="engineer":c,canBulk:s?s==="admin":d,viewAs:s,realIsBuilder:l}}const HE="lt_ai_override";function GE(){return Ee("/settings")}function FE(){try{if(localStorage.getItem(HE)==="off")return!1}catch{}return null}function Or(){var r;const i=ot({queryKey:["settings"],queryFn:GE,staleTime:1/0}),t=FE();return i.data&&t===!1&&((r=i.data.ai)!=null&&r.enabled)?{...i,data:{...i.data,ai:{enabled:!1}}}:i}function $b(){var f;const{isSuperAdmin:i,hasRoleType:t,hasRole:r}=pn(),{data:s}=Or(),l=((f=s==null?void 0:s.features)==null?void 0:f.publicPaceBoard)!==!1,c=i?"superadmin":t("admin")?"admin":r("engineer")?"engineer":"operator",d=Pd(),p=d==="admin"||d==="engineer"||d==="operator"?d:null,g=p??c;return{tier:g,realTier:c,viewAs:p,canSeePaceBoard:l||g==="superadmin"||g==="admin",canSeeWorkflows:g==="superadmin"||g==="engineer",showTaskQueueCards:g==="operator"&&!l}}function Ib(i){return(i??"").replace(/[^A-Za-z0-9_-]+/g,"-").replace(/^-+|-+$/g,"")||"none"}function gd(i={}){const t=i.role?Ib(i.role):"*",r=i.id??"*",s=i.verb??">";return`${B2}.system.escalation.${t}.${r}.${s}`}function xg(i){return i.verbs.map(t=>gd({role:i.role,verb:t}))}function $d(i){const{user:t,isSuperAdmin:r,hasRoleType:s}=pn(),l=r||s("admin"),c=((t==null?void 0:t.roles)??[]).map(p=>p.role).sort().join(","),d=(i??[]).join(",");return T.useMemo(()=>{const p=d?d.split(","):null;return l||!c?p?xg({verbs:p}):[gd({})]:c.split(",").flatMap(g=>p?xg({role:g,verbs:p}):[gd({role:g})])},[l,c,d])}const bd="/escalations/detail/";function VE(i){return i.startsWith(bd)&&i.slice(bd.length).split("/")[0]||void 0}function YE(){const{user:i}=pn(),t=yo(),r=mn(),s=T.useRef(r.pathname);s.current=r.pathname;const l=T.useRef(i==null?void 0:i.userId);l.current=i==null?void 0:i.userId;const c=T.useCallback(d=>{var b,v,_;if((d==null?void 0:d.assignedAtCreation)!==!0)return;const p=(d==null?void 0:d.escalationId)??((b=d==null?void 0:d.data)==null?void 0:b.id),g=(v=d==null?void 0:d.data)==null?void 0:v.assigned_to,f=(_=d==null?void 0:d.data)==null?void 0:_.parent_id;if(!p||g!==l.current||!f||f!==VE(s.current))return;const m=`${bd}${p}`;s.current!==m&&t(m)},[t]);Cd($d(["claimed"]),c)}const Id=T.createContext(null),Uh="lt_sidebar_collapsed",Hb="(max-width: 1023px)";function KE(){try{return window.matchMedia(Hb).matches}catch{return!1}}function XE({children:i}){const[t,r]=T.useState(()=>{if(KE())return!0;try{return localStorage.getItem(Uh)==="true"}catch{return!1}});T.useEffect(()=>{let l;try{l=window.matchMedia(Hb)}catch{return}const c=d=>{if(d.matches)r(!0);else try{r(localStorage.getItem(Uh)==="true")}catch{r(!1)}};return l.addEventListener("change",c),()=>l.removeEventListener("change",c)},[]);const s=T.useCallback(()=>{r(l=>{const c=!l;try{localStorage.setItem(Uh,String(c))}catch{}return c})},[]);return y.jsx(Id.Provider,{value:{collapsed:t,toggle:s},children:i})}function JE({children:i}){return y.jsx(Id.Provider,{value:{collapsed:!1,toggle:()=>{}},children:i})}function Hd(){const i=T.useContext(Id);if(!i)throw new Error("useSidebar must be used within SidebarProvider");return i}const _g=380,Gd=T.createContext(null);function QE({children:i}){const[t,r]=T.useState({node:null,width:_g,open:!1,ownerKey:null}),s=mn(),l=T.useRef(s.pathname),c=T.useCallback((p,g)=>{r({node:p,width:(g==null?void 0:g.width)??_g,open:!0,ownerKey:(g==null?void 0:g.key)??null})},[]),d=T.useCallback(p=>{r(g=>typeof p=="string"&&g.ownerKey!==p?g:{...g,open:!1})},[]);return T.useEffect(()=>{s.pathname!==l.current&&(l.current=s.pathname,r(p=>p.open||p.node?{...p,node:null,open:!1,ownerKey:null}:p))},[s.pathname]),y.jsx(Gd.Provider,{value:{...t,setPanel:c,closePanel:d},children:i})}function Fd(){const i=T.useContext(Gd);if(!i)throw new Error("useShellPanel must be used within ShellPanelProvider");return i}function FT(){return T.useContext(Gd)}function ZE({open:i,width:t=380,children:r,className:s=""}){const[l,c]=T.useState(i);return T.useEffect(()=>{i&&c(!0)},[i]),y.jsx("div",{className:`shrink-0 overflow-hidden transition-[width] duration-300 ease-out ${s}`,style:{width:i?t:0,maxWidth:"50%"},onTransitionEnd:d=>{!i&&d.propertyName==="width"&&c(!1)},children:y.jsx("div",{style:{width:t},className:"h-full",children:l?r:null})})}function VT({label:i,children:t}){return y.jsxs("div",{children:[y.jsx("dt",{className:"text-2xs font-medium text-text-secondary uppercase tracking-wide",children:i}),y.jsx("dd",{className:"text-xs text-text-primary mt-0.5",children:t})]})}function YT({views:i,activeId:t,onViewChange:r,onClose:s,headerActions:l,stickyClassName:c}){const d=i.find(p=>p.id===t)??i[0];return d?y.jsx("div",{className:"h-full bg-surface-hover",children:y.jsxs("div",{className:`flex flex-col ${c??"sticky top-0 z-10 max-h-[calc(100vh-3.5rem)]"}`,children:[y.jsxs("div",{className:"flex items-center justify-between pl-4 pr-3 pt-3 shrink-0",children:[y.jsx("div",{className:"flex items-center gap-1",role:"radiogroup","aria-label":"Panel view",children:i.map(p=>{const g=p.icon,f=p.id===d.id;return y.jsx("button",{role:"radio","aria-checked":f,onClick:()=>r(p.id),title:p.label,className:`p-1.5 rounded-md transition-colors ${f?"bg-accent/10 text-accent":"text-text-tertiary hover:text-text-primary hover:bg-surface-hover"}`,children:y.jsx(g,{className:"w-3.5 h-3.5"})},p.id)})}),y.jsxs("div",{className:"flex items-center gap-1",children:[l,s&&y.jsx("button",{onClick:s,title:"Close panel",className:"p-1 rounded text-text-tertiary hover:text-text-primary hover:bg-surface-hover transition-colors",children:y.jsx(Cn,{className:"w-3.5 h-3.5"})})]})]}),y.jsx("p",{className:"px-5 pt-2 pb-1 text-2xs font-semibold uppercase tracking-widest text-text-secondary shrink-0",children:d.label}),y.jsx("div",{className:"flex-1 overflow-y-auto px-5 pb-5 pt-1",children:d.content})]})}):null}function Gb(i,t){var r,s,l,c,d;t.facets&&Object.keys(t.facets).length&&i.set("facets",JSON.stringify(t.facets)),(r=t.block)!=null&&r.length&&i.set("block",JSON.stringify(t.block)),(s=t.range)!=null&&s.length&&i.set("range",JSON.stringify(t.range)),(l=t.exists)!=null&&l.length&&i.set("exists",JSON.stringify(t.exists)),(c=t.roles)!=null&&c.length&&i.set("roles",JSON.stringify(t.roles)),(d=t.orderBy)!=null&&d.length&&i.set("orderBy",JSON.stringify(t.orderBy)),t.available!==void 0&&i.set("available",String(t.available)),t.jeopardy===!0&&i.set("jeopardy","1")}function KT(i,t){const r=i??"24h";return ot({queryKey:["stationMetrics",r],queryFn:()=>Ee(`/escalations/station-metrics?period=${r}`),staleTime:5e3,enabled:(t==null?void 0:t.enabled)??!0})}function XT(i){const t=i?`?period=${i}`:"";return ot({queryKey:["escalationStats",i],queryFn:()=>Ee(`/escalations/stats${t}`)})}function JT(){return ot({queryKey:["escalationTypes"],queryFn:()=>Ee("/escalations/types")})}function QT(i=!0){return ot({queryKey:["escalationFacetKeys"],queryFn:()=>Ee("/escalations/facet-keys"),enabled:i,staleTime:6e4})}function Fb(i){const{enabled:t=!0,staleTime:r,...s}=i,l=new URLSearchParams;return s.status&&l.set("status",s.status),s.role&&l.set("role",s.role),s.type&&l.set("type",s.type),s.subtype&&l.set("subtype",s.subtype),s.assigned_to&&l.set("assigned_to",s.assigned_to),s.parent_id&&l.set("parent_id",s.parent_id),s.claimed&&l.set("claimed","true"),s.priority&&l.set("priority",String(s.priority)),s.limit&&l.set("limit",String(s.limit)),s.offset!==void 0&&l.set("offset",String(s.offset)),s.sort_by&&l.set("sort_by",s.sort_by),s.order&&l.set("order",s.order),s.search&&l.set("search",s.search),Gb(l,s),ot({queryKey:["escalations",s],queryFn:()=>Ee(`/escalations?${l}`),enabled:t,...r!==void 0?{staleTime:r}:{}})}function Vb(i){const{enabled:t=!0,staleTime:r,...s}=i,l=new URLSearchParams;return s.role&&l.set("role",s.role),s.type&&l.set("type",s.type),s.subtype&&l.set("subtype",s.subtype),s.priority&&l.set("priority",String(s.priority)),s.limit&&l.set("limit",String(s.limit)),s.offset!==void 0&&l.set("offset",String(s.offset)),s.sort_by&&l.set("sort_by",s.sort_by),s.order&&l.set("order",s.order),s.search&&l.set("search",s.search),Gb(l,s),ot({queryKey:["escalations","available",s],queryFn:()=>Ee(`/escalations/available?${l}`),enabled:t,...r!==void 0?{staleTime:r}:{}})}function ZT(i){return ot({queryKey:["escalations","by-workflow",i],queryFn:()=>Ee(`/escalations/by-workflow/${i}`),enabled:!!i})}function WT(i){return ot({queryKey:["escalations",i],queryFn:()=>Ee(`/escalations/${i}`),enabled:!!i})}function eN(){const i=st();return dt({mutationFn:({id:t,durationMinutes:r})=>Ee(`/escalations/${t}/claim`,{method:"POST",body:JSON.stringify({durationMinutes:r})}),onSuccess:()=>{i.resetQueries({queryKey:["escalations"]}),i.resetQueries({queryKey:["escalationStats"]})}})}function tN(){const i=st();return dt({mutationFn:t=>Ee(`/escalations/${t}/release`,{method:"POST"}),onSuccess:()=>{i.resetQueries({queryKey:["escalations"]}),i.resetQueries({queryKey:["escalationStats"]})}})}function nN(){const i=st();return dt({mutationFn:({id:t,resolverPayload:r})=>Ee(`/escalations/${t}/resolve`,{method:"POST",body:JSON.stringify({resolverPayload:r})}),onSuccess:()=>{i.resetQueries({queryKey:["escalations"]}),i.resetQueries({queryKey:["escalationStats"]}),i.resetQueries({queryKey:["tasks"]}),i.resetQueries({queryKey:["jobs"]})}})}function rN(){const i=st();return dt({mutationFn:({id:t,targetRole:r})=>Ee(`/escalations/${t}/escalate`,{method:"PATCH",body:JSON.stringify({targetRole:r})}),onSuccess:()=>{i.resetQueries({queryKey:["escalations"]}),i.resetQueries({queryKey:["escalationStats"]})}})}function iN(){const i=st();return dt({mutationFn:({ids:t,priority:r})=>Ee("/escalations/priority",{method:"PATCH",body:JSON.stringify({ids:t,priority:r})}),onSuccess:()=>{i.invalidateQueries({queryKey:["escalations"],refetchType:"all"}),i.invalidateQueries({queryKey:["escalationStats"],refetchType:"all"})}})}function sN(){const i=st();return dt({mutationFn:({ids:t,durationMinutes:r})=>Ee("/escalations/bulk-claim",{method:"POST",body:JSON.stringify({ids:t,durationMinutes:r})}),onSuccess:()=>{i.invalidateQueries({queryKey:["escalations"],refetchType:"all"}),i.invalidateQueries({queryKey:["escalationStats"],refetchType:"all"})}})}function aN(){const i=st();return dt({mutationFn:({ids:t,targetUserId:r,durationMinutes:s})=>Ee("/escalations/bulk-assign",{method:"POST",body:JSON.stringify({ids:t,targetUserId:r,durationMinutes:s})}),onSuccess:()=>{i.invalidateQueries({queryKey:["escalations"],refetchType:"all"}),i.invalidateQueries({queryKey:["escalationStats"],refetchType:"all"})}})}function oN(){const i=st();return dt({mutationFn:({ids:t,targetRole:r})=>Ee("/escalations/bulk-escalate",{method:"PATCH",body:JSON.stringify({ids:t,targetRole:r})}),onSuccess:()=>{i.invalidateQueries({queryKey:["escalations"],refetchType:"all"}),i.invalidateQueries({queryKey:["escalationStats"],refetchType:"all"})}})}function lN(){const i=st();return dt({mutationFn:({ids:t,hint:r})=>Ee("/escalations/bulk-triage",{method:"POST",body:JSON.stringify({ids:t,...r?{hint:r}:{}})}),onSuccess:()=>{i.invalidateQueries({queryKey:["escalations"],refetchType:"all"}),i.invalidateQueries({queryKey:["escalationStats"],refetchType:"all"})}})}function cN(){const i=st();return dt({mutationFn:t=>Ee(`/escalations/${t}/cancel`,{method:"POST"}),onSuccess:()=>{i.resetQueries({queryKey:["escalations"]}),i.resetQueries({queryKey:["escalationStats"]})}})}function uN(){const i=st();return dt({mutationFn:({ids:t})=>Ee("/escalations/bulk-cancel",{method:"POST",body:JSON.stringify({ids:t})}),onSuccess:()=>{i.invalidateQueries({queryKey:["escalations"],refetchType:"all"}),i.invalidateQueries({queryKey:["escalationStats"],refetchType:"all"})}})}function WE(){const{user:i}=pn(),t=i==null?void 0:i.userId,r=st(),s=T.useRef(null),l=T.useCallback(()=>{s.current||(s.current=setTimeout(()=>{s.current=null,r.invalidateQueries({queryKey:["escalations"]})},15e3))},[r]);Cd($d(),l);const{data:c}=Vb({limit:1}),{data:d}=Fb({assigned_to:t,status:"pending",limit:1});return{available:(c==null?void 0:c.total)??0,mine:(d==null?void 0:d.total)??0}}function eu({size:i="sm",hideLabel:t=!1,className:r="",appName:s="LongTail",variant:l="full"}){const c=i==="lg";if(l==="comet")return y.jsx("div",{className:`relative overflow-visible ${r}`,style:{width:"2.5rem",height:"2.5rem",flexShrink:0},children:y.jsx("span",{role:"img","aria-label":s,className:"logo-mark absolute pointer-events-none select-none",style:{"--logo-url":`url(${Mt}/logo512.png)`,width:"82px",height:"82px",top:"-12px",left:"-80px",transform:"rotate(232deg)",zIndex:-1,opacity:.55}})});if(l==="mark")return y.jsx("div",{className:`flex items-center ${r}`,children:y.jsx("span",{role:"img","aria-label":s,className:"logo-mark shrink-0 w-7 h-7",style:{"--logo-url":`url(${Mt}/logo512.png)`}})});const d=c?"w-[16rem] h-[16rem] -rotate-[120deg] opacity-40 -ml-10":"w-[12.5rem] h-[12.5rem] -rotate-[120deg] opacity-40 -ml-8",p=c?"text-[44px] font-normal text-text-primary tracking-[0.15em] -ml-[12.5rem]":"text-[36px] font-normal text-text-primary tracking-[0.15em] -ml-[9.75rem]";return y.jsxs("div",{className:`flex items-center ${r}`,style:{height:"50px"},children:[y.jsx("span",{role:"img","aria-label":s,className:`logo-mark shrink-0 z-0 ${d}`,style:{"--logo-url":`url(${Mt}/logo512.png)`}}),y.jsx("span",{className:`z-[1] transition-opacity duration-300 ${p} ${t?"opacity-0":""}`,children:s})]})}const eO=[{id:null,label:"Your view",description:"Full access based on your account role",minTier:"operator"},{id:"admin",label:"Admin",description:"Pace Board + identity management",minTier:"superadmin"},{id:"engineer",label:"Engineer",description:"Work queue + identity management",minTier:"admin"},{id:"operator",label:"Operator",description:"Escalation queue only",minTier:"engineer"}],tO=["operator","engineer","admin","superadmin"];function wg(i){return tO.indexOf(i)}function nO(i,t){return wg(i)>=wg(t)}function rO({onClose:i}){var ae,de,Oe,le,we,Se,Ne;const{isSuperAdmin:t,hasRoleType:r,hasRole:s}=pn(),{data:l}=Or(),c=Pd(),d=!!((ae=l==null?void 0:l.ai)!=null&&ae.enabled),p=Lb(),g=p!==null?p:d,[f,m]=T.useState(g),b=(de=l==null?void 0:l.features)==null?void 0:de.graphWorkflows,v=b==null,[_,w]=T.useState(b===!0||v&&zb()),S=!!((Oe=l==null?void 0:l.features)!=null&&Oe.scanCodes),C=Ub(),[L,z]=T.useState(C!==null?C:S),se=t?"superadmin":r("admin")?"admin":s("engineer")?"engineer":"operator",oe=((le=l==null?void 0:l.branding)==null?void 0:le.appName)??"LongTail",M=(we=l==null?void 0:l.environment)==null?void 0:we.longTailVersion,B=(Se=l==null?void 0:l.environment)==null?void 0:Se.hotmeshVersion,te=(Ne=l==null?void 0:l.environment)==null?void 0:Ne.nodeEnv;T.useEffect(()=>{const be=at=>{at.key==="Escape"&&i()};return document.addEventListener("keydown",be),()=>document.removeEventListener("keydown",be)},[i]);const K=eO.filter(be=>nO(se,be.minTier)),P=K.length>1,Y=[...P?[{id:"viewas",label:"View As",icon:X_}]:[],{id:"features",label:"Features",icon:J_}],[W,X]=T.useState(Y[0].id),he=be=>{be===null?yd():UE(be)},_e=()=>{const be=!f;m(be),be===d?zE():LE(be),window.location.reload()},Te=()=>{const be=!_;w(be),PE(be),window.location.reload()},F=()=>{const be=!L;z(be),be===S?IE():$E(be),window.location.reload()};return y.jsx("div",{className:"fixed inset-0 z-[100] bg-surface-sunken/75 backdrop-blur-sm flex items-center justify-center",onClick:i,children:y.jsxs("div",{className:"relative w-[440px] max-h-[85vh] overflow-y-auto bg-surface-raised px-12 py-10",onClick:be=>be.stopPropagation(),children:[y.jsx("button",{onClick:i,className:"absolute top-4 right-4 text-text-quaternary hover:text-text-secondary transition-colors p-1","aria-label":"Close",children:y.jsx(Cn,{className:"w-4 h-4",strokeWidth:1.5})}),y.jsxs("div",{className:"flex flex-col items-center gap-3 pb-8",children:[y.jsx("span",{className:"logo-mark block w-20 h-20 opacity-50",style:{"--logo-url":`url(${Mt}/logo512.png)`}}),y.jsxs("div",{className:"text-center",children:[y.jsx("p",{className:"text-2xl font-light text-text-primary tracking-[0.12em]",children:oe}),M&&y.jsxs("p",{className:"mt-1 text-2xs text-text-tertiary",children:["v",M,B&&y.jsxs(y.Fragment,{children:[" · HotMesh v",B]}),te&&te!=="production"&&y.jsx("span",{className:"ml-1 text-status-warning",children:te})]})]})]}),y.jsx("hr",{className:"border-surface-border/50 mb-6"}),Y.length>1&&y.jsx("div",{className:"flex items-center justify-center gap-2 mb-8",role:"tablist",children:Y.map(be=>{const at=W===be.id;return y.jsxs("button",{role:"tab","aria-selected":at,onClick:()=>X(be.id),title:be.label,className:`flex flex-col items-center gap-1.5 px-5 py-2.5 rounded-lg transition-colors ${at?"bg-accent/10 text-accent":"text-text-tertiary hover:text-text-secondary hover:bg-surface-hover"}`,children:[y.jsx(be.icon,{className:"w-5 h-5",strokeWidth:1.5,...at?{fill:"currentColor",fillOpacity:.15}:{}}),y.jsx("span",{className:"text-2xs font-medium",children:be.label})]},be.id)})}),W==="viewas"&&P&&y.jsxs("div",{className:"space-y-1",children:[y.jsx("p",{className:"text-2xs font-medium uppercase tracking-widest text-text-tertiary mb-4",children:"View As"}),K.map(be=>{const at=c===be.id,Ht=be.id===null?`Your view · ${se}`:be.label;return y.jsxs("button",{onClick:()=>he(be.id),className:"w-full text-left flex items-start gap-3 py-2.5 px-1 group",children:[y.jsx("span",{className:`mt-0.5 w-4 h-4 rounded-full border shrink-0 flex items-center justify-center transition-colors ${at?"border-accent bg-accent":"border-surface-border group-hover:border-accent/60"}`,children:at&&y.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-text-inverse"})}),y.jsxs("span",{children:[y.jsx("span",{className:`block text-sm font-medium transition-colors ${at?"text-accent":"text-text-primary group-hover:text-accent"}`,children:Ht}),y.jsx("span",{className:"block text-xs text-text-secondary mt-0.5",children:be.description})]})]},String(be.id))})]}),W==="features"&&y.jsxs("div",{children:[y.jsx("p",{className:"text-2xs font-medium uppercase tracking-widest text-text-tertiary mb-4",children:"Features"}),y.jsxs("button",{onClick:_e,className:"w-full text-left flex items-center justify-between py-2.5 px-1 group",children:[y.jsxs("span",{children:[y.jsx("span",{className:"block text-sm font-medium text-text-primary group-hover:text-accent transition-colors",children:"AI features"}),y.jsx("span",{className:"block text-xs text-text-secondary mt-0.5",children:f?"Enabled — AI assist, agent labels, bulk AI actions":"Hidden — automation labels, no AI surfaces"})]}),y.jsx("span",{className:`shrink-0 ml-4 w-9 h-5 rounded-full transition-colors flex items-center px-0.5 ${f?"bg-accent":"bg-surface-border"}`,children:y.jsx("span",{className:`w-4 h-4 rounded-full bg-text-inverse shadow-sm transition-transform ${f?"translate-x-4":"translate-x-0"}`})})]}),v&&y.jsxs("button",{onClick:Te,className:"w-full text-left flex items-center justify-between py-2.5 px-1 group",children:[y.jsxs("span",{children:[y.jsx("span",{className:"block text-sm font-medium text-text-primary group-hover:text-accent transition-colors",children:"Graph workflows"}),y.jsx("span",{className:"block text-xs text-text-secondary mt-0.5",children:_?"Visible — Graph section shown in Orchestrate sidebar":"Hidden — use Procedural workflows instead"})]}),y.jsx("span",{className:`shrink-0 ml-4 w-9 h-5 rounded-full transition-colors flex items-center px-0.5 ${_?"bg-accent":"bg-surface-border"}`,children:y.jsx("span",{className:`w-4 h-4 rounded-full bg-text-inverse shadow-sm transition-transform ${_?"translate-x-4":"translate-x-0"}`})})]}),y.jsxs("button",{onClick:F,className:"w-full text-left flex items-center justify-between py-2.5 px-1 group",children:[y.jsxs("span",{children:[y.jsx("span",{className:"block text-sm font-medium text-text-primary group-hover:text-accent transition-colors",children:"Scan input"}),y.jsx("span",{className:"block text-xs text-text-secondary mt-0.5",children:L?"Enabled — header scan affordance, panel, and keyboard-wedge capture":"Hidden — the deployment opts in with features.scanCodes"})]}),y.jsx("span",{className:`shrink-0 ml-4 w-9 h-5 rounded-full transition-colors flex items-center px-0.5 ${L?"bg-accent":"bg-surface-border"}`,children:y.jsx("span",{className:`w-4 h-4 rounded-full bg-text-inverse shadow-sm transition-transform ${L?"translate-x-4":"translate-x-0"}`})})]})]}),y.jsx("hr",{className:"border-surface-border/50 mt-8"}),y.jsx("p",{className:"mt-4 text-2xs text-text-quaternary text-center",children:"Esc or click outside to close"})]})})}const Yb=[{id:"violet",label:"Violet",swatch:"#7B3BE0"},{id:"red",label:"Brick",swatch:"#DC382D"},{id:"green",label:"Emerald",swatch:"#059669"},{id:"blue",label:"Electric",swatch:"#2563EB"},{id:"rose",label:"Raspberry",swatch:"#D6246E"},{id:"orange",label:"Harvest",swatch:"#E85D04"}],Sg="blue",Kb="lt.theme";let Xb=[];function iO(i){const t=new Set(Yb.map(s=>s.id)),r=new Set;Xb=i.filter(s=>!(s!=null&&s.id)||t.has(s.id)||r.has(s.id)?!1:(r.add(s.id),!0))}function sO(){return[...Yb,...Xb]}function Jb(){try{return localStorage.getItem(Kb)||Sg}catch{return Sg}}function Qb(i){document.documentElement.dataset.theme=i}function aO(i){try{localStorage.setItem(Kb,i)}catch{}Qb(i)}const ht={EXECUTED:"executed",MATCHED_LIST:"matched_list",CONFIRM_REQUIRED:"confirm_required",NO_MATCH_FALLBACK:"no_match_fallback",UNCONFIGURED:"unconfigured",INVALID_CODE:"invalid_code",FORBIDDEN:"forbidden",CONFLICT:"conflict"},Ql={SHOW_DETAIL:"show-detail",SHOW_LIST:"show-list",CLAIM:"claim",CLAIM_SHOW_DETAIL:"claim-show-detail",RELEASE:"release",RESOLVE:"resolve",ESCALATE:"escalate",CANCEL:"cancel"};function oO(i){return Ee("/scan-codes/execute",{method:"POST",body:JSON.stringify({code:i})})}function fN(){return ot({queryKey:["scan-schemes"],queryFn:()=>Ee("/scan-codes/schemes")})}function hN(i){return ot({queryKey:["scan-schemes",i],queryFn:()=>Ee(`/scan-codes/schemes/${i}`),enabled:i!=null})}function dN(){const i=st();return dt({mutationFn:t=>Ee(`/scan-codes/schemes/${t.version}`,{method:"PUT",body:JSON.stringify(t)}),onSuccess:()=>i.invalidateQueries({queryKey:["scan-schemes"]})})}function mN(){const i=st();return dt({mutationFn:t=>Ee(`/scan-codes/schemes/${t}`,{method:"DELETE"}),onSuccess:()=>i.invalidateQueries({queryKey:["scan-schemes"]})})}function pN(){const i=st();return dt({mutationFn:t=>Ee(`/scan-codes/schemes/${t.scheme_version}/actions/${t.category}`,{method:"PUT",body:JSON.stringify(t)}),onSuccess:(t,r)=>i.invalidateQueries({queryKey:["scan-schemes",r.scheme_version]})})}function yN(){const i=st();return dt({mutationFn:t=>Ee(`/scan-codes/schemes/${t.scheme_version}/actions/${t.category}`,{method:"DELETE"}),onSuccess:(t,r)=>i.invalidateQueries({queryKey:["scan-schemes",r.scheme_version]})})}const Fc={maxKeyGapMs:500,terminators:["Enter","Tab"],minLength:6,autoFireQuietMs:300,autoFireMaxAvgKeyMs:50},Zb="lt_scan_wedge_config";function Wb(){try{const i=localStorage.getItem(Zb);return i?{...Fc,...JSON.parse(i)}:Fc}catch{return Fc}}function lO(i){const t={...Wb(),...i};return localStorage.setItem(Zb,JSON.stringify(t)),t}const cO=[/[1-9][0-9]:[0-9]:[a-zA-Z0-9._-]+$/,/[1-9][0-9]{7,}$/];function Eg(i){let t=null;for(const r of cO){const s=i.match(r);s&&(!t||s[0].length>t.length)&&(t=s[0])}return t}const uO=new Set(["Shift","CapsLock"]),Zl={suppress:!1,emit:null};function fO(i=Fc){let t={buffer:"",times:[],lastKeyMs:0};function r(){t={buffer:"",times:[],lastKeyMs:0}}function s(d){const{key:p,timeMs:g,hasModifier:f,isRepeat:m}=d;if(uO.has(p))return Zl;if(i.terminators.includes(p)){const S=Eg(t.buffer);return r(),S&&S.length>=i.minLength?{suppress:!0,emit:S,consumedLength:S.length}:Zl}if(f||m||p.length!==1)return r(),Zl;const b=g-t.lastKeyMs,v=t.lastKeyMs>0&&b<=i.maxKeyGapMs,_=(v?t.buffer+p:p).slice(-128),w=(v?[...t.times,g]:[g]).slice(-128);return t={buffer:_,times:w,lastKeyMs:g},Zl}function l(){return{buffer:t.buffer}}function c(){const d=Eg(t.buffer);if(!d||d.length<i.minLength)return null;const p=t.times.slice(-d.length);return p.length<2||(p[p.length-1]-p[0])/(p.length-1)>i.autoFireMaxAvgKeyMs?null:{code:d,consumedLength:d.length}}return{step:s,reset:r,snapshot:l,pendingAutoFire:c}}const Ph={KEYBOARD_WEDGE:"keyboard-wedge",MANUAL:"manual"};function hO(){const i=document.activeElement;return i instanceof HTMLInputElement?["text","search","tel","url","email","password","number"].includes(i.type)?i:null:i instanceof HTMLTextAreaElement?i:null}function dO(i,t,r){var c;const s=i instanceof HTMLInputElement?HTMLInputElement.prototype:HTMLTextAreaElement.prototype,l=(c=Object.getOwnPropertyDescriptor(s,"value"))==null?void 0:c.set;l?l.call(i,t):i.value=t;try{i.setSelectionRange(r,r)}catch{}i.dispatchEvent(new Event("input",{bubbles:!0}))}function Og(i){if(i<=0)return;const t=hO();if(!t)return;const r=t.selectionStart??t.value.length,s=Math.max(0,r-i);dO(t,t.value.slice(0,s)+t.value.slice(r),s)}const Cs=i=>{if(i)try{return JSON.parse(i)}catch{return}},Ui=i=>i==null||Array.isArray(i)&&i.length===0||typeof i=="object"&&!Array.isArray(i)&&Object.keys(i).length===0;function mO(i){const t={},r=Cs(i.get("facets"));Ui(r)||(t.facets=r);const s=Cs(i.get("block"));Ui(s)||(t.block=s);const l=Cs(i.get("range"));Ui(l)||(t.range=l);const c=Cs(i.get("exists"));Ui(c)||(t.exists=c);const d=Cs(i.get("roles"));Ui(d)||(t.roles=d);const p=Cs(i.get("orderBy"));Ui(p)||(t.orderBy=p),i.get("available")!=null&&(t.available=i.get("available")==="true");const g=i.get("jeopardy");return(g==="1"||g==="true")&&(t.jeopardy=!0),t}function gN(i,t){const r=(s,l)=>Ui(l)?i.delete(s):i.set(s,JSON.stringify(l));r("facets",t.facets),r("block",t.block),r("range",t.range),r("exists",t.exists),r("roles",t.roles),r("orderBy",t.orderBy),t.available==null?i.delete("available"):i.set("available",String(t.available)),t.jeopardy===!0?i.set("jeopardy","1"):i.delete("jeopardy")}function ev(i,t){const r={};for(const[l,c]of Object.entries(i))r[l]=typeof c=="object"&&c!==null?JSON.stringify(c):c;const s=encodeURIComponent(JSON.stringify(r));return t?`/escalations/available?role=${encodeURIComponent(t)}&facets=${s}&status=all`:`/escalations/available?facets=${s}&status=all`}function bN(i,t,r){return ev({[i]:t},r)}function vN(i){var t,r,s;return Object.keys(i.facets??{}).length+(((t=i.block)==null?void 0:t.length)??0)+(((r=i.range)==null?void 0:r.length)??0)+(((s=i.exists)==null?void 0:s.length)??0)+(i.available!=null?1:0)+(i.jeopardy===!0?1:0)}function tv(){var r;const{data:i}=Or(),t=Ub();return t!==null?t:!!((r=i==null?void 0:i.features)!=null&&r.scanCodes)}const nv=T.createContext(null);function rv(){const i=T.useContext(nv);if(!i)throw new Error("useScanInput must be used within ScanInputProvider");return i}const pO="scanPendingAction";function yO({children:i}){const{user:t}=pn(),r=tv(),s=yo(),[l,c]=T.useState(null),[d,p]=T.useState(!1),[g,f]=T.useState(()=>Wb()),[m,b]=T.useState([]),[v,_]=T.useState(!1),w=T.useRef(v);w.current=v;const S=T.useRef(0),C=T.useRef(0),L=T.useCallback(B=>{var K;const{outcome:te}=B;if(te===ht.CONFIRM_REQUIRED&&B.pendingAction)return s(`/escalations/detail/${B.pendingAction.escalationId}`,{state:{[pO]:B.pendingAction}}),!0;if(te===ht.EXECUTED&&B.escalation){const P=[Ql.SHOW_DETAIL,Ql.CLAIM_SHOW_DETAIL,Ql.CLAIM,Ql.ESCALATE];return B.verb&&P.includes(B.verb)?(s(`/escalations/detail/${B.escalation.id}`),!0):!1}if(te===ht.MATCHED_LIST&&B.listQuery){const{targetFacet:P,target:Y,roles:W}=B.listQuery;return s(ev({[P]:Y},(W==null?void 0:W[0])??null)),!0}return te===ht.NO_MATCH_FALLBACK&&((K=B.fallback)!=null&&K.route)?(s(B.fallback.route),!0):!1},[s]),z=T.useCallback(async(B,te=Ph.MANUAL)=>{p(!0);const K=Date.now();try{const P=await oO(B),Y=L(P);c({code:B,source:te,at:K,response:P,error:null,navigated:Y})}catch(P){c({code:B,source:te,at:K,response:null,error:P.message,navigated:!1})}finally{p(!1)}},[L]),se=T.useRef(z);se.current=z,T.useEffect(()=>{if(!t||!r)return;const B=fO(g);let te=null;const K=()=>{te&&(clearTimeout(te),te=null)},P=(X,he,_e)=>{if(he&&Og(he),w.current){const Te={seq:++S.current,key:"(quiet)",code:"",deltaMs:0,buffer:"",note:_e};console.debug("[scan]",_e),b(F=>[...F.slice(-29),Te])}se.current(X,Ph.KEYBOARD_WEDGE)},Y=()=>{K(),B.pendingAutoFire()&&(te=setTimeout(()=>{te=null;const X=B.pendingAutoFire();X&&(B.reset(),P(X.code,X.consumedLength,`capture → ${X.code} (quiet period — no suffix)`))},g.autoFireQuietMs))},W=X=>{const he=B.snapshot().buffer,{suppress:_e,emit:Te,consumedLength:F}=B.step({key:X.key,timeMs:X.timeStamp,hasModifier:X.ctrlKey||X.metaKey||X.altKey,isRepeat:X.repeat});if(_e&&(X.preventDefault(),X.stopPropagation()),w.current){const ae=B.snapshot().buffer,de=g.terminators.includes(X.key),Oe=Te?`capture → ${Te}`:de?`terminator — no code tail in "${he.slice(-24)}"`:ae===he?he?"neutral (chord key)":"ignored":ae===""?"reset (edit/chord/non-printable)":ae.length<=1&&he.length>1?"gap — new episode":"accumulate",le=C.current?Math.round(X.timeStamp-C.current):0,we={seq:++S.current,key:X.key,code:X.code!==X.key?X.code:"",deltaMs:le,buffer:ae.slice(-24),note:Oe};console.debug("[scan]",we.key,we.code,`${we.deltaMs}ms`,we.note),b(Se=>[...Se.slice(-29),we])}C.current=X.timeStamp,Te?(K(),F&&Og(F),se.current(Te,Ph.KEYBOARD_WEDGE)):Y()};return window.addEventListener("keydown",W,{capture:!0}),()=>{K(),window.removeEventListener("keydown",W,{capture:!0})}},[t,r,g]);const oe=T.useCallback(B=>{f(lO(B))},[]),M=T.useMemo(()=>({submitCode:z,lastResult:l,busy:d,wedgeConfig:g,updateWedgeConfig:oe,diagnostics:m,diagnosticsOn:v,setDiagnosticsOn:_}),[z,l,d,g,oe,m,v]);return y.jsx(nv.Provider,{value:M,children:i})}var Wl={},Ka={},ec={},Ag;function yn(){if(Ag)return ec;Ag=1,Object.defineProperty(ec,"__esModule",{value:!0});function i(r,s){if(!(r instanceof s))throw new TypeError("Cannot call a class as a function")}var t=function r(s,l){i(this,r),this.data=s,this.text=l.text||s,this.options=l};return ec.default=t,ec}var jg;function gO(){if(jg)return Ka;jg=1,Object.defineProperty(Ka,"__esModule",{value:!0}),Ka.CODE39=void 0;var i=(function(){function S(C,L){for(var z=0;z<L.length;z++){var se=L[z];se.enumerable=se.enumerable||!1,se.configurable=!0,"value"in se&&(se.writable=!0),Object.defineProperty(C,se.key,se)}}return function(C,L,z){return L&&S(C.prototype,L),z&&S(C,z),C}})(),t=yn(),r=s(t);function s(S){return S&&S.__esModule?S:{default:S}}function l(S,C){if(!(S instanceof C))throw new TypeError("Cannot call a class as a function")}function c(S,C){if(!S)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return C&&(typeof C=="object"||typeof C=="function")?C:S}function d(S,C){if(typeof C!="function"&&C!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof C);S.prototype=Object.create(C&&C.prototype,{constructor:{value:S,enumerable:!1,writable:!0,configurable:!0}}),C&&(Object.setPrototypeOf?Object.setPrototypeOf(S,C):S.__proto__=C)}var p=(function(S){d(C,S);function C(L,z){return l(this,C),L=L.toUpperCase(),z.mod43&&(L+=v(w(L))),c(this,(C.__proto__||Object.getPrototypeOf(C)).call(this,L,z))}return i(C,[{key:"encode",value:function(){for(var z=m("*"),se=0;se<this.data.length;se++)z+=m(this.data[se])+"0";return z+=m("*"),{data:z,text:this.text}}},{key:"valid",value:function(){return this.data.search(/^[0-9A-Z\-\.\ \$\/\+\%]+$/)!==-1}}]),C})(r.default),g=["0","1","2","3","4","5","6","7","8","9","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","-","."," ","$","/","+","%","*"],f=[20957,29783,23639,30485,20951,29813,23669,20855,29789,23645,29975,23831,30533,22295,30149,24005,21623,29981,23837,22301,30023,23879,30545,22343,30161,24017,21959,30065,23921,22385,29015,18263,29141,17879,29045,18293,17783,29021,18269,17477,17489,17681,20753,35770];function m(S){return b(_(S))}function b(S){return f[S].toString(2)}function v(S){return g[S]}function _(S){return g.indexOf(S)}function w(S){for(var C=0,L=0;L<S.length;L++)C+=_(S[L]);return C=C%43,C}return Ka.CODE39=p,Ka}var zn={},tc={},nc={},ft={},Tg;function vo(){if(Tg)return ft;Tg=1,Object.defineProperty(ft,"__esModule",{value:!0});var i;function t(g,f,m){return f in g?Object.defineProperty(g,f,{value:m,enumerable:!0,configurable:!0,writable:!0}):g[f]=m,g}var r=ft.SET_A=0,s=ft.SET_B=1,l=ft.SET_C=2;ft.SHIFT=98;var c=ft.START_A=103,d=ft.START_B=104,p=ft.START_C=105;return ft.MODULO=103,ft.STOP=106,ft.FNC1=207,ft.SET_BY_CODE=(i={},t(i,c,r),t(i,d,s),t(i,p,l),i),ft.SWAP={101:r,100:s,99:l},ft.A_START_CHAR="Ð",ft.B_START_CHAR="Ñ",ft.C_START_CHAR="Ò",ft.A_CHARS="[\0-_È-Ï]",ft.B_CHARS="[ -È-Ï]",ft.C_CHARS="(Ï*[0-9]{2}Ï*)",ft.BARS=[11011001100,11001101100,11001100110,10010011e3,10010001100,10001001100,10011001e3,10011000100,10001100100,11001001e3,11001000100,11000100100,10110011100,10011011100,10011001110,10111001100,10011101100,10011100110,11001110010,11001011100,11001001110,11011100100,11001110100,11101101110,11101001100,11100101100,11100100110,11101100100,11100110100,11100110010,11011011e3,11011000110,11000110110,10100011e3,10001011e3,10001000110,10110001e3,10001101e3,10001100010,11010001e3,11000101e3,11000100010,10110111e3,10110001110,10001101110,10111011e3,10111000110,10001110110,11101110110,11010001110,11000101110,11011101e3,11011100010,11011101110,11101011e3,11101000110,11100010110,11101101e3,11101100010,11100011010,11101111010,11001000010,11110001010,1010011e4,10100001100,1001011e4,10010000110,10000101100,10000100110,1011001e4,10110000100,1001101e4,10011000010,10000110100,10000110010,11000010010,1100101e4,11110111010,11000010100,10001111010,10100111100,10010111100,10010011110,10111100100,10011110100,10011110010,11110100100,11110010100,11110010010,11011011110,11011110110,11110110110,10101111e3,10100011110,10001011110,10111101e3,10111100010,11110101e3,11110100010,10111011110,10111101110,11101011110,11110101110,11010000100,1101001e4,11010011100,1100011101011],ft}var Ng;function fu(){if(Ng)return nc;Ng=1,Object.defineProperty(nc,"__esModule",{value:!0});var i=(function(){function f(m,b){for(var v=0;v<b.length;v++){var _=b[v];_.enumerable=_.enumerable||!1,_.configurable=!0,"value"in _&&(_.writable=!0),Object.defineProperty(m,_.key,_)}}return function(m,b,v){return b&&f(m.prototype,b),v&&f(m,v),m}})(),t=yn(),r=l(t),s=vo();function l(f){return f&&f.__esModule?f:{default:f}}function c(f,m){if(!(f instanceof m))throw new TypeError("Cannot call a class as a function")}function d(f,m){if(!f)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return m&&(typeof m=="object"||typeof m=="function")?m:f}function p(f,m){if(typeof m!="function"&&m!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof m);f.prototype=Object.create(m&&m.prototype,{constructor:{value:f,enumerable:!1,writable:!0,configurable:!0}}),m&&(Object.setPrototypeOf?Object.setPrototypeOf(f,m):f.__proto__=m)}var g=(function(f){p(m,f);function m(b,v){c(this,m);var _=d(this,(m.__proto__||Object.getPrototypeOf(m)).call(this,b.substring(1),v));return _.bytes=b.split("").map(function(w){return w.charCodeAt(0)}),_}return i(m,[{key:"valid",value:function(){return/^[\x00-\x7F\xC8-\xD3]+$/.test(this.data)}},{key:"encode",value:function(){var v=this.bytes,_=v.shift()-105,w=s.SET_BY_CODE[_];if(w===void 0)throw new RangeError("The encoding does not start with a start character.");this.shouldEncodeAsEan128()===!0&&v.unshift(s.FNC1);var S=m.next(v,1,w);return{text:this.text===this.data?this.text.replace(/[^\x20-\x7E]/g,""):this.text,data:m.getBar(_)+S.result+m.getBar((S.checksum+_)%s.MODULO)+m.getBar(s.STOP)}}},{key:"shouldEncodeAsEan128",value:function(){var v=this.options.ean128||!1;return typeof v=="string"&&(v=v.toLowerCase()==="true"),v}}],[{key:"getBar",value:function(v){return s.BARS[v]?s.BARS[v].toString():""}},{key:"correctIndex",value:function(v,_){if(_===s.SET_A){var w=v.shift();return w<32?w+64:w-32}else return _===s.SET_B?v.shift()-32:(v.shift()-48)*10+v.shift()-48}},{key:"next",value:function(v,_,w){if(!v.length)return{result:"",checksum:0};var S=void 0,C=void 0;if(v[0]>=200){C=v.shift()-105;var L=s.SWAP[C];L!==void 0?S=m.next(v,_+1,L):((w===s.SET_A||w===s.SET_B)&&C===s.SHIFT&&(v[0]=w===s.SET_A?v[0]>95?v[0]-96:v[0]:v[0]<32?v[0]+96:v[0]),S=m.next(v,_+1,w))}else C=m.correctIndex(v,w),S=m.next(v,_+1,w);var z=m.getBar(C),se=C*_;return{result:z+S.result,checksum:se+S.checksum}}}]),m})(r.default);return nc.default=g,nc}var rc={},kg;function bO(){if(kg)return rc;kg=1,Object.defineProperty(rc,"__esModule",{value:!0});var i=vo(),t=function(p){return p.match(new RegExp("^"+i.A_CHARS+"*"))[0].length},r=function(p){return p.match(new RegExp("^"+i.B_CHARS+"*"))[0].length},s=function(p){return p.match(new RegExp("^"+i.C_CHARS+"*"))[0]};function l(d,p){var g=p?i.A_CHARS:i.B_CHARS,f=d.match(new RegExp("^("+g+"+?)(([0-9]{2}){2,})([^0-9]|$)"));if(f)return f[1]+"Ì"+c(d.substring(f[1].length));var m=d.match(new RegExp("^"+g+"+"))[0];return m.length===d.length?d:m+String.fromCharCode(p?205:206)+l(d.substring(m.length),!p)}function c(d){var p=s(d),g=p.length;if(g===d.length)return d;d=d.substring(g);var f=t(d)>=r(d);return p+String.fromCharCode(f?206:205)+l(d,f)}return rc.default=function(d){var p=void 0,g=s(d).length;if(g>=2)p=i.C_START_CHAR+c(d);else{var f=t(d)>r(d);p=(f?i.A_START_CHAR:i.B_START_CHAR)+l(d,f)}return p.replace(/[\xCD\xCE]([^])[\xCD\xCE]/,function(m,b){return"Ë"+b})},rc}var Cg;function vO(){if(Cg)return tc;Cg=1,Object.defineProperty(tc,"__esModule",{value:!0});var i=fu(),t=l(i),r=bO(),s=l(r);function l(f){return f&&f.__esModule?f:{default:f}}function c(f,m){if(!(f instanceof m))throw new TypeError("Cannot call a class as a function")}function d(f,m){if(!f)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return m&&(typeof m=="object"||typeof m=="function")?m:f}function p(f,m){if(typeof m!="function"&&m!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof m);f.prototype=Object.create(m&&m.prototype,{constructor:{value:f,enumerable:!1,writable:!0,configurable:!0}}),m&&(Object.setPrototypeOf?Object.setPrototypeOf(f,m):f.__proto__=m)}var g=(function(f){p(m,f);function m(b,v){if(c(this,m),/^[\x00-\x7F\xC8-\xD3]+$/.test(b))var _=d(this,(m.__proto__||Object.getPrototypeOf(m)).call(this,(0,s.default)(b),v));else var _=d(this,(m.__proto__||Object.getPrototypeOf(m)).call(this,b,v));return d(_)}return m})(t.default);return tc.default=g,tc}var ic={},Mg;function xO(){if(Mg)return ic;Mg=1,Object.defineProperty(ic,"__esModule",{value:!0});var i=(function(){function f(m,b){for(var v=0;v<b.length;v++){var _=b[v];_.enumerable=_.enumerable||!1,_.configurable=!0,"value"in _&&(_.writable=!0),Object.defineProperty(m,_.key,_)}}return function(m,b,v){return b&&f(m.prototype,b),v&&f(m,v),m}})(),t=fu(),r=l(t),s=vo();function l(f){return f&&f.__esModule?f:{default:f}}function c(f,m){if(!(f instanceof m))throw new TypeError("Cannot call a class as a function")}function d(f,m){if(!f)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return m&&(typeof m=="object"||typeof m=="function")?m:f}function p(f,m){if(typeof m!="function"&&m!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof m);f.prototype=Object.create(m&&m.prototype,{constructor:{value:f,enumerable:!1,writable:!0,configurable:!0}}),m&&(Object.setPrototypeOf?Object.setPrototypeOf(f,m):f.__proto__=m)}var g=(function(f){p(m,f);function m(b,v){return c(this,m),d(this,(m.__proto__||Object.getPrototypeOf(m)).call(this,s.A_START_CHAR+b,v))}return i(m,[{key:"valid",value:function(){return new RegExp("^"+s.A_CHARS+"+$").test(this.data)}}]),m})(r.default);return ic.default=g,ic}var sc={},Rg;function _O(){if(Rg)return sc;Rg=1,Object.defineProperty(sc,"__esModule",{value:!0});var i=(function(){function f(m,b){for(var v=0;v<b.length;v++){var _=b[v];_.enumerable=_.enumerable||!1,_.configurable=!0,"value"in _&&(_.writable=!0),Object.defineProperty(m,_.key,_)}}return function(m,b,v){return b&&f(m.prototype,b),v&&f(m,v),m}})(),t=fu(),r=l(t),s=vo();function l(f){return f&&f.__esModule?f:{default:f}}function c(f,m){if(!(f instanceof m))throw new TypeError("Cannot call a class as a function")}function d(f,m){if(!f)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return m&&(typeof m=="object"||typeof m=="function")?m:f}function p(f,m){if(typeof m!="function"&&m!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof m);f.prototype=Object.create(m&&m.prototype,{constructor:{value:f,enumerable:!1,writable:!0,configurable:!0}}),m&&(Object.setPrototypeOf?Object.setPrototypeOf(f,m):f.__proto__=m)}var g=(function(f){p(m,f);function m(b,v){return c(this,m),d(this,(m.__proto__||Object.getPrototypeOf(m)).call(this,s.B_START_CHAR+b,v))}return i(m,[{key:"valid",value:function(){return new RegExp("^"+s.B_CHARS+"+$").test(this.data)}}]),m})(r.default);return sc.default=g,sc}var ac={},Dg;function wO(){if(Dg)return ac;Dg=1,Object.defineProperty(ac,"__esModule",{value:!0});var i=(function(){function f(m,b){for(var v=0;v<b.length;v++){var _=b[v];_.enumerable=_.enumerable||!1,_.configurable=!0,"value"in _&&(_.writable=!0),Object.defineProperty(m,_.key,_)}}return function(m,b,v){return b&&f(m.prototype,b),v&&f(m,v),m}})(),t=fu(),r=l(t),s=vo();function l(f){return f&&f.__esModule?f:{default:f}}function c(f,m){if(!(f instanceof m))throw new TypeError("Cannot call a class as a function")}function d(f,m){if(!f)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return m&&(typeof m=="object"||typeof m=="function")?m:f}function p(f,m){if(typeof m!="function"&&m!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof m);f.prototype=Object.create(m&&m.prototype,{constructor:{value:f,enumerable:!1,writable:!0,configurable:!0}}),m&&(Object.setPrototypeOf?Object.setPrototypeOf(f,m):f.__proto__=m)}var g=(function(f){p(m,f);function m(b,v){return c(this,m),d(this,(m.__proto__||Object.getPrototypeOf(m)).call(this,s.C_START_CHAR+b,v))}return i(m,[{key:"valid",value:function(){return new RegExp("^"+s.C_CHARS+"+$").test(this.data)}}]),m})(r.default);return ac.default=g,ac}var qg;function SO(){if(qg)return zn;qg=1,Object.defineProperty(zn,"__esModule",{value:!0}),zn.CODE128C=zn.CODE128B=zn.CODE128A=zn.CODE128=void 0;var i=vO(),t=g(i),r=xO(),s=g(r),l=_O(),c=g(l),d=wO(),p=g(d);function g(f){return f&&f.__esModule?f:{default:f}}return zn.CODE128=t.default,zn.CODE128A=s.default,zn.CODE128B=c.default,zn.CODE128C=p.default,zn}var Ut={},oc={},xr={},Bg;function xo(){return Bg||(Bg=1,Object.defineProperty(xr,"__esModule",{value:!0}),xr.SIDE_BIN="101",xr.MIDDLE_BIN="01010",xr.BINARIES={L:["0001101","0011001","0010011","0111101","0100011","0110001","0101111","0111011","0110111","0001011"],G:["0100111","0110011","0011011","0100001","0011101","0111001","0000101","0010001","0001001","0010111"],R:["1110010","1100110","1101100","1000010","1011100","1001110","1010000","1000100","1001000","1110100"],O:["0001101","0011001","0010011","0111101","0100011","0110001","0101111","0111011","0110111","0001011"],E:["0100111","0110011","0011011","0100001","0011101","0111001","0000101","0010001","0001001","0010111"]},xr.EAN2_STRUCTURE=["LL","LG","GL","GG"],xr.EAN5_STRUCTURE=["GGLLL","GLGLL","GLLGL","GLLLG","LGGLL","LLGGL","LLLGG","LGLGL","LGLLG","LLGLG"],xr.EAN13_STRUCTURE=["LLLLLL","LLGLGG","LLGGLG","LLGGGL","LGLLGG","LGGLLG","LGGGLL","LGLGLG","LGLGGL","LGGLGL"]),xr}var lc={},cc={},Lg;function _o(){if(Lg)return cc;Lg=1,Object.defineProperty(cc,"__esModule",{value:!0});var i=xo(),t=function(s,l,c){var d=s.split("").map(function(g,f){return i.BINARIES[l[f]]}).map(function(g,f){return g?g[s[f]]:""});if(c){var p=s.length-1;d=d.map(function(g,f){return f<p?g+c:g})}return d.join("")};return cc.default=t,cc}var zg;function iv(){if(zg)return lc;zg=1,Object.defineProperty(lc,"__esModule",{value:!0});var i=(function(){function b(v,_){for(var w=0;w<_.length;w++){var S=_[w];S.enumerable=S.enumerable||!1,S.configurable=!0,"value"in S&&(S.writable=!0),Object.defineProperty(v,S.key,S)}}return function(v,_,w){return _&&b(v.prototype,_),w&&b(v,w),v}})(),t=xo(),r=_o(),s=d(r),l=yn(),c=d(l);function d(b){return b&&b.__esModule?b:{default:b}}function p(b,v){if(!(b instanceof v))throw new TypeError("Cannot call a class as a function")}function g(b,v){if(!b)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return v&&(typeof v=="object"||typeof v=="function")?v:b}function f(b,v){if(typeof v!="function"&&v!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof v);b.prototype=Object.create(v&&v.prototype,{constructor:{value:b,enumerable:!1,writable:!0,configurable:!0}}),v&&(Object.setPrototypeOf?Object.setPrototypeOf(b,v):b.__proto__=v)}var m=(function(b){f(v,b);function v(_,w){p(this,v);var S=g(this,(v.__proto__||Object.getPrototypeOf(v)).call(this,_,w));return S.fontSize=!w.flat&&w.fontSize>w.width*10?w.width*10:w.fontSize,S.guardHeight=w.height+S.fontSize/2+w.textMargin,S}return i(v,[{key:"encode",value:function(){return this.options.flat?this.encodeFlat():this.encodeGuarded()}},{key:"leftText",value:function(w,S){return this.text.substr(w,S)}},{key:"leftEncode",value:function(w,S){return(0,s.default)(w,S)}},{key:"rightText",value:function(w,S){return this.text.substr(w,S)}},{key:"rightEncode",value:function(w,S){return(0,s.default)(w,S)}},{key:"encodeGuarded",value:function(){var w={fontSize:this.fontSize},S={height:this.guardHeight};return[{data:t.SIDE_BIN,options:S},{data:this.leftEncode(),text:this.leftText(),options:w},{data:t.MIDDLE_BIN,options:S},{data:this.rightEncode(),text:this.rightText(),options:w},{data:t.SIDE_BIN,options:S}]}},{key:"encodeFlat",value:function(){var w=[t.SIDE_BIN,this.leftEncode(),t.MIDDLE_BIN,this.rightEncode(),t.SIDE_BIN];return{data:w.join(""),text:this.text}}}]),v})(c.default);return lc.default=m,lc}var Ug;function EO(){if(Ug)return oc;Ug=1,Object.defineProperty(oc,"__esModule",{value:!0});var i=(function(){function b(v,_){for(var w=0;w<_.length;w++){var S=_[w];S.enumerable=S.enumerable||!1,S.configurable=!0,"value"in S&&(S.writable=!0),Object.defineProperty(v,S.key,S)}}return function(v,_,w){return _&&b(v.prototype,_),w&&b(v,w),v}})(),t=function b(v,_,w){v===null&&(v=Function.prototype);var S=Object.getOwnPropertyDescriptor(v,_);if(S===void 0){var C=Object.getPrototypeOf(v);return C===null?void 0:b(C,_,w)}else{if("value"in S)return S.value;var L=S.get;return L===void 0?void 0:L.call(w)}},r=xo(),s=iv(),l=c(s);function c(b){return b&&b.__esModule?b:{default:b}}function d(b,v){if(!(b instanceof v))throw new TypeError("Cannot call a class as a function")}function p(b,v){if(!b)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return v&&(typeof v=="object"||typeof v=="function")?v:b}function g(b,v){if(typeof v!="function"&&v!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof v);b.prototype=Object.create(v&&v.prototype,{constructor:{value:b,enumerable:!1,writable:!0,configurable:!0}}),v&&(Object.setPrototypeOf?Object.setPrototypeOf(b,v):b.__proto__=v)}var f=function(v){var _=v.substr(0,12).split("").map(function(w){return+w}).reduce(function(w,S,C){return C%2?w+S*3:w+S},0);return(10-_%10)%10},m=(function(b){g(v,b);function v(_,w){d(this,v),_.search(/^[0-9]{12}$/)!==-1&&(_+=f(_));var S=p(this,(v.__proto__||Object.getPrototypeOf(v)).call(this,_,w));return S.lastChar=w.lastChar,S}return i(v,[{key:"valid",value:function(){return this.data.search(/^[0-9]{13}$/)!==-1&&+this.data[12]===f(this.data)}},{key:"leftText",value:function(){return t(v.prototype.__proto__||Object.getPrototypeOf(v.prototype),"leftText",this).call(this,1,6)}},{key:"leftEncode",value:function(){var w=this.data.substr(1,6),S=r.EAN13_STRUCTURE[this.data[0]];return t(v.prototype.__proto__||Object.getPrototypeOf(v.prototype),"leftEncode",this).call(this,w,S)}},{key:"rightText",value:function(){return t(v.prototype.__proto__||Object.getPrototypeOf(v.prototype),"rightText",this).call(this,7,6)}},{key:"rightEncode",value:function(){var w=this.data.substr(7,6);return t(v.prototype.__proto__||Object.getPrototypeOf(v.prototype),"rightEncode",this).call(this,w,"RRRRRR")}},{key:"encodeGuarded",value:function(){var w=t(v.prototype.__proto__||Object.getPrototypeOf(v.prototype),"encodeGuarded",this).call(this);return this.options.displayValue&&(w.unshift({data:"000000000000",text:this.text.substr(0,1),options:{textAlign:"left",fontSize:this.fontSize}}),this.options.lastChar&&(w.push({data:"00"}),w.push({data:"00000",text:this.options.lastChar,options:{fontSize:this.fontSize}}))),w}}]),v})(l.default);return oc.default=m,oc}var uc={},Pg;function OO(){if(Pg)return uc;Pg=1,Object.defineProperty(uc,"__esModule",{value:!0});var i=(function(){function m(b,v){for(var _=0;_<v.length;_++){var w=v[_];w.enumerable=w.enumerable||!1,w.configurable=!0,"value"in w&&(w.writable=!0),Object.defineProperty(b,w.key,w)}}return function(b,v,_){return v&&m(b.prototype,v),_&&m(b,_),b}})(),t=function m(b,v,_){b===null&&(b=Function.prototype);var w=Object.getOwnPropertyDescriptor(b,v);if(w===void 0){var S=Object.getPrototypeOf(b);return S===null?void 0:m(S,v,_)}else{if("value"in w)return w.value;var C=w.get;return C===void 0?void 0:C.call(_)}},r=iv(),s=l(r);function l(m){return m&&m.__esModule?m:{default:m}}function c(m,b){if(!(m instanceof b))throw new TypeError("Cannot call a class as a function")}function d(m,b){if(!m)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return b&&(typeof b=="object"||typeof b=="function")?b:m}function p(m,b){if(typeof b!="function"&&b!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof b);m.prototype=Object.create(b&&b.prototype,{constructor:{value:m,enumerable:!1,writable:!0,configurable:!0}}),b&&(Object.setPrototypeOf?Object.setPrototypeOf(m,b):m.__proto__=b)}var g=function(b){var v=b.substr(0,7).split("").map(function(_){return+_}).reduce(function(_,w,S){return S%2?_+w:_+w*3},0);return(10-v%10)%10},f=(function(m){p(b,m);function b(v,_){return c(this,b),v.search(/^[0-9]{7}$/)!==-1&&(v+=g(v)),d(this,(b.__proto__||Object.getPrototypeOf(b)).call(this,v,_))}return i(b,[{key:"valid",value:function(){return this.data.search(/^[0-9]{8}$/)!==-1&&+this.data[7]===g(this.data)}},{key:"leftText",value:function(){return t(b.prototype.__proto__||Object.getPrototypeOf(b.prototype),"leftText",this).call(this,0,4)}},{key:"leftEncode",value:function(){var _=this.data.substr(0,4);return t(b.prototype.__proto__||Object.getPrototypeOf(b.prototype),"leftEncode",this).call(this,_,"LLLL")}},{key:"rightText",value:function(){return t(b.prototype.__proto__||Object.getPrototypeOf(b.prototype),"rightText",this).call(this,4,4)}},{key:"rightEncode",value:function(){var _=this.data.substr(4,4);return t(b.prototype.__proto__||Object.getPrototypeOf(b.prototype),"rightEncode",this).call(this,_,"RRRR")}}]),b})(s.default);return uc.default=f,uc}var fc={},$g;function AO(){if($g)return fc;$g=1,Object.defineProperty(fc,"__esModule",{value:!0});var i=(function(){function v(_,w){for(var S=0;S<w.length;S++){var C=w[S];C.enumerable=C.enumerable||!1,C.configurable=!0,"value"in C&&(C.writable=!0),Object.defineProperty(_,C.key,C)}}return function(_,w,S){return w&&v(_.prototype,w),S&&v(_,S),_}})(),t=xo(),r=_o(),s=d(r),l=yn(),c=d(l);function d(v){return v&&v.__esModule?v:{default:v}}function p(v,_){if(!(v instanceof _))throw new TypeError("Cannot call a class as a function")}function g(v,_){if(!v)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return _&&(typeof _=="object"||typeof _=="function")?_:v}function f(v,_){if(typeof _!="function"&&_!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof _);v.prototype=Object.create(_&&_.prototype,{constructor:{value:v,enumerable:!1,writable:!0,configurable:!0}}),_&&(Object.setPrototypeOf?Object.setPrototypeOf(v,_):v.__proto__=_)}var m=function(_){var w=_.split("").map(function(S){return+S}).reduce(function(S,C,L){return L%2?S+C*9:S+C*3},0);return w%10},b=(function(v){f(_,v);function _(w,S){return p(this,_),g(this,(_.__proto__||Object.getPrototypeOf(_)).call(this,w,S))}return i(_,[{key:"valid",value:function(){return this.data.search(/^[0-9]{5}$/)!==-1}},{key:"encode",value:function(){var S=t.EAN5_STRUCTURE[m(this.data)];return{data:"1011"+(0,s.default)(this.data,S,"01"),text:this.text}}}]),_})(c.default);return fc.default=b,fc}var hc={},Ig;function jO(){if(Ig)return hc;Ig=1,Object.defineProperty(hc,"__esModule",{value:!0});var i=(function(){function b(v,_){for(var w=0;w<_.length;w++){var S=_[w];S.enumerable=S.enumerable||!1,S.configurable=!0,"value"in S&&(S.writable=!0),Object.defineProperty(v,S.key,S)}}return function(v,_,w){return _&&b(v.prototype,_),w&&b(v,w),v}})(),t=xo(),r=_o(),s=d(r),l=yn(),c=d(l);function d(b){return b&&b.__esModule?b:{default:b}}function p(b,v){if(!(b instanceof v))throw new TypeError("Cannot call a class as a function")}function g(b,v){if(!b)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return v&&(typeof v=="object"||typeof v=="function")?v:b}function f(b,v){if(typeof v!="function"&&v!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof v);b.prototype=Object.create(v&&v.prototype,{constructor:{value:b,enumerable:!1,writable:!0,configurable:!0}}),v&&(Object.setPrototypeOf?Object.setPrototypeOf(b,v):b.__proto__=v)}var m=(function(b){f(v,b);function v(_,w){return p(this,v),g(this,(v.__proto__||Object.getPrototypeOf(v)).call(this,_,w))}return i(v,[{key:"valid",value:function(){return this.data.search(/^[0-9]{2}$/)!==-1}},{key:"encode",value:function(){var w=t.EAN2_STRUCTURE[parseInt(this.data)%4];return{data:"1011"+(0,s.default)(this.data,w,"01"),text:this.text}}}]),v})(c.default);return hc.default=m,hc}var Xa={},Hg;function sv(){if(Hg)return Xa;Hg=1,Object.defineProperty(Xa,"__esModule",{value:!0});var i=(function(){function b(v,_){for(var w=0;w<_.length;w++){var S=_[w];S.enumerable=S.enumerable||!1,S.configurable=!0,"value"in S&&(S.writable=!0),Object.defineProperty(v,S.key,S)}}return function(v,_,w){return _&&b(v.prototype,_),w&&b(v,w),v}})();Xa.checksum=m;var t=_o(),r=c(t),s=yn(),l=c(s);function c(b){return b&&b.__esModule?b:{default:b}}function d(b,v){if(!(b instanceof v))throw new TypeError("Cannot call a class as a function")}function p(b,v){if(!b)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return v&&(typeof v=="object"||typeof v=="function")?v:b}function g(b,v){if(typeof v!="function"&&v!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof v);b.prototype=Object.create(v&&v.prototype,{constructor:{value:b,enumerable:!1,writable:!0,configurable:!0}}),v&&(Object.setPrototypeOf?Object.setPrototypeOf(b,v):b.__proto__=v)}var f=(function(b){g(v,b);function v(_,w){d(this,v),_.search(/^[0-9]{11}$/)!==-1&&(_+=m(_));var S=p(this,(v.__proto__||Object.getPrototypeOf(v)).call(this,_,w));return S.displayValue=w.displayValue,w.fontSize>w.width*10?S.fontSize=w.width*10:S.fontSize=w.fontSize,S.guardHeight=w.height+S.fontSize/2+w.textMargin,S}return i(v,[{key:"valid",value:function(){return this.data.search(/^[0-9]{12}$/)!==-1&&this.data[11]==m(this.data)}},{key:"encode",value:function(){return this.options.flat?this.flatEncoding():this.guardedEncoding()}},{key:"flatEncoding",value:function(){var w="";return w+="101",w+=(0,r.default)(this.data.substr(0,6),"LLLLLL"),w+="01010",w+=(0,r.default)(this.data.substr(6,6),"RRRRRR"),w+="101",{data:w,text:this.text}}},{key:"guardedEncoding",value:function(){var w=[];return this.displayValue&&w.push({data:"00000000",text:this.text.substr(0,1),options:{textAlign:"left",fontSize:this.fontSize}}),w.push({data:"101"+(0,r.default)(this.data[0],"L"),options:{height:this.guardHeight}}),w.push({data:(0,r.default)(this.data.substr(1,5),"LLLLL"),text:this.text.substr(1,5),options:{fontSize:this.fontSize}}),w.push({data:"01010",options:{height:this.guardHeight}}),w.push({data:(0,r.default)(this.data.substr(6,5),"RRRRR"),text:this.text.substr(6,5),options:{fontSize:this.fontSize}}),w.push({data:(0,r.default)(this.data[11],"R")+"101",options:{height:this.guardHeight}}),this.displayValue&&w.push({data:"00000000",text:this.text.substr(11,1),options:{textAlign:"right",fontSize:this.fontSize}}),w}}]),v})(l.default);function m(b){var v=0,_;for(_=1;_<11;_+=2)v+=parseInt(b[_]);for(_=0;_<11;_+=2)v+=parseInt(b[_])*3;return(10-v%10)%10}return Xa.default=f,Xa}var dc={},Gg;function TO(){if(Gg)return dc;Gg=1,Object.defineProperty(dc,"__esModule",{value:!0});var i=(function(){function w(S,C){for(var L=0;L<C.length;L++){var z=C[L];z.enumerable=z.enumerable||!1,z.configurable=!0,"value"in z&&(z.writable=!0),Object.defineProperty(S,z.key,z)}}return function(S,C,L){return C&&w(S.prototype,C),L&&w(S,L),S}})(),t=_o(),r=d(t),s=yn(),l=d(s),c=sv();function d(w){return w&&w.__esModule?w:{default:w}}function p(w,S){if(!(w instanceof S))throw new TypeError("Cannot call a class as a function")}function g(w,S){if(!w)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return S&&(typeof S=="object"||typeof S=="function")?S:w}function f(w,S){if(typeof S!="function"&&S!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof S);w.prototype=Object.create(S&&S.prototype,{constructor:{value:w,enumerable:!1,writable:!0,configurable:!0}}),S&&(Object.setPrototypeOf?Object.setPrototypeOf(w,S):w.__proto__=S)}var m=["XX00000XXX","XX10000XXX","XX20000XXX","XXX00000XX","XXXX00000X","XXXXX00005","XXXXX00006","XXXXX00007","XXXXX00008","XXXXX00009"],b=[["EEEOOO","OOOEEE"],["EEOEOO","OOEOEE"],["EEOOEO","OOEEOE"],["EEOOOE","OOEEEO"],["EOEEOO","OEOOEE"],["EOOEEO","OEEOOE"],["EOOOEE","OEEEOO"],["EOEOEO","OEOEOE"],["EOEOOE","OEOEEO"],["EOOEOE","OEEOEO"]],v=(function(w){f(S,w);function S(C,L){p(this,S);var z=g(this,(S.__proto__||Object.getPrototypeOf(S)).call(this,C,L));if(z.isValid=!1,C.search(/^[0-9]{6}$/)!==-1)z.middleDigits=C,z.upcA=_(C,"0"),z.text=L.text||""+z.upcA[0]+C+z.upcA[z.upcA.length-1],z.isValid=!0;else if(C.search(/^[01][0-9]{7}$/)!==-1)if(z.middleDigits=C.substring(1,C.length-1),z.upcA=_(z.middleDigits,C[0]),z.upcA[z.upcA.length-1]===C[C.length-1])z.isValid=!0;else return g(z);else return g(z);return z.displayValue=L.displayValue,L.fontSize>L.width*10?z.fontSize=L.width*10:z.fontSize=L.fontSize,z.guardHeight=L.height+z.fontSize/2+L.textMargin,z}return i(S,[{key:"valid",value:function(){return this.isValid}},{key:"encode",value:function(){return this.options.flat?this.flatEncoding():this.guardedEncoding()}},{key:"flatEncoding",value:function(){var L="";return L+="101",L+=this.encodeMiddleDigits(),L+="010101",{data:L,text:this.text}}},{key:"guardedEncoding",value:function(){var L=[];return this.displayValue&&L.push({data:"00000000",text:this.text[0],options:{textAlign:"left",fontSize:this.fontSize}}),L.push({data:"101",options:{height:this.guardHeight}}),L.push({data:this.encodeMiddleDigits(),text:this.text.substring(1,7),options:{fontSize:this.fontSize}}),L.push({data:"010101",options:{height:this.guardHeight}}),this.displayValue&&L.push({data:"00000000",text:this.text[7],options:{textAlign:"right",fontSize:this.fontSize}}),L}},{key:"encodeMiddleDigits",value:function(){var L=this.upcA[0],z=this.upcA[this.upcA.length-1],se=b[parseInt(z)][parseInt(L)];return(0,r.default)(this.middleDigits,se)}}]),S})(l.default);function _(w,S){for(var C=parseInt(w[w.length-1]),L=m[C],z="",se=0,oe=0;oe<L.length;oe++){var M=L[oe];M==="X"?z+=w[se++]:z+=M}return z=""+S+z,""+z+(0,c.checksum)(z)}return dc.default=v,dc}var Fg;function NO(){if(Fg)return Ut;Fg=1,Object.defineProperty(Ut,"__esModule",{value:!0}),Ut.UPCE=Ut.UPC=Ut.EAN2=Ut.EAN5=Ut.EAN8=Ut.EAN13=void 0;var i=EO(),t=v(i),r=OO(),s=v(r),l=AO(),c=v(l),d=jO(),p=v(d),g=sv(),f=v(g),m=TO(),b=v(m);function v(_){return _&&_.__esModule?_:{default:_}}return Ut.EAN13=t.default,Ut.EAN8=s.default,Ut.EAN5=c.default,Ut.EAN2=p.default,Ut.UPC=f.default,Ut.UPCE=b.default,Ut}var Li={},mc={},Ms={},Vg;function kO(){return Vg||(Vg=1,Object.defineProperty(Ms,"__esModule",{value:!0}),Ms.START_BIN="1010",Ms.END_BIN="11101",Ms.BINARIES=["00110","10001","01001","11000","00101","10100","01100","00011","10010","01010"]),Ms}var Yg;function av(){if(Yg)return mc;Yg=1,Object.defineProperty(mc,"__esModule",{value:!0});var i=(function(){function f(m,b){for(var v=0;v<b.length;v++){var _=b[v];_.enumerable=_.enumerable||!1,_.configurable=!0,"value"in _&&(_.writable=!0),Object.defineProperty(m,_.key,_)}}return function(m,b,v){return b&&f(m.prototype,b),v&&f(m,v),m}})(),t=kO(),r=yn(),s=l(r);function l(f){return f&&f.__esModule?f:{default:f}}function c(f,m){if(!(f instanceof m))throw new TypeError("Cannot call a class as a function")}function d(f,m){if(!f)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return m&&(typeof m=="object"||typeof m=="function")?m:f}function p(f,m){if(typeof m!="function"&&m!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof m);f.prototype=Object.create(m&&m.prototype,{constructor:{value:f,enumerable:!1,writable:!0,configurable:!0}}),m&&(Object.setPrototypeOf?Object.setPrototypeOf(f,m):f.__proto__=m)}var g=(function(f){p(m,f);function m(){return c(this,m),d(this,(m.__proto__||Object.getPrototypeOf(m)).apply(this,arguments))}return i(m,[{key:"valid",value:function(){return this.data.search(/^([0-9]{2})+$/)!==-1}},{key:"encode",value:function(){var v=this,_=this.data.match(/.{2}/g).map(function(w){return v.encodePair(w)}).join("");return{data:t.START_BIN+_+t.END_BIN,text:this.text}}},{key:"encodePair",value:function(v){var _=t.BINARIES[v[1]];return t.BINARIES[v[0]].split("").map(function(w,S){return(w==="1"?"111":"1")+(_[S]==="1"?"000":"0")}).join("")}}]),m})(s.default);return mc.default=g,mc}var pc={},Kg;function CO(){if(Kg)return pc;Kg=1,Object.defineProperty(pc,"__esModule",{value:!0});var i=(function(){function f(m,b){for(var v=0;v<b.length;v++){var _=b[v];_.enumerable=_.enumerable||!1,_.configurable=!0,"value"in _&&(_.writable=!0),Object.defineProperty(m,_.key,_)}}return function(m,b,v){return b&&f(m.prototype,b),v&&f(m,v),m}})(),t=av(),r=s(t);function s(f){return f&&f.__esModule?f:{default:f}}function l(f,m){if(!(f instanceof m))throw new TypeError("Cannot call a class as a function")}function c(f,m){if(!f)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return m&&(typeof m=="object"||typeof m=="function")?m:f}function d(f,m){if(typeof m!="function"&&m!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof m);f.prototype=Object.create(m&&m.prototype,{constructor:{value:f,enumerable:!1,writable:!0,configurable:!0}}),m&&(Object.setPrototypeOf?Object.setPrototypeOf(f,m):f.__proto__=m)}var p=function(m){var b=m.substr(0,13).split("").map(function(v){return parseInt(v,10)}).reduce(function(v,_,w){return v+_*(3-w%2*2)},0);return Math.ceil(b/10)*10-b},g=(function(f){d(m,f);function m(b,v){return l(this,m),b.search(/^[0-9]{13}$/)!==-1&&(b+=p(b)),c(this,(m.__proto__||Object.getPrototypeOf(m)).call(this,b,v))}return i(m,[{key:"valid",value:function(){return this.data.search(/^[0-9]{14}$/)!==-1&&+this.data[13]===p(this.data)}}]),m})(r.default);return pc.default=g,pc}var Xg;function MO(){if(Xg)return Li;Xg=1,Object.defineProperty(Li,"__esModule",{value:!0}),Li.ITF14=Li.ITF=void 0;var i=av(),t=l(i),r=CO(),s=l(r);function l(c){return c&&c.__esModule?c:{default:c}}return Li.ITF=t.default,Li.ITF14=s.default,Li}var an={},yc={},Jg;function wo(){if(Jg)return yc;Jg=1,Object.defineProperty(yc,"__esModule",{value:!0});var i=(function(){function f(m,b){for(var v=0;v<b.length;v++){var _=b[v];_.enumerable=_.enumerable||!1,_.configurable=!0,"value"in _&&(_.writable=!0),Object.defineProperty(m,_.key,_)}}return function(m,b,v){return b&&f(m.prototype,b),v&&f(m,v),m}})(),t=yn(),r=s(t);function s(f){return f&&f.__esModule?f:{default:f}}function l(f,m){if(!(f instanceof m))throw new TypeError("Cannot call a class as a function")}function c(f,m){if(!f)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return m&&(typeof m=="object"||typeof m=="function")?m:f}function d(f,m){if(typeof m!="function"&&m!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof m);f.prototype=Object.create(m&&m.prototype,{constructor:{value:f,enumerable:!1,writable:!0,configurable:!0}}),m&&(Object.setPrototypeOf?Object.setPrototypeOf(f,m):f.__proto__=m)}var p=(function(f){d(m,f);function m(b,v){return l(this,m),c(this,(m.__proto__||Object.getPrototypeOf(m)).call(this,b,v))}return i(m,[{key:"encode",value:function(){for(var v="110",_=0;_<this.data.length;_++){var w=parseInt(this.data[_]),S=w.toString(2);S=g(S,4-S.length);for(var C=0;C<S.length;C++)v+=S[C]=="0"?"100":"110"}return v+="1001",{data:v,text:this.text}}},{key:"valid",value:function(){return this.data.search(/^[0-9]+$/)!==-1}}]),m})(r.default);function g(f,m){for(var b=0;b<m;b++)f="0"+f;return f}return yc.default=p,yc}var gc={},Ja={},Qg;function hu(){if(Qg)return Ja;Qg=1,Object.defineProperty(Ja,"__esModule",{value:!0}),Ja.mod10=i,Ja.mod11=t;function i(r){for(var s=0,l=0;l<r.length;l++){var c=parseInt(r[l]);(l+r.length)%2===0?s+=c:s+=c*2%10+Math.floor(c*2/10)}return(10-s%10)%10}function t(r){for(var s=0,l=[2,3,4,5,6,7],c=0;c<r.length;c++){var d=parseInt(r[r.length-1-c]);s+=l[c%l.length]*d}return(11-s%11)%11}return Ja}var Zg;function RO(){if(Zg)return gc;Zg=1,Object.defineProperty(gc,"__esModule",{value:!0});var i=wo(),t=s(i),r=hu();function s(g){return g&&g.__esModule?g:{default:g}}function l(g,f){if(!(g instanceof f))throw new TypeError("Cannot call a class as a function")}function c(g,f){if(!g)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return f&&(typeof f=="object"||typeof f=="function")?f:g}function d(g,f){if(typeof f!="function"&&f!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof f);g.prototype=Object.create(f&&f.prototype,{constructor:{value:g,enumerable:!1,writable:!0,configurable:!0}}),f&&(Object.setPrototypeOf?Object.setPrototypeOf(g,f):g.__proto__=f)}var p=(function(g){d(f,g);function f(m,b){return l(this,f),c(this,(f.__proto__||Object.getPrototypeOf(f)).call(this,m+(0,r.mod10)(m),b))}return f})(t.default);return gc.default=p,gc}var bc={},Wg;function DO(){if(Wg)return bc;Wg=1,Object.defineProperty(bc,"__esModule",{value:!0});var i=wo(),t=s(i),r=hu();function s(g){return g&&g.__esModule?g:{default:g}}function l(g,f){if(!(g instanceof f))throw new TypeError("Cannot call a class as a function")}function c(g,f){if(!g)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return f&&(typeof f=="object"||typeof f=="function")?f:g}function d(g,f){if(typeof f!="function"&&f!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof f);g.prototype=Object.create(f&&f.prototype,{constructor:{value:g,enumerable:!1,writable:!0,configurable:!0}}),f&&(Object.setPrototypeOf?Object.setPrototypeOf(g,f):g.__proto__=f)}var p=(function(g){d(f,g);function f(m,b){return l(this,f),c(this,(f.__proto__||Object.getPrototypeOf(f)).call(this,m+(0,r.mod11)(m),b))}return f})(t.default);return bc.default=p,bc}var vc={},e1;function qO(){if(e1)return vc;e1=1,Object.defineProperty(vc,"__esModule",{value:!0});var i=wo(),t=s(i),r=hu();function s(g){return g&&g.__esModule?g:{default:g}}function l(g,f){if(!(g instanceof f))throw new TypeError("Cannot call a class as a function")}function c(g,f){if(!g)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return f&&(typeof f=="object"||typeof f=="function")?f:g}function d(g,f){if(typeof f!="function"&&f!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof f);g.prototype=Object.create(f&&f.prototype,{constructor:{value:g,enumerable:!1,writable:!0,configurable:!0}}),f&&(Object.setPrototypeOf?Object.setPrototypeOf(g,f):g.__proto__=f)}var p=(function(g){d(f,g);function f(m,b){return l(this,f),m+=(0,r.mod10)(m),m+=(0,r.mod10)(m),c(this,(f.__proto__||Object.getPrototypeOf(f)).call(this,m,b))}return f})(t.default);return vc.default=p,vc}var xc={},t1;function BO(){if(t1)return xc;t1=1,Object.defineProperty(xc,"__esModule",{value:!0});var i=wo(),t=s(i),r=hu();function s(g){return g&&g.__esModule?g:{default:g}}function l(g,f){if(!(g instanceof f))throw new TypeError("Cannot call a class as a function")}function c(g,f){if(!g)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return f&&(typeof f=="object"||typeof f=="function")?f:g}function d(g,f){if(typeof f!="function"&&f!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof f);g.prototype=Object.create(f&&f.prototype,{constructor:{value:g,enumerable:!1,writable:!0,configurable:!0}}),f&&(Object.setPrototypeOf?Object.setPrototypeOf(g,f):g.__proto__=f)}var p=(function(g){d(f,g);function f(m,b){return l(this,f),m+=(0,r.mod11)(m),m+=(0,r.mod10)(m),c(this,(f.__proto__||Object.getPrototypeOf(f)).call(this,m,b))}return f})(t.default);return xc.default=p,xc}var n1;function LO(){if(n1)return an;n1=1,Object.defineProperty(an,"__esModule",{value:!0}),an.MSI1110=an.MSI1010=an.MSI11=an.MSI10=an.MSI=void 0;var i=wo(),t=m(i),r=RO(),s=m(r),l=DO(),c=m(l),d=qO(),p=m(d),g=BO(),f=m(g);function m(b){return b&&b.__esModule?b:{default:b}}return an.MSI=t.default,an.MSI10=s.default,an.MSI11=c.default,an.MSI1010=p.default,an.MSI1110=f.default,an}var Qa={},r1;function zO(){if(r1)return Qa;r1=1,Object.defineProperty(Qa,"__esModule",{value:!0}),Qa.pharmacode=void 0;var i=(function(){function g(f,m){for(var b=0;b<m.length;b++){var v=m[b];v.enumerable=v.enumerable||!1,v.configurable=!0,"value"in v&&(v.writable=!0),Object.defineProperty(f,v.key,v)}}return function(f,m,b){return m&&g(f.prototype,m),b&&g(f,b),f}})(),t=yn(),r=s(t);function s(g){return g&&g.__esModule?g:{default:g}}function l(g,f){if(!(g instanceof f))throw new TypeError("Cannot call a class as a function")}function c(g,f){if(!g)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return f&&(typeof f=="object"||typeof f=="function")?f:g}function d(g,f){if(typeof f!="function"&&f!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof f);g.prototype=Object.create(f&&f.prototype,{constructor:{value:g,enumerable:!1,writable:!0,configurable:!0}}),f&&(Object.setPrototypeOf?Object.setPrototypeOf(g,f):g.__proto__=f)}var p=(function(g){d(f,g);function f(m,b){l(this,f);var v=c(this,(f.__proto__||Object.getPrototypeOf(f)).call(this,m,b));return v.number=parseInt(m,10),v}return i(f,[{key:"encode",value:function(){for(var b=this.number,v="";!isNaN(b)&&b!=0;)b%2===0?(v="11100"+v,b=(b-2)/2):(v="100"+v,b=(b-1)/2);return v=v.slice(0,-2),{data:v,text:this.text}}},{key:"valid",value:function(){return this.number>=3&&this.number<=131070}}]),f})(r.default);return Qa.pharmacode=p,Qa}var Za={},i1;function UO(){if(i1)return Za;i1=1,Object.defineProperty(Za,"__esModule",{value:!0}),Za.codabar=void 0;var i=(function(){function g(f,m){for(var b=0;b<m.length;b++){var v=m[b];v.enumerable=v.enumerable||!1,v.configurable=!0,"value"in v&&(v.writable=!0),Object.defineProperty(f,v.key,v)}}return function(f,m,b){return m&&g(f.prototype,m),b&&g(f,b),f}})(),t=yn(),r=s(t);function s(g){return g&&g.__esModule?g:{default:g}}function l(g,f){if(!(g instanceof f))throw new TypeError("Cannot call a class as a function")}function c(g,f){if(!g)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return f&&(typeof f=="object"||typeof f=="function")?f:g}function d(g,f){if(typeof f!="function"&&f!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof f);g.prototype=Object.create(f&&f.prototype,{constructor:{value:g,enumerable:!1,writable:!0,configurable:!0}}),f&&(Object.setPrototypeOf?Object.setPrototypeOf(g,f):g.__proto__=f)}var p=(function(g){d(f,g);function f(m,b){l(this,f),m.search(/^[0-9\-\$\:\.\+\/]+$/)===0&&(m="A"+m+"A");var v=c(this,(f.__proto__||Object.getPrototypeOf(f)).call(this,m.toUpperCase(),b));return v.text=v.options.text||v.text.replace(/[A-D]/g,""),v}return i(f,[{key:"valid",value:function(){return this.data.search(/^[A-D][0-9\-\$\:\.\+\/]+[A-D]$/)!==-1}},{key:"encode",value:function(){for(var b=[],v=this.getEncodings(),_=0;_<this.data.length;_++)b.push(v[this.data.charAt(_)]),_!==this.data.length-1&&b.push("0");return{text:this.text,data:b.join("")}}},{key:"getEncodings",value:function(){return{0:"101010011",1:"101011001",2:"101001011",3:"110010101",4:"101101001",5:"110101001",6:"100101011",7:"100101101",8:"100110101",9:"110100101","-":"101001101",$:"101100101",":":"1101011011","/":"1101101011",".":"1101101101","+":"1011011011",A:"1011001001",B:"1001001011",C:"1010010011",D:"1010011001"}}}]),f})(r.default);return Za.codabar=p,Za}var zi={},_c={},Rs={},s1;function PO(){return s1||(s1=1,Object.defineProperty(Rs,"__esModule",{value:!0}),Rs.SYMBOLS=["0","1","2","3","4","5","6","7","8","9","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","-","."," ","$","/","+","%","($)","(%)","(/)","(+)","ÿ"],Rs.BINARIES=["100010100","101001000","101000100","101000010","100101000","100100100","100100010","101010000","100010010","100001010","110101000","110100100","110100010","110010100","110010010","110001010","101101000","101100100","101100010","100110100","100011010","101011000","101001100","101000110","100101100","100010110","110110100","110110010","110101100","110100110","110010110","110011010","101101100","101100110","100110110","100111010","100101110","111010100","111010010","111001010","101101110","101110110","110101110","100100110","111011010","111010110","100110010","101011110"],Rs.MULTI_SYMBOLS={"\0":["(%)","U"],"":["($)","A"],"":["($)","B"],"":["($)","C"],"":["($)","D"],"":["($)","E"],"":["($)","F"],"\x07":["($)","G"],"\b":["($)","H"]," ":["($)","I"],"\n":["($)","J"],"\v":["($)","K"],"\f":["($)","L"],"\r":["($)","M"],"":["($)","N"],"":["($)","O"],"":["($)","P"],"":["($)","Q"],"":["($)","R"],"":["($)","S"],"":["($)","T"],"":["($)","U"],"":["($)","V"],"":["($)","W"],"":["($)","X"],"":["($)","Y"],"":["($)","Z"],"\x1B":["(%)","A"],"":["(%)","B"],"":["(%)","C"],"":["(%)","D"],"":["(%)","E"],"!":["(/)","A"],'"':["(/)","B"],"#":["(/)","C"],"&":["(/)","F"],"'":["(/)","G"],"(":["(/)","H"],")":["(/)","I"],"*":["(/)","J"],",":["(/)","L"],":":["(/)","Z"],";":["(%)","F"],"<":["(%)","G"],"=":["(%)","H"],">":["(%)","I"],"?":["(%)","J"],"@":["(%)","V"],"[":["(%)","K"],"\\":["(%)","L"],"]":["(%)","M"],"^":["(%)","N"],_:["(%)","O"],"`":["(%)","W"],a:["(+)","A"],b:["(+)","B"],c:["(+)","C"],d:["(+)","D"],e:["(+)","E"],f:["(+)","F"],g:["(+)","G"],h:["(+)","H"],i:["(+)","I"],j:["(+)","J"],k:["(+)","K"],l:["(+)","L"],m:["(+)","M"],n:["(+)","N"],o:["(+)","O"],p:["(+)","P"],q:["(+)","Q"],r:["(+)","R"],s:["(+)","S"],t:["(+)","T"],u:["(+)","U"],v:["(+)","V"],w:["(+)","W"],x:["(+)","X"],y:["(+)","Y"],z:["(+)","Z"],"{":["(%)","P"],"|":["(%)","Q"],"}":["(%)","R"],"~":["(%)","S"],"":["(%)","T"]}),Rs}var a1;function ov(){if(a1)return _c;a1=1,Object.defineProperty(_c,"__esModule",{value:!0});var i=(function(){function f(m,b){for(var v=0;v<b.length;v++){var _=b[v];_.enumerable=_.enumerable||!1,_.configurable=!0,"value"in _&&(_.writable=!0),Object.defineProperty(m,_.key,_)}}return function(m,b,v){return b&&f(m.prototype,b),v&&f(m,v),m}})(),t=PO(),r=yn(),s=l(r);function l(f){return f&&f.__esModule?f:{default:f}}function c(f,m){if(!(f instanceof m))throw new TypeError("Cannot call a class as a function")}function d(f,m){if(!f)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return m&&(typeof m=="object"||typeof m=="function")?m:f}function p(f,m){if(typeof m!="function"&&m!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof m);f.prototype=Object.create(m&&m.prototype,{constructor:{value:f,enumerable:!1,writable:!0,configurable:!0}}),m&&(Object.setPrototypeOf?Object.setPrototypeOf(f,m):f.__proto__=m)}var g=(function(f){p(m,f);function m(b,v){return c(this,m),d(this,(m.__proto__||Object.getPrototypeOf(m)).call(this,b,v))}return i(m,[{key:"valid",value:function(){return/^[0-9A-Z\-. $/+%]+$/.test(this.data)}},{key:"encode",value:function(){var v=this.data.split("").flatMap(function(C){return t.MULTI_SYMBOLS[C]||C}),_=v.map(function(C){return m.getEncoding(C)}).join(""),w=m.checksum(v,20),S=m.checksum(v.concat(w),15);return{text:this.text,data:m.getEncoding("ÿ")+_+m.getEncoding(w)+m.getEncoding(S)+m.getEncoding("ÿ")+"1"}}}],[{key:"getEncoding",value:function(v){return t.BINARIES[m.symbolValue(v)]}},{key:"getSymbol",value:function(v){return t.SYMBOLS[v]}},{key:"symbolValue",value:function(v){return t.SYMBOLS.indexOf(v)}},{key:"checksum",value:function(v,_){var w=v.slice().reverse().reduce(function(S,C,L){var z=L%_+1;return S+m.symbolValue(C)*z},0);return m.getSymbol(w%47)}}]),m})(s.default);return _c.default=g,_c}var wc={},o1;function $O(){if(o1)return wc;o1=1,Object.defineProperty(wc,"__esModule",{value:!0});var i=(function(){function g(f,m){for(var b=0;b<m.length;b++){var v=m[b];v.enumerable=v.enumerable||!1,v.configurable=!0,"value"in v&&(v.writable=!0),Object.defineProperty(f,v.key,v)}}return function(f,m,b){return m&&g(f.prototype,m),b&&g(f,b),f}})(),t=ov(),r=s(t);function s(g){return g&&g.__esModule?g:{default:g}}function l(g,f){if(!(g instanceof f))throw new TypeError("Cannot call a class as a function")}function c(g,f){if(!g)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return f&&(typeof f=="object"||typeof f=="function")?f:g}function d(g,f){if(typeof f!="function"&&f!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof f);g.prototype=Object.create(f&&f.prototype,{constructor:{value:g,enumerable:!1,writable:!0,configurable:!0}}),f&&(Object.setPrototypeOf?Object.setPrototypeOf(g,f):g.__proto__=f)}var p=(function(g){d(f,g);function f(m,b){return l(this,f),c(this,(f.__proto__||Object.getPrototypeOf(f)).call(this,m,b))}return i(f,[{key:"valid",value:function(){return/^[\x00-\x7f]+$/.test(this.data)}}]),f})(r.default);return wc.default=p,wc}var l1;function IO(){if(l1)return zi;l1=1,Object.defineProperty(zi,"__esModule",{value:!0}),zi.CODE93FullASCII=zi.CODE93=void 0;var i=ov(),t=l(i),r=$O(),s=l(r);function l(c){return c&&c.__esModule?c:{default:c}}return zi.CODE93=t.default,zi.CODE93FullASCII=s.default,zi}var Wa={},c1;function HO(){if(c1)return Wa;c1=1,Object.defineProperty(Wa,"__esModule",{value:!0}),Wa.GenericBarcode=void 0;var i=(function(){function g(f,m){for(var b=0;b<m.length;b++){var v=m[b];v.enumerable=v.enumerable||!1,v.configurable=!0,"value"in v&&(v.writable=!0),Object.defineProperty(f,v.key,v)}}return function(f,m,b){return m&&g(f.prototype,m),b&&g(f,b),f}})(),t=yn(),r=s(t);function s(g){return g&&g.__esModule?g:{default:g}}function l(g,f){if(!(g instanceof f))throw new TypeError("Cannot call a class as a function")}function c(g,f){if(!g)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return f&&(typeof f=="object"||typeof f=="function")?f:g}function d(g,f){if(typeof f!="function"&&f!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof f);g.prototype=Object.create(f&&f.prototype,{constructor:{value:g,enumerable:!1,writable:!0,configurable:!0}}),f&&(Object.setPrototypeOf?Object.setPrototypeOf(g,f):g.__proto__=f)}var p=(function(g){d(f,g);function f(m,b){return l(this,f),c(this,(f.__proto__||Object.getPrototypeOf(f)).call(this,m,b))}return i(f,[{key:"encode",value:function(){return{data:"10101010101010101010101010101010101010101",text:this.text}}},{key:"valid",value:function(){return!0}}]),f})(r.default);return Wa.GenericBarcode=p,Wa}var u1;function GO(){if(u1)return Wl;u1=1,Object.defineProperty(Wl,"__esModule",{value:!0});var i=gO(),t=SO(),r=NO(),s=MO(),l=LO(),c=zO(),d=UO(),p=IO(),g=HO();return Wl.default={CODE39:i.CODE39,CODE128:t.CODE128,CODE128A:t.CODE128A,CODE128B:t.CODE128B,CODE128C:t.CODE128C,EAN13:r.EAN13,EAN8:r.EAN8,EAN5:r.EAN5,EAN2:r.EAN2,UPC:r.UPC,UPCE:r.UPCE,ITF14:s.ITF14,ITF:s.ITF,MSI:l.MSI,MSI10:l.MSI10,MSI11:l.MSI11,MSI1010:l.MSI1010,MSI1110:l.MSI1110,pharmacode:c.pharmacode,codabar:d.codabar,CODE93:p.CODE93,CODE93FullASCII:p.CODE93FullASCII,GenericBarcode:g.GenericBarcode},Wl}var Sc={},f1;function du(){if(f1)return Sc;f1=1,Object.defineProperty(Sc,"__esModule",{value:!0});var i=Object.assign||function(t){for(var r=1;r<arguments.length;r++){var s=arguments[r];for(var l in s)Object.prototype.hasOwnProperty.call(s,l)&&(t[l]=s[l])}return t};return Sc.default=function(t,r){return i({},t,r)},Sc}var Ec={},h1;function FO(){if(h1)return Ec;h1=1,Object.defineProperty(Ec,"__esModule",{value:!0}),Ec.default=i;function i(t){var r=[];function s(l){if(Array.isArray(l))for(var c=0;c<l.length;c++)s(l[c]);else l.text=l.text||"",l.data=l.data||"",r.push(l)}return s(t),r}return Ec}var Oc={},d1;function VO(){if(d1)return Oc;d1=1,Object.defineProperty(Oc,"__esModule",{value:!0}),Oc.default=i;function i(t){return t.marginTop=t.marginTop||t.margin,t.marginBottom=t.marginBottom||t.margin,t.marginRight=t.marginRight||t.margin,t.marginLeft=t.marginLeft||t.margin,t}return Oc}var Ac={},jc={},Tc={},m1;function lv(){if(m1)return Tc;m1=1,Object.defineProperty(Tc,"__esModule",{value:!0}),Tc.default=i;function i(t){var r=["width","height","textMargin","fontSize","margin","marginTop","marginBottom","marginLeft","marginRight"];for(var s in r)r.hasOwnProperty(s)&&(s=r[s],typeof t[s]=="string"&&(t[s]=parseInt(t[s],10)));return typeof t.displayValue=="string"&&(t.displayValue=t.displayValue!="false"),t}return Tc}var Nc={},p1;function cv(){if(p1)return Nc;p1=1,Object.defineProperty(Nc,"__esModule",{value:!0});var i={width:2,height:100,format:"auto",displayValue:!0,fontOptions:"",font:"monospace",text:void 0,textAlign:"center",textPosition:"bottom",textMargin:2,fontSize:20,background:"#ffffff",lineColor:"#000000",margin:10,marginTop:void 0,marginBottom:void 0,marginLeft:void 0,marginRight:void 0,valid:function(){}};return Nc.default=i,Nc}var y1;function YO(){if(y1)return jc;y1=1,Object.defineProperty(jc,"__esModule",{value:!0});var i=lv(),t=l(i),r=cv(),s=l(r);function l(d){return d&&d.__esModule?d:{default:d}}function c(d){var p={};for(var g in s.default)s.default.hasOwnProperty(g)&&(d.hasAttribute("jsbarcode-"+g.toLowerCase())&&(p[g]=d.getAttribute("jsbarcode-"+g.toLowerCase())),d.hasAttribute("data-"+g.toLowerCase())&&(p[g]=d.getAttribute("data-"+g.toLowerCase())));return p.value=d.getAttribute("jsbarcode-value")||d.getAttribute("data-value"),p=(0,t.default)(p),p}return jc.default=c,jc}var kc={},Cc={},on={},g1;function uv(){if(g1)return on;g1=1,Object.defineProperty(on,"__esModule",{value:!0}),on.getTotalWidthOfEncodings=on.calculateEncodingAttributes=on.getBarcodePadding=on.getEncodingHeight=on.getMaximumHeightOfEncodings=void 0;var i=du(),t=r(i);function r(f){return f&&f.__esModule?f:{default:f}}function s(f,m){return m.height+(m.displayValue&&f.text.length>0?m.fontSize+m.textMargin:0)+m.marginTop+m.marginBottom}function l(f,m,b){if(b.displayValue&&m<f){if(b.textAlign=="center")return Math.floor((f-m)/2);if(b.textAlign=="left")return 0;if(b.textAlign=="right")return Math.floor(f-m)}return 0}function c(f,m,b){for(var v=0;v<f.length;v++){var _=f[v],w=(0,t.default)(m,_.options),S;w.displayValue?S=g(_.text,w,b):S=0;var C=_.data.length*w.width;_.width=Math.ceil(Math.max(S,C)),_.height=s(_,w),_.barcodePadding=l(S,C,w)}}function d(f){for(var m=0,b=0;b<f.length;b++)m+=f[b].width;return m}function p(f){for(var m=0,b=0;b<f.length;b++)f[b].height>m&&(m=f[b].height);return m}function g(f,m,b){var v;if(b)v=b;else if(typeof document<"u")v=document.createElement("canvas").getContext("2d");else return 0;v.font=m.fontOptions+" "+m.fontSize+"px "+m.font;var _=v.measureText(f);if(!_)return 0;var w=_.width;return w}return on.getMaximumHeightOfEncodings=p,on.getEncodingHeight=s,on.getBarcodePadding=l,on.calculateEncodingAttributes=c,on.getTotalWidthOfEncodings=d,on}var b1;function KO(){if(b1)return Cc;b1=1,Object.defineProperty(Cc,"__esModule",{value:!0});var i=(function(){function p(g,f){for(var m=0;m<f.length;m++){var b=f[m];b.enumerable=b.enumerable||!1,b.configurable=!0,"value"in b&&(b.writable=!0),Object.defineProperty(g,b.key,b)}}return function(g,f,m){return f&&p(g.prototype,f),m&&p(g,m),g}})(),t=du(),r=l(t),s=uv();function l(p){return p&&p.__esModule?p:{default:p}}function c(p,g){if(!(p instanceof g))throw new TypeError("Cannot call a class as a function")}var d=(function(){function p(g,f,m){c(this,p),this.canvas=g,this.encodings=f,this.options=m}return i(p,[{key:"render",value:function(){if(!this.canvas.getContext)throw new Error("The browser does not support canvas.");this.prepareCanvas();for(var f=0;f<this.encodings.length;f++){var m=(0,r.default)(this.options,this.encodings[f].options);this.drawCanvasBarcode(m,this.encodings[f]),this.drawCanvasText(m,this.encodings[f]),this.moveCanvasDrawing(this.encodings[f])}this.restoreCanvas()}},{key:"prepareCanvas",value:function(){var f=this.canvas.getContext("2d");f.save(),(0,s.calculateEncodingAttributes)(this.encodings,this.options,f);var m=(0,s.getTotalWidthOfEncodings)(this.encodings),b=(0,s.getMaximumHeightOfEncodings)(this.encodings);this.canvas.width=m+this.options.marginLeft+this.options.marginRight,this.canvas.height=b,f.clearRect(0,0,this.canvas.width,this.canvas.height),this.options.background&&(f.fillStyle=this.options.background,f.fillRect(0,0,this.canvas.width,this.canvas.height)),f.translate(this.options.marginLeft,0)}},{key:"drawCanvasBarcode",value:function(f,m){var b=this.canvas.getContext("2d"),v=m.data,_;f.textPosition=="top"?_=f.marginTop+f.fontSize+f.textMargin:_=f.marginTop,b.fillStyle=f.lineColor;for(var w=0;w<v.length;w++){var S=w*f.width+m.barcodePadding;v[w]==="1"?b.fillRect(S,_,f.width,f.height):v[w]&&b.fillRect(S,_,f.width,f.height*v[w])}}},{key:"drawCanvasText",value:function(f,m){var b=this.canvas.getContext("2d"),v=f.fontOptions+" "+f.fontSize+"px "+f.font;if(f.displayValue){var _,w;f.textPosition=="top"?w=f.marginTop+f.fontSize-f.textMargin:w=f.height+f.textMargin+f.marginTop+f.fontSize,b.font=v,f.textAlign=="left"||m.barcodePadding>0?(_=0,b.textAlign="left"):f.textAlign=="right"?(_=m.width-1,b.textAlign="right"):(_=m.width/2,b.textAlign="center"),b.fillText(m.text,_,w)}}},{key:"moveCanvasDrawing",value:function(f){var m=this.canvas.getContext("2d");m.translate(f.width,0)}},{key:"restoreCanvas",value:function(){var f=this.canvas.getContext("2d");f.restore()}}]),p})();return Cc.default=d,Cc}var Mc={},v1;function XO(){if(v1)return Mc;v1=1,Object.defineProperty(Mc,"__esModule",{value:!0});var i=(function(){function g(f,m){for(var b=0;b<m.length;b++){var v=m[b];v.enumerable=v.enumerable||!1,v.configurable=!0,"value"in v&&(v.writable=!0),Object.defineProperty(f,v.key,v)}}return function(f,m,b){return m&&g(f.prototype,m),b&&g(f,b),f}})(),t=du(),r=l(t),s=uv();function l(g){return g&&g.__esModule?g:{default:g}}function c(g,f){if(!(g instanceof f))throw new TypeError("Cannot call a class as a function")}var d="http://www.w3.org/2000/svg",p=(function(){function g(f,m,b){c(this,g),this.svg=f,this.encodings=m,this.options=b,this.document=b.xmlDocument||document}return i(g,[{key:"render",value:function(){var m=this.options.marginLeft;this.prepareSVG();for(var b=0;b<this.encodings.length;b++){var v=this.encodings[b],_=(0,r.default)(this.options,v.options),w=this.createGroup(m,_.marginTop,this.svg);this.setGroupOptions(w,_),this.drawSvgBarcode(w,_,v),this.drawSVGText(w,_,v),m+=v.width}}},{key:"prepareSVG",value:function(){for(;this.svg.firstChild;)this.svg.removeChild(this.svg.firstChild);(0,s.calculateEncodingAttributes)(this.encodings,this.options);var m=(0,s.getTotalWidthOfEncodings)(this.encodings),b=(0,s.getMaximumHeightOfEncodings)(this.encodings),v=m+this.options.marginLeft+this.options.marginRight;this.setSvgAttributes(v,b),this.options.background&&this.drawRect(0,0,v,b,this.svg).setAttribute("fill",this.options.background)}},{key:"drawSvgBarcode",value:function(m,b,v){var _=v.data,w;b.textPosition=="top"?w=b.fontSize+b.textMargin:w=0;for(var S=0,C=0,L=0;L<_.length;L++)C=L*b.width+v.barcodePadding,_[L]==="1"?S++:S>0&&(this.drawRect(C-b.width*S,w,b.width*S,b.height,m),S=0);S>0&&this.drawRect(C-b.width*(S-1),w,b.width*S,b.height,m)}},{key:"drawSVGText",value:function(m,b,v){var _=this.document.createElementNS(d,"text");if(b.displayValue){var w,S;_.setAttribute("font-family",b.font),_.setAttribute("font-size",b.fontSize),b.fontOptions.includes("bold")&&_.setAttribute("font-weight","bold"),b.fontOptions.includes("italic")&&_.setAttribute("font-style","italic"),b.textPosition=="top"?S=b.fontSize-b.textMargin:S=b.height+b.textMargin+b.fontSize,b.textAlign=="left"||v.barcodePadding>0?(w=0,_.setAttribute("text-anchor","start")):b.textAlign=="right"?(w=v.width-1,_.setAttribute("text-anchor","end")):(w=v.width/2,_.setAttribute("text-anchor","middle")),_.setAttribute("x",w),_.setAttribute("y",S),_.appendChild(this.document.createTextNode(v.text)),m.appendChild(_)}}},{key:"setSvgAttributes",value:function(m,b){var v=this.svg;v.setAttribute("width",m+"px"),v.setAttribute("height",b+"px"),v.setAttribute("x","0px"),v.setAttribute("y","0px"),v.setAttribute("viewBox","0 0 "+m+" "+b),v.setAttribute("xmlns",d),v.setAttribute("version","1.1")}},{key:"createGroup",value:function(m,b,v){var _=this.document.createElementNS(d,"g");return _.setAttribute("transform","translate("+m+", "+b+")"),v.appendChild(_),_}},{key:"setGroupOptions",value:function(m,b){m.setAttribute("fill",b.lineColor)}},{key:"drawRect",value:function(m,b,v,_,w){var S=this.document.createElementNS(d,"rect");return S.setAttribute("x",m),S.setAttribute("y",b),S.setAttribute("width",v),S.setAttribute("height",_),w.appendChild(S),S}}]),g})();return Mc.default=p,Mc}var Rc={},x1;function JO(){if(x1)return Rc;x1=1,Object.defineProperty(Rc,"__esModule",{value:!0});var i=(function(){function s(l,c){for(var d=0;d<c.length;d++){var p=c[d];p.enumerable=p.enumerable||!1,p.configurable=!0,"value"in p&&(p.writable=!0),Object.defineProperty(l,p.key,p)}}return function(l,c,d){return c&&s(l.prototype,c),d&&s(l,d),l}})();function t(s,l){if(!(s instanceof l))throw new TypeError("Cannot call a class as a function")}var r=(function(){function s(l,c,d){t(this,s),this.object=l,this.encodings=c,this.options=d}return i(s,[{key:"render",value:function(){this.object.encodings=this.encodings}}]),s})();return Rc.default=r,Rc}var _1;function QO(){if(_1)return kc;_1=1,Object.defineProperty(kc,"__esModule",{value:!0});var i=KO(),t=d(i),r=XO(),s=d(r),l=JO(),c=d(l);function d(p){return p&&p.__esModule?p:{default:p}}return kc.default={CanvasRenderer:t.default,SVGRenderer:s.default,ObjectRenderer:c.default},kc}var Ds={},w1;function fv(){if(w1)return Ds;w1=1,Object.defineProperty(Ds,"__esModule",{value:!0});function i(d,p){if(!(d instanceof p))throw new TypeError("Cannot call a class as a function")}function t(d,p){if(!d)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return p&&(typeof p=="object"||typeof p=="function")?p:d}function r(d,p){if(typeof p!="function"&&p!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof p);d.prototype=Object.create(p&&p.prototype,{constructor:{value:d,enumerable:!1,writable:!0,configurable:!0}}),p&&(Object.setPrototypeOf?Object.setPrototypeOf(d,p):d.__proto__=p)}var s=(function(d){r(p,d);function p(g,f){i(this,p);var m=t(this,(p.__proto__||Object.getPrototypeOf(p)).call(this));return m.name="InvalidInputException",m.symbology=g,m.input=f,m.message='"'+m.input+'" is not a valid input for '+m.symbology,m}return p})(Error),l=(function(d){r(p,d);function p(){i(this,p);var g=t(this,(p.__proto__||Object.getPrototypeOf(p)).call(this));return g.name="InvalidElementException",g.message="Not supported type to render on",g}return p})(Error),c=(function(d){r(p,d);function p(){i(this,p);var g=t(this,(p.__proto__||Object.getPrototypeOf(p)).call(this));return g.name="NoElementException",g.message="No element to render on.",g}return p})(Error);return Ds.InvalidInputException=s,Ds.InvalidElementException=l,Ds.NoElementException=c,Ds}var S1;function ZO(){if(S1)return Ac;S1=1,Object.defineProperty(Ac,"__esModule",{value:!0});var i=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(m){return typeof m}:function(m){return m&&typeof Symbol=="function"&&m.constructor===Symbol&&m!==Symbol.prototype?"symbol":typeof m},t=YO(),r=d(t),s=QO(),l=d(s),c=fv();function d(m){return m&&m.__esModule?m:{default:m}}function p(m){if(typeof m=="string")return g(m);if(Array.isArray(m)){for(var b=[],v=0;v<m.length;v++)b.push(p(m[v]));return b}else{if(typeof HTMLCanvasElement<"u"&&m instanceof HTMLImageElement)return f(m);if(m&&m.nodeName&&m.nodeName.toLowerCase()==="svg"||typeof SVGElement<"u"&&m instanceof SVGElement)return{element:m,options:(0,r.default)(m),renderer:l.default.SVGRenderer};if(typeof HTMLCanvasElement<"u"&&m instanceof HTMLCanvasElement)return{element:m,options:(0,r.default)(m),renderer:l.default.CanvasRenderer};if(m&&m.getContext)return{element:m,renderer:l.default.CanvasRenderer};if(m&&(typeof m>"u"?"undefined":i(m))==="object"&&!m.nodeName)return{element:m,renderer:l.default.ObjectRenderer};throw new c.InvalidElementException}}function g(m){var b=document.querySelectorAll(m);if(b.length!==0){for(var v=[],_=0;_<b.length;_++)v.push(p(b[_]));return v}}function f(m){var b=document.createElement("canvas");return{element:b,options:(0,r.default)(m),renderer:l.default.CanvasRenderer,afterRender:function(){m.setAttribute("src",b.toDataURL())}}}return Ac.default=p,Ac}var Dc={},E1;function WO(){if(E1)return Dc;E1=1,Object.defineProperty(Dc,"__esModule",{value:!0});var i=(function(){function s(l,c){for(var d=0;d<c.length;d++){var p=c[d];p.enumerable=p.enumerable||!1,p.configurable=!0,"value"in p&&(p.writable=!0),Object.defineProperty(l,p.key,p)}}return function(l,c,d){return c&&s(l.prototype,c),d&&s(l,d),l}})();function t(s,l){if(!(s instanceof l))throw new TypeError("Cannot call a class as a function")}var r=(function(){function s(l){t(this,s),this.api=l}return i(s,[{key:"handleCatch",value:function(c){if(c.name==="InvalidInputException")if(this.api._options.valid!==this.api._defaults.valid)this.api._options.valid(!1);else throw c.message;else throw c;this.api.render=function(){}}},{key:"wrapBarcodeCall",value:function(c){try{var d=c.apply(void 0,arguments);return this.api._options.valid(!0),d}catch(p){return this.handleCatch(p),this.api}}}]),s})();return Dc.default=r,Dc}var $h,O1;function eA(){if(O1)return $h;O1=1;var i=GO(),t=L(i),r=du(),s=L(r),l=FO(),c=L(l),d=VO(),p=L(d),g=ZO(),f=L(g),m=lv(),b=L(m),v=WO(),_=L(v),w=fv(),S=cv(),C=L(S);function L(P){return P&&P.__esModule?P:{default:P}}var z=function(){},se=function(Y,W,X){var he=new z;if(typeof Y>"u")throw Error("No element to render on was provided.");return he._renderProperties=(0,f.default)(Y),he._encodings=[],he._options=C.default,he._errorHandler=new _.default(he),typeof W<"u"&&(X=X||{},X.format||(X.format=te()),he.options(X)[X.format](W,X).render()),he};se.getModule=function(P){return t.default[P]};for(var oe in t.default)t.default.hasOwnProperty(oe)&&M(t.default,oe);function M(P,Y){z.prototype[Y]=z.prototype[Y.toUpperCase()]=z.prototype[Y.toLowerCase()]=function(W,X){var he=this;return he._errorHandler.wrapBarcodeCall(function(){X.text=typeof X.text>"u"?void 0:""+X.text;var _e=(0,s.default)(he._options,X);_e=(0,b.default)(_e);var Te=P[Y],F=B(W,Te,_e);return he._encodings.push(F),he})}}function B(P,Y,W){P=""+P;var X=new Y(P,W);if(!X.valid())throw new w.InvalidInputException(X.constructor.name,P);var he=X.encode();he=(0,c.default)(he);for(var _e=0;_e<he.length;_e++)he[_e].options=(0,s.default)(W,he[_e].options);return he}function te(){return t.default.CODE128?"CODE128":Object.keys(t.default)[0]}z.prototype.options=function(P){return this._options=(0,s.default)(this._options,P),this},z.prototype.blank=function(P){var Y=new Array(P+1).join("0");return this._encodings.push({data:Y}),this},z.prototype.init=function(){if(this._renderProperties){Array.isArray(this._renderProperties)||(this._renderProperties=[this._renderProperties]);var P;for(var Y in this._renderProperties){P=this._renderProperties[Y];var W=(0,s.default)(this._options,P.options);W.format=="auto"&&(W.format=te()),this._errorHandler.wrapBarcodeCall(function(){var X=W.value,he=t.default[W.format.toUpperCase()],_e=B(X,he,W);K(P,_e,W)})}}},z.prototype.render=function(){if(!this._renderProperties)throw new w.NoElementException;if(Array.isArray(this._renderProperties))for(var P=0;P<this._renderProperties.length;P++)K(this._renderProperties[P],this._encodings,this._options);else K(this._renderProperties,this._encodings,this._options);return this},z.prototype._defaults=C.default;function K(P,Y,W){Y=(0,c.default)(Y);for(var X=0;X<Y.length;X++)Y[X].options=(0,s.default)(W,Y[X].options),(0,p.default)(Y[X].options);(0,p.default)(W);var he=P.renderer,_e=new he(P.element,Y,W);_e.render(),P.afterRender&&P.afterRender()}return typeof window<"u"&&(window.JsBarcode=se),typeof jQuery<"u"&&(jQuery.fn.JsBarcode=function(P,Y){var W=[];return jQuery(this).each(function(){W.push(this)}),se(W,P,Y)}),$h=se,$h}var tA=eA();const nA=H_(tA),hv={[ht.EXECUTED]:"Executed",[ht.MATCHED_LIST]:"Matched list",[ht.CONFIRM_REQUIRED]:"Awaiting confirmation",[ht.NO_MATCH_FALLBACK]:"No match",[ht.UNCONFIGURED]:"Not configured",[ht.INVALID_CODE]:"Invalid code",[ht.FORBIDDEN]:"Not permitted",[ht.CONFLICT]:"Conflict"},dv={[ht.EXECUTED]:"text-status-success",[ht.MATCHED_LIST]:"text-status-success",[ht.CONFIRM_REQUIRED]:"text-status-warning",[ht.NO_MATCH_FALLBACK]:"text-text-secondary",[ht.UNCONFIGURED]:"text-status-warning",[ht.INVALID_CODE]:"text-status-error",[ht.FORBIDDEN]:"text-status-error",[ht.CONFLICT]:"text-status-warning"};function ri(i){return i.replace(/`([^`]+)`/g,'<code class="px-1 py-0.5 bg-surface-sunken rounded text-xs font-mono">$1</code>').replace(/\*\*\*(.+?)\*\*\*/g,"<strong><em>$1</em></strong>").replace(/\*\*(.+?)\*\*/g,"<strong>$1</strong>").replace(/\*(.+?)\*/g,"<em>$1</em>").replace(/\[([^\]]+)\]\(([^)]+)\)/g,'<a href="$2" class="text-accent-primary hover:underline" target="_blank" rel="noopener noreferrer">$1</a>')}function mv({content:i,compact:t}){const r=[],s=/^```(\w*)\n([\s\S]*?)^```$/gm;let l=0,c;for(;(c=s.exec(i))!==null;)c.index>l&&r.push({type:"text",text:i.slice(l,c.index)}),r.push({type:"code",lang:c[1],code:c[2].replace(/\n$/,"")}),l=c.index+c[0].length;l<i.length&&r.push({type:"text",text:i.slice(l)});const d=t?{text:"text-xs",heading:"text-xs",list:"text-xs",code:"text-2xs"}:{text:"text-sm",heading:"text-sm",list:"text-sm",code:"text-xs"},p=[];for(const g of r){if(g.type==="code"){const f=g.code.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">");p.push(`<pre class="my-2 p-2.5 bg-surface-sunken rounded-md overflow-x-auto"><code class="${d.code} font-mono text-text-secondary leading-relaxed">${f}</code></pre>`);continue}p.push(...rA(g.text,d))}return y.jsx("div",{className:"prose-sm",dangerouslySetInnerHTML:{__html:p.join(`
|
|
54
|
+
`)}})}function rA(i,t){const r=i.split(`
|
|
55
|
+
`),s=[];let l=!1,c=!1,d=[];for(const p of r){const g=p.trim();if(g.startsWith("|")&&g.endsWith("|")){const f=g.slice(1,-1).split("|").map(m=>m.trim());if(f.every(m=>/^[-:]+$/.test(m)))continue;c||(c=!0,d=[]),d.push(f);continue}if(c){c=!1;const[f,...m]=d;s.push('<div class="overflow-x-auto my-2"><table class="text-xs w-full"><thead><tr>');for(const b of f)s.push(`<th class="text-left py-1 px-2 border-b border-border text-text-secondary font-medium">${ri(b)}</th>`);s.push("</tr></thead><tbody>");for(const b of m){s.push("<tr>");for(const v of b)s.push(`<td class="py-1 px-2 border-b border-border/50">${ri(v)}</td>`);s.push("</tr>")}s.push("</tbody></table></div>"),d=[]}if(!g){l&&(s.push("</ul>"),l=!1);continue}if(g.startsWith("### ")){l&&(s.push("</ul>"),l=!1),s.push(`<h4 class="${t.heading} font-semibold text-text-primary mt-3 mb-1">${ri(g.slice(4))}</h4>`);continue}if(g.startsWith("## ")){l&&(s.push("</ul>"),l=!1),s.push(`<h3 class="${t.heading} font-semibold text-text-primary mt-3 mb-1">${ri(g.slice(3))}</h3>`);continue}if(/^[-*_]{3,}$/.test(g)){l&&(s.push("</ul>"),l=!1),s.push('<hr class="border-border my-3" />');continue}if(/^[-*] /.test(g)){l||(s.push('<ul class="space-y-1 my-1">'),l=!0),s.push(`<li class="${t.list} text-text-secondary flex gap-2"><span class="text-text-tertiary shrink-0">-</span><span>${ri(g.slice(2))}</span></li>`);continue}l&&(s.push("</ul>"),l=!1),s.push(`<p class="${t.text} text-text-secondary my-1">${ri(g)}</p>`)}if(c&&d.length){const[p,...g]=d;s.push('<div class="overflow-x-auto my-2"><table class="text-xs w-full"><thead><tr>');for(const f of p)s.push(`<th class="text-left py-1 px-2 border-b border-border text-text-secondary font-medium">${ri(f)}</th>`);s.push("</tr></thead><tbody>");for(const f of g){s.push("<tr>");for(const m of f)s.push(`<td class="py-1 px-2 border-b border-border/50">${ri(m)}</td>`);s.push("</tr>")}s.push("</tbody></table></div>")}return l&&s.push("</ul>"),s}function iA(i){return i.replace(/[\u2010-\u2015\u2212]/g,"-").replace(/[\u2018\u2019]/g,"'").replace(/[\u201C\u201D]/g,'"').replace(/\u00A0/g," ").replace(/[\u200B-\u200D\uFEFF]/g,"").replace(/[\x00-\x1F\x7F]/g,"").trim()}function sA(i){const t=new Set;for(const r of i){const s=r.codePointAt(0);(s>127||s<32)&&t.add(`"${s<32?"\\x"+s.toString(16).padStart(2,"0"):r}" U+${s.toString(16).toUpperCase().padStart(4,"0")}`)}return[...t]}function aA({value:i}){const t=T.useRef(null),[r,s]=T.useState(!1);return T.useEffect(()=>{if(!(!t.current||!i))try{nA(t.current,i,{format:"CODE128",width:2,height:88,margin:12,displayValue:!0,fontSize:13,background:"#ffffff",lineColor:"#000000"}),s(!1)}catch{s(!0)}},[i]),i?y.jsxs("div",{children:[y.jsx("span",{className:"block text-xs uppercase tracking-wide text-text-tertiary mb-1",children:"Barcode"}),r?y.jsxs("p",{className:"text-xs text-status-error",children:["This value has characters Code 128 cannot carry:"," ",y.jsx("span",{className:"font-mono",children:sA(i).join(", ")||"unknown"})]}):y.jsx("div",{className:"bg-white rounded p-1 inline-block max-w-full overflow-hidden",children:y.jsx("svg",{ref:t,className:"max-w-full"})})]}):null}function oA({onClose:i}){var S;const{submitCode:t,lastResult:r,busy:s,wedgeConfig:l,updateWedgeConfig:c,diagnostics:d,diagnosticsOn:p,setDiagnosticsOn:g}=rv(),[f,m]=T.useState(""),[b,v]=T.useState(!1),_=C=>{C.preventDefault();const L=f.trim();L&&(m(""),t(L))},w=(r==null?void 0:r.response)??null;return y.jsxs("div",{className:"flex flex-col h-full",children:[y.jsxs("div",{className:"flex items-center justify-between px-4 py-3 border-b border-surface-border",children:[y.jsxs("div",{className:"flex items-center gap-2 text-sm font-medium text-text-primary",children:[y.jsx(iu,{className:"w-4 h-4"}),"Scan"]}),y.jsx("button",{type:"button",onClick:i,className:"text-text-tertiary hover:text-text-primary",title:"Close",children:y.jsx(Cn,{className:"w-4 h-4"})})]}),y.jsxs("div",{className:"flex-1 overflow-y-auto px-4 py-4 space-y-6",children:[y.jsxs("form",{onSubmit:_,className:"space-y-2",children:[y.jsx("label",{className:"block text-xs uppercase tracking-wide text-text-tertiary",children:"Enter a code"}),y.jsxs("div",{className:"flex gap-2",children:[y.jsx("input",{value:f,onChange:C=>m(iA(C.target.value)),placeholder:"10:1:SN-12345",className:"flex-1 px-2 py-1.5 text-sm bg-surface-raised border border-surface-border rounded text-text-primary","data-scan-manual-entry":!0}),y.jsx("button",{type:"submit",disabled:s||!f.trim(),className:"px-3 py-1.5 text-sm rounded bg-accent text-text-inverse disabled:opacity-50",children:"Go"})]}),y.jsx("p",{className:"text-xs text-text-tertiary",children:"Scanning with a connected scanner works from any page — this entry exists for testing and for codes you can read but not scan. Typing here also draws the code below; point the scanner at the screen to fire it for real."})]}),y.jsx(aA,{value:f.trim()}),r&&y.jsxs("div",{className:"space-y-2",children:[y.jsx("div",{className:"text-xs uppercase tracking-wide text-text-tertiary",children:"Last scan"}),y.jsx("div",{className:"text-sm font-mono text-text-primary",children:r.code}),w?y.jsxs(y.Fragment,{children:[y.jsxs("div",{className:`text-sm font-medium ${dv[w.outcome]}`,children:[hv[w.outcome],w.rule?` — ${w.rule.name}`:""]}),w.error&&y.jsx("div",{className:"text-xs text-text-tertiary",children:w.error}),w.outcome===ht.NO_MATCH_FALLBACK&&((S=w.fallback)==null?void 0:S.markdown)&&y.jsx("div",{className:"text-sm border-t border-surface-border pt-2",children:y.jsx(mv,{content:w.fallback.markdown,compact:!0})})]}):y.jsx("div",{className:"text-sm text-status-error",children:r.error})]}),y.jsxs("div",{className:"space-y-2",children:[y.jsxs("button",{type:"button",onClick:()=>v(C=>!C),className:"text-xs uppercase tracking-wide text-text-tertiary hover:text-text-primary",children:["Capture settings ",b?"▾":"▸"]}),b&&y.jsxs("div",{className:"space-y-3",children:[y.jsxs("label",{className:"block text-sm text-text-primary",children:[y.jsx("span",{className:"block text-xs text-text-tertiary mb-1",children:"Key gap limit (ms) — a longer pause between keys starts a new capture; raise it for scanners that pace slowly"}),y.jsx("input",{type:"number",min:100,max:2e3,step:50,value:l.maxKeyGapMs,onChange:C=>c({maxKeyGapMs:Number(C.target.value)}),className:"w-24 px-2 py-1 text-sm bg-surface-raised border border-surface-border rounded"})]}),y.jsxs("label",{className:"flex items-center gap-2 text-sm text-text-primary",children:[y.jsx("input",{type:"checkbox",checked:p,onChange:C=>g(C.target.checked)}),y.jsx("span",{children:"Diagnostics — trace every keydown the capture sees (also logged to the console)"})]}),p&&y.jsxs("div",{className:"border border-surface-border rounded",children:[y.jsx("div",{className:"px-2 py-1.5 text-2xs uppercase tracking-wide text-text-tertiary border-b border-surface-border",children:"Keydown trace — scan now, newest last"}),y.jsxs("div",{className:"max-h-64 overflow-y-auto font-mono text-2xs leading-5 px-2 py-1",children:[d.length===0&&y.jsx("div",{className:"text-text-tertiary",children:"Waiting for keys…"}),d.map(C=>y.jsxs("div",{className:"whitespace-nowrap overflow-hidden text-ellipsis",title:`buffer: ${C.buffer}`,children:[y.jsxs("span",{className:"text-text-tertiary",children:[String(C.deltaMs).padStart(4),"ms "]}),y.jsx("span",{className:"text",children:JSON.stringify(C.key)}),C.code&&y.jsxs("span",{className:"text-text-tertiary",children:[" (",C.code,")"]}),y.jsxs("span",{className:"text-text-tertiary",children:[" — ",C.note]})]},C.seq))]}),y.jsxs("div",{className:"px-2 py-1.5 text-2xs text-text-tertiary border-t border-surface-border",children:["Read it like this: a scan should end with an"," ",y.jsx("span",{className:"font-mono",children:'"Enter"'})," row saying"," ",y.jsx("span",{className:"font-mono",children:"capture → …"}),'. An Enter row saying "no code tail" means the buffer split (raise the gap limit, or a key arrived as something other than one character). No Enter row at all means the scanner sends no suffix — program its Enter/CR suffix. Keys named'," ",y.jsx("span",{className:"font-mono",children:'"Unidentified"'})," mean the decode arrives outside the keydown path."]})]})]})]})]})]})}const pv="lt:bookmarks",qc="scan";function lA(){try{const i=localStorage.getItem(pv);if(!i)return[];const t=JSON.parse(i);return Array.isArray(t)?t:[]}catch{return[]}}function A1(i){try{localStorage.setItem(pv,JSON.stringify(i))}catch{}}function cA({onToggleEventFeed:i,onToggleDocs:t,onToggleNav:r}){var de,Oe;const s=yo(),{user:l,logout:c}=pn(),{viewAs:d,realIsBuilder:p}=Pb(),{available:g,mine:f}=WE();$b();const{connected:m}=L2(),{data:b}=Or(),{setPanel:v,closePanel:_,open:w,ownerKey:S}=Fd(),C=tv(),L=mn(),z=()=>{w&&S===qc?_(qc):v(y.jsx(oA,{onClose:()=>_(qc)}),{width:360,key:qc})},[se,oe]=T.useState(!1),[M,B]=T.useState(!1),[te,K]=T.useState(Jb),[P,Y]=T.useState(lA),W=T.useRef(null),X=(de=b==null?void 0:b.branding)==null?void 0:de.appName,he=(Oe=b==null?void 0:b.branding)==null?void 0:Oe.themes,_e=T.useMemo(()=>(iO(he??[]),sO()),[he]),Te=le=>{aO(le),K(le)},F=()=>{const le=window.prompt("Bookmark label:");if(!(le!=null&&le.trim()))return;const we=L.pathname+L.search,Se=[...P,{label:le.trim(),url:we}].sort((Ne,be)=>Ne.label.localeCompare(be.label));Y(Se),A1(Se),oe(!1)},ae=le=>{const we=P.filter(Se=>!(Se.label===le.label&&Se.url===le.url));Y(we),A1(we)};return T.useEffect(()=>{if(!se)return;const le=we=>{W.current&&!W.current.contains(we.target)&&oe(!1)};return document.addEventListener("mousedown",le),()=>document.removeEventListener("mousedown",le)},[se]),y.jsxs(y.Fragment,{children:[y.jsxs("header",{className:`h-14 shrink-0 border-b border-surface-border bg-surface-raised flex items-center justify-between pl-2 pr-5 relative ${se?"z-[100]":"z-30"}`,children:[y.jsxs("div",{className:"flex items-center gap-1 min-w-0",children:[r&&y.jsx("button",{onClick:r,className:"lg:hidden p-2 text-text-secondary hover:text-text-primary transition-colors","aria-label":"Open navigation",children:y.jsx(Q_,{className:"w-5 h-5",strokeWidth:1.5})}),y.jsxs($i,{to:"/","aria-label":"Home",className:"shrink-0",onClick:le=>{(le.ctrlKey||le.metaKey)&&(le.preventDefault(),B(!0))},children:[y.jsx(eu,{appName:X,className:"hidden lg:flex"}),y.jsx(eu,{appName:X,variant:"comet",className:"flex lg:hidden"})]}),y.jsx("div",{className:"hidden lg:block w-px h-4 bg-surface-border mx-1"}),y.jsx("button",{onClick:()=>s(-1),className:"p-2 text-accent/60 hover:text-accent transition-colors","aria-label":"Go back",children:y.jsx(Q1,{className:"w-5 h-5",strokeWidth:2})}),y.jsx("button",{onClick:()=>s(1),className:"p-2 text-accent/60 hover:text-accent transition-colors","aria-label":"Go forward",children:y.jsx(Fh,{className:"w-5 h-5",strokeWidth:2})})]}),y.jsxs("div",{className:"flex items-center gap-5",children:[y.jsxs($i,{to:"/escalations/available",className:`flex items-center gap-1.5 text-xs transition-colors ${g>0?"text-status-queued":"text-text-quaternary hover:text-text-secondary"}`,title:"All escalations",children:[y.jsx(Vh,{className:"w-4 h-4",strokeWidth:1.5}),y.jsx("span",{className:"hidden lg:inline",children:"all"}),g>0&&y.jsx("sup",{className:"tabular-nums font-medium text-[0.5em]",children:g})]}),y.jsxs($i,{to:"/escalations/queue",className:`flex items-center gap-1.5 text-xs transition-colors ${f>0?"text-status-claimed":"text-text-quaternary hover:text-text-secondary"}`,title:"My escalation queue",children:[y.jsx(Vh,{className:"w-4 h-4",strokeWidth:1.5}),y.jsx("span",{className:"hidden lg:inline",children:"mine"}),f>0&&y.jsx("sup",{className:"tabular-nums font-medium text-[0.5em]",children:f})]}),y.jsx("div",{className:"hidden lg:block w-px h-4 bg-surface-border"}),C&&y.jsxs("button",{type:"button",onClick:z,className:"flex items-center gap-1.5 text-xs text-text-quaternary hover:text-text-secondary transition-colors",title:"Scan a code",children:[y.jsx(iu,{className:"w-4 h-4",strokeWidth:1.5}),y.jsx("span",{className:"hidden lg:inline",children:"scan"})]}),y.jsxs("button",{type:"button",onClick:()=>{m?i==null||i():window.location.reload()},className:`hidden lg:flex items-center gap-1.5 text-xs transition-colors ${m?"text-status-success hover:text-status-success/80":"text-text-quaternary hover:text-text-secondary"}`,title:m?"Live events — click to toggle feed":"Events disconnected — click to reconnect",children:[y.jsx(Z1,{className:"w-4 h-4",strokeWidth:1.5}),"events"]}),p&&y.jsx(y.Fragment,{children:y.jsxs("button",{onClick:t,className:"hidden lg:flex items-center gap-1.5 text-xs text-text-quaternary hover:text-text-secondary transition-colors",title:"Documentation",children:[y.jsx(W1,{className:"w-4 h-4",strokeWidth:1.5}),"docs"]})}),d&&y.jsx(y.Fragment,{children:y.jsxs("span",{className:"hidden lg:flex items-center gap-1 pl-2 pr-1 py-0.5 rounded-full bg-accent/10 border border-accent/25 text-2xs text-accent select-none",children:[y.jsxs("span",{className:"capitalize font-medium tracking-wide",children:[d," View"]}),y.jsx("button",{onClick:yd,title:"Restore your real view",className:"ml-0.5 rounded-full p-0.5 hover:bg-accent/20 transition-colors",children:y.jsx(Cn,{className:"w-2.5 h-2.5"})})]})}),y.jsx("div",{className:"hidden lg:block w-px h-4 bg-surface-border"}),l&&y.jsxs("div",{className:"relative",ref:W,children:[y.jsxs("button",{onClick:()=>oe(le=>!le),className:"btn-ghost flex items-center gap-1",children:[y.jsxs("span",{className:"relative",children:[y.jsx(Z_,{className:"w-4 h-4 text-accent/75",strokeWidth:1.5}),d&&y.jsx("span",{className:"lg:hidden absolute -top-0.5 -right-0.5 w-2 h-2 rounded-full bg-accent"})]}),y.jsx("span",{className:"hidden lg:inline whitespace-nowrap",children:l.displayName||l.username||l.userId}),y.jsx("svg",{className:"hidden lg:block w-3 h-3",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:y.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M19 9l-7 7-7-7"})})]}),se&&y.jsxs("div",{className:"absolute right-0 top-full mt-1 w-52 bg-surface-raised border border-surface-border rounded-md shadow-lg py-1 z-[100]",children:[y.jsx($i,{to:"/credentials",onClick:()=>oe(!1),className:"block px-3 py-2 text-xs text-text-secondary hover:bg-surface-hover",children:"Credentials"}),y.jsx("button",{onClick:()=>{oe(!1),m?i==null||i():window.location.reload()},className:"lg:hidden block w-full text-left px-3 py-2 text-xs text-text-secondary hover:bg-surface-hover",children:m?"Events":"Reconnect events"}),p&&y.jsx("button",{onClick:()=>{oe(!1),t==null||t()},className:"lg:hidden block w-full text-left px-3 py-2 text-xs text-text-secondary hover:bg-surface-hover",children:"Docs"}),d&&y.jsxs("button",{onClick:()=>{oe(!1),yd()},className:"lg:hidden block w-full text-left px-3 py-2 text-xs text-accent hover:bg-surface-hover capitalize",children:["Exit ",d," view"]}),y.jsxs("div",{className:"px-3 py-2 border-t border-surface-border/60",children:[y.jsx("p",{className:"text-2xs font-medium uppercase tracking-widest text-text-tertiary mb-1.5",children:"Theme"}),y.jsx("div",{className:"flex items-center gap-2 flex-wrap",children:_e.map(le=>y.jsx("button",{type:"button",onClick:()=>Te(le.id),title:le.label,"aria-label":`${le.label} theme`,className:`w-4 h-4 rounded-full transition-transform hover:scale-110 ${te===le.id?"ring-2 ring-offset-1 ring-surface-border":""}`,style:{backgroundColor:le.swatch}},le.id))})]}),y.jsx("button",{onClick:()=>{oe(!1),c()},className:"block w-full text-left px-3 py-2 text-xs text-text-secondary hover:bg-surface-hover",children:"Sign Out"}),y.jsxs("div",{className:"border-t border-surface-border/60 pt-1",children:[P.map(le=>y.jsxs("div",{className:"flex items-center group px-3 py-1.5 hover:bg-surface-hover",children:[y.jsx($i,{to:le.url,onClick:()=>oe(!1),title:le.url,className:"flex-1 min-w-0 text-xs text-text-secondary hover:text-text-primary truncate",children:le.label}),y.jsx("button",{type:"button",onClick:()=>ae(le),title:`Remove "${le.label}"`,className:"opacity-0 group-hover:opacity-100 transition-opacity ml-1 p-0.5 shrink-0 text-text-quaternary hover:text-status-error",children:y.jsx(Cn,{className:"w-3 h-3"})})]},`${le.label}::${le.url}`)),y.jsx("hr",{className:"border-surface-border/60 mx-3 my-0.5"}),y.jsxs("button",{type:"button",onClick:F,className:"flex items-center gap-1.5 w-full px-3 py-2 text-xs text-text-secondary hover:bg-surface-hover",children:[y.jsx(W_,{className:"w-3.5 h-3.5 shrink-0",strokeWidth:1.5}),"Add Bookmark"]})]})]})]})]})]}),M&&y.jsx(rO,{onClose:()=>B(!1)})]})}function Vd({open:i,children:t}){const[r,s]=T.useState(i);return T.useEffect(()=>{i&&s(!0)},[i]),y.jsx("div",{className:`grid transition-[grid-template-rows] duration-300 ease-out ${i?"grid-rows-[1fr]":"grid-rows-[0fr]"}`,onTransitionEnd:()=>{i||s(!1)},children:y.jsx("div",{className:"overflow-hidden",children:r?t:null})})}function vd(i){return({isActive:t})=>{const r="flex items-center rounded-md transition-colors duration-150",s="bg-surface-hover text-text-primary font-medium",l="text-text-secondary hover:text-text-primary hover:bg-surface-hover";return i?`${r} justify-center w-10 h-10 mx-auto ${t?s:l}`:`${r} gap-3 px-4 py-2 text-sm ${t?s:l}`}}function uA(){return({isActive:i})=>`flex items-center gap-3 pl-11 pr-4 py-1.5 text-xs rounded-md transition-colors duration-150 ${i?"text-text-primary font-medium":"text-text-secondary hover:text-text-primary"}`}function fA({group:i,collapsed:t}){const{pathname:r}=mn(),s=i.matchPaths.some(p=>r.startsWith(p)),[l,c]=T.useState(s),d=l||s;return t?y.jsx(y.Fragment,{children:i.items.map(p=>y.jsx(Hs,{to:p.to,className:vd(!0),title:p.label,children:p.icon&&y.jsx(p.icon,{className:"w-5 h-5 shrink-0 text-accent/75",strokeWidth:1.5})},p.to))}):y.jsxs("div",{children:[y.jsxs("button",{onClick:()=>c(p=>!p),className:"w-full flex items-center justify-between px-4 py-2 text-sm rounded-md transition-colors duration-150 text-text-secondary hover:text-text-primary hover:bg-surface-hover",children:[y.jsxs("span",{className:"flex items-center gap-3",children:[i.icon&&y.jsx(i.icon,{className:"w-5 h-5 shrink-0 text-accent/75",strokeWidth:1.5}),y.jsx("span",{children:i.label})]}),y.jsx("svg",{className:`w-3.5 h-3.5 text-text-tertiary transition-transform duration-150 ${d?"rotate-90":""}`,fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:y.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9 5l7 7-7 7"})})]}),y.jsx(Vd,{open:d,children:i.items.map(p=>y.jsxs(Hs,{to:p.to,end:p.end,className:uA(),children:[p.icon&&y.jsx(p.icon,{className:"w-4 h-4 shrink-0 text-accent/75",strokeWidth:1.5}),y.jsx("span",{children:p.label})]},p.to))})]})}function hA(i){return i.kind==="group"}function dA({entry:i,collapsed:t}){const{pathname:r,search:s}=mn(),l=i.to.includes("?"),c=i.icon&&y.jsx(i.icon,{className:`w-5 h-5 shrink-0 text-accent/75 ${i.iconClassName??""}`,strokeWidth:1.5,...i.solid?{fill:"currentColor"}:{}});if(l){const[d,p]=i.to.split("?"),g=r===d&&s===`?${p}`,f=vd(t)({isActive:g});return y.jsxs(Hs,{to:i.to,className:f,title:t?i.label:void 0,children:[c,!t&&y.jsx("span",{children:i.label})]})}return y.jsxs(Hs,{to:i.to,end:i.end,className:vd(t),title:t?i.label:void 0,children:[c,!t&&y.jsx("span",{children:i.label})]})}function ui({heading:i,entries:t}){const{collapsed:r}=Hd();return y.jsxs("div",{className:"space-y-1",children:[r?y.jsx("div",{className:"h-px bg-surface-border mx-3 my-2",title:i}):y.jsx("p",{className:"px-4 pt-5 pb-2 text-xs font-semibold uppercase tracking-wider text-text-tertiary",children:i}),t.map(s=>hA(s)?y.jsx(fA,{group:s,collapsed:r},s.label):y.jsx(dA,{entry:s,collapsed:r},s.to))]})}function mA({aiEnabled:i=!1,isBuilder:t=!1,isOps:r=!1,viewAs:s=null,canSeePaceBoard:l=!1}){const c={to:"/operations",label:"Pace Board",icon:ew};if(!t&&(!r||s==="engineer"||s==="operator"))return l?y.jsx(ui,{heading:"Monitor",entries:[c]}):null;if(!t)return y.jsx(ui,{heading:"Monitor",entries:l?[c]:[]});const d=[...l?[c]:[],{to:"/topics",label:"Event Topics",icon:Z1},{to:"/agents",label:i?"Agents":"Automations",icon:tw},{to:"/capabilities",label:"Capabilities",icon:nw}];return y.jsx(ui,{heading:"Monitor",entries:d})}function xN(){return ot({queryKey:["roles"],queryFn:()=>Ee("/roles")})}function _N(){return ot({queryKey:["roles","escalation-chains"],queryFn:()=>Ee("/roles/escalation-chains")})}function wN(i){return ot({queryKey:["roles",i,"escalation-targets"],queryFn:()=>Ee(`/roles/${encodeURIComponent(i)}/escalation-targets`),enabled:!!i})}function SN(){const i=st();return dt({mutationFn:t=>Ee("/roles/escalation-chains",{method:"POST",body:JSON.stringify(t)}),onSuccess:()=>{i.invalidateQueries({queryKey:["roles"]})}})}function EN(){const i=st();return dt({mutationFn:t=>Ee("/roles/escalation-chains",{method:"DELETE",body:JSON.stringify(t)}),onSuccess:()=>{i.invalidateQueries({queryKey:["roles"]})}})}function pA(i){return ot({queryKey:["roles","details"],queryFn:()=>Ee("/roles/details"),enabled:(i==null?void 0:i.enabled)??!0})}function ON(i,t,r=!0){return ot({queryKey:["roles",i,"schema",t??"latest"],queryFn:()=>Ee(`/roles/${encodeURIComponent(i)}/schema${t!=null?`?version=${t}`:""}`),enabled:r&&!!i})}function AN(i){return ot({queryKey:["roles",i,"schema-versions"],queryFn:()=>Ee(`/roles/${encodeURIComponent(i)}/schema/versions`),enabled:!!i})}function jN(i,t,r=!0){return ot({queryKey:["roles",i,"list-schema",t??"latest"],queryFn:()=>Ee(`/roles/${encodeURIComponent(i)}/list-schema${t!=null?`?version=${t}`:""}`),enabled:r&&!!i})}function TN(i){return ot({queryKey:["roles",i,"list-schema-versions"],queryFn:()=>Ee(`/roles/${encodeURIComponent(i)}/list-schema/versions`),enabled:!!i})}function NN(){const i=st();return dt({mutationFn:t=>Ee("/roles",{method:"POST",body:JSON.stringify({role:t})}),onSuccess:()=>{i.invalidateQueries({queryKey:["roles"]})}})}function kN(){const i=st();return dt({mutationFn:({role:t,...r})=>Ee(`/roles/${encodeURIComponent(t)}`,{method:"PATCH",body:JSON.stringify(r)}),onMutate:async({role:t,...r})=>{await i.cancelQueries({queryKey:["roles","details"]});const s=i.getQueryData(["roles","details"]);return s&&i.setQueryData(["roles","details"],{roles:s.roles.map(l=>l.role===t?{...l,...r}:l)}),{previous:s}},onError:(t,r,s)=>{s!=null&&s.previous&&i.setQueryData(["roles","details"],s.previous)},onSuccess:()=>{i.invalidateQueries({queryKey:["roles"]})}})}function CN(){const i=st();return dt({mutationFn:t=>Ee(`/roles/${encodeURIComponent(t)}`,{method:"DELETE"}),onSuccess:()=>{i.invalidateQueries({queryKey:["roles"]})}})}function yA(){return ot({queryKey:["me","preferences"],queryFn:()=>Ee("/me/preferences"),staleTime:6e4})}function gA(){const i=st();return dt({mutationFn:t=>Ee("/me/preferences",{method:"PATCH",body:JSON.stringify(t)}),onSuccess:t=>{i.setQueryData(["me","preferences"],t)}})}function bA(i){return i.replace(/([a-z0-9])([A-Z])/g,"$1 $2").replace(/([A-Z]+)([A-Z][a-z])/g,"$1 $2").split(/[-_\s]+/).filter(Boolean).map(t=>t.charAt(0).toUpperCase()+t.slice(1)).join(" ")}function vA(i){var t;return((t=i.title)==null?void 0:t.trim())||bA(i.role)}function xA(i,t){const r=(i==null?void 0:i.pinnedViews)??[],s=new Set((i==null?void 0:i.hiddenRolePins)??[]),l=new Set(r.map(p=>p.label)),c=[...r],d=new Set;for(const{role:p,pins:g}of t)for(const f of g)l.has(f.label)||s.has(f.label)||d.has(f.label)||(d.add(f.label),c.push({...f,id:`role:${p}:${f.label}`,fromRole:p}));return c}function _A(i){let t;try{t=new URL(i,"http://local")}catch{return null}if(t.pathname!=="/escalations/available"&&t.pathname!=="/escalations")return null;const r=t.searchParams,s=mO(r),l=r.get("status")||void 0,c=t.pathname==="/escalations/available"&&(l===void 0||l==="available");return{available:c,params:{...s,role:r.get("role")||void 0,type:r.get("type")||void 0,priority:r.get("priority")?parseInt(r.get("priority"),10):void 0,status:c||l==="all"?void 0:l,search:r.get("search")||void 0}}}function wA(){return`pin-${Date.now().toString(36)}-${Math.random().toString(36).slice(2,8)}`}function SA(){var M;const{collapsed:i}=Hd(),{user:t}=pn(),r=yA(),s=gA(),l=T.useMemo(()=>new Set(((t==null?void 0:t.roles)??[]).map(B=>B.role)),[t]),{data:c}=pA({enabled:l.size>0}),d=st();Cd($d(),()=>{d.invalidateQueries({queryKey:["escalations"]})});const p=(M=r.data)==null?void 0:M.preferences,g=T.useMemo(()=>((c==null?void 0:c.roles)??[]).filter(B=>l.has(B.role)&&Array.isArray(B.default_pins)&&B.default_pins.length>0).map(B=>({role:B.role,pins:B.default_pins})),[c,l]),f=T.useMemo(()=>xA(p,g),[p,g]),m=T.useMemo(()=>new Map(((c==null?void 0:c.roles)??[]).map(B=>[B.role,vA(B)])),[c]),b=T.useMemo(()=>f.filter(B=>!B.fromRole),[f]),v=T.useMemo(()=>g.map(({role:B})=>({role:B,title:m.get(B)??B,pins:f.filter(te=>te.fromRole===B)})).filter(B=>B.pins.length>0),[g,m,f]),_=(p==null?void 0:p.pinnedViews)??[],w=T.useRef(null),S=B=>s.mutate({pinnedViews:B}),C=B=>S(_.filter(te=>te.id!==B)),L=B=>S([..._,{id:wA(),label:B.label,url:B.url,badge:B.badge}]),z=B=>s.mutate({hiddenRolePins:[...(p==null?void 0:p.hiddenRolePins)??[],B]}),se=(B,te)=>{if(B===te)return;const K=[..._],[P]=K.splice(B,1);K.splice(te,0,P),S(K)};if(f.length===0)return null;const oe="px-4 pt-5 pb-2 text-xs font-semibold uppercase tracking-wider text-text-tertiary truncate";return y.jsxs("div",{className:"space-y-1",children:[i&&y.jsx("div",{className:"h-px bg-surface-border mx-3 my-2",title:"Pinned"}),!i&&b.length>0&&y.jsx("p",{className:oe,children:"Pinned"}),b.map(B=>{const te=_.findIndex(K=>K.id===B.id);return y.jsx(j1,{pin:B,collapsed:i,draggable:te!==-1,onDragStart:()=>{w.current=te},onDropOn:()=>{w.current!==null&&te!==-1&&se(w.current,te),w.current=null},onRemove:()=>C(B.id)},B.id)}),v.map(B=>y.jsxs("div",{children:[!i&&y.jsx("p",{className:oe,title:`${B.title} — pins from the ${B.role} role`,"data-testid":"pin-group-label",children:B.title}),B.pins.map(te=>y.jsx(j1,{pin:te,collapsed:i,draggable:!1,onDragStart:()=>{},onDropOn:()=>{},onPromote:()=>L(te),onHide:()=>z(te.label)},te.id))]},B.role))]})}function j1({pin:i,collapsed:t,draggable:r,onDragStart:s,onDropOn:l,onRemove:c,onPromote:d,onHide:p}){const{pathname:g,search:f}=mn(),[m,b=""]=i.url.split("?"),v=g===m&&f===(b?`?${b}`:""),_="group flex items-center rounded-md transition-colors duration-150",w=v?"bg-surface-hover text-text-primary font-medium":"text-text-secondary hover:text-text-primary hover:bg-surface-hover";return t?y.jsx(Hs,{to:i.url,className:`${_} ${w} justify-center w-10 h-10 mx-auto`,title:i.label,children:y.jsx(qy,{className:"w-5 h-5 shrink-0 text-accent/75",strokeWidth:1.5})}):y.jsxs("div",{className:`${_} ${w} relative`,draggable:r,onDragStart:s,onDragOver:S=>S.preventDefault(),onDrop:l,children:[y.jsxs(Hs,{to:i.url,title:i.label,className:"flex items-center gap-2.5 pl-4 pr-3 py-1.5 text-[0.7875rem] flex-1 min-w-0",children:[y.jsx(qy,{className:"w-4 h-4 shrink-0 text-accent/75",strokeWidth:1.5,...i.fromRole?{}:{fill:"currentColor",fillOpacity:.15}}),y.jsx("span",{className:"truncate flex-1 min-w-0",children:i.label}),i.badge&&y.jsx(EA,{url:i.url})]}),y.jsxs("span",{className:"absolute right-1 top-1/2 -translate-y-1/2 flex items-center gap-0.5 rounded px-0.5 bg-surface-hover opacity-0 pointer-events-none group-hover:opacity-100 group-hover:pointer-events-auto transition-opacity",children:[d&&y.jsx("button",{onClick:d,title:"Make mine — copy into my pins",className:"p-1 text-text-quaternary hover:text-accent transition-colors",children:y.jsx(eb,{className:"w-3 h-3"})}),p&&y.jsx("button",{onClick:p,title:"Hide this role pin",className:"p-1 text-text-quaternary hover:text-status-error transition-colors",children:y.jsx(rw,{className:"w-3 h-3"})}),c&&y.jsx("button",{onClick:c,title:`Remove "${i.label}"`,className:"p-1 text-text-quaternary hover:text-status-error transition-colors",children:y.jsx(Cn,{className:"w-3 h-3"})})]})]})}function EA({url:i}){var d;const t=T.useMemo(()=>_A(i),[i]),r={limit:1,staleTime:15e3},s=Vb({...(t==null?void 0:t.params)??{},...r,enabled:!!t&&t.available}),l=Fb({...(t==null?void 0:t.params)??{},...r,enabled:!!t&&!t.available});if(!t)return null;const c=t.available?s:l;return c.isError||((d=c.data)==null?void 0:d.total)===void 0?null:y.jsx("span",{className:"shrink-0 text-right text-2xs leading-none tabular-nums text-accent/80 relative -top-[0.35em]",title:`${c.data.total} matching now`,children:c.data.total})}function OA(){var c;const{data:i}=Or(),t=(c=i==null?void 0:i.features)==null?void 0:c.graphWorkflows,r=t===!0||t!==!1&&zb(),s=[{to:"/workflows/registry",label:"Registry",icon:By},{to:"/workflows/durable/invoke",label:"Invoke",icon:Ly},{to:"/workflows/executions",label:"Executions",icon:zy}],l=r?[{kind:"group",label:"Procedural",icon:iw,matchPaths:["/workflows/registry","/workflows/durable/invoke","/workflows/executions","/workflows/durable/executions","/workflows/start","/workflows/workers","/workflows/tasks"],items:s},{kind:"group",label:"Graph",icon:xd,matchPaths:["/mcp/workflows","/mcp/executions"],items:[{to:"/mcp/workflows",label:"Configure",icon:By,end:!0},{to:"/mcp/workflows/invoke",label:"Invoke",icon:Ly},{to:"/mcp/executions",label:"Executions",icon:zy}]}]:s;return y.jsx(ui,{heading:"Orchestrate",entries:l})}const AA=[{to:"/mcp/queries",label:"Designer",icon:sw},{to:"/mcp/servers",label:"Servers & Tools",icon:aw}];function jA(){return y.jsx(ui,{heading:"Design",entries:AA})}const TA=[{to:"/files",label:"Files",icon:ow},{to:"/knowledge",label:"Knowledge",icon:lw}];function NA(){return y.jsx(ui,{heading:"Storage",entries:TA})}function kA({isBuilder:i=!1,isOps:t=!1}){var d;const{data:r}=Or(),s=((d=r==null?void 0:r.features)==null?void 0:d.dbMaintenance)!==!1,l=[{to:"/admin/users",label:"Accounts",icon:cw},...i||t?[{to:"/admin/roles",label:"Roles",icon:Vh},{to:"/admin/personas",label:"Personas",icon:uw},{to:"/admin/scan-codes",label:"Scan Codes",icon:iu}]:[]],c=[{to:"/admin/controlplane",label:"Routers",icon:fw},{to:"/admin/streams",label:"Messages",icon:hw},...s?[{to:"/admin/maintenance",label:"DB Maintenance",icon:dw}]:[]];return y.jsxs(y.Fragment,{children:[y.jsx(ui,{heading:"Identity & Access",entries:l}),i&&y.jsx(ui,{heading:"Infrastructure",entries:c})]})}function yv({aiEnabled:i,isBuilder:t,isOps:r,viewAs:s,canSeePaceBoard:l}){return y.jsxs(y.Fragment,{children:[y.jsx(mA,{aiEnabled:i,isBuilder:t,isOps:r,viewAs:s,canSeePaceBoard:l}),y.jsx(SA,{}),t&&y.jsx(OA,{}),t&&i&&y.jsx(jA,{}),t&&y.jsx(NA,{}),(t||r)&&y.jsx(kA,{isBuilder:t,isOps:r})]})}function CA({open:i,onClose:t,...r}){const s=mn();return T.useEffect(()=>{t()},[s.pathname]),y.jsxs("div",{className:`lg:hidden fixed inset-y-0 left-0 z-40 flex ${i?"":"pointer-events-none"}`,children:[y.jsx("div",{className:`fixed inset-0 bg-black/20 transition-opacity duration-200 ${i?"opacity-100":"opacity-0"}`,onClick:t,"aria-hidden":!0}),y.jsxs("div",{className:`relative w-72 max-w-[85vw] h-full bg-surface-raised border-r border-surface-border shadow-xl flex flex-col transition-transform duration-200 ease-out ${i?"translate-x-0":"-translate-x-full"}`,children:[y.jsx("div",{className:"flex items-center justify-end px-3 pt-3 shrink-0",children:y.jsx("button",{onClick:t,className:"p-1.5 rounded text-text-tertiary hover:text-text-primary hover:bg-surface-hover transition-colors","aria-label":"Close navigation",children:y.jsx(Cn,{className:"w-4 h-4"})})}),y.jsx("nav",{className:"flex-1 px-3 pb-4 space-y-2 overflow-y-auto overflow-x-hidden",children:y.jsx(JE,{children:y.jsx(yv,{...r})})})]})]})}const gv="lt_event_feed_patterns";function MA(i,t){if(i.startsWith("/topics/")){const d=decodeURIComponent(i.replace("/topics/",""));if(d&&!d.includes("/"))return`lt.events.${d}`}const r=i.match(/^\/escalations\/detail\/(.+)/);if(r)return`lt.events.system.escalation.*.${r[1]}.>`;if(i.startsWith("/escalations")){const d=new URLSearchParams(t).get("role");return d?`lt.events.system.escalation.${Ib(d)}.>`:"lt.events.system.escalation.>"}const s=i.match(/^\/workflows\/(?:durable\/)?executions\/(.+)/);if(s)return`lt.events.system.workflow.${s[1]}.>`;if(i.startsWith("/workflows"))return"lt.events.system.workflow.>";const l=i.match(/^\/agents\/([^/]+)$/);if(l&&l[1]!=="new")return`lt.events.system.agent.${l[1]}.>`;if(i.startsWith("/agents"))return"lt.events.system.agent.>";if(i.startsWith("/knowledge"))return"lt.events.system.knowledge.>";if(i.startsWith("/files"))return"lt.events.system.file.>";if(i==="/")return"lt.events.system.>";const c=i.match(/^\/mcp\/executions\/(.+)/);return c?`lt.events.system.*.${c[1]}.>`:(i.startsWith("/mcp"),"lt.events.system.>")}function RA(){try{const i=localStorage.getItem(gv);return i?JSON.parse(i):[]}catch{return[]}}function Ih(i){try{localStorage.setItem(gv,JSON.stringify(i))}catch{}}function DA(){const{pathname:i,search:t}=mn(),[r,s]=T.useState(RA),l=T.useMemo(()=>MA(i,t),[i,t]),c=T.useMemo(()=>{const f=new Set([l,...r]);return Array.from(f)},[l,r]),d=T.useCallback(f=>{const m=f.startsWith("lt.events.")?f:`lt.events.${f}`;s(b=>{if(b.includes(m))return b;const v=[...b,m];return Ih(v),v})},[]),p=T.useCallback(f=>{s(m=>{const b=m.filter(v=>v!==f);return Ih(b),b})},[]),g=T.useCallback(()=>{s([]),Ih([])},[]);return{patterns:c,pagePattern:l,userPatterns:r,addPattern:d,removePattern:p,clearUserPatterns:g}}function qA({children:i,className:t=""}){return y.jsx("p",{className:`text-2xs font-semibold uppercase tracking-widest text-text-tertiary ${t}`,children:i})}const Hh=280,T1="cubic-bezier(0.4, 0, 0.2, 1)",Bc=40;function BA(i){if(!i)return"scale(0.92)";const t=window.innerWidth,r=window.innerHeight,s=t-Bc*2,l=r-Bc*2,c=i.width/s,d=i.height/l,p=i.left+i.width/2-(Bc+s/2),g=i.top+i.height/2-(Bc+l/2);return`translate(${p}px, ${g}px) scale(${c}, ${d})`}function bv({open:i,onClose:t,sourceRef:r,children:s}){const[l,c]=T.useState(null),d=T.useRef(null),p=T.useRef(!1);T.useEffect(()=>{var v,_;i&&!p.current?(d.current=((v=r==null?void 0:r.current)==null?void 0:v.getBoundingClientRect())??null,c("entering")):!i&&p.current&&l==="open"&&(d.current=((_=r==null?void 0:r.current)==null?void 0:_.getBoundingClientRect())??null,c("exiting")),p.current=i},[i,r,l]),T.useEffect(()=>{if(l!=="entering")return;const v=requestAnimationFrame(()=>{requestAnimationFrame(()=>c("open"))});return()=>cancelAnimationFrame(v)},[l]),T.useEffect(()=>{if(l)return document.body.style.overflow="hidden",()=>{document.body.style.overflow=""}},[l]),T.useEffect(()=>{if(!l)return;const v=_=>{_.key==="Escape"&&t()};return document.addEventListener("keydown",v),()=>document.removeEventListener("keydown",v)},[l,t]);const g=T.useCallback(v=>{v.propertyName==="transform"&&l==="exiting"&&c(null)},[l]);if(T.useEffect(()=>{if(l!=="exiting")return;const v=setTimeout(()=>c(null),Hh+50);return()=>clearTimeout(v)},[l]),!l)return null;const f=l==="entering"||l==="exiting",m=f?BA(d.current):"none",b=f?0:1;return J1.createPortal(y.jsx("div",{className:"fixed inset-0 z-50 overflow-auto p-10",style:{transformOrigin:"center center",transition:`transform ${Hh}ms ${T1}, opacity ${Hh}ms ${T1}`,transform:m,opacity:b,backgroundColor:"rgb(var(--lt-surface))"},onTransitionEnd:g,children:s}),document.body)}function LA({className:i}){return y.jsx("svg",{className:i,fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:y.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M4 6h16M4 12h8M4 18h12"})})}function zA({className:i}){return y.jsx("svg",{className:i,fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:y.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M8 7l-5 5 5 5M16 7l5 5-5 5"})})}function UA({className:i}){return y.jsx("svg",{className:i,fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:y.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M8 5H6a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2v-1M8 5a2 2 0 002 2h2a2 2 0 002-2M8 5a2 2 0 012-2h2a2 2 0 012 2m0 0h2a2 2 0 012 2v3"})})}function PA({className:i}){return y.jsx("svg",{className:i,fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:y.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M5 13l4 4L19 7"})})}function $A({className:i}){return y.jsx("svg",{className:i,fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:y.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9 9V4.5M9 9H4.5M9 9L3.5 3.5M9 15v4.5M9 15H4.5M9 15l-5.5 5.5M15 9h4.5M15 9V4.5M15 9l5.5-5.5M15 15h4.5M15 15v4.5m0-4.5l5.5 5.5"})})}function IA({className:i}){return y.jsx("svg",{className:i,fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:y.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M4 8V4m0 0h4M4 4l5 5m11-1V4m0 0h-4m4 0l-5 5M4 16v4m0 0h4m-4 0l5-5m11 5v-4m0 4h-4m4 0l-5-5"})})}function HA(i){const t=i.trim().split(`
|
|
56
|
+
`);if(t.length<2)return i;const r=p=>p.split("|").map(g=>g.trim()).filter(Boolean),s=r(t[0]),l=t.slice(2),c=s.map(p=>`<th class="px-3 py-1.5 text-left text-2xs font-semibold uppercase tracking-wider text-text-tertiary">${p}</th>`).join(""),d=l.map(p=>`<tr class="border-t border-surface-border">${r(p).map(m=>`<td class="px-3 py-1.5 text-xs text-text-secondary">${m}</td>`).join("")}</tr>`).join("");return`<table class="w-full my-3 text-xs"><thead><tr class="border-b border-surface-border">${c}</tr></thead><tbody>${d}</tbody></table>`}function Lc(i){return i.toLowerCase().replace(/<[^>]+>/g,"").replace(/[^\w\s-]/g,"").replace(/\s+/g,"-").trim()}function GA(i){const t=[];let r=i.replace(/```(\w*)\n([\s\S]*?)```/g,(g,f,m)=>{const b=t.length;return t.push(`<pre class="bg-surface-sunken rounded p-3 my-2 overflow-x-auto text-2xs leading-relaxed"><code>${m}</code></pre>`),`\0CODE${b}\0`});const s=/^(\|.+\|)\n(\|[-| :]+\|)\n((?:\|.+\|\n?)+)/gm;r=r.replace(s,(g,f,m,b)=>HA(`${f}
|
|
57
|
+
${m}
|
|
58
|
+
${b.trimEnd()}`)),r=r.replace(/`([^`]+)`/g,'<code class="bg-surface-sunken px-1 py-0.5 rounded text-2xs">$1</code>'),r=r.replace(/^#### (.+)$/gm,(g,f)=>`<h4 id="${Lc(f)}" class="text-xs font-semibold text-text-primary mt-4 mb-1">${f}</h4>`).replace(/^### (.+)$/gm,(g,f)=>`<h3 id="${Lc(f)}" class="text-sm font-semibold text-text-primary mt-5 mb-1.5">${f}</h3>`).replace(/^## (.+)$/gm,(g,f)=>`<h2 id="${Lc(f)}" class="text-base font-semibold text-text-primary mt-6 mb-2 pb-1 border-b border-surface-border">${f}</h2>`).replace(/^# (.+)$/gm,(g,f)=>`<h1 id="${Lc(f)}" class="text-lg font-bold text-text-primary mb-3">${f}</h1>`),r=r.replace(/\*\*(.+?)\*\*/g,"<strong>$1</strong>").replace(/\*(.+?)\*/g,"<em>$1</em>").replace(/\[([^\]]+)\]\(#([^)]+)\)/g,'<a data-anchor="$2" class="text-accent hover:underline cursor-pointer">$1</a>').replace(/\[([^\]]+)\]\(([^)]*\.md(?:#[^)]*)?)\)/g,'<a data-doc-link="$2" class="text-accent hover:underline cursor-pointer">$1</a>').replace(/\[([^\]]+)\]\(([^)]+)\)/g,'<a href="$2" class="text-accent hover:underline">$1</a>').replace(/^ - (.+)$/gm,'<li class="ml-8 list-disc text-xs -my-1" style="line-height:1.1">$1</li>').replace(/^ - (.+)$/gm,'<li class="ml-8 list-disc text-xs -my-1" style="line-height:1.1">$1</li>').replace(/^- (.+)$/gm,'<li class="ml-4 list-disc text-xs -my-1" style="line-height:1.1">$1</li>').replace(/^\d+\. (.+)$/gm,'<li class="ml-4 list-decimal text-xs -my-1" style="line-height:1.1">$1</li>').replace(/^---+$/gm,'<hr class="border-surface-border my-4" />').replace(/(?:^> (.+)$\n?)+/gm,g=>{const f=g.replace(/^> /gm,"").trim(),m=/⚠️|warning|caution/i.test(f),b=/note:|ℹ️|info/i.test(f);return`<div class="${m?"bg-status-warning/5":b?"bg-accent/5":"bg-surface-sunken/50"} ${m?"border-status-warning":b?"border-accent":"border-text-tertiary"} border-l-2 rounded-r-md px-3 py-2 my-3 text-xs text-text-secondary leading-relaxed">${f}</div>`}).replace(/\n\n/g,"\0PARA\0").replace(/\n/g,"<br/>");const l=g=>g.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),c=g=>new RegExp(`(${l(g)}[\\s\\S]*?<\\/li>(?:<br\\/>)?)+`,"g");r=r.replace(c('<li class="ml-8 list-disc'),g=>`<ul class="mb-3">${g}</ul>`),r=r.replace(c('<li class="ml-4 list-disc'),g=>`<ul class="mb-3">${g}</ul>`),r=r.replace(c('<li class="ml-4 list-decimal'),g=>`<ol class="list-decimal mb-3">${g}</ol>`),r=r.replace(/\x00CODE(\d+)\x00/g,(g,f)=>t[parseInt(f,10)]);const d="text-xs leading-relaxed text-text-secondary mb-2",p=/<\/(h[1-4]|pre|table|ul|ol|hr|div)>/;return r=r.split("\0PARA\0").map(g=>{const f=g.trim();if(!f)return"";const m=[];let b=f,v;for(;(v=p.exec(b))!==null;){const _=v.index+v[0].length;m.push(b.slice(0,_)),b=b.slice(_).replace(/^<br\/>/,"").trim(),p.lastIndex=0}return b&&m.push(b),m.map(_=>{const w=_.trim();return w?/^\s*<(h[1-4]|pre|table|ul|ol|hr|div)/.test(w)?w:`<p class="${d}">${w}</p>`:""}).join("")}).join(""),r}const FA=/(\*\*|^#{1,4}\s|^- |^\d+\.\s|```|^\|.*\|$|\[.+\]\(.+\))/m;function VA(i){return FA.test(i)}function Yd({content:i,className:t,onClick:r}){const s=T.useMemo(()=>GA(i),[i]);return y.jsx("div",{className:t,onClick:r,dangerouslySetInnerHTML:{__html:s}})}function tu({data:i,depth:t=0,generation:r}){const l=r!==void 0&&r>0&&r%2===1?!1:t>0,[c,d]=T.useState(l),[p,g]=T.useState(r);if(r!==void 0&&r!==p&&(g(r),d(r%2===0&&t>0)),i==null)return y.jsx("span",{className:"text-text-tertiary italic",children:"null"});if(typeof i=="string")return y.jsxs("span",{className:"text-text-primary",children:['"',i,'"']});if(typeof i=="number"||typeof i=="boolean")return y.jsx("span",{className:"text-text-primary font-medium",children:String(i)});if(Array.isArray(i))return i.length===0?y.jsx("span",{className:"text-text-tertiary",children:"[]"}):c?y.jsxs("button",{onClick:()=>d(!1),className:"text-text-secondary hover:text-text-primary",children:["[",i.length," items]"]}):y.jsxs("span",{children:[y.jsx("button",{onClick:()=>d(!0),className:"text-text-tertiary hover:text-text-primary",children:"["}),y.jsx("div",{className:"pl-4 border-l border-surface-border ml-1",children:i.map((f,m)=>y.jsxs("div",{children:[y.jsx(tu,{data:f,depth:t+1,generation:r}),m<i.length-1&&y.jsx("span",{className:"text-text-tertiary",children:","})]},m))}),y.jsx("span",{className:"text-text-tertiary",children:"]"})]});if(typeof i=="object"){const f=Object.entries(i);return f.length===0?y.jsx("span",{className:"text-text-tertiary",children:"{}"}):c?y.jsxs("button",{onClick:()=>d(!1),className:"text-text-secondary hover:text-text-primary",children:["{","...","}"]}):y.jsxs("span",{children:[y.jsx("button",{onClick:()=>d(!0),className:"text-text-tertiary hover:text-text-primary",children:"{"}),y.jsx("div",{className:"pl-4 border-l border-surface-border ml-1",children:f.map(([m,b],v)=>y.jsxs("div",{children:[y.jsx("span",{className:"text-text-secondary",children:m}),y.jsx("span",{className:"text-text-tertiary",children:": "}),y.jsx(tu,{data:b,depth:t+1,generation:r}),v<f.length-1&&y.jsx("span",{className:"text-text-tertiary",children:","})]},m))}),y.jsx("span",{className:"text-text-tertiary",children:"}"})]})}return y.jsx("span",{children:String(i)})}function co({data:i,depth:t=0}){if(i==null)return y.jsx("span",{className:"text-text-tertiary italic",children:"null"});if(typeof i=="string")return i.length>40&&VA(i)?y.jsx(Yd,{content:i}):y.jsx("span",{className:"text-text-primary",children:i});if(typeof i=="number"||typeof i=="boolean")return y.jsx("span",{className:"text-text-primary font-medium",children:String(i)});if(Array.isArray(i))return i.length===0?y.jsx("span",{className:"text-text-tertiary italic",children:"empty list"}):y.jsx("div",{className:"space-y-2",children:i.map((r,s)=>y.jsxs("div",{className:"flex items-baseline gap-2",children:[y.jsxs("span",{className:"text-text-tertiary text-2xs shrink-0",children:[s+1,"."]}),y.jsx("div",{className:"flex-1",children:y.jsx(co,{data:r,depth:t+1})})]},s))});if(typeof i=="object"){const r=Object.entries(i);return r.length===0?y.jsx("span",{className:"text-text-tertiary italic",children:"empty"}):y.jsx("div",{className:t>0?"pl-4 border-l border-surface-border space-y-3":"space-y-3",children:r.map(([s,l])=>{const c=l===null||typeof l!="object";return y.jsxs("div",{children:[y.jsx("p",{className:"text-2xs font-semibold uppercase tracking-widest text-text-tertiary mb-0.5",children:s.replace(/[_-]/g," ")}),c?y.jsx("p",{className:"text-sm text-text-primary",children:y.jsx(co,{data:l,depth:t+1})}):y.jsx(co,{data:l,depth:t+1})]},s)})})}return y.jsx("span",{children:String(i)})}function N1({mode:i,setMode:t,isCollapsed:r,onToggleCollapse:s,onCopy:l,copied:c,onFullscreen:d,onClose:p,large:g}){const f=g?"w-5 h-5":"w-3.5 h-3.5",m=`${g?"p-2":"p-1.5"} rounded text-text-tertiary hover:text-text-primary hover:bg-surface-raised transition-colors duration-150`;return y.jsxs("div",{className:"flex items-center gap-0.5 bg-surface-sunken/80 rounded-md backdrop-blur-sm",children:[i==="json"&&y.jsx("button",{onClick:s,className:m,title:r?"Expand all":"Collapse all",children:r?y.jsx(IA,{className:f}):y.jsx($A,{className:f})}),y.jsx("button",{onClick:()=>t(i==="json"?"tree":"json"),className:m,title:i==="json"?"Outline view":"JSON view",children:i==="json"?y.jsx(LA,{className:f}):y.jsx(zA,{className:f})}),y.jsx("button",{onClick:l,className:m,title:"Copy to clipboard",children:c?y.jsx(PA,{className:`${f} text-status-success`}):y.jsx(UA,{className:f})}),d&&y.jsx("button",{onClick:d,className:m,title:"Fullscreen",children:y.jsx(tb,{className:f})}),p&&y.jsx("button",{onClick:p,className:m,title:"Close (Esc)",children:y.jsx(nb,{className:f})})]})}function YA({data:i,label:t,variant:r,defaultCollapsed:s=!1,defaultMode:l}){const c=T.useRef(null),[d,p]=T.useState(l??"json"),[g,f]=T.useState(!1),[m,b]=T.useState(!1),[v,_]=T.useState(s?0:1),[w,S]=T.useState(1),C=v%2===0,L=w%2===0,z=T.useCallback(()=>_(Y=>Y+1),[]),se=T.useCallback(()=>S(Y=>Y+1),[]);let oe=i;if(typeof i=="string")try{oe=JSON.parse(i)}catch{}const M=async()=>{const Y=typeof i=="string"?i:JSON.stringify(oe,null,2);await navigator.clipboard.writeText(Y),f(!0),setTimeout(()=>f(!1),2e3)},B=T.useCallback(()=>{S(1),b(!0)},[]),te=r==="panel",K=te?"border border-accent-muted/40 rounded-lg p-3 bg-surface-hover/30":"",P=te?"font-mono text-xs leading-relaxed bg-surface-raised rounded-md p-4 overflow-x-auto break-all":"font-mono text-xs leading-relaxed bg-surface-sunken rounded-md p-4 overflow-x-auto break-all";return y.jsxs("div",{className:K,children:[t&&y.jsx(qA,{children:t}),y.jsxs("div",{ref:c,className:"relative",children:[y.jsx("div",{className:"absolute top-2 right-2 z-[5]",children:y.jsx(N1,{mode:d,setMode:p,isCollapsed:C,onToggleCollapse:z,onCopy:M,copied:g,onFullscreen:B})}),y.jsx("div",{className:P,children:d==="json"?y.jsx(tu,{data:oe,generation:v}):y.jsx(co,{data:oe})})]}),y.jsxs(bv,{open:m,onClose:()=>b(!1),sourceRef:c,children:[y.jsx("div",{className:"sticky top-0 float-right z-10",children:y.jsx(N1,{mode:d,setMode:p,isCollapsed:L,onToggleCollapse:se,onCopy:M,copied:g,onClose:()=>b(!1),large:!0})}),y.jsx("div",{className:"font-mono text-sm leading-relaxed",children:d==="json"?y.jsx(tu,{data:oe,generation:w}):y.jsx(co,{data:oe})})]})]})}const KA=100,k1=500;let XA=0;const vv={"escalation.created":"text-status-active","escalation.claimed":"text-status-warning","escalation.released":"text-text-tertiary","escalation.resolved":"text-status-success","task.created":"text-accent","task.completed":"text-status-success","task.failed":"text-status-error","task.escalated":"text-status-warning","workflow.started":"text-accent","workflow.completed":"text-status-success","workflow.failed":"text-status-error","activity.started":"text-status-active","activity.completed":"text-status-success","activity.failed":"text-status-error","knowledge.stored":"text-accent","knowledge.deleted":"text-text-tertiary","agent.started":"text-accent","agent.completed":"text-status-success","agent.failed":"text-status-error","agent.status_changed":"text-status-active",milestone:"text-accent"};function xv(i){const t=i.split(".");return t[0]==="system"&&t.length>=3?`${t[1]}.${t[t.length-1]}`:i}function C1({event:i,forceExpanded:t=!1}){var v,_;const[r,s]=T.useState(t),l=vv[xv(i.type)]||"text-text-tertiary";T.useEffect(()=>{s(t)},[t]);const c=t,d=c?"text-xs":"text-2xs",p=c?"text-xs":"text-2xs",g=c?"text-xs":"text-2xs",f=c?"w-3.5 h-3.5":"w-2.5 h-2.5",m=c?"py-2 px-4":"py-1 px-3",b=c?"pb-4 px-4":"pb-2 px-3";return y.jsxs("div",{className:"border-b border-surface-border/30 last:border-b-0",children:[y.jsxs("button",{onClick:()=>s(!r),className:`flex items-center gap-2 ${m} w-full text-left hover:bg-surface-hover/50 transition-colors`,children:[y.jsx("span",{className:`${d} font-mono text-text-tertiary whitespace-nowrap tabular-nums shrink-0`,children:new Date(i.timestamp).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit",second:"2-digit"})}),y.jsx("span",{className:`${p} font-medium px-1 py-0.5 rounded ${l} bg-surface-sunken whitespace-nowrap shrink-0`,children:i.type}),y.jsxs("span",{className:`${g} text-text-tertiary font-mono flex-1 min-w-0 truncate`,children:[(v=i.data)!=null&&v.workflowId?String(i.data.workflowId):"",(_=i.data)!=null&&_.escalationId?` esc:${String(i.data.escalationId).slice(0,12)}`:""]}),y.jsx("svg",{className:`${f} text-text-tertiary shrink-0 transition-transform duration-150 ${r?"rotate-180":""}`,fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:y.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M19 9l-7 7-7-7"})})]}),y.jsx(Vd,{open:r,children:y.jsx("div",{className:b,children:y.jsx(YA,{data:i.data})})})]})}function JA({open:i,onToggle:t,configOpen:r,onToggleConfig:s}){const[l,c]=T.useState([]),[d,p]=T.useState(!1),[g,f]=T.useState(""),m=T.useRef(null),b=T.useRef(new Map),{subscribe:v}=T.useContext(Ks),{patterns:_,pagePattern:w,userPatterns:S,addPattern:C,removePattern:L}=DA(),z=T.useCallback(M=>{const B=String(M.type||"unknown");if(B.startsWith("mesh."))return;const te=`${B}:${M.timestamp||""}:${M.escalationId||M.workflowId||M.taskId||""}`,K=Date.now(),P=b.current.get(te);if(!(P&&K-P<k1)){if(b.current.set(te,K),b.current.size>200)for(const[Y,W]of b.current)K-W>k1*2&&b.current.delete(Y);c(Y=>[{id:++XA,type:B,timestamp:M.timestamp||new Date().toISOString(),data:M},...Y].slice(0,KA))}},[]),se=T.useRef(z);se.current=z;const oe=i||d||r;return T.useEffect(()=>{if(!oe)return;const M=_.map(B=>v(B,te=>se.current(te)));return()=>M.forEach(B=>B())},[v,_.join(","),oe]),T.useEffect(()=>{i&&m.current&&(m.current.scrollTop=0)},[l.length,i]),y.jsxs("div",{className:"shrink-0 border-t border-surface-border bg-surface-raised",children:[y.jsxs("button",{onClick:t,className:"flex items-center gap-2 w-full px-4 py-1.5 text-left hover:bg-surface-hover transition-colors",children:[i?y.jsx(mw,{className:"w-3 h-3 text-text-tertiary"}):y.jsx(pw,{className:"w-3 h-3 text-text-tertiary"}),y.jsx("span",{className:"text-2xs font-semibold uppercase tracking-widest text-text-tertiary",children:"Event Stream"}),l.length>0&&y.jsxs("span",{className:"text-2xs text-text-tertiary",children:[l.length," events"]}),l.length>0&&!i&&y.jsx("span",{className:`text-2xs font-medium px-1 py-0.5 rounded ${vv[xv(l[0].type)]||"text-text-tertiary"} bg-surface-sunken`,children:l[0].type}),y.jsxs("span",{className:"ml-auto flex items-center gap-1",children:[y.jsx("span",{className:`p-0.5 cursor-pointer ${r?"text-accent":"text-text-tertiary hover:text-text-primary"}`,title:"Subscription config",onClick:M=>{M.stopPropagation(),s()},children:y.jsx(yw,{className:"w-3 h-3"})}),l.length>0&&y.jsxs(y.Fragment,{children:[y.jsx("span",{className:"text-text-tertiary hover:text-text-primary p-0.5 cursor-pointer",title:"Fullscreen",onClick:M=>{M.stopPropagation(),p(!0)},children:y.jsx(tb,{className:"w-3 h-3"})}),y.jsx("span",{className:"text-text-tertiary hover:text-text-primary p-0.5 cursor-pointer",title:"Clear events",onClick:M=>{M.stopPropagation(),c([])},children:y.jsx(gw,{className:"w-3 h-3"})})]})]})]}),r&&y.jsxs("div",{className:"px-4 py-2 border-t border-surface-border/50 bg-surface-sunken/30",children:[y.jsxs("div",{className:"flex flex-wrap items-center gap-1.5 mb-1.5",children:[y.jsx("span",{className:"text-2xs text-text-quaternary uppercase tracking-wider shrink-0",children:"Subscribed:"}),y.jsx("span",{className:"text-2xs font-mono text-accent px-1.5 py-0.5 bg-accent/10 rounded",children:w.replace("lt.events.","")}),S.map(M=>y.jsxs("span",{className:"inline-flex items-center gap-1 text-2xs font-mono text-text-secondary px-1.5 py-0.5 bg-surface-sunken rounded",children:[M.replace("lt.events.",""),y.jsx("button",{onClick:()=>L(M),className:"text-text-quaternary hover:text-status-error",children:y.jsx(Cn,{className:"w-2 h-2"})})]},M))]}),y.jsxs("div",{className:"flex items-center gap-2",children:[y.jsx("input",{type:"text",value:g,onChange:M=>f(M.target.value),onKeyDown:M=>{M.key==="Enter"&&g.trim()&&(C(g.trim()),f(""))},placeholder:"task.> or file.stored",className:"input text-2xs font-mono flex-1 py-1"}),y.jsxs("button",{onClick:()=>{g.trim()&&(C(g.trim()),f(""))},className:"text-2xs text-accent hover:text-accent-hover flex items-center gap-0.5",children:[y.jsx(eb,{className:"w-2.5 h-2.5"})," Add"]})]})]}),y.jsx(Vd,{open:i,children:y.jsx("div",{ref:m,className:"h-48 overflow-y-auto",children:l.length===0?y.jsx("p",{className:"text-2xs text-text-tertiary py-4 text-center",children:"Waiting for events..."}):l.map(M=>y.jsx(C1,{event:M},M.id))})}),y.jsxs(bv,{open:d,onClose:()=>p(!1),sourceRef:m,children:[y.jsx("div",{className:"sticky top-0 float-right z-10",children:y.jsx("button",{onClick:()=>p(!1),className:"p-2 rounded text-text-tertiary hover:text-text-primary hover:bg-surface-raised transition-colors duration-150 bg-surface-sunken/80 backdrop-blur-sm",title:"Close (Esc)",children:y.jsx(nb,{className:"w-5 h-5"})})}),l.length===0?y.jsx("p",{className:"text-sm text-text-tertiary py-8",children:"No events captured"}):l.map(M=>y.jsx(C1,{event:M,forceExpanded:!0},M.id))]})]})}function QA(){return ot({queryKey:["docs"],queryFn:()=>Ee("/docs"),staleTime:5*6e4})}function ZA(i){return ot({queryKey:["docs",i],queryFn:()=>Ee(`/docs/read?path=${encodeURIComponent(i)}`),enabled:!!i,staleTime:5*6e4})}function WA(){const[i,t]=T.useState([]),[r,s]=T.useState([]),[l,c]=T.useState(null),d=T.useRef(l),p=T.useRef(i),g=T.useRef(r);d.current=l,p.current=i,g.current=r;const f=T.useCallback((w,S)=>{var L;const C=d.current;if(C){const z=((L=S==null?void 0:S.current)==null?void 0:L.scrollTop)??0;t([...p.current,{...C,scrollTop:z}])}s([]),c({path:w,scrollTop:0})},[]),m=T.useCallback(w=>{var z;const S=p.current;if(S.length===0)return;const C=S[S.length-1],L=d.current;if(L){const se=((z=w==null?void 0:w.current)==null?void 0:z.scrollTop)??0;s([...g.current,{...L,scrollTop:se}])}t(S.slice(0,-1)),c(C),requestAnimationFrame(()=>{w!=null&&w.current&&(w.current.scrollTop=C.scrollTop)})},[]),b=T.useCallback(w=>{var z;const S=g.current;if(S.length===0)return;const C=S[S.length-1],L=d.current;if(L){const se=((z=w==null?void 0:w.current)==null?void 0:z.scrollTop)??0;t([...p.current,{...L,scrollTop:se}])}s(S.slice(0,-1)),c(C),requestAnimationFrame(()=>{w!=null&&w.current&&(w.current.scrollTop=C.scrollTop)})},[]),v=T.useCallback(w=>{var L,z;const S=d.current;if(!S)return;const C=((L=w==null?void 0:w.current)==null?void 0:L.scrollTop)??0;t([...p.current,{...S,scrollTop:C}]),s([]),c({...S,scrollTop:((z=w==null?void 0:w.current)==null?void 0:z.scrollTop)??0})},[]),_=T.useCallback(()=>{t([]),s([]),c(null)},[]);return{current:l,backStack:i,forwardStack:r,navigate:f,goBack:m,goForward:b,pushScrollPosition:v,reset:_}}function ej(i,t){const[r,s]=i.split("#");let l=r;if(l.startsWith("./")||l.startsWith("../")){const d=((t?t.replace(/[^/]+$/,""):"")+l).split("/"),p=[];for(const g of d)g===".."?p.pop():g&&g!=="."&&p.push(g);l=p.join("/")}return{path:l,anchor:s}}function tj(i){if(!i.startsWith("#docs"))return null;const t=i.slice(1).split(":"),r=t[1]||"README.md",s=t[2]||void 0;return{path:r,anchor:s}}function nj(i){return!i||i==="README.md"?"#docs":`#docs:${i}`}function rj({content:i,currentPath:t,onNavigate:r,onAnchorClick:s}){const l=c=>{var f;const d=c.target,p=d.closest("[data-anchor]");if(p){c.preventDefault(),s();const m=p.dataset.anchor,b=(f=p.closest(".docs-content"))==null?void 0:f.querySelector(`#${CSS.escape(m)}`);b==null||b.scrollIntoView({behavior:"smooth",block:"start"});return}const g=d.closest("[data-doc-link]");if(g){c.preventDefault();const{path:m,anchor:b}=ej(g.dataset.docLink,t);r(m,b);return}};return y.jsx(Yd,{content:i,className:"docs-content",onClick:l})}function ij(i){const t=[],r=new Map;for(const s of i){const l=s.path.split("/");if(l.length===1){t.push(s);continue}let c=r;for(let d=0;d<l.length-1;d++){const p=l[d];c.has(p)||c.set(p,{label:p,children:[],subdirs:new Map});const g=c.get(p);d===l.length-2?g.children.push(s):c=g.subdirs}}return{topLevel:t,dirs:r}}function sj({docs:i,selected:t,onSelect:r}){const{topLevel:s,dirs:l}=ij(i),c=p=>`block w-full text-left px-3 py-1 text-xs rounded truncate transition-colors ${t===p?"bg-accent/10 text-accent":"text-text-secondary hover:bg-surface-hover"}`;function d(p,g){return y.jsxs("details",{open:!0,children:[y.jsxs("summary",{className:"flex items-center gap-1.5 px-3 py-1 text-2xs font-semibold uppercase tracking-widest text-text-tertiary cursor-pointer",children:[y.jsx(bw,{className:"w-3 h-3",strokeWidth:1.5}),p.label]}),y.jsxs("div",{className:"pl-2 space-y-0.5",children:[[...p.subdirs.values()].map(f=>d(f)),p.children.map(f=>y.jsx("button",{className:c(f.path),onClick:()=>r(f.path),children:f.title},f.path))]})]},p.label)}return y.jsxs("div",{className:"space-y-0.5",children:[s.map(p=>y.jsx("button",{className:c(p.path),onClick:()=>r(p.path),children:p.title},p.path)),[...l.values()].map(p=>d(p))]})}function aj({open:i,onClose:t}){var te,K,P;const[r,s]=T.useState(!1),{data:l}=QA(),c=WA(),{data:d,isLoading:p}=ZA(((te=c.current)==null?void 0:te.path)??null),g=T.useRef(null),[f,m]=T.useState(null);T.useEffect(()=>{f&&(d!=null&&d.content)&&g.current&&requestAnimationFrame(()=>{var W;const Y=(W=g.current)==null?void 0:W.querySelector(`#${CSS.escape(f)}`);Y==null||Y.scrollIntoView({behavior:"smooth",block:"start"}),m(null)})},[f,d]);const b=T.useCallback(()=>{var X;const Y=tj(window.location.hash),W=(Y==null?void 0:Y.path)??"README.md";((X=c.current)==null?void 0:X.path)!==W&&c.navigate(W,g),Y!=null&&Y.anchor&&m(Y.anchor)},[c]),v=T.useRef(!0);T.useEffect(()=>{if(!i||!c.current)return;if(v.current){v.current=!1;return}const Y=nj(c.current.path);window.location.hash!==Y&&window.history.replaceState(null,"",window.location.pathname+window.location.search+Y)},[i,(K=c.current)==null?void 0:K.path]),T.useEffect(()=>{if(!i)return;const Y=()=>{window.location.hash.startsWith("#docs")&&b()};return window.addEventListener("hashchange",Y),()=>window.removeEventListener("hashchange",Y)},[i,b]);const _=T.useCallback((Y,W)=>{W&&m(W),c.navigate(Y,g)},[c]),w=T.useCallback(Y=>{c.navigate(Y,g)},[c]),S=T.useCallback(()=>{c.goBack(g)},[c]),C=T.useCallback(()=>{c.goForward(g)},[c]),L=T.useCallback(()=>{c.pushScrollPosition(g)},[c]);if(T.useEffect(()=>{if(i){v.current=!0,b();const Y=requestAnimationFrame(()=>s(!0));return()=>cancelAnimationFrame(Y)}},[i]),!(i||r))return null;const se=()=>{s(!1),setTimeout(()=>{t(),c.reset()},200)},oe=((P=c.current)==null?void 0:P.path)??null,M=c.backStack.length>0,B=c.forwardStack.length>0;return y.jsxs("div",{className:"fixed inset-y-0 right-0 z-50 flex",children:[y.jsx("div",{className:`fixed inset-0 bg-black/20 transition-opacity duration-200 ${r&&i?"opacity-100":"opacity-0"}`,onClick:se}),y.jsxs("div",{className:`relative ml-auto w-[40vw] min-w-[800px] max-w-[90vw] h-full bg-surface-raised border-l border-surface-border flex flex-col shadow-xl transition-transform duration-200 ease-out ${r&&i?"translate-x-0":"translate-x-full"}`,children:[y.jsxs("div",{className:"flex items-center justify-between px-4 py-3 border-b border-surface-border shrink-0",children:[y.jsxs("div",{className:"flex items-center gap-1",children:[y.jsx("button",{onClick:S,disabled:!M,className:`p-0.5 transition-colors ${M?"text-text-tertiary hover:text-text-primary":"text-surface-border cursor-default"}`,title:"Back",children:y.jsx(Q1,{className:"w-4 h-4"})}),y.jsx("button",{onClick:C,disabled:!B,className:`p-0.5 transition-colors ${B?"text-text-tertiary hover:text-text-primary":"text-surface-border cursor-default"}`,title:"Forward",children:y.jsx(Fh,{className:"w-4 h-4"})}),y.jsx(W1,{className:"w-4 h-4 text-accent ml-1",strokeWidth:1.5}),y.jsx("span",{className:"text-sm font-medium text-text-primary",children:"Documentation"})]}),y.jsx("button",{onClick:se,className:"p-1 text-text-tertiary hover:text-text-primary",children:y.jsx(Cn,{className:"w-4 h-4"})})]}),y.jsxs("div",{className:"flex flex-1 overflow-hidden",children:[y.jsx("div",{className:"w-48 shrink-0 border-r border-surface-border overflow-y-auto py-2",children:l!=null&&l.docs?y.jsx(sj,{docs:l.docs,selected:oe,onSelect:w}):y.jsx("div",{className:"px-3 py-2 text-xs text-text-tertiary",children:"Loading..."})}),y.jsx("div",{ref:g,className:"flex-1 overflow-y-auto px-6 py-4",children:oe?p?y.jsxs("div",{className:"animate-pulse space-y-2",children:[y.jsx("div",{className:"h-6 bg-surface-sunken rounded w-48"}),y.jsx("div",{className:"h-4 bg-surface-sunken rounded w-full"}),y.jsx("div",{className:"h-4 bg-surface-sunken rounded w-3/4"})]}):d!=null&&d.content?y.jsx(rj,{content:d.content,currentPath:oe,onNavigate:_,onAnchorClick:L}):y.jsx("p",{className:"text-xs text-text-tertiary",children:"Document not found."}):y.jsxs("div",{className:"flex flex-col items-center justify-center h-full text-text-tertiary",children:[y.jsx(Fh,{className:"w-5 h-5 mb-2"}),y.jsx("p",{className:"text-xs",children:"Select a document"})]})})]})]})]})}function oj(i){if(i.includes("/escalations"))return["escalation","human-queue"]}const M1=2e3;function lj(i){const r=i.filter(l=>!l.pending).slice(-8);return r.length===0?"":`[Prior conversation]
|
|
59
|
+
${r.map(l=>`${l.role==="user"?"User":"Assistant"}: ${l.content}`).join(`
|
|
60
|
+
`)}
|
|
61
|
+
[End prior conversation]
|
|
62
|
+
|
|
63
|
+
`}function cj(i){const t=i.summary,r=i.title;if(t){const s=t.search(/\n\s*\{[\s\S]*"title"\s*:/);return s>0?t.slice(0,s).trim():t}return r||(typeof i=="string"?i:"Query completed.")}const _v=T.createContext(null);function uj({children:i}){const t=mn(),[r,s]=T.useState(!1),[l,c]=T.useState([]),[d,p]=T.useState(null),[g,f]=T.useState({}),m=T.useRef(null),b={page:t.pathname.split("/").filter(Boolean).join("-")||"home",route:t.pathname,params:{},...g,suggestedTags:g.suggestedTags??oj(t.pathname)};T.useEffect(()=>()=>{m.current&&clearInterval(m.current)},[]);const v=T.useCallback(()=>s(L=>!L),[]),_=T.useCallback(L=>{f(L)},[]),w=T.useCallback(()=>{c([]),p(null)},[]),S=T.useCallback(async L=>{var K;const z=new Date().toISOString(),se={id:`user-${Date.now()}`,role:"user",content:L,timestamp:z},oe={id:`pending-${Date.now()}`,role:"assistant",content:"",timestamp:z,pending:!0};c(P=>[...P,se,oe]);const M={...b};(K=M.entities)!=null&&K.yamlContent&&M.entities.yamlContent.length>M1&&(M.entities={...M.entities,yamlContent:M.entities.yamlContent.slice(0,M1)+`
|
|
64
|
+
... (truncated)`});const te=`${lj(l.concat(se))}${L}`;try{const Y=(await Ee("/insight/mcp-query",{method:"POST",body:JSON.stringify({prompt:te,tags:M.suggestedTags,context:M,wait:!1,direct:!0})})).workflow_id;p(Y),c(W=>W.map(X=>X.id===oe.id?{...X,workflowId:Y}:X)),m.current&&clearInterval(m.current),m.current=setInterval(async()=>{var W;try{const X=await Ee(`/workflows/${Y}/result`),he=(W=X==null?void 0:X.result)==null?void 0:W.data;if(he){m.current&&clearInterval(m.current),m.current=null,p(null);const _e=cj(he);let Te;try{Te=(await Ee(`/workflow-states/${Y}/execution`)).duration_ms}catch{}c(F=>F.map(ae=>ae.id===oe.id?{...ae,content:_e,timestamp:new Date().toISOString(),pending:!1,durationMs:Te}:ae))}}catch{}},3e3)}catch{c(P=>P.map(Y=>Y.id===oe.id?{...Y,content:"Failed to submit query. Please try again.",pending:!1}:Y))}},[l,b]),C=T.useCallback(async L=>{const z=l.find(M=>M.id===L);if(!(z!=null&&z.workflowId)||z.compilationStatus==="compiling"||z.compilationStatus==="done")return;const se=l.indexOf(z),oe=l.slice(0,se).reverse().find(M=>M.role==="user");if(oe){c(M=>M.map(B=>B.id===L?{...B,compilationStatus:"compiling"}:B));try{const M=await Ee("/insight/mcp-query/describe",{method:"POST",body:JSON.stringify({prompt:oe.content,summary:z.content})}),B=await Ee("/yaml-workflows",{method:"POST",body:JSON.stringify({workflow_id:z.workflowId,task_queue:"long-tail-system",workflow_name:"mcpQuery",name:M.tool_name,description:M.description,tags:M.tags,app_id:""})});await Ee(`/yaml-workflows/${B.id}/deploy`,{method:"POST"}),c(te=>te.map(K=>K.id===L?{...K,compilationStatus:"done"}:K))}catch(M){const B=M instanceof Error?M.message:"Compilation failed";c(te=>te.map(K=>K.id===L?{...K,compilationStatus:"error",compilationError:B}:K))}}},[l]);return y.jsx(_v.Provider,{value:{helpOpen:r,setHelpOpen:s,toggleHelp:v,messages:l,sendMessage:S,pageContext:b,setPageContext:_,activeWorkflowId:d,clearMessages:w,compileMessage:C},children:i})}function wv(){const i=T.useContext(_v);if(!i)throw new Error("useHelpAssistant must be used within HelpAssistantProvider");return i}function fj(){const{helpOpen:i,toggleHelp:t}=wv();return y.jsx("button",{onClick:t,className:"fixed right-3 z-[45] flex items-center justify-center w-10 h-10 rounded-full bg-surface-raised shadow-lg hover:scale-110 transition-transform duration-150 border border-accent/30",style:{bottom:"44px"},"aria-label":i?"Close help":"Ask for help",children:i?y.jsx(Cn,{className:"w-5 h-5 text-text-tertiary",strokeWidth:1.5}):y.jsx("span",{role:"img","aria-label":"Help",className:"logo-mark w-8 h-8 -rotate-[120deg]",style:{"--logo-url":`url(${Mt}/logo512.png)`}})})}const Sv=6048e5,hj=864e5,R1=6e4,D1=525600,q1=43200,B1=1440,L1=Symbol.for("constructDateFrom");function Er(i,t){return typeof i=="function"?i(t):i&&typeof i=="object"&&L1 in i?i[L1](t):i instanceof Date?new i.constructor(t):new Date(t)}function dn(i,t){return Er(t||i,i)}let dj={};function So(){return dj}function po(i,t){var p,g,f,m;const r=So(),s=(t==null?void 0:t.weekStartsOn)??((g=(p=t==null?void 0:t.locale)==null?void 0:p.options)==null?void 0:g.weekStartsOn)??r.weekStartsOn??((m=(f=r.locale)==null?void 0:f.options)==null?void 0:m.weekStartsOn)??0,l=dn(i,t==null?void 0:t.in),c=l.getDay(),d=(c<s?7:0)+c-s;return l.setDate(l.getDate()-d),l.setHours(0,0,0,0),l}function nu(i,t){return po(i,{...t,weekStartsOn:1})}function Ev(i,t){const r=dn(i,t==null?void 0:t.in),s=r.getFullYear(),l=Er(r,0);l.setFullYear(s+1,0,4),l.setHours(0,0,0,0);const c=nu(l),d=Er(r,0);d.setFullYear(s,0,4),d.setHours(0,0,0,0);const p=nu(d);return r.getTime()>=c.getTime()?s+1:r.getTime()>=p.getTime()?s:s-1}function ru(i){const t=dn(i),r=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return r.setUTCFullYear(t.getFullYear()),+i-+r}function Ov(i,...t){const r=Er.bind(null,i||t.find(s=>typeof s=="object"));return t.map(r)}function z1(i,t){const r=dn(i,t==null?void 0:t.in);return r.setHours(0,0,0,0),r}function mj(i,t,r){const[s,l]=Ov(r==null?void 0:r.in,i,t),c=z1(s),d=z1(l),p=+c-ru(c),g=+d-ru(d);return Math.round((p-g)/hj)}function pj(i,t){const r=Ev(i,t),s=Er(i,0);return s.setFullYear(r,0,4),s.setHours(0,0,0,0),nu(s)}function yj(i,t){const r=+dn(i)-+dn(t);return r<0?-1:r>0?1:r}function gj(i){return Er(i,Date.now())}function bj(i){return i instanceof Date||typeof i=="object"&&Object.prototype.toString.call(i)==="[object Date]"}function vj(i){return!(!bj(i)&&typeof i!="number"||isNaN(+dn(i)))}function xj(i){return t=>{const s=(i?Math[i]:Math.trunc)(t);return s===0?0:s}}function _j(i,t){const r=dn(i,t==null?void 0:t.in);return r.setFullYear(r.getFullYear(),0,1),r.setHours(0,0,0,0),r}const wj={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}},Sj=(i,t,r)=>{let s;const l=wj[i];return typeof l=="string"?s=l:t===1?s=l.one:s=l.other.replace("{{count}}",t.toString()),r!=null&&r.addSuffix?r.comparison&&r.comparison>0?"in "+s:s+" ago":s};function Gh(i){return(t={})=>{const r=t.width?String(t.width):i.defaultWidth;return i.formats[r]||i.formats[i.defaultWidth]}}const Ej={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},Oj={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},Aj={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},jj={date:Gh({formats:Ej,defaultWidth:"full"}),time:Gh({formats:Oj,defaultWidth:"full"}),dateTime:Gh({formats:Aj,defaultWidth:"full"})},Tj={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},Nj=(i,t,r,s)=>Tj[i];function eo(i){return(t,r)=>{const s=r!=null&&r.context?String(r.context):"standalone";let l;if(s==="formatting"&&i.formattingValues){const d=i.defaultFormattingWidth||i.defaultWidth,p=r!=null&&r.width?String(r.width):d;l=i.formattingValues[p]||i.formattingValues[d]}else{const d=i.defaultWidth,p=r!=null&&r.width?String(r.width):i.defaultWidth;l=i.values[p]||i.values[d]}const c=i.argumentCallback?i.argumentCallback(t):t;return l[c]}}const kj={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},Cj={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},Mj={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},Rj={narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},Dj={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},qj={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},Bj=(i,t)=>{const r=Number(i),s=r%100;if(s>20||s<10)switch(s%10){case 1:return r+"st";case 2:return r+"nd";case 3:return r+"rd"}return r+"th"},Lj={ordinalNumber:Bj,era:eo({values:kj,defaultWidth:"wide"}),quarter:eo({values:Cj,defaultWidth:"wide",argumentCallback:i=>i-1}),month:eo({values:Mj,defaultWidth:"wide"}),day:eo({values:Rj,defaultWidth:"wide"}),dayPeriod:eo({values:Dj,defaultWidth:"wide",formattingValues:qj,defaultFormattingWidth:"wide"})};function to(i){return(t,r={})=>{const s=r.width,l=s&&i.matchPatterns[s]||i.matchPatterns[i.defaultMatchWidth],c=t.match(l);if(!c)return null;const d=c[0],p=s&&i.parsePatterns[s]||i.parsePatterns[i.defaultParseWidth],g=Array.isArray(p)?Uj(p,b=>b.test(d)):zj(p,b=>b.test(d));let f;f=i.valueCallback?i.valueCallback(g):g,f=r.valueCallback?r.valueCallback(f):f;const m=t.slice(d.length);return{value:f,rest:m}}}function zj(i,t){for(const r in i)if(Object.prototype.hasOwnProperty.call(i,r)&&t(i[r]))return r}function Uj(i,t){for(let r=0;r<i.length;r++)if(t(i[r]))return r}function Pj(i){return(t,r={})=>{const s=t.match(i.matchPattern);if(!s)return null;const l=s[0],c=t.match(i.parsePattern);if(!c)return null;let d=i.valueCallback?i.valueCallback(c[0]):c[0];d=r.valueCallback?r.valueCallback(d):d;const p=t.slice(l.length);return{value:d,rest:p}}}const $j=/^(\d+)(th|st|nd|rd)?/i,Ij=/\d+/i,Hj={narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},Gj={any:[/^b/i,/^(a|c)/i]},Fj={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},Vj={any:[/1/i,/2/i,/3/i,/4/i]},Yj={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},Kj={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},Xj={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},Jj={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},Qj={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},Zj={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},Wj={ordinalNumber:Pj({matchPattern:$j,parsePattern:Ij,valueCallback:i=>parseInt(i,10)}),era:to({matchPatterns:Hj,defaultMatchWidth:"wide",parsePatterns:Gj,defaultParseWidth:"any"}),quarter:to({matchPatterns:Fj,defaultMatchWidth:"wide",parsePatterns:Vj,defaultParseWidth:"any",valueCallback:i=>i+1}),month:to({matchPatterns:Yj,defaultMatchWidth:"wide",parsePatterns:Kj,defaultParseWidth:"any"}),day:to({matchPatterns:Xj,defaultMatchWidth:"wide",parsePatterns:Jj,defaultParseWidth:"any"}),dayPeriod:to({matchPatterns:Qj,defaultMatchWidth:"any",parsePatterns:Zj,defaultParseWidth:"any"})},Av={code:"en-US",formatDistance:Sj,formatLong:jj,formatRelative:Nj,localize:Lj,match:Wj,options:{weekStartsOn:0,firstWeekContainsDate:1}};function e3(i,t){const r=dn(i,t==null?void 0:t.in);return mj(r,_j(r))+1}function t3(i,t){const r=dn(i,t==null?void 0:t.in),s=+nu(r)-+pj(r);return Math.round(s/Sv)+1}function jv(i,t){var m,b,v,_;const r=dn(i,t==null?void 0:t.in),s=r.getFullYear(),l=So(),c=(t==null?void 0:t.firstWeekContainsDate)??((b=(m=t==null?void 0:t.locale)==null?void 0:m.options)==null?void 0:b.firstWeekContainsDate)??l.firstWeekContainsDate??((_=(v=l.locale)==null?void 0:v.options)==null?void 0:_.firstWeekContainsDate)??1,d=Er((t==null?void 0:t.in)||i,0);d.setFullYear(s+1,0,c),d.setHours(0,0,0,0);const p=po(d,t),g=Er((t==null?void 0:t.in)||i,0);g.setFullYear(s,0,c),g.setHours(0,0,0,0);const f=po(g,t);return+r>=+p?s+1:+r>=+f?s:s-1}function n3(i,t){var p,g,f,m;const r=So(),s=(t==null?void 0:t.firstWeekContainsDate)??((g=(p=t==null?void 0:t.locale)==null?void 0:p.options)==null?void 0:g.firstWeekContainsDate)??r.firstWeekContainsDate??((m=(f=r.locale)==null?void 0:f.options)==null?void 0:m.firstWeekContainsDate)??1,l=jv(i,t),c=Er((t==null?void 0:t.in)||i,0);return c.setFullYear(l,0,s),c.setHours(0,0,0,0),po(c,t)}function r3(i,t){const r=dn(i,t==null?void 0:t.in),s=+po(r,t)-+n3(r,t);return Math.round(s/Sv)+1}function Ve(i,t){const r=i<0?"-":"",s=Math.abs(i).toString().padStart(t,"0");return r+s}const ii={y(i,t){const r=i.getFullYear(),s=r>0?r:1-r;return Ve(t==="yy"?s%100:s,t.length)},M(i,t){const r=i.getMonth();return t==="M"?String(r+1):Ve(r+1,2)},d(i,t){return Ve(i.getDate(),t.length)},a(i,t){const r=i.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return r.toUpperCase();case"aaa":return r;case"aaaaa":return r[0];case"aaaa":default:return r==="am"?"a.m.":"p.m."}},h(i,t){return Ve(i.getHours()%12||12,t.length)},H(i,t){return Ve(i.getHours(),t.length)},m(i,t){return Ve(i.getMinutes(),t.length)},s(i,t){return Ve(i.getSeconds(),t.length)},S(i,t){const r=t.length,s=i.getMilliseconds(),l=Math.trunc(s*Math.pow(10,r-3));return Ve(l,t.length)}},qs={midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},U1={G:function(i,t,r){const s=i.getFullYear()>0?1:0;switch(t){case"G":case"GG":case"GGG":return r.era(s,{width:"abbreviated"});case"GGGGG":return r.era(s,{width:"narrow"});case"GGGG":default:return r.era(s,{width:"wide"})}},y:function(i,t,r){if(t==="yo"){const s=i.getFullYear(),l=s>0?s:1-s;return r.ordinalNumber(l,{unit:"year"})}return ii.y(i,t)},Y:function(i,t,r,s){const l=jv(i,s),c=l>0?l:1-l;if(t==="YY"){const d=c%100;return Ve(d,2)}return t==="Yo"?r.ordinalNumber(c,{unit:"year"}):Ve(c,t.length)},R:function(i,t){const r=Ev(i);return Ve(r,t.length)},u:function(i,t){const r=i.getFullYear();return Ve(r,t.length)},Q:function(i,t,r){const s=Math.ceil((i.getMonth()+1)/3);switch(t){case"Q":return String(s);case"QQ":return Ve(s,2);case"Qo":return r.ordinalNumber(s,{unit:"quarter"});case"QQQ":return r.quarter(s,{width:"abbreviated",context:"formatting"});case"QQQQQ":return r.quarter(s,{width:"narrow",context:"formatting"});case"QQQQ":default:return r.quarter(s,{width:"wide",context:"formatting"})}},q:function(i,t,r){const s=Math.ceil((i.getMonth()+1)/3);switch(t){case"q":return String(s);case"qq":return Ve(s,2);case"qo":return r.ordinalNumber(s,{unit:"quarter"});case"qqq":return r.quarter(s,{width:"abbreviated",context:"standalone"});case"qqqqq":return r.quarter(s,{width:"narrow",context:"standalone"});case"qqqq":default:return r.quarter(s,{width:"wide",context:"standalone"})}},M:function(i,t,r){const s=i.getMonth();switch(t){case"M":case"MM":return ii.M(i,t);case"Mo":return r.ordinalNumber(s+1,{unit:"month"});case"MMM":return r.month(s,{width:"abbreviated",context:"formatting"});case"MMMMM":return r.month(s,{width:"narrow",context:"formatting"});case"MMMM":default:return r.month(s,{width:"wide",context:"formatting"})}},L:function(i,t,r){const s=i.getMonth();switch(t){case"L":return String(s+1);case"LL":return Ve(s+1,2);case"Lo":return r.ordinalNumber(s+1,{unit:"month"});case"LLL":return r.month(s,{width:"abbreviated",context:"standalone"});case"LLLLL":return r.month(s,{width:"narrow",context:"standalone"});case"LLLL":default:return r.month(s,{width:"wide",context:"standalone"})}},w:function(i,t,r,s){const l=r3(i,s);return t==="wo"?r.ordinalNumber(l,{unit:"week"}):Ve(l,t.length)},I:function(i,t,r){const s=t3(i);return t==="Io"?r.ordinalNumber(s,{unit:"week"}):Ve(s,t.length)},d:function(i,t,r){return t==="do"?r.ordinalNumber(i.getDate(),{unit:"date"}):ii.d(i,t)},D:function(i,t,r){const s=e3(i);return t==="Do"?r.ordinalNumber(s,{unit:"dayOfYear"}):Ve(s,t.length)},E:function(i,t,r){const s=i.getDay();switch(t){case"E":case"EE":case"EEE":return r.day(s,{width:"abbreviated",context:"formatting"});case"EEEEE":return r.day(s,{width:"narrow",context:"formatting"});case"EEEEEE":return r.day(s,{width:"short",context:"formatting"});case"EEEE":default:return r.day(s,{width:"wide",context:"formatting"})}},e:function(i,t,r,s){const l=i.getDay(),c=(l-s.weekStartsOn+8)%7||7;switch(t){case"e":return String(c);case"ee":return Ve(c,2);case"eo":return r.ordinalNumber(c,{unit:"day"});case"eee":return r.day(l,{width:"abbreviated",context:"formatting"});case"eeeee":return r.day(l,{width:"narrow",context:"formatting"});case"eeeeee":return r.day(l,{width:"short",context:"formatting"});case"eeee":default:return r.day(l,{width:"wide",context:"formatting"})}},c:function(i,t,r,s){const l=i.getDay(),c=(l-s.weekStartsOn+8)%7||7;switch(t){case"c":return String(c);case"cc":return Ve(c,t.length);case"co":return r.ordinalNumber(c,{unit:"day"});case"ccc":return r.day(l,{width:"abbreviated",context:"standalone"});case"ccccc":return r.day(l,{width:"narrow",context:"standalone"});case"cccccc":return r.day(l,{width:"short",context:"standalone"});case"cccc":default:return r.day(l,{width:"wide",context:"standalone"})}},i:function(i,t,r){const s=i.getDay(),l=s===0?7:s;switch(t){case"i":return String(l);case"ii":return Ve(l,t.length);case"io":return r.ordinalNumber(l,{unit:"day"});case"iii":return r.day(s,{width:"abbreviated",context:"formatting"});case"iiiii":return r.day(s,{width:"narrow",context:"formatting"});case"iiiiii":return r.day(s,{width:"short",context:"formatting"});case"iiii":default:return r.day(s,{width:"wide",context:"formatting"})}},a:function(i,t,r){const l=i.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return r.dayPeriod(l,{width:"abbreviated",context:"formatting"});case"aaa":return r.dayPeriod(l,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return r.dayPeriod(l,{width:"narrow",context:"formatting"});case"aaaa":default:return r.dayPeriod(l,{width:"wide",context:"formatting"})}},b:function(i,t,r){const s=i.getHours();let l;switch(s===12?l=qs.noon:s===0?l=qs.midnight:l=s/12>=1?"pm":"am",t){case"b":case"bb":return r.dayPeriod(l,{width:"abbreviated",context:"formatting"});case"bbb":return r.dayPeriod(l,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return r.dayPeriod(l,{width:"narrow",context:"formatting"});case"bbbb":default:return r.dayPeriod(l,{width:"wide",context:"formatting"})}},B:function(i,t,r){const s=i.getHours();let l;switch(s>=17?l=qs.evening:s>=12?l=qs.afternoon:s>=4?l=qs.morning:l=qs.night,t){case"B":case"BB":case"BBB":return r.dayPeriod(l,{width:"abbreviated",context:"formatting"});case"BBBBB":return r.dayPeriod(l,{width:"narrow",context:"formatting"});case"BBBB":default:return r.dayPeriod(l,{width:"wide",context:"formatting"})}},h:function(i,t,r){if(t==="ho"){let s=i.getHours()%12;return s===0&&(s=12),r.ordinalNumber(s,{unit:"hour"})}return ii.h(i,t)},H:function(i,t,r){return t==="Ho"?r.ordinalNumber(i.getHours(),{unit:"hour"}):ii.H(i,t)},K:function(i,t,r){const s=i.getHours()%12;return t==="Ko"?r.ordinalNumber(s,{unit:"hour"}):Ve(s,t.length)},k:function(i,t,r){let s=i.getHours();return s===0&&(s=24),t==="ko"?r.ordinalNumber(s,{unit:"hour"}):Ve(s,t.length)},m:function(i,t,r){return t==="mo"?r.ordinalNumber(i.getMinutes(),{unit:"minute"}):ii.m(i,t)},s:function(i,t,r){return t==="so"?r.ordinalNumber(i.getSeconds(),{unit:"second"}):ii.s(i,t)},S:function(i,t){return ii.S(i,t)},X:function(i,t,r){const s=i.getTimezoneOffset();if(s===0)return"Z";switch(t){case"X":return $1(s);case"XXXX":case"XX":return Pi(s);case"XXXXX":case"XXX":default:return Pi(s,":")}},x:function(i,t,r){const s=i.getTimezoneOffset();switch(t){case"x":return $1(s);case"xxxx":case"xx":return Pi(s);case"xxxxx":case"xxx":default:return Pi(s,":")}},O:function(i,t,r){const s=i.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+P1(s,":");case"OOOO":default:return"GMT"+Pi(s,":")}},z:function(i,t,r){const s=i.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+P1(s,":");case"zzzz":default:return"GMT"+Pi(s,":")}},t:function(i,t,r){const s=Math.trunc(+i/1e3);return Ve(s,t.length)},T:function(i,t,r){return Ve(+i,t.length)}};function P1(i,t=""){const r=i>0?"-":"+",s=Math.abs(i),l=Math.trunc(s/60),c=s%60;return c===0?r+String(l):r+String(l)+t+Ve(c,2)}function $1(i,t){return i%60===0?(i>0?"-":"+")+Ve(Math.abs(i)/60,2):Pi(i,t)}function Pi(i,t=""){const r=i>0?"-":"+",s=Math.abs(i),l=Ve(Math.trunc(s/60),2),c=Ve(s%60,2);return r+l+t+c}const I1=(i,t)=>{switch(i){case"P":return t.date({width:"short"});case"PP":return t.date({width:"medium"});case"PPP":return t.date({width:"long"});case"PPPP":default:return t.date({width:"full"})}},Tv=(i,t)=>{switch(i){case"p":return t.time({width:"short"});case"pp":return t.time({width:"medium"});case"ppp":return t.time({width:"long"});case"pppp":default:return t.time({width:"full"})}},i3=(i,t)=>{const r=i.match(/(P+)(p+)?/)||[],s=r[1],l=r[2];if(!l)return I1(i,t);let c;switch(s){case"P":c=t.dateTime({width:"short"});break;case"PP":c=t.dateTime({width:"medium"});break;case"PPP":c=t.dateTime({width:"long"});break;case"PPPP":default:c=t.dateTime({width:"full"});break}return c.replace("{{date}}",I1(s,t)).replace("{{time}}",Tv(l,t))},s3={p:Tv,P:i3},a3=/^D+$/,o3=/^Y+$/,l3=["D","DD","YY","YYYY"];function c3(i){return a3.test(i)}function u3(i){return o3.test(i)}function f3(i,t,r){const s=h3(i,t,r);if(console.warn(s),l3.includes(i))throw new RangeError(s)}function h3(i,t,r){const s=i[0]==="Y"?"years":"days of the month";return`Use \`${i.toLowerCase()}\` instead of \`${i}\` (in \`${t}\`) for formatting ${s} to the input \`${r}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}const d3=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,m3=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,p3=/^'([^]*?)'?$/,y3=/''/g,g3=/[a-zA-Z]/;function Nv(i,t,r){var m,b,v,_;const s=So(),l=s.locale??Av,c=s.firstWeekContainsDate??((b=(m=s.locale)==null?void 0:m.options)==null?void 0:b.firstWeekContainsDate)??1,d=s.weekStartsOn??((_=(v=s.locale)==null?void 0:v.options)==null?void 0:_.weekStartsOn)??0,p=dn(i,r==null?void 0:r.in);if(!vj(p))throw new RangeError("Invalid time value");let g=t.match(m3).map(w=>{const S=w[0];if(S==="p"||S==="P"){const C=s3[S];return C(w,l.formatLong)}return w}).join("").match(d3).map(w=>{if(w==="''")return{isToken:!1,value:"'"};const S=w[0];if(S==="'")return{isToken:!1,value:b3(w)};if(U1[S])return{isToken:!0,value:w};if(S.match(g3))throw new RangeError("Format string contains an unescaped latin alphabet character `"+S+"`");return{isToken:!1,value:w}});l.localize.preprocessor&&(g=l.localize.preprocessor(p,g));const f={firstWeekContainsDate:c,weekStartsOn:d,locale:l};return g.map(w=>{if(!w.isToken)return w.value;const S=w.value;(u3(S)||c3(S))&&f3(S,t,String(i));const C=U1[S[0]];return C(p,S,l.localize,f)}).join("")}function b3(i){const t=i.match(p3);return t?t[1].replace(y3,"'"):i}function v3(i,t,r){const s=So(),l=(r==null?void 0:r.locale)??s.locale??Av,c=yj(i,t);if(isNaN(c))throw new RangeError("Invalid time value");const d=Object.assign({},r,{addSuffix:r==null?void 0:r.addSuffix,comparison:c}),[p,g]=Ov(r==null?void 0:r.in,...c>0?[t,i]:[i,t]),f=xj((r==null?void 0:r.roundingMethod)??"round"),m=g.getTime()-p.getTime(),b=m/R1,v=ru(g)-ru(p),_=(m-v)/R1,w=r==null?void 0:r.unit;let S;if(w?S=w:b<1?S="second":b<60?S="minute":b<B1?S="hour":_<q1?S="day":_<D1?S="month":S="year",S==="second"){const C=f(m/1e3);return l.formatDistance("xSeconds",C,d)}else if(S==="minute"){const C=f(b);return l.formatDistance("xMinutes",C,d)}else if(S==="hour"){const C=f(b/60);return l.formatDistance("xHours",C,d)}else if(S==="day"){const C=f(_/B1);return l.formatDistance("xDays",C,d)}else if(S==="month"){const C=f(_/q1);return C===12&&w!=="month"?l.formatDistance("xYears",1,d):l.formatDistance("xMonths",C,d)}else{const C=f(_/D1);return l.formatDistance("xYears",C,d)}}function x3(i,t){return v3(i,gj(i),t)}function MN(i){return i.toLocaleString()}function RN(i){return i>=1e9?`${(i/1e9).toFixed(1).replace(/\.0$/,"")}B`:i>=1e6?`${(i/1e6).toFixed(1).replace(/\.0$/,"")}M`:i>=1e4?`${(i/1e3).toFixed(1).replace(/\.0$/,"")}K`:i.toLocaleString()}function _3(i){const t=new Date(i);return t.getTime()>Date.now()?"just now":x3(t,{addSuffix:!0})}function DN(i){const t=Date.now()-new Date(i).getTime();if(t<0)return"now";const r=Math.floor(t/1e3);if(r<60)return`${r}s`;const s=Math.floor(r/60);if(s<60)return`${s}m`;const l=Math.floor(s/60);if(l<24)return`${l}h`;const c=Math.floor(l/24);return c<7?`${c}d`:c<30?`${Math.floor(c/7)}w`:c<365?`${Math.floor(c/30)}mo`:`${Math.floor(c/365)}y`}function qN(i){return i<=0?"Expired":Kd(i)}function w3(i){return i==null?"--":Kd(i)}function Kd(i){if(i<1e3)return`${Math.round(i)}ms`;if(i<6e4){const d=i/1e3;return Number.isInteger(d)?`${d}s`:`${d.toFixed(1)}s`}const t=Math.floor(i/1e3),r=Math.floor(t/86400),s=Math.floor(t%86400/3600),l=Math.floor(t%3600/60),c=t%60;return r>0?s>0?`${r}d ${s}h`:`${r}d`:s>0?l>0?`${s}h ${l}m`:`${s}h`:c>0?`${l}m ${c}s`:`${l}m`}function BN(i,t){const r=new Date(i).getTime(),s=t?new Date(t).getTime():Date.now();return Kd(s-r)}function kv({options:i,children:t,className:r=""}){const[s,l]=T.useState(!1),[c,d]=T.useState(null),[p,g]=T.useState(null),f=T.useRef(null),m=T.useRef(void 0),b=T.useRef(void 0),v=220,_=T.useCallback(()=>{if(!f.current)return;const L=f.current.getBoundingClientRect(),z=window.innerWidth-v-8,se=Math.max(8,Math.min(L.left,z));g({top:L.bottom+4,left:se})},[]),w=T.useCallback(async(L,z)=>{try{await navigator.clipboard.writeText(L),d(z),clearTimeout(m.current),m.current=setTimeout(()=>d(null),1200)}catch{}},[]),S=T.useCallback(()=>{clearTimeout(b.current),_(),l(!0)},[_]),C=T.useCallback(()=>{b.current=setTimeout(()=>l(!1),150)},[]);return T.useEffect(()=>()=>{clearTimeout(m.current),clearTimeout(b.current)},[]),y.jsxs("span",{ref:f,className:`inline-flex items-center cursor-default ${r}`,onMouseEnter:S,onMouseLeave:C,children:[t,s&&p&&J1.createPortal(y.jsx("span",{className:"fixed z-[9999] bg-surface-raised border border-surface-border rounded shadow-lg py-1 min-w-[180px]",style:{top:p.top,left:p.left},onMouseEnter:S,onMouseLeave:C,children:i.map(L=>y.jsxs("button",{onClick:z=>{z.stopPropagation(),w(L.value,L.label)},className:"flex items-center justify-between w-full px-2.5 py-1 text-left hover:bg-surface-hover transition-colors",children:[y.jsx("span",{className:"text-2xs font-medium uppercase tracking-wider text-text-tertiary w-10 shrink-0",children:L.label}),y.jsx("span",{className:"text-2xs font-mono text-text-secondary truncate ml-2",children:c===L.label?"✓":L.value})]},L.label))}),document.body)]})}function S3(i,t){const r=new Date(i);switch(t){case"relative":return _3(i);case"datetime":return Nv(r,"MMM d, yyyy h:mm a");case"time":return r.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit",second:"2-digit"})}}function E3(i){const t=new Date(i);return[{label:"ms",value:String(t.getTime())},{label:"utc",value:t.toISOString()},{label:"local",value:Nv(t,"MMM d, yyyy h:mm:ss a")}]}function O3({date:i,format:t="relative",className:r=""}){const[,s]=T.useState(0);T.useEffect(()=>{if(t!=="relative")return;const c=setInterval(()=>s(d=>d+1),3e4);return()=>clearInterval(c)},[t]);const l=T.useMemo(()=>E3(i),[i]);return y.jsx(kv,{options:l,children:y.jsx("time",{dateTime:i,className:`text-xs text-text-tertiary ${r}`,children:S3(i,t)})})}function A3({ms:i,className:t=""}){const r=w3(i),s=T.useMemo(()=>i==null?[]:[{label:"ms",value:String(i)},{label:"sec",value:`${(i/1e3).toFixed(3)}s`},{label:"text",value:r}],[i,r]);return i==null?y.jsx("span",{className:`text-xs text-text-tertiary ${t}`,children:"--"}):y.jsx(kv,{options:s,children:y.jsx("span",{className:`text-xs text-text-tertiary ${t}`,children:r})})}const j3=["sm","md","lg","full"],H1={sm:"w-[28rem] max-h-[40vh]",md:"w-[36rem] max-h-[60vh]",lg:"w-[48rem] max-h-[80vh]",full:"inset-4 w-auto max-h-none"},G1={sm:"Small",md:"Medium",lg:"Large",full:"Fullscreen"};function T3({which:i}){const t="stroke-current";switch(i){case"sm":return y.jsx("svg",{width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",children:y.jsx("rect",{x:"5",y:"5",width:"7",height:"7",rx:"1.5",className:t,strokeWidth:"1.5"})});case"md":return y.jsx("svg",{width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",children:y.jsx("rect",{x:"3",y:"3",width:"9",height:"9",rx:"1.5",className:t,strokeWidth:"1.5"})});case"lg":return y.jsx("svg",{width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",children:y.jsx("rect",{x:"1.5",y:"1.5",width:"11",height:"11",rx:"1.5",className:t,strokeWidth:"1.5"})});case"full":return y.jsx("svg",{width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",children:y.jsx("rect",{x:"0.75",y:"0.75",width:"12.5",height:"12.5",rx:"1.5",className:t,strokeWidth:"1.5"})})}}function N3({msg:i}){const[t,r]=T.useState(0);T.useEffect(()=>{const d=new Date(i.timestamp).getTime(),p=()=>r(Math.floor((Date.now()-d)/1e3));p();const g=setInterval(p,1e3);return()=>clearInterval(g)},[i.timestamp]);const s=Math.floor(t/60),l=t%60,c=s>0?`${s}m ${l}s`:`${l}s`;return y.jsxs("span",{className:"inline-flex flex-col gap-1.5",children:[y.jsxs("span",{className:"inline-flex items-center gap-1",children:[y.jsx("span",{className:"text-text-tertiary",children:"Thinking"}),y.jsx("span",{className:"inline-block w-1 h-1 rounded-full bg-text-tertiary animate-pulse"}),y.jsx("span",{className:"inline-block w-1 h-1 rounded-full bg-text-tertiary animate-pulse [animation-delay:150ms]"}),y.jsx("span",{className:"inline-block w-1 h-1 rounded-full bg-text-tertiary animate-pulse [animation-delay:300ms]"}),y.jsx("span",{className:"text-text-muted ml-1 tabular-nums",children:c})]}),i.workflowId&&y.jsxs($i,{to:`/workflows/executions/${i.workflowId}`,className:"inline-flex items-center gap-1 text-2xs text-accent/70 hover:text-accent transition-colors",children:[y.jsx(xd,{className:"w-2.5 h-2.5",strokeWidth:1.5}),"watch execution"]})]})}function k3({msg:i,compileMessage:t}){const r=i.role==="assistant";return y.jsxs("div",{className:`flex items-center gap-1.5 ${r?"justify-start":"justify-end"}`,children:[y.jsx(O3,{date:i.timestamp,format:"time",className:"!text-2xs text-text-muted/50"}),i.durationMs!=null&&y.jsxs(y.Fragment,{children:[y.jsx("span",{className:"text-text-muted/30 text-2xs",children:"·"}),y.jsx(A3,{ms:i.durationMs,className:"!text-2xs text-text-muted/50"})]}),i.workflowId&&y.jsx($i,{to:`/workflows/executions/${i.workflowId}`,className:"text-text-muted/40 hover:text-accent transition-colors",title:"View workflow execution",children:y.jsx(xd,{className:"w-2.5 h-2.5",strokeWidth:1.5})}),r&&i.workflowId&&!i.pending&&y.jsx("button",{onClick:()=>t(i.id),disabled:i.compilationStatus==="compiling"||i.compilationStatus==="done",className:"transition-colors",title:i.compilationStatus==="done"?"Compiled — future queries will match this pipeline":i.compilationStatus==="error"?i.compilationError??"Compilation failed":i.compilationStatus==="compiling"?"Compiling...":"Compile to fast pipeline",children:y.jsx(vw,{className:`w-2.5 h-2.5 ${i.compilationStatus==="done"?"text-status-success":i.compilationStatus==="error"?"text-status-error":i.compilationStatus==="compiling"?"text-accent/40 animate-pulse":"text-text-muted/40 hover:text-accent"}`,strokeWidth:1.5})})]})}function C3(){const{helpOpen:i,setHelpOpen:t,messages:r,sendMessage:s,pageContext:l,activeWorkflowId:c,clearMessages:d,compileMessage:p}=wv(),[g,f]=T.useState(""),[m,b]=T.useState("md"),[v,_]=T.useState(!0),w=T.useRef(null),S=T.useRef(null);if(T.useEffect(()=>{w.current&&(w.current.scrollTop=w.current.scrollHeight)},[r]),T.useEffect(()=>{i&&S.current&&S.current.focus()},[i]),T.useEffect(()=>{if(!i)return;const M=B=>{B.key==="Escape"&&(m==="full"?b("lg"):m==="lg"?b("md"):m==="md"?b("sm"):t(!1))};return document.addEventListener("keydown",M),()=>document.removeEventListener("keydown",M)},[i,m,t]),!i)return null;const C=()=>{const M=g.trim();!M||c||(s(M),f(""),S.current&&(S.current.style.height="auto"))},L=M=>{M.key==="Enter"&&!M.shiftKey&&(M.preventDefault(),C())},z=m==="full",se=l.page.replace(/-/g," "),oe=z?{}:{bottom:"108px"};return y.jsxs("div",{className:`fixed z-[45] flex flex-col border border-surface-border rounded-lg overflow-hidden transition-all duration-300 ${z?H1.full:`right-6 ${H1[m]}`} ${v?"bg-surface-raised shadow-xl":"bg-surface-raised/[0.03] shadow-lg shadow-black/5"}`,style:oe,onMouseEnter:()=>_(!0),onMouseLeave:()=>_(!1),children:[y.jsxs("div",{className:`flex items-center justify-between px-4 py-2.5 border-b border-surface-border shrink-0 transition-all duration-300 ${v?"opacity-100":"opacity-50 grayscale brightness-150"}`,children:[y.jsxs("div",{className:"min-w-0 flex-1",children:[y.jsx("p",{className:"text-xs font-medium text-text-primary truncate",children:"Help Assistant"}),y.jsx("p",{className:"text-2xs text-text-tertiary truncate",children:se})]}),y.jsxs("div",{className:"flex items-center gap-1 ml-2",children:[y.jsx("div",{className:"flex items-center gap-0.5 border border-surface-border rounded p-0.5",role:"radiogroup","aria-label":"Panel size",children:j3.map(M=>y.jsx("button",{onClick:()=>b(M),className:`p-1 rounded transition-colors ${M===m?"bg-accent/15 text-accent":"text-text-muted hover:text-text-secondary hover:bg-surface-hover"}`,role:"radio","aria-checked":M===m,"aria-label":G1[M],title:G1[M],children:y.jsx(T3,{which:M})},M))}),r.length>0&&y.jsx("button",{onClick:d,className:"p-1 text-text-tertiary hover:text-text-secondary transition-colors","aria-label":"Clear conversation",title:"Clear conversation",children:y.jsx(xw,{className:"w-3.5 h-3.5",strokeWidth:1.5})}),y.jsx("button",{onClick:()=>t(!1),className:"p-1 text-text-tertiary hover:text-text-primary transition-colors","aria-label":"Close",title:"Close",children:y.jsx(Cn,{className:"w-3.5 h-3.5",strokeWidth:1.5})})]})]}),y.jsxs("div",{ref:w,className:`flex-1 overflow-y-auto px-4 py-3 space-y-3 min-h-[120px] transition-all duration-300 ${v?"opacity-100":"opacity-50 grayscale brightness-150"}`,children:[r.length===0&&y.jsx("p",{className:"text-xs text-text-tertiary text-center py-6",children:"Ask anything about what you're viewing."}),r.map(M=>y.jsxs("div",{className:`text-xs leading-relaxed ${M.role==="user"?"text-right":"text-left"}`,children:[y.jsx("div",{className:`inline-block max-w-[85%] px-3 py-2 rounded-md whitespace-pre-wrap ${M.role==="user"?"bg-accent/10 text-text-primary":"bg-surface-sunken text-text-secondary"}`,children:M.pending?y.jsx(N3,{msg:M}):M.role==="assistant"?y.jsx(Yd,{content:M.content}):M.content}),!M.pending&&y.jsx("div",{className:"mt-0.5",children:y.jsx(k3,{msg:M,compileMessage:p})})]},M.id))]}),y.jsxs("div",{className:`border-t border-surface-border px-3 py-2.5 flex gap-2 shrink-0 transition-all duration-300 ${v?"opacity-100":"opacity-50 grayscale brightness-150"}`,children:[y.jsx("textarea",{ref:S,value:g,onChange:M=>{f(M.target.value);const B=M.target;B.style.height="auto",B.style.height=`${Math.min(B.scrollHeight,120)}px`},onKeyDown:L,placeholder:"Ask a question...",rows:2,className:"flex-1 resize-none bg-surface text-xs text-text-primary placeholder:text-text-tertiary rounded px-2.5 py-1.5 border border-surface-border focus:outline-none focus:border-accent",style:{minHeight:"2.5rem"},disabled:!!c}),y.jsx("button",{onClick:C,disabled:!g.trim()||!!c,className:"px-2.5 py-1.5 text-accent hover:text-accent-hover disabled:text-text-muted transition-colors self-end","aria-label":"Send",children:y.jsx(_w,{className:"w-4 h-4",strokeWidth:1.5})})]})]})}const M3=6e3,R3="scan";function D3(){var d;const{lastResult:i}=rv(),{open:t,ownerKey:r}=Fd(),[s,l]=T.useState(null);if(T.useEffect(()=>{if(!i)return;const p=setTimeout(()=>l(i.at),M3);return()=>clearTimeout(p)},[i]),!i||i.navigated||s===i.at||t&&r===R3)return null;const{response:c}=i;return y.jsx("div",{role:"status",className:"fixed bottom-14 right-4 z-[60] w-80 max-w-[calc(100vw-2rem)] bg-surface-raised border border-surface-border shadow-lg rounded-md animate-page-in",children:y.jsxs("div",{className:"flex items-start gap-2.5 px-3.5 py-3",children:[y.jsx(iu,{className:"w-4 h-4 mt-0.5 text-accent-muted shrink-0",strokeWidth:1.5}),y.jsxs("div",{className:"flex-1 min-w-0",children:[y.jsx("div",{className:"text-sm font-mono text-text-secondary truncate",children:i.code}),c?y.jsxs(y.Fragment,{children:[y.jsxs("div",{className:`text-sm font-medium ${dv[c.outcome]}`,children:[hv[c.outcome],c.rule?` — ${c.rule.name}`:""]}),c.error&&y.jsx("div",{className:"text-xs text-text-tertiary mt-0.5",children:c.error}),c.outcome===ht.NO_MATCH_FALLBACK&&((d=c.fallback)==null?void 0:d.markdown)&&y.jsx("div",{className:"text-xs text-text-secondary mt-1.5",children:y.jsx(mv,{content:c.fallback.markdown,compact:!0})})]}):y.jsx("div",{className:"text-sm text-status-error",children:i.error})]}),y.jsx("button",{type:"button",onClick:()=>l(i.at),className:"text-text-tertiary hover:text-text-primary shrink-0",title:"Dismiss",children:y.jsx(Cn,{className:"w-3.5 h-3.5"})})]})})}function q3(){var se;const{isBuilder:i,isOps:t,viewAs:r}=Pb(),{canSeePaceBoard:s}=$b();YE();const{data:l}=Or(),c=Lb(),d=c!==null?c:!!((se=l==null?void 0:l.ai)!=null&&se.enabled),{collapsed:p,toggle:g}=Hd(),[f,m]=T.useState(!1),[b,v]=T.useState(!1),[_,w]=T.useState(!1),[S,C]=T.useState(()=>window.location.hash.startsWith("#docs")),L=mn(),z=T.useRef(null);return T.useEffect(()=>{const oe=z.current;oe&&(oe.classList.remove("animate-page-in"),oe.offsetWidth,oe.classList.add("animate-page-in"))},[L.pathname]),T.useEffect(()=>{const oe=()=>{window.location.hash.startsWith("#docs")&&C(!0)};return window.addEventListener("hashchange",oe),()=>window.removeEventListener("hashchange",oe)},[]),y.jsxs("div",{className:"h-screen bg-surface flex flex-col",children:[y.jsx(cA,{onToggleEventFeed:()=>m(oe=>!oe),onToggleDocs:()=>C(oe=>!oe),onToggleNav:()=>v(oe=>!oe)}),y.jsxs("div",{className:"flex flex-1 overflow-hidden",children:[y.jsxs("aside",{className:`${p?"w-16":"w-60"} shrink-0 bg-surface-raised border-r border-surface-border hidden lg:flex flex-col transition-[width] duration-200 ease-out overflow-hidden relative z-20`,children:[y.jsx("nav",{className:"flex-1 px-3 pt-[36px] pb-4 space-y-2 overflow-y-auto overflow-x-hidden",children:y.jsx(yv,{aiEnabled:d,isBuilder:i,isOps:t,viewAs:r,canSeePaceBoard:s})}),y.jsx("button",{onClick:g,className:`shrink-0 py-3 text-text-tertiary hover:text-text-secondary transition-colors duration-150 ${p?"flex justify-center":"flex items-center px-7"}`,"aria-label":p?"Expand sidebar":"Collapse sidebar",children:p?y.jsx(ww,{className:"w-4 h-4 text-accent-muted",strokeWidth:1.5}):y.jsx(Sw,{className:"w-4 h-4 text-accent-muted",strokeWidth:1.5})}),!p&&(l==null?void 0:l.environment)&&y.jsxs("div",{className:"shrink-0 px-5 pb-3 text-2xs leading-tight text-text-tertiary whitespace-nowrap overflow-hidden text-ellipsis",title:`long-tail v${l.environment.longTailVersion} · HotMesh v${l.environment.hotmeshVersion} · Node ${l.environment.nodeVersion} · ${l.environment.nodeEnv}`,children:["long-tail v",l.environment.longTailVersion,y.jsx("span",{className:"mx-1 text-surface-border",children:"·"}),"HotMesh v",l.environment.hotmeshVersion]})]}),y.jsx("main",{className:"flex-1 min-w-0 overflow-y-auto",children:y.jsx("div",{ref:z,className:"w-full px-page-x py-8 pb-16 animate-page-in h-full flex flex-col @container",children:y.jsx(Ls,{})})}),y.jsx(B3,{})]}),y.jsx(CA,{open:b,onClose:()=>v(!1),aiEnabled:d,isBuilder:i,isOps:t,viewAs:r,canSeePaceBoard:s}),y.jsx(JA,{open:f,onToggle:()=>m(oe=>!oe),configOpen:_,onToggleConfig:()=>w(oe=>!oe)}),y.jsx(aj,{open:S,onClose:()=>{C(!1),history.replaceState(null,"",window.location.pathname+window.location.search)}}),d&&y.jsx(fj,{}),d&&y.jsx(C3,{}),y.jsx(D3,{})]})}function B3(){const{node:i,width:t,open:r}=Fd();return y.jsx(ZE,{open:r,width:t,className:"border-l border-surface-border bg-surface-raised",children:i})}function L3(){const{isAuthenticated:i}=pn(),t=mn();return i?y.jsx(XE,{children:y.jsx(QE,{children:y.jsx(uj,{children:y.jsx(yO,{children:y.jsx(q3,{})})})})}):y.jsx(Kn,{to:"/login",state:{from:t.pathname},replace:!0})}function Cv({provider:i,className:t="w-5 h-5"}){switch(i){case"google":return y.jsxs("svg",{className:t,viewBox:"0 0 24 24",fill:"currentColor",children:[y.jsx("path",{d:"M22.56 12.25c0-.78-.07-1.53-.2-2.25H12v4.26h5.92a5.06 5.06 0 0 1-2.2 3.32v2.77h3.57c2.08-1.92 3.28-4.74 3.28-8.1z",fill:"#4285F4"}),y.jsx("path",{d:"M12 23c2.97 0 5.46-.98 7.28-2.66l-3.57-2.77c-.98.66-2.23 1.06-3.71 1.06-2.86 0-5.29-1.93-6.16-4.53H2.18v2.84C3.99 20.53 7.7 23 12 23z",fill:"#34A853"}),y.jsx("path",{d:"M5.84 14.09c-.22-.66-.35-1.36-.35-2.09s.13-1.43.35-2.09V7.07H2.18C1.43 8.55 1 10.22 1 12s.43 3.45 1.18 4.93l2.85-2.22.81-.62z",fill:"#FBBC05"}),y.jsx("path",{d:"M12 5.38c1.62 0 3.06.56 4.21 1.64l3.15-3.15C17.45 2.09 14.97 1 12 1 7.7 1 3.99 3.47 2.18 7.07l3.66 2.84c.87-2.6 3.3-4.53 6.16-4.53z",fill:"#EA4335"})]});case"github":return y.jsx("svg",{className:t,viewBox:"0 0 24 24",fill:"currentColor",children:y.jsx("path",{d:"M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-1.703-2.782.605-3.369-1.343-3.369-1.343-.454-1.158-1.11-1.466-1.11-1.466-.908-.62.069-.608.069-.608 1.003.07 1.531 1.032 1.531 1.032.892 1.53 2.341 1.088 2.91.832.092-.647.35-1.088.636-1.338-2.22-.253-4.555-1.113-4.555-4.951 0-1.093.39-1.988 1.029-2.688-.103-.253-.446-1.272.098-2.65 0 0 .84-.27 2.75 1.026A9.564 9.564 0 0 1 12 6.844c.85.004 1.705.115 2.504.337 1.909-1.296 2.747-1.027 2.747-1.027.546 1.379.202 2.398.1 2.651.64.7 1.028 1.595 1.028 2.688 0 3.848-2.339 4.695-4.566 4.943.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0 0 22 12.017C22 6.484 17.522 2 12 2z"})});case"microsoft":return y.jsxs("svg",{className:t,viewBox:"0 0 24 24",fill:"currentColor",children:[y.jsx("path",{d:"M3 3h8.5v8.5H3z",fill:"#F25022"}),y.jsx("path",{d:"M12.5 3H21v8.5h-8.5z",fill:"#7FBA00"}),y.jsx("path",{d:"M3 12.5h8.5V21H3z",fill:"#00A4EF"}),y.jsx("path",{d:"M12.5 12.5H21V21h-8.5z",fill:"#FFB900"})]});case"anthropic":return y.jsx("svg",{className:t,viewBox:"0 0 24 24",fill:"currentColor",children:y.jsx("path",{d:"M13.827 3.52h3.603L24 20.48h-3.603l-6.57-16.96zm-7.258 0h3.767L16.906 20.48h-3.674l-1.343-3.461H6.396l-1.34 3.461H1.5l5.07-16.96zm2.327 5.14l-2.065 5.326h4.108l-2.043-5.326z"})});default:return y.jsxs("svg",{className:t,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[y.jsx("circle",{cx:"12",cy:"12",r:"10"}),y.jsx("path",{d:"M12 8v4l3 3"})]})}}async function z3(){return Ee("/auth/oauth/providers")}async function U3(i,t){const r=t?`?label=${encodeURIComponent(t)}`:"";return Ee(`/auth/oauth/connections/${i}${r}`,{method:"DELETE"})}function LN(){return ot({queryKey:["oauth-connections"],queryFn:()=>Ee("/auth/oauth/connections")})}function zN(){const i=st();return dt({mutationFn:({provider:t,label:r})=>U3(t,r),onSuccess:()=>{i.invalidateQueries({queryKey:["oauth-connections"]})}})}function P3(){var te;const{login:i,isAuthenticated:t}=pn(),r=yo(),s=mn(),l=new URLSearchParams(s.search),c=l.get("token"),d=l.get("error"),p=((te=s.state)==null?void 0:te.from)??l.get("returnTo")??"/",g=T.useRef(!1);c&&!g.current&&(g.current=!0,i(c,void 0,{displayName:l.get("displayName"),username:l.get("username")}));const[f,m]=T.useState(""),[b,v]=T.useState(""),[_,w]=T.useState(d||""),[S,C]=T.useState(!1),[L,z]=T.useState(!!c),[se,oe]=T.useState([]),M=T.useRef(!1);if(T.useEffect(()=>{c||M.current||(M.current=!0,(async()=>{var K,P,Y,W;try{const X=await fetch(`${Mt}/api/settings`);if(!X.ok)return;const he=await X.json();if(!((K=he.auth)!=null&&K.sso))return;const _e=await fetch(`${Mt}/api/auth/sso`,{method:"POST"});if(!_e.ok){w("Host authentication required — please log in to your organization first");return}const Te=await _e.json();Te.token&&((P=he.auth)!=null&&P.ssoLogoutUrl&&sessionStorage.setItem("lt_sso_logout_url",he.auth.ssoLogoutUrl),z(!0),i(Te.token,void 0,{displayName:(Y=Te.user)==null?void 0:Y.display_name,username:(W=Te.user)==null?void 0:W.external_id}))}catch{}})())},[]),T.useEffect(()=>{c||z3().then(oe).catch(()=>{})},[]),T.useEffect(()=>{if(!L)return;const K=setTimeout(()=>r(p,{replace:!0}),1500);return()=>clearTimeout(K)},[L]),t&&!L)return y.jsx(Kn,{to:p,replace:!0});const B=async K=>{var P,Y;if(K.preventDefault(),w(""),!f.trim()||!b){w("Username and password are required");return}C(!0);try{const W=await fetch(`${Mt}/api/auth/login`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({username:f.trim(),password:b})}),X=await W.json();if(!W.ok){w(X.error||"Login failed");return}z(!0),i(X.token,{username:f.trim(),password:b},{displayName:(P=X.user)==null?void 0:P.display_name,username:(Y=X.user)==null?void 0:Y.external_id})}catch{w("Unable to connect to server")}finally{C(!1)}};return y.jsx("div",{className:"min-h-screen bg-surface flex items-center justify-center overflow-hidden",children:y.jsxs("div",{className:"w-full max-w-md p-10",children:[y.jsx("div",{className:`mb-10 transition-all duration-[1500ms] ease-in ${L?"translate-x-[120vw] -translate-y-[60vh] scale-[3] opacity-0":""}`,children:y.jsx(eu,{size:"lg",hideLabel:L})}),y.jsxs("form",{onSubmit:B,className:`space-y-5 transition-opacity duration-300 ${L?"opacity-0":""}`,children:[y.jsxs("div",{children:[y.jsx("label",{htmlFor:"username",className:"block text-sm font-medium text-text-secondary mb-2",children:"Username"}),y.jsx("input",{id:"username",type:"text",value:f,onChange:K=>m(K.target.value),className:"input",placeholder:"Enter your username",autoFocus:!L,autoComplete:"username"})]}),y.jsxs("div",{children:[y.jsx("label",{htmlFor:"password",className:"block text-sm font-medium text-text-secondary mb-2",children:"Password"}),y.jsx("input",{id:"password",type:"password",value:b,onChange:K=>v(K.target.value),className:"input",placeholder:"Enter your password",autoComplete:"current-password"})]}),_&&y.jsx("p",{className:"text-sm text-status-error",children:_}),y.jsx("button",{type:"submit",className:"btn-primary w-full",disabled:S||L,children:S?"Signing in...":"Sign In"}),se.length>0&&y.jsxs(y.Fragment,{children:[y.jsxs("div",{className:"flex items-center gap-3 mt-6",children:[y.jsx("div",{className:"flex-1 h-px bg-border"}),y.jsx("span",{className:"text-xs text-text-tertiary",children:"or continue with"}),y.jsx("div",{className:"flex-1 h-px bg-border"})]}),y.jsx("div",{className:"space-y-2",children:se.filter(K=>K.provider!=="anthropic").map(K=>y.jsxs("a",{href:`${Mt}/api/auth/oauth/${K.provider}?returnTo=${encodeURIComponent(p)}`,className:"btn-secondary w-full flex items-center justify-center gap-2",children:[y.jsx(Cv,{provider:K.provider}),"Sign in with ",K.name]},K.provider))})]})]})]})})}function F1(){const{isAuthenticated:i}=pn(),t=yo(),r=mn(),s=new URLSearchParams(r.search),l=s.get("state")||"";T.useEffect(()=>{i||t(`/login?returnTo=${encodeURIComponent(r.pathname+r.search)}`)},[i]);const[c,d]=T.useState(""),[p,g]=T.useState(s.get("label")||"default"),[f,m]=T.useState(""),[b,v]=T.useState(!1),_=c.trim().startsWith("sk-ant-oat"),w=c.trim().startsWith("sk-ant-api"),S=C=>{C.preventDefault();const L=c.trim();if(!L){m("A token or API key is required");return}if(!L.startsWith("sk-ant-")){m('Invalid format. Must start with "sk-ant-oat" (OAuth token) or "sk-ant-api" (API key)');return}v(!0),m("");const z=`${Mt}/api/auth/oauth/anthropic/callback?code=${encodeURIComponent(L)}&state=${encodeURIComponent(l)}`;window.location.href=z};return y.jsx("div",{className:"min-h-screen bg-surface flex items-center justify-center",children:y.jsxs("div",{className:"w-full max-w-md p-10",children:[y.jsx("div",{className:"mb-10",children:y.jsx(eu,{size:"lg"})}),y.jsxs("div",{className:"flex items-center gap-2 mb-6",children:[y.jsx(Cv,{provider:"anthropic",className:"w-6 h-6"}),y.jsx("h2",{className:"heading-3",children:"Connect Anthropic"})]}),y.jsx("p",{className:"text-sm text-text-secondary mb-4",children:"Connect your Anthropic account so Claude Code tasks run under your credentials. Your token is encrypted at rest."}),y.jsxs("form",{onSubmit:S,className:"space-y-5",children:[y.jsxs("div",{children:[y.jsx("label",{htmlFor:"token",className:"block text-sm font-medium text-text-secondary mb-2",children:"OAuth Token or API Key"}),y.jsx("input",{id:"token",type:"password",value:c,onChange:C=>d(C.target.value),className:"input",placeholder:"sk-ant-oat01-... or sk-ant-api03-...",autoFocus:!0,autoComplete:"off"}),_&&y.jsx("p",{className:"text-xs text-status-success mt-1",children:"OAuth token detected — uses your Claude subscription (flat rate)"}),w&&y.jsx("p",{className:"text-xs text-status-warning mt-1",children:"API key detected — billed per-token from your Anthropic API account"})]}),y.jsxs("div",{children:[y.jsx("label",{htmlFor:"label",className:"block text-sm font-medium text-text-secondary mb-2",children:"Label"}),y.jsx("input",{id:"label",type:"text",value:p,onChange:C=>g(C.target.value.replace(/\s+/g,"-").toLowerCase()),className:"input",placeholder:"default",autoComplete:"off"}),y.jsx("p",{className:"text-xs text-text-tertiary mt-1",children:'A name for this credential. Use different labels to store multiple credentials (e.g., "subscription", "api-batch").'})]}),f&&y.jsx("p",{className:"text-sm text-status-error",children:f}),y.jsx("button",{type:"submit",className:"btn-primary w-full",disabled:b,children:b?"Validating...":"Connect"}),y.jsx("a",{href:"/",className:"block text-center text-sm text-text-tertiary hover:text-text-secondary",children:"Cancel"})]}),y.jsxs("div",{className:"mt-6 space-y-3 text-xs text-text-tertiary",children:[y.jsxs("div",{children:[y.jsx("span",{className:"font-medium text-text-secondary",children:"Recommended:"})," ","Run"," ",y.jsx("code",{className:"px-1 py-0.5 bg-surface-sunken rounded text-2xs",children:"claude setup-token"})," ","in your terminal to generate an OAuth token that uses your subscription."]}),y.jsxs("div",{children:[y.jsx("span",{className:"font-medium text-text-secondary",children:"Alternative:"})," ","Use an API key from"," ",y.jsx("a",{href:"https://console.anthropic.com/settings/keys",target:"_blank",rel:"noopener noreferrer",className:"text-accent-secondary hover:underline",children:"console.anthropic.com"})," ","(billed per-token)."]})]})]})})}function zc({roleTypes:i,roleNames:t,redirectTo:r="/"}){const{isSuperAdmin:s,hasRole:l,hasRoleType:c}=pn();return s?y.jsx(Ls,{}):i&&i.some(d=>c(d))?y.jsx(Ls,{}):t&&t.some(d=>l(d))?y.jsx(Ls,{}):y.jsx(Kn,{to:r,replace:!0})}function $3({redirectTo:i="/"}){var s;const{data:t,isLoading:r}=Or();return r||!t?null:(s=t.ai)!=null&&s.enabled?y.jsx(Ls,{}):y.jsx(Kn,{to:i,replace:!0})}function I3({flag:i,redirectTo:t="/"}){var l;const{data:r,isLoading:s}=Or();return s||!r?null:((l=r.features)==null?void 0:l[i])===!1?y.jsx(Kn,{to:t,replace:!0}):y.jsx(Ls,{})}const H3=T.lazy(()=>je(()=>import("./ProcessesListPage-DRYtvS3N.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17]),import.meta.url).then(i=>({default:i.ProcessesListPage}))),G3=T.lazy(()=>je(()=>import("./ProcessDetailPage-Vnx8Z5_y.js"),__vite__mapDeps([18,1,2,4,19,14,20,17,11,6,21,22,23]),import.meta.url).then(i=>({default:i.ProcessDetailPage}))),F3=T.lazy(()=>je(()=>import("./McpOverview-Dx2j0KkF.js"),__vite__mapDeps([24,1,25,26,27,28,15,14,29,6]),import.meta.url).then(i=>({default:i.McpOverview}))),V3=T.lazy(()=>je(()=>import("./McpRunsPage-CK96s3Nt.js"),__vite__mapDeps([30,1,26,27,5,6,31,28,8,9,10,17,14,32,15,13,12,16,33]),import.meta.url).then(i=>({default:i.McpRunsPage}))),Y3=T.lazy(()=>je(()=>import("./McpRunDetailPage-BJguEMS0.js"),__vite__mapDeps([34,1,26,20,15,14,35,6,36,37,13,38,39,16]),import.meta.url).then(i=>({default:i.McpRunDetailPage}))),K3=T.lazy(()=>je(()=>import("./McpQueryPage-CNsuiw_q.js"),__vite__mapDeps([40,1,15,14,9,10,13,12,16,8,11,32,17,33,5,6,4,41]),import.meta.url).then(i=>({default:i.McpQueryPage}))),X3=T.lazy(()=>je(()=>import("./McpQueryDetailPage-CzF_bna8.js"),__vite__mapDeps([42,1,15,14,20,41,6,27,4,43,36,26,3,2,44,45,46,47,48,49,35,50,38,39]),import.meta.url).then(i=>({default:i.McpQueryDetailPage}))),J3=T.lazy(()=>je(()=>import("./EscalationsOverview-D17auO-m.js"),__vite__mapDeps([51,1,4,15,14,29,6]),import.meta.url).then(i=>({default:i.EscalationsOverview}))),Q3=T.lazy(()=>je(()=>import("./AvailableEscalationsPage-DldboL4W.js"),__vite__mapDeps([52,1,53,4,14,54,55,6,56,57,13,58,21,17,59,9,10,20,12,5,7,8,23,33,16]),import.meta.url).then(i=>({default:i.AvailableEscalationsPage}))),Z3=T.lazy(()=>je(()=>import("./OperatorDashboard-C-jE0IRA.js"),__vite__mapDeps([60,1,4,5,6,7,8,53,9,10,12,33,57,14,13,58,21,17,59,20,55,16]),import.meta.url).then(i=>({default:i.OperatorDashboard}))),W3=T.lazy(()=>je(()=>import("./index-mKcQGi2B.js"),__vite__mapDeps([61,1,54,55,6,56,15,14,16,59,9,10,20,12,3,4,21,35,22,23]),import.meta.url).then(i=>({default:i.EscalationDetailPage}))),eT=T.lazy(()=>je(()=>import("./WorkflowsOverview-CdxjVifp.js"),__vite__mapDeps([62,1,3,4,15,14,29,6]),import.meta.url).then(i=>({default:i.WorkflowsOverview}))),tT=T.lazy(()=>je(()=>import("./index-BzkE48xJ.js"),__vite__mapDeps([63,1,3,15,14,13,17,64,47,48,6]),import.meta.url).then(i=>({default:i.StartWorkflowPage}))),nT=T.lazy(()=>je(()=>import("./index-BzkE48xJ.js"),__vite__mapDeps([63,1,3,15,14,13,17,64,47,48,6]),import.meta.url).then(i=>({default:i.DurableInvokePage}))),rT=T.lazy(()=>je(()=>import("./WorkflowsDashboard-BMQd_0tW.js"),__vite__mapDeps([65,1,32,3,31,28,6,4,5,8,9,10,17,14,15,13,12,16,33]),import.meta.url).then(i=>({default:()=>i.WorkflowsDashboard({tier:"durable"})}))),iT=T.lazy(()=>je(()=>import("./WorkflowsDashboard-BMQd_0tW.js"),__vite__mapDeps([65,1,32,3,31,28,6,4,5,8,9,10,17,14,15,13,12,16,33]),import.meta.url).then(i=>({default:()=>i.WorkflowsDashboard({tier:"all"})}))),sT=T.lazy(()=>je(()=>import("./YamlWorkflowsPage-BGP8wuos.js"),__vite__mapDeps([66,1,27,5,6,15,14,13,10,49,64,20]),import.meta.url).then(i=>({default:i.YamlWorkflowsPage}))),aT=T.lazy(()=>je(()=>import("./GraphInvokePage-D11uOnZi.js"),__vite__mapDeps([67,1,27,15,14,44,46,47,48,45,6,49,64]),import.meta.url).then(i=>({default:i.GraphInvokePage}))),oT=T.lazy(()=>je(()=>import("./YamlWorkflowDetailPage-DNVffIXa.js"),__vite__mapDeps([68,1,27,20,64,14,6]),import.meta.url).then(i=>({default:i.YamlWorkflowDetailPage}))),lT=T.lazy(()=>je(()=>import("./TasksListPage-CiGR2QiQ.js"),__vite__mapDeps([69,1,2,3,5,6,9,10,20,58,50,12,13,14,15,17]),import.meta.url).then(i=>({default:i.TasksListPage}))),cT=T.lazy(()=>je(()=>import("./TaskDetailPage-B0p_Z4J_.js"),__vite__mapDeps([70,1,2,20,58,15,14,6]),import.meta.url).then(i=>({default:i.TaskDetailPage}))),V1=T.lazy(()=>je(()=>import("./WorkflowExecutionPage-C15GSAoe.js"),__vite__mapDeps([71,1,3,4,37,13,14,38,20,6,39,2,15,36,16,35]),import.meta.url).then(i=>({default:i.WorkflowExecutionPage}))),uT=T.lazy(()=>je(()=>import("./AdminDashboard-Bv3pHBzn.js"),__vite__mapDeps([72,1,2,4,25,19,14,6]),import.meta.url).then(i=>({default:i.AdminDashboard}))),fT=T.lazy(()=>je(()=>import("./index-yGNt29V9.js"),__vite__mapDeps([73,1,3,9,10,13,14,33,5,6,15,74,17]),import.meta.url).then(i=>({default:i.WorkersPage}))),hT=T.lazy(()=>je(()=>import("./index-CvNBdkB1.js"),__vite__mapDeps([75,1,3,13,14,76,55,6,21,17,15,47,48,64]),import.meta.url).then(i=>({default:i.WorkflowConfigsPage}))),Y1=T.lazy(()=>je(()=>import("./index-CvNBdkB1.js"),__vite__mapDeps([75,1,3,13,14,76,55,6,21,17,15,47,48,64]),import.meta.url).then(i=>({default:i.WorkflowConfigDetailPage}))),dT=T.lazy(()=>je(()=>import("./index-CmnNqpWg.js"),__vite__mapDeps([77,1,25,10,76,55,6,15,14,13,12,5,78,46,47,48,49,45,33,20]),import.meta.url).then(i=>({default:i.McpServersPage}))),K1=T.lazy(()=>je(()=>import("./index-C3o4OisO.js"),__vite__mapDeps([79,1,25,15,14,43,6]),import.meta.url).then(i=>({default:i.McpServerDetailPage}))),mT=T.lazy(()=>je(()=>import("./index-CLmZaNTK.js"),__vite__mapDeps([80,1,23,5,6,9,10,12,13,14,76,55,33,15,21,48,50,81,82]),import.meta.url).then(i=>({default:i.UsersPage}))),pT=T.lazy(()=>je(()=>import("./RolesPage-BHzWK9n6.js"),__vite__mapDeps([83,1,15,14,21,55,6]),import.meta.url).then(i=>({default:i.RolesPage}))),yT=T.lazy(()=>je(()=>import("./RoleDetailPage-BKkUvTO-.js"),__vite__mapDeps([84,1,76,55,6,85,23,14]),import.meta.url).then(i=>({default:i.RoleDetailPage}))),gT=T.lazy(()=>je(()=>import("./PersonasPage-D8hL3kL5.js"),__vite__mapDeps([86,1,81,15,14,21,55,6,23,7]),import.meta.url).then(i=>({default:i.PersonasPage}))),bT=T.lazy(()=>je(()=>import("./PersonaDetailPage-CJ6jqo7h.js"),__vite__mapDeps([87,1,81,21,14,82,85,76,55,6]),import.meta.url).then(i=>({default:i.PersonaDetailPage}))),vT=T.lazy(()=>je(()=>import("./EscalationSchemaPage-kUmCDivo.js"),__vite__mapDeps([88,1,14,6]),import.meta.url).then(i=>({default:i.EscalationSchemaPage}))),xT=T.lazy(()=>je(()=>import("./EscalationListSchemaPage-kYLdUtZX.js"),__vite__mapDeps([89,1,14,6]),import.meta.url).then(i=>({default:i.EscalationListSchemaPage}))),_T=T.lazy(()=>je(()=>import("./ScanCodesPage-BW4P4zWf.js"),__vite__mapDeps([90,1,15,14,6]),import.meta.url).then(i=>({default:i.ScanCodesPage}))),wT=T.lazy(()=>je(()=>import("./ScanSchemeDetailPage-BLykA4j-.js"),__vite__mapDeps([91,1,76,55,6,15,14]),import.meta.url).then(i=>({default:i.ScanSchemeDetailPage}))),ST=T.lazy(()=>je(()=>import("./index-Dldi3Q3M.js"),__vite__mapDeps([92,1,15,14,55,6,56]),import.meta.url).then(i=>({default:i.MaintenancePage}))),ET=T.lazy(()=>je(()=>import("./OperationsPage-DvWrLuH6.js").then(i=>i.O),__vite__mapDeps([93,1,4,15,14,6]),import.meta.url).then(i=>({default:i.OperationsPage}))),OT=T.lazy(()=>je(()=>import("./index-CJu2PBNx.js"),__vite__mapDeps([94,1,19,14,13,5,6,31,28,55,36,74,9,10,33]),import.meta.url).then(i=>({default:i.ControlPlanePage}))),AT=T.lazy(()=>je(()=>import("./index-kiKZresb.js"),__vite__mapDeps([95,1,39,14,5,6,31,28,8,9,10,12,13,15,16]),import.meta.url).then(i=>({default:i.StreamMessagesPage}))),jT=T.lazy(()=>je(()=>import("./CredentialsPage-8LIEvomi.js"),__vite__mapDeps([96,1,15,14,50,76,55,6]),import.meta.url).then(i=>({default:i.CredentialsPage}))),TT=T.lazy(()=>je(()=>import("./index-BqGnhkh0.js"),__vite__mapDeps([97,1,6,15,14,13,16,8,10,98,50]),import.meta.url).then(i=>({default:i.FilesPage}))),NT=T.lazy(()=>je(()=>import("./index-D0zFReGL.js"),__vite__mapDeps([99,1,15,14,13,16,12,10,98,50,100,43,6]),import.meta.url).then(i=>({default:i.KnowledgePage}))),kT=T.lazy(()=>je(()=>import("./HomePage-Bcq10Bxx.js"),__vite__mapDeps([101,1,3,26,28,4,21,14,17,16,93,15,6,53]),import.meta.url).then(i=>({default:i.HomePage}))),CT=T.lazy(()=>je(()=>import("./AgentsPage-CToVu1qj.js"),__vite__mapDeps([102,1,103,4,5,6,8,9,10,12,13,14,15,16]),import.meta.url).then(i=>({default:i.AgentsPage}))),MT=T.lazy(()=>je(()=>import("./AgentDetailPage-DUno6EGs.js"),__vite__mapDeps([104,1,103,105,14,4,17,6]),import.meta.url).then(i=>({default:i.AgentDetailPage}))),X1=T.lazy(()=>je(()=>import("./AgentConfigPage-Dk2zlvDb.js"),__vite__mapDeps([106,1,103,105,14,15,100,46,47,48,3,27,107,108,17,6]),import.meta.url).then(i=>({default:i.AgentConfigPage}))),RT=T.lazy(()=>je(()=>import("./CapabilitiesPage-Dmf46PUJ.js"),__vite__mapDeps([109,1,107,78,25,46,47,48,14,49,6,45,15,13]),import.meta.url).then(i=>({default:i.CapabilitiesPage}))),DT=T.lazy(()=>je(()=>import("./TopicsPage-1VAc29Qw.js"),__vite__mapDeps([110,1,108,15,14,13,6]),import.meta.url).then(i=>({default:i.TopicsPage}))),qT=T.lazy(()=>je(()=>import("./TopicDetailPage-B455XrRc.js"),__vite__mapDeps([111,1,108,16,14,6]),import.meta.url).then(i=>({default:i.TopicDetailPage})));function BT(){return y.jsxs("div",{className:"animate-pulse space-y-4",children:[y.jsx("div",{className:"h-8 bg-surface-sunken rounded w-48"}),y.jsx("div",{className:"h-40 bg-surface-sunken rounded"})]})}function xe({children:i}){return y.jsx(T.Suspense,{fallback:y.jsx(BT,{}),children:y.jsx("div",{className:"animate-page-enter flex flex-col flex-1 min-h-0",children:i})})}const Mv=new G_({defaultOptions:{queries:{staleTime:1e4,retry:(i,t)=>t instanceof Error&&t.message==="Session expired"?!1:i<1}}});window.addEventListener("auth:unauthorized",()=>{Mv.clear(),sessionStorage.removeItem("lt_token"),sessionStorage.removeItem("lt_credentials"),sessionStorage.removeItem("lt_user_info");const i=window.__LT_BASE__||"",t=`${i}/login`;if(window.location.pathname!==t){const r=window.location.pathname+window.location.search,s=i&&r.startsWith(i)?r.slice(i.length)||"/":r;window.location.href=`${t}?returnTo=${encodeURIComponent(s)}`}});const LT=Y_([{path:"/login",element:y.jsx(P3,{})},{path:"/connect/anthropic",element:y.jsx(F1,{})},{path:"/connect/:provider",element:y.jsx(F1,{})},{path:"/",element:y.jsx(L3,{}),children:[{index:!0,element:y.jsx(xe,{children:y.jsx(kT,{})})},{path:"processes/all",element:y.jsx(xe,{children:y.jsx(H3,{})})},{path:"processes/detail/:originId",element:y.jsx(xe,{children:y.jsx(G3,{})})},{path:"credentials",element:y.jsx(xe,{children:y.jsx(jT,{})})},{path:"connections",element:y.jsx(Kn,{to:"/credentials",replace:!0})},{path:"escalations",element:y.jsx(xe,{children:y.jsx(J3,{})})},{path:"escalations/available",element:y.jsx(xe,{children:y.jsx(Q3,{})})},{path:"escalations/queue",element:y.jsx(xe,{children:y.jsx(Z3,{})})},{path:"escalations/detail/:id",element:y.jsx(xe,{children:y.jsx(W3,{})})},{path:"capabilities",element:y.jsx(xe,{children:y.jsx(RT,{})})},{path:"agents",element:y.jsx(xe,{children:y.jsx(CT,{})})},{path:"agents/new",element:y.jsx(xe,{children:y.jsx(X1,{})})},{path:"agents/:id",element:y.jsx(xe,{children:y.jsx(MT,{})})},{path:"agents/:id/edit",element:y.jsx(xe,{children:y.jsx(X1,{})})},{path:"topics",element:y.jsx(xe,{children:y.jsx(DT,{})})},{path:"topics/:topic",element:y.jsx(xe,{children:y.jsx(qT,{})})},{element:y.jsx(zc,{roleTypes:["superadmin"],roleNames:["engineer"]}),children:[{path:"workflows",element:y.jsx(xe,{children:y.jsx(eT,{})})},{path:"workflows/executions",element:y.jsx(xe,{children:y.jsx(iT,{})})},{path:"workflows/durable/executions",element:y.jsx(xe,{children:y.jsx(rT,{})})},{path:"workflows/durable/executions/:workflowId",element:y.jsx(xe,{children:y.jsx(V1,{})})},{path:"workflows/tasks",element:y.jsx(xe,{children:y.jsx(lT,{})})},{path:"workflows/tasks/detail/:id",element:y.jsx(xe,{children:y.jsx(cT,{})})},{path:"workflows/executions/:workflowId",element:y.jsx(xe,{children:y.jsx(V1,{})})},{path:"workflows/start",element:y.jsx(xe,{children:y.jsx(tT,{})})},{path:"workflows/durable/invoke",element:y.jsx(xe,{children:y.jsx(nT,{})})},{path:"workflows/cron",element:y.jsx(Kn,{to:"/workflows/start?mode=schedule",replace:!0})},{path:"workflows/workers",element:y.jsx(xe,{children:y.jsx(fT,{})})},{path:"workflows/registry",element:y.jsx(xe,{children:y.jsx(hT,{})})},{path:"workflows/registry/new",element:y.jsx(xe,{children:y.jsx(Y1,{})})},{path:"workflows/registry/:workflowType",element:y.jsx(xe,{children:y.jsx(Y1,{})})}]},{element:y.jsx(zc,{roleTypes:["superadmin"],roleNames:["engineer"]}),children:[{path:"mcp/workflows",element:y.jsx(xe,{children:y.jsx(sT,{})})},{path:"mcp/workflows/invoke",element:y.jsx(xe,{children:y.jsx(aT,{})})},{path:"mcp/workflows/:id",element:y.jsx(xe,{children:y.jsx(oT,{})})},{path:"mcp/executions",element:y.jsx(xe,{children:y.jsx(V3,{})})},{path:"mcp/executions/:jobId",element:y.jsx(xe,{children:y.jsx(Y3,{})})},{path:"files",element:y.jsx(xe,{children:y.jsx(TT,{})})},{path:"knowledge",element:y.jsx(xe,{children:y.jsx(NT,{})})},{element:y.jsx($3,{}),children:[{path:"mcp",element:y.jsx(xe,{children:y.jsx(F3,{})})},{path:"mcp/queries",element:y.jsx(xe,{children:y.jsx(K3,{})})},{path:"mcp/queries/:workflowId",element:y.jsx(xe,{children:y.jsx(X3,{})})},{path:"mcp/tools",element:y.jsx(Kn,{to:"/mcp/servers",replace:!0})},{path:"mcp/servers",element:y.jsx(xe,{children:y.jsx(dT,{})})},{path:"mcp/servers/new",element:y.jsx(xe,{children:y.jsx(K1,{})})},{path:"mcp/servers/:serverId",element:y.jsx(xe,{children:y.jsx(K1,{})})}]}]},{path:"operations",element:y.jsx(xe,{children:y.jsx(ET,{})})},{element:y.jsx(zc,{roleTypes:["admin","superadmin"],roleNames:["engineer"]}),children:[{path:"admin",element:y.jsx(xe,{children:y.jsx(uT,{})})},{path:"admin/users",element:y.jsx(xe,{children:y.jsx(mT,{})})},{path:"admin/escalation-chains",element:y.jsx(Kn,{to:"/admin/roles",replace:!0})},{path:"admin/roles",element:y.jsx(xe,{children:y.jsx(pT,{})})},{path:"admin/roles/:role",element:y.jsx(xe,{children:y.jsx(yT,{})})},{path:"admin/roles/:role/schema",element:y.jsx(xe,{children:y.jsx(vT,{})})},{path:"admin/roles/:role/list-schema",element:y.jsx(xe,{children:y.jsx(xT,{})})},{path:"admin/scan-codes",element:y.jsx(xe,{children:y.jsx(_T,{})})},{path:"admin/scan-codes/:version",element:y.jsx(xe,{children:y.jsx(wT,{})})},{path:"admin/personas",element:y.jsx(xe,{children:y.jsx(gT,{})})},{path:"admin/personas/:key",element:y.jsx(xe,{children:y.jsx(bT,{})})}]},{element:y.jsx(zc,{roleTypes:["superadmin"],roleNames:["engineer"]}),children:[{path:"admin/bots",element:y.jsx(Kn,{to:"/admin/users?tab=service-accounts",replace:!0})},{element:y.jsx(I3,{flag:"dbMaintenance"}),children:[{path:"admin/maintenance",element:y.jsx(xe,{children:y.jsx(ST,{})})}]},{path:"admin/controlplane",element:y.jsx(xe,{children:y.jsx(OT,{})})},{path:"admin/streams",element:y.jsx(xe,{children:y.jsx(AT,{})})}]}]}],{basename:window.__LT_BASE__||"/"});function zT(){return y.jsx(F_,{client:Mv,children:y.jsx(Rw,{children:y.jsx(BE,{children:y.jsx(K_,{router:LT})})})})}Qb(Jb());const Xd=document.createElement("link");Xd.rel="stylesheet";Xd.href=`${Mt}/api/settings/custom.css`;document.head.appendChild(Xd);Tw.createRoot(document.getElementById("root")).render(y.jsx(T.StrictMode,{children:y.jsx(zT,{})}));export{rN as $,lN as A,uN as B,Vd as C,A3 as D,xN as E,bv as F,pA as G,JT as H,vA as I,YA as J,Vb as K,Fb as L,jN as M,B2 as N,Kd as O,tN as P,bA as Q,DN as R,qA as S,pO as T,Ql as U,Yd as V,ZE as W,YT as X,VT as Y,mv as Z,WT as _,BN as a,cN as a0,wN as a1,Cw as a2,ev as a3,Nv as a4,kv as a5,qN as a6,NN as a7,_N as a8,kN as a9,CN as aa,SN as ab,EN as ac,AN as ad,ON as ae,gd as af,xg as ag,Cd as ah,MN as ai,FT as aj,Mt as ak,ib as al,TN as am,fN as an,dN as ao,pN as ap,yN as aq,hN as ar,mN as as,KT as at,LN as au,zN as av,Cv as aw,$d as ax,$b as ay,RN as az,O3 as b,HT as c,Ee as d,ZT as e,w3 as f,eN as g,nN as h,XT as i,Lb as j,pn as k,QT as l,bN as m,vN as n,Fd as o,mO as p,yA as q,gA as r,wA as s,Pb as t,Or as u,iN as v,gN as w,sN as x,aN as y,oN as z};
|
|
65
|
+
//# sourceMappingURL=index-CfAi1OsI.js.map
|