moi-computer 0.12.1-next.0 → 0.12.1-next.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (354) hide show
  1. package/README.md +26 -26
  2. package/bin/moi.mjs +2 -2
  3. package/client/AGENTS.md +7 -3
  4. package/client/api/app-config.ts +5 -10
  5. package/client/api/workspace-keys.ts +3 -2
  6. package/client/app/app-provider.tsx +25 -0
  7. package/client/app/{AppRouter.tsx → app-router.tsx} +4 -4
  8. package/client/app/routes/{HomeRoute.tsx → home-route.tsx} +2 -2
  9. package/client/app/routes/{WorkspaceRoute.tsx → workspace-route.tsx} +22 -23
  10. package/client/app/shell/{SidebarLayout.tsx → sidebar-layout.tsx} +29 -23
  11. package/client/dev/index.html +43 -0
  12. package/client/dev/index.ts +15 -0
  13. package/client/features/applets/api.ts +1 -1
  14. package/client/features/applets/{AppletContainer.tsx → applet-container.tsx} +1 -1
  15. package/client/features/applets/applet-thumbnail.ts +1 -1
  16. package/client/features/applets/{useApplet.ts → use-applet.ts} +2 -2
  17. package/client/features/applets/{WidgetShell.tsx → widget-shell.tsx} +4 -4
  18. package/client/features/chat/applet-chat-intents.ts +4 -4
  19. package/client/features/chat/{ChatPanel.tsx → chat-panel.tsx} +11 -11
  20. package/client/features/chat/{ChatPopup.tsx → chat-popup.tsx} +1 -1
  21. package/client/features/chat/composer/attachments/{DrawingAttachmentChip.tsx → drawing-attachment-chip.tsx} +1 -1
  22. package/client/features/chat/composer/attachments/{FileAttachmentChip.tsx → file-attachment-chip.tsx} +1 -1
  23. package/client/features/chat/composer/attachments/{TextAttachmentChip.tsx → text-attachment-chip.tsx} +1 -1
  24. package/client/features/chat/composer/banners/{ComposerBanner.tsx → composer-banner.tsx} +0 -14
  25. package/client/features/chat/composer/banners/{ErrorBanner.tsx → error-banner.tsx} +1 -1
  26. package/client/features/chat/composer/banners/{SkillUpdateBanner.tsx → skill-update-banner.tsx} +3 -3
  27. package/client/features/chat/composer/{ChatComposer.tsx → chat-composer.tsx} +8 -7
  28. package/client/features/chat/composer/{ModelPicker.tsx → model-picker.tsx} +1 -1
  29. package/client/features/chat/composer/{useWorkspaceComposerState.tsx → use-workspace-composer-state.tsx} +12 -28
  30. package/client/features/chat/composer/{useWorkspaceSkillUpdates.ts → use-workspace-skill-updates.ts} +1 -1
  31. package/client/features/chat/connection/chat-frames.ts +3 -3
  32. package/client/features/chat/messages/{ChatEmptyState.tsx → chat-empty-state.tsx} +4 -4
  33. package/client/features/chat/messages/{MarkdownContent.tsx → markdown-content.tsx} +1 -1
  34. package/client/features/chat/messages/tool-group/index.ts +1 -1
  35. package/client/features/chat/messages/tool-group/{ReadImagePreview.tsx → read-image-preview.tsx} +2 -2
  36. package/client/features/chat/messages/tool-group/{SubagentCard.tsx → subagent-card.tsx} +3 -3
  37. package/client/features/chat/messages/tool-group/{TimelineRow.tsx → timeline-row.tsx} +1 -1
  38. package/client/features/chat/messages/tool-group/{ToolCallGroup.tsx → tool-call-group.tsx} +8 -8
  39. package/client/features/chat/messages/tool-group/{ToolOutput.tsx → tool-output.tsx} +1 -1
  40. package/client/features/chat/messages/{TurnView.tsx → turn-view.tsx} +4 -4
  41. package/client/features/chat/sessions/api.ts +3 -3
  42. package/client/features/chat/sessions/{ChatSelector.tsx → chat-selector.tsx} +2 -2
  43. package/client/features/chat/sessions/{useSelectedSession.ts → use-selected-session.ts} +2 -2
  44. package/client/features/chat/{useChat.ts → use-chat.ts} +4 -4
  45. package/client/features/collab/host-state.ts +24 -7
  46. package/client/features/collab/local-user.ts +1 -1
  47. package/client/features/collab/proxy-user.ts +4 -9
  48. package/client/features/connectors/mcp-icons.ts +1 -1
  49. package/client/features/connectors/{McpServerCards.tsx → mcp-server-cards.tsx} +1 -1
  50. package/client/features/{home/workspace-setup/DemoDialog.tsx → demo/demo-dialog.tsx} +26 -80
  51. package/client/features/dev/chat-states-fixtures.ts +4 -4
  52. package/client/features/dev/{ChatStatesPage.tsx → chat-states-page.tsx} +6 -6
  53. package/client/features/dev/collab/local-user-settings.tsx +4 -4
  54. package/client/features/dev/{DevIndexPage.tsx → dev-index-page.tsx} +7 -1
  55. package/client/features/dev/{DevRoutes.tsx → dev-routes.tsx} +8 -6
  56. package/client/features/dev/workspace-setup-mocks.ts +102 -0
  57. package/client/features/dev/workspace-setup-page.tsx +11 -0
  58. package/client/features/dev/workspace-setup-preview.tsx +253 -0
  59. package/client/features/drawings/{DrawingToolbar.tsx → drawing-toolbar.tsx} +1 -1
  60. package/client/features/drawings/{useChatAnnotation.ts → use-chat-annotation.ts} +29 -23
  61. package/client/features/drawings/{useDrawingLayer.ts → use-drawing-layer.ts} +1 -1
  62. package/client/features/drawings/{useViewSketch.ts → use-view-sketch.ts} +1 -1
  63. package/client/features/harness/api.ts +36 -0
  64. package/client/features/harness/device-login-steps.tsx +97 -0
  65. package/client/features/home/api.ts +29 -89
  66. package/client/features/home/{HomeLogo.tsx → home-logo.tsx} +1 -1
  67. package/client/features/home/{HomePage.tsx → home-page.tsx} +13 -14
  68. package/client/features/overview/api.ts +2 -2
  69. package/client/features/overview/default/registry.tsx +1 -1
  70. package/client/features/overview/default/{ViewsWidget.tsx → views-widget.tsx} +1 -1
  71. package/client/features/overview/{HiddenPanel.tsx → hidden-panel.tsx} +2 -2
  72. package/client/features/overview/{Overview.tsx → overview.tsx} +6 -6
  73. package/client/features/overview/{WidgetCanvas.tsx → widget-canvas.tsx} +1 -1
  74. package/client/features/overview/{WidgetFrame.tsx → widget-frame.tsx} +1 -1
  75. package/client/features/overview/workspace-name.tsx +55 -0
  76. package/client/features/scratchpad/{Scratchpad.tsx → scratchpad.tsx} +10 -13
  77. package/client/features/scratchpad/{useScratchpadSnapshot.tsx → use-scratchpad-snapshot.tsx} +3 -3
  78. package/client/features/settings/api.ts +15 -9
  79. package/client/features/settings/{ConnectorsSettings.tsx → connectors-settings.tsx} +3 -3
  80. package/client/features/settings/{EnvironmentSettings.tsx → environment-settings.tsx} +3 -3
  81. package/client/features/settings/{GeneralSettings.tsx → general-settings.tsx} +5 -5
  82. package/client/features/settings/{useEnvVars.ts → use-env-vars.ts} +1 -1
  83. package/client/features/settings/{WorkspaceIconPicker.tsx → workspace-icon-picker.tsx} +1 -1
  84. package/client/features/settings/{WorkspaceSettingsDialog.tsx → workspace-settings-dialog.tsx} +3 -3
  85. package/client/features/update/api.ts +1 -1
  86. package/client/features/views/api.ts +1 -1
  87. package/client/features/views/{PendingViewScreen.tsx → pending-view-screen.tsx} +7 -4
  88. package/client/features/views/{useViewActions.ts → use-view-actions.ts} +2 -2
  89. package/client/features/views/{useViewDrafts.ts → use-view-drafts.ts} +15 -6
  90. package/client/features/views/{ViewManager.tsx → view-manager.tsx} +3 -3
  91. package/client/features/views/view-submission.ts +1 -1
  92. package/client/features/workspace/add/api.ts +80 -0
  93. package/client/features/{home/workspace-setup/CreateWorkspaceDialog.tsx → workspace/add/create-workspace-dialog.tsx} +56 -42
  94. package/client/features/workspace/add/import-workspace-dialog.tsx +81 -0
  95. package/client/features/{home/workspace-setup/useWorkspaceImport.ts → workspace/add/use-workspace-import.ts} +1 -1
  96. package/client/features/workspace/add/workspace-agent-options.ts +53 -0
  97. package/client/features/{home/workspace-setup/WorkspaceAgentStep.tsx → workspace/add/workspace-agent-selector.tsx} +59 -98
  98. package/client/features/{home/workspace-setup/WorkspaceDialogContent.tsx → workspace/add/workspace-dialog-content.tsx} +1 -1
  99. package/client/features/workspace/api.ts +31 -26
  100. package/client/features/workspace/browser-tab-state.ts +1 -1
  101. package/client/features/workspace/moi-context.ts +1 -1
  102. package/client/features/workspace/setup/workspace-login-state.tsx +175 -0
  103. package/client/features/workspace/setup/workspace-recovery-states.tsx +125 -0
  104. package/client/features/workspace/setup/workspace-setup-panel.tsx +18 -0
  105. package/client/features/workspace/setup/workspace-setup.tsx +78 -0
  106. package/client/features/workspace/setup/workspace-welcome-state.tsx +81 -0
  107. package/client/features/workspace/{ThemePanel.tsx → theme-panel.tsx} +3 -3
  108. package/client/features/workspace/{useWorkspaceNavigation.ts → use-workspace-navigation.ts} +2 -2
  109. package/client/features/workspace/{WorkspaceScreen.tsx → workspace-content.tsx} +37 -80
  110. package/client/features/workspace/workspace-frame.tsx +76 -0
  111. package/client/features/workspace/workspace-identity.tsx +40 -0
  112. package/client/features/workspace/{WorkspaceLayoutContext.tsx → workspace-layout-context.tsx} +2 -0
  113. package/client/features/workspace/{WorkspaceMenu.tsx → workspace-menu.tsx} +3 -3
  114. package/client/features/workspace/workspace-pending-screen.tsx +26 -0
  115. package/client/features/{home → workspace}/workspace-presentation.tsx +10 -3
  116. package/client/features/workspace/workspace-screen.tsx +28 -0
  117. package/client/features/workspace/{WorkspaceSplitLayout.tsx → workspace-split-layout.tsx} +1 -1
  118. package/client/features/workspace/{WorkspaceTabs.tsx → workspace-tabs.tsx} +2 -2
  119. package/client/index.css +2 -2
  120. package/client/index.html +29 -10
  121. package/client/index.tsx +7 -2
  122. package/client/lib/agent-availability.ts +0 -5
  123. package/client/lib/browser-tab-id.ts +4 -0
  124. package/client/main.tsx +10 -7
  125. package/client/runtime/app-context.ts +20 -0
  126. package/client/runtime/use-workspace-events.ts +56 -0
  127. package/client/runtime/workspace-events.ts +151 -0
  128. package/dist/chunk-00rh9df4.js +2 -0
  129. package/dist/chunk-4nh7y1hq.css +1 -0
  130. package/dist/{chunk-vqpkqtdr.js → chunk-am4agx6v.js} +1 -1
  131. package/dist/{chunk-gps4qc38.js → chunk-d7cbm65e.js} +1 -1
  132. package/dist/chunk-hbpdv7vd.js +1 -0
  133. package/dist/chunk-hmka9rt5.js +2 -0
  134. package/dist/{chunk-j905va8r.js → chunk-hvh9f5h0.js} +1 -1
  135. package/dist/chunk-mjjregkn.js +10 -0
  136. package/dist/chunk-rt30jbcm.js +1 -0
  137. package/dist/chunk-vt6zybej.js +2 -0
  138. package/dist/chunk-wbkwf6cc.js +68 -0
  139. package/dist/chunk-xjyfyz64.js +1 -0
  140. package/dist/{chunk-hzwr8dp8.js → chunk-y8nbwp21.js} +71 -71
  141. package/dist/chunk-ysfdcew7.js +1 -0
  142. package/dist/index.html +30 -11
  143. package/lib/format.ts +1 -1
  144. package/lib/harness-instructions.ts +30 -0
  145. package/lib/ids.ts +3 -3
  146. package/lib/moi-context.ts +2 -2
  147. package/lib/scratchpad-skew.ts +3 -3
  148. package/lib/types.ts +28 -20
  149. package/lib/update.ts +1 -1
  150. package/package.json +5 -2
  151. package/server/AGENTS.md +10 -4
  152. package/server/README.md +102 -0
  153. package/server/api/harnesses.ts +56 -0
  154. package/server/{api.ts → api/index.ts} +125 -118
  155. package/server/app-config.ts +24 -12
  156. package/server/app-settings.ts +1 -1
  157. package/server/applets/applet-css.ts +1 -1
  158. package/server/applets/build-applet.ts +4 -4
  159. package/server/applets/build-worker.ts +1 -1
  160. package/server/applets/config.ts +1 -1
  161. package/server/{functions-worker.ts → applets/functions-worker.ts} +1 -1
  162. package/server/{functions.ts → applets/functions.ts} +2 -2
  163. package/server/applets/index.ts +2 -2
  164. package/server/{thumbnails.ts → applets/thumbnails.ts} +9 -6
  165. package/server/{applet-typecheck.ts → applets/typecheck.ts} +4 -4
  166. package/server/{ui-components.ts → applets/ui-components.ts} +2 -2
  167. package/server/{views.ts → applets/views.ts} +7 -7
  168. package/server/{widgets.ts → applets/widgets.ts} +2 -2
  169. package/server/cli/applet-selector.ts +19 -0
  170. package/server/cli/args.ts +5 -0
  171. package/server/{cli-colors.ts → cli/colors.ts} +1 -1
  172. package/server/cli/commands/bundle.ts +119 -0
  173. package/server/cli/commands/call-server-fn.ts +42 -0
  174. package/server/cli/commands/check.ts +53 -0
  175. package/server/cli/commands/config.ts +132 -0
  176. package/server/cli/commands/debug.ts +119 -0
  177. package/server/cli/commands/env.ts +162 -0
  178. package/server/cli/commands/hermes.ts +149 -0
  179. package/server/cli/commands/init.ts +286 -0
  180. package/server/cli/commands/navigate.ts +35 -0
  181. package/server/cli/commands/openclaw.ts +168 -0
  182. package/server/cli/commands/refresh.ts +39 -0
  183. package/server/cli/commands/scratch.ts +496 -0
  184. package/server/cli/commands/service.ts +298 -0
  185. package/server/cli/commands/skill.ts +122 -0
  186. package/server/cli/commands/start.ts +138 -0
  187. package/server/cli/commands/status.ts +80 -0
  188. package/server/cli/commands/tabs.ts +43 -0
  189. package/server/cli/commands/theme.ts +192 -0
  190. package/server/cli/commands/ui-components.ts +15 -0
  191. package/server/cli/commands/update.ts +192 -0
  192. package/server/cli/commands/version.ts +9 -0
  193. package/server/cli/commands/views.ts +87 -0
  194. package/server/cli/control.ts +89 -0
  195. package/server/{cli-env.ts → cli/env.ts} +9 -9
  196. package/server/cli/index.ts +171 -0
  197. package/server/{cli-pc.ts → cli/pc.ts} +1 -1
  198. package/server/cli/provider.ts +25 -0
  199. package/server/cli/server-version.ts +16 -0
  200. package/server/cli/server.ts +81 -0
  201. package/server/{cli-ui-components.ts → cli/ui-components.ts} +5 -5
  202. package/server/cli.ts +2 -3252
  203. package/server/collab/manager.ts +3 -3
  204. package/server/collab/skill/index.ts +2 -2
  205. package/server/control.ts +20 -20
  206. package/server/harness/README.md +47 -25
  207. package/server/harness/acp/NOTES.md +11 -11
  208. package/server/harness/acp/archived.ts +3 -3
  209. package/server/harness/acp/client.ts +2 -2
  210. package/server/harness/acp/run-durations.ts +1 -1
  211. package/server/harness/acp/session.ts +5 -5
  212. package/server/harness/auth.ts +303 -0
  213. package/server/harness/claude-code/NOTES.md +9 -7
  214. package/server/harness/claude-code/auth.ts +125 -17
  215. package/server/harness/claude-code/index.ts +2 -1
  216. package/server/harness/claude-code/mcp.ts +1 -1
  217. package/server/harness/claude-code/session.ts +10 -7
  218. package/server/harness/codex/NOTES.md +12 -12
  219. package/server/harness/codex/auth.ts +86 -19
  220. package/server/harness/codex/client.ts +17 -13
  221. package/server/harness/codex/index.ts +2 -1
  222. package/server/harness/codex/permissions.ts +3 -3
  223. package/server/harness/codex/probe.ts +3 -5
  224. package/server/harness/codex/session.ts +16 -13
  225. package/server/harness/codex/thread-list.ts +4 -0
  226. package/server/harness/codex/transport.ts +5 -5
  227. package/server/harness/executable.ts +42 -18
  228. package/server/harness/hermes/NOTES.md +70 -70
  229. package/server/harness/hermes/discovery.ts +1 -1
  230. package/server/harness/openclaw/NOTES.md +24 -24
  231. package/server/harness/openclaw/adapter.ts +1 -1
  232. package/server/harness/openclaw/compat.ts +1 -1
  233. package/server/harness/openclaw/session.ts +5 -2
  234. package/server/harness/registry.ts +1 -1
  235. package/server/harness/shell-path.ts +31 -21
  236. package/server/harness/types.ts +9 -2
  237. package/server/navigation-relay.ts +1 -1
  238. package/server/open-browser.ts +7 -0
  239. package/server/{scratchpad-assets.ts → scratchpad/assets.ts} +4 -4
  240. package/server/{scratchpad.ts → scratchpad/document.ts} +8 -8
  241. package/server/{scratchpad-executor.ts → scratchpad/executor.ts} +7 -7
  242. package/server/{scratchpad-relay.ts → scratchpad/relay.ts} +4 -5
  243. package/server/{scratchpad-shape-defaults.ts → scratchpad/shape-defaults.ts} +2 -2
  244. package/server/server-cwd.ts +1 -1
  245. package/server/service.ts +2 -2
  246. package/server/{session-archive.ts → sessions/archive.ts} +5 -5
  247. package/server/{attachment-message.ts → sessions/attachment-message.ts} +1 -1
  248. package/server/{session-config.ts → sessions/config.ts} +1 -1
  249. package/server/{session-lifecycle.ts → sessions/lifecycle.ts} +3 -3
  250. package/server/{pending-views.ts → sessions/pending-views.ts} +3 -3
  251. package/server/{selected-session.ts → sessions/selected.ts} +1 -1
  252. package/server/{session-store.ts → sessions/store.ts} +1 -1
  253. package/server/{view-sessions.ts → sessions/view-sessions.ts} +9 -9
  254. package/server/{skills-template.ts → skills/template.ts} +1 -1
  255. package/server/{skill-update.ts → skills/update.ts} +5 -5
  256. package/server/{skill-version.ts → skills/version.ts} +4 -4
  257. package/server/static.ts +5 -3
  258. package/server/status.ts +3 -3
  259. package/server/vendor.ts +23 -30
  260. package/server/web.ts +17 -9
  261. package/server/{env-apply.ts → workspaces/env-apply.ts} +5 -5
  262. package/server/{workspace-env.ts → workspaces/env.ts} +3 -3
  263. package/server/{workspace-import.ts → workspaces/import.ts} +4 -4
  264. package/server/{workspace-init.ts → workspaces/init.ts} +5 -5
  265. package/server/{layout.ts → workspaces/layout.ts} +13 -8
  266. package/server/{preview.ts → workspaces/preview.ts} +1 -1
  267. package/server/{registry.ts → workspaces/registry.ts} +3 -3
  268. package/server/{required-env.ts → workspaces/required-env.ts} +3 -3
  269. package/server/{moi-scaffold.ts → workspaces/scaffold.ts} +3 -3
  270. package/ui-components/button.tsx +1 -1
  271. package/ui-components/docs/attachment.md +2 -2
  272. package/ui-components/docs/button.md +1 -1
  273. package/ui-components/docs/calendar.md +1 -1
  274. package/ui-components/docs/chart.md +4 -4
  275. package/ui-components/docs/data-table.md +1 -1
  276. package/ui-components/docs/drawer.md +1 -1
  277. package/ui-components/docs/field.md +1 -1
  278. package/ui-components/docs/input.md +2 -2
  279. package/ui-components/docs/label.md +2 -2
  280. package/ui-components/docs/table.md +2 -2
  281. package/workspace/.claude/skills/moi-workspace/SKILL.md +12 -12
  282. package/workspace/.claude/skills/moi-workspace/references/COLLAB.md +2 -2
  283. package/workspace/.claude/skills/moi-workspace/references/DESIGN.md +2 -2
  284. package/workspace/.claude/skills/moi-workspace/references/INTENTS.md +2 -2
  285. package/client/features/chat/composer/banners/AgentAvailabilityBanner.tsx +0 -101
  286. package/client/features/home/workspace-setup/ImportWorkspaceDialog.tsx +0 -92
  287. package/client/features/overview/WorkspaceName.tsx +0 -60
  288. package/client/runtime/useWorkspaceEvents.ts +0 -189
  289. package/dist/chunk-1zhnhy00.js +0 -1
  290. package/dist/chunk-27501vke.js +0 -1
  291. package/dist/chunk-9xtv6djt.js +0 -2
  292. package/dist/chunk-am1x230f.js +0 -2
  293. package/dist/chunk-darpsw65.js +0 -1
  294. package/dist/chunk-n33w9y38.js +0 -10
  295. package/dist/chunk-r63ks44z.js +0 -68
  296. package/dist/chunk-wd46nk26.css +0 -1
  297. package/dist/chunk-xgt7vxt9.js +0 -1
  298. package/dist/chunk-yvzhwtfa.js +0 -2
  299. package/server/agent.ts +0 -223
  300. /package/client/components/shared/{AgentBlobatar.tsx → agent-blobatar.tsx} +0 -0
  301. /package/client/components/shared/{BottomPanel.tsx → bottom-panel.tsx} +0 -0
  302. /package/client/components/shared/{Composer.tsx → composer.tsx} +0 -0
  303. /package/client/components/shared/{LedLogo.tsx → led-logo.tsx} +0 -0
  304. /package/client/components/shared/{PanelHeader.tsx → panel-header.tsx} +0 -0
  305. /package/client/components/shared/{ReorderableList.tsx → reorderable-list.tsx} +0 -0
  306. /package/client/components/shared/{WorkspaceIcon.tsx → workspace-icon.tsx} +0 -0
  307. /package/client/features/applets/{WidgetErrorBoundary.tsx → widget-error-boundary.tsx} +0 -0
  308. /package/client/features/chat/composer/attachments/{AttachmentChip.tsx → attachment-chip.tsx} +0 -0
  309. /package/client/features/chat/messages/{ChatPromptBubbles.tsx → chat-prompt-bubbles.tsx} +0 -0
  310. /package/client/features/chat/messages/{ShimmerText.tsx → shimmer-text.tsx} +0 -0
  311. /package/client/features/chat/messages/tool-group/{CodeBlock.tsx → code-block.tsx} +0 -0
  312. /package/client/features/chat/messages/tool-group/{Collapse.tsx → collapse.tsx} +0 -0
  313. /package/client/features/chat/messages/{useStickToBottom.ts → use-stick-to-bottom.ts} +0 -0
  314. /package/client/features/connectors/{IconMcp.tsx → icon-mcp.tsx} +0 -0
  315. /package/client/features/dev/{BlobatarShapesPage.tsx → blobatar-shapes-page.tsx} +0 -0
  316. /package/client/features/dev/{HarnessDebugPage.tsx → harness-debug-page.tsx} +0 -0
  317. /package/client/features/dev/{TextureLabPage.tsx → texture-lab-page.tsx} +0 -0
  318. /package/client/features/dev/{ToolCallsPage.tsx → tool-calls-page.tsx} +0 -0
  319. /package/client/features/drawings/{DrawingLayer.tsx → drawing-layer.tsx} +0 -0
  320. /package/client/features/home/{WorkspacePreview.tsx → workspace-preview.tsx} +0 -0
  321. /package/client/features/overview/{useGridReconcile.ts → use-grid-reconcile.ts} +0 -0
  322. /package/client/features/scratchpad/{ScratchpadControls.tsx → scratchpad-controls.tsx} +0 -0
  323. /package/client/features/settings/{SettingsLayout.tsx → settings-layout.tsx} +0 -0
  324. /package/client/features/update/{UpdateControl.tsx → update-control.tsx} +0 -0
  325. /package/client/features/workspace/{UnavailablePage.tsx → unavailable-page.tsx} +0 -0
  326. /package/client/features/workspace/{useFitsSplitLayout.ts → use-fits-split-layout.ts} +0 -0
  327. /package/client/features/workspace/{WorkspaceContext.tsx → workspace-context.tsx} +0 -0
  328. /package/client/vendor/react/{development → 19.2.4/development}/_impl/react-dom-client.js +0 -0
  329. /package/client/vendor/react/{development → 19.2.4/development}/_impl/react-dom.js +0 -0
  330. /package/client/vendor/react/{development → 19.2.4/development}/_impl/react-jsx-dev-runtime.js +0 -0
  331. /package/client/vendor/react/{development → 19.2.4/development}/_impl/react-jsx-runtime.js +0 -0
  332. /package/client/vendor/react/{development → 19.2.4/development}/_impl/react.js +0 -0
  333. /package/client/vendor/react/{development → 19.2.4/development}/react-dom-client.js +0 -0
  334. /package/client/vendor/react/{development → 19.2.4/development}/react-dom.js +0 -0
  335. /package/client/vendor/react/{development → 19.2.4/development}/react-jsx-dev-runtime.js +0 -0
  336. /package/client/vendor/react/{development → 19.2.4/development}/react-jsx-runtime.js +0 -0
  337. /package/client/vendor/react/{development → 19.2.4/development}/react.js +0 -0
  338. /package/client/vendor/react/{production → 19.2.4/production}/_impl/react-dom-client.js +0 -0
  339. /package/client/vendor/react/{production → 19.2.4/production}/_impl/react-dom.js +0 -0
  340. /package/client/vendor/react/{production → 19.2.4/production}/_impl/react-jsx-dev-runtime.js +0 -0
  341. /package/client/vendor/react/{production → 19.2.4/production}/_impl/react-jsx-runtime.js +0 -0
  342. /package/client/vendor/react/{production → 19.2.4/production}/_impl/react.js +0 -0
  343. /package/client/vendor/react/{production → 19.2.4/production}/react-dom-client.js +0 -0
  344. /package/client/vendor/react/{production → 19.2.4/production}/react-dom.js +0 -0
  345. /package/client/vendor/react/{production → 19.2.4/production}/react-jsx-dev-runtime.js +0 -0
  346. /package/client/vendor/react/{production → 19.2.4/production}/react-jsx-runtime.js +0 -0
  347. /package/client/vendor/react/{production → 19.2.4/production}/react.js +0 -0
  348. /package/server/{bundle-queue.ts → applets/bundle-queue.ts} +0 -0
  349. /package/server/{applet-log.ts → applets/log.ts} +0 -0
  350. /package/server/{cli-ui.ts → cli/ui.ts} +0 -0
  351. /package/server/{workspace-config.ts → workspaces/config.ts} +0 -0
  352. /package/server/{icon.ts → workspaces/icon.ts} +0 -0
  353. /package/server/{tabs.ts → workspaces/tabs.ts} +0 -0
  354. /package/server/{theme.ts → workspaces/theme.ts} +0 -0
@@ -0,0 +1,68 @@
1
+ import{$ as IG,$a as cI,$b as Yk,A as w8,Aa as eE,Ac as kS,B as u2,Ba as bI,Bb as $k,Bc as Y5,C as bB,Ca as wI,Cb as VY,Cc as gS,D as S8,Da as SI,Db as Ym,Dc as mS,E as cZ,Ea as eW,Eb as Zk,Ec as p1,F as sA,Fa as RI,Fb as qi,Fc as Ct,G as m0,Ga as II,Gb as A_,Gc as q5,H as p2,Ha as kI,Hb as Ni,Hc as $R,I as wh,Ia as yI,Ib as Dq,Ic as L2,J as Y2,Ja as xI,Jb as Jk,Jc as Fs,K as G0,Ka as NY,Kb as a2,Kc as a9,L as fo,La as FR,Lb as SS,M as BH,Ma as rF,Mb as On,N as ZH,Na as gh,Nb as Hk,O as w5,Ob as Bk,P as IO,Pa as hI,Pb as mx,Q as Q0,Qa as lF,Qb as $H,R as AJ,Ra as bJ,Rb as c6,S as i0,Sa as vI,Sb as Qk,T as z9,Ta as fI,Tb as Xk,U as M0,Ua as Hs,Ub as tQ,V as Si,Va as Ft,Vb as ux,W as zt,Wa as gI,Wb as zk,X as Gt,Xa as mI,Xb as Gk,Y as Ut,Ya as uI,Z as NI,Za as pI,Zb as Uk,_ as tE,aa as AI,ab as dI,ac as Kk,b as c,ba as Gm,bc as Fk,c as fq0,ca as sK,cb as Um,cc as Wk,d as U1,da as oo,db as lI,dc as Pq,e as Z4,ea as jv,eb as $b,ec as qk,f as D1,fa as WY,fb as AY,g as Z5,ga as UI,gb as iF,gc as Hm,h as H0,ha as wv,hb as $t,hc as so,i as I0,ia as dF,ib as iI,ic as NU,j as Cz,ja as DI,jb as QN,k as YC,ka as VI,kb as mv,kc as Bm,l as Y0,la as JQ,lc as Nk,m as U8,ma as LI,mb as d5,mc as Ak,n as b2,na as MI,nb as Zb,nc as e5,o as I1,oa as PI,ob as rI,oc as xr,p as R3,pa as qY,pb as aI,pc as og,q as MC,qa as _I,qb as gx,qc as zK,r as n0,ra as OI,rb as YI,rc as Km,s as L1,sa as jI,sb as oI,sc as $m,t as G6,ta as TI,tb as ja,tc as mb,u as EB,ua as CI,ub as no,uc as ub,v as WE,va as g8,vb as nI,vc as fS,w as _G,wa as EI,wb as sI,x as tA,xa as VU,xb as tI,xc as aS,y as qE,ya as u3,yb as eI,yc as I4,z as eA,za as hi,zb as DY,zc as CU}from"/chunk-mjjregkn.js";import{Mc as a4}from"/chunk-vt6zybej.js";import{Nc as m}from"/chunk-00rh9df4.js";import{Oc as ab,Pc as LD,Qc as MD,Rc as k3,Sc as aG}from"/chunk-hmka9rt5.js";import{Xc as B1,Yc as U4,Zc as _5}from"/chunk-am4agx6v.js";import{$c as b5,_c as P,ad as I5,bd as yL}from"/chunk-d7cbm65e.js";var RZ=b5((Je)=>{var i8=P(m());function rt($,Z){return $===Z&&($!==0||1/$===1/Z)||$!==$&&Z!==Z}var at=typeof Object.is==="function"?Object.is:rt,ot=i8.useState,nt=i8.useEffect,st=i8.useLayoutEffect,tt=i8.useDebugValue;function et($,Z){var J=Z(),H=ot({inst:{value:J,getSnapshot:Z}}),B=H[0].inst,Q=H[1];return st(function(){B.value=J,B.getSnapshot=Z,pN(B)&&Q({inst:B})},[$,J,Z]),nt(function(){return pN(B)&&Q({inst:B}),$(function(){pN(B)&&Q({inst:B})})},[$]),tt(J),J}function pN($){var Z=$.getSnapshot;$=$.value;try{var J=Z();return!at($,J)}catch(H){return!0}}function $e($,Z){return Z()}var Ze=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?$e:et;Je.useSyncExternalStore=i8.useSyncExternalStore!==void 0?i8.useSyncExternalStore:Ze});var Cm=b5((oJ1,Tm)=>{var Pm=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,L$0=/\n/g,M$0=/^\s*/,P$0=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,_$0=/^:\s*/,O$0=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,j$0=/^[;\s]*/,T$0=/^\s+|\s+$/g,C$0=`
2
+ `,_m="/",Om="*",i$="",E$0="comment",b$0="declaration";function w$0($,Z){if(typeof $!=="string")throw TypeError("First argument must be a string");if(!$)return[];Z=Z||{};var J=1,H=1;function B(q){var N=q.match(L$0);if(N)J+=N.length;var D=q.lastIndexOf(C$0);H=~D?q.length-D:H+q.length}function Q(){var q={line:J,column:H};return function(N){return N.position=new X(q),U(),N}}function X(q){this.start=q,this.end={line:J,column:H},this.source=Z.source}X.prototype.content=$;function z(q){var N=Error(Z.source+":"+J+":"+H+": "+q);if(N.reason=q,N.filename=Z.source,N.line=J,N.column=H,N.source=$,Z.silent);else throw N}function G(q){var N=q.exec($);if(!N)return;var D=N[0];return B(D),$=$.slice(D.length),N}function U(){G(M$0)}function Y(q){var N;q=q||[];while(N=K())if(N!==!1)q.push(N);return q}function K(){var q=Q();if(_m!=$.charAt(0)||Om!=$.charAt(1))return;var N=2;while(i$!=$.charAt(N)&&(Om!=$.charAt(N)||_m!=$.charAt(N+1)))++N;if(N+=2,i$===$.charAt(N-1))return z("End of comment missing");var D=$.slice(2,N-2);return H+=2,B(D),$=$.slice(N),H+=2,q({type:E$0,comment:D})}function F(){var q=Q(),N=G(P$0);if(!N)return;if(K(),!G(_$0))return z("property missing ':'");var D=G(O$0),A=q({type:b$0,property:jm(N[0].replace(Pm,i$)),value:D?jm(D[0].replace(Pm,i$)):i$});return G(j$0),A}function W(){var q=[];Y(q);var N;while(N=F())if(N!==!1)q.push(N),Y(q);return q}return U(),W()}function jm($){return $?$.replace(T$0,i$):i$}Tm.exports=w$0});var Em=b5((HX)=>{var S$0=HX&&HX.__importDefault||function($){return $&&$.__esModule?$:{default:$}};Object.defineProperty(HX,"__esModule",{value:!0});HX.default=I$0;var R$0=S$0(Cm());function I$0($,Z){let J=null;if(!$||typeof $!=="string")return J;let H=(0,R$0.default)($),B=typeof Z==="function";return H.forEach((Q)=>{if(Q.type!=="declaration")return;let{property:X,value:z}=Q;if(B)Z(X,z,Q);else if(z)J=J||{},J[X]=z}),J}});var Rm=b5((wm)=>{Object.defineProperty(wm,"__esModule",{value:!0});wm.camelCase=void 0;var k$0=/^--[a-zA-Z0-9_-]+$/,y$0=/-([a-z])/g,x$0=/^[^-]+$/,h$0=/^-(webkit|moz|ms|o|khtml)-/,v$0=/^-(ms)-/,f$0=function($){return!$||x$0.test($)||k$0.test($)},g$0=function($,Z){return Z.toUpperCase()},bm=function($,Z){return"".concat(Z,"-")},m$0=function($,Z){if(Z===void 0)Z={};if(f$0($))return $;if($=$.toLowerCase(),Z.reactCompat)$=$.replace(v$0,bm);else $=$.replace(h$0,bm);return $.replace(y$0,g$0)};wm.camelCase=m$0});var km=b5((jM,Im)=>{var u$0=jM&&jM.__importDefault||function($){return $&&$.__esModule?$:{default:$}},p$0=u$0(Em()),c$0=Rm();function OM($,Z){var J={};if(!$||typeof $!=="string")return J;return(0,p$0.default)($,function(H,B){if(H&&B)J[(0,c$0.camelCase)(H,Z)]=B}),J}OM.default=OM;Im.exports=OM});var $p=b5((mG1,eu)=>{var jW=Object.prototype.hasOwnProperty,tu=Object.prototype.toString,iu=Object.defineProperty,ru=Object.getOwnPropertyDescriptor,au=function(Z){if(typeof Array.isArray==="function")return Array.isArray(Z);return tu.call(Z)==="[object Array]"},ou=function(Z){if(!Z||tu.call(Z)!=="[object Object]")return!1;var J=jW.call(Z,"constructor"),H=Z.constructor&&Z.constructor.prototype&&jW.call(Z.constructor.prototype,"isPrototypeOf");if(Z.constructor&&!J&&!H)return!1;var B;for(B in Z);return typeof B>"u"||jW.call(Z,B)},nu=function(Z,J){if(iu&&J.name==="__proto__")iu(Z,J.name,{enumerable:!0,configurable:!0,value:J.newValue,writable:!0});else Z[J.name]=J.newValue},su=function(Z,J){if(J==="__proto__"){if(!jW.call(Z,J))return;else if(ru)return ru(Z,J).value}return Z[J]};eu.exports=function $(){var Z,J,H,B,Q,X,z=arguments[0],G=1,U=arguments.length,Y=!1;if(typeof z==="boolean")Y=z,z=arguments[1]||{},G=2;if(z==null||typeof z!=="object"&&typeof z!=="function")z={};for(;G<U;++G)if(Z=arguments[G],Z!=null){for(J in Z)if(H=su(z,J),B=su(Z,J),z!==B){if(Y&&B&&(ou(B)||(Q=au(B)))){if(Q)Q=!1,X=H&&au(H)?H:[];else X=H&&ou(H)?H:{};nu(z,{name:J,newValue:$(Y,X,B)})}else if(typeof B<"u")nu(z,{name:J,newValue:B})}}return z}});var lc=b5((zK1,dc)=>{function wc($){if($ instanceof Map)$.clear=$.delete=$.set=function(){throw Error("map is read-only")};else if($ instanceof Set)$.add=$.clear=$.delete=function(){throw Error("set is read-only")};return Object.freeze($),Object.getOwnPropertyNames($).forEach((Z)=>{let J=$[Z],H=typeof J;if((H==="object"||H==="function")&&!Object.isFrozen(J))wc(J)}),$}class NP{constructor($){if($.data===void 0)$.data={};this.data=$.data,this.isMatchIgnored=!1}ignoreMatch(){this.isMatchIgnored=!0}}function Sc($){return $.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#x27;")}function T7($,...Z){let J=Object.create(null);for(let H in $)J[H]=$[H];return Z.forEach(function(H){for(let B in H)J[B]=H[B]}),J}var qB0="</span>",Oc=($)=>{return!!$.scope},NB0=($,{prefix:Z})=>{if($.startsWith("language:"))return $.replace("language:","language-");if($.includes(".")){let J=$.split(".");return[`${Z}${J.shift()}`,...J.map((H,B)=>`${H}${"_".repeat(B+1)}`)].join(" ")}return`${Z}${$}`};class Rc{constructor($,Z){this.buffer="",this.classPrefix=Z.classPrefix,$.walk(this)}addText($){this.buffer+=Sc($)}openNode($){if(!Oc($))return;let Z=NB0($.scope,{prefix:this.classPrefix});this.span(Z)}closeNode($){if(!Oc($))return;this.buffer+=qB0}value(){return this.buffer}span($){this.buffer+=`<span class="${$}">`}}var jc=($={})=>{let Z={children:[]};return Object.assign(Z,$),Z};class AP{constructor(){this.rootNode=jc(),this.stack=[this.rootNode]}get top(){return this.stack[this.stack.length-1]}get root(){return this.rootNode}add($){this.top.children.push($)}openNode($){let Z=jc({scope:$});this.add(Z),this.stack.push(Z)}closeNode(){if(this.stack.length>1)return this.stack.pop();return}closeAllNodes(){while(this.closeNode());}toJSON(){return JSON.stringify(this.rootNode,null,4)}walk($){return this.constructor._walk($,this.rootNode)}static _walk($,Z){if(typeof Z==="string")$.addText(Z);else if(Z.children)$.openNode(Z),Z.children.forEach((J)=>this._walk($,J)),$.closeNode(Z);return $}static _collapse($){if(typeof $==="string")return;if(!$.children)return;if($.children.every((Z)=>typeof Z==="string"))$.children=[$.children.join("")];else $.children.forEach((Z)=>{AP._collapse(Z)})}}class Ic extends AP{constructor($){super();this.options=$}addText($){if($==="")return;this.add($)}startScope($){this.openNode($)}endScope(){this.closeNode()}__addSublanguage($,Z){let J=$.root;if(Z)J.scope=`language:${Z}`;this.add(J)}toHTML(){return new Rc(this,this.options).value()}finalize(){return this.closeAllNodes(),!0}}function MX($){if(!$)return null;if(typeof $==="string")return $;return $.source}function kc($){return JZ("(?=",$,")")}function AB0($){return JZ("(?:",$,")*")}function DB0($){return JZ("(?:",$,")?")}function JZ(...$){return $.map((J)=>MX(J)).join("")}function VB0($){let Z=$[$.length-1];if(typeof Z==="object"&&Z.constructor===Object)return $.splice($.length-1,1),Z;else return{}}function DP(...$){return"("+(VB0($).capture?"":"?:")+$.map((H)=>MX(H)).join("|")+")"}function yc($){return new RegExp($.toString()+"|").exec("").length-1}function LB0($,Z){let J=$&&$.exec(Z);return J&&J.index===0}var MB0=/\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./;function VP($,{joinWith:Z}){let J=0;return $.map((H)=>{J+=1;let B=J,Q=MX(H),X="";while(Q.length>0){let z=MB0.exec(Q);if(!z){X+=Q;break}if(X+=Q.substring(0,z.index),Q=Q.substring(z.index+z[0].length),z[0][0]==="\\"&&z[1])X+="\\"+String(Number(z[1])+B);else if(X+=z[0],z[0]==="(")J++}return X}).map((H)=>`(${H})`).join(Z)}var PB0=/\b\B/,xc="[a-zA-Z]\\w*",LP="[a-zA-Z_]\\w*",hc="\\b\\d+(\\.\\d+)?",vc="(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",fc="\\b(0b[01]+)",_B0="!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~",OB0=($={})=>{let Z=/^#![ ]*\//;if($.binary)$.begin=JZ(Z,/.*\b/,$.binary,/\b.*/);return T7({scope:"meta",begin:Z,end:/$/,relevance:0,"on:begin":(J,H)=>{if(J.index!==0)H.ignoreMatch()}},$)},PX={begin:"\\\\[\\s\\S]",relevance:0},jB0={scope:"string",begin:"'",end:"'",illegal:"\\n",contains:[PX]},TB0={scope:"string",begin:'"',end:'"',illegal:"\\n",contains:[PX]},CB0={begin:/\b(a|an|the|are|I'm|isn't|don't|doesn't|won't|but|just|should|pretty|simply|enough|gonna|going|wtf|so|such|will|you|your|they|like|more)\b/},fW=function($,Z,J={}){let H=T7({scope:"comment",begin:$,end:Z,contains:[]},J);H.contains.push({scope:"doctag",begin:"[ ]*(?=(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):)",end:/(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):/,excludeBegin:!0,relevance:0});let B=DP("I","a","is","so","us","to","at","if","in","it","on",/[A-Za-z]+['](d|ve|re|ll|t|s|n)/,/[A-Za-z]+[-][a-z]+/,/[A-Za-z][a-z]{2,}/);return H.contains.push({begin:JZ(/[ ]+/,"(",B,/[.]?[:]?([.][ ]|[ ])/,"){3}")}),H},EB0=fW("//","$"),bB0=fW("/\\*","\\*/"),wB0=fW("#","$"),SB0={scope:"number",begin:hc,relevance:0},RB0={scope:"number",begin:vc,relevance:0},IB0={scope:"number",begin:fc,relevance:0},kB0={scope:"regexp",begin:/\/(?=[^/\n]*\/)/,end:/\/[gimuy]*/,contains:[PX,{begin:/\[/,end:/\]/,relevance:0,contains:[PX]}]},yB0={scope:"title",begin:xc,relevance:0},xB0={scope:"title",begin:LP,relevance:0},hB0={begin:"\\.\\s*"+LP,relevance:0},vB0=function($){return Object.assign($,{"on:begin":(Z,J)=>{J.data._beginMatch=Z[1]},"on:end":(Z,J)=>{if(J.data._beginMatch!==Z[1])J.ignoreMatch()}})},hW=Object.freeze({__proto__:null,APOS_STRING_MODE:jB0,BACKSLASH_ESCAPE:PX,BINARY_NUMBER_MODE:IB0,BINARY_NUMBER_RE:fc,COMMENT:fW,C_BLOCK_COMMENT_MODE:bB0,C_LINE_COMMENT_MODE:EB0,C_NUMBER_MODE:RB0,C_NUMBER_RE:vc,END_SAME_AS_BEGIN:vB0,HASH_COMMENT_MODE:wB0,IDENT_RE:xc,MATCH_NOTHING_RE:PB0,METHOD_GUARD:hB0,NUMBER_MODE:SB0,NUMBER_RE:hc,PHRASAL_WORDS_MODE:CB0,QUOTE_STRING_MODE:TB0,REGEXP_MODE:kB0,RE_STARTERS_RE:_B0,SHEBANG:OB0,TITLE_MODE:yB0,UNDERSCORE_IDENT_RE:LP,UNDERSCORE_TITLE_MODE:xB0});function fB0($,Z){if($.input[$.index-1]===".")Z.ignoreMatch()}function gB0($,Z){if($.className!==void 0)$.scope=$.className,delete $.className}function mB0($,Z){if(!Z)return;if(!$.beginKeywords)return;if($.begin="\\b("+$.beginKeywords.split(" ").join("|")+")(?!\\.)(?=\\b|\\s)",$.__beforeBegin=fB0,$.keywords=$.keywords||$.beginKeywords,delete $.beginKeywords,$.relevance===void 0)$.relevance=0}function uB0($,Z){if(!Array.isArray($.illegal))return;$.illegal=DP(...$.illegal)}function pB0($,Z){if(!$.match)return;if($.begin||$.end)throw Error("begin & end are not supported with match");$.begin=$.match,delete $.match}function cB0($,Z){if($.relevance===void 0)$.relevance=1}var dB0=($,Z)=>{if(!$.beforeMatch)return;if($.starts)throw Error("beforeMatch cannot be used with starts");let J=Object.assign({},$);Object.keys($).forEach((H)=>{delete $[H]}),$.keywords=J.keywords,$.begin=JZ(J.beforeMatch,kc(J.begin)),$.starts={relevance:0,contains:[Object.assign(J,{endsParent:!0})]},$.relevance=0,delete J.beforeMatch},lB0=["of","and","for","in","not","or","if","then","parent","list","value"],iB0="keyword";function gc($,Z,J=iB0){let H=Object.create(null);if(typeof $==="string")B(J,$.split(" "));else if(Array.isArray($))B(J,$);else Object.keys($).forEach(function(Q){Object.assign(H,gc($[Q],Z,Q))});return H;function B(Q,X){if(Z)X=X.map((z)=>z.toLowerCase());X.forEach(function(z){let G=z.split("|");H[G[0]]=[Q,rB0(G[0],G[1])]})}}function rB0($,Z){if(Z)return Number(Z);return aB0($)?0:1}function aB0($){return lB0.includes($.toLowerCase())}var Tc={},ZZ=($)=>{console.error($)},Cc=($,...Z)=>{console.log(`WARN: ${$}`,...Z)},_H=($,Z)=>{if(Tc[`${$}/${Z}`])return;console.log(`Deprecated as of ${$}. ${Z}`),Tc[`${$}/${Z}`]=!0},vW=Error();function mc($,Z,{key:J}){let H=0,B=$[J],Q={},X={};for(let z=1;z<=Z.length;z++)X[z+H]=B[z],Q[z+H]=!0,H+=yc(Z[z-1]);$[J]=X,$[J]._emit=Q,$[J]._multi=!0}function oB0($){if(!Array.isArray($.begin))return;if($.skip||$.excludeBegin||$.returnBegin)throw ZZ("skip, excludeBegin, returnBegin not compatible with beginScope: {}"),vW;if(typeof $.beginScope!=="object"||$.beginScope===null)throw ZZ("beginScope must be object"),vW;mc($,$.begin,{key:"beginScope"}),$.begin=VP($.begin,{joinWith:""})}function nB0($){if(!Array.isArray($.end))return;if($.skip||$.excludeEnd||$.returnEnd)throw ZZ("skip, excludeEnd, returnEnd not compatible with endScope: {}"),vW;if(typeof $.endScope!=="object"||$.endScope===null)throw ZZ("endScope must be object"),vW;mc($,$.end,{key:"endScope"}),$.end=VP($.end,{joinWith:""})}function sB0($){if($.scope&&typeof $.scope==="object"&&$.scope!==null)$.beginScope=$.scope,delete $.scope}function tB0($){if(sB0($),typeof $.beginScope==="string")$.beginScope={_wrap:$.beginScope};if(typeof $.endScope==="string")$.endScope={_wrap:$.endScope};oB0($),nB0($)}function eB0($){function Z(X,z){return new RegExp(MX(X),"m"+($.case_insensitive?"i":"")+($.unicodeRegex?"u":"")+(z?"g":""))}class J{constructor(){this.matchIndexes={},this.regexes=[],this.matchAt=1,this.position=0}addRule(X,z){z.position=this.position++,this.matchIndexes[this.matchAt]=z,this.regexes.push([z,X]),this.matchAt+=yc(X)+1}compile(){if(this.regexes.length===0)this.exec=()=>null;let X=this.regexes.map((z)=>z[1]);this.matcherRe=Z(VP(X,{joinWith:"|"}),!0),this.lastIndex=0}exec(X){this.matcherRe.lastIndex=this.lastIndex;let z=this.matcherRe.exec(X);if(!z)return null;let G=z.findIndex((Y,K)=>K>0&&Y!==void 0),U=this.matchIndexes[G];return z.splice(0,G),Object.assign(z,U)}}class H{constructor(){this.rules=[],this.multiRegexes=[],this.count=0,this.lastIndex=0,this.regexIndex=0}getMatcher(X){if(this.multiRegexes[X])return this.multiRegexes[X];let z=new J;return this.rules.slice(X).forEach(([G,U])=>z.addRule(G,U)),z.compile(),this.multiRegexes[X]=z,z}resumingScanAtSamePosition(){return this.regexIndex!==0}considerAll(){this.regexIndex=0}addRule(X,z){if(this.rules.push([X,z]),z.type==="begin")this.count++}exec(X){let z=this.getMatcher(this.regexIndex);z.lastIndex=this.lastIndex;let G=z.exec(X);if(this.resumingScanAtSamePosition())if(G&&G.index===this.lastIndex);else{let U=this.getMatcher(0);U.lastIndex=this.lastIndex+1,G=U.exec(X)}if(G){if(this.regexIndex+=G.position+1,this.regexIndex===this.count)this.considerAll()}return G}}function B(X){let z=new H;if(X.contains.forEach((G)=>z.addRule(G.begin,{rule:G,type:"begin"})),X.terminatorEnd)z.addRule(X.terminatorEnd,{type:"end"});if(X.illegal)z.addRule(X.illegal,{type:"illegal"});return z}function Q(X,z){let G=X;if(X.isCompiled)return G;[gB0,pB0,tB0,dB0].forEach((Y)=>Y(X,z)),$.compilerExtensions.forEach((Y)=>Y(X,z)),X.__beforeBegin=null,[mB0,uB0,cB0].forEach((Y)=>Y(X,z)),X.isCompiled=!0;let U=null;if(typeof X.keywords==="object"&&X.keywords.$pattern)X.keywords=Object.assign({},X.keywords),U=X.keywords.$pattern,delete X.keywords.$pattern;if(U=U||/\w+/,X.keywords)X.keywords=gc(X.keywords,$.case_insensitive);if(G.keywordPatternRe=Z(U,!0),z){if(!X.begin)X.begin=/\B|\b/;if(G.beginRe=Z(G.begin),!X.end&&!X.endsWithParent)X.end=/\B|\b/;if(X.end)G.endRe=Z(G.end);if(G.terminatorEnd=MX(G.end)||"",X.endsWithParent&&z.terminatorEnd)G.terminatorEnd+=(X.end?"|":"")+z.terminatorEnd}if(X.illegal)G.illegalRe=Z(X.illegal);if(!X.contains)X.contains=[];if(X.contains=[].concat(...X.contains.map(function(Y){return $Q0(Y==="self"?X:Y)})),X.contains.forEach(function(Y){Q(Y,G)}),X.starts)Q(X.starts,z);return G.matcher=B(G),G}if(!$.compilerExtensions)$.compilerExtensions=[];if($.contains&&$.contains.includes("self"))throw Error("ERR: contains `self` is not supported at the top-level of a language. See documentation.");return $.classNameAliases=T7($.classNameAliases||{}),Q($)}function uc($){if(!$)return!1;return $.endsWithParent||uc($.starts)}function $Q0($){if($.variants&&!$.cachedVariants)$.cachedVariants=$.variants.map(function(Z){return T7($,{variants:null},Z)});if($.cachedVariants)return $.cachedVariants;if(uc($))return T7($,{starts:$.starts?T7($.starts):null});if(Object.isFrozen($))return T7($);return $}var ZQ0="11.11.1";class pc extends Error{constructor($,Z){super($);this.name="HTMLInjectionError",this.html=Z}}var qP=Sc,Ec=T7,bc=Symbol("nomatch"),JQ0=7,cc=function($){let Z=Object.create(null),J=Object.create(null),H=[],B=!0,Q="Could not find the language '{}', did you forget to load/include a language module?",X={disableAutodetect:!0,name:"Plain text",contains:[]},z={ignoreUnescapedHTML:!1,throwUnescapedHTML:!1,noHighlightRe:/^(no-?highlight)$/i,languageDetectRe:/\blang(?:uage)?-([\w-]+)\b/i,classPrefix:"hljs-",cssSelector:"pre code",languages:null,__emitter:Ic};function G(R){return z.noHighlightRe.test(R)}function U(R){let x=R.className+" ";x+=R.parentNode?R.parentNode.className:"";let v=z.languageDetectRe.exec(x);if(v){let f=C(v[1]);if(!f)Cc(Q.replace("{}",v[1])),Cc("Falling back to no-highlight mode for this block.",R);return f?v[1]:"no-highlight"}return x.split(/\s+/).find((f)=>G(f)||C(f))}function Y(R,x,v){let f="",b="";if(typeof x==="object")f=R,v=x.ignoreIllegals,b=x.language;else _H("10.7.0","highlight(lang, code, ...args) has been deprecated."),_H("10.7.0",`Please use highlight(code, options) instead.
3
+ https://github.com/highlightjs/highlight.js/issues/2277`),b=R,f=x;if(v===void 0)v=!0;let l={code:f,language:b};T("before:highlight",l);let r=l.result?l.result:K(l.language,l.code,v);return r.code=l.code,T("after:highlight",r),r}function K(R,x,v,f){let b=Object.create(null);function l(g,u){return g.keywords[u]}function r(){if(!a.keywords){t.addText(B0);return}let g=0;a.keywordPatternRe.lastIndex=0;let u=a.keywordPatternRe.exec(B0),e="";while(u){e+=B0.substring(g,u.index);let W0=N0.case_insensitive?u[0].toLowerCase():u[0],S0=l(a,W0);if(S0){let[h0,v0]=S0;if(t.addText(e),e="",b[W0]=(b[W0]||0)+1,b[W0]<=JQ0)_0+=v0;if(h0.startsWith("_"))e+=u[0];else{let T0=N0.classNameAliases[h0]||h0;o(u[0],T0)}}else e+=u[0];g=a.keywordPatternRe.lastIndex,u=a.keywordPatternRe.exec(B0)}e+=B0.substring(g),t.addText(e)}function h(){if(B0==="")return;let g=null;if(typeof a.subLanguage==="string"){if(!Z[a.subLanguage]){t.addText(B0);return}g=K(a.subLanguage,B0,!0,$0[a.subLanguage]),$0[a.subLanguage]=g._top}else g=W(B0,a.subLanguage.length?a.subLanguage:null);if(a.relevance>0)_0+=g.relevance;t.__addSublanguage(g._emitter,g.language)}function d(){if(a.subLanguage!=null)h();else r();B0=""}function o(g,u){if(g==="")return;t.startScope(u),t.addText(g),t.endScope()}function p(g,u){let e=1,W0=u.length-1;while(e<=W0){if(!g._emit[e]){e++;continue}let S0=N0.classNameAliases[g[e]]||g[e],h0=u[e];if(S0)o(h0,S0);else B0=h0,r(),B0="";e++}}function i(g,u){if(g.scope&&typeof g.scope==="string")t.openNode(N0.classNameAliases[g.scope]||g.scope);if(g.beginScope){if(g.beginScope._wrap)o(B0,N0.classNameAliases[g.beginScope._wrap]||g.beginScope._wrap),B0="";else if(g.beginScope._multi)p(g.beginScope,u),B0=""}return a=Object.create(g,{parent:{value:a}}),a}function n(g,u,e){let W0=LB0(g.endRe,e);if(W0){if(g["on:end"]){let S0=new NP(g);if(g["on:end"](u,S0),S0.isMatchIgnored)W0=!1}if(W0){while(g.endsParent&&g.parent)g=g.parent;return g}}if(g.endsWithParent)return n(g.parent,u,e)}function Z0(g){if(a.matcher.regexIndex===0)return B0+=g[0],1;else return L0=!0,0}function J0(g){let u=g[0],e=g.rule,W0=new NP(e),S0=[e.__beforeBegin,e["on:begin"]];for(let h0 of S0){if(!h0)continue;if(h0(g,W0),W0.isMatchIgnored)return Z0(u)}if(e.skip)B0+=u;else{if(e.excludeBegin)B0+=u;if(d(),!e.returnBegin&&!e.excludeBegin)B0=u}return i(e,g),e.returnBegin?0:u.length}function U0(g){let u=g[0],e=x.substring(g.index),W0=n(a,g,e);if(!W0)return bc;let S0=a;if(a.endScope&&a.endScope._wrap)d(),o(u,a.endScope._wrap);else if(a.endScope&&a.endScope._multi)d(),p(a.endScope,g);else if(S0.skip)B0+=u;else{if(!(S0.returnEnd||S0.excludeEnd))B0+=u;if(d(),S0.excludeEnd)B0=u}do{if(a.scope)t.closeNode();if(!a.skip&&!a.subLanguage)_0+=a.relevance;a=a.parent}while(a!==W0.parent);if(W0.starts)i(W0.starts,g);return S0.returnEnd?0:u.length}function z0(){let g=[];for(let u=a;u!==N0;u=u.parent)if(u.scope)g.unshift(u.scope);g.forEach((u)=>t.openNode(u))}let X0={};function q0(g,u){let e=u&&u[0];if(B0+=g,e==null)return d(),0;if(X0.type==="begin"&&u.type==="end"&&X0.index===u.index&&e===""){if(B0+=x.slice(u.index,u.index+1),!B){let W0=Error(`0 width match regex (${R})`);throw W0.languageName=R,W0.badRule=X0.rule,W0}return 1}if(X0=u,u.type==="begin")return J0(u);else if(u.type==="illegal"&&!v){let W0=Error('Illegal lexeme "'+e+'" for mode "'+(a.scope||"<unnamed>")+'"');throw W0.mode=a,W0}else if(u.type==="end"){let W0=U0(u);if(W0!==bc)return W0}if(u.type==="illegal"&&e==="")return B0+=`
4
+ `,1;if(A0>1e5&&A0>u.index*3)throw Error("potential infinite loop, way more iterations than matches");return B0+=e,e.length}let N0=C(R);if(!N0)throw ZZ(Q.replace("{}",R)),Error('Unknown language: "'+R+'"');let F0=eB0(N0),s="",a=f||F0,$0={},t=new z.__emitter(z);z0();let B0="",_0=0,P0=0,A0=0,L0=!1;try{if(!N0.__emitTokens){a.matcher.considerAll();for(;;){if(A0++,L0)L0=!1;else a.matcher.considerAll();a.matcher.lastIndex=P0;let g=a.matcher.exec(x);if(!g)break;let u=x.substring(P0,g.index),e=q0(u,g);P0=g.index+e}q0(x.substring(P0))}else N0.__emitTokens(x,t);return t.finalize(),s=t.toHTML(),{language:R,value:s,relevance:_0,illegal:!1,_emitter:t,_top:a}}catch(g){if(g.message&&g.message.includes("Illegal"))return{language:R,value:qP(x),illegal:!0,relevance:0,_illegalBy:{message:g.message,index:P0,context:x.slice(P0-100,P0+100),mode:g.mode,resultSoFar:s},_emitter:t};else if(B)return{language:R,value:qP(x),illegal:!1,relevance:0,errorRaised:g,_emitter:t,_top:a};else throw g}}function F(R){let x={value:qP(R),illegal:!1,relevance:0,_top:X,_emitter:new z.__emitter(z)};return x._emitter.addText(R),x}function W(R,x){x=x||z.languages||Object.keys(Z);let v=F(R),f=x.filter(C).filter(j).map((d)=>K(d,R,!1));f.unshift(v);let b=f.sort((d,o)=>{if(d.relevance!==o.relevance)return o.relevance-d.relevance;if(d.language&&o.language){if(C(d.language).supersetOf===o.language)return 1;else if(C(o.language).supersetOf===d.language)return-1}return 0}),[l,r]=b,h=l;return h.secondBest=r,h}function q(R,x,v){let f=x&&J[x]||v;R.classList.add("hljs"),R.classList.add(`language-${f}`)}function N(R){let x=null,v=U(R);if(G(v))return;if(T("before:highlightElement",{el:R,language:v}),R.dataset.highlighted){console.log("Element previously highlighted. To highlight again, first unset `dataset.highlighted`.",R);return}if(R.children.length>0){if(!z.ignoreUnescapedHTML)console.warn("One of your code blocks includes unescaped HTML. This is a potentially serious security risk."),console.warn("https://github.com/highlightjs/highlight.js/wiki/security"),console.warn("The element with unescaped HTML:"),console.warn(R);if(z.throwUnescapedHTML)throw new pc("One of your code blocks includes unescaped HTML.",R.innerHTML)}x=R;let f=x.textContent,b=v?Y(f,{language:v,ignoreIllegals:!0}):W(f);if(R.innerHTML=b.value,R.dataset.highlighted="yes",q(R,v,b.language),R.result={language:b.language,re:b.relevance,relevance:b.relevance},b.secondBest)R.secondBest={language:b.secondBest.language,relevance:b.secondBest.relevance};T("after:highlightElement",{el:R,result:b,text:f})}function D(R){z=Ec(z,R)}let A=()=>{O(),_H("10.6.0","initHighlighting() deprecated. Use highlightAll() now.")};function V(){O(),_H("10.6.0","initHighlightingOnLoad() deprecated. Use highlightAll() now.")}let L=!1;function O(){function R(){O()}if(document.readyState==="loading"){if(!L)window.addEventListener("DOMContentLoaded",R,!1);L=!0;return}document.querySelectorAll(z.cssSelector).forEach(N)}function M(R,x){let v=null;try{v=x($)}catch(f){if(ZZ("Language definition for '{}' could not be registered.".replace("{}",R)),!B)throw f;else ZZ(f);v=X}if(!v.name)v.name=R;if(Z[R]=v,v.rawDefinition=x.bind(null,$),v.aliases)E(v.aliases,{languageName:R})}function _(R){delete Z[R];for(let x of Object.keys(J))if(J[x]===R)delete J[x]}function w(){return Object.keys(Z)}function C(R){return R=(R||"").toLowerCase(),Z[R]||Z[J[R]]}function E(R,{languageName:x}){if(typeof R==="string")R=[R];R.forEach((v)=>{J[v.toLowerCase()]=x})}function j(R){let x=C(R);return x&&!x.disableAutodetect}function k(R){if(R["before:highlightBlock"]&&!R["before:highlightElement"])R["before:highlightElement"]=(x)=>{R["before:highlightBlock"](Object.assign({block:x.el},x))};if(R["after:highlightBlock"]&&!R["after:highlightElement"])R["after:highlightElement"]=(x)=>{R["after:highlightBlock"](Object.assign({block:x.el},x))}}function S(R){k(R),H.push(R)}function I(R){let x=H.indexOf(R);if(x!==-1)H.splice(x,1)}function T(R,x){let v=R;H.forEach(function(f){if(f[v])f[v](x)})}function y(R){return _H("10.7.0","highlightBlock will be removed entirely in v12.0"),_H("10.7.0","Please use highlightElement now."),N(R)}Object.assign($,{highlight:Y,highlightAuto:W,highlightAll:O,highlightElement:N,highlightBlock:y,configure:D,initHighlighting:A,initHighlightingOnLoad:V,registerLanguage:M,unregisterLanguage:_,listLanguages:w,getLanguage:C,registerAliases:E,autoDetection:j,inherit:Ec,addPlugin:S,removePlugin:I}),$.debugMode=function(){B=!1},$.safeMode=function(){B=!0},$.versionString=ZQ0,$.regex={concat:JZ,lookahead:kc,either:DP,optional:DB0,anyNumberOfTimes:AB0};for(let R in hW)if(typeof hW[R]==="object")wc(hW[R]);return Object.assign($,hW),$},OH=cc({});OH.newInstance=()=>cc({});dc.exports=OH;OH.HighlightJS=OH;OH.default=OH});var ll=b5((XD1,dl)=>{var bz0=["||","&&",";;","|&","<(","<<<",">>",">&","<&","&",";","(",")","|","<",">"],cl=/[\n\r\u2028\u2029]/,wz0=/[\s#!"$&'():;<=>@\\^`|]/g;dl.exports=function(Z){return Z.map(function(J){if(J==="")return"''";if(J&&typeof J==="object"){if("op"in J&&J.op==="glob"){if(typeof J.pattern!=="string")throw TypeError("glob token requires a string `pattern`");if(cl.test(J.pattern))throw TypeError("glob `pattern` must not contain line terminators");return J.pattern.replace(wz0,"\\$&")}if("op"in J&&typeof J.op==="string"){if(bz0.indexOf(J.op)<0)throw TypeError("invalid `op` value: "+JSON.stringify(J.op));return J.op.replace(/[\s\S]/g,"\\$&")}if("comment"in J&&typeof J.comment==="string"){if(cl.test(J.comment))throw TypeError("`comment` must not contain line terminators");return"#"+J.comment}throw TypeError("unrecognized object token shape")}if(/["\s\\]/.test(J)&&!/'/.test(J))return"'"+J.replace(/(['])/g,"\\$1")+"'";if(/["'\s]/.test(J))return'"'+J.replace(/(["\\$`!])/g,"\\$1")+'"';return String(J).replace(/([A-Za-z]:)?([#!"$&'()*,:;<=>?@[\\\]^`{|}~])/g,"$1\\$2")}).join(" ")}});var tl=b5((zD1,sl)=>{var nl="(?:"+["\\|\\|","\\&\\&",";;","\\|\\&","\\<\\(","\\<\\<\\<",">>",">\\&","<\\&","[&;()|<>]"].join("|")+")",il=new RegExp("^"+nl+"$"),rl="|&;()<> \\t",Sz0="'([^']*?)'",Rz0='"((\\\\"|[^"])*?)"',Iz0=/^#$/,al="'",ol='"',aW="$",QZ="",kz0=4294967296;for(oW=0;oW<4;oW++)QZ+=(kz0*Math.random()).toString(16);var oW,yz0=new RegExp("^"+QZ);function xz0($,Z){var J=Z.lastIndex,H=[],B;while(B=Z.exec($))if(H[H.length]=B,Z.lastIndex===B.index)Z.lastIndex+=1;return Z.lastIndex=J,H}function hz0($,Z,J){var H=typeof $==="function"?$(J):$[J];if(typeof H>"u"&&J!="")H="";else if(typeof H>"u")H="$";if(typeof H==="object")return Z+QZ+JSON.stringify(H)+QZ;return Z+H}function vz0($,Z,J){if(!J)J={};var H=J.escape||"\\",B=J.splitUnquoted===!0?`
5
+ `:typeof J.splitUnquoted==="string"?J.splitUnquoted:"",Q="(\\"+H+`['"`+rl+`]|[^\\s'"`+rl+"])+",X=new RegExp(["("+nl+")","("+Q+"|"+Rz0+"|"+Sz0+")+"].join("|"),"g"),z=xz0($,X);if(z.length===0)return[];if(!Z)Z={};var G=!1;return z.map(function(U){var Y=U[0];if(!Y||G)return;if(il.test(Y))return{op:Y};var K=!1,F=!1,W="",q=[],N=!1,D=null,A=!1,V;function L(){V+=1;var k,S,I=Y.charAt(V);if(I==="{"){if(V+=1,Y.charAt(V)==="}")throw Error("Bad substitution: "+Y.slice(V-2,V+1));var T=1;k=V;while(T>0&&k<Y.length){if(Y.charAt(k)==="{"&&Y.charAt(k-1)==="$")T+=1;else if(Y.charAt(k)==="}")T-=1;k+=1}if(T!==0)throw Error("Bad substitution: "+Y.slice(V));k-=1,S=Y.slice(V,k),V=k}else if(/[*@#?$!_-]/.test(I))S=I,V+=1;else{var y=Y.slice(V);if(k=y.match(/[^\w\d_]/),!k)S=y,V=Y.length;else S=y.slice(0,k.index),V+=k.index-1}return hz0(Z,"",S)}function O(){if(D===null)return;if(D===0){if(W!=="")q[q.length]=W,W=""}else{q[q.length]=W,W="";for(var k=1;k<D;k+=1)q[q.length]=""}D=null}for(V=0;V<Y.length;V++){var M=Y.charAt(V);if(B&&M!==aW)O();if(A=A||!K&&(M==="*"||M==="?"),F)W+=M,F=!1;else if(K)if(M===K)K=!1;else if(K==al)W+=M;else if(M===H)if(V+=1,M=Y.charAt(V),M===ol||M===H||M===aW)W+=M;else W+=H+M;else if(M===aW)W+=L();else W+=M;else if(M===ol||M===al)K=M,N=!0;else if(il.test(M))return{op:Y};else if(Iz0.test(M)){G=!0;var _={comment:$.slice(U.index+V+1)};if(W.length)return[W,_];return[_]}else if(M===H)F=!0;else if(M===aW){var w=L();if(!B)W+=w;else for(var C=0;C<w.length;C+=1){var E=w.charAt(C);if(B.indexOf(E)<0)O(),W+=E;else if(D===null)D=E===" "||E==="\t"||E===`
6
+ `?0:1;else if(E!==" "&&E!=="\t"&&E!==`
7
+ `)D+=1}}else W+=M}if(A)return{op:"glob",pattern:W};if(B){if(D!==null&&D>0){q[q.length]=W,W="";for(var j=1;j<D;j+=1)q[q.length]=""}if(W!==""||N&&q.length===0)q[q.length]=W;return q}return W}).reduce(function(U,Y){if(typeof Y>"u")return U;return[].concat(Y).forEach(function(K){U[U.length]=K}),U},[])}sl.exports=function(Z,J,H){var B=vz0(Z,J,H);if(typeof J!=="function")return B;return B.reduce(function(Q,X){if(typeof X==="object")return Q[Q.length]=X,Q;var z=X.split(RegExp("("+QZ+".*?"+QZ+")","g"));if(z.length===1)return Q[Q.length]=z[0],Q;return z.filter(Boolean).forEach(function(G){Q[Q.length]=yz0.test(G)?JSON.parse(G.split(QZ)[1]):G}),Q},[])}});var fi=b5((JL1,vi)=>{var aG0="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";vi.exports=aG0});var pi=b5((HL1,ui)=>{var oG0=fi();function gi(){}function mi(){}mi.resetWarningCache=gi;ui.exports=function(){function $(H,B,Q,X,z,G){if(G===oG0)return;var U=Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw U.name="Invariant Violation",U}$.isRequired=$;function Z(){return $}var J={array:$,bigint:$,bool:$,func:$,number:$,object:$,string:$,symbol:$,any:$,arrayOf:Z,element:$,elementType:$,instanceOf:Z,node:$,objectOf:Z,oneOf:Z,oneOfType:Z,shape:Z,exact:Z,checkPropTypes:mi,resetWarningCache:gi};return J.PropTypes=J,J}});var wX=b5((BL1,ci)=>{ci.exports=pi()();var nG0,sG0});var ii=b5((QL1,b_)=>{function li($){var Z,J,H="";if(typeof $=="string"||typeof $=="number")H+=$;else if(typeof $=="object")if(Array.isArray($)){var B=$.length;for(Z=0;Z<B;Z++)$[Z]&&(J=li($[Z]))&&(H&&(H+=" "),H+=J)}else for(J in $)$[J]&&(H&&(H+=" "),H+=J);return H}function di(){for(var $,Z,J=0,H="",B=arguments.length;J<B;J++)($=arguments[J])&&(Z=li($))&&(H&&(H+=" "),H+=Z);return H}b_.exports=di,b_.exports.clsx=di});var SX=b5((ri)=>{Object.defineProperty(ri,"__esModule",{value:!0});ri.dontSetMe=JU0;ri.findInArray=tG0;ri.int=ZU0;ri.isFunction=eG0;ri.isNum=$U0;function tG0($,Z){for(let J=0,H=$.length;J<H;J++)if(Z.apply(Z,[$[J],J,$]))return $[J]}function eG0($){return typeof $==="function"||Object.prototype.toString.call($)==="[object Function]"}function $U0($){return typeof $==="number"&&!isNaN($)}function ZU0($){return parseInt($,10)}function JU0($,Z,J){if($[Z])return Error(`Invalid prop ${Z} passed to ${J} - do not set this, set it on the child.`)}});var ti=b5((ni)=>{Object.defineProperty(ni,"__esModule",{value:!0});ni.browserPrefixToKey=oi;ni.browserPrefixToStyle=GU0;ni.default=void 0;ni.getPrefix=ai;var w_=["Moz","Webkit","O","ms"];function ai(){let $=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"transform";if(typeof window>"u")return"";let Z=window.document?.documentElement?.style;if(!Z)return"";if($ in Z)return"";for(let J=0;J<w_.length;J++)if(oi($,w_[J])in Z)return w_[J];return""}function oi($,Z){return Z?`${Z}${UU0($)}`:$}function GU0($,Z){return Z?`-${Z.toLowerCase()}-${$}`:$}function UU0($){let Z="",J=!0;for(let H=0;H<$.length;H++)if(J)Z+=$[H].toUpperCase(),J=!1;else if($[H]==="-")J=!0;else Z+=$[H];return Z}var zL1=ni.default=ai()});var Hq=b5((Qr)=>{Object.defineProperty(Qr,"__esModule",{value:!0});Qr.addClassName=Hr;Qr.addEvent=qU0;Qr.addUserSelectStyles=TU0;Qr.createCSSTransform=PU0;Qr.createSVGTransform=_U0;Qr.getTouch=OU0;Qr.getTouchIdentifier=jU0;Qr.getTranslation=S_;Qr.innerHeight=VU0;Qr.innerWidth=LU0;Qr.matchesSelector=Jr;Qr.matchesSelectorAndParentsTo=WU0;Qr.offsetXYFromParent=MU0;Qr.outerHeight=AU0;Qr.outerWidth=DU0;Qr.removeClassName=Br;Qr.removeEvent=NU0;Qr.scheduleRemoveUserSelectStyles=CU0;var V8=SX(),ei=Zr(ti());function Zr($,Z){if(typeof WeakMap=="function")var J=new WeakMap,H=new WeakMap;return(Zr=function(B,Q){if(!Q&&B&&B.__esModule)return B;var X,z,G={__proto__:null,default:B};if(B===null||typeof B!="object"&&typeof B!="function")return G;if(X=Q?H:J){if(X.has(B))return X.get(B);X.set(B,G)}for(let U in B)U!=="default"&&{}.hasOwnProperty.call(B,U)&&((z=(X=Object.defineProperty)&&Object.getOwnPropertyDescriptor(B,U))&&(z.get||z.set)?X(G,U,z):G[U]=B[U]);return G})($,Z)}var Jq="";function Jr($,Z){if(!Jq)Jq=(0,V8.findInArray)(["matches","webkitMatchesSelector","mozMatchesSelector","msMatchesSelector","oMatchesSelector"],function(J){return(0,V8.isFunction)($[J])});if(!(0,V8.isFunction)($[Jq]))return!1;return $[Jq](Z)}function WU0($,Z,J){let H=$;do{if(Jr(H,Z))return!0;if(H===J)return!1;H=H.parentNode}while(H);return!1}function qU0($,Z,J,H){if(!$)return;let B={capture:!0,...H};if($.addEventListener)$.addEventListener(Z,J,B);else if($.attachEvent)$.attachEvent("on"+Z,J);else $["on"+Z]=J}function NU0($,Z,J,H){if(!$)return;let B={capture:!0,...H};if($.removeEventListener)$.removeEventListener(Z,J,B);else if($.detachEvent)$.detachEvent("on"+Z,J);else $["on"+Z]=null}function AU0($){let Z=$.clientHeight,J=$.ownerDocument.defaultView.getComputedStyle($);return Z+=(0,V8.int)(J.borderTopWidth),Z+=(0,V8.int)(J.borderBottomWidth),Z}function DU0($){let Z=$.clientWidth,J=$.ownerDocument.defaultView.getComputedStyle($);return Z+=(0,V8.int)(J.borderLeftWidth),Z+=(0,V8.int)(J.borderRightWidth),Z}function VU0($){let Z=$.clientHeight,J=$.ownerDocument.defaultView.getComputedStyle($);return Z-=(0,V8.int)(J.paddingTop),Z-=(0,V8.int)(J.paddingBottom),Z}function LU0($){let Z=$.clientWidth,J=$.ownerDocument.defaultView.getComputedStyle($);return Z-=(0,V8.int)(J.paddingLeft),Z-=(0,V8.int)(J.paddingRight),Z}function MU0($,Z,J){let B=Z===Z.ownerDocument.body?{left:0,top:0}:Z.getBoundingClientRect(),Q=($.clientX+Z.scrollLeft-B.left)/J,X=($.clientY+Z.scrollTop-B.top)/J;return{x:Q,y:X}}function PU0($,Z){let J=S_($,Z,"px");return{[(0,ei.browserPrefixToKey)("transform",ei.default)]:J}}function _U0($,Z){return S_($,Z,"")}function S_($,Z,J){let{x:H,y:B}=$,Q=`translate(${H}${J},${B}${J})`;if(Z){let X=`${typeof Z.x==="string"?Z.x:Z.x+J}`,z=`${typeof Z.y==="string"?Z.y:Z.y+J}`;Q=`translate(${X}, ${z})`+Q}return Q}function OU0($,Z){return $.targetTouches&&(0,V8.findInArray)($.targetTouches,(J)=>Z===J.identifier)||$.changedTouches&&(0,V8.findInArray)($.changedTouches,(J)=>Z===J.identifier)}function jU0($){if($.targetTouches&&$.targetTouches[0])return $.targetTouches[0].identifier;if($.changedTouches&&$.changedTouches[0])return $.changedTouches[0].identifier}function TU0($){if(!$)return;let Z=$.getElementById("react-draggable-style-el");if(!Z)Z=$.createElement("style"),Z.type="text/css",Z.id="react-draggable-style-el",Z.innerHTML=`.react-draggable-transparent-selection *::-moz-selection {all: inherit;}
8
+ `,Z.innerHTML+=`.react-draggable-transparent-selection *::selection {all: inherit;}
9
+ `,$.getElementsByTagName("head")[0].appendChild(Z);if($.body)Hr($.body,"react-draggable-transparent-selection")}function CU0($){if(window.requestAnimationFrame)window.requestAnimationFrame(()=>{$r($)});else $r($)}function $r($){if(!$)return;try{if($.body)Br($.body,"react-draggable-transparent-selection");if($.selection)$.selection.empty();else{let Z=($.defaultView||window).getSelection();if(Z&&Z.type!=="Caret")Z.removeAllRanges()}}catch(Z){}}function Hr($,Z){if($.classList)$.classList.add(Z);else if(!$.className.match(new RegExp(`(?:^|\\s)${Z}(?!\\S)`)))$.className+=` ${Z}`}function Br($,Z){if($.classList)$.classList.remove(Z);else $.className=$.className.replace(new RegExp(`(?:^|\\s)${Z}(?!\\S)`,"g"),"")}});var I_=b5((Xr)=>{Object.defineProperty(Xr,"__esModule",{value:!0});Xr.canDragX=rU0;Xr.canDragY=aU0;Xr.createCoreData=nU0;Xr.createDraggableData=sU0;Xr.getBoundPosition=lU0;Xr.getControlPosition=oU0;Xr.snapToGrid=iU0;var L8=SX(),yH=Hq();function lU0($,Z,J){if(!$.props.bounds)return[Z,J];let{bounds:H}=$.props;H=typeof H==="string"?H:tU0(H);let B=R_($);if(typeof H==="string"){let{ownerDocument:Q}=B,X=Q.defaultView,z;if(H==="parent")z=B.parentNode;else z=B.getRootNode().querySelector(H);if(!(z instanceof X.HTMLElement))throw Error('Bounds selector "'+H+'" could not find an element.');let G=z,U=X.getComputedStyle(B),Y=X.getComputedStyle(G);H={left:-B.offsetLeft+(0,L8.int)(Y.paddingLeft)+(0,L8.int)(U.marginLeft),top:-B.offsetTop+(0,L8.int)(Y.paddingTop)+(0,L8.int)(U.marginTop),right:(0,yH.innerWidth)(G)-(0,yH.outerWidth)(B)-B.offsetLeft+(0,L8.int)(Y.paddingRight)-(0,L8.int)(U.marginRight),bottom:(0,yH.innerHeight)(G)-(0,yH.outerHeight)(B)-B.offsetTop+(0,L8.int)(Y.paddingBottom)-(0,L8.int)(U.marginBottom)}}if((0,L8.isNum)(H.right))Z=Math.min(Z,H.right);if((0,L8.isNum)(H.bottom))J=Math.min(J,H.bottom);if((0,L8.isNum)(H.left))Z=Math.max(Z,H.left);if((0,L8.isNum)(H.top))J=Math.max(J,H.top);return[Z,J]}function iU0($,Z,J){let H=Math.round(Z/$[0])*$[0],B=Math.round(J/$[1])*$[1];return[H,B]}function rU0($){return $.props.axis==="both"||$.props.axis==="x"}function aU0($){return $.props.axis==="both"||$.props.axis==="y"}function oU0($,Z,J){let H=typeof Z==="number"?(0,yH.getTouch)($,Z):null;if(typeof Z==="number"&&!H)return null;let B=R_(J),Q=J.props.offsetParent||B.offsetParent||B.ownerDocument.body;return(0,yH.offsetXYFromParent)(H||$,Q,J.props.scale)}function nU0($,Z,J){let H=!(0,L8.isNum)($.lastX),B=R_($);if(H)return{node:B,deltaX:0,deltaY:0,lastX:Z,lastY:J,x:Z,y:J};else return{node:B,deltaX:Z-$.lastX,deltaY:J-$.lastY,lastX:$.lastX,lastY:$.lastY,x:Z,y:J}}function sU0($,Z){let J=$.props.scale;return{node:Z.node,x:$.state.x+Z.deltaX/J,y:$.state.y+Z.deltaY/J,deltaX:Z.deltaX/J,deltaY:Z.deltaY/J,lastX:$.state.x,lastY:$.state.y}}function tU0($){return{left:$.left,top:$.top,right:$.right,bottom:$.bottom}}function R_($){let Z=$.findDOMNode();if(!Z)throw Error("<DraggableCore>: Unmounted during event!");return Z}});var k_=b5((zr)=>{Object.defineProperty(zr,"__esModule",{value:!0});zr.default=XY0;function XY0(){}});var Kr=b5((Ur)=>{var KY0=P(m()),FY0=P(U8());Object.defineProperty(Ur,"__esModule",{value:!0});Ur.default=void 0;var y_=Gr(KY0),h4=h_(wX()),GY0=h_(FY0),P4=Hq(),b7=I_(),x_=SX(),RX=h_(k_());function h_($){return $&&$.__esModule?$:{default:$}}function Gr($,Z){if(typeof WeakMap=="function")var J=new WeakMap,H=new WeakMap;return(Gr=function(B,Q){if(!Q&&B&&B.__esModule)return B;var X,z,G={__proto__:null,default:B};if(B===null||typeof B!="object"&&typeof B!="function")return G;if(X=Q?H:J){if(X.has(B))return X.get(B);X.set(B,G)}for(let U in B)U!=="default"&&{}.hasOwnProperty.call(B,U)&&((z=(X=Object.defineProperty)&&Object.getOwnPropertyDescriptor(B,U))&&(z.get||z.set)?X(G,U,z):G[U]=B[U]);return G})($,Z)}function v4($,Z,J){return(Z=UY0(Z))in $?Object.defineProperty($,Z,{value:J,enumerable:!0,configurable:!0,writable:!0}):$[Z]=J,$}function UY0($){var Z=YY0($,"string");return typeof Z=="symbol"?Z:Z+""}function YY0($,Z){if(typeof $!="object"||!$)return $;var J=$[Symbol.toPrimitive];if(J!==void 0){var H=J.call($,Z||"default");if(typeof H!="object")return H;throw TypeError("@@toPrimitive must return a primitive value.")}return(Z==="string"?String:Number)($)}var W9={touch:{start:"touchstart",move:"touchmove",stop:"touchend"},mouse:{start:"mousedown",move:"mousemove",stop:"mouseup"}},w7=W9.mouse;class IX extends y_.Component{constructor(){super(...arguments);v4(this,"dragging",!1),v4(this,"lastX",NaN),v4(this,"lastY",NaN),v4(this,"touchIdentifier",null),v4(this,"mounted",!1),v4(this,"handleDragStart",($)=>{if(this.props.onMouseDown($),!this.props.allowAnyClick&&typeof $.button==="number"&&$.button!==0)return!1;let Z=this.findDOMNode();if(!Z||!Z.ownerDocument||!Z.ownerDocument.body)throw Error("<DraggableCore> not mounted on DragStart!");let{ownerDocument:J}=Z;if(this.props.disabled||!($.target instanceof J.defaultView.Node)||this.props.handle&&!(0,P4.matchesSelectorAndParentsTo)($.target,this.props.handle,Z)||this.props.cancel&&(0,P4.matchesSelectorAndParentsTo)($.target,this.props.cancel,Z))return;if($.type==="touchstart"&&!this.props.allowMobileScroll)$.preventDefault();let H=(0,P4.getTouchIdentifier)($);this.touchIdentifier=H;let B=(0,b7.getControlPosition)($,H,this);if(B==null)return;let{x:Q,y:X}=B,z=(0,b7.createCoreData)(this,Q,X);if((0,RX.default)("DraggableCore: handleDragStart: %j",z),(0,RX.default)("calling",this.props.onStart),this.props.onStart($,z)===!1||this.mounted===!1)return;if(this.props.enableUserSelectHack)(0,P4.addUserSelectStyles)(J);this.dragging=!0,this.lastX=Q,this.lastY=X,(0,P4.addEvent)(J,w7.move,this.handleDrag),(0,P4.addEvent)(J,w7.stop,this.handleDragStop)}),v4(this,"handleDrag",($)=>{let Z=(0,b7.getControlPosition)($,this.touchIdentifier,this);if(Z==null)return;let{x:J,y:H}=Z;if(Array.isArray(this.props.grid)){let X=J-this.lastX,z=H-this.lastY;if([X,z]=(0,b7.snapToGrid)(this.props.grid,X,z),!X&&!z)return;J=this.lastX+X,H=this.lastY+z}let B=(0,b7.createCoreData)(this,J,H);if((0,RX.default)("DraggableCore: handleDrag: %j",B),this.props.onDrag($,B)===!1||this.mounted===!1){try{this.handleDragStop(new MouseEvent("mouseup"))}catch(X){let z=document.createEvent("MouseEvents");z.initMouseEvent("mouseup",!0,!0,window,0,0,0,0,0,!1,!1,!1,!1,0,null),this.handleDragStop(z)}return}this.lastX=J,this.lastY=H}),v4(this,"handleDragStop",($)=>{if(!this.dragging)return;let Z=(0,b7.getControlPosition)($,this.touchIdentifier,this);if(Z==null)return;let{x:J,y:H}=Z;if(Array.isArray(this.props.grid)){let z=J-this.lastX||0,G=H-this.lastY||0;[z,G]=(0,b7.snapToGrid)(this.props.grid,z,G),J=this.lastX+z,H=this.lastY+G}let B=(0,b7.createCoreData)(this,J,H);if(this.props.onStop($,B)===!1||this.mounted===!1)return!1;let X=this.findDOMNode();if(X){if(this.props.enableUserSelectHack)(0,P4.scheduleRemoveUserSelectStyles)(X.ownerDocument)}if((0,RX.default)("DraggableCore: handleDragStop: %j",B),this.dragging=!1,this.lastX=NaN,this.lastY=NaN,X)(0,RX.default)("DraggableCore: Removing handlers"),(0,P4.removeEvent)(X.ownerDocument,w7.move,this.handleDrag),(0,P4.removeEvent)(X.ownerDocument,w7.stop,this.handleDragStop)}),v4(this,"onMouseDown",($)=>{return w7=W9.mouse,this.handleDragStart($)}),v4(this,"onMouseUp",($)=>{return w7=W9.mouse,this.handleDragStop($)}),v4(this,"onTouchStart",($)=>{return w7=W9.touch,this.handleDragStart($)}),v4(this,"onTouchEnd",($)=>{return w7=W9.touch,this.handleDragStop($)})}componentDidMount(){this.mounted=!0;let $=this.findDOMNode();if($)(0,P4.addEvent)($,W9.touch.start,this.onTouchStart,{passive:!1})}componentWillUnmount(){this.mounted=!1;let $=this.findDOMNode();if($){let{ownerDocument:Z}=$;if((0,P4.removeEvent)(Z,W9.mouse.move,this.handleDrag),(0,P4.removeEvent)(Z,W9.touch.move,this.handleDrag),(0,P4.removeEvent)(Z,W9.mouse.stop,this.handleDragStop),(0,P4.removeEvent)(Z,W9.touch.stop,this.handleDragStop),(0,P4.removeEvent)($,W9.touch.start,this.onTouchStart,{passive:!1}),this.props.enableUserSelectHack)(0,P4.scheduleRemoveUserSelectStyles)(Z)}}findDOMNode(){return this.props?.nodeRef?this.props?.nodeRef?.current:GY0.default.findDOMNode(this)}render(){return y_.cloneElement(y_.Children.only(this.props.children),{onMouseDown:this.onMouseDown,onMouseUp:this.onMouseUp,onTouchEnd:this.onTouchEnd})}}Ur.default=IX;v4(IX,"displayName","DraggableCore");v4(IX,"propTypes",{allowAnyClick:h4.default.bool,allowMobileScroll:h4.default.bool,children:h4.default.node.isRequired,disabled:h4.default.bool,enableUserSelectHack:h4.default.bool,offsetParent:function($,Z){if($[Z]&&$[Z].nodeType!==1)throw Error("Draggable's offsetParent must be a DOM Node.")},grid:h4.default.arrayOf(h4.default.number),handle:h4.default.string,cancel:h4.default.string,nodeRef:h4.default.object,onStart:h4.default.func,onDrag:h4.default.func,onStop:h4.default.func,onMouseDown:h4.default.func,scale:h4.default.number,className:x_.dontSetMe,style:x_.dontSetMe,transform:x_.dontSetMe});v4(IX,"defaultProps",{allowAnyClick:!1,allowMobileScroll:!1,disabled:!1,enableUserSelectHack:!0,onStart:function(){},onDrag:function(){},onStop:function(){},onMouseDown:function(){},scale:1})});var Nr=b5((g_)=>{var DY0=P(m()),VY0=P(U8());Object.defineProperty(g_,"__esModule",{value:!0});Object.defineProperty(g_,"DraggableCore",{enumerable:!0,get:function(){return Xq.default}});g_.default=void 0;var Bq=Wr(DY0),v5=zq(wX()),WY0=zq(VY0),qY0=ii(),Fr=Hq(),xH=I_(),v_=SX(),Xq=zq(Kr()),Qq=zq(k_());function zq($){return $&&$.__esModule?$:{default:$}}function Wr($,Z){if(typeof WeakMap=="function")var J=new WeakMap,H=new WeakMap;return(Wr=function(B,Q){if(!Q&&B&&B.__esModule)return B;var X,z,G={__proto__:null,default:B};if(B===null||typeof B!="object"&&typeof B!="function")return G;if(X=Q?H:J){if(X.has(B))return X.get(B);X.set(B,G)}for(let U in B)U!=="default"&&{}.hasOwnProperty.call(B,U)&&((z=(X=Object.defineProperty)&&Object.getOwnPropertyDescriptor(B,U))&&(z.get||z.set)?X(G,U,z):G[U]=B[U]);return G})($,Z)}function f_(){return f_=Object.assign?Object.assign.bind():function($){for(var Z=1;Z<arguments.length;Z++){var J=arguments[Z];for(var H in J)({}).hasOwnProperty.call(J,H)&&($[H]=J[H])}return $},f_.apply(null,arguments)}function hH($,Z,J){return(Z=NY0(Z))in $?Object.defineProperty($,Z,{value:J,enumerable:!0,configurable:!0,writable:!0}):$[Z]=J,$}function NY0($){var Z=AY0($,"string");return typeof Z=="symbol"?Z:Z+""}function AY0($,Z){if(typeof $!="object"||!$)return $;var J=$[Symbol.toPrimitive];if(J!==void 0){var H=J.call($,Z||"default");if(typeof H!="object")return H;throw TypeError("@@toPrimitive must return a primitive value.")}return(Z==="string"?String:Number)($)}class kX extends Bq.Component{static getDerivedStateFromProps($,Z){let{position:J}=$,{prevPropsPosition:H}=Z;if(J&&(!H||J.x!==H.x||J.y!==H.y))return(0,Qq.default)("Draggable: getDerivedStateFromProps %j",{position:J,prevPropsPosition:H}),{x:J.x,y:J.y,prevPropsPosition:{...J}};return null}constructor($){super($);if(hH(this,"onDragStart",(Z,J)=>{if((0,Qq.default)("Draggable: onDragStart: %j",J),this.props.onStart(Z,(0,xH.createDraggableData)(this,J))===!1)return!1;this.setState({dragging:!0,dragged:!0})}),hH(this,"onDrag",(Z,J)=>{if(!this.state.dragging)return!1;(0,Qq.default)("Draggable: onDrag: %j",J);let H=(0,xH.createDraggableData)(this,J),B={x:H.x,y:H.y,slackX:0,slackY:0};if(this.props.bounds){let{x:X,y:z}=B;B.x+=this.state.slackX,B.y+=this.state.slackY;let[G,U]=(0,xH.getBoundPosition)(this,B.x,B.y);B.x=G,B.y=U,B.slackX=this.state.slackX+(X-B.x),B.slackY=this.state.slackY+(z-B.y),H.x=B.x,H.y=B.y,H.deltaX=B.x-this.state.x,H.deltaY=B.y-this.state.y}if(this.props.onDrag(Z,H)===!1)return!1;this.setState(B)}),hH(this,"onDragStop",(Z,J)=>{if(!this.state.dragging)return!1;if(this.props.onStop(Z,(0,xH.createDraggableData)(this,J))===!1)return!1;(0,Qq.default)("Draggable: onDragStop: %j",J);let B={dragging:!1,slackX:0,slackY:0};if(Boolean(this.props.position)){let{x:X,y:z}=this.props.position;B.x=X,B.y=z}this.setState(B)}),this.state={dragging:!1,dragged:!1,x:$.position?$.position.x:$.defaultPosition.x,y:$.position?$.position.y:$.defaultPosition.y,prevPropsPosition:{...$.position},slackX:0,slackY:0,isElementSVG:!1},$.position&&!($.onDrag||$.onStop))console.warn("A `position` was applied to this <Draggable>, without drag handlers. This will make this component effectively undraggable. Please attach `onDrag` or `onStop` handlers so you can adjust the `position` of this element.")}componentDidMount(){if(typeof window.SVGElement<"u"&&this.findDOMNode()instanceof window.SVGElement)this.setState({isElementSVG:!0})}componentWillUnmount(){if(this.state.dragging)this.setState({dragging:!1})}findDOMNode(){return this.props?.nodeRef?.current??WY0.default.findDOMNode(this)}render(){let{axis:$,bounds:Z,children:J,defaultPosition:H,defaultClassName:B,defaultClassNameDragging:Q,defaultClassNameDragged:X,position:z,positionOffset:G,scale:U,...Y}=this.props,K={},F=null,q=!Boolean(z)||this.state.dragging,N=z||H,D={x:(0,xH.canDragX)(this)&&q?this.state.x:N.x,y:(0,xH.canDragY)(this)&&q?this.state.y:N.y};if(this.state.isElementSVG)F=(0,Fr.createSVGTransform)(D,G);else K=(0,Fr.createCSSTransform)(D,G);let A=(0,qY0.clsx)(J.props.className||"",B,{[Q]:this.state.dragging,[X]:this.state.dragged});return Bq.createElement(Xq.default,f_({},Y,{onStart:this.onDragStart,onDrag:this.onDrag,onStop:this.onDragStop}),Bq.cloneElement(Bq.Children.only(J),{className:A,style:{...J.props.style,...K},transform:F}))}}g_.default=kX;hH(kX,"displayName","Draggable");hH(kX,"propTypes",{...Xq.default.propTypes,axis:v5.default.oneOf(["both","x","y","none"]),bounds:v5.default.oneOfType([v5.default.shape({left:v5.default.number,right:v5.default.number,top:v5.default.number,bottom:v5.default.number}),v5.default.string,v5.default.oneOf([!1])]),defaultClassName:v5.default.string,defaultClassNameDragging:v5.default.string,defaultClassNameDragged:v5.default.string,defaultPosition:v5.default.shape({x:v5.default.number,y:v5.default.number}),positionOffset:v5.default.shape({x:v5.default.oneOfType([v5.default.number,v5.default.string]),y:v5.default.oneOfType([v5.default.number,v5.default.string])}),position:v5.default.shape({x:v5.default.number,y:v5.default.number}),className:v_.dontSetMe,style:v_.dontSetMe,transform:v_.dontSetMe});hH(kX,"defaultProps",{...Xq.default.defaultProps,axis:"both",bounds:!1,defaultClassName:"react-draggable",defaultClassNameDragging:"react-draggable-dragging",defaultClassNameDragged:"react-draggable-dragged",defaultPosition:{x:0,y:0},scale:1})});var Uq=b5((qL1,Gq)=>{var{default:Ar,DraggableCore:LY0}=Nr();Gq.exports=Ar;Gq.exports.default=Ar;Gq.exports.DraggableCore=LY0});var Lr=b5((CY0)=>{var wY0=P(m());CY0.__esModule=!0;CY0.cloneElement=TY0;var MY0=PY0(wY0);function PY0($){return $&&$.__esModule?$:{default:$}}function Dr($,Z){var J=Object.keys($);if(Object.getOwnPropertySymbols){var H=Object.getOwnPropertySymbols($);Z&&(H=H.filter(function(B){return Object.getOwnPropertyDescriptor($,B).enumerable})),J.push.apply(J,H)}return J}function Vr($){for(var Z=1;Z<arguments.length;Z++){var J=arguments[Z]!=null?arguments[Z]:{};Z%2?Dr(Object(J),!0).forEach(function(H){_Y0($,H,J[H])}):Object.getOwnPropertyDescriptors?Object.defineProperties($,Object.getOwnPropertyDescriptors(J)):Dr(Object(J)).forEach(function(H){Object.defineProperty($,H,Object.getOwnPropertyDescriptor(J,H))})}return $}function _Y0($,Z,J){return(Z=OY0(Z))in $?Object.defineProperty($,Z,{value:J,enumerable:!0,configurable:!0,writable:!0}):$[Z]=J,$}function OY0($){var Z=jY0($,"string");return typeof Z=="symbol"?Z:Z+""}function jY0($,Z){if(typeof $!="object"||!$)return $;var J=$[Symbol.toPrimitive];if(J!==void 0){var H=J.call($,Z||"default");if(typeof H!="object")return H;throw TypeError("@@toPrimitive must return a primitive value.")}return(Z==="string"?String:Number)($)}function TY0($,Z){if(Z.style&&$.props.style)Z.style=Vr(Vr({},$.props.style),Z.style);if(Z.className&&$.props.className)Z.className=$.props.className+" "+Z.className;return MY0.default.cloneElement($,Z)}});var m_=b5((RY0)=>{RY0.__esModule=!0;RY0.resizableProps=void 0;var w1=SY0(wX()),AL1=Uq();function SY0($){return $&&$.__esModule?$:{default:$}}var DL1=RY0.resizableProps={axis:w1.default.oneOf(["both","x","y","none"]),className:w1.default.string,children:w1.default.element.isRequired,draggableOpts:w1.default.shape({allowAnyClick:w1.default.bool,cancel:w1.default.string,children:w1.default.node,disabled:w1.default.bool,enableUserSelectHack:w1.default.bool,offsetParent:typeof Element<"u"?w1.default.instanceOf(Element):w1.default.any,grid:w1.default.arrayOf(w1.default.number),handle:w1.default.string,nodeRef:w1.default.object,onStart:w1.default.func,onDrag:w1.default.func,onStop:w1.default.func,onMouseDown:w1.default.func,scale:w1.default.number}),height:function(){for(var $=arguments.length,Z=Array($),J=0;J<$;J++)Z[J]=arguments[J];let H=Z[0];if(H.axis==="both"||H.axis==="y")return w1.default.number.isRequired(...Z);return w1.default.number(...Z)},handle:w1.default.oneOfType([w1.default.node,w1.default.func]),handleSize:w1.default.arrayOf(w1.default.number),lockAspectRatio:w1.default.bool,maxConstraints:w1.default.arrayOf(w1.default.number),minConstraints:w1.default.arrayOf(w1.default.number),onResizeStop:w1.default.func,onResizeStart:w1.default.func,onResize:w1.default.func,resizeHandles:w1.default.arrayOf(w1.default.oneOf(["s","w","e","n","sw","nw","se","ne"])),transformScale:w1.default.number,width:function(){for(var $=arguments.length,Z=Array($),J=0;J<$;J++)Z[J]=arguments[J];let H=Z[0];if(H.axis==="both"||H.axis==="x")return w1.default.number.isRequired(...Z);return w1.default.number(...Z)}}});var c_=b5((uY0)=>{var cY0=P(m());uY0.__esModule=!0;uY0.default=void 0;var vH=_r(cY0),kY0=Uq(),yY0=Lr(),xY0=m_(),hY0=["children","className","draggableOpts","width","height","handle","handleSize","lockAspectRatio","axis","minConstraints","maxConstraints","onResize","onResizeStop","onResizeStart","resizeHandles","transformScale"];function _r($,Z){if(typeof WeakMap=="function")var J=new WeakMap,H=new WeakMap;return(_r=function(B,Q){if(!Q&&B&&B.__esModule)return B;var X,z,G={__proto__:null,default:B};if(B===null||typeof B!="object"&&typeof B!="function")return G;if(X=Q?H:J){if(X.has(B))return X.get(B);X.set(B,G)}for(let U in B)U!=="default"&&{}.hasOwnProperty.call(B,U)&&((z=(X=Object.defineProperty)&&Object.getOwnPropertyDescriptor(B,U))&&(z.get||z.set)?X(G,U,z):G[U]=B[U]);return G})($,Z)}function p_(){return p_=Object.assign?Object.assign.bind():function($){for(var Z=1;Z<arguments.length;Z++){var J=arguments[Z];for(var H in J)({}).hasOwnProperty.call(J,H)&&($[H]=J[H])}return $},p_.apply(null,arguments)}function vY0($,Z){if($==null)return{};var J={};for(var H in $)if({}.hasOwnProperty.call($,H)){if(Z.indexOf(H)!==-1)continue;J[H]=$[H]}return J}function Pr($,Z){var J=Object.keys($);if(Object.getOwnPropertySymbols){var H=Object.getOwnPropertySymbols($);Z&&(H=H.filter(function(B){return Object.getOwnPropertyDescriptor($,B).enumerable})),J.push.apply(J,H)}return J}function u_($){for(var Z=1;Z<arguments.length;Z++){var J=arguments[Z]!=null?arguments[Z]:{};Z%2?Pr(Object(J),!0).forEach(function(H){fY0($,H,J[H])}):Object.getOwnPropertyDescriptors?Object.defineProperties($,Object.getOwnPropertyDescriptors(J)):Pr(Object(J)).forEach(function(H){Object.defineProperty($,H,Object.getOwnPropertyDescriptor(J,H))})}return $}function fY0($,Z,J){return(Z=gY0(Z))in $?Object.defineProperty($,Z,{value:J,enumerable:!0,configurable:!0,writable:!0}):$[Z]=J,$}function gY0($){var Z=mY0($,"string");return typeof Z=="symbol"?Z:Z+""}function mY0($,Z){if(typeof $!="object"||!$)return $;var J=$[Symbol.toPrimitive];if(J!==void 0){var H=J.call($,Z||"default");if(typeof H!="object")return H;throw TypeError("@@toPrimitive must return a primitive value.")}return(Z==="string"?String:Number)($)}class Yq extends vH.Component{constructor(){super(...arguments);this.handleRefs={},this.lastHandleRect=null,this.slack=null,this.lastSize=null}componentWillUnmount(){this.resetData()}resetData(){this.lastHandleRect=this.slack=this.lastSize=null}runConstraints($,Z){let J=this.props,H=J.minConstraints,B=J.maxConstraints,Q=J.lockAspectRatio;if(!H&&!B&&!Q)return[$,Z];if(Q){let K=this.props.width/this.props.height,F=$-this.props.width,W=Z-this.props.height;if(Math.abs(F)>Math.abs(W*K))Z=$/K;else $=Z*K}let X=$,z=Z,G=this.slack||[0,0],U=G[0],Y=G[1];if($+=U,Z+=Y,H)$=Math.max(H[0],$),Z=Math.max(H[1],Z);if(B)$=Math.min(B[0],$),Z=Math.min(B[1],Z);return this.slack=[U+(X-$),Y+(z-Z)],[$,Z]}resizeHandler($,Z){return(J,H)=>{var B,Q,X,z;let{node:G,deltaX:U,deltaY:Y}=H;if($==="onResizeStart")this.resetData();let K=(this.props.axis==="both"||this.props.axis==="x")&&Z!=="n"&&Z!=="s",F=(this.props.axis==="both"||this.props.axis==="y")&&Z!=="e"&&Z!=="w";if(!K&&!F)return;let W=Z[0],q=Z[Z.length-1],N=G.getBoundingClientRect();if(this.lastHandleRect!=null){if(q==="w"){let E=N.left-this.lastHandleRect.left;U+=E}if(W==="n"){let E=N.top-this.lastHandleRect.top;Y+=E}}if(this.lastHandleRect=N,q==="w")U=-U;if(W==="n")Y=-Y;let D=(B=(Q=this.lastSize)==null?void 0:Q.width)!=null?B:this.props.width,A=(X=(z=this.lastSize)==null?void 0:z.height)!=null?X:this.props.height,V=D+(K?U/this.props.transformScale:0),L=A+(F?Y/this.props.transformScale:0);var O=this.runConstraints(V,L);if(V=O[0],L=O[1],$==="onResizeStop"&&this.lastSize){var M=this.lastSize;V=M.width,L=M.height}let _=V!==D||L!==A;if($!=="onResizeStop")this.lastSize={width:V,height:L};let w=typeof this.props[$]==="function"?this.props[$]:null;if(w&&!($==="onResize"&&!_))J.persist==null||J.persist(),w(J,{node:G,size:{width:V,height:L},handle:Z});if($==="onResizeStop")this.resetData()}}renderResizeHandle($,Z){let J=this.props.handle;if(!J)return vH.createElement("span",{className:"react-resizable-handle react-resizable-handle-"+$,ref:Z});if(typeof J==="function")return J($,Z);let H=typeof J.type==="string",B=u_({ref:Z},H?{}:{handleAxis:$});return vH.cloneElement(J,B)}render(){let $=this.props,Z=$.children,J=$.className,H=$.draggableOpts,B=$.width,Q=$.height,X=$.handle,z=$.handleSize,G=$.lockAspectRatio,U=$.axis,Y=$.minConstraints,K=$.maxConstraints,F=$.onResize,W=$.onResizeStop,q=$.onResizeStart,N=$.resizeHandles,D=$.transformScale,A=vY0($,hY0);return(0,yY0.cloneElement)(Z,u_(u_({},A),{},{className:(J?J+" ":"")+"react-resizable",children:[...vH.Children.toArray(Z.props.children),...N.map((V)=>{var L;let O=(L=this.handleRefs[V])!=null?L:this.handleRefs[V]=vH.createRef();return vH.createElement(kY0.DraggableCore,p_({},H,{nodeRef:O,key:"resizableHandle-"+V,onStop:this.resizeHandler("onResizeStop",V),onStart:this.resizeHandler("onResizeStart",V),onDrag:this.resizeHandler("onResize",V)}),this.renderResizeHandle(V,O))})]}))}}uY0.default=Yq;Yq.propTypes=xY0.resizableProps;Yq.defaultProps={axis:"both",handleSize:[20,20],lockAspectRatio:!1,minConstraints:[20,20],maxConstraints:[1/0,1/0],resizeHandles:["se"],transformScale:1}});var br=b5((tY0)=>{var $K0=P(m());tY0.__esModule=!0;tY0.default=void 0;var d_=Cr($K0),dY0=Tr(wX()),lY0=Tr(c_()),iY0=m_(),rY0=["handle","handleSize","onResize","onResizeStart","onResizeStop","draggableOpts","minConstraints","maxConstraints","lockAspectRatio","axis","width","height","resizeHandles","style","transformScale"];function Tr($){return $&&$.__esModule?$:{default:$}}function Cr($,Z){if(typeof WeakMap=="function")var J=new WeakMap,H=new WeakMap;return(Cr=function(B,Q){if(!Q&&B&&B.__esModule)return B;var X,z,G={__proto__:null,default:B};if(B===null||typeof B!="object"&&typeof B!="function")return G;if(X=Q?H:J){if(X.has(B))return X.get(B);X.set(B,G)}for(let U in B)U!=="default"&&{}.hasOwnProperty.call(B,U)&&((z=(X=Object.defineProperty)&&Object.getOwnPropertyDescriptor(B,U))&&(z.get||z.set)?X(G,U,z):G[U]=B[U]);return G})($,Z)}function l_(){return l_=Object.assign?Object.assign.bind():function($){for(var Z=1;Z<arguments.length;Z++){var J=arguments[Z];for(var H in J)({}).hasOwnProperty.call(J,H)&&($[H]=J[H])}return $},l_.apply(null,arguments)}function jr($,Z){var J=Object.keys($);if(Object.getOwnPropertySymbols){var H=Object.getOwnPropertySymbols($);Z&&(H=H.filter(function(B){return Object.getOwnPropertyDescriptor($,B).enumerable})),J.push.apply(J,H)}return J}function Kq($){for(var Z=1;Z<arguments.length;Z++){var J=arguments[Z]!=null?arguments[Z]:{};Z%2?jr(Object(J),!0).forEach(function(H){aY0($,H,J[H])}):Object.getOwnPropertyDescriptors?Object.defineProperties($,Object.getOwnPropertyDescriptors(J)):jr(Object(J)).forEach(function(H){Object.defineProperty($,H,Object.getOwnPropertyDescriptor(J,H))})}return $}function aY0($,Z,J){return(Z=oY0(Z))in $?Object.defineProperty($,Z,{value:J,enumerable:!0,configurable:!0,writable:!0}):$[Z]=J,$}function oY0($){var Z=nY0($,"string");return typeof Z=="symbol"?Z:Z+""}function nY0($,Z){if(typeof $!="object"||!$)return $;var J=$[Symbol.toPrimitive];if(J!==void 0){var H=J.call($,Z||"default");if(typeof H!="object")return H;throw TypeError("@@toPrimitive must return a primitive value.")}return(Z==="string"?String:Number)($)}function sY0($,Z){if($==null)return{};var J={};for(var H in $)if({}.hasOwnProperty.call($,H)){if(Z.indexOf(H)!==-1)continue;J[H]=$[H]}return J}class i_ extends d_.Component{constructor(){super(...arguments);this.state={width:this.props.width,height:this.props.height,propsWidth:this.props.width,propsHeight:this.props.height},this.onResize=($,Z)=>{let J=Z.size;if(this.props.onResize)$.persist==null||$.persist(),this.setState(J,()=>this.props.onResize&&this.props.onResize($,Z));else this.setState(J)}}static getDerivedStateFromProps($,Z){if(Z.propsWidth!==$.width||Z.propsHeight!==$.height)return{width:$.width,height:$.height,propsWidth:$.width,propsHeight:$.height};return null}render(){let $=this.props,Z=$.handle,J=$.handleSize,H=$.onResize,B=$.onResizeStart,Q=$.onResizeStop,X=$.draggableOpts,z=$.minConstraints,G=$.maxConstraints,U=$.lockAspectRatio,Y=$.axis,K=$.width,F=$.height,W=$.resizeHandles,q=$.style,N=$.transformScale,D=sY0($,rY0);return d_.createElement(lY0.default,{axis:Y,draggableOpts:X,handle:Z,handleSize:J,height:this.state.height,lockAspectRatio:U,maxConstraints:G,minConstraints:z,onResizeStart:B,onResize:this.onResize,onResizeStop:Q,resizeHandles:W,transformScale:N,width:this.state.width},d_.createElement("div",l_({},D,{style:Kq(Kq({},q),{},{width:this.state.width+"px",height:this.state.height+"px"})})))}}tY0.default=i_;i_.propTypes=Kq(Kq({},iY0.resizableProps),{},{children:dY0.default.element})});var r_=b5((PL1,Fq)=>{Fq.exports=function(){throw Error("Don't instantiate Resizable directly! Use require('react-resizable').Resizable")};Fq.exports.Resizable=c_().default;Fq.exports.ResizableBox=br().default});var Nn=b5((BN,qn)=>{(function($,Z){typeof BN==="object"&&typeof qn<"u"?Z(BN):typeof define==="function"&&define.amd?define(["exports"],Z):($=typeof globalThis<"u"?globalThis:$||self,Z($["fast-equals"]={}))})(BN,function($){function Z(p){return function(n,Z0,J0,U0,z0,X0,q0){return p(n,Z0,q0)}}function J(p){return function(n,Z0,J0,U0){if(!n||!Z0||typeof n!=="object"||typeof Z0!=="object")return p(n,Z0,J0,U0);var z0=U0.get(n),X0=U0.get(Z0);if(z0&&X0)return z0===Z0&&X0===n;U0.set(n,Z0),U0.set(Z0,n);var q0=p(n,Z0,J0,U0);return U0.delete(n),U0.delete(Z0),q0}}function H(p,i){var n={};for(var Z0 in p)n[Z0]=p[Z0];for(var Z0 in i)n[Z0]=i[Z0];return n}function B(p){return p.constructor===Object||p.constructor==null}function Q(p){return typeof p.then==="function"}function X(p,i){return p===i||p!==p&&i!==i}var z="[object Arguments]",G="[object Boolean]",U="[object Date]",Y="[object RegExp]",K="[object Map]",F="[object Number]",W="[object Object]",q="[object Set]",N="[object String]",D=Object.prototype.toString;function A(p){var{areArraysEqual:i,areDatesEqual:n,areMapsEqual:Z0,areObjectsEqual:J0,areRegExpsEqual:U0,areSetsEqual:z0,createIsNestedEqual:X0}=p,q0=X0(N0);function N0(F0,s,a){if(F0===s)return!0;if(!F0||!s||typeof F0!=="object"||typeof s!=="object")return F0!==F0&&s!==s;if(B(F0)&&B(s))return J0(F0,s,q0,a);var $0=Array.isArray(F0),t=Array.isArray(s);if($0||t)return $0===t&&i(F0,s,q0,a);var B0=D.call(F0);if(B0!==D.call(s))return!1;if(B0===U)return n(F0,s,q0,a);if(B0===Y)return U0(F0,s,q0,a);if(B0===K)return Z0(F0,s,q0,a);if(B0===q)return z0(F0,s,q0,a);if(B0===W||B0===z)return Q(F0)||Q(s)?!1:J0(F0,s,q0,a);if(B0===G||B0===F||B0===N)return X(F0.valueOf(),s.valueOf());return!1}return N0}function V(p,i,n,Z0){var J0=p.length;if(i.length!==J0)return!1;while(J0-- >0)if(!n(p[J0],i[J0],J0,J0,p,i,Z0))return!1;return!0}var L=J(V);function O(p,i){return X(p.valueOf(),i.valueOf())}function M(p,i,n,Z0){var J0=p.size===i.size;if(!J0)return!1;if(!p.size)return!0;var U0={},z0=0;return p.forEach(function(X0,q0){if(!J0)return;var N0=!1,F0=0;i.forEach(function(s,a){if(!N0&&!U0[F0]&&(N0=n(q0,a,z0,F0,p,i,Z0)&&n(X0,s,q0,a,p,i,Z0)))U0[F0]=!0;F0++}),z0++,J0=N0}),J0}var _=J(M),w="_owner",C=Object.prototype.hasOwnProperty;function E(p,i,n,Z0){var J0=Object.keys(p),U0=J0.length;if(Object.keys(i).length!==U0)return!1;var z0;while(U0-- >0){if(z0=J0[U0],z0===w){var X0=!!p.$$typeof,q0=!!i.$$typeof;if((X0||q0)&&X0!==q0)return!1}if(!C.call(i,z0)||!n(p[z0],i[z0],z0,z0,p,i,Z0))return!1}return!0}var j=J(E);function k(p,i){return p.source===i.source&&p.flags===i.flags}function S(p,i,n,Z0){var J0=p.size===i.size;if(!J0)return!1;if(!p.size)return!0;var U0={};return p.forEach(function(z0,X0){if(!J0)return;var q0=!1,N0=0;i.forEach(function(F0,s){if(!q0&&!U0[N0]&&(q0=n(z0,F0,X0,s,p,i,Z0)))U0[N0]=!0;N0++}),J0=q0}),J0}var I=J(S),T=Object.freeze({areArraysEqual:V,areDatesEqual:O,areMapsEqual:M,areObjectsEqual:E,areRegExpsEqual:k,areSetsEqual:S,createIsNestedEqual:Z}),y=Object.freeze({areArraysEqual:L,areDatesEqual:O,areMapsEqual:_,areObjectsEqual:j,areRegExpsEqual:k,areSetsEqual:I,createIsNestedEqual:Z}),R=A(T);function x(p,i){return R(p,i,void 0)}var v=A(H(T,{createIsNestedEqual:function(){return X}}));function f(p,i){return v(p,i,void 0)}var b=A(y);function l(p,i){return b(p,i,new WeakMap)}var r=A(H(y,{createIsNestedEqual:function(){return X}}));function h(p,i){return r(p,i,new WeakMap)}function d(p){return A(H(T,p(T)))}function o(p){var i=A(H(y,p(y)));return function(n,Z0,J0){if(J0===void 0)J0=new WeakMap;return i(n,Z0,J0)}}$.circularDeepEqual=l,$.circularShallowEqual=h,$.createCustomCircularEqual=o,$.createCustomEqual=d,$.deepEqual=x,$.sameValueZeroEqual=X,$.shallowEqual=f,Object.defineProperty($,"__esModule",{value:!0})})});var jZ=P(m(),1),Xj=P(c(),1),wN=jZ.createContext(void 0),$1=($)=>{let Z=jZ.useContext(wN);if($)return $;if(!Z)throw Error("No QueryClient set, use QueryClientProvider to set one");return Z},SN=({client:$,children:Z})=>{return jZ.useEffect(()=>{return $.mount(),()=>{$.unmount()}},[$]),Xj.jsx(wN.Provider,{value:$,children:Z})};var Kz=P(m(),1),zj=Kz.createContext(!1),Gj=()=>Kz.useContext(zj),mq0=zj.Provider;var JB=P(m(),1),yt=P(c(),1);function xt(){let $=!1;return{clearReset:()=>{$=!1},reset:()=>{$=!0},isReset:()=>{return $}}}var ht=JB.createContext(xt()),Uj=()=>JB.useContext(ht);var wj=P(m(),1);var vt={setTimeout:($,Z)=>setTimeout($,Z),clearTimeout:($)=>clearTimeout($),setInterval:($,Z)=>setInterval($,Z),clearInterval:($)=>clearInterval($)},ft=class{#$=vt;#Z=!1;setTimeoutProvider($){this.#$=$}setTimeout($,Z){return this.#$.setTimeout($,Z)}clearTimeout($){this.#$.clearTimeout($)}setInterval($,Z){return this.#$.setInterval($,Z)}clearInterval($){this.#$.clearInterval($)}},_9=new ft;function Yj($){setTimeout($,0)}var IN=typeof window>"u"||"Deno"in globalThis;function c5(){}function Wj($,Z){return typeof $==="function"?$(Z):$}function Fz($){return typeof $==="number"&&$>=0&&$!==1/0}function Wz($,Z){return Math.max($+(Z||0)-Date.now(),0)}function y5($,Z){return typeof $==="function"?$(Z):$}function qz($,Z){let{type:J="all",exact:H,fetchStatus:B,predicate:Q,queryKey:X,stale:z}=$;if(X){if(H){if(Z.queryHash!==HB(X,Z.options))return!1}else if(!B6(Z.queryKey,X))return!1}if(J!=="all"){let G=Z.isActive();if(J==="active"&&!G)return!1;if(J==="inactive"&&G)return!1}if(typeof z==="boolean"&&Z.isStale()!==z)return!1;if(B&&B!==Z.state.fetchStatus)return!1;if(Q&&!Q(Z))return!1;return!0}function Nz($,Z){let{exact:J,status:H,predicate:B,mutationKey:Q}=$;if(Q){if(!Z.options.mutationKey)return!1;if(J){if(O9(Z.options.mutationKey)!==O9(Q))return!1}else if(!B6(Z.options.mutationKey,Q))return!1}if(H&&Z.state.status!==H)return!1;if(B&&!B(Z))return!1;return!0}function HB($,Z){return(Z?.queryKeyHashFn||O9)($)}function O9($){return JSON.stringify($,(Z,J)=>RN(J)?Object.keys(J).sort().reduce((H,B)=>{return H[B]=J[B],H},{}):J)}function B6($,Z){if($===Z)return!0;if(typeof $!==typeof Z)return!1;if($&&Z&&typeof $==="object"&&typeof Z==="object"){if(Array.isArray($)&&Array.isArray(Z)){for(let H=0;H<Z.length;H++)if(!B6($[H],Z[H]))return!1;return!0}let J=Object.keys(Z);for(let H of J)if(!B6($[H],Z[H]))return!1;return!0}return!1}var gt=Object.prototype.hasOwnProperty;function BB($,Z,J=0){if($===Z)return $;if(J>500)return Z;let H=Kj($)&&Kj(Z);if(!H&&!(RN($)&&RN(Z)))return Z;let B=(H?$:Object.keys($)).length,Q=H?Z:Object.keys(Z),X=Q.length,z=H?Array(X):{},G=0;for(let U=0;U<X;U++){let Y=H?U:Q[U],K=$[Y],F=Z[Y];if(K===F){if(z[Y]=K,H?U<B:gt.call($,Y))G++;continue}if(K===null||F===null||typeof K!=="object"||typeof F!=="object"){z[Y]=F;continue}let W=BB(K,F,J+1);if(z[Y]=W,W===K)G++}return B===X&&G===B?$:z}function TZ($,Z){if(!Z||Object.keys($).length!==Object.keys(Z).length)return!1;for(let J in $)if($[J]!==Z[J])return!1;return!0}function Kj($){return Array.isArray($)&&$.length===Object.keys($).length}function RN($){if(!Fj($))return!1;let Z=$.constructor;if(Z===void 0)return!0;let J=Z.prototype;if(!Fj(J))return!1;if(!J.hasOwnProperty("isPrototypeOf"))return!1;if(Object.getPrototypeOf($)!==Object.prototype)return!1;return!0}function Fj($){return Object.prototype.toString.call($)==="[object Object]"}function qj($){return new Promise((Z)=>{_9.setTimeout(Z,$)})}function QB($,Z,J){if(typeof J.structuralSharing==="function")return J.structuralSharing($,Z);else if(J.structuralSharing!==!1)return BB($,Z);return Z}function Nj($,Z,J=0){let H=[...$,Z];return J&&H.length>J?H.slice(1):H}function Aj($,Z,J=0){let H=[Z,...$];return J&&H.length>J?H.slice(0,-1):H}var CZ=Symbol();function Az($,Z){if(!$.queryFn&&Z?.initialPromise)return()=>Z.initialPromise;if(!$.queryFn||$.queryFn===CZ)return()=>Promise.reject(Error(`Missing queryFn: '${$.queryHash}'`));return $.queryFn}function EZ($,Z){if(typeof $==="function")return $(...Z);return!!$}function Dj($,Z,J){let H=!1,B;return Object.defineProperty($,"signal",{enumerable:!0,get:()=>{if(B??=Z(),H)return B;if(H=!0,B.aborted)J();else B.addEventListener("abort",J,{once:!0});return B}}),$}var mt=()=>IN,bZ=()=>mt();var O8=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe($){return this.listeners.add($),this.onSubscribe(),()=>{this.listeners.delete($),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}};var ut=class extends O8{#$;#Z;#J;constructor(){super();this.#J=($)=>{if(typeof window<"u"&&window.addEventListener){let Z=()=>$();return window.addEventListener("visibilitychange",Z,!1),()=>{window.removeEventListener("visibilitychange",Z)}}}}onSubscribe(){if(!this.#Z)this.setEventListener(this.#J)}onUnsubscribe(){if(!this.hasListeners())this.#Z?.(),this.#Z=void 0}setEventListener($){this.#J=$,this.#Z?.(),this.#Z=$((Z)=>{if(typeof Z==="boolean")this.setFocused(Z);else this.onFocus()})}setFocused($){if(this.#$!==$)this.#$=$,this.onFocus()}onFocus(){let $=this.isFocused();this.listeners.forEach((Z)=>{Z($)})}isFocused(){if(typeof this.#$==="boolean")return this.#$;return globalThis.document?.visibilityState!=="hidden"}},wZ=new ut;var Vj=Yj;function pt(){let $=[],Z=0,J=(z)=>{z()},H=(z)=>{z()},B=Vj,Q=(z)=>{if(Z)$.push(z);else B(()=>{J(z)})},X=()=>{let z=$;if($=[],z.length)B(()=>{H(()=>{z.forEach((G)=>{J(G)})})})};return{batch:(z)=>{let G;Z++;try{G=z()}finally{if(Z--,!Z)X()}return G},batchCalls:(z)=>{return(...G)=>{Q(()=>{z(...G)})}},schedule:Q,setNotifyFunction:(z)=>{J=z},setBatchNotifyFunction:(z)=>{H=z},setScheduler:(z)=>{B=z}}}var G5=pt();var ct=class extends O8{#$=!0;#Z;#J;constructor(){super();this.#J=($)=>{if(typeof window<"u"&&window.addEventListener){let Z=()=>$(!0),J=()=>$(!1);return window.addEventListener("online",Z,!1),window.addEventListener("offline",J,!1),()=>{window.removeEventListener("online",Z),window.removeEventListener("offline",J)}}}}onSubscribe(){if(!this.#Z)this.setEventListener(this.#J)}onUnsubscribe(){if(!this.hasListeners())this.#Z?.(),this.#Z=void 0}setEventListener($){this.#J=$,this.#Z?.(),this.#Z=$(this.setOnline.bind(this))}setOnline($){if(this.#$!==$)this.#$=$,this.listeners.forEach((Z)=>{Z($)})}isOnline(){return this.#$}},SZ=new ct;function dt($){return Math.min(1000*2**$,30000)}function kN($){return($??"online")==="online"?SZ.isOnline():!0}var Dz=class extends Error{constructor($){super("CancelledError");this.revert=$?.revert,this.silent=$?.silent}};function Vz($){let Z=!1,J=0,H,B="pending",Q,X,z=new Promise((V,L)=>{Q=V,X=L});z.catch(c5);let G=()=>B!=="pending",U=(V)=>{if(!G()){let L=new Dz(V);N(L),$.onCancel?.(L)}},Y=()=>{Z=!0},K=()=>{Z=!1},F=()=>wZ.isFocused()&&($.networkMode==="always"||SZ.isOnline())&&$.canRun(),W=()=>kN($.networkMode)&&$.canRun(),q=(V)=>{if(!G())H?.(),B="resolved",Q(V)},N=(V)=>{if(!G())H?.(),B="rejected",X(V)},D=()=>{return new Promise((V)=>{H=(L)=>{if(G()||F())V(L)},$.onPause?.()}).then(()=>{if(H=void 0,!G())$.onContinue?.()})},A=()=>{if(G())return;let V,L=J===0?$.initialPromise:void 0;try{V=L??$.fn()}catch(O){V=Promise.reject(O)}Promise.resolve(V).then(q).catch((O)=>{if(G())return;let M=$.retry??(bZ()?0:3),_=$.retryDelay??dt,w=typeof _==="function"?_(J,O):_,C=M===!0||typeof M==="number"&&J<M||typeof M==="function"&&M(J,O);if(Z||!C){N(O);return}J++,$.onFail?.(J,O),qj(w).then(()=>{return F()?void 0:D()}).then(()=>{if(Z)N(O);else A()})})};return{promise:z,status:()=>B,cancel:U,continue:()=>{return H?.(),z},cancelRetry:Y,continueRetry:K,canStart:W,start:()=>{if(W())A();else D().then(A);return z}}}var Lz=class{#$;destroy(){this.clearGcTimeout()}scheduleGc(){if(this.clearGcTimeout(),Fz(this.gcTime))this.#$=_9.setTimeout(()=>{this.optionalRemove()},this.gcTime)}updateGcTime($){this.gcTime=Math.max(this.gcTime||0,$??(bZ()?1/0:300000))}clearGcTimeout(){if(this.#$!==void 0)_9.clearTimeout(this.#$),this.#$=void 0}};function Mj($){return{onFetch:(Z,J)=>{let H=Z.options,B=Z.fetchOptions?.meta?.fetchMore?.direction,Q=Z.state.data?.pages||[],X=Z.state.data?.pageParams||[],z={pages:[],pageParams:[]},G=0,U=async()=>{let Y=!1,K=(q)=>{Dj(q,()=>Z.signal,()=>Y=!0)},F=Az(Z.options,Z.fetchOptions),W=async(q,N,D)=>{if(Y)return Promise.reject(Z.signal.reason);if(N==null&&q.pages.length)return Promise.resolve(q);let V=(()=>{let _={client:Z.client,queryKey:Z.queryKey,pageParam:N,direction:D?"backward":"forward",meta:Z.options.meta};return K(_),_})(),L=await F(V),{maxPages:O}=Z.options,M=D?Aj:Nj;return{pages:M(q.pages,L,O),pageParams:M(q.pageParams,N,O)}};if(B&&Q.length){let q=B==="backward",N=q?lt:Lj,D={pages:Q,pageParams:X};z=await W(D,N(H,D),q)}else{let q=$??Q.length;do{let N=G===0?X[0]??H.initialPageParam:Lj(H,z);if(G>0&&N==null)break;z=await W(z,N),G++}while(G<q)}return z};if(Z.options.persister)Z.fetchFn=()=>{return Z.options.persister?.(U,{client:Z.client,queryKey:Z.queryKey,meta:Z.options.meta,signal:Z.signal},J)};else Z.fetchFn=U}}}function Lj($,{pages:Z,pageParams:J}){let H=Z.length-1;return Z.length>0?$.getNextPageParam(Z[H],Z,J[H],J):void 0}function lt($,{pages:Z,pageParams:J}){return Z.length>0?$.getPreviousPageParam?.(Z[0],Z,J[0],J):void 0}var Oj=class extends Lz{#$;#Z;#J;#H;#Q;#B;#X;#G;constructor($){super();this.#G=!1,this.#X=$.defaultOptions,this.setOptions($.options),this.observers=[],this.#Q=$.client,this.#H=this.#Q.getQueryCache(),this.queryKey=$.queryKey,this.queryHash=$.queryHash,this.#Z=_j(this.options),this.state=$.state??this.#Z,this.scheduleGc()}get meta(){return this.options.meta}get queryType(){return this.#$}get promise(){return this.#B?.promise}setOptions($){if(this.options={...this.#X,...$},$?._type)this.#$=$._type;if(this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){let Z=_j(this.options);if(Z.data!==void 0)this.setState(Pj(Z.data,Z.dataUpdatedAt)),this.#Z=Z}}optionalRemove(){if(!this.observers.length&&this.state.fetchStatus==="idle")this.#H.remove(this)}setData($,Z){let J=QB(this.state.data,$,this.options);return this.#z({data:J,type:"success",dataUpdatedAt:Z?.updatedAt,manual:Z?.manual}),J}setState($){this.#z({type:"setState",state:$})}cancel($){let Z=this.#B?.promise;return this.#B?.cancel($),Z?Z.then(c5).catch(c5):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}get resetState(){return this.#Z}reset(){this.destroy(),this.setState(this.resetState)}isActive(){return this.observers.some(($)=>y5($.options.enabled,this)!==!1)}isDisabled(){if(this.getObserversCount()>0)return!this.isActive();return this.options.queryFn===CZ||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){if(this.getObserversCount()>0)return this.observers.some(($)=>y5($.options.staleTime,this)==="static");return!1}isStale(){if(this.getObserversCount()>0)return this.observers.some(($)=>$.getCurrentResult().isStale);return this.state.data===void 0||this.state.isInvalidated}isStaleByTime($=0){if(this.state.data===void 0)return!0;if($==="static")return!1;if(this.state.isInvalidated)return!0;return!Wz(this.state.dataUpdatedAt,$)}onFocus(){this.observers.find(($)=>$.shouldFetchOnWindowFocus())?.refetch({cancelRefetch:!1}),this.#B?.continue()}onOnline(){this.observers.find(($)=>$.shouldFetchOnReconnect())?.refetch({cancelRefetch:!1}),this.#B?.continue()}addObserver($){if(!this.observers.includes($))this.observers.push($),this.clearGcTimeout(),this.#H.notify({type:"observerAdded",query:this,observer:$})}removeObserver($){let Z=this.observers.indexOf($);if(Z!==-1){if(this.observers.splice(Z,1),!this.observers.length){if(this.#B)if(this.#G||this.state.fetchStatus==="paused"&&this.state.status==="pending")this.#B.cancel({revert:!0});else this.#B.cancelRetry();this.scheduleGc()}this.#H.notify({type:"observerRemoved",query:this,observer:$})}}getObserversCount(){return this.observers.length}invalidate(){if(!this.state.isInvalidated)this.#z({type:"invalidate"})}async fetch($,Z){if(this.state.fetchStatus!=="idle"&&this.#B?.status()!=="rejected"){if(this.state.data!==void 0&&Z?.cancelRefetch)this.cancel({silent:!0});else if(this.#B)return this.#B.continueRetry(),this.#B.promise}if($)this.setOptions($);if(!this.options.queryFn){let G=this.observers.find((U)=>U.options.queryFn);if(G)this.setOptions(G.options)}let J=new AbortController,H=(G)=>{Object.defineProperty(G,"signal",{enumerable:!0,get:()=>{return this.#G=!0,J.signal}})},B=()=>{let G=Az(this.options,Z),Y=(()=>{let K={client:this.#Q,queryKey:this.queryKey,meta:this.meta};return H(K),K})();if(this.#G=!1,this.options.persister)return this.options.persister(G,Y,this);return G(Y)},X=(()=>{let G={fetchOptions:Z,options:this.options,queryKey:this.queryKey,client:this.#Q,state:this.state,fetchFn:B};return H(G),G})();if((this.#$==="infinite"?Mj(this.options.pages):this.options.behavior)?.onFetch(X,this),this.#J=this.state,this.state.fetchStatus==="idle"||this.state.fetchMeta!==X.fetchOptions?.meta)this.#z({type:"fetch",meta:X.fetchOptions?.meta});let z=this.#B=Vz({initialPromise:Z?.initialPromise,fn:X.fetchFn,onCancel:(G)=>{if(G instanceof Dz&&G.revert)this.setState({...this.#J,fetchStatus:"idle"});J.abort()},onFail:(G,U)=>{this.#z({type:"failed",failureCount:G,error:U})},onPause:()=>{this.#z({type:"pause"})},onContinue:()=>{this.#z({type:"continue"})},retry:X.options.retry,retryDelay:X.options.retryDelay,networkMode:X.options.networkMode,canRun:()=>!0});try{let G=await z.start();if(G===void 0)throw Error(`${this.queryHash} data is undefined`);return this.setData(G),this.#H.config.onSuccess?.(G,this),this.#H.config.onSettled?.(G,this.state.error,this),G}catch(G){if(G instanceof Dz){if(G.silent)return this.#B.promise;else if(G.revert){if(this.state.data===void 0)throw G;return this.state.data}}throw this.#z({type:"error",error:G}),this.#H.config.onError?.(G,this),this.#H.config.onSettled?.(this.state.data,G,this),G}finally{if(this.#B===z)this.#B=void 0;this.scheduleGc()}}#z($){let Z=(J)=>{switch($.type){case"failed":return{...J,fetchFailureCount:$.failureCount,fetchFailureReason:$.error};case"pause":return{...J,fetchStatus:"paused"};case"continue":return{...J,fetchStatus:"fetching"};case"fetch":return{...J,...yN(J.data,this.options),fetchMeta:$.meta??null};case"success":let H={...J,...Pj($.data,$.dataUpdatedAt),dataUpdateCount:J.dataUpdateCount+1,...!$.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return this.#J=$.manual?H:void 0,H;case"error":let B=$.error;return{...J,error:B,errorUpdateCount:J.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:J.fetchFailureCount+1,fetchFailureReason:B,fetchStatus:"idle",status:"error",isInvalidated:!0};case"invalidate":return{...J,isInvalidated:!0};case"setState":return{...J,...$.state}}};this.state=Z(this.state),G5.batch(()=>{this.observers.slice().forEach((J)=>{J.onQueryUpdate()}),this.#H.notify({query:this,type:"updated",action:$})})}};function yN($,Z){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:kN(Z.networkMode)?"fetching":"paused",...$===void 0&&{error:null,status:"pending"}}}function Pj($,Z){return{data:$,dataUpdatedAt:Z??Date.now(),error:null,isInvalidated:!1,status:"success"}}function _j($){let Z=typeof $.initialData==="function"?$.initialData():$.initialData,J=Z!==void 0,H=J?typeof $.initialDataUpdatedAt==="function"?$.initialDataUpdatedAt():$.initialDataUpdatedAt:0;return{data:Z,dataUpdateCount:0,dataUpdatedAt:J?H??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:J?"success":"pending",fetchStatus:"idle"}}var hN=class extends O8{#$;#Z=void 0;#J=void 0;#H=void 0;#Q;#B;#X;#G;#z;#W;#Y;#K;#U;#q=new Set;constructor($,Z){super();this.options=Z,this.#$=$,this.#X=null,this.bindMethods(),this.setOptions(Z)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){if(this.listeners.size===1){if(this.#Z.addObserver(this),jj(this.#Z,this.options))this.#F();else this.updateResult();this.#L()}}onUnsubscribe(){if(!this.hasListeners())this.destroy()}shouldFetchOnReconnect(){return xN(this.#Z,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return xN(this.#Z,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.#M(),this.#P(),this.#Z.removeObserver(this)}setOptions($){let Z=this.options,J=this.#Z;if(this.options=this.#$.defaultQueryOptions($),this.options.enabled!==void 0&&typeof this.options.enabled!=="boolean"&&typeof this.options.enabled!=="function"&&typeof y5(this.options.enabled,this.#Z)!=="boolean")throw Error("Expected enabled to be a boolean or a callback that returns a boolean");if(this.#_(),this.#Z.setOptions(this.options),Z._defaulted&&!TZ(this.options,Z))this.#$.getQueryCache().notify({type:"observerOptionsUpdated",query:this.#Z,observer:this});let H=this.hasListeners();if(H&&Tj(this.#Z,J,this.options,Z))this.#F();if(this.updateResult(),H&&(this.#Z!==J||y5(this.options.enabled,this.#Z)!==y5(Z.enabled,this.#Z)||y5(this.options.staleTime,this.#Z)!==y5(Z.staleTime,this.#Z)))this.#A();let B=this.#D();if(H&&(this.#Z!==J||y5(this.options.enabled,this.#Z)!==y5(Z.enabled,this.#Z)||B!==this.#U))this.#V(B)}getOptimisticResult($){let Z=this.#$.getQueryCache().build(this.#$,$),J=this.createResult(Z,$);if(!TZ(this.getCurrentResult(),J))this.#H=J,this.#B=this.options,this.#Q=this.#Z.state;return J}getCurrentResult(){return this.#H}trackResult($,Z){return new Proxy($,{get:(J,H)=>{return this.trackProp(H),Z?.(H),Reflect.get(J,H)}})}trackProp($){this.#q.add($)}getCurrentQuery(){return this.#Z}refetch({...$}={}){return this.fetch({...$})}fetchOptimistic($){let Z=this.#$.defaultQueryOptions($),J=this.#$.getQueryCache().build(this.#$,Z),H=()=>{},B,Q=new Promise((X)=>{B=X,H=this.#$.getQueryCache().subscribe((z)=>{if(z.type==="updated"&&z.query.queryHash===J.queryHash&&J.state.data!==void 0)H(),X(this.createResult(J,Z))})});return Promise.race([J.fetch().then(()=>{let X=this.createResult(J,Z);return B?.(X),X}).finally(()=>{H()}),Q])}fetch($){return this.#F({...$,cancelRefetch:$.cancelRefetch??!0}).then(()=>{return this.updateResult(),this.#H})}#F($){this.#_();let Z=this.#Z.fetch(this.options,$);if(!$?.throwOnError)Z=Z.catch(c5);return Z}#N($){return!bZ()&&y5(this.options.enabled,this.#Z)!==!1&&Fz($)}#A(){this.#M();let $=y5(this.options.staleTime,this.#Z);if(this.#H.isStale||!this.#N($))return;let Z=Wz(this.#H.dataUpdatedAt,$)+1;this.#Y=_9.setTimeout(()=>{if(!this.#H.isStale)this.updateResult()},Z)}#D(){return(typeof this.options.refetchInterval==="function"?this.options.refetchInterval(this.#Z):this.options.refetchInterval)??!1}#V($){if(this.#P(),this.#U=$,this.#U===0||!this.#N(this.#U))return;this.#K=_9.setInterval(()=>{if(this.options.refetchIntervalInBackground||wZ.isFocused())this.#F()},this.#U)}#L(){this.#A(),this.#V(this.#D())}#M(){if(this.#Y!==void 0)_9.clearTimeout(this.#Y),this.#Y=void 0}#P(){if(this.#K!==void 0)_9.clearInterval(this.#K),this.#K=void 0}createResult($,Z){let J=this.#Z,H=this.options,B=this.#H,Q=this.#Q,X=this.#B,z=$!==J?$.state:this.#J,{state:G}=$,U={...G},Y=!1,K;if(Z._optimisticResults){let M=this.hasListeners(),_=!M&&jj($,Z),w=M&&Tj($,J,Z,H);if(_||w)U={...U,...yN(G.data,$.options)};if(Z._optimisticResults==="isRestoring")U.fetchStatus="idle"}let{error:F,errorUpdatedAt:W,status:q}=U;K=U.data;let N=!1;if(Z.placeholderData!==void 0&&K===void 0&&q==="pending"){let M;if(B?.isPlaceholderData&&Z.placeholderData===X?.placeholderData)M=B.data,N=!0;else M=typeof Z.placeholderData==="function"?Z.placeholderData(this.#W?.state.data,this.#W):Z.placeholderData;if(M!==void 0)q="success",K=QB(B?.data,M,Z),Y=!0}if(Z.select&&K!==void 0&&!N)if(B&&K===Q?.data&&Z.select===this.#G)K=this.#z;else try{this.#G=Z.select,K=Z.select(K),K=QB(B?.data,K,Z),this.#z=K,this.#X=null}catch(M){this.#X=M}else if(K===void 0)this.#X=null;if(this.#X)F=this.#X,K=this.#z,W=Date.now(),q="error",Y=!1;let D=U.fetchStatus==="fetching",A=q==="pending",V=q==="error",L=A&&D,O=K!==void 0;return{status:q,fetchStatus:U.fetchStatus,isPending:A,isSuccess:q==="success",isError:V,isInitialLoading:L,isLoading:L,data:K,dataUpdatedAt:U.dataUpdatedAt,error:F,errorUpdatedAt:W,failureCount:U.fetchFailureCount,failureReason:U.fetchFailureReason,errorUpdateCount:U.errorUpdateCount,isFetched:$.isFetched(),isFetchedAfterMount:U.dataUpdateCount>z.dataUpdateCount||U.errorUpdateCount>z.errorUpdateCount,isFetching:D,isRefetching:D&&!A,isLoadingError:V&&!O,isPaused:U.fetchStatus==="paused",isPlaceholderData:Y,isRefetchError:V&&O,isStale:vN($,Z),refetch:this.refetch,isEnabled:y5(Z.enabled,$)!==!1}}updateResult(){let $=this.#H,Z=this.createResult(this.#Z,this.options);if(this.#Q=this.#Z.state,this.#B=this.options,this.#Q.data!==void 0)this.#W=this.#Z;if(TZ(Z,$))return;this.#H=Z;let H=(()=>{if(!$)return!0;let{notifyOnChangeProps:B}=this.options,Q=typeof B==="function"?B():B;if(Q==="all"||!Q&&!this.#q.size)return!0;let X=new Set(Q??this.#q);if(this.options.throwOnError)X.add("error");return Object.keys(this.#H).some((z)=>{let G=z;return this.#H[G]!==$[G]&&X.has(G)})})();G5.batch(()=>{if(H)this.listeners.forEach((B)=>{B(this.#H)});this.#$.getQueryCache().notify({query:this.#Z,type:"observerResultsUpdated"})})}#_(){let $=this.#$.getQueryCache().build(this.#$,this.options);if($===this.#Z)return;let Z=this.#Z;if(this.#Z=$,this.#J=$.state,this.hasListeners())Z?.removeObserver(this),$.addObserver(this)}onQueryUpdate(){if(this.updateResult(),this.hasListeners())this.#L()}};function it($,Z){return y5(Z.enabled,$)!==!1&&$.state.data===void 0&&!($.state.status==="error"&&y5(Z.retryOnMount,$)===!1)}function jj($,Z){return it($,Z)||$.state.data!==void 0&&xN($,Z,Z.refetchOnMount)}function xN($,Z,J){if(y5(Z.enabled,$)!==!1&&y5(Z.staleTime,$)!=="static"){let H=typeof J==="function"?J($):J;return H==="always"||H!==!1&&vN($,Z)}return!1}function Tj($,Z,J,H){return($!==Z||y5(H.enabled,$)===!1)&&(!J.suspense||$.state.status!=="error")&&vN($,J)}function vN($,Z){return y5(Z.enabled,$)!==!1&&$.isStaleByTime(y5(Z.staleTime,$))}var Cj=class extends Lz{#$;#Z;#J;#H;constructor($){super();this.#$=$.client,this.mutationId=$.mutationId,this.#J=$.mutationCache,this.#Z=[],this.state=$.state||fN(),this.setOptions($.options),this.scheduleGc()}setOptions($){this.options=$,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver($){if(!this.#Z.includes($))this.#Z.push($),this.clearGcTimeout(),this.#J.notify({type:"observerAdded",mutation:this,observer:$})}removeObserver($){this.#Z=this.#Z.filter((Z)=>Z!==$),this.scheduleGc(),this.#J.notify({type:"observerRemoved",mutation:this,observer:$})}optionalRemove(){if(!this.#Z.length)if(this.state.status==="pending")this.scheduleGc();else this.#J.remove(this)}continue(){return this.#H?.continue()??(this.state.status==="pending"?this.execute(this.state.variables):Promise.resolve())}async execute($){let Z=()=>{this.#Q({type:"continue"})},J={client:this.#$,meta:this.options.meta,mutationKey:this.options.mutationKey},H=this.#H=Vz({fn:()=>{if(!this.options.mutationFn)return Promise.reject(Error("No mutationFn found"));return this.options.mutationFn($,J)},onFail:(X,z)=>{this.#Q({type:"failed",failureCount:X,error:z})},onPause:()=>{this.#Q({type:"pause"})},onContinue:Z,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#J.canRun(this)}),B=this.state.status==="pending",Q=!H.canStart();try{if(B)Z();else{if(this.#Q({type:"pending",variables:$,isPaused:Q}),this.#J.config.onMutate)await this.#J.config.onMutate($,this,J);let z=await this.options.onMutate?.($,J);if(z!==this.state.context)this.#Q({type:"pending",context:z,variables:$,isPaused:Q})}let X=await H.start();return await this.#J.config.onSuccess?.(X,$,this.state.context,this,J),await this.options.onSuccess?.(X,$,this.state.context,J),await this.#J.config.onSettled?.(X,null,this.state.variables,this.state.context,this,J),await this.options.onSettled?.(X,null,$,this.state.context,J),this.#Q({type:"success",data:X}),X}catch(X){try{await this.#J.config.onError?.(X,$,this.state.context,this,J)}catch(z){Promise.reject(z)}try{await this.options.onError?.(X,$,this.state.context,J)}catch(z){Promise.reject(z)}try{await this.#J.config.onSettled?.(void 0,X,this.state.variables,this.state.context,this,J)}catch(z){Promise.reject(z)}try{await this.options.onSettled?.(void 0,X,$,this.state.context,J)}catch(z){Promise.reject(z)}throw this.#Q({type:"error",error:X}),X}finally{if(this.#H===H)this.#H=void 0;this.#J.runNext(this)}}#Q($){let Z=(J)=>{switch($.type){case"failed":return{...J,failureCount:$.failureCount,failureReason:$.error};case"pause":return{...J,isPaused:!0};case"continue":return{...J,isPaused:!1};case"pending":return{...J,context:$.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:$.isPaused,status:"pending",variables:$.variables,submittedAt:Date.now()};case"success":return{...J,data:$.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...J,data:void 0,error:$.error,failureCount:J.failureCount+1,failureReason:$.error,isPaused:!1,status:"error"}}};this.state=Z(this.state),G5.batch(()=>{this.#Z.forEach((J)=>{J.onMutationUpdate($)}),this.#J.notify({mutation:this,type:"updated",action:$})})}};function fN(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var Ej=class extends O8{#$;#Z;#J;constructor($={}){super();this.config=$,this.#$=new Set,this.#Z=new Map,this.#J=0}build($,Z,J){let H=new Cj({client:$,mutationCache:this,mutationId:++this.#J,options:$.defaultMutationOptions(Z),state:J});return this.add(H),H}add($){this.#$.add($);let Z=Mz($);if(typeof Z==="string"){let J=this.#Z.get(Z);if(J)J.push($);else this.#Z.set(Z,[$])}this.notify({type:"added",mutation:$})}remove($){if(this.#$.delete($)){let Z=Mz($);if(typeof Z==="string"){let J=this.#Z.get(Z);if(J){if(J.length>1){let H=J.indexOf($);if(H!==-1)J.splice(H,1)}else if(J[0]===$)this.#Z.delete(Z)}}}this.notify({type:"removed",mutation:$})}canRun($){let Z=Mz($);if(typeof Z==="string"){let J=this.#Z.get(Z)?.find((H)=>H.state.status==="pending");return!J||J===$}else return!0}runNext($){let Z=Mz($);if(typeof Z==="string")return this.#Z.get(Z)?.find((J)=>J!==$&&J.state.isPaused)?.continue()??Promise.resolve();else return Promise.resolve()}clear(){G5.batch(()=>{this.#$.forEach(($)=>{this.notify({type:"removed",mutation:$})}),this.#$.clear(),this.#Z.clear()})}getAll(){return Array.from(this.#$)}find($){let Z={exact:!0,...$};return this.getAll().find((J)=>Nz(Z,J))}findAll($={}){return this.getAll().filter((Z)=>Nz($,Z))}notify($){G5.batch(()=>{this.listeners.forEach((Z)=>{Z($)})})}resumePausedMutations(){let $=this.getAll().filter((Z)=>Z.state.isPaused);return G5.batch(()=>Promise.all($.map((Z)=>Z.continue().catch(c5))))}};function Mz($){return $.options.scope?.id}var gN=class extends O8{#$;#Z=void 0;#J;#H;constructor($,Z){super();this.#$=$,this.setOptions(Z),this.bindMethods(),this.#Q()}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions($){let Z=this.options;if(this.options=this.#$.defaultMutationOptions($),!TZ(this.options,Z))this.#$.getMutationCache().notify({type:"observerOptionsUpdated",mutation:this.#J,observer:this});if(Z?.mutationKey&&this.options.mutationKey&&O9(Z.mutationKey)!==O9(this.options.mutationKey))this.reset();else if(this.#J?.state.status==="pending")this.#J.setOptions(this.options)}onSubscribe(){if(this.listeners.size===1&&this.#J)this.#J.addObserver(this),this.#Q()}onUnsubscribe(){if(!this.hasListeners())this.#J?.removeObserver(this)}onMutationUpdate($){this.#Q(),this.#B($)}getCurrentResult(){return this.#Z}reset(){this.#J?.removeObserver(this),this.#J=void 0,this.#Q(),this.#B()}mutate($,Z){return this.#H=Z,this.#J?.removeObserver(this),this.#J=this.#$.getMutationCache().build(this.#$,this.options),this.#J.addObserver(this),this.#J.execute($)}#Q(){let $=this.#J?.state??fN();this.#Z={...$,isPending:$.status==="pending",isSuccess:$.status==="success",isError:$.status==="error",isIdle:$.status==="idle",mutate:this.mutate,reset:this.reset}}#B($){G5.batch(()=>{if(this.#H&&this.hasListeners()){let Z=this.#Z.variables,J=this.#Z.context,H={client:this.#$,meta:this.options.meta,mutationKey:this.options.mutationKey};if($?.type==="success"){try{this.#H.onSuccess?.($.data,Z,J,H)}catch(B){Promise.reject(B)}try{this.#H.onSettled?.($.data,null,Z,J,H)}catch(B){Promise.reject(B)}}else if($?.type==="error"){try{this.#H.onError?.($.error,Z,J,H)}catch(B){Promise.reject(B)}try{this.#H.onSettled?.(void 0,$.error,Z,J,H)}catch(B){Promise.reject(B)}}}this.listeners.forEach((Z)=>{Z(this.#Z)})})}};var bj=class extends O8{#$;constructor($={}){super();this.config=$,this.#$=new Map}build($,Z,J){let H=Z.queryKey,B=Z.queryHash??HB(H,Z),Q=this.get(B);if(!Q)Q=new Oj({client:$,queryKey:H,queryHash:B,options:$.defaultQueryOptions(Z),state:J,defaultOptions:$.getQueryDefaults(H)}),this.add(Q);return Q}add($){if(!this.#$.has($.queryHash))this.#$.set($.queryHash,$),this.notify({type:"added",query:$})}remove($){let Z=this.#$.get($.queryHash);if(Z){if($.destroy(),Z===$)this.#$.delete($.queryHash);this.notify({type:"removed",query:$})}}clear(){G5.batch(()=>{this.getAll().forEach(($)=>{this.remove($)})})}get($){return this.#$.get($)}getAll(){return[...this.#$.values()]}find($){let Z={exact:!0,...$};return this.getAll().find((J)=>qz(Z,J))}findAll($={}){let Z=this.getAll();return Object.keys($).length>0?Z.filter((J)=>qz($,J)):Z}notify($){G5.batch(()=>{this.listeners.forEach((Z)=>{Z($)})})}onFocus(){G5.batch(()=>{this.getAll().forEach(($)=>{$.onFocus()})})}onOnline(){G5.batch(()=>{this.getAll().forEach(($)=>{$.onOnline()})})}};var mN=class{#$;#Z;#J;#H;#Q;#B;#X;#G;constructor($={}){this.#$=$.queryCache||new bj,this.#Z=$.mutationCache||new Ej,this.#J=$.defaultOptions||{},this.#H=new Map,this.#Q=new Map,this.#B=0}mount(){if(this.#B++,this.#B!==1)return;this.#X=wZ.subscribe(async($)=>{if($)await this.resumePausedMutations(),this.#$.onFocus()}),this.#G=SZ.subscribe(async($)=>{if($)await this.resumePausedMutations(),this.#$.onOnline()})}unmount(){if(this.#B--,this.#B!==0)return;this.#X?.(),this.#X=void 0,this.#G?.(),this.#G=void 0}isFetching($){return this.#$.findAll({...$,fetchStatus:"fetching"}).length}isMutating($){return this.#Z.findAll({...$,status:"pending"}).length}getQueryData($){let Z=this.defaultQueryOptions({queryKey:$});return this.#$.get(Z.queryHash)?.state.data}ensureQueryData($){let Z=this.defaultQueryOptions($),J=this.#$.build(this,Z),H=J.state.data;if(H===void 0)return this.fetchQuery($);if($.revalidateIfStale&&J.isStaleByTime(y5(Z.staleTime,J)))this.prefetchQuery(Z);return Promise.resolve(H)}getQueriesData($){return this.#$.findAll($).map(({queryKey:Z,state:J})=>{return[Z,J.data]})}setQueryData($,Z,J){let H=this.defaultQueryOptions({queryKey:$}),B=this.#$.get(H.queryHash)?.state.data,Q=Wj(Z,B);if(Q===void 0)return;return this.#$.build(this,H).setData(Q,{...J,manual:!0})}setQueriesData($,Z,J){return G5.batch(()=>this.#$.findAll($).map(({queryKey:H})=>[H,this.setQueryData(H,Z,J)]))}getQueryState($){let Z=this.defaultQueryOptions({queryKey:$});return this.#$.get(Z.queryHash)?.state}removeQueries($){let Z=this.#$;G5.batch(()=>{Z.findAll($).forEach((J)=>{Z.remove(J)})})}resetQueries($,Z){let J=this.#$;return G5.batch(()=>{let H=J.findAll($),B=new Set(H);return H.forEach((Q)=>{Q.reset()}),this.refetchQueries({type:"active",predicate:(Q)=>B.has(Q)},Z)})}cancelQueries($,Z={}){let J={revert:!0,...Z},H=G5.batch(()=>this.#$.findAll($).map((B)=>B.cancel(J)));return Promise.all(H).then(c5).catch(c5)}invalidateQueries($,Z={}){return G5.batch(()=>{if(this.#$.findAll($).forEach((J)=>{J.invalidate()}),$?.refetchType==="none")return Promise.resolve();return this.refetchQueries({...$,type:$?.refetchType??$?.type??"active"},Z)})}refetchQueries($,Z={}){let J={...Z,cancelRefetch:Z.cancelRefetch??!0},H=G5.batch(()=>this.#$.findAll($).filter((B)=>!B.isDisabled()&&!B.isStatic()).map((B)=>{let Q=B.fetch(void 0,J);if(!J.throwOnError)Q=Q.catch(c5);return B.state.fetchStatus==="paused"?Promise.resolve():Q}));return Promise.all(H).then(c5)}async query($){let Z=this.defaultQueryOptions($);if(Z.retry===void 0)Z.retry=!1;let J=this.#$.build(this,Z),H=J.isStaleByTime(y5(Z.staleTime,J))?await J.fetch(Z):J.state.data,B=Z.select;if(B)return B(H);return H}fetchQuery($){let Z=this.defaultQueryOptions($);if(Z.retry===void 0)Z.retry=!1;let J=this.#$.build(this,Z);return J.isStaleByTime(y5(Z.staleTime,J))?J.fetch(Z):Promise.resolve(J.state.data)}prefetchQuery($){return this.fetchQuery($).then(c5).catch(c5)}infiniteQuery($){return $._type="infinite",this.query($)}fetchInfiniteQuery($){return $._type="infinite",this.fetchQuery($)}prefetchInfiniteQuery($){return this.fetchInfiniteQuery($).then(c5).catch(c5)}ensureInfiniteQueryData($){return $._type="infinite",this.ensureQueryData($)}resumePausedMutations(){if(SZ.isOnline())return this.#Z.resumePausedMutations();return Promise.resolve()}getQueryCache(){return this.#$}getMutationCache(){return this.#Z}getDefaultOptions(){return this.#J}setDefaultOptions($){this.#J=$}setQueryDefaults($,Z){this.#H.set(O9($),{queryKey:$,defaultOptions:Z})}getQueryDefaults($){let Z=[...this.#H.values()],J={};return Z.forEach((H)=>{if(B6($,H.queryKey))Object.assign(J,H.defaultOptions)}),J}setMutationDefaults($,Z){this.#Q.set(O9($),{mutationKey:$,defaultOptions:Z})}getMutationDefaults($){let Z=[...this.#Q.values()],J={};return Z.forEach((H)=>{if(B6($,H.mutationKey))Object.assign(J,H.defaultOptions)}),J}defaultQueryOptions($){if($._defaulted)return $;let Z={...this.#J.queries,...this.getQueryDefaults($.queryKey),...$,_defaulted:!0};if(!Z.queryHash)Z.queryHash=HB(Z.queryKey,Z);if(Z.refetchOnReconnect===void 0)Z.refetchOnReconnect=Z.networkMode!=="always";if(Z.throwOnError===void 0)Z.throwOnError=!!Z.suspense;if(!Z.networkMode&&Z.persister)Z.networkMode="offlineFirst";if(Z.queryFn===CZ)Z.enabled=!1;return Z}defaultMutationOptions($){if($?._defaulted)return $;return{...this.#J.mutations,...$?.mutationKey&&this.getMutationDefaults($.mutationKey),...$,_defaulted:!0}}clear(){this.#$.clear(),this.#Z.clear()}};var Sj=($,Z,J)=>{let H=J?.state.error&&typeof $.throwOnError==="function"?EZ($.throwOnError,[J.state.error,J]):$.throwOnError;if($.suspense||H){if(!Z.isReset())$.retryOnMount=!1}},Rj=($)=>{wj.useEffect(()=>{$.clearReset()},[$])},Ij=({result:$,errorResetBoundary:Z,throwOnError:J,query:H,suspense:B})=>{return $.isError&&!Z.isReset()&&!$.isFetching&&H&&(B&&$.data===void 0||EZ(J,[$.error,H]))};var kj=($)=>{if($.suspense){let J=(B)=>B==="static"?B:Math.max(B??1000,1000),H=$.staleTime;if($.staleTime=typeof H==="function"?(...B)=>J(H(...B)):J(H),typeof $.gcTime==="number")$.gcTime=Math.max($.gcTime,1000)}},yj=($,Z)=>$?.suspense&&Z.isPending,xj=($,Z,J)=>Z.fetchOptimistic($).catch(()=>{J.clearReset()});var Q6=P(m(),1);function hj($,Z,J){let H=Gj(),B=Uj(),Q=$1(J),X=Q.defaultQueryOptions($),z=Q.getQueryCache().get(X.queryHash),G=$.subscribed!==!1;X._optimisticResults=H?"isRestoring":G?"optimistic":void 0,kj(X),Sj(X,B,z),Rj(B);let[U]=Q6.useState(()=>new Z(Q,X)),Y=U.getOptimisticResult(X),K=!H&&G;if(Q6.useSyncExternalStore(Q6.useCallback((F)=>{let W=K?U.subscribe(G5.batchCalls(F)):c5;return U.updateResult(),W},[U,K]),()=>U.getCurrentResult(),()=>U.getCurrentResult()),Q6.useEffect(()=>{U.setOptions(X)},[X,U]),yj(X,Y))throw xj(X,U,B);if(Ij({result:Y,errorResetBoundary:B,throwOnError:X.throwOnError,query:z,suspense:X.suspense}))throw Y.error;return!X.notifyOnChangeProps?U.trackResult(Y):Y}function s1($,Z){return hj($,hN,Z)}function XB($){return $}var _3=P(m(),1);function uN($,Z){let J=$1(Z);return fj({filters:{...$,status:"pending"}},J).length}function vj($,Z){return $.findAll(Z.filters).map((J)=>Z.select?Z.select(J):J.state)}function fj($={},Z){let J=$1(Z).getMutationCache(),H=_3.useRef($),B=_3.useRef(null);if(B.current===null)B.current=vj(J,$);return _3.useEffect(()=>{H.current=$}),_3.useSyncExternalStore(_3.useCallback((Q)=>J.subscribe(()=>{let X=BB(B.current,vj(J,H.current));if(B.current!==X)B.current=X,G5.schedule(Q)}),[J]),()=>B.current,()=>B.current)}var O3=P(m(),1);function F5($,Z){let J=$1(Z),[H]=O3.useState(()=>new gN(J,$));O3.useEffect(()=>{H.setOptions($)},[H,$]);let B=O3.useSyncExternalStore(O3.useCallback((X)=>H.subscribe(G5.batchCalls(X)),[H]),()=>H.getCurrentResult(),()=>H.getCurrentResult()),Q=O3.useCallback((...X)=>{H.mutate(X[0],X[1]).catch(c5)},[H]);if(B.error&&EZ(H.options.throwOnError,[B.error]))throw B.error;return{...B,mutate:Q,mutateAsync:B.mutate}}var St=P(fq0(),1);function gj($,Z){if($ instanceof RegExp)return{keys:!1,pattern:$};var J,H,B,Q,X=[],z="",G=$.split("/");G[0]||G.shift();while(B=G.shift())if(J=B[0],J==="*")X.push(J),z+=B[1]==="?"?"(?:/(.*))?":"/(.*)";else if(J===":"){if(H=B.indexOf("?",1),Q=B.indexOf(".",1),X.push(B.substring(1,~H?H:~Q?Q:B.length)),z+=!!~H&&!~Q?"(?:/([^/]+?))?":"/([^/]+?)",~Q)z+=(~H?"?":"")+"\\"+B.substring(Q)}else z+="/"+B;return{keys:X,pattern:new RegExp("^"+z+(Z?"(?=$|/)":"/?$"),"i")}}var i7=P(m(),1),u1=P(m(),1);var Pz=P(RZ(),1);var Be=i7.useInsertionEffect,Qe=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",cN=Qe?i7.useLayoutEffect:i7.useEffect,Xe=Be||cN,_z=($)=>{let Z=i7.useRef([$,(...J)=>Z[0](...J)]).current;return Xe(()=>{Z[0]=$}),Z[1]};var mj=["popstate","pushState","replaceState","hashchange"],zB=[],uj=()=>zB.forEach(($)=>$()),ze=($)=>{if(zB.push($)===1)mj.forEach((Z)=>addEventListener(Z,uj));return()=>{if(zB=zB.filter((Z)=>Z!==$),!zB.length)mj.forEach((Z)=>removeEventListener(Z,uj))}},lj=($,Z)=>Pz.useSyncExternalStore(ze,$,Z),pj=()=>location.search,Oz=({ssrSearch:$}={})=>lj(pj,$!=null?()=>$:pj),cj=()=>location.pathname,r7=({ssrPath:$}={})=>lj(cj,$!=null?()=>$:cj);var Ge=($,{replace:Z=!1,state:J=null}={})=>history[Z?"replaceState":"pushState"](J,"",$),ij=($)=>[r7($),Ge],dj=Symbol.for("wouter_v3");if(typeof history<"u"&&typeof window[dj]>"u"){for(let $ of["pushState","replaceState"]){let Z=history[$];history[$]=function(){let J=Z.apply(this,arguments),H=new Event($);return H.arguments=arguments,dispatchEvent(H),J}}Object.defineProperty(window,dj,{value:!0})}var aj=($="")=>$==="/"?"":$,oj=($,Z)=>$[0]==="~"?$.slice(1):aj(Z)+$,dN=($,Z)=>{return $=rj(aj($)),Z=rj(Z),!$||!Z.toLowerCase().indexOf($.toLowerCase())?Z.slice($.length)||"/":"~"+Z},rj=($)=>{try{return $.includes("%")?decodeURI($):$}catch(Z){return $}};var nj={hook:ij,searchHook:Oz,parser:gj,base:"",ssrPath:void 0,ssrSearch:void 0,ssrContext:void 0,hrefs:($)=>$,aroundNav:($,Z,J)=>$(Z,J)},sj=u1.createContext(nj),C2=()=>u1.useContext(sj),tj={},ej=u1.createContext(tj),lN=()=>u1.useContext(ej),$T=($,Z=$.base)=>dN(Z,$.hook($)[0]),iN=($)=>{let[Z,J]=$.hook($);return[dN($.base,Z),_z((H,B)=>$.aroundNav(J,oj(H,$.base),B))]},m4=()=>iN(C2());var ZT=($,Z,J,H)=>{let{pattern:B,keys:Q}=Z instanceof RegExp?{pattern:Z}:$(Z||"*",H),X=B.exec(J);if(!X)return[!1,null];let z={};for(let G=1;G<X.length;G++)z[G-1]=X[G];if(Q)for(let G=0;G<Q.length;G++)z[Q[G]]=X[G+1];else Object.assign(z,X.groups);return H?[!0,z,X[0]]:[!0,z]};var rN=({children:$,...Z})=>{let J=C2(),H=Z.hook?nj:J,B=H;if(Z.ssrPath){let[G,U=Z.ssrSearch??""]=Z.ssrPath.split("?");if(G)Z.ssrSearch=U,Z.ssrPath=G}Z.hrefs=Z.hrefs??Z.hook?.hrefs,Z.searchHook=Z.searchHook??Z.hook?.searchHook;let Q=u1.useRef(H),X=Q.current,z=X;for(let G in H){let U=G==="base"?H[G]+(Z[G]??""):Z[G]??H[G];if(U!==z[G]){if(X===z)Q.current=z={...z};z[G]=U}if(U!==H[G]||U!==B[G])B=z}return u1.createElement(sj.Provider,{value:B},$)},Ue=({children:$,component:Z},J)=>{if(Z)return u1.createElement(Z,{params:J});return typeof $==="function"?$(J):$},Ye=($)=>{let Z=u1.useRef(tj),J=Z.current,H=Object.keys($);return Z.current=H.length!==Object.keys(J).length||H.some((B)=>$[B]!==J[B])?$:J};var jz=({path:$,nest:Z,match:J,...H})=>{let B=C2(),Q=$T(B),[X,z,G]=J??ZT(B.parser,$,Q,Z),U=Ye({...lN(),...z});if(!X)return null;let Y=Ue(H,U);return u1.createElement(ej.Provider,{value:U},G?u1.createElement(rN,{base:G},Y):Y)},a7=u1.forwardRef(($,Z)=>{let J=C2(),[H,B]=iN(J),{to:Q="",href:X=Q,onClick:z,asChild:G,children:U,className:Y,replace:K,state:F,transition:W,...q}=$;if(q.onClick=_z((N)=>{if(N.ctrlKey||N.metaKey||N.altKey||N.shiftKey||N.button!==0)return;if(z?.(N),!N.defaultPrevented)N.preventDefault(),B(X,$)}),q.href=J.hrefs(X[0]==="~"?X.slice(1):J.base+X,J),Y!==void 0)q.className=Y?.call?Y(H===X):Y;if(Z)q.ref=Z;return G&&u1.isValidElement(U)?u1.cloneElement(U,q):u1.createElement("a",q,U)}),JT=($,Z=[])=>{if(Array.isArray($))for(let J of $)JT(J&&J.type===u1.Fragment?J.props.children:J,Z);else Z.push($);return Z},HT=({children:$,location:Z})=>{let J=C2(),H=$T(J);for(let B of JT($)){let Q=0;if(u1.isValidElement(B)&&(Q=ZT(J.parser,B.props.path,Z||H,B.props.nest))[0])return u1.cloneElement(B,{match:Q})}return null},BT=($)=>{let{to:Z,href:J=Z}=$,H=C2(),[,B]=iN(H),Q=_z(()=>B(Z||J,$)),{ssrContext:X}=H;if(cN(()=>{Q()},[]),X)X.redirectTo=Z;return null};var z4={};I5(z4,{useToastManager:()=>nE,createToastManager:()=>sE,Viewport:()=>pT,Title:()=>AC,Root:()=>XC,Provider:()=>fT,Positioner:()=>iE,Portal:()=>CC,Description:()=>qC,Content:()=>zC,Close:()=>DC,Arrow:()=>aE,Action:()=>LC});var vT=P(m(),1);var QT=P(m(),1);function X6($){QT.useEffect($,Z4)}var Tz=P(m(),1),aN=Tz.createContext(void 0);function j9(){let $=Tz.useContext(aN);if(!$)throw Error(I0(73));return $}var UT=P(m(),1),tN=P(RZ(),1);var z6=P(m(),1),Ke=RZ();function Fe($,Z){return $===Z&&($!==0||1/$===1/Z)||$!==$&&Z!==Z}var We=typeof Object.is==="function"?Object.is:Fe,qe=Ke.useSyncExternalStore,Ne=z6.useRef,Ae=z6.useEffect,De=z6.useMemo,Ve=z6.useDebugValue;var oN=function($,Z,J,H,B){var Q=Ne(null);if(Q.current===null){var X={hasValue:!1,value:null};Q.current=X}else X=Q.current;Q=De(function(){function G(W){if(!U){if(U=!0,Y=W,W=H(W),B!==void 0&&X.hasValue){var q=X.value;if(B(q,W))return K=q}return K=W}if(q=K,We(Y,W))return q;var N=H(W);if(B!==void 0&&B(q,N))return Y=W,q;return Y=W,K=N}var U=!1,Y,K,F=J===void 0?null:J;return[function(){return G(Z())},F===null?void 0:function(){return G(F())}]},[Z,J,H,B]);var z=qe($,Q[0],Q[1]);return Ae(function(){X.hasValue=!0,X.value=z},[z]),Ve(z),z};var XT=P(m(),1);var nN=[],sN=void 0;function zT(){return sN}function GT($){nN.push($)}function r8($){let Z=(J,H)=>{let B=Z5(Le).current,Q;try{sN=B;for(let X of nN)X.before(B);Q=$(J,H);for(let X of nN)X.after(B);B.didInitialize=!0}finally{sN=void 0}return Q};return Z.displayName=$.displayName||$.name,Z}function T9($){return XT.forwardRef(r8($))}function Le(){return{didInitialize:!1}}var Me=Cz(19),Pe=Me?Oe:je;function Ez($,Z,J,H,B){return Pe($,Z,J,H,B)}function _e($,Z,J,H,B){let Q=UT.useCallback(()=>Z($.getSnapshot(),J,H,B),[$,Z,J,H,B]);return tN.useSyncExternalStore($.subscribe,Q,Q)}GT({before($){if($.syncIndex=0,!$.didInitialize)$.syncTick=1,$.syncHooks=[],$.didChangeStore=!0,$.getSnapshot=()=>{let Z=!1;for(let J=0;J<$.syncHooks.length;J+=1){let H=$.syncHooks[J],B=H.selector(H.store.state,H.a1,H.a2,H.a3);if(!Object.is(H.value,B))Z=!0,H.value=B}if(Z)$.syncTick+=1;return $.syncTick}},after($){if($.syncHooks.length>0){if($.didChangeStore)$.didChangeStore=!1,$.subscribe=(Z)=>{let J=new Set;for(let B of $.syncHooks)J.add(B.store);let H=[];for(let B of J)H.push(B.subscribe(Z));return()=>{for(let B of H)B()}};tN.useSyncExternalStore($.subscribe,$.getSnapshot,$.getSnapshot)}}});function Oe($,Z,J,H,B){let Q=zT();if(!Q)return _e($,Z,J,H,B);let X=Q.syncIndex;Q.syncIndex+=1;let z;if(!Q.didInitialize)z={store:$,selector:Z,a1:J,a2:H,a3:B,value:Z($.getSnapshot(),J,H,B)},Q.syncHooks.push(z);else if(z=Q.syncHooks[X],z.store!==$||z.selector!==Z||!Object.is(z.a1,J)||!Object.is(z.a2,H)||!Object.is(z.a3,B)){if(z.store!==$)Q.didChangeStore=!0;z.store=$,z.selector=Z,z.a1=J,z.a2=H,z.a3=B,z.value=Z($.getSnapshot(),J,H,B)}return z.value}function je($,Z,J,H,B){return oN($.subscribe,$.getSnapshot,$.getSnapshot,(Q)=>Z(Q,J,H,B))}class eN{static create($){return new this($)}constructor($){this.state=$,this.listeners=new Set,this.updateTick=0}subscribe=($)=>{return this.listeners.add($),()=>{this.listeners.delete($)}};getSnapshot=()=>{return this.state};setState($){if(this.state===$)return;this.state=$,this.updateTick+=1;let Z=this.updateTick;for(let J of this.listeners){if(Z!==this.updateTick)return;J($)}}update($){for(let Z in $)if(!Object.is(this.state[Z],$[Z])){this.setState({...this.state,...$});return}}set($,Z){if(!Object.is(this.state[$],Z))this.setState({...this.state,[$]:Z})}notifyAll(){let $={...this.state};this.setState($)}use($,Z,J,H){return Ez(this,$,Z,J,H)}}var o7=P(m(),1);class g2 extends eN{constructor($,Z={},J){super($);this.context=Z,this.selectors=J}useSyncedValue($,Z){o7.useDebugValue($);let J=this;H0(()=>{if(J.state[$]!==Z)J.set($,Z)},[J,$,Z])}useSyncedValueWithCleanup($,Z){let J=this;H0(()=>{if(J.state[$]!==Z)J.set($,Z);return()=>{J.set($,void 0)}},[J,$,Z])}useSyncedValues($){let Z=this,J=Object.values($);H0(()=>{Z.update($)},[Z,...J])}useControlledProp($,Z){o7.useDebugValue($);let J=this,H=Z!==void 0;H0(()=>{if(H&&!Object.is(J.state[$],Z))J.setState({...J.state,[$]:Z})},[J,$,Z,H])}select($,Z,J,H){let B=this.selectors[$];return B(this.state,Z,J,H)}useState($,Z,J,H){return o7.useDebugValue($),Ez(this,this.selectors[$],Z,J,H)}useContextCallback($,Z){o7.useDebugValue($);let J=Y0(Z??U1);this.context[$]=J}useStateSetter($){let Z=o7.useRef(void 0);if(Z.current===void 0)Z.current=(J)=>{this.set($,J)};return Z.current}observe($,Z){let J;if(typeof $==="function")J=$;else J=this.selectors[$];let H=J(this.state);return Z(H,H,this),this.subscribe((B)=>{let Q=J(B);if(!Object.is(H,Q)){let X=H;H=Q,Z(Q,X,this)}})}}function E2(...$){return()=>{for(let Z=0;Z<$.length;Z+=1){let J=$[Z];if(J)J()}}}function a0($,Z,J,H){return $.addEventListener(Z,J,H),()=>{$.removeEventListener(Z,J,H)}}var bz=P(m(),1);function YT(){let[,$]=bz.useState({});return bz.useCallback(()=>{$({})},[])}var wz=null,HV0=globalThis.requestAnimationFrame;class KT{callbacks=[];callbacksCount=0;nextId=1;startId=1;isScheduled=!1;tick=($)=>{this.isScheduled=!1;let Z=this.callbacks,J=this.callbacksCount;if(this.callbacks=[],this.callbacksCount=0,this.startId=this.nextId,J>0)for(let H=0;H<Z.length;H+=1)Z[H]?.($)};request($){let Z=this.nextId;this.nextId+=1,this.callbacks.push($),this.callbacksCount+=1;let J=!1;if(!this.isScheduled||J)requestAnimationFrame(this.tick),this.isScheduled=!0;return Z}cancel($){let Z=$-this.startId;if(Z<0||Z>=this.callbacks.length)return;if(this.callbacks[Z]===null)return;this.callbacks[Z]=null,this.callbacksCount-=1}}var Sz=new KT;class m2{static create(){return new m2}static request($){return Sz.request($)}static cancel($){return Sz.cancel($)}currentId=wz;request($){this.cancel(),this.currentId=Sz.request(()=>{this.currentId=wz,$()})}cancel=()=>{if(this.currentId!==wz)Sz.cancel(this.currentId),this.currentId=wz};disposeEffect=()=>{return this.cancel}}function C4(){let $=Z5(m2.create).current;return X6($.disposeEffect),$}var GB=0;class r5{static create(){return new r5}currentId=GB;start($,Z){this.clear(),this.currentId=setTimeout(()=>{this.currentId=GB,Z()},$)}isStarted(){return this.currentId!==GB}clear=()=>{if(this.currentId!==GB)clearTimeout(this.currentId),this.currentId=GB};disposeEffect=()=>{return this.clear}}function t1(){let $=Z5(r5.create).current;return X6($.disposeEffect),$}var FT=0;function Rz($){return FT+=1,`${$}-${Math.random().toString(36).slice(2,6)}-${FT}`}function Iz($,Z){if(typeof $==="string")return{description:$};if(typeof $==="function"){let J=$(Z);return typeof J==="string"?{description:J}:J}return $}var J5={};I5(J5,{screenReader:()=>QA,os:()=>JA,mediaQuery:()=>zA,env:()=>XA,engine:()=>BA});var JA={};I5(JA,{windows:()=>be,mac:()=>AT,linux:()=>we,ios:()=>$A,apple:()=>ZA,android:()=>NT});function Te(){if(typeof navigator>"u")return{userAgent:"",platform:"",maxTouchPoints:0};return{userAgent:navigator.userAgent,platform:navigator.platform??"",maxTouchPoints:navigator.maxTouchPoints??0}}var{userAgent:Ce,platform:Ee,maxTouchPoints:WT}=Te(),n7=Ce.toLowerCase(),s7=Ee.toLowerCase();var $A=/^i(os$|p)/.test(s7)||s7==="macintel"&&WT>1,qT="android",NT=s7===qT||n7.includes(qT),AT=!$A&&s7.startsWith("mac"),be=s7.startsWith("win"),we=!NT&&/^(linux|chrome os)/.test(s7),ZA=AT||$A;var BA={};I5(BA,{webkit:()=>HA,gecko:()=>Se,blink:()=>Re});var HA=typeof CSS<"u"&&!!CSS.supports?.("-webkit-backdrop-filter:none"),Se=!HA&&n7.includes("firefox"),Re=!HA&&n7.includes("chrom");var QA={};I5(QA,{voiceOver:()=>Ie});var Ie=ZA;var XA={};I5(XA,{jsdom:()=>ke});var ke=/jsdom|happydom/.test(n7);var zA={};I5(zA,{iOS:()=>ye});var ye="@supports (-webkit-touch-callout: none)";function l1($){let Z=$.activeElement;while(Z?.shadowRoot?.activeElement!=null)Z=Z.shadowRoot.activeElement;return Z}function R0($,Z){if(!$||!Z)return!1;let J=Z.getRootNode?.();if($.contains(Z))return!0;if(J&&G6(J)){let H=Z;while(H){if($===H)return!0;H=H.parentNode||H.host}}return!1}function V1($){if("composedPath"in $)return $.composedPath()[0]??$.target;return $.target}var UB="data-base-ui-focusable";var GA="input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])",YB="ArrowLeft",KB="ArrowRight",UA="ArrowUp",kz="ArrowDown";var X8={};I5(X8,{startingStyle:()=>t7,endingStyle:()=>FB});var t7="data-starting-style",FB="data-ending-style";var xe={[t7]:""},he={[FB]:""},G2={transitionStatus($){if($==="starting")return xe;if($==="ending")return he;return null}};var e7={};I5(e7,{startingStyle:()=>ve,side:()=>ge,open:()=>YA,endingStyle:()=>fe,closed:()=>KA,anchorHidden:()=>FA,align:()=>me});var YA="data-open",KA="data-closed",ve=t7,fe=FB,FA="data-anchor-hidden",ge="data-side",me="data-align";var xz={};I5(xz,{pressed:()=>WA,popupOpen:()=>yz});var yz="data-popup-open",WA="data-pressed";var ue={[yz]:""},pe={[yz]:"",[WA]:""},ce={[YA]:""},de={[KA]:""},le={[FA]:""},C9={open($){if($)return ue;return null}},WB={open($){if($)return pe;return null}},z8={open($){if($)return ce;return de},anchorHidden($){if($)return le;return null}},J4={...z8,...G2};var OV0=xz.popupOpen,qB="data-trigger-disabled";function U6($,Z){if(!n0($))return!1;let J=$;if(Z.hasElement(J))return!J.hasAttribute(qB);for(let[,H]of Z.entries())if(R0(H,J))return!H.hasAttribute(qB);return!1}function hz($,Z){if(Z==null)return!1;if("composedPath"in $)return $.composedPath().includes(Z);let J=$;return J.target!=null&&Z.contains(J.target)}function VT($){return $.matches("html,body")}function $$($){return L1($)&&$.matches(GA)}function qA($){return $?.closest(`button,a[href],[role="button"],select,[tabindex]:not([tabindex="-1"]),${GA}`)!=null}function NB($){if(!$)return!1;return $.getAttribute("role")==="combobox"&&$$($)}function E9($){if(!$||J5.env.jsdom)return!0;try{return $.matches(":focus-visible")}catch(Z){return!0}}function AB($){if(!$)return null;return $.hasAttribute(UB)?$:$.querySelector(`[${UB}]`)||$}function j8($,Z,J=!0){return $.filter((B)=>B.parentId===Z).flatMap((B)=>[...!J||B.context?.open?[B]:[],...j8($,B.id,J)])}function NA($,Z){let J=[],H=$.find((B)=>B.id===Z)?.parentId;while(H){let B=$.find((Q)=>Q.id===H);if(H=B?.parentId,B)J=J.concat(B)}return J}function u4($){$.preventDefault(),$.stopPropagation()}function LT($){return"nativeEvent"in $}function IZ($){if($.pointerType===""&&$.isTrusted)return!0;if(J5.os.android&&$.pointerType)return $.type==="click"&&$.buttons===1;return $.detail===0&&!$.pointerType}function kZ($){if(J5.env.jsdom)return!1;return!J5.os.android&&$.width===0&&$.height===0||J5.os.android&&$.width===1&&$.height===1&&$.pressure===0&&$.detail===0&&$.pointerType==="mouse"||$.width<1&&$.height<1&&$.pressure===0&&$.detail===0&&$.pointerType==="touch"}function G8($,Z){let J=["mouse","pen"];if(!Z)J.push("",void 0);return J.includes($)}function MT($){let Z=$.type;return Z==="click"||Z==="mousedown"||Z==="keydown"||Z==="keyup"}var{min:Y6,max:a8,round:K6,floor:VB}=Math,b9=($)=>({x:$,y:$}),ie={left:"right",right:"left",bottom:"top",top:"bottom"};function fz($,Z,J){return a8($,Y6(Z,J))}function w9($,Z){return typeof $==="function"?$(Z):$}function H4($){return $.split("-")[0]}function T8($){return $.split("-")[1]}function gz($){return $==="x"?"y":"x"}function LB($){return $==="y"?"height":"width"}function p4($){let Z=$[0];return Z==="t"||Z==="b"?"y":"x"}function MB($){return gz(p4($))}function OT($,Z,J){if(J===void 0)J=!1;let H=T8($),B=MB($),Q=LB(B),X=B==="x"?H===(J?"end":"start")?"right":"left":H==="start"?"bottom":"top";if(Z.reference[Q]>Z.floating[Q])X=DB(X);return[X,DB(X)]}function jT($){let Z=DB($);return[vz($),Z,vz(Z)]}function vz($){return $.includes("start")?$.replace("start","end"):$.replace("end","start")}var PT=["left","right"],_T=["right","left"],re=["top","bottom"],ae=["bottom","top"];function oe($,Z,J){switch($){case"top":case"bottom":if(J)return Z?_T:PT;return Z?PT:_T;case"left":case"right":return Z?re:ae;default:return[]}}function TT($,Z,J,H){let B=T8($),Q=oe(H4($),J==="start",H);if(B){if(Q=Q.map((X)=>X+"-"+B),Z)Q=Q.concat(Q.map(vz))}return Q}function DB($){let Z=H4($);return ie[Z]+$.slice(Z.length)}function ne($){var Z,J,H,B;return{top:(Z=$.top)!=null?Z:0,right:(J=$.right)!=null?J:0,bottom:(H=$.bottom)!=null?H:0,left:(B=$.left)!=null?B:0}}function mz($){return typeof $!=="number"?ne($):{top:$,right:$,bottom:$,left:$}}function Z$($){let{x:Z,y:J,width:H,height:B}=$;return{width:H,height:B,top:J,left:Z,right:Z+H,bottom:J+B,x:Z,y:J}}function F6($,Z){return Z<0||Z>=$.length}function J$($,Z){return C8($.current,{disabledIndices:Z})}function yZ($,Z){return C8($.current,{decrement:!0,startingIndex:$.current.length,disabledIndices:Z})}function C8($,{startingIndex:Z=-1,decrement:J=!1,disabledIndices:H,amount:B=1}={}){let Q=Z;do Q+=J?-B:B;while(Q>=0&&Q<=$.length-1&&j3($,Q,H));return Q}function j3($,Z,J){if(typeof J==="function"?J(Z):J?.includes(Z)??!1)return!0;let B=$[Z];if(!B)return!1;if(!H$(B))return!0;if(B.matches(":disabled"))return!0;return!J&&(B.hasAttribute("disabled")||B.getAttribute("aria-disabled")==="true")}function se($){return $.visibility==="hidden"||$.visibility==="collapse"}function H$($,Z=$?u2($):null){if(!$||!$.isConnected||!Z||se(Z))return!1;if(typeof $.checkVisibility==="function")return $.checkVisibility();return Z.display!=="none"&&Z.display!=="contents"}var te='a[href],button,input,select,textarea,summary,details,iframe,object,embed,[tabindex],[contenteditable]:not([contenteditable="false"]),audio[controls],video[controls]';function ee($){let Z=$.assignedSlot;if(Z)return Z;if($.parentElement)return $.parentElement;let J=$.getRootNode();return G6(J)?J.host:null}function DA($){for(let Z of Array.from($.children))if(b2(Z)==="summary")return Z;return null}function $00($,Z){let J=DA(Z);return!!J&&($===J||R0(J,$))}function CT($){let Z=$?b2($):"";return $!=null&&$.matches(te)&&(Z!=="summary"||$.parentElement!=null&&b2($.parentElement)==="details"&&DA($.parentElement)===$)&&(Z!=="details"||DA($)==null)&&(Z!=="input"||$.type!=="hidden")}function ET($){if(!CT($)||!$.isConnected||$.matches(":disabled"))return!1;for(let Z=$;Z;Z=ee(Z)){let J=Z!==$,H=b2(Z)==="slot";if(Z.hasAttribute("inert"))return!1;if(J&&b2(Z)==="details"&&!Z.open&&!$00($,Z)||Z.hasAttribute("hidden")||!H&&!Z00(Z,J))return!1}return!0}function Z00($,Z){let J=u2($);if(!Z)return H$($,J);return J.display!=="none"}function bT($){let Z=$.tabIndex;if(Z<0){let J=b2($);if(J==="details"||J==="audio"||J==="video"||L1($)&&$.isContentEditable)return 0}return Z}function AA($){if(b2($)!=="input")return null;let Z=$;return Z.type==="radio"&&Z.name!==""?Z:null}function J00($,Z){let J=AA($);if(!J)return!0;let H=Z.find((B)=>{let Q=AA(B);return Q?.name===J.name&&Q.form===J.form&&Q.checked});if(H)return H===J;return Z.find((B)=>{let Q=AA(B);return Q?.name===J.name&&Q.form===J.form})===J}function wT($){if(L1($)&&b2($)==="slot"){let Z=$.assignedElements({flatten:!0});if(Z.length>0)return Z}if(L1($)&&$.shadowRoot)return Array.from($.shadowRoot.children);return Array.from($.children)}function ST($,Z){wT($).forEach((J)=>{if(CT(J))Z.push(J);ST(J,Z)})}function RT($,Z,J){wT($).forEach((H)=>{if(L1(H)&&H.matches(Z))J.push(H);RT(H,Z,J)})}function uz($){return ET($)&&bT($)>=0}function VA($){let Z=[];return ST($,Z),Z.filter(ET)}function xZ($){let Z=VA($);return Z.filter((J)=>bT(J)>=0&&J00(J,Z))}function IT($,Z){let J=xZ($),H=J.length;if(H===0)return;let B=l1(m0($)),Q=J.indexOf(B),X=Q===-1?Z===1?0:H-1:Q+Z;return J[X]}function hZ($){return IT(m0($).body,1)||$}function pz($){return IT(m0($).body,-1)||$}function kT($,Z){if(!$)return null;let J=xZ(m0($).body),H=J.length;if(H===0)return null;let B=J.indexOf($);if(B===-1)return null;let Q=(B+Z+H)%H;return J[Q]}function yT($){return kT($,1)}function xT($){return kT($,-1)}function T3($,Z){let J=Z||$.currentTarget,H=$.relatedTarget;return!H||!R0(J,H)}function hT($){xZ($).forEach((J)=>{J.dataset.tabindex=J.getAttribute("tabindex")||"",J.setAttribute("tabindex","-1")})}function LA($){let Z=[];RT($,"[data-tabindex]",Z),Z.forEach((J)=>{let H=J.dataset.tabindex;if(delete J.dataset.tabindex,H)J.setAttribute("tabindex",H);else J.removeAttribute("tabindex")})}function MA($){let Z=new Map,J=0,H=0;return $.forEach((B,Q)=>{let X=B.transitionStatus==="ending";if(Z.set(B.id,{value:B,domIndex:Q,visibleIndex:X?-1:J,offsetY:H}),H+=B.height||0,!X)J+=1}),Z}function PA($,Z){let J=0;return $.map((H)=>{if(H.transitionStatus==="ending")return H;let B=J>=Z;return J+=1,H.limited===B?H:{...H,limited:B}})}var o8={toasts:($)=>$.toasts,isEmpty:($)=>$.toasts.length===0,toast:($,Z)=>$.toastMetadata.get(Z)?.value,toastIndex:($,Z)=>$.toastMetadata.get(Z)?.domIndex??-1,toastOffsetY:($,Z)=>$.toastMetadata.get(Z)?.offsetY??0,toastVisibleIndex:($,Z)=>$.toastMetadata.get(Z)?.visibleIndex??-1,focused:($)=>$.focused,expanded:($)=>$.hovering||$.focused,expandedOrOutOfFocus:($)=>$.hovering||$.focused||!$.isWindowFocused,prevFocusElement:($)=>$.prevFocusElement};class _A extends g2{timers=new Map;areTimersPaused=!1;constructor($){super({...$,toastMetadata:MA($.toasts)},{},o8)}setViewport=($)=>{this.set("viewport",$)};syncProviderProps($,Z){let J=this.state.limit!==Z;if(this.state.timeout===$&&!J)return;let H={timeout:$,limit:Z};if(J){let B=PA(this.state.toasts,Z);H.toasts=B,H.toastMetadata=MA(B)}this.update(H)}disposeEffect=()=>{return()=>{this.timers.forEach(($)=>{$.timeout?.clear()}),this.timers.clear()}};removeToast($,Z=!1){let J=o8.toastIndex(this.state,$);if(J===-1)return;let H=this.state.toasts[J];if(!Z)H?.onRemove?.();let B=[...this.state.toasts];B.splice(J,1),this.setToasts(B)}addToast=($)=>{let{timeout:Z,limit:J}=this.state,H=$.id||Rz("toast");if($.id){let z=o8.toast(this.state,$.id);if(z)if(z.transitionStatus==="ending")this.removeToast($.id,!0);else{let{id:G,transitionStatus:U,...Y}=$;return this.updateToastInternal($.id,Y,!0,!0),$.id}}let B={...$,id:H,updateKey:0,transitionStatus:"starting"},Q=[B,...this.state.toasts];this.setToasts(PA(Q,J));let X=B.timeout??Z;if(B.type!=="loading"&&X>0)this.scheduleTimer(H,X,()=>this.closeToast(H));if(o8.expandedOrOutOfFocus(this.state))this.pauseTimers();return H};updateToast=($,Z)=>{let J=o8.toast(this.state,$);if(!J||J.transitionStatus==="ending")return;this.updateToastInternal($,typeof Z==="function"?Z(J):Z,!1,!0)};updateToastInternal=($,Z,J=!1,H=!1)=>{let{timeout:B,toasts:Q}=this.state,X=o8.toast(this.state,$);if(!X)return;if(X.transitionStatus==="ending")return;let z={...X,...Z,...H&&{updateKey:X.updateKey+1}};this.setToasts(Q.map((N)=>N.id===$?z:N));let G=z.timeout??B,U=X.timeout??B,Y=Object.hasOwn(Z,"timeout"),K=z.transitionStatus!=="ending"&&z.type!=="loading"&&G>0,F=this.timers.has($),W=U!==G,q=X.type==="loading";if(!K&&F){this.clearTimer($);return}if(K&&(!F||W||Y||q||J)){if(this.clearTimer($),this.scheduleTimer($,G,()=>this.closeToast($)),o8.expandedOrOutOfFocus(this.state))this.pauseTimers()}};closeToast=($)=>{let Z=$===void 0,{limit:J,toasts:H}=this.state,B;if(Z)B=H,this.clearTimers();else{let z=o8.toast(this.state,$);if(!z)return;B=[z],this.clearTimer($)}let Q=H.map((z)=>Z||z.id===$?{...z,transitionStatus:"ending",height:0}:z),X=PA(Q,J);this.setToasts(X,!X.some((z)=>z.transitionStatus!=="ending")),B.forEach((z)=>{if(z.transitionStatus!=="ending")z.onClose?.()}),this.handleFocusManagement($)};promiseToast=($,Z)=>{let J=Iz(Z.loading),H=this.addToast({...J,type:"loading"}),B=$.then((Q)=>{let X=Iz(Z.success,Q);return this.updateToast(H,{...X,type:"success",timeout:X.timeout}),Q}).catch((Q)=>{let X=Iz(Z.error,Q);return this.updateToast(H,{...X,type:"error",timeout:X.timeout}),Promise.reject(Q)});if({}.hasOwnProperty.call(Z,"setPromise"))Z.setPromise(B);return B};pauseTimers(){if(this.areTimersPaused)return;this.areTimersPaused=!0,this.timers.forEach(($)=>{if($.timeout)$.timeout.clear(),$.remaining=Math.max($.remaining-(Date.now()-$.start),0)})}resumeTimers(){if(!this.areTimersPaused)return;this.areTimersPaused=!1,this.timers.forEach(($,Z)=>{$.remaining=$.remaining>0?$.remaining:$.delay,$.timeout??=r5.create(),$.timeout.start($.remaining,()=>{this.handleTimerFired(Z),$.callback()}),$.start=Date.now()})}restoreFocusToPrevElement(){this.state.prevFocusElement?.focus({preventScroll:!0})}handleDocumentPointerDown=($)=>{if($.pointerType!=="touch")return;let Z=V1($);if(R0(this.state.viewport,Z))return;this.resumeTimers(),this.update({hovering:!1,focused:!1})};scheduleTimer($,Z,J){let H=Date.now(),Q=!o8.expandedOrOutOfFocus(this.state)?r5.create():void 0;Q?.start(Z,()=>{this.handleTimerFired($),J()}),this.timers.set($,{timeout:Q,start:H,delay:Z,remaining:Z,callback:J})}clearTimers(){this.timers.forEach(($)=>{$.timeout?.clear()}),this.timers.clear(),this.areTimersPaused=!1}clearTimer($){this.timers.get($)?.timeout?.clear(),this.timers.delete($),this.resetPausedStateIfNoTimersRemain()}handleTimerFired($){this.timers.delete($),this.resetPausedStateIfNoTimersRemain()}resetPausedStateIfNoTimersRemain(){if(this.timers.size===0)this.areTimersPaused=!1}setToasts($,Z=$.length===0){let J={toasts:$,toastMetadata:MA($)};if(Z)J.hovering=!1,J.focused=!1;this.update(J)}handleFocusManagement($){let Z=l1(m0(this.state.viewport));if(!this.state.viewport||!R0(this.state.viewport,Z)||!E9(Z))return;if($===void 0){this.restoreFocusToPrevElement();return}let J=o8.toasts(this.state),H=o8.toastIndex(this.state,$),B=(X,z)=>{for(let G=X;G>=0&&G<J.length;G+=z)if(J[G].transitionStatus!=="ending")return J[G];return null},Q=B(H+1,1)??B(H-1,-1);if(Q)Q.ref?.current?.focus();else this.restoreFocusToPrevElement()}}var cz=P(c(),1),fT=function(Z){let{children:J,timeout:H=5000,limit:B=3,toastManager:Q}=Z,X=Z5(()=>new _A({timeout:H,limit:B,viewport:null,toasts:[],hovering:!1,focused:!1,isWindowFocused:!0,prevFocusElement:null})).current;return X6(X.disposeEffect),vT.useEffect(function(){if(!Q)return;return Q[" subscribe"](({action:U,options:Y})=>{let K=Y.id;if(U==="promise"&&Y.promise)X.promiseToast(Y.promise,Y);else if(U==="update"&&K)X.updateToast(K,Y.updates);else if(U==="close")X.closeToast(K);else X.addToast(Y)})},[X,Q]),cz.jsxs(aN.Provider,{value:X,children:[cz.jsx(H00,{store:X,timeout:H,limit:B}),J]})};function H00($){let{store:Z,timeout:J,limit:H}=$;return H0(()=>{Z.syncProviderProps(J,H)},[Z,J,H]),null}var E8=P(m(),1);var gT={clipPath:"inset(50%)",overflow:"hidden",whiteSpace:"nowrap",border:0,padding:0,width:1,height:1,margin:-1},n8={...gT,position:"fixed",top:0,left:0},dz={...gT,position:"absolute"};var lz=P(m(),1);var mT=P(c(),1),c4=lz.forwardRef(function(Z,J){let[H,B]=lz.useState();return H0(()=>{if(J5.screenReader.voiceOver&&J5.engine.webkit)B("button")},[]),mT.jsx("span",{...Z,ref:J,style:n8,"aria-hidden":H?void 0:!0,...{tabIndex:0,role:H},"data-base-ui-focus-guard":""})});var uT="--toast-frontmost-height";var C3=P(c(),1),pT=E8.forwardRef(function(Z,J){let{render:H,className:B,style:Q,children:X,...z}=Z,G=j9(),U=t1(),Y=E8.useRef(!1),K=E8.useRef(!1),F=E8.useRef(!1),W=G.useState("isEmpty"),q=G.useState("toasts"),N=G.useState("focused"),D=G.useState("expanded"),A=G.useState("prevFocusElement"),V=q[0]?.height,L=q.some((f)=>f.transitionStatus==="ending"),O=q.filter((f)=>f.priority==="high");E8.useEffect(()=>{let f=G.state.viewport;if(!f||W)return;let b=I1(f),l=m0(f);function r(o){if(o.key==="F6"&&V1(o)!==f)o.preventDefault(),G.set("prevFocusElement",l1(l)),f?.focus({preventScroll:!0}),G.pauseTimers(),G.set("focused",!0)}function h(o){if(V1(o)!==b)return;G.set("isWindowFocused",!1),G.pauseTimers()}function d(o){if(o.relatedTarget)return;let p=V1(o),i=l1(m0(f));if(p===b||!R0(f,p)||!E9(i))G.resumeTimers();U.start(0,()=>G.set("isWindowFocused",!0))}return E2(a0(b,"keydown",r),a0(b,"blur",h,!0),a0(b,"focus",d,!0),a0(l,"pointerdown",G.handleDocumentPointerDown,!0))},[G,U,W]);function M(f){Y.current=!0;let b=f.relatedTarget===G.state.viewport?q.find((l)=>l.transitionStatus!=="ending"&&!l.limited):void 0;if(b)b.ref?.current?.focus();else G.restoreFocusToPrevElement()}function _(f){if(f.key==="Tab"&&f.shiftKey&&V1(f.nativeEvent)===G.state.viewport)f.preventDefault(),G.restoreFocusToPrevElement()}function w(){if(G.state.toasts.some((b)=>b.transitionStatus==="ending")||F.current||!K.current)return;if(G.state.isWindowFocused)G.resumeTimers();G.set("hovering",!1),K.current=!1}E8.useEffect(w,[L,G]);function C(){G.pauseTimers(),G.set("hovering",!0),K.current=!1}function E(){if(G.state.isWindowFocused)G.resumeTimers()}function j(){K.current=!0,w()}function k(f){if(f.pointerType==="touch")F.current=!0}function S(f){if(f.pointerType!=="touch")return;F.current=!1,w()}function I(){if(Y.current){Y.current=!1;return}if(N)return;if(E9(l1(m0(G.state.viewport))))G.set("focused",!0),G.pauseTimers()}function T(f){if(!N||R0(G.state.viewport,f.relatedTarget))return;G.set("focused",!1),E()}let y={tabIndex:-1,role:"region","aria-live":"polite","aria-atomic":!1,"aria-relevant":"additions text","aria-label":"Notifications",onMouseEnter:C,onMouseMove:C,onMouseLeave:j,onFocus:I,onBlur:T,onKeyDown:_,onClick:I,onPointerDown:k,onPointerUp:S,onPointerCancel:S,style:{[uT]:V?`${V}px`:void 0}},R={expanded:D},x=!W&&A&&C3.jsx(c4,{onFocus:M}),v=G0("div",Z,{ref:[J,G.setViewport],state:R,props:[y,z,{children:C3.jsxs(E8.Fragment,{children:[x,X,x]})}]});return C3.jsxs(E8.Fragment,{children:[x,v,!N&&O.length>0&&C3.jsx("div",{style:n8,children:O.map((f)=>C3.jsxs("div",{role:"alert","aria-atomic":!0,children:[C3.jsx("div",{children:f.title}),C3.jsx("div",{children:f.description})]},f.id))})]})});var L5=P(m(),1),BC=P(U8(),1);function b8($){if(Cz(19))return $;return $?"true":void 0}var iz=P(m(),1),OA=iz.createContext(void 0);function W6(){let $=iz.useContext(OA);if(!$)throw Error(I0(66));return $}var cT=P(m(),1);var jA=P(U8(),1);function s8($){if($==null)return $;return"current"in $?$.current:$}var rz=null;function Q00($){if(!rz){let Z=[];rz=Z,queueMicrotask(()=>{rz=null,jA.flushSync(()=>{for(let J of Z)J()})})}rz.push($)}function d4($,Z=!1,J=!1){let H=C4();return Y0((B,Q=null)=>{H.cancel();let X=s8($);if(X==null)return;let z=X,G=()=>{if(!J){jA.flushSync(B);return}Q00(()=>{if(!Q?.aborted)B()})};if(typeof z.getAnimations!=="function"||globalThis.BASE_UI_ANIMATIONS_DISABLED){B();return}function U(){Promise.all(z.getAnimations().map((Y)=>Y.finished)).then(()=>{if(!Q?.aborted)G()},()=>{if(Q?.aborted)return;if(z.getAnimations().some((K)=>K.pending||K.playState!=="finished")){U();return}G()})}if(Z){let Y=t7;if(!z.hasAttribute(Y)){H.request(U);return}let K=new MutationObserver(()=>{if(!z.hasAttribute(Y))K.disconnect(),U()});K.observe(z,{attributes:!0,attributeFilter:[Y]}),Q?.addEventListener("abort",()=>K.disconnect(),{once:!0});return}H.request(U)})}function V5($){let{enabled:Z=!0,open:J,ref:H,batch:B=!1,onComplete:Q}=$,X=Y0(Q),z=d4(H,J,B);cT.useEffect(()=>{if(!Z)return;let G=new AbortController;return z(X,G.signal),()=>{G.abort()}},[Z,J,X,z])}var dT=500,az=500,lT={style:{transition:"none"}},vZ="data-base-ui-click-trigger";var iT="[data-base-ui-swipe-ignore]",rT="[data-swipe-ignore]",aT={fallbackAxisSide:"none"},S9={fallbackAxisSide:"end"},oT={clipPath:"inset(50%)",position:"fixed",top:0,left:0};var nz=P(m(),1);function w2($,Z=Number.MIN_SAFE_INTEGER,J=Number.MAX_SAFE_INTEGER){return Math.max(Z,Math.min($,J))}function oz($,Z){let J=(Z??I1($).getComputedStyle($)).transform,H=0,B=0,Q=1;if(J&&J!=="none"){let X=J.match(/matrix(?:3d)?\(([^)]+)\)/);if(X){let z=X[1].split(", ").map(parseFloat);if(z.length===6)H=z[4],B=z[5],Q=Math.sqrt(z[0]*z[0]+z[1]*z[1]);else if(z.length===16)H=z[12],B=z[13],Q=z[0]}}return{x:H,y:B,scale:Q}}function sz($,Z,J){switch($){case"up":return-J;case"down":return J;case"left":return-Z;case"right":return Z;default:return 0}}var tz="--toast-index",nT="--toast-offset-y",sT="--toast-height",tT="--toast-swipe-movement-x",eT="--toast-swipe-movement-y";var ZC="data-swipe-direction",hL0=X8.startingStyle,vL0=X8.endingStyle;var QC=P(c(),1),z00={...G2,swipeDirection($){return $?{[ZC]:$}:null}},JC=40,G00=10,HC=0.5,U00=1,Y00=`${iT},${rT}`,XC=L5.forwardRef(function(Z,J){let{toast:H,render:B,className:Q,swipeDirection:X=["down","right"],style:z,...G}=Z,U=H.positionerProps?.anchor!==void 0,Y=[];if(!U)Y=Array.isArray(X)?X:[X];let K=Y.length>0,F=j9(),[W,q]=L5.useState(void 0),[N,D]=L5.useState(!1),[A,V]=L5.useState(!1),[L,O]=L5.useState({x:0,y:0}),[M,_]=L5.useState({x:0,y:0,scale:1}),[w,C]=L5.useState(),[E,j]=L5.useState(),[k,S]=L5.useState(null),I=L5.useRef(null),T=L5.useRef(void 0),y=L5.useRef({x:0,y:0}),R=L5.useRef({x:0,y:0,scale:1}),x=L5.useRef(void 0),v=L5.useRef(0),f=L5.useRef(!1),b=L5.useRef({x:0,y:0}),l=L5.useRef(!1),r=L5.useRef({x:0,y:0}),h=L5.useRef(null),d=L5.useRef(null),o=F.useState("toastIndex",H.id),p=F.useState("toastVisibleIndex",H.id),i=F.useState("toastOffsetY",H.id),n=F.useState("focused"),Z0=F.useState("expanded");V5({open:H.transitionStatus!=="ending",ref:I,onComplete(){if(H.transitionStatus==="ending")F.removeToast(H.id)}});let J0=Y0((P0=!1)=>{let A0=I.current;if(!A0)return;let L0=A0.style.height;A0.style.height="auto";let g=A0.offsetHeight;A0.style.height=L0;function u(){F.updateToastInternal(H.id,{ref:I,height:g,transitionStatus:void 0})}if(P0)BC.flushSync(u);else u()});H0(()=>{let P0=T.current;if(H.transitionStatus!=="starting"&&P0===H.id)return;if(P0!==void 0)q(void 0),_({x:0,y:0,scale:1}),U0({x:0,y:0});T.current=H.id,J0()},[J0,H.id,H.transitionStatus]);function U0(P0){r.current=P0,O(P0)}H0(()=>{return()=>{d.current?.abort()}},[]);function z0(P0,A0){let L0=(e)=>e>0?e**HC:-(Math.abs(e)**HC),g=P0>0&&!Y.includes("right")||P0<0&&!Y.includes("left"),u=A0>0&&!Y.includes("down")||A0<0&&!Y.includes("up");return{x:g?L0(P0):P0,y:u?L0(A0):A0}}let X0=Y0((P0)=>{if(P0.pointerId!==h.current)return;h.current=null,d.current?.abort(),d.current=null,D(!1),V(!1),S(null);let A0=R.current;if(P0.type==="pointercancel"||f.current){U0({x:A0.x,y:A0.y}),q(void 0);return}let L0=r.current,g=L0.x-A0.x,u=L0.y-A0.y,e;for(let W0 of Y)if(sz(W0,g,u)>JC){e=W0;break}if(e)q(e),F.closeToast(H.id);else U0({x:A0.x,y:A0.y}),q(void 0)});function q0(P0){if(P0.button!==0)return;if(P0.pointerType==="touch")F.pauseTimers();if(V1(P0.nativeEvent)?.closest(`button,a,input,textarea,[role="button"],${Y00}`))return;f.current=!1,x.current=void 0,v.current=0,h.current=P0.pointerId,y.current={x:P0.clientX,y:P0.clientY},b.current=y.current;let g=P0.currentTarget,u=oz(g);R.current=u,_(u),U0({x:u.x,y:u.y}),F.set("hovering",!0),D(!0),V(!1),S(null),l.current=!0,d.current?.abort();let e=new AbortController;d.current=e;let W0=m0(g);W0.addEventListener("pointerup",X0,{signal:e.signal}),W0.addEventListener("pointercancel",X0,{signal:e.signal}),g.setPointerCapture?.(P0.pointerId)}function N0(P0){if(P0.pointerId!==h.current)return;if(P0.preventDefault(),l.current)y.current={x:P0.clientX,y:P0.clientY},l.current=!1;let{clientY:A0,clientX:L0,movementX:g,movementY:u}=P0;if(u<0&&A0>b.current.y||u>0&&A0<b.current.y)b.current={x:b.current.x,y:A0};if(g<0&&L0>b.current.x||g>0&&L0<b.current.x)b.current={x:L0,y:b.current.y};let e=L0-y.current.x,W0=A0-y.current.y,S0=A0-b.current.y,h0=L0-b.current.x,v0=k;if(!A){if(Math.sqrt(e*e+W0*W0)>=U00){V(!0);let K1=Y.includes("left")||Y.includes("right"),z5=Y.includes("up")||Y.includes("down");if(K1&&z5){let C0=Math.abs(e),p0=Math.abs(W0);v0=C0>p0?"horizontal":"vertical",S(v0)}}}let T0;if(!x.current){if(v0==="vertical"){if(W0>0)T0="down";else if(W0<0)T0="up"}else if(v0==="horizontal"){if(e>0)T0="right";else if(e<0)T0="left"}else if(Math.abs(e)>=Math.abs(W0))T0=e>0?"right":"left";else T0=W0>0?"down":"up";if(T0&&Y.includes(T0))x.current=T0,v.current=sz(T0,e,W0),q(T0)}else{let S1=x.current,K1=sz(S1,h0,S0);if(K1>JC)f.current=!1,q(S1);else if(!(Y.includes("left")&&Y.includes("right"))&&!(Y.includes("up")&&Y.includes("down"))&&v.current-K1>=G00)f.current=!0}let c0=z0(e,W0),G1=R.current.x,A1=R.current.y,d0=Y.includes("left")||Y.includes("right"),k0=Y.includes("up")||Y.includes("down");if(v0!=="vertical"&&d0)G1+=c0.x;if(v0!=="horizontal"&&k0)A1+=c0.y;U0({x:G1,y:A1})}function F0(P0){if(P0.key==="Escape"){if(!I.current||!R0(I.current,l1(m0(I.current))))return;F.closeToast(H.id)}}L5.useEffect(()=>{let P0=I.current;if(!K||!P0)return;function A0(L0){if(h.current===null||!R0(P0,V1(L0)))return;L0.preventDefault()}return a0(P0,"touchmove",A0,{passive:!1})},[K]);function s(){let P0=L.x-M.x,A0=L.y-M.y;return{transition:N?"none":void 0,transform:N?`translateX(${L.x}px) translateY(${L.y}px) scale(${M.scale})`:void 0,[tT]:`${P0}px`,[eT]:`${A0}px`}}let a=H.priority==="high",$0={role:a?"alertdialog":"dialog",tabIndex:0,"aria-modal":!1,"aria-labelledby":w,"aria-describedby":E,"aria-hidden":a&&!n?!0:void 0,onPointerDown:K?q0:void 0,onPointerMove:K?N0:void 0,onPointerUp:K?X0:void 0,onPointerCancel:K?X0:void 0,onKeyDown:F0,inert:b8(H.limited),style:{...s(),[tz]:H.transitionStatus==="ending"?o:p,[nT]:`${i}px`,[sT]:H.height?`${H.height}px`:void 0}},t=L5.useMemo(()=>({toast:H,setTitleId:C,setDescriptionId:j,recalculateHeight:J0,visibleIndex:p,expanded:Z0}),[H,C,j,J0,p,Z0]),B0={transitionStatus:H.transitionStatus,expanded:Z0,limited:H.limited||!1,type:H.type,swiping:N,swipeDirection:W},_0=G0("div",Z,{ref:[J,I],state:B0,stateAttributesMapping:z00,props:[$0,G]});return QC.jsx(OA.Provider,{value:t,children:_0})});var ez=P(m(),1);var zC=ez.forwardRef(function(Z,J){let{render:H,className:B,style:Q,...X}=Z,{visibleIndex:z,expanded:G,recalculateHeight:U}=W6(),Y=ez.useRef(null);H0(()=>{U();let W=Y.current;if(!W||typeof ResizeObserver!=="function"||typeof MutationObserver!=="function")return;let q=new ResizeObserver(()=>U(!0)),N=new MutationObserver(()=>U(!0));return q.observe(W),N.observe(W,{childList:!0,subtree:!0,characterData:!0}),()=>{q.disconnect(),N.disconnect()}},[U]);let K=z>0;return G0("div",Z,{ref:[J,Y],state:{expanded:G,behind:K},props:X})});var WC=P(m(),1);var $G=P(m(),1);var GC=0;function K00($,Z="mui"){let[J,H]=$G.useState($),B=$||J;return $G.useEffect(()=>{if(J==null)GC+=1,H(`${Z}-${GC}`)},[J,Z]),B}var UC=YC.useId;function E4($,Z){if(UC!==void 0){let J=UC();return $??(Z?`${Z}-${J}`:J)}return K00($,Z)}var KC=P(m(),1);function FC($){if($==null||typeof $==="boolean"||$==="")return!1;if(Array.isArray($))return $.some(FC);return!0}function ZG($){return KC.isValidElement($)&&FC($.props.children)}function JG($,Z,J){let{toast:H,setTitleId:B,setDescriptionId:Q}=W6(),X=J==="title"?B:Q,z=Z??(J==="title"?H.title:H.description);return{id:E4($),children:z,type:H.type,setId:X}}function HG($,Z,J){let H=ZG($);return H0(()=>{if(!H)return;return J(Z),()=>{J((B)=>B===Z?void 0:B)}},[H,Z,J]),H?$:null}var qC=WC.forwardRef(function(Z,J){let{render:H,className:B,style:Q,id:X,children:z,...G}=Z,{id:U,children:Y,type:K,setId:F}=JG(X,z,"description"),q=G0("p",Z,{ref:J,state:{type:K},props:{...G,id:U,children:Y}});return HG(q,U,F)});var NC=P(m(),1);var AC=NC.forwardRef(function(Z,J){let{render:H,className:B,style:Q,id:X,children:z,...G}=Z,{id:U,children:Y,type:K,setId:F}=JG(X,z,"title"),q=G0("h2",Z,{ref:J,state:{type:K},props:{...G,id:U,children:Y}});return HG(q,U,F)});var BG=P(m(),1);var DC=BG.forwardRef(function(Z,J){let{render:H,className:B,style:Q,disabled:X,nativeButton:z=!0,...G}=Z,U=j9(),{toast:Y,expanded:K}=W6(),[F,W]=BG.useState(!1),{getButtonProps:q,buttonRef:N}=w5({disabled:X,native:z}),D={type:Y.type};return G0("button",Z,{ref:[J,N],state:D,props:[{"aria-hidden":!K&&!F,onClick(){U.closeToast(Y.id)},onFocus(){W(!0)},onBlur(){W(!1)}},G,q]})});var VC=P(m(),1);var LC=VC.forwardRef(function(Z,J){let{render:H,className:B,style:Q,disabled:X,nativeButton:z=!0,...G}=Z,{toast:U}=W6(),Y=U.actionProps?.children??G.children,{getButtonProps:K,buttonRef:F}=w5({disabled:X,native:z}),W={type:U.type},q=G0("button",Z,{ref:[J,F],state:W,props:[G,U.actionProps,K,{children:Y}]});return ZG(q)?q:null});var jC=P(m(),1);var zG=P(m(),1),_C=P(U8(),1);var x5=P(m(),1),TA=P(U8(),1);var K0={};I5(K0,{windowResize:()=>i00,wheel:()=>v00,triggerPress:()=>W00,triggerHover:()=>q00,triggerFocus:()=>N00,trackPress:()=>_00,swipe:()=>l00,siblingOpen:()=>m00,scrub:()=>f00,pointer:()=>x00,outsidePress:()=>A00,none:()=>F00,missing:()=>p00,listNavigation:()=>k00,linkPress:()=>L00,keyboard:()=>y00,itemPress:()=>D00,inputPress:()=>w00,inputPaste:()=>b00,inputClear:()=>C00,inputChange:()=>T00,inputBlur:()=>E00,initial:()=>c00,incrementPress:()=>O00,imperativeAction:()=>d00,focusOut:()=>S00,escapeKey:()=>R00,drag:()=>h00,disabled:()=>u00,decrementPress:()=>j00,closeWatcher:()=>I00,closePress:()=>V00,clearPress:()=>M00,chipRemovePress:()=>P00,cancelOpen:()=>g00});var F00="none",W00="trigger-press",q00="trigger-hover",N00="trigger-focus",A00="outside-press",D00="item-press",V00="close-press",L00="link-press",M00="clear-press",P00="chip-remove-press",_00="track-press",O00="increment-press",j00="decrement-press",T00="input-change",C00="input-clear",E00="input-blur",b00="input-paste",w00="input-press",S00="focus-out",R00="escape-key",I00="close-watcher",k00="list-navigation",y00="keyboard",x00="pointer",h00="drag",v00="wheel",f00="scrub",g00="cancel-open",m00="sibling-open",u00="disabled",p00="missing",c00="initial",d00="imperative-action",l00="swipe",i00="window-resize";function w0($,Z,J,H){let B=!1,Q=!1,X=H??D1;return{reason:$,event:Z??new Event("base-ui"),cancel(){B=!0},allowPropagation(){Q=!0},get isCanceled(){return B},get isPropagationAllowed(){return Q},trigger:J,...X}}function QG($,Z,J){let H=J??D1;return{reason:$,event:Z??new Event("base-ui"),...H}}function E3($){return`data-base-ui-${$}`}var B$=P(c(),1),PC=x5.createContext(null),CA=()=>x5.useContext(PC),r00=E3("portal");function XG($={}){let{ref:Z,container:J,componentProps:H=D1,elementProps:B}=$,Q=E4(),z=CA()?.portalNode,[G,U]=x5.useState(null),[Y,K]=x5.useState(null),F=Y0((D)=>{if(D!==null)K(D)}),W=x5.useRef(null);H0(()=>{if(J===null){if(W.current)W.current=null,K(null),U(null);return}let D=(J&&(MC(J)?J:J.current))??z??document.body;if(D==null){if(W.current)W.current=null,K(null),U(null);return}if(W.current!==D)W.current=D,K(null),U(D)},[J,z]);let q=G0("div",H,{ref:[Z,F],props:[{id:Q,[r00]:""},B]}),N=G&&q?TA.createPortal(q,G):null;return{node:Y,nodeId:x5.isValidElement(q)?q.props.id:void 0,subtree:N}}var Q$=x5.forwardRef(function(Z,J){let{render:H,className:B,style:Q,children:X,container:z,portalOwnerRole:G,...U}=Z,{node:Y,nodeId:K,subtree:F}=XG({container:z,ref:J,componentProps:Z,elementProps:U}),W=x5.useRef(null),q=x5.useRef(null),N=x5.useRef(null),D=x5.useRef(null),[A,V]=x5.useState(null),L=x5.useRef(!1),O=A?.modal,M=A?.open,_=!!A&&!A.modal&&A.open&&!!Y;x5.useEffect(()=>{if(!Y||O)return;function C(E){if(Y&&E.relatedTarget&&T3(E))if(E.type==="focusin"){if(L.current)LA(Y),L.current=!1}else hT(Y),L.current=!0}return E2(a0(Y,"focusin",C,!0),a0(Y,"focusout",C,!0))},[Y,O]),H0(()=>{if(!Y||M!==!0||!L.current)return;LA(Y),L.current=!1},[M,Y]);let w=x5.useMemo(()=>({beforeOutsideRef:W,afterOutsideRef:q,beforeInsideRef:N,afterInsideRef:D,portalNode:Y,setFocusManagerState:V}),[Y]);return B$.jsxs(x5.Fragment,{children:[F,B$.jsxs(PC.Provider,{value:w,children:[_&&Y&&B$.jsx(c4,{"data-type":"outside",ref:W,onFocus:(C)=>{if(T3(C,Y))N.current?.focus();else{let E=A?A.domReference:null;pz(E)?.focus()}}}),_&&Y&&B$.jsx("span",{role:G,"aria-owns":K,style:oT}),Y&&TA.createPortal(X,Y),_&&Y&&B$.jsx(c4,{"data-type":"outside",ref:q,onFocus:(C)=>{if(T3(C,Y))D.current?.focus();else{let E=A?A.domReference:null;if(hZ(E)?.focus(),A?.closeOnFocusOut)A?.onOpenChange(!1,w0(K0.focusOut,C.nativeEvent))}}})]})]})});var OC=P(c(),1),fZ=zG.forwardRef(function(Z,J){let{children:H,container:B,className:Q,render:X,style:z,...G}=Z,{node:U,subtree:Y}=XG({container:B,ref:J,componentProps:Z,elementProps:G});if(!Y&&!U)return null;return OC.jsxs(zG.Fragment,{children:[Y,U&&_C.createPortal(H,U)]})});var TC=P(c(),1),CC=jC.forwardRef(function(Z,J){return TC.jsx(fZ,{ref:J,...Z})});var RG=P(m(),1);var Y8=P(m(),1);function W5($){let Z=Z5(a00,$).current;return Z.next=$,H0(Z.effect),Z}function a00($){let Z={current:$,next:$,effect:()=>{Z.current=Z.next}};return Z}var b4=P(m(),1);function o00($,Z){if(Z!=null&&!G8(Z))return 0;if(typeof $==="function")return $();return $}function t8($,Z,J){let H=o00($,J);if(typeof H==="number")return H;return H?.[Z]}function EA($){if(typeof $==="function")return $();return $}function GG($,Z){return Z||$==="click"||$==="mousedown"}function EC($){return $?.includes("mouse")&&$!=="mousedown"}var bC=P(c(),1),wC=b4.createContext({hasProvider:!1,timeoutMs:0,delayRef:{current:0},initialDelayRef:{current:0},timeout:new r5,currentIdRef:{current:null},currentContextRef:{current:null}});function n00($,Z){$.current=Z.current}function bA($){let{children:Z,delay:J,timeoutMs:H=0}=$,B=b4.useRef(J),Q=b4.useRef(J),X=b4.useRef(null),z=b4.useRef(null),G=t1();return H0(()=>{if(Q.current=J,!X.current){B.current=J;return}B.current={open:t8(B.current,"open"),close:t8(J,"close")}},[J,X,B,Q]),bC.jsx(wC.Provider,{value:b4.useMemo(()=>({hasProvider:!0,delayRef:B,initialDelayRef:Q,currentIdRef:X,timeoutMs:H,currentContextRef:z,timeout:G}),[H,G]),children:Z})}function wA($,Z={open:!1}){let{open:J}=Z,H="rootStore"in $?$.rootStore:$,B=H.useState("floatingId"),Q=b4.useContext(wC),{currentIdRef:X,delayRef:z,timeoutMs:G,initialDelayRef:U,currentContextRef:Y,hasProvider:K,timeout:F}=Q,[W,q]=b4.useState(!1),N=b4.useRef(J);return H0(()=>{N.current=J},[J]),H0(()=>{function D(){Y.current?.setIsInstantPhase(!1),X.current=null,Y.current=null,z.current=U.current,F.clear()}if(!X.current)return;if(!J&&X.current===B){if(q(!1),G){let A=B;return F.start(G,()=>{if(H.select("open")||X.current&&X.current!==A)return;D()}),()=>{if(N.current||X.current!==A)F.clear()}}D()}return},[J,B,X,z,G,U,Y,F,H]),H0(()=>{if(!J)return;let D=Y.current,A=X.current;if(F.clear(),Y.current={onOpenChange:H.setOpen,setIsInstantPhase:q},X.current=B,z.current={open:0,close:t8(U.current,"close")},A!==null&&A!==B)q(!0),D?.setIsInstantPhase(!0),D?.onOpenChange(!1,w0(K0.none));else q(!1),D?.setIsInstantPhase(!1)},[J,B,H,X,z,U,Y,F]),H0(()=>{return()=>{if(X.current===B){if(Y.current=null,!N.current)return;X.current=null,n00(z,U),F.clear()}}},[Y,X,z,B,U,F]),b4.useMemo(()=>({activeIdRef:X,hasProvider:K,delayRef:z,isInstantPhase:W}),[X,K,z,W])}var Q4=P(m(),1);var UG=0;function gZ($,Z={}){let{preventScroll:J=!1,sync:H=!1,shouldFocus:B}=Z;cancelAnimationFrame(UG);function Q(){if(B&&!B())return;$?.focus({preventScroll:J})}if(H)return Q(),U1;let X=requestAnimationFrame(Q);return UG=X,()=>{if(UG===X)cancelAnimationFrame(X),UG=0}}var SA={inert:new WeakMap,"aria-hidden":new WeakMap},SC="data-base-ui-inert",IA={inert:new WeakSet,"aria-hidden":new WeakSet},PB=new WeakMap,RA=0;function s00($){return IA[$]}function yC($){if(!$)return null;return G6($)?$.host:yC($.parentNode)}var RC=($,Z)=>Z.map((J)=>{if($.contains(J))return J;let H=yC(J);if($.contains(H))return H;return null}).filter((J)=>J!=null),IC=($)=>{let Z=new Set;return $.forEach((J)=>{let H=J;while(H&&!Z.has(H))Z.add(H),H=H.parentNode}),Z},kC=($,Z,J)=>{let H=[],B=(Q)=>{if(!Q||J.has(Q))return;Array.from(Q.children).forEach((X)=>{if(b2(X)==="script")return;if(Z.has(X))B(X);else H.push(X)})};return B($),H};function t00($,Z,J,H,{mark:B=!0}){let Q=null;if(H)Q="inert";else if(J)Q="aria-hidden";let X=null,z=null,G=RC(Z,$),U=B?kC(Z,IC(G),new Set(G)):[],Y=[],K=[];if(Q){let F=SA[Q],W=s00(Q);z=W,X=F;let q=RC(Z,Array.from(Z.querySelectorAll("[aria-live]"))),N=G.concat(q);kC(Z,IC(N),new Set(N)).forEach((A)=>{let V=A.getAttribute(Q),L=V!==null&&V!=="false",O=(F.get(A)||0)+1;if(F.set(A,O),Y.push(A),O===1&&L)W.add(A);if(!L)A.setAttribute(Q,Q==="inert"?"":"true")})}if(B)U.forEach((F)=>{let W=(PB.get(F)||0)+1;if(PB.set(F,W),K.push(F),W===1)F.setAttribute(SC,"")});return RA+=1,()=>{if(X)Y.forEach((F)=>{let q=(X.get(F)||0)-1;if(X.set(F,q),!q){if(!z?.has(F)&&Q)F.removeAttribute(Q);z?.delete(F)}});if(B)K.forEach((F)=>{let W=(PB.get(F)||0)-1;if(PB.set(F,W),!W)F.removeAttribute(SC)});if(RA-=1,!RA)SA.inert=new WeakMap,SA["aria-hidden"]=new WeakMap,IA.inert=new WeakSet,IA["aria-hidden"]=new WeakSet,PB=new WeakMap}}function kA($,Z={}){let{ariaHidden:J=!1,inert:H=!1,mark:B=!0}=Z,Q=m0($[0]).body;return t00($,Q,J,H,{mark:B})}var q6=P(m(),1);function YG(){let $=new Map;return{emit(Z,J){$.get(Z)?.forEach((H)=>H(J))},on(Z,J){if(!$.has(Z))$.set(Z,new Set);$.get(Z).add(J)},off(Z,J){$.get(Z)?.delete(J)}}}class X${nodesRef={current:[]};events=YG();addNode($){this.nodesRef.current.push($)}removeNode($){let Z=this.nodesRef.current.findIndex((J)=>J===$);if(Z!==-1)this.nodesRef.current.splice(Z,1)}}var yA=P(c(),1),xC=q6.createContext(null),hC=q6.createContext(null),w4=()=>q6.useContext(xC)?.id||null,B4=($)=>{let Z=q6.useContext(hC);return $??Z};function b3($){let Z=E4(),J=B4($),H=w4();return H0(()=>{if(!Z)return;let B={id:Z,parentId:H};return J?.addNode(B),()=>{J?.removeNode(B)}},[J,Z,H]),Z}function z$($){let{children:Z,id:J}=$,H=w4();return yA.jsx(xC.Provider,{value:q6.useMemo(()=>({id:J,parentId:H}),[J,H]),children:Z})}function G$($){let{children:Z,externalTree:J}=$,H=Z5(()=>J??new X$).current;return yA.jsx(hC.Provider,{value:H,children:Z})}var _B=P(c(),1);function e00($,Z){let J=I1(V1($));if($ instanceof J.KeyboardEvent)return"keyboard";if($ instanceof J.FocusEvent)return Z||"keyboard";if("pointerType"in $)return $.pointerType||"keyboard";if("touches"in $)return"touch";if($ instanceof J.MouseEvent)return Z||($.detail===0?"keyboard":"mouse");return""}var vC=20,N6=[];function xA(){N6=N6.filter(($)=>{return $.deref()?.isConnected})}function fC($){if(xA(),$&&b2($)!=="body"){if(N6.push(new WeakRef($)),N6.length>vC)N6=N6.slice(-vC)}}function gC(){return xA(),N6[N6.length-1]?.deref()}function $10($){if(!$)return null;if(uz($))return $;return xZ($)[0]||$}function mC($){if($.hasAttribute("tabindex")&&!$.hasAttribute("data-tabindex"))return;if(!$.getAttribute("role")?.includes("dialog"))return;let J=VA($).filter((B)=>{let Q=B.getAttribute("data-tabindex")||"";return uz(B)||B.hasAttribute("data-tabindex")&&!Q.startsWith("-")}),H=$.getAttribute("tabindex");if(J.length===0){if(H!=="0")$.setAttribute("tabindex","0"),$.setAttribute("data-tabindex","0")}else if(H!=="-1"||$.hasAttribute("data-tabindex")&&$.getAttribute("data-tabindex")!=="-1")$.setAttribute("tabindex","-1"),$.setAttribute("data-tabindex","-1")}function U$($){let{context:Z,children:J,disabled:H=!1,initialFocus:B=!0,returnFocus:Q=!0,restoreFocus:X=!1,modal:z=!0,closeOnFocusOut:G=!0,openInteractionType:U="",nextFocusableElement:Y,previousFocusableElement:K,beforeContentFocusGuardRef:F,externalTree:W,getInsideElements:q}=$,N="rootStore"in Z?Z.rootStore:Z,D=N.useState("open"),A=N.useState("domReferenceElement"),V=N.useState("floatingElement"),{events:L,dataRef:O}=N.context,M=Y0(()=>O.current.floatingContext?.nodeId),_=B===!1,w=NB(A)&&_,C=W5(B),E=W5(Q),j=W5(U),k=W5(D),S=B4(W),I=CA(),T=Q4.useRef(!1),y=Q4.useRef(!1),R=Q4.useRef(!1),x=Q4.useRef(null),v=Q4.useRef(""),f=Q4.useRef(""),b=Q4.useRef(null),l=Q4.useRef(null),r=p2(b,F,I?.beforeInsideRef),h=p2(l,I?.afterInsideRef),d=t1(),o=t1(),p=C4(),i=I!=null,n=AB(V),Z0=Y0((z0=n)=>{return z0?xZ(z0):[]}),J0=Y0(()=>q?.().filter((z0)=>z0!=null)??[]);Q4.useEffect(()=>{if(H||!z)return;function z0(q0){if(q0.key==="Tab"){if(R0(n,l1(m0(n)))&&Z0().length===0&&!w)u4(q0)}}let X0=m0(n);return a0(X0,"keydown",z0)},[H,n,z,w,Z0]),Q4.useEffect(()=>{if(H||!D)return;let z0=m0(n);function X0(){R.current=!1}function q0(F0){let s=V1(F0),a=J0(),$0=R0(V,s)||R0(A,s)||R0(I?.portalNode,s)||a.some((t)=>t===s||R0(t,s));if(R.current=!$0,f.current=F0.pointerType||"keyboard",s?.closest(`[${vZ}]`))y.current=!0,o.start(0,()=>{y.current=!1})}function N0(){f.current="keyboard"}return E2(a0(z0,"pointerdown",q0,!0),a0(z0,"pointerup",X0,!0),a0(z0,"pointercancel",X0,!0),a0(z0,"keydown",N0,!0),X0)},[H,V,A,n,D,I,o,J0]),Q4.useEffect(()=>{if(H||!G)return;let z0=m0(n);function X0(){y.current=!0,o.start(0,()=>{y.current=!1})}function q0(a){let $0=V1(a);if(uz($0))x.current=$0}function N0(a){let{relatedTarget:$0,currentTarget:t}=a,B0=V1(a);if(z&&$0==null&&B0!=null&&R0(V,B0))fC(B0);queueMicrotask(()=>{let _0=M(),P0=N.context.triggerElements,A0=J0(),L0=$0?.hasAttribute(E3("focus-guard"))&&[b.current,l.current,I?.beforeInsideRef.current,I?.afterInsideRef.current,I?.beforeOutsideRef.current,I?.afterOutsideRef.current,s8(K),s8(Y)].includes($0),g=!(R0(A,$0)||R0(V,$0)||R0($0,V)||R0(I?.portalNode,$0)||A0.some((u)=>u===$0||R0(u,$0))||P0.hasMatchingElement((u)=>R0(u,$0))||L0||S&&(j8(S.nodesRef.current,_0).find((u)=>R0(u.context?.elements.floating,$0)||R0(u.context?.elements.domReference,$0))||NA(S.nodesRef.current,_0).find((u)=>[u.context?.elements.floating,AB(u.context?.elements.floating)].includes($0)||u.context?.elements.domReference===$0)));if(t===A&&n)mC(n);if(X&&t!==A&&!H$(B0)&&l1(z0)===z0.body){if(L1(n)){if(n.focus(),X==="popup"){p.request(()=>{n.focus()});return}}let u=Z0(),e=x.current,W0=(e&&u.includes(e)?e:null)||u[u.length-1]||n;if(L1(W0))W0.focus()}if(O.current.insideReactTree){O.current.insideReactTree=!1;return}if((w?!0:!z)&&$0&&g&&!y.current&&(w||$0!==gC()))T.current=!0,N.setOpen(!1,w0(K0.focusOut,a))})}function F0(){if(R.current)return;O.current.insideReactTree=!0,d.start(0,()=>{O.current.insideReactTree=!1})}let s=L1(A)?A:null;if(!V&&!s)return;return E2(s&&a0(s,"focusout",N0),s&&a0(s,"pointerdown",X0),V&&a0(V,"focusin",q0),V&&a0(V,"focusout",N0),V&&I&&a0(V,"focusout",F0,!0))},[H,A,V,n,z,S,I,N,G,X,Z0,w,M,O,d,o,p,Y,K,J0]),Q4.useEffect(()=>{if(H||!V||!D)return;let z0=Array.from(I?.portalNode?.querySelectorAll(`[${E3("portal")}]`)||[]),q0=(S?NA(S.nodesRef.current,M()):[]).find((t)=>NB(t.context?.elements.domReference||null))?.context?.elements.domReference,F0=[...[V,...z0,b.current,l.current,I?.beforeOutsideRef.current,I?.afterOutsideRef.current,...J0()],q0,s8(K),s8(Y),w?A:null].filter((t)=>t!=null),s=kA(F0,{ariaHidden:z||w,mark:!1}),a=[V,...z0].filter((t)=>t!=null),$0=kA(a);return()=>{$0(),s()}},[D,H,A,V,z,I,w,S,M,Y,K,J0]),H0(()=>{if(!D||H||!L1(n))return;v.current="",f.current="";let z0=m0(n),X0=l1(z0);queueMicrotask(()=>{let q0=C.current,N0=typeof q0==="function"?q0(j.current||""):q0;if(N0===void 0||N0===!1)return;if(R0(n,X0))return;let s=null,a=()=>{if(s==null)s=Z0(n);return s[0]||n},$0;if(N0===!0||N0===null)$0=a();else $0=s8(N0);$0=$0||a();let t=R0(n,l1(z0));gZ($0,{preventScroll:$0===n,shouldFocus(){if(!k.current)return!1;if(t)return!0;let B0=l1(z0);return!(B0!==$0&&R0(n,B0))}})})},[H,D,n,Z0,C,j,k]),H0(()=>{if(H||!n)return;let z0=m0(n),X0=l1(z0),q0=j.current==null;fC(X0);function N0(s){if(!s.open)v.current=e00(s.nativeEvent,f.current);if(s.reason===K0.triggerHover&&s.nativeEvent.type==="mouseleave")T.current=!0;if(s.reason!==K0.outsidePress)return;if(s.nested)T.current=!1;else if(IZ(s.nativeEvent)||kZ(s.nativeEvent))T.current=!1;else{let a=!1;if(m0(n).createElement("div").focus({get preventScroll(){return a=!0,!1}}),a)T.current=!1;else T.current=!0}}L.on("openchange",N0);function F0(s){let a=E.current,$0=typeof a==="function"?a(s):a;if($0===void 0||$0===!1)return null;if($0===null)$0=!0;let t=A?.isConnected?A:null,B0=X0?.isConnected&&b2(X0)!=="body"?X0:null,_0=q0?B0||t:t||B0;if(!_0)_0=gC()||null;if(typeof $0==="boolean")return _0;return s8($0)||_0||null}return()=>{L.off("openchange",N0);let s=l1(z0),a=J0(),$0=R0(V,s)||a.some((P0)=>P0===s||R0(P0,s))||S&&j8(S.nodesRef.current,M(),!1).some((P0)=>R0(P0.context?.elements.floating,s)),t=E.current,B0=v.current,_0=F0(B0);queueMicrotask(()=>{let P0=$10(_0),A0=typeof t!=="boolean";if(t&&!T.current&&L1(P0)&&(!A0&&P0!==s&&s!==z0.body?$0:!0)){let L0={preventScroll:!0};if(B0==="keyboard")L0.focusVisible=!0;P0.focus(L0)}T.current=!1})}},[H,V,n,E,j,L,S,A,M,J0]),H0(()=>{if(!J5.engine.webkit||D||!V)return;let z0=l1(m0(V));if(!L1(z0)||!$$(z0))return;if(R0(V,z0))z0.blur()},[D,V]),H0(()=>{if(H||!I)return;return I.setFocusManagerState({modal:z,closeOnFocusOut:G,open:D,onOpenChange:N.setOpen,domReference:A}),()=>{I.setFocusManagerState(null)}},[H,I,z,D,N,G,A]),H0(()=>{if(H||!n)return;return mC(n),()=>{queueMicrotask(xA)}},[H,n]);let U0=!H&&(z?!w:!0)&&(i||z);return _B.jsxs(Q4.Fragment,{children:[U0&&_B.jsx(c4,{"data-type":"inside",ref:r,onFocus:(z0)=>{if(z){let X0=Z0();gZ(X0[X0.length-1])}else if(I?.portalNode)if(T.current=!1,T3(z0,I.portalNode))hZ(A)?.focus();else s8(K??I.beforeOutsideRef)?.focus()}}),J,U0&&_B.jsx(c4,{"data-type":"inside",ref:h,onFocus:(z0)=>{if(z)gZ(Z0()[0]);else if(I?.portalNode){if(G)T.current=!0;if(T3(z0,I.portalNode))pz(A)?.focus();else s8(Y??I.afterOutsideRef)?.focus()}}})]})}var OB=P(m(),1);function w3($,Z={}){let{enabled:J=!0,event:H="click",toggle:B=!0,ignoreMouse:Q=!1,stickIfOpen:X=!0,touchOpenDelay:z=0,reason:G=K0.triggerPress}=Z,U="rootStore"in $?$.rootStore:$,Y=U.context.dataRef,K=OB.useRef(void 0),F=C4(),W=t1(),q=OB.useMemo(()=>{function N(A,V,L,O){let M=w0(G,V,L);if(A&&O==="touch"&&z>0)W.start(z,()=>{U.setOpen(!0,M)});else U.setOpen(A,M)}function D(A,V,L){let O=Y.current.openEvent,M=U.select("domReferenceElement")!==V;if(A&&M)return!0;if(!A)return!0;if(!B)return!0;if(O&&X)return!L(O.type);return!1}return{onPointerDown(A){K.current=G8(A.pointerType,!0)&&kZ(A.nativeEvent)?"virtual":A.pointerType},onMouseDown(A){let V=K.current,L=A.nativeEvent,O=U.select("open");if(A.button!==0||H==="click"||G8(V,!0)&&Q)return;let M=D(O,A.currentTarget,(C)=>C==="click"||C==="mousedown"),_=V1(L);if($$(_)){N(M,L,_,V);return}let w=A.currentTarget;F.request(()=>{N(M,L,w,V)})},onClick(A){if(H==="mousedown-only")return;let V=K.current;if(H==="mousedown"&&V){K.current=void 0;return}if(G8(V,!0)&&Q)return;let L=U.select("open"),O=D(L,A.currentTarget,(M)=>M==="click"||M==="mousedown"||M==="keydown"||M==="keyup");N(O,A.nativeEvent,A.currentTarget,V)},onKeyDown(){K.current=void 0}}},[Y,H,Q,G,U,X,B,F,W,z]);return OB.useMemo(()=>J?{reference:q}:D1,[J,q])}var l4=P(m(),1);function Z10($,Z){let J=null,H=null,B=!1;return{contextElement:$||void 0,getBoundingClientRect(){let Q=$?.getBoundingClientRect()||{width:0,height:0,x:0,y:0},X=Z.axis==="x"||Z.axis==="both",z=Z.axis==="y"||Z.axis==="both",G=["mouseenter","mousemove"].includes(Z.dataRef.current.openEvent?.type||"")&&Z.pointerType!=="touch",U=Q.width,Y=Q.height,K=Q.x,F=Q.y;if(J==null&&Z.x&&X)J=Q.x-Z.x;if(H==null&&Z.y&&z)H=Q.y-Z.y;if(K-=J||0,F-=H||0,U=0,Y=0,!B||G)U=Z.axis==="y"?Q.width:0,Y=Z.axis==="x"?Q.height:0,K=X&&Z.x!=null?Z.x:K,F=z&&Z.y!=null?Z.y:F;else if(B&&!G)Y=Z.axis==="x"?Q.height:Y,U=Z.axis==="y"?Q.width:U;return B=!0,{width:U,height:Y,x:K,y:F,top:F,right:K+U,bottom:F+Y,left:K}}}}function uC($){return $!=null&&$.clientX!=null}function hA($,Z={}){let{enabled:J=!0,axis:H="both"}=Z,B="rootStore"in $?$.rootStore:$,Q=B.useState("open"),X=B.useState("floatingElement"),z=B.useState("domReferenceElement"),G=B.context.dataRef,U=l4.useRef(!1),Y=l4.useRef(null),[K,F]=l4.useState(),[W,q]=l4.useState([]),N=Y0((O)=>{B.set("positionReference",O)}),D=Y0((O,M,_)=>{if(U.current)return;if(G.current.openEvent&&!uC(G.current.openEvent))return;B.set("positionReference",Z10(_??z,{x:O,y:M,axis:H,dataRef:G,pointerType:K}))}),A=Y0((O)=>{if(!Q)D(O.clientX,O.clientY,O.currentTarget);else if(!Y.current)D(O.clientX,O.clientY,O.currentTarget),q([])}),V=G8(K)?X:Q;l4.useEffect(()=>{if(!J){N(z);return}if(!V)return;function O(){Y.current?.(),Y.current=null}let M=I1(X);function _(w){let C=V1(w);if(!R0(X,C))D(w.clientX,w.clientY);else O()}if(!G.current.openEvent||uC(G.current.openEvent))Y.current=a0(M,"mousemove",_);else N(z);return O},[V,J,X,G,z,B,D,N,W]),l4.useEffect(()=>()=>{B.set("positionReference",null)},[B]),l4.useEffect(()=>{if(J&&!X)U.current=!1},[J,X]),l4.useEffect(()=>{if(!J&&Q)U.current=!0},[J,Q]);let L=l4.useMemo(()=>{function O(M){F(M.pointerType)}return{onPointerDown:O,onPointerEnter:O,onMouseMove:A,onMouseEnter:A}},[A]);return l4.useMemo(()=>J?{reference:L,trigger:L}:{},[J,L])}var S4=P(m(),1);function J10(){return!1}function H10($){return{escapeKey:typeof $==="boolean"?$:$?.escapeKey??!1,outsidePress:typeof $==="boolean"?$:$?.outsidePress??!0}}function e8($,Z={}){let{enabled:J=!0,escapeKey:H=!0,outsidePress:B=!0,outsidePressEvent:Q="sloppy",referencePress:X=J10,bubbles:z,externalTree:G}=Z,U="rootStore"in $?$.rootStore:$,Y=U.useState("open"),K=U.useState("floatingElement"),{dataRef:F,events:W}=U.context,q=B4(G),N=Y0(typeof B==="function"?B:()=>!1),D=typeof B==="function"?N:B,A=D!==!1,V=Y0(()=>Q),{escapeKey:L,outsidePress:O}=H10(z),M=S4.useRef(!1),_=S4.useRef(!1),w=S4.useRef(!1),C=S4.useRef(!1),E=S4.useRef(!1),j=S4.useRef(""),k=S4.useRef(null),S=t1(),I=t1(),T=Y0(()=>{I.clear(),F.current.insideReactTree=!1}),y=Y0((d)=>{let o=F.current.floatingContext?.nodeId;return(q?j8(q.nodesRef.current,o):[]).some((i)=>i.context?.open&&!i.context.dataRef.current[d])}),R=Y0((d)=>{return hz(d,U.select("floatingElement"))||hz(d,U.select("domReferenceElement"))}),x=Y0((d)=>{if(!X())return;U.setOpen(!1,w0(K0.triggerPress,d.nativeEvent))}),v=Y0((d)=>{if(!Y||!J||!H||d.key!=="Escape")return;if(E.current)return;if(!L&&y("__escapeKeyBubbles"))return;let o=LT(d)?d.nativeEvent:d,p=w0(K0.escapeKey,o);if(U.setOpen(!1,p),!p.isCanceled)d.preventDefault();if(!L&&!p.isPropagationAllowed)d.stopPropagation()}),f=Y0(()=>{F.current.insideReactTree=!0,I.start(0,T)}),b=Y0((d)=>{if(!Y||!J||d.button!==0)return;let o=V1(d.nativeEvent);if(!R0(U.select("floatingElement"),o))return;if(!M.current)M.current=!0,_.current=!1}),l=Y0((d)=>{if(!Y||!J)return;if(!(d.defaultPrevented||d.nativeEvent.defaultPrevented))return;if(M.current)_.current=!0});S4.useEffect(()=>{function d(o){if(!o.open)C.current=!1}return W.on("openchange",d),()=>{W.off("openchange",d)}},[W]),S4.useEffect(()=>{if(!Y||!J){if(!Y)C.current=!1;return T}F.current.__escapeKeyBubbles=L,F.current.__outsidePressBubbles=O;let d=new r5,o=new r5,p=m0(K);function i(){d.clear(),E.current=!0}function n(){d.start(J5.engine.webkit?5:0,()=>{E.current=!1})}function Z0(){w.current=!0,o.start(0,()=>{w.current=!1})}function J0(){M.current=!1,_.current=!1}function U0(){let g=j.current,u=g==="pen"||!g?"mouse":g,e=V(),W0=typeof e==="function"?e():e;if(typeof W0==="string")return W0;return W0[u]}function z0(g){let u=U0();return u==="intentional"&&g.type!=="click"||u==="sloppy"&&g.type==="click"}function X0(g){let u=F.current.floatingContext?.nodeId,e=q&&j8(q.nodesRef.current,u).some((W0)=>hz(g,W0.context?.elements.floating));return R(g)||e}function q0(g){if(z0(g)){if(g.type!=="click"&&!R(g))o.clear(),w.current=!1;T();return}if(F.current.insideReactTree){T();return}let u=V1(g),e=`[${E3("inert")}]`,W0=n0(u)?u.getRootNode():null,S0=Array.from((G6(W0)?W0:m0(U.select("floatingElement"))).querySelectorAll(e)),h0=U.context.triggerElements;if(u&&(h0.hasElement(u)||h0.hasMatchingElement((T0)=>R0(T0,u))))return;let v0=n0(u)?u:null;while(v0&&!w8(v0)){let T0=S8(v0);if(w8(T0)||!n0(T0))break;v0=T0}if(S0.length&&n0(u)&&!VT(u)&&!R0(u,U.select("floatingElement"))&&S0.every((T0)=>!R0(v0,T0)))return;if(L1(u)&&!("touches"in g)){let T0=w8(u),c0=u2(u),G1=/auto|scroll/,A1=T0||G1.test(c0.overflowX),d0=T0||G1.test(c0.overflowY),k0=A1&&u.clientWidth>0&&u.scrollWidth>u.clientWidth,S1=d0&&u.clientHeight>0&&u.scrollHeight>u.clientHeight,K1=c0.direction==="rtl",z5=S1&&(K1?g.offsetX<=u.offsetWidth-u.clientWidth:g.offsetX>u.clientWidth),C0=k0&&g.offsetY>u.clientHeight;if(z5||C0)return}if(X0(g))return;if(U0()==="intentional"){if(g.detail!==0&&!IZ(g)&&!C.current)return;if(w.current){o.clear(),w.current=!1;return}}if(typeof D==="function"&&!D(g))return;if(y("__outsidePressBubbles"))return;U.setOpen(!1,w0(K0.outsidePress,g)),T()}function N0(g){if(U0()!=="sloppy"||g.pointerType==="touch"||!U.select("open")||!J||R(g))return;q0(g)}function F0(g){if(U0()!=="sloppy"||!U.select("open")||!J||R(g))return;let u=g.touches[0];if(u)k.current={startTime:Date.now(),startX:u.clientX,startY:u.clientY,dismissOnTouchEnd:!1,dismissOnMouseDown:!0},S.start(1000,()=>{if(k.current)k.current.dismissOnTouchEnd=!1,k.current.dismissOnMouseDown=!1})}function s(g,u){let e=V1(g);if(!e)return;let W0=a0(e,g.type,()=>{u(g),W0()})}function a(g){j.current="touch",s(g,F0)}function $0(g){if(S.clear(),g.type==="pointerdown"){if(g.button===0)C.current=!0;j.current=g.pointerType}if(g.type==="mousedown"&&k.current&&!k.current.dismissOnMouseDown)return;s(g,(u)=>{if(u.type==="pointerdown")N0(u);else q0(u)})}function t(g){if(g.type==="pointercancel")C.current=!1;if(!M.current)return;let u=_.current;if(J0(),U0()!=="intentional")return;if(g.type==="pointercancel"){if(u)Z0();return}if(X0(g))return;if(u){Z0();return}if(typeof D==="function"&&!D(g))return;o.clear(),w.current=!0,T()}function B0(g){if(U0()!=="sloppy"||!k.current||R(g))return;let u=g.touches[0];if(!u)return;let e=Math.abs(u.clientX-k.current.startX),W0=Math.abs(u.clientY-k.current.startY),S0=Math.sqrt(e*e+W0*W0);if(S0>5)k.current.dismissOnTouchEnd=!0;if(S0>10)q0(g),S.clear(),k.current=null}function _0(g){s(g,B0)}function P0(g){if(U0()!=="sloppy"||!k.current||R(g))return;if(k.current.dismissOnTouchEnd)q0(g);S.clear(),k.current=null}function A0(g){s(g,P0)}let L0=E2(H&&E2(a0(p,"keydown",v),a0(p,"compositionstart",i),a0(p,"compositionend",n)),A&&E2(a0(p,"click",$0,!0),a0(p,"pointerdown",$0,!0),a0(p,"pointerup",t,!0),a0(p,"pointercancel",t,!0),a0(p,"mousedown",$0,!0),a0(p,"mouseup",t,!0),a0(p,"touchstart",a,{capture:!0,passive:!0}),a0(p,"touchmove",_0,{capture:!0,passive:!0}),a0(p,"touchend",A0,{capture:!0,passive:!0})));return()=>{L0(),d.clear(),o.clear(),J0(),w.current=!1,T()}},[F,K,H,A,D,Y,J,L,O,v,T,V,y,R,q,U,S]);let r=S4.useMemo(()=>({onKeyDown:v,onPointerDown:x,onClick:x}),[v,x]),h=S4.useMemo(()=>({onKeyDown:v,onPointerDown:l,onMouseDown:l,onClickCapture:f,onMouseDownCapture(d){f(),b(d)},onPointerDownCapture(d){f(),b(d)},onMouseUpCapture:f,onTouchEndCapture:f,onTouchMoveCapture:f}),[v,f,b,l]);return S4.useMemo(()=>J?{reference:r,floating:h,trigger:r}:{},[J,r,h])}function KG($,Z,J,H){return{left:$,top:Z,right:J,bottom:H,x:$,y:Z,width:J-$,height:H-Z}}function B10($){return{left:$.left,top:$.top,right:$.right,bottom:$.bottom,width:$.width,height:$.height}}function cC($){let Z=[],J,H=Number.POSITIVE_INFINITY,B=Number.POSITIVE_INFINITY,Q=Number.NEGATIVE_INFINITY,X=Number.NEGATIVE_INFINITY;for(let z of Array.from($).sort((G,U)=>G.top-U.top)){if(H=Math.min(H,z.left),B=Math.min(B,z.top),Q=Math.max(Q,z.right),X=Math.max(X,z.bottom),!J||z.top-J.top>J.height/2)Z.push(B10(z));else{let G=Z[Z.length-1];G.left=Math.min(G.left,z.left),G.right=Math.max(G.right,z.right),G.bottom=Math.max(G.bottom,z.bottom),G.width=G.right-G.left,G.height=G.bottom-G.top}J=z}return{lines:Z,fallback:KG(H,B,Q,X)}}function dC($,Z,J){return $.findIndex((H)=>Z>H.left-2&&Z<H.right+2&&J>H.top-2&&J<H.bottom+2)}function pC($){return KG($.left,$.top,$.right,$.bottom)}function Q10($,Z,J){let{lines:H}=cC($.getClientRects());if(H.length<2)return;let B=dC(H,Z,J);return{x:Z,y:J,lineIndex:B===-1?void 0:B,element:$}}function X10($,Z,J){let{lines:H,fallback:B}=cC($.getClientRects());if(H.length<2)return null;let Q=J?.x,X=J?.y,z=Z[0];if(J?.lineIndex!=null&&H[J.lineIndex])return pC(H[J.lineIndex]);if(Q!=null&&X!=null){let q=dC(H,Q,X);if(q!==-1)return pC(H[q])}if(H.length===2&&H[0].left>H[1].right&&Q!=null&&X!=null)return B;if(z==="t"||z==="b"){let q=H[0],N=H[H.length-1],D=z==="t"?q:N;return KG(D.left,q.top,D.right,N.bottom)}let G=z==="l",U=H[0].left,Y=H[0].right,K=G?Number.POSITIVE_INFINITY:Number.NEGATIVE_INFINITY,F=H[0],W=H[0];for(let q of H){U=Math.min(U,q.left),Y=Math.max(Y,q.right);let N=G?q.left:q.right;if(G&&N<K||!G&&N>K)K=N,F=q,W=q;else if(N===K)W=q}return KG(U,F.top,Y,W.bottom)}function z10($){if("contextElement"in $&&$.contextElement)return $.contextElement;return n0($)?$:void 0}function lC($,Z){function J(B){vA($,B.currentTarget,B.clientX,B.clientY)}function H(B){if(!Z)J(B)}return{onFocus(){$.current=void 0},onMouseEnter:H,onMouseMove:H}}function vA($,Z,J,H){let B=Q10(Z,J,H);return $.current=B,B}function iC($){return{name:"inline",async fn(Z){let J=Z.elements.reference;if(typeof J?.getClientRects!=="function")return{};let H=z10(J),B=$.current,Q=B?.element===J||B?.element===H?B:void 0,X=X10(J,Z.placement,Q);if(!X||typeof Z.platform.getElementRects!=="function")return{};let z=await Z.platform.getElementRects({reference:{contextElement:H,getBoundingClientRect(){return X}},floating:Z.elements.floating,strategy:Z.strategy});if(Z.rects.reference.x===z.reference.x&&Z.rects.reference.y===z.reference.y&&Z.rects.reference.width===z.reference.width&&Z.rects.reference.height===z.reference.height)return{};return{reset:{rects:z}}}}}class $9{attachedStores=[];attachedStoreValue=null;storeListeners=new Set;constructor($,Z,J=!0){this.fallbackStore=$,this.componentName=Z,this.throwOnMissingTrigger=J}get attachedStore(){return this.attachedStoreValue}get store(){return this.attachedStoreValue??this.fallbackStore}get serverStore(){return this.fallbackStore}subscribeStore($){return this.storeListeners.add($),()=>{this.storeListeners.delete($)}}attachStore($){return this.attachedStores.push($),this.setActiveStore($),()=>{let Z=this.attachedStores.lastIndexOf($);if(Z!==-1)this.attachedStores.splice(Z,1);this.setActiveStore(this.attachedStores[this.attachedStores.length-1]??null)}}setActiveStore($){if(this.attachedStoreValue!==$)this.attachedStoreValue=$,this.storeListeners.forEach((Z)=>{Z()})}openByTrigger($){let Z=this.attachedStore;if(Z===null)return;let J;if($){for(let H=this.attachedStores.length-1;H>=0&&!J;H-=1)J=this.attachedStores[H].context.triggerElements.getById($);J??=this.fallbackStore.context.triggerElements.getById($)}if($&&!J){if(this.throwOnMissingTrigger)throw Error(I0(99,this.componentName,$,this.componentName))}Z.setOpen(!0,w0(K0.imperativeAction,void 0,J))}closePopup(){let $=this.attachedStore;if($===null)return;$.setOpen(!1,w0(K0.imperativeAction))}}var gA=P(m(),1),oC=P(U8(),1);var rC=P(m(),1);var G10={open:($)=>$.open,transitionStatus:($)=>$.transitionStatus,domReferenceElement:($)=>$.domReferenceElement,referenceElement:($)=>$.positionReference??$.referenceElement,floatingElement:($)=>$.floatingElement,floatingId:($)=>$.floatingId};class Y$ extends g2{constructor($){let{syncOnly:Z,nested:J,onOpenChange:H,triggerElements:B,...Q}=$;super({...Q,positionReference:Q.referenceElement,domReferenceElement:Q.referenceElement},{onOpenChange:H,dataRef:{current:{}},events:YG(),nested:J,triggerElements:B},G10);this.syncOnly=Z}syncOpenEvent=($,Z)=>{if(!$||!this.state.open||Z!=null&&MT(Z))this.context.dataRef.current.openEvent=$?Z:void 0};dispatchOpenChange=($,Z)=>{this.syncOpenEvent($,Z.event);let J={open:$,reason:Z.reason,nativeEvent:Z.event,nested:this.context.nested,triggerElement:Z.trigger};this.context.events.emit("openchange",J)};setOpen=($,Z)=>{if(this.syncOnly){this.context.onOpenChange?.($,Z);return}this.dispatchOpenChange($,Z),this.context.onOpenChange?.($,Z)}}function jB($){let{popupStore:Z,treatPopupAsFloatingElement:J=!1,floatingRootContext:H,floatingId:B,nested:Q,onOpenChange:X}=$,z=Z.useState("open"),G=Z.useState("activeTriggerElement"),U=Z.useState(J?"popupElement":"positionerElement"),Y=Z.context.triggerElements,K=X,F=rC.useRef(null);if(H===void 0&&F.current===null)F.current=new Y$({open:z,transitionStatus:void 0,referenceElement:G,floatingElement:U,triggerElements:Y,onOpenChange:K,floatingId:B,syncOnly:!0,nested:Q});let W=H??F.current;return Z.useSyncedValue("floatingId",B),H0(()=>{let q={open:z,floatingId:B,referenceElement:G,floatingElement:U};if(n0(G))q.domReferenceElement=G;if(W.state.positionReference===W.state.referenceElement)q.positionReference=G;W.update(q)},[z,B,G,U,W]),W.context.onOpenChange=K,W.context.nested=Q,W}var fA=P(m(),1);function S2($,Z=!1,J=!1,H=!1){let[B,Q]=fA.useState($&&Z?"idle":void 0),[X,z]=fA.useState($&&!H);if($&&!X)z(!0),Q("starting");if(!$&&X&&B!=="ending"&&!J)Q("ending");if(!$&&!X&&B==="ending")Q(void 0);return H0(()=>{if(!$&&X&&B!=="ending"&&J){let G=m2.request(()=>{Q("ending")});return()=>{m2.cancel(G)}}return},[$,X,B,J]),H0(()=>{if(!$||Z)return;let G=m2.request(()=>{Q(void 0)});return()=>{m2.cancel(G)}},[Z,$]),H0(()=>{if(!$||!Z)return;if($&&X&&B!=="idle")Q("starting");let G=m2.request(()=>{Q("idle")});return()=>{m2.cancel(G)}},[Z,$,X,B]),{mounted:X,setMounted:z,transitionStatus:B}}var R9={tabIndex:-1,[UB]:""};function FG($){return(Z)=>Z==="touch"?$.current:!0}function A6($,Z=!1){let J=E4(),H=w4()!=null,B=Z5(()=>$(J,H)).current;return jB({popupStore:B,treatPopupAsFloatingElement:Z,floatingRootContext:B.state.floatingRootContext,floatingId:J,nested:H,onOpenChange:B.setOpen}),B}function I9({handle:$,store:Z}){return H0(()=>{return $.attachStore(Z)},[$,Z]),null}function aC($){let Z=$.context.triggerElements.size;if($.select("open")&&$.state.triggerCount!==Z)$.set("triggerCount",Z)}function mA($,Z){let J=gA.useRef(null);return Y0((H)=>{let B=J.current;if(B!==null){if(B.element===H&&B.store===Z&&B.id===$)return;J.current=null;let Q=B.store;if(Q.context.triggerElements.getById(B.id)===B.element)Q.context.triggerElements.delete(B.id),aC(Q)}if(H!==null&&$!==void 0)J.current={store:Z,id:$,element:H},Z.context.triggerElements.add($,H),aC(Z)})}function K$($,Z,J,H=!1){let B=$.preventUnmountingOnClose;if(Z)B=!1;else if(H)B=!0;let Q=J?.id??null,X=$.activeTriggerId,z=$.activeTriggerElement;if(Q||Z)X=Q,z=J??null;return{open:Z,preventUnmountingOnClose:B,activeTriggerId:X,activeTriggerElement:z}}function TB($){let Z=!1;return $.preventUnmountOnClose=()=>{Z=!0},()=>Z}function WG($,Z,J,H={}){let B=J.reason,Q=B===K0.triggerHover,X=Z&&B===K0.triggerFocus,z=!Z&&(B===K0.triggerPress||B===K0.escapeKey),G=TB(J);if($.context.onOpenChange?.(Z,J),J.isCanceled)return;H.onBeforeDispatch?.(),$.state.floatingRootContext.dispatchOpenChange(Z,J);let U=()=>{let Y=K$($.state,Z,J.trigger,G()),K={...H.extraState,...Y};if(X)K.instantType="focus";else if(z)K.instantType="dismiss";else if(Q)K.instantType=void 0;$.update(K)};if(Q)oC.flushSync(U);else U()}function k9($,Z,J,H){let B=J.useState("isMountedByTrigger",$),Q=mA($,J),X=Y0((G)=>{let U=J.select("open"),Y=J.select("activeTriggerId");if(Y===$){let K={activeTriggerElement:G,...U?H:null};J.update(K);return}if(Y==null&&U){let K={activeTriggerId:$??null,activeTriggerElement:G,...H};J.update(K)}}),z=Y0((G)=>{if(Q(G),G)X(G)});return H0(()=>{return z(Z.current),()=>z(null)},[z,Z,J,$]),H0(()=>{if(B){let G={activeTriggerElement:Z.current,...H};J.update(G)}},[B,J,Z,...Object.values(H)]),{registerTrigger:z,isMountedByThisTrigger:B}}function y9($,Z={}){let{closeOnActiveTriggerUnmount:J=!1}=Z,H=gA.useRef(null),B=$.useState("open"),Q=$.useState("triggerCount"),X=$.useState("activeTriggerId"),z=$.useState("activeTriggerElement");H0(()=>{if(!B){if(H.current=null,$.state.triggerCount!==0)$.set("triggerCount",0);return}let G=$.context.triggerElements.size,U={};if($.state.triggerCount!==G)U.triggerCount=G;let Y=$.select("activeTriggerId"),K=null;if(Y){let F=$.context.triggerElements.getById(Y);if(!F){for(let[W,q]of $.context.triggerElements.entries())if(q===$.state.activeTriggerElement){U.activeTriggerId=W,U.activeTriggerElement=q,H.current=W;break}if(U.activeTriggerId===void 0)if(H.current===Y)K=Y;else H.current=null}else if(H.current=Y,F!==$.state.activeTriggerElement)U.activeTriggerElement=F}else H.current=null;if(!K&&!Y&&G===1){let F=$.context.triggerElements.entries().next();if(!F.done){let[W,q]=F.value;U.activeTriggerId=W,U.activeTriggerElement=q,H.current=W}}if(U.triggerCount!==void 0||U.activeTriggerId!==void 0||U.activeTriggerElement!==void 0)$.update(U);if(K){if(J)queueMicrotask(()=>{if($.select("open")&&$.select("activeTriggerId")===K&&!$.context.triggerElements.getById(K)){let F=w0(K0.none);if($.setOpen(!1,F),!F.isCanceled)$.update({activeTriggerId:null,activeTriggerElement:null})}})}},[B,$,Q,X,z,J])}function x9($,Z,J,H){let{mounted:B,setMounted:Q,transitionStatus:X}=S2($,!1,!1,H),z=Z.useState("preventUnmountingOnClose"),G=$?!1:z;Z.useSyncedValues({mounted:B,transitionStatus:X,preventUnmountingOnClose:G});let U=Y0(()=>{Q(!1),Z.update({activeTriggerId:null,activeTriggerElement:null,mounted:!1,preventUnmountingOnClose:!1}),J?.(),Z.context.onOpenChangeComplete?.(!1)});return V5({enabled:B&&!$&&!G,open:$,ref:Z.context.popupRef,onComplete(){if(!$)U()}}),{forceUnmount:U,transitionStatus:X}}function h9($,Z){$.useSyncedValues(Z),H0(()=>()=>{$.update({activeTriggerProps:D1,inactiveTriggerProps:D1,popupProps:D1})},[$])}function qG($,Z){H0(()=>{if(!Z&&$.state.openMethod!==null)$.set("openMethod",null)},[Z,$]),H0(()=>()=>{if($.state.openMethod!==null)$.set("openMethod",null)},[$])}class R2{constructor(){this.idMap=new Map}add($,Z){this.idMap.set($,Z)}delete($){this.idMap.delete($)}hasElement($){for(let Z of this.idMap.values())if(Z===$)return!0;return!1}hasMatchingElement($){for(let Z of this.idMap.values())if($(Z))return!0;return!1}getById($){return this.idMap.get($)}entries(){return this.idMap.entries()}elements(){return this.idMap.values()}get size(){return this.idMap.size}}function v9($,Z,J=!1){return{open:!1,openProp:void 0,mounted:!1,transitionStatus:void 0,floatingRootContext:new Y$({open:!1,transitionStatus:void 0,floatingElement:null,referenceElement:null,triggerElements:$,floatingId:Z,syncOnly:!0,nested:J,onOpenChange:void 0}),floatingId:Z,triggerCount:0,preventUnmountingOnClose:!1,payload:void 0,activeTriggerId:null,activeTriggerElement:null,triggerIdProp:void 0,popupElement:null,positionerElement:null,activeTriggerProps:D1,inactiveTriggerProps:D1,popupProps:D1}}var CB=($)=>$.triggerIdProp??$.activeTriggerId,uA=($)=>$.openProp??$.open,nC=($)=>{return($.popupElement?.id??$.floatingId)||void 0};function sC($,Z){return Z!==void 0&&uA($)&&CB($)===Z}function U10($,Z){if(sC($,Z))return!0;return Z!==void 0&&uA($)&&CB($)==null&&$.triggerCount===1}var f9={open:uA,mounted:($)=>$.mounted,transitionStatus:($)=>$.transitionStatus,floatingRootContext:($)=>$.floatingRootContext,triggerCount:($)=>$.triggerCount,preventUnmountingOnClose:($)=>$.preventUnmountingOnClose,payload:($)=>$.payload,activeTriggerId:CB,activeTriggerElement:($)=>$.mounted?$.activeTriggerElement:null,popupId:nC,isTriggerActive:($,Z)=>Z!==void 0&&CB($)===Z,isOpenedByTrigger:($,Z)=>sC($,Z),isMountedByTrigger:($,Z)=>Z!==void 0&&CB($)===Z&&$.mounted,triggerProps:($,Z)=>Z?$.activeTriggerProps:$.inactiveTriggerProps,triggerPopupId:($,Z)=>U10($,Z)?nC($):void 0,popupProps:($)=>$.popupProps,popupElement:($)=>$.popupElement,positionerElement:($)=>$.positionerElement};var pA=P(m(),1),tC=P(RZ(),1);function g9($){let Z=pA.useCallback((H)=>{if($===void 0)return U1;return $.subscribeStore(H)},[$]),J=pA.useCallback(()=>{return $===void 0?void 0:$.store},[$]);return tC.useSyncExternalStore(Z,J,()=>$?.serverStore)}function cA($){let{open:Z=!1,onOpenChange:J,elements:H={}}=$,B=E4(),Q=w4()!=null,X=Z5(()=>new Y$({open:Z,transitionStatus:void 0,onOpenChange:J,referenceElement:H.reference??null,floatingElement:H.floating??null,triggerElements:new R2,floatingId:B,syncOnly:!1,nested:Q})).current;return H0(()=>{let z={open:Z,floatingId:B};if(H.reference!==void 0)z.referenceElement=H.reference,z.domReferenceElement=n0(H.reference)?H.reference:null;if(H.floating!==void 0)z.floatingElement=H.floating;X.update(z)},[Z,B,H.reference,H.floating,X]),X.context.onOpenChange=J,X.context.nested=Q,X}var m9=P(m(),1);var dA=J5.os.mac&&J5.engine.webkit;function F$($,Z={}){let{enabled:J=!0,delay:H}=Z,B="rootStore"in $?$.rootStore:$,{events:Q,dataRef:X}=B.context,z=m9.useRef(!1),G=m9.useRef(null),U=m9.useRef(!0),Y=t1();m9.useEffect(()=>{let F=B.select("domReferenceElement");if(!J)return;let W=I1(F);function q(){let A=B.select("domReferenceElement");if(!B.select("open")&&L1(A)&&A===l1(m0(A)))z.current=!0,G.current=A}function N(){U.current=!0}function D(){U.current=!1}return E2(a0(W,"blur",q),dA&&a0(W,"keydown",N,!0),dA&&a0(W,"pointerdown",D,!0))},[B,J]),m9.useEffect(()=>{if(!J)return;function F(W){if(W.reason===K0.triggerPress||W.reason===K0.escapeKey){let q=B.select("domReferenceElement");if(n0(q))G.current=q,z.current=!0}}return Q.on("openchange",F),()=>{Q.off("openchange",F)}},[Q,J,B]);let K=m9.useMemo(()=>{function F(){z.current=!1,G.current=null}return{onMouseLeave(){F()},onFocus(W){let q=W.currentTarget;if(z.current){if(G.current===q)return;F()}let N=V1(W.nativeEvent);if(n0(N)){if(dA&&!W.relatedTarget){if(!U.current&&!$$(N))return}else if(!E9(N))return}let D=U6(W.relatedTarget,B.context.triggerElements),{nativeEvent:A,currentTarget:V}=W,L=typeof H==="function"?H():H;if(B.select("open")&&D||L===0||L===void 0){B.setOpen(!0,w0(K0.triggerFocus,A,V));return}Y.start(L,()=>{if(z.current)return;B.setOpen(!0,w0(K0.triggerFocus,A,V))})},onBlur(W){F();let{relatedTarget:q,nativeEvent:N}=W,D=n0(q)&&q.hasAttribute(E3("focus-guard"))&&q.getAttribute("data-type")==="outside";Y.start(0,()=>{let A=B.select("domReferenceElement"),V=l1(m0(A));if(!q&&V===A)return;if(R0(X.current.floatingContext?.refs.floating.current,V)||R0(A,V)||D)return;if(U6(q??V,B.context.triggerElements))return;B.setOpen(!1,w0(K0.triggerFocus,N))})}}},[X,H,B,Y]);return m9.useMemo(()=>J?{reference:K,trigger:K}:{},[J,K])}var iA=P(m(),1);class lA{constructor(){this.pointerType=void 0,this.interactedInside=!1,this.handler=void 0,this.blockMouseMove=!0,this.performedPointerEventsMutation=!1,this.pointerEventsScopeElement=null,this.pointerEventsReferenceElement=null,this.pointerEventsFloatingElement=null,this.restTimeoutPending=!1,this.openChangeTimeout=new r5,this.restTimeout=new r5,this.handleCloseOptions=void 0}static create(){return new lA}dispose=()=>{this.openChangeTimeout.clear(),this.restTimeout.clear()};disposeEffect=()=>{return this.dispose}}var NG=new WeakMap;function mZ($){if(!$.performedPointerEventsMutation)return;let Z=$.pointerEventsScopeElement;if(Z&&NG.get(Z)===$)$.pointerEventsScopeElement?.style.removeProperty("pointer-events"),$.pointerEventsReferenceElement?.style.removeProperty("pointer-events"),$.pointerEventsFloatingElement?.style.removeProperty("pointer-events"),NG.delete(Z);$.performedPointerEventsMutation=!1,$.pointerEventsScopeElement=null,$.pointerEventsReferenceElement=null,$.pointerEventsFloatingElement=null}function AG($,Z){let{scopeElement:J,referenceElement:H,floatingElement:B}=Z,Q=NG.get(J);if(Q&&Q!==$)mZ(Q);mZ($),$.performedPointerEventsMutation=!0,$.pointerEventsScopeElement=J,$.pointerEventsReferenceElement=H,$.pointerEventsFloatingElement=B,NG.set(J,$),J.style.pointerEvents="none",H.style.pointerEvents="auto",B.style.pointerEvents="auto"}function uZ($){let Z=$.context.dataRef.current,J=Z5(()=>Z.hoverInteractionState??lA.create()).current;if(!Z.hoverInteractionState)Z.hoverInteractionState=J;return X6(Z.hoverInteractionState.disposeEffect),Z.hoverInteractionState}function S3($,Z={}){let{enabled:J=!0,closeDelay:H=0,nodeId:B}=Z,Q="rootStore"in $?$.rootStore:$,X=Q.useState("open"),z=Q.useState("floatingElement"),G=Q.useState("domReferenceElement"),{dataRef:U}=Q.context,Y=B4(),K=w4(),F=uZ(Q),W=t1(),q=Y0(()=>{return GG(U.current.openEvent?.type,F.interactedInside)}),N=Y0(()=>{return EC(U.current.openEvent?.type)}),D=Y0(()=>{mZ(F)});H0(()=>{if(!X)F.pointerType=void 0,F.restTimeoutPending=!1,F.interactedInside=!1,D()},[X,F,D]),iA.useEffect(()=>{return D},[D]),H0(()=>{if(!J)return;if(X&&F.handleCloseOptions?.blockPointerEvents&&N()&&n0(G)&&z){let A=G,V=z,L=m0(z),O=Y?.nodesRef.current.find((C)=>C.id===K)?.context?.elements.floating;if(O)O.style.pointerEvents="";let M=F.pointerEventsScopeElement!==V?F.pointerEventsScopeElement:null,_=O!==V?O:null,w=F.handleCloseOptions?.getScope?.()??M??_??A.closest("[data-rootownerid]")??L.body;return AG(F,{scopeElement:w,referenceElement:A,floatingElement:V}),()=>{D()}}return},[J,X,G,z,F,N,Y,K,D]),iA.useEffect(()=>{if(!J)return;function A(){return!!(Y&&K&&j8(Y.nodesRef.current,K).length>0)}function V(C){let E=t8(H,"close",F.pointerType),j=()=>{Q.setOpen(!1,w0(K0.triggerHover,C)),Y?.events.emit("floating.closed",C)};if(E)F.openChangeTimeout.start(E,j);else F.openChangeTimeout.clear(),j()}function L(C){let E=V1(C);if(!qA(E)){F.interactedInside=!1;return}F.interactedInside=E?.closest("[aria-haspopup]")!=null}function O(){F.openChangeTimeout.clear(),W.clear(),Y?.events.off("floating.closed",_),D()}function M(C){if(A()&&Y){Y.events.on("floating.closed",_);return}if(U6(C.relatedTarget,Q.context.triggerElements))return;let E=U.current.floatingContext?.nodeId??B,j=C.relatedTarget;if(Y&&E&&n0(j)&&j8(Y.nodesRef.current,E,!1).some((S)=>R0(S.context?.elements.floating,j)))return;if(F.handler){F.handler(C);return}if(D(),N()&&!q())V(C)}function _(C){if(!Y||!K||A())return;W.start(0,()=>{Y.events.off("floating.closed",_),Q.setOpen(!1,w0(K0.triggerHover,C)),Y.events.emit("floating.closed",C)})}let w=z;return E2(w&&a0(w,"mouseenter",O),w&&a0(w,"mouseleave",M),w&&a0(w,"pointerdown",L,!0),()=>{Y?.events.off("floating.closed",_)})},[J,z,Q,U,H,B,N,q,D,F,Y,K,W])}var D6=P(m(),1),eC=P(U8(),1);var Y10={current:null};function Z9($,Z={}){let{enabled:J=!0,delay:H=0,handleClose:B=null,mouseOnly:Q=!1,restMs:X=0,move:z=!0,triggerElementRef:G=Y10,externalTree:U,isActiveTrigger:Y=!0,getHandleCloseContext:K,isClosing:F,shouldOpen:W,guardStaleOpen:q=!1}=Z,N="rootStore"in $?$.rootStore:$,{dataRef:D,events:A}=N.context,V=B4(U),L=uZ(N),O=D6.useRef(!1),M=W5(B),_=W5(H),w=W5(X),C=W5(J),E=W5(W),j=W5(F),k=Y0(()=>{return GG(D.current.openEvent?.type,L.interactedInside)}),S=Y0(()=>{return E.current?.()!==!1}),I=Y0((R,x,v)=>{let f=N.context.triggerElements;if(f.hasElement(x))return!R||!R0(R,x);if(!n0(v))return!1;let b=v;return f.hasMatchingElement((l)=>R0(l,b))&&(!R||!R0(R,b))}),T=Y0(()=>{if(!L.handler)return;m0(N.select("domReferenceElement")).removeEventListener("mousemove",L.handler),L.handler=void 0}),y=Y0(()=>{mZ(L)});if(Y)L.handleCloseOptions=B?.__options;return D6.useEffect(()=>T,[T]),D6.useEffect(()=>{if(!J)return;function R(x){if(!x.open)O.current=x.reason===K0.triggerHover,T(),L.openChangeTimeout.clear(),L.restTimeout.clear(),L.blockMouseMove=!0,L.restTimeoutPending=!1;else O.current=!1}return A.on("openchange",R),()=>{A.off("openchange",R)}},[J,A,L,T]),D6.useEffect(()=>{if(!J)return;function R(r,h=!0){let d=t8(_.current,"close",L.pointerType);if(d)L.openChangeTimeout.start(d,()=>{N.setOpen(!1,w0(K0.triggerHover,r)),V?.events.emit("floating.closed",r)});else if(h)L.openChangeTimeout.clear(),N.setOpen(!1,w0(K0.triggerHover,r)),V?.events.emit("floating.closed",r)}let x=G.current??(Y?N.select("domReferenceElement"):null);if(!n0(x))return;function v(r){if(L.openChangeTimeout.clear(),L.blockMouseMove=!1,Q&&!G8(L.pointerType))return;let h=EA(w.current),d=t8(_.current,"open",L.pointerType),o=V1(r),p=r.currentTarget??null,i=N.select("domReferenceElement"),n=p;if(n0(o)&&!N.context.triggerElements.hasElement(o)){for(let s of N.context.triggerElements.elements())if(R0(s,o)){n=s;break}}if(n0(p)&&n0(i)&&!N.context.triggerElements.hasElement(p)&&R0(p,i))n=i;let Z0=n==null?!1:I(i,n,o),J0=N.select("open"),U0=j.current?.()??N.select("transitionStatus")==="ending",z0=!J0&&U0&&O.current,X0=!Z0&&n0(n)&&n0(i)&&R0(i,n)&&z0,q0=h>0&&!d,N0=Z0&&(J0||z0)||X0,F0=!J0||Z0;if(N0){if(S())N.setOpen(!0,w0(K0.triggerHover,r,n));return}if(q0)return;if(d)L.openChangeTimeout.start(d,()=>{if(F0&&S())N.setOpen(!0,w0(K0.triggerHover,r,n))});else if(F0){if(S())N.setOpen(!0,w0(K0.triggerHover,r,n))}}function f(r){if(k()){y();return}T();let h=N.select("domReferenceElement"),d=m0(h);L.restTimeout.clear(),L.restTimeoutPending=!1;let o=D.current.floatingContext??K?.();if(U6(r.relatedTarget,N.context.triggerElements))return;if(M.current&&o){if(!N.select("open"))L.openChangeTimeout.clear();let i=G.current;L.handler=M.current({...o,tree:V,x:r.clientX,y:r.clientY,onClose(){if(y(),T(),C.current&&!k()&&i===N.select("domReferenceElement"))R(r,!0)}}),d.addEventListener("mousemove",L.handler),L.handler(r);return}if(L.pointerType==="touch"?!R0(N.select("floatingElement"),r.relatedTarget):!0)R(r)}function b(r){if(R0(x,r.relatedTarget))return;L.openChangeTimeout.clear(),L.restTimeout.clear(),L.restTimeoutPending=!1}let l=q?a0(x,"mouseout",b):void 0;if(z)return E2(a0(x,"mousemove",v,{once:!0}),a0(x,"mouseenter",v),a0(x,"mouseleave",f),l);return E2(a0(x,"mouseenter",v),a0(x,"mouseleave",f),l)},[T,y,D,_,N,J,M,L,Y,I,k,Q,z,w,G,V,C,K,j,S,q]),D6.useMemo(()=>{if(!J)return;function R(x){L.pointerType=x.pointerType}return{onPointerDown:R,onPointerEnter:R,onMouseMove(x){let{nativeEvent:v}=x,f=x.currentTarget,b=N.select("domReferenceElement"),l=N.select("open"),r=I(b,f,x.target);if(Q&&!G8(L.pointerType))return;if(l&&r&&L.handleCloseOptions?.blockPointerEvents){let o=N.select("floatingElement");if(o){let p=L.handleCloseOptions?.getScope?.()??f.ownerDocument.body;AG(L,{scopeElement:p,referenceElement:f,floatingElement:o})}}let h=EA(w.current);if(l&&!r||h===0)return;if(!r&&L.restTimeoutPending&&x.movementX**2+x.movementY**2<2)return;L.restTimeout.clear();function d(){if(L.restTimeoutPending=!1,k())return;let o=N.select("open");if(!L.blockMouseMove&&(!o||r)&&S())N.setOpen(!0,w0(K0.triggerHover,v,f))}if(L.pointerType==="touch")eC.flushSync(()=>{d()});else if(r&&l)d();else L.restTimeoutPending=!0,L.restTimeout.start(h,d)}}},[J,L,k,I,Q,N,w,S])}var c2=P(m(),1);var K10="Escape";function $E($){return J5.engine.webkit&&$.movementX===0&&$.movementY===0}function VG($,Z,J){switch($){case"vertical":return Z;case"horizontal":return J;default:return Z||J}}function DG($,Z){return VG(Z,$===UA||$===kz,$===YB||$===KB)}function rA($,Z,J){return VG(Z,$===kz,J?$===YB:$===KB)||$==="Enter"||$===" "||$===""}function F10($,Z,J){return VG(Z,J?$===YB:$===KB,$===kz)}function W10($,Z,J,H){let B=J?$===KB:$===YB,Q=$===UA;if(Z==="both"||Z==="horizontal"&&H)return $===K10;return VG(Z,B,Q)}function aA($,Z){let{listRef:J,activeIndex:H,onNavigate:B=()=>{},enabled:Q=!0,selectedIndex:X=null,allowEscape:z=!1,loopFocus:G=!1,nested:U=!1,rtl:Y=!1,virtual:K=!1,focusItemOnOpen:F="auto",focusItemOnHover:W=!0,openOnArrowKeyDown:q=!0,disabledIndices:N=void 0,orientation:D="vertical",parentOrientation:A,id:V,resetOnPointerLeave:L=!0,externalTree:O,grid:M}=Z,_=M!=null,w="rootStore"in $?$.rootStore:$,C=w.useState("open"),E=w.useState("floatingElement"),j=w.useState("domReferenceElement"),k=w.context.dataRef,S=AB(E),I=NB(j),T=W5(S),y=w4(),R=B4(O),x=c2.useRef(F),v=c2.useRef(X??-1),f=c2.useRef(null),b=c2.useRef(!0),l=Y0((A0)=>{B(v.current===-1?null:v.current,A0)}),r=c2.useRef(!!E),h=c2.useRef(C),d=c2.useRef(!1),o=c2.useRef(!1),p=c2.useRef(null),i=W5(N),n=W5(C),Z0=W5(X),J0=W5(L),U0=C4(),z0=C4(),X0=Y0(()=>{function A0(e){if(K)R?.events.emit("virtualfocus",e);else p.current=gZ(e,{sync:d.current,preventScroll:!0})}let L0=J.current[v.current],g=o.current;if(L0)A0(L0);(d.current?(e)=>e():(e)=>U0.request(e))(()=>{let e=J.current[v.current]||L0;if(!e)return;if(!L0)A0(e);if($0&&(g||!b.current))e.scrollIntoView?.({block:"nearest",inline:"nearest"})})});H0(()=>{k.current.orientation=D},[k,D]),H0(()=>{if(!Q)return;if(C&&E){if(v.current=X??-1,x.current&&X!=null)o.current=!0,l()}else if(r.current)v.current=-1,l()},[Q,C,E,X,l]),H0(()=>{if(!Q)return;if(!C){d.current=!1;return}if(!E)return;if(H==null){if(d.current=!1,Z0.current!=null)return;if(r.current)v.current=-1,X0();if((!h.current||!r.current)&&x.current&&(f.current!=null||x.current===!0&&f.current==null)){let A0=0,L0=()=>{if(J.current[0]==null){if(A0<2)(A0?(u)=>z0.request(u):queueMicrotask)(L0);A0+=1}else v.current=f.current==null||rA(f.current,D,Y)||U?J$(J):yZ(J),f.current=null,l()};L0()}}else if(!F6(J.current,H))v.current=H,X0(),o.current=!1},[Q,C,E,H,Z0,U,J,D,Y,l,X0,z0]),H0(()=>{if(!Q||E||!R||K||!r.current)return;let A0=R.nodesRef.current,L0=A0.find((e)=>e.id===y)?.context?.elements.floating,g=l1(m0(j??L0??null)),u=A0.some((e)=>e.context&&R0(e.context.elements.floating,g));if(L0&&!u&&b.current)L0.focus({preventScroll:!0})},[Q,E,j,R,y,K]),H0(()=>{h.current=C,r.current=!!E}),H0(()=>{if(!C)f.current=null,x.current=F},[C,F]);let q0=H!=null,N0=Y0((A0)=>{if(!n.current)return;let L0=J.current.indexOf(A0.currentTarget);if(L0!==-1&&(v.current!==L0||H!==L0))v.current=L0,l(A0)}),F0=Y0(()=>{return A??R?.nodesRef.current.find((A0)=>A0.id===y)?.context?.dataRef?.current.orientation}),s=Y0(()=>{return J$(J,i.current)}),a=Y0((A0)=>{if(b.current=!1,d.current=!0,A0.which===229)return;if(!n.current&&A0.currentTarget===T.current)return;if(U&&W10(A0.key,D,Y,_)){if(!DG(A0.key,F0()))u4(A0);if(w.setOpen(!1,w0(K0.listNavigation,A0.nativeEvent)),L1(j))if(K)R?.events.emit("virtualfocus",j);else j.focus();return}let L0=v.current,g=J$(J,N),u=yZ(J,N);if(!I){if(A0.key==="Home")u4(A0),v.current=g,l(A0);if(A0.key==="End")u4(A0),v.current=u,l(A0)}if(M!=null){let e=M(A0,v.current,J,D,G,Y,N,g,u);if(e!=null)v.current=e,l(A0);if(D==="both")return}if(DG(A0.key,D)){if(u4(A0),C&&!K&&l1(A0.currentTarget.ownerDocument)===A0.currentTarget){v.current=rA(A0.key,D,Y)?g:u,l(A0);return}if(rA(A0.key,D,Y))if(G)if(L0>=u)if(z&&L0!==J.current.length)v.current=-1;else d.current=!1,v.current=g;else v.current=C8(J.current,{startingIndex:L0,disabledIndices:N});else v.current=Math.min(u,C8(J.current,{startingIndex:L0,disabledIndices:N}));else if(G)if(L0<=g)if(z&&L0!==-1)v.current=J.current.length;else d.current=!1,v.current=u;else v.current=C8(J.current,{startingIndex:L0,decrement:!0,disabledIndices:N});else v.current=Math.max(g,C8(J.current,{startingIndex:L0,decrement:!0,disabledIndices:N}));if(F6(J.current,v.current))v.current=-1;l(A0)}}),$0=c2.useMemo(()=>{return{onFocus(L0){d.current=!0,N0(L0)},onClick:({currentTarget:L0})=>L0.focus({preventScroll:!0}),onMouseMove(L0){if($E(L0))return;if(d.current=!0,o.current=!1,W)N0(L0)},onPointerLeave(L0){if(!n.current||!b.current||L0.pointerType==="touch")return;d.current=!0;let g=L0.relatedTarget;if(!W||J.current.includes(g))return;if(!J0.current)return;if(p.current?.(),p.current=null,v.current=-1,l(L0),!K){let u=T.current,e=l1(m0(u));if(u&&R0(u,e))u.focus({preventScroll:!0})}}}},[N0,n,T,W,J,l,J0,K]),t=c2.useMemo(()=>{return K&&C&&q0&&{"aria-activedescendant":`${V}-${H}`}},[K,C,q0,V,H]),B0=c2.useMemo(()=>{return{...!I?t:{},onKeyDown(A0){if(A0.key==="Tab"&&A0.shiftKey&&C&&!K){let L0=V1(A0.nativeEvent);if(L0&&!R0(T.current,L0))return;if(u4(A0),w.setOpen(!1,w0(K0.focusOut,A0.nativeEvent)),L1(j))j.focus();return}a(A0)},onPointerMove(A0){if($E(A0))return;b.current=!0}}},[t,a,T,I,w,C,K,j]),_0=c2.useMemo(()=>{function A0(u){w.setOpen(!0,w0(K0.listNavigation,u.nativeEvent,u.currentTarget))}function L0(u){if(F==="auto"&&IZ(u.nativeEvent))x.current=!K}function g(u){if(x.current=F,F==="auto"&&kZ(u.nativeEvent))x.current=!0}return{onKeyDown(u){let e=w.select("open");b.current=!1;let W0=u.key.startsWith("Arrow"),S0=F10(u.key,F0(),Y),h0=DG(u.key,D),v0=(U?S0:h0)||u.key==="Enter"||u.key.trim()==="";if(K&&e)return a(u);if(!e&&!q&&W0)return;if(v0){let T0=DG(u.key,F0());f.current=U&&T0?null:u.key}if(U){if(S0)if(u4(u),e)v.current=s(),l(u);else A0(u);return}if(h0){if(Z0.current!=null)v.current=Z0.current;if(u4(u),!e&&q)A0(u);else a(u);if(e)l(u)}return},onFocus(u){if(w.select("open")&&!K)v.current=-1,l(u)},onPointerDown:g,onPointerEnter:g,onMouseDown:L0,onClick:L0}},[a,F,s,U,l,w,q,D,F0,Y,Z0,K]),P0=c2.useMemo(()=>{return{...t,..._0}},[t,_0]);return c2.useMemo(()=>Q?{reference:P0,floating:B0,item:$0,trigger:_0}:{},[Q,P0,B0,_0,$0])}var W$=P(m(),1);function oA($,Z){let{listRef:J,elementsRef:H,activeIndex:B,onMatch:Q,disabledIndices:X,onTyping:z,enabled:G=!0,resetMs:U=750,selectedIndex:Y=null}=Z,K="rootStore"in $?$.rootStore:$,F=K.useState("open"),W=t1(),q=W$.useRef(""),N=W$.useRef(Y??B??-1),D=W$.useRef(null),A=Y0((O)=>{function M(T){return H?.current[T]}function _(T){let y=M(T);if(y&&!H$(y)||y?.matches(":disabled"))return!1;return X==null||!j3(Z4,T,X)}function w(T,y,R=0){if(T.length===0)return-1;let x=(R%T.length+T.length)%T.length,v=y.toLowerCase();for(let f=0;f<T.length;f+=1){let b=(x+f)%T.length;if(!T[b]?.toLowerCase().startsWith(v)||!_(b))continue;return b}return-1}let C=J.current;if(q.current.length>0&&O.key===" ")u4(O),z?.(!0);if(q.current.length>0&&q.current[0]!==" "){if(w(C,q.current)===-1&&O.key!==" ")z?.(!1)}if(C==null||O.key.length!==1||O.ctrlKey||O.metaKey||O.altKey)return;if(F&&O.key!==" ")u4(O),z?.(!0);let E=q.current==="";if(E)N.current=Y??B??-1;if(C.every((T,y)=>T&&_(y)?T[0]?.toLowerCase()!==T[1]?.toLowerCase():!0)&&q.current===O.key)q.current="",N.current=D.current;q.current+=O.key,W.start(U,()=>{q.current="",N.current=D.current,z?.(!1)});let S=((E?Y??B??-1:N.current)??0)+1,I=w(C,q.current,S);if(I!==-1)Q?.(I),D.current=I;else if(O.key!==" ")q.current="",z?.(!1)}),V=Y0((O)=>{let M=O.relatedTarget,_=K.select("domReferenceElement"),w=K.select("floatingElement");if(R0(_,M)||R0(w,M))return;W.clear(),q.current="",N.current=D.current,z?.(!1)});H0(()=>{if(!F&&Y!==null)return;if(W.clear(),D.current=null,q.current!=="")q.current=""},[F,Y,W]);let L=W$.useMemo(()=>({onKeyDown:A,onBlur:V}),[A,V]);return W$.useMemo(()=>G?{reference:L,floating:L}:{},[G,L])}var ZE=0.1,q10=ZE*ZE,M5=0.5;function LG($,Z,J,H,B,Q){return H>=Z!==Q>=Z&&$<=(B-J)*(Z-H)/(Q-H)+J}function MG($,Z,J,H,B,Q,X,z,G,U){let Y=!1;if(LG($,Z,J,H,B,Q))Y=!Y;if(LG($,Z,B,Q,X,z))Y=!Y;if(LG($,Z,X,z,G,U))Y=!Y;if(LG($,Z,G,U,J,H))Y=!Y;return Y}function N10($,Z,J){return $>=J.x&&$<=J.x+J.width&&Z>=J.y&&Z<=J.y+J.height}function PG($,Z,J,H,B,Q){let X=Math.min(J,B),z=Math.max(J,B),G=Math.min(H,Q),U=Math.max(H,Q);return $>=X&&$<=z&&Z>=G&&Z<=U}function J9($={}){let{blockPointerEvents:Z=!1}=$,J=new r5,H=({x:B,y:Q,placement:X,elements:z,onClose:G,nodeId:U,tree:Y})=>{let K=X?.split("-")[0],F=!1,W=null,q=null,N=typeof performance<"u"?performance.now():0;function D(V,L){let O=performance.now(),M=O-N;if(W===null||q===null||M===0)return W=V,q=L,N=O,!1;let _=V-W,w=L-q,C=_*_+w*w,E=M*M*q10;return W=V,q=L,N=O,C<E}function A(){J.clear(),G()}return function(L){J.clear();let{domReference:O,floating:M}=z;if(!O||!M||K==null||B==null||Q==null)return;let{clientX:_,clientY:w}=L,C=V1(L),E=L.type==="mouseleave",j=R0(M,C),k=R0(O,C);if(j){if(F=!0,!E)return}if(k){if(F=!1,!E){F=!0;return}}if(E&&n0(L.relatedTarget)&&R0(M,L.relatedTarget))return;function S(){return Boolean(Y&&j8(Y.nodesRef.current,U).length>0)}function I(){if(!S())A()}if(S())return;let T=O.getBoundingClientRect(),y=M.getBoundingClientRect(),R=B>y.right-y.width/2,x=Q>y.bottom-y.height/2,v=y.width>T.width,f=y.height>T.height,b=(v?T:y).left,l=(v?T:y).right,r=(f?T:y).top,h=(f?T:y).bottom;if(K==="top"&&Q>=T.bottom-1||K==="bottom"&&Q<=T.top+1||K==="left"&&B>=T.right-1||K==="right"&&B<=T.left+1){I();return}let d=!1;switch(K){case"top":d=PG(_,w,b,T.top+1,l,y.bottom-1);break;case"bottom":d=PG(_,w,b,y.top+1,l,T.bottom-1);break;case"left":d=PG(_,w,y.right-1,h,T.left+1,r);break;case"right":d=PG(_,w,T.right-1,h,y.left+1,r);break;default:}if(d)return;if(F&&!N10(_,w,T)){I();return}if(!E&&D(_,w)){I();return}let o=!1;switch(K){case"top":{let p=v?M5/2:M5*4,i=v?B+p:R?B+p:B-p,n=v?B-p:R?B+p:B-p,Z0=Q+M5+1,J0=R?y.bottom-M5:v?y.bottom-M5:y.top,U0=R?v?y.bottom-M5:y.top:y.bottom-M5;o=MG(_,w,i,Z0,n,Z0,y.left,J0,y.right,U0);break}case"bottom":{let p=v?M5/2:M5*4,i=v?B+p:R?B+p:B-p,n=v?B-p:R?B+p:B-p,Z0=Q-M5,J0=R?y.top+M5:v?y.top+M5:y.bottom,U0=R?v?y.top+M5:y.bottom:y.top+M5;o=MG(_,w,i,Z0,n,Z0,y.left,J0,y.right,U0);break}case"left":{let p=f?M5/2:M5*4,i=f?Q+p:x?Q+p:Q-p,n=f?Q-p:x?Q+p:Q-p,Z0=B+M5+1,J0=x?y.right-M5:f?y.right-M5:y.left,U0=x?f?y.right-M5:y.left:y.right-M5;o=MG(_,w,J0,y.top,U0,y.bottom,Z0,i,Z0,n);break}case"right":{let p=f?M5/2:M5*4,i=f?Q+p:x?Q+p:Q-p,n=f?Q-p:x?Q+p:Q-p,Z0=B-M5,J0=x?y.left+M5:f?y.left+M5:y.right,U0=x?f?y.left+M5:y.right:y.left+M5;o=MG(_,w,Z0,i,Z0,n,J0,y.top,U0,y.bottom);break}default:}if(!o)I();else if(!F)J.start(40,I);return}};return H.__options={...$,blockPointerEvents:Z},H}function JE($,Z,J){let{reference:H,floating:B}=$,Q=p4(Z),X=MB(Z),z=LB(X),G=H4(Z),U=Q==="y",Y=H.x+H.width/2-B.width/2,K=H.y+H.height/2-B.height/2,F=H[z]/2-B[z]/2,W;switch(G){case"top":W={x:Y,y:H.y-B.height};break;case"bottom":W={x:Y,y:H.y+H.height};break;case"right":W={x:H.x+H.width,y:K};break;case"left":W={x:H.x-B.width,y:K};break;default:W={x:H.x,y:H.y}}let q=T8(Z);if(q)W[X]+=F*(q==="end"?1:-1)*(J&&U?-1:1);return W}async function HE($,Z){var J;if(Z===void 0)Z={};let{x:H,y:B,platform:Q,rects:X,elements:z,strategy:G}=$,{boundary:U="clippingAncestors",rootBoundary:Y="viewport",elementContext:K="floating",altBoundary:F=!1,padding:W=0}=w9(Z,$),q=mz(W),D=z[F?K==="floating"?"reference":"floating":K],A=Z$(await Q.getClippingRect({element:((J=await(Q.isElement==null?void 0:Q.isElement(D)))!=null?J:!0)?D:D.contextElement||await(Q.getDocumentElement==null?void 0:Q.getDocumentElement(z.floating)),boundary:U,rootBoundary:Y,strategy:G})),V=K==="floating"?{x:H,y:B,width:X.floating.width,height:X.floating.height}:X.reference,L=await(Q.getOffsetParent==null?void 0:Q.getOffsetParent(z.floating)),O=await(Q.isElement==null?void 0:Q.isElement(L))&&await(Q.getScale==null?void 0:Q.getScale(L))||{x:1,y:1},M=Z$(Q.convertOffsetParentRelativeRectToViewportRelativeRect?await Q.convertOffsetParentRelativeRectToViewportRelativeRect({elements:z,rect:V,offsetParent:L,strategy:G}):V);return{top:(A.top-M.top+q.top)/O.y,bottom:(M.bottom-A.bottom+q.bottom)/O.y,left:(A.left-M.left+q.left)/O.x,right:(M.right-A.right+q.right)/O.x}}var A10=50,BE=async($,Z,J)=>{let{placement:H="bottom",strategy:B="absolute",middleware:Q=[],platform:X}=J,z=X.detectOverflow?X:{...X,detectOverflow:HE},G=await(X.isRTL==null?void 0:X.isRTL(Z)),U=await X.getElementRects({reference:$,floating:Z,strategy:B}),{x:Y,y:K}=JE(U,H,G),F=H,W=0,q={};for(let N=0;N<Q.length;N++){let D=Q[N];if(!D)continue;let{name:A,fn:V}=D,{x:L,y:O,data:M,reset:_}=await V({x:Y,y:K,initialPlacement:H,placement:F,strategy:B,middlewareData:q,rects:U,platform:z,elements:{reference:$,floating:Z}});if(Y=L!=null?L:Y,K=O!=null?O:K,q[A]={...q[A],...M},_&&W<A10){if(W++,typeof _==="object"){if(_.placement)F=_.placement;if(_.rects)U=_.rects===!0?await X.getElementRects({reference:$,floating:Z,strategy:B}):_.rects;({x:Y,y:K}=JE(U,F,G))}N=-1}}return{x:Y,y:K,placement:F,strategy:B,middlewareData:q}};var QE=function($){if($===void 0)$={};return{name:"flip",options:$,async fn(Z){var J,H;let{placement:B,middlewareData:Q,rects:X,initialPlacement:z,platform:G,elements:U}=Z,{mainAxis:Y=!0,crossAxis:K=!0,fallbackPlacements:F,fallbackStrategy:W="bestFit",fallbackAxisSideDirection:q="none",flipAlignment:N=!0,...D}=w9($,Z);if((J=Q.arrow)!=null&&J.alignmentOffset)return{};let A=H4(B),V=p4(z),L=H4(z)===z,O=await(G.isRTL==null?void 0:G.isRTL(U.floating)),M=F||(L||!N?[DB(z)]:jT(z)),_=q!=="none";if(!F&&_)M.push(...TT(z,N,q,O));let w=[z,...M],C=await G.detectOverflow(Z,D),E=[],j=((H=Q.flip)==null?void 0:H.overflows)||[];if(Y)E.push(C[A]);if(K){let T=OT(B,X,O);E.push(C[T[0]],C[T[1]])}if(j=[...j,{placement:B,overflows:E}],!E.every((T)=>T<=0)){var k,S;let T=(((k=Q.flip)==null?void 0:k.index)||0)+1,y=w[T];if(y){if(!(K==="alignment"?V!==p4(y):!1)||j.every((v)=>p4(v.placement)===V?v.overflows[0]>0:!0))return{data:{index:T,overflows:j},reset:{placement:y}}}let R=(S=j.filter((x)=>x.overflows[0]<=0).sort((x,v)=>x.overflows[1]-v.overflows[1])[0])==null?void 0:S.placement;if(!R)switch(W){case"bestFit":{var I;let x=(I=j.filter((v)=>{if(_){let f=p4(v.placement);return f===V||f==="y"}return!0}).map((v)=>[v.placement,v.overflows.filter((f)=>f>0).reduce((f,b)=>f+b,0)]).sort((v,f)=>v[1]-f[1])[0])==null?void 0:I[0];if(x)R=x;break}case"initialPlacement":R=z;break}if(B!==R)return{reset:{placement:R}}}return{}}}};var XE=new Set(["left","top"]);async function D10($,Z){let{placement:J,platform:H,elements:B}=$,Q=await(H.isRTL==null?void 0:H.isRTL(B.floating)),X=H4(J),z=T8(J),G=p4(J)==="y",U=XE.has(X)?-1:1,Y=Q&&G?-1:1,K=w9(Z,$),{mainAxis:F,crossAxis:W,alignmentAxis:q}=typeof K==="number"?{mainAxis:K,crossAxis:0,alignmentAxis:null}:{mainAxis:K.mainAxis||0,crossAxis:K.crossAxis||0,alignmentAxis:K.alignmentAxis};if(z&&typeof q==="number")W=z==="end"?q*-1:q;return G?{x:W*Y,y:F*U}:{x:F*U,y:W*Y}}var zE=function($){if($===void 0)$=0;return{name:"offset",options:$,async fn(Z){var J,H;let{x:B,y:Q,placement:X,middlewareData:z}=Z,G=await D10(Z,$);if(X===((J=z.offset)==null?void 0:J.placement)&&(H=z.arrow)!=null&&H.alignmentOffset)return{};return{x:B+G.x,y:Q+G.y,data:{...G,placement:X}}}}},GE=function($){if($===void 0)$={};return{name:"shift",options:$,async fn(Z){let{x:J,y:H,placement:B,platform:Q}=Z,{mainAxis:X=!0,crossAxis:z=!1,limiter:G={fn:(V)=>{let{x:L,y:O}=V;return{x:L,y:O}}},...U}=w9($,Z),Y={x:J,y:H},K=await Q.detectOverflow(Z,U),F=p4(B),W=gz(F),q=Y[W],N=Y[F],D=(V,L)=>fz(L+K[V==="y"?"top":"left"],L,L-K[V==="y"?"bottom":"right"]);if(X)q=D(W,q);if(z)N=D(F,N);let A=G.fn({...Z,[W]:q,[F]:N});return{...A,data:{x:A.x-J,y:A.y-H,enabled:{[W]:X,[F]:z}}}}}},UE=function($){if($===void 0)$={};return{options:$,fn(Z){var J,H;let{x:B,y:Q,placement:X,rects:z,middlewareData:G}=Z,{offset:U=0,mainAxis:Y=!0,crossAxis:K=!0}=w9($,Z),F={x:B,y:Q},W=p4(X),q=gz(W),N=F[q],D=F[W],A=w9(U,Z),V=typeof A==="number"?{mainAxis:A,crossAxis:0}:{mainAxis:(J=A.mainAxis)!=null?J:0,crossAxis:(H=A.crossAxis)!=null?H:0};if(Y){let M=q==="y"?"height":"width",_=z.reference[q]-z.floating[M]+V.mainAxis,w=z.reference[q]+z.reference[M]-V.mainAxis;if(N<_)N=_;else if(N>w)N=w}if(K){var L,O;let M=q==="y"?"width":"height",_=XE.has(H4(X)),w=z.reference[W]-z.floating[M]+(_?((L=G.offset)==null?void 0:L[W])||0:0)+(_?0:V.crossAxis),C=z.reference[W]+z.reference[M]+(_?0:((O=G.offset)==null?void 0:O[W])||0)-(_?V.crossAxis:0);if(D<w)D=w;else if(D>C)D=C}return{[q]:N,[W]:D}}}},YE=function($){if($===void 0)$={};return{name:"size",options:$,async fn(Z){let{placement:J,rects:H,platform:B,elements:Q}=Z,{apply:X=()=>{},...z}=w9($,Z),G=await B.detectOverflow(Z,z),U=H4(J),Y=T8(J),K=p4(J)==="y",{width:F,height:W}=H.floating,q,N;if(U==="top"||U==="bottom")q=U,N=Y===(await(B.isRTL==null?void 0:B.isRTL(Q.floating))?"start":"end")?"left":"right";else N=U,q=Y==="end"?"top":"bottom";let D=W-G.top-G.bottom,A=F-G.left-G.right,V=Y6(W-G[q],D),L=Y6(F-G[N],A),O=Z.middlewareData.shift,M=!O,_=V,w=L;if(O!=null&&O.enabled.x)w=A;if(O!=null&&O.enabled.y)_=D;if(M&&!Y)if(K)w=F-2*a8(G.left,G.right);else _=W-2*a8(G.top,G.bottom);await X({...Z,availableWidth:w,availableHeight:_});let C=await B.getDimensions(Q.floating);if(F!==C.width||W!==C.height)return{reset:{rects:!0}};return{}}}};function NE($){let Z=u2($),J=parseFloat(Z.width)||0,H=parseFloat(Z.height)||0,B=L1($),Q=B?$.offsetWidth:J,X=B?$.offsetHeight:H,z=K6(J)!==Q||K6(H)!==X;if(z)J=Q,H=X;return{width:J,height:H,$:z}}function $D($){return!n0($)?$.contextElement:$}function pZ($){let Z=$D($);if(!L1(Z))return b9(1);let J=Z.getBoundingClientRect(),{width:H,height:B,$:Q}=NE(Z),X=(Q?K6(J.width):J.width)/H,z=(Q?K6(J.height):J.height)/B;if(!X||!Number.isFinite(X))X=1;if(!z||!Number.isFinite(z))z=1;return{x:X,y:z}}var V10=b9(0);function AE($){let Z=I1($);if(!eA()||!Z.visualViewport)return V10;return{x:Z.visualViewport.offsetLeft,y:Z.visualViewport.offsetTop}}function L10($,Z,J){if(Z===void 0)Z=!1;return!!J&&Z&&J===I1($)}function q$($,Z,J,H){if(Z===void 0)Z=!1;if(J===void 0)J=!1;let B=$.getBoundingClientRect(),Q=$D($),X=b9(1);if(Z)if(H){if(n0(H))X=pZ(H)}else X=pZ($);let z=L10(Q,J,H)?AE(Q):b9(0),G=(B.left+z.x)/X.x,U=(B.top+z.y)/X.y,Y=B.width/X.x,K=B.height/X.y;if(Q&&H){let F=I1(Q),W=n0(H)?I1(H):H,q=F,N=sA(q);while(N&&W!==q){let D=pZ(N),A=N.getBoundingClientRect(),V=u2(N),L=A.left+(N.clientLeft+parseFloat(V.paddingLeft))*D.x,O=A.top+(N.clientTop+parseFloat(V.paddingTop))*D.y;G*=D.x,U*=D.y,Y*=D.x,K*=D.y,G+=L,U+=O,q=I1(N),N=sA(q)}}return Z$({width:Y,height:K,x:G,y:U})}function OG($,Z){let J=bB($).scrollLeft;if(!Z)return q$(R3($)).left+J;return Z.left+J}function DE($,Z){let J=$.getBoundingClientRect(),H=J.left+Z.scrollLeft-OG($,J),B=J.top+Z.scrollTop;return{x:H,y:B}}function M10($){let{elements:Z,rect:J,offsetParent:H,strategy:B}=$,Q=B==="fixed",X=R3(H),z=Z?_G(Z.floating):!1;if(H===X||z&&Q)return J;let G={scrollLeft:0,scrollTop:0},U=b9(1),Y=b9(0),K=L1(H);if(K||!Q){if(b2(H)!=="body"||EB(X))G=bB(H);if(K){let W=q$(H);U=pZ(H),Y.x=W.x+H.clientLeft,Y.y=W.y+H.clientTop}}let F=X&&!K&&!Q?DE(X,G):b9(0);return{width:J.width*U.x,height:J.height*U.y,x:J.x*U.x-G.scrollLeft*U.x+Y.x+F.x,y:J.y*U.y-G.scrollTop*U.y+Y.y+F.y}}function P10($){return $.getClientRects?Array.from($.getClientRects()):[]}function _10($){let Z=bB($),J=$.ownerDocument.body,H=a8($.scrollWidth,$.clientWidth,J.scrollWidth,J.clientWidth),B=a8($.scrollHeight,$.clientHeight,J.scrollHeight,J.clientHeight),Q=-Z.scrollLeft+OG($),X=-Z.scrollTop;if(u2(J).direction==="rtl")Q+=a8($.clientWidth,J.clientWidth)-H;return{width:H,height:B,x:Q,y:X}}var O10=25;function j10($,Z,J){if(J===void 0)J="viewport";let H=J==="layoutViewport",B=I1($),Q=R3($),X=B.visualViewport,z=Q.clientWidth,G=Q.clientHeight,U=0,Y=0;if(X){let F=!eA()||Z==="fixed";if(H){if(!F)U=-X.offsetLeft,Y=-X.offsetTop}else if(z=X.width,G=X.height,F)U=X.offsetLeft,Y=X.offsetTop}if(OG(Q)<=0){let F=Q.ownerDocument,W=F.body,q=getComputedStyle(W),N=F.compatMode==="CSS1Compat"?parseFloat(q.marginLeft)+parseFloat(q.marginRight)||0:0,D=Math.abs(Q.clientWidth-W.clientWidth-N),A=getComputedStyle(Q).scrollbarGutter==="stable both-edges"?D/2:D;if(A<=O10)z-=A}return{width:z,height:G,x:U,y:Y}}function T10($,Z){let J=q$($,!0,Z==="fixed"),H=J.top+$.clientTop,B=J.left+$.clientLeft,Q=pZ($),X=$.clientWidth*Q.x,z=$.clientHeight*Q.y,G=B*Q.x,U=H*Q.y;return{width:X,height:z,x:G,y:U}}function KE($,Z,J){let H;if(Z==="viewport"||Z==="layoutViewport")H=j10($,J,Z);else if(Z==="document")H=_10(R3($));else if(n0(Z))H=T10(Z,J);else{let B=AE($);H={x:Z.x-B.x,y:Z.y-B.y,width:Z.width,height:Z.height}}return Z$(H)}function C10($,Z){let J=Z.get($);if(J)return J;let H=cZ($,[],!1).filter((z)=>n0(z)&&b2(z)!=="body"),B=null,Q=u2($).position==="fixed",X=Q?S8($):$;while(n0(X)&&!w8(X)){let z=u2(X),G=tA(X),U=B?B.position:Q?"fixed":"";if(!G&&(U==="fixed"||U==="absolute"&&z.position==="static"))H=H.filter((K)=>K!==X);else B=z;X=S8(X)}return Z.set($,H),H}function E10($){let{element:Z,boundary:J,rootBoundary:H,strategy:B}=$,X=[...J==="clippingAncestors"?_G(Z)?[]:C10(Z,this._c):[].concat(J),H],z=KE(Z,X[0],B),G=z.top,U=z.right,Y=z.bottom,K=z.left;for(let F=1;F<X.length;F++){let W=KE(Z,X[F],B);G=a8(W.top,G),U=Y6(W.right,U),Y=Y6(W.bottom,Y),K=a8(W.left,K)}return{width:U-K,height:Y-G,x:K,y:G}}function b10($){let{width:Z,height:J}=NE($);return{width:Z,height:J}}function w10($,Z,J){let H=L1(Z),B=R3(Z),Q=J==="fixed",X=q$($,!0,Q,Z),z={scrollLeft:0,scrollTop:0},G=b9(0);if(H||!Q){if(b2(Z)!=="body"||EB(B))z=bB(Z);if(H){let F=q$(Z,!0,Q,Z);G.x=F.x+Z.clientLeft,G.y=F.y+Z.clientTop}}if(!H&&B)G.x=OG(B);let U=B&&!H&&!Q?DE(B,z):b9(0),Y=X.left+z.scrollLeft-G.x-U.x,K=X.top+z.scrollTop-G.y-U.y;return{x:Y,y:K,width:X.width,height:X.height}}function nA($){return u2($).position==="static"}function FE($,Z){if(!L1($)||u2($).position==="fixed")return null;if(Z)return Z($);let J=$.offsetParent;if(R3($)===J)J=J.ownerDocument.body;return J}function VE($,Z){let J=I1($);if(_G($))return J;if(!L1($)){let B=S8($);while(B&&!w8(B)){if(n0(B)&&!nA(B))return B;B=S8(B)}return J}let H=FE($,Z);while(H&&WE(H)&&nA(H))H=FE(H,Z);if(H&&w8(H)&&nA(H)&&!tA(H))return J;return H||qE($)||J}var S10=async function($){let Z=this.getOffsetParent||VE,J=this.getDimensions,H=await J($.floating);return{reference:w10($.reference,await Z($.floating),$.strategy),floating:{x:0,y:0,width:H.width,height:H.height}}};function R10($){return u2($).direction==="rtl"}var ZD={convertOffsetParentRelativeRectToViewportRelativeRect:M10,getDocumentElement:R3,getClippingRect:E10,getOffsetParent:VE,getElementRects:S10,getClientRects:P10,getDimensions:b10,getScale:pZ,isElement:n0,isRTL:R10};function LE($,Z){return $.x===Z.x&&$.y===Z.y&&$.width===Z.width&&$.height===Z.height}function I10($,Z,J){let H=null,B,Q=R3($);function X(){var Y;clearTimeout(B),(Y=H)==null||Y.disconnect(),H=null}function z(Y,K){if(Y===void 0)Y=!1;if(K===void 0)K=1;X();let F=$.getBoundingClientRect(),{left:W,top:q,width:N,height:D}=F;if(!Y)Z();if(!N||!D)return;let A=VB(q),V=VB(Q.clientWidth-(W+N)),L=VB(Q.clientHeight-(q+D)),O=VB(W),_={rootMargin:-A+"px "+-V+"px "+-L+"px "+-O+"px",threshold:a8(0,Y6(1,K))||1},w=!0;function C(E){let j=E[0].intersectionRatio;if(!LE(F,$.getBoundingClientRect()))return z();if(j!==K){if(!w)return z();if(!j)B=setTimeout(()=>{z(!1,0.0000001)},1000);else z(!1,j)}w=!1}try{H=new IntersectionObserver(C,{..._,root:Q.ownerDocument})}catch(E){H=new IntersectionObserver(C,_)}H.observe($)}let G=I1($),U=()=>z(J);return G.addEventListener("resize",U),z(!0),()=>{G.removeEventListener("resize",U),X()}}function wB($,Z,J,H){if(H===void 0)H={};let{ancestorScroll:B=!0,ancestorResize:Q=!0,elementResize:X=typeof ResizeObserver==="function",layoutShift:z=typeof IntersectionObserver==="function",animationFrame:G=!1}=H,U=$D($),Y=B||Q?[...U?cZ(U):[],...Z?cZ(Z):[]]:[];Y.forEach((A)=>{B&&A.addEventListener("scroll",J),Q&&A.addEventListener("resize",J)});let K=U&&z?I10(U,J,Q):null,F=-1,W=null;if(X){if(W=new ResizeObserver((A)=>{let[V]=A;if(V&&V.target===U&&W&&Z)W.unobserve(Z),cancelAnimationFrame(F),F=requestAnimationFrame(()=>{var L;(L=W)==null||L.observe(Z)});J()}),U&&!G)W.observe(U);if(Z)W.observe(Z)}let q,N=G?q$($):null;if(G)D();function D(){let A=q$($);if(N&&!LE(N,A))J();N=A,q=requestAnimationFrame(D)}return J(),()=>{var A;if(Y.forEach((V)=>{B&&V.removeEventListener("scroll",J),Q&&V.removeEventListener("resize",J)}),K==null||K(),(A=W)==null||A.disconnect(),W=null,G)cancelAnimationFrame(q)}}var ME=zE;var PE=GE,_E=QE,OE=YE;var jE=UE,jG=($,Z,J)=>{let H=new Map,B=J!=null?J:{},Q={...ZD,...B.platform,_c:H};return BE($,Z,{...B,platform:Q})};var U2=P(m(),1),CE=P(m(),1),EE=P(U8(),1),y10=typeof document<"u",x10=function(){},TG=y10?CE.useLayoutEffect:x10;function CG($,Z){if($===Z)return!0;if(typeof $!==typeof Z)return!1;if(typeof $==="function"&&$.toString()===Z.toString())return!0;let J,H,B;if($&&Z&&typeof $==="object"){if(Array.isArray($)){if(J=$.length,J!==Z.length)return!1;for(H=J;H--!==0;)if(!CG($[H],Z[H]))return!1;return!0}if(B=Object.keys($),J=B.length,J!==Object.keys(Z).length)return!1;for(H=J;H--!==0;)if(!{}.hasOwnProperty.call(Z,B[H]))return!1;for(H=J;H--!==0;){let Q=B[H];if(Q==="_owner"&&$.$$typeof)continue;if(!CG($[Q],Z[Q]))return!1}return!0}return $!==$&&Z!==Z}function bE($){if(typeof window>"u")return 1;return($.ownerDocument.defaultView||window).devicePixelRatio||1}function TE($,Z){let J=bE($);return Math.round(Z*J)/J}function JD($){let Z=U2.useRef($);return TG(()=>{Z.current=$}),Z}function wE($){if($===void 0)$={};let{placement:Z="bottom",strategy:J="absolute",middleware:H=[],platform:B,elements:{reference:Q,floating:X}={},transform:z=!0,whileElementsMounted:G,open:U}=$,[Y,K]=U2.useState({x:0,y:0,strategy:J,placement:Z,middlewareData:{},isPositioned:!1}),[F,W]=U2.useState(H);if(!CG(F,H))W(H);let[q,N]=U2.useState(null),[D,A]=U2.useState(null),V=U2.useCallback((v)=>{if(v!==_.current)_.current=v,N(v)},[]),L=U2.useCallback((v)=>{if(v!==w.current)w.current=v,A(v)},[]),O=Q||q,M=X||D,_=U2.useRef(null),w=U2.useRef(null),C=U2.useRef(Y),E=G!=null,j=JD(G),k=JD(B),S=JD(U),I=U2.useCallback(()=>{if(!_.current||!w.current)return;let v={placement:Z,strategy:J,middleware:F};if(k.current)v.platform=k.current;jG(_.current,w.current,v).then((f)=>{let b={...f,isPositioned:S.current!==!1};if(T.current&&!CG(C.current,b))C.current=b,EE.flushSync(()=>{K(b)})})},[F,Z,J,k,S]);TG(()=>{if(U===!1&&C.current.isPositioned)C.current.isPositioned=!1,K((v)=>({...v,isPositioned:!1}))},[U]);let T=U2.useRef(!1);TG(()=>{return T.current=!0,()=>{T.current=!1}},[]),TG(()=>{if(O)_.current=O;if(M)w.current=M;if(O&&M){if(j.current)return j.current(O,M,I);I()}},[O,M,I,j,E]);let y=U2.useMemo(()=>({reference:_,floating:w,setReference:V,setFloating:L}),[V,L]),R=U2.useMemo(()=>({reference:O,floating:M}),[O,M]),x=U2.useMemo(()=>{let v={position:J,left:0,top:0};if(!R.floating)return v;let f=TE(R.floating,Y.x),b=TE(R.floating,Y.y);if(z)return{...v,transform:"translate("+f+"px, "+b+"px)",...bE(R.floating)>=1.5&&{willChange:"transform"}};return{position:J,left:f,top:b}},[J,z,R.floating,Y.x,Y.y]);return U2.useMemo(()=>({...Y,update:I,refs:y,elements:R,floatingStyles:x}),[Y,I,y,R,x])}var HD=($,Z)=>{let J=ME($);return{name:J.name,fn:J.fn,options:[$,Z]}},BD=($,Z)=>{let J=PE($);return{name:J.name,fn:J.fn,options:[$,Z]}},QD=($,Z)=>{return{fn:jE($).fn,options:[$,Z]}},XD=($,Z)=>{let J=_E($);return{name:J.name,fn:J.fn,options:[$,Z]}},zD=($,Z)=>{let J=OE($);return{name:J.name,fn:J.fn,options:[$,Z]}};var X4=P(m(),1);function SE($){return h10($,$.rootContext)}function h10($,Z){let{nodeId:J,externalTree:H}=$,B=Z.useState("referenceElement"),Q=Z.useState("floatingElement"),X=Z.useState("domReferenceElement"),z=Z.useState("open"),G=Z.useState("floatingId"),[U,Y]=X4.useState(null),[K,F]=X4.useState(void 0),[W,q]=X4.useState(void 0),N=X4.useRef(null),D=B4(H),A=X4.useMemo(()=>({reference:B,floating:Q,domReference:X}),[B,Q,X]),V=wE({...$,elements:{...A,...U&&{reference:U}}}),L=n0(K)?K:null,O=W===void 0?Z.state.floatingElement:W;Z.useSyncedValue("referenceElement",K??null),Z.useSyncedValue("domReferenceElement",K===void 0?X:L),Z.useSyncedValue("floatingElement",O);let M=X4.useCallback((k)=>{let S=n0(k)?{getBoundingClientRect:()=>k.getBoundingClientRect(),getClientRects:()=>k.getClientRects(),contextElement:k}:k;Y(S),V.refs.setReference(S)},[V.refs]),_=X4.useCallback((k)=>{if(n0(k)||k===null)N.current=k,F(k);if(n0(V.refs.reference.current)||V.refs.reference.current===null||k!==null&&!n0(k))V.refs.setReference(k)},[V.refs,F]),w=X4.useCallback((k)=>{q(k),V.refs.setFloating(k)},[V.refs]),C=X4.useMemo(()=>({...V.refs,setReference:_,setFloating:w,setPositionReference:M,domReference:N}),[V.refs,_,w,M]),E=X4.useMemo(()=>({...V.elements,domReference:X}),[V.elements,X]),j=X4.useMemo(()=>({...V,dataRef:Z.context.dataRef,open:z,onOpenChange:Z.setOpen,events:Z.context.events,floatingId:G,refs:C,elements:E,nodeId:J,rootStore:Z}),[V,C,E,J,Z,z,G]);return H0(()=>{if(X)N.current=X},[X]),H0(()=>{Z.context.dataRef.current.floatingContext=j;let k=D?.nodesRef.current.find((S)=>S.id===J);if(k)k.context=j}),X4.useMemo(()=>({...V,context:j,refs:C,elements:E,rootStore:Z}),[V,C,E,j,Z])}var EG=P(m(),1),v10=EG.createContext(void 0);function i4(){return EG.useContext(v10)?.direction??"ltr"}var f10=($)=>({name:"arrow",options:$,async fn(Z){let{x:J,y:H,placement:B,rects:Q,platform:X,elements:z,middlewareData:G}=Z,{element:U,padding:Y=0,offsetParent:K="real"}=w9($,Z)||{};if(U==null)return{};let F=mz(Y),W={x:J,y:H},q=MB(B),N=LB(q),D=await X.getDimensions(U),A=q==="y",V=A?"top":"left",L=A?"bottom":"right",O=A?"clientHeight":"clientWidth",M=Q.reference[N]+Q.reference[q]-W[q]-Q.floating[N],_=W[q]-Q.reference[q],w=K==="real"?await X.getOffsetParent?.(U):z.floating,C=z.floating[O]||Q.floating[N];if(!C||!await X.isElement?.(w))C=z.floating[O]||Q.floating[N];let E=M/2-_/2,j=C/2-D[N]/2-1,k=Math.min(F[V],j),S=Math.min(F[L],j),I=k,T=C-D[N]-S,y=C/2-D[N]/2+E,R=fz(I,y,T),x=!G.arrow&&T8(B)!=null&&y!==R&&Q.reference[N]/2-(y<I?k:S)-D[N]/2<0,v=x?y<I?y-I:y-T:0;return{[q]:W[q]+v,data:{[q]:R,centerOffset:y-R-v,...x&&{alignmentOffset:v}},reset:x}}}),RE=($,Z)=>{let{name:J,fn:H}=f10($);return{name:J,fn:H,options:[$,Z]}};var IE={name:"hide",async fn($){let{width:Z,height:J,x:H,y:B}=$.rects.reference,Q=Z===0&&J===0&&H===0&&B===0,X=await $.platform.detectOverflow($,{elementContext:"reference"});return{data:{referenceHidden:X.top-J>=0||X.right-Z>=0||X.bottom-J>=0||X.left-Z>=0||Q}}}};var dZ={sideX:"left",sideY:"top"};var bG="--available-width",wG="--available-height",kE="--anchor-width",yE="--anchor-height",xE="--transform-origin",hE="--positioner-width",vE="--positioner-height";var gE=bG,mE=wG;function cE($,Z,J){let H=$==="inline-start"||$==="inline-end";return{top:"top",right:H?J?"inline-start":"inline-end":"right",bottom:"bottom",left:H?J?"inline-end":"inline-start":"left"}[Z]}function uE($,Z,J){let{rects:H,placement:B}=$;return{side:cE(Z,H4(B),J),align:T8(B)||"center",anchor:{width:H.reference.width,height:H.reference.height},positioner:{width:H.floating.width,height:H.floating.height}}}function u9($){return g10($,SE)}function g10($,Z){let{anchor:J,positionMethod:H="absolute",side:B="bottom",sideOffset:Q=0,align:X="center",alignOffset:z=0,collisionBoundary:G,collisionPadding:U=5,sticky:Y=!1,arrowPadding:K=5,disableAnchorTracking:F=!1,inline:W,keepMounted:q=!1,floatingRootContext:N,mounted:D,collisionAvoidance:A,shift:V,nodeId:L,adaptiveOrigin:O,lazyFlip:M=!1,externalTree:_}=$,[w,C]=Y8.useState(null);if(!D&&w!==null)C(null);let E=A.side||"flip",j=A.align||"flip",k=A.fallbackAxisSide||"end",S=V?.crossAxis??!1,I=V?.rootBoundary,T=typeof J==="function"?J:void 0,y=Y0(T),R=T?y:J,x=W5(J),v=W5(D),b=i4()==="rtl",l=w||{top:"top",right:"right",bottom:"bottom",left:"left","inline-end":b?"left":"right","inline-start":b?"right":"left"}[B],r=X==="center"?l:`${l}-${X}`,h=U;if(typeof h==="number")h={top:h,right:h,bottom:h,left:h};else if(h)h={top:h.top||0,right:h.right||0,bottom:h.bottom||0,left:h.left||0};let d=1,o=B==="bottom"?d:0,p=B==="top"?d:0,i=B==="right"?d:0,n=B==="left"?d:0,Z0={boundary:G==="clipping-ancestors"?"clippingAncestors":G,padding:h},J0=Y8.useRef(null),U0=W5(Q),z0=W5(z),X0=typeof Q!=="function"?Q:0,q0=typeof z!=="function"?z:0,N0=[];if(W)N0.push(W);N0.push(HD((C0)=>{let p0=uE(C0,B,b),r0=typeof U0.current==="function"?U0.current(p0):U0.current,o0=typeof z0.current==="function"?z0.current(p0):z0.current;return{mainAxis:r0,crossAxis:o0,alignmentAxis:o0}},[X0,q0,b,B]));let F0=j==="none"&&E!=="shift",s=!F0&&(Y||S||E==="shift"),a=E==="none"?null:XD({...Z0,padding:{top:h.top+d+o,right:h.right+d+n,bottom:h.bottom+d+p,left:h.left+d+i},mainAxis:!S&&E==="flip",crossAxis:j==="flip"?"alignment":!1,fallbackAxisSideDirection:k}),$0=F0?null:BD({...Z0,rootBoundary:I,mainAxis:j!=="none",crossAxis:s,limiter:Y||S?void 0:QD((C0)=>{if(!J0.current)return{};let{width:p0,height:r0}=J0.current.getBoundingClientRect(),o0=p4(H4(C0.placement)),D0=o0==="y"?p0:r0,y0=o0==="y"?h.left+h.right:h.top+h.bottom;return{offset:D0/2+y0/2}})},[Z0,Y,S,I,h,j]);if(E==="shift"||j==="shift"||X==="center")N0.push($0,a);else N0.push(a,$0);N0.push(zD({...Z0,apply({elements:{floating:C0},availableWidth:p0,availableHeight:r0,rects:o0}){if(!v.current)return;let D0=C0.style;D0.setProperty(gE,`${p0}px`),D0.setProperty(mE,`${r0}px`);let y0=I1(C0).devicePixelRatio||1,{x:W1,y:R1,width:f0,height:t0}=o0.reference,O1=(Math.round((W1+f0)*y0)-Math.round(W1*y0))/y0,j1=(Math.round((R1+t0)*y0)-Math.round(R1*y0))/y0;D0.setProperty(kE,`${O1}px`),D0.setProperty(yE,`${j1}px`)}}),RE((C0)=>({element:J0.current||m0(C0.elements.floating).createElement("div"),padding:J0.current?K:0,offsetParent:"floating"}),[K]),{name:"transformOrigin",fn(C0){let{elements:{floating:p0},middlewareData:r0,placement:o0,platform:D0,rects:y0,y:W1}=C0,R1=H4(o0),f0=T8(o0),t0=p4(R1)==="y",O1=J0.current,j1=typeof Q==="function"?Q(uE(C0,B,b)):Q,x0;if(!O1&&f0&&Math.abs(t0?r0.shift?.x||0:r0.shift?.y||0)<=1)x0=f0==="start"===(t0&&D0.isRTL?.(p0)===!0)?"100%":"0%";else{let l0=t0?r0.arrow?.x||0:r0.arrow?.y||0,P1=t0?O1?.clientWidth||0:O1?.clientHeight||0;x0=`${l0+P1/2}px`}let e0=R1==="top"||R1==="left"?`calc(100% + ${j1}px)`:`${-j1}px`;if(s&&t0&&Math.abs(r0.shift?.y||0)>j1)e0=`${y0.reference.y+y0.reference.height/2-W1}px`;return p0.style.setProperty(xE,t0?`${x0} ${e0}`:`${e0} ${x0}`),{}}},IE,O),H0(()=>{if(!D&&N)N.update({referenceElement:null,floatingElement:null,domReferenceElement:null,positionReference:null})},[D,N]);let t=Y8.useMemo(()=>({ancestorScroll:!F,elementResize:!F&&typeof ResizeObserver<"u",layoutShift:!F&&typeof IntersectionObserver<"u"}),[F]),{refs:B0,elements:_0,x:P0,y:A0,middlewareData:L0,update:g,placement:u,context:e,isPositioned:W0,floatingStyles:S0}=Z({rootContext:N,open:q?D:void 0,placement:r,middleware:N0,strategy:H,whileElementsMounted:q?void 0:(...C0)=>wB(...C0,t),nodeId:L,externalTree:_}),{sideX:h0,sideY:v0}=L0.adaptiveOrigin||dZ,T0=W0?H:"fixed",c0=Y8.useMemo(()=>{let C0;if(!W0)C0={position:T0,top:0,left:0};else if(O)C0={position:T0,[h0]:P0,[v0]:A0};else C0={...S0,position:T0};if(C0[gE]="100vw",C0[mE]="100vh",!W0)C0.opacity=0;return C0},[O,T0,h0,P0,v0,A0,S0,W0]),G1=Y8.useRef(null);H0(()=>{if(!D)return;let C0=x.current,p0=typeof C0==="function"?C0():C0,o0=(pE(p0)?p0.current:p0)||null||null;if(o0!==G1.current)B0.setPositionReference(o0),G1.current=o0},[D,B0,R,x]),Y8.useEffect(()=>{if(!D)return;let C0=x.current;if(typeof C0==="function")return;if(pE(C0)&&C0.current!==G1.current)B0.setPositionReference(C0.current),G1.current=C0.current},[D,B0,R,x]),Y8.useEffect(()=>{if(q&&D&&_0.reference&&_0.floating)return wB(_0.reference,_0.floating,g,t);return},[q,D,_0,g,t]);let A1=H4(u),d0=cE(B,A1,b),k0=T8(u)||"center",S1=Boolean(L0.hide?.referenceHidden);H0(()=>{if(M&&D&&W0&&A1!==l)C(A1)},[M,D,W0,A1,l]);let K1=Y8.useMemo(()=>({position:"absolute",top:L0.arrow?.y,left:L0.arrow?.x}),[L0.arrow]),z5=L0.arrow?.centerOffset!==0;return Y8.useMemo(()=>({positionerStyles:c0,arrowStyles:K1,arrowRef:J0,arrowUncentered:z5,side:d0,align:k0,physicalSide:A1,anchorHidden:S1,refs:B0,context:e,isPositioned:W0,update:g}),[c0,K1,J0,z5,d0,k0,A1,S1,B0,e,W0,g])}function pE($){return $!=null&&"current"in $}var SG=P(m(),1),GD=SG.createContext(void 0);function dE(){let $=SG.useContext(GD);if($===void 0)throw Error(I0(84));return $}function p9($){return $==="starting"?lT:D1}function c9($,Z,{styles:J,transitionStatus:H,props:B,refs:Q,hidden:X,inert:z=!1}){let G={...J};if(z)G.pointerEvents="none";return G0("div",$,{state:Z,ref:Q,props:[{role:"presentation",hidden:X,style:G},p9(H),B],stateAttributesMapping:z8})}var lE=P(c(),1),iE=RG.forwardRef(function(Z,J){let{toast:H,...B}=Z,Q=j9(),X=H.positionerProps??D1,{render:z,className:G,anchor:U=X.anchor,positionMethod:Y=X.positionMethod??"absolute",side:K=X.side??"top",align:F=X.align??"center",sideOffset:W=X.sideOffset??0,alignOffset:q=X.alignOffset??0,collisionBoundary:N=X.collisionBoundary??"clipping-ancestors",collisionPadding:D=X.collisionPadding??5,arrowPadding:A=X.arrowPadding??5,sticky:V=X.sticky??!1,disableAnchorTracking:L=X.disableAnchorTracking??!1,collisionAvoidance:O=X.collisionAvoidance??S9,style:M,..._}=B,[w,C]=RG.useState(null),E=Q.useState("toastIndex",H.id),j=Q.useState("toastVisibleIndex",H.id),k=n0(U)?U:null,S=cA({open:!0,onOpenChange:U1,elements:{floating:w,reference:k}}),I=u9({anchor:k,positionMethod:Y,floatingRootContext:S,mounted:!0,side:K,sideOffset:W,align:F,alignOffset:q,collisionBoundary:N,collisionPadding:D,sticky:V,arrowPadding:A,disableAnchorTracking:L,keepMounted:!0,collisionAvoidance:O}),T={side:I.side,align:I.align,anchorHidden:I.anchorHidden},y=c9(Z,T,{styles:{...I.positionerStyles,[tz]:H.transitionStatus==="ending"?E:j},transitionStatus:H.transitionStatus,props:_,refs:[J,C]});return lE.jsx(GD.Provider,{value:I,children:y})});var rE=P(m(),1);var aE=rE.forwardRef(function(Z,J){let{className:H,render:B,style:Q,...X}=Z,{arrowRef:z,side:G,align:U,arrowUncentered:Y,arrowStyles:K}=dE();return G0("div",Z,{state:{side:G,align:U,uncentered:Y},ref:[J,z],props:[{style:K,"aria-hidden":!0},X]})});var oE=P(m(),1);function nE(){let $=j9(),Z=$.useState("toasts");return oE.useMemo(()=>({toasts:Z,add:$.addToast,close:$.closeToast,update:$.updateToast,promise:$.promiseToast}),[Z,$])}function sE(){let $=new Set;function Z(J){$.forEach((H)=>H(J))}return{" subscribe":function(H){return $.add(H),()=>{$.delete(H)}},add(J){let H=J.id||Rz("toast"),B={...J,id:H,transitionStatus:"starting"};return Z({action:"add",options:B}),H},close(J){Z({action:"close",options:{id:J}})},update(J,H){Z({action:"update",options:{id:J,updates:H}})},promise(J,H){let B=J;return Z({action:"promise",options:{...H,promise:J,setPromise(Q){B=Q}}}),B}}}var H5=P(c(),1),e1=z4.createToastManager();function m10({...$}){return H5.jsx(z4.Provider,{...$})}function u10({...$}){return H5.jsx(z4.Portal,{"data-slot":"toast-portal",...$})}function p10({className:$,...Z}){return H5.jsx(z4.Viewport,{"data-slot":"toast-viewport",className:Q0("pointer-events-none fixed inset-x-4 bottom-4 z-50 mx-auto w-auto max-w-sm outline-none sm:right-4 sm:left-auto sm:mx-0 sm:w-full",$),...Z})}function c10({className:$,...Z}){return H5.jsx(z4.Root,{"data-slot":"toast",className:Q0("group/toast pointer-events-auto absolute right-0 bottom-0 z-[calc(1000-var(--toast-index))] w-full origin-bottom rounded-xl bg-popover text-popover-foreground shadow-lg will-change-transform outline-none select-none focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50","[--gap:0.75rem] [--height:var(--toast-frontmost-height,var(--toast-height))] [--offset-y:calc(var(--toast-offset-y)*-1+calc(var(--toast-index)*var(--gap)*-1)+var(--toast-swipe-movement-y))] [--peek:0.75rem] [--scale:calc(max(0,1-(var(--toast-index)*0.1)))] [--shrink:calc(1-var(--scale))]","h-(--height) [transform:translateX(var(--toast-swipe-movement-x))_translateY(calc(var(--toast-swipe-movement-y)-(var(--toast-index)*var(--peek))-(var(--shrink)*var(--height))))_scale(var(--scale))] [transition:transform_500ms_cubic-bezier(0.22,1,0.36,1),opacity_500ms,height_150ms]","after:absolute after:top-full after:left-0 after:h-[calc(var(--gap)+1px)] after:w-full after:content-['']","data-expanded:h-(--toast-height) data-expanded:[transform:translateX(var(--toast-swipe-movement-x))_translateY(var(--offset-y))]","data-limited:opacity-0 data-starting-style:[transform:translateY(150%)]","[&[data-ending-style]:not([data-limited]):not([data-swipe-direction])]:[transform:translateY(150%)]","data-ending-style:data-[swipe-direction=down]:[transform:translateY(calc(var(--toast-swipe-movement-y)+150%))]","data-ending-style:data-[swipe-direction=left]:[transform:translateX(calc(var(--toast-swipe-movement-x)-150%))_translateY(var(--offset-y))]","data-ending-style:data-[swipe-direction=right]:[transform:translateX(calc(var(--toast-swipe-movement-x)+150%))_translateY(var(--offset-y))]","data-ending-style:data-[swipe-direction=up]:[transform:translateY(calc(var(--toast-swipe-movement-y)-150%))]","data-expanded:data-ending-style:data-[swipe-direction=down]:[transform:translateY(calc(var(--toast-swipe-movement-y)+150%))]","data-expanded:data-ending-style:data-[swipe-direction=left]:[transform:translateX(calc(var(--toast-swipe-movement-x)-150%))_translateY(var(--offset-y))]","data-expanded:data-ending-style:data-[swipe-direction=right]:[transform:translateX(calc(var(--toast-swipe-movement-x)+150%))_translateY(var(--offset-y))]","data-expanded:data-ending-style:data-[swipe-direction=up]:[transform:translateY(calc(var(--toast-swipe-movement-y)-150%))]",$),...Z})}function d10({className:$,...Z}){return H5.jsx(z4.Content,{"data-slot":"toast-content",className:Q0("flex items-center gap-3 overflow-hidden p-4 transition-opacity duration-250 ease-[cubic-bezier(0.22,1,0.36,1)] data-behind:opacity-0 data-expanded:opacity-100",$),...Z})}function l10({className:$,...Z}){return H5.jsx(z4.Title,{"data-slot":"toast-title",className:Q0("text-sm font-medium",$),...Z})}function i10({className:$,...Z}){return H5.jsx(z4.Description,{"data-slot":"toast-description",className:Q0("text-sm text-muted-foreground",$),...Z})}function r10({className:$,render:Z=H5.jsx(M0,{variant:"outline",size:"sm"}),...J}){return H5.jsx(z4.Action,{"data-slot":"toast-action",render:Z,className:Q0("shrink-0",$),...J})}function a10({className:$,children:Z,render:J=H5.jsx(M0,{variant:"ghost",size:"icon-sm"}),...H}){return H5.jsx(z4.Close,{"data-slot":"toast-close","aria-label":"Close toast",render:J,className:Q0("relative shrink-0 text-muted-foreground after:absolute after:-inset-2 after:content-[''] hover:text-foreground",$),...H,children:Z??H5.jsx(e5,{"aria-hidden":"true",stroke:1.75})})}function o10({type:$}){let Z=null;if($==="success")Z=H5.jsx(eE,{"aria-hidden":"true",stroke:1.75});if($==="info")Z=H5.jsx($b,{"aria-hidden":"true",stroke:1.75});if($==="warning")Z=H5.jsx(IG,{"aria-hidden":"true",stroke:1.75});if($==="error")Z=H5.jsx(tE,{className:"text-destructive","aria-hidden":"true",stroke:1.75});if($==="loading")Z=H5.jsx(Zb,{className:"animate-spin","aria-hidden":"true",stroke:1.75});if(!Z)return null;return H5.jsx("span",{"data-slot":"toast-icon",className:"shrink-0 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4",children:Z})}function n10(){let{toasts:$}=z4.useToastManager();return $.map((Z)=>H5.jsx(c10,{toast:Z,children:H5.jsxs(d10,{children:[H5.jsx(o10,{type:Z.type}),H5.jsxs("div",{className:"flex min-w-0 flex-1 flex-col gap-1",children:[H5.jsx(l10,{}),H5.jsx(i10,{})]}),H5.jsx(r10,{}),H5.jsx(a10,{})]})},Z.id))}function Jb({children:$,toastManager:Z=e1,...J}){return H5.jsxs(m10,{toastManager:Z,...J,children:[$,H5.jsx(u10,{children:H5.jsx(p10,{children:H5.jsx(n10,{})})})]})}var mC0=z4.createToastManager,uC0=z4.useToastManager;var I3={};I5(I3,{createHandle:()=>hb,Viewport:()=>xb,Trigger:()=>Wb,Root:()=>Gb,Provider:()=>jb,Positioner:()=>Vb,Portal:()=>Ab,Popup:()=>Mb,Handle:()=>uG,Arrow:()=>_b});var lZ=P(m(),1);var kG=P(m(),1),UD=kG.createContext(void 0);function R8($){let Z=kG.useContext(UD);if(Z===void 0&&!$)throw Error(I0(72));return Z}var Hb=P(m(),1);class H9 extends g2{setState($){}update($){}set($,Z){}notifyAll(){}}var Bb={...f9,disabled:($)=>$.disabled,instantType:($)=>$.instantType,isInstantPhase:($)=>$.isInstantPhase,trackCursorAxis:($)=>$.trackCursorAxis,disableHoverablePopup:($)=>$.disableHoverablePopup,lastOpenChangeReason:($)=>$.openChangeReason,closeOnClick:($)=>$.closeOnClick,closeDelay:($)=>$.closeDelay,adaptiveOrigin:($)=>$.adaptiveOrigin};class YD extends g2{constructor($,Z,J){let H=new R2;super(Xb($,H,Z,J),zb(H),Bb)}setOpen=($,Z)=>{WG(this,$,Z,{extraState:{openChangeReason:Z.reason}})};cancelPendingOpen($){this.state.floatingRootContext.dispatchOpenChange(!1,w0(K0.triggerPress,$))}}function Qb(){let $=new R2,Z=new H9(Object.freeze(Xb(void 0,$)),Object.freeze(zb($)),Bb);return Object.assign(Z,{setOpen:U1,cancelPendingOpen:U1})}function Xb($,Z,J,H=!1){return{...v9(Z,J,H),disabled:!1,instantType:void 0,isInstantPhase:!1,trackCursorAxis:"none",disableHoverablePopup:!1,openChangeReason:null,closeOnClick:!0,closeDelay:0,adaptiveOrigin:void 0,...$}}function zb($){return{popupRef:Hb.createRef(),onOpenChange:void 0,onOpenChangeComplete:void 0,triggerElements:$}}var SB=P(c(),1),Gb=r8(function(Z){let{disabled:J=!1,defaultOpen:H=!1,open:B,disableHoverablePopup:Q=!1,trackCursorAxis:X="none",actionsRef:z,onOpenChange:G,onOpenChangeComplete:U,handle:Y,triggerId:K,defaultTriggerId:F=null,children:W}=Z,q=A6((k,S)=>new YD({open:H,openProp:B,activeTriggerId:F,triggerIdProp:K},k,S));q.useControlledProp("openProp",B),q.useControlledProp("triggerIdProp",K),q.useContextCallback("onOpenChange",G),q.useContextCallback("onOpenChangeComplete",U);let N=q.useState("open"),D=!J&&N,A=q.useState("activeTriggerId"),V=q.useState("mounted"),L=q.useState("payload");q.useSyncedValues({trackCursorAxis:X,disableHoverablePopup:Q,disabled:J}),y9(q,{closeOnActiveTriggerUnmount:!0});let{forceUnmount:O,transitionStatus:M}=x9(D,q),_=q.useState("isInstantPhase"),w=q.useState("instantType"),C=q.useState("lastOpenChangeReason"),E=lZ.useRef(null);H0(()=>{if(N&&J)q.setOpen(!1,w0(K0.disabled))},[N,J,q]),H0(()=>{if(M==="ending"&&C===K0.none||M!=="ending"&&_){if(w!=="delay")E.current=w;q.set("instantType","delay")}else if(E.current!==null)q.set("instantType",E.current),E.current=null},[M,_,C,w,q]),H0(()=>{if(D){if(A==null)q.set("payload",void 0)}},[q,A,D]),lZ.useImperativeHandle(z,()=>({unmount:O,close:()=>q.setOpen(!1,w0(K0.imperativeAction))}),[O,q]);let j=D||V||!J&&X!=="none";return SB.jsxs(UD.Provider,{value:q,children:[Y&&SB.jsx(I9,{handle:Y,store:q}),j&&SB.jsx(s10,{store:q,disabled:J,trackCursorAxis:X}),typeof W==="function"?W({payload:L}):W]})});function s10({store:$,disabled:Z,trackCursorAxis:J}){let H=$.useState("floatingRootContext"),B=e8(H,{enabled:!Z,referencePress:()=>$.select("closeOnClick")}),Q=hA(H,{enabled:!Z&&J!=="none",axis:J==="none"?void 0:J}),X=lZ.useMemo(()=>Y2(Q.reference,B.reference),[Q.reference,B.reference]);return h9($,{activeTriggerProps:X,inactiveTriggerProps:X,popupProps:B.floating??D1}),null}var xG=P(m(),1);function s0($){return E4($,"base-ui")}var yG=P(m(),1),KD=yG.createContext(void 0);function Ub(){return yG.useContext(KD)}var Yb=600;var Fb="data-base-ui-tooltip-trigger";function Kb($){if("composedPath"in $){let J=$.composedPath();for(let H=0;H<J.length;H+=1){let B=J[H];if(n0(B))return B}}let Z=$.target;if(n0(Z))return Z;return null}function t10($){let Z=$;while(Z){let J=Z.closest(`[${Fb}]`);if(J)return J;let H=Z.getRootNode();Z="host"in H&&n0(H.host)?H.host:null}return null}var Wb=T9(function(Z,J){let{render:H,className:B,style:Q,handle:X,payload:z,disabled:G,delay:U,closeOnClick:Y=!0,closeDelay:K,id:F,...W}=Z,q=R8(!0),D=g9(X)??q;if(!D)throw Error(I0(82));let A=s0(F),V=D.useState("isTriggerActive",A),L=D.useState("isOpenedByTrigger",A),O=D.useState("floatingRootContext"),M=xG.useRef(null),_=K??0,{registerTrigger:w,isMountedByThisTrigger:C}=k9(A,M,D,{payload:z,closeOnClick:Y,closeDelay:_}),E=Ub(),{activeIdRef:j,delayRef:k,isInstantPhase:S,hasProvider:I}=wA(O,{open:L}),T=uZ(O);D.useSyncedValue("isInstantPhase",S);let y=D.useState("disabled"),R=G??y,x=W5(R),v=D.useState("trackCursorAxis"),f=D.useState("disableHoverablePopup"),b=xG.useRef(!1),l=t1(),r=xG.useRef(void 0);function h(){if(I&&j.current!=null)return 0;return U??E??Yb}function d(X0){let q0=M.current;if(!q0||!X0)return!1;let N0=t10(X0);return N0!==null&&N0!==q0&&R0(q0,N0)}function o(X0){let q0=d(X0);if(b.current=q0,q0)T.openChangeTimeout.clear(),T.restTimeout.clear(),T.restTimeoutPending=!1,l.clear();return q0}let p=Z9(O,{enabled:!R,mouseOnly:!0,move:!1,handleClose:!f&&v!=="both"?J9():null,restMs:h,delay(){if(K==null&&I)return{close:t8(k.current,"close")};return{close:_}},triggerElementRef:M,isActiveTrigger:V,isClosing:()=>D.select("transitionStatus")==="ending",shouldOpen(){return!b.current}}),i=F$(O,{enabled:!R}).reference,n=(X0)=>{let q0=b.current,N0=Kb(X0),F0=o(N0),s=M.current,a=s&&N0&&R0(s,N0);if(F0&&D.select("open")&&D.select("lastOpenChangeReason")===K0.triggerHover){D.setOpen(!1,w0(K0.triggerHover,X0));return}if(q0&&!F0&&a&&!x.current&&!D.select("open")&&s&&G8(r.current)){let $0=()=>{if(!b.current&&!x.current&&!D.select("open"))D.setOpen(!0,w0(K0.triggerHover,X0,s))},t=h();if(t===0)l.clear(),$0();else l.start(t,$0)}},Z0=D.useState("triggerProps",C);return G0("button",Z,{state:{open:L},ref:[J,w,M],props:[p,i,C||v!=="none"?Z0:void 0,{onMouseOver(X0){n(X0.nativeEvent)},onFocus(X0){if(d(Kb(X0.nativeEvent)))X0.preventBaseUIHandler()},onMouseLeave(){b.current=!1,l.clear(),r.current=void 0},onPointerEnter(X0){r.current=X0.pointerType},onPointerDown(X0){if(r.current=X0.pointerType,D.set("closeOnClick",Y),Y&&!D.select("open"))D.cancelPendingOpen(X0.nativeEvent)},onClick(X0){if(Y&&!D.select("open"))D.cancelPendingOpen(X0.nativeEvent)},id:A,[qB]:R?"":void 0,[Fb]:R?void 0:""},W],stateAttributesMapping:C9})});var Nb=P(m(),1);var hG=P(m(),1),FD=hG.createContext(void 0);function qb(){let $=hG.useContext(FD);if($===void 0)throw Error(I0(70));return $}var WD=P(c(),1),Ab=Nb.forwardRef(function(Z,J){let{keepMounted:H=!1,...B}=Z;if(!(R8().useState("mounted")||H))return null;return WD.jsx(FD.Provider,{value:H,children:WD.jsx(fZ,{ref:J,...B})})});var fG=P(m(),1);var vG=P(m(),1),qD=vG.createContext(void 0);function iZ(){let $=vG.useContext(qD);if($===void 0)throw Error(I0(71));return $}var Db=P(c(),1),Vb=fG.forwardRef(function(Z,J){let{render:H,className:B,anchor:Q,positionMethod:X="absolute",side:z="top",align:G="center",sideOffset:U=0,alignOffset:Y=0,collisionBoundary:K="clipping-ancestors",collisionPadding:F=5,arrowPadding:W=5,sticky:q=!1,disableAnchorTracking:N=!1,collisionAvoidance:D=S9,style:A,...V}=Z,L=R8(),O=qb(),M=L.useState("open"),_=L.useState("mounted"),w=L.useState("trackCursorAxis"),C=L.useState("disableHoverablePopup"),E=L.useState("floatingRootContext"),j=L.useState("instantType"),k=L.useState("transitionStatus"),S=L.useState("adaptiveOrigin"),I=u9({anchor:Q,positionMethod:X,floatingRootContext:E,mounted:_,side:z,sideOffset:U,align:G,alignOffset:Y,collisionBoundary:K,collisionPadding:F,sticky:q,arrowPadding:W,disableAnchorTracking:N,keepMounted:O,collisionAvoidance:D,adaptiveOrigin:S}),T=fG.useMemo(()=>({open:M,side:I.side,align:I.align,anchorHidden:I.anchorHidden,instant:w!=="none"?"tracking-cursor":j}),[M,I.side,I.align,I.anchorHidden,w,j]),y=c9(Z,T,{styles:I.positionerStyles,transitionStatus:k,props:V,refs:[J,L.useStateSetter("positionerElement")],hidden:!_,inert:!M||w==="both"||C});return Db.jsx(qD.Provider,{value:I,children:y})});var Lb=P(m(),1);var Mb=Lb.forwardRef(function(Z,J){let{render:H,className:B,style:Q,...X}=Z,z=R8(),{side:G,align:U}=iZ(),Y=z.useState("open"),K=z.useState("instantType"),F=z.useState("transitionStatus"),W=z.useState("popupProps"),q=z.useState("floatingRootContext"),N=z.useState("disabled"),D=z.useState("closeDelay");V5({open:Y,ref:z.context.popupRef,onComplete(){if(Y)z.context.onOpenChangeComplete?.(!0)}}),S3(q,{enabled:!N,closeDelay:D});let A=z.useStateSetter("popupElement");return G0("div",Z,{state:{open:Y,side:G,align:U,instant:K,transitionStatus:F},ref:[J,z.context.popupRef,A],props:[R9,W,p9(F),X],stateAttributesMapping:J4})});var Pb=P(m(),1);var _b=Pb.forwardRef(function(Z,J){let{render:H,className:B,style:Q,...X}=Z,z=R8(),{arrowRef:G,side:U,align:Y,arrowUncentered:K,arrowStyles:F}=iZ(),W=z.useState("open"),q=z.useState("instantType");return G0("div",Z,{state:{open:W,side:U,align:Y,uncentered:K,instant:q},ref:[J,G],props:[{style:F,"aria-hidden":!0},X],stateAttributesMapping:z8})});var Ob=P(m(),1);var ND=P(c(),1),jb=function(Z){let{delay:J,closeDelay:H,timeout:B=400}=Z,Q=Ob.useMemo(()=>({open:J,close:H}),[J,H]);return ND.jsx(KD.Provider,{value:J,children:ND.jsx(bA,{delay:Q,timeoutMs:B,children:Z.children})})};var yb=P(m(),1);var d2=P(m(),1),kb=P(U8(),1);var Tb=P(m(),1);function Cb($){let[Z,J]=Tb.useState({current:$,previous:null});if(!Object.is($,Z.current))J({current:$,previous:Z.current});return Z.previous}var aZ=P(m(),1);function rZ($){let Z=u2($),J=parseFloat(Z.width)||0,H=parseFloat(Z.height)||0,B=L1($),Q=B?$.offsetWidth:J,X=B?$.offsetHeight:H;if(K6(J)!==Q||K6(H)!==X)J=Q,H=X;return{width:J,height:H}}var RB="--popup-width",IB="--popup-height";function wb($){let{popupElement:Z,positionerElement:J,content:H,mounted:B,onMeasureLayout:Q,onMeasureLayoutComplete:X,side:z,direction:G}=$,U=d4(Z,!0),Y=C4(),K=aZ.useRef(null),F=aZ.useRef(!0),W=aZ.useRef(U1),q=Y0(Q),N=Y0(X),D=aZ.useMemo(()=>e10(z,G),[z,G]);H0(()=>{if(!B){W.current=U1,F.current=!0,K.current=null;return}if(!Z||!J)return;W.current=bb(Z,D),AD(Z,"auto");let A=mG(Z,"position","static"),V=mG(Z,"transform","none"),L=mG(Z,"scale","1"),O=bb(J,{[bG]:"max-content",[wG]:"max-content"});function M(){A(),V(),O()}function _(){M(),L()}if(q?.(),F.current||K.current===null){gG(J,"max-content");let j=rZ(Z);return K.current=j,gG(J,j),_(),N?.(null,j),F.current=!1,()=>{W.current(),W.current=U1}}gG(J,"max-content");let w=K.current,C=rZ(Z);K.current=C,AD(Z,w),_(),N?.(w,C),gG(J,C);let E=new AbortController;return Y.request(()=>{AD(Z,C),U(()=>{Z.style.setProperty(RB,"auto"),Z.style.setProperty(IB,"auto")},E.signal)}),()=>{E.abort(),Y.cancel(),W.current(),W.current=U1}},[H,Z,J,U,Y,B,q,N,D])}function e10($,Z){let J=$==="top",H=$==="left"||$===(Z==="rtl"?"inline-end":"inline-start");if(!J&&!H)return D1;return{position:"absolute",[J?"bottom":"top"]:"0",[H?"right":"left"]:"0"}}function mG($,Z,J){let H=$.style.getPropertyValue(Z);return $.style.setProperty(Z,J),()=>{$.style.setProperty(Z,H)}}function bb($,Z){let J=[];for(let[H,B]of Object.entries(Z))J.push(mG($,H,B));return J.length?()=>{J.forEach((H)=>H())}:U1}function AD($,Z){let J=Z==="auto"?"auto":`${Z.width}px`,H=Z==="auto"?"auto":`${Z.height}px`;$.style.setProperty(RB,J),$.style.setProperty(IB,H)}function gG($,Z){let J=Z==="max-content"?"max-content":`${Z.width}px`,H=Z==="max-content"?"max-content":`${Z.height}px`;$.style.setProperty(hE,J),$.style.setProperty(vE,H)}var Sb={name:"adaptiveOrigin",async fn($){let{x:Z,y:J,rects:{floating:H},elements:{floating:B},platform:Q,strategy:X,placement:z}=$,G=I1(B),U=G.getComputedStyle(B);if(!(U.transitionDuration!=="0s"&&U.transitionDuration!==""))return{x:Z,y:J,data:dZ};let K=await Q.getOffsetParent?.(B),F={width:0,height:0};if(X==="fixed"&&G?.visualViewport)F={width:G.visualViewport.width,height:G.visualViewport.height};else if(K===G){let V=m0(B);F={width:V.documentElement.clientWidth,height:V.documentElement.clientHeight}}else if(await Q.isElement?.(K))F=await Q.getDimensions(K);let W=H4(z),q=Z,N=J;if(W==="left")q=F.width-(Z+H.width);if(W==="top")N=F.height-(J+H.height);let D=W==="left"?"right":dZ.sideX,A=W==="top"?"bottom":dZ.sideY;return{x:q,y:N,data:{sideX:D,sideY:A}}}};var Rb="data-activation-direction";var oZ=P(c(),1),V6={activationDirection:($)=>$?{[Rb]:$}:null};function L6($){let{store:Z,side:J,children:H}=$,B=i4(),Q=Z.useState("activeTriggerElement"),X=Z.useState("activeTriggerId"),z=Z.useState("open"),G=Z.useState("payload"),U=Z.useState("mounted"),Y=Z.useState("popupElement"),K=Z.useState("positionerElement"),F=Cb(z?Q:null),W=H50(X,G),q=d2.useRef(null),[N,D]=d2.useState(null),[A,V]=d2.useState(null),L=d2.useRef(null),O=d2.useRef(null),M=d4(L,!0),_=C4(),w=d2.useRef(null),[C,E]=d2.useState(null),[j,k]=d2.useState(!1);H0(()=>{return Z.set("adaptiveOrigin",Sb),()=>{Z.set("adaptiveOrigin",void 0)}},[Z]);let S=Y0(()=>{L.current?.style.setProperty("animation","none"),L.current?.style.setProperty("transition","none"),O.current?.style.setProperty("display","none")}),I=Y0((f)=>{if(L.current?.style.removeProperty("animation"),L.current?.style.removeProperty("transition"),O.current?.style.removeProperty("display"),f)E(f)}),T=Y0(()=>{w.current?.abort();let f=new AbortController;w.current=f,M(()=>{D(null),E(null),q.current=null},f.signal)}),y=d2.useRef(null);H0(()=>{if(!z||!U)y.current=null},[z,U]),H0(()=>{if(Q&&F&&Q!==F&&y.current!==Q&&q.current){D(q.current),k(!0);let f=J50(F,Q);V(f),y.current=Q}},[Q,F]),H0(()=>{if(N==null)return;w.current?.abort(),k(!0),_.request(()=>{kb.flushSync(()=>{k(!1)}),T()})},[W,N,T,_]),H0(()=>{let f=L.current;if(!f)return;let b=m0(f).createElement("div");for(let l of Array.from(f.childNodes))b.appendChild(l.cloneNode(!0));q.current=b});let R=N!=null,x;if(!R)x=oZ.jsx("div",{"data-current":!0,ref:L,children:H},W);else x=oZ.jsxs(d2.Fragment,{children:[oZ.jsx("div",{"data-previous":!0,inert:b8(!0),ref:O,style:{...C?{[RB]:`${C.width}px`,[IB]:`${C.height}px`}:null,position:"absolute"},"data-ending-style":j?void 0:""},"previous"),oZ.jsx("div",{"data-current":!0,ref:L,"data-starting-style":j?"":void 0,children:H},W)]});H0(()=>{let f=O.current;if(!f||!N)return;f.replaceChildren(...Array.from(N.childNodes))},[N]),wb({popupElement:Y,positionerElement:K,mounted:U,content:G,onMeasureLayout:S,onMeasureLayoutComplete:I,side:J,direction:B});let v={activationDirection:Z50(A),transitioning:R};return{children:x,state:v}}function Z50($){if(!$)return;return`${Ib($.horizontal,5,"right","left")} ${Ib($.vertical,5,"down","up")}`}function Ib($,Z,J,H){if($>Z)return J;if($<-Z)return H;return""}function J50($,Z){let J=$.getBoundingClientRect(),H=Z.getBoundingClientRect(),B={x:J.left+J.width/2,y:J.top+J.height/2},Q={x:H.left+H.width/2,y:H.top+H.height/2};return{horizontal:Q.x-B.x,vertical:Q.y-B.y}}function H50($,Z){let[J,H]=d2.useState(0),B=d2.useRef($),Q=d2.useRef(Z),X=d2.useRef(!1);return H0(()=>{let z=B.current,G=Q.current,U=$!==z,Y=Z!==G;if(U)H((K)=>K+1),X.current=!Y;else if(X.current&&Y)H((K)=>K+1),X.current=!1;B.current=$,Q.current=Z},[$,Z]),`${$??"current"}-${J}`}var xb=yb.forwardRef(function(Z,J){let{render:H,className:B,style:Q,children:X,...z}=Z,G=R8(),U=iZ(),Y=G.useState("instantType"),{children:K,state:F}=L6({store:G,side:U.side,children:X}),W={activationDirection:F.activationDirection,transitioning:F.transitioning,instant:Y};return G0("div",Z,{state:W,ref:J,props:[z,{children:K}],stateAttributesMapping:V6})});class uG extends $9{constructor(){super(Qb(),"Tooltip")}open($){this.openByTrigger($)}close(){this.closePopup()}get isOpen(){return this.attachedStore?.select("open")??!1}}function hb(){return new uG}var pG=P(m(),1),M6=P(c(),1);function I8({portal:$,children:Z,...J}){let[H,B]=pG.useState(void 0),Q=pG.useCallback((X)=>{if(X)B(X.closest("[data-applet]")?.getAttribute("data-applet")??void 0)},[]);return M6.jsxs(M6.Fragment,{children:[M6.jsx("span",{hidden:!0,ref:Q}),M6.jsx($,{...J,children:M6.jsx("div",{"data-applet":H,className:"contents",children:Z})})]})}var N$=P(c(),1);function cG({delay:$=100,...Z}){return N$.jsx(I3.Provider,{"data-slot":"tooltip-provider",delay:$,...Z})}function i1({...$}){return N$.jsx(I3.Root,{"data-slot":"tooltip",...$})}function r1({...$}){return N$.jsx(I3.Trigger,{"data-slot":"tooltip-trigger",...$})}function a1({className:$,side:Z="top",sideOffset:J=6,align:H="center",alignOffset:B=0,children:Q,...X}){return N$.jsx(I8,{portal:I3.Portal,children:N$.jsx(I3.Positioner,{align:H,alignOffset:B,side:Z,sideOffset:J,className:"isolate z-50",children:N$.jsx(I3.Popup,{"data-slot":"tooltip-content",className:i0("z-50 flex w-fit max-w-xs origin-(--transform-origin) items-center gap-1.5 rounded-lg bg-popover px-2.5 py-1.5 text-xs font-medium text-popover-foreground shadow-md has-data-[slot=kbd]:pr-1.5 data-[side=bottom]:slide-in-from-top-2 data-[side=inline-end]:slide-in-from-left-2 data-[side=inline-start]:slide-in-from-right-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 **:data-[slot=kbd]:relative **:data-[slot=kbd]:isolate **:data-[slot=kbd]:z-50 **:data-[slot=kbd]:rounded-lg data-[state=delayed-open]:animate-in data-[state=delayed-open]:fade-in-0 data-[state=delayed-open]:zoom-in-95 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95",$),...X,children:Q})})})}function dG({cooldownMs:$,windowMs:Z,maxPerWindow:J,maxKeys:H=256,now:B=Date.now}){let Q=new Map,X=0,z=0;return{admit(G){let U=B(),Y=Q.get(G);if(Y!==void 0&&U-Y<$)return"cooldown";if(U-X>=Z)X=U,z=0;if(z>=J)return"window";if(z++,Q.set(G,U),Q.size>H)for(let K of[...Q.keys()].slice(0,Math.ceil(H/2)))Q.delete(K);return"ok"}}}var B50=dG({cooldownMs:5000,windowMs:60000,maxPerWindow:30});function K8($,Z){let J=[$,Z.source,Z.kind,Z.name,Z.message].join("\x00");if(B50.admit(J)!=="ok")return;fetch(`/api/workspaces/${$}/applet-log`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({events:[Z]})}).catch(()=>{})}var Q50=/\/api\/workspaces\/([^/\s)]+)\/(widgets|views)\/([^/\s)]+)\//;function vb($){if(!$)return null;let Z=Q50.exec($);if(!Z)return null;return{workspaceId:Z[1],kind:Z[2]==="widgets"?"widget":"view",name:Z[3]}}var fb=!1;function gb(){if(fb)return;fb=!0;let $=(Z,J,H)=>{let B=J instanceof Error?J:null,Q=B?.stack??"",X=Z??vb(Q);if(!X)return;K8(X.workspaceId,{source:"window",kind:X.kind,name:X.name,message:B?.message||H||String(J),...Q?{stack:Q}:{}})};window.addEventListener("error",(Z)=>$(vb(Z.filename),Z.error,Z.message)),window.addEventListener("unhandledrejection",(Z)=>$(null,Z.reason))}function nZ($){return`${location.protocol==="https:"?"wss":"ws"}://${location.host}${$}`}function sZ($,Z){return`${$}:${Z}`}function kB($){return $==="running"}function pb($){return Object.values($).some(kB)}function tZ($,Z,J){return kB($[sZ(Z,J)])}function iG($,Z){let J=`${Z}:`;return Object.entries($).some(([H,B])=>H.startsWith(J)&&kB(B))}function F8($,Z){return sZ($,Z??"new")}function lG($,Z,J){for(let[H,B]of Object.entries($)){if(!H.startsWith(`${Z}:`))continue;let Q=B.find((X)=>X.localId===J);if(Q)return{key:H,attachment:Q}}}var y1=mb()(($)=>({activity:{},errors:{},previews:{},attachments:{},setActivity:(Z,J,H)=>$((B)=>({activity:{...B.activity,[sZ(Z,J)]:H}})),reconcileActivity:(Z)=>$(()=>({activity:Object.fromEntries(Z.map((J)=>[sZ(J.workspaceId,J.sessionId),J.activity]))})),setError:(Z,J,H)=>$((B)=>({errors:{...B.errors,[sZ(Z,J)]:H}})),setPreview:(Z)=>$((J)=>({previews:{...J.previews,[Z.messageId]:{workspaceId:Z.workspaceId,sessionId:Z.sessionId,parentToolUseId:Z.parentToolUseId,blocks:Z.blocks,updatedAt:Date.now()}}})),clearPreview:(Z)=>$((J)=>{if(!(Z in J.previews))return J;let{[Z]:H,...B}=J.previews;return{previews:B}}),clearPreviewsForSession:(Z,J)=>$((H)=>{let B={},Q=!1;for(let[X,z]of Object.entries(H.previews))if(z.workspaceId===Z&&z.sessionId===J)Q=!0;else B[X]=z;return Q?{previews:B}:H}),clearAllPreviews:()=>$((Z)=>Object.keys(Z.previews).length?{previews:{}}:Z),sweepPreviews:(Z,J)=>$((H)=>{let B={},Q=!1;for(let[X,z]of Object.entries(H.previews))if(J-z.updatedAt>Z)Q=!0;else B[X]=z;return Q?{previews:B}:H}),addAttachments:(Z,J,H)=>$((B)=>{let Q=F8(Z,J);return{attachments:{...B.attachments,[Q]:[...B.attachments[Q]??[],...H]}}}),updateAttachment:(Z,J,H)=>$((B)=>{let Q=lG(B.attachments,Z,J);if(!Q)return{};let{key:X,attachment:z}=Q,G=B.attachments[X];if(z.kind!=="text"&&z.previewUrl&&"previewUrl"in H&&H.previewUrl!==z.previewUrl)URL.revokeObjectURL(z.previewUrl);return{attachments:{...B.attachments,[X]:G.map((U)=>U.localId===J&&U.kind!=="text"?{...U,...H}:U)}}}),removeAttachment:(Z,J)=>$((H)=>{let B=lG(H.attachments,Z,J);if(!B)return{};let{key:Q,attachment:X}=B,z=H.attachments[Q];if(X.kind!=="text"&&X.previewUrl)URL.revokeObjectURL(X.previewUrl);return{attachments:{...H.attachments,[Q]:z.filter((G)=>G.localId!==J)}}}),clearAttachments:(Z,J)=>$((H)=>{let B=F8(Z,J);for(let X of H.attachments[B]??[])if(X.kind!=="text"&&X.previewUrl)URL.revokeObjectURL(X.previewUrl);let Q={...H.attachments};return delete Q[B],{attachments:Q}}),renameSession:(Z,J,H)=>$((B)=>{let Q=F8(Z,J),X=sZ(Z,H);if(Q===X)return B;if(!(Q in B.activity)&&!(Q in B.errors)&&!(Q in B.attachments)&&!Object.values(B.previews).some((F)=>F.workspaceId===Z&&F.sessionId===J))return B;let z={...B.activity},G={...B.errors};if(Q in z)z[X]=z[Q],delete z[Q];if(Q in G)G[X]=G[Q],delete G[Q];let U=B.previews,Y=!1;for(let[F,W]of Object.entries(B.previews))if(W.workspaceId===Z&&W.sessionId===J){if(!Y)U={...B.previews},Y=!0;U[F]={...W,sessionId:H}}let K=B.attachments;if(Q!==X&&K[Q])K={...K,[X]:[...K[X]??[],...K[Q]]},delete K[Q];return{activity:z,errors:G,previews:U,attachments:K}})}));function cb($,Z,J){if(!J)return{root:null,byParent:{}};let H=null,B={};for(let Q of Object.values($)){if(Q.workspaceId!==Z||Q.sessionId!==J)continue;if(Q.parentToolUseId===null){if(!H||Q.updatedAt>H.updatedAt)H=Q}else{let X=B[Q.parentToolUseId];if(!X||Q.updatedAt>X.updatedAt)B[Q.parentToolUseId]=Q}}return{root:H,byParent:B}}function G4($){return ub(y1,$)}var O0={all:["workspaces"],discover:["workspaces","discover"],creationInfo:["workspaces","creation-info"],previews:["workspaces","previews"],layout:($)=>["workspaces","layout",$],widgets:($)=>["workspaces","widgets",$],appletThumbnails:($)=>["workspaces","applet-thumbnails",$],views:($)=>["workspaces","views",$],sessions:($)=>["workspaces","sessions",$],events:($,Z)=>["workspaces","events",$,Z],session:($,Z)=>["workspaces","session",$,Z],mcp:($)=>["workspaces","mcp",$],agent:($)=>["workspaces","agent",$],skills:($)=>["workspaces","skills",$],env:($)=>["workspaces","env",$]};function yB(){return{turns:[],notices:[]}}function rG($,Z){switch(Z.kind){case"snapshot":return{...$,snapshot:Z.snapshot};case"turn":{let J=$.turns.findIndex((B)=>B.id===Z.turn.id);if(J>=0)return{...$,turns:$.turns.map((B,Q)=>Q===J?Z.turn:B)};if(Z.turn.seq===void 0)return{...$,turns:[...$.turns,Z.turn]};let H=$.turns.findIndex((B)=>B.seq!==void 0&&B.seq>Z.turn.seq);if(H<0)return{...$,turns:[...$.turns,Z.turn]};return{...$,turns:[...$.turns.slice(0,H),Z.turn,...$.turns.slice(H)]}}case"notice":{if($.notices.some((J)=>J.id===Z.notice.id))return{...$,notices:$.notices.map((J)=>J.id===Z.notice.id?Z.notice:J)};return{...$,notices:[...$.notices,Z.notice]}}case"result":return{...$,result:Z.result}}}function db($){let Z=yB(),J=new Map,H=new Map,B=-1/0;for(let Q of $)switch(Q.kind){case"snapshot":Z.snapshot=Q.snapshot;break;case"turn":{let X=Q.turn,z=X.seq,G=J.get(X.id);if(G!==void 0)Z.turns[G]=X;else{let U=z!==void 0&&z<B?Z.turns.findIndex((Y)=>Y.seq!==void 0&&Y.seq>z):-1;if(U<0)J.set(X.id,Z.turns.length),Z.turns.push(X);else{Z.turns.splice(U,0,X);for(let Y=U;Y<Z.turns.length;Y++)J.set(Z.turns[Y].id,Y)}}if(z!==void 0)B=Math.max(B,z);break}case"notice":H.set(Q.notice.id,Q.notice);break;case"result":Z.result=Q.result;break}return Z.notices=[...H.values()],Z}var DD=new WeakMap;function lb($,Z,J,H){for(let B of DD.get($)??[])if(B.workspaceId===Z&&B.sessionId===J)B.events.push(H)}function ib($,Z){return XB({queryKey:O0.events($,Z),queryFn:async({client:J,signal:H})=>{let B=DD.get(J)??new Set;DD.set(J,B);let Q={workspaceId:$,sessionId:Z,events:[]};B.add(Q);try{let X=await B1(`/api/workspaces/${$}/sessions/${Z}/events`,{signal:H},"Couldn’t load chat");return db([...X,...Q.events])}finally{B.delete(Q)}},staleTime:1/0,gcTime:300000})}var r4=P(m(),1);function d9($){return $==="overview"||$==="scratchpad"||typeof $==="string"&&/^views\/[a-zA-Z0-9_-]+$/.test($)}function A$($){try{let Z=decodeURIComponent($);return d9(Z)?Z:void 0}catch{return}}var S5=($)=>`views/${$}`,eZ=($)=>$.startsWith("views/")?$.slice(6):void 0;function l9($){return typeof $==="object"&&$!==null&&!Array.isArray($)}var P6={status:"disconnected",connectionId:null,connections:[],users:[],error:null},X50=[],rb=($,Z)=>JSON.stringify([$,Z]);class VD{state=P6;usersState=P6;channels=new Map;listeners=new Set;registrations=new Map;location=null;send=()=>{};getSnapshot=()=>this.state;getUsersSnapshot=()=>this.usersState;getPresenceSnapshot=($,Z)=>this.channels.get(rb($,Z))??X50;subscribe=($)=>{return this.listeners.add($),()=>{this.listeners.delete($)}};setSender($){this.send=$}connecting(){this.publish({status:"connecting",error:null})}disconnect($){this.publish({...P6,error:$??null})}setLocation($){if(JSON.stringify(this.location)===JSON.stringify($))return;if(this.location=$,this.publish({},!0),this.state.status==="connected")this.send({type:"location",location:$})}getLocation(){return this.location}setPresence($){let Z=this.registrations.get($.registrationId);if(Z&&JSON.stringify(Z)===JSON.stringify($))return;if(this.registrations.set($.registrationId,$),this.state.status==="connected")this.send({type:"presence:set",...$})}deletePresence($){if(this.registrations.delete($),this.state.status==="connected")this.send({type:"presence:delete",registrationId:$})}receive($){switch($.type){case"welcome":this.publish({status:"connected",connectionId:$.connectionId,connections:$.connections,users:$.users,error:null});for(let Z of this.registrations.values())this.send({type:"presence:set",...Z});break;case"connections":this.publish({connections:$.connections,users:$.users});break;case"error":this.publish({error:$.message});break;case"pong":break}}publish($,Z=!1){this.state={...this.state,...$};let J={...this.state,connections:this.state.connections.map((B)=>({...B,presence:[]}))};if(Z||JSON.stringify(J)!==JSON.stringify(this.usersState))this.usersState=J;let H=new Map;if(this.location?.status==="active")for(let B of this.state.connections){if(B.connectionId===this.state.connectionId||B.location?.page!==this.location.page||B.location.status!=="active")continue;for(let Q of B.presence){let X=rb(Q.appletId,Q.channel),z=H.get(X)??[];z.push({registrationId:Q.registrationId,connectionId:B.connectionId,userId:B.userId,value:Q.value}),H.set(X,z)}}this.channels=new Map([...H].map(([B,Q])=>{let X=this.channels.get(B);return[B,X&&JSON.stringify(X)===JSON.stringify(Q)?X:Q]})),this.listeners.forEach((B)=>B())}}var D$=()=>{},ob=[],nb={workspaceId:"",enabled:!1,start:()=>D$,getSnapshot:()=>P6,getUsersSnapshot:()=>P6,getPresenceSnapshot:()=>ob,subscribe:()=>D$,getCurrentUser:k3,subscribeCurrentUser:aG,getDirectory:LD,subscribeDirectory:MD,getLocation:()=>null,setLocation:D$,setPresence:D$,deletePresence:D$};class PD{workspaceId;enabled;store=new VD;socket=null;retry;heartbeat;unsubscribeCurrentUser;presenceTimer;queuedPresence=new Map;stopped=!0;attempts=0;lastMessageAt=0;userId=k3()?.id;constructor($,Z=!0){this.workspaceId=$;this.enabled=Z;this.store.setSender((J)=>this.send(J))}getSnapshot=()=>this.enabled?this.store.getSnapshot():P6;getUsersSnapshot=()=>this.enabled?this.store.getUsersSnapshot():P6;getPresenceSnapshot=($,Z)=>this.enabled?this.store.getPresenceSnapshot($,Z):ob;subscribe=($)=>this.enabled?this.store.subscribe($):D$;getCurrentUser=k3;subscribeCurrentUser=aG;getDirectory=LD;subscribeDirectory=MD;getLocation=()=>this.enabled?this.store.getLocation():null;setLocation=($)=>{this.store.setLocation($)};setPresence=($)=>{if(this.enabled)this.store.setPresence($)};deletePresence=($)=>{if(this.enabled)this.store.deletePresence($)};start(){if(!this.enabled)return D$;if(!this.stopped)return()=>{};return this.stopped=!1,this.userId=k3()?.id,this.unsubscribeCurrentUser=aG(()=>{let $=k3();if($?.id!==this.userId)if(this.userId=$?.id,this.store.disconnect(),clearTimeout(this.retry),this.socket)this.socket.close();else this.connect();else if($)this.send({type:"profile",profile:$})}),this.connect(),()=>this.stop()}wantsConnection(){return!this.stopped&&k3()!==void 0}connect(){if(!this.wantsConnection()){this.store.disconnect();return}if(this.socket)return;clearTimeout(this.retry),this.store.connecting();let $=new WebSocket(nZ(`/api/workspaces/${encodeURIComponent(this.workspaceId)}/collab/ws`));this.socket=$,$.onopen=()=>{if($!==this.socket)return;this.lastMessageAt=Date.now();let Z=k3();if(!Z){$.close();return}this.heartbeat=setInterval(()=>{if(Date.now()-this.lastMessageAt>45000)$.close();else this.rawSend({type:"ping"})},15000),this.rawSend({type:"join",version:ab,profile:Z,location:this.store.getLocation()})},$.onmessage=(Z)=>{if($!==this.socket)return;this.lastMessageAt=Date.now();try{let J=JSON.parse(String(Z.data));if(J.type==="welcome")this.attempts=0;let H=J.type==="error"&&this.store.getSnapshot().status!=="connected";if(this.store.receive(J),H)$.close()}catch{this.store.disconnect("The collaboration connection returned an invalid message."),$.close()}},$.onerror=()=>$.close(),$.onclose=()=>{if($!==this.socket)return;if(clearInterval(this.heartbeat),clearTimeout(this.presenceTimer),this.presenceTimer=void 0,this.queuedPresence.clear(),this.socket=null,this.store.disconnect(),this.wantsConnection()){let Z=Math.min(500*2**this.attempts++,1e4);this.retry=setTimeout(()=>this.connect(),Z)}}}send($){if(!k3()&&($.type==="location"||$.type==="presence:set"||$.type==="presence:delete"))return;if($.type==="presence:set"){if(this.queuedPresence.set($.registrationId,$),!this.presenceTimer)this.presenceTimer=setTimeout(()=>{this.presenceTimer=void 0;for(let Z of this.queuedPresence.values())this.rawSend(Z);this.queuedPresence.clear()},50);return}if($.type==="presence:delete")this.queuedPresence.delete($.registrationId);this.rawSend($)}rawSend($){if(this.socket?.readyState===WebSocket.OPEN)try{this.socket.send(JSON.stringify($))}catch{this.socket.close()}}stop(){this.stopped=!0,this.unsubscribeCurrentUser?.(),clearTimeout(this.retry),clearTimeout(this.presenceTimer),this.presenceTimer=void 0,clearInterval(this.heartbeat),this.queuedPresence.clear(),this.socket?.close(),this.socket=null,this.store.disconnect()}}var TD=P(c(),1),sb=r4.createContext(nb),tb=r4.createContext(null);function _D($,Z,J=""){let H=`${J.replace(/\/$/,"")}/workspace/${encodeURIComponent(Z)}/`,B=$.startsWith(H)?$.slice(H.length):"";return A$(B)??(B||"overview")}function OD({workspaceId:$,enabled:Z,children:J}){let H=r4.useMemo(()=>new PD($,Z),[$,Z]),B=C2(),Q=r7(B),{base:X}=B;return r4.useEffect(()=>H.start(),[H]),r4.useEffect(()=>{let z=()=>H.setLocation({page:_D(window.location.pathname,$,X),status:document.visibilityState==="hidden"?"away":"active"});return z(),document.addEventListener("visibilitychange",z),()=>document.removeEventListener("visibilitychange",z)},[X,H,Q,$]),TD.jsx(sb,{value:H,children:J})}function xB({appletId:$,active:Z=!0,children:J}){let{enabled:H}=_6(),B=r4.useMemo(()=>({active:H&&Z,appletId:$}),[H,Z,$]);return TD.jsx(tb,{value:B,children:J})}function _6(){return r4.useContext(sb)}function jD(){return r4.useContext(tb)}function l2(){let $=_6(),Z=r4.useSyncExternalStore($.subscribeCurrentUser,$.getCurrentUser,$.getCurrentUser);return $.enabled&&Z!==void 0}var LU=P(m(),1);var y3={};I5(y3,{createHandle:()=>pw,Viewport:()=>uw,Trigger:()=>Kw,Title:()=>xw,Root:()=>Qw,Positioner:()=>Ow,Portal:()=>qw,Popup:()=>ww,Handle:()=>zU,Description:()=>vw,Close:()=>gw,Backdrop:()=>kw,Arrow:()=>Rw});var hB=P(m(),1);var oG=P(m(),1),CD=oG.createContext(void 0);function a5($){let Z=oG.useContext(CD);if(Z===void 0&&!$)throw Error(I0(47));return Z}var nG=P(m(),1),eb=P(U8(),1);var $w={...f9,disabled:($)=>$.disabled,instantType:($)=>$.instantType,openMethod:($)=>$.openMethod,openChangeReason:($)=>$.openChangeReason,modal:($)=>$.modal,focusManagerModal:($)=>$.focusManagerModal,stickIfOpen:($)=>$.stickIfOpen,titleElementId:($)=>$.titleElementId,descriptionElementId:($)=>$.descriptionElementId,openOnHover:($)=>$.openOnHover,closeDelay:($)=>$.closeDelay,adaptiveOrigin:($)=>$.adaptiveOrigin};class ED extends g2{constructor($,Z,J){let H=new R2;super(Jw($,H,Z,J),Hw(H),$w)}setOpen=($,Z)=>{let J=Z.reason===K0.triggerHover,H=Z.reason===K0.triggerPress&&Z.event.detail===0,B=!$&&(Z.reason===K0.escapeKey||Z.reason==null),Q=TB(Z),X=this.select("activeTriggerId");if(!$&&Z.reason===K0.closePress&&Z.trigger==null&&X!=null)Z.trigger=this.context.triggerElements.getById(X)??this.select("activeTriggerElement")??void 0;if(this.context.onOpenChange?.($,Z),Z.isCanceled)return;this.state.floatingRootContext.dispatchOpenChange($,Z);let z=()=>{let U=K$(this.state,$,Z.trigger,Q());U.openChangeReason=Z.reason,this.update(U)};if(J)this.set("stickIfOpen",!0),this.context.stickIfOpenTimeout.start(az,()=>{this.set("stickIfOpen",!1)}),eb.flushSync(z);else z();let G;if(H)G="click";else if(B)G="dismiss";else if(Z.reason===K0.focusOut)G="focus";this.set("instantType",G)}}function Zw(){let $=new R2,Z=new H9(Object.freeze(Jw(void 0,$)),Object.freeze(Hw($)),$w);return Object.assign(Z,{setOpen:U1})}function Jw($,Z,J,H=!1){let B={...v9(Z,J,H),disabled:!1,modal:!1,focusManagerModal:!1,instantType:void 0,openMethod:null,openChangeReason:null,titleElementId:void 0,descriptionElementId:void 0,stickIfOpen:!0,openOnHover:!1,closeDelay:0,adaptiveOrigin:void 0,...$};if(B.open&&$?.mounted===void 0)B.mounted=!0;return B}function Hw($){return{popupRef:nG.createRef(),onOpenChange:void 0,onOpenChangeComplete:void 0,triggerFocusTargetRef:nG.createRef(),beforeContentFocusGuardRef:nG.createRef(),stickIfOpenTimeout:new r5,triggerElements:$}}var O6=P(c(),1),Bw=r8(function({props:Z}){let{children:J,open:H,defaultOpen:B=!1,onOpenChange:Q,onOpenChangeComplete:X,modal:z=!1,handle:G,triggerId:U,defaultTriggerId:Y=null}=Z,K=z50(G,{modal:z,open:B,openProp:H,activeTriggerId:Y,triggerIdProp:U});K.useControlledProp("openProp",H),K.useControlledProp("triggerIdProp",U);let F=K.useState("open"),W=K.useState("mounted"),q=K.useState("payload");K.useContextCallback("onOpenChange",Q),K.useContextCallback("onOpenChangeComplete",X),qG(K,F),y9(K);let{forceUnmount:N}=x9(F,K,()=>{K.update({stickIfOpen:!0,openChangeReason:null})});K.useSyncedValues({modal:z}),hB.useEffect(()=>{if(!F)K.context.stickIfOpenTimeout.clear()},[K,F]),hB.useImperativeHandle(Z.actionsRef,()=>({unmount:N,close:()=>K.setOpen(!1,w0(K0.imperativeAction))}),[N,K]);let D=F||W;return O6.jsxs(CD.Provider,{value:K,children:[G&&O6.jsx(I9,{handle:G,store:K}),D&&O6.jsx(G50,{store:K,modal:z}),typeof J==="function"?J({payload:q}):J]})});function Qw($){if(a5(!0))return O6.jsx(Bw,{props:$});return O6.jsx(G$,{children:O6.jsx(Bw,{props:$})})}function z50($,Z){let J=A6((H,B)=>new ED(Z,H,B));return hB.useEffect(()=>J.context.stickIfOpenTimeout.disposeEffect(),[J]),J}function G50({store:$,modal:Z}){let J=$.useState("floatingRootContext"),H=e8(J,{outsidePressEvent:{mouse:Z==="trap-focus"?"sloppy":"intentional",touch:"sloppy"}}),B=H.reference,Q=H.floating;return h9($,{activeTriggerProps:B,inactiveTriggerProps:B,popupProps:Q}),null}var mB=P(m(),1);var Xw=300;var zw=P(m(),1),bD=P(U8(),1);function sG($,Z){let J=zw.useRef(null);function H(Q){bD.flushSync(()=>{$.setOpen(!1,w0(K0.focusOut,Q.nativeEvent,Q.currentTarget))}),xT(J.current)?.focus()}function B(Q){let X=$.select("positionerElement");if(X&&T3(Q,X))$.context.beforeContentFocusGuardRef.current?.focus();else{bD.flushSync(()=>{$.setOpen(!1,w0(K0.focusOut,Q.nativeEvent,Q.currentTarget))});let z=yT($.context.triggerFocusTargetRef.current||Z.current);while(z!==null&&R0(X,z)){let G=z;if(z=hZ(z),z===G)break}z?.focus()}}return{preFocusGuardRef:J,handlePreFocusGuardFocus:H,handleFocusTargetFocus:B}}var fB=P(m(),1);var vB=P(m(),1);function Gw($){let Z=vB.useRef(""),J=vB.useCallback((B)=>{if(B.defaultPrevented)return;Z.current=B.pointerType,$(B,B.pointerType)},[$]);return{onClick:vB.useCallback((B)=>{if(B.detail===0){$(B,"keyboard");return}if("pointerType"in B)$(B,B.pointerType);else $(B,Z.current);Z.current=""},[$]),onPointerDown:J}}var Uw=P(m(),1);function i9($,Z){let J=Uw.useRef($),H=Y0(Z);H0(()=>{if(J.current!==$)H(J.current);J.current=$},[$,H])}function gB($,Z){let J=Y0((Q,X)=>{if(!(typeof $==="function"?$():$))Z(X||(J5.os.ios?"touch":""))}),{onClick:H,onPointerDown:B}=Gw(J);return fB.useMemo(()=>({onClick:H,onPointerDown:B}),[H,B])}function Yw($){let[Z,J]=fB.useState(null),H=gB($,J);return i9($,(B)=>{if(B&&!$)J(null)}),fB.useMemo(()=>({openMethod:Z,triggerProps:H}),[Z,H])}var $J=P(c(),1),Kw=T9(function(Z,J){let{render:H,className:B,style:Q,disabled:X=!1,nativeButton:z=!0,handle:G,payload:U,openOnHover:Y=!1,delay:K=Xw,closeDelay:F=0,id:W,...q}=Z,N=a5(!0),A=g9(G)??N;if(!A)throw Error(I0(74));let V=s0(W),L=A.useState("isTriggerActive",V),O=A.useState("floatingRootContext"),M=A.useState("isOpenedByTrigger",V),_=A.useState("triggerPopupId",V),w=mB.useRef(null),{registerTrigger:C,isMountedByThisTrigger:E}=k9(V,w,A,{payload:U,disabled:X,openOnHover:Y,closeDelay:F}),j=A.useState("openChangeReason"),k=A.useState("stickIfOpen"),S=A.useState("openMethod"),I=A.useState("focusManagerModal"),T=Z9(O,{enabled:!X&&Y&&(S!=="touch"||j!==K0.triggerPress),mouseOnly:!0,move:!1,handleClose:J9(),restMs:K,delay:{close:F},triggerElementRef:w,isActiveTrigger:L,isClosing:()=>A.select("transitionStatus")==="ending"}),y=w3(O,{stickIfOpen:k}),R=gB(()=>A.select("open"),(i)=>{A.set("openMethod",i)}),x=A.useState("triggerProps",E),{getButtonProps:v,buttonRef:f}=w5({disabled:X,native:z}),b={open(i){if(i&&j===K0.triggerPress)return WB.open(i);return C9.open(i)}},{preFocusGuardRef:l,handlePreFocusGuardFocus:r,handleFocusTargetFocus:h}=sG(A,w),o=G0("button",Z,{state:{disabled:X,open:M},ref:[f,J,C,w],props:[y.reference,T,x,R,{[vZ]:"",id:V,"aria-haspopup":"dialog","aria-expanded":M,"aria-controls":_},q,v],stateAttributesMapping:b}),p=$J.jsx(mB.Fragment,{children:o},V);if(E&&!I)return $J.jsxs(mB.Fragment,{children:[$J.jsx(c4,{ref:l,onFocus:r}),p,$J.jsx(c4,{ref:A.context.triggerFocusTargetRef,onFocus:h})]});return p});var Ww=P(m(),1);var tG=P(m(),1),wD=tG.createContext(void 0);function Fw(){let $=tG.useContext(wD);if($===void 0)throw Error(I0(45));return $}var SD=P(c(),1),qw=Ww.forwardRef(function(Z,J){let{keepMounted:H=!1,...B}=Z;if(!(a5().useState("mounted")||H))return null;return SD.jsx(wD.Provider,{value:H,children:SD.jsx(Q$,{ref:J,...B})})});var HU=P(m(),1);var eG=P(m(),1),RD=eG.createContext(void 0);function ZJ(){let $=eG.useContext(RD);if(!$)throw Error(I0(46));return $}var Nw=P(m(),1),Aw=P(c(),1),JJ=Nw.forwardRef(function(Z,J){let{cutout:H,...B}=Z,Q;if(H){let X=H.getBoundingClientRect();Q=`polygon(0% 0%,100% 0%,100% 100%,0% 100%,0% 0%,${X.left}px ${X.top}px,${X.left}px ${X.bottom}px,${X.right}px ${X.bottom}px,${X.right}px ${X.top}px,${X.left}px ${X.top}px)`}return Aw.jsx("div",{ref:J,role:"presentation","data-base-ui-inert":"",...B,style:{position:"fixed",inset:0,userSelect:"none",WebkitUserSelect:"none",clipPath:Q}})});var _w=P(m(),1);var Dw={},Vw={},Lw="";function $U($,Z){return EB($)?$:Z}function Mw($,Z,J){return/hidden|clip/.test($.getComputedStyle($U(Z,J)).overflowY)}function U50($){if(typeof document>"u")return!1;let Z=m0($);return I1(Z).innerWidth-Z.documentElement.clientWidth>0}function Y50($){if(!(typeof CSS<"u"&&CSS.supports&&CSS.supports("scrollbar-gutter","stable"))||typeof document>"u")return!1;let J=m0($),H=J.documentElement,B=J.body,Q=$U(H,B),X=Q.style.overflowY,z=H.style.scrollbarGutter;H.style.scrollbarGutter="stable",Q.style.overflowY="scroll";let G=Q.offsetWidth;Q.style.overflowY="hidden";let U=Q.offsetWidth;return Q.style.overflowY=X,H.style.scrollbarGutter=z,G===U}function K50($){let Z=m0($),J=Z.documentElement,H=Z.body,B=$U(J,H),Q={overflowY:B.style.overflowY,overflowX:B.style.overflowX};return Object.assign(B.style,{overflowY:"hidden",overflowX:"hidden"}),()=>{Object.assign(B.style,Q)}}function F50($){let Z=m0($),J=Z.documentElement,H=Z.body,B=I1(J),Q=0,X=0,z=!1,G=m2.create();if(J5.engine.webkit&&(B.visualViewport?.scale??1)!==1)return()=>{};function U(){let W=B.getComputedStyle(J),q=B.getComputedStyle(H),A=(W.scrollbarGutter||"").includes("both-edges")?"stable both-edges":"stable";Q=J.scrollTop,X=J.scrollLeft,Dw={scrollbarGutter:J.style.scrollbarGutter,overflowY:J.style.overflowY,overflowX:J.style.overflowX},Lw=J.style.scrollBehavior,Vw={position:H.style.position,height:H.style.height,width:H.style.width,boxSizing:H.style.boxSizing,overflowY:H.style.overflowY,overflowX:H.style.overflowX,scrollBehavior:H.style.scrollBehavior};let V=J.scrollHeight>J.clientHeight,L=J.scrollWidth>J.clientWidth,O=W.overflowY==="scroll"||q.overflowY==="scroll",M=W.overflowX==="scroll"||q.overflowX==="scroll",_=Math.max(0,B.innerWidth-H.clientWidth),w=Math.max(0,B.innerHeight-H.clientHeight),C=parseFloat(q.marginTop)+parseFloat(q.marginBottom),E=parseFloat(q.marginLeft)+parseFloat(q.marginRight),j=$U(J,H);if(z=Y50($),z){J.style.scrollbarGutter=A,j.style.overflowY="hidden",j.style.overflowX="hidden";return}if(Object.assign(J.style,{scrollbarGutter:A,overflowY:"hidden",overflowX:"hidden"}),V||O)J.style.overflowY="scroll";if(L||M)J.style.overflowX="scroll";Object.assign(H.style,{position:"relative",height:C||w?`calc(100dvh - ${C+w}px)`:"100dvh",width:E||_?`calc(100vw - ${E+_}px)`:"100vw",boxSizing:"border-box",overflowY:"hidden",overflowX:"hidden",scrollBehavior:"unset"}),H.scrollTop=Q,H.scrollLeft=X,J.setAttribute("data-base-ui-scroll-locked",""),J.style.scrollBehavior="unset"}function Y(){if(Object.assign(J.style,Dw),Object.assign(H.style,Vw),!z)J.scrollTop=Q,J.scrollLeft=X,J.removeAttribute("data-base-ui-scroll-locked"),J.style.scrollBehavior=Lw}function K(){Y(),G.request(U)}U();let F=a0(B,"resize",K);return()=>{if(G.cancel(),Y(),typeof B.removeEventListener==="function")F()}}class Pw{lockCount=0;restore=null;timeoutLock=r5.create();timeoutUnlock=r5.create();acquire($){if(this.lockCount+=1,this.lockCount===1&&this.restore===null)this.timeoutLock.start(0,()=>this.lock($));return this.release}release=()=>{if(this.lockCount-=1,this.lockCount===0&&this.restore)this.timeoutUnlock.start(0,this.unlock)};unlock=()=>{if(this.lockCount===0&&this.restore)this.restore?.(),this.restore=null};lock($){if(this.lockCount===0||this.restore!==null)return;let Z=m0($),J=Z.documentElement,H=Z.body,B=I1(J);if(Mw(B,J,H)){let X=new B.MutationObserver(()=>{if(Mw(B,J,H))return;X.disconnect(),this.restore=null,this.lock($)}),z={attributes:!0};X.observe(J,z),X.observe(H,z),this.restore=()=>X.disconnect();return}let Q=J5.os.ios||!U50($);this.restore=Q?K50($):F50($)}}var W50=new Pw;function ZU($=!0,Z=null){H0(()=>{if(!$)return;return W50.acquire(Z)},[$,Z])}var q50=20;function JU($,Z,J,H){let[B,Q]=_w.useState(!1);H0(()=>{if(!$||!Z||J==null){Q(!1);return}let X=m0(J).documentElement.clientWidth,z=J.offsetWidth;Q(X>0&&z>0&&z>=X-q50)},[$,Z,J]),ZU($&&(!Z||B),H)}var uB=P(c(),1),Ow=HU.forwardRef(function(Z,J){let{render:H,className:B,style:Q,anchor:X,positionMethod:z,side:G,align:U,sideOffset:Y,alignOffset:K,collisionBoundary:F="clipping-ancestors",collisionPadding:W,arrowPadding:q,sticky:N,disableAnchorTracking:D=!1,collisionAvoidance:A=S9,...V}=Z,L=a5(),O=Fw(),M=b3(),_=L.useState("floatingRootContext"),w=L.useState("mounted"),C=L.useState("open"),E=L.useState("openChangeReason"),j=L.useState("activeTriggerElement"),k=L.useState("modal"),S=L.useState("openMethod"),I=L.useState("positionerElement"),T=L.useState("instantType"),y=L.useState("transitionStatus"),R=L.useState("adaptiveOrigin"),x=HU.useRef(null),v=d4(I),f=u9({anchor:X,floatingRootContext:_,positionMethod:z,mounted:w,side:G,sideOffset:Y,align:U,alignOffset:K,arrowPadding:q,collisionBoundary:F,collisionPadding:W,sticky:N,disableAnchorTracking:D,keepMounted:O,nodeId:M,collisionAvoidance:A,adaptiveOrigin:R}),b=_.useState("domReferenceElement");H0(()=>{let o=b,p=x.current;if(o)x.current=o;if(p&&o&&o!==p){L.set("instantType",void 0);let i=new AbortController;return v(()=>{L.set("instantType","trigger-change")},i.signal),()=>{i.abort()}}return},[b,v,L]);let l=k===!0&&E!==K0.triggerHover;JU(C&&l,S==="touch",I,j);let r=L.useStateSetter("positionerElement"),h={open:C,side:f.side,align:f.align,anchorHidden:f.anchorHidden,instant:T},d=c9(Z,h,{styles:f.positionerStyles,transitionStatus:y,props:V,refs:[J,r],hidden:!w,inert:!C});return uB.jsxs(RD.Provider,{value:f,children:[w&&l&&uB.jsx(JJ,{inert:b8(!C),cutout:j}),uB.jsx(z$,{id:M,children:d})]})});var bw=P(m(),1);var HJ="ArrowUp",BJ="ArrowDown",QJ="ArrowLeft",XJ="ArrowRight",zJ="Home",GJ="End",ID="PageUp",kD="PageDown",B9=new Set([HJ,BJ,QJ,XJ,zJ,GJ]),N50="Shift",Tw=[N50,"Control","Alt","Meta"];function A50($){return L1($)&&$.tagName==="INPUT"}function yD($){if(A50($)&&$.selectionStart!=null)return!0;if(L1($)&&$.tagName==="TEXTAREA")return!0;return!1}function xD($,Z,J,H){if(!$||!Z||!Z.scrollTo)return;let{scrollLeft:B,scrollTop:Q}=$,X=$.clientWidth<$.scrollWidth,z=$.clientHeight<$.scrollHeight;if(X&&H!=="vertical"){let G=jw($,Z,"left"),U=BU($),Y=BU(Z);if(J==="ltr"){if(G+Z.offsetWidth+Y.scrollMarginRight>$.scrollLeft+$.clientWidth-U.scrollPaddingRight)B=G+Z.offsetWidth+Y.scrollMarginRight-$.clientWidth+U.scrollPaddingRight;else if(G-Y.scrollMarginLeft<$.scrollLeft+U.scrollPaddingLeft)B=G-Y.scrollMarginLeft-U.scrollPaddingLeft}if(J==="rtl"){if(G-Y.scrollMarginLeft<$.scrollLeft+U.scrollPaddingLeft)B=G-Y.scrollMarginLeft-U.scrollPaddingLeft;else if(G+Z.offsetWidth+Y.scrollMarginRight>$.scrollLeft+$.clientWidth-U.scrollPaddingRight)B=G+Z.offsetWidth+Y.scrollMarginRight-$.clientWidth+U.scrollPaddingRight}}if(z&&H!=="horizontal"){let G=jw($,Z,"top"),U=BU($),Y=BU(Z);if(G-Y.scrollMarginTop<$.scrollTop+U.scrollPaddingTop)Q=G-Y.scrollMarginTop-U.scrollPaddingTop;else if(G+Z.offsetHeight+Y.scrollMarginBottom>$.scrollTop+$.clientHeight-U.scrollPaddingBottom)Q=G+Z.offsetHeight+Y.scrollMarginBottom-$.clientHeight+U.scrollPaddingBottom}$.scrollTo({left:B,top:Q,behavior:"auto"})}function jw($,Z,J){let H=J==="left"?"offsetLeft":"offsetTop",B=0;while(Z.offsetParent){if(B+=Z[H],Z.offsetParent===$)break;Z=Z.offsetParent}return B}function BU($){let Z=getComputedStyle($);return{scrollMarginTop:parseFloat(Z.scrollMarginTop)||0,scrollMarginRight:parseFloat(Z.scrollMarginRight)||0,scrollMarginBottom:parseFloat(Z.scrollMarginBottom)||0,scrollMarginLeft:parseFloat(Z.scrollMarginLeft)||0,scrollPaddingTop:parseFloat(Z.scrollPaddingTop)||0,scrollPaddingRight:parseFloat(Z.scrollPaddingRight)||0,scrollPaddingBottom:parseFloat(Z.scrollPaddingBottom)||0,scrollPaddingLeft:parseFloat(Z.scrollPaddingLeft)||0}}var QU=P(m(),1),D50=QU.createContext(void 0);function XU($){let Z=QU.useContext(D50);if(Z===void 0&&!$)throw Error(I0(69));return Z}var j6=P(m(),1);var hD=j6.createContext(void 0);function Cw(){let[$,Z]=j6.useState(0),J=Y0(()=>{return Z((B)=>B+1),()=>{Z((B)=>Math.max(0,B-1))}});return{context:j6.useMemo(()=>({register:J}),[J]),hasClosePart:$>0}}function Ew(){let $=j6.useContext(hD);H0(()=>{return $?.register()},[$])}var vD=P(c(),1),ww=bw.forwardRef(function(Z,J){let{render:H,className:B,style:Q,initialFocus:X,finalFocus:z,...G}=Z,U=a5(),Y=ZJ(),K=XU(!0)!=null,{context:F,hasClosePart:W}=Cw(),q=U.useState("open"),N=U.useState("openMethod"),D=U.useState("instantType"),A=U.useState("transitionStatus"),V=U.useState("popupProps"),L=U.useState("titleElementId"),O=U.useState("descriptionElementId"),M=U.useState("modal"),_=U.useState("mounted"),w=U.useState("openChangeReason"),C=U.useState("activeTriggerElement"),E=U.useState("floatingRootContext"),j=E.useState("floatingId"),k=U.useState("disabled"),S=U.useState("openOnHover"),I=U.useState("closeDelay");V5({open:q,ref:U.context.popupRef,onComplete(){if(q)U.context.onOpenChangeComplete?.(!0)}}),S3(E,{enabled:S&&!k,closeDelay:I});let T=X===void 0?FG(U.context.popupRef):X,y=M!==!1&&W;U.useSyncedValue("focusManagerModal",y);let R=U.useStateSetter("popupElement"),x={open:q,side:Y.side,align:Y.align,instant:D,transitionStatus:A},v=G0("div",Z,{state:x,ref:[J,U.context.popupRef,R],props:[V,{id:j,role:"dialog",...R9,"aria-labelledby":L,"aria-describedby":O,onKeyDown(f){if(K&&B9.has(f.key))f.stopPropagation()}},p9(A),G],stateAttributesMapping:J4});return vD.jsx(U$,{context:E,openInteractionType:N,modal:y,disabled:!_||w===K0.triggerHover,initialFocus:T,returnFocus:z,restoreFocus:"popup",previousFocusableElement:L1(C)?C:void 0,nextFocusableElement:U.context.triggerFocusTargetRef,beforeContentFocusGuardRef:U.context.beforeContentFocusGuardRef,children:vD.jsx(hD.Provider,{value:F,children:v})})});var Sw=P(m(),1);var Rw=Sw.forwardRef(function(Z,J){let{render:H,className:B,style:Q,...X}=Z,G=a5().useState("open"),{arrowRef:U,side:Y,align:K,arrowUncentered:F,arrowStyles:W}=ZJ();return G0("div",Z,{state:{open:G,side:Y,align:K,uncentered:F},ref:[J,U],props:[{style:W,"aria-hidden":!0},X],stateAttributesMapping:z8})});var Iw=P(m(),1);var kw=Iw.forwardRef(function(Z,J){let{render:H,className:B,style:Q,...X}=Z,z=a5(),G=z.useState("open"),U=z.useState("mounted"),Y=z.useState("transitionStatus"),K=z.useState("openChangeReason");return G0("div",Z,{state:{open:G,transitionStatus:Y},ref:J,props:[{role:"presentation",hidden:!U,style:{pointerEvents:K===K0.triggerHover?"none":void 0,userSelect:"none",WebkitUserSelect:"none"}},X],stateAttributesMapping:J4})});var yw=P(m(),1);var xw=yw.forwardRef(function(Z,J){let{render:H,className:B,style:Q,...X}=Z,z=a5(),G=s0(X.id);return z.useSyncedValueWithCleanup("titleElementId",G),G0("h2",Z,{ref:J,props:[{id:G},X]})});var hw=P(m(),1);var vw=hw.forwardRef(function(Z,J){let{render:H,className:B,style:Q,...X}=Z,z=a5(),G=s0(X.id);return z.useSyncedValueWithCleanup("descriptionElementId",G),G0("p",Z,{ref:J,props:[{id:G},X]})});var fw=P(m(),1);var gw=fw.forwardRef(function(Z,J){let{render:H,className:B,style:Q,disabled:X=!1,nativeButton:z=!0,...G}=Z,{buttonRef:U,getButtonProps:Y}=w5({disabled:X,focusableWhenDisabled:!1,native:z}),K=a5();return Ew(),G0("button",Z,{ref:[J,U],props:[{onClick(W){K.setOpen(!1,w0(K0.closePress,W.nativeEvent))}},G,Y]})});var mw=P(m(),1);var uw=mw.forwardRef(function(Z,J){let{render:H,className:B,style:Q,children:X,...z}=Z,G=a5(),{side:U}=ZJ(),Y=G.useState("instantType"),{children:K,state:F}=L6({store:G,side:U,children:X}),W={activationDirection:F.activationDirection,transitioning:F.transitioning,instant:Y};return G0("div",Z,{state:W,ref:J,props:[z,{children:K}],stateAttributesMapping:V6})});class zU extends $9{constructor(){super(Zw(),"Popover")}open($){this.openByTrigger($)}close(){this.closePopup()}get isOpen(){return this.attachedStore?.select("open")??!1}}function pw(){return new zU}var T6=P(c(),1);function C6({...$}){return T6.jsx(y3.Root,{"data-slot":"popover",...$})}function E6({...$}){return T6.jsx(y3.Trigger,{"data-slot":"popover-trigger",...$})}function b6({className:$,align:Z="center",alignOffset:J=0,side:H="bottom",sideOffset:B=4,keepMounted:Q,...X}){return T6.jsx(I8,{portal:y3.Portal,keepMounted:Q,children:T6.jsx(y3.Positioner,{align:Z,alignOffset:J,side:H,sideOffset:B,className:"isolate z-50",children:T6.jsx(y3.Popup,{"data-slot":"popover-content",className:i0("z-50 flex w-72 origin-(--transform-origin) flex-col gap-2.5 rounded-lg bg-popover p-3 text-sm text-popover-foreground shadow-md outline-hidden duration-100 data-[side=bottom]:slide-in-from-top-2 data-[side=inline-end]:slide-in-from-left-2 data-[side=inline-start]:slide-in-from-right-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95",$),...X})})})}function cw({className:$,...Z}){return T6.jsx("div",{"data-slot":"popover-header",className:i0("flex flex-col gap-0.5 text-sm",$),...Z})}function dw({className:$,...Z}){return T6.jsx(y3.Title,{"data-slot":"popover-title",className:i0("font-medium",$),...Z})}var UU=P(m(),1),V$=P(c(),1),V50=($,Z)=>`mo-root${$==="always"?" mo-always":""}${Z?" mo-expr":""}`;function L50($){let Z=Math.round($.num("motion.blink",3500,6500)),J=Math.round($.num("motion.saccade",4200,7600)),H=$.num("motion.lookX",1,2.2),B=$.num("motion.lookY",0.8,1.7),Q=(X)=>Math.round(X*100)/100;return{phase:Math.round($.num("motion.phase",0,2800)),bob:Math.round($.num("motion.bob",0,3400)),blink:Z,blinkPhase:Math.round($.num("motion.blinkPhase",0,Z)),saccade:J,saccadePhase:Math.round($.num("motion.saccadePhase",0,J)),lookX:Q(H)*($.bool("motion.lookXFlip")?-1:1),lookY:Q(B)*($.bool("motion.lookYFlip")?-1:1),lookMX:Q(H),lookMY:Q(B)}}function M50($){let Z=(H)=>`${-H}ms`,J=L50($);return{"--mo-phase":Z(J.phase),"--mo-bob-phase":Z(J.bob),"--mo-blink":`${J.blink}ms`,"--mo-blink-phase":Z(J.blinkPhase),"--mo-look-x":String(J.lookX),"--mo-look-mx":String(J.lookMX),"--mo-look-y":String(J.lookY),"--mo-look-my":String(J.lookMY),"--mo-saccade":`${J.saccade}ms`,"--mo-saccade-phase":Z(J.saccadePhase)}}function fD({l:$,c:Z,h:J}){let H=J*Math.PI/180,B=Z*Math.cos(H),Q=Z*Math.sin(H),X=$+0.3963377774*B+0.2158037573*Q,z=$-0.1055613458*B-0.0638541728*Q,G=$-0.0894841775*B-1.291485548*Q,U=X*X*X,Y=z*z*z,K=G*G*G;return[4.0767416621*U-3.3077115913*Y+0.2309699292*K,-1.2684380046*U+2.6097574011*Y-0.3413193965*K,-0.0041960863*U-0.7034186147*Y+1.707614701*K]}var lw=($)=>$.every((Z)=>Z>=-0.0001&&Z<=1.0001);function ow($){let Z=fD($);if(!lw(Z)){let J=0,H=$.c;for(let B=0;B<12;B++){let Q=(J+H)/2;if(lw(fD({...$,c:Q})))J=Q;else H=Q}Z=fD({...$,c:J})}return Z.map((J)=>Math.min(1,Math.max(0,J)))}function iw($){let[Z,J,H]=ow($);return 0.2126*Z+0.7152*J+0.0722*H}function GU($,Z){let J=iw($),H=iw(Z);return(Math.max(J,H)+0.05)/(Math.min(J,H)+0.05)}function nw($,Z,J){if(GU($,Z)>=J)return $;let H=$.l>=Z.l?1:-1;for(let X of[H,-H]){let z={...$};for(let G=0;G<60;G++){if(z.l=Math.min(1,Math.max(0,z.l+X*0.02)),GU(z,Z)>=J)return z;if(z.l===0||z.l===1)break}}let B={...$,l:0,c:0},Q={...$,l:1,c:0};return GU(B,Z)>=GU(Q,Z)?B:Q}function P50($){return"#"+ow($).map((Z)=>{let J=Z<=0.0031308?12.92*Z:1.055*Math.pow(Z,0.4166666666666667)-0.055;return Math.round(J*255).toString(16).padStart(2,"0")}).join("")}var rw=[[0.2,{l:0.86,c:0.085}],[0.36,{l:0.9,c:0.028}],[0.62,{l:0.73,c:0.135}],[0.8,{l:0.62,c:0.165}],[0.93,{l:0.87,c:0.16}],[1,{l:0.34,c:0.035}]],_50=($)=>rw.find(([Z])=>$<Z)?.[1]??rw[0][1],O50={l:0.145,c:0,h:0},j50=1.5,T50=($,Z)=>{let J=_50(Z),H=nw({l:J.l,c:J.c,h:$},O50,j50);return{bg:{l:0.965,c:0.01,h:$},head:H,eye:H.l>=0.5?{l:0.17,c:0.02,h:$}:{l:0.97,c:0.012,h:$}}},C50=[["head","bg",1.25],["eye","head",4.5]];function E50($,Z=!0,J=0){let H=T50($,J);if(Z)for(let[B,Q,X]of C50)H[B]=nw(H[B],H[Q],X);return H}function b50($,Z=!0,J=0){let H=E50($,Z,J),B={};for(let Q in H)B[Q]=P50(H[Q]);return B}var P5=($)=>{let Z=Math.round($*100)/100;return Object.is(Z,-0)?"0":String(Z)};function gD({cx:$,cy:Z,rx:J,ry:H,n:B=4,rot:Q=0}){let X=Math.min(1,(8*Math.pow(2,-1/B)-4)/3),z=J,G=H,U=z*X,Y=G*X,K=[[z,0],[z,Y],[U,G],[0,G],[-U,G],[-z,Y],[-z,0],[-z,-Y],[-U,-G],[0,-G],[U,-G],[z,-Y],[z,0]],F=Q*Math.PI/180,W=Math.cos(F),q=Math.sin(F),N=(A)=>{let[V,L]=K[A];return`${P5($+V*W-L*q)} ${P5(Z+V*q+L*W)}`},D=`M${N(0)}`;for(let A=1;A<13;A+=3)D+=`C${N(A)} ${N(A+1)} ${N(A+2)}`;return D+"Z"}function w50($,Z,J,H,B,Q=0){let X=B.length,z=Q*Math.PI/180,G=B.map((K,F)=>{let W=z+2*Math.PI*F/X;return[$+J*K*Math.cos(W),Z+H*K*Math.sin(W)]}),U=(K)=>G[(K%X+X)%X],Y=`M${P5(U(0)[0])} ${P5(U(0)[1])}`;for(let K=0;K<X;K++){let[F,W]=U(K-1),[q,N]=U(K),[D,A]=U(K+1),[V,L]=U(K+2);Y+=`C${P5(q+(D-F)/6)} ${P5(N+(A-W)/6)} ${P5(D-(V-q)/6)} ${P5(A-(L-N)/6)} ${P5(D)} ${P5(A)}`}return Y+"Z"}function S50({cx:$,cy:Z,rx:J,ry:H,sides:B,round:Q=0.3,rot:X=0}){let z=Q>0?Q<1?Q/2:0.5:0,G=X*Math.PI/180-Math.PI/2,U=Array.from({length:B},(W,q)=>{let N=G+2*Math.PI*q/B;return[$+J*Math.cos(N),Z+H*Math.sin(N)]}),Y=(W)=>U[(W%B+B)%B],K=(W,q)=>{let[N,D]=Y(W),[A,V]=Y(q);return`${P5(N+(A-N)*z)} ${P5(D+(V-D)*z)}`},F=`M${K(0,-1)}`;for(let W=0;W<B;W++){let[q,N]=Y(W);if(F+=`Q${P5(q)} ${P5(N)} ${K(W,W+1)}`,z<0.5)F+=`L${K(W+1,W)}`}return F+"Z"}function R50($,Z,J,H){let B=P5($-J),Q=P5($+J);return`M${B} ${P5(Z-H)}H${Q}V${P5(Z+H)}H${B}Z`}function I50($,Z,J,H,B){let Q=Math.max(1.05,B),X=J*Math.sqrt(1-1/(Q*Q)),z=Z-H/Q,G=Z-Q*H,U=X*0.14,Y=z+0.86*(G-z);return`M${P5($-X)} ${P5(z)}L${P5($-U)} ${P5(Y)}Q${P5($)} ${P5(G)} ${P5($+U)} ${P5(Y)}L${P5($+X)} ${P5(z)}Z`}function mD($,Z){for(let J=0;J<Z.length;J++)$=Math.imul($^Z[J],3432918353),$=$<<13|$>>>19;return $}function k50($){return $=Math.imul($^$>>>16,2246822507),$=Math.imul($^$>>>13,3266489909),($^$>>>16)>>>0}var sw=new TextEncoder;function y50($){return $.normalize("NFC").trim().toLowerCase()}function x50($,Z=!0){let J=Z?y50($):$;return mD(1779033703^J.length,sw.encode(J))}function aw($,Z){return k50(mD(mD($,Uint8Array.of(255)),sw.encode(Z)))/4294967296}function h50($,Z=!0,J){let H=x50($,Z),B=(Q)=>{let X=J?.[Q],z=Array.isArray(X)?X[Math.floor(aw(H,Q)*X.length)]:X;return z===void 0?aw(H,Q):z>0?z<1?z:0.999999:0};return B.num=(Q,X,z)=>X+B(Q)*(z-X),B.int=(Q,X,z)=>X+Math.floor(B(Q)*(z-X+1)),B.pick=(Q,X)=>X[Math.floor(B(Q)*X.length)],B.bool=(Q,X=0.5)=>B(Q)<X,B.jitter=(Q,X)=>(B(Q)*2-1)*X,B}function tw($,Z,J){let H=Z.expression;if(J||!H)return{l:$,wrap:""};return H.bake($,H.p)}var v50=($,Z)=>Z?.tint?Z.tint($,Z.p):$,ew=($,Z)=>Z?`<g transform="${Z}">${$}</g>`:$,f50=($)=>$.replace(/[&<>]/g,(Z)=>Z==="&"?"&amp;":Z==="<"?"&lt;":"&gt;");function $S($,Z){let J=h50($,Z.normalize??!0,Z.traits);return{t:J,palette:{...b50(Z.hue??J.num("hue",0,360),Z.contrast??!0,Z.tone??J("tone")),...Z.palette}}}var g50=($)=>$.title?`<title>${f50($.title)}</title>`:"";function ZS($,Z,J){let H=Z.background??$.background;if(H===!1)return;return{d:H==="square"?"M0 0H100V100H0Z":gD({cx:50,cy:50,rx:50,ry:50,n:H==="circle"?2:6}),fill:J.bg}}var m50=($)=>$?`<path d="${$.d}" fill="${$.fill}"/>`:"";function u50($){return(Z,J={})=>{let{t:H,palette:B}=$S(Z,J),Q=v50(B,J.expression),X=J.size?` width="${J.size}" height="${J.size}"`:"",z=tw($.layout(H),J),G=g50(J)+m50(ZS($,J,Q))+ew($.render(z.l,Q),z.wrap);return`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"${X}>${G}</svg>`}}function p50($){return(Z,J={},H)=>{let{t:B,palette:Q}=$S(Z,J),X=H?.(B,Q),z=tw($.layout(B),J,X);return{cls:X?.cls,bg:ZS($,J,Q),inner:ew($.render(z.l,Q,!!X),z.wrap),vars:X?.vars}}}var c50=($,Z,J)=>{let H=Z.rx,B=$.num("eye.rx",0.075,0.105)*H,Q=$.num("eye.ratio",1.9,3.2),X=$.num("eye.scale",0.78,1.24),z=$.num("eye.stretch",0.85,1.18),G=$.num("eye.gap",0.1,0.24)*H,U=B*Math.max(1,X),Y=B*Q*Math.max(1,X*z),K=U+H*0.03+G,F=$.jitter("gaze.x",0.09)*J.rx,W=$.num("gaze.y",-0.2,0.08)*J.ry,q=$.jitter("eye.dy",0.04)*J.ry,N=Math.hypot(U,Y),D=Math.hypot((Math.abs(F)+K+N)/J.rx,(Math.abs(W)+Math.abs(q)+N)/J.ry),A=D>0.9?0.9/D:1,V=B*A,L=V*Q,O=K*A,M=Math.max(0,Math.min(1,G/Y)),_=Math.min(12,Math.asin(M)*180/Math.PI),w=$.num("eye.lean",-1,1)*_,C=Math.max(-12,Math.min(12,w+$.jitter("eye.lean2",3.5))),E=J.cx+F*A,j=J.cy+W*A;return[{cx:E-O,cy:j,rx:V,ry:L,n:$.num("eye.n",3.5,6),rot:w},{cx:E+O,cy:j+q*A,rx:V*X,ry:L*X*z,n:$.num("eye.n",3.5,6),rot:C}]};function d50($,Z){let J=(Q)=>($.find(([,X])=>Q<X)??$[$.length-1])[0];function H(Q){let X=J(Q("shape")),z=Q.num("body.r",31,38)*X.core,G={cx:50+Q.jitter("body.x",1.5),cy:50+Q.jitter("body.y",1.5),rx:z,ry:z*Q.num("body.ratio",0.92,1.08),n:Q.num("body.n",1.9,2.5),rot:0,radii:Array.from({length:Q.int("body.pts",6,8)},(K,F)=>1+Q.jitter(`body.r${F}`,0.16))};X.body?.(Q,G);let U=X.face?.(G)??G,Y={petals:[],extra:[]};return X.decorate?.(Q,G,Y),{shape:X.name,draw:X.path,body:G,face:U,petals:Y.petals,extra:Y.extra,eyes:Z(Q,G,U)}}function B(Q,X,z){let G=(K)=>Math.round(K*100)/100,U=(K,F)=>{let W=`<path d="${gD(K)}"/>`;return z?`<g class="mo-eye" style="--mo-wrap:${F?1:-1};--mo-lean:${G(K.rot)};transform-origin:${G(K.cx)}px ${G(K.cy)}px">${W}</g>`:W},Y=`<g fill="${X.head}">`+Q.petals.map((K)=>`<circle cx="${G(K.cx)}" cy="${G(K.cy)}" r="${G(K.r)}"/>`).join("")+Q.extra.map((K)=>`<path d="${K}"/>`).join("")+`<path d="${Q.draw?Q.draw(Q.body):gD(Q.body)}"/></g><g fill="${X.eye}"${z?' class="mo-eyes"':""}>`+Q.eyes.map(U).join("")+"</g>";return z?`<g class="mo-breathe"><g class="mo-bob">${Y}</g></g>`:Y}return{layout:H,render:B,background:!1}}var JS=($)=>S50($),HS=($)=>w50($.cx,$.cy,$.rx,$.ry,$.radii,$.rot),uD=($)=>(Z)=>({cx:Z.cx,cy:Z.cy,rx:Z.rx*$,ry:Z.ry*$}),BS=($)=>uD(Math.min(...$.radii)*0.95)($),l50=($)=>uD(0.84)($),i50={name:"round",core:1},r50={name:"organic",core:0.98,path:HS,face:BS},a50={name:"boxy",core:0.86,body:($,Z)=>{Z.n=$.num("body.n",3.4,6),Z.rot=$.num("body.rot",-20,20)}},o50={name:"capsule",core:1.02,body:($,Z)=>{Z.ry*=$.num("capsule.squat",0.55,0.68)},face:uD(0.94),decorate:($,Z,J)=>{for(let H of[-1,1])J.petals.push({cx:Z.cx+H*(Z.rx-Z.ry),cy:Z.cy,r:Z.ry})},path:($)=>R50($.cx,$.cy,$.rx-$.ry,$.ry)},n50={name:"nub",core:0.88,decorate:($,Z,J)=>{let H=$.int("nub.n",1,2);for(let B=0;B<H;B++){let Q=$.num(`nub.a${B}`,0,2*Math.PI);J.petals.push({cx:Z.cx+Math.cos(Q)*Z.rx*0.88,cy:Z.cy+Math.sin(Q)*Z.rx*0.88,r:Z.rx*$.num(`nub.r${B}`,0.24,0.4)})}}},s50={name:"cloud",core:0.78,face:BS,path:HS,decorate:($,Z,J)=>{let H=$.int("cloud.n",4,6);for(let B=0;B<H;B++){let Q=Math.PI+Math.PI*(B+0.5)/H;J.petals.push({cx:Z.cx+Math.cos(Q)*Z.rx*0.8,cy:Z.cy+Math.sin(Q)*Z.rx*0.5,r:Z.rx*$.num(`cloud.r${B}`,0.44,0.62)})}}},t50={name:"droplet",core:0.78,body:($,Z)=>{Z.cy+=0.22*Z.ry,Z.n=2},face:($)=>({cx:$.cx,cy:$.cy+$.ry*0.05,rx:$.rx*0.88,ry:$.ry*0.88}),decorate:($,Z,J)=>{J.extra.push(I50(Z.cx,Z.cy,Z.rx,Z.ry,$.num("droplet.tip",1.4,1.65)))}},e50={name:"hexagon",core:1.05,path:JS,face:l50,body:($,Z)=>{Z.sides=6,Z.rot=$.num("body.rot",-12,12),Z.round=$.num("poly.round",0.24,0.5)}},$20={name:"sun",core:0.7,decorate:($,Z,J)=>{let H=$.int("sun.n",6,9),B=Z.rx*$.num("sun.dist",1,1.08),Q=Z.rx*$.num("sun.r",0.2,0.26),X=$.num("sun.rot",0,2*Math.PI);for(let z=0;z<H;z++){let G=X+2*Math.PI*z/H;J.petals.push({cx:Z.cx+Math.cos(G)*B,cy:Z.cy+Math.sin(G)*B,r:Q})}}},Z20={name:"triangle",core:1.15,path:JS,body:($,Z)=>{Z.sides=3,Z.rot=$.num("body.rot",-5,5),Z.round=$.num("poly.round",0.24,0.5)},face:($)=>({cx:$.cx,cy:$.cy+$.ry*0.1,rx:$.rx*0.54,ry:$.ry*0.36})},J20=[[i50,0.22],[r50,0.48],[a50,0.6],[o50,0.7],[n50,0.79],[s50,0.86],[t50,0.915],[e50,0.95],[$20,0.98],[Z20,1]],QS=d50(J20,c50),H20=u50(QS),B20=($,Z)=>(J,H)=>{let B=Z?Z.vars(Z.p):{},Q=Z?.tint?Z.tint(H,Z.p):H;return{cls:V50($,!!Object.keys(B).length||!!Z?.tint),vars:{...M50(J),"--mo-head":Q.head,"--mo-eye":Q.eye,...B}}};function Q20($,Z={}){return p50(QS)($,Z,Z.animate&&B20(Z.animate,Z.expression))}function X20($,Z){return"data:image/svg+xml,"+H20($,Z).replace(/"/g,"'").replace(/[%#<>{}|\\^[\]`]/g,(J)=>"%"+J.charCodeAt(0).toString(16).toUpperCase()).replace(/\s+/g," ")}function XS({name:$,size:Z,background:J,palette:H,hue:B,tone:Q,normalize:X,contrast:z,title:G,animate:U,expression:Y,traits:K,...F}){let W={size:Z,background:J,palette:H,hue:B,tone:Q,normalize:X,contrast:z,title:G,expression:Y,traits:K},q=JSON.stringify([$,W,U]),N=UU.useMemo(()=>U?"":X20($,W),[q]),D=UU.useMemo(()=>U?Q20($,{...W,animate:U}):null,[q]),A=UU.useMemo(()=>({__html:D?.inner??""}),[D?.inner]);if(D){let{style:O,...M}=F;return V$.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 100 100",width:Z,height:Z,role:G?"img":void 0,"aria-hidden":G?void 0:!0,style:{...D.vars,...O},...M,children:[G?V$.jsx("title",{children:G}):null,D.bg?V$.jsx("path",{d:D.bg.d,fill:D.bg.fill}):null,V$.jsx("g",{className:D.cls,dangerouslySetInnerHTML:A})]})}let{alt:V,...L}=F;return V$.jsx("img",{src:N,width:Z,height:Z,alt:V??G??"",...L})}var YU=XS;var FJ={};I5(FJ,{Root:()=>GS,Image:()=>KS,Fallback:()=>FS});var YJ=P(m(),1);var KU=P(m(),1),pD=KU.createContext(void 0);function FU(){let $=KU.useContext(pD);if($===void 0)throw Error(I0(13));return $}var UJ={imageLoadingStatus:()=>null};var zS=P(c(),1),GS=YJ.forwardRef(function(Z,J){let{className:H,render:B,style:Q,...X}=Z,[z,G]=YJ.useState("idle"),U={imageLoadingStatus:z},Y=YJ.useMemo(()=>({imageLoadingStatus:z,setImageLoadingStatus:G}),[z,G]),K=G0("span",Z,{state:U,ref:J,props:X,stateAttributesMapping:UJ});return zS.jsx(pD.Provider,{value:Y,children:K})});var pB=P(m(),1);var US=P(m(),1);function YS($,{referrerPolicy:Z,crossOrigin:J,sizes:H,srcSet:B},Q){let X=US.useState("idle"),z=X[1];return H0(()=>{if(!Q)return U1;if(!$&&!B)return z("error"),U1;let G=!0,U=new window.Image,Y=(K)=>()=>{if(!G)return;z(K)};if(z("loading"),U.onload=Y("loaded"),U.onerror=Y("error"),Z)U.referrerPolicy=Z;if(U.crossOrigin=J??null,H)U.sizes=H;if(B)U.srcset=B;if($)U.src=$;if(U.complete)z(U.naturalWidth>0?"loaded":"error");return()=>{G=!1}},[Q,$,B,H,J,Z,z]),X}var z20={...UJ,...G2},KS=pB.forwardRef(function(Z,J){let{className:H,render:B,onLoadingStatusChange:Q,keepMounted:X=!1,style:z,sizes:G,srcSet:U,src:Y,...K}=Z,{setImageLoadingStatus:F}=FU(),[W,q]=YS(Y,Z,!X),N=W==="loaded",{mounted:D,transitionStatus:A,setMounted:V}=S2(N),L=pB.useRef(null),O=pB.useRef(!0);H0(()=>{if(!X)return;let k=O.current;O.current=!1;let S=L.current;if(!S)return;if(!S.complete){q("loading");return}let I=S.naturalWidth>0?"loaded":"error";if(q(I),I==="loaded"&&k)V(!0)},[X,Y,U,G,K.crossOrigin,K.referrerPolicy,B,q,V]);let M=X?{"data-loading":W==="loading"?"":void 0,"data-error":W==="error"?"":void 0,"aria-hidden":W!=="loaded"||void 0,onLoad(){q("loaded")},onError(){q("error")}}:void 0,_=Y0((k)=>{Q?.(k),F(k)});H0(()=>{if(W!=="idle")_(W)},[W,_]),H0(()=>{return()=>F("idle")},[F]),V5({enabled:!N,open:N,ref:L,onComplete(){if(!N)V(!1)}});let w={imageLoadingStatus:W,transitionStatus:X&&A==="ending"?void 0:A},C=X||D,E={};if(G!==void 0)E.sizes=G;if(U!==void 0)E.srcSet=U;if(Y!==void 0)E.src=Y;let j=G0("img",Z,{state:w,ref:[J,L],props:[M,K,E],stateAttributesMapping:z20,enabled:C});if(!C)return null;return j});var KJ=P(m(),1);var FS=KJ.forwardRef(function(Z,J){let{className:H,render:B,delay:Q=0,style:X,...z}=Z,{imageLoadingStatus:G}=FU(),[U,Y]=KJ.useState(Q===0),K=t1();return KJ.useEffect(()=>{if(Q>0)K.start(Q,()=>Y(!0));else Y(!0);return K.clear},[K,Q]),G0("span",Z,{state:{imageLoadingStatus:G},ref:J,props:z,stateAttributesMapping:UJ,enabled:G!=="loaded"&&(Q===0||U)})});var L$=P(c(),1);function WS({className:$,size:Z="default",...J}){return L$.jsx(FJ.Root,{"data-slot":"avatar","data-size":Z,className:i0("group/avatar relative isolate flex shrink-0 rounded-full select-none after:absolute after:inset-0 after:rounded-full after:border after:border-border after:mix-blend-darken data-[size=default]:size-8 data-[size=lg]:size-10 data-[size=sm]:size-6 data-[size=xs]:size-5 dark:after:mix-blend-lighten","[--avatar-badge-size:--spacing(2.5)] data-[size=sm]:[--avatar-badge-size:--spacing(2)] data-[size=xs]:[--avatar-badge-size:--spacing(1.5)]","has-[>[data-slot=avatar-badge]]:[&::after,&>:where([data-slot=avatar-image],[data-slot=avatar-fallback])]:mask-[radial-gradient(circle_at_calc(100%_-_var(--avatar-badge-size)/2)_calc(100%_-_var(--avatar-badge-size)/2),transparent_calc(var(--avatar-badge-size)/2_+_2px),black_calc(var(--avatar-badge-size)/2_+_2.5px))]",$),...J})}function qS({className:$,...Z}){return L$.jsx(FJ.Image,{"data-slot":"avatar-image",className:i0("aspect-square size-full rounded-full object-cover",$),...Z})}function NS({className:$,...Z}){return L$.jsx(FJ.Fallback,{"data-slot":"avatar-fallback",className:i0("flex size-full items-center justify-center overflow-hidden rounded-full bg-muted text-sm text-muted-foreground group-data-[size=sm]/avatar:text-xs group-data-[size=xs]/avatar:text-xs",$),...Z})}function AS({className:$,...Z}){return L$.jsx("span",{"data-slot":"avatar-badge",className:i0("absolute right-0 bottom-0 size-(--avatar-badge-size) rounded-full bg-primary select-none",$),...Z})}function DS({className:$,...Z}){return L$.jsx("div",{"data-slot":"avatar-group",className:i0("group/avatar-group flex items-center -space-x-2 [--avatar-radius:--spacing(4)]","*:data-[size=lg]:[--avatar-radius:--spacing(5)] *:data-[size=sm]:[--avatar-radius:--spacing(3)] *:data-[size=xs]:[--avatar-radius:--spacing(2.5)]","[&>[data-slot=avatar]:not(:last-child)]:mask-[radial-gradient(circle_at_calc(100%_+_var(--avatar-radius)_-_--spacing(2))_50%,transparent_calc(var(--avatar-radius)_+_2px),black_calc(var(--avatar-radius)_+_2.5px))]",$),...Z})}function VS({className:$,size:Z="default",...J}){return L$.jsx("div",{"data-slot":"avatar-group-count","data-size":Z,className:i0("relative flex shrink-0 items-center justify-center rounded-full bg-accent text-sm text-muted-foreground [&>svg]:size-4","data-[size=default]:size-8 data-[size=lg]:size-10 data-[size=sm]:size-6 data-[size=xs]:size-5","data-[size=sm]:text-[11px] data-[size=xs]:text-[11px]","data-[size=lg]:[&>svg]:size-5 data-[size=sm]:[&>svg]:size-3 data-[size=xs]:[&>svg]:size-3",$),...J})}var h5=P(m(),1);function w6($){return $.name?.trim()||$.email?.trim()||$.id}function LS($,Z){let J=$.filter((H)=>H.userId===Z);return J.some((H)=>H.location?.status==="active")?"active":J.length?"away":"offline"}function MS($,Z,J){if(J!==void 0)return J;let H=new Map($.map((B)=>[B.id,B]));if(Z)H.set(Z.id,Z);return[...H.values()]}function WJ($,Z){let J=$.users.find((H)=>H.id===Z);return J?{...J,status:LS($.connections,Z)}:void 0}function PS($,Z,J,{scope:H="page",status:B}={}){let Q=[],X=new Set($.connections.filter((z)=>z.userId!==Z&&(H==="workspace"||J!==null&&z.location?.page===J.page)).map((z)=>z.userId));for(let z of X){let G=WJ($,z);if(G&&(!B||G.status===B))Q.push(G)}return Q}function _S($,Z){return[...Z.users].sort((H,B)=>Number(B.id===Z.currentUser?.id)-Number(H.id===Z.currentUser?.id)).map((H)=>{let B=new Set;for(let X of $){if(X.userId!==H.id||X.connectionId===Z.connectionId)continue;if(X.location)B.add(X.location.page)}let Q=H.id===Z.currentUser?.id;if(Q&&Z.page)B.add(Z.page);return{profile:H,self:Q,pages:[...B],status:LS($,H.id)}})}function OS($,Z,J=()=>!0){let H=!1,B=()=>{if(!H)return;H=!1,$.deletePresence(Z.registrationId)};return{publish(Q,X){if(!X||!J(Q)){B();return}H=!0,$.setPresence({...Z,value:Q})},clear:B}}function cD(){let $=_6();return h5.useSyncExternalStore($.subscribe,$.getUsersSnapshot,$.getUsersSnapshot)}function qJ(){let $=_6(),Z=cD(),J=h5.useSyncExternalStore($.subscribeCurrentUser,$.getCurrentUser,$.getCurrentUser),H=h5.useSyncExternalStore($.subscribeDirectory,$.getDirectory,$.getDirectory),B=h5.useMemo(()=>MS(Z.users,J,H),[Z.users,J,H]);return{state:Z,self:J,users:B,engine:$}}function S6($){let{state:Z,users:J}=qJ();return h5.useMemo(()=>WJ({...Z,users:J},$),[Z,J,$])}function jS($){let{state:Z,users:J}=qJ();return $.map((H)=>WJ({...Z,users:J},H))}function WU({status:$}={}){let{state:Z,users:J}=qJ();return h5.useMemo(()=>J.map((H)=>WJ({...Z,users:J},H.id)).filter((H)=>!$||H.status===$),[Z,J,$])}function qU(){let{state:$,self:Z,users:J}=qJ();return h5.useMemo(()=>Z?WJ({...$,users:J},Z.id):void 0,[$,Z,J])}function TS($={}){let{state:Z,self:J,users:H,engine:B}=qJ(),{scope:Q,status:X}=$;return h5.useMemo(()=>PS({...Z,users:H},J?.id,B.getLocation(),{scope:Q,status:X}),[Z,J,H,B,Q,X])}var NJ={custom:($)=>`custom:${$}`,cursor:($)=>`cursor:${$}`,target:($)=>`field:${$}`};function CS($){return cB(NJ.custom($))}function cB($){let{users:Z,engine:J}=qJ(),H=jD(),B=H?.appletId??"",Q=h5.useCallback(()=>J.getPresenceSnapshot(B,$),[J,B,$]),X=h5.useSyncExternalStore(J.subscribe,Q,Q);return h5.useMemo(()=>{if(!H?.active)return[];let z=new Set(Z.map((G)=>G.id));return X.filter((G)=>z.has(G.userId)).map((G)=>({connectionId:G.connectionId,userId:G.userId,value:G.value}))},[X,Z,H])}function dB($,Z,J){let H=_6(),B=jD(),[Q]=h5.useState(()=>crypto.randomUUID()),X=h5.useRef(Z),z=h5.useRef(!1),G=B?.appletId??"",U=h5.useMemo(()=>OS(H,{registrationId:Q,appletId:G,channel:$},J),[H,Q,G,$,J]),Y=h5.useCallback(()=>{U.publish(X.current,B?.active===!0&&document.visibilityState!=="hidden")},[B,U]);return h5.useLayoutEffect(()=>{if(!B?.active)return;return z.current=!0,Y(),document.addEventListener("visibilitychange",Y),()=>{z.current=!1,document.removeEventListener("visibilitychange",Y),U.clear()}},[B,Y,U]),h5.useCallback((K)=>{if(X.current=K,z.current)Y()},[Y])}function G20($,Z,J){let H=dB($,Z,J);h5.useLayoutEffect(()=>H(Z),[H,Z])}function ES($,Z){G20(NJ.custom($),Z)}var R6=P(c(),1);function I6({id:$,size:Z="default",showStatusBadge:J,className:H}){let B=S6($),Q=B?w6(B):"Unknown user";return R6.jsxs(WS,{size:Z,"aria-label":Q,"data-collab-color":B?.color??"unknown",className:H,children:[B?.avatar&&R6.jsx(qS,{src:B.avatar,alt:""}),R6.jsx(NS,{children:B?R6.jsx(YU,{name:$,animate:"hover",background:"circle",traits:{shape:0,"body.r":1},palette:{bg:"var(--collab)",head:"var(--collab)",eye:"var(--collab-foreground)"}}):R6.jsx(NU,{size:Z==="xs"||Z==="sm"?12:16,stroke:1.75})}),J&&B?.status==="active"&&R6.jsx(AS,{className:"bg-success"})]})}var r9=P(c(),1),U20="Unknown user";function AU({id:$,size:Z="default",showStatusBadge:J,showYouLabel:H,description:B,className:Q}){let X=S6($),z=qU(),G=X?w6(X):U20,U=X!==void 0&&X.id===z?.id;return r9.jsxs("span",{className:Q0("inline-flex min-w-0 items-center gap-2",Q),children:[r9.jsx(I6,{id:$,size:Z,showStatusBadge:J}),r9.jsxs("span",{className:Q0("flex min-w-0 flex-1 text-sm",Z==="xs"?"items-baseline":"flex-col"),children:[r9.jsxs("span",{className:"flex min-w-0 items-baseline gap-1",children:[r9.jsx("span",{className:Q0("truncate",!X&&"text-muted-foreground"),children:G}),H&&U&&r9.jsx("span",{className:"shrink-0 text-muted-foreground",children:"(You)"})]}),B&&r9.jsxs("span",{className:Q0("truncate text-muted-foreground",Z==="sm"&&"text-xs leading-tight"),children:[Z==="xs"&&r9.jsx("span",{"aria-hidden":"true",className:"whitespace-pre",children:" · "}),B]})]})]})}var lB=P(c(),1);function DU({ids:$,max:Z=3,size:J="sm",className:H}){let B=[...new Set($)],Q=B.slice(0,Z),X=B.length-Q.length;return lB.jsxs(DS,{className:H,"aria-label":`${B.length} users`,children:[Q.map((z)=>lB.jsx(I6,{id:z,size:J},z)),X>0&&lB.jsxs(VS,{size:J,"aria-label":`${X} more`,children:["+",X]})]})}var K2=P(c(),1),bS={active:0,away:1,offline:2};function dD({workspaceId:$,describeTab:Z,onOpenTab:J}){let H=l2(),B=_6(),Q=cD(),X=WU(),z=LU.useSyncExternalStore(B.subscribeCurrentUser,B.getCurrentUser,B.getCurrentUser),G=C2(),U=_D(r7(G),$,G.base),Y=_S(Q.connections,{currentUser:z,connectionId:Q.connectionId,users:X,page:U}),K=Y.filter((q)=>q.self||q.status!=="offline").map((q)=>q.profile.id),[F,W]=LU.useState(!1);if(!H)return null;return K2.jsxs(C6,{open:F,onOpenChange:W,children:[K2.jsxs(E6,{render:K2.jsx(M0,{variant:"ghost",size:"sm","aria-label":"Users in this workspace",className:"gap-0.5 rounded-full pr-1 pl-1 data-popup-open:bg-accent"}),children:[K2.jsx(DU,{ids:K,size:"xs",max:4}),K2.jsx(VU,{stroke:2.5,className:"size-3! text-muted-foreground"})]}),K2.jsxs(b6,{align:"end",className:"max-w-64 p-1",children:[K2.jsx(dw,{className:"sr-only",children:"Users in this workspace"}),K2.jsx(Y20,{users:Y,page:U,describeTab:Z,onOpenTab:(q)=>{W(!1),J(q)}}),Y.length===0&&K2.jsx("p",{className:"px-2 py-1 text-xs text-muted-foreground",children:"No workspace users to show."})]})]})}function Y20({users:$,page:Z,describeTab:J,onOpenTab:H}){let B=$.toSorted((Q,X)=>bS[Q.status]-bS[X.status]||Number(X.self)-Number(Q.self));return K2.jsx("ul",{className:"flex max-h-80 scroll-fade flex-col overflow-y-auto",children:B.map((Q)=>K2.jsx(K20,{user:Q,page:Z,describeTab:J,onOpenTab:H},Q.profile.id))})}function K20({user:$,page:Z,describeTab:J,onOpenTab:H}){let B=$.pages.map((F)=>{let W=A$(F);return{tab:W,info:W?J(W):null}}),Q=$.self||$.status==="offline"?void 0:B.find(({tab:F,info:W})=>F!==null&&W!==null&&F!==Z),X=Q?.tab,z=[...new Set(B.map(({tab:F,info:W})=>W?.label??F??"Another tab"))].join(", "),G=$.status==="offline"?"Offline":$.status==="away"?z?`${z} · Away`:"Away":z||"Another tab",U=$.status==="offline"?void 0:B[0]?.info?.Icon,Y=K2.jsx(AU,{id:$.profile.id,className:"flex-1",size:"sm",showYouLabel:!0,description:K2.jsxs("span",{className:"flex items-center gap-1 text-xs",children:[U&&K2.jsx(U,{size:12,stroke:1.75,className:"shrink-0"}),K2.jsx("span",{className:"truncate",children:G})]})}),K="flex w-full items-center gap-2.5 rounded-md px-2 py-1 text-left";return K2.jsx("li",{children:X?K2.jsx("button",{type:"button",title:`Go to ${Q?.info?.label}`,className:Q0("flex w-full items-center gap-2.5 rounded-md px-2 py-1 text-left","cursor-pointer outline-none hover:bg-accent focus-visible:ring-3 focus-visible:ring-ring/50"),onClick:()=>H(X),children:Y}):K2.jsx("div",{className:"flex w-full items-center gap-2.5 rounded-md px-2 py-1 text-left",children:Y})})}var M$=P(m(),1);function wS($){return G0($.defaultTagName??"div",$,$)}var F20=AJ("group/badge inline-flex h-5 w-fit shrink-0 items-center justify-center gap-1 overflow-hidden rounded-sm border border-transparent px-1.5 py-0.5 text-xs font-medium whitespace-nowrap transition-all focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 [&>svg]:pointer-events-none [&>svg]:size-3!",{variants:{variant:{default:"bg-primary text-primary-foreground [a]:hover:bg-primary/80",secondary:"bg-secondary text-secondary-foreground [a]:hover:bg-secondary/80",destructive:"bg-destructive/10 text-destructive focus-visible:ring-destructive/20 dark:bg-destructive/20 dark:focus-visible:ring-destructive/40 [a]:hover:bg-destructive/20",outline:"border-border text-foreground [a]:hover:bg-accent [a]:hover:text-accent-foreground",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline"}},defaultVariants:{variant:"default"}});function MU({className:$,variant:Z="default",render:J,...H}){return wS({defaultTagName:"span",props:Y2({className:i0(F20({variant:Z}),$)},H),render:J,state:{slot:"badge",variant:Z}})}var k6=P(m(),1);function PU(...$){if(!$.length||$.some((Z)=>typeof Z!=="string"||!Z.trim()))throw Error("PresenceGroup, PresenceFrame, and PresenceAvatars require a nonempty id.");return $.map((Z)=>encodeURIComponent(Z)).join("/")}var lD=($)=>$!==!1&&$!==null,DJ=k6.createContext([]);function _U($){return PU(...k6.useContext(DJ),$)}function OU($,Z){let J=Z===void 0,H=k6.useRef(null),B=NJ.target($),Q=cB(B),X=dB(B,!1,lD),z=(U,Y)=>Y!==null&&U instanceof Element&&U.closest("[data-presence-target]")===Y;k6.useLayoutEffect(()=>{X(Z??z(document.activeElement,H.current))},[$,Z,X]);let G=new Map;for(let U of Q)if(U.value===!0&&!G.has(U.userId))G.set(U.userId,{id:U.userId,connectionId:U.connectionId});return{users:[...G.values()],props:{ref:H,"data-collab-target":$,"data-presence-target":J?$:void 0,onFocusCapture:J?(U)=>X(z(U.target,U.currentTarget)):void 0,onBlurCapture:J?(U)=>X(z(U.relatedTarget,U.currentTarget)):void 0}}}var Q9=P(c(),1);function W20($){if(!$||typeof $!=="object"||Array.isArray($))return null;if(typeof $.x!=="number"||typeof $.y!=="number")return null;if(!Number.isFinite($.x)||!Number.isFinite($.y))return null;return{x:$.x,y:$.y,...typeof $.target==="string"?{target:$.target}:{},...typeof $.targetX==="number"&&Number.isFinite($.targetX)?{targetX:$.targetX}:{},...typeof $.targetY==="number"&&Number.isFinite($.targetY)?{targetY:$.targetY}:{}}}function RS({id:$="default",children:Z,className:J}){let H=M$.useRef(null),B=M$.useRef(null);M$.useLayoutEffect(()=>{let Y=H.current,K=B.current;if(!Y||!K)return;let F=()=>{K.style.transform=`translate(${Y.scrollLeft}px, ${Y.scrollTop}px)`};return F(),Y.addEventListener("scroll",F),()=>Y.removeEventListener("scroll",F)},[]);let Q=NJ.cursor($),X=cB(Q),z=dB(Q,null,lD),G=new Map;for(let{connectionId:Y,userId:K,value:F}of X){let W=W20(F);if(W)G.set(Y,{id:K,point:W})}let U=(Y)=>{if(Y.pointerType==="touch")return;let K=H.current;if(!K||!(Y.target instanceof Element)||Y.target.closest("[data-collab-cursors]")!==K)return;let F=K.getBoundingClientRect(),W=Y.target instanceof Element?Y.target.closest("[data-collab-target]"):null,q=W&&K.contains(W)?W:null,N=q?.getBoundingClientRect();z({x:Y.clientX-F.left-K.clientLeft+K.scrollLeft,y:Y.clientY-F.top-K.clientTop+K.scrollTop,...q&&N?{target:q.dataset.collabTarget??"",targetX:N.width?(Y.clientX-N.left)/N.width:0,targetY:N.height?(Y.clientY-N.top)/N.height:0}:{}})};return Q9.jsxs("div",{ref:H,"data-collab-cursors":$,className:Q0("relative",J),onPointerEnter:U,onPointerMove:U,onPointerLeave:(Y)=>{if(Y.target instanceof Element&&Y.target.closest("[data-collab-cursors]")===Y.currentTarget)z(null)},children:[Z,Q9.jsx("div",{ref:B,className:"pointer-events-none absolute inset-0 overflow-hidden","aria-hidden":"true",children:[...G].map(([Y,{id:K,point:F}])=>Q9.jsx(q20,{root:H,point:F,id:K},Y))})]})}function q20({root:$,point:Z,id:J}){let H=M$.useRef(null);return M$.useLayoutEffect(()=>{let B=$.current,Q=H.current;if(!B||!Q)return;let X=(Y=!1)=>{let K=Z.x-B.scrollLeft,F=Z.y-B.scrollTop;if(Z.target){let q=[...B.querySelectorAll("[data-collab-target]")].find((A)=>A.dataset.collabTarget===Z.target);if(!q){Q.hidden=!0;return}let N=B.getBoundingClientRect(),D=q.getBoundingClientRect();K=D.left-N.left-B.clientLeft+D.width*(Z.targetX??0),F=D.top-N.top-B.clientTop+D.height*(Z.targetY??0)}let W=`translate(${K}px, ${F}px)`;if(Q.hidden||Q.style.transform!==W)Q.dataset.moving=Y&&!Q.hidden?"true":"false",Q.style.transform=W;Q.hidden=!1};X(!0);let z=()=>X(),G=new ResizeObserver(z);G.observe(B);let U=new MutationObserver(z);return U.observe(B,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["data-collab-target"]}),B.addEventListener("scroll",z,!0),window.addEventListener("resize",z),()=>{G.disconnect(),U.disconnect(),B.removeEventListener("scroll",z,!0),window.removeEventListener("resize",z)}},[$,Z]),Q9.jsx(N20,{ref:H,id:J})}function N20({id:$,ref:Z}){let J=S6($);return Q9.jsx("span",{ref:Z,hidden:!0,"aria-hidden":"true","data-collab-color":J?.color??"unknown",className:"pointer-events-none absolute top-0 left-0 transition-transform duration-100 ease-linear data-[moving=false]:transition-none motion-reduce:transition-none",children:Q9.jsxs("span",{className:"relative block animate-in duration-200 zoom-in-75 fade-in",children:[Q9.jsx(SS,{size:24,stroke:1.5,className:"-translate-x-0.5 -translate-y-0.5 fill-collab stroke-white drop-shadow-xs"}),Q9.jsx(MU,{className:"absolute top-3.5 left-3.5 bg-collab text-collab-foreground",children:Q9.jsx("span",{className:"truncate",children:J?w6(J):"Someone"})})]})})}var jU=P(m(),1);var y6=P(c(),1);function IS({id:$,present:Z,align:J,children:H,className:B}){let Q=_U($),X=OU(Q,Z);return y6.jsx(A20,{...X.props,ids:X.users.map((z)=>z.id),align:J,className:B,children:H})}function A20({ids:$,align:Z,children:J,className:H,...B}){let Q=jS($).filter((X)=>X!==void 0);return y6.jsxs("div",{className:Q0("relative",H),...B,children:[y6.jsx(L20,{names:Q.map(w6).join(", "),color:Q[0]?.color,align:Z}),J]})}var iB=4,D20=6,V20=["borderTopLeftRadius","borderTopRightRadius","borderBottomRightRadius","borderBottomLeftRadius"];function L20({names:$,color:Z,align:J="end"}){let H=jU.useRef(null);return jU.useLayoutEffect(()=>{let B=H.current,Q=B?.parentElement;if(!$||!B||!Q)return;let X=()=>{let G=[...Q.children].filter((A)=>{if(A===B)return!1;let{display:V,position:L}=getComputedStyle(A);return V!=="none"&&L!=="absolute"&&L!=="fixed"}),U=[...Q.childNodes].some((A)=>A.nodeType===Node.TEXT_NODE&&A.textContent?.trim()),Y=G.length===1&&!U?G[0]:null,K=Y instanceof HTMLElement?Y:null,W=(K??Q).getBoundingClientRect(),q=Q.getBoundingClientRect(),N=B.style;N.left=`${W.left-q.left-Q.clientLeft+Q.scrollLeft-iB}px`,N.top=`${W.top-q.top-Q.clientTop+Q.scrollTop-iB}px`,N.width=`${W.width+iB*2}px`,N.height=`${W.height+iB*2}px`,N.setProperty("--presence-target-width",`${W.width}px`);let D=K?getComputedStyle(K):null;for(let A of V20)N[A]=D?`calc(${D[A]} + ${iB}px)`:`${D20}px`};X();let z=new ResizeObserver(X);z.observe(Q);for(let G of Q.children)if(G!==B)z.observe(G);return()=>z.disconnect()}),y6.jsx("div",{ref:H,hidden:!$,"data-align":J,"data-collab-color":Z??"unknown",className:"group/frame pointer-events-none absolute m-0! animate-in ring-2 ring-collab duration-150 fade-in",children:y6.jsx(MU,{className:"absolute bottom-full mb-1.5 max-w-[min(var(--presence-target-width),10rem)] bg-collab text-collab-foreground group-data-[align=end]/frame:-right-0.5 group-data-[align=start]/frame:-left-0.5",children:y6.jsx("span",{className:"truncate",children:$})})})}var VJ=P(m(),1);var TU=P(c(),1);function yS({id:$,children:Z}){let J=VJ.useContext(DJ),H=VJ.useMemo(()=>{return PU($),[...J,$]},[J,$]),B=VJ.useId();return TU.jsx(kS,{reducedMotion:"user",children:TU.jsx(CU,{id:B,children:TU.jsx(DJ,{value:H,children:Z})})})}var xS=P(m(),1);var P$=P(c(),1);function hS({id:$,present:Z,align:J,children:H,className:B}){let Q=_U($),X=OU(Q,Z),z=xS.useContext(DJ).length>0;return P$.jsx(M20,{...X.props,users:X.users,animate:z&&Z===void 0,align:J,className:B,children:H})}function M20({users:$,children:Z,animate:J=!1,align:H="center",className:B,...Q}){return P$.jsxs("div",{className:Q0("relative pl-8",B),...Q,children:[Z,P$.jsx("div",{"data-align":H,className:"pointer-events-none absolute inset-y-0 left-0 flex items-center -space-x-3 data-[align=end]:items-end data-[align=start]:items-start","aria-hidden":"true",children:$.map(({id:X,connectionId:z})=>P$.jsx(Y5.span,{layoutId:J?`presence:${z}`:void 0,children:P$.jsx(I6,{id:X,size:"sm",className:"animate-in duration-200 zoom-in-75 fade-in"})},X))})]})}var iD={Cursors:RS,User:AU,UserAvatar:I6,UserAvatarGroup:DU,PresenceFrame:IS,PresenceAvatars:hS,PresenceGroup:yS,useMe:qU,usePeers:TS,useUser:S6,useWorkspaceUsers:WU,usePresence:CS,usePublishPresence:ES};var vS=($)=>`moi:collab:${$}:session`,EU=()=>({selected:{},pinned:null});function x6($){try{let Z=sessionStorage.getItem(vS($));if(!Z)return EU();if(!Z.startsWith("{"))return{selected:{overview:Z},pinned:null};let J=JSON.parse(Z);if(!J||typeof J!=="object"||!("selected"in J))return EU();let H=J.selected;if(!H||typeof H!=="object"||Array.isArray(H))return EU();return{selected:Object.fromEntries(Object.entries(H).filter(([,B])=>typeof B==="string"||B===null)),pinned:null}}catch{return EU()}}function h6($,Z){try{sessionStorage.setItem(vS($),JSON.stringify({selected:Z.selected}))}catch{}}var LJ=P(m(),1);function F2($){return`draft:${$}`}function V2($,Z){return JSON.stringify([$,Z])}var P20=($)=>fS()(mS((Z)=>({discoveredWorkspacesOpen:!0,hasSentMessageFromMoi:!1,workspaceIdsPendingAnalysis:[],composerDrafts:{},dockedChatWidth:360,popupChatWidth:440,setDiscoveredWorkspacesOpen:(J)=>Z({discoveredWorkspacesOpen:J}),markWorkspacePendingAnalysis:(J)=>Z((H)=>{let B=H.workspaceIdsPendingAnalysis??[];return{workspaceIdsPendingAnalysis:B.includes(J)?B:[...B,J]}}),markMessageSentFromMoi:(J)=>Z((H)=>({hasSentMessageFromMoi:!0,workspaceIdsPendingAnalysis:(H.workspaceIdsPendingAnalysis??[]).filter((B)=>B!==J)})),setComposerDraft:(J,H)=>Z((B)=>{if(H===null?!(J in B.composerDrafts):B.composerDrafts[J]===H)return B;let Q={...B.composerDrafts};if(H===null)delete Q[J];else Q[J]=H;return{composerDrafts:Q}}),moveComposerDraft:(J,H)=>Z((B)=>{if(J===H||!(J in B.composerDrafts))return B;let Q={...B.composerDrafts};return Q[H]??=Q[J],delete Q[J],{composerDrafts:Q}}),setDockedChatWidth:(J)=>Z({dockedChatWidth:J}),setPopupChatWidth:(J)=>Z({popupChatWidth:J})}),{name:"moi:ui",...$?{storage:gS(()=>$)}:{}})),T1=P20();var x3={all:["app-ui"],sessionSelection:($)=>["app-ui","session-selection",$]};function i2($,Z="shared"){let J=x3.sessionSelection($);return Z==="browser-tab"?[...J,"browser-tab"]:J}function aB($,Z="shared"){return{queryKey:i2($,Z),queryFn:()=>Z==="browser-tab"?Promise.resolve(x6($)):B1(`/api/workspaces/${$}/selected-session`),staleTime:1/0,gcTime:0,refetchOnMount:!1,refetchOnWindowFocus:!1}}function _20($,Z){return[...i2($,Z),"save"]}function rB($,Z,J,H,B="shared"){let Q=i2(Z,B),X=$.getQueryData(Q),z=X?.selected[H]??null;if(X&&z===J&&(B==="shared"||(H in X.selected)))return null;let G={...X?.selected};if(J===null&&B==="shared")delete G[H];else G[H]=J;if($.setQueryData(Q,{selected:G,pinned:X?.pinned??null}),B==="browser-tab")h6(Z,{selected:G,pinned:null});return{sessionId:J,previousSessionId:z,tabId:H,scope:B}}function O20($,Z,J,H){let B=i2(Z,H.scope),Q=$.getQueryData(B),X=Q?.selected[H.tabId]??null;if(J.sessionId!==H.sessionId&&X!==J.sessionId)return"conflict";if(X!==H.sessionId&&X!==H.previousSessionId)return"ignored";let z={...Q?.selected};if(J.sessionId===null&&H.scope==="shared")delete z[H.tabId];else z[H.tabId]=J.sessionId;return $.setQueryData(B,{selected:z,pinned:Q?.pinned??null}),"applied"}function j20($,Z,J){if(J)return;$.invalidateQueries({queryKey:x3.sessionSelection(Z),exact:!0})}function bU($,Z,J,H){T1.getState().moveComposerDraft(V2(Z,J),V2(Z,H));for(let Q of["shared","browser-tab"])$.setQueryData(i2(Z,Q),(X)=>X?{selected:Object.fromEntries(Object.entries(X.selected).map(([z,G])=>[z,G===J?H:G])),pinned:X.pinned===J?H:X.pinned}:X);let B=x6(Z);h6(Z,{selected:Object.fromEntries(Object.entries(B.selected).map(([Q,X])=>[Q,X===J?H:X])),pinned:null})}function h3(){let $=lN()["*"];return d9($)?$:"overview"}function rD($,Z,J){if(!$)return;if($.pinned)return $.pinned;if(J&&Z in J.selected)return J.selected[Z]??null;return $.selected[Z]??null}function v3($){let Z=h3(),J=$??Z,H=p1(),Q=l2()?"browser-tab":"shared",X=$1(),z=LJ.useMemo(()=>i2(H,Q),[H,Q]),G=LJ.useMemo(()=>_20(H,Q),[H,Q]),U=uN({mutationKey:G,exact:!0}),Y=s1(aB(H,Q)),K=uS().data,{mutate:F,mutateAsync:W}=F5({mutationKey:G,scope:{id:`selected-session:${H}`},mutationFn:(A)=>{if(A.scope==="browser-tab")return h6(H,X.getQueryData(z)??x6(H)),Promise.resolve({sessionId:A.sessionId});return B1(`/api/workspaces/${H}/selected-session`,_5("PUT",A),"Couldn’t save selected chat")},onSuccess:(A,V)=>{if(O20(X,H,A,V)!=="conflict")return;e1.add({title:"Couldn’t save selected chat",type:"error"}),X.invalidateQueries({queryKey:z,exact:!0})},onError:(A,V)=>{if((X.getQueryData(z)?.selected[V.tabId]??null)!==V.sessionId)return;e1.add({title:"Couldn’t save selected chat",type:"error"}),X.invalidateQueries({queryKey:z,exact:!0})},onSettled:()=>{if(Q==="shared"&&X.isMutating({mutationKey:G,exact:!0})===1)X.invalidateQueries({queryKey:z,exact:!0})}}),q=LJ.useCallback((A)=>{if(X.getQueryData(i2(H))?.pinned)return;let V=rB(X,H,A,J,Q);if(V)F(V)},[X,F,H,J,Q]),N=LJ.useCallback(async(A,V)=>{let L=rB(X,H,A,V,Q);if(!L)return;if((await W(L)).sessionId!==A||X.getQueryData(z)?.selected[V]!==A)throw Error("Couldn’t save selected chat")},[X,z,W,Q,H]);return L2((A)=>{if(A.type!=="selected-session:updated"||A.workspaceId!==H)return;j20(X,H,Q==="shared"&&U>0)}),[Y.data===void 0||K===void 0?void 0:rD(K,J,Q==="browser-tab"?Y.data:void 0),q,N]}function uS(){let $=p1();return s1(aB($))}function v6(){let $=p1(),Z=$1(),{data:J}=uS(),H=F5({scope:{id:`pinned-session:${$}`},mutationFn:(B)=>B1(`/api/workspaces/${$}/pinned-session`,_5("PUT",{sessionId:B})),onMutate:(B)=>{let Q=x3.sessionSelection($),X=Z.getQueryData(Q)?.pinned??null;return Z.setQueryData(Q,(z)=>({selected:z?.selected??{},pinned:B})),X},onError:(B,Q,X)=>{Z.setQueryData(x3.sessionSelection($),(z)=>z?.pinned===Q?{...z,pinned:X??null}:z),e1.add({title:"Couldn’t pin chat",type:"error"})},onSettled:()=>{Z.invalidateQueries({queryKey:x3.sessionSelection($),exact:!0})}});return{pinnedSessionId:J?.pinned??null,loaded:J!==void 0,pin:H.mutate,pinAsync:H.mutateAsync}}var pS=P(m(),1);var W8={staleTime:0,gcTime:300000,refetchOnMount:!0,refetchOnWindowFocus:!0};function cS($){return{queryKey:O0.sessions($),queryFn:()=>B1(`/api/workspaces/${$}/sessions`),...W8}}function MJ($){return s1(cS($))}function dS(){let $=p1(),Z=$1(),J=l2(),[,,H]=v3(),{pinAsync:B}=v6(),Q=q5({collabEnabled:J,selectSessionForTab:H,pinAsync:B});return pS.useCallback(async(X,z,G)=>{let{collabEnabled:U,selectSessionForTab:Y,pinAsync:K}=Q.current;G.throwIfAborted();let F=Z.getQueryData(O0.sessions($))??[];if(!F.some((q)=>q.sessionId===X))F=await Z.fetchQuery(cS($));if(G.throwIfAborted(),!F.some((q)=>q.sessionId===X))return!1;if(await Z.ensureQueryData(aB($)),U)await Z.ensureQueryData(aB($,"browser-tab"));G.throwIfAborted();let W=Z.getQueryData(i2($))?.pinned;if(W&&W!==X)await K(null),G.throwIfAborted();if(W!==X)await Y(X,z),G.throwIfAborted();return!0},[Z,Q,$])}function T20($,Z){return $?.filter((J)=>J.sessionId!==Z)}function aD($,Z,J){let H=O0.sessions(Z);$.cancelQueries({queryKey:H}),$.setQueryData(H,(B)=>T20(B,J)),$.removeQueries({queryKey:O0.events(Z,J)}),$.removeQueries({queryKey:O0.session(Z,J)});for(let B of["shared","browser-tab"]){let Q=i2(Z,B),X=$.getQueryData(Q)??(B==="browser-tab"?x6(Z):void 0);if(!X)continue;let z=X.pinned===J,G=Object.fromEntries(Object.entries(X.selected));for(let[Y,K]of Object.entries(G)){if(K!==J)continue;if(z=!0,B==="browser-tab")G[Y]=null;else delete G[Y]}if(!z)continue;let U={selected:G,pinned:X.pinned===J?null:X.pinned};if($.setQueryData(Q,U),B==="browser-tab")h6(Z,U)}$.invalidateQueries({queryKey:i2(Z),exact:!0})}function lS($){let Z=$1();return F5({mutationFn:(J)=>U4(`/api/workspaces/${$}/sessions/${J}/archive`,{method:"POST"},"Couldn’t archive chat"),onSuccess:(J,H)=>{aD(Z,$,H),Z.invalidateQueries({queryKey:O0.previews})}})}function iS($,Z){return s1({...ib($,Z??""),enabled:Boolean(Z)})}function wU($,Z){return s1({queryKey:O0.session($,Z??""),queryFn:()=>B1(`/api/workspaces/${$}/sessions/${Z}`),enabled:Boolean(Z),staleTime:1/0,gcTime:300000,refetchOnMount:!1,refetchOnWindowFocus:!1})}function rS($){let Z=$1();return F5({mutationFn:({patch:J,sessionId:H})=>B1(`/api/workspaces/${$}/sessions/${H}/config`,_5("PUT",J),"Failed to save chat settings"),onSuccess:(J,{sessionId:H})=>{Z.setQueryData(O0.session($,H),J)}})}function oS($,Z){let{queryClient:J,sendMessage:H,onWorkspaceSwitch:B}=Z,Q=y1.getState();if($.type==="status_snapshot"){Q.reconcileActivity($.sessions??[]);return}if($.type==="status"){let{workspaceId:U,sessionId:Y,activity:K}=$;if(Q.setActivity(U,Y,K),K!=="running")Q.clearPreviewsForSession(U,Y);return}if($.type==="preview"){let U=$,Y=O0.events(U.workspaceId,U.sessionId);if(J?.getQueryData(Y)===void 0)return;Q.setPreview({workspaceId:U.workspaceId,sessionId:U.sessionId,messageId:U.messageId,parentToolUseId:U.parentToolUseId,blocks:U.blocks});return}if($.type==="session_renamed"){let{workspaceId:U,from:Y,to:K}=$,F=O0.sessions(U),q=J?.getQueryData(F)?.find((A)=>A.sessionId===Y||A.sessionId===K);if(q)J?.cancelQueries({queryKey:F});if(Q.renameSession(U,Y,K),J)bU(J,U,Y,K);if(q)J?.setQueryData(F,(A)=>[{...q,sessionId:K},...(A??[]).filter((V)=>V.sessionId!==Y&&V.sessionId!==K)]);let N=J?.getQueryData(O0.events(U,Y));if(N!==void 0)J?.setQueryData(O0.events(U,K),N),J?.removeQueries({queryKey:O0.events(U,Y)});let D=J?.getQueryData(O0.session(U,Y));if(D!==void 0)J?.setQueryData(O0.session(U,K),D),J?.removeQueries({queryKey:O0.session(U,Y)});if(!q)J?.invalidateQueries({queryKey:F});J?.invalidateQueries({queryKey:O0.previews});return}if($.type==="sessions_changed"||$.type==="session_archived"){let U=$.workspaceId;if(J&&$.type==="session_archived"&&typeof $.sessionId==="string")aD(J,U,$.sessionId);let Y=O0.sessions(U);if(J?.invalidateQueries({queryKey:Y}),J?.invalidateQueries({queryKey:O0.previews}),typeof $.sessionId==="string")J?.invalidateQueries({queryKey:O0.session(U,$.sessionId)});return}if($.type==="workspace:switch"){B?.($.workspaceId);return}if($.type==="scratchpad:op"){let U=aS($.workspaceId);if(!U)return;let Y=$.opId;U($.op).then((K)=>H({type:"scratchpad:op-result",opId:Y,result:K}),(K)=>H({type:"scratchpad:op-result",opId:Y,error:K instanceof Error?K.message:String(K)}));return}let{workspaceId:X,sessionId:z}=$;if(!X||!z)return;let G=$.kind;if(G==="snapshot"||G==="turn"||G==="notice"||G==="result"){if(C20(J,X,z,$),G==="turn"){let U=$.turn?.meta?.apiMessageId;if(U)Q.clearPreview(U)}if(G==="result")Q.clearPreviewsForSession(X,z)}if(G==="error"&&typeof $.content==="string"){if(Q.setError(X,z,$.content),$.terminal!==!1)Q.setActivity(X,z,"idle"),Q.clearPreviewsForSession(X,z)}if(G==="stopped")Q.setActivity(X,z,"idle"),Q.clearPreviewsForSession(X,z)}function C20($,Z,J,H){if(!$)return;lb($,Z,J,H);let B=O0.events(Z,J),Q=$.getQueryData(B);if(Q===void 0)return;$.setQueryData(B,rG(Q,H))}var nD=null,PJ=null,SU=0,RU=null,oD=[],sS=null,nS=null,E20=15000;function tS($){if(nD=$,!nS)nS=setInterval(()=>y1.getState().sweepPreviews(E20,Date.now()),5000);if(PJ)return;eS()}function eS(){let $=++SU;if(RU)clearTimeout(RU),RU=null;let Z=new WebSocket(nZ("/ws"));PJ=Z,Z.onopen=()=>{if(SU!==$){Z.close();return}for(let J of oD)Z.send(JSON.stringify(J));oD.length=0,nD?.invalidateQueries({queryKey:["workspaces","events"]}),y1.getState().clearAllPreviews()},Z.onmessage=(J)=>{if(SU!==$)return;let H;try{H=JSON.parse(J.data)}catch{return}b20(H)},Z.onclose=()=>{if(SU!==$)return;PJ=null,RU=setTimeout(eS,1000)},Z.onerror=()=>Z.close()}function b20($){oS($,{queryClient:nD,sendMessage:IU,onWorkspaceSwitch:sS})}function IU($){if(PJ&&PJ.readyState===WebSocket.OPEN)PJ.send(JSON.stringify($));else oD.push($)}function sD($){sS=$}var kU=P(m(),1);class tD{url;listeners=new Set;baseDelayMs;maxDelayMs;socket;closed=!0;reconnectAttempt=0;reconnectTimer;shownWorkspace;constructor($,Z={}){this.url=$;this.baseDelayMs=Z.reconnectBaseDelayMs??1000,this.maxDelayMs=Z.reconnectMaxDelayMs??30000}connect(){this.closed=!1,this.open()}close(){this.closed=!0,clearTimeout(this.reconnectTimer);let $=this.socket;this.socket=void 0,$?.close()}subscribe($){return this.listeners.add($),()=>{this.listeners.delete($)}}send($){if(this.socket?.readyState!==WebSocket.OPEN)return;this.socket.send(JSON.stringify($))}get navigationWorkspace(){return this.shownWorkspace}setNavigationWorkspace($){this.shownWorkspace=$,this.sendNavigationPresence()}sendNavigationPresence(){this.send({type:"navigation:presence",workspaceId:this.shownWorkspace??null,focused:document.visibilityState==="visible"&&document.hasFocus()})}open(){if(this.closed||this.socket)return;let $=new WebSocket(this.url);this.socket=$,$.onopen=()=>{this.reconnectAttempt=0,this.sendNavigationPresence()},$.onmessage=(Z)=>{try{let J=JSON.parse(Z.data);for(let H of this.listeners)H(J)}catch{}},$.onclose=()=>{if(this.socket!==$)return;if(this.socket=void 0,!this.closed)this.scheduleReconnect()},$.onerror=()=>{$.close()}}scheduleReconnect(){let $=Math.min(this.baseDelayMs*2**this.reconnectAttempt,this.maxDelayMs);this.reconnectAttempt++,this.reconnectTimer=setTimeout(()=>this.open(),$)}}var JR=P(c(),1);function ZR({children:$}){let[Z]=kU.useState(()=>({events:new tD(nZ("/api/workspaces/ws"))}));return kU.useEffect(()=>{return Z.events.connect(),()=>Z.events.close()},[Z]),JR.jsx($R,{value:Z,children:$})}var CN=P(m(),1);function yU(){return s1({queryKey:O0.all,queryFn:()=>B1("/api/workspaces"),staleTime:300000})}var BR=XB({queryKey:O0.previews,queryFn:()=>B1("/api/workspaces/previews"),staleTime:60000});function QR(){return s1(BR)}function xU($){return s1({...BR,select:(Z)=>Z[$]})}function XR(){return s1({queryKey:O0.discover,queryFn:()=>B1("/api/workspaces/discover")})}var HR=["workspaces-reorder"];function zR(){let $=$1();return F5({mutationKey:HR,mutationFn:(Z)=>B1("/api/workspaces/order",_5("PUT",{ids:Z,origin:a9}),"Failed to reorder spaces"),onMutate:async(Z)=>{await $.cancelQueries({queryKey:O0.all,exact:!0});let J=$.getQueryData(O0.all);if(J){let H=new Map(J.map((Q)=>[Q.id,Q])),B=Z.map((Q)=>H.get(Q)).filter((Q)=>Boolean(Q));if(B.length===J.length)$.setQueryData(O0.all,B)}return{previous:J}},onError:(Z,J,H)=>{if(H?.previous)$.setQueryData(O0.all,H.previous);$.invalidateQueries({queryKey:O0.all,exact:!0})},onSuccess:(Z)=>{if($.isMutating({mutationKey:HR})>1)return;$.setQueryData(O0.all,Z)}})}function hU(){let $=$1();return F5({mutationFn:(Z)=>U4(`/api/workspaces/${Z}`,{method:"DELETE"},"Failed to remove workspace"),onSuccess:(Z,J)=>{$.setQueryData(O0.all,(H)=>(H??[]).filter((B)=>B.id!==J)),$.invalidateQueries({queryKey:O0.discover})}})}var WR=P(m(),1);var GR=P(c(),1);function r2({className:$,...Z}){return GR.jsx(d5,{"data-slot":"spinner",role:"status","aria-label":"Loading",className:i0("size-4 animate-spin",$),stroke:1.75,...Z})}var eD="Wait for active agents to finish, or stop them before updating Moi";var w20=["update"],UR=300000,S20=1000;function YR($){return s1({queryKey:w20,queryFn:()=>B1("/api/update"),staleTime:UR,refetchInterval:$?S20:UR,refetchOnWindowFocus:!0,retry:!1})}function KR(){return F5({mutationFn:()=>B1("/api/update",{method:"POST"},"Could not update Moi")})}var f3=P(c(),1);function R20($,Z){return!!Z&&$?.runningVersion===Z}function I20($,Z,J){let H=Z||J,B=$&&!H;return{busy:H,blocked:B,label:Z?"Updating":J?"Restarting":B?eD:"Update"}}function qR(){let $=KR(),Z=YR($.isSuccess),J=G4((z)=>pb(z.activity)),H=Z.data,B=$.data?.installedVersion??null;if(WR.useEffect(()=>{if(R20(H,B))window.location.reload()},[B,H]),Z.isPending)return{status:"loading"};if(!H?.availableVersion&&!$.isSuccess)return{status:"unavailable"};let Q=$.isSuccess;return{status:"available",button:{...I20(J,$.isPending,Q),errorMessage:$.error?.message??null,onClick:()=>$.mutate()}}}function NR({busy:$,blocked:Z,label:J,errorMessage:H,onClick:B}){return f3.jsxs(i1,{children:[f3.jsx(r1,{render:f3.jsx("div",{children:f3.jsx(M0,{type:"button",size:"icon",variant:$?"ghost":"default","aria-label":J,disabled:Z||$,onClick:B,children:$?f3.jsx(r2,{stroke:1.5}):f3.jsx(FR,{stroke:1.5})})})}),f3.jsx(a1,{side:"right",className:Z?"max-w-56":void 0,children:Z?eD:H??J})]})}var VQ=P(m(),1);function AR($,Z){let J=$??[],H=J.findIndex((B)=>B.id===Z.id||B.path===Z.path);if(H===-1)return[Z,...J];return J.map((B,Q)=>Q===H?{...B,...Z}:B)}function DR(){let $=$1();return F5({mutationFn:(Z)=>B1("/api/workspaces",_5("POST",Z),"Failed to add workspace"),onSuccess:(Z,J)=>{T1.getState().markWorkspacePendingAnalysis(Z.id),$.setQueryData(O0.all,(H)=>AR(H,Z)),$.setQueryData(O0.discover,(H)=>(H??[]).filter((B)=>B.path!==J.path))}})}function vU(){return s1({queryKey:O0.creationInfo,queryFn:()=>B1("/api/workspaces/create"),staleTime:30000,refetchOnMount:"always"})}function VR(){let $=$1();return F5({mutationFn:(Z)=>B1("/api/workspaces/create",_5("POST",Z),"Failed to create workspace"),onSuccess:(Z)=>{$.setQueryData(O0.all,(J)=>AR(J,Z))}})}var X9={};I5(X9,{createHandle:()=>vR,Viewport:()=>oU,Trigger:()=>sU,Title:()=>nU,Root:()=>kR,Portal:()=>iU,Popup:()=>lU,Handle:()=>_J,Description:()=>uU,Close:()=>mU,Backdrop:()=>gU});var LR=P(m(),1);var fU=P(m(),1),$V=fU.createContext(void 0);function I2($){let Z=fU.useContext($V);if(!$&&Z===void 0)throw Error(I0(27));return Z}var gU=LR.forwardRef(function(Z,J){let{render:H,className:B,style:Q,forceRender:X=!1,...z}=Z,G=I2(),U=G.useState("open"),Y=G.useState("nested"),K=G.useState("mounted"),F=G.useState("transitionStatus");return G0("div",Z,{state:{open:U,transitionStatus:F},ref:[G.context.backdropRef,J],stateAttributesMapping:J4,props:[{role:"presentation",hidden:!K,style:{userSelect:"none",WebkitUserSelect:"none"}},z],enabled:X||!Y})});var MR=P(m(),1);var mU=MR.forwardRef(function(Z,J){let{render:H,className:B,style:Q,disabled:X=!1,nativeButton:z=!0,...G}=Z,U=I2(),Y=U.useState("open"),{getButtonProps:K,buttonRef:F}=w5({disabled:X,native:z}),W={disabled:X};function q(N){if(Y)U.setOpen(!1,w0(K0.closePress,N.nativeEvent))}return G0("button",Z,{state:W,ref:[J,F],props:[{onClick:q},G,K]})});var PR=P(m(),1);var uU=PR.forwardRef(function(Z,J){let{render:H,className:B,style:Q,id:X,...z}=Z,G=I2(),U=s0(X);return G.useSyncedValueWithCleanup("descriptionElementId",U),G0("p",Z,{ref:J,props:[{id:U},z]})});var jR=P(m(),1);var pU=P(m(),1),ZV=pU.createContext(void 0);function cU(){let $=pU.useContext(ZV);if($===void 0)throw Error(I0(26));return $}var _R="--nested-dialogs";var Sh0=e7.open,Rh0=e7.closed,Ih0=e7.startingStyle,kh0=e7.endingStyle;var OR="data-nested-dialog-open";var dU={...z8,...G2,nestedDialogOpen($){return $?{[OR]:""}:null}};var TR=P(c(),1),lU=jR.forwardRef(function(Z,J){let{render:H,className:B,style:Q,finalFocus:X,initialFocus:z,...G}=Z,U=I2(),Y=U.useState("descriptionElementId"),K=U.useState("disablePointerDismissal"),F=U.useState("floatingRootContext"),W=U.useState("popupProps"),q=U.useState("modal"),N=U.useState("mounted"),D=U.useState("nested"),A=U.useState("nestedOpenDialogCount"),V=U.useState("open"),L=U.useState("openMethod"),O=U.useState("titleElementId"),M=U.useState("transitionStatus"),_=U.useState("role"),w=F.useState("floatingId");cU(),V5({open:V,ref:U.context.popupRef,onComplete(){if(V)U.context.onOpenChangeComplete?.(!0)}});let C=z===void 0?FG(U.context.popupRef):z,E=A>0,j=U.useStateSetter("popupElement"),S=G0("div",Z,{state:{open:V,nested:D,transitionStatus:M,nestedDialogOpen:E},props:[W,{id:w,"aria-labelledby":O,"aria-describedby":Y,role:_,...R9,hidden:!N,onKeyDown(I){if(B9.has(I.key))I.stopPropagation()},style:{[_R]:A}},G],ref:[J,U.context.popupRef,j],stateAttributesMapping:dU});return TR.jsx(U$,{context:F,openInteractionType:L,disabled:!N,closeOnFocusOut:!K,initialFocus:C,returnFocus:X,modal:q!==!1,restoreFocus:"popup",children:S})});var CR=P(m(),1);var oB=P(c(),1),iU=CR.forwardRef(function(Z,J){let{keepMounted:H=!1,...B}=Z,Q=I2(),X=Q.useState("mounted"),z=Q.useState("modal"),G=Q.useState("open");if(!(X||H))return null;return oB.jsx(ZV.Provider,{value:H,children:oB.jsxs(Q$,{ref:J,...B,children:[X&&z===!0&&oB.jsx(JJ,{ref:Q.context.internalBackdropRef,inert:b8(!G)}),Z.children]})})});var IR=P(m(),1);var JV=P(m(),1);function ER({store:$,parentContext:Z,isDrawer:J}){let H=$.useState("open"),B=$.useState("disablePointerDismissal"),Q=$.useState("modal"),X=$.useState("popupElement"),z=$.useState("floatingRootContext"),[G,U]=JV.useState(0),[Y,K]=JV.useState(0),F=G===0,W=e8(z,{outsidePressEvent(){if($.context.internalBackdropRef.current||$.context.backdropRef.current)return"intentional";return{mouse:Q==="trap-focus"?"sloppy":"intentional",touch:"sloppy"}},outsidePress(q){if(!$.context.outsidePressEnabledRef.current)return!1;if("button"in q&&q.button!==0)return!1;if("touches"in q){if(q.type==="touchend"){if(q.changedTouches.length!==1||q.touches.length!==0)return!1}else if(q.touches.length!==1)return!1}let N=V1(q);if(F&&!B){if(Q){let D=$.context.internalBackdropRef.current,A=$.context.backdropRef.current;return D||A?D===N||A===N||R0(N,X)&&!N?.hasAttribute("data-base-ui-portal"):!0}return!0}return!1},escapeKey:F});return ZU(H&&Q===!0,X),$.useContextCallback("onNestedDialogOpen",(q,N)=>{U(q),K(N)}),H0(()=>{if(Z?.onNestedDialogOpen)if(H)Z.onNestedDialogOpen(G+1,Y+(J?1:0));else Z.onNestedDialogOpen(0,0);return()=>{if(Z?.onNestedDialogOpen&&H)Z.onNestedDialogOpen(0,0)}},[J,H,G,Y,Z]),h9($,{activeTriggerProps:W.reference,inactiveTriggerProps:W.trigger,popupProps:W.floating,nestedOpenDialogCount:G,nestedOpenDrawerCount:Y}),null}var rU=P(m(),1);var bR={...f9,modal:($)=>$.modal,nested:($)=>$.nested,nestedOpenDialogCount:($)=>$.nestedOpenDialogCount,nestedOpenDrawerCount:($)=>$.nestedOpenDrawerCount,disablePointerDismissal:($)=>$.disablePointerDismissal,openMethod:($)=>$.openMethod,descriptionElementId:($)=>$.descriptionElementId,titleElementId:($)=>$.titleElementId,viewportElement:($)=>$.viewportElement,role:($)=>$.role};class HV extends g2{constructor($,Z,J){let H=new R2,B=SR($,H,Z,J);super(B,RR(H),bR)}setOpen=($,Z)=>{if(Z.preventUnmountOnClose=()=>{this.set("preventUnmountingOnClose",!0)},!$&&Z.trigger==null&&this.state.activeTriggerId!=null)Z.trigger=this.state.activeTriggerElement??void 0;if(this.context.onOpenChange?.($,Z),Z.isCanceled)return;this.state.floatingRootContext.dispatchOpenChange($,Z),this.update(K$(this.state,$,Z.trigger))}}function wR(){let $=new R2;return new H9(Object.freeze(SR(void 0,$)),Object.freeze(RR($)),bR)}function SR($,Z,J,H=!1){return{...v9(Z,J,H),modal:!0,disablePointerDismissal:!1,viewportElement:null,descriptionElementId:void 0,titleElementId:void 0,openMethod:null,nested:!1,nestedOpenDialogCount:0,nestedOpenDrawerCount:0,role:"dialog",...$}}function RR($){return{popupRef:rU.createRef(),backdropRef:rU.createRef(),internalBackdropRef:rU.createRef(),outsidePressEnabledRef:{current:!0},triggerElements:$,onOpenChange:void 0,onOpenChangeComplete:void 0}}var nB=P(c(),1);function aU($,Z){let{children:J,open:H,defaultOpen:B=!1,onOpenChange:Q,onOpenChangeComplete:X,disablePointerDismissal:z=!1,modal:G=!0,actionsRef:U,handle:Y,triggerId:K,defaultTriggerId:F=null}=Z,W=$==="drawer",q=$==="alert-dialog",N=q?!0:G,D=q||z,A=q?"alertdialog":"dialog",V=I2(!0),L=V!=null,O={modal:N,disablePointerDismissal:D,nested:L,role:A},M=A6((k,S)=>new HV({open:B,openProp:H,activeTriggerId:F,triggerIdProp:K,...O},k,S),!0);M.useControlledProp("openProp",H),M.useControlledProp("triggerIdProp",K),M.useSyncedValues(O),M.useContextCallback("onOpenChange",Q),M.useContextCallback("onOpenChangeComplete",X);let _=M.useState("open"),w=M.useState("mounted"),C=M.useState("payload");qG(M,_),y9(M);let{forceUnmount:E}=x9(_,M);IR.useImperativeHandle(U,()=>({unmount:E,close:()=>M.setOpen(!1,w0(K0.imperativeAction))}),[E,M]);let j=_||w;return nB.jsxs($V.Provider,{value:M,children:[Y&&nB.jsx(I9,{handle:Y,store:M}),j&&nB.jsx(ER,{store:M,parentContext:V?.context,isDrawer:W}),typeof J==="function"?J({payload:C}):J]})}var kR=r8(function(Z){return aU("dialog",Z)});var yR=P(m(),1);var oU=yR.forwardRef(function(Z,J){let{render:H,className:B,style:Q,children:X,...z}=Z,G=cU(),U=I2(),Y=U.useState("open"),K=U.useState("nested"),F=U.useState("transitionStatus"),W=U.useState("nestedOpenDialogCount"),q=U.useState("mounted"),N=U.useStateSetter("viewportElement"),D=W>0;return G0("div",Z,{enabled:G||q,state:{open:Y,nested:K,transitionStatus:F,nestedDialogOpen:D},ref:[J,N],stateAttributesMapping:dU,props:[{role:"presentation",hidden:!q,style:{pointerEvents:!Y?"none":void 0},children:X},z]})});var xR=P(m(),1);var nU=xR.forwardRef(function(Z,J){let{render:H,className:B,style:Q,id:X,...z}=Z,G=I2(),U=s0(X);return G.useSyncedValueWithCleanup("titleElementId",U),G0("h2",Z,{ref:J,props:[{id:U},z]})});var hR=P(m(),1);var sU=T9(function(Z,J){let{render:H,className:B,style:Q,disabled:X=!1,nativeButton:z=!0,id:G,payload:U,handle:Y,...K}=Z,F=I2(!0),q=g9(Y)??F;if(!q)throw Error(I0(79));let N=s0(G),D=q.useState("floatingRootContext"),A=q.useState("isOpenedByTrigger",N),V=q.useState("triggerPopupId",N),L=hR.useRef(null),{registerTrigger:O,isMountedByThisTrigger:M}=k9(N,L,q,{payload:U}),{getButtonProps:_,buttonRef:w}=w5({disabled:X,native:z}),C=w3(D),E=gB(()=>q.select("open"),(S)=>{q.set("openMethod",S)}),j={disabled:X,open:A},k=q.useState("triggerProps",M);return G0("button",Z,{state:j,ref:[w,J,O,L],props:[C.reference,k,E,{[vZ]:"",id:N,"aria-haspopup":"dialog","aria-expanded":A,"aria-controls":V},K,_],stateAttributesMapping:C9})});class _J extends $9{constructor(){super(wR(),"Dialog",!1)}open($){this.openByTrigger($)}openWithPayload($){let Z=this.attachedStore;if(Z===null)return;Z.set("payload",$),Z.setOpen(!0,w0(K0.imperativeAction))}close(){this.closePopup()}get isOpen(){return this.attachedStore?.select("open")??!1}}function vR(){return new _J}var Y4=P(c(),1);function f6({...$}){return Y4.jsx(X9.Root,{"data-slot":"dialog",...$})}function g3({...$}){return Y4.jsx(X9.Trigger,{"data-slot":"dialog-trigger",...$})}function x20({...$}){return Y4.jsx(I8,{portal:X9.Portal,"data-slot":"dialog-portal",...$})}function sB({...$}){return Y4.jsx(X9.Close,{"data-slot":"dialog-close",...$})}function h20({className:$,...Z}){return Y4.jsx(X9.Backdrop,{"data-slot":"dialog-overlay",className:i0("fixed inset-0 isolate z-50 bg-black/10 duration-100 supports-backdrop-filter:backdrop-blur-xs data-open:animate-in data-open:fade-in-0 data-closed:animate-out data-closed:fade-out-0",$),...Z})}function OJ({className:$,children:Z,showCloseButton:J=!0,...H}){return Y4.jsxs(x20,{children:[Y4.jsx(h20,{}),Y4.jsxs(X9.Popup,{"data-slot":"dialog-content",className:i0("fixed top-1/2 left-1/2 z-50 grid w-full max-w-[calc(100%-2rem)] -translate-x-1/2 -translate-y-1/2 gap-4 rounded-xl bg-popover p-6 text-sm text-popover-foreground shadow-xl duration-100 outline-none sm:max-w-sm data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95",$),...H,children:[Z,J&&Y4.jsxs(sB,{render:Y4.jsx(M0,{variant:"ghost",size:"icon-sm",className:"absolute top-4 right-4"}),children:[Y4.jsx(e5,{stroke:1.75}),Y4.jsx("span",{className:"sr-only",children:"Close"})]})]})]})}function g6({className:$,...Z}){return Y4.jsx(X9.Title,{"data-slot":"dialog-title",className:i0("text-lg font-semibold",$),...Z})}function jJ({className:$,...Z}){return Y4.jsx(X9.Description,{"data-slot":"dialog-description",className:i0("text-sm text-muted-foreground *:[a]:underline *:[a]:underline-offset-3 *:[a]:hover:text-foreground",$),...Z})}var HI=P(m(),1);var YY={};I5(YY,{Validity:()=>ZI,Root:()=>rR,Label:()=>oR,Item:()=>JI,Error:()=>nR,Description:()=>tR,Control:()=>eR});var y2=P(m(),1);var tU=P(m(),1);var fR="data-valid",gR="data-invalid";var _$={badInput:!1,customError:!1,patternMismatch:!1,rangeOverflow:!1,rangeUnderflow:!1,stepMismatch:!1,tooLong:!1,tooShort:!1,typeMismatch:!1,valid:null,valueMissing:!1},f20={valid:null,touched:!1,dirty:!1,filled:!1,focused:!1},mR={disabled:!1,...f20},k2={valid($){if($===null)return null;if($)return{[fR]:""};return{[gR]:""}}};var g20={invalid:void 0,name:void 0,validityData:{state:_$,errors:[],error:"",value:"",initialValue:null},setValidityData:U1,disabled:void 0,setTouched:U1,setDirty:U1,setFilled:U1,setFocused:U1,validationMode:"onSubmit",shouldValidateOnChange:()=>!1,state:mR,registerFieldControl:U1,validation:{getValidationProps:($,Z=D1)=>Z,inputRef:{current:null},registeredInputs:new Map,registerInput:U1,getInputControl:()=>null,commit:async()=>{},change:U1}},BV=tU.createContext(g20);function o5($=!0){let Z=tU.useContext(BV);if(Z.setValidityData===U1&&!$)throw Error(I0(28));return Z}var eU=P(m(),1),m20=eU.createContext(void 0);function uR($=!1){let Z=eU.useContext(m20);if(!Z&&!$)throw Error(I0(86));return Z}var $Y=P(m(),1);var u20=$Y.createContext({elementRef:{current:null},formRef:{current:{fields:new Map}},errors:{},clearErrors:U1,validationMode:"onSubmit",submitCountRef:{current:0}});function K4(){return $Y.useContext(u20)}var m6=P(m(),1);var ZY=P(m(),1);var QV=ZY.createContext({controlId:void 0,registerControlId:U1,resetControlId:U1,labelId:void 0,setLabelId:U1,messageIds:[],setMessageIds:U1,getDescriptionProps:($)=>$});function n5(){return ZY.useContext(QV)}var pR=P(c(),1),JY=function(Z){let J=s0(),[H,B]=m6.useState(J),[Q,X]=m6.useState(),[z,G]=m6.useState([]),U=H===void 0?J:H,Y=Z5(()=>new Map),{messageIds:K}=n5(),F=Y0((D,A)=>{let V=Y.current;if(A===void 0)V.delete(D);else V.set(D,A);B((L)=>{if(V.size===0)return L;let O;for(let M of V.values()){if(M===L)return L;if(O===void 0)O=M}return O})}),W=Y0(()=>{if(Y.current.size===0)B(J)}),q=m6.useCallback((D)=>{let A=D["aria-describedby"]?D["aria-describedby"].split(" "):[];return A.push(...K,...z),{...D,"aria-describedby":Array.from(new Set(A)).join(" ")||void 0}},[K,z]),N=m6.useMemo(()=>({controlId:U,registerControlId:F,resetControlId:W,labelId:Q,setLabelId:X,messageIds:z,setMessageIds:G,getDescriptionProps:q}),[U,F,W,Q,X,z,G,q]);return pR.jsx(QV.Provider,{value:N,children:Z.children})};var m3=P(m(),1);function O$($,Z){return{...$,state:{...$.state,valid:!Z&&$.state.valid}}}var XV=Object.keys(_$);function p20($,Z){if($.matches(":disabled"))return!1;if(!Z||$.form===Z)return!0;return $.form===null&&!$.hasAttribute("form")}function cR($,Z){let J=null;for(let H of $.keys()){if(!p20(H,Z))continue;if(!H.validity.valid)return H;J??=H}return J}function dR($){return{..._$,valid:!$,customError:$}}function zV($){return $&&$.validationMessage?[$.validationMessage]:[]}function lR($){let{elementRef:Z,formRef:J}=K4(),{setValidityData:H,validate:B,validityData:Q,validationDebounceTime:X,invalid:z,markedDirtyRef:G,state:U,shouldValidateOnChange:Y,validationMode:K,registeredFieldIdRef:F}=$,{controlId:W,getDescriptionProps:q}=n5(),N=t1(),D=m3.useRef(null),A=Z5(()=>new Map).current,V=m3.useRef(0),L=m3.useRef(null),O=m3.useCallback((E,j)=>{return A.set(E,j),()=>{A.delete(E)}},[A]),M=Y0(()=>{let E=cR(A,Z.current);return E&&A.get(E)?.controlRef.current||null}),_=Y0(async(E,j=!1)=>{V.current+=1;let k=V.current;function S(d,o=z){let p=F.current??W;if(p==null)return;let i=J.current.fields.get(p);if(!i)return;let n=O$(d,o);J.current.fields.set(p,{...i,validityData:n})}function I(d,o){let p=d.valid===!1?o:[];return{value:E,state:d,error:p[0]??"",errors:p,initialValue:Q.initialValue}}function T(d,o){let p=d.validity.customError?d.validationMessage:"",i=o.replace(/\r\n?/g,`
10
+ `);d.setCustomValidity(i),L.current=[d,i,p]}function y(){let d=L.current;if(L.current=null,d&&(!d[0].willValidate||d[0].validationMessage===d[1]))d[0].setCustomValidity(d[2])}function R(d,o,p){let i=I(d,o);S(i,p),H(i)}function x(d){let o=XV.reduce((i,n)=>{return i[n]=d.validity[n],i},{}),p=!1;for(let i of XV){if(i==="valid")continue;if(i==="valueMissing"&&o[i])p=!0;else if(o[i])return o}if(p&&!G.current)o.valid=!0,o.valueMissing=!1;return o}function v(){return A.size>0?cR(A,Z.current):D.current}let f=v();function b(){return f=v(),f?.willValidate?x(f):dR(!1)}if(j){if(U.valid!==!1||!f)return;if(!f.validity.valueMissing){y();let d=v(),o=d?.validity.customError?zV(d):[];R(dR(o.length>0),o,!1);return}for(let d of XV)if(d!=="valid"&&d!=="valueMissing"&&d!=="customError"&&f.validity[d])return}N.clear(),y();let l=b(),r=zV(f),h=Y();if(r.length===0||h){let d=Array.from(J.current.fields.values()).reduce((i,n)=>{if(n.name)i[n.name]=n.getValue();return i},{}),o=B(E,d),p;if(typeof o==="object"&&o!==null&&"then"in o){if(l.valid===!1)R(l,r);else if(K==="onSubmit"||!Q.state.customError)l.valid=null,R(l,r);if(p=await o,k!==V.current)return;l=b()}else p=o;if(r=p?[].concat(p).filter(Boolean):[],r.length>0){if(l.valid=!1,l.customError=!0,f?.willValidate)T(f,r.join(`
11
+ `))}else r=zV(f)}R(l,r)}),w=Y0((E,j=!1)=>{if(N.clear(),V.current+=1,j)return;let k=Y();if(k&&E!==""&&X)N.start(X,()=>{_(E)});else _(E,!k)}),C=m3.useCallback((E,j={})=>Y2(q(j),U.valid===!1&&!U.disabled&&!E?{"aria-invalid":!0}:D1),[q,U.disabled,U.valid]);return m3.useMemo(()=>({getValidationProps:C,inputRef:D,registeredInputs:A,registerInput:O,getInputControl:M,commit:_,change:w}),[C,A,O,M,_,w])}var HY=P(m(),1);function iR($){let{change:Z,commit:J,invalid:H,markedDirtyRef:B,name:Q,setRegisteredFieldName:X,registeredFieldIdRef:z,setValidityData:G,validityData:U}=$,{formRef:Y}=K4(),K=HY.useRef(null),F=HY.useRef(null),W=HY.useRef(!1),q=Y0(()=>{let M=F.current;if(!M)return;if(M.getValue)return M.getValue();return M.value});function N(M){return M.value===void 0?q():M.value}let D=Y0(()=>{let M=F.current;if(B.current=!0,!M){J(U.value);return}J(N(M))});function A(){let M=F.current;if(!M||!M.id)return;Y.current.fields.set(M.id,{getValue:q,name:Q??M.name,controlRef:M.controlRef,validityData:O$(U,H),validate:D})}function V(M=F.current?.id){if(M)Y.current.fields.delete(M)}function L(M){if(W.current)return;W.current=!0;let _=N(M);G((w)=>w.initialValue===_?w:{...w,initialValue:_})}H0(()=>{let M=F.current;if(!M||!M.id)return;X(Q?void 0:M.name),Y.current.fields.set(M.id,{getValue:q,name:Q??M.name,controlRef:M.controlRef,validityData:O$(U,H),validate:D})},[Y,q,H,Q,X,D,U]),H0(()=>{let M=Y.current.fields;return()=>{let _=F.current?.id;if(_)M.delete(_)}},[Y]);let O=Y0((M,_)=>{if(!_){if(K.current===M)K.current=null,Z(void 0,!0),V(),F.current=null,X(void 0),z.current=void 0;return}let w=F.current?.id,C=K.current;if(C&&C!==M)Z(void 0,!0);if(K.current=M,F.current=_,!Q)X(_.name);if(z.current=_.id,w&&w!==_.id)V(w);L(_),A()});return[D,O]}var BY=P(c(),1),c20=y2.forwardRef(function(Z,J){let{errors:H,validationMode:B,submitCountRef:Q}=K4(),{render:X,className:z,validate:G,validationDebounceTime:U=0,validationMode:Y=B,name:K,disabled:F=!1,invalid:W,dirty:q,touched:N,actionsRef:D,style:A,...V}=Z,L=uR(!0)?.disabled,O=Y0(G||(()=>null)),M=L||F,[_,w]=y2.useState(!1),[C,E]=y2.useState(!1),[j,k]=y2.useState(!1),[S,I]=y2.useState(!1),T=q??C,y=N??_,R=y2.useRef(T),x=y2.useRef(void 0),[v,f]=y2.useState(),b=K??v;H0(()=>{if(q!==void 0)R.current=q},[q]);let l=Y0((F0)=>{if(q!==void 0)return;if(F0)R.current=!0;E(F0)}),r=Y0((F0)=>{if(N!==void 0)return;w(F0)}),h=Y0(()=>Y==="onChange"||Y==="onSubmit"&&Q.current>0),d=b&&Object.hasOwn(H,b)?H[b]:null,o=!!(Array.isArray(d)?d.length:d),p=W===!0||o,[i,n]=y2.useState({state:_$,error:"",errors:[],value:null,initialValue:null}),Z0=!p&&(M?null:i.state.valid),J0=y2.useMemo(()=>({disabled:M,touched:y,dirty:T,valid:Z0,filled:j,focused:S}),[M,y,T,Z0,j,S]),U0=lR({setValidityData:n,validate:O,validityData:i,validationDebounceTime:U,invalid:p,markedDirtyRef:R,state:J0,shouldValidateOnChange:h,validationMode:Y,registeredFieldIdRef:x}),[z0,X0]=iR({change:U0.change,commit:U0.commit,invalid:p,markedDirtyRef:R,name:K,setRegisteredFieldName:f,registeredFieldIdRef:x,setValidityData:n,validityData:i});y2.useImperativeHandle(D,()=>({validate:z0}),[z0]);let q0=y2.useMemo(()=>({invalid:p,name:b,validityData:i,setValidityData:n,disabled:M,setTouched:r,setDirty:l,setFilled:k,setFocused:I,validationMode:Y,shouldValidateOnChange:h,state:J0,registerFieldControl:X0,validation:U0}),[p,b,i,M,r,l,k,I,Y,h,J0,X0,U0]),N0=G0("div",Z,{ref:J,state:J0,props:V,stateAttributesMapping:k2});return BY.jsx(BV.Provider,{value:q0,children:N0})}),rR=y2.forwardRef(function(Z,J){return BY.jsx(JY,{children:BY.jsx(c20,{...Z,ref:J})})});var tB=P(m(),1);function aR($,Z){let J=s0($);return H0(()=>{return Z(J),()=>{Z((H)=>H===J?void 0:H)}},[J,Z]),J}function QY($={}){let{id:Z,fallbackControlId:J,native:H=!1,setLabelId:B,focusControl:Q}=$,{controlId:X,setLabelId:z}=n5(),G=Y0((W)=>{z(W),B?.(W)}),U=aR(Z,G),Y=X??J;function K(W){if(Q){Q(W,Y);return}if(!Y)return;let q=m0(W.currentTarget).getElementById(Y);if(L1(q))XY(q)}function F(W){if(V1(W.nativeEvent)?.closest("button,input,select,textarea"))return;if(!W.defaultPrevented&&W.detail>1)W.preventDefault();if(H)return;K(W)}return H?{id:U,htmlFor:Y,onMouseDown:F}:{id:U,onClick:F,onPointerDown(W){W.preventDefault()}}}function XY($){$.focus({focusVisible:!0})}var zY=P(m(),1),GV=zY.createContext({disabled:!1});function TJ(){return zY.useContext(GV)}var oR=tB.forwardRef(function(Z,J){let{render:H,className:B,style:Q,id:X,nativeLabel:z=!0,...G}=Z,U=o5(!1),Y=TJ(),{labelId:K}=n5(),F={...U.state,disabled:U.disabled||Y.disabled},W=tB.useRef(null),q=QY({id:K??X,native:z});return G0("label",Z,{ref:[J,W],state:F,props:[q,G],stateAttributesMapping:k2})});var j$=P(m(),1);var UV=P(c(),1),d20={...k2,...G2},nR=j$.forwardRef(function(Z,J){let{render:H,id:B,className:Q,match:X,style:z,...G}=Z,U=s0(B),{validityData:Y,state:K,name:F}=o5(!1),{setMessageIds:W}=n5(),{errors:q}=K4(),N=F&&Object.hasOwn(q,F)?q[F]:null,D=!!(Array.isArray(N)?N.length:N),A=typeof X==="string",V=!1;if(X===!0)V=!0;else if(K.disabled)V=!1;else if(A)V=Boolean(Y.state[X]);else V=D||Y.state.valid===!1;let{mounted:L,transitionStatus:O,setMounted:M}=S2(V);H0(()=>{if(!V||!U)return;return W((R)=>R.concat(U)),()=>{W((R)=>R.filter((x)=>x!==U))}},[V,U,W]);let _=j$.useRef(null),[w,C]=j$.useState(null),[E,j]=j$.useState(null),k=Y.error;if(!A&&D)k=N;else if(Y.errors.length>1)k=Y.errors;let S=k;if(Array.isArray(k))S=k.length>1?UV.jsx("ul",{children:k.map((R)=>UV.jsx("li",{children:R},R))}):k[0];let I=Array.isArray(k)?JSON.stringify(k):k;if(V&&I!==E)j(I),C(S);V5({open:V,ref:_,onComplete(){if(!V)M(!1)}});let T={...K,transitionStatus:O},y=G0("div",Z,{ref:[J,_],state:T,props:[{id:U,children:V?S:w},G],stateAttributesMapping:d20,enabled:L});if(!L)return null;return y});var sR=P(m(),1);var tR=sR.forwardRef(function(Z,J){let{render:H,id:B,className:Q,style:X,...z}=Z,G=s0(B),U=o5(!1),Y=TJ(),{setMessageIds:K}=n5(),F={...U.state,disabled:U.disabled||Y.disabled};return H0(()=>{if(!G)return;return K((q)=>q.concat(G)),()=>{K((q)=>q.filter((N)=>N!==G))}},[G,K]),G0("p",Z,{ref:J,state:F,props:[{id:G},z],stateAttributesMapping:k2})});var GY=P(m(),1);var T$=P(m(),1);function F4({controlled:$,default:Z,name:J,state:H="value"}){let{current:B}=T$.useRef($!==void 0),[Q,X]=T$.useState(Z),z=B&&$!==void 0?$:Q,G=T$.useCallback((U)=>{if(!B)X(U)},[]);return[z,G]}function u6($,Z,J,H,B=!0,Q){let{registerFieldControl:X}=o5(),z=Z5(()=>Symbol());H0(()=>{let G=z.current;if(!B){X(G,void 0);return}X(G,{controlRef:$,getValue:H,id:Z,name:Q,value:J})},[$,B,H,Z,Q,X,z,J]),H0(()=>{let G=z.current;return()=>{X(G,void 0)}},[X,z])}var YV=P(m(),1);function p6($={}){let{id:Z,enabled:J=!0}=$,{controlId:H,registerControlId:B,resetControlId:Q}=n5(),X=s0(),z=Z5(()=>Symbol()),G=YV.useRef(!1),U=YV.useRef(!1),Y=Y0(()=>{if(!G.current||B===U1)return;G.current=!1,B(z.current,void 0)});return H0(()=>{if(!J||B===U1){Y();return}let K;if(Z!==void 0)U.current=!0,K=Z;else if(U.current)K=X;else{Q();return}if(K===void 0){Y();return}G.current=!0,B(z.current,K);return},[Z,J,B,Q,X,z,Y]),H0(()=>{return Y},[Y]),(J?H:void 0)??Z??X}var eR=GY.forwardRef(function(Z,J){let{render:H,className:B,id:Q,name:X,value:z,disabled:G=!1,onValueChange:U,defaultValue:Y,autoFocus:K=!1,style:F,...W}=Z,{state:q,name:N,disabled:D,setTouched:A,setDirty:V,validityData:L,setFocused:O,setFilled:M,validationMode:_,validation:w}=o5(),{clearErrors:C,elementRef:E,submitCountRef:j}=K4(),k=D||G,S=N??X,I={...q,disabled:k},{labelId:T}=n5(),y=p6({id:Q}),[R]=F4({controlled:z,default:Y,name:"FieldControl",state:"value"}),x=z!==void 0,v=x?R:void 0,f=v==null?void 0:String(v),b=Y0(()=>w.inputRef.current?.value);u6(w.inputRef,y,f,b,!k,X),H0(()=>{let d=f??w.inputRef.current?.value;if(d!==void 0)M(d!=="")},[f,w.inputRef,M]),i9(f,()=>{if(f===void 0)return;C(S),V(f!==(L.initialValue??"")),w.change(f)});let l=GY.useRef(null),r=t1();return H0(()=>{if(K&&l.current===l1(m0(l.current)))O(!0)},[K,O]),G0("input",Z,{ref:[J,l],state:I,props:[{id:y,disabled:k,name:S,ref:w.inputRef,"aria-labelledby":T,autoFocus:K,...x?{value:v}:{defaultValue:Y},onChange(d){let o=d.currentTarget.value,p=w0(K0.none,d.nativeEvent);if(U?.(o,p),x)return;if(V(o!==(L.initialValue??"")),M(o!==""),!d.nativeEvent.defaultPrevented&&!p.isCanceled)C(S),w.change(o)},onFocus(){O(!0)},onBlur(d){if(A(!0),O(!1),_==="onBlur"){let o=d.currentTarget.value;if(w.commit(o),x)queueMicrotask(()=>{let p=w.inputRef.current?.value;if(p!==void 0&&p!==o&&p!==(L.initialValue??""))w.commit(p)})}},onKeyDown(d){if(d.currentTarget.tagName==="INPUT"&&d.key==="Enter"){A(!0);let o=d.currentTarget.value,p=d.currentTarget.form;if(p&&p===E.current&&!d.defaultPrevented){let i=d.currentTarget,n=j.current;r.start(0,()=>{if(j.current===n)w.commit(i.value)})}else w.commit(o)}}},W,(d)=>w.getValidationProps(k,d)],stateAttributesMapping:k2})});var eB=P(m(),1);var $I=P(c(),1),ZI=function(Z){let{children:J}=Z,{validityData:H,invalid:B}=o5(!1),Q=eB.useMemo(()=>O$(H,B),[H,B]),X=Q.state.valid===!1,{transitionStatus:z}=S2(X),G=eB.useMemo(()=>{return{...Q,validity:Q.state,transitionStatus:z}},[Q,z]);return $I.jsx(eB.Fragment,{children:J(G)})};var UY=P(m(),1);var KV=P(c(),1),JI=UY.forwardRef(function(Z,J){let{render:H,className:B,style:Q,disabled:X=!1,...z}=Z,{state:G,disabled:U}=o5(!1),Y=U||X,K={...G,disabled:Y},F=UY.useMemo(()=>({disabled:Y}),[Y]),W=G0("div",Z,{ref:J,state:K,props:z,stateAttributesMapping:k2});return KV.jsx(JY,{children:KV.jsx(GV.Provider,{value:F,children:W})})});var BI=P(c(),1),$Q=HI.forwardRef(function(Z,J){return BI.jsx(YY.Control,{ref:J,...Z})});var QI=P(c(),1);function C$({className:$,type:Z,...J}){return QI.jsx($Q,{type:Z,"data-slot":"input",className:i0("h-8 w-full min-w-0 rounded-lg border bg-transparent px-2.5 py-1 text-base transition-colors outline-none file:inline-flex file:h-6 file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 disabled:pointer-events-none disabled:cursor-not-allowed disabled:bg-input/50 disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 md:text-sm dark:bg-input/30 dark:disabled:bg-input/80 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40",$),...J})}function XI($){if(!$)return"Folder name is required";if($.length>64)return"Folder name is too long (max 64 characters)";if(!/^[A-Za-z0-9][A-Za-z0-9._ -]*$/.test($))return"Use letters, numbers, dots, dashes, underscores and spaces, starting with a letter or number";if($.endsWith(".")||$.endsWith(" "))return"Folder name cannot end with a dot or space";return null}var CJ=["claude-code","codex","openclaw","hermes"];var KI=P(m(),1);var KY="/claude-z2xnay0d.svg";var zI="/floppy-disk-wmjs0n85.webp";var FY="/openai-ep9ht2pq.svg";var C1=P(c(),1);function EJ({trigger:$,open:Z,onOpenChange:J}){return C1.jsxs(f6,{open:Z,onOpenChange:J,children:[$&&C1.jsx(g3,{render:$}),C1.jsx(o20,{})]})}var GI=2;function a20({demoInstallUrl:$}){let Z=KI.useRef(null);return C1.jsx("div",{className:"relative min-h-56 overflow-hidden md:min-h-full",onMouseMove:(B)=>{if(!Z.current)return;let Q=B.currentTarget.getBoundingClientRect(),X=(B.clientX-Q.left)/Q.width-0.5,z=(B.clientY-Q.top)/Q.height-0.5;Z.current.style.setProperty("--floppy-x",`${X*-2*GI}px`),Z.current.style.setProperty("--floppy-y",`${z*-2*GI}px`)},onMouseLeave:()=>{Z.current?.style.removeProperty("--floppy-x"),Z.current?.style.removeProperty("--floppy-y")},children:C1.jsxs("a",{ref:Z,href:$,target:"_blank",rel:"noreferrer",className:"group absolute top-1/2 left-1/2 w-40 -translate-x-1/2 -translate-y-1/2 rotate-4 [transform:translate3d(var(--floppy-x,0px),var(--floppy-y,0px),0)] rounded-lg transition-transform duration-150 ease-out will-change-transform outline-none focus-visible:ring-3 focus-visible:ring-ring/50 motion-reduce:transform-none motion-reduce:transition-none md:w-36",children:[C1.jsx("img",{src:zI,alt:"",className:"w-full drop-shadow-xl"}),C1.jsxs("div",{className:z9({variant:"outline",className:"absolute -right-3 -bottom-2 -rotate-8"}),children:["About Moi",C1.jsx(UI,{"data-icon":"inline-end",stroke:1.5})]})]})})}function o20(){let{demoInstallUrl:$}=a4();return C1.jsxs(OJ,{"data-vivid":!0,showCloseButton:!1,className:"block w-full max-w-md overflow-hidden rounded-2xl bg-primary texture-checker-16 p-2 text-primary-foreground sm:max-w-md md:max-w-2xl",children:[C1.jsx("div",{className:"absolute inset-0 bg-[linear-gradient(to_right,color-mix(in_oklch,var(--background)_14%,transparent),color-mix(in_oklch,var(--background)_6%,transparent))]"}),C1.jsxs("svg",{className:"pointer-events-none absolute inset-0 size-full opacity-30 mix-blend-soft-light","aria-hidden":"true",children:[C1.jsx("filter",{id:"floppy-grain",children:C1.jsx("feTurbulence",{type:"fractalNoise",baseFrequency:"0.8",numOctaves:"2",stitchTiles:"stitch"})}),C1.jsx("rect",{width:"100%",height:"100%",filter:"url(#floppy-grain)"})]}),C1.jsxs("div",{className:"relative grid max-h-[calc(100dvh-2rem)] overflow-y-auto md:grid-cols-[3fr_2fr] md:overflow-visible",children:[C1.jsxs("div",{className:"rounded-xl bg-background p-6 text-foreground shadow-sm md:p-8",children:[C1.jsxs("div",{className:"flex flex-col gap-0.5",children:[C1.jsx(g6,{children:"Set up your personal Moi"}),C1.jsx(jJ,{className:"mt-1",children:"This is a demo workspace. Sign in and connect your agent to unlock all features."})]}),C1.jsxs("ul",{className:"mt-4 flex flex-col gap-3",children:[C1.jsxs("li",{className:"flex items-center gap-3",children:[C1.jsx(qY,{stroke:0.75,className:"mt-0.5 size-8 shrink-0 text-muted-foreground"}),C1.jsx("span",{className:"text-sm text-foreground",children:"Create as many workspaces, views, and widgets as you want"})]}),C1.jsxs("li",{className:"flex items-center gap-3",children:[C1.jsx(YI,{stroke:0.75,className:"mt-0.5 size-8 shrink-0 text-muted-foreground"}),C1.jsxs("span",{className:"text-sm text-foreground",children:["Build with"," ",C1.jsxs("span",{className:"inline-flex items-baseline gap-1",children:[C1.jsx("img",{src:KY,alt:"",className:"size-3.5 self-center object-contain"}),C1.jsx("strong",{className:"font-medium",children:"Claude"})]})," ","or"," ",C1.jsxs("span",{className:"inline-flex items-baseline gap-1",children:[C1.jsx("img",{src:FY,alt:"",className:"size-3.5 self-center object-contain"}),C1.jsx("strong",{className:"font-medium",children:"ChatGPT"})]})," ","using your subscription and app connectors"]})]})]}),C1.jsxs(M0,{render:C1.jsx("a",{href:"/cloud/login"}),className:"mt-6",children:["Sign in",C1.jsx(WY,{"data-icon":"inline-end",stroke:1.5})]})]}),C1.jsx(a20,{demoInstallUrl:$})]}),C1.jsx(sB,{render:C1.jsx(M0,{variant:"outline",size:"icon","aria-label":"Close",className:"absolute top-4 right-4",children:C1.jsx(e5,{stroke:1.5})})})]})}var J7=P(m(),1);var ky=P(m(),1);var FI="/hermes-pznd63x9.png";var WI="/openclaw-a2pyfhpn.svg";var ZQ=["rocket","sparkles","bolt","flame","star","heart","diamond","trophy","target","bulb","brain","robot","wand","atom","flask","cpu","code","terminal","api","database","cube","hexagon","plug","tool","settings","dots","bug","activity","chart","briefcase","folder","file","book","message","mail","bell","paperclip","key","shield","user","home","globe","world","planet","compass","map","calendar","cloud","sun","moon","snowflake","leaf","mountain","feather","ghost","music","piano","camera","photo","palette","gamepad","gift","cart","chef"],t20=new Set(ZQ);function qI($){return t20.has($)}var Dk={rocket:Bk,sparkles:Gk,bolt:JQ,flame:vI,star:Uk,heart:cI,diamond:xI,trophy:qk,target:Kk,bulb:OI,brain:MI,robot:Hk,wand:Nk,atom:DI,flask:fI,cpu:RI,code:wI,terminal:Fk,api:AI,database:kI,cube:II,hexagon:dI,plug:Jk,tool:Wk,settings:c6,dots:NY,bug:_I,activity:NI,chart:CI,briefcase:PI,folder:gI,file:bJ,book:LI,message:oI,mail:rI,bell:VI,paperclip:DY,key:AY,shield:Qk,user:NU,home:lI,globe:pI,world:Ak,planet:Zk,compass:SI,map:aI,calendar:jI,cloud:bI,sun:Yk,moon:nI,snowflake:zk,leaf:iI,mountain:sI,feather:hI,ghost:mI,music:tI,piano:VY,camera:TI,photo:$k,palette:eI,gamepad:yI,gift:uI,cart:Xk,chef:EI},Vk=ZQ.map(($)=>({id:$,Icon:Dk[$]}));function LY($){return $&&qI($)?Dk[$]:null}var e20=($,Z)=>{if(typeof $!=="number")return;if(Z===3)return{mode:"rgb",r:($>>8&15|$>>4&240)/255,g:($>>4&15|$&240)/255,b:($&15|$<<4&240)/255};if(Z===4)return{mode:"rgb",r:($>>12&15|$>>8&240)/255,g:($>>8&15|$>>4&240)/255,b:($>>4&15|$&240)/255,alpha:($&15|$<<4&240)/255};if(Z===6)return{mode:"rgb",r:($>>16&255)/255,g:($>>8&255)/255,b:($&255)/255};if(Z===8)return{mode:"rgb",r:($>>24&255)/255,g:($>>16&255)/255,b:($>>8&255)/255,alpha:($&255)/255}},MY=e20;var $40={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074},Lk=$40;var Z40=($)=>{return MY(Lk[$.toLowerCase()],6)},Mk=Z40;var J40=/^#?([0-9a-f]{8}|[0-9a-f]{6}|[0-9a-f]{4}|[0-9a-f]{3})$/i,H40=($)=>{let Z;return(Z=$.match(J40))?MY(parseInt(Z[1],16),Z[1].length):void 0},Pk=H40;var PY="([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)";var E$="([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)%";var HQ="(?:([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)%|([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?))";var _k="(?:([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)(deg|grad|rad|turn)|([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?))";var d6="\\s*,\\s*";var Yu0=new RegExp("^(?:([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)%|([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)|none)$");var B40=new RegExp(`^rgba?\\(\\s*${PY}${d6}${PY}${d6}${PY}\\s*(?:,\\s*${HQ}\\s*)?\\)$`),Q40=new RegExp(`^rgba?\\(\\s*${E$}${d6}${E$}${d6}${E$}\\s*(?:,\\s*${HQ}\\s*)?\\)$`),X40=($)=>{let Z={mode:"rgb"},J;if(J=$.match(B40)){if(J[1]!==void 0)Z.r=J[1]/255;if(J[2]!==void 0)Z.g=J[2]/255;if(J[3]!==void 0)Z.b=J[3]/255}else if(J=$.match(Q40)){if(J[1]!==void 0)Z.r=J[1]/100;if(J[2]!==void 0)Z.g=J[2]/100;if(J[3]!==void 0)Z.b=J[3]/100}else return;if(J[4]!==void 0)Z.alpha=Math.max(0,Math.min(1,J[4]/100));else if(J[5]!==void 0)Z.alpha=Math.max(0,Math.min(1,+J[5]));return Z},Ok=X40;var z40=($,Z)=>$===void 0?void 0:typeof $!=="object"?Tk($):$.mode!==void 0?$:Z?{...$,mode:Z}:void 0,jk=z40;var G40=($="rgb")=>(Z)=>(Z=jk(Z,$))!==void 0?Z.mode===$?Z:G9[Z.mode][$]?G9[Z.mode][$](Z):$==="rgb"?G9[Z.mode].rgb(Z):G9.rgb[$](G9[Z.mode].rgb(Z)):void 0,_Y=G40;var G9={},Ck={},BQ=[],FV={},U40=($)=>$,U5=($)=>{if(G9[$.mode]={...G9[$.mode],...$.toMode},Object.keys($.fromMode||{}).forEach((Z)=>{if(!G9[Z])G9[Z]={};G9[Z][$.mode]=$.fromMode[Z]}),!$.ranges)$.ranges={};if(!$.difference)$.difference={};return $.channels.forEach((Z)=>{if($.ranges[Z]===void 0)$.ranges[Z]=[0,1];if(!$.interpolate[Z])throw Error(`Missing interpolator for: ${Z}`);if(typeof $.interpolate[Z]==="function")$.interpolate[Z]={use:$.interpolate[Z]};if(!$.interpolate[Z].fixup)$.interpolate[Z].fixup=U40}),Ck[$.mode]=$,($.parse||[]).forEach((Z)=>{Y40(Z,$.mode)}),_Y($.mode)},Ek=($)=>Ck[$],Y40=($,Z)=>{if(typeof $==="string"){if(!Z)throw Error("'mode' required when 'parser' is a string");FV[$]=Z}else if(typeof $==="function"){if(BQ.indexOf($)<0)BQ.push($)}};var WV=/[^\x00-\x7F]|[a-zA-Z_]/,K40=/[^\x00-\x7F]|[-\w]/,j0={Function:"function",Ident:"ident",Number:"number",Percentage:"percentage",ParenClose:")",None:"none",Hue:"hue",Alpha:"alpha"},Y1=0;function OY($){let Z=$[Y1],J=$[Y1+1];if(Z==="-"||Z==="+")return/\d/.test(J)||J==="."&&/\d/.test($[Y1+2]);if(Z===".")return/\d/.test(J);return/\d/.test(Z)}function qV($){if(Y1>=$.length)return!1;let Z=$[Y1];if(WV.test(Z))return!0;if(Z==="-"){if($.length-Y1<2)return!1;let J=$[Y1+1];if(J==="-"||WV.test(J))return!0;return!1}return!1}var F40={deg:1,rad:180/Math.PI,grad:0.9,turn:360};function QQ($){let Z="";if($[Y1]==="-"||$[Y1]==="+")Z+=$[Y1++];if(Z+=jY($),$[Y1]==="."&&/\d/.test($[Y1+1]))Z+=$[Y1++]+jY($);if($[Y1]==="e"||$[Y1]==="E"){if(($[Y1+1]==="-"||$[Y1+1]==="+")&&/\d/.test($[Y1+2]))Z+=$[Y1++]+$[Y1++]+jY($);else if(/\d/.test($[Y1+1]))Z+=$[Y1++]+jY($)}if(qV($)){let J=TY($);if(J==="deg"||J==="rad"||J==="turn"||J==="grad")return{type:j0.Hue,value:Z*F40[J]};return}if($[Y1]==="%")return Y1++,{type:j0.Percentage,value:+Z};return{type:j0.Number,value:+Z}}function jY($){let Z="";while(/\d/.test($[Y1]))Z+=$[Y1++];return Z}function TY($){let Z="";while(Y1<$.length&&K40.test($[Y1]))Z+=$[Y1++];return Z}function W40($){let Z=TY($);if($[Y1]==="(")return Y1++,{type:j0.Function,value:Z};if(Z==="none")return{type:j0.None,value:void 0};return{type:j0.Ident,value:Z}}function q40($=""){let Z=$.trim(),J=[],H;Y1=0;while(Y1<Z.length){if(H=Z[Y1++],H===`
12
+ `||H==="\t"||H===" "){while(Y1<Z.length&&(Z[Y1]===`
13
+ `||Z[Y1]==="\t"||Z[Y1]===" "))Y1++;continue}if(H===",")return;if(H===")"){J.push({type:j0.ParenClose});continue}if(H==="+"){if(Y1--,OY(Z)){J.push(QQ(Z));continue}return}if(H==="-"){if(Y1--,OY(Z)){J.push(QQ(Z));continue}if(qV(Z)){J.push({type:j0.Ident,value:TY(Z)});continue}return}if(H==="."){if(Y1--,OY(Z)){J.push(QQ(Z));continue}return}if(H==="/"){while(Y1<Z.length&&(Z[Y1]===`
14
+ `||Z[Y1]==="\t"||Z[Y1]===" "))Y1++;let B;if(OY(Z)){if(B=QQ(Z),B.type!==j0.Hue){J.push({type:j0.Alpha,value:B});continue}}if(qV(Z)){if(TY(Z)==="none"){J.push({type:j0.Alpha,value:{type:j0.None,value:void 0}});continue}}return}if(/\d/.test(H)){Y1--,J.push(QQ(Z));continue}if(WV.test(H)){Y1--,J.push(W40(Z));continue}return}return J}function N40($){$._i=0;let Z=$[$._i++];if(!Z||Z.type!==j0.Function||Z.value!=="color")return;if(Z=$[$._i++],Z.type!==j0.Ident)return;let J=FV[Z.value];if(!J)return;let H={mode:J},B=bk($,!1);if(!B)return;let Q=Ek(J).channels;for(let X=0,z,G;X<Q.length;X++)if(z=B[X],G=Q[X],z.type!==j0.None){if(H[G]=z.type===j0.Number?z.value:z.value/100,G==="alpha")H[G]=Math.max(0,Math.min(1,H[G]))}return H}function bk($,Z){let J=[],H;while($._i<$.length){if(H=$[$._i++],H.type===j0.None||H.type===j0.Number||H.type===j0.Alpha||H.type===j0.Percentage||Z&&H.type===j0.Hue){J.push(H);continue}if(H.type===j0.ParenClose){if($._i<$.length)return;continue}return}if(J.length<3||J.length>4)return;if(J.length===4){if(J[3].type!==j0.Alpha)return;J[3]=J[3].value}if(J.length===3)J.push({type:j0.None,value:void 0});return J.every((B)=>B.type!==j0.Alpha)?J:void 0}function A40($,Z){$._i=0;let J=$[$._i++];if(!J||J.type!==j0.Function)return;let H=bk($,Z);if(!H)return;return H.unshift(J.value),H}var D40=($)=>{if(typeof $!=="string")return;let Z=q40($),J=Z?A40(Z,!0):void 0,H=void 0,B=0,Q=BQ.length;while(B<Q)if((H=BQ[B++]($,J))!==void 0)return H;return Z?N40(Z):void 0},Tk=D40;function V40($,Z){if(!Z||Z[0]!=="rgb"&&Z[0]!=="rgba")return;let J={mode:"rgb"},[,H,B,Q,X]=Z;if(H.type===j0.Hue||B.type===j0.Hue||Q.type===j0.Hue)return;if(H.type!==j0.None)J.r=H.type===j0.Number?H.value/255:H.value/100;if(B.type!==j0.None)J.g=B.type===j0.Number?B.value/255:B.value/100;if(Q.type!==j0.None)J.b=Q.type===j0.Number?Q.value/255:Q.value/100;if(X.type!==j0.None)J.alpha=Math.min(1,Math.max(0,X.type===j0.Number?X.value:X.value/100));return J}var wk=V40;var L40=($)=>$==="transparent"?{mode:"rgb",r:0,g:0,b:0,alpha:0}:void 0,Sk=L40;var Rk=($,Z,J)=>$+J*(Z-$);var M40=($)=>{let Z=[];for(let J=0;J<$.length-1;J++){let H=$[J],B=$[J+1];if(H===void 0&&B===void 0)Z.push(void 0);else if(H!==void 0&&B!==void 0)Z.push([H,B]);else Z.push(H!==void 0?[H,H]:[B,B])}return Z},Ik=($)=>(Z)=>{let J=M40(Z);return(H)=>{let B=H*J.length,Q=H>=1?J.length-1:Math.max(Math.floor(B),0),X=J[Q];return X===void 0?void 0:$(X[0],X[1],B-Q)}};var E0=Ik(Rk);var x1=($)=>{let Z=!1,J=$.map((H)=>{if(H!==void 0)return Z=!0,H;return 1});return Z?J:$};var P40={mode:"rgb",channels:["r","g","b","alpha"],parse:[wk,Pk,Ok,Mk,Sk,"srgb"],serialize:"srgb",interpolate:{r:E0,g:E0,b:E0,alpha:{use:E0,fixup:x1}},gamut:!0,white:{r:1,g:1,b:1},black:{r:0,g:0,b:0}},k8=P40;var NV=($=0)=>Math.pow(Math.abs($),2.19921875)*Math.sign($),_40=($)=>{let Z=NV($.r),J=NV($.g),H=NV($.b),B={mode:"xyz65",x:0.5766690429101305*Z+0.1855582379065463*J+0.1882286462349947*H,y:0.297344975250536*Z+0.6273635662554661*J+0.0752914584939979*H,z:0.0270313613864123*Z+0.0706888525358272*J+0.9913375368376386*H};if($.alpha!==void 0)B.alpha=$.alpha;return B},AV=_40;var DV=($)=>Math.pow(Math.abs($),0.4547069271758437)*Math.sign($),O40=({x:$,y:Z,z:J,alpha:H})=>{if($===void 0)$=0;if(Z===void 0)Z=0;if(J===void 0)J=0;let B={mode:"a98",r:DV($*2.0415879038107465-Z*0.5650069742788597-0.3447313507783297*J),g:DV($*-0.9692436362808798+Z*1.8759675015077206+0.0415550574071756*J),b:DV($*0.0134442806320312-Z*0.1183623922310184+1.0151749943912058*J)};if(H!==void 0)B.alpha=H;return B},VV=O40;var LV=($=0)=>{let Z=Math.abs($);if(Z<=0.04045)return $/12.92;return(Math.sign($)||1)*Math.pow((Z+0.055)/1.055,2.4)},j40=({r:$,g:Z,b:J,alpha:H})=>{let B={mode:"lrgb",r:LV($),g:LV(Z),b:LV(J)};if(H!==void 0)B.alpha=H;return B},y8=j40;var T40=($)=>{let{r:Z,g:J,b:H,alpha:B}=y8($),Q={mode:"xyz65",x:0.4123907992659593*Z+0.357584339383878*J+0.1804807884018343*H,y:0.2126390058715102*Z+0.715168678767756*J+0.0721923153607337*H,z:0.0193308187155918*Z+0.119194779794626*J+0.9505321522496607*H};if(B!==void 0)Q.alpha=B;return Q},o4=T40;var MV=($=0)=>{let Z=Math.abs($);if(Z>0.0031308)return(Math.sign($)||1)*(1.055*Math.pow(Z,0.4166666666666667)-0.055);return $*12.92},C40=({r:$,g:Z,b:J,alpha:H},B="rgb")=>{let Q={mode:B,r:MV($),g:MV(Z),b:MV(J)};if(H!==void 0)Q.alpha=H;return Q},x8=C40;var E40=({x:$,y:Z,z:J,alpha:H})=>{if($===void 0)$=0;if(Z===void 0)Z=0;if(J===void 0)J=0;let B=x8({r:$*3.2409699419045226-Z*1.537383177570094-0.4986107602930034*J,g:$*-0.9692436362808796+Z*1.8759675015077204+0.0415550574071756*J,b:$*0.0556300796969936-Z*0.2039769588889765+1.0569715142428784*J});if(H!==void 0)B.alpha=H;return B},n4=E40;var b40={...k8,mode:"a98",parse:["a98-rgb"],serialize:"a98-rgb",fromMode:{rgb:($)=>VV(o4($)),xyz65:VV},toMode:{rgb:($)=>n4(AV($)),xyz65:AV}},kk=b40;var w40=($)=>($=$%360)<0?$+360:$,O5=w40;var S40=($,Z)=>{return $.map((J,H,B)=>{if(J===void 0)return J;let Q=O5(J);if(H===0||$[H-1]===void 0)return Q;return Z(Q-O5(B[H-1]))}).reduce((J,H)=>{if(!J.length||H===void 0||J[J.length-1]===void 0)return J.push(H),J;return J.push(H+J[J.length-1]),J},[])},x2=($)=>S40($,(Z)=>Math.abs(Z)<=180?Z:Z-360*Math.sign(Z));var W2=[-0.14861,1.78277,-0.29227,-0.90649,1.97294,0],yk=Math.PI/180,xk=180/Math.PI;var hk=W2[3]*W2[4],vk=W2[1]*W2[4],fk=W2[1]*W2[2]-W2[0]*W2[3],R40=({r:$,g:Z,b:J,alpha:H})=>{if($===void 0)$=0;if(Z===void 0)Z=0;if(J===void 0)J=0;let B=(fk*J+$*hk-Z*vk)/(fk+hk-vk),Q=J-B,X=(W2[4]*(Z-B)-W2[2]*Q)/W2[3],z={mode:"cubehelix",l:B,s:B===0||B===1?void 0:Math.sqrt(Q*Q+X*X)/(W2[4]*B*(1-B))};if(z.s)z.h=Math.atan2(X,Q)*xk-120;if(H!==void 0)z.alpha=H;return z},gk=R40;var I40=({h:$,s:Z,l:J,alpha:H})=>{let B={mode:"rgb"};if($=($===void 0?0:$+120)*yk,J===void 0)J=0;let Q=Z===void 0?0:Z*J*(1-J),X=Math.cos($),z=Math.sin($);if(B.r=J+Q*(W2[0]*X+W2[1]*z),B.g=J+Q*(W2[2]*X+W2[3]*z),B.b=J+Q*(W2[4]*X+W2[5]*z),H!==void 0)B.alpha=H;return B},mk=I40;var l6=($,Z)=>{if($.h===void 0||Z.h===void 0||!$.s||!Z.s)return 0;let J=O5($.h),H=O5(Z.h),B=Math.sin((H-J+360)/2*Math.PI/180);return 2*Math.sqrt($.s*Z.s)*B},uk=($,Z)=>{if($.h===void 0||Z.h===void 0)return 0;let J=O5($.h),H=O5(Z.h);if(Math.abs(H-J)>180)return J-(H-360*Math.sign(H-J));return H-J},i6=($,Z)=>{if($.h===void 0||Z.h===void 0||!$.c||!Z.c)return 0;let J=O5($.h),H=O5(Z.h),B=Math.sin((H-J+360)/2*Math.PI/180);return 2*Math.sqrt($.c*Z.c)*B};var h2=($)=>{let Z=$.reduce((H,B)=>{if(B!==void 0){let Q=B*Math.PI/180;H.sin+=Math.sin(Q),H.cos+=Math.cos(Q)}return H},{sin:0,cos:0}),J=Math.atan2(Z.sin,Z.cos)*180/Math.PI;return J<0?360+J:J};var k40={mode:"cubehelix",channels:["h","s","l","alpha"],parse:["--cubehelix"],serialize:"--cubehelix",ranges:{h:[0,360],s:[0,4.614],l:[0,1]},fromMode:{rgb:gk},toMode:{rgb:mk},interpolate:{h:{use:E0,fixup:x2},s:E0,l:E0,alpha:{use:E0,fixup:x1}},difference:{h:l6},average:{h:h2}},pk=k40;var y40=({l:$,a:Z,b:J,alpha:H},B="lch")=>{if(Z===void 0)Z=0;if(J===void 0)J=0;let Q=Math.sqrt(Z*Z+J*J),X={mode:B,l:$,c:Q};if(Q)X.h=O5(Math.atan2(J,Z)*180/Math.PI);if(H!==void 0)X.alpha=H;return X},q8=y40;var x40=({l:$,c:Z,h:J,alpha:H},B="lab")=>{if(J===void 0)J=0;let Q={mode:B,l:$,a:Z?Z*Math.cos(J/180*Math.PI):0,b:Z?Z*Math.sin(J/180*Math.PI):0};if(H!==void 0)Q.alpha=H;return Q},N8=x40;var CY=Math.pow(29,3)/Math.pow(3,3),EY=Math.pow(6,3)/Math.pow(29,3);var u5={X:0.9642956764295677,Y:1,Z:0.8251046025104602},r6={X:0.9504559270516716,Y:1,Z:1.0890577507598784},Op0=Math.pow(29,3)/Math.pow(3,3),jp0=Math.pow(6,3)/Math.pow(29,3);var PV=($)=>Math.pow($,3)>EY?Math.pow($,3):(116*$-16)/CY,h40=({l:$,a:Z,b:J,alpha:H})=>{if($===void 0)$=0;if(Z===void 0)Z=0;if(J===void 0)J=0;let B=($+16)/116,Q=Z/500+B,X=B-J/200,z={mode:"xyz65",x:PV(Q)*r6.X,y:PV(B)*r6.Y,z:PV(X)*r6.Z};if(H!==void 0)z.alpha=H;return z},bY=h40;var v40=($)=>n4(bY($)),a6=v40;var _V=($)=>$>EY?Math.cbrt($):(CY*$+16)/116,f40=({x:$,y:Z,z:J,alpha:H})=>{if($===void 0)$=0;if(Z===void 0)Z=0;if(J===void 0)J=0;let B=_V($/r6.X),Q=_V(Z/r6.Y),X=_V(J/r6.Z),z={mode:"lab65",l:116*Q-16,a:500*(B-Q),b:200*(Q-X)};if(H!==void 0)z.alpha=H;return z},wY=f40;var g40=($)=>{let Z=wY(o4($));if($.r===$.b&&$.b===$.g)Z.a=Z.b=0;return Z},o6=g40;var wJ=1,SY=1,b$=0.14444444444444443*Math.PI,SJ=Math.cos(b$),RJ=Math.sin(b$),RY=100/Math.log(1.39);var m40=({l:$,c:Z,h:J,alpha:H})=>{if($===void 0)$=0;if(Z===void 0)Z=0;if(J===void 0)J=0;let B={mode:"lab65",l:(Math.exp($*wJ/RY)-1)/0.0039},Q=(Math.exp(0.0435*Z*SY*wJ)-1)/0.075,X=Q*Math.cos(J/180*Math.PI-b$),z=Q*Math.sin(J/180*Math.PI-b$);if(B.a=X*SJ-z/0.83*RJ,B.b=X*RJ+z/0.83*SJ,H!==void 0)B.alpha=H;return B},XQ=m40;var u40=({l:$,a:Z,b:J,alpha:H})=>{if($===void 0)$=0;if(Z===void 0)Z=0;if(J===void 0)J=0;let B=Z*SJ+J*RJ,Q=0.83*(J*SJ-Z*RJ),X=Math.sqrt(B*B+Q*Q),z={mode:"dlch",l:RY/wJ*Math.log(1+0.0039*$),c:Math.log(1+0.075*X)/(0.0435*SY*wJ)};if(z.c)z.h=O5((Math.atan2(Q,B)+b$)/Math.PI*180);if(H!==void 0)z.alpha=H;return z},zQ=u40;var ck=($)=>XQ(q8($,"dlch")),dk=($)=>N8(zQ($),"dlab"),p40={mode:"dlab",parse:["--din99o-lab"],serialize:"--din99o-lab",toMode:{lab65:ck,rgb:($)=>a6(ck($))},fromMode:{lab65:dk,rgb:($)=>dk(o6($))},channels:["l","a","b","alpha"],ranges:{l:[0,100],a:[-40.09,45.501],b:[-40.469,44.344]},interpolate:{l:E0,a:E0,b:E0,alpha:{use:E0,fixup:x1}}},lk=p40;var c40={mode:"dlch",parse:["--din99o-lch"],serialize:"--din99o-lch",toMode:{lab65:XQ,dlab:($)=>N8($,"dlab"),rgb:($)=>a6(XQ($))},fromMode:{lab65:zQ,dlab:($)=>q8($,"dlch"),rgb:($)=>zQ(o6($))},channels:["l","c","h","alpha"],ranges:{l:[0,100],c:[0,51.484],h:[0,360]},interpolate:{l:E0,c:E0,h:{use:E0,fixup:x2},alpha:{use:E0,fixup:x1}},difference:{h:i6},average:{h:h2}},ik=c40;function OV({h:$,s:Z,i:J,alpha:H}){if($=O5($!==void 0?$:0),Z===void 0)Z=0;if(J===void 0)J=0;let B=Math.abs($/60%2-1),Q;switch(Math.floor($/60)){case 0:Q={r:J*(1+Z*(3/(2-B)-1)),g:J*(1+Z*(3*(1-B)/(2-B)-1)),b:J*(1-Z)};break;case 1:Q={r:J*(1+Z*(3*(1-B)/(2-B)-1)),g:J*(1+Z*(3/(2-B)-1)),b:J*(1-Z)};break;case 2:Q={r:J*(1-Z),g:J*(1+Z*(3/(2-B)-1)),b:J*(1+Z*(3*(1-B)/(2-B)-1))};break;case 3:Q={r:J*(1-Z),g:J*(1+Z*(3*(1-B)/(2-B)-1)),b:J*(1+Z*(3/(2-B)-1))};break;case 4:Q={r:J*(1+Z*(3*(1-B)/(2-B)-1)),g:J*(1-Z),b:J*(1+Z*(3/(2-B)-1))};break;case 5:Q={r:J*(1+Z*(3/(2-B)-1)),g:J*(1-Z),b:J*(1+Z*(3*(1-B)/(2-B)-1))};break;default:Q={r:J*(1-Z),g:J*(1-Z),b:J*(1-Z)}}if(Q.mode="rgb",H!==void 0)Q.alpha=H;return Q}function jV({r:$,g:Z,b:J,alpha:H}){if($===void 0)$=0;if(Z===void 0)Z=0;if(J===void 0)J=0;let B=Math.max($,Z,J),Q=Math.min($,Z,J),X={mode:"hsi",s:$+Z+J===0?0:1-3*Q/($+Z+J),i:($+Z+J)/3};if(B-Q!==0)X.h=(B===$?(Z-J)/(B-Q)+(Z<J)*6:B===Z?(J-$)/(B-Q)+2:($-Z)/(B-Q)+4)*60;if(H!==void 0)X.alpha=H;return X}var d40={mode:"hsi",toMode:{rgb:OV},parse:["--hsi"],serialize:"--hsi",fromMode:{rgb:jV},channels:["h","s","i","alpha"],ranges:{h:[0,360]},gamut:"rgb",interpolate:{h:{use:E0,fixup:x2},s:E0,i:E0,alpha:{use:E0,fixup:x1}},difference:{h:l6},average:{h:h2}},rk=d40;function TV({h:$,s:Z,l:J,alpha:H}){if($=O5($!==void 0?$:0),Z===void 0)Z=0;if(J===void 0)J=0;let B=J+Z*(J<0.5?J:1-J),Q=B-(B-J)*2*Math.abs($/60%2-1),X;switch(Math.floor($/60)){case 0:X={r:B,g:Q,b:2*J-B};break;case 1:X={r:Q,g:B,b:2*J-B};break;case 2:X={r:2*J-B,g:B,b:Q};break;case 3:X={r:2*J-B,g:Q,b:B};break;case 4:X={r:Q,g:2*J-B,b:B};break;case 5:X={r:B,g:2*J-B,b:Q};break;default:X={r:2*J-B,g:2*J-B,b:2*J-B}}if(X.mode="rgb",H!==void 0)X.alpha=H;return X}function CV({r:$,g:Z,b:J,alpha:H}){if($===void 0)$=0;if(Z===void 0)Z=0;if(J===void 0)J=0;let B=Math.max($,Z,J),Q=Math.min($,Z,J),X={mode:"hsl",s:B===Q?0:(B-Q)/(1-Math.abs(B+Q-1)),l:0.5*(B+Q)};if(B-Q!==0)X.h=(B===$?(Z-J)/(B-Q)+(Z<J)*6:B===Z?(J-$)/(B-Q)+2:($-Z)/(B-Q)+4)*60;if(H!==void 0)X.alpha=H;return X}var l40=($,Z)=>{switch(Z){case"deg":return+$;case"rad":return $/Math.PI*180;case"grad":return $/10*9;case"turn":return $*360}},ak=l40;var i40=new RegExp(`^hsla?\\(\\s*${_k}${d6}${E$}${d6}${E$}\\s*(?:,\\s*${HQ}\\s*)?\\)$`),r40=($)=>{let Z=$.match(i40);if(!Z)return;let J={mode:"hsl"};if(Z[3]!==void 0)J.h=+Z[3];else if(Z[1]!==void 0&&Z[2]!==void 0)J.h=ak(Z[1],Z[2]);if(Z[4]!==void 0)J.s=Math.min(Math.max(0,Z[4]/100),1);if(Z[5]!==void 0)J.l=Math.min(Math.max(0,Z[5]/100),1);if(Z[6]!==void 0)J.alpha=Math.max(0,Math.min(1,Z[6]/100));else if(Z[7]!==void 0)J.alpha=Math.max(0,Math.min(1,+Z[7]));return J},ok=r40;function a40($,Z){if(!Z||Z[0]!=="hsl"&&Z[0]!=="hsla")return;let J={mode:"hsl"},[,H,B,Q,X]=Z;if(H.type!==j0.None){if(H.type===j0.Percentage)return;J.h=H.value}if(B.type!==j0.None){if(B.type===j0.Hue)return;J.s=B.value/100}if(Q.type!==j0.None){if(Q.type===j0.Hue)return;J.l=Q.value/100}if(X.type!==j0.None)J.alpha=Math.min(1,Math.max(0,X.type===j0.Number?X.value:X.value/100));return J}var nk=a40;var o40={mode:"hsl",toMode:{rgb:TV},fromMode:{rgb:CV},channels:["h","s","l","alpha"],ranges:{h:[0,360]},gamut:"rgb",parse:[nk,ok],serialize:($)=>`hsl(${$.h!==void 0?$.h:"none"} ${$.s!==void 0?$.s*100+"%":"none"} ${$.l!==void 0?$.l*100+"%":"none"}${$.alpha<1?` / ${$.alpha}`:""})`,interpolate:{h:{use:E0,fixup:x2},s:E0,l:E0,alpha:{use:E0,fixup:x1}},difference:{h:l6},average:{h:h2}},IY=o40;function GQ({h:$,s:Z,v:J,alpha:H}){if($=O5($!==void 0?$:0),Z===void 0)Z=0;if(J===void 0)J=0;let B=Math.abs($/60%2-1),Q;switch(Math.floor($/60)){case 0:Q={r:J,g:J*(1-Z*B),b:J*(1-Z)};break;case 1:Q={r:J*(1-Z*B),g:J,b:J*(1-Z)};break;case 2:Q={r:J*(1-Z),g:J,b:J*(1-Z*B)};break;case 3:Q={r:J*(1-Z),g:J*(1-Z*B),b:J};break;case 4:Q={r:J*(1-Z*B),g:J*(1-Z),b:J};break;case 5:Q={r:J,g:J*(1-Z),b:J*(1-Z*B)};break;default:Q={r:J*(1-Z),g:J*(1-Z),b:J*(1-Z)}}if(Q.mode="rgb",H!==void 0)Q.alpha=H;return Q}function UQ({r:$,g:Z,b:J,alpha:H}){if($===void 0)$=0;if(Z===void 0)Z=0;if(J===void 0)J=0;let B=Math.max($,Z,J),Q=Math.min($,Z,J),X={mode:"hsv",s:B===0?0:1-Q/B,v:B};if(B-Q!==0)X.h=(B===$?(Z-J)/(B-Q)+(Z<J)*6:B===Z?(J-$)/(B-Q)+2:($-Z)/(B-Q)+4)*60;if(H!==void 0)X.alpha=H;return X}var n40={mode:"hsv",toMode:{rgb:GQ},parse:["--hsv"],serialize:"--hsv",fromMode:{rgb:UQ},channels:["h","s","v","alpha"],ranges:{h:[0,360]},gamut:"rgb",interpolate:{h:{use:E0,fixup:x2},s:E0,v:E0,alpha:{use:E0,fixup:x1}},difference:{h:l6},average:{h:h2}},kY=n40;function EV({h:$,w:Z,b:J,alpha:H}){if(Z===void 0)Z=0;if(J===void 0)J=0;if(Z+J>1){let B=Z+J;Z/=B,J/=B}return GQ({h:$,s:J===1?1:1-Z/(1-J),v:1-J,alpha:H})}function bV($){let Z=UQ($);if(Z===void 0)return;let J=Z.s!==void 0?Z.s:0,H=Z.v!==void 0?Z.v:0,B={mode:"hwb",w:(1-J)*H,b:1-H};if(Z.h!==void 0)B.h=Z.h;if(Z.alpha!==void 0)B.alpha=Z.alpha;return B}function s40($,Z){if(!Z||Z[0]!=="hwb")return;let J={mode:"hwb"},[,H,B,Q,X]=Z;if(H.type!==j0.None){if(H.type===j0.Percentage)return;J.h=H.value}if(B.type!==j0.None){if(B.type===j0.Hue)return;J.w=B.value/100}if(Q.type!==j0.None){if(Q.type===j0.Hue)return;J.b=Q.value/100}if(X.type!==j0.None)J.alpha=Math.min(1,Math.max(0,X.type===j0.Number?X.value:X.value/100));return J}var sk=s40;var t40={mode:"hwb",toMode:{rgb:EV},fromMode:{rgb:bV},channels:["h","w","b","alpha"],ranges:{h:[0,360]},gamut:"rgb",parse:[sk],serialize:($)=>`hwb(${$.h!==void 0?$.h:"none"} ${$.w!==void 0?$.w*100+"%":"none"} ${$.b!==void 0?$.b*100+"%":"none"}${$.alpha<1?` / ${$.alpha}`:""})`,interpolate:{h:{use:E0,fixup:x2},w:E0,b:E0,alpha:{use:E0,fixup:x1}},difference:{h:uk},average:{h:h2}},tk=t40;var yY=203;var xY=0.1593017578125;var hY=0.8359375,vY=18.8515625,fY=18.6875;function gY($){if($<0)return 0;let Z=Math.pow($,0.012683313515655966);return 1e4*Math.pow(Math.max(0,Z-0.8359375)/(18.8515625-18.6875*Z),6.277394636015326)}function mY($){if($<0)return 0;let Z=Math.pow($/1e4,0.1593017578125);return Math.pow((0.8359375+18.8515625*Z)/(1+18.6875*Z),78.84375)}var wV=($)=>Math.max($/yY,0),e40=({i:$,t:Z,p:J,alpha:H})=>{if($===void 0)$=0;if(Z===void 0)Z=0;if(J===void 0)J=0;let B=gY($+0.008609037037932761*Z+0.11102962500302593*J),Q=gY($-0.00860903703793275*Z-0.11102962500302599*J),X=gY($+0.5600313357106791*Z-0.32062717498731885*J),z={mode:"xyz65",x:wV(2.070152218389422*B-1.3263473389671556*Q+0.2066510476294051*X),y:wV(0.3647385209748074*B+0.680566024947227*Q-0.0453045459220346*X),z:wV(-0.049747207535812*B-0.0492609666966138*Q+1.1880659249923042*X)};if(H!==void 0)z.alpha=H;return z},SV=e40;var RV=($=0)=>Math.max($*yY,0),$80=({x:$,y:Z,z:J,alpha:H})=>{let B=RV($),Q=RV(Z),X=RV(J),z=mY(0.3592832590121217*B+0.6976051147779502*Q-0.0358915932320289*X),G=mY(-0.1920808463704995*B+1.1004767970374323*Q+0.0753748658519118*X),U=mY(0.0070797844607477*B+0.0748396662186366*Q+0.8433265453898765*X),Y=0.5*z+0.5*G,K=1.61376953125*z-3.323486328125*G+1.709716796875*U,F=4.378173828125*z-4.24560546875*G-0.132568359375*U,W={mode:"itp",i:Y,t:K,p:F};if(H!==void 0)W.alpha=H;return W},IV=$80;var Z80={mode:"itp",channels:["i","t","p","alpha"],parse:["--ictcp"],serialize:"--ictcp",toMode:{xyz65:SV,rgb:($)=>n4(SV($))},fromMode:{xyz65:IV,rgb:($)=>IV(o4($))},ranges:{i:[0,0.581],t:[-0.369,0.272],p:[-0.164,0.331]},interpolate:{i:E0,t:E0,p:E0,alpha:{use:E0,fixup:x1}}},ek=Z80;var J80=134.03437499999998,H80=0.000000000016295499532821565,kV=($)=>{if($<0)return 0;let Z=Math.pow($/1e4,xY);return Math.pow((hY+vY*Z)/(1+fY*Z),J80)},yV=($=0)=>Math.max($*203,0),B80=({x:$,y:Z,z:J,alpha:H})=>{$=yV($),Z=yV(Z),J=yV(J);let B=1.15*$-0.15*J,Q=0.66*Z+0.34*$,X=kV(0.41478972*B+0.579999*Q+0.014648*J),z=kV(-0.20151*B+1.120649*Q+0.0531008*J),G=kV(-0.0166008*B+0.2648*Q+0.6684799*J),U=(X+z)/2,Y={mode:"jab",j:0.44*U/(1-0.56*U)-H80,a:3.524*X-4.066708*z+0.542708*G,b:0.199076*X+1.096799*z-1.295875*G};if(H!==void 0)Y.alpha=H;return Y},uY=B80;var Q80=134.03437499999998,$y=0.000000000016295499532821565,xV=($)=>{if($<0)return 0;let Z=Math.pow($,1/Q80);return 1e4*Math.pow((hY-Z)/(fY*Z-vY),1/xY)},hV=($)=>$/203,X80=({j:$,a:Z,b:J,alpha:H})=>{if($===void 0)$=0;if(Z===void 0)Z=0;if(J===void 0)J=0;let B=($+$y)/(0.44+0.56*($+$y)),Q=xV(B+0.13860504*Z+0.058047316*J),X=xV(B-0.13860504*Z-0.058047316*J),z=xV(B-0.096019242*Z-0.8118919*J),G={mode:"xyz65",x:hV(1.661373024652174*Q-0.914523081304348*X+0.23136208173913045*z),y:hV(-0.3250758611844533*Q+1.571847026732543*X-0.21825383453227928*z),z:hV(-0.090982811*Q-0.31272829*X+1.5227666*z)};if(H!==void 0)G.alpha=H;return G},pY=X80;var z80=($)=>{let Z=uY(o4($));if($.r===$.b&&$.b===$.g)Z.a=Z.b=0;return Z},cY=z80;var G80=($)=>n4(pY($)),dY=G80;var U80={mode:"jab",channels:["j","a","b","alpha"],parse:["--jzazbz"],serialize:"--jzazbz",fromMode:{rgb:cY,xyz65:uY},toMode:{rgb:dY,xyz65:pY},ranges:{j:[0,0.222],a:[-0.109,0.129],b:[-0.185,0.134]},interpolate:{j:E0,a:E0,b:E0,alpha:{use:E0,fixup:x1}}},Zy=U80;var Y80=({j:$,a:Z,b:J,alpha:H})=>{if(Z===void 0)Z=0;if(J===void 0)J=0;let B=Math.sqrt(Z*Z+J*J),Q={mode:"jch",j:$,c:B};if(B)Q.h=O5(Math.atan2(J,Z)*180/Math.PI);if(H!==void 0)Q.alpha=H;return Q},vV=Y80;var K80=({j:$,c:Z,h:J,alpha:H})=>{if(J===void 0)J=0;let B={mode:"jab",j:$,a:Z?Z*Math.cos(J/180*Math.PI):0,b:Z?Z*Math.sin(J/180*Math.PI):0};if(H!==void 0)B.alpha=H;return B},fV=K80;var F80={mode:"jch",parse:["--jzczhz"],serialize:"--jzczhz",toMode:{jab:fV,rgb:($)=>dY(fV($))},fromMode:{rgb:($)=>vV(cY($)),jab:vV},channels:["j","c","h","alpha"],ranges:{j:[0,0.221],c:[0,0.19],h:[0,360]},interpolate:{h:{use:E0,fixup:x2},c:E0,j:E0,alpha:{use:E0,fixup:x1}},difference:{h:i6},average:{h:h2}},Jy=F80;var n6=Math.pow(29,3)/Math.pow(3,3),IJ=Math.pow(6,3)/Math.pow(29,3);var gV=($)=>Math.pow($,3)>IJ?Math.pow($,3):(116*$-16)/n6,W80=({l:$,a:Z,b:J,alpha:H})=>{if($===void 0)$=0;if(Z===void 0)Z=0;if(J===void 0)J=0;let B=($+16)/116,Q=Z/500+B,X=B-J/200,z={mode:"xyz50",x:gV(Q)*u5.X,y:gV(B)*u5.Y,z:gV(X)*u5.Z};if(H!==void 0)z.alpha=H;return z},kJ=W80;var q80=({x:$,y:Z,z:J,alpha:H})=>{if($===void 0)$=0;if(Z===void 0)Z=0;if(J===void 0)J=0;let B=x8({r:$*3.1341359569958707-Z*1.6173863321612538-0.4906619460083532*J,g:$*-0.978795502912089+Z*1.916254567259524+0.03344273116131949*J,b:$*0.07195537988411677-Z*0.2289768264158322+1.405386058324125*J});if(H!==void 0)B.alpha=H;return B},o9=q80;var N80=($)=>o9(kJ($)),lY=N80;var A80=($)=>{let{r:Z,g:J,b:H,alpha:B}=y8($),Q={mode:"xyz50",x:0.436065742824811*Z+0.3851514688337912*J+0.14307845442264197*H,y:0.22249319175623702*Z+0.7168870538238823*J+0.06061979053616537*H,z:0.013923904500943465*Z+0.09708128566574634*J+0.7140993584005155*H};if(B!==void 0)Q.alpha=B;return Q},n9=A80;var mV=($)=>$>IJ?Math.cbrt($):(n6*$+16)/116,D80=({x:$,y:Z,z:J,alpha:H})=>{if($===void 0)$=0;if(Z===void 0)Z=0;if(J===void 0)J=0;let B=mV($/u5.X),Q=mV(Z/u5.Y),X=mV(J/u5.Z),z={mode:"lab",l:116*Q-16,a:500*(B-Q),b:200*(Q-X)};if(H!==void 0)z.alpha=H;return z},yJ=D80;var V80=($)=>{let Z=yJ(n9($));if($.r===$.b&&$.b===$.g)Z.a=Z.b=0;return Z},iY=V80;function L80($,Z){if(!Z||Z[0]!=="lab")return;let J={mode:"lab"},[,H,B,Q,X]=Z;if(H.type===j0.Hue||B.type===j0.Hue||Q.type===j0.Hue)return;if(H.type!==j0.None)J.l=Math.min(Math.max(0,H.value),100);if(B.type!==j0.None)J.a=B.type===j0.Number?B.value:B.value*125/100;if(Q.type!==j0.None)J.b=Q.type===j0.Number?Q.value:Q.value*125/100;if(X.type!==j0.None)J.alpha=Math.min(1,Math.max(0,X.type===j0.Number?X.value:X.value/100));return J}var Hy=L80;var M80={mode:"lab",toMode:{xyz50:kJ,rgb:lY},fromMode:{xyz50:yJ,rgb:iY},channels:["l","a","b","alpha"],ranges:{l:[0,100],a:[-125,125],b:[-125,125]},parse:[Hy],serialize:($)=>`lab(${$.l!==void 0?$.l:"none"} ${$.a!==void 0?$.a:"none"} ${$.b!==void 0?$.b:"none"}${$.alpha<1?` / ${$.alpha}`:""})`,interpolate:{l:E0,a:E0,b:E0,alpha:{use:E0,fixup:x1}}},xJ=M80;var P80={...xJ,mode:"lab65",parse:["--lab-d65"],serialize:"--lab-d65",toMode:{xyz65:bY,rgb:a6},fromMode:{xyz65:wY,rgb:o6},ranges:{l:[0,100],a:[-125,125],b:[-125,125]}},By=P80;function _80($,Z){if(!Z||Z[0]!=="lch")return;let J={mode:"lch"},[,H,B,Q,X]=Z;if(H.type!==j0.None){if(H.type===j0.Hue)return;J.l=Math.min(Math.max(0,H.value),100)}if(B.type!==j0.None)J.c=Math.max(0,B.type===j0.Number?B.value:B.value*150/100);if(Q.type!==j0.None){if(Q.type===j0.Percentage)return;J.h=Q.value}if(X.type!==j0.None)J.alpha=Math.min(1,Math.max(0,X.type===j0.Number?X.value:X.value/100));return J}var Qy=_80;var O80={mode:"lch",toMode:{lab:N8,rgb:($)=>lY(N8($))},fromMode:{rgb:($)=>q8(iY($)),lab:q8},channels:["l","c","h","alpha"],ranges:{l:[0,100],c:[0,150],h:[0,360]},parse:[Qy],serialize:($)=>`lch(${$.l!==void 0?$.l:"none"} ${$.c!==void 0?$.c:"none"} ${$.h!==void 0?$.h:"none"}${$.alpha<1?` / ${$.alpha}`:""})`,interpolate:{h:{use:E0,fixup:x2},c:E0,l:E0,alpha:{use:E0,fixup:x1}},difference:{h:i6},average:{h:h2}},hJ=O80;var j80={...hJ,mode:"lch65",parse:["--lch-d65"],serialize:"--lch-d65",toMode:{lab65:($)=>N8($,"lab65"),rgb:($)=>a6(N8($,"lab65"))},fromMode:{rgb:($)=>q8(o6($),"lch65"),lab65:($)=>q8($,"lch65")},ranges:{l:[0,100],c:[0,150],h:[0,360]}},Xy=j80;var T80=({l:$,u:Z,v:J,alpha:H})=>{if(Z===void 0)Z=0;if(J===void 0)J=0;let B=Math.sqrt(Z*Z+J*J),Q={mode:"lchuv",l:$,c:B};if(B)Q.h=O5(Math.atan2(J,Z)*180/Math.PI);if(H!==void 0)Q.alpha=H;return Q},uV=T80;var C80=({l:$,c:Z,h:J,alpha:H})=>{if(J===void 0)J=0;let B={mode:"luv",l:$,u:Z?Z*Math.cos(J/180*Math.PI):0,v:Z?Z*Math.sin(J/180*Math.PI):0};if(H!==void 0)B.alpha=H;return B},pV=C80;var zy=($,Z,J)=>4*$/($+15*Z+3*J),Gy=($,Z,J)=>9*Z/($+15*Z+3*J),E80=zy(u5.X,u5.Y,u5.Z),b80=Gy(u5.X,u5.Y,u5.Z),w80=($)=>$<=IJ?n6*$:116*Math.cbrt($)-16,S80=({x:$,y:Z,z:J,alpha:H})=>{if($===void 0)$=0;if(Z===void 0)Z=0;if(J===void 0)J=0;let B=w80(Z/u5.Y),Q=zy($,Z,J),X=Gy($,Z,J);if(!isFinite(Q)||!isFinite(X))B=Q=X=0;else Q=13*B*(Q-E80),X=13*B*(X-b80);let z={mode:"luv",l:B,u:Q,v:X};if(H!==void 0)z.alpha=H;return z},YQ=S80;var R80=($,Z,J)=>4*$/($+15*Z+3*J),I80=($,Z,J)=>9*Z/($+15*Z+3*J),k80=R80(u5.X,u5.Y,u5.Z),y80=I80(u5.X,u5.Y,u5.Z),x80=({l:$,u:Z,v:J,alpha:H})=>{if($===void 0)$=0;if($===0)return{mode:"xyz50",x:0,y:0,z:0};if(Z===void 0)Z=0;if(J===void 0)J=0;let B=Z/(13*$)+k80,Q=J/(13*$)+y80,X=u5.Y*($<=8?$/n6:Math.pow(($+16)/116,3)),z=X*(9*B)/(4*Q),G=X*(12-3*B-20*Q)/(4*Q),U={mode:"xyz50",x:z,y:X,z:G};if(H!==void 0)U.alpha=H;return U},KQ=x80;var h80=($)=>uV(YQ(n9($))),v80=($)=>o9(KQ(pV($))),f80={mode:"lchuv",toMode:{luv:pV,rgb:v80},fromMode:{rgb:h80,luv:uV},channels:["l","c","h","alpha"],parse:["--lchuv"],serialize:"--lchuv",ranges:{l:[0,100],c:[0,176.956],h:[0,360]},interpolate:{h:{use:E0,fixup:x2},c:E0,l:E0,alpha:{use:E0,fixup:x1}},difference:{h:i6},average:{h:h2}},Uy=f80;var g80={...k8,mode:"lrgb",toMode:{rgb:x8},fromMode:{rgb:y8},parse:["srgb-linear"],serialize:"srgb-linear"},Yy=g80;var m80={mode:"luv",toMode:{xyz50:KQ,rgb:($)=>o9(KQ($))},fromMode:{xyz50:YQ,rgb:($)=>YQ(n9($))},channels:["l","u","v","alpha"],parse:["--luv"],serialize:"--luv",ranges:{l:[0,100],u:[-84.936,175.042],v:[-125.882,87.243]},interpolate:{l:E0,u:E0,v:E0,alpha:{use:E0,fixup:x1}}},Ky=m80;var u80=({r:$,g:Z,b:J,alpha:H})=>{if($===void 0)$=0;if(Z===void 0)Z=0;if(J===void 0)J=0;let B=Math.cbrt(0.412221469470763*$+0.5363325372617348*Z+0.0514459932675022*J),Q=Math.cbrt(0.2119034958178252*$+0.6806995506452344*Z+0.1073969535369406*J),X=Math.cbrt(0.0883024591900564*$+0.2817188391361215*Z+0.6299787016738222*J),z={mode:"oklab",l:0.210454268309314*B+0.7936177747023054*Q-0.0040720430116193*X,a:1.9779985324311684*B-2.42859224204858*Q+0.450593709617411*X,b:0.0259040424655478*B+0.7827717124575296*Q-0.8086757549230774*X};if(H!==void 0)z.alpha=H;return z},rY=u80;var p80=($)=>{let Z=rY(y8($));if($.r===$.b&&$.b===$.g)Z.a=Z.b=0;return Z},s6=p80;var c80=({l:$,a:Z,b:J,alpha:H})=>{if($===void 0)$=0;if(Z===void 0)Z=0;if(J===void 0)J=0;let B=Math.pow($+0.3963377773761749*Z+0.2158037573099136*J,3),Q=Math.pow($-0.1055613458156586*Z-0.0638541728258133*J,3),X=Math.pow($-0.0894841775298119*Z-1.2914855480194092*J,3),z={mode:"lrgb",r:4.076741636075957*B-3.3077115392580616*Q+0.2309699031821044*X,g:-1.2684379732850317*B+2.6097573492876887*Q-0.3413193760026573*X,b:-0.0041960761386756*B-0.7034186179359362*Q+1.7076146940746117*X};if(H!==void 0)z.alpha=H;return z},s9=c80;var d80=($)=>x8(s9($)),t6=d80;function FQ($){return 0.5*(1.170873786407767*$-0.206+Math.sqrt((1.170873786407767*$-0.206)*(1.170873786407767*$-0.206)+0.14050485436893204*$))}function w$($){return($*$+0.206*$)/(1.170873786407767*($+0.03))}function l80($,Z){let J,H,B,Q,X,z,G,U;if(-1.88170328*$-0.80936493*Z>1)J=1.19086277,H=1.76576728,B=0.59662641,Q=0.75515197,X=0.56771245,z=4.0767416621,G=-3.3077115913,U=0.2309699292;else if(1.81444104*$-1.19445276*Z>1)J=0.73956515,H=-0.45954404,B=0.08285427,Q=0.1254107,X=0.14503204,z=-1.2684380046,G=2.6097574011,U=-0.3413193965;else J=1.35733652,H=-0.00915799,B=-1.1513021,Q=-0.50559606,X=0.00692167,z=-0.0041960863,G=-0.7034186147,U=1.707614701;let Y=J+H*$+B*Z+Q*$*$+X*$*Z,K=0.3963377774*$+0.2158037573*Z,F=-0.1055613458*$-0.0638541728*Z,W=-0.0894841775*$-1.291485548*Z;{let q=1+Y*K,N=1+Y*F,D=1+Y*W,A=q*q*q,V=N*N*N,L=D*D*D,O=3*K*q*q,M=3*F*N*N,_=3*W*D*D,w=6*K*K*q,C=6*F*F*N,E=6*W*W*D,j=z*A+G*V+U*L,k=z*O+G*M+U*_,S=z*w+G*C+U*E;Y=Y-j*k/(k*k-0.5*j*S)}return Y}function cV($,Z){let J=l80($,Z),H=s9({l:1,a:J*$,b:J*Z}),B=Math.cbrt(1/Math.max(H.r,H.g,H.b)),Q=B*J;return[B,Q]}function i80($,Z,J,H,B,Q=null){if(!Q)Q=cV($,Z);let X;if((J-B)*Q[1]-(Q[0]-B)*H<=0)X=Q[1]*B/(H*Q[0]+Q[1]*(B-J));else{X=Q[1]*(B-1)/(H*(Q[0]-1)+Q[1]*(B-J));{let z=J-B,G=H,U=0.3963377774*$+0.2158037573*Z,Y=-0.1055613458*$-0.0638541728*Z,K=-0.0894841775*$-1.291485548*Z,F=z+G*U,W=z+G*Y,q=z+G*K;{let N=B*(1-X)+X*J,D=X*H,A=N+D*U,V=N+D*Y,L=N+D*K,O=A*A*A,M=V*V*V,_=L*L*L,w=3*F*A*A,C=3*W*V*V,E=3*q*L*L,j=6*F*F*A,k=6*W*W*V,S=6*q*q*L,I=4.0767416621*O-3.3077115913*M+0.2309699292*_-1,T=4.0767416621*w-3.3077115913*C+0.2309699292*E,y=4.0767416621*j-3.3077115913*k+0.2309699292*S,R=T/(T*T-0.5*I*y),x=-I*R,v=-1.2684380046*O+2.6097574011*M-0.3413193965*_-1,f=-1.2684380046*w+2.6097574011*C-0.3413193965*E,b=-1.2684380046*j+2.6097574011*k-0.3413193965*S,l=f/(f*f-0.5*v*b),r=-v*l,h=-0.0041960863*O-0.7034186147*M+1.707614701*_-1,d=-0.0041960863*w-0.7034186147*C+1.707614701*E,o=-0.0041960863*j-0.7034186147*k+1.707614701*S,p=d/(d*d-0.5*h*o),i=-h*p;x=R>=0?x:1e6,r=l>=0?r:1e6,i=p>=0?i:1e6,X+=Math.min(x,Math.min(r,i))}}}return X}function WQ($,Z,J=null){if(!J)J=cV($,Z);let H=J[0],B=J[1];return[B/H,B/(1-H)]}function aY($,Z,J){let H=cV(Z,J),B=i80(Z,J,$,1,$,H),Q=WQ(Z,J,H),X=0.11516993+1/(7.4477897+4.1590124*J+Z*(-2.19557347+1.75198401*J+Z*(-2.13704948-10.02301043*J+Z*(-4.24894561+5.38770819*J+4.69891013*Z)))),z=0.11239642+1/(1.6132032-0.68124379*J+Z*(0.40370612+0.90148123*J+Z*(-0.27087943+0.6122399*J+Z*(0.00299215-0.45399568*J-0.14661872*Z)))),G=B/Math.min($*Q[0],(1-$)*Q[1]),U=$*X,Y=(1-$)*z,K=0.9*G*Math.sqrt(Math.sqrt(1/(1/(U*U*U*U)+1/(Y*Y*Y*Y))));return U=$*0.4,Y=(1-$)*0.8,[Math.sqrt(1/(1/(U*U)+1/(Y*Y))),K,B]}function oY($){let Z=$.l!==void 0?$.l:0,J=$.a!==void 0?$.a:0,H=$.b!==void 0?$.b:0,B={mode:"okhsl",l:FQ(Z)};if($.alpha!==void 0)B.alpha=$.alpha;let Q=Math.sqrt(J*J+H*H);if(!Q)return B.s=0,B;let[X,z,G]=aY(Z,J/Q,H/Q),U;if(Q<z){let Y=0,K=0.8*X,F=1-K/z;U=(Q-Y)/(K+F*(Q-Y))*0.8}else{let Y=z,K=0.2*z*z*1.25*1.25/X,F=1-K/(G-z);U=0.8+0.2*((Q-Y)/(K+F*(Q-Y)))}if(U)B.s=U,B.h=O5(Math.atan2(H,J)*180/Math.PI);return B}function nY($){let Z=$.h!==void 0?$.h:0,J=$.s!==void 0?$.s:0,H=$.l!==void 0?$.l:0,B={mode:"oklab",l:w$(H)};if($.alpha!==void 0)B.alpha=$.alpha;if(!J||H===1)return B.a=B.b=0,B;let Q=Math.cos(Z/180*Math.PI),X=Math.sin(Z/180*Math.PI),[z,G,U]=aY(B.l,Q,X),Y,K,F,W;if(J<0.8)Y=1.25*J,K=0,F=0.8*z,W=1-F/G;else Y=5*(J-0.8),K=G,F=0.2*G*G*1.25*1.25/z,W=1-F/(U-G);let q=K+Y*F/(1-W*Y);return B.a=q*Q,B.b=q*X,B}var r80={...IY,mode:"okhsl",channels:["h","s","l","alpha"],parse:["--okhsl"],serialize:"--okhsl",fromMode:{oklab:oY,rgb:($)=>oY(s6($))},toMode:{oklab:nY,rgb:($)=>t6(nY($))}},Fy=r80;function sY($){let Z=$.l!==void 0?$.l:0,J=$.a!==void 0?$.a:0,H=$.b!==void 0?$.b:0,B=Math.sqrt(J*J+H*H),Q=B?J/B:1,X=B?H/B:1,[z,G]=WQ(Q,X),U=0.5,Y=1-U/z,K=G/(B+Z*G),F=K*Z,W=K*B,q=w$(F),N=W*q/F,D=s9({l:q,a:Q*N,b:X*N}),A=Math.cbrt(1/Math.max(D.r,D.g,D.b,0));Z=Z/A,B=B/A*FQ(Z)/Z,Z=FQ(Z);let V={mode:"okhsv",s:B?(U+G)*W/(G*U+G*Y*W):0,v:Z?Z/F:0};if(V.s)V.h=O5(Math.atan2(H,J)*180/Math.PI);if($.alpha!==void 0)V.alpha=$.alpha;return V}function tY($){let Z={mode:"oklab"};if($.alpha!==void 0)Z.alpha=$.alpha;let J=$.h!==void 0?$.h:0,H=$.s!==void 0?$.s:0,B=$.v!==void 0?$.v:0,Q=Math.cos(J/180*Math.PI),X=Math.sin(J/180*Math.PI),[z,G]=WQ(Q,X),U=0.5,Y=1-U/z,K=1-H*U/(U+G-G*Y*H),F=H*G*U/(U+G-G*Y*H),W=w$(K),q=F*W/K,N=s9({l:W,a:Q*q,b:X*q}),D=Math.cbrt(1/Math.max(N.r,N.g,N.b,0)),A=w$(B*K),V=F*A/K;return Z.l=A*D,Z.a=V*Q*D,Z.b=V*X*D,Z}var a80={...kY,mode:"okhsv",channels:["h","s","v","alpha"],parse:["--okhsv"],serialize:"--okhsv",fromMode:{oklab:sY,rgb:($)=>sY(s6($))},toMode:{oklab:tY,rgb:($)=>t6(tY($))}},Wy=a80;function o80($,Z){if(!Z||Z[0]!=="oklab")return;let J={mode:"oklab"},[,H,B,Q,X]=Z;if(H.type===j0.Hue||B.type===j0.Hue||Q.type===j0.Hue)return;if(H.type!==j0.None)J.l=Math.min(Math.max(0,H.type===j0.Number?H.value:H.value/100),1);if(B.type!==j0.None)J.a=B.type===j0.Number?B.value:B.value*0.4/100;if(Q.type!==j0.None)J.b=Q.type===j0.Number?Q.value:Q.value*0.4/100;if(X.type!==j0.None)J.alpha=Math.min(1,Math.max(0,X.type===j0.Number?X.value:X.value/100));return J}var qy=o80;var n80={...xJ,mode:"oklab",toMode:{lrgb:s9,rgb:t6},fromMode:{lrgb:rY,rgb:s6},ranges:{l:[0,1],a:[-0.4,0.4],b:[-0.4,0.4]},parse:[qy],serialize:($)=>`oklab(${$.l!==void 0?$.l:"none"} ${$.a!==void 0?$.a:"none"} ${$.b!==void 0?$.b:"none"}${$.alpha<1?` / ${$.alpha}`:""})`},Ny=n80;function s80($,Z){if(!Z||Z[0]!=="oklch")return;let J={mode:"oklch"},[,H,B,Q,X]=Z;if(H.type!==j0.None){if(H.type===j0.Hue)return;J.l=Math.min(Math.max(0,H.type===j0.Number?H.value:H.value/100),1)}if(B.type!==j0.None)J.c=Math.max(0,B.type===j0.Number?B.value:B.value*0.4/100);if(Q.type!==j0.None){if(Q.type===j0.Percentage)return;J.h=Q.value}if(X.type!==j0.None)J.alpha=Math.min(1,Math.max(0,X.type===j0.Number?X.value:X.value/100));return J}var Ay=s80;var t80={...hJ,mode:"oklch",toMode:{oklab:($)=>N8($,"oklab"),rgb:($)=>t6(N8($,"oklab"))},fromMode:{rgb:($)=>q8(s6($),"oklch"),oklab:($)=>q8($,"oklch")},parse:[Ay],serialize:($)=>`oklch(${$.l!==void 0?$.l:"none"} ${$.c!==void 0?$.c:"none"} ${$.h!==void 0?$.h:"none"}${$.alpha<1?` / ${$.alpha}`:""})`,ranges:{l:[0,1],c:[0,0.4],h:[0,360]}},Dy=t80;var e80=($)=>{let{r:Z,g:J,b:H,alpha:B}=y8($),Q={mode:"xyz65",x:0.486570948648216*Z+0.265667693169093*J+0.1982172852343625*H,y:0.2289745640697487*Z+0.6917385218365062*J+0.079286914093745*H,z:0*Z+0.0451133818589026*J+1.043944368900976*H};if(B!==void 0)Q.alpha=B;return Q},dV=e80;var $90=({x:$,y:Z,z:J,alpha:H})=>{if($===void 0)$=0;if(Z===void 0)Z=0;if(J===void 0)J=0;let B=x8({r:$*2.4934969119414263-Z*0.9313836179191242-0.402710784450717*J,g:$*-0.8294889695615749+Z*1.7626640603183465+0.0236246858419436*J,b:$*0.0358458302437845-Z*0.0761723892680418+0.9568845240076871*J},"p3");if(H!==void 0)B.alpha=H;return B},lV=$90;var Z90={...k8,mode:"p3",parse:["display-p3"],serialize:"display-p3",fromMode:{rgb:($)=>lV(o4($)),xyz65:lV},toMode:{rgb:($)=>n4(dV($)),xyz65:dV}},Vy=Z90;var iV=($)=>{let Z=Math.abs($);if(Z>=0.001953125)return Math.sign($)*Math.pow(Z,0.5555555555555556);return 16*$},J90=({x:$,y:Z,z:J,alpha:H})=>{if($===void 0)$=0;if(Z===void 0)Z=0;if(J===void 0)J=0;let B={mode:"prophoto",r:iV($*1.3457868816471585-Z*0.2555720873797946-0.0511018649755453*J),g:iV($*-0.5446307051249019+Z*1.5082477428451466+0.0205274474364214*J),b:iV($*0+Z*0+1.2119675456389452*J)};if(H!==void 0)B.alpha=H;return B},rV=J90;var aV=($=0)=>{let Z=Math.abs($);if(Z>=0.03125)return Math.sign($)*Math.pow(Z,1.8);return $/16},H90=($)=>{let Z=aV($.r),J=aV($.g),H=aV($.b),B={mode:"xyz50",x:0.7977666449006423*Z+0.1351812974005331*J+0.0313477341283922*H,y:0.2880748288194013*Z+0.7118352342418731*J+0.0000899369387256*H,z:0*Z+0*J+0.8251046025104602*H};if($.alpha!==void 0)B.alpha=$.alpha;return B},oV=H90;var B90={...k8,mode:"prophoto",parse:["prophoto-rgb"],serialize:"prophoto-rgb",fromMode:{xyz50:rV,rgb:($)=>rV(n9($))},toMode:{xyz50:oV,rgb:($)=>o9(oV($))}},Ly=B90;var nV=($)=>{let Z=Math.abs($);if(Z>0.018053968510807)return(Math.sign($)||1)*(1.09929682680944*Math.pow(Z,0.45)-0.09929682680944008);return 4.5*$},Q90=({x:$,y:Z,z:J,alpha:H})=>{if($===void 0)$=0;if(Z===void 0)Z=0;if(J===void 0)J=0;let B={mode:"rec2020",r:nV($*1.7166511879712683-Z*0.3556707837763925-0.2533662813736599*J),g:nV($*-0.6666843518324893+Z*1.6164812366349395+0.0157685458139111*J),b:nV($*0.0176398574453108-Z*0.0427706132578085+0.9421031212354739*J)};if(H!==void 0)B.alpha=H;return B},sV=Q90;var tV=($=0)=>{let Z=Math.abs($);if(Z<0.08124285829863151)return $/4.5;return(Math.sign($)||1)*Math.pow((Z+1.09929682680944-1)/1.09929682680944,2.2222222222222223)},X90=($)=>{let Z=tV($.r),J=tV($.g),H=tV($.b),B={mode:"xyz65",x:0.6369580483012911*Z+0.1446169035862083*J+0.1688809751641721*H,y:0.262700212011267*Z+0.6779980715188708*J+0.059301716469862*H,z:0*Z+0.0280726930490874*J+1.0609850577107909*H};if($.alpha!==void 0)B.alpha=$.alpha;return B},eV=X90;var z90={...k8,mode:"rec2020",fromMode:{xyz65:sV,rgb:($)=>sV(o4($))},toMode:{xyz65:eV,rgb:($)=>n4(eV($))},parse:["rec2020"],serialize:"rec2020"},My=z90;var e6=0.0037930732552754493,eY=Math.cbrt(0.0037930732552754493);var $L=($)=>Math.cbrt($)-eY,G90=($)=>{let{r:Z,g:J,b:H,alpha:B}=y8($),Q=$L(0.3*Z+0.622*J+0.078*H+e6),X=$L(0.23*Z+0.692*J+0.078*H+e6),z=$L(0.2434226892454782*Z+0.2047674442449682*J+0.5518098665095535*H+e6),G={mode:"xyb",x:(Q-X)/2,y:(Q+X)/2,b:z-(Q+X)/2};if(B!==void 0)G.alpha=B;return G},Py=G90;var ZL=($)=>Math.pow($+eY,3),U90=({x:$,y:Z,b:J,alpha:H})=>{if($===void 0)$=0;if(Z===void 0)Z=0;if(J===void 0)J=0;let B=ZL($+Z)-e6,Q=ZL(Z-$)-e6,X=ZL(J+Z)-e6,z=x8({r:11.031566904639861*B-9.866943908131562*Q-0.16462299650829934*X,g:-3.2541473810744237*B+4.418770377582723*Q-0.16462299650829934*X,b:-3.6588512867136815*B+2.7129230459360922*Q+1.9459282407775895*X});if(H!==void 0)z.alpha=H;return z},_y=U90;var Y90={mode:"xyb",channels:["x","y","b","alpha"],parse:["--xyb"],serialize:"--xyb",toMode:{rgb:_y},fromMode:{rgb:Py},ranges:{x:[-0.0154,0.0281],y:[0,0.8453],b:[-0.2778,0.388]},interpolate:{x:E0,y:E0,b:E0,alpha:{use:E0,fixup:x1}}},Oy=Y90;var K90={mode:"xyz50",parse:["xyz-d50"],serialize:"xyz-d50",toMode:{rgb:o9,lab:yJ},fromMode:{rgb:n9,lab:kJ},channels:["x","y","z","alpha"],ranges:{x:[0,0.964],y:[0,0.999],z:[0,0.825]},interpolate:{x:E0,y:E0,z:E0,alpha:{use:E0,fixup:x1}}},jy=K90;var F90=($)=>{let{x:Z,y:J,z:H,alpha:B}=$;if(Z===void 0)Z=0;if(J===void 0)J=0;if(H===void 0)H=0;let Q={mode:"xyz50",x:1.0479298208405488*Z+0.0229467933410191*J-0.0501922295431356*H,y:0.0296278156881593*Z+0.990434484573249*J-0.0170738250293851*H,z:-0.0092430581525912*Z+0.0150551448965779*J+0.7518742899580008*H};if(B!==void 0)Q.alpha=B;return Q},Ty=F90;var W90=($)=>{let{x:Z,y:J,z:H,alpha:B}=$;if(Z===void 0)Z=0;if(J===void 0)J=0;if(H===void 0)H=0;let Q={mode:"xyz65",x:0.9554734527042182*Z-0.0230985368742614*J+0.0632593086610217*H,y:-0.0283697069632081*Z+1.0099954580058226*J+0.021041398966943*H,z:0.0123140016883199*Z-0.0205076964334779*J+1.3303659366080753*H};if(B!==void 0)Q.alpha=B;return Q},Cy=W90;var q90={mode:"xyz65",toMode:{rgb:n4,xyz50:Ty},fromMode:{rgb:o4,xyz50:Cy},ranges:{x:[0,0.95],y:[0,1],z:[0,1.088]},channels:["x","y","z","alpha"],parse:["xyz","xyz-d65"],serialize:"xyz-d65",interpolate:{x:E0,y:E0,z:E0,alpha:{use:E0,fixup:x1}}},Ey=q90;var N90=({r:$,g:Z,b:J,alpha:H})=>{if($===void 0)$=0;if(Z===void 0)Z=0;if(J===void 0)J=0;let B={mode:"yiq",y:0.29889531*$+0.58662247*Z+0.11448223*J,i:0.59597799*$-0.2741761*Z-0.32180189*J,q:0.21147017*$-0.52261711*Z+0.31114694*J};if(H!==void 0)B.alpha=H;return B},by=N90;var A90=({y:$,i:Z,q:J,alpha:H})=>{if($===void 0)$=0;if(Z===void 0)Z=0;if(J===void 0)J=0;let B={mode:"rgb",r:$+0.95608445*Z+0.6208885*J,g:$-0.27137664*Z-0.6486059*J,b:$-1.10561724*Z+1.70250126*J};if(H!==void 0)B.alpha=H;return B},wy=A90;var D90={mode:"yiq",toMode:{rgb:wy},fromMode:{rgb:by},channels:["y","i","q","alpha"],parse:["--yiq"],serialize:"--yiq",ranges:{i:[-0.595,0.595],q:[-0.522,0.522]},interpolate:{y:E0,i:E0,q:E0,alpha:{use:E0,fixup:x1}}},Sy=D90;function JL($){let Z=_Y("lrgb")($);return 0.2126*Z.r+0.7152*Z.g+0.0722*Z.b}var Lo0=U5(kk),Mo0=U5(pk),Po0=U5(lk),_o0=U5(ik),Oo0=U5(rk),jo0=U5(IY),To0=U5(kY),Co0=U5(tk),Eo0=U5(ek),bo0=U5(Zy),wo0=U5(Jy),So0=U5(xJ),Ro0=U5(By),Io0=U5(hJ),ko0=U5(Xy),yo0=U5(Uy),xo0=U5(Yy),ho0=U5(Ky),vo0=U5(Fy),fo0=U5(Wy),go0=U5(Ny),mo0=U5(Dy),uo0=U5(Vy),po0=U5(Ly),co0=U5(My),do0=U5(k8),lo0=U5(Oy),io0=U5(jy),ro0=U5(Ey),ao0=U5(Sy);var $7={sans:{label:"Sans",sans:"system-ui",mono:"Geist Mono",googleFontsQuery:"Geist+Mono:wght@400;500"},serif:{label:"Serif",sans:"Literata",mono:"Geist Mono",googleFontsQuery:"Literata:wght@400;600;700&family=Geist+Mono:wght@400;500"},mono:{label:"Mono",sans:"Geist Mono",mono:"Geist Mono",googleFontsQuery:"Geist+Mono:wght@400;500;600"},geometric:{label:"Geometric",sans:"Manrope",mono:"Geist Mono",googleFontsQuery:"Manrope:wght@400;500;600&family=Geist+Mono:wght@400;500"},rounded:{label:"Rounded",sans:"SN Pro",mono:"Geist Mono",googleFontsQuery:"SN+Pro:wght@400;500;600&family=Geist+Mono:wght@400;500"},blobby:{label:"Blobby",sans:"Sour Gummy",mono:"Azeret Mono",googleFontsQuery:"Sour+Gummy:wght@400;500;600&family=Azeret+Mono:wght@400;500"},awkward:{label:"Awkward",sans:"Averia Sans Libre",mono:"Azeret Mono",googleFontsQuery:"Averia+Sans+Libre:wght@400;500;600&family=Azeret+Mono:wght@400;500"},comic:{label:"Comic",sans:"Comic Sans MS, Comic Sans, cursive",mono:"Geist Mono",googleFontsQuery:"Geist+Mono:wght@400;500"}},qQ={squishy:{label:"Squishy",radius:"0.875rem"},soft:{label:"Soft",radius:"0.625rem"},subtle:{label:"Subtle",radius:"0.375rem"},square:{label:"Square",radius:"0"}},NQ={blob:{label:"Blob",traits:{shape:0.11,"body.r":0.5,"body.ratio":0,"body.n":0.5}},boxy:{label:"Boxy",traits:{shape:0.54,"body.r":1,"body.ratio":0}},pill:{label:"Pill",traits:{shape:0.65,"body.r":1}},dorito:{label:"Dorito",traits:{shape:0.99,"body.r":1,"body.ratio":0,"body.rot":0}}},HL="oklch(0.205 0 0)";function Ry($){return JL($)>0.3?"oklch(0 0 0)":"oklch(1 0 0)"}var Iy={workspace:{primary:($)=>$,primaryForeground:($)=>Ry($),background:()=>"color-mix(in srgb, var(--primary) 2%, oklch(1 0 0) 98%)",foreground:()=>"color-mix(in srgb, var(--primary) 20%, oklch(0 0 0) 80%)",muted:()=>"color-mix(in srgb, var(--background) 95%, var(--foreground) 5%)",mutedForeground:()=>"color-mix(in srgb, var(--background) 50%, var(--foreground) 50%)",accent:()=>"color-mix(in srgb, var(--primary) 3%, var(--foreground) 4%)",accentForeground:()=>"var(--foreground)",border:()=>"color-mix(in srgb, var(--foreground) 7%, transparent)",ring:()=>"color-mix(in srgb, var(--background) 50%, var(--primary) 50%)"},widget:{background:($)=>$,foreground:($)=>Ry($),primary:()=>"color-mix(in srgb, var(--background) 2%, oklch(1 0 0) 98%)",primaryForeground:()=>"color-mix(in srgb, var(--background) 20%, oklch(0 0 0) 80%)",muted:()=>"color-mix(in srgb, var(--background) 95%, var(--foreground) 5%)",mutedForeground:()=>"color-mix(in srgb, var(--background) 50%, var(--foreground) 50%)",accent:()=>"color-mix(in srgb, var(--primary) 3%, var(--foreground) 4%)",accentForeground:()=>"var(--foreground)",border:()=>"color-mix(in srgb, var(--foreground) 15%, transparent)",ring:()=>"color-mix(in srgb, var(--background) 50%, var(--primary) 50%)"}},BL=Object.keys(Iy.workspace);function QL($,Z="workspace"){let J={},H=Iy[Z];for(let B of BL)J[B]=H[B]($);return J}var ZK={default:{label:"Default"},paper:{label:"Paper",primary:"oklch(0.4328 0.0351 66.67)"},rose:{label:"Rose",primary:"oklch(0.6322 0.2171 26.02)"},tangerine:{label:"Tangerine",primary:"oklch(0.6886 0.22 37.15)"},sand:{label:"Sand",primary:"oklch(0.8334 0.1271 67.80)"},mint:{label:"Tropics",primary:"oklch(0.5774 0.1399 156.06)"},sky:{label:"Sky",primary:"oklch(0.5824 0.1830 253.59)"},lavender:{label:"Lavender",primary:"oklch(0.6025 0.2426 294.58)"}},t9={font:"sans",color:"default",radius:"soft",agent:"boxy"};function $K($,Z,J){return typeof $==="string"&&Object.hasOwn(Z,$)?$:J}function U9($){return{font:$K($?.font,$7,t9.font),color:$K($?.color,ZK,t9.color),radius:$K($?.radius,qQ,t9.radius),agent:$K($?.agent,NQ,t9.agent)}}function JK($,Z="workspace"){let J=U9($),B=ZK[J.color].primary??(Z==="widget"?HL:void 0);return B?QL(B,Z):void 0}var AQ=P(c(),1),e9={"claude-code":KY,openclaw:WI,codex:FY,hermes:FI};function V90($,Z,J){switch($?.type){case"emoji":return AQ.jsx("span",{"aria-hidden":"true",className:Q0("flex size-full translate-y-[2cqi] items-center justify-center font-[Apple_Color_Emoji,Segoe_UI_Emoji,Noto_Color_Emoji,sans-serif] leading-none",Z?"text-[60cqi]":"text-[85cqi]"),children:$.value});case"upload":return AQ.jsx("img",{src:$.value,alt:"",className:"size-full"});case"glyph":{let H=LY($.value);if(H)return ky.createElement(H,{"aria-hidden":!0,stroke:1.75,className:Z?"size-[70%]":"size-[95%] text-foreground"})}default:return AQ.jsx("img",{src:J,alt:"",className:"size-[95%]"})}}function Z7({className:$,icon:Z,workspaceType:J,workspaceTheme:H}){let B=Z?.type!=="upload"&&Z?.background==="theme",Q=B?JK(H)??QL(HL):void 0,X=e9[J??"claude-code"];return AQ.jsx("span",{className:Q0("@container inline-flex shrink-0 items-center justify-center overflow-hidden",B&&"shadow-[inset_0_0_1rem_rgba(255,255,255,0.3)]",$),style:Q?{backgroundColor:Q.primary,color:Q.primaryForeground}:void 0,children:V90(Z,B,X)})}var yy=P(m(),1);var xy=P(c(),1);function HK({className:$,onBlur:Z,onFocus:J,onKeyDown:H,onValueChange:B,onValueCommit:Q,selectOnFocus:X,...z}){let G=yy.useRef(null);function U(F){let W=G.current!==null;if(G.current=null,Z?.(F),!F.defaultPrevented&&W)Q?.(F.currentTarget.value)}function Y(F){if(G.current=F.currentTarget.value,X){let W=F.currentTarget;W.select(),requestAnimationFrame(()=>{W.scrollLeft=0})}J?.(F)}function K(F){if(H?.(F),F.defaultPrevented)return;if(F.key==="Enter")F.preventDefault(),F.currentTarget.blur();else if(F.key==="Escape"){F.preventDefault();let W=G.current??F.currentTarget.value;G.current=null,F.currentTarget.value=W,B?.(W),F.currentTarget.blur()}}return xy.jsx($Q,{"data-slot":"inline-input",className:Q0("-ml-2 [field-sizing:content] w-auto max-w-full min-w-0 rounded-md bg-transparent px-2 py-0.5 text-sm shadow-none outline-none focus:[field-sizing:fixed] focus:w-full focus-visible:border-ring focus-visible:bg-accent disabled:pointer-events-none",$),onBlur:U,onChange:(F)=>B?.(F.target.value),onFocus:Y,onKeyDown:K,...z})}var DQ=P(c(),1);function BK({name:$="Workspace",onNameChange:Z,onNameCommit:J,renderIcon:H,...B}){let Q=DQ.jsx(Z7,{...B,className:"size-10 rounded-lg"});return DQ.jsxs("div",{className:"flex max-w-full min-w-0 flex-1 items-center gap-4",children:[H?H(Q):Q,DQ.jsx(HK,{"aria-label":"Workspace name",value:$,onValueChange:Z,onValueCommit:J,readOnly:!Z,tabIndex:Z?void 0:-1,className:Q0("min-w-0 truncate text-3xl font-semibold md:text-3xl",!Z&&"pointer-events-none")})]})}var vJ=P(c(),1),hy=["Welcome to","This is","Make yourself at home in","A fresh start in","Good to see you in"],QK;function vy($){QK=$}function fy($){let[Z,J]=J7.useState(()=>QK===$);return J7.useEffect(()=>{if(QK===$)QK=void 0;if(!Z)return;let H=setTimeout(()=>J(!1),3000);return()=>clearTimeout(H)},[$,Z]),Z}function gy({name:$="Workspace",icon:Z,...J}){let[H]=J7.useState(()=>hy[Math.floor(Math.random()*hy.length)]),[B]=J7.useState(()=>{let z=[...ZQ];return Array.from({length:4},()=>z.splice(Math.floor(Math.random()*z.length),1)[0])}),[Q,X]=J7.useState(()=>typeof window<"u"&&window.matchMedia?.("(prefers-reduced-motion: reduce)").matches?4:0);return J7.useEffect(()=>{if(window.matchMedia?.("(prefers-reduced-motion: reduce)").matches)return;let z=[500,1000,1500,2000].map((G,U)=>setTimeout(()=>X(U+1),G));return()=>z.forEach(clearTimeout)},[]),vJ.jsx("div",{"aria-label":"Workspace welcome",className:"flex flex-1 items-center justify-center p-6 text-center",children:vJ.jsxs("div",{className:"flex min-w-0 flex-col items-center gap-1",children:[vJ.jsx("p",{className:"text-sm text-muted-foreground",children:H}),vJ.jsx(BK,{...J,name:$,icon:Q<4?{type:"glyph",value:B[Q]}:Z})]})})}var iy=P(m(),1);var my=P(c(),1);function S$({className:$,...Z}){return my.jsx("div",{"data-slot":"skeleton",className:i0("animate-pulse rounded-lg bg-accent",$),...Z})}var XL=P(c(),1),R$={"claude-code":"Claude",openclaw:"OpenClaw",codex:"ChatGPT",hermes:"Hermes"},uy={"claude-code":"Anthropic",codex:"OpenAI",openclaw:"Open-source",hermes:"Nous Research"};function py({types:$}){let Z=$.map((J)=>R$[J]).join(", ");return XL.jsx("span",{role:"img","aria-label":Z,className:"inline-flex shrink-0 items-center -space-x-0.5",children:$.map((J)=>XL.jsx("img",{src:e9[J],alt:"",className:"size-4 shrink-0 rounded-full bg-muted ring-2 ring-muted"},J))})}function I$($){if("types"in $)return $.path.split("/").pop()||$.path;if($.name)return $.name;if($.type==="openclaw")return $.agentId??"OpenClaw agent";if($.type==="hermes")return $.agentId??"Hermes agent";return $.path.split("/").pop()||$.path}var cy={"claude-code":{reason:"Run in terminal to install Claude:",command:"curl -fsSL https://claude.ai/install.sh | sh"},codex:{reason:"Run in terminal to install ChatGPT:",command:"curl -fsSL https://chatgpt.com/codex/install.sh | sh"},openclaw:{reason:"Run in terminal to connect OpenClaw:",command:"moi openclaw init"},hermes:{reason:"Run in terminal to connect Hermes:",command:"moi hermes init"}};var dy={"claude-code":{importOnly:!1},codex:{importOnly:!1},openclaw:{importOnly:!0},hermes:{importOnly:!0}};function XK($,Z=[]){if(!$)return[];return CJ.filter((J)=>$[J]||!dy[J].importOnly).map((J)=>{let H=dy[J],B=cy[J],Q=!$[J]||H.importOnly&&!Z.includes(J);return{type:J,description:uy[J],disabled:Q,disabledReason:Q?B.reason:void 0,disabledCommand:Q?B.command:void 0}})}function ly($,Z){let J=$.find((H)=>H.type===Z);if(J&&!J.disabled)return J.type;return $.find((H)=>!H.disabled)?.type}var o1=P(c(),1),L90="Choose which agent Moi will use to build your workspace";function GK({title:$,selectedType:Z,options:J,isLoading:H=!1,isPending:B,errorMessage:Q,emptyMessage:X,secondaryAction:z,primaryLabel:G,pendingLabel:U,onTypeChange:Y,onSubmit:K}){let F=T1((D)=>D.hasSentMessageFromMoi),W=ly(J,Z),q=W!==Z,N=W==="claude-code"?"Tip: you can use your existing Claude subscription in Moi":W==="codex"?"Tip: you can use your existing ChatGPT subscription in Moi":void 0;return iy.useEffect(()=>{if(!B&&W&&q)Y(W)},[B,Y,W,q]),o1.jsxs("div",{className:"flex min-w-[min(22rem,calc(100vw-5rem))] flex-col gap-5",children:[o1.jsxs("div",{className:"flex w-0 min-w-full flex-col gap-0.5 pr-8",children:[o1.jsx(g6,{children:$}),o1.jsx(jJ,{children:L90})]}),o1.jsxs("div",{className:"flex flex-col gap-4",children:[H?o1.jsxs("div",{className:"flex flex-wrap justify-center gap-2",role:"status","aria-label":"Checking installed agents",children:[o1.jsx(S$,{className:"h-32 min-w-32 flex-1"}),o1.jsx(S$,{className:"h-32 min-w-32 flex-1"})]}):o1.jsx(M90,{disabled:B,options:J,selectedType:q?void 0:Z,onTypeChange:Y}),!F&&N&&o1.jsx("p",{className:"w-0 min-w-full text-sm text-muted-foreground",children:N})]}),Q&&o1.jsx("p",{role:"alert",className:"w-0 min-w-full text-xs text-destructive",children:Q}),X&&!W&&!B&&!Q&&o1.jsx("p",{className:"w-0 min-w-full text-sm text-muted-foreground",children:X}),o1.jsxs("div",{className:"flex items-center justify-end gap-2",children:[z,o1.jsx(M0,{onClick:K,disabled:B||q,children:B&&U?U:G})]})]})}function M90({disabled:$,options:Z,selectedType:J,onTypeChange:H}){return o1.jsx("fieldset",{disabled:$,"aria-label":"Agent",className:"flex min-w-0 flex-wrap justify-center gap-2",children:Z.map((B)=>o1.jsx(P90,{option:B,selected:J===B.type,onSelect:H},B.type))})}function P90({option:$,selected:Z,onSelect:J}){let H=Boolean($.disabledReason),B=o1.jsxs("button",{type:"button",disabled:$.disabled&&!H,"aria-disabled":$.disabled||void 0,"aria-pressed":Z,onClick:(Q)=>{if($.disabled){Q.preventDefault();return}J($.type)},className:Q0("relative flex h-32 min-w-32 flex-1 flex-col items-start justify-between gap-6 rounded-xl bg-card p-4 text-left ring-1 ring-border transition-opacity outline-none focus-visible:ring-3 focus-visible:ring-ring/50",!Z&&"opacity-70",!Z&&!$.disabled&&"cursor-pointer hover:opacity-100",$.disabled&&"cursor-not-allowed"),children:[o1.jsxs("span",{className:"relative inline-flex",children:[o1.jsx(_90,{type:$.type}),Z&&o1.jsx(zK,{size:16,stroke:1.75,"aria-hidden":"true",className:"absolute -top-1.5 -right-1.5"})]}),o1.jsxs("span",{className:"flex min-w-0 flex-col gap-0.5",children:[o1.jsx("span",{className:"text-sm font-medium text-foreground",children:R$[$.type]}),o1.jsx("span",{className:"text-xs leading-4 text-muted-foreground",children:$.description})]})]});if(!H)return B;return o1.jsxs(i1,{children:[o1.jsx(r1,{render:B}),o1.jsx(a1,{className:"max-w-[calc(100vw-2rem)] leading-5 sm:max-w-96",children:o1.jsxs("span",{className:"text-center",children:[$.disabledReason,$.disabledCommand&&o1.jsxs(o1.Fragment,{children:[o1.jsx("br",{}),o1.jsx("code",{className:"rounded-xs bg-accent px-1 py-0.5 font-mono wrap-anywhere",children:$.disabledCommand})]})]})})]})}function _90({type:$}){return o1.jsx("img",{src:e9[$],alt:"",className:"size-8 shrink-0"})}var ry=P(c(),1);function UK({children:$,showCloseButton:Z=!0}){return ry.jsx(OJ,{showCloseButton:Z,className:"block max-h-[calc(100dvh-2rem)] w-max max-w-[calc(100vw-2rem)] overflow-y-auto p-6 sm:max-w-[calc(100vw-2rem)]",children:$})}var k5=P(c(),1),ay=CJ[0];function LQ({trigger:$}){let[,Z]=m4(),J=a4(),H=vU(),B=VR(),[Q,X]=VQ.useState(!1),[z,G]=VQ.useState("name"),[U,Y]=VQ.useState(ay),[K,F]=VQ.useState(""),W=K.trim(),q=W?XI(W):null,N=B.isPending,D=H.isPending||H.isFetching,A=H.isError?void 0:H.data?.installed,V=XK(A),L=V.some((j)=>j.type===U&&!j.disabled),O=!D&&!A?"Could not check installed agents.":void 0,M=!D&&!O&&L;if(J.demo)return k5.jsx(EJ,{trigger:$});function _(j){vy(j),X(!1),Z(`/workspace/${j}`)}function w(){G("name"),Y(ay),F(""),B.reset()}function C(){if(!W||q)return;B.reset(),G("agent")}function E(){if(!W||q||N||!M)return;B.reset(),B.mutate({name:W,type:U},{onSuccess:(j)=>_(j.id)})}return k5.jsxs(f6,{open:Q,onOpenChange:(j)=>{if(!j&&N)return;if(X(j),j)H.refetch({cancelRefetch:!1})},onOpenChangeComplete:(j)=>{if(!j)w()},children:[k5.jsx(g3,{render:$}),k5.jsx(UK,{showCloseButton:!N,children:z==="name"?k5.jsx(O90,{name:K,validationError:q,onNameChange:F,onSubmit:C}):k5.jsx(GK,{title:"Create new workspace",selectedType:U,options:V,isLoading:D&&!A,errorMessage:O??B.error?.message,emptyMessage:"Install at least one agent to create a new workspace",isPending:N||D||Boolean(O),secondaryAction:k5.jsx(M0,{variant:"secondary",disabled:N,onClick:()=>G("name"),children:"Back"}),primaryLabel:"Create workspace",pendingLabel:N?"Creating…":void 0,onTypeChange:Y,onSubmit:E})})]})}function O90({name:$,validationError:Z,onNameChange:J,onSubmit:H}){function B(Q){Q.preventDefault(),H()}return k5.jsxs("form",{className:"flex min-w-[min(22rem,calc(100vw-5rem))] flex-col gap-5",onSubmit:B,children:[k5.jsxs("div",{className:"flex flex-col gap-0.5 pr-8",children:[k5.jsx(g6,{children:"Create new workspace"}),k5.jsx(jJ,{children:"Give it a short and recognizable name"})]}),k5.jsxs("div",{className:"flex flex-col gap-2",children:[k5.jsx("label",{htmlFor:"workspace-name",className:"sr-only",children:"Workspace name"}),k5.jsx(C$,{id:"workspace-name",value:$,onChange:(Q)=>J(Q.target.value),placeholder:"Workspace name",autoFocus:!0,"aria-invalid":Boolean(Z),"aria-describedby":Z?"workspace-name-error":void 0,autoComplete:"off",spellCheck:!1}),Z&&k5.jsx("p",{id:"workspace-name-error",role:"alert",className:"text-xs text-destructive",children:Z})]}),k5.jsxs("div",{className:"flex items-center justify-end gap-2",children:[k5.jsx(j90,{}),k5.jsx(M0,{type:"submit",disabled:!$.trim()||Boolean(Z),children:"Next"})]})]})}function j90(){return k5.jsxs(i1,{children:[k5.jsx(r1,{render:k5.jsx(M0,{variant:"secondary","aria-disabled":!0,onClick:(Z)=>Z.preventDefault(),className:"cursor-not-allowed bg-accent text-muted-foreground hover:bg-accent",children:"Use existing folder"})}),k5.jsx(a1,{className:"max-w-64",children:k5.jsxs("span",{className:"text-center",children:["Not supported yet — run"," ",k5.jsx("code",{className:"rounded-xs bg-accent px-1 py-0.5 font-mono whitespace-nowrap",children:"moi init"})," ","in the folder from your console to add it"]})})]})}var B7=P(m(),1);var V0=P(m(),1),v$=P(U8(),1);var q2=P(m(),1);var MQ=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function k$($){let Z=Object.prototype.toString.call($);return Z==="[object Window]"||Z==="[object global]"}function YK($){return"nodeType"in $}function W4($){var Z,J;if(!$)return window;if(k$($))return $;if(!YK($))return window;return(Z=(J=$.ownerDocument)==null?void 0:J.defaultView)!=null?Z:window}function KK($){let{Document:Z}=W4($);return $ instanceof Z}function gJ($){if(k$($))return!1;return $ instanceof W4($).HTMLElement}function GL($){return $ instanceof W4($).SVGElement}function y$($){if(!$)return document;if(k$($))return $.document;if(!YK($))return document;if(KK($))return $;if(gJ($)||GL($))return $.ownerDocument;return document}var $3=MQ?q2.useLayoutEffect:q2.useEffect;function PQ($){let Z=q2.useRef($);return $3(()=>{Z.current=$}),q2.useCallback(function(){for(var J=arguments.length,H=Array(J),B=0;B<J;B++)H[B]=arguments[B];return Z.current==null?void 0:Z.current(...H)},[])}function ny(){let $=q2.useRef(null),Z=q2.useCallback((H,B)=>{$.current=setInterval(H,B)},[]),J=q2.useCallback(()=>{if($.current!==null)clearInterval($.current),$.current=null},[]);return[Z,J]}function mJ($,Z){if(Z===void 0)Z=[$];let J=q2.useRef($);return $3(()=>{if(J.current!==$)J.current=$},Z),J}function uJ($,Z){let J=q2.useRef();return q2.useMemo(()=>{let H=$(J.current);return J.current=H,H},[...Z])}function _Q($){let Z=PQ($),J=q2.useRef(null),H=q2.useCallback((B)=>{if(B!==J.current)Z==null||Z(B,J.current);J.current=B},[]);return[J,H]}function OQ($){let Z=q2.useRef();return q2.useEffect(()=>{Z.current=$},[$]),Z.current}var zL={};function jQ($,Z){return q2.useMemo(()=>{if(Z)return Z;let J=zL[$]==null?0:zL[$]+1;return zL[$]=J,$+"-"+J},[$,Z])}function sy($){return function(Z){for(var J=arguments.length,H=Array(J>1?J-1:0),B=1;B<J;B++)H[B-1]=arguments[B];return H.reduce((Q,X)=>{let z=Object.entries(X);for(let[G,U]of z){let Y=Q[G];if(Y!=null)Q[G]=Y+$*U}return Q},{...Z})}}var x$=sy(1),TQ=sy(-1);function T90($){return"clientX"in $&&"clientY"in $}function FK($){if(!$)return!1;let{KeyboardEvent:Z}=W4($.target);return Z&&$ instanceof Z}function C90($){if(!$)return!1;let{TouchEvent:Z}=W4($.target);return Z&&$ instanceof Z}function CQ($){if(C90($)){if($.touches&&$.touches.length){let{clientX:Z,clientY:J}=$.touches[0];return{x:Z,y:J}}else if($.changedTouches&&$.changedTouches.length){let{clientX:Z,clientY:J}=$.changedTouches[0];return{x:Z,y:J}}}if(T90($))return{x:$.clientX,y:$.clientY};return null}var fJ=Object.freeze({Translate:{toString($){if(!$)return;let{x:Z,y:J}=$;return"translate3d("+(Z?Math.round(Z):0)+"px, "+(J?Math.round(J):0)+"px, 0)"}},Scale:{toString($){if(!$)return;let{scaleX:Z,scaleY:J}=$;return"scaleX("+Z+") scaleY("+J+")"}},Transform:{toString($){if(!$)return;return[fJ.Translate.toString($),fJ.Scale.toString($)].join(" ")}},Transition:{toString($){let{property:Z,duration:J,easing:H}=$;return Z+" "+J+"ms "+H}}}),oy="a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]";function ty($){if($.matches(oy))return $;return $.querySelector(oy)}var h$=P(m(),1),E90={display:"none"};function ey($){let{id:Z,value:J}=$;return h$.default.createElement("div",{id:Z,style:E90},J)}function $x($){let{id:Z,announcement:J,ariaLiveType:H="assertive"}=$,B={position:"fixed",top:0,left:0,width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0 0 0 0)",clipPath:"inset(100%)",whiteSpace:"nowrap"};return h$.default.createElement("div",{id:Z,style:B,role:"status","aria-live":H,"aria-atomic":!0},J)}function Zx(){let[$,Z]=h$.useState("");return{announce:h$.useCallback((H)=>{if(H!=null)Z(H)},[]),announcement:$}}var qx=V0.createContext(null);function b90($){let Z=V0.useContext(qx);V0.useEffect(()=>{if(!Z)throw Error("useDndMonitor must be used within a children of <DndContext>");return Z($)},[$,Z])}function w90(){let[$]=V0.useState(()=>new Set),Z=V0.useCallback((H)=>{return $.add(H),()=>$.delete(H)},[$]);return[V0.useCallback((H)=>{let{type:B,event:Q}=H;$.forEach((X)=>{var z;return(z=X[B])==null?void 0:z.call(X,Q)})},[$]),Z]}var S90={draggable:`
15
+ To pick up a draggable item, press the space bar.
16
+ While dragging, use the arrow keys to move the item.
17
+ Press space again to drop the item in its new position, or press escape to cancel.
18
+ `},R90={onDragStart($){let{active:Z}=$;return"Picked up draggable item "+Z.id+"."},onDragOver($){let{active:Z,over:J}=$;if(J)return"Draggable item "+Z.id+" was moved over droppable area "+J.id+".";return"Draggable item "+Z.id+" is no longer over a droppable area."},onDragEnd($){let{active:Z,over:J}=$;if(J)return"Draggable item "+Z.id+" was dropped over droppable area "+J.id;return"Draggable item "+Z.id+" was dropped."},onDragCancel($){let{active:Z}=$;return"Dragging was cancelled. Draggable item "+Z.id+" was dropped."}};function I90($){let{announcements:Z=R90,container:J,hiddenTextDescribedById:H,screenReaderInstructions:B=S90}=$,{announce:Q,announcement:X}=Zx(),z=jQ("DndLiveRegion"),[G,U]=V0.useState(!1);if(V0.useEffect(()=>{U(!0)},[]),b90(V0.useMemo(()=>({onDragStart(K){let{active:F}=K;Q(Z.onDragStart({active:F}))},onDragMove(K){let{active:F,over:W}=K;if(Z.onDragMove)Q(Z.onDragMove({active:F,over:W}))},onDragOver(K){let{active:F,over:W}=K;Q(Z.onDragOver({active:F,over:W}))},onDragEnd(K){let{active:F,over:W}=K;Q(Z.onDragEnd({active:F,over:W}))},onDragCancel(K){let{active:F,over:W}=K;Q(Z.onDragCancel({active:F,over:W}))}}),[Q,Z])),!G)return null;let Y=V0.default.createElement(V0.default.Fragment,null,V0.default.createElement(ey,{id:H,value:B.draggable}),V0.default.createElement($x,{id:z,announcement:X}));return J?v$.createPortal(Y,J):Y}var M2;(function($){$.DragStart="dragStart",$.DragMove="dragMove",$.DragEnd="dragEnd",$.DragCancel="dragCancel",$.DragOver="dragOver",$.RegisterDroppable="registerDroppable",$.SetDroppableDisabled="setDroppableDisabled",$.UnregisterDroppable="unregisterDroppable"})(M2||(M2={}));function qK(){}function NL($,Z){return V0.useMemo(()=>({sensor:$,options:Z!=null?Z:{}}),[$,Z])}function Nx(){for(var $=arguments.length,Z=Array($),J=0;J<$;J++)Z[J]=arguments[J];return V0.useMemo(()=>[...Z].filter((H)=>H!=null),[...Z])}var Y9=Object.freeze({x:0,y:0});function k90($,Z){return Math.sqrt(Math.pow($.x-Z.x,2)+Math.pow($.y-Z.y,2))}function y90($,Z){let J=CQ($);if(!J)return"0 0";let H={x:(J.x-Z.left)/Z.width*100,y:(J.y-Z.top)/Z.height*100};return H.x+"% "+H.y+"%"}function x90($,Z){let{data:{value:J}}=$,{data:{value:H}}=Z;return J-H}function h90($,Z){let{data:{value:J}}=$,{data:{value:H}}=Z;return H-J}function v90($,Z){if(!$||$.length===0)return null;let[J]=$;return Z?J[Z]:J}function Jx($,Z,J){if(Z===void 0)Z=$.left;if(J===void 0)J=$.top;return{x:Z+$.width*0.5,y:J+$.height*0.5}}var Ax=($)=>{let{collisionRect:Z,droppableRects:J,droppableContainers:H}=$,B=Jx(Z,Z.left,Z.top),Q=[];for(let X of H){let{id:z}=X,G=J.get(z);if(G){let U=k90(Jx(G),B);Q.push({id:z,data:{droppableContainer:X,value:U}})}}return Q.sort(x90)};function f90($,Z){let J=Math.max(Z.top,$.top),H=Math.max(Z.left,$.left),B=Math.min(Z.left+Z.width,$.left+$.width),Q=Math.min(Z.top+Z.height,$.top+$.height),X=B-H,z=Q-J;if(H<B&&J<Q){let G=Z.width*Z.height,U=$.width*$.height,Y=X*z,K=Y/(G+U-Y);return Number(K.toFixed(4))}return 0}var g90=($)=>{let{collisionRect:Z,droppableRects:J,droppableContainers:H}=$,B=[];for(let Q of H){let{id:X}=Q,z=J.get(X);if(z){let G=f90(z,Z);if(G>0)B.push({id:X,data:{droppableContainer:Q,value:G}})}}return B.sort(h90)};function m90($,Z,J){return{...$,scaleX:Z&&J?Z.width/J.width:1,scaleY:Z&&J?Z.height/J.height:1}}function Dx($,Z){return $&&Z?{x:$.left-Z.left,y:$.top-Z.top}:Y9}function u90($){return function(J){for(var H=arguments.length,B=Array(H>1?H-1:0),Q=1;Q<H;Q++)B[Q-1]=arguments[Q];return B.reduce((X,z)=>({...X,top:X.top+$*z.y,bottom:X.bottom+$*z.y,left:X.left+$*z.x,right:X.right+$*z.x}),{...J})}}var p90=u90(1);function Vx($){if($.startsWith("matrix3d(")){let Z=$.slice(9,-1).split(/, /);return{x:+Z[12],y:+Z[13],scaleX:+Z[0],scaleY:+Z[5]}}else if($.startsWith("matrix(")){let Z=$.slice(7,-1).split(/, /);return{x:+Z[4],y:+Z[5],scaleX:+Z[0],scaleY:+Z[3]}}return null}function c90($,Z,J){let H=Vx(Z);if(!H)return $;let{scaleX:B,scaleY:Q,x:X,y:z}=H,G=$.left-X-(1-B)*parseFloat(J),U=$.top-z-(1-Q)*parseFloat(J.slice(J.indexOf(" ")+1)),Y=B?$.width/B:$.width,K=Q?$.height/Q:$.height;return{width:Y,height:K,top:U,right:G+Y,bottom:U+K,left:G}}var d90={ignoreTransform:!1};function wQ($,Z){if(Z===void 0)Z=d90;let J=$.getBoundingClientRect();if(Z.ignoreTransform){let{transform:U,transformOrigin:Y}=W4($).getComputedStyle($);if(U)J=c90(J,U,Y)}let{top:H,left:B,width:Q,height:X,bottom:z,right:G}=J;return{top:H,left:B,width:Q,height:X,bottom:z,right:G}}function Hx($){return wQ($,{ignoreTransform:!0})}function l90($){let{innerWidth:Z,innerHeight:J}=$;return{top:0,left:0,right:Z,bottom:J,width:Z,height:J}}function i90($,Z){if(Z===void 0)Z=W4($).getComputedStyle($);return Z.position==="fixed"}function r90($,Z){if(Z===void 0)Z=W4($).getComputedStyle($);let J=/(auto|scroll|overlay)/;return["overflow","overflowX","overflowY"].some((B)=>{let Q=Z[B];return typeof Q==="string"?J.test(Q):!1})}function AL($,Z){let J=[];function H(B){if(Z!=null&&J.length>=Z)return J;if(!B)return J;if(KK(B)&&B.scrollingElement!=null&&!J.includes(B.scrollingElement))return J.push(B.scrollingElement),J;if(!gJ(B)||GL(B))return J;if(J.includes(B))return J;let Q=W4($).getComputedStyle(B);if(B!==$){if(r90(B,Q))J.push(B)}if(i90(B,Q))return J;return H(B.parentNode)}if(!$)return J;return H($)}function Lx($){let[Z]=AL($,1);return Z!=null?Z:null}function UL($){if(!MQ||!$)return null;if(k$($))return $;if(!YK($))return null;if(KK($)||$===y$($).scrollingElement)return window;if(gJ($))return $;return null}function Mx($){if(k$($))return $.scrollX;return $.scrollLeft}function Px($){if(k$($))return $.scrollY;return $.scrollTop}function FL($){return{x:Mx($),y:Px($)}}var v2;(function($){$[$.Forward=1]="Forward",$[$.Backward=-1]="Backward"})(v2||(v2={}));function _x($){if(!MQ||!$)return!1;return $===document.scrollingElement}function Ox($){let Z={x:0,y:0},J=_x($)?{height:window.innerHeight,width:window.innerWidth}:{height:$.clientHeight,width:$.clientWidth},H={x:$.scrollWidth-J.width,y:$.scrollHeight-J.height},B=$.scrollTop<=Z.y,Q=$.scrollLeft<=Z.x,X=$.scrollTop>=H.y,z=$.scrollLeft>=H.x;return{isTop:B,isLeft:Q,isBottom:X,isRight:z,maxScroll:H,minScroll:Z}}var a90={x:0.2,y:0.2};function o90($,Z,J,H,B){let{top:Q,left:X,right:z,bottom:G}=J;if(H===void 0)H=10;if(B===void 0)B=a90;let{isTop:U,isBottom:Y,isLeft:K,isRight:F}=Ox($),W={x:0,y:0},q={x:0,y:0},N={height:Z.height*B.y,width:Z.width*B.x};if(!U&&Q<=Z.top+N.height)W.y=v2.Backward,q.y=H*Math.abs((Z.top+N.height-Q)/N.height);else if(!Y&&G>=Z.bottom-N.height)W.y=v2.Forward,q.y=H*Math.abs((Z.bottom-N.height-G)/N.height);if(!F&&z>=Z.right-N.width)W.x=v2.Forward,q.x=H*Math.abs((Z.right-N.width-z)/N.width);else if(!K&&X<=Z.left+N.width)W.x=v2.Backward,q.x=H*Math.abs((Z.left+N.width-X)/N.width);return{direction:W,speed:q}}function n90($){if($===document.scrollingElement){let{innerWidth:Q,innerHeight:X}=window;return{top:0,left:0,right:Q,bottom:X,width:Q,height:X}}let{top:Z,left:J,right:H,bottom:B}=$.getBoundingClientRect();return{top:Z,left:J,right:H,bottom:B,width:$.clientWidth,height:$.clientHeight}}function jx($){return $.reduce((Z,J)=>{return x$(Z,FL(J))},Y9)}function s90($){return $.reduce((Z,J)=>{return Z+Mx(J)},0)}function t90($){return $.reduce((Z,J)=>{return Z+Px(J)},0)}function Tx($,Z){if(Z===void 0)Z=wQ;if(!$)return;let{top:J,left:H,bottom:B,right:Q}=Z($);if(!Lx($))return;if(B<=0||Q<=0||J>=window.innerHeight||H>=window.innerWidth)$.scrollIntoView({block:"center",inline:"center"})}var e90=[["x",["left","right"],s90],["y",["top","bottom"],t90]];class AK{constructor($,Z){this.rect=void 0,this.width=void 0,this.height=void 0,this.top=void 0,this.bottom=void 0,this.right=void 0,this.left=void 0;let J=AL(Z),H=jx(J);this.rect={...$},this.width=$.width,this.height=$.height;for(let[B,Q,X]of e90)for(let z of Q)Object.defineProperty(this,z,{get:()=>{let G=X(J),U=H[B]-G;return this.rect[z]+U},enumerable:!0});Object.defineProperty(this,"rect",{enumerable:!1})}}class pJ{constructor($){this.target=void 0,this.listeners=[],this.removeAll=()=>{this.listeners.forEach((Z)=>{var J;return(J=this.target)==null?void 0:J.removeEventListener(...Z)})},this.target=$}add($,Z,J){var H;(H=this.target)==null||H.addEventListener($,Z,J),this.listeners.push([$,Z,J])}}function $30($){let{EventTarget:Z}=W4($);return $ instanceof Z?$:y$($)}function YL($,Z){let J=Math.abs($.x),H=Math.abs($.y);if(typeof Z==="number")return Math.sqrt(J**2+H**2)>Z;if("x"in Z&&"y"in Z)return J>Z.x&&H>Z.y;if("x"in Z)return J>Z.x;if("y"in Z)return H>Z.y;return!1}var h8;(function($){$.Click="click",$.DragStart="dragstart",$.Keydown="keydown",$.ContextMenu="contextmenu",$.Resize="resize",$.SelectionChange="selectionchange",$.VisibilityChange="visibilitychange"})(h8||(h8={}));function Bx($){$.preventDefault()}function Z30($){$.stopPropagation()}var B5;(function($){$.Space="Space",$.Down="ArrowDown",$.Right="ArrowRight",$.Left="ArrowLeft",$.Up="ArrowUp",$.Esc="Escape",$.Enter="Enter",$.Tab="Tab"})(B5||(B5={}));var Cx={start:[B5.Space,B5.Enter],cancel:[B5.Esc],end:[B5.Space,B5.Enter,B5.Tab]},J30=($,Z)=>{let{currentCoordinates:J}=Z;switch($.code){case B5.Right:return{...J,x:J.x+25};case B5.Left:return{...J,x:J.x-25};case B5.Down:return{...J,y:J.y+25};case B5.Up:return{...J,y:J.y-25}}return};class SQ{constructor($){this.props=void 0,this.autoScrollEnabled=!1,this.referenceCoordinates=void 0,this.listeners=void 0,this.windowListeners=void 0,this.props=$;let{event:{target:Z}}=$;this.props=$,this.listeners=new pJ(y$(Z)),this.windowListeners=new pJ(W4(Z)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach()}attach(){this.handleStart(),this.windowListeners.add(h8.Resize,this.handleCancel),this.windowListeners.add(h8.VisibilityChange,this.handleCancel),setTimeout(()=>this.listeners.add(h8.Keydown,this.handleKeyDown))}handleStart(){let{activeNode:$,onStart:Z}=this.props,J=$.node.current;if(J)Tx(J);Z(Y9)}handleKeyDown($){if(FK($)){let{active:Z,context:J,options:H}=this.props,{keyboardCodes:B=Cx,coordinateGetter:Q=J30,scrollBehavior:X="smooth"}=H,{code:z}=$;if(B.end.includes(z)){this.handleEnd($);return}if(B.cancel.includes(z)){this.handleCancel($);return}let{collisionRect:G}=J.current,U=G?{x:G.left,y:G.top}:Y9;if(!this.referenceCoordinates)this.referenceCoordinates=U;let Y=Q($,{active:Z,context:J.current,currentCoordinates:U});if(Y){let K=TQ(Y,U),F={x:0,y:0},{scrollableAncestors:W}=J.current;for(let q of W){let N=$.code,{isTop:D,isRight:A,isLeft:V,isBottom:L,maxScroll:O,minScroll:M}=Ox(q),_=n90(q),w={x:Math.min(N===B5.Right?_.right-_.width/2:_.right,Math.max(N===B5.Right?_.left:_.left+_.width/2,Y.x)),y:Math.min(N===B5.Down?_.bottom-_.height/2:_.bottom,Math.max(N===B5.Down?_.top:_.top+_.height/2,Y.y))},C=N===B5.Right&&!A||N===B5.Left&&!V,E=N===B5.Down&&!L||N===B5.Up&&!D;if(C&&w.x!==Y.x){let j=q.scrollLeft+K.x,k=N===B5.Right&&j<=O.x||N===B5.Left&&j>=M.x;if(k&&!K.y){q.scrollTo({left:j,behavior:X});return}if(k)F.x=q.scrollLeft-j;else F.x=N===B5.Right?q.scrollLeft-O.x:q.scrollLeft-M.x;if(F.x)q.scrollBy({left:-F.x,behavior:X});break}else if(E&&w.y!==Y.y){let j=q.scrollTop+K.y,k=N===B5.Down&&j<=O.y||N===B5.Up&&j>=M.y;if(k&&!K.x){q.scrollTo({top:j,behavior:X});return}if(k)F.y=q.scrollTop-j;else F.y=N===B5.Down?q.scrollTop-O.y:q.scrollTop-M.y;if(F.y)q.scrollBy({top:-F.y,behavior:X});break}}this.handleMove($,x$(TQ(Y,this.referenceCoordinates),F))}}}handleMove($,Z){let{onMove:J}=this.props;$.preventDefault(),J(Z)}handleEnd($){let{onEnd:Z}=this.props;$.preventDefault(),this.detach(),Z()}handleCancel($){let{onCancel:Z}=this.props;$.preventDefault(),this.detach(),Z()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll()}}SQ.activators=[{eventName:"onKeyDown",handler:($,Z,J)=>{let{keyboardCodes:H=Cx,onActivation:B}=Z,{active:Q}=J,{code:X}=$.nativeEvent;if(H.start.includes(X)){let z=Q.activatorNode.current;if(z&&$.target!==z)return!1;return $.preventDefault(),B==null||B({event:$.nativeEvent}),!0}return!1}}];function Qx($){return Boolean($&&"distance"in $)}function Xx($){return Boolean($&&"delay"in $)}class DK{constructor($,Z,J){var H;if(J===void 0)J=$30($.event.target);this.props=void 0,this.events=void 0,this.autoScrollEnabled=!0,this.document=void 0,this.activated=!1,this.initialCoordinates=void 0,this.timeoutId=null,this.listeners=void 0,this.documentListeners=void 0,this.windowListeners=void 0,this.props=$,this.events=Z;let{event:B}=$,{target:Q}=B;this.props=$,this.events=Z,this.document=y$(Q),this.documentListeners=new pJ(this.document),this.listeners=new pJ(J),this.windowListeners=new pJ(W4(Q)),this.initialCoordinates=(H=CQ(B))!=null?H:Y9,this.handleStart=this.handleStart.bind(this),this.handleMove=this.handleMove.bind(this),this.handleEnd=this.handleEnd.bind(this),this.handleCancel=this.handleCancel.bind(this),this.handleKeydown=this.handleKeydown.bind(this),this.removeTextSelection=this.removeTextSelection.bind(this),this.attach()}attach(){let{events:$,props:{options:{activationConstraint:Z,bypassActivationConstraint:J}}}=this;if(this.listeners.add($.move.name,this.handleMove,{passive:!1}),this.listeners.add($.end.name,this.handleEnd),$.cancel)this.listeners.add($.cancel.name,this.handleCancel);if(this.windowListeners.add(h8.Resize,this.handleCancel),this.windowListeners.add(h8.DragStart,Bx),this.windowListeners.add(h8.VisibilityChange,this.handleCancel),this.windowListeners.add(h8.ContextMenu,Bx),this.documentListeners.add(h8.Keydown,this.handleKeydown),Z){if(J!=null&&J({event:this.props.event,activeNode:this.props.activeNode,options:this.props.options}))return this.handleStart();if(Xx(Z)){this.timeoutId=setTimeout(this.handleStart,Z.delay),this.handlePending(Z);return}if(Qx(Z)){this.handlePending(Z);return}}this.handleStart()}detach(){if(this.listeners.removeAll(),this.windowListeners.removeAll(),setTimeout(this.documentListeners.removeAll,50),this.timeoutId!==null)clearTimeout(this.timeoutId),this.timeoutId=null}handlePending($,Z){let{active:J,onPending:H}=this.props;H(J,$,this.initialCoordinates,Z)}handleStart(){let{initialCoordinates:$}=this,{onStart:Z}=this.props;if($)this.activated=!0,this.documentListeners.add(h8.Click,Z30,{capture:!0}),this.removeTextSelection(),this.documentListeners.add(h8.SelectionChange,this.removeTextSelection),Z($)}handleMove($){var Z;let{activated:J,initialCoordinates:H,props:B}=this,{onMove:Q,options:{activationConstraint:X}}=B;if(!H)return;let z=(Z=CQ($))!=null?Z:Y9,G=TQ(H,z);if(!J&&X){if(Qx(X)){if(X.tolerance!=null&&YL(G,X.tolerance))return this.handleCancel();if(YL(G,X.distance))return this.handleStart()}if(Xx(X)){if(YL(G,X.tolerance))return this.handleCancel()}this.handlePending(X,G);return}if($.cancelable)$.preventDefault();Q(z)}handleEnd(){let{onAbort:$,onEnd:Z}=this.props;if(this.detach(),!this.activated)$(this.props.active);Z()}handleCancel(){let{onAbort:$,onCancel:Z}=this.props;if(this.detach(),!this.activated)$(this.props.active);Z()}handleKeydown($){if($.code===B5.Esc)this.handleCancel()}removeTextSelection(){var $;($=this.document.getSelection())==null||$.removeAllRanges()}}var H30={cancel:{name:"pointercancel"},move:{name:"pointermove"},end:{name:"pointerup"}};class RQ extends DK{constructor($){let{event:Z}=$,J=y$(Z.target);super($,H30,J)}}RQ.activators=[{eventName:"onPointerDown",handler:($,Z)=>{let{nativeEvent:J}=$,{onActivation:H}=Z;if(!J.isPrimary||J.button!==0)return!1;return H==null||H({event:J}),!0}}];var B30={move:{name:"mousemove"},end:{name:"mouseup"}},WL;(function($){$[$.RightClick=2]="RightClick"})(WL||(WL={}));class Ex extends DK{constructor($){super($,B30,y$($.event.target))}}Ex.activators=[{eventName:"onMouseDown",handler:($,Z)=>{let{nativeEvent:J}=$,{onActivation:H}=Z;if(J.button===WL.RightClick)return!1;return H==null||H({event:J}),!0}}];var KL={cancel:{name:"touchcancel"},move:{name:"touchmove"},end:{name:"touchend"}};class bx extends DK{constructor($){super($,KL)}static setup(){return window.addEventListener(KL.move.name,$,{capture:!1,passive:!1}),function(){window.removeEventListener(KL.move.name,$)};function $(){}}}bx.activators=[{eventName:"onTouchStart",handler:($,Z)=>{let{nativeEvent:J}=$,{onActivation:H}=Z,{touches:B}=J;if(B.length>1)return!1;return H==null||H({event:J}),!0}}];var EQ;(function($){$[$.Pointer=0]="Pointer",$[$.DraggableRect=1]="DraggableRect"})(EQ||(EQ={}));var NK;(function($){$[$.TreeOrder=0]="TreeOrder",$[$.ReversedTreeOrder=1]="ReversedTreeOrder"})(NK||(NK={}));function Q30($){let{acceleration:Z,activator:J=EQ.Pointer,canScroll:H,draggingRect:B,enabled:Q,interval:X=5,order:z=NK.TreeOrder,pointerCoordinates:G,scrollableAncestors:U,scrollableAncestorRects:Y,delta:K,threshold:F}=$,W=z30({delta:K,disabled:!Q}),[q,N]=ny(),D=V0.useRef({x:0,y:0}),A=V0.useRef({x:0,y:0}),V=V0.useMemo(()=>{switch(J){case EQ.Pointer:return G?{top:G.y,bottom:G.y,left:G.x,right:G.x}:null;case EQ.DraggableRect:return B}},[J,B,G]),L=V0.useRef(null),O=V0.useCallback(()=>{let _=L.current;if(!_)return;let w=D.current.x*A.current.x,C=D.current.y*A.current.y;_.scrollBy(w,C)},[]),M=V0.useMemo(()=>z===NK.TreeOrder?[...U].reverse():U,[z,U]);V0.useEffect(()=>{if(!Q||!U.length||!V){N();return}for(let _ of M){if((H==null?void 0:H(_))===!1)continue;let w=U.indexOf(_),C=Y[w];if(!C)continue;let{direction:E,speed:j}=o90(_,C,V,Z,F);for(let k of["x","y"])if(!W[k][E[k]])j[k]=0,E[k]=0;if(j.x>0||j.y>0){N(),L.current=_,q(O,X),D.current=j,A.current=E;return}}D.current={x:0,y:0},A.current={x:0,y:0},N()},[Z,O,H,N,Q,X,JSON.stringify(V),JSON.stringify(W),q,U,M,Y,JSON.stringify(F)])}var X30={x:{[v2.Backward]:!1,[v2.Forward]:!1},y:{[v2.Backward]:!1,[v2.Forward]:!1}};function z30($){let{delta:Z,disabled:J}=$,H=OQ(Z);return uJ((B)=>{if(J||!H||!B)return X30;let Q={x:Math.sign(Z.x-H.x),y:Math.sign(Z.y-H.y)};return{x:{[v2.Backward]:B.x[v2.Backward]||Q.x===-1,[v2.Forward]:B.x[v2.Forward]||Q.x===1},y:{[v2.Backward]:B.y[v2.Backward]||Q.y===-1,[v2.Forward]:B.y[v2.Forward]||Q.y===1}}},[J,Z,H])}function G30($,Z){let J=Z!=null?$.get(Z):void 0,H=J?J.node.current:null;return uJ((B)=>{var Q;if(Z==null)return null;return(Q=H!=null?H:B)!=null?Q:null},[H,Z])}function U30($,Z){return V0.useMemo(()=>$.reduce((J,H)=>{let{sensor:B}=H,Q=B.activators.map((X)=>({eventName:X.eventName,handler:Z(X.handler,H)}));return[...J,...Q]},[]),[$,Z])}var bQ;(function($){$[$.Always=0]="Always",$[$.BeforeDragging=1]="BeforeDragging",$[$.WhileDragging=2]="WhileDragging"})(bQ||(bQ={}));var qL;(function($){$.Optimized="optimized"})(qL||(qL={}));var zx=new Map;function Y30($,Z){let{dragging:J,dependencies:H,config:B}=Z,[Q,X]=V0.useState(null),{frequency:z,measure:G,strategy:U}=B,Y=V0.useRef($),K=D(),F=mJ(K),W=V0.useCallback(function(A){if(A===void 0)A=[];if(F.current)return;X((V)=>{if(V===null)return A;return V.concat(A.filter((L)=>!V.includes(L)))})},[F]),q=V0.useRef(null),N=uJ((A)=>{if(K&&!J)return zx;if(!A||A===zx||Y.current!==$||Q!=null){let V=new Map;for(let L of $){if(!L)continue;if(Q&&Q.length>0&&!Q.includes(L.id)&&L.rect.current){V.set(L.id,L.rect.current);continue}let O=L.node.current,M=O?new AK(G(O),O):null;if(L.rect.current=M,M)V.set(L.id,M)}return V}return A},[$,Q,J,K,G]);return V0.useEffect(()=>{Y.current=$},[$]),V0.useEffect(()=>{if(K)return;W()},[J,K]),V0.useEffect(()=>{if(Q&&Q.length>0)X(null)},[JSON.stringify(Q)]),V0.useEffect(()=>{if(K||typeof z!=="number"||q.current!==null)return;q.current=setTimeout(()=>{W(),q.current=null},z)},[z,K,W,...H]),{droppableRects:N,measureDroppableContainers:W,measuringScheduled:Q!=null};function D(){switch(U){case bQ.Always:return!1;case bQ.BeforeDragging:return J;default:return!J}}}function DL($,Z){return uJ((J)=>{if(!$)return null;if(J)return J;return typeof Z==="function"?Z($):$},[Z,$])}function K30($,Z){return DL($,Z)}function F30($){let{callback:Z,disabled:J}=$,H=PQ(Z),B=V0.useMemo(()=>{if(J||typeof window>"u"||typeof window.MutationObserver>"u")return;let{MutationObserver:Q}=window;return new Q(H)},[H,J]);return V0.useEffect(()=>{return()=>B==null?void 0:B.disconnect()},[B]),B}function VK($){let{callback:Z,disabled:J}=$,H=PQ(Z),B=V0.useMemo(()=>{if(J||typeof window>"u"||typeof window.ResizeObserver>"u")return;let{ResizeObserver:Q}=window;return new Q(H)},[J]);return V0.useEffect(()=>{return()=>B==null?void 0:B.disconnect()},[B]),B}function W30($){return new AK(wQ($),$)}function Gx($,Z,J){if(Z===void 0)Z=W30;let[H,B]=V0.useState(null);function Q(){B((G)=>{if(!$)return null;if($.isConnected===!1){var U;return(U=G!=null?G:J)!=null?U:null}let Y=Z($);if(JSON.stringify(G)===JSON.stringify(Y))return G;return Y})}let X=F30({callback(G){if(!$)return;for(let U of G){let{type:Y,target:K}=U;if(Y==="childList"&&K instanceof HTMLElement&&K.contains($)){Q();break}}}}),z=VK({callback:Q});return $3(()=>{if(Q(),$)z==null||z.observe($),X==null||X.observe(document.body,{childList:!0,subtree:!0});else z==null||z.disconnect(),X==null||X.disconnect()},[$]),H}function q30($){let Z=DL($);return Dx($,Z)}var Ux=[];function N30($){let Z=V0.useRef($),J=uJ((H)=>{if(!$)return Ux;if(H&&H!==Ux&&$&&Z.current&&$.parentNode===Z.current.parentNode)return H;return AL($)},[$]);return V0.useEffect(()=>{Z.current=$},[$]),J}function A30($){let[Z,J]=V0.useState(null),H=V0.useRef($),B=V0.useCallback((Q)=>{let X=UL(Q.target);if(!X)return;J((z)=>{if(!z)return null;return z.set(X,FL(X)),new Map(z)})},[]);return V0.useEffect(()=>{let Q=H.current;if($!==Q){X(Q);let z=$.map((G)=>{let U=UL(G);if(U)return U.addEventListener("scroll",B,{passive:!0}),[U,FL(U)];return null}).filter((G)=>G!=null);J(z.length?new Map(z):null),H.current=$}return()=>{X($),X(Q)};function X(z){z.forEach((G)=>{let U=UL(G);U==null||U.removeEventListener("scroll",B)})}},[B,$]),V0.useMemo(()=>{if($.length)return Z?Array.from(Z.values()).reduce((Q,X)=>x$(Q,X),Y9):jx($);return Y9},[$,Z])}function Yx($,Z){if(Z===void 0)Z=[];let J=V0.useRef(null);return V0.useEffect(()=>{J.current=null},Z),V0.useEffect(()=>{let H=$!==Y9;if(H&&!J.current)J.current=$;if(!H&&J.current)J.current=null},[$]),J.current?TQ($,J.current):Y9}function D30($){V0.useEffect(()=>{if(!MQ)return;let Z=$.map((J)=>{let{sensor:H}=J;return H.setup==null?void 0:H.setup()});return()=>{for(let J of Z)J==null||J()}},$.map((Z)=>{let{sensor:J}=Z;return J}))}function V30($,Z){return V0.useMemo(()=>{return $.reduce((J,H)=>{let{eventName:B,handler:Q}=H;return J[B]=(X)=>{Q(X,Z)},J},{})},[$,Z])}function wx($){return V0.useMemo(()=>$?l90($):null,[$])}var Kx=[];function L30($,Z){if(Z===void 0)Z=wQ;let[J]=$,H=wx(J?W4(J):null),[B,Q]=V0.useState(Kx);function X(){Q(()=>{if(!$.length)return Kx;return $.map((G)=>_x(G)?H:new AK(Z(G),G))})}let z=VK({callback:X});return $3(()=>{z==null||z.disconnect(),X(),$.forEach((G)=>z==null?void 0:z.observe(G))},[$]),B}function Sx($){if(!$)return null;if($.children.length>1)return $;let Z=$.children[0];return gJ(Z)?Z:$}function M30($){let{measure:Z}=$,[J,H]=V0.useState(null),B=V0.useCallback((U)=>{for(let{target:Y}of U)if(gJ(Y)){H((K)=>{let F=Z(Y);return K?{...K,width:F.width,height:F.height}:F});break}},[Z]),Q=VK({callback:B}),X=V0.useCallback((U)=>{let Y=Sx(U);if(Q==null||Q.disconnect(),Y)Q==null||Q.observe(Y);H(Y?Z(Y):null)},[Z,Q]),[z,G]=_Q(X);return V0.useMemo(()=>({nodeRef:z,rect:J,setRef:G}),[J,z,G])}var P30=[{sensor:RQ,options:{}},{sensor:SQ,options:{}}],_30={current:{}},WK={draggable:{measure:Hx},droppable:{measure:Hx,strategy:bQ.WhileDragging,frequency:qL.Optimized},dragOverlay:{measure:wQ}};class cJ extends Map{get($){var Z;return $!=null?(Z=super.get($))!=null?Z:void 0:void 0}toArray(){return Array.from(this.values())}getEnabled(){return this.toArray().filter(($)=>{let{disabled:Z}=$;return!Z})}getNodeFor($){var Z,J;return(Z=(J=this.get($))==null?void 0:J.node.current)!=null?Z:void 0}}var O30={activatorEvent:null,active:null,activeNode:null,activeNodeRect:null,collisions:null,containerNodeRect:null,draggableNodes:new Map,droppableRects:new Map,droppableContainers:new cJ,over:null,dragOverlay:{nodeRef:{current:null},rect:null,setRef:qK},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:WK,measureDroppableContainers:qK,windowRect:null,measuringScheduled:!1},Rx={activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:""},dispatch:qK,draggableNodes:new Map,over:null,measureDroppableContainers:qK},IQ=V0.createContext(Rx),Ix=V0.createContext(O30);function j30(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new cJ}}}function T30($,Z){switch(Z.type){case M2.DragStart:return{...$,draggable:{...$.draggable,initialCoordinates:Z.initialCoordinates,active:Z.active}};case M2.DragMove:if($.draggable.active==null)return $;return{...$,draggable:{...$.draggable,translate:{x:Z.coordinates.x-$.draggable.initialCoordinates.x,y:Z.coordinates.y-$.draggable.initialCoordinates.y}}};case M2.DragEnd:case M2.DragCancel:return{...$,draggable:{...$.draggable,active:null,initialCoordinates:{x:0,y:0},translate:{x:0,y:0}}};case M2.RegisterDroppable:{let{element:J}=Z,{id:H}=J,B=new cJ($.droppable.containers);return B.set(H,J),{...$,droppable:{...$.droppable,containers:B}}}case M2.SetDroppableDisabled:{let{id:J,key:H,disabled:B}=Z,Q=$.droppable.containers.get(J);if(!Q||H!==Q.key)return $;let X=new cJ($.droppable.containers);return X.set(J,{...Q,disabled:B}),{...$,droppable:{...$.droppable,containers:X}}}case M2.UnregisterDroppable:{let{id:J,key:H}=Z,B=$.droppable.containers.get(J);if(!B||H!==B.key)return $;let Q=new cJ($.droppable.containers);return Q.delete(J),{...$,droppable:{...$.droppable,containers:Q}}}default:return $}}function C30($){let{disabled:Z}=$,{active:J,activatorEvent:H,draggableNodes:B}=V0.useContext(IQ),Q=OQ(H),X=OQ(J==null?void 0:J.id);return V0.useEffect(()=>{if(Z)return;if(!H&&Q&&X!=null){if(!FK(Q))return;if(document.activeElement===Q.target)return;let z=B.get(X);if(!z)return;let{activatorNode:G,node:U}=z;if(!G.current&&!U.current)return;requestAnimationFrame(()=>{for(let Y of[G.current,U.current]){if(!Y)continue;let K=ty(Y);if(K){K.focus();break}}})}},[H,Z,B,X,Q]),null}function kx($,Z){let{transform:J,...H}=Z;return $!=null&&$.length?$.reduce((B,Q)=>{return Q({transform:B,...H})},J):J}function E30($){return V0.useMemo(()=>({draggable:{...WK.draggable,...$==null?void 0:$.draggable},droppable:{...WK.droppable,...$==null?void 0:$.droppable},dragOverlay:{...WK.dragOverlay,...$==null?void 0:$.dragOverlay}}),[$==null?void 0:$.draggable,$==null?void 0:$.droppable,$==null?void 0:$.dragOverlay])}function b30($){let{activeNode:Z,measure:J,initialRect:H,config:B=!0}=$,Q=V0.useRef(!1),{x:X,y:z}=typeof B==="boolean"?{x:B,y:B}:B;$3(()=>{if(!X&&!z||!Z){Q.current=!1;return}if(Q.current||!H)return;let U=Z==null?void 0:Z.node.current;if(!U||U.isConnected===!1)return;let Y=J(U),K=Dx(Y,H);if(!X)K.x=0;if(!z)K.y=0;if(Q.current=!0,Math.abs(K.x)>0||Math.abs(K.y)>0){let F=Lx(U);if(F)F.scrollBy({top:K.y,left:K.x})}},[Z,X,z,H,J])}var LK=V0.createContext({...Y9,scaleX:1,scaleY:1}),H7;(function($){$[$.Uninitialized=0]="Uninitialized",$[$.Initializing=1]="Initializing",$[$.Initialized=2]="Initialized"})(H7||(H7={}));var yx=V0.memo(function(Z){var J,H,B,Q;let{id:X,accessibility:z,autoScroll:G=!0,children:U,sensors:Y=P30,collisionDetection:K=g90,measuring:F,modifiers:W,...q}=Z,N=V0.useReducer(T30,void 0,j30),[D,A]=N,[V,L]=w90(),[O,M]=V0.useState(H7.Uninitialized),_=O===H7.Initialized,{draggable:{active:w,nodes:C,translate:E},droppable:{containers:j}}=D,k=w!=null?C.get(w):null,S=V0.useRef({initial:null,translated:null}),I=V0.useMemo(()=>{var C0;return w!=null?{id:w,data:(C0=k==null?void 0:k.data)!=null?C0:_30,rect:S}:null},[w,k]),T=V0.useRef(null),[y,R]=V0.useState(null),[x,v]=V0.useState(null),f=mJ(q,Object.values(q)),b=jQ("DndDescribedBy",X),l=V0.useMemo(()=>j.getEnabled(),[j]),r=E30(F),{droppableRects:h,measureDroppableContainers:d,measuringScheduled:o}=Y30(l,{dragging:_,dependencies:[E.x,E.y],config:r.droppable}),p=G30(C,w),i=V0.useMemo(()=>x?CQ(x):null,[x]),n=z5(),Z0=K30(p,r.draggable.measure);b30({activeNode:w!=null?C.get(w):null,config:n.layoutShiftCompensation,initialRect:Z0,measure:r.draggable.measure});let J0=Gx(p,r.draggable.measure,Z0),U0=Gx(p?p.parentElement:null),z0=V0.useRef({activatorEvent:null,active:null,activeNode:p,collisionRect:null,collisions:null,droppableRects:h,draggableNodes:C,draggingNode:null,draggingNodeRect:null,droppableContainers:j,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null}),X0=j.getNodeFor((J=z0.current.over)==null?void 0:J.id),q0=M30({measure:r.dragOverlay.measure}),N0=(H=q0.nodeRef.current)!=null?H:p,F0=_?(B=q0.rect)!=null?B:J0:null,s=Boolean(q0.nodeRef.current&&q0.rect),a=q30(s?null:J0),$0=wx(N0?W4(N0):null),t=N30(_?X0!=null?X0:p:null),B0=L30(t),_0=kx(W,{transform:{x:E.x-a.x,y:E.y-a.y,scaleX:1,scaleY:1},activatorEvent:x,active:I,activeNodeRect:J0,containerNodeRect:U0,draggingNodeRect:F0,over:z0.current.over,overlayNodeRect:q0.rect,scrollableAncestors:t,scrollableAncestorRects:B0,windowRect:$0}),P0=i?x$(i,E):null,A0=A30(t),L0=Yx(A0),g=Yx(A0,[J0]),u=x$(_0,L0),e=F0?p90(F0,_0):null,W0=I&&e?K({active:I,collisionRect:e,droppableRects:h,droppableContainers:l,pointerCoordinates:P0}):null,S0=v90(W0,"id"),[h0,v0]=V0.useState(null),T0=s?_0:x$(_0,g),c0=m90(T0,(Q=h0==null?void 0:h0.rect)!=null?Q:null,J0),G1=V0.useRef(null),A1=V0.useCallback((C0,p0)=>{let{sensor:r0,options:o0}=p0;if(T.current==null)return;let D0=C.get(T.current);if(!D0)return;let y0=C0.nativeEvent,W1=new r0({active:T.current,activeNode:D0,event:y0,options:o0,context:z0,onAbort(f0){if(!C.get(f0))return;let{onDragAbort:O1}=f.current,j1={id:f0};O1==null||O1(j1),V({type:"onDragAbort",event:j1})},onPending(f0,t0,O1,j1){if(!C.get(f0))return;let{onDragPending:e0}=f.current,l0={id:f0,constraint:t0,initialCoordinates:O1,offset:j1};e0==null||e0(l0),V({type:"onDragPending",event:l0})},onStart(f0){let t0=T.current;if(t0==null)return;let O1=C.get(t0);if(!O1)return;let{onDragStart:j1}=f.current,x0={activatorEvent:y0,active:{id:t0,data:O1.data,rect:S}};v$.unstable_batchedUpdates(()=>{j1==null||j1(x0),M(H7.Initializing),A({type:M2.DragStart,initialCoordinates:f0,active:t0}),V({type:"onDragStart",event:x0}),R(G1.current),v(y0)})},onMove(f0){A({type:M2.DragMove,coordinates:f0})},onEnd:R1(M2.DragEnd),onCancel:R1(M2.DragCancel)});G1.current=W1;function R1(f0){return async function(){let{active:O1,collisions:j1,over:x0,scrollAdjustedTranslate:e0}=z0.current,l0=null;if(O1&&e0){let{cancelDrop:P1}=f.current;if(l0={activatorEvent:y0,active:O1,collisions:j1,delta:e0,over:x0},f0===M2.DragEnd&&typeof P1==="function"){if(await Promise.resolve(P1(l0)))f0=M2.DragCancel}}T.current=null,v$.unstable_batchedUpdates(()=>{A({type:f0}),M(H7.Uninitialized),v0(null),R(null),v(null),G1.current=null;let P1=f0===M2.DragEnd?"onDragEnd":"onDragCancel";if(l0){let m1=f.current[P1];m1==null||m1(l0),V({type:P1,event:l0})}})}}},[C]),d0=V0.useCallback((C0,p0)=>{return(r0,o0)=>{let D0=r0.nativeEvent,y0=C.get(o0);if(T.current!==null||!y0||D0.dndKit||D0.defaultPrevented)return;let W1={active:y0};if(C0(r0,p0.options,W1)===!0)D0.dndKit={capturedBy:p0.sensor},T.current=o0,A1(r0,p0)}},[C,A1]),k0=U30(Y,d0);D30(Y),$3(()=>{if(J0&&O===H7.Initializing)M(H7.Initialized)},[J0,O]),V0.useEffect(()=>{let{onDragMove:C0}=f.current,{active:p0,activatorEvent:r0,collisions:o0,over:D0}=z0.current;if(!p0||!r0)return;let y0={active:p0,activatorEvent:r0,collisions:o0,delta:{x:u.x,y:u.y},over:D0};v$.unstable_batchedUpdates(()=>{C0==null||C0(y0),V({type:"onDragMove",event:y0})})},[u.x,u.y]),V0.useEffect(()=>{let{active:C0,activatorEvent:p0,collisions:r0,droppableContainers:o0,scrollAdjustedTranslate:D0}=z0.current;if(!C0||T.current==null||!p0||!D0)return;let{onDragOver:y0}=f.current,W1=o0.get(S0),R1=W1&&W1.rect.current?{id:W1.id,rect:W1.rect.current,data:W1.data,disabled:W1.disabled}:null,f0={active:C0,activatorEvent:p0,collisions:r0,delta:{x:D0.x,y:D0.y},over:R1};v$.unstable_batchedUpdates(()=>{v0(R1),y0==null||y0(f0),V({type:"onDragOver",event:f0})})},[S0]),$3(()=>{z0.current={activatorEvent:x,active:I,activeNode:p,collisionRect:e,collisions:W0,droppableRects:h,draggableNodes:C,draggingNode:N0,draggingNodeRect:F0,droppableContainers:j,over:h0,scrollableAncestors:t,scrollAdjustedTranslate:u},S.current={initial:F0,translated:e}},[I,p,W0,e,C,N0,F0,h,j,h0,t,u]),Q30({...n,delta:E,draggingRect:e,pointerCoordinates:P0,scrollableAncestors:t,scrollableAncestorRects:B0});let S1=V0.useMemo(()=>{return{active:I,activeNode:p,activeNodeRect:J0,activatorEvent:x,collisions:W0,containerNodeRect:U0,dragOverlay:q0,draggableNodes:C,droppableContainers:j,droppableRects:h,over:h0,measureDroppableContainers:d,scrollableAncestors:t,scrollableAncestorRects:B0,measuringConfiguration:r,measuringScheduled:o,windowRect:$0}},[I,p,J0,x,W0,U0,q0,C,j,h,h0,d,t,B0,r,o,$0]),K1=V0.useMemo(()=>{return{activatorEvent:x,activators:k0,active:I,activeNodeRect:J0,ariaDescribedById:{draggable:b},dispatch:A,draggableNodes:C,over:h0,measureDroppableContainers:d}},[x,k0,I,J0,A,b,C,h0,d]);return V0.default.createElement(qx.Provider,{value:L},V0.default.createElement(IQ.Provider,{value:K1},V0.default.createElement(Ix.Provider,{value:S1},V0.default.createElement(LK.Provider,{value:c0},U)),V0.default.createElement(C30,{disabled:(z==null?void 0:z.restoreFocus)===!1})),V0.default.createElement(I90,{...z,hiddenTextDescribedById:b}));function z5(){let C0=(y==null?void 0:y.autoScrollEnabled)===!1,p0=typeof G==="object"?G.enabled===!1:G===!1,r0=_&&!C0&&!p0;if(typeof G==="object")return{...G,enabled:r0};return{enabled:r0}}}),w30=V0.createContext(null),Fx="button",S30="Draggable";function xx($){let{id:Z,data:J,disabled:H=!1,attributes:B}=$,Q=jQ(S30),{activators:X,activatorEvent:z,active:G,activeNodeRect:U,ariaDescribedById:Y,draggableNodes:K,over:F}=V0.useContext(IQ),{role:W=Fx,roleDescription:q="draggable",tabIndex:N=0}=B!=null?B:{},D=(G==null?void 0:G.id)===Z,A=V0.useContext(D?LK:w30),[V,L]=_Q(),[O,M]=_Q(),_=V30(X,Z),w=mJ(J);$3(()=>{return K.set(Z,{id:Z,key:Q,node:V,activatorNode:O,data:w}),()=>{let E=K.get(Z);if(E&&E.key===Q)K.delete(Z)}},[K,Z]);let C=V0.useMemo(()=>({role:W,tabIndex:N,"aria-disabled":H,"aria-pressed":D&&W===Fx?!0:void 0,"aria-roledescription":q,"aria-describedby":Y.draggable}),[H,W,N,D,q,Y.draggable]);return{active:G,activatorEvent:z,activeNodeRect:U,attributes:C,isDragging:D,listeners:H?void 0:_,node:V,over:F,setNodeRef:L,setActivatorNodeRef:M,transform:A}}function R30(){return V0.useContext(Ix)}var I30="Droppable",k30={timeout:25};function hx($){let{data:Z,disabled:J=!1,id:H,resizeObserverConfig:B}=$,Q=jQ(I30),{active:X,dispatch:z,over:G,measureDroppableContainers:U}=V0.useContext(IQ),Y=V0.useRef({disabled:J}),K=V0.useRef(!1),F=V0.useRef(null),W=V0.useRef(null),{disabled:q,updateMeasurementsFor:N,timeout:D}={...k30,...B},A=mJ(N!=null?N:H),V=V0.useCallback(()=>{if(!K.current){K.current=!0;return}if(W.current!=null)clearTimeout(W.current);W.current=setTimeout(()=>{U(Array.isArray(A.current)?A.current:[A.current]),W.current=null},D)},[D]),L=VK({callback:V,disabled:q||!X}),O=V0.useCallback((C,E)=>{if(!L)return;if(E)L.unobserve(E),K.current=!1;if(C)L.observe(C)},[L]),[M,_]=_Q(O),w=mJ(Z);return V0.useEffect(()=>{if(!L||!M.current)return;L.disconnect(),K.current=!1,L.observe(M.current)},[M,L]),V0.useEffect(()=>{return z({type:M2.RegisterDroppable,element:{id:H,key:Q,disabled:J,node:M,rect:F,data:w}}),()=>z({type:M2.UnregisterDroppable,key:Q,id:H})},[H]),V0.useEffect(()=>{if(J!==Y.current.disabled)z({type:M2.SetDroppableDisabled,id:H,key:Q,disabled:J}),Y.current.disabled=J},[H,Q,J,z]),{active:X,rect:F,isOver:(G==null?void 0:G.id)===H,node:M,over:G,setNodeRef:_}}function y30($){let{animation:Z,children:J}=$,[H,B]=V0.useState(null),[Q,X]=V0.useState(null),z=OQ(J);if(!J&&!H&&z)B(z);return $3(()=>{if(!Q)return;let G=H==null?void 0:H.key,U=H==null?void 0:H.props.id;if(G==null||U==null){B(null);return}Promise.resolve(Z(U,Q)).then(()=>{B(null)})},[Z,H,Q]),V0.default.createElement(V0.default.Fragment,null,J,H?V0.cloneElement(H,{ref:X}):null)}var x30={x:0,y:0,scaleX:1,scaleY:1};function h30($){let{children:Z}=$;return V0.default.createElement(IQ.Provider,{value:Rx},V0.default.createElement(LK.Provider,{value:x30},Z))}var v30={position:"fixed",touchAction:"none"},f30=($)=>{return FK($)?"transform 250ms ease":void 0},g30=V0.forwardRef(($,Z)=>{let{as:J,activatorEvent:H,adjustScale:B,children:Q,className:X,rect:z,style:G,transform:U,transition:Y=f30}=$;if(!z)return null;let K=B?U:{...U,scaleX:1,scaleY:1},F={...v30,width:z.width,height:z.height,top:z.top,left:z.left,transform:fJ.Transform.toString(K),transformOrigin:B&&H?y90(H,z):void 0,transition:typeof Y==="function"?Y(H):Y,...G};return V0.default.createElement(J,{className:X,style:F,ref:Z},Q)}),m30=($)=>(Z)=>{let{active:J,dragOverlay:H}=Z,B={},{styles:Q,className:X}=$;if(Q!=null&&Q.active)for(let[z,G]of Object.entries(Q.active)){if(G===void 0)continue;B[z]=J.node.style.getPropertyValue(z),J.node.style.setProperty(z,G)}if(Q!=null&&Q.dragOverlay)for(let[z,G]of Object.entries(Q.dragOverlay)){if(G===void 0)continue;H.node.style.setProperty(z,G)}if(X!=null&&X.active)J.node.classList.add(X.active);if(X!=null&&X.dragOverlay)H.node.classList.add(X.dragOverlay);return function(){for(let[G,U]of Object.entries(B))J.node.style.setProperty(G,U);if(X!=null&&X.active)J.node.classList.remove(X.active)}},u30=($)=>{let{transform:{initial:Z,final:J}}=$;return[{transform:fJ.Transform.toString(Z)},{transform:fJ.Transform.toString(J)}]},p30={duration:250,easing:"ease",keyframes:u30,sideEffects:m30({styles:{active:{opacity:"0"}}})};function c30($){let{config:Z,draggableNodes:J,droppableContainers:H,measuringConfiguration:B}=$;return PQ((Q,X)=>{if(Z===null)return;let z=J.get(Q);if(!z)return;let G=z.node.current;if(!G)return;let U=Sx(X);if(!U)return;let{transform:Y}=W4(X).getComputedStyle(X),K=Vx(Y);if(!K)return;let F=typeof Z==="function"?Z:d30(Z);return Tx(G,B.draggable.measure),F({active:{id:Q,data:z.data,node:G,rect:B.draggable.measure(G)},draggableNodes:J,dragOverlay:{node:X,rect:B.dragOverlay.measure(U)},droppableContainers:H,measuringConfiguration:B,transform:K})})}function d30($){let{duration:Z,easing:J,sideEffects:H,keyframes:B}={...p30,...$};return(Q)=>{let{active:X,dragOverlay:z,transform:G,...U}=Q;if(!Z)return;let Y={x:z.rect.left-X.rect.left,y:z.rect.top-X.rect.top},K={scaleX:G.scaleX!==1?X.rect.width*G.scaleX/z.rect.width:1,scaleY:G.scaleY!==1?X.rect.height*G.scaleY/z.rect.height:1},F={x:G.x-Y.x,y:G.y-Y.y,...K},W=B({...U,active:X,dragOverlay:z,transform:{initial:G,final:F}}),[q]=W,N=W[W.length-1];if(JSON.stringify(q)===JSON.stringify(N))return;let D=H==null?void 0:H({active:X,dragOverlay:z,...U}),A=z.node.animate(W,{duration:Z,easing:J,fill:"forwards"});return new Promise((V)=>{A.onfinish=()=>{D==null||D(),V()}})}}var Wx=0;function l30($){return V0.useMemo(()=>{if($==null)return;return Wx++,Wx},[$])}var vx=V0.default.memo(($)=>{let{adjustScale:Z=!1,children:J,dropAnimation:H,style:B,transition:Q,modifiers:X,wrapperElement:z="div",className:G,zIndex:U=999}=$,{activatorEvent:Y,active:K,activeNodeRect:F,containerNodeRect:W,draggableNodes:q,droppableContainers:N,dragOverlay:D,over:A,measuringConfiguration:V,scrollableAncestors:L,scrollableAncestorRects:O,windowRect:M}=R30(),_=V0.useContext(LK),w=l30(K==null?void 0:K.id),C=kx(X,{activatorEvent:Y,active:K,activeNodeRect:F,containerNodeRect:W,draggingNodeRect:D.rect,over:A,overlayNodeRect:D.rect,scrollableAncestors:L,scrollableAncestorRects:O,transform:_,windowRect:M}),E=DL(F),j=c30({config:H,draggableNodes:q,droppableContainers:N,measuringConfiguration:V}),k=E?D.setRef:void 0;return V0.default.createElement(h30,null,V0.default.createElement(y30,{animation:j},K&&w?V0.default.createElement(g30,{key:w,id:K.id,ref:k,as:z,activatorEvent:Y,adjustScale:Z,className:G,transition:Q,rect:E,style:{zIndex:U,...B},transform:C},J):null))});var f$=P(c(),1),i30={start:[B5.Space],cancel:[B5.Esc],end:[B5.Space,B5.Tab]};function r30($,Z,J){let H=$.indexOf(Z),B=$.indexOf(J);if(H<0||B<0||H===B)return $;let Q=[...$],[X]=Q.splice(H,1);return Q.splice(B,0,X),Q}function MK({items:$,getId:Z,className:J,itemClassName:H,dragDisabled:B=!1,isItemDragDisabled:Q,onReorder:X,renderItem:z,renderPlaceholder:G,renderOverlay:U}){let Y=Nx(NL(RQ,{activationConstraint:{distance:4}}),NL(SQ,{keyboardCodes:i30})),[K,F]=B7.useState(null),[W,q]=B7.useState(null),N=B7.useRef(null),D=B7.useMemo(()=>$.map(Z),[$,Z]),A=B7.useMemo(()=>new Map($.map((E)=>[Z(E),E])),[$,Z]),L=(K&&W?W:D).map((E)=>A.get(E)).filter((E)=>Boolean(E)),O=K?A.get(K):void 0,M=Q?$.filter((E)=>!Q(E)).length:$.length,_=B||M<2;return f$.jsxs(yx,{sensors:Y,collisionDetection:Ax,onDragStart:(E)=>{let j=$.map(Z);F(String(E.active.id)),N.current=j,q(j)},onDragOver:(E)=>{let j=String(E.active.id),k=E.over?String(E.over.id):void 0,S=N.current;if(!k||k===j||!S)return;let I=r30(S,j,k);if(I===S)return;N.current=I,q(I)},onDragCancel:()=>{N.current=null,F(null),q(null)},onDragEnd:(E)=>{let j=String(E.active.id),k=N.current;if(N.current=null,F(null),q(null),!k||k.join("|")===D.join("|"))return;if(!k.includes(j))return;X(k)},children:[f$.jsx("div",{className:J,children:L.map((E)=>f$.jsx(a30,{id:Z(E),item:E,disabled:_||Q?.(E)===!0,itemClassName:H,renderItem:z,renderPlaceholder:G},Z(E)))}),f$.jsx(vx,{dropAnimation:null,children:O&&U?U(O):null})]})}function a30({id:$,item:Z,disabled:J,itemClassName:H,renderItem:B,renderPlaceholder:Q}){let{setNodeRef:X,isOver:z}=hx({id:$,disabled:J}),{attributes:G,listeners:U,setNodeRef:Y,isDragging:K}=xx({id:$,disabled:J,attributes:{roleDescription:"sortable item"}}),F=(q)=>{X(q),Y(q)},W={isDragging:K,isOver:z,dragDisabled:J,dragHandleProps:J?{}:{...G,...U}};return f$.jsxs(Y5.div,{layout:!0,ref:F,className:Q0("relative",H?.(Z,W)),transition:{type:"spring",duration:0.25,bounce:0},children:[K&&Q?.(Z),B(Z,W)]})}var z1=P(c(),1),o30="https://mlfrg.notion.site/3c678a44b6788042b734d775dd2e935e?pvs=105";function n30($){return Q0(z9({variant:"ghost",size:"icon"}),$&&"bg-accent text-accent-foreground")}function PK({children:$,showWorkspaces:Z=!0}){let{data:J}=yU(),H=$1();return L2((B)=>{if(B.type==="workspace:updated"||B.type==="theme:updated"||B.type==="workspaces-list:updated"){if(B.type!=="theme:updated"&&B.origin===a9)return;H.invalidateQueries({queryKey:O0.all,exact:!0})}}),z1.jsxs("div",{className:"flex h-dvh bg-muted transition-colors duration-100 ease-out motion-reduce:transition-none",children:[z1.jsx(s30,{workspaces:Z?J??[]:[]}),z1.jsx("main",{className:"flex min-w-0 flex-1 flex-col",children:$})]})}function s30({workspaces:$}){let Z=zR();return z1.jsx(cG,{delay:500,children:z1.jsxs("aside",{className:"flex h-full shrink-0 flex-col items-center gap-4 px-2 py-5 [font-family:var(--default-sans)]",children:[z1.jsxs(i1,{children:[z1.jsx(r1,{render:z1.jsx(a7,{href:"/","aria-label":"Home",className:n30,children:z1.jsx(ux,{stroke:1.5})})}),z1.jsx(a1,{side:"right",children:"Home"})]}),z1.jsx("nav",{className:"flex max-h-full min-h-0 w-14 flex-1 flex-col items-center justify-center gap-4",children:$.length>0&&z1.jsxs(z1.Fragment,{children:[z1.jsx("div",{className:"no-scrollbar min-h-0 scroll-fade overflow-y-auto [--scroll-fade-reveal:16px]",children:z1.jsx(MK,{items:$,getId:(J)=>J.id,className:"flex flex-col gap-4",onReorder:(J)=>Z.mutate(J),renderPlaceholder:()=>z1.jsx("div",{className:"pointer-events-none absolute top-0 left-1 size-12 rounded-xl bg-accent"}),renderOverlay:(J)=>z1.jsx(fx,{workspace:J,dragOverlay:!0}),renderItem:(J,H)=>z1.jsx(fx,{workspace:J,dragState:H})})}),z1.jsx("div",{className:"shrink-0",children:z1.jsxs(i1,{children:[z1.jsx(LQ,{trigger:z1.jsx(r1,{render:z1.jsx(M0,{type:"button",variant:"ghost",size:"icon-lg","aria-label":"Create new workspace",className:"text-muted-foreground hover:text-foreground",children:z1.jsx(a2,{"data-icon":"inline-start",stroke:1.5})})})}),z1.jsx(a1,{side:"right",children:"Create new workspace"})]})})]})}),z1.jsx("div",{className:"size-8 shrink-0",children:z1.jsx(t30,{})})]})})}function t30(){let{demo:$}=a4(),Z=qR();if($)return z1.jsxs(i1,{children:[z1.jsx(EJ,{trigger:z1.jsx(r1,{render:z1.jsx(M0,{size:"icon","aria-label":"Set up Moi",children:z1.jsx(mx,{stroke:1.5})})})}),z1.jsx(a1,{side:"right",children:"Set up Moi"})]});if(Z.status==="loading")return null;if(Z.status==="available")return z1.jsx(NR,{...Z.button});return z1.jsx(e30,{})}function e30(){return z1.jsxs(i1,{children:[z1.jsx(r1,{render:z1.jsx(M0,{render:z1.jsx("a",{href:o30,target:"_blank",rel:"noreferrer"}),variant:"ghost",size:"icon","aria-label":"Leave feedback",className:"text-muted-foreground hover:text-foreground",children:z1.jsx(gx,{stroke:1.5})})}),z1.jsx(a1,{side:"right",children:"Leave feedback"})]})}function fx({workspace:$,dragOverlay:Z=!1,dragState:J}){let[H]=m4(),B=`/workspace/${$.id}`,Q=I$($),X=H===B||H.startsWith(`${B}/`),z=z1.jsx("div",{className:Q0(z9({variant:"ghost",size:"icon-lg"}),"pointer-events-none size-12 transition-[border-radius,background-color,color] duration-100 ease-out motion-reduce:transition-none",Z?"bg-background shadow-lg":"group-hover:bg-accent group-hover:text-accent-foreground group-focus-visible:ring-3 group-focus-visible:ring-ring/50",X&&!Z&&"bg-accent text-accent-foreground"),children:z1.jsx(Z7,{icon:$.icon,workspaceType:$.type,workspaceTheme:$.theme,className:"size-7 shrink-0 rounded-md transition-[border-radius] duration-100 ease-out motion-reduce:transition-none"})}),G=z1.jsx("span",{className:"mt-0.5 line-clamp-2 w-full text-center text-[11px] leading-snug font-medium text-ellipsis text-foreground",children:Q});if(Z)return z1.jsxs("span",{className:"flex w-14 flex-col items-center",children:[z,G]});return z1.jsxs(a7,{href:B,"aria-label":Q,onClick:(U)=>{if(J?.isDragging)U.preventDefault()},className:Q0("group flex w-14 flex-col items-center rounded-xl outline-none",J?.isDragging&&"invisible"),...J?.dragHandleProps,children:[z,z1.jsxs(i1,{children:[z1.jsx(r1,{render:G}),z1.jsx(a1,{side:"right",children:Q})]})]})}var mh=P(m(),1);var px=P(m(),1);var dJ=P(c(),1);function cx({choice:$,isPending:Z,errorMessage:J,onTypeChange:H,onSubmit:B,onReset:Q}){let[X,z]=px.useState(!0),G=vU(),U=G.isPending||G.isFetching,Y=G.isError?void 0:G.data?.installed,K=XK(Y,$.workspace.types),F=!U&&!Y?"Could not check installed agents.":void 0,W=!Z&&!U&&!F&&K.some((D)=>D.type===$.selectedType&&!D.disabled);function q(D){if(!D&&Z)return;z(D)}function N(D){if(!D)Q()}return dJ.jsx(f6,{open:X,onOpenChange:q,onOpenChangeComplete:N,children:dJ.jsx(UK,{showCloseButton:!Z,children:dJ.jsx(GK,{title:`Import ${I$($.workspace)}`,selectedType:$.selectedType,options:K,isLoading:U&&!Y,isPending:Z||U||Boolean(F),errorMessage:F??J,secondaryAction:dJ.jsx(sB,{render:dJ.jsx(M0,{variant:"secondary"}),disabled:Z,children:"Cancel"}),primaryLabel:"Add workspace",pendingLabel:Z?"Adding…":void 0,onTypeChange:H,onSubmit:()=>{if(W)B()}})})})}var dx=P(m(),1);function $60($){return $.types[0]??CJ[0]}function lx({onSuccess:$}){let Z=DR(),[J,H]=dx.useState(null);function B(G){Z.reset(),H({workspace:G,selectedType:$60(G)})}function Q(G){H((U)=>U?{...U,selectedType:G}:U)}function X(){if(!J||Z.isPending)return;Z.mutate({path:J.workspace.path,type:J.selectedType},{onSuccess:$})}function z(){H(null),Z.reset()}return{choice:J,isPending:Z.isPending,error:Z.error,startImport:B,selectType:Q,submit:X,reset:z}}var yQ=P(m(),1);var xQ=P(c(),1),Z60=[["OOOOO","O.O.O","O.O.O"],["OOO","O.O","OOO"],["O","O","O"]],Q7=10,_K=3,J60=2.5,H60={O:1,o:0.5,".":0},B60=3000,Q60=2,ix=3,X7=3,rx=0.001,g$={courantSquared:0.14,damping:0.976,driveAmplitude:1.4,driveFrequency:0.027,gain:0.65,fadeIn:0.36,fadeOut:0.1};function X60($){let Z=Math.max(...$.map((Q)=>Q.length)),J=Z*Q7+(Z-1)*_K,H=$.length*Q7+($.length-1)*_K,B=[];return $.forEach((Q,X)=>{Array.from(Q).forEach((z,G)=>{let U=H60[z];if(U===void 0)return;let Y=G*(Q7+_K),K=X*(Q7+_K);B.push({x:Y,y:K,centerX:Y+Q7/2,centerY:K+Q7/2,targetOpacity:U})})}),{width:J,height:H,fieldColumns:Math.round(J/X7)+1,fieldRows:Math.round(H/X7)+1,pixels:B}}var z60=Z60.map(X60);function kQ($,Z,J){return $<Z?Z:$>J?J:$}function G60($){return $<0.5?2*$*$:1-(-2*$+2)**2/2}class ax{rects;svg;geometry;animationFrame=0;running=!1;intro=!0;introStartedAt=-1;field;previousField;nextField;pointerActive=!1;pointerX=0;pointerY=0;activation=0;constructor($,Z,J){this.rects=$,this.svg=Z,this.geometry=J;let H=J.fieldColumns*J.fieldRows;this.field=new Float32Array(H),this.previousField=new Float32Array(H),this.nextField=new Float32Array(H)}start(){this.seedImpulse(),this.activation=1,this.resume()}stop(){cancelAnimationFrame(this.animationFrame),this.running=!1}handlePointerMove=($)=>{let Z=this.svg.getBoundingClientRect();if(!Z.width||!Z.height)return;if(this.pointerActive=$.clientX>=Z.left&&$.clientX<=Z.right&&$.clientY>=Z.top&&$.clientY<=Z.bottom,this.pointerActive)this.pointerX=($.clientX-Z.left)/Z.width*this.geometry.width,this.pointerY=($.clientY-Z.top)/Z.height*this.geometry.height,this.resume()};seedImpulse(){let $=Math.round(this.geometry.width/2/X7),Z=Math.round(this.geometry.height/2/X7),J=2*ix*ix;for(let H=0;H<this.geometry.fieldRows;H++)for(let B=0;B<this.geometry.fieldColumns;B++){let Q=(B-$)**2+(H-Z)**2,X=Q60*Math.exp(-Q/J),z=H*this.geometry.fieldColumns+B;this.field[z]=X,this.previousField[z]=X}}resume(){if(this.running)return;this.running=!0,this.animationFrame=requestAnimationFrame(this.animate)}animate=($)=>{if(this.stepWave(),this.pointerActive)this.driveWave($);if(this.intro&&!this.pointerActive){if(this.introStartedAt<0)this.introStartedAt=$;let J=($-this.introStartedAt)/B60;if(this.activation=1-G60(Math.min(1,J)),J>=1)this.intro=!1}else{this.intro=!1;let J=this.pointerActive?1:0,H=this.pointerActive?g$.fadeIn:g$.fadeOut;this.activation+=(J-this.activation)*H}let Z=this.renderWave();if(this.intro||this.pointerActive||this.activation>rx||Z>rx){this.animationFrame=requestAnimationFrame(this.animate);return}this.running=!1,this.activation=0,this.renderTargets()};stepWave(){let{fieldColumns:$,fieldRows:Z}=this.geometry;for(let H=1;H<Z-1;H++)for(let B=1;B<$-1;B++){let Q=H*$+B,X=this.field[Q-1]+this.field[Q+1]+this.field[Q-$]+this.field[Q+$]-4*this.field[Q];this.nextField[Q]=(2*this.field[Q]-this.previousField[Q]+g$.courantSquared*X)*g$.damping}let J=this.previousField;this.previousField=this.field,this.field=this.nextField,this.nextField=J}driveWave($){let Z=kQ(Math.round(this.pointerX/X7),1,this.geometry.fieldColumns-2),J=kQ(Math.round(this.pointerY/X7),1,this.geometry.fieldRows-2);this.field[J*this.geometry.fieldColumns+Z]=g$.driveAmplitude*Math.sin($*g$.driveFrequency)}sampleField($,Z){let J=kQ($/X7,0,this.geometry.fieldColumns-1),H=kQ(Z/X7,0,this.geometry.fieldRows-1),B=Math.floor(J),Q=Math.floor(H),X=Math.min(B+1,this.geometry.fieldColumns-1),z=Math.min(Q+1,this.geometry.fieldRows-1),G=J-B,U=H-Q,{fieldColumns:Y}=this.geometry,K=this.field[Q*Y+B],F=this.field[Q*Y+X],W=this.field[z*Y+B],q=this.field[z*Y+X];return(K*(1-G)+F*G)*(1-U)+(W*(1-G)+q*G)*U}renderWave(){let $=0;return this.geometry.pixels.forEach((Z,J)=>{let H=this.rects[J];if(!H)return;let B=this.sampleField(Z.centerX,Z.centerY);$=Math.max($,Math.abs(B));let Q=kQ(0.5+B*g$.gain,0,1),X=Z.targetOpacity*(1-this.activation)+Q*this.activation;H.setAttribute("opacity",X.toFixed(3))}),$}renderTargets(){this.geometry.pixels.forEach(($,Z)=>{this.rects[Z]?.setAttribute("opacity",String($.targetOpacity))})}}function U60({geometry:$}){let Z=yQ.useRef([]),J=yQ.useRef(null);return yQ.useEffect(()=>{let H=J.current;if(!H||window.matchMedia("(prefers-reduced-motion: reduce)").matches)return;let B=new ax(Z.current,H,$);return B.start(),window.addEventListener("pointermove",B.handlePointerMove),()=>{B.stop(),window.removeEventListener("pointermove",B.handlePointerMove)}},[$]),xQ.jsx("svg",{ref:J,className:"h-8 w-auto",viewBox:`0 0 ${$.width} ${$.height}`,fill:"currentColor","aria-hidden":"true",children:$.pixels.map((H,B)=>xQ.jsx("rect",{ref:(Q)=>{Z.current[B]=Q},x:H.x,y:H.y,width:Q7,height:Q7,rx:J60,opacity:H.targetOpacity},`${H.x}-${H.y}`))})}function ox({className:$}){return xQ.jsx("div",{role:"img","aria-label":"Moi",className:Q0("flex items-center gap-2 text-accent",$),children:z60.map((Z,J)=>xQ.jsx(U60,{geometry:Z},J))})}function VL({l:$,c:Z,h:J}){let H=J*Math.PI/180,B=Z*Math.cos(H),Q=Z*Math.sin(H),X=$+0.3963377774*B+0.2158037573*Q,z=$-0.1055613458*B-0.0638541728*Q,G=$-0.0894841775*B-1.291485548*Q,U=X*X*X,Y=z*z*z,K=G*G*G;return[4.0767416621*U-3.3077115913*Y+0.2309699292*K,-1.2684380046*U+2.6097574011*Y-0.3413193965*K,-0.0041960863*U-0.7034186147*Y+1.707614701*K]}var nx=($)=>$.every((Z)=>Z>=-0.0001&&Z<=1.0001);function $h($){let Z=VL($);if(!nx(Z)){let J=0,H=$.c;for(let B=0;B<12;B++){let Q=(J+H)/2;if(nx(VL({...$,c:Q})))J=Q;else H=Q}Z=VL({...$,c:J})}return Z.map((J)=>Math.min(1,Math.max(0,J)))}function sx($){let[Z,J,H]=$h($);return 0.2126*Z+0.7152*J+0.0722*H}function hQ($,Z){let J=sx($),H=sx(Z);return(Math.max(J,H)+0.05)/(Math.min(J,H)+0.05)}function tx($,Z,J){if(hQ($,Z)>=J)return $;let H=$.l>=Z.l?1:-1;for(let X of[H,-H]){let z={...$};for(let G=0;G<60;G++){if(z.l=Math.min(1,Math.max(0,z.l+X*0.02)),hQ(z,Z)>=J)return z;if(z.l===0||z.l===1)break}}let B={...$,l:0,c:0},Q={...$,l:1,c:0};return hQ(B,Z)>=hQ(Q,Z)?B:Q}function OK($){return"#"+$h($).map((Z)=>{let J=Z<=0.0031308?12.92*Z:1.055*Math.pow(Z,0.4166666666666667)-0.055;return Math.round(J*255).toString(16).padStart(2,"0")}).join("")}function lJ($){let Z=parseInt($.slice(1),16),[J,H,B]=[Z>>16&255,Z>>8&255,Z&255].map((Y)=>{let K=Y/255;return K<=0.04045?K/12.92:Math.pow((K+0.055)/1.055,2.4)}),Q=Math.cbrt(0.4122214708*J+0.5363325363*H+0.0514459929*B),X=Math.cbrt(0.2119034982*J+0.6806995451*H+0.1073969566*B),z=Math.cbrt(0.0883024619*J+0.2817188376*H+0.6299787005*B),G=1.9779984951*Q-2.428592205*X+0.4505937099*z,U=0.0259040371*Q+0.7827717662*X-0.808675766*z;return{l:0.2104542553*Q+0.793617785*X-0.0040720468*z,c:Math.hypot(G,U),h:Math.atan2(U,G)*180/Math.PI}}function Y60($,Z,J){let H=(Y)=>Y*Math.PI/180,B=$.c*Math.cos(H($.h)),Q=$.c*Math.sin(H($.h)),X=Z.c*Math.cos(H(Z.h)),z=Z.c*Math.sin(H(Z.h)),G=B+(X-B)*J,U=Q+(z-Q)*J;return{l:$.l+(Z.l-$.l)*J,c:Math.hypot(G,U),h:Math.atan2(U,G)*180/Math.PI}}var jK=($,Z,J)=>OK(Y60(lJ($),lJ(Z),J));var K60={h:12,l:0.84,pull:0.4,c:0.1};var ex=4.55;function F60($,Z,J){let H=lJ($),B=lJ(Z),Q={l:H.l+(J.l-H.l)*J.pull,c:Math.max(H.c,J.c),h:J.h};Q=tx(Q,W60,q60);let X=tx(B,Q,ex),z=X.l>=Q.l?1:-1,G=OK(Q);for(let U=0;U<40;U++){let Y=OK(X),K=1/0;for(let W=0;W<=10;W++){let q=W/10;K=Math.min(K,hQ(lJ(jK(Z,Y,q)),lJ(jK($,G,q))))}if(K>=ex)return[G,Y];let F=Math.min(1,Math.max(0,X.l+z*0.02));if(F===X.l)return[G,Y];X={...X,l:F}}return[G,OK(X)]}var W60={l:0.145,c:0,h:0},q60=1.5;var LL={esx:1,esy:1,tilt:0,edy:0,edx:0,esx2:0,esy2:0,tilt2:0,edy2:0,lock:0,heat:0,shake:0,rock:0,bdy:0},Zh=($)=>String(Math.round($*1000)/1000);function Z3($,Z){return{l:{...$,eyes:$.eyes.map((J,H)=>({...J,cx:J.cx+Z.edx*(H?1:-1),cy:J.cy+Z.edy+(H?Z.edy2:0),rx:J.rx*(Z.esx+(H?Z.esx2:0)),ry:J.ry*(Z.esy+(H?Z.esy2:0)),rot:J.rot*(1-Z.lock)+(Z.tilt+(H?Z.tilt2:0))*(H?1:-1)}))},wrap:Z.bdy!==0?`translate(0 ${Zh(Z.bdy)})`:""}}function J3($){let Z={};for(let J in LL){if(J==="heat")continue;let H=$[J];if(H!==LL[J])Z["--mo-"+J]=Zh(H)}return Z}function N60($,Z,J){let[H,B]=F60($.head,$.eye,J);return{...$,head:jK($.head,H,Z.heat),eye:jK($.eye,B,Z.heat)}}var Jh={p:LL,vars:J3,bake:Z3},Hh={p:{esx:1.72,esy:0.3,tilt:8,edy:-1.5,edx:1.5,esx2:0.08,esy2:0.05,tilt2:-16,edy2:0,lock:1,heat:0,shake:0,rock:0,bdy:-2.2},vars:J3,bake:Z3},Bh={p:{esx:0.6,esy:0.56,tilt:26,edy:3.6,edx:1.9,esx2:-0.05,esy2:-0.07,tilt2:-7,edy2:0,lock:1,heat:0,shake:0,rock:0,bdy:2.6},vars:J3,bake:Z3};var Qh={p:{esx:1.34,esy:1.2,tilt:-6,edy:-1.05,edx:0.5,esx2:0.05,esy2:0.07,tilt2:3,edy2:0,lock:1,heat:0,shake:0,rock:0,bdy:-1.4},vars:J3,bake:Z3},Xh={p:{esx:1.32,esy:0.76,tilt:5,edy:-0.6,edx:0.8,esx2:0.26,esy2:-0.56,tilt2:-11,edy2:0,lock:1,heat:0,shake:0,rock:0,bdy:-1.1},vars:J3,bake:Z3},zh={p:{esx:1.14,esy:0.22,tilt:0,edy:2.4,edx:0.3,esx2:-0.04,esy2:0.03,tilt2:4,edy2:0,lock:1,heat:0,shake:0,rock:0,bdy:1.2},vars:J3,bake:Z3},Gh={p:{esx:1.3,esy:0.42,tilt:18,edy:-0.5,edx:0.5,esx2:0.06,esy2:-0.06,tilt2:-36,edy2:0,lock:1,heat:0,shake:0,rock:0,bdy:-1},vars:J3,bake:Z3},Uh={p:{esx:0.95,esy:1.02,tilt:4,edy:-0.2,edx:0.3,esx2:0.24,esy2:-0.44,tilt2:-18,edy2:0,lock:1,heat:0,shake:0,rock:0,bdy:0},vars:J3,bake:Z3};var Yh={p:{esx:0.62,esy:0.5,tilt:10,edy:1.4,edx:-0.2,esx2:-0.05,esy2:-0.04,tilt2:-8,edy2:0,lock:1,heat:0.55,shake:0,rock:0,bdy:0.9},vars:J3,bake:Z3,tint:($,Z)=>N60($,Z,K60)};var Kh={p:{esx:1.15,esy:0.62,tilt:0,edy:4.2,edx:0.4,esx2:0.02,esy2:0.06,tilt2:0,edy2:-8.4,lock:1,heat:0,shake:0,rock:0.8,bdy:-0.4},vars:J3,bake:Z3};var Fh=P(c(),1),A60="moi-agent",D60={default:{head:"var(--foreground)",eye:"var(--background)"},primary:{head:"var(--primary)",eye:"var(--primary-foreground)"},secondary:{head:"var(--accent)",eye:"var(--accent-foreground)"}},V60={idle:Jh,happy:Hh,sad:Bh,surprised:Qh,wink:Xh,sleepy:zh,smug:Gh,unsure:Uh,shy:Yh,thinking:Kh};function H3({size:$=56,preset:Z=t9.agent,animated:J=!1,color:H="default",expression:B="idle",className:Q}){return Fh.jsx(YU,{name:A60,size:$,animate:J?"always":"hover",palette:D60[H],expression:B?V60[B]:void 0,className:Q0("shrink-0",Q),traits:NQ[Z].traits})}var rJ={};I5(rJ,{Trigger:()=>jh,Root:()=>_h,Panel:()=>Sh});var vQ=P(m(),1);var TK=P(m(),1);function Wh($){let{open:Z,defaultOpen:J=!1,onOpenChange:H,disabled:B}=$,[Q,X]=F4({controlled:Z,default:J,name:"Collapsible",state:"open"}),{mounted:z,setMounted:G,transitionStatus:U}=S2(Q,!0,!0),Y=s0(),[K,F]=TK.useState(),W=K===null?void 0:K??Y,q=Y0((N)=>{let D=!Q,A=w0(K0.triggerPress,N.nativeEvent);if(H(D,A),A.isCanceled)return;X(D)});return TK.useMemo(()=>({defaultPanelId:Y,disabled:B,handleTrigger:q,mounted:z,open:Q,panelId:W,setMounted:G,setOpen:X,setPanelIdState:F,transitionStatus:U}),[Y,B,q,z,Q,W,G,X,F,U])}var CK=P(m(),1),ML=CK.createContext(void 0);function EK(){let $=CK.useContext(ML);if($===void 0)throw Error(I0(15));return $}var qh="data-open",Nh="data-closed",Ah=X8.startingStyle,Bt0=X8.endingStyle;var Vh="data-panel-open";var M60={[qh]:""},P60={[Nh]:""},Lh={open($){if($)return{[Vh]:""};return null}},Mh={open($){if($)return M60;return P60}};var bK={...Mh,...G2};var Ph=P(c(),1),_h=vQ.forwardRef(function(Z,J){let{render:H,className:B,defaultOpen:Q=!1,disabled:X=!1,onOpenChange:z,open:G,style:U,...Y}=Z,K=Y0(z),F=Wh({open:G,defaultOpen:Q,onOpenChange:K,disabled:X}),W=vQ.useMemo(()=>({open:F.open,disabled:F.disabled,transitionStatus:F.transitionStatus}),[F.open,F.disabled,F.transitionStatus]),q=vQ.useMemo(()=>({...F,onOpenChange:K,state:W}),[F,K,W]),N=G0("div",Z,{state:W,ref:J,props:Y,stateAttributesMapping:bK});return Ph.jsx(ML.Provider,{value:q,children:N})});var Oh=P(m(),1);var _60={...Lh,...G2},jh=Oh.forwardRef(function(Z,J){let{panelId:H,open:B,handleTrigger:Q,state:X,disabled:z}=EK(),{className:G,disabled:U=z,render:Y,nativeButton:K=!0,style:F,...W}=Z,{getButtonProps:q,buttonRef:N}=w5({disabled:U,focusableWhenDisabled:!0,native:K});return G0("button",Z,{state:X,ref:[J,N],props:[{"aria-controls":B?H:void 0,"aria-expanded":B,onClick:Q},W,q],stateAttributesMapping:_60})});var PL=P(m(),1);var R4=P(m(),1);var fQ={height:void 0,width:void 0};function Ch($){let{externalRef:Z,hiddenUntilFound:J,id:H,keepMounted:B,mounted:Q,onOpenChange:X,open:z,setMounted:G,setOpen:U,transitionStatus:Y}=$,K=R4.useRef(null),F=R4.useRef(null),[W,q]=R4.useState(fQ),N=R4.useRef(fQ),D=R4.useRef(!1),A=R4.useRef(z),V=R4.useRef(!1),[L,O]=R4.useState(!1),M=R4.useRef(null),_=p2(Z,K),w=W5(z),C=d4(K),E=!z&&!Q,j=L?"idle":Y,k=z&&(A.current||V.current),S=!z&&Q&&F.current==="css-animation"&&W.height===void 0&&W.width===void 0?N.current:W,I=J&&E&&F.current!=="css-animation",T=Y0((f,b=!0)=>{if(b)N.current=f;q(f)}),y=Y0(()=>{M.current?.(),M.current=null}),R=Y0((f)=>{y(),M.current=()=>{M.current=null,f()}}),x=Y0(()=>{if(z&&Q&&F.current==="css-animation")V.current=!0});H0(()=>{if(!L||Y==="starting")return;O(!1)},[L,Y]),R4.useEffect(()=>{return()=>{x(),y()}},[x,y]),H0(()=>{let f=K.current;if(!f)return;if(!z&&M.current)y();let b=O60(f,k);if(F.current=b,z&&Y==="idle"&&A.current&&b==="css-animation"){N.current=iJ(f);return}if(z&&Y==="starting"){let h=D.current;if(D.current=!1,b==="none"){T(iJ(f)),O(!0);return}if(b==="css-transition"){let p=j60(f);if(T(iJ(f)),!h)return p;let i=wK(f,"transition-duration","0s");return R(i),O(!0),p}T(iJ(f));let d=wK(f,"animation-name","none");if(!h){d();return}let o=wK(f,"animation-duration","0s");d(),R(o),O(!0);return}if(!z&&Q&&(Y==="idle"||Y==="starting")){if(A.current=!1,V.current=!1,b==="none"){T(fQ,!1),G(!1);return}T(iJ(f));return}if(Y!=="ending")return;if(b==="none"){G(!1);return}let l=iJ(f);if(!(l.height>0||l.width>0)){G(!1);return}if(T(l),b==="css-animation")wK(f,"animation-name","none")();return},[Q,z,y,T,G,R,k,Y]),V5({enabled:z&&Q&&j==="idle",open:!0,ref:K,onComplete(){if(!z)return;T(fQ,!1)}}),R4.useEffect(()=>{if(z||!Q||j!=="ending")return;if(!K.current)return;let b=new AbortController,l=-1;function r(){if(w.current)return;G(!1),T(fQ,!1)}return l=m2.request(()=>{C(r,b.signal)}),()=>{m2.cancel(l),b.abort()}},[w,Q,z,j,C,T,G]),H0(()=>{let f=K.current;if(!f||!J||!E)return;f.setAttribute("hidden","until-found")},[E,J]),R4.useEffect(function(){let b=K.current;if(!b)return;function l(r){let h=w0(K0.none,r);if(X(!0,h),h.isCanceled)return;D.current=!0,U(!0)}return a0(b,"beforematch",l)},[X,U]);let v=B||J||Q||z;return{height:S.height,props:{...I?{[Ah]:""}:void 0,hidden:E,id:H},ref:_,shouldPreventOpenAnimation:k,shouldRender:v,transitionStatus:j,width:S.width}}function iJ($){return{height:$.scrollHeight,width:$.scrollWidth}}function O60($,Z){let J=I1($).getComputedStyle($),H=(J.animationName.split(",").map((Q)=>Q.trim()).some((Q)=>Q!==""&&Q!=="none")||Z)&&Th(J.animationDuration),B=Th(J.transitionDuration);if(H&&B)return"css-transition";if(B)return"css-transition";if(H)return"css-animation";return"none"}function Th($){return $.split(",").map((Z)=>Z.trim()).some((Z)=>Z!==""&&Number.parseFloat(Z)>0)}function wK($,Z,J){let H=$.style.getPropertyValue(Z),B=$.style.getPropertyPriority(Z);return $.style.setProperty(Z,J),()=>{if(H===""){$.style.removeProperty(Z);return}$.style.setProperty(Z,H,B)}}function j60($){let Z={"justify-content":$.style.justifyContent,"align-items":$.style.alignItems,"align-content":$.style.alignContent,"justify-items":$.style.justifyItems};Object.keys(Z).forEach((B)=>{$.style.setProperty(B,"initial","important")});function J(){Object.entries(Z).forEach(([B,Q])=>{if(Q===""){$.style.removeProperty(B);return}$.style.setProperty(B,Q)})}let H=m2.request(J);return()=>{m2.cancel(H),J()}}var Eh="--collapsible-panel-height",bh="--collapsible-panel-width";var Sh=PL.forwardRef(function(Z,J){let{className:H,hiddenUntilFound:B,keepMounted:Q,render:X,id:z,style:G,...U}=Z,{defaultPanelId:Y,mounted:K,onOpenChange:F,open:W,setMounted:q,setPanelIdState:N,setOpen:D,state:A,transitionStatus:V}=EK(),L=B??!1,O=Q??!1,M=z||void 0,_=M??Y;H0(()=>{return N((x)=>M??(x===null?void 0:x)),()=>{N((x)=>x===M?null:x)}},[M,N]);let{height:w,props:C,ref:E,shouldPreventOpenAnimation:j,shouldRender:k,transitionStatus:S,width:I}=Ch({externalRef:J,hiddenUntilFound:L,id:_,keepMounted:O,mounted:K,onOpenChange:F,open:W,setMounted:q,setOpen:D,transitionStatus:V}),T={...A,transitionStatus:S},y=wh(G,T),R=G0("div",{...Z,style:void 0},{state:T,ref:E,props:[C,{style:{[Eh]:w===void 0?"auto":`${w}px`,[bh]:I===void 0?"auto":`${I}px`}},U,y?{style:y}:void 0,j?{style:{animationName:"none"}}:void 0],stateAttributesMapping:bK});if(!k)return null;return R});var kK=P(c(),1);function SK({...$}){return kK.jsx(rJ.Root,{"data-slot":"collapsible",...$})}function RK({...$}){return kK.jsx(rJ.Trigger,{"data-slot":"collapsible-trigger",...$})}function IK({...$}){return kK.jsx(rJ.Panel,{"data-slot":"collapsible-content",...$})}var yK=P(m(),1);var _L="moi-fonts",Rh="moi-font-previews",C60=Object.values($7).map(($)=>$.googleFontsQuery).filter(Boolean).join("&family="),kh=[["sans","--sans"],["mono","--mono"]],yh=BL.map(($)=>[$,E60($)]),xh="--radius",Ih=[...kh.map(([,$])=>$),...yh.map(([,$])=>$),xh];function E60($){return`--${$.replace(/[A-Z]/g,(J)=>`-${J.toLowerCase()}`)}`}function b60($){let Z={},J=U9($),H=J.font===t9.font?void 0:$7[J.font];for(let[B,Q]of kh)Z[Q]=H?.[B];return Z}function OL($,Z="workspace"){let J={},H=JK($,Z);for(let[B,Q]of yh)J[Q]=H?.[B];return J}function w60($){let Z={},J=U9($),H=J.radius===t9.radius?void 0:qQ[J.radius];return Z[xh]=H?.radius,Z}function K9($,Z="workspace"){return{...b60($),...OL($,Z),...w60($)}}function xK(){yK.useEffect(()=>{if(document.getElementById(Rh))return;let $=document.createElement("link");return $.id=Rh,$.rel="stylesheet",$.crossOrigin="anonymous",$.href=`https://fonts.googleapis.com/css2?family=${C60}&display=swap`,document.head.appendChild($),()=>{$.remove()}},[])}function S60($){yK.useEffect(()=>{let Z=document.documentElement,J=K9($);for(let H of Ih){let B=J[H];if(B)Z.style.setProperty(H,B);else Z.style.removeProperty(H)}return()=>{for(let H of Ih)Z.style.removeProperty(H)}},[$])}function hh($){let{font:Z}=U9($);S60($),yK.useEffect(()=>{let J=$7[Z]??$7[t9.font],H=document.getElementById(_L);if(!J.googleFontsQuery)H?.remove();else{let B=`https://fonts.googleapis.com/css2?family=${J.googleFontsQuery}&display=swap`;if(H)H.href=B;else{let Q=document.createElement("link");Q.id=_L,Q.rel="stylesheet",Q.crossOrigin="anonymous",Q.href=B,document.head.appendChild(Q)}}return()=>{document.getElementById(_L)?.remove()}},[Z])}function A8($,{workspaceId:Z,base:J="",apiBase:H}={}){if(typeof $!=="string")throw Error("A URL is required");if(!$.startsWith("moi:")){let q=new URL($);if(q.protocol!=="https:"&&q.protocol!=="http:")throw Error("Unsupported URL");return q.href}if(!$.startsWith("moi:/")||$.startsWith("moi://"))throw Error("Expected a workspace address such as moi:/views/events?eventId=123");let B=$.slice(5),Q=B.search(/[?#]/),X=Q<0?B:B.slice(0,Q),z=Q<0?"":B.slice(Q),G=X.split("/").map(decodeURIComponent);if(G.some((q)=>!q||q==="."||q===".."||/[/\\\0]/.test(q)))throw Error("Invalid workspace address");let U=Z===void 0?void 0:encodeURIComponent(Z);if(G[0]==="files"){if(G.length<2)throw Error("Invalid workspace file path");return`${H??(U===void 0?"moi:":`/api/workspaces/${U}`)}/files/${G.slice(1).map(encodeURIComponent).join("/")}${z}`}let Y=G.join("/");if($.includes("#")||/\s/.test(Y))throw Error("Invalid workspace address");if(Y!=="chat"&&!d9(Y)&&!(G[0]==="chats"&&G.length===2))throw Error(`Unsupported workspace destination: ${Y}`);let K=new URLSearchParams(z);K.sort();let F=K.toString();return`${U===void 0?"moi:":`${J.replace(/\/$/,"")}/workspace/${U}`}/${G.map(encodeURIComponent).join("/")}${F?`?${F}`:""}`}var aJ=P(m(),1);var P2=P(c(),1),gQ={width:320,height:180,radius:32,topLeftRadius:18,bodyTop:24,tabEnd:124,shoulder:{width:48,roundness:20}};function R60($){let{width:Z,height:J,radius:H,topLeftRadius:B,bodyTop:Q,tabEnd:X,shoulder:z}=gQ,G=Math.min(Z/2,H*$),U=Math.min(Z/2,B*$),Y=Math.max(0,z.width),K=X+Y,F=Math.max(0,Math.min(z.roundness,Y/2));return[`M ${U} 0`,`H ${X}`,`C ${X+F} 0 ${K-F} ${Q} ${K} ${Q}`,`H ${Z-G}`,`Q ${Z} ${Q} ${Z} ${Q+H}`,`V ${J-H}`,`Q ${Z} ${J} ${Z-G} ${J}`,`H ${G}`,`Q 0 ${J} 0 ${J-H}`,`V ${B}`,`Q 0 0 ${U} 0`,"Z"].join(" ")}function I60(){let $=aJ.useRef(null),[Z,J]=aJ.useState(1);return aJ.useLayoutEffect(()=>{let H=$.current;if(!H)return;let B=(z,G)=>{if(z<=0||G<=0)return;let U=z/gQ.width,K=G/gQ.height/U;J((F)=>Math.abs(F-K)<0.001?F:K)},Q=H.getBoundingClientRect();B(Q.width,Q.height);let X=new ResizeObserver(([z])=>{if(z)B(z.contentRect.width,z.contentRect.height)});return X.observe(H),()=>X.disconnect()},[]),{ref:$,horizontalRadiusScale:Z}}var vh=[{frame:Q0("-translate-x-3 translate-y-3 -rotate-6","group-focus-within:translate-y-2 group-hover:translate-y-2"),img:"opacity-40"},{frame:Q0("translate-x-3 translate-y-2 rotate-5","group-focus-within:translate-y-1 group-hover:translate-y-1"),img:"opacity-50"},{frame:Q0("-translate-x-1 translate-y-1 -rotate-2","group-focus-within:-translate-y-2 group-hover:-translate-y-2"),img:"opacity-100"}];function fh({workspaceId:$}){let Z=xU($),J=Z.data?[...Z.data.thumbnails].reverse():[],H=vh.slice(vh.length-J.length),B=Z.data?.firstUserMessage,Q=Z.data?.theme,{ref:X,horizontalRadiusScale:z}=I60(),G=R60(z),U=`folder-noise-${$}`,Y=K9(Q),K=OL(Q);return P2.jsxs("div",{ref:X,style:K,className:"relative h-45 w-full",children:[P2.jsxs("svg",{viewBox:`0 0 ${gQ.width} ${gQ.height}`,preserveAspectRatio:"none","aria-hidden":"true",className:"absolute inset-0 h-full w-full overflow-visible",children:[P2.jsx("defs",{children:P2.jsxs("filter",{id:U,x:"0%",y:"0%",width:"100%",height:"100%",colorInterpolationFilters:"sRGB",children:[P2.jsx("feTurbulence",{type:"fractalNoise",baseFrequency:"0.5",numOctaves:"3",seed:"7",result:"noise"}),P2.jsx("feColorMatrix",{in:"noise",type:"saturate",values:"0",result:"monochromeNoise"}),P2.jsx("feComponentTransfer",{in:"monochromeNoise",result:"faintNoise",children:P2.jsx("feFuncA",{type:"linear",slope:"0.24"})}),P2.jsx("feComposite",{in:"faintNoise",in2:"SourceAlpha",operator:"in",result:"clippedNoise"}),P2.jsx("feBlend",{in:"SourceGraphic",in2:"clippedNoise",mode:"soft-light"})]})}),P2.jsx("path",{d:G,filter:`url(#${U})`,className:"fill-accent"})]}),J.map((F,W)=>P2.jsx("div",{className:Q0("absolute top-[12%] left-[14%] w-fit max-w-[72%] overflow-hidden rounded-[calc(var(--radius-2xl)*0.4)] bg-background shadow-xs squircle","animate-in duration-300 ease-out fade-in",H[W].frame),children:P2.jsx("img",{src:F,alt:"",loading:"lazy",className:Q0("block h-auto max-h-32 w-auto max-w-full object-contain",H[W].img)})},F)),J.length===0&&B&&P2.jsx("div",{className:"absolute inset-x-[12%] top-[22%] flex justify-end",children:P2.jsx("div",{"aria-hidden":"true",style:Y,className:Q0("w-max max-w-40 origin-center rounded-lg bg-card px-3 py-2 font-sans shadow-xs","animate-in transition-transform duration-300 ease-out fade-in","-translate-x-1 translate-y-1 -rotate-2","group-focus-within:translate-y-0.5 group-hover:translate-y-0.5"),children:P2.jsx("p",{className:"line-clamp-3 text-sm leading-normal whitespace-normal",children:B})})}),P2.jsx("div",{className:Q0("absolute inset-x-2 top-[40%] bottom-2 rounded-3xl bg-[color-mix(in_oklch,var(--accent),var(--foreground)_5%)]","mask-[linear-gradient(to_bottom,rgba(0,0,0,0.9)_0%,black_50%)] backdrop-blur-lg","inset-shadow-[0_0_12px_color-mix(in_oklab,var(--background)_20%,transparent)]")})]})}var Q1=P(c(),1);function uh(){xK();let[,$]=m4(),Z=yU();QR();let J=XR(),H=lx({onSuccess:(W)=>$(`/workspace/${W.id}`)}),B=a4(),[Q,X]=mh.useState(!1),z=T1((W)=>W.discoveredWorkspacesOpen),G=T1((W)=>W.setDiscoveredWorkspacesOpen);if(Z.isPending||J.isPending)return Q1.jsx("div",{className:"flex min-h-[50vh] items-center justify-center",children:Q1.jsx(d5,{size:20,stroke:1.5,className:"animate-spin text-muted-foreground"})});if(Z.isError||J.isError)return Q1.jsx("div",{className:"flex min-h-[50vh] items-center justify-center",children:Q1.jsx("p",{className:"text-sm text-muted-foreground",children:"Could not load spaces."})});let U=Z.data,Y=J.data,K=U.length;function F(W){if(B.demo){X(!0);return}H.startImport(W)}return Q1.jsxs("div",{className:"mx-auto w-full max-w-3xl px-8 pt-14 pb-16",children:[Q1.jsx(ox,{className:"mb-10"}),K>0?Q1.jsxs("section",{className:"mb-12",children:[Q1.jsxs("div",{className:"mb-4 flex items-center justify-between gap-2",children:[Q1.jsx("h1",{className:"text-sm font-medium text-foreground",children:"My workspaces"}),Q1.jsx(LQ,{trigger:Q1.jsxs(M0,{variant:"outline",size:"sm",children:[Q1.jsx(a2,{"data-icon":"inline-start",stroke:1.75}),"New"]})})]}),Q1.jsx("div",{className:"grid grid-cols-1 gap-x-4 gap-y-8 sm:grid-cols-2 md:grid-cols-3",children:U.map((W)=>Q1.jsx(k60,{workspace:W},W.id))})]}):Q1.jsxs("div",{className:"mb-10 flex flex-col items-center gap-4 px-8 pt-8 pb-16 text-center",children:[Q1.jsx(gh,{size:32,stroke:1.5,className:"text-muted-foreground"}),Q1.jsxs("div",{className:"flex flex-col gap-1.5",children:[Q1.jsx("h2",{className:"font-medium",children:"Let’s start with creating your first workspace"}),Q1.jsx("p",{className:"mx-auto max-w-sm text-sm text-muted-foreground",children:"Workspace is a place for all the chats, widgets, and views that share the same context. Create a new one or import an existing folder you’ve worked in before."})]}),Q1.jsx(LQ,{trigger:Q1.jsx(M0,{children:"Create workspace"})})]}),Y.length>0&&Q1.jsx("section",{children:Q1.jsxs(SK,{open:z,onOpenChange:G,className:"group",children:[Q1.jsxs(RK,{className:Q0("group/trigger","flex w-full items-center gap-1 pb-4 text-left outline-none focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-ring","text-muted-foreground group-data-open:text-foreground hover:text-foreground"),children:[Q1.jsx("span",{className:"text-sm font-medium",children:"Import from this computer"}),Q1.jsx(u3,{size:16,stroke:2,className:Q0("opacity-0 transition-[opacity,transform]","group-hover/trigger:opacity-100 group-focus-visible/trigger:opacity-100 group-data-open:rotate-90")})]}),Q1.jsx(IK,{children:Q1.jsx("ul",{className:"border-t border-border",children:Y.map((W)=>Q1.jsx(y60,{suggestion:W,onAdd:F},W.path))})})]})}),H.choice&&Q1.jsx(cx,{choice:H.choice,isPending:H.isPending,errorMessage:H.error?.message,onTypeChange:H.selectType,onSubmit:H.submit,onReset:H.reset}),Q1.jsx(EJ,{open:Q,onOpenChange:X})]})}function k60({workspace:$}){let Z=I$($),J=xU($.id),H=$.theme??J.data?.theme,B=U9(H).agent,Q=G4((G)=>iG(G.activity,$.id)),X=J.data?.updatedAt??new Date($.addedAt).getTime(),z=`/workspace/${$.id}`;return Q1.jsxs("div",{className:"group flex min-w-0 flex-col gap-3",children:[Q1.jsxs("div",{className:"relative",children:[Q1.jsx(fh,{workspaceId:$.id}),Q1.jsx(a7,{href:z,"aria-label":`Open ${Z}`,className:"absolute inset-0 rounded-2xl outline-none focus-visible:ring-3 focus-visible:ring-ring/50"}),J.data&&Q1.jsxs(i1,{children:[Q1.jsx(r1,{render:Q1.jsx(a7,{href:A8("moi:/chat",{workspaceId:$.id}),"aria-label":`Chat in ${Z}`,style:K9(H),className:"absolute right-3 bottom-3 rounded-lg outline-none focus-visible:ring-3 focus-visible:ring-ring/50",children:Q1.jsx(H3,{preset:B,color:"primary",animated:Q,expression:Q?"thinking":void 0,size:48,className:"drop-shadow-sm drop-shadow-primary/20"})})}),Q1.jsx(a1,{children:"Chat"})]})]}),Q1.jsxs(a7,{href:z,className:"flex min-w-0 flex-col gap-2 rounded-lg px-2 outline-none focus-visible:ring-3 focus-visible:ring-ring/50",children:[Q1.jsxs("div",{className:"flex min-w-0 items-center gap-1.5 font-sans",style:K9(H),children:[Q1.jsx(Z7,{icon:$.icon,workspaceType:$.type,workspaceTheme:H,className:"size-4 shrink-0 rounded-xs"}),Q1.jsx("span",{className:"truncate text-sm font-medium text-foreground",children:Z})]}),Q1.jsx("span",{className:"text-xs text-muted-foreground",children:x60(X)})]})]})}function y60({suggestion:$,onAdd:Z}){let{path:J,types:H}=$,B=I$($);return Q1.jsxs("li",{className:"flex items-center gap-2 border-b border-border px-1 py-3",children:[Q1.jsx(py,{types:H}),Q1.jsx("span",{className:"shrink-0 text-sm font-medium text-foreground",children:B}),Q1.jsx("span",{title:J,className:"min-w-0 flex-1 truncate text-xs text-muted-foreground",children:$.displayPath??J}),Q1.jsxs(M0,{variant:"outline",size:"sm",onClick:()=>Z($),children:[Q1.jsx(a2,{stroke:1.75}),"Add"]})]})}function x60($){let Z=Date.now()-$,J=Math.floor(Z/60000);if(J<1)return"Updated just now";if(J<60)return`Updated ${J} min${J===1?"":"s"} ago`;let H=Math.floor(J/60);if(H<24)return`Updated ${H} hour${H===1?"":"s"} ago`;let B=Math.floor(H/24);if(B<30)return`Updated ${B} day${B===1?"":"s"} ago`;return`Updated ${new Date($).toLocaleDateString()}`}var hK=P(c(),1);function ph(){return hK.jsx(PK,{showWorkspaces:!1,children:hK.jsx("div",{className:"min-h-0 flex-1 overflow-y-auto",children:hK.jsx(uh,{})})})}var nJ=P(m(),1);var vK=5000,fK=120;var h60="</moi-attachments>";function jL($){if(!l9($)||typeof $.label!=="string")return null;let Z=$.label.trim();if(!Z||Z.length>fK||typeof $.text!=="string"||!$.text.trim()||$.text.length>vK)return null;return{label:Z,text:$.text}}function ch($){return Array.isArray($)&&$.every((Z)=>l9(Z)&&Z.purpose===void 0&&(Z.source===void 0||typeof Z.source==="string"&&Z.source.length>0)&&jL(Z)!==null)}function dh($){return $==="annotation"||$==="sketch"}function v60($){return Array.isArray($)&&$.every((Z)=>{if(!l9(Z))return!1;if(Z.type==="text")return ch([Z]);if(Z.type!=="file"&&Z.type!=="image")return!1;if(Z.source!==void 0&&(typeof Z.source!=="string"||!Z.source))return!1;if(typeof Z.mediaType!=="string"||!Z.mediaType)return!1;if(Z.purpose!==void 0&&(!dh(Z.purpose)||!Z.mediaType.startsWith("image/")))return!1;let J=typeof Z.path==="string"&&/^(\/|[A-Za-z]:[\\/])/.test(Z.path)&&!Z.path.includes("\x00");if(Z.type==="file")return J&&Z.label===void 0;return Z.path===void 0&&Z.mediaType.startsWith("image/")&&typeof Z.label==="string"&&Boolean(Z.label.trim())})}function TL($){let Z=[],J=!1,H=$.replace(/<moi-attachments>([^<]*)<\/moi-attachments>/g,(B,Q)=>{try{let X=JSON.parse(Q),z=l9(X)&&X.version===1&&Array.isArray(X.attachments)?X.attachments.map((G)=>l9(G)?{type:"text",source:G.source,label:G.label,text:G.text}:G):X;if(!v60(z))return B;return Z.push(...z),J=!0,""}catch{return B}});return{text:J?H.trim():$,attachments:Z}}function CL($){return $.type==="file"?$.path.split(/[\\/]/).at(-1):$.label}function lh($,Z){let{source:J}=$,H=CL($);if($.type==="text")return{type:"text-attachment",source:$.source,label:H,text:$.text};return{type:"file-attachment",label:H,mediaType:$.mediaType,source:J,...$.purpose?{purpose:$.purpose}:{},previewUrl:Z,path:$.type==="file"?$.path:void 0}}function f60($){return TL($).text}function ih($){let Z=f60($),J=Z.search(/<moi-attachments>\s*(?:\[|\{"version":1,"attachments":\[)/);return(J<0||Z.includes(h60,J)?Z:Z.slice(0,J)).trimEnd()}var mQ=10;function gK($){return $.length>mQ?`A message can have at most ${mQ} attachments.`:null}var rh=33554432;function ah($){return typeof $==="string"&&$.length>0&&!/[\\:\0]/.test($)&&$.split("/").every((Z)=>Z.length>0&&!Z.startsWith("."))}var th=P(m(),1);var oh=()=>({emit($,...Z){for(let J=this.events[$]||[],H=0,B=J.length;H<B;H++)J[H](...Z)},events:{},on($,Z){return(this.events[$]||=[]).push(Z),()=>{this.events[$]=this.events[$]?.filter((J)=>Z!==J)}}});var g60=({kind:$,name:Z})=>`${$}:${Z}`,m60=1000,EL={cooldownMs:2000,windowMs:60000,maxPerWindow:10,maxKeys:64};function u60($){let Z=oh(),J=dG(EL),H=(X,z)=>{K8($,{source:"runtime",kind:X.kind,name:X.name,message:z})},B=(X,z,G,U,Y)=>{let K=X.admit(G);if(K==="ok")return!0;return H(z,K==="cooldown"?U:Y),!1},Q=(X,z,G)=>{return B(J,X,`${z}\x00${G}`,`sendChatMessage() for "${G}" was dropped: the same message was already sent less than ${EL.cooldownMs/1000}s ago. Call it from an event handler, not during render.`,`sendChatMessage() for "${G}" was dropped: more than ${EL.maxPerWindow} messages in a minute from this workspace. Each one starts an agent run, so send only on a real user action.`)};return{on(X,z){return Z.on(X,z)},connect(X,z=""){let G=!0,U=g60(X);return{bridge:{get collab(){return G?iD:void 0},addChatAttachment(K){if(!G)return;try{let F=nh(K,U);Z.emit("addChatAttachment",F)}catch(F){let W=bL(F);e1.add({title:"Couldn’t add attachment",description:W,type:"error"}),H(X,`addChatAttachment() was dropped: ${W}`)}},navigate(K){if(!G)return;try{Z.emit("navigate",A8(K))}catch(F){H(X,`navigate() was dropped: ${bL(F)}`)}},resolveUrl(K){if(!G)return"";return A8(K,{workspaceId:$,base:z})},sendChatMessage(K,F){if(!G)return;try{if(typeof K==="string")K={message:K,attachments:F===void 0?[]:[{type:"text",label:"Context",text:JSON.stringify(F)}]};if(!l9(K)||typeof K.message!=="string")throw Error("This message uses an unsupported format");if("context"in K)throw Error("This message uses an outdated format");let W=K.message.trim();if(!W)throw Error("The message is empty");if(W.length>m60)throw Error("Messages can be up to 1,000 characters");if(K.attachments!==void 0&&!Array.isArray(K.attachments))throw Error("The attachments use an unsupported format");let q=Array.from(K.attachments??[],(N)=>nh(N,U));if(!Q(X,U,W))return;Z.emit("sendChatMessage",{message:W,applet:{kind:X.kind,id:X.name},attachments:q})}catch(W){let q=bL(W);e1.add({title:"Couldn’t send message",description:q,type:"error"}),H(X,`sendChatMessage() was dropped: ${q}`)}}},dispose:()=>{G=!1}}}}}function nh($,Z){if(!l9($))throw Error("This attachment isn’t supported");if($.type==="text"){let J=jL($);if(J)return{type:"text",...J,source:Z};if(typeof $.label!=="string"||!$.label.trim())throw Error("Add a label to this text attachment");if($.label.trim().length>fK)throw Error(`Attachment labels can be up to ${fK} characters`);if(typeof $.text!=="string"||!$.text.trim())throw Error("Add some text to this attachment");if($.text.length>vK)throw Error(`Text attachments can be up to ${vK.toLocaleString("en-US")} characters`)}else if($.type==="file"){if($.file instanceof File&&$.path===void 0){if($.file.size>rh)throw Error("Files can be up to 32 MB");return{type:"file",file:$.file,source:Z}}if(typeof $.path==="string"&&$.file===void 0){if(!ah($.path))throw Error("Choose a file from this workspace");return{type:"file",path:$.path,source:Z}}}throw Error("This attachment isn’t supported")}function bL($){return $ instanceof Error?$.message:String($)}var sh=new Map;function uK($){let Z=sh.get($);if(!Z)Z=u60($),sh.set($,Z);return Z}function pK($,Z,J){let H=q5(J);th.useEffect(()=>{let B=(...Q)=>H.current(...Q);return uK($).on(Z,B)},[$,Z,H])}var mK=new Map;function eh($,Z,J,H,B=""){let Q=$.__attachBridge;if(typeof Q!=="function")return;mK.get(J)?.();let{bridge:X,dispose:z}=uK(Z).connect(H,B);mK.set(J,z),Q(X)}function wL($){let Z=mK.get($);if(!Z)return;mK.delete($),Z()}function cK($,Z,J){return`${$}/${Z}/${J}`}var oJ=new Map,uQ=new Map;function p60($,Z,J){return oJ.get(cK($,Z,J))??0}var c60="module";function $v($,Z,J){return`/api/workspaces/${Z}/${$}/${J}/${c60}?v=${p60($,Z,J)}`}function dK($,Z,J){return`/api/workspaces/${Z}/${$}/${J}`}function z7($,Z){return`${$}/${Z}`}function Zv($){return uQ.get($)}function Jv($,Z){uQ.set($,Z)}function lK($,Z,J){let H=cK($,Z,J);uQ.delete(H),oJ.set(H,(oJ.get(H)??0)+1),wL(H)}function SL($){let Z=`${$}/`;for(let J of new Set([...uQ.keys(),...oJ.keys()]))if(J.startsWith(Z))uQ.delete(J),oJ.set(J,(oJ.get(J)??0)+1),wL(J)}var d60={kind:"widget",segment:"widgets",shouldReload:($,Z)=>$.type==="widget:updated"&&$.name===Z||$.type==="applets:refresh"&&$.only!=="views"},l60={kind:"view",segment:"views",shouldReload:($,Z)=>$.type==="view:updated"&&$.name===Z||$.type==="applets:refresh"&&$.only!=="widgets"};function i60($,Z,J,H){let{segment:B}=$,Q=cK(B,Z,J),X=Zv(Q);if(X)return X;let z=import($v(B,Z,J)).then((G)=>{if(!G.default)throw Error(`"${J}" has no default export`);return eh(G,Z,Q,{kind:$.kind,name:J},H),G.default});return Jv(Q,z),z}function Hv($,Z){let J=p1(),{base:H}=C2(),[B,Q]=nJ.useState({status:"loading",version:0}),X=nJ.useCallback(()=>{Q((z)=>({status:"loading",version:z.version})),i60($,J,Z,H).then((z)=>Q((G)=>({status:"ready",Component:z,version:G.version+1}))).catch((z)=>{K8(J,{source:"load",kind:$.kind,name:Z,message:String(z),...z instanceof Error&&z.stack?{stack:z.stack}:{}}),Q((G)=>({status:"error",error:String(z),version:G.version+1}))})},[H,$,J,Z]);return nJ.useEffect(()=>{X()},[X]),L2((z)=>{if($.shouldReload(z,Z))lK($.segment,J,Z),X()}),B}function Bv($){return Hv(d60,$)}function Qv($){return Hv(l60,$)}function Xv(){let $=p1();L2((Z)=>{if(Z.type==="view:updated")lK("views",$,Z.name);else if(Z.type==="widget:updated")lK("widgets",$,Z.name);else if(Z.type==="applets:refresh"){if(Z.only!=="views")SL("widgets");if(Z.only!=="widgets")SL("views")}})}var f8=P(m(),1);function zv($){return s1({queryKey:O0.layout($),queryFn:()=>B1(`/api/workspaces/${$}`),...W8})}function v8($){let Z=$1();return L2((J)=>{if(J.type==="harness:updated"&&J.workspaceId===$)Z.setQueryData(O0.agent($),(H)=>H?{...H,availability:J.availability}:H);if(J.type==="env:updated"&&J.workspaceId===$)Z.invalidateQueries({queryKey:O0.agent($)})}),s1({queryKey:O0.agent($),queryFn:async({signal:J})=>{let H=O0.agent($),B=Z.getQueryData(H),Q=B!==void 0&&B.availability.status!=="available",X=await B1(`/api/workspaces/${$}/agent${Q?"?refresh=true":""}`,{signal:J}),z=Z.getQueryData(H);return z&&z!==B?{...X,availability:z.availability}:X},staleTime:30000,refetchOnMount:(J)=>J.state.data?.availability.status==="available"?!0:"always",refetchOnWindowFocus:!0})}function Gv($){return s1({queryKey:O0.skills($),queryFn:()=>B1(`/api/workspaces/${$}/skills`),...W8})}async function r60($){let Z=await fetch(`/api/workspaces/${$}/skills/update`,{method:"POST"}),J=await Z.text(),H=null;try{H=JSON.parse(J)}catch{}if(!Z.ok){let B=H&&"error"in H?H.error:J,Q=Error(B||"Failed to update workspace skill");if(H?.skills)Q.status={skills:H.skills,updateAvailable:H.updateAvailable};throw Q}if(!H)throw Error("Invalid workspace skill update response");return H}function Uv($){let Z=$1();return F5({mutationFn:()=>r60($),onSuccess:(J)=>{Z.setQueryData(O0.skills($),J)},onError:(J)=>{if(J.status)Z.setQueryData(O0.skills($),J.status)}})}function Yv($){let Z=$1();return F5({mutationFn:(J)=>U4(`/api/workspaces/${$}`,_5("PUT",{...J,origin:a9}),"Failed to save layout"),onSuccess:()=>{Z.invalidateQueries({queryKey:O0.previews})}})}var RL={id:"_moi_views",config:{colSpan:4,rowSpan:1},defaultPosition:{x:0,y:0}},IL=[RL],a60=new Set(IL.map(($)=>$.id));function B3($){return a60.has($)}function Kv($){return[...IL,...$]}function Fv(){return IL.map(($)=>({i:$.id,...$.defaultPosition}))}function iK(){return{open:["overview","scratchpad"],active:"overview"}}function rK($){let Z=iK();if(!$||typeof $!=="object")return Z;let J=$,H=Array.isArray(J.open)?J.open.filter(d9).filter((X,z,G)=>G.indexOf(X)===z):[];if(H.length===0)return Z;let B=["overview",...H.filter((X)=>X!=="overview")],Q=d9(J.active)&&B.includes(J.active)?J.active:"overview";return{open:B,active:Q}}function Wv(){return{version:1,widgetGrid:Fv(),layoutMode:"split",tabs:iK()}}function qv($,Z,J){let{tabs:H,...B}=$,Q=Z.tabs??J?.tabs;return Q===void 0?B:{...B,tabs:Q}}var Vv=P(c(),1),kL=f8.createContext(null);function b1(){let $=f8.useContext(kL);if(!$)throw Error("useWorkspaceLayoutCtx must be used within <WorkspaceLayoutProvider>");return $}function Av(){return f8.useContext(kL)?.layout.theme}function Nv($){let{cwd:Z,name:J,provider:H,agentId:B,...Q}=$;return Q}function Dv({id:$,children:Z}){let J=$1(),H=zv($),B=Yv($),Q=q5(B.mutate),X=f8.useRef(null),z=f8.useRef(null),G=f8.useCallback((Y)=>{let K=O0.layout($),F=J.getQueryData(K);if(!F)return;J.cancelQueries({queryKey:K});let W={...F,...Y};if(J.setQueryData(K,W),z.current=qv(Nv(W),Y,z.current),X.current)clearTimeout(X.current);X.current=setTimeout(()=>{X.current=null;let q=z.current;if(z.current=null,q)Q.current(q)},600)},[$,J,Q]),U=f8.useMemo(()=>({layout:H.data?Nv(H.data):Wv(),setLayout:G,name:H.data?.name??null,cwd:H.data?.cwd??null,provider:H.data?.provider??null,workspaceId:$,isLoading:H.isLoading}),[H.data,H.isLoading,G,$]);return Vv.jsx(kL,{value:U,children:Z})}var e2=P(m(),1);var oK=P(c(),1);function aK({visible:$,editing:Z,canvasRef:J,width:H,height:B,pointerProps:Q,onKeyDown:X,children:z}){if(!$)return null;return oK.jsxs("div",{className:"absolute inset-0 animate-in duration-100 fade-in",onKeyDown:X,children:[oK.jsx("canvas",{ref:J,...Q,width:H,height:B,"aria-label":"Drawing area",tabIndex:0,className:"absolute inset-0 size-full cursor-pencil touch-none outline-none"}),Z&&z]})}var Z1=P(m(),1);function xL($,Z,J){let H=Math.max($,Z);if(H<=0)return 1;return Math.min(Math.max(J,1),1568/H)}function o60($){return new Promise((Z,J)=>{setTimeout(()=>J(Error("Annotation capture timed out")),$)})}function n60($){if(!($ instanceof HTMLElement))return;let{overflowX:Z,overflowY:J}=$.style;if(J==="auto"||J==="scroll")$.style.overflowY="hidden";if(Z==="auto"||Z==="scroll")$.style.overflowX="hidden"}async function Lv($){let Z=$.getBoundingClientRect();if(Z.width<=0||Z.height<=0)throw Error("Annotation target is not visible");let{createContext:J,destroyContext:H,domToCanvas:B}=await import("/chunk-hvh9f5h0.js"),Q=async()=>{let X=await J($,{width:Math.round(Z.width),height:Math.round(Z.height),scale:xL(Z.width,Z.height,window.devicePixelRatio),type:"image/png",backgroundColor:getComputedStyle($).backgroundColor,timeout:1000,features:{restoreScrollPosition:!0},style:{overflow:"hidden"},onCloneEachNode:n60});try{return await B(X)}finally{H(X)}};return Promise.race([Q(),o60(1e4)])}var hL={past:[],present:[],future:[]};function s60($,Z){if(Z.type==="commit")return{past:[...$.past,$.present],present:[...$.present,Z.stroke],future:[]};if(Z.type==="undo"){let J=$.past.at(-1);if(!J)return $;return{past:$.past.slice(0,-1),present:J,future:[$.present,...$.future]}}if(Z.type==="redo"){let J=$.future[0];if(!J)return $;return{past:[...$.past,$.present],present:J,future:$.future.slice(1)}}if($.present.length===0)return $;return{past:[...$.past,$.present],present:[],future:[]}}function _v($,Z,J){let H=$.getBoundingClientRect();return{x:(Z-H.left)/H.width*$.width,y:(J-H.top)/H.height*$.height}}function Mv($,Z){let J=Z.getCoalescedEvents?.()??[];return(J.length>0?J:[Z]).map((B)=>_v($,B.clientX,B.clientY))}var t60={canUndo:!1,canRedo:!1,hasStrokes:!1};function pQ($){return Z1.useSyncExternalStore($.subscribeHistory,$.getHistoryState,$.getHistoryState)}function Pv($,Z,J,H){let B=Z.points[0];if(!B)return;$.beginPath(),$.lineCap="round",$.lineJoin="round",$.lineWidth=H,$.strokeStyle=J,$.moveTo(B.x,B.y);for(let Q=1;Q<Z.points.length;Q++){let X=Z.points[Q];$.lineTo(X.x,X.y)}if(Z.points.length===1)$.lineTo(B.x+0.01,B.y+0.01);$.stroke()}function Ov($,Z,J,H,B,Q=null){let X=Math.max(3,Math.min(Z,J)*0.005),z=X+Math.max(2,X*0.75),G=Q?[...B,Q]:B;for(let U of G)Pv($,U,H.haloColor,z);for(let U of G)Pv($,U,H.strokeColor,X)}function e60($,Z,J,H=null){let B=$.getContext("2d");if(!B)return;B.clearRect(0,0,$.width,$.height),Ov(B,$.width,$.height,Z,J,H)}function $70($,Z,J){let H=$.getContext("2d");if(!H)return;H.clearRect(0,0,$.width,$.height),H.drawImage(Z.snapshot,0,0,$.width,$.height),Ov(H,$.width,$.height,Z,J)}function Z70($){return new Promise((Z,J)=>{$.toBlob((H)=>{if(H)Z(H);else J(Error("Could not export drawing"))},"image/png")})}function J70($,Z,J){let H=$.getBoundingClientRect();if(H.width<=0||H.height<=0)return null;let B=getComputedStyle($),Q=xL(H.width,H.height,window.devicePixelRatio),X=Math.max(1,Math.round(H.width*Q)),z=Math.max(1,Math.round(H.height*Q)),G=document.createElement("canvas");G.width=X,G.height=z;let U=B.getPropertyValue("--background").trim()||"#ffffff",Y=G.getContext("2d");if(Y)Y.fillStyle=U,Y.fillRect(0,0,X,z);return Z.width=X,Z.height=z,{id:J,snapshot:G,strokeColor:B.getPropertyValue("--primary").trim()||"#2563eb",haloColor:U,targetWidth:H.width,targetHeight:H.height}}function H70($){return $ instanceof HTMLInputElement||$ instanceof HTMLTextAreaElement||$ instanceof HTMLElement&&$.isContentEditable}function nK({mode:$="annotation",onChange:Z,onEditingStart:J,onFinish:H}={}){let B=Z1.useRef(null),Q=Z1.useRef(null),[X,z]=Z1.useState(null),G=Z1.useRef(X),[U,Y]=Z1.useState(!1),K=Z1.useRef(!1),F=Z1.useRef(hL),W=Z1.useRef(t60),q=Z1.useRef(new Set),N=Z1.useRef(0),D=Z1.useRef(null),A=Z1.useRef(null),V=Z1.useRef(0),L=Z1.useRef(0),O=Z1.useRef(null),M=Z1.useRef(null),[_,w]=Z1.useState(!1),C=Z1.useRef(!1),[E,j]=Z1.useState(!1),k=Z1.useRef(!1),S=q5(Z),I=q5(J),T=q5(H),y=Z1.useCallback(()=>{let s=F.current,a=W.current,$0={canUndo:s.past.length>0,canRedo:s.future.length>0,hasStrokes:s.present.length>0};if($0.canUndo===a.canUndo&&$0.canRedo===a.canRedo&&$0.hasStrokes===a.hasStrokes)return;W.current=$0;for(let t of q.current)t()},[]),R=Z1.useCallback((s)=>{return q.current.add(s),()=>{q.current.delete(s)}},[]),x=Z1.useCallback(()=>W.current,[]),v=Z1.useCallback((s,a=null)=>{if(V.current)cancelAnimationFrame(V.current),V.current=0;let $0=Q.current,t=G.current;if($0&&t)e60($0,t,s,a)},[]),f=Z1.useCallback(()=>{if(V.current)return;V.current=requestAnimationFrame(()=>{V.current=0,v(F.current.present,D.current)})},[v]),b=Z1.useCallback((s,a,$0)=>{let t=O.current;if(t?.sessionId===s.id&&t.historyVersion===$0)return Promise.resolve(t.blob);let B0=M.current;if(B0?.sessionId===s.id&&B0.historyVersion===$0)return B0.promise;if(a.length===0)return O.current={sessionId:s.id,historyVersion:$0,blob:null},S.current?.(null),Promise.resolve(null);let _0=document.createElement("canvas");_0.width=s.snapshot.width,_0.height=s.snapshot.height,$70(_0,s,a);let P0=Z70(_0).then((A0)=>{if(G.current?.id!==s.id||N.current!==$0)return A0;return O.current={sessionId:s.id,historyVersion:$0,blob:A0},S.current?.(A0),A0}).catch(()=>{if(G.current?.id===s.id&&N.current===$0)e1.add({title:"Couldn’t export the drawing",type:"error"});return null}).finally(()=>{if(M.current?.promise===P0)M.current=null});return M.current={sessionId:s.id,historyVersion:$0,promise:P0},P0},[S]),l=Z1.useCallback(()=>{if(!D.current)return;let s=Q.current,a=A.current;if(s&&a!==null&&s.hasPointerCapture(a))s.releasePointerCapture(a);D.current=null,A.current=null,v(F.current.present)},[v]),r=Z1.useCallback((s)=>{let a=G.current;if(!a||k.current)return;let $0=s60(F.current,s);if($0===F.current)return;F.current=$0,y(),D.current=null;let t=++N.current;v($0.present),b(a,$0.present,t)},[b,y,v]),h=Z1.useCallback((s)=>{F.current=hL,N.current=0,O.current=null,M.current=null,D.current=null,A.current=null,y(),G.current=s,z(s)},[y]),d=Z1.useCallback(()=>{if(K.current)return;K.current=!0,Y(!0),I.current?.()},[I]),o=Z1.useCallback(async()=>{let s=B.current;if(!s||G.current||C.current)return!1;let a=++L.current;C.current=!0,w(!0);try{let $0=await Lv(s);if(a!==L.current||B.current!==s)return!1;let t=s.getBoundingClientRect(),B0=getComputedStyle(s),_0={id:a,snapshot:$0,strokeColor:B0.getPropertyValue("--primary").trim()||"#2563eb",haloColor:B0.getPropertyValue("--background").trim()||"#ffffff",targetWidth:t.width,targetHeight:t.height};return h(_0),d(),!0}finally{if(a===L.current)C.current=!1,w(!1)}},[d,h]),p=Z1.useCallback(()=>{let s=G.current;L.current+=1,C.current=!1,k.current=!1,w(!1),j(!1),K.current=!1,Y(!1),l(),z(null),F.current=hL,y();let a=M.current;if(!s||a?.sessionId!==s.id)return G.current=null,Promise.resolve();return a.promise.then(()=>{if(G.current?.id===s.id)G.current=null})},[l,y]),i=Z1.useCallback(async()=>{let s=G.current;if(!s)return null;return l(),b(s,F.current.present,N.current)},[l,b]),n=Z1.useCallback(async()=>{return K.current=!1,Y(!1),i()},[i]),Z0=Z1.useCallback(async()=>{let s=G.current;if(!s||k.current)return null;k.current=!0,j(!0),l();let a=N.current,$0=F.current.present,t=null;if($0.length>0||a>0)t=await b(s,$0,a);if(G.current?.id!==s.id)return t;try{await T.current?.(t)}finally{if(G.current?.id===s.id)L.current+=1,K.current=!1,Y(!1),G.current=null,z(null),k.current=!1,j(!1)}return t},[l,b,T]),J0=Z1.useCallback(()=>r({type:"undo"}),[r]),U0=Z1.useCallback(()=>r({type:"redo"}),[r]),z0=Z1.useCallback(()=>r({type:"clear"}),[r]),X0=Z1.useMemo(()=>({onPointerDown:(s)=>{if(k.current||!s.isPrimary||s.pointerType==="mouse"&&s.button!==0)return;if(!G.current&&$==="sketch"){let a=B.current;if(!a)return;let $0=J70(a,s.currentTarget,++L.current);if(!$0)return;h($0)}if(!G.current)return;d(),A.current=s.pointerId,s.currentTarget.setPointerCapture(s.pointerId),D.current={points:[_v(s.currentTarget,s.clientX,s.clientY)]},v(F.current.present,D.current)},onPointerMove:(s)=>{if(s.pointerId!==A.current||!D.current)return;D.current.points.push(...Mv(s.currentTarget,s.nativeEvent)),f()},onPointerUp:(s)=>{if(s.pointerId!==A.current||!D.current)return;let a=D.current;if(a.points.push(...Mv(s.currentTarget,s.nativeEvent)),D.current=null,A.current=null,s.currentTarget.hasPointerCapture(s.pointerId))s.currentTarget.releasePointerCapture(s.pointerId);r({type:"commit",stroke:a})},onPointerCancel:(s)=>{if(s.pointerId===A.current)l()}}),[r,d,l,h,$,v,f]),q0=Z1.useCallback((s)=>{if(H70(s.target))return;if(s.key==="Escape"&&$==="annotation"){s.preventDefault(),Z0();return}if(!(s.metaKey||s.ctrlKey)||s.key.toLowerCase()!=="z")return;if(s.preventDefault(),s.shiftKey)U0();else J0()},[Z0,$,U0,J0]);Z1.useLayoutEffect(()=>{if(!X)return;if(v(F.current.present,D.current),U)Q.current?.focus()},[U,v,X]),Z1.useEffect(()=>{if(!X||$==="sketch")return;let s=B.current;if(!s){p();return}let a=new ResizeObserver(($0)=>{let t=$0[0]?.contentRect;if(!t)return;if(Math.abs(t.width-X.targetWidth)>1||Math.abs(t.height-X.targetHeight)>1)p()});return a.observe(s),()=>a.disconnect()},[p,$,X]),Z1.useEffect(()=>()=>{if(L.current+=1,K.current=!1,G.current=null,V.current)cancelAnimationFrame(V.current)},[]);let N0=Z1.useMemo(()=>({active:U,visible:$==="sketch"||X!==null,starting:_,finishing:E,open:o,undo:J0,redo:U0,clear:z0,flush:i,deactivate:n,finish:Z0,cancel:p,subscribeHistory:R,getHistoryState:x}),[U,$,X,_,E,o,J0,U0,z0,i,n,Z0,p,R,x]),F0=Z1.useMemo(()=>({visible:N0.visible,editing:N0.active,canvasRef:Q,width:X?.snapshot.width??1,height:X?.snapshot.height??1,pointerProps:X0,onKeyDown:q0}),[N0.active,N0.visible,X,X0,q0]);return Z1.useMemo(()=>({targetRef:B,controls:N0,layerProps:F0}),[N0,F0])}var $2=P(c(),1);function tK({controls:$,title:Z,busy:J,onComplete:H}){let{canUndo:B,canRedo:Q,hasStrokes:X}=pQ($);return $2.jsxs("div",{className:"absolute bottom-3 left-1/2 flex -translate-x-1/2 items-center gap-2 rounded-lg bg-popover p-1.5 shadow-md",children:[$2.jsx("span",{className:"mr-2 ml-2 text-sm font-medium",children:Z}),$2.jsxs("div",{className:"flex gap-1",children:[$2.jsxs(i1,{children:[$2.jsx(r1,{render:$2.jsx(M0,{type:"button",variant:"outline",size:"icon-sm",onClick:$.undo,disabled:J||!B,"aria-label":"Undo",children:$2.jsx(sK,{stroke:1.75})})}),$2.jsx(a1,{children:"Undo"})]}),$2.jsxs(i1,{children:[$2.jsx(r1,{render:$2.jsx(M0,{type:"button",variant:"outline",size:"icon-sm",onClick:$.redo,disabled:J||!Q,"aria-label":"Redo",children:$2.jsx(jv,{stroke:1.75})})}),$2.jsx(a1,{children:"Redo"})]}),$2.jsx(M0,{type:"button",variant:"outline",size:"sm",onClick:$.clear,disabled:J||!X,children:"Clear"})]}),$2.jsx(I4,{mode:"popLayout",initial:!1,children:$2.jsx(Y5.div,{variants:{from:{opacity:0,scale:0.8,filter:"blur(4px)"},to:{opacity:1,scale:1,filter:"blur(0px)"}},initial:"from",animate:"to",exit:"from",transition:{type:"spring",duration:0.1,bounce:0},children:$2.jsx(M0,{type:"button",variant:X?"default":"ghost",size:"icon-sm",onClick:H,disabled:J,"aria-label":"Complete",className:Q0(!X&&"text-muted-foreground"),children:X?$2.jsx(g8,{stroke:1.75}):$2.jsx(e5,{stroke:1.75})})},X?"complete":"cancel")})]})}var Z2=P(m(),1);async function cQ($,Z){let J=`/api/workspaces/${$}/uploads`;if(typeof Z==="string")return B1(`${J}/from-path`,_5("POST",{path:Z}),"The file couldn’t be uploaded");let H=new FormData;H.append("files",Z);let[B]=await B1(J,{method:"POST",body:H},"The file couldn’t be uploaded");if(!B)throw Error("The upload didn’t finish");return B}function vL({workspaceId:$,sessionId:Z}){if((y1.getState().attachments[F8($,Z)]??[]).length<mQ)return!0;return e1.add({id:"draft-attachment-limit",title:"Attachment limit reached",description:`You can attach up to ${mQ} items. Remove one to add another.`,type:"error"}),!1}function Tv($,Z){for(let J of Z)Cv($,J)}async function Cv({workspaceId:$,sessionId:Z},J,H,B){if(!vL({workspaceId:$,sessionId:Z}))return;let Q=typeof J==="string"?null:J,X=typeof J==="string"?J.split("/").at(-1):J.name||"file",z=crypto.randomUUID();y1.getState().addAttachments($,Z,[{kind:"file",source:B,localId:z,label:X,mediaType:Q?.type||"application/octet-stream",previewUrl:Q?.type.startsWith("image/")?URL.createObjectURL(Q):void 0,status:"uploading"}]);try{let G=await cQ($,J);y1.getState().updateAttachment($,z,{status:"ready",upload:G,label:G.filename,mediaType:G.mediaType,...G.kind==="image"&&!Q?.type.startsWith("image/")?{previewUrl:`/api/workspaces/${$}/uploads/${G.id}`}:{}})}catch(G){let U=G instanceof Error?G.message:"The file couldn’t be uploaded";y1.getState().removeAttachment($,z),e1.add({title:`Couldn’t add ${X}`,description:U,type:"error"}),H?.(U)}}function Ev($,Z){if(Z.type==="text"){let{source:J,label:H,text:B}=Z;return B70($,{source:J,label:H,text:B}),Promise.resolve()}return Cv($,Z.file??Z.path,(J)=>{K8($.workspaceId,{source:"runtime",message:`addChatAttachment() from ${Z.source}: ${J}`})},Z.source)}function dQ({workspaceId:$,sessionId:Z,localId:J,purpose:H,source:B,blob:Q}){let X=H==="sketch"?"Sketch":"Annotation",z=y1.getState(),G=lG(z.attachments,$,J);if(!G&&!vL({workspaceId:$,sessionId:Z}))return!1;let U=URL.createObjectURL(Q);if(G)z.updateAttachment($,J,{previewUrl:U,status:"draft",upload:void 0});else z.addAttachments($,Z,[{kind:"drawing",purpose:H,localId:J,source:B,label:`${X}.png`,mediaType:"image/png",previewUrl:U,status:"draft"}]);return!0}async function eK($){let{workspaceId:Z,localId:J,purpose:H,blob:B,isCurrent:Q}=$,X=H==="sketch"?"Sketch":"Annotation";if(!dQ($))return;y1.getState().updateAttachment(Z,J,{status:"uploading"});try{let z=await cQ(Z,new File([B],`${X}.png`,{type:"image/png"}));if(!Q())return;y1.getState().updateAttachment(Z,J,{status:"ready",upload:z,mediaType:z.mediaType})}catch{if(!Q())return;y1.getState().removeAttachment(Z,J)}}function B70({workspaceId:$,sessionId:Z},J){if(!vL({workspaceId:$,sessionId:Z}))return;y1.getState().addAttachments($,Z,[{kind:"text",localId:crypto.randomUUID(),...J}])}function bv({workspaceId:$,sessionId:Z,activeTab:J,mode:H,available:B,closePopup:Q,openPopup:X}){let z=Z2.useRef(null),G=Z2.useRef(new Map),U=q5(Q),Y=q5(X),K=Z2.useCallback((T)=>{let y=z.current;if(!y)return;if(!T){y1.getState().removeAttachment(y.workspaceId,y.attachmentId);return}dQ({workspaceId:y.workspaceId,sessionId:y.sourceSessionId,localId:y.attachmentId,purpose:"annotation",source:y.source,blob:T})},[]),F=Z2.useCallback(async(T)=>{let y=z.current;if(!y)return;z.current=null;let R=(G.current.get(y.attachmentId)??0)+1;G.current.set(y.attachmentId,R);let x=()=>G.current.get(y.attachmentId)===R,v=await T;if(!v||!x())return;await eK({workspaceId:y.workspaceId,sessionId:y.sourceSessionId,localId:y.attachmentId,purpose:"annotation",source:y.source,blob:v,isCurrent:x})},[]),W=Z2.useCallback(async(T)=>{let y=z.current;if(await F(T),y?.origin==="popup")Y.current()},[Y,F]),q=nK({onChange:K,onFinish:W}),{controls:N}=q,{active:D,starting:A,open:V,finish:L,flush:O,cancel:M}=N;Z2.useLayoutEffect(()=>()=>{if(z.current)F(O())},[O,F]);let _=Z2.useCallback(async(T)=>{if(!B||D||A)return;let y={workspaceId:$,sourceSessionId:Z,source:J,origin:T,attachmentId:crypto.randomUUID()};z.current=y;try{if(!await V()){if(z.current===y)z.current=null;return}if(T==="popup")U.current()}catch{if(z.current!==y)return;z.current=null,e1.add({title:"Couldn’t capture this page",type:"error"})}},[D,J,B,U,V,Z,A,$]),w=Z2.useCallback(async()=>{let T=z.current?F(O()):void 0;await M(),await T},[M,O,F]),C=Z2.useCallback((T)=>{let y=(G.current.get(T)??0)+1;if(G.current.set(T,y),y1.getState().removeAttachment($,T),z.current?.attachmentId===T)z.current=null,M()},[M,$]),E=Z2.useCallback(async()=>{if(A){await w();return}await L()},[w,L,A]),j=Z2.useCallback(()=>{if(D||A)E();else _("docked")},[D,E,_,A]),k=Z2.useCallback(()=>{if(D||A)E();else _("popup")},[D,E,_,A]);Z2.useEffect(()=>{let T=z.current;if(!T)return;let y=T.origin==="docked"?"split":"fullscreen";if(T.workspaceId!==$||T.sourceSessionId!==Z||T.source!==J||H!==y||!B)w()},[J,B,w,H,Z,$]);let S=Z2.useMemo(()=>B?{active:D||A,finish:E,onRemove:C,onToggle:j}:void 0,[B,D,A,E,C,j]),I=Z2.useMemo(()=>B?{active:D||A,finish:E,onRemove:C,onToggle:k}:void 0,[B,D,A,E,C,k]);return Z2.useMemo(()=>({...q,docked:S,popup:I}),[q,S,I])}var $8=P(m(),1);var m8=P(c(),1);function fL($){if(!$)return;$.focus();let Z=$.value.length;$.setSelectionRange(Z,Z)}function Sv({composerRef:$,className:Z,onMouseDown:J,children:H,...B}){return m8.jsx("form",{...B,onMouseDown:(Q)=>{if(J?.(Q),Q.defaultPrevented)return;if(Q.target instanceof Element&&Q.target.closest('button, input, textarea, select, a, [contenteditable="true"]'))return;fL($.current)},className:Q0("group/composer flex w-full cursor-text flex-col gap-1 rounded-xl bg-card p-2 text-card-foreground shadow-xs transition-[color,box-shadow] outline-none focus-within:shadow-sm",Z),children:H})}function Rv({textareaRef:$,className:Z,...J}){return m8.jsx("textarea",{...J,ref:$,className:Q0("field-sizing-content max-h-40 w-full resize-none bg-transparent px-2 py-1 text-sm leading-relaxed outline-none placeholder:text-muted-foreground disabled:opacity-50",Z)})}function Iv({className:$,children:Z,...J}){return m8.jsx("div",{...J,className:Q0("flex items-center justify-end gap-3",$),children:Z})}function Q70($){if($.status==="checking")return"Checking agent status…";return}function lQ($,Z,J){return $&&!Z&&J.status==="available"}function kv({label:$,hasContent:Z,busy:J=!1,loading:H=!1,availability:B}){let Q=lQ(Z,J||H,B),X=Q70(B),z=m8.jsx(M0,{type:"submit",size:"icon",disabled:!Q,"aria-label":$,children:H?m8.jsx(r2,{}):m8.jsx(wv,{stroke:1.5})});if(H||!X)return z;return m8.jsxs(i1,{children:[m8.jsx(r1,{render:m8.jsx("span",{className:"inline-flex",children:z})}),m8.jsx(a1,{className:"max-w-64 text-center",children:X})]})}var D8=P(m(),1),X70=48;function yv($,Z){let J=D8.useRef(!0),[H,B]=D8.useState(!0),Q=D8.useCallback((G)=>{J.current=G,B((U)=>U===G?U:G)},[]),X=D8.useCallback((G="auto")=>{let U=$.current;if(!U)return;Q(!0),U.scrollTo({top:U.scrollHeight,behavior:G})},[$,Q]),z=D8.useCallback(()=>{let G=$.current;if(!G)return;Q(!1),G.scrollTo({top:0,behavior:"auto"})},[$,Q]);return D8.useEffect(()=>{let G=$.current;if(!G)return;let U=()=>{let Y=G.scrollHeight-G.scrollTop-G.clientHeight;Q(Y<=X70)};return G.addEventListener("scroll",U,{passive:!0}),()=>G.removeEventListener("scroll",U)},[$,Q]),D8.useEffect(()=>{let G=$.current;if(!G)return;let U=G.firstElementChild??G,Y=new ResizeObserver(()=>{if(J.current)G.scrollTop=G.scrollHeight});return Y.observe(U),()=>Y.disconnect()},[$]),D8.useLayoutEffect(()=>{X("auto")},[Z,X]),{atBottom:H,scrollToBottom:X,scrollToTop:z}}function z70($){return $.origin.kind!=="replay"&&$.origin.kind!=="synthetic"&&$.origin.kind!=="subagent-prompt"}function xv($,Z){let J=$.meta||Z.meta?{...$.meta,...Z.meta}:void 0;return{...$,parts:[...$.parts,...Z.parts],timestamp:Z.timestamp??$.timestamp,meta:J}}function hv($,Z){if(!Z)return $;let J=$.at(-1);if(J?.role==="assistant")return[...$.slice(0,-1),xv(J,Z)];return[...$,Z]}function vv($){let Z=[];for(let J of $){if(!z70(J))continue;if(J.role!=="assistant"){Z.push(J);continue}let H=Z.length>0?Z[Z.length-1]:null;if(H?.role==="assistant")Z[Z.length-1]=xv(H,J);else Z.push(J)}return Z.map((J,H)=>{let B=Z[H-1];if(J.role!=="assistant"||J.meta?.durationMs!==void 0||B?.role!=="user"||B.origin.kind!=="user-input"||!B.timestamp||!J.timestamp)return J;let Q=Date.parse(B.timestamp),X=Date.parse(J.timestamp);if(!Number.isFinite(Q)||!Number.isFinite(X)||X<Q)return J;return{...J,meta:{...J.meta,durationMs:X-Q}}})}function gL($){switch($.kind){case"warning":return $.message;case"compact":return"Context compacted";case"model-change":return $.prev?`Model changed to ${$.model} (was ${$.prev})`:`Model changed to ${$.model}`;case"api-retry":return $.error?`Retrying: ${$.error}`:"Retrying the connection";case"rate-limit":case"hook":case"session-state":case"files-persisted":case"elicitation":default:return null}}function fv($){if(!$)return;let Z=Date.parse($);return Number.isNaN(Z)?void 0:Z}function gv($,Z){let J=Z.filter((G)=>gL(G)!==null);if(J.length===0)return $.map((G)=>({kind:"turn",turn:G}));let H=[],B=[];for(let G of J){let U=fv(G.at);if(U===void 0)B.push(G);else H.push({notice:G,time:U})}H.sort((G,U)=>G.time-U.time);let Q=[],X=0,z=Number.NEGATIVE_INFINITY;for(let G of $){z=Math.max(z,fv(G.timestamp)??z);while(X<H.length&&H[X].time<=z)Q.push({kind:"notice",notice:H[X].notice}),X+=1;Q.push({kind:"turn",turn:G})}for(;X<H.length;X+=1)Q.push({kind:"notice",notice:H[X].notice});for(let G of B)Q.push({kind:"notice",notice:G});return Q}var J2=P(c(),1);function sJ({label:$,icon:Z,onRemove:J,previewUrl:H,loading:B,className:Q,children:X,...z}){return J2.jsxs("div",{...z,className:Q0("group relative flex max-w-full min-w-0 cursor-default items-center rounded-md bg-background text-sm whitespace-nowrap text-foreground ring-1 ring-border outline-none focus-visible:ring-3 focus-visible:ring-ring/50",H?"size-14 overflow-hidden":"h-7 pr-2 pl-0.5",Q),children:[B&&J2.jsx("div",{className:"pointer-events-none absolute inset-0 flex items-center justify-center bg-background/70",children:J2.jsx(d5,{size:16,stroke:1.75,className:"animate-spin text-muted-foreground"})}),H?J2.jsx(U70,{label:$,previewUrl:H,onRemove:J}):J2.jsx(G70,{label:$,icon:Z,onRemove:J}),X]})}function G70({label:$,icon:Z,onRemove:J}){return J2.jsxs(J2.Fragment,{children:[J?J2.jsxs(M0,{type:"button",variant:"ghost",size:"icon-sm",onClick:J,"aria-label":`Remove ${$}`,className:"size-6 shrink-0 hover:bg-transparent hover:text-current",children:[J2.jsx(Z,{stroke:1.75,className:"group-focus-within:hidden group-hover:hidden"}),J2.jsx(e5,{stroke:1.75,className:"hidden group-focus-within:block group-hover:block"})]}):J2.jsx("span",{className:"flex size-6 shrink-0 items-center justify-center",children:J2.jsx(Z,{size:16,stroke:1.75})}),J2.jsx("span",{className:"truncate",children:$})]})}function U70({label:$,previewUrl:Z,onRemove:J}){return J2.jsxs(J2.Fragment,{children:[J2.jsx("img",{src:Z,alt:$,className:"size-full object-cover"}),J&&J2.jsx(M0,{type:"button",variant:"outline",size:"icon-sm",onClick:J,"aria-label":`Remove ${$}`,className:"absolute top-1 right-1 size-4 rounded-xs border-0 opacity-0 shadow-xs transition-opacity group-focus-within:opacity-100 group-hover:opacity-100 [&_svg]:size-3",children:J2.jsx(e5,{stroke:1.75})})]})}var uv=P(c(),1);function iQ({label:$,onRemove:Z}){return uv.jsx(sJ,{label:$,icon:mv,onRemove:Z})}var U7={};I5(U7,{createHandle:()=>Ff,Viewport:()=>Kf,Trigger:()=>Zf,Root:()=>nv,Positioner:()=>Hf,Portal:()=>ev,Popup:()=>Qf,Handle:()=>BF,Backdrop:()=>Uf,Arrow:()=>zf});var ov=P(m(),1);var $F=P(m(),1),mL=$F.createContext(void 0);function q4($){let Z=$F.useContext(mL);if(Z===void 0&&!$)throw Error(I0(50));return Z}var cv=P(m(),1);var pv=600,ZF=300;var dv={...f9,instantType:($)=>$.instantType,adaptiveOrigin:($)=>$.adaptiveOrigin,closeDelay:($)=>$.closeDelay};class uL extends g2{constructor($,Z,J){let H=new R2;super(iv($,H,Z,J),rv(H),dv)}setOpen=($,Z)=>{let{inlineRectCoordsRef:J}=this.context;WG(this,$,Z,{onBeforeDispatch(){let H=Z.event;if($&&Z.reason===K0.triggerHover&&Z.trigger&&"clientX"in H&&"clientY"in H&&J.current?.element!==Z.trigger)vA(J,Z.trigger,H.clientX,H.clientY)}})}}function lv(){let $=new R2;return new H9(Object.freeze(iv(void 0,$)),Object.freeze(rv($)),dv)}function iv($,Z,J,H=!1){return{...v9(Z,J,H),instantType:void 0,adaptiveOrigin:void 0,closeDelay:ZF,...$}}function rv($){return{popupRef:cv.createRef(),onOpenChange:void 0,onOpenChangeComplete:void 0,triggerElements:$,inlineRectCoordsRef:{current:void 0}}}var G7=P(c(),1);function av($){let{open:Z,defaultOpen:J=!1,onOpenChange:H,onOpenChangeComplete:B,actionsRef:Q,handle:X,triggerId:z,defaultTriggerId:G=null,children:U}=$,Y=A6((A,V)=>new uL({open:J,openProp:Z,activeTriggerId:G,triggerIdProp:z},A,V));Y.useControlledProp("openProp",Z),Y.useControlledProp("triggerIdProp",z),Y.useContextCallback("onOpenChange",H),Y.useContextCallback("onOpenChangeComplete",B);let K=Y.useState("open"),F=Y.useState("activeTriggerId"),W=Y.useState("mounted"),q=Y.useState("payload");y9(Y,{closeOnActiveTriggerUnmount:!0});let{forceUnmount:N}=x9(K,Y,()=>{Y.context.inlineRectCoordsRef.current=void 0});H0(()=>{if(K){if(F==null)Y.set("payload",void 0)}},[Y,F,K]),ov.useImperativeHandle(Q,()=>({unmount:N,close:()=>Y.setOpen(!1,w0(K0.imperativeAction))}),[N,Y]);let D=K||W;return G7.jsxs(mL.Provider,{value:Y,children:[X&&G7.jsx(I9,{handle:X,store:Y}),D&&G7.jsx(Y70,{store:Y}),typeof U==="function"?U({payload:q}):U]})}function Y70({store:$}){let Z=$.useState("floatingRootContext"),J=e8(Z);return h9($,{activeTriggerProps:J.reference,inactiveTriggerProps:J.trigger,popupProps:J.floating}),null}var nv=r8(function(Z){if(q4(!0))return G7.jsx(av,{...Z});return G7.jsx(G$,{children:G7.jsx(av,{...Z})})});var tv=P(m(),1);var JF=P(m(),1),pL=JF.createContext(void 0);function sv(){let $=JF.useContext(pL);if($===void 0)throw Error(I0(48));return $}var cL=P(c(),1),ev=tv.forwardRef(function(Z,J){let{keepMounted:H=!1,...B}=Z;if(!(q4().useState("mounted")||H))return null;return cL.jsx(pL.Provider,{value:H,children:cL.jsx(fZ,{ref:J,...B})})});var $f=P(m(),1);var Zf=T9(function(Z,J){let{render:H,className:B,delay:Q,closeDelay:X,id:z,payload:G,handle:U,style:Y,...K}=Z,F=q4(!0),q=g9(U)??F;if(!q)throw Error(I0(89));let N=s0(z),D=q.useState("isTriggerActive",N),A=q.useState("isOpenedByTrigger",N),V=q.useState("floatingRootContext"),L=q.context.inlineRectCoordsRef,O=$f.useRef(null),M=Q??pv,_=X??ZF,{registerTrigger:w,isMountedByThisTrigger:C}=k9(N,O,q,{payload:G,closeDelay:_}),E=Z9(V,{mouseOnly:!0,move:!1,handleClose:J9(),delay:()=>({open:M,close:_}),triggerElementRef:O,isActiveTrigger:D,isClosing:()=>q.select("transitionStatus")==="ending"}),j=F$(V,{delay:M}),k={open:A},S=q.useState("triggerProps",C),I=lC(L,A);return G0("a",Z,{state:k,ref:[J,w,O],props:[E,j.reference,S,I,{id:N},K],stateAttributesMapping:C9})});var Jf=P(m(),1);var HF=P(m(),1),dL=HF.createContext(void 0);function tJ(){let $=HF.useContext(dL);if($===void 0)throw Error(I0(49));return $}var lL=P(c(),1),Hf=Jf.forwardRef(function(Z,J){let{render:H,className:B,anchor:Q,positionMethod:X="absolute",side:z="bottom",align:G="center",sideOffset:U=0,alignOffset:Y=0,collisionBoundary:K="clipping-ancestors",collisionPadding:F=5,arrowPadding:W=5,sticky:q=!1,disableAnchorTracking:N=!1,collisionAvoidance:D=S9,style:A,...V}=Z,L=q4(),O=sv(),M=b3(),_=L.useState("open"),w=L.useState("mounted"),C=L.useState("floatingRootContext"),E=L.useState("instantType"),j=L.useState("transitionStatus"),k=L.useState("adaptiveOrigin"),S=L.context.inlineRectCoordsRef,I=u9({anchor:Q,floatingRootContext:C,positionMethod:X,mounted:w,side:z,sideOffset:U,align:G,alignOffset:Y,arrowPadding:W,collisionBoundary:K,collisionPadding:F,sticky:q,disableAnchorTracking:N,keepMounted:O,nodeId:M,collisionAvoidance:D,adaptiveOrigin:k,inline:iC(S)}),T=I.update;H0(()=>{if(_&&w)T()},[_,w,T]);let y={open:_,side:I.side,align:I.align,anchorHidden:I.anchorHidden,instant:E},R=c9(Z,y,{styles:I.positionerStyles,transitionStatus:j,props:V,refs:[J,L.useStateSetter("positionerElement")],hidden:!w,inert:!_});return lL.jsx(dL.Provider,{value:I,children:lL.jsx(z$,{id:M,children:R})})});var Bf=P(m(),1);var Qf=Bf.forwardRef(function(Z,J){let{className:H,render:B,style:Q,...X}=Z,z=q4(),{side:G,align:U}=tJ(),Y=z.useState("open"),K=z.useState("instantType"),F=z.useState("transitionStatus"),W=z.useState("popupProps"),q=z.useState("floatingRootContext"),N=z.useState("closeDelay");return V5({open:Y,ref:z.context.popupRef,onComplete(){if(Y)z.context.onOpenChangeComplete?.(!0)}}),S3(q,{closeDelay:N}),G0("div",Z,{state:{open:Y,side:G,align:U,instant:K,transitionStatus:F},ref:[J,z.context.popupRef,z.useStateSetter("popupElement")],props:[R9,W,p9(F),X],stateAttributesMapping:J4})});var Xf=P(m(),1);var zf=Xf.forwardRef(function(Z,J){let{render:H,className:B,style:Q,...X}=Z,z=q4(),{arrowRef:G,side:U,align:Y,arrowUncentered:K,arrowStyles:F}=tJ(),q={open:z.useState("open"),side:U,align:Y,uncentered:K};return G0("div",Z,{state:q,ref:[G,J],props:[{style:F,"aria-hidden":!0},X],stateAttributesMapping:z8})});var Gf=P(m(),1);var Uf=Gf.forwardRef(function(Z,J){let{render:H,className:B,style:Q,...X}=Z,z=q4(),G=z.useState("open"),U=z.useState("mounted"),Y=z.useState("transitionStatus");return G0("div",Z,{state:{open:G,transitionStatus:Y},ref:[J],props:[{role:"presentation",hidden:!U,style:{pointerEvents:"none",userSelect:"none",WebkitUserSelect:"none"}},X],stateAttributesMapping:J4})});var Yf=P(m(),1);var Kf=Yf.forwardRef(function(Z,J){let{render:H,className:B,style:Q,children:X,...z}=Z,G=q4(),U=tJ(),Y=G.useState("instantType"),{children:K,state:F}=L6({store:G,side:U.side,children:X}),W={activationDirection:F.activationDirection,transitioning:F.transitioning,instant:Y};return G0("div",Z,{state:W,ref:J,props:[z,{children:K}],stateAttributesMapping:V6})});class BF extends $9{constructor(){super(lv(),"PreviewCard")}open($){this.openByTrigger($)}close(){this.closePopup()}get isOpen(){return this.attachedStore?.select("open")??!1}}function Ff(){return new BF}var eJ=P(c(),1);function Wf({...$}){return eJ.jsx(U7.Root,{"data-slot":"hover-card",...$})}function qf({...$}){return eJ.jsx(U7.Trigger,{"data-slot":"hover-card-trigger",...$})}function Nf({className:$,side:Z="bottom",sideOffset:J=4,align:H="center",alignOffset:B=0,...Q}){return eJ.jsx(I8,{portal:U7.Portal,"data-slot":"hover-card-portal",children:eJ.jsx(U7.Positioner,{align:H,alignOffset:B,side:Z,sideOffset:J,className:"isolate z-50",children:eJ.jsx(U7.Popup,{"data-slot":"hover-card-content",className:i0("z-50 w-64 origin-(--transform-origin) rounded-lg bg-popover p-3 text-sm text-popover-foreground shadow-md outline-hidden duration-100 data-[side=bottom]:slide-in-from-top-2 data-[side=inline-end]:slide-in-from-left-2 data-[side=inline-start]:slide-in-from-right-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95",$),...Q})})})}var m$=P(c(),1);function Af({attachment:$,onRemove:Z}){let{previewUrl:J,purpose:H}=$,B=H==="sketch"?"Sketch":"Annotation";return m$.jsxs(Wf,{children:[m$.jsx(qf,{render:m$.jsx(sJ,{tabIndex:0,label:B,icon:$H,onRemove:Z})}),J&&m$.jsx(Nf,{side:"top",align:"start",className:"w-60 max-w-[calc(100vw-2rem)] rounded-xl",children:m$.jsx("img",{src:J,alt:`${B} preview`,className:"max-h-72 w-full rounded-md object-contain"})})]})}var Vf=P(c(),1);function Df({attachment:$,onRemove:Z}){return Vf.jsx(sJ,{label:$.label,icon:bJ,onRemove:Z,previewUrl:$.previewUrl,loading:$.status==="uploading",title:$.label,className:"max-w-52"})}var c$=P(m(),1);var UH=P(m(),1);var K70=["fable","opus","sonnet","haiku"];function QF($,Z,J=$.find((H)=>H.value==="default")?.resolvedModel){let H=$.filter((B)=>B.value!=="default");return H.find((B)=>B.value===Z)??H.find((B)=>(B.resolvedModel??B.value)===J)??H[0]}function Lf($){let Z=$.resolvedModel??$.value,J=K70.findIndex((H)=>Z===H||Z.startsWith(`${H}[`)||Z.includes(`-${H}-`));return J===-1?void 0:J}function F70($,Z){if($===void 0&&Z===void 0)return 0;if($===void 0)return-1;if(Z===void 0)return 1;return $-Z}function W70($,Z){return F70(Lf($),Lf(Z))}var q70={"claude-code":W70};function N70($,Z){return $.map((J,H)=>({model:J,index:H})).sort((J,H)=>Z(J.model,H.model)||J.index-H.index).map(({model:J})=>J)}function iL($,Z,J){if(Z&&$.includes(Z))return Z;if(J&&$.includes(J))return J;if($.includes("high"))return"high";return $[$.length-1]}function Mf($,Z,J){let H=iL($,Z,J);return H?$.indexOf(H):-1}function Pf($){return $.length>1}function _f($,Z){if($.supportsFastMode!==!0)return!1;return Z??$.defaultFastMode??!1}function Of($,Z){let J=q70[Z];return J?N70($,J):$}function jf($,Z){let J=[];for(let H of $){let B=H.group??Z,Q=J.find((X)=>X.label===B);if(Q)Q.models.push(H);else J.push({label:B,models:[H]})}return J}var s4={};I5(s4,{createHandle:()=>Og,Viewport:()=>Vg,Trigger:()=>Ag,SubmenuTrigger:()=>_g,SubmenuRoot:()=>Kg,Separator:()=>Mg,Root:()=>EF,RadioItemIndicator:()=>Qg,RadioItem:()=>Bg,RadioGroup:()=>Zg,Positioner:()=>ef,Portal:()=>nf,Popup:()=>rf,LinkItem:()=>df,Item:()=>cf,Handle:()=>RF,GroupLabel:()=>uf,Group:()=>gf,CheckboxItemIndicator:()=>hf,CheckboxItem:()=>xf,Backdrop:()=>bf,Arrow:()=>Cf});var Tf=P(m(),1);var XF=P(m(),1),rL=XF.createContext(void 0);function N4($){let Z=XF.useContext(rL);if(Z===void 0&&!$)throw Error(I0(33));return Z}var zF=P(m(),1),aL=zF.createContext(void 0);function j5($){let Z=zF.useContext(aL);if(Z===void 0&&!$)throw Error(I0(36));return Z}var Cf=Tf.forwardRef(function(Z,J){let{render:H,className:B,style:Q,...X}=Z,{store:z}=j5(),{arrowRef:G,side:U,align:Y,arrowUncentered:K,arrowStyles:F}=N4(),q={open:z.useState("open"),side:U,align:Y,uncentered:K};return G0("div",Z,{ref:[G,J],stateAttributesMapping:z8,state:q,props:{style:F,"aria-hidden":!0,...X}})});var Ef=P(m(),1);var GF=P(m(),1),A70=GF.createContext(void 0);function Y7($=!0){let Z=GF.useContext(A70);if(Z===void 0&&!$)throw Error(I0(25));return Z}var bf=Ef.forwardRef(function(Z,J){let{render:H,className:B,style:Q,...X}=Z,{store:z}=j5(),G=z.useState("open"),U=z.useState("mounted"),Y=z.useState("transitionStatus"),K=z.useState("lastOpenChangeReason"),F=Y7(),W={open:G,transitionStatus:Y};return G0("div",Z,{ref:F?.backdropRef?[J,F.backdropRef]:J,state:W,stateAttributesMapping:J4,props:[{role:"presentation",hidden:!U,style:{pointerEvents:K===K0.triggerHover?"none":void 0,userSelect:"none",WebkitUserSelect:"none"}},X]})});var FF=P(m(),1);var UF=P(m(),1),oL=UF.createContext(void 0);function wf(){let $=UF.useContext(oL);if($===void 0)throw Error(I0(30));return $}var JH=P(m(),1);var Sf=P(m(),1);function YF($){let{closeOnClick:Z,highlighted:J,id:H,nodeId:B,store:Q,typingRef:X,itemRef:z,itemMetadata:G}=$,{events:U}=Q.useState("floatingTreeRoot"),Y=Q.useState("open"),K=Y7(!0),F=K!==void 0;return Sf.useMemo(()=>({id:H,role:"menuitem",tabIndex:Y&&J?0:-1,onKeyDown(W){if(W.key===" "&&X?.current)W.preventDefault()},onMouseMove(W){if(!B)return;U.emit("itemhover",{nodeId:B,target:W.currentTarget})},onClick(W){if(Z)U.emit("close",{domEvent:W,reason:K0.itemPress})},onMouseUp(W){if(K){let q=K.initialCursorPointRef.current;if(K.initialCursorPointRef.current=null,F&&q&&Math.abs(W.clientX-q.x)<=1&&Math.abs(W.clientY-q.y)<=1)return;if(F&&!J5.os.mac&&W.button===2)return}if(z.current&&Q.context.allowMouseUpTriggerRef.current&&(!F||W.button===2)){if(G.type==="regular-item")ZH(z.current,W,{detail:1})}}}),[Z,J,H,U,B,Y,Q,X,z,K,F,G])}var K7={type:"regular-item"};function F7($){let{closeOnClick:Z,disabled:J,highlighted:H,id:B,store:Q,typingRef:X=Q.context.typingRef,nativeButton:z,itemMetadata:G,nodeId:U}=$,Y=JH.useRef(null),{getButtonProps:K,buttonRef:F}=w5({disabled:J,focusableWhenDisabled:!0,native:z,composite:!0}),W=YF({closeOnClick:Z,highlighted:H,id:B,nodeId:U,store:Q,typingRef:X,itemRef:Y,itemMetadata:G}),q=JH.useCallback((D)=>{return Y2(W,{onMouseEnter(){if(G.type!=="submenu-trigger")return;G.setActive()}},D,K)},[W,K,G]),N=p2(Y,F);return JH.useMemo(()=>({getItemProps:q,itemRef:N}),[q,N])}var u$=P(m(),1);var KF=P(m(),1),nL=KF.createContext({register:()=>{},unregister:()=>{},subscribeMapChange:()=>()=>{},nextIndexRef:{current:0}});function Rf(){return KF.useContext(nL)}function A4($={}){let{guess:Z,label:J,metadata:H,textRef:B,index:Q}=$,{register:X,unregister:z,subscribeMapChange:G,nextIndexRef:U}=Rf(),Y=u$.useRef(-1),[K,F]=u$.useState(Q==null&&Z?()=>{if(Y.current===-1){let D=U.current;U.current+=1,Y.current=D}return Y.current}:-1),W=Q??K,q=u$.useRef(null),N=u$.useCallback((D)=>{let A=q.current;if(A)z(A);if(q.current=D,D)X(D,{metadata:H??null,index:Q??null,label:J,textRef:B})},[Q,X,z,H,J,B]);return H0(()=>{if(Q!=null)return;return G((D)=>{let A=q.current?D.get(q.current)?.index:null;if(A!=null)F(A)})},[Q,G]),{ref:N,index:W}}var If="data-checked",kf="data-unchecked";var W7={checked($){if($)return{[If]:""};return{[kf]:""}},...G2};var yf=P(c(),1),xf=FF.forwardRef(function(Z,J){let{render:H,className:B,id:Q,label:X,nativeButton:z=!1,disabled:G=!1,closeOnClick:U=!1,checked:Y,defaultChecked:K,onCheckedChange:F,style:W,...q}=Z,N=A4({guess:!0,label:X}),D=N4(!0),A=s0(Q),{store:V}=j5(),L=V.useState("disabled"),O=G||L,M=V.useState("isActive",N.index),_=V.useState("itemProps"),[w,C]=F4({controlled:Y,default:K??!1,name:"MenuCheckboxItem",state:"checked"}),{getItemProps:E,itemRef:j}=F7({closeOnClick:U,disabled:O,highlighted:M,id:A,store:V,nativeButton:z,nodeId:D?.context.nodeId,itemMetadata:K7}),k=FF.useMemo(()=>({disabled:O,highlighted:M,checked:w}),[O,M,w]);function S(T){let y=w0(K0.itemPress,T.nativeEvent,void 0,{preventUnmountOnClose:U1});if(F?.(!w,y),y.isCanceled)return;C((R)=>!R)}let I=G0("div",Z,{state:k,stateAttributesMapping:W7,props:[_,{role:"menuitemcheckbox","aria-checked":w,onClick:S},q,E],ref:[j,J,N.ref]});return yf.jsx(oL.Provider,{value:k,children:I})});var WF=P(m(),1);var hf=WF.forwardRef(function(Z,J){let{render:H,className:B,style:Q,keepMounted:X=!1,...z}=Z,G=wf(),U=WF.useRef(null),{transitionStatus:Y,mounted:K,setMounted:F}=S2(G.checked);V5({batch:!0,enabled:!G.checked,open:G.checked,ref:U,onComplete(){if(!G.checked)F(!1)}});let W={checked:G.checked,disabled:G.disabled,highlighted:G.highlighted,transitionStatus:Y};return G0("span",Z,{state:W,ref:[J,U],stateAttributesMapping:W7,props:{"aria-hidden":!0,...z},enabled:X||K})});var NF=P(m(),1);var qF=P(m(),1),rQ=qF.createContext(void 0);function vf(){let $=qF.useContext(rQ);if($===void 0)throw Error(I0(31));return $}var ff=P(c(),1),gf=NF.forwardRef(function(Z,J){let{render:H,className:B,style:Q,...X}=Z,[z,G]=NF.useState(void 0),U=G0("div",Z,{ref:J,props:{role:"group","aria-labelledby":z,...X}});return ff.jsx(rQ.Provider,{value:G,children:U})});var mf=P(m(),1);var uf=mf.forwardRef(function(Z,J){let{render:H,className:B,style:Q,id:X,...z}=Z,G=s0(X),U=vf();return H0(()=>{return U(G),()=>{U((Y)=>Y===G?void 0:Y)}},[U,G]),G0("div",Z,{ref:J,props:{id:G,"aria-hidden":!0,...z}})});var pf=P(m(),1);var cf=pf.forwardRef(function(Z,J){let{render:H,className:B,id:Q,label:X,nativeButton:z=!1,disabled:G=!1,closeOnClick:U=!0,style:Y,...K}=Z,F=A4({guess:!0,label:X}),W=N4(!0),q=s0(Q),{store:N}=j5(),D=N.useState("disabled"),A=G||D,V=N.useState("isActive",F.index),L=N.useState("itemProps"),{getItemProps:O,itemRef:M}=F7({closeOnClick:U,disabled:A,highlighted:V,id:q,store:N,nativeButton:z,nodeId:W?.context.nodeId,itemMetadata:K7});return G0("div",Z,{state:{disabled:A,highlighted:V},props:[L,K,O],ref:[M,J,F.ref]})});var AF=P(m(),1);var df=AF.forwardRef(function(Z,J){let{render:H,className:B,id:Q,label:X,closeOnClick:z=!1,style:G,...U}=Z,Y=AF.useRef(null),K=A4({guess:!0,label:X}),W=N4(!0)?.context.nodeId,q=s0(Q),{store:N}=j5(),D=N.useState("isActive",K.index),A=N.useState("itemProps"),V=N.context.typingRef,{getButtonProps:L,buttonRef:O}=w5({native:!1,composite:!0}),M=YF({closeOnClick:z,highlighted:D,id:q,nodeId:W,store:N,typingRef:V,itemRef:Y,itemMetadata:K7});function _(C){return Y2(M,C,L)}return G0("a",Z,{state:{highlighted:D},props:[A,U,_],ref:[Y,O,J,K.ref]})});var DF=P(m(),1);var lf=P(c(),1),rf=DF.forwardRef(function(Z,J){let{render:H,className:B,style:Q,finalFocus:X,...z}=Z,{store:G}=j5(),{side:U,align:Y}=N4(),K=XU(!0)!=null,F=G.useState("open"),W=G.useState("transitionStatus"),q=G.useState("popupProps"),N=G.useState("mounted"),D=G.useState("instantType"),A=G.useState("activeTriggerElement"),V=G.useState("parent"),L=G.useState("lastOpenChangeReason"),O=G.useState("rootId"),M=G.useState("floatingRootContext"),_=G.useState("floatingTreeRoot"),w=G.useState("closeDelay"),C=G.useState("hoverEnabled"),E=G.useState("disabled"),j=G.useState("openMethod"),k=V.type==="context-menu";V5({open:F,ref:G.context.popupRef,onComplete(){if(F)G.context.onOpenChangeComplete?.(!0)}}),DF.useEffect(()=>{function R(x){G.setOpen(!1,w0(x.reason,x.domEvent))}return _.events.on("close",R),()=>{_.events.off("close",R)}},[_.events,G]),S3(M,{enabled:C&&!E&&!k&&V.type!=="menubar",closeDelay:w});let S=G.useStateSetter("popupElement"),I={transitionStatus:W,side:U,align:Y,open:F,nested:V.type==="menu",instant:D},T=G0("div",Z,{state:I,ref:[J,G.context.popupRef,S],stateAttributesMapping:J4,props:[q,{onKeyDown(R){if(K&&B9.has(R.key))R.stopPropagation()}},p9(W),z,{"data-rootownerid":O}]}),y=V.type===void 0||k;if(A||V.type==="menubar"&&L!==K0.outsidePress)y=!0;return lf.jsx(U$,{context:M,openInteractionType:j,modal:k,disabled:!N,returnFocus:X===void 0?y:X,initialFocus:V.type!=="menu",restoreFocus:!0,externalTree:V.type!=="menubar"?_:void 0,previousFocusableElement:A,nextFocusableElement:V.type===void 0?G.context.triggerFocusTargetRef:void 0,beforeContentFocusGuardRef:V.type===void 0?G.context.beforeContentFocusGuardRef:void 0,children:T})});var of=P(m(),1);var VF=P(m(),1),sL=VF.createContext(void 0);function af(){let $=VF.useContext(sL);if($===void 0)throw Error(I0(32));return $}var tL=P(c(),1),nf=of.forwardRef(function(Z,J){let{keepMounted:H=!1,...B}=Z,{store:Q,parent:X}=j5();if(!(Q.useState("mounted")||H))return null;let U=X.type==="menu"||X.type==="menubar"?"group":void 0;return tL.jsx(sL.Provider,{value:H,children:tL.jsx(Q$,{ref:J,...B,portalOwnerRole:U})})});var Q3=P(m(),1);var p3=P(m(),1);var sf=P(c(),1);function q7($){let{children:Z,elementsRef:J,labelsRef:H,onMapChange:B}=$,Q=Y0(B),[,X]=p3.useState(!1),z=Z5(L70).current,G=Z5(V70).current,U=p3.useRef(0),Y=p3.useRef(!0),K=p3.useRef(null),F=p3.useRef(null),W=Y0(()=>{if(Y.current)return;Y.current=!0,X((M)=>!M)}),q=Y0((M,_)=>{G.set(M,_),W()}),N=Y0((M)=>{G.delete(M),W()}),D=Y0((M)=>{let _=new Map;if(J.current.length=0,H)H.current.length=0;return M.forEach((w)=>{if(_.set(w.element,{...w.registration.metadata??{},index:w.index}),J.current[w.index]=w.element,H)H.current[w.index]=w.registration.label!==void 0?w.registration.label:w.registration.textRef?.current?.textContent??w.element.textContent}),U.current=J.current.length,_});function A(M){if(F.current?.disconnect(),F.current=null,typeof MutationObserver!=="function"||M.length<2)return;let _=new MutationObserver((C)=>{if(!_70(C))return;let E=null;for(let j of M){if(!j.isConnected)continue;if(E&&tf(E,j)>0){_.disconnect(),W();return}E=j}});F.current=_;let w=new Set;for(let C=1;C<M.length;C+=1){let E=P70(M[C-1],M[C]);if(E)w.add(E)}w.forEach((C)=>_.observe(C,{childList:!0}))}let V=Y0(()=>{let[M,_]=M70(G),w=D(M),C=K.current,E=!C||C.length!==M.length||M.some((j,k)=>{let S=C[k];return j.index!==S.index||j.element!==S.element||j.registration.index!==S.registration.index||j.registration.metadata!==S.registration.metadata});if(A(_),K.current=M,Y.current=!1,!E)return;z.forEach((j)=>j(w)),Q(w)});H0(()=>{if(!Y.current&&K.current)D(K.current);return()=>{if(J.current=[],H)H.current=[]}},[J,H,D]),H0(()=>{if(Y.current)V()}),H0(()=>{return()=>{F.current?.disconnect(),Y.current=!0}},[]);let L=Y0((M)=>{return z.add(M),()=>{z.delete(M)}}),O=p3.useMemo(()=>({register:q,unregister:N,subscribeMapChange:L,nextIndexRef:U}),[q,N,L,U]);return sf.jsx(nL.Provider,{value:O,children:Z})}function V70(){return new Map}function L70(){return new Set}function M70($){let Z=new Set,J=[],H=[];$.forEach((Q,X)=>{if(!X.isConnected)return;let z=Q.index,G={index:z??-1,element:X,registration:Q};if(z===null)H.push(G);else if(z>=0)Z.add(z),J.push(G)});let B=0;if(H.sort((Q,X)=>tf(Q.element,X.element)),H.forEach((Q)=>{while(Z.has(B))B+=1;Q.index=B,J.push(Q),B+=1}),Z.size>0)J.sort((Q,X)=>Q.index-X.index);return[J,H.map((Q)=>Q.element)]}function P70($,Z){let J=$.parentElement;while(J&&!J.contains(Z))J=J.parentElement;return J}function _70($){for(let Z of $)for(let J=0;J<Z.removedNodes.length;J+=1)if(Z.removedNodes[J].isConnected)return!0;return!1}function tf($,Z){return $.compareDocumentPosition(Z)&Node.DOCUMENT_POSITION_FOLLOWING?-1:1}var HH=P(c(),1),ef=Q3.forwardRef(function(Z,J){let{anchor:H,positionMethod:B="absolute",className:Q,render:X,side:z,align:G,sideOffset:U=0,alignOffset:Y=0,collisionBoundary:K="clipping-ancestors",collisionPadding:F=5,arrowPadding:W=5,sticky:q=!1,disableAnchorTracking:N=!1,collisionAvoidance:D=aT,style:A,...V}=Z,{store:L}=j5(),O=af(),M=Y7(!0),_=L.useState("parent"),w=L.useState("floatingRootContext"),C=L.useState("floatingTreeRoot"),E=L.useState("mounted"),j=L.useState("open"),k=L.useState("modal"),S=L.useState("openMethod"),I=L.useState("activeTriggerElement"),T=L.useState("transitionStatus"),y=L.useState("positionerElement"),R=L.useState("instantType"),x=L.useState("adaptiveOrigin"),v=L.useState("lastOpenChangeReason"),f=L.useState("floatingNodeId"),b=L.useState("floatingParentNodeId"),l=w.useState("domReferenceElement"),r=Q3.useRef(null),h=d4(y),d=H,o=U,p=Y,i=G,n=D;if(_.type==="context-menu"){if(d=H??_.context?.anchor,i=i??"start",!z&&i!=="center")p=Z.alignOffset??2,o=Z.sideOffset??-5}let Z0=z,J0=i;if(_.type==="menu")Z0=Z0??"inline-end",J0=J0??"start",n=Z.collisionAvoidance??S9;else if(_.type==="menubar")Z0=Z0??(_.context.orientation==="vertical"?"inline-end":"bottom"),J0=J0??"start";let U0=_.type==="context-menu",z0=u9({anchor:d,floatingRootContext:w,positionMethod:M?"fixed":B,mounted:E,side:Z0,sideOffset:o,align:J0,alignOffset:p,arrowPadding:U0?0:W,collisionBoundary:K,collisionPadding:F,sticky:q,nodeId:f,keepMounted:O,disableAnchorTracking:N,collisionAvoidance:n,shift:U0?{crossAxis:!(("side"in n)&&n.side==="flip"),rootBoundary:"layoutViewport"}:void 0,externalTree:C,adaptiveOrigin:x});Q3.useEffect(()=>{function t(B0){if(B0.open){if(B0.parentNodeId===f)L.set("hoverEnabled",!1);if(B0.nodeId!==f&&B0.parentNodeId===L.select("floatingParentNodeId"))L.setOpen(!1,w0(K0.siblingOpen))}}return C.events.on("menuopenchange",t),()=>{C.events.off("menuopenchange",t)}},[L,C.events,f]),Q3.useEffect(()=>{if(L.select("floatingParentNodeId")==null)return;function t(B0){if(B0.open||B0.nodeId!==L.select("floatingParentNodeId"))return;let _0=B0.reason??K0.siblingOpen;L.setOpen(!1,w0(_0))}return C.events.on("menuopenchange",t),()=>{C.events.off("menuopenchange",t)}},[C.events,L]);let X0=t1();Q3.useEffect(()=>{if(!j)X0.clear()},[j,X0]),Q3.useEffect(()=>{function t(B0){if(!j||B0.nodeId!==L.select("floatingParentNodeId"))return;if(B0.target&&I&&I!==B0.target){let _0=L.select("closeDelay");if(_0>0){if(!X0.isStarted())X0.start(_0,()=>{L.setOpen(!1,w0(K0.siblingOpen))})}else L.setOpen(!1,w0(K0.siblingOpen))}else X0.clear()}return C.events.on("itemhover",t),()=>{C.events.off("itemhover",t)}},[C.events,j,I,L,X0]),Q3.useEffect(()=>{let t={open:j,nodeId:f,parentNodeId:b,reason:L.select("lastOpenChangeReason")};C.events.emit("menuopenchange",t)},[C.events,j,L,f,b]),H0(()=>{let t=l,B0=r.current;if(t)r.current=t;if(B0&&t&&t!==B0){L.set("instantType",void 0);let _0=new AbortController;return h(()=>{L.set("instantType","trigger-change")},_0.signal),()=>{_0.abort()}}return},[l,h,L]);let q0={open:j,side:z0.side,align:z0.align,anchorHidden:z0.anchorHidden,nested:_.type==="menu",instant:R},N0=_.type==="menubar"&&_.context.modal,F0=k&&v!==K0.triggerHover;JU(j&&(N0||F0),S==="touch",y,I);let s=c9(Z,q0,{styles:z0.positionerStyles,transitionStatus:T,props:V,refs:[J,L.useStateSetter("positionerElement")],hidden:!E,inert:!j}),a=E&&_.type!=="menu"&&(_.type!=="menubar"&&k&&v!==K0.triggerHover||_.type==="menubar"&&_.context.modal),$0=null;if(_.type==="menubar")$0=_.context.contentElement;else if(_.type===void 0)$0=I;return HH.jsxs(rL.Provider,{value:z0,children:[a&&HH.jsx(JJ,{ref:_.type==="context-menu"||_.type==="nested-context-menu"?_.context.internalBackdropRef:null,inert:b8(!j),cutout:$0}),HH.jsx(z$,{id:f,children:HH.jsx(q7,{elementsRef:L.context.itemDomElements,labelsRef:L.context.itemLabels,children:s})})]})});var N7=P(m(),1);var LF=P(m(),1),eL=LF.createContext(void 0);function $g(){let $=LF.useContext(eL);if($===void 0)throw Error(I0(34));return $}var $M=P(c(),1),Zg=N7.memo(N7.forwardRef(function(Z,J){let{render:H,className:B,value:Q,defaultValue:X,onValueChange:z,disabled:G=!1,style:U,"aria-labelledby":Y,...K}=Z,[F,W]=N7.useState(void 0),[q,N]=F4({controlled:Q,default:X,name:"MenuRadioGroup"}),D=Y0((O,M)=>{if(z?.(O,M),M.isCanceled)return;N(O)}),V=G0("div",Z,{state:{disabled:G},ref:J,props:{role:"group","aria-labelledby":Y??F,"aria-disabled":G||void 0,...K}}),L=N7.useMemo(()=>({value:q,setValue:D,disabled:G}),[q,D,G]);return $M.jsx(rQ.Provider,{value:W,children:$M.jsx(eL.Provider,{value:L,children:V})})}));var PF=P(m(),1);var MF=P(m(),1),ZM=MF.createContext(void 0);function Jg(){let $=MF.useContext(ZM);if($===void 0)throw Error(I0(35));return $}var Hg=P(c(),1),Bg=PF.forwardRef(function(Z,J){let{render:H,className:B,id:Q,label:X,nativeButton:z=!1,disabled:G=!1,closeOnClick:U=!1,value:Y,style:K,...F}=Z,W=A4({guess:!0,label:X}),q=N4(!0),N=s0(Q),{store:D}=j5(),A=D.useState("isActive",W.index),V=D.useState("itemProps"),{value:L,setValue:O,disabled:M}=$g(),_=D.useState("disabled"),w=G||M||_,C=L===Y,{getItemProps:E,itemRef:j}=F7({closeOnClick:U,disabled:w,highlighted:A,id:N,store:D,nativeButton:z,nodeId:q?.context.nodeId,itemMetadata:K7}),k=PF.useMemo(()=>({disabled:w,highlighted:A,checked:C}),[w,A,C]);function S(T){let y=w0(K0.itemPress,T.nativeEvent,void 0,{preventUnmountOnClose:U1});O(Y,y)}let I=G0("div",Z,{state:k,stateAttributesMapping:W7,props:[V,{role:"menuitemradio","aria-checked":C,onClick:S},F,E],ref:[j,J,W.ref]});return Hg.jsx(ZM.Provider,{value:k,children:I})});var _F=P(m(),1);var Qg=_F.forwardRef(function(Z,J){let{render:H,className:B,style:Q,keepMounted:X=!1,...z}=Z,G=Jg(),U=_F.useRef(null),{transitionStatus:Y,mounted:K,setMounted:F}=S2(G.checked);V5({batch:!0,enabled:!G.checked,open:G.checked,ref:U,onComplete(){if(!G.checked)F(!1)}});let W={checked:G.checked,disabled:G.disabled,highlighted:G.highlighted,transitionStatus:Y};return G0("span",Z,{state:W,stateAttributesMapping:W7,ref:[J,U],props:{"aria-hidden":!0,...z},enabled:X||K})});var H2=P(m(),1);var OF=P(m(),1),O70=OF.createContext(null);function jF($){let Z=OF.useContext(O70);if(Z===null&&!$)throw Error(I0(5));return Z}var aQ=P(m(),1);var Xg={...f9,disabled:($)=>$.parent.type==="menubar"?$.parent.context.disabled||$.disabled:$.disabled,modal:($)=>($.parent.type===void 0||$.parent.type==="context-menu")&&($.modal??!0),openMethod:($)=>$.openMethod,allowMouseEnter:($)=>$.allowMouseEnter,highlightItemOnHover:($)=>$.highlightItemOnHover,parent:($)=>$.parent,rootId:($)=>{if($.parent.type==="menu")return $.parent.store.select("rootId");return $.parent.type!==void 0?$.parent.context.rootId:$.rootId},activeIndex:($)=>$.activeIndex,isActive:($,Z)=>$.activeIndex===Z,hoverEnabled:($)=>$.hoverEnabled,instantType:($)=>$.instantType,lastOpenChangeReason:($)=>$.openChangeReason,floatingTreeRoot:($)=>{if($.parent.type==="menu")return $.parent.store.select("floatingTreeRoot");return $.floatingTreeRoot},floatingNodeId:($)=>$.floatingNodeId,floatingParentNodeId:($)=>$.floatingParentNodeId,itemProps:($)=>$.itemProps,closeDelay:($)=>$.closeDelay,adaptiveOrigin:($)=>$.adaptiveOrigin,keyboardEventRelay:($)=>{if($.keyboardEventRelay)return $.keyboardEventRelay;if($.parent.type==="menu")return $.parent.store.select("keyboardEventRelay");return}};class JM extends g2{constructor($,Z,J=!1){let H=new R2,B=Ug(H,Z,J,$);super(B,Gg(H),Xg);this.unsubscribeParentListener=this.observe("parent",(Q)=>{if(this.unsubscribeParentListener?.(),Q.type==="menu"){let X=Q.store.select("rootId"),z=Q.store.select("floatingTreeRoot"),G=Q.store.select("keyboardEventRelay");this.unsubscribeParentListener=Q.store.subscribe(()=>{let U=Q.store.select("rootId"),Y=Q.store.select("floatingTreeRoot"),K=Q.store.select("keyboardEventRelay");if(X===U&&z===Y&&G===K)return;X=U,z=Y,G=K,this.notifyAll()}),this.context.allowMouseUpTriggerRef=Q.store.context.allowMouseUpTriggerRef;return}if(Q.type!==void 0)this.context.allowMouseUpTriggerRef=Q.context.allowMouseUpTriggerRef;this.unsubscribeParentListener=null})}setOpen($,Z){this.state.floatingRootContext.context.events.emit("setOpen",{open:$,eventDetails:Z})}unsubscribeParentListener=null}function zg(){let $=new R2,Z=new H9(Object.freeze(Ug($)),Object.freeze(Gg($)),Xg);return Object.assign(Z,{setOpen:U1})}function Gg($){return{positionerRef:aQ.createRef(),popupRef:aQ.createRef(),typingRef:{current:!1},itemDomElements:{current:[]},itemLabels:{current:[]},allowMouseUpTriggerRef:{current:!1},triggerFocusTargetRef:aQ.createRef(),beforeContentFocusGuardRef:aQ.createRef(),onOpenChangeComplete:void 0,triggerElements:$}}function Ug($,Z,J=!1,H){return{...v9($,Z,J),disabled:!1,modal:!0,openMethod:null,allowMouseEnter:!1,highlightItemOnHover:!0,parent:{type:void 0},rootId:void 0,activeIndex:null,hoverEnabled:!0,instantType:void 0,openChangeReason:null,floatingTreeRoot:new X$,floatingNodeId:void 0,floatingParentNodeId:null,itemProps:D1,keyboardEventRelay:void 0,closeDelay:0,adaptiveOrigin:void 0,...H}}var TF=P(m(),1),HM=TF.createContext(void 0);function CF(){return TF.useContext(HM)}var oQ=P(c(),1),EF=r8(function(Z){let{children:J,open:H,onOpenChange:B,onOpenChangeComplete:Q,defaultOpen:X=!1,disabled:z=!1,modal:G,loopFocus:U=!0,orientation:Y="vertical",actionsRef:K,closeParentOnEsc:F=!1,handle:W,triggerId:q,defaultTriggerId:N=null,highlightItemOnHover:D=!0}=Z,A=Y7(!0),V=j5(!0),L=jF(!0),O=CF(),M=H2.useMemo(()=>{if(O&&V)return{type:"menu",store:V.store};if(L)return{type:"menubar",context:L};if(A&&!V)return{type:"context-menu",context:A};return{type:void 0}},[A,V,L,O]),_=E4(),w=E4(),C=w4(),E=M.type==="menu"?M.store:void 0,j=(H??X)&&E?.state.transitionStatus==="starting",k=Z5(()=>j?E?.state.instantType:void 0).current,S=j70({open:X,openProp:H,activeTriggerId:N,triggerIdProp:q,parent:M,disabled:z,highlightItemOnHover:D,modal:M.type===void 0?G:void 0,rootId:_,instantType:k},w,C!=null);S.useControlledProp("openProp",H),S.useControlledProp("triggerIdProp",q),S.useContextCallback("onOpenChangeComplete",Q);let I=S.useState("floatingTreeRoot"),T=b3(I),y=S.useState("open"),R=S.useState("activeTriggerElement"),x=S.useState("positionerElement"),v=S.useState("hoverEnabled"),f=S.useState("disabled"),b=S.useState("lastOpenChangeReason"),l=S.useState("parent"),r=S.useState("activeIndex"),h=S.useState("payload"),d=S.useState("floatingParentNodeId"),o=H2.useRef(null),p=H2.useRef(l.type!=="context-menu"),i=t1(),n=H2.useRef(!0),Z0=t1(),J0=d!=null,{openMethod:U0,triggerProps:z0}=Yw(y);S.useSyncedValues({disabled:z,highlightItemOnHover:D,modal:l.type===void 0?G:void 0,openMethod:U0,rootId:_}),y9(S);let{forceUnmount:X0,transitionStatus:q0}=x9(y,S,()=>{S.set("allowMouseEnter",!1)},j),N0=d4(S.context.popupRef);H2.useEffect(()=>{if(k===void 0)return;let T0=()=>{if(S.state.instantType===k)S.set("instantType",void 0)};if(!y){T0();return}if(q0!==void 0)return;if(S.context.popupRef.current==null){T0();return}let c0=new AbortController;return N0(T0,c0.signal),()=>{c0.abort()}},[k,y,q0,N0,S]),H0(()=>{if(A&&!V)S.update({parent:{type:"context-menu",context:A},floatingNodeId:T,floatingParentNodeId:C});else if(V)S.update({floatingNodeId:T,floatingParentNodeId:C})},[A,V,T,C,S]),H2.useEffect(()=>{if(!y)o.current=null;if(l.type!=="context-menu")return;if(!y){i.clear(),p.current=!1;return}i.start(500,()=>{p.current=!0})},[i,y,l.type]),H0(()=>{if(!y&&!v)S.set("hoverEnabled",!0)},[y,v,S]);let F0=Y0((T0,c0)=>{let G1=c0.reason;if(!T0&&!S.select("open"))return;if(y===T0&&c0.trigger===R&&b===G1)return;let A1=TB(c0);if(!T0&&c0.trigger==null)c0.trigger=R??void 0;if(B?.(T0,c0),c0.isCanceled)return;S.state.floatingRootContext.dispatchOpenChange(T0,c0);let d0=c0.event;if(T0===!1&&d0?.type==="click"&&d0.pointerType==="touch"&&!n.current)return;if(T0&&G1===K0.triggerFocus)n.current=!1,Z0.start(300,()=>{n.current=!0});else n.current=!0,Z0.clear();let k0=(G1===K0.triggerPress||G1===K0.itemPress)&&d0.detail===0,S1=!T0&&(G1===K0.escapeKey||G1==null);o.current=c0.event;let K1=K$(S.state,T0,c0.trigger,A1());if(K1.openChangeReason=G1,l.type==="menubar"&&(G1===K0.triggerFocus||G1===K0.focusOut||G1===K0.triggerHover||G1===K0.listNavigation||G1===K0.siblingOpen))K1.instantType="group";else if(k0||S1)K1.instantType=k0?"click":"dismiss";else K1.instantType=void 0;S.update(K1)}),s=jB({popupStore:S,floatingRootContext:S.state.floatingRootContext,floatingId:w,nested:C!=null,onOpenChange:F0}),a=s.context.events;H0(()=>{let T0=({open:c0,eventDetails:G1})=>F0(c0,G1);return a.on("setOpen",T0),()=>{a?.off("setOpen",T0)}},[a,F0]);let $0=H2.useCallback(()=>{S.setOpen(!1,w0(K0.imperativeAction))},[S]);H2.useImperativeHandle(K,()=>({unmount:X0,close:$0}),[X0,$0]);let t;if(l.type==="context-menu")t=l.context;H2.useImperativeHandle(t?.positionerRef,()=>x,[x]),H2.useImperativeHandle(t?.actionsRef,()=>({setOpen:F0}),[F0]);let B0=e8(s,{enabled:!f,bubbles:{escapeKey:F&&l.type==="menu"},outsidePress(){if(l.type!=="context-menu"||o.current?.type==="contextmenu")return!0;return p.current},externalTree:J0?I:void 0}),_0=i4(),P0=H2.useCallback((T0)=>{if(S.select("activeIndex")===T0)return;S.set("activeIndex",T0)},[S]),A0=aA(s,{enabled:!f,listRef:S.context.itemDomElements,activeIndex:r,nested:l.type!==void 0,loopFocus:U,orientation:Y,parentOrientation:l.type==="menubar"?l.context.orientation:void 0,rtl:_0==="rtl",disabledIndices:Z4,onNavigate:P0,openOnArrowKeyDown:l.type!=="context-menu",externalTree:J0?I:void 0,focusItemOnHover:D}),L0=H2.useCallback((T0)=>{S.context.typingRef.current=T0},[S]),g=oA(s,{enabled:!f,listRef:S.context.itemLabels,elementsRef:S.context.itemDomElements,activeIndex:r,resetMs:dT,onMatch:(T0)=>{if(y&&T0!==r)S.set("activeIndex",T0)},onTyping:L0}),u=H2.useMemo(()=>{let T0=Y2(g.reference,A0.reference,B0.reference,{onMouseMove(){S.set("allowMouseEnter",!0)}},z0);return T0["aria-haspopup"]="menu",T0["aria-expanded"]=y,T0},[S,g.reference,A0.reference,B0.reference,z0,y]),e=H2.useMemo(()=>{let T0=Y2(A0.trigger,B0.trigger,z0);return T0["aria-haspopup"]="menu",T0["aria-expanded"]=!1,T0},[A0.trigger,B0.trigger,z0]);Z5(()=>{return S.update({inactiveTriggerProps:e}),null});let W0=H2.useMemo(()=>Y2(R9,{id:w,role:"menu","aria-orientation":Y==="horizontal"?"horizontal":void 0,"aria-labelledby":R?.id,onMouseMove(){if(S.set("allowMouseEnter",!0),l.type==="menu")S.set("hoverEnabled",!1)},onClick(){if(S.select("hoverEnabled"))S.set("hoverEnabled",!1)},onKeyDown(T0){let c0=S.select("keyboardEventRelay");if(c0&&!T0.isPropagationStopped())c0(T0)}},g.floating,A0.floating,B0.floating),[R,w,Y,l.type,S,g.floating,A0.floating,B0.floating]),S0=A0.item??D1;h9(S,{floatingRootContext:s,activeTriggerProps:u,inactiveTriggerProps:e,popupProps:W0,itemProps:S0});let h0=H2.useMemo(()=>({store:S,parent:M}),[S,M]),v0=oQ.jsxs(aL.Provider,{value:h0,children:[W&&oQ.jsx(I9,{handle:W,store:S}),typeof J==="function"?J({payload:h}):J]});if(l.type===void 0||l.type==="context-menu")return oQ.jsx(G$,{externalTree:I,children:v0});return v0});function j70($,Z,J){return Z5(()=>new JM($,Z,J)).current}var Yg=P(m(),1);var BM=P(c(),1);function Kg($){let Z=j5().store,J=Yg.useMemo(()=>({parentMenu:Z}),[Z]);return BM.jsx(HM.Provider,{value:J,children:BM.jsx(EF,{...$})})}var D4=P(m(),1);var bF=5;function Fg($,Z){let J=T70(Z);return $.clientX>=J.left-bF&&$.clientX<=J.right+bF&&$.clientY>=J.top-bF&&$.clientY<=J.bottom+bF}function T70($){let Z=$.getBoundingClientRect(),J=I1($);if(J5.env.jsdom)return Z;let H=J.getComputedStyle($,"::before"),B=J.getComputedStyle($,"::after");if(!(H.content!=="none"||B.content!=="none"))return Z;let X=parseFloat(H.width)||0,z=parseFloat(H.height)||0,G=parseFloat(B.width)||0,U=parseFloat(B.height)||0,Y=Math.max(Z.width,X,G),K=Math.max(Z.height,z,U),F=Y-Z.width,W=K-Z.height;return{left:Z.left-F/2,right:Z.right+F/2,top:Z.top-W/2,bottom:Z.bottom+W/2}}var Wg=P(m(),1);function wF($={}){let{highlightItemOnHover:Z,highlightedIndex:J,onHighlightedIndexChange:H}=BH(),{ref:B,index:Q}=A4($),X=J===Q,z=Wg.useRef(null),G=p2(B,z);return{compositeProps:{tabIndex:X?0:-1,onFocus(){H(Q)},onMouseMove(){let Y=z.current;if(!Z||!Y)return;let K=Y.hasAttribute("disabled")||Y.ariaDisabled==="true";if(!X&&!K)Y.focus()}},compositeRef:G,index:Q}}function qg($){let{render:Z,className:J,style:H,state:B=D1,props:Q=Z4,refs:X=Z4,metadata:z,stateAttributesMapping:G,tag:U="div",...Y}=$,{compositeProps:K,compositeRef:F}=wF({metadata:z});return G0(U,$,{state:B,ref:[F,...X],props:[K,...Q,Y],stateAttributesMapping:G})}function QM($){if(L1($)&&$.hasAttribute("data-rootownerid"))return $.getAttribute("data-rootownerid");if(w8($))return;return QM(S8($))}var SF=P(m(),1);function Ng($){let{enabled:Z=!0,mouseDownAction:J,open:H}=$,B=SF.useRef(!1);return SF.useMemo(()=>{if(!Z)return D1;return{onMouseDown:(Q)=>{if(J==="open"&&!H||J==="close"&&H)B.current=!0,m0(Q.currentTarget).addEventListener("click",()=>{B.current=!1},{once:!0})},onClick:(Q)=>{if(B.current)B.current=!1,Q.preventBaseUIHandler()}}},[Z,J,H])}var A7=P(c(),1),Ag=T9(function(Z,J){let{render:H,className:B,style:Q,disabled:X=!1,nativeButton:z=!0,id:G,openOnHover:U,delay:Y=100,closeDelay:K=0,handle:F,payload:W,...q}=Z,N=j5(!0),A=g9(F)??N?.store;if(!A)throw Error(I0(85));let V=s0(G),L=A.useState("isTriggerActive",V),O=A.useState("floatingRootContext"),M=A.useState("isOpenedByTrigger",V),_=A.useState("triggerPopupId",V),w=D4.useRef(null),C=E70(),E=BH(!0),j=B4(),k=D4.useMemo(()=>{return j??new X$},[j]),S=b3(k),I=w4(),{registerTrigger:T,isMountedByThisTrigger:y}=k9(V,w,A,{payload:W,closeDelay:K,parent:C,floatingTreeRoot:k,floatingNodeId:S,floatingParentNodeId:I,keyboardEventRelay:E?.relayKeyboardEvent}),R=C.type==="menubar",x=A.useState("disabled"),v=X||x||R&&C.context.disabled,{getButtonProps:f,buttonRef:b}=w5({disabled:v,native:z});D4.useEffect(()=>{if(!M&&C.type===void 0)A.context.allowMouseUpTriggerRef.current=!1},[A,M,C.type]);let l=D4.useRef(null),r=t1(),h=Y0((t)=>{if(!l.current)return;r.clear(),A.context.allowMouseUpTriggerRef.current=!1;let B0=t.target;if(R0(l.current,B0)||R0(A.select("positionerElement"),B0)||B0===l.current)return;if(B0!=null&&QM(B0)===A.select("rootId"))return;if(Fg(t,l.current))return;k.events.emit("close",{domEvent:t,reason:K0.cancelOpen})});D4.useEffect(()=>{if(M&&A.select("lastOpenChangeReason")===K0.triggerHover)m0(l.current).addEventListener("mouseup",h,{once:!0})},[M,h,A]);let d=R&&C.context.hasSubmenuOpen,p=Z9(O,{enabled:(U??d)&&!v&&(!R||d&&!y),handleClose:J9({blockPointerEvents:!R}),mouseOnly:!0,move:!1,restMs:C.type===void 0?Y:void 0,delay:{close:K},triggerElementRef:w,externalTree:k,isActiveTrigger:L,isClosing:()=>A.select("transitionStatus")==="ending"}),i=C70(M,A.select("lastOpenChangeReason")),n=w3(O,{enabled:!v,event:M&&R?"click":"mousedown",toggle:!0,ignoreMouse:!1,stickIfOpen:C.type===void 0?i:!1}),Z0=F$(O,{enabled:!v&&d}),J0=Ng({open:M,enabled:R,mouseDownAction:"open"}),U0=D4.useMemo(()=>Y2(Z0.reference,n.reference),[Z0.reference,n.reference]),z0=A.useState("triggerProps",y),{preFocusGuardRef:X0,handlePreFocusGuardFocus:q0,handleFocusTargetFocus:N0}=sG(A,w),F0={disabled:v,open:M},s=[l,J,b,T,w],a=[U0,p??D1,z0,{"aria-haspopup":"menu","aria-controls":_,id:V,onMouseDown:(t)=>{if(A.select("open"))return;r.start(200,()=>{A.context.allowMouseUpTriggerRef.current=!0}),m0(t.currentTarget).addEventListener("mouseup",h,{once:!0})}},R?{role:"menuitem"}:{},J0,q,f],$0=G0("button",Z,{enabled:!R,stateAttributesMapping:WB,state:F0,ref:s,props:a});if(R)return A7.jsx(qg,{tag:"button",render:H,className:B,style:Q,state:F0,refs:s,props:a,stateAttributesMapping:WB});if(M)return A7.jsxs(D4.Fragment,{children:[A7.jsx(c4,{ref:X0,onFocus:q0},`${V}-pre-focus-guard`),A7.jsx(D4.Fragment,{children:$0},V),A7.jsx(c4,{ref:A.context.triggerFocusTargetRef,onFocus:N0},`${V}-post-focus-guard`)]});return A7.jsx(D4.Fragment,{children:$0},V)});function C70($,Z){let J=t1(),[H,B]=D4.useState(!1);return H0(()=>{if($&&Z===K0.triggerHover)B(!0),J.start(az,()=>{B(!1)});else if(!$)J.clear(),B(!1)},[$,Z,J]),H}function E70(){let $=jF(!0);return D4.useMemo(()=>{if($)return{type:"menubar",context:$};return{type:void 0}},[$])}var Dg=P(m(),1);var Vg=Dg.forwardRef(function(Z,J){let{render:H,className:B,style:Q,children:X,...z}=Z,{store:G}=j5(),{side:U}=N4(),Y=G.useState("instantType"),{children:K,state:F}=L6({store:G,side:U,children:X}),W={activationDirection:F.activationDirection,transitioning:F.transitioning,instant:Y};return G0("div",Z,{state:W,ref:J,props:[z,{children:K}],stateAttributesMapping:V6})});var Lg=P(m(),1);var Mg=Lg.forwardRef(function(Z,J){let{className:H,render:B,orientation:Q="horizontal",style:X,...z}=Z;return G0("div",Z,{state:{orientation:Q},ref:J,props:[{role:"separator","aria-orientation":Q},z]})});var c3=P(m(),1);function Pg($){return $==null||$.hasAttribute("disabled")||$.getAttribute("aria-disabled")==="true"}var b70={"aria-expanded":void 0},_g=c3.forwardRef(function(Z,J){let{render:H,className:B,style:Q,label:X,id:z,nativeButton:G=!1,openOnHover:U=!0,delay:Y=100,closeDelay:K=0,disabled:F=!1,...W}=Z,q=CF();if(!q?.parentMenu)throw Error(I0(37));let N=A4({guess:!0,label:X}),D=N4(),{store:A}=j5(),V=s0(z),L=A.useState("open"),O=A.useState("floatingRootContext"),M=A.useState("floatingTreeRoot"),_=A.useState("triggerPopupId",V),w=mA(V,A),C=Y0((U0)=>{if(w(U0),U0!==null&&A.select("open")&&A.select("activeTriggerId")==null)A.update({activeTriggerId:V??null,activeTriggerElement:U0,closeDelay:K})}),E=c3.useRef(null),j=c3.useCallback((U0)=>{E.current=U0,A.set("activeTriggerElement",U0)},[A]);H0(()=>{return C(E.current),()=>C(null)},[C,V,A]),A.useSyncedValue("closeDelay",K);let k=q.parentMenu,S=A.useState("disabled"),I=k.useState("disabled"),T=F||S||I,y=k.useState("itemProps"),R=k.useState("isActive",N.index),x=c3.useMemo(()=>({type:"submenu-trigger",setActive(){if(k.select("highlightItemOnHover"))k.set("activeIndex",N.index)}}),[k,N.index]),{getItemProps:v,itemRef:f}=F7({closeOnClick:!1,disabled:T,highlighted:R,id:V,store:A,typingRef:k.context.typingRef,nativeButton:G,itemMetadata:x,nodeId:D?.context.nodeId}),b=A.useState("hoverEnabled"),l=Z9(O,{enabled:b&&U&&!T,handleClose:J9({blockPointerEvents:!0}),mouseOnly:!0,move:!0,restMs:Y,delay:{open:Y,close:K},shouldOpen:Y>0?()=>k.select("allowMouseEnter"):void 0,triggerElementRef:E,externalTree:M,isClosing:()=>A.select("transitionStatus")==="ending",guardStaleOpen:!0}),h=w3(O,{enabled:!T,event:"mousedown",toggle:!U,ignoreMouse:U,stickIfOpen:!1}).reference??D1,d=A.useState("triggerProps",!0);delete d.id;let o={disabled:T,highlighted:R,open:L},p=A.useState("openMethod"),n=A.useState("lastOpenChangeReason")===K0.listNavigation||p==="keyboard",Z0=L&&n&&J5.screenReader.voiceOver;return G0("div",Z,{state:o,stateAttributesMapping:C9,props:[h,l,d,y,Z0?b70:void 0,{"aria-controls":_,tabIndex:L||R?0:-1,onBlur(){if(R)k.set("activeIndex",null)}},W,v],ref:[J,N.ref,f,C,j]})});class RF extends $9{constructor(){super(zg(),"Menu")}open($){this.openByTrigger($)}close(){this.closePopup()}get isOpen(){return this.attachedStore?.select("open")??!1}}function Og(){return new RF}var V4=P(c(),1);function X3({...$}){return V4.jsx(s4.Root,{"data-slot":"dropdown-menu",...$})}function w70({...$}){return V4.jsx(I8,{portal:s4.Portal,"data-slot":"dropdown-menu-portal",...$})}function z3({...$}){return V4.jsx(s4.Trigger,{"data-slot":"dropdown-menu-trigger",...$})}function G3({align:$="start",alignOffset:Z=0,side:J="bottom",sideOffset:H=4,className:B,...Q}){return V4.jsx(w70,{children:V4.jsx(s4.Positioner,{className:"isolate z-50 outline-none",align:$,alignOffset:Z,side:J,sideOffset:H,children:V4.jsx(s4.Popup,{"data-slot":"dropdown-menu-content",className:i0("z-50 max-h-(--available-height) w-(--anchor-width) min-w-32 origin-(--transform-origin) overflow-x-hidden overflow-y-auto rounded-lg bg-popover p-1 text-popover-foreground shadow-md duration-100 outline-none data-[side=bottom]:slide-in-from-top-2 data-[side=inline-end]:slide-in-from-left-2 data-[side=inline-start]:slide-in-from-right-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 rtl:data-[side=inline-end]:slide-in-from-right-2 rtl:data-[side=inline-start]:slide-in-from-left-2 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:overflow-hidden data-closed:fade-out-0 data-closed:zoom-out-95",B),...Q})})})}function D7({...$}){return V4.jsx(s4.Group,{"data-slot":"dropdown-menu-group",...$})}function IF({className:$,inset:Z,...J}){return V4.jsx(s4.GroupLabel,{"data-slot":"dropdown-menu-label","data-inset":Z,className:i0("px-2 pt-1.5 pb-0.5 text-xs text-muted-foreground data-inset:ps-7",$),...J})}function U3({className:$,inset:Z,variant:J="default",...H}){return V4.jsx(s4.Item,{"data-slot":"dropdown-menu-item","data-inset":Z,"data-variant":J,className:i0("group/dropdown-menu-item relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground not-data-[variant=destructive]:focus:**:text-accent-foreground data-inset:ps-7 data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 data-[variant=destructive]:focus:text-destructive dark:data-[variant=destructive]:focus:bg-destructive/20 data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 data-[variant=destructive]:*:[svg]:text-destructive",$),...H})}function jg({...$}){return V4.jsx(s4.RadioGroup,{"data-slot":"dropdown-menu-radio-group",...$})}function Tg({className:$,children:Z,inset:J,...H}){return V4.jsxs(s4.RadioItem,{"data-slot":"dropdown-menu-radio-item","data-inset":J,className:i0("relative flex cursor-default items-center gap-2 rounded-md py-1 ps-2 pe-8 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground focus:**:text-accent-foreground data-inset:ps-7 data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",$),...H,children:[V4.jsx("span",{className:"pointer-events-none absolute end-2 flex items-center justify-center","data-slot":"dropdown-menu-radio-item-indicator",children:V4.jsx(s4.RadioItemIndicator,{children:V4.jsx(g8,{stroke:1.75})})}),Z]})}var cF=P(m(),1);var V7={};I5(V7,{Value:()=>Ig,Track:()=>hg,Thumb:()=>pg,Root:()=>bg,Label:()=>Sg,Indicator:()=>dg,Control:()=>yg});var B2=P(m(),1);function XM($,Z,J=Object.is){let{length:H}=$;if(H!==Z.length)return!1;for(let B=0;B<H;B+=1)if(!J($[B],Z[B]))return!1;return!0}function Cg($){return $==null?void 0:`${$}-label`}function Eg($,Z){return $??Z}function kF($,Z){return $-Z}function yF($,Z,J,H,B,Q){let X=w2($,J,H);if(!B)return X;let z=Q.slice();return z[Z]=w2(X,Q[Z-1]??-1/0,Q[Z+1]??1/0),z.sort(kF)}function xF($,Z,J){if(!Array.isArray($))return!0;let H=Z*J;for(let B=0;B<$.length-1;B+=1)if(!(Math.abs($[B]-$[B+1])>=H))return!1;return!0}var QH=()=>null,t4={activeThumbIndex:QH,max:QH,min:QH,minStepsBetweenValues:QH,step:QH,values:QH,...k2};var hF=P(m(),1),zM=hF.createContext(void 0);function u8(){let $=hF.useContext(zM);if($===void 0)throw Error(I0(62));return $}var GM=P(c(),1);function S70($,Z){return $===Z||Array.isArray($)&&Array.isArray(Z)&&XM($,Z)}var bg=B2.forwardRef(function(Z,J){let{"aria-labelledby":H,className:B,defaultValue:Q,disabled:X=!1,id:z,format:G,largeStep:U=10,locale:Y,render:K,max:F=100,min:W=0,minStepsBetweenValues:q=0,form:N,name:D,onValueChange:A,onValueCommitted:V,orientation:L="horizontal",step:O=1,thumbCollisionBehavior:M="push",thumbAlignment:_="center",value:w,style:C,...E}=Z,j=s0(z),k=Cg(j),S=Y0(A),I=Y0(V),{clearErrors:T}=K4(),{state:y,disabled:R,name:x,setTouched:v,setDirty:f,validityData:b,validation:l}=o5(),{labelId:r}=n5(),[h,d]=B2.useState(),o=H??Eg(r,h),p=R||X,i=x??D,[n,Z0]=F4({controlled:w,default:Q??W,name:"Slider"}),J0=B2.useRef(null),U0=B2.useRef(null),z0=B2.useRef([]),X0=B2.useRef(null),q0=B2.useRef(-1),N0=B2.useRef(null),F0=B2.useRef(K0.none),[s,a]=B2.useState(-1),[$0,t]=B2.useState(-1),[B0,_0]=B2.useState(!1),[P0,A0]=B2.useState(()=>new Map),[L0,g]=B2.useState([void 0,void 0]),u=Y0((d0)=>{if(a(d0),d0!==-1)t(d0)}),e=Y0((d0)=>{if(d0)U0.current=d0}),W0=Array.isArray(n),S0=B2.useMemo(()=>{if(!W0)return[w2(n,W,F)];return n.map((d0)=>w2(d0,W,F)).sort(kF)},[F,W,W0,n]),h0=W0?S0:S0[0];u6(l.inputRef,j,h0,void 0,!p,D),i9(h0,()=>{T(i),l.change(h0);let d0=b.initialValue,k0;if(Array.isArray(h0)&&Array.isArray(d0))k0=!XM(h0,d0);else k0=h0!==d0;f(k0)});let v0=Y0((d0,k0)=>{if(Number.isNaN(d0)||S70(d0,n))return!1;let S1=k0.event,z5=new S1.constructor(S1.type,S1);if(Object.defineProperty(z5,"target",{writable:!0,value:{value:d0,name:i}}),k0.event=z5,S(d0,k0),k0.isCanceled)return!1;return F0.current=k0.reason,Z0(d0),!0}),T0=Y0((d0,k0,S1)=>{let K1=yF(d0,k0,W,F,W0,S0);if(xF(K1,O,q)){let z5="key"in S1?K0.keyboard:K0.inputChange,C0=v0(K1,w0(z5,S1.nativeEvent,void 0,{activeThumbIndex:k0}));if(v(!0),C0)I(K1,QG(z5,S1.nativeEvent))}});H0(()=>{if(!p)return;let d0=l1(m0(J0.current));if(R0(J0.current,d0))d0.blur();if(s!==-1)u(-1)},[s,p,u]);let c0=B2.useMemo(()=>({...y,activeThumbIndex:s,disabled:p,dragging:B0,orientation:L,max:F,min:W,minStepsBetweenValues:q,step:O,values:S0}),[y,s,p,B0,F,W,q,L,O,S0]),G1=B2.useMemo(()=>({active:s,controlRef:U0,disabled:p,dragging:B0,validation:l,format:G,handleInputChange:T0,indicatorPosition:L0,inset:_!=="center",labelId:o,rootLabelId:k,largeStep:U,lastUsedThumbIndex:$0,lastChangeReasonRef:F0,form:N,locale:Y,max:F,min:W,minStepsBetweenValues:q,name:i,onValueCommitted:I,orientation:L,pressedThumbCenterOffsetRef:X0,pressedThumbIndexRef:q0,pressedValuesRef:N0,registerFieldControlRef:e,renderBeforeHydration:_==="edge",setActive:u,setDragging:_0,setIndicatorPosition:g,setLabelId:d,setValue:v0,state:c0,step:O,thumbCollisionBehavior:M,thumbMap:P0,thumbRefs:z0,values:S0}),[s,o,k,p,B0,l,G,T0,L0,U,$0,N,Y,F,W,q,i,I,L,e,u,v0,c0,O,M,_,P0,S0]),A1=G0("div",Z,{state:c0,ref:[J,J0],props:[{"aria-labelledby":o,id:j,role:"group"},E,(d0)=>l.getValidationProps(p,d0)],stateAttributesMapping:t4});return GM.jsx(zM.Provider,{value:G1,children:GM.jsx(q7,{elementsRef:z0,onMapChange:A0,children:A1})})});var wg=P(m(),1);var Sg=wg.forwardRef(function(Z,J){let{render:H,className:B,style:Q,...X}=Z,z=X;delete z.id;let{state:G,setLabelId:U,controlRef:Y,rootLabelId:K}=u8();function F(q,N){if(N){let V=m0(q.currentTarget).getElementById(N);if(L1(V)){XY(V);return}}let D=Y.current?.querySelectorAll('input[type="range"]'),A=D?.length===1?D[0]:null;if(L1(A))XY(A)}let W=QY({id:K,setLabelId:U,focusControl:F});return G0("div",Z,{ref:J,state:G,props:[W,X],stateAttributesMapping:t4})});var vF=P(m(),1);function UM($){if(Array.isArray($))return $.map((Z)=>UM(Z)).join(",");if($==null)return"";return String($)}var Rg=new Map;function R70($,Z){let J=JSON.stringify({locale:UM($),options:Z}),H=Rg.get(J);if(H)return H;let B=new Intl.NumberFormat($,Z);return Rg.set(J,B),B}function XH($,Z,J){if($==null)return"";return R70(Z,J).format($)}var Ig=vF.forwardRef(function(Z,J){let{"aria-live":H="off",render:B,className:Q,children:X,style:z,...G}=Z,{thumbMap:U,state:Y,values:K,format:F,locale:W}=u8(),q=Array.from(U.values(),({inputId:V})=>V).join(" ").trim()||void 0,N=vF.useMemo(()=>K.map((V)=>XH(V,W,F)),[F,W,K]),D=N.join(" – ");return G0("output",Z,{state:Y,ref:J,props:[{"aria-live":H,children:typeof X==="function"?X(N,K):D,htmlFor:q},G],stateAttributesMapping:t4})});var p8=P(m(),1);function fF($,Z){let J=$.getBoundingClientRect();return Z?(J.top+J.bottom)/2:(J.left+J.right)/2}function zH($){if($===0)return 0;if(Math.abs($)<1){let J=$.toExponential().split("e-"),H=J[0].split(".")[1];return(H?H.length:0)+parseInt(J[1],10)}let Z=$.toString().split(".")[1];return Z?Z.length:0}function gF($,Z,J){let H=Math.round(($-J)/Z)*Z+J;return Number(H.toFixed(Math.max(zH(Z),zH(J))))}function YM($,Z,J,H,B,Q,X,z){let G=$.slice(),U=Q*X,Y=G.length-1,K=z??$,F=H+Z*U,W=B-(Y-Z)*U;G[Z]=w2(J,F,W);for(let q=Z+1;q<=Y;q+=1){let N=G[q-1]+U,D=B-(Y-q)*U,A=K[q],V=Math.max(G[q],N);if(A<V)V=Math.max(A,N);G[q]=w2(V,N,D)}for(let q=Z-1;q>=0;q-=1){let N=G[q+1]-U,D=H+q*U,A=K[q],V=Math.min(G[q],N);if(A>V)V=Math.min(A,N);G[q]=w2(V,D,N)}for(let q=0;q<=Y;q+=1)G[q]=Number(G[q].toFixed(12));return G}function kg($,Z,J,H,B,Q,X,z,G,U){let Y=J??Z,K=H??Z;if(!(Y.length>1))return{value:Q,thumbIndex:0,didSwap:!1};let W=G*U;if($==="push")return{value:YM(Y,B,Q,X,z,G,U),thumbIndex:B,didSwap:!1};let q=Y.slice(),N=q[B-1],D=q[B+1],A=N!=null?N+W:X,V=D!=null?D-W:z,L=Number(w2(Q,A,V).toFixed(12));switch(q[B]=L,$){case"swap":{let O=Y[B],M=0.0000001,_=Q>O,w=Q<O,C=_&&D!=null&&Q>=D-0.0000001,E=w&&N!=null&&Q<=N+0.0000001;if(!C&&!E)return{value:q,thumbIndex:B,didSwap:!1};let j=C?B+1:B-1,k=q.map((b,l)=>{if(l===B)return L;let r=K[l];if(r!=null)return r;return Y[l]}),S=Q;if(C)S=Math.max(Q,q[j]);else S=Math.min(Q,q[j]);let I=YM(q,j,S,X,z,G,U,k),T=C?j-1:j+1,y=I[T-1],R=I[T+1],x=y!=null?y+W:X;x=Math.max(x,X+T*W);let v=R!=null?R-W:z;v=Math.min(v,z-(I.length-1-T)*W);let f=w2(L,x,v);return I[T]=Number(f.toFixed(12)),{value:I,thumbIndex:j,didSwap:!0}}case"none":default:return{value:q,thumbIndex:B,didSwap:!1}}}var I70=2;function k70($,Z){if(!$)return{start:0,end:0};function J(Q){let X=Q!=null?parseFloat(Q):0;return Number.isNaN(X)?0:X}let H=!Z?"InlineStart":"Top",B=!Z?"InlineEnd":"Bottom";return{start:J($[`border${H}Width`])+J($[`padding${H}`]),end:J($[`border${B}Width`])+J($[`padding${B}`])}}function y70($,Z){if(Z.current!=null&&$.changedTouches){let J=$;for(let H=0;H<J.changedTouches.length;H+=1){let B=J.changedTouches[H];if(B.identifier===Z.current)return{x:B.clientX,y:B.clientY}}return null}return{x:$.clientX,y:$.clientY}}var yg=p8.forwardRef(function(Z,J){let{render:H,className:B,style:Q,...X}=Z,{disabled:z,dragging:G,inset:U,lastChangeReasonRef:Y,max:K,min:F,minStepsBetweenValues:W,onValueCommitted:q,orientation:N,pressedThumbCenterOffsetRef:D,pressedThumbIndexRef:A,pressedValuesRef:V,registerFieldControlRef:L,renderBeforeHydration:O,setActive:M,setDragging:_,setValue:w,state:C,step:E,thumbCollisionBehavior:j,thumbRefs:k,values:S}=u8(),I=i4(),T=S.length>1,y=N==="vertical",R=p8.useRef(null),x=p8.useRef(null),v=Y0((a)=>{if(a&&x.current==null)x.current=I1(a).getComputedStyle(a)}),f=p8.useRef(null),b=p8.useRef(0),l=p8.useRef(0),r=p8.useRef(null),h=W5(S);function d(a){return a?.querySelector('input[type="range"]')}function o(a){if(A.current=a,!k.current[a])D.current=null}function p(){A.current=-1,D.current=null}function i(a){if(!n0(a))return!1;return k.current.some(($0)=>{if(!n0($0)||!R0($0,a))return!1;return d($0)?.disabled===!0})}function n(a){let $0=R.current,t=A.current;if(!$0||t<0||t>=S.length){if(t>=S.length)r.current=null;return null}let{width:B0,height:_0,bottom:P0,left:A0,right:L0}=$0.getBoundingClientRect(),g=k70(x.current,y),u=l.current,e=(y?_0:B0)-g.start-g.end-u*2,W0=D.current??0,S0=a.x-W0,h0=a.y-W0,v0=y?P0-h0-g.end:(I==="rtl"?L0-S0:S0-A0)-g.start,T0=w2((v0-u)/e,0,1),c0=(K-F)*T0+F;if(c0=gF(c0,E,F),c0=w2(c0,F,K),!T)return{value:c0,thumbIndex:t,didSwap:!1};return kg(j,S,h.current,V.current,t,c0,F,K,E,W)}function Z0(a){V.current=T?S.slice():null,r.current=null,h.current=S;let $0=A.current,t=$0;if($0>-1&&$0<S.length){if(S[$0]===K){let B0=$0;while(B0>0&&S[B0-1]===K)B0-=1;t=B0}}else{let B0=!y?"x":"y",_0;t=-1;for(let P0=0;P0<k.current.length;P0+=1){let A0=k.current[P0];if(n0(A0)&&!d(A0)?.disabled){let L0=fF(A0,y),g=Math.abs(a[B0]-L0);if(_0===void 0||g<=_0)t=P0,_0=g}}}if(t>-1&&t!==$0)o(t);if(U){let B0=k.current[t];if(n0(B0)){let _0=B0.getBoundingClientRect(),P0=!y?"width":"height";l.current=_0[P0]/2}}}function J0(a){let $0=d(k.current?.[a]);if(!$0)return;$0.focus({preventScroll:!0,focusVisible:!1})}function U0(a,$0,t){let B0=w(a.value,w0($0,t,void 0,{activeThumbIndex:a.thumbIndex}));if(B0){if(r.current=a.value,h.current=Array.isArray(a.value)?a.value:[a.value],a.didSwap)o(a.thumbIndex),J0(a.thumbIndex)}return B0}let z0=Y0((a)=>{let $0=y70(a,f);if($0==null)return;if(b.current+=1,a.type==="pointermove"&&a.buttons===0){X0(a);return}let t=n($0);if(t==null)return;if(xF(t.value,E,W)){if(!G&&b.current>I70)_(!0);U0(t,K0.drag,a)}}),X0=Y0((a)=>{M(-1),_(!1),D.current=null;let $0=r.current;if(Array.isArray($0)&&$0.length!==S.length)r.current=null;if(r.current!=null){let t=Y.current;q(r.current,QG(t,a))}if("pointerType"in a&&R.current?.hasPointerCapture(a.pointerId))R.current?.releasePointerCapture(a.pointerId);A.current=-1,f.current=null,N0()}),q0=Y0((a)=>{if(z)return;if(i(V1(a))){p();return}let $0=a.changedTouches[0];if($0==null)return;f.current=$0.identifier;let t={x:$0.clientX,y:$0.clientY};Z0(t);let B0=n(t);if(B0==null)return;J0(B0.thumbIndex),U0(B0,K0.trackPress,a),b.current=0;let _0=m0(R.current);_0.addEventListener("touchmove",z0,{passive:!0}),_0.addEventListener("touchend",X0,{passive:!0})}),N0=Y0(()=>{let a=m0(R.current);a.removeEventListener("pointermove",z0),a.removeEventListener("pointerup",X0),a.removeEventListener("touchmove",z0),a.removeEventListener("touchend",X0),V.current=null,r.current=null}),F0=C4();return p8.useEffect(()=>{let a=R.current;if(!a)return()=>N0();let $0=a0(a,"touchstart",q0,{passive:!0});return()=>{$0(),F0.cancel(),N0()}},[N0,q0,R,F0]),p8.useEffect(()=>{if(z)N0()},[z,N0]),G0("div",Z,{state:C,ref:[J,L,R,v],props:[{["data-base-ui-slider-control"]:O?"":void 0,onPointerDown(a){let $0=R.current,t=V1(a.nativeEvent);if(!$0||z||a.defaultPrevented||!n0(t)||a.button!==0)return;if(i(t)){p();return}let B0={x:a.clientX,y:a.clientY};Z0(B0);let _0=n(B0);if(_0==null)return;if(R0(k.current[_0.thumbIndex],l1(m0($0))))a.preventDefault();else F0.request(()=>{J0(_0.thumbIndex)});if(_(!0),D.current==null)U0(_0,K0.trackPress,a.nativeEvent);if(a.nativeEvent.pointerId)$0.setPointerCapture(a.nativeEvent.pointerId);b.current=0;let L0=m0($0);L0.addEventListener("pointermove",z0,{passive:!0}),L0.addEventListener("pointerup",X0,{once:!0})}},X],stateAttributesMapping:t4})});var xg=P(m(),1);var hg=xg.forwardRef(function(Z,J){let{render:H,className:B,style:Q,...X}=Z,{state:z}=u8();return G0("div",Z,{state:z,ref:J,props:[{style:{position:"relative"}},X],stateAttributesMapping:t4})});var c8=P(m(),1);var mF="";var vg=P(RZ(),1);function x70(){return U1}function h70(){return!1}function v70(){return!0}function GH(){return vg.useSyncExternalStore(x70,h70,v70)}function nQ($,Z,J){return($-Z)*100/(J-Z)}var s71=P(m(),1);var uF=P(m(),1),f70=uF.createContext(void 0),g70={disableStyleElements:!1};function fg(){return uF.useContext(f70)??g70}var gg=P(c(),1);function pF($){let{script:Z}=$,{nonce:J}=fg();if(!GH())return null;return gg.jsx("script",{nonce:J,dangerouslySetInnerHTML:{__html:Z},suppressHydrationWarning:!0})}var mg="data-index";var sQ=P(c(),1),ug,u70=new Set([...B9,ID,kD]);function p70($,Z,J,H){if(Z<0)return;if($.length===2)return`${XH($[Z],H,J)} ${Z===0?"start":"end"} range`;return J?XH($[Z],H,J):void 0}function c70($,Z,J,H,B){let Q=$+Z*J,X=Number(Q.toFixed(Math.max(zH($),zH(Z),zH(H))));return w2(X,H,B)}var pg=c8.forwardRef(function(Z,J){let{render:H,children:B,className:Q,"aria-describedby":X,"aria-label":z,"aria-labelledby":G,"aria-valuetext":U,disabled:Y=!1,getAriaLabel:K,getAriaValueText:F,id:W,index:q,inputRef:N,onBlur:D,onFocus:A,onKeyDown:V,tabIndex:L,style:O,...M}=Z,_=s0(W),{active:w,lastUsedThumbIndex:C,controlRef:E,disabled:j,validation:k,format:S,handleInputChange:I,inset:T,labelId:y,largeStep:R,locale:x,max:v,min:f,minStepsBetweenValues:b,form:l,name:r,orientation:h,pressedThumbCenterOffsetRef:d,pressedThumbIndexRef:o,renderBeforeHydration:p,setActive:i,setIndicatorPosition:n,state:Z0,step:J0,thumbRefs:U0,values:z0}=u8(),X0=i4(),q0=Y||j,N0=z0.length>1,F0=h==="vertical",s=X0==="rtl",{setTouched:a,setFocused:$0,validationMode:t}=o5(),B0=c8.useRef(null),_0=c8.useRef(null),P0=c8.useRef(!1),A0=Y0((f0)=>{if(P0.current)return;A?.(f0)}),L0=Y0((f0)=>{if(P0.current)return;D?.(f0)}),g=s0(),u=p6(),e=N0?g:u,W0=c8.useMemo(()=>({inputId:e}),[e]),{ref:S0,index:h0}=A4({metadata:W0}),v0=!N0?0:q??h0,T0=v0===z0.length-1,c0=z0[v0],G1=nQ(c0,f,v),[A1,d0]=c8.useState(),k0=GH(),S1=C>=0&&C<z0.length?C:-1,K1=Y0(()=>{let f0=E.current,t0=B0.current;if(!f0||!t0)return;let O1=t0.getBoundingClientRect(),j1=f0.getBoundingClientRect(),x0=F0?"height":"width",e0=j1[x0]-O1[x0],P1=(O1[x0]/2+e0*G1/100)/j1[x0]*100,m1=Number.isFinite(P1)?P1:void 0;if(d0(m1),v0===0)n((d1)=>[m1,d1[1]]);else if(T0)n((d1)=>[d1[0],m1])});H0(()=>{if(T)queueMicrotask(K1)},[K1,T]),H0(()=>{if(T)K1()},[K1,T,G1]),H0(()=>{if(!T)return;let f0=E.current,t0=B0.current;if(!f0||!t0)return;let O1=I1(f0).ResizeObserver;if(typeof O1!=="function")return;let j1=new O1(K1);return j1.observe(f0),j1.observe(t0),()=>{j1.disconnect()}},[E,K1,T]);let z5=F0?"bottom":"insetInlineStart",C0=F0?"left":"top",p0;if(N0){if(w===v0)p0=2;else if(S1===v0)p0=1}else if(w===v0)p0=1;let r0;if(!T&&!Number.isFinite(G1))r0=n8;else r0={position:"absolute",[z5]:T?"var(--position)":`${G1}%`,[C0]:"50%",translate:`${(F0||!s?-1:1)*50}% ${(F0?1:-1)*50}%`,zIndex:p0,...T&&{["--position"]:`${A1??0}%`,visibility:p&&k0||A1===void 0?"hidden":void 0}};let o0;if(F0)o0=s?"vertical-rl":"vertical-lr";let D0=typeof K==="function"?K(v0):z,y0=Y2({"aria-label":D0,"aria-labelledby":G??(D0==null?y:void 0),"aria-describedby":X,"aria-orientation":h,"aria-valuenow":c0,"aria-valuetext":typeof F==="function"?F(XH(c0,x,S),c0,v0):U??p70(z0,v0,S,x),disabled:q0,form:l,id:e,max:v,min:f,name:r,onChange(f0){I(f0.currentTarget.valueAsNumber,v0,f0)},onFocus(f0){let t0=P0.current;if(P0.current=!1,i(v0),$0(!0),t0)f0.stopPropagation()},onBlur(f0){if(P0.current){f0.stopPropagation();return}if(i(-1),U0.current.some((t0)=>R0(t0,f0.relatedTarget)))return;if(a(!0),$0(!1),t==="onBlur")k.commit(yF(c0,v0,f,v,N0,z0))},onKeyDown(f0){if(f0.defaultPrevented)return;if(!u70.has(f0.key))return;if(B9.has(f0.key))f0.stopPropagation();let t0=null,O1=0,j1=f0.shiftKey?R:J0,x0=gF(c0,J0,f);switch(f0.key){case HJ:O1=1;break;case XJ:O1=s?-1:1;break;case BJ:O1=-1;break;case QJ:O1=s?1:-1;break;case ID:j1=R,O1=1;break;case kD:j1=R,O1=-1;break;case GJ:t0=N0&&Number.isFinite(z0[v0+1])?z0[v0+1]-J0*b:v;break;case zJ:t0=N0&&Number.isFinite(z0[v0-1])?z0[v0-1]+J0*b:f;break;default:break}if(O1!==0)t0=c70(x0,j1,O1,f,v);if(t0!==null){let e0=f0.currentTarget;if(!E9(e0))P0.current=!0,e0.blur(),e0.focus({preventScroll:!0,focusVisible:!0});I(t0,v0,f0),f0.preventDefault()}},step:J0,style:{...n8,width:"100%",height:"100%",writingMode:o0},tabIndex:L,type:"range",value:c0??""},(f0)=>k.getValidationProps(q0,f0),{onFocus:A0,onBlur:L0,onKeyDown:V}),W1=p2(_0,k.inputRef,N);return G0("div",Z,{state:Z0,ref:[J,S0,B0],props:[{[mg]:v0,children:sQ.jsxs(c8.Fragment,{children:[B,sQ.jsx("input",{ref:W1,...y0,suppressHydrationWarning:!0}),T&&T0&&p&&(ug||(ug=sQ.jsx(pF,{script:mF})))]}),id:_,onPointerDown(f0){if(q0)return;o.current=v0;let t0=fF(f0.currentTarget,F0);d.current=(F0?f0.clientY:f0.clientX)-t0},style:r0,suppressHydrationWarning:p||void 0},M],stateAttributesMapping:t4})});var cg=P(m(),1);function d70($,Z,J,H,B,Q){let X={visibility:Q||J&&(H===void 0||Z&&B===void 0)?"hidden":void 0,position:$?"absolute":"relative",[$?"width":"height"]:"inherit"},z=`${H??0}%`,G=`${(B??0)-(H??0)}%`;if(J){if(X["--start-position"]=z,z="var(--start-position)",Z)X["--relative-size"]=G,G="var(--relative-size)"}return X[$?"bottom":"insetInlineStart"]=Z?z:0,X[$?"height":"width"]=Z?G:z,X}var dg=cg.forwardRef(function(Z,J){let{render:H,className:B,style:Q,...X}=Z,{indicatorPosition:z,inset:G,max:U,min:Y,orientation:K,renderBeforeHydration:F,state:W,values:q}=u8(),N=GH(),D=K==="vertical",A=q.length>1,V=d70(D,A,G,G?z[0]:nQ(q[0],Y,U),G?z[1]:nQ(q[q.length-1],Y,U),G&&F&&N);return G0("div",Z,{state:W,ref:J,props:[{["data-base-ui-slider-indicator"]:F?"":void 0,style:V,suppressHydrationWarning:F||void 0},X],stateAttributesMapping:t4})});var p$=P(c(),1);function lg({animate:$=!1,children:Z,className:J,defaultValue:H,value:B,min:Q=0,max:X=100,...z}){let[G,U]=cF.useState(!1),Y=Array.isArray(B)?B:Array.isArray(H)?H:[Q];return cF.useEffect(()=>{let K=requestAnimationFrame(()=>U(!0));return()=>cancelAnimationFrame(K)},[]),p$.jsx(V7.Root,{className:i0("data-horizontal:w-full data-vertical:h-full",J),"data-slot":"slider",defaultValue:H,value:B,min:Q,max:X,thumbAlignment:"edge",...z,children:p$.jsxs(V7.Control,{className:"relative flex w-full touch-none items-center select-none data-disabled:opacity-50 data-vertical:h-full data-vertical:min-h-40 data-vertical:w-auto data-vertical:flex-col",children:[p$.jsx(V7.Track,{"data-slot":"slider-track",className:"relative grow overflow-hidden rounded-full bg-accent select-none data-horizontal:h-1 data-horizontal:w-full data-vertical:h-full data-vertical:w-1",children:p$.jsx(V7.Indicator,{"data-slot":"slider-range",className:i0("bg-primary select-none data-horizontal:h-full data-vertical:w-full",$&&G&&"transition-[width,height,inset-inline-start,bottom] duration-100 ease-in-out")})}),Z,Array.from({length:Y.length},(K,F)=>p$.jsx(V7.Thumb,{"data-slot":"slider-thumb",className:i0("relative block size-3 shrink-0 rounded-xs bg-white shadow-xs ring-ring/50 select-none after:absolute after:-inset-2 hover:ring-3 focus-visible:ring-3 focus-visible:outline-hidden active:ring-3 disabled:pointer-events-none disabled:opacity-50 data-horizontal:cursor-ew-resize data-vertical:cursor-ns-resize",$&&G&&"transition-[inset-inline-start,bottom,color,box-shadow] duration-100 ease-in-out")},F))]})})}var M1=P(c(),1);function l70($){return $.charAt(0).toUpperCase()+$.slice(1)}function i70($){return $==="xhigh"?"Extra":l70($)}function ig($){return typeof $==="number"?$:$[0]??0}var rg={from:{opacity:0,filter:"blur(4px)"},to:{opacity:1,filter:"blur(0px)"}},ag={type:"spring",duration:0.3,delay:0.1,bounce:0};function ng({label:$,leadingIcon:Z,className:J,...H}){return M1.jsxs(M0,{...H,variant:"ghost",className:Q0("group/picker max-w-56 min-w-0 px-2 text-muted-foreground hover:text-muted-foreground",J),children:[Z,M1.jsx("span",{className:"truncate font-normal",children:$})]})}function r70({current:$,model:Z,models:J,onValueChange:H}){let B=Z.displayName,Q=jf(J,"Models");return M1.jsxs(X3,{children:[M1.jsx(z3,{render:M1.jsx(ng,{label:B,className:"shrink","aria-label":`Model: ${B}`})}),M1.jsx(G3,{align:"end",side:"top",className:"w-max max-w-64 min-w-40",children:M1.jsx(jg,{value:$,onValueChange:H,children:Q.map((X)=>M1.jsxs(D7,{children:[M1.jsx(IF,{children:X.label}),X.models.map((z)=>M1.jsx(Tg,{value:z.value,closeOnClick:!0,children:z.displayName},z.value))]},X.label))})})]})}function sg({fastMode:$,onChange:Z}){return M1.jsxs(i1,{children:[M1.jsx(r1,{render:M1.jsx(M0,{type:"button",variant:"ghost",size:"icon-sm","aria-label":$?"Turn off fast mode":"Turn on fast mode","aria-pressed":$,onClick:()=>Z(!$),className:"-my-1 -mr-1",children:$?M1.jsx(og,{className:"text-primary",stroke:1.75}):M1.jsx(JQ,{className:"text-muted-foreground",stroke:1.75})})}),M1.jsxs(a1,{align:"center",className:"flex-col gap-0",children:[M1.jsx("span",{children:"Fast mode"}),M1.jsx("span",{className:"font-normal text-muted-foreground",children:"More usage"})]})]})}function a70({currentEffort:$,effortLevels:Z,fastMode:J,showFastMode:H,onFastModeChange:B,onValueChange:Q}){let X=Mf(Z,$),[z,G]=UH.useState(!1),[U,Y]=UH.useState(X),[K,F]=UH.useState(!1),q=Z[z?U:X]??$,N=i70(q),D=(V)=>{if(V)Y(X);else F(!1);G(V)},A=(V)=>{let L=Z[V];if(L&&L!==$)Q(L)};return M1.jsxs(C6,{open:z,onOpenChange:D,children:[M1.jsx(E6,{render:M1.jsx(ng,{label:N,leadingIcon:J?M1.jsx(JQ,{stroke:1.5}):void 0,"aria-label":`Effort: ${N}`})}),M1.jsxs(b6,{align:"end",side:"top",className:"w-64",children:[M1.jsx(cw,{className:"relative h-5 flex-row items-center",children:M1.jsx(I4,{mode:"popLayout",initial:!1,children:K?M1.jsxs(Y5.div,{className:"flex h-5 w-full items-center justify-between text-sm text-muted-foreground","aria-hidden":"true",variants:rg,initial:"from",animate:"to",exit:"from",transition:ag,children:[M1.jsx("span",{children:"Faster"}),M1.jsx("span",{children:"Smarter"})]},"range"):M1.jsxs(Y5.div,{className:"flex h-5 w-full items-center justify-between gap-2",variants:rg,initial:"from",animate:"to",exit:"from",transition:ag,children:[M1.jsxs("div",{className:"flex items-center gap-1",children:[M1.jsx("span",{className:"text-muted-foreground",children:"Effort"}),M1.jsx("output",{"aria-live":"polite",children:N})]}),H&&M1.jsx(sg,{fastMode:J,onChange:B})]},"effort")})}),M1.jsxs("label",{className:"block",children:[M1.jsx("span",{className:"sr-only",children:"Reasoning effort"}),M1.jsx(lg,{value:[U],min:0,max:Z.length-1,step:1,onPointerDown:(V)=>{if(V.button===0)F(!0)},onPointerCancel:()=>F(!1),onValueChange:(V)=>Y(ig(V)),onValueCommitted:(V)=>{F(!1),A(ig(V))},className:Q0("**:data-[slot=slider-track]:h-6 **:data-[slot=slider-track]:rounded-sm","**:data-[slot=slider-thumb]:h-6 **:data-[slot=slider-thumb]:w-5 **:data-[slot=slider-thumb]:rounded-sm **:data-[slot=slider-thumb]:ring-0"),animate:!0,children:M1.jsx("span",{"data-slot":"slider-marks","aria-hidden":"true",className:"absolute inset-x-2 flex items-center justify-between",children:Array.from({length:Z.length},(V,L)=>M1.jsx("span",{className:Q0("size-1 rounded-full",L<=U?"bg-primary-foreground/30":"bg-foreground/30")},L))})})]})]})]})}var tg=UH.memo(function({sessionId:Z}){let{workspaceId:J,layout:H,setLayout:B}=b1(),{data:Q}=v8(J),X=Q?.models??[],z=X.find((_)=>_.value==="default"),G=Q?Of(X.filter((_)=>_.value!=="default"),Q.provider):[],U=wU(J,Z).data?.config,Y=rS(J),K=(Z?U?.model:void 0)??H.selectedModel,F=(Z?U?.effort:void 0)??H.selectedEffort,W=(Z?U?.fastMode:void 0)??H.selectedFastMode,q=(_)=>{if(Z)Y.mutate({sessionId:Z,patch:{model:_}});else B({selectedModel:_})},N=(_)=>{if(Z)Y.mutate({sessionId:Z,patch:{effort:_}});else B({selectedEffort:_})},D=(_)=>{if(Z)Y.mutate({sessionId:Z,patch:{fastMode:_}});else B({selectedFastMode:_})},A=QF(G,K,z?.resolvedModel);if(!A)return null;let V=A.supportsEffort?A.supportedEffortLevels??[]:[],L=iL(V,F,A.defaultEffort),O=Pf(V)&&L!==void 0,M=_f(A,W);return M1.jsxs("div",{className:"flex min-w-0 items-center gap-1",children:[M1.jsx(r70,{current:A.value,model:A,models:G,onValueChange:q}),!O&&A.supportsFastMode&&M1.jsx(sg,{fastMode:M,onChange:D}),O&&M1.jsx(a70,{currentEffort:L,effortLevels:V,fastMode:M,showFastMode:A.supportsFastMode===!0,onFastModeChange:D,onValueChange:N},A.value)]})});var T5=P(c(),1);function Zm({composerRef:$,onSend:Z,onStop:J,processing:H,sessionId:B,modelSessionId:Q,availability:X,chatReady:z,annotation:G,onRemoveDrawing:U,allowFiles:Y=!0,placeholder:K}){let F=c$.useRef(null),W=p1(),q=h3(),N=V2(W,B??F2(q)),D=T1((T)=>T.composerDrafts[N]??"");c$.useEffect(()=>{if(q==="overview")T1.getState().moveComposerDraft(W,N)},[q,W,N]);let A=q5(D),V=G4((T)=>T.attachments[F8(W,B)]??o70),[L,O]=c$.useState(!1),M=V.some((T)=>T.kind!=="text"&&T.status==="uploading"),_=V.some((T)=>T.kind==="text"||T.status==="ready"||T.status==="draft"),w=D.trim().length>0||_,C=z&&lQ(w,M,X),E=(T)=>{A.current=T,T1.getState().setComposerDraft(N,T)},j=(T)=>{if(Y)Tv({workspaceId:W,sessionId:B},T)},k=c$.useRef(!1),S=(T)=>{if(T.kind==="drawing"&&U){U(T.localId);return}y1.getState().removeAttachment(W,T.localId)},I=async()=>{if(!C||k.current)return;k.current=!0;try{await G?.finish(),await Z(A.current),A.current="",T1.getState().setComposerDraft(N,null)}catch(T){e1.add({title:T instanceof Error?T.message:"Couldn’t send message",type:"error"})}finally{k.current=!1}};return T5.jsxs(Sv,{composerRef:$,onSubmit:(T)=>{T.preventDefault(),I()},onDragOver:(T)=>{if(!T.dataTransfer.types.includes("Files"))return;if(T.preventDefault(),Y)O(!0)},onDragLeave:(T)=>{if(!Y)return;if(T.currentTarget.contains(T.relatedTarget))return;O(!1)},onDrop:(T)=>{if(!T.dataTransfer.types.includes("Files"))return;T.preventDefault(),O(!1),j(Array.from(T.dataTransfer.files))},className:Q0(L&&"ring-2 ring-ring/60"),children:[V.length>0&&T5.jsx("div",{className:"flex flex-wrap gap-2 px-1 pt-1 pb-1",children:V.toSorted((T,y)=>eg[T.kind]-eg[y.kind]).map((T)=>T.kind==="text"?T5.jsx(iQ,{label:T.label,onRemove:()=>S(T)},T.localId):T.kind==="drawing"?T5.jsx(Af,{attachment:T,onRemove:()=>S(T)},T.localId):T5.jsx(Df,{attachment:T,onRemove:()=>S(T)},T.localId))}),T5.jsx(Rv,{textareaRef:$,disabled:X.status!=="available",id:"chat-input",name:"message",value:D,onChange:(T)=>E(T.target.value),onKeyDown:(T)=>{if(T.key==="Enter"&&!T.shiftKey)T.preventDefault(),I()},onPaste:(T)=>{let y=Array.from(T.clipboardData?.files??[]);if(y.length===0)return;T.preventDefault(),j(y)},placeholder:H?"Queue a follow-up":K??"Do anything",rows:1}),T5.jsxs(Iv,{children:[Y&&T5.jsx("input",{ref:F,type:"file",multiple:!0,hidden:!0,onChange:(T)=>{j(Array.from(T.target.files??[])),T.target.value=""}}),T5.jsxs("div",{className:"mr-auto flex shrink-0 items-center gap-0.5",children:[Y&&T5.jsxs(i1,{children:[T5.jsx(r1,{render:T5.jsx(M0,{type:"button",variant:"ghost",size:"icon",onClick:()=>F.current?.click(),"aria-label":"Attach files",children:T5.jsx(DY,{stroke:1.6,className:"size-4.5!"})})}),T5.jsx(a1,{children:"Attach files"})]}),G&&T5.jsxs(i1,{children:[T5.jsx(r1,{render:T5.jsx(M0,{type:"button",variant:"ghost",size:"icon",onClick:G.onToggle,className:Q0(G.active&&"bg-accent"),"aria-label":"Draw annotation","aria-pressed":G.active,children:T5.jsx($H,{stroke:1.5})})}),T5.jsx(a1,{children:"Draw annotation"})]})]}),T5.jsx(tg,{sessionId:Q}),H?T5.jsxs(i1,{children:[T5.jsx(r1,{render:T5.jsx(M0,{type:"button",size:"icon",onClick:J,"aria-label":"Stop agent",children:T5.jsx($m,{})})}),T5.jsx(a1,{children:"Stop answering"})]}):T5.jsx(kv,{label:"Send message",hasContent:w,busy:M||!z,availability:X})]})]})}var o70=[],eg={file:0,drawing:1,text:2};var d$=P(c(),1);function KM({className:$,prompt:Z,disabled:J=!1,onSelect:H}){let B=Z.icon;return d$.jsxs(M0,{type:"button",size:"sm",disabled:J,onClick:()=>H(Z),className:Q0("h-auto items-start justify-start gap-2 rounded-lg p-2 px-3 text-left leading-snug whitespace-normal",$),children:[d$.jsx(B,{stroke:2,"aria-hidden":!0,className:"mt-0.5"}),d$.jsx("span",{children:Z.label})]})}function Jm({prompts:$,disabled:Z=!1,onSelect:J}){return d$.jsx("div",{className:"row-gap-2 grid w-full grid-cols-1 gap-x-3 gap-y-2 @md:grid-cols-3",children:$.map((H,B)=>{return d$.jsx(KM,{prompt:H,disabled:Z,onSelect:J,className:Q0("h-full w-fit @md:w-full",B===0&&"@md:translate-y-3 @md:rotate-3 @md:hover:translate-y-2.5",B===1&&"@md:-rotate-1",B===2&&"@md:translate-y-3 @md:-rotate-4 @md:hover:translate-y-2.5")},H.prompt)})})}var Q5=P(c(),1),FM="Keep the final reply brief and user-facing. Do not include file or storage links, file paths, or bundle, test, and runtime-log summaries.",n70=[{label:"Check the weather",prompt:"Build me a set of weather widgets that surface current conditions, today's hourly forecast, and a simple weekly outlook at a glance",context:["Build this onboarding example immediately without asking follow-up questions.","Create three separate widgets: current conditions, today's hourly forecast, and a seven-day outlook.","Use one shared Open-Meteo server function with no API key and use Berlin as the default location.","Give each widget an appropriate grid size and a compact, visually distinct layout with loading, error, and last-updated states.","Bundle all three widgets, smoke-test the shared weather function, and check runtime logs before finishing.",FM],icon:Hm},{label:"Track my finances",prompt:"Build me a personal finance view for tracking income, expenses, monthly budgets, spending trends, and savings, with an agent action that can add sample transactions",context:["Build this onboarding example immediately without asking follow-up questions, and don't use external services or bank connections.","Create a responsive View with a month selector, income, spending, and savings summaries, an income-versus-spending trend, category breakdowns, budget progress, and recent transactions.","Support adding, editing, and deleting income and expense transactions, categories, and monthly category budgets.","Persist transactions, categories, and budgets in a workspace-local SQLite database accessed through server functions. Store monetary amounts as integer cents and seed realistic sample data only when the database is empty.","Add an “Add with agent” action that imports `sendChatMessage` from `moi` and sends a concise request for the agent to generate and insert a realistic batch of sample transactions into the same database.","Provide a small documented workspace script the agent can use to validate and append transactions safely, then refresh the View data after the agent updates the database.","Include loading, empty, and error states, then bundle the View and smoke-test its SQLite persistence and transaction mutations before finishing.",FM],icon:Bm},{label:"Build a playful synthesizer",prompt:"Build me a view with a simple, playful synthesizer featuring a keyboard, five sound controls, and the ability to record, save, and load music files from the workspace",context:["Build this onboarding example immediately without asking follow-up questions, and don't use external services.","Create a responsive View that uses the browser's audio capabilities, with an onscreen piano and computer-keyboard controls.","Include five clearly labeled sound controls for waveform, attack, release, filter cutoff, and volume.","Let the user record timed note events, play and stop recordings, give them names, and save and load them as JSON music files in a workspace music folder.","Include clear empty and error states, then bundle the View and check runtime logs before finishing.",FM],icon:VY}],s70={label:"Explore the workspace",prompt:"Explore this workspace and suggest what Moi can build based on its content",context:["Explore the existing workspace files before making suggestions.","Briefly explain what the workspace appears to be for and which content informed your ideas.","Propose a focused set of useful widgets or views that fit the work already here.","Wait for me to choose before building anything."],icon:lF};function Qm({tabId:$,isViewDraft:Z,hasSentMessageFromMoi:J,isWorkspacePendingAnalysis:H}){if(Z)return"view-draft";if(!J)return"welcome";if(H)return"explore-workspace";return $==="overview"?"overview-empty":"tab-empty"}function Xm({agent:$,kind:Z,hasWorkspaceApplets:J,disabled:H=!1,onSelectPrompt:B,onNavigate:Q}){switch(Z){case"view-draft":return Q5.jsx(t70,{agent:$});case"welcome":return Q5.jsx(e70,{agent:$,disabled:H,showExamples:!J,onSelectPrompt:B,onNavigate:Q});case"explore-workspace":return Q5.jsx($$0,{agent:$,disabled:H,onSelectPrompt:B});case"overview-empty":return Q5.jsx(Z$0,{agent:$});case"tab-empty":return Q5.jsx(J$0,{agent:$})}}function eQ({agent:$,children:Z,className:J}){return Q5.jsxs("div",{className:Q0("flex flex-1 flex-col items-center justify-center self-center",J),children:[Q5.jsx(H3,{preset:$,color:"secondary",expression:"idle",className:"mb-2",animated:!0}),Z]})}function t70({agent:$}){return Q5.jsx(eQ,{agent:$,className:"text-center text-muted-foreground",children:Q5.jsx("p",{className:"mx-auto max-w-xs px-8 text-sm",children:"Describe the content, data, and key actions you need in the view"})})}function e70({agent:$,disabled:Z=!1,showExamples:J=!0,onSelectPrompt:H,onNavigate:B}){return Q5.jsx(eQ,{agent:$,className:"@container w-full max-w-md min-w-0",children:Q5.jsxs("div",{className:"mt-2 flex flex-col gap-4",children:[Q5.jsxs("div",{className:"prose prose-sm min-w-0 wrap-anywhere prose-inherit",children:[Q5.jsx("p",{children:"Moi is the personal workspace built for you by your agent. It grows and adapts to your needs."}),Q5.jsxs("p",{children:["Ask the agent to build widgets on the"," ",Q5.jsx(WM,{Icon:iF,destination:"overview",onNavigate:B,children:"Overview"})," ","page, or more complex tools as separate"," ",Q5.jsx(WM,{Icon:dF,destination:"views",onNavigate:B,children:"Views"}),". Use"," ",Q5.jsx(WM,{Icon:tQ,destination:"scratchpad",onNavigate:B,children:"Scratchpad"})," ","for exploring and shaping ideas with your agent."]}),J&&Q5.jsx("p",{children:"Try an example:"})]}),J&&Q5.jsx(Jm,{prompts:n70,disabled:Z,onSelect:H})]})})}function $$0({agent:$,disabled:Z=!1,onSelectPrompt:J}){return Q5.jsx(eQ,{agent:$,children:Q5.jsxs("div",{className:"flex flex-col items-center gap-4",children:[Q5.jsx("div",{className:"prose prose-sm max-w-xs min-w-0 text-center wrap-anywhere prose-inherit",children:Q5.jsx("p",{children:"Your agent can explore this workspace and suggest useful widgets and views based on what’s already here"})}),Q5.jsx(KM,{prompt:s70,disabled:Z,onSelect:J})]})})}function Z$0({agent:$}){return Q5.jsx(eQ,{agent:$,className:"text-center text-muted-foreground",children:Q5.jsx("p",{className:"mx-auto max-w-sm px-8 text-sm",children:"Chat with your agent, create widgets and views, and manage your workspace context from here"})})}function J$0({agent:$}){return Q5.jsx(eQ,{agent:$,className:"text-center text-muted-foreground",children:Q5.jsx("p",{className:"mx-auto max-w-sm px-8 text-sm",children:"Chat with your agent and manage the view from here"})})}function WM({Icon:$,children:Z,destination:J,onNavigate:H}){return Q5.jsxs("button",{type:"button","data-welcome-destination":J,onClick:()=>H(J),className:"inline-flex cursor-pointer items-center gap-0.5 align-bottom font-medium text-foreground",children:[Q5.jsx($,{size:16,stroke:1.75,"aria-hidden":!0}),Z]})}var $X=P(m(),1);var F1=P(c(),1);function H$0($){if($.flavor==="cron"||$.flavor==="subagent")return $.flavor;let Z=$.origin?.provider.trim().toLowerCase();return Z?Z:null}function B$0({active:$,canArchive:Z,confirmingArchive:J,onArchive:H,onRequestArchive:B,onSelect:Q,session:X,workspaceId:z}){let G=$X.useRef(!1),[U,Y]=$X.useState(!1),K=G4((N)=>tZ(N.activity,z,X.sessionId)),F=H$0(X);function W(){B(X.sessionId)}async function q(){if(G.current)return;G.current=!0,Y(!0);try{await H(X.sessionId)}catch{e1.add({title:"Couldn’t archive chat",type:"error"})}finally{G.current=!1,Y(!1)}}return F1.jsxs("div",{className:"group/chat relative",children:[F1.jsx(U3,{className:Q0("font-medium group-hover/chat:bg-accent group-hover/chat:text-accent-foreground",$&&"bg-accent text-accent-foreground"),onClick:()=>Q(X.sessionId),children:F1.jsx("div",{className:Q0("flex min-w-0 flex-1 overflow-hidden",(K||U)&&"mr-4 mask-r-from-[calc(100%-16px)]",Z&&!J&&"group-focus-within/chat:mr-4 group-focus-within/chat:mask-r-from-[calc(100%-16px)] group-hover/chat:mr-4 group-hover/chat:mask-r-from-[calc(100%-16px)] [@media(hover:none)]:mr-4 [@media(hover:none)]:mask-r-from-[calc(100%-16px)]",J&&"mr-14 mask-r-from-[calc(100%-16px)]"),children:F1.jsxs("span",{className:Q0("flex min-w-0 items-baseline gap-1.5",(K||U)&&"-mr-4",J?"-mr-14":Z&&"group-focus-within/chat:-mr-4 group-hover/chat:-mr-4 [@media(hover:none)]:-mr-4"),children:[F1.jsx("span",{className:"min-w-0 truncate",children:X.summary}),F&&F1.jsx("span",{className:"shrink-0 text-xs text-muted-foreground",children:F})]})})}),K&&F1.jsx(r2,{className:Q0("pointer-events-none absolute top-1/2 right-1.5 -translate-y-1/2 text-muted-foreground",Z&&"group-focus-within/chat:hidden group-hover/chat:hidden [@media(hover:none)]:hidden",(J||U)&&"hidden")}),Z&&F1.jsx("div",{className:Q0("absolute top-1/2 right-0 flex -translate-y-1/2 items-center opacity-100 transition-none",!J&&"group-focus-within/chat:opacity-100 group-hover/chat:opacity-100 [@media(hover:hover)]:opacity-0",U&&"opacity-100!"),children:J?F1.jsx(M0,{type:"button",variant:"secondary",size:"sm","aria-label":`Confirm archive ${X.summary}`,tabIndex:-1,className:"mr-1 h-5 rounded-sm px-1.5 text-xs hover:bg-accent",disabled:U,onClick:q,onPointerDown:(N)=>N.stopPropagation(),children:"Confirm"}):F1.jsxs(i1,{children:[F1.jsx(r1,{render:F1.jsx(M0,{type:"button",variant:"ghost",size:"icon-sm","aria-label":`Archive ${X.summary}`,tabIndex:-1,className:"text-muted-foreground hover:bg-transparent hover:text-foreground",disabled:U,onClick:W,onPointerDown:(N)=>N.stopPropagation(),children:F1.jsx(Gm,{stroke:1.75})})}),F1.jsx(a1,{side:"right",children:"Archive chat"})]})})]})}function Q$0($){return`${$.getFullYear()}-${$.getMonth()}-${$.getDate()}`}function zm($){return Date.UTC($.getFullYear(),$.getMonth(),$.getDate())/86400000}function X$0($,Z){let J=zm(Z)-zm($);if(J===0)return"Today";if(J===1)return"Yesterday";if(J>=2&&J<=5)return`${J} days ago`;return $.toLocaleDateString([],{month:"short",day:"numeric",...$.getFullYear()===Z.getFullYear()?{}:{year:"numeric"}})}function z$0($,Z=new Date){let J=new Map;for(let H of $.slice().sort((B,Q)=>Q.lastModified-B.lastModified)){let B=new Date(H.lastModified),Q=Q$0(B),X=J.get(Q);if(X){X.sessions.push(H);continue}J.set(Q,{key:Q,label:X$0(B,Z),sessions:[H]})}return[...J.values()]}function G$0($,Z,J=new Date){return z$0($.filter((H)=>Z==="overview"?!H.tabId?.startsWith("views/"):H.tabId===Z),J)}function Fm({className:$}){let Z=p1(),{pinnedSessionId:J,loaded:H,pin:B}=v6(),[Q]=v3(),{data:X=[]}=MJ(Z);if(!H)return null;if(J){let z=X.find((G)=>G.sessionId===J)?.summary;if(!z)return null;return F1.jsxs("div",{className:Q0("-my-0.5 -ml-0.5 box-content h-7 max-w-64 rounded-lg py-0.5 pr-0.5 pl-3","flex min-w-0 items-center gap-1 bg-accent text-sm font-medium"),children:[F1.jsx("span",{className:"min-w-0 flex-1 truncate",children:z}),F1.jsxs(i1,{children:[F1.jsx(r1,{render:F1.jsx(M0,{variant:"ghost",size:"icon-sm",className:$,onClick:()=>B(null),"aria-label":"Unpin chat","aria-pressed":!0,children:F1.jsx(Km,{stroke:1.75})})}),F1.jsx(a1,{children:"Unpin chat"})]},"unpin")]})}return F1.jsxs("div",{className:"flex w-full min-w-0 items-center justify-between gap-1",children:[F1.jsx(U$0,{className:$,sessions:X}),Q&&F1.jsxs(i1,{children:[F1.jsx(r1,{render:F1.jsx(M0,{variant:"ghost",size:"icon-sm",className:$,onClick:()=>B(Q),"aria-label":"Pin chat to workspace","aria-pressed":!1,children:F1.jsx(Ym,{stroke:1.75})})}),F1.jsx(a1,{children:"Pin chat to workspace"})]},"pin")]})}function U$0({className:$,sessions:Z}){let J=p1(),H=h3(),[B,Q]=v3(),[X,z]=$X.useState(null),G=v8(J).data?.supportsArchiving===!0,U=lS(J),Y=G$0(Z,H);if(Y.length===0&&!B)return null;function K(W){if(!W)z(null)}async function F(W){z(null),await U.mutateAsync(W);let q=y1.getState();if(q.clearAttachments(J,W),q.clearPreviewsForSession(J,W),B===W)Q(null)}return B?F1.jsxs(i1,{children:[F1.jsx(r1,{render:F1.jsx(M0,{variant:"ghost",size:"icon-sm","aria-label":"New chat",onClick:()=>Q(null),className:$,children:F1.jsx(rF,{stroke:1.75})})}),F1.jsx(a1,{children:"New chat"})]}):F1.jsxs(X3,{onOpenChange:K,children:[F1.jsxs(i1,{children:[F1.jsx(z3,{render:F1.jsx(r1,{render:F1.jsx(M0,{variant:"ghost",size:"icon-sm","aria-label":"History",className:$,children:F1.jsx(Um,{stroke:1.75})})})}),F1.jsx(a1,{children:"History"})]}),F1.jsx(G3,{align:"start",className:"flex max-h-100 w-max max-w-72 min-w-40 flex-col overflow-hidden",children:F1.jsx("div",{className:"no-scrollbar flex min-h-0 flex-1 scroll-fade flex-col gap-1 overflow-y-auto overscroll-contain [--scroll-fade-reveal:8px]",children:Y.map((W)=>F1.jsxs(D7,{children:[F1.jsx(IF,{children:W.label}),W.sessions.map((q)=>F1.jsx(B$0,{session:q,active:B===q.sessionId,canArchive:G,confirmingArchive:X===q.sessionId,onSelect:Q,onArchive:F,onRequestArchive:z,workspaceId:J},q.sessionId))]},W.key))})})]})}var Ii=P(m(),1);function X5(){}function aF(){}function Wm($,Z){let J=Z||{};return($[$.length-1]===""?[...$,""]:$).join((J.padRight?" ":"")+","+(J.padLeft===!1?"":" ")).trim()}var Y$0=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,K$0=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,F$0={};function oF($,Z){return((Z||F$0).jsx?K$0:Y$0).test($)}var W$0=/[ \t\n\f\r]/g;function qM($){return typeof $==="object"?$.type==="text"?qm($.value):!1:qm($)}function qm($){return $.replace(W$0,"")===""}class L7{constructor($,Z,J){if(this.normal=Z,this.property=$,J)this.space=J}}L7.prototype.normal={};L7.prototype.property={};L7.prototype.space=void 0;function NM($,Z){let J={},H={};for(let B of $)Object.assign(J,B.property),Object.assign(H,B.normal);return new L7(J,H,Z)}function ZX($){return $.toLowerCase()}class o2{constructor($,Z){this.attribute=Z,this.property=$}}o2.prototype.attribute="";o2.prototype.booleanish=!1;o2.prototype.boolean=!1;o2.prototype.commaOrSpaceSeparated=!1;o2.prototype.commaSeparated=!1;o2.prototype.defined=!1;o2.prototype.mustUseProperty=!1;o2.prototype.number=!1;o2.prototype.overloadedBoolean=!1;o2.prototype.property="";o2.prototype.spaceSeparated=!1;o2.prototype.space=void 0;var JX={};I5(JX,{spaceSeparated:()=>N5,overloadedBoolean:()=>nF,number:()=>b0,commaSeparated:()=>M7,commaOrSpaceSeparated:()=>e4,booleanish:()=>s5,boolean:()=>_1});var q$0=0,_1=l$(),s5=l$(),nF=l$(),b0=l$(),N5=l$(),M7=l$(),e4=l$();function l$(){return 2**++q$0}var AM=Object.keys(JX);class YH extends o2{constructor($,Z,J,H){let B=-1;super($,Z);if(Nm(this,"space",H),typeof J==="number")while(++B<AM.length){let Q=AM[B];Nm(this,AM[B],(J&JX[Q])===JX[Q])}}}YH.prototype.defined=!0;function Nm($,Z,J){if(J)$[Z]=J}function d8($){let Z={},J={};for(let[H,B]of Object.entries($.properties)){let Q=new YH(H,$.transform($.attributes||{},H),B,$.space);if($.mustUseProperty&&$.mustUseProperty.includes(H))Q.mustUseProperty=!0;Z[H]=Q,J[ZX(H)]=H,J[ZX(Q.attribute)]=H}return new L7(Z,J,$.space)}var DM=d8({properties:{ariaActiveDescendant:null,ariaAtomic:s5,ariaAutoComplete:null,ariaBusy:s5,ariaChecked:s5,ariaColCount:b0,ariaColIndex:b0,ariaColSpan:b0,ariaControls:N5,ariaCurrent:null,ariaDescribedBy:N5,ariaDetails:null,ariaDisabled:s5,ariaDropEffect:N5,ariaErrorMessage:null,ariaExpanded:s5,ariaFlowTo:N5,ariaGrabbed:s5,ariaHasPopup:null,ariaHidden:s5,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:N5,ariaLevel:b0,ariaLive:null,ariaModal:s5,ariaMultiLine:s5,ariaMultiSelectable:s5,ariaOrientation:null,ariaOwns:N5,ariaPlaceholder:null,ariaPosInSet:b0,ariaPressed:s5,ariaReadOnly:s5,ariaRelevant:null,ariaRequired:s5,ariaRoleDescription:N5,ariaRowCount:b0,ariaRowIndex:b0,ariaRowSpan:b0,ariaSelected:s5,ariaSetSize:b0,ariaSort:null,ariaValueMax:b0,ariaValueMin:b0,ariaValueNow:b0,ariaValueText:null,role:null},transform($,Z){return Z==="role"?Z:"aria-"+Z.slice(4).toLowerCase()}});function sF($,Z){return Z in $?$[Z]:Z}function tF($,Z){return sF($,Z.toLowerCase())}var Am=d8({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:M7,acceptCharset:N5,accessKey:N5,action:null,allow:null,allowFullScreen:_1,allowPaymentRequest:_1,allowUserMedia:_1,alt:null,as:null,async:_1,autoCapitalize:null,autoComplete:N5,autoFocus:_1,autoPlay:_1,blocking:N5,capture:null,charSet:null,checked:_1,cite:null,className:N5,cols:b0,colSpan:null,content:null,contentEditable:s5,controls:_1,controlsList:N5,coords:b0|M7,crossOrigin:null,data:null,dateTime:null,decoding:null,default:_1,defer:_1,dir:null,dirName:null,disabled:_1,download:nF,draggable:s5,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:_1,formTarget:null,headers:N5,height:b0,hidden:nF,high:b0,href:null,hrefLang:null,htmlFor:N5,httpEquiv:N5,id:null,imageSizes:null,imageSrcSet:null,inert:_1,inputMode:null,integrity:null,is:null,isMap:_1,itemId:null,itemProp:N5,itemRef:N5,itemScope:_1,itemType:N5,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:_1,low:b0,manifest:null,max:null,maxLength:b0,media:null,method:null,min:null,minLength:b0,multiple:_1,muted:_1,name:null,nonce:null,noModule:_1,noValidate:_1,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:_1,optimum:b0,pattern:null,ping:N5,placeholder:null,playsInline:_1,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:_1,referrerPolicy:null,rel:N5,required:_1,reversed:_1,rows:b0,rowSpan:b0,sandbox:N5,scope:null,scoped:_1,seamless:_1,selected:_1,shadowRootClonable:_1,shadowRootDelegatesFocus:_1,shadowRootMode:null,shape:null,size:b0,sizes:null,slot:null,span:b0,spellCheck:s5,src:null,srcDoc:null,srcLang:null,srcSet:null,start:b0,step:null,style:null,tabIndex:b0,target:null,title:null,translate:null,type:null,typeMustMatch:_1,useMap:null,value:s5,width:b0,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:N5,axis:null,background:null,bgColor:null,border:b0,borderColor:null,bottomMargin:b0,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:_1,declare:_1,event:null,face:null,frame:null,frameBorder:null,hSpace:b0,leftMargin:b0,link:null,longDesc:null,lowSrc:null,marginHeight:b0,marginWidth:b0,noResize:_1,noHref:_1,noShade:_1,noWrap:_1,object:null,profile:null,prompt:null,rev:null,rightMargin:b0,rules:null,scheme:null,scrolling:s5,standby:null,summary:null,text:null,topMargin:b0,valueType:null,version:null,vAlign:null,vLink:null,vSpace:b0,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:_1,disableRemotePlayback:_1,prefix:null,property:null,results:b0,security:null,unselectable:null},space:"html",transform:tF});var Dm=d8({attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",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",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",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",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",transformOrigin:"transform-origin",typeOf:"typeof",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",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},properties:{about:e4,accentHeight:b0,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:b0,amplitude:b0,arabicForm:null,ascent:b0,attributeName:null,attributeType:null,azimuth:b0,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:b0,by:null,calcMode:null,capHeight:b0,className:N5,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:b0,diffuseConstant:b0,direction:null,display:null,dur:null,divisor:b0,dominantBaseline:null,download:_1,dx:null,dy:null,edgeMode:null,editable:null,elevation:b0,enableBackground:null,end:null,event:null,exponent:b0,externalResourcesRequired:null,fill:null,fillOpacity:b0,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:M7,g2:M7,glyphName:M7,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:b0,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:b0,horizOriginX:b0,horizOriginY:b0,id:null,ideographic:b0,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:b0,k:b0,k1:b0,k2:b0,k3:b0,k4:b0,kernelMatrix:e4,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:b0,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:b0,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:b0,overlineThickness:b0,paintOrder:null,panose1:null,path:null,pathLength:b0,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:N5,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:b0,pointsAtY:b0,pointsAtZ:b0,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:e4,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:e4,rev:e4,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:e4,requiredFeatures:e4,requiredFonts:e4,requiredFormats:e4,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:b0,specularExponent:b0,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:b0,strikethroughThickness:b0,string:null,stroke:null,strokeDashArray:e4,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:b0,strokeOpacity:b0,strokeWidth:null,style:null,surfaceScale:b0,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:e4,tabIndex:b0,tableValues:null,target:null,targetX:b0,targetY:b0,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:e4,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:b0,underlineThickness:b0,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:b0,values:null,vAlphabetic:b0,vMathematical:b0,vectorEffect:null,vHanging:b0,vIdeographic:b0,version:null,vertAdvY:b0,vertOriginX:b0,vertOriginY:b0,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:b0,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:sF});var VM=d8({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform($,Z){return"xlink:"+Z.slice(5).toLowerCase()}});var LM=d8({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:tF});var MM=d8({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform($,Z){return"xml:"+Z.slice(3).toLowerCase()}});var PM={classId:"classID",dataType:"datatype",itemId:"itemID",strokeDashArray:"strokeDasharray",strokeDashOffset:"strokeDashoffset",strokeLineCap:"strokeLinecap",strokeLineJoin:"strokeLinejoin",strokeMiterLimit:"strokeMiterlimit",typeOf:"typeof",xLinkActuate:"xlinkActuate",xLinkArcRole:"xlinkArcrole",xLinkHref:"xlinkHref",xLinkRole:"xlinkRole",xLinkShow:"xlinkShow",xLinkTitle:"xlinkTitle",xLinkType:"xlinkType",xmlnsXLink:"xmlnsXlink"};var N$0=/[A-Z]/g,Vm=/-[a-z]/g,A$0=/^data[-\w.:]+$/i;function _M($,Z){let J=ZX(Z),H=Z,B=o2;if(J in $.normal)return $.property[$.normal[J]];if(J.length>4&&J.slice(0,4)==="data"&&A$0.test(Z)){if(Z.charAt(4)==="-"){let Q=Z.slice(5).replace(Vm,V$0);H="data"+Q.charAt(0).toUpperCase()+Q.slice(1)}else{let Q=Z.slice(4);if(!Vm.test(Q)){let X=Q.replace(N$0,D$0);if(X.charAt(0)!=="-")X="-"+X;Z="data"+X}}B=YH}return new B(H,Z)}function D$0($){return"-"+$.toLowerCase()}function V$0($){return $.charAt(1).toUpperCase()}var Lm=NM([DM,Am,VM,LM,MM],"html"),eF=NM([DM,Dm,VM,LM,MM],"svg");function Mm($){return $.join(" ").trim()}var vm=P(km(),1);var $W=ym("end"),KH=ym("start");function ym($){return Z;function Z(J){let H=J&&J.position&&J.position[$]||{};if(typeof H.line==="number"&&H.line>0&&typeof H.column==="number"&&H.column>0)return{line:H.line,column:H.column,offset:typeof H.offset==="number"&&H.offset>-1?H.offset:void 0}}}function TM($){let Z=KH($),J=$W($);if(Z&&J)return{start:Z,end:J}}function P7($){if(!$||typeof $!=="object")return"";if("position"in $||"type"in $)return xm($.position);if("start"in $||"end"in $)return xm($);if("line"in $||"column"in $)return CM($);return""}function CM($){return hm($&&$.line)+":"+hm($&&$.column)}function xm($){return CM($&&$.start)+"-"+CM($&&$.end)}function hm($){return $&&typeof $==="number"?$:1}class N2 extends Error{constructor($,Z,J){super();if(typeof Z==="string")J=Z,Z=void 0;let H="",B={},Q=!1;if(Z)if("line"in Z&&"column"in Z)B={place:Z};else if("start"in Z&&"end"in Z)B={place:Z};else if("type"in Z)B={ancestors:[Z],place:Z.position};else B={...Z};if(typeof $==="string")H=$;else if(!B.cause&&$)Q=!0,H=$.message,B.cause=$;if(!B.ruleId&&!B.source&&typeof J==="string"){let z=J.indexOf(":");if(z===-1)B.ruleId=J;else B.source=J.slice(0,z),B.ruleId=J.slice(z+1)}if(!B.place&&B.ancestors&&B.ancestors){let z=B.ancestors[B.ancestors.length-1];if(z)B.place=z.position}let X=B.place&&"start"in B.place?B.place.start:B.place;this.ancestors=B.ancestors||void 0,this.cause=B.cause||void 0,this.column=X?X.column:void 0,this.fatal=void 0,this.file="",this.message=H,this.line=X?X.line:void 0,this.name=P7(B.place)||"1:1",this.place=B.place||void 0,this.reason=this.message,this.ruleId=B.ruleId||void 0,this.source=B.source||void 0,this.stack=Q&&B.cause&&typeof B.cause.stack==="string"?B.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}N2.prototype.file="";N2.prototype.name="";N2.prototype.reason="";N2.prototype.message="";N2.prototype.stack="";N2.prototype.column=void 0;N2.prototype.line=void 0;N2.prototype.ancestors=void 0;N2.prototype.cause=void 0;N2.prototype.fatal=void 0;N2.prototype.place=void 0;N2.prototype.ruleId=void 0;N2.prototype.source=void 0;var EM={}.hasOwnProperty,d$0=new Map,l$0=/[A-Z]/g,i$0=new Set(["table","tbody","thead","tfoot","tr"]),r$0=new Set(["td","th"]),fm="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function bM($,Z){if(!Z||Z.Fragment===void 0)throw TypeError("Expected `Fragment` in options");let J=Z.filePath||void 0,H;if(Z.development){if(typeof Z.jsxDEV!=="function")throw TypeError("Expected `jsxDEV` in options when `development: true`");H=ZZ0(J,Z.jsxDEV)}else{if(typeof Z.jsx!=="function")throw TypeError("Expected `jsx` in production options");if(typeof Z.jsxs!=="function")throw TypeError("Expected `jsxs` in production options");H=$Z0(J,Z.jsx,Z.jsxs)}let B={Fragment:Z.Fragment,ancestors:[],components:Z.components||{},create:H,elementAttributeNameCase:Z.elementAttributeNameCase||"react",evaluater:Z.createEvaluater?Z.createEvaluater():void 0,filePath:J,ignoreInvalidStyle:Z.ignoreInvalidStyle||!1,passKeys:Z.passKeys!==!1,passNode:Z.passNode||!1,schema:Z.space==="svg"?eF:Lm,stylePropertyNameCase:Z.stylePropertyNameCase||"dom",tableCellAlignToStyle:Z.tableCellAlignToStyle!==!1},Q=gm(B,$,void 0);if(Q&&typeof Q!=="string")return Q;return B.create($,B.Fragment,{children:Q||void 0},void 0)}function gm($,Z,J){if(Z.type==="element")return a$0($,Z,J);if(Z.type==="mdxFlowExpression"||Z.type==="mdxTextExpression")return o$0($,Z);if(Z.type==="mdxJsxFlowElement"||Z.type==="mdxJsxTextElement")return s$0($,Z,J);if(Z.type==="mdxjsEsm")return n$0($,Z);if(Z.type==="root")return t$0($,Z,J);if(Z.type==="text")return e$0($,Z)}function a$0($,Z,J){let H=$.schema,B=H;if(Z.tagName.toLowerCase()==="svg"&&H.space==="html")B=eF,$.schema=B;$.ancestors.push(Z);let Q=um($,Z.tagName,!1),X=JZ0($,Z),z=SM($,Z);if(i$0.has(Z.tagName))z=z.filter(function(G){return typeof G==="string"?!qM(G):!0});return mm($,X,Q,Z),wM(X,z),$.ancestors.pop(),$.schema=H,$.create(Z,Q,X,J)}function o$0($,Z){if(Z.data&&Z.data.estree&&$.evaluater){let H=Z.data.estree.body[0];return X5(H.type==="ExpressionStatement"),$.evaluater.evaluateExpression(H.expression)}BX($,Z.position)}function n$0($,Z){if(Z.data&&Z.data.estree&&$.evaluater)return $.evaluater.evaluateProgram(Z.data.estree);BX($,Z.position)}function s$0($,Z,J){let H=$.schema,B=H;if(Z.name==="svg"&&H.space==="html")B=eF,$.schema=B;$.ancestors.push(Z);let Q=Z.name===null?$.Fragment:um($,Z.name,!0),X=HZ0($,Z),z=SM($,Z);return mm($,X,Q,Z),wM(X,z),$.ancestors.pop(),$.schema=H,$.create(Z,Q,X,J)}function t$0($,Z,J){let H={};return wM(H,SM($,Z)),$.create(Z,$.Fragment,H,J)}function e$0($,Z){return Z.value}function mm($,Z,J,H){if(typeof J!=="string"&&J!==$.Fragment&&$.passNode)Z.node=H}function wM($,Z){if(Z.length>0){let J=Z.length>1?Z:Z[0];if(J)$.children=J}}function $Z0($,Z,J){return H;function H(B,Q,X,z){let U=Array.isArray(X.children)?J:Z;return z?U(Q,X,z):U(Q,X)}}function ZZ0($,Z){return J;function J(H,B,Q,X){let z=Array.isArray(Q.children),G=KH(H);return Z(B,Q,X,z,{columnNumber:G?G.column-1:void 0,fileName:$,lineNumber:G?G.line:void 0},void 0)}}function JZ0($,Z){let J={},H,B;for(B in Z.properties)if(B!=="children"&&EM.call(Z.properties,B)){let Q=BZ0($,B,Z.properties[B]);if(Q){let[X,z]=Q;if($.tableCellAlignToStyle&&X==="align"&&typeof z==="string"&&r$0.has(Z.tagName))H=z;else J[X]=z}}if(H){let Q=J.style||(J.style={});Q[$.stylePropertyNameCase==="css"?"text-align":"textAlign"]=H}return J}function HZ0($,Z){let J={};for(let H of Z.attributes)if(H.type==="mdxJsxExpressionAttribute")if(H.data&&H.data.estree&&$.evaluater){let Q=H.data.estree.body[0];X5(Q.type==="ExpressionStatement");let X=Q.expression;X5(X.type==="ObjectExpression");let z=X.properties[0];X5(z.type==="SpreadElement"),Object.assign(J,$.evaluater.evaluateExpression(z.argument))}else BX($,Z.position);else{let B=H.name,Q;if(H.value&&typeof H.value==="object")if(H.value.data&&H.value.data.estree&&$.evaluater){let z=H.value.data.estree.body[0];X5(z.type==="ExpressionStatement"),Q=$.evaluater.evaluateExpression(z.expression)}else BX($,Z.position);else Q=H.value===null?!0:H.value;J[B]=Q}return J}function SM($,Z){let J=[],H=-1,B=$.passKeys?new Map:d$0;while(++H<Z.children.length){let Q=Z.children[H],X;if($.passKeys){let G=Q.type==="element"?Q.tagName:Q.type==="mdxJsxFlowElement"||Q.type==="mdxJsxTextElement"?Q.name:void 0;if(G){let U=B.get(G)||0;X=G+"-"+U,B.set(G,U+1)}}let z=gm($,Q,X);if(z!==void 0)J.push(z)}return J}function BZ0($,Z,J){let H=_M($.schema,Z);if(J===null||J===void 0||typeof J==="number"&&Number.isNaN(J))return;if(Array.isArray(J))J=H.commaSeparated?Wm(J):Mm(J);if(H.property==="style"){let B=typeof J==="object"?J:QZ0($,String(J));if($.stylePropertyNameCase==="css")B=XZ0(B);return["style",B]}return[$.elementAttributeNameCase==="react"&&H.space?PM[H.property]||H.property:H.attribute,J]}function QZ0($,Z){try{return vm.default(Z,{reactCompat:!0})}catch(J){if($.ignoreInvalidStyle)return{};let H=J,B=new N2("Cannot parse `style` attribute",{ancestors:$.ancestors,cause:H,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw B.file=$.filePath||void 0,B.url=fm+"#cannot-parse-style-attribute",B}}function um($,Z,J){let H;if(!J)H={type:"Literal",value:Z};else if(Z.includes(".")){let B=Z.split("."),Q=-1,X;while(++Q<B.length){let z=oF(B[Q])?{type:"Identifier",name:B[Q]}:{type:"Literal",value:B[Q]};X=X?{type:"MemberExpression",object:X,property:z,computed:Boolean(Q&&z.type==="Literal"),optional:!1}:z}X5(X,"always a result"),H=X}else H=oF(Z)&&!/^[a-z]/.test(Z)?{type:"Identifier",name:Z}:{type:"Literal",value:Z};if(H.type==="Literal"){let B=H.value;return EM.call($.components,B)?$.components[B]:B}if($.evaluater)return $.evaluater.evaluateExpression(H);BX($)}function BX($,Z){let J=new N2("Cannot handle MDX estrees without `createEvaluater`",{ancestors:$.ancestors,place:Z,ruleId:"mdx-estree",source:"hast-util-to-jsx-runtime"});throw J.file=$.filePath||void 0,J.url=fm+"#cannot-handle-mdx-estrees-without-createevaluater",J}function XZ0($){let Z={},J;for(J in $)if(EM.call($,J))Z[zZ0(J)]=$[J];return Z}function zZ0($){let Z=$.replace(l$0,GZ0);if(Z.slice(0,3)==="ms-")Z="-"+Z;return Z}function GZ0($){return"-"+$.toLowerCase()}var QX={action:["form"],cite:["blockquote","del","ins","q"],data:["object"],formAction:["button","input"],href:["a","area","base","link"],icon:["menuitem"],itemId:null,manifest:["html"],ping:["a","area"],poster:["video"],src:["audio","embed","iframe","img","input","script","source","track","video"]};var LH=P(c(),1),Yp=P(m(),1);var UZ0={};function r$($,Z){let J=Z||UZ0,H=typeof J.includeImageAlt==="boolean"?J.includeImageAlt:!0,B=typeof J.includeHtml==="boolean"?J.includeHtml:!0;return cm($,H,B)}function cm($,Z,J){if(YZ0($)){if("value"in $)return $.type==="html"&&!J?"":$.value;if(Z&&"alt"in $&&$.alt)return $.alt;if("children"in $)return pm($.children,Z,J)}if(Array.isArray($))return pm($,Z,J);return""}function pm($,Z,J){let H=[],B=-1;while(++B<$.length)H[B]=cm($[B],Z,J);return H.join("")}function YZ0($){return Boolean($&&typeof $==="object")}var dm=document.createElement("i");function FH($){let Z="&"+$+";";dm.innerHTML=Z;let J=dm.textContent;if(J.charCodeAt(J.length-1)===59&&$!=="semi")return!1;return J===Z?!1:J}function Q2($,Z,J,H){let B=$.length,Q=0,X;if(Z<0)Z=-Z>B?0:B+Z;else Z=Z>B?B:Z;if(J=J>0?J:0,H.length<1e4)X=Array.from(H),X.unshift(Z,J),$.splice(...X);else{if(J)$.splice(Z,J);while(Q<H.length)X=H.slice(Q,Q+1e4),X.unshift(Z,0),$.splice(...X),Q+=1e4,Z+=1e4}}function k4($,Z){if($.length>0)return Q2($,$.length,0,Z),$;return Z}var lm={}.hasOwnProperty;function ZW($){let Z={},J=-1;while(++J<$.length)KZ0(Z,$[J]);return Z}function KZ0($,Z){let J;for(J in Z){let B=(lm.call($,J)?$[J]:void 0)||($[J]={}),Q=Z[J],X;if(Q)for(X in Q){if(!lm.call(B,X))B[X]=[];let z=Q[X];FZ0(B[X],Array.isArray(z)?z:z?[z]:[])}}}function FZ0($,Z){let J=-1,H=[];while(++J<Z.length)(Z[J].add==="after"?$:H).push(Z[J]);Q2($,0,0,H)}function JW($,Z){let J=Number.parseInt($,Z);if(J<9||J===11||J>13&&J<32||J>126&&J<160||J>55295&&J<57344||J>64975&&J<65008||(J&65535)===65535||(J&65535)===65534||J>1114111)return"�";return String.fromCodePoint(J)}function L4($){return $.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}var _2=_7(/[A-Za-z]/),t5=_7(/[\dA-Za-z]/),im=_7(/[#-'*+\--9=?A-Z^-~]/);function a$($){return $!==null&&($<32||$===127)}var XX=_7(/\d/),rm=_7(/[\dA-Fa-f]/),am=_7(/[!-/:-@[-`{-~]/);function u0($){return $!==null&&$<-2}function h1($){return $!==null&&($<0||$===32)}function X1($){return $===-2||$===-1||$===32}var o$=_7(/\p{P}|\p{S}/u),Y3=_7(/\s/);function _7($){return Z;function Z(J){return J!==null&&J>-1&&$.test(String.fromCharCode(J))}}function l8($){let Z=[],J=-1,H=0,B=0;while(++J<$.length){let Q=$.charCodeAt(J),X="";if(Q===37&&t5($.charCodeAt(J+1))&&t5($.charCodeAt(J+2)))B=2;else if(Q<128){if(!/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(Q)))X=String.fromCharCode(Q)}else if(Q>55295&&Q<57344){let z=$.charCodeAt(J+1);if(Q<56320&&z>56319&&z<57344)X=String.fromCharCode(Q,z),B=1;else X="�"}else X=String.fromCharCode(Q);if(X)Z.push($.slice(H,J),encodeURIComponent(X)),H=J+B+1,X="";if(B)J+=B,B=0}return Z.join("")+$.slice(H)}function J1($,Z,J,H){let B=H?H-1:Number.POSITIVE_INFINITY,Q=0;return X;function X(G){if(X1(G))return $.enter(J),z(G);return Z(G)}function z(G){if(X1(G)&&Q++<B)return $.consume(G),z;return $.exit(J),Z(G)}}var om={tokenize:WZ0};function WZ0($){let Z=$.attempt(this.parser.constructs.contentInitial,H,B),J;return Z;function H(z){if(z===null){$.consume(z);return}return $.enter("lineEnding"),$.consume(z),$.exit("lineEnding"),J1($,Z,"linePrefix")}function B(z){return $.enter("paragraph"),Q(z)}function Q(z){let G=$.enter("chunkText",{contentType:"text",previous:J});if(J)J.next=G;return J=G,X(z)}function X(z){if(z===null){$.exit("chunkText"),$.exit("paragraph"),$.consume(z);return}if(u0(z))return $.consume(z),$.exit("chunkText"),Q;return $.consume(z),X}}var sm={tokenize:qZ0},nm={tokenize:NZ0};function qZ0($){let Z=this,J=[],H=0,B,Q,X;return z;function z(L){if(H<J.length){let O=J[H];return Z.containerState=O[1],$.attempt(O[0].continuation,G,U)(L)}return U(L)}function G(L){if(H++,Z.containerState._closeFlow){if(Z.containerState._closeFlow=void 0,B)V();let O=Z.events.length,M=O,_;while(M--)if(Z.events[M][0]==="exit"&&Z.events[M][1].type==="chunkFlow"){_=Z.events[M][1].end;break}A(H);let w=O;while(w<Z.events.length)Z.events[w][1].end={..._},w++;return Q2(Z.events,M+1,0,Z.events.slice(O)),Z.events.length=w,U(L)}return z(L)}function U(L){if(H===J.length){if(!B)return F(L);if(B.currentConstruct&&B.currentConstruct.concrete)return q(L);Z.interrupt=Boolean(B.currentConstruct&&!B._gfmTableDynamicInterruptHack)}return Z.containerState={},$.check(nm,Y,K)(L)}function Y(L){if(B)V();return A(H),F(L)}function K(L){return Z.parser.lazy[Z.now().line]=H!==J.length,X=Z.now().offset,q(L)}function F(L){return Z.containerState={},$.attempt(nm,W,q)(L)}function W(L){return H++,J.push([Z.currentConstruct,Z.containerState]),F(L)}function q(L){if(L===null){if(B)V();A(0),$.consume(L);return}return B=B||Z.parser.flow(Z.now()),$.enter("chunkFlow",{_tokenizer:B,contentType:"flow",previous:Q}),N(L)}function N(L){if(L===null){D($.exit("chunkFlow"),!0),A(0),$.consume(L);return}if(u0(L))return $.consume(L),D($.exit("chunkFlow")),H=0,Z.interrupt=void 0,z;return $.consume(L),N}function D(L,O){let M=Z.sliceStream(L);if(O)M.push(null);if(L.previous=Q,Q)Q.next=L;if(Q=L,B.defineSkip(L.start),B.write(M),Z.parser.lazy[L.start.line]){let _=B.events.length;while(_--)if(B.events[_][1].start.offset<X&&(!B.events[_][1].end||B.events[_][1].end.offset>X))return;let w=Z.events.length,C=w,E,j;while(C--)if(Z.events[C][0]==="exit"&&Z.events[C][1].type==="chunkFlow"){if(E){j=Z.events[C][1].end;break}E=!0}A(H),_=w;while(_<Z.events.length)Z.events[_][1].end={...j},_++;Q2(Z.events,C+1,0,Z.events.slice(w)),Z.events.length=_}}function A(L){let O=J.length;while(O-- >L){let M=J[O];Z.containerState=M[1],M[0].exit.call(Z,$)}J.length=L}function V(){B.write([null]),Q=void 0,B=void 0,Z.containerState._closeFlow=void 0}}function NZ0($,Z,J){return J1($,$.attempt(this.parser.constructs.document,Z,J),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function d3($){if($===null||h1($)||Y3($))return 1;if(o$($))return 2}function O7($,Z,J){let H=[],B=-1;while(++B<$.length){let Q=$[B].resolveAll;if(Q&&!H.includes(Q))Z=Q(Z,J),H.push(Q)}return Z}var zX={name:"attention",resolveAll:AZ0,tokenize:DZ0};function AZ0($,Z){let J=-1,H,B,Q,X,z,G,U,Y;while(++J<$.length)if($[J][0]==="enter"&&$[J][1].type==="attentionSequence"&&$[J][1]._close){H=J;while(H--)if($[H][0]==="exit"&&$[H][1].type==="attentionSequence"&&$[H][1]._open&&Z.sliceSerialize($[H][1]).charCodeAt(0)===Z.sliceSerialize($[J][1]).charCodeAt(0)){if(($[H][1]._close||$[J][1]._open)&&($[J][1].end.offset-$[J][1].start.offset)%3&&!(($[H][1].end.offset-$[H][1].start.offset+$[J][1].end.offset-$[J][1].start.offset)%3))continue;G=$[H][1].end.offset-$[H][1].start.offset>1&&$[J][1].end.offset-$[J][1].start.offset>1?2:1;let K={...$[H][1].end},F={...$[J][1].start};if(tm(K,-G),tm(F,G),X={type:G>1?"strongSequence":"emphasisSequence",start:K,end:{...$[H][1].end}},z={type:G>1?"strongSequence":"emphasisSequence",start:{...$[J][1].start},end:F},Q={type:G>1?"strongText":"emphasisText",start:{...$[H][1].end},end:{...$[J][1].start}},B={type:G>1?"strong":"emphasis",start:{...X.start},end:{...z.end}},$[H][1].end={...X.start},$[J][1].start={...z.end},U=[],$[H][1].end.offset-$[H][1].start.offset)U=k4(U,[["enter",$[H][1],Z],["exit",$[H][1],Z]]);if(U=k4(U,[["enter",B,Z],["enter",X,Z],["exit",X,Z],["enter",Q,Z]]),U=k4(U,O7(Z.parser.constructs.insideSpan.null,$.slice(H+1,J),Z)),U=k4(U,[["exit",Q,Z],["enter",z,Z],["exit",z,Z],["exit",B,Z]]),$[J][1].end.offset-$[J][1].start.offset)Y=2,U=k4(U,[["enter",$[J][1],Z],["exit",$[J][1],Z]]);else Y=0;Q2($,H-1,J-H+3,U),J=H+U.length-Y-2;break}}J=-1;while(++J<$.length)if($[J][1].type==="attentionSequence")$[J][1].type="data";return $}function DZ0($,Z){let J=this.parser.constructs.attentionMarkers.null,H=this.previous,B=d3(H),Q;return X;function X(G){return Q=G,$.enter("attentionSequence"),z(G)}function z(G){if(G===Q)return $.consume(G),z;let U=$.exit("attentionSequence"),Y=d3(G),K=!Y||Y===2&&B||J.includes(G),F=!B||B===2&&Y||J.includes(H);return U._open=Boolean(Q===42?K:K&&(B||!F)),U._close=Boolean(Q===42?F:F&&(Y||!K)),Z(G)}}function tm($,Z){$.column+=Z,$.offset+=Z,$._bufferIndex+=Z}var RM={name:"autolink",tokenize:VZ0};function VZ0($,Z,J){let H=0;return B;function B(W){return $.enter("autolink"),$.enter("autolinkMarker"),$.consume(W),$.exit("autolinkMarker"),$.enter("autolinkProtocol"),Q}function Q(W){if(_2(W))return $.consume(W),X;if(W===64)return J(W);return U(W)}function X(W){if(W===43||W===45||W===46||t5(W))return H=1,z(W);return U(W)}function z(W){if(W===58)return $.consume(W),H=0,G;if((W===43||W===45||W===46||t5(W))&&H++<32)return $.consume(W),z;return H=0,U(W)}function G(W){if(W===62)return $.exit("autolinkProtocol"),$.enter("autolinkMarker"),$.consume(W),$.exit("autolinkMarker"),$.exit("autolink"),Z;if(W===null||W===32||W===60||a$(W))return J(W);return $.consume(W),G}function U(W){if(W===64)return $.consume(W),Y;if(im(W))return $.consume(W),U;return J(W)}function Y(W){return t5(W)?K(W):J(W)}function K(W){if(W===46)return $.consume(W),H=0,Y;if(W===62)return $.exit("autolinkProtocol").type="autolinkEmail",$.enter("autolinkMarker"),$.consume(W),$.exit("autolinkMarker"),$.exit("autolink"),Z;return F(W)}function F(W){if((W===45||t5(W))&&H++<63){let q=W===45?F:K;return $.consume(W),q}return J(W)}}var K3={partial:!0,tokenize:LZ0};function LZ0($,Z,J){return H;function H(Q){return X1(Q)?J1($,B,"linePrefix")(Q):B(Q)}function B(Q){return Q===null||u0(Q)?Z(Q):J(Q)}}var HW={continuation:{tokenize:PZ0},exit:_Z0,name:"blockQuote",tokenize:MZ0};function MZ0($,Z,J){let H=this;return B;function B(X){if(X===62){let z=H.containerState;if(!z.open)$.enter("blockQuote",{_container:!0}),z.open=!0;return $.enter("blockQuotePrefix"),$.enter("blockQuoteMarker"),$.consume(X),$.exit("blockQuoteMarker"),Q}return J(X)}function Q(X){if(X1(X))return $.enter("blockQuotePrefixWhitespace"),$.consume(X),$.exit("blockQuotePrefixWhitespace"),$.exit("blockQuotePrefix"),Z;return $.exit("blockQuotePrefix"),Z(X)}}function PZ0($,Z,J){let H=this;return B;function B(X){if(X1(X))return J1($,Q,"linePrefix",H.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(X);return Q(X)}function Q(X){return $.attempt(HW,Z,J)(X)}}function _Z0($){$.exit("blockQuote")}var BW={name:"characterEscape",tokenize:OZ0};function OZ0($,Z,J){return H;function H(Q){return $.enter("characterEscape"),$.enter("escapeMarker"),$.consume(Q),$.exit("escapeMarker"),B}function B(Q){if(am(Q))return $.enter("characterEscapeValue"),$.consume(Q),$.exit("characterEscapeValue"),$.exit("characterEscape"),Z;return J(Q)}}var QW={name:"characterReference",tokenize:jZ0};function jZ0($,Z,J){let H=this,B=0,Q,X;return z;function z(K){return $.enter("characterReference"),$.enter("characterReferenceMarker"),$.consume(K),$.exit("characterReferenceMarker"),G}function G(K){if(K===35)return $.enter("characterReferenceMarkerNumeric"),$.consume(K),$.exit("characterReferenceMarkerNumeric"),U;return $.enter("characterReferenceValue"),Q=31,X=t5,Y(K)}function U(K){if(K===88||K===120)return $.enter("characterReferenceMarkerHexadecimal"),$.consume(K),$.exit("characterReferenceMarkerHexadecimal"),$.enter("characterReferenceValue"),Q=6,X=rm,Y;return $.enter("characterReferenceValue"),Q=7,X=XX,Y(K)}function Y(K){if(K===59&&B){let F=$.exit("characterReferenceValue");if(X===t5&&!FH(H.sliceSerialize(F)))return J(K);return $.enter("characterReferenceMarker"),$.consume(K),$.exit("characterReferenceMarker"),$.exit("characterReference"),Z}if(X(K)&&B++<Q)return $.consume(K),Y;return J(K)}}var em={partial:!0,tokenize:CZ0},XW={concrete:!0,name:"codeFenced",tokenize:TZ0};function TZ0($,Z,J){let H=this,B={partial:!0,tokenize:M},Q=0,X=0,z;return G;function G(_){return U(_)}function U(_){let w=H.events[H.events.length-1];return Q=w&&w[1].type==="linePrefix"?w[2].sliceSerialize(w[1],!0).length:0,z=_,$.enter("codeFenced"),$.enter("codeFencedFence"),$.enter("codeFencedFenceSequence"),Y(_)}function Y(_){if(_===z)return X++,$.consume(_),Y;if(X<3)return J(_);return $.exit("codeFencedFenceSequence"),X1(_)?J1($,K,"whitespace")(_):K(_)}function K(_){if(_===null||u0(_))return $.exit("codeFencedFence"),H.interrupt?Z(_):$.check(em,N,O)(_);return $.enter("codeFencedFenceInfo"),$.enter("chunkString",{contentType:"string"}),F(_)}function F(_){if(_===null||u0(_))return $.exit("chunkString"),$.exit("codeFencedFenceInfo"),K(_);if(X1(_))return $.exit("chunkString"),$.exit("codeFencedFenceInfo"),J1($,W,"whitespace")(_);if(_===96&&_===z)return J(_);return $.consume(_),F}function W(_){if(_===null||u0(_))return K(_);return $.enter("codeFencedFenceMeta"),$.enter("chunkString",{contentType:"string"}),q(_)}function q(_){if(_===null||u0(_))return $.exit("chunkString"),$.exit("codeFencedFenceMeta"),K(_);if(_===96&&_===z)return J(_);return $.consume(_),q}function N(_){return $.attempt(B,O,D)(_)}function D(_){return $.enter("lineEnding"),$.consume(_),$.exit("lineEnding"),A}function A(_){return Q>0&&X1(_)?J1($,V,"linePrefix",Q+1)(_):V(_)}function V(_){if(_===null||u0(_))return $.check(em,N,O)(_);return $.enter("codeFlowValue"),L(_)}function L(_){if(_===null||u0(_))return $.exit("codeFlowValue"),V(_);return $.consume(_),L}function O(_){return $.exit("codeFenced"),Z(_)}function M(_,w,C){let E=0;return j;function j(y){return _.enter("lineEnding"),_.consume(y),_.exit("lineEnding"),k}function k(y){return _.enter("codeFencedFence"),X1(y)?J1(_,S,"linePrefix",H.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(y):S(y)}function S(y){if(y===z)return _.enter("codeFencedFenceSequence"),I(y);return C(y)}function I(y){if(y===z)return E++,_.consume(y),I;if(E>=X)return _.exit("codeFencedFenceSequence"),X1(y)?J1(_,T,"whitespace")(y):T(y);return C(y)}function T(y){if(y===null||u0(y))return _.exit("codeFencedFence"),w(y);return C(y)}}}function CZ0($,Z,J){let H=this;return B;function B(X){if(X===null)return J(X);return $.enter("lineEnding"),$.consume(X),$.exit("lineEnding"),Q}function Q(X){return H.parser.lazy[H.now().line]?J(X):Z(X)}}var GX={name:"codeIndented",tokenize:bZ0},EZ0={partial:!0,tokenize:wZ0};function bZ0($,Z,J){let H=this;return B;function B(U){return $.enter("codeIndented"),J1($,Q,"linePrefix",5)(U)}function Q(U){let Y=H.events[H.events.length-1];return Y&&Y[1].type==="linePrefix"&&Y[2].sliceSerialize(Y[1],!0).length>=4?X(U):J(U)}function X(U){if(U===null)return G(U);if(u0(U))return $.attempt(EZ0,X,G)(U);return $.enter("codeFlowValue"),z(U)}function z(U){if(U===null||u0(U))return $.exit("codeFlowValue"),X(U);return $.consume(U),z}function G(U){return $.exit("codeIndented"),Z(U)}}function wZ0($,Z,J){let H=this;return B;function B(X){if(H.parser.lazy[H.now().line])return J(X);if(u0(X))return $.enter("lineEnding"),$.consume(X),$.exit("lineEnding"),B;return J1($,Q,"linePrefix",5)(X)}function Q(X){let z=H.events[H.events.length-1];return z&&z[1].type==="linePrefix"&&z[2].sliceSerialize(z[1],!0).length>=4?Z(X):u0(X)?B(X):J(X)}}var IM={name:"codeText",previous:RZ0,resolve:SZ0,tokenize:IZ0};function SZ0($){let Z=$.length-4,J=3,H,B;if(($[J][1].type==="lineEnding"||$[J][1].type==="space")&&($[Z][1].type==="lineEnding"||$[Z][1].type==="space")){H=J;while(++H<Z)if($[H][1].type==="codeTextData"){$[J][1].type="codeTextPadding",$[Z][1].type="codeTextPadding",J+=2,Z-=2;break}}H=J-1,Z++;while(++H<=Z)if(B===void 0){if(H!==Z&&$[H][1].type!=="lineEnding")B=H}else if(H===Z||$[H][1].type==="lineEnding"){if($[B][1].type="codeTextData",H!==B+2)$[B][1].end=$[H-1][1].end,$.splice(B+2,H-B-2),Z-=H-B-2,H=B+2;B=void 0}return $}function RZ0($){return $!==96||this.events[this.events.length-1][1].type==="characterEscape"}function IZ0($,Z,J){let H=this,B=0,Q,X;return z;function z(F){return $.enter("codeText"),$.enter("codeTextSequence"),G(F)}function G(F){if(F===96)return $.consume(F),B++,G;return $.exit("codeTextSequence"),U(F)}function U(F){if(F===null)return J(F);if(F===32)return $.enter("space"),$.consume(F),$.exit("space"),U;if(F===96)return X=$.enter("codeTextSequence"),Q=0,K(F);if(u0(F))return $.enter("lineEnding"),$.consume(F),$.exit("lineEnding"),U;return $.enter("codeTextData"),Y(F)}function Y(F){if(F===null||F===32||F===96||u0(F))return $.exit("codeTextData"),U(F);return $.consume(F),Y}function K(F){if(F===96)return $.consume(F),Q++,K;if(Q===B)return $.exit("codeTextSequence"),$.exit("codeText"),Z(F);return X.type="codeTextData",Y(F)}}class kM{constructor($){this.left=$?[...$]:[],this.right=[]}get($){if($<0||$>=this.left.length+this.right.length)throw RangeError("Cannot access index `"+$+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");if($<this.left.length)return this.left[$];return this.right[this.right.length-$+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice($,Z){let J=Z===null||Z===void 0?Number.POSITIVE_INFINITY:Z;if(J<this.left.length)return this.left.slice($,J);if($>this.left.length)return this.right.slice(this.right.length-J+this.left.length,this.right.length-$+this.left.length).reverse();return this.left.slice($).concat(this.right.slice(this.right.length-J+this.left.length).reverse())}splice($,Z,J){let H=Z||0;this.setCursor(Math.trunc($));let B=this.right.splice(this.right.length-H,Number.POSITIVE_INFINITY);if(J)UX(this.left,J);return B.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push($){this.setCursor(Number.POSITIVE_INFINITY),this.left.push($)}pushMany($){this.setCursor(Number.POSITIVE_INFINITY),UX(this.left,$)}unshift($){this.setCursor(0),this.right.push($)}unshiftMany($){this.setCursor(0),UX(this.right,$.reverse())}setCursor($){if($===this.left.length||$>this.left.length&&this.right.length===0||$<0&&this.left.length===0)return;if($<this.left.length){let Z=this.left.splice($,Number.POSITIVE_INFINITY);UX(this.right,Z.reverse())}else{let Z=this.right.splice(this.left.length+this.right.length-$,Number.POSITIVE_INFINITY);UX(this.left,Z.reverse())}}}function UX($,Z){let J=0;if(Z.length<1e4)$.push(...Z);else while(J<Z.length)$.push(...Z.slice(J,J+1e4)),J+=1e4}function zW($){let Z={},J=-1,H,B,Q,X,z,G,U,Y=new kM($);while(++J<Y.length){while(J in Z)J=Z[J];if(H=Y.get(J),J&&H[1].type==="chunkFlow"&&Y.get(J-1)[1].type==="listItemPrefix"){if(G=H[1]._tokenizer.events,Q=0,Q<G.length&&G[Q][1].type==="lineEndingBlank")Q+=2;if(Q<G.length&&G[Q][1].type==="content")while(++Q<G.length){if(G[Q][1].type==="content")break;if(G[Q][1].type==="chunkText")G[Q][1]._isInFirstContentOfListItem=!0,Q++}}if(H[0]==="enter"){if(H[1].contentType)Object.assign(Z,kZ0(Y,J)),J=Z[J],U=!0}else if(H[1]._container){Q=J,B=void 0;while(Q--)if(X=Y.get(Q),X[1].type==="lineEnding"||X[1].type==="lineEndingBlank"){if(X[0]==="enter"){if(B)Y.get(B)[1].type="lineEndingBlank";X[1].type="lineEnding",B=Q}}else if(X[1].type==="linePrefix"||X[1].type==="listItemIndent");else break;if(B)H[1].end={...Y.get(B)[1].start},z=Y.slice(B,J),z.unshift(H),Y.splice(B,J-B+1,z)}}return Q2($,0,Number.POSITIVE_INFINITY,Y.slice(0)),!U}function kZ0($,Z){let J=$.get(Z)[1],H=$.get(Z)[2],B=Z-1,Q=[],X=J._tokenizer;if(!X){if(X=H.parser[J.contentType](J.start),J._contentTypeTextTrailing)X._contentTypeTextTrailing=!0}let z=X.events,G=[],U={},Y,K,F=-1,W=J,q=0,N=0,D=[N];while(W){while($.get(++B)[1]!==W);if(Q.push(B),!W._tokenizer){if(Y=H.sliceStream(W),!W.next)Y.push(null);if(K)X.defineSkip(W.start);if(W._isInFirstContentOfListItem)X._gfmTasklistFirstContentOfListItem=!0;if(X.write(Y),W._isInFirstContentOfListItem)X._gfmTasklistFirstContentOfListItem=void 0}K=W,W=W.next}W=J;while(++F<z.length)if(z[F][0]==="exit"&&z[F-1][0]==="enter"&&z[F][1].type===z[F-1][1].type&&z[F][1].start.line!==z[F][1].end.line)N=F+1,D.push(N),W._tokenizer=void 0,W.previous=void 0,W=W.next;if(X.events=[],W)W._tokenizer=void 0,W.previous=void 0;else D.pop();F=D.length;while(F--){let A=z.slice(D[F],D[F+1]),V=Q.pop();G.push([V,V+A.length-1]),$.splice(V,2,A)}G.reverse(),F=-1;while(++F<G.length)U[q+G[F][0]]=q+G[F][1],q+=G[F][1]-G[F][0]-1;return U}var yM={resolve:xZ0,tokenize:hZ0},yZ0={partial:!0,tokenize:vZ0};function xZ0($){return zW($),$}function hZ0($,Z){let J;return H;function H(z){return $.enter("content"),J=$.enter("chunkContent",{contentType:"content"}),B(z)}function B(z){if(z===null)return Q(z);if(u0(z))return $.check(yZ0,X,Q)(z);return $.consume(z),B}function Q(z){return $.exit("chunkContent"),$.exit("content"),Z(z)}function X(z){return $.consume(z),$.exit("chunkContent"),J.next=$.enter("chunkContent",{contentType:"content",previous:J}),J=J.next,B}}function vZ0($,Z,J){let H=this;return B;function B(X){return $.exit("chunkContent"),$.enter("lineEnding"),$.consume(X),$.exit("lineEnding"),J1($,Q,"linePrefix")}function Q(X){if(X===null||u0(X))return J(X);let z=H.events[H.events.length-1];if(!H.parser.constructs.disable.null.includes("codeIndented")&&z&&z[1].type==="linePrefix"&&z[2].sliceSerialize(z[1],!0).length>=4)return Z(X);return $.interrupt(H.parser.constructs.flow,J,Z)(X)}}function GW($,Z,J,H,B,Q,X,z,G){let U=G||Number.POSITIVE_INFINITY,Y=0;return K;function K(A){if(A===60)return $.enter(H),$.enter(B),$.enter(Q),$.consume(A),$.exit(Q),F;if(A===null||A===32||A===41||a$(A))return J(A);return $.enter(H),$.enter(X),$.enter(z),$.enter("chunkString",{contentType:"string"}),N(A)}function F(A){if(A===62)return $.enter(Q),$.consume(A),$.exit(Q),$.exit(B),$.exit(H),Z;return $.enter(z),$.enter("chunkString",{contentType:"string"}),W(A)}function W(A){if(A===62)return $.exit("chunkString"),$.exit(z),F(A);if(A===null||A===60||u0(A))return J(A);return $.consume(A),A===92?q:W}function q(A){if(A===60||A===62||A===92)return $.consume(A),W;return W(A)}function N(A){if(!Y&&(A===null||A===41||h1(A)))return $.exit("chunkString"),$.exit(z),$.exit(X),$.exit(H),Z(A);if(Y<U&&A===40)return $.consume(A),Y++,N;if(A===41)return $.consume(A),Y--,N;if(A===null||A===32||A===40||a$(A))return J(A);return $.consume(A),A===92?D:N}function D(A){if(A===40||A===41||A===92)return $.consume(A),N;return N(A)}}function UW($,Z,J,H,B,Q){let X=this,z=0,G;return U;function U(W){return $.enter(H),$.enter(B),$.consume(W),$.exit(B),$.enter(Q),Y}function Y(W){if(z>999||W===null||W===91||W===93&&!G||W===94&&!z&&"_hiddenFootnoteSupport"in X.parser.constructs)return J(W);if(W===93)return $.exit(Q),$.enter(B),$.consume(W),$.exit(B),$.exit(H),Z;if(u0(W))return $.enter("lineEnding"),$.consume(W),$.exit("lineEnding"),Y;return $.enter("chunkString",{contentType:"string"}),K(W)}function K(W){if(W===null||W===91||W===93||u0(W)||z++>999)return $.exit("chunkString"),Y(W);if($.consume(W),!G)G=!X1(W);return W===92?F:K}function F(W){if(W===91||W===92||W===93)return $.consume(W),z++,K;return K(W)}}function YW($,Z,J,H,B,Q){let X;return z;function z(F){if(F===34||F===39||F===40)return $.enter(H),$.enter(B),$.consume(F),$.exit(B),X=F===40?41:F,G;return J(F)}function G(F){if(F===X)return $.enter(B),$.consume(F),$.exit(B),$.exit(H),Z;return $.enter(Q),U(F)}function U(F){if(F===X)return $.exit(Q),G(X);if(F===null)return J(F);if(u0(F))return $.enter("lineEnding"),$.consume(F),$.exit("lineEnding"),J1($,U,"linePrefix");return $.enter("chunkString",{contentType:"string"}),Y(F)}function Y(F){if(F===X||F===null||u0(F))return $.exit("chunkString"),U(F);return $.consume(F),F===92?K:Y}function K(F){if(F===X||F===92)return $.consume(F),Y;return Y(F)}}function n$($,Z){let J;return H;function H(B){if(u0(B))return $.enter("lineEnding"),$.consume(B),$.exit("lineEnding"),J=!0,H;if(X1(B))return J1($,H,J?"linePrefix":"lineSuffix")(B);return Z(B)}}var xM={name:"definition",tokenize:gZ0},fZ0={partial:!0,tokenize:mZ0};function gZ0($,Z,J){let H=this,B;return Q;function Q(W){return $.enter("definition"),X(W)}function X(W){return UW.call(H,$,z,J,"definitionLabel","definitionLabelMarker","definitionLabelString")(W)}function z(W){if(B=L4(H.sliceSerialize(H.events[H.events.length-1][1]).slice(1,-1)),W===58)return $.enter("definitionMarker"),$.consume(W),$.exit("definitionMarker"),G;return J(W)}function G(W){return h1(W)?n$($,U)(W):U(W)}function U(W){return GW($,Y,J,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(W)}function Y(W){return $.attempt(fZ0,K,K)(W)}function K(W){return X1(W)?J1($,F,"whitespace")(W):F(W)}function F(W){if(W===null||u0(W))return $.exit("definition"),H.parser.defined.push(B),Z(W);return J(W)}}function mZ0($,Z,J){return H;function H(z){return h1(z)?n$($,B)(z):J(z)}function B(z){return YW($,Q,J,"definitionTitle","definitionTitleMarker","definitionTitleString")(z)}function Q(z){return X1(z)?J1($,X,"whitespace")(z):X(z)}function X(z){return z===null||u0(z)?Z(z):J(z)}}var hM={name:"hardBreakEscape",tokenize:uZ0};function uZ0($,Z,J){return H;function H(Q){return $.enter("hardBreakEscape"),$.consume(Q),B}function B(Q){if(u0(Q))return $.exit("hardBreakEscape"),Z(Q);return J(Q)}}var vM={name:"headingAtx",resolve:pZ0,tokenize:cZ0};function pZ0($,Z){let J=$.length-2,H=3,B,Q;if($[H][1].type==="whitespace")H+=2;if(J-2>H&&$[J][1].type==="whitespace")J-=2;if($[J][1].type==="atxHeadingSequence"&&(H===J-1||J-4>H&&$[J-2][1].type==="whitespace"))J-=H+1===J?2:4;if(J>H)B={type:"atxHeadingText",start:$[H][1].start,end:$[J][1].end},Q={type:"chunkText",start:$[H][1].start,end:$[J][1].end,contentType:"text"},Q2($,H,J-H+1,[["enter",B,Z],["enter",Q,Z],["exit",Q,Z],["exit",B,Z]]);return $}function cZ0($,Z,J){let H=0;return B;function B(Y){return $.enter("atxHeading"),Q(Y)}function Q(Y){return $.enter("atxHeadingSequence"),X(Y)}function X(Y){if(Y===35&&H++<6)return $.consume(Y),X;if(Y===null||h1(Y))return $.exit("atxHeadingSequence"),z(Y);return J(Y)}function z(Y){if(Y===35)return $.enter("atxHeadingSequence"),G(Y);if(Y===null||u0(Y))return $.exit("atxHeading"),Z(Y);if(X1(Y))return J1($,z,"whitespace")(Y);return $.enter("atxHeadingText"),U(Y)}function G(Y){if(Y===35)return $.consume(Y),G;return $.exit("atxHeadingSequence"),z(Y)}function U(Y){if(Y===null||Y===35||h1(Y))return $.exit("atxHeadingText"),z(Y);return $.consume(Y),U}}var $u=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],fM=["pre","script","style","textarea"];var gM={concrete:!0,name:"htmlFlow",resolveTo:iZ0,tokenize:rZ0},dZ0={partial:!0,tokenize:oZ0},lZ0={partial:!0,tokenize:aZ0};function iZ0($){let Z=$.length;while(Z--)if($[Z][0]==="enter"&&$[Z][1].type==="htmlFlow")break;if(Z>1&&$[Z-2][1].type==="linePrefix")$[Z][1].start=$[Z-2][1].start,$[Z+1][1].start=$[Z-2][1].start,$.splice(Z-2,2);return $}function rZ0($,Z,J){let H=this,B,Q,X,z,G;return U;function U(h){return Y(h)}function Y(h){return $.enter("htmlFlow"),$.enter("htmlFlowData"),$.consume(h),K}function K(h){if(h===33)return $.consume(h),F;if(h===47)return $.consume(h),Q=!0,N;if(h===63)return $.consume(h),B=3,H.interrupt?Z:b;if(_2(h))return $.consume(h),X=String.fromCharCode(h),D;return J(h)}function F(h){if(h===45)return $.consume(h),B=2,W;if(h===91)return $.consume(h),B=5,z=0,q;if(_2(h))return $.consume(h),B=4,H.interrupt?Z:b;return J(h)}function W(h){if(h===45)return $.consume(h),H.interrupt?Z:b;return J(h)}function q(h){if(h==="CDATA[".charCodeAt(z++)){if($.consume(h),z===6)return H.interrupt?Z:S;return q}return J(h)}function N(h){if(_2(h))return $.consume(h),X=String.fromCharCode(h),D;return J(h)}function D(h){if(h===null||h===47||h===62||h1(h)){let d=h===47,o=X.toLowerCase();if(!d&&!Q&&fM.includes(o))return B=1,H.interrupt?Z(h):S(h);if($u.includes(X.toLowerCase())){if(B=6,d)return $.consume(h),A;return H.interrupt?Z(h):S(h)}return B=7,H.interrupt&&!H.parser.lazy[H.now().line]?J(h):Q?V(h):L(h)}if(h===45||t5(h))return $.consume(h),X+=String.fromCharCode(h),D;return J(h)}function A(h){if(h===62)return $.consume(h),H.interrupt?Z:S;return J(h)}function V(h){if(X1(h))return $.consume(h),V;return j(h)}function L(h){if(h===47)return $.consume(h),j;if(h===58||h===95||_2(h))return $.consume(h),O;if(X1(h))return $.consume(h),L;return j(h)}function O(h){if(h===45||h===46||h===58||h===95||t5(h))return $.consume(h),O;return M(h)}function M(h){if(h===61)return $.consume(h),_;if(X1(h))return $.consume(h),M;return L(h)}function _(h){if(h===null||h===60||h===61||h===62||h===96)return J(h);if(h===34||h===39)return $.consume(h),G=h,w;if(X1(h))return $.consume(h),_;return C(h)}function w(h){if(h===G)return $.consume(h),G=null,E;if(h===null||u0(h))return J(h);return $.consume(h),w}function C(h){if(h===null||h===34||h===39||h===47||h===60||h===61||h===62||h===96||h1(h))return M(h);return $.consume(h),C}function E(h){if(h===47||h===62||X1(h))return L(h);return J(h)}function j(h){if(h===62)return $.consume(h),k;return J(h)}function k(h){if(h===null||u0(h))return S(h);if(X1(h))return $.consume(h),k;return J(h)}function S(h){if(h===45&&B===2)return $.consume(h),R;if(h===60&&B===1)return $.consume(h),x;if(h===62&&B===4)return $.consume(h),l;if(h===63&&B===3)return $.consume(h),b;if(h===93&&B===5)return $.consume(h),f;if(u0(h)&&(B===6||B===7))return $.exit("htmlFlowData"),$.check(dZ0,r,I)(h);if(h===null||u0(h))return $.exit("htmlFlowData"),I(h);return $.consume(h),S}function I(h){return $.check(lZ0,T,r)(h)}function T(h){return $.enter("lineEnding"),$.consume(h),$.exit("lineEnding"),y}function y(h){if(h===null||u0(h))return I(h);return $.enter("htmlFlowData"),S(h)}function R(h){if(h===45)return $.consume(h),b;return S(h)}function x(h){if(h===47)return $.consume(h),X="",v;return S(h)}function v(h){if(h===62){let d=X.toLowerCase();if(fM.includes(d))return $.consume(h),l;return S(h)}if(_2(h)&&X.length<8)return $.consume(h),X+=String.fromCharCode(h),v;return S(h)}function f(h){if(h===93)return $.consume(h),b;return S(h)}function b(h){if(h===62)return $.consume(h),l;if(h===45&&B===2)return $.consume(h),b;return S(h)}function l(h){if(h===null||u0(h))return $.exit("htmlFlowData"),r(h);return $.consume(h),l}function r(h){return $.exit("htmlFlow"),Z(h)}}function aZ0($,Z,J){let H=this;return B;function B(X){if(u0(X))return $.enter("lineEnding"),$.consume(X),$.exit("lineEnding"),Q;return J(X)}function Q(X){return H.parser.lazy[H.now().line]?J(X):Z(X)}}function oZ0($,Z,J){return H;function H(B){return $.enter("lineEnding"),$.consume(B),$.exit("lineEnding"),$.attempt(K3,Z,J)}}var mM={name:"htmlText",tokenize:nZ0};function nZ0($,Z,J){let H=this,B,Q,X;return z;function z(b){return $.enter("htmlText"),$.enter("htmlTextData"),$.consume(b),G}function G(b){if(b===33)return $.consume(b),U;if(b===47)return $.consume(b),M;if(b===63)return $.consume(b),L;if(_2(b))return $.consume(b),C;return J(b)}function U(b){if(b===45)return $.consume(b),Y;if(b===91)return $.consume(b),Q=0,q;if(_2(b))return $.consume(b),V;return J(b)}function Y(b){if(b===45)return $.consume(b),W;return J(b)}function K(b){if(b===null)return J(b);if(b===45)return $.consume(b),F;if(u0(b))return X=K,x(b);return $.consume(b),K}function F(b){if(b===45)return $.consume(b),W;return K(b)}function W(b){return b===62?R(b):b===45?F(b):K(b)}function q(b){if(b==="CDATA[".charCodeAt(Q++))return $.consume(b),Q===6?N:q;return J(b)}function N(b){if(b===null)return J(b);if(b===93)return $.consume(b),D;if(u0(b))return X=N,x(b);return $.consume(b),N}function D(b){if(b===93)return $.consume(b),A;return N(b)}function A(b){if(b===62)return R(b);if(b===93)return $.consume(b),A;return N(b)}function V(b){if(b===null||b===62)return R(b);if(u0(b))return X=V,x(b);return $.consume(b),V}function L(b){if(b===null)return J(b);if(b===63)return $.consume(b),O;if(u0(b))return X=L,x(b);return $.consume(b),L}function O(b){return b===62?R(b):L(b)}function M(b){if(_2(b))return $.consume(b),_;return J(b)}function _(b){if(b===45||t5(b))return $.consume(b),_;return w(b)}function w(b){if(u0(b))return X=w,x(b);if(X1(b))return $.consume(b),w;return R(b)}function C(b){if(b===45||t5(b))return $.consume(b),C;if(b===47||b===62||h1(b))return E(b);return J(b)}function E(b){if(b===47)return $.consume(b),R;if(b===58||b===95||_2(b))return $.consume(b),j;if(u0(b))return X=E,x(b);if(X1(b))return $.consume(b),E;return R(b)}function j(b){if(b===45||b===46||b===58||b===95||t5(b))return $.consume(b),j;return k(b)}function k(b){if(b===61)return $.consume(b),S;if(u0(b))return X=k,x(b);if(X1(b))return $.consume(b),k;return E(b)}function S(b){if(b===null||b===60||b===61||b===62||b===96)return J(b);if(b===34||b===39)return $.consume(b),B=b,I;if(u0(b))return X=S,x(b);if(X1(b))return $.consume(b),S;return $.consume(b),T}function I(b){if(b===B)return $.consume(b),B=void 0,y;if(b===null)return J(b);if(u0(b))return X=I,x(b);return $.consume(b),I}function T(b){if(b===null||b===34||b===39||b===60||b===61||b===96)return J(b);if(b===47||b===62||h1(b))return E(b);return $.consume(b),T}function y(b){if(b===47||b===62||h1(b))return E(b);return J(b)}function R(b){if(b===62)return $.consume(b),$.exit("htmlTextData"),$.exit("htmlText"),Z;return J(b)}function x(b){return $.exit("htmlTextData"),$.enter("lineEnding"),$.consume(b),$.exit("lineEnding"),v}function v(b){return X1(b)?J1($,f,"linePrefix",H.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(b):f(b)}function f(b){return $.enter("htmlTextData"),X(b)}}var s$={name:"labelEnd",resolveAll:$J0,resolveTo:ZJ0,tokenize:JJ0},sZ0={tokenize:HJ0},tZ0={tokenize:BJ0},eZ0={tokenize:QJ0};function $J0($){let Z=-1,J=[];while(++Z<$.length){let H=$[Z][1];if(J.push($[Z]),H.type==="labelImage"||H.type==="labelLink"||H.type==="labelEnd"){let B=H.type==="labelImage"?4:2;H.type="data",Z+=B}}if($.length!==J.length)Q2($,0,$.length,J);return $}function ZJ0($,Z){let J=$.length,H=0,B,Q,X,z;while(J--)if(B=$[J][1],Q){if(B.type==="link"||B.type==="labelLink"&&B._inactive)break;if($[J][0]==="enter"&&B.type==="labelLink")B._inactive=!0}else if(X){if($[J][0]==="enter"&&(B.type==="labelImage"||B.type==="labelLink")&&!B._balanced){if(Q=J,B.type!=="labelLink"){H=2;break}}}else if(B.type==="labelEnd")X=J;let G={type:$[Q][1].type==="labelLink"?"link":"image",start:{...$[Q][1].start},end:{...$[$.length-1][1].end}},U={type:"label",start:{...$[Q][1].start},end:{...$[X][1].end}},Y={type:"labelText",start:{...$[Q+H+2][1].end},end:{...$[X-2][1].start}};return z=[["enter",G,Z],["enter",U,Z]],z=k4(z,$.slice(Q+1,Q+H+3)),z=k4(z,[["enter",Y,Z]]),z=k4(z,O7(Z.parser.constructs.insideSpan.null,$.slice(Q+H+4,X-3),Z)),z=k4(z,[["exit",Y,Z],$[X-2],$[X-1],["exit",U,Z]]),z=k4(z,$.slice(X+1)),z=k4(z,[["exit",G,Z]]),Q2($,Q,$.length,z),$}function JJ0($,Z,J){let H=this,B=H.events.length,Q,X;while(B--)if((H.events[B][1].type==="labelImage"||H.events[B][1].type==="labelLink")&&!H.events[B][1]._balanced){Q=H.events[B][1];break}return z;function z(F){if(!Q)return J(F);if(Q._inactive)return K(F);return X=H.parser.defined.includes(L4(H.sliceSerialize({start:Q.end,end:H.now()}))),$.enter("labelEnd"),$.enter("labelMarker"),$.consume(F),$.exit("labelMarker"),$.exit("labelEnd"),G}function G(F){if(F===40)return $.attempt(sZ0,Y,X?Y:K)(F);if(F===91)return $.attempt(tZ0,Y,X?U:K)(F);return X?Y(F):K(F)}function U(F){return $.attempt(eZ0,Y,K)(F)}function Y(F){return Z(F)}function K(F){return Q._balanced=!0,J(F)}}function HJ0($,Z,J){return H;function H(K){return $.enter("resource"),$.enter("resourceMarker"),$.consume(K),$.exit("resourceMarker"),B}function B(K){return h1(K)?n$($,Q)(K):Q(K)}function Q(K){if(K===41)return Y(K);return GW($,X,z,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(K)}function X(K){return h1(K)?n$($,G)(K):Y(K)}function z(K){return J(K)}function G(K){if(K===34||K===39||K===40)return YW($,U,J,"resourceTitle","resourceTitleMarker","resourceTitleString")(K);return Y(K)}function U(K){return h1(K)?n$($,Y)(K):Y(K)}function Y(K){if(K===41)return $.enter("resourceMarker"),$.consume(K),$.exit("resourceMarker"),$.exit("resource"),Z;return J(K)}}function BJ0($,Z,J){let H=this;return B;function B(z){return UW.call(H,$,Q,X,"reference","referenceMarker","referenceString")(z)}function Q(z){return H.parser.defined.includes(L4(H.sliceSerialize(H.events[H.events.length-1][1]).slice(1,-1)))?Z(z):J(z)}function X(z){return J(z)}}function QJ0($,Z,J){return H;function H(Q){return $.enter("reference"),$.enter("referenceMarker"),$.consume(Q),$.exit("referenceMarker"),B}function B(Q){if(Q===93)return $.enter("referenceMarker"),$.consume(Q),$.exit("referenceMarker"),$.exit("reference"),Z;return J(Q)}}var uM={name:"labelStartImage",resolveAll:s$.resolveAll,tokenize:XJ0};function XJ0($,Z,J){let H=this;return B;function B(z){return $.enter("labelImage"),$.enter("labelImageMarker"),$.consume(z),$.exit("labelImageMarker"),Q}function Q(z){if(z===91)return $.enter("labelMarker"),$.consume(z),$.exit("labelMarker"),$.exit("labelImage"),X;return J(z)}function X(z){return z===94&&"_hiddenFootnoteSupport"in H.parser.constructs?J(z):Z(z)}}var pM={name:"labelStartLink",resolveAll:s$.resolveAll,tokenize:zJ0};function zJ0($,Z,J){let H=this;return B;function B(X){return $.enter("labelLink"),$.enter("labelMarker"),$.consume(X),$.exit("labelMarker"),$.exit("labelLink"),Q}function Q(X){return X===94&&"_hiddenFootnoteSupport"in H.parser.constructs?J(X):Z(X)}}var YX={name:"lineEnding",tokenize:GJ0};function GJ0($,Z){return J;function J(H){return $.enter("lineEnding"),$.consume(H),$.exit("lineEnding"),J1($,Z,"linePrefix")}}var t$={name:"thematicBreak",tokenize:UJ0};function UJ0($,Z,J){let H=0,B;return Q;function Q(U){return $.enter("thematicBreak"),X(U)}function X(U){return B=U,z(U)}function z(U){if(U===B)return $.enter("thematicBreakSequence"),G(U);if(H>=3&&(U===null||u0(U)))return $.exit("thematicBreak"),Z(U);return J(U)}function G(U){if(U===B)return $.consume(U),H++,G;return $.exit("thematicBreakSequence"),X1(U)?J1($,z,"whitespace")(U):z(U)}}var M4={continuation:{tokenize:WJ0},exit:NJ0,name:"list",tokenize:FJ0},YJ0={partial:!0,tokenize:AJ0},KJ0={partial:!0,tokenize:qJ0};function FJ0($,Z,J){let H=this,B=H.events[H.events.length-1],Q=B&&B[1].type==="linePrefix"?B[2].sliceSerialize(B[1],!0).length:0,X=0;return z;function z(W){let q=H.containerState.type||(W===42||W===43||W===45?"listUnordered":"listOrdered");if(q==="listUnordered"?!H.containerState.marker||W===H.containerState.marker:XX(W)){if(!H.containerState.type)H.containerState.type=q,$.enter(q,{_container:!0});if(q==="listUnordered")return $.enter("listItemPrefix"),W===42||W===45?$.check(t$,J,U)(W):U(W);if(!H.interrupt||W===49)return $.enter("listItemPrefix"),$.enter("listItemValue"),G(W)}return J(W)}function G(W){if(XX(W)&&++X<10)return $.consume(W),G;if((!H.interrupt||X<2)&&(H.containerState.marker?W===H.containerState.marker:W===41||W===46))return $.exit("listItemValue"),U(W);return J(W)}function U(W){return $.enter("listItemMarker"),$.consume(W),$.exit("listItemMarker"),H.containerState.marker=H.containerState.marker||W,$.check(K3,H.interrupt?J:Y,$.attempt(YJ0,F,K))}function Y(W){return H.containerState.initialBlankLine=!0,Q++,F(W)}function K(W){if(X1(W))return $.enter("listItemPrefixWhitespace"),$.consume(W),$.exit("listItemPrefixWhitespace"),F;return J(W)}function F(W){return H.containerState.size=Q+H.sliceSerialize($.exit("listItemPrefix"),!0).length,Z(W)}}function WJ0($,Z,J){let H=this;return H.containerState._closeFlow=void 0,$.check(K3,B,Q);function B(z){return H.containerState.furtherBlankLines=H.containerState.furtherBlankLines||H.containerState.initialBlankLine,J1($,Z,"listItemIndent",H.containerState.size+1)(z)}function Q(z){if(H.containerState.furtherBlankLines||!X1(z))return H.containerState.furtherBlankLines=void 0,H.containerState.initialBlankLine=void 0,X(z);return H.containerState.furtherBlankLines=void 0,H.containerState.initialBlankLine=void 0,$.attempt(KJ0,Z,X)(z)}function X(z){return H.containerState._closeFlow=!0,H.interrupt=void 0,J1($,$.attempt(M4,Z,J),"linePrefix",H.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(z)}}function qJ0($,Z,J){let H=this;return J1($,B,"listItemIndent",H.containerState.size+1);function B(Q){let X=H.events[H.events.length-1];return X&&X[1].type==="listItemIndent"&&X[2].sliceSerialize(X[1],!0).length===H.containerState.size?Z(Q):J(Q)}}function NJ0($){$.exit(this.containerState.type)}function AJ0($,Z,J){let H=this;return J1($,B,"listItemPrefixWhitespace",H.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function B(Q){let X=H.events[H.events.length-1];return!X1(Q)&&X&&X[1].type==="listItemPrefixWhitespace"?Z(Q):J(Q)}}var KW={name:"setextUnderline",resolveTo:DJ0,tokenize:VJ0};function DJ0($,Z){let J=$.length,H,B,Q;while(J--)if($[J][0]==="enter"){if($[J][1].type==="content"){H=J;break}if($[J][1].type==="paragraph")B=J}else{if($[J][1].type==="content")$.splice(J,1);if(!Q&&$[J][1].type==="definition")Q=J}let X={type:"setextHeading",start:{...$[H][1].start},end:{...$[$.length-1][1].end}};if($[B][1].type="setextHeadingText",Q)$.splice(B,0,["enter",X,Z]),$.splice(Q+1,0,["exit",$[H][1],Z]),$[H][1].end={...$[Q][1].end};else $[H][1]=X;return $.push(["exit",X,Z]),$}function VJ0($,Z,J){let H=this,B;return Q;function Q(U){let Y=H.events.length,K;while(Y--)if(H.events[Y][1].type!=="lineEnding"&&H.events[Y][1].type!=="linePrefix"&&H.events[Y][1].type!=="content"){K=H.events[Y][1].type==="paragraph";break}if(!H.parser.lazy[H.now().line]&&(H.interrupt||K))return $.enter("setextHeadingLine"),B=U,X(U);return J(U)}function X(U){return $.enter("setextHeadingLineSequence"),z(U)}function z(U){if(U===B)return $.consume(U),z;return $.exit("setextHeadingLineSequence"),X1(U)?J1($,G,"lineSuffix")(U):G(U)}function G(U){if(U===null||u0(U))return $.exit("setextHeadingLine"),Z(U);return J(U)}}var Zu={tokenize:LJ0};function LJ0($){let Z=this,J=$.attempt(K3,H,$.attempt(this.parser.constructs.flowInitial,B,J1($,$.attempt(this.parser.constructs.flow,B,$.attempt(yM,B)),"linePrefix")));return J;function H(Q){if(Q===null){$.consume(Q);return}return $.enter("lineEndingBlank"),$.consume(Q),$.exit("lineEndingBlank"),Z.currentConstruct=void 0,J}function B(Q){if(Q===null){$.consume(Q);return}return $.enter("lineEnding"),$.consume(Q),$.exit("lineEnding"),Z.currentConstruct=void 0,J}}var Ju={resolveAll:Xu()},Hu=Qu("string"),Bu=Qu("text");function Qu($){return{resolveAll:Xu($==="text"?MJ0:void 0),tokenize:Z};function Z(J){let H=this,B=this.parser.constructs[$],Q=J.attempt(B,X,z);return X;function X(Y){return U(Y)?Q(Y):z(Y)}function z(Y){if(Y===null){J.consume(Y);return}return J.enter("data"),J.consume(Y),G}function G(Y){if(U(Y))return J.exit("data"),Q(Y);return J.consume(Y),G}function U(Y){if(Y===null)return!0;let K=B[Y],F=-1;if(K)while(++F<K.length){let W=K[F];if(!W.previous||W.previous.call(H,H.previous))return!0}return!1}}}function Xu($){return Z;function Z(J,H){let B=-1,Q;while(++B<=J.length)if(Q===void 0){if(J[B]&&J[B][1].type==="data")Q=B,B++}else if(!J[B]||J[B][1].type!=="data"){if(B!==Q+2)J[Q][1].end=J[B-1][1].end,J.splice(Q+2,B-Q-2),B=Q+2;Q=void 0}return $?$(J,H):J}}function MJ0($,Z){let J=0;while(++J<=$.length)if((J===$.length||$[J][1].type==="lineEnding")&&$[J-1][1].type==="data"){let H=$[J-1][1],B=Z.sliceStream(H),Q=B.length,X=-1,z=0,G;while(Q--){let U=B[Q];if(typeof U==="string"){X=U.length;while(U.charCodeAt(X-1)===32)z++,X--;if(X)break;X=-1}else if(U===-2)G=!0,z++;else if(U===-1);else{Q++;break}}if(Z._contentTypeTextTrailing&&J===$.length)z=0;if(z){let U={type:J===$.length||G||z<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:Q?X:H.start._bufferIndex+X,_index:H.start._index+Q,line:H.end.line,column:H.end.column-z,offset:H.end.offset-z},end:{...H.end}};if(H.end={...U.start},H.start.offset===H.end.offset)Object.assign(H,U);else $.splice(J,0,["enter",U,Z],["exit",U,Z]),J+=2}J++}return $}var cM={};I5(cM,{text:()=>CJ0,string:()=>TJ0,insideSpan:()=>EJ0,flowInitial:()=>OJ0,flow:()=>jJ0,document:()=>PJ0,disable:()=>wJ0,contentInitial:()=>_J0,attentionMarkers:()=>bJ0});var PJ0={[42]:M4,[43]:M4,[45]:M4,[48]:M4,[49]:M4,[50]:M4,[51]:M4,[52]:M4,[53]:M4,[54]:M4,[55]:M4,[56]:M4,[57]:M4,[62]:HW},_J0={[91]:xM},OJ0={[-2]:GX,[-1]:GX,[32]:GX},jJ0={[35]:vM,[42]:t$,[45]:[KW,t$],[60]:gM,[61]:KW,[95]:t$,[96]:XW,[126]:XW},TJ0={[38]:QW,[92]:BW},CJ0={[-5]:YX,[-4]:YX,[-3]:YX,[33]:uM,[38]:QW,[42]:zX,[60]:[RM,mM],[91]:pM,[92]:[hM,BW],[93]:s$,[95]:zX,[96]:IM},EJ0={null:[zX,Ju]},bJ0={null:[42,95]},wJ0={null:[]};function zu($,Z,J){let H={_bufferIndex:-1,_index:0,line:J&&J.line||1,column:J&&J.column||1,offset:J&&J.offset||0},B={},Q=[],X=[],z=[],G=!0,U={attempt:E(w),check:E(C),consume:O,enter:M,exit:_,interrupt:E(C,{interrupt:!0})},Y={code:null,containerState:{},defineSkip:A,events:[],now:D,parser:$,previous:null,sliceSerialize:q,sliceStream:N,write:W},K=Z.tokenize.call(Y,U),F;if(Z.resolveAll)Q.push(Z);return Y;function W(I){if(X=k4(X,I),V(),X[X.length-1]!==null)return[];return j(Z,0),Y.events=O7(Q,Y.events,Y),Y.events}function q(I,T){return RJ0(N(I),T)}function N(I){return SJ0(X,I)}function D(){let{_bufferIndex:I,_index:T,line:y,column:R,offset:x}=H;return{_bufferIndex:I,_index:T,line:y,column:R,offset:x}}function A(I){B[I.line]=I.column,S()}function V(){let I;while(H._index<X.length){let T=X[H._index];if(typeof T==="string"){if(I=H._index,H._bufferIndex<0)H._bufferIndex=0;while(H._index===I&&H._bufferIndex<T.length)L(T.charCodeAt(H._bufferIndex))}else L(T)}}function L(I){G=void 0,F=I,K=K(I)}function O(I){if(u0(I))H.line++,H.column=1,H.offset+=I===-3?2:1,S();else if(I!==-1)H.column++,H.offset++;if(H._bufferIndex<0)H._index++;else if(H._bufferIndex++,H._bufferIndex===X[H._index].length)H._bufferIndex=-1,H._index++;Y.previous=I,G=!0}function M(I,T){let y=T||{};return y.type=I,y.start=D(),Y.events.push(["enter",y,Y]),z.push(y),y}function _(I){let T=z.pop();return T.end=D(),Y.events.push(["exit",T,Y]),T}function w(I,T){j(I,T.from)}function C(I,T){T.restore()}function E(I,T){return y;function y(R,x,v){let f,b,l,r;return Array.isArray(R)?d(R):("tokenize"in R)?d([R]):h(R);function h(n){return Z0;function Z0(J0){let U0=J0!==null&&n[J0],z0=J0!==null&&n.null,X0=[...Array.isArray(U0)?U0:U0?[U0]:[],...Array.isArray(z0)?z0:z0?[z0]:[]];return d(X0)(J0)}}function d(n){if(f=n,b=0,n.length===0)return v;return o(n[b])}function o(n){return Z0;function Z0(J0){if(r=k(),l=n,!n.partial)Y.currentConstruct=n;if(n.name&&Y.parser.constructs.disable.null.includes(n.name))return i(J0);return n.tokenize.call(T?Object.assign(Object.create(Y),T):Y,U,p,i)(J0)}}function p(n){return G=!0,I(l,r),x}function i(n){if(G=!0,r.restore(),++b<f.length)return o(f[b]);return v}}}function j(I,T){if(I.resolveAll&&!Q.includes(I))Q.push(I);if(I.resolve)Q2(Y.events,T,Y.events.length-T,I.resolve(Y.events.slice(T),Y));if(I.resolveTo)Y.events=I.resolveTo(Y.events,Y)}function k(){let I=D(),T=Y.previous,y=Y.currentConstruct,R=Y.events.length,x=Array.from(z);return{from:R,restore:v};function v(){H=I,Y.previous=T,Y.currentConstruct=y,Y.events.length=R,z=x,S()}}function S(){if(H.line in B&&H.column<2)H.column=B[H.line],H.offset+=B[H.line]-1}}function SJ0($,Z){let J=Z.start._index,H=Z.start._bufferIndex,B=Z.end._index,Q=Z.end._bufferIndex,X;if(J===B)X=[$[J].slice(H,Q)];else{if(X=$.slice(J,B),H>-1){let z=X[0];if(typeof z==="string")X[0]=z.slice(H);else X.shift()}if(Q>0)X.push($[B].slice(0,Q))}return X}function RJ0($,Z){let J=-1,H=[],B;while(++J<$.length){let Q=$[J],X;if(typeof Q==="string")X=Q;else switch(Q){case-5:{X="\r";break}case-4:{X=`
19
+ `;break}case-3:{X=`\r
20
+ `;break}case-2:{X=Z?" ":"\t";break}case-1:{if(!Z&&B)continue;X=" ";break}default:X=String.fromCharCode(Q)}B=Q===-2,H.push(X)}return H.join("")}function dM($){let H={constructs:ZW([cM,...($||{}).extensions||[]]),content:B(om),defined:[],document:B(sm),flow:B(Zu),lazy:{},string:B(Hu),text:B(Bu)};return H;function B(Q){return X;function X(z){return zu(H,Q,z)}}}function lM($){while(!zW($));return $}var Gu=/[\0\t\n\r]/g;function iM(){let $=1,Z="",J=!0,H;return B;function B(Q,X,z){let G=[],U,Y,K,F,W;if(Q=Z+(typeof Q==="string"?Q.toString():new TextDecoder(X||void 0).decode(Q)),K=0,Z="",J){if(Q.charCodeAt(0)===65279)K++;J=void 0}while(K<Q.length){if(Gu.lastIndex=K,U=Gu.exec(Q),F=U&&U.index!==void 0?U.index:Q.length,W=Q.charCodeAt(F),!U){Z=Q.slice(K);break}if(W===10&&K===F&&H)G.push(-3),H=void 0;else{if(H)G.push(-5),H=void 0;if(K<F)G.push(Q.slice(K,F)),$+=F-K;switch(W){case 0:{G.push(65533),$++;break}case 9:{Y=Math.ceil($/4)*4,G.push(-2);while($++<Y)G.push(-1);break}case 10:{G.push(-4),$=1;break}default:H=!0,$=1}}K=F+1}if(z){if(H)G.push(-5);if(Z)G.push(Z);G.push(null)}return G}}var IJ0=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function Uu($){return $.replace(IJ0,kJ0)}function kJ0($,Z,J){if(Z)return Z;if(J.charCodeAt(0)===35){let B=J.charCodeAt(1),Q=B===120||B===88;return JW(J.slice(Q?2:1),Q?16:10)}return FH(J)||$}var Ku={}.hasOwnProperty;function rM($,Z,J){if(Z&&typeof Z==="object")J=Z,Z=void 0;return yJ0(J)(lM(dM(J).document().write(iM()($,Z,!0))))}function yJ0($){let Z={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:Q($0),autolinkProtocol:E,autolinkEmail:E,atxHeading:Q(N0),blockQuote:Q(J0),characterEscape:E,characterReference:E,codeFenced:Q(U0),codeFencedFenceInfo:X,codeFencedFenceMeta:X,codeIndented:Q(U0,X),codeText:Q(z0,X),codeTextData:E,data:E,codeFlowValue:E,definition:Q(X0),definitionDestinationString:X,definitionLabelString:X,definitionTitleString:X,emphasis:Q(q0),hardBreakEscape:Q(F0),hardBreakTrailing:Q(F0),htmlFlow:Q(s,X),htmlFlowData:E,htmlText:Q(s,X),htmlTextData:E,image:Q(a),label:X,link:Q($0),listItem:Q(B0),listItemValue:F,listOrdered:Q(t,K),listUnordered:Q(t),paragraph:Q(_0),reference:h,referenceString:X,resourceDestinationString:X,resourceTitleString:X,setextHeading:Q(N0),strong:Q(P0),thematicBreak:Q(L0)},exit:{atxHeading:G(),atxHeadingSequence:M,autolink:G(),autolinkEmail:Z0,autolinkProtocol:n,blockQuote:G(),characterEscapeValue:j,characterReferenceMarkerHexadecimal:o,characterReferenceMarkerNumeric:o,characterReferenceValue:p,characterReference:i,codeFenced:G(D),codeFencedFence:N,codeFencedFenceInfo:W,codeFencedFenceMeta:q,codeFlowValue:j,codeIndented:G(A),codeText:G(y),codeTextData:j,data:j,definition:G(),definitionDestinationString:O,definitionLabelString:V,definitionTitleString:L,emphasis:G(),hardBreakEscape:G(S),hardBreakTrailing:G(S),htmlFlow:G(I),htmlFlowData:j,htmlText:G(T),htmlTextData:j,image:G(x),label:f,labelText:v,lineEnding:k,link:G(R),listItem:G(),listOrdered:G(),listUnordered:G(),paragraph:G(),referenceString:d,resourceDestinationString:b,resourceTitleString:l,resource:r,setextHeading:G(C),setextHeadingLineSequence:w,setextHeadingText:_,strong:G(),thematicBreak:G()}};Fu(Z,($||{}).mdastExtensions||[]);let J={};return H;function H(g){let u={type:"root",children:[]},e={stack:[u],tokenStack:[],config:Z,enter:z,exit:U,buffer:X,resume:Y,data:J},W0=[],S0=-1;while(++S0<g.length)if(g[S0][1].type==="listOrdered"||g[S0][1].type==="listUnordered")if(g[S0][0]==="enter")W0.push(S0);else{let h0=W0.pop();S0=B(g,h0,S0)}S0=-1;while(++S0<g.length){let h0=Z[g[S0][0]];if(Ku.call(h0,g[S0][1].type))h0[g[S0][1].type].call(Object.assign({sliceSerialize:g[S0][2].sliceSerialize},e),g[S0][1])}if(e.tokenStack.length>0){let h0=e.tokenStack[e.tokenStack.length-1];(h0[1]||Yu).call(e,void 0,h0[0])}u.position={start:j7(g.length>0?g[0][1].start:{line:1,column:1,offset:0}),end:j7(g.length>0?g[g.length-2][1].end:{line:1,column:1,offset:0})},S0=-1;while(++S0<Z.transforms.length)u=Z.transforms[S0](u)||u;return u}function B(g,u,e){let W0=u-1,S0=-1,h0=!1,v0,T0,c0,G1;while(++W0<=e){let A1=g[W0];switch(A1[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{if(A1[0]==="enter")S0++;else S0--;G1=void 0;break}case"lineEndingBlank":{if(A1[0]==="enter"){if(v0&&!G1&&!S0&&!c0)c0=W0;G1=void 0}break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:G1=void 0}if(!S0&&A1[0]==="enter"&&A1[1].type==="listItemPrefix"||S0===-1&&A1[0]==="exit"&&(A1[1].type==="listUnordered"||A1[1].type==="listOrdered")){if(v0){let d0=W0;T0=void 0;while(d0--){let k0=g[d0];if(k0[1].type==="lineEnding"||k0[1].type==="lineEndingBlank"){if(k0[0]==="exit")continue;if(T0)g[T0][1].type="lineEndingBlank",h0=!0;k0[1].type="lineEnding",T0=d0}else if(k0[1].type==="linePrefix"||k0[1].type==="blockQuotePrefix"||k0[1].type==="blockQuotePrefixWhitespace"||k0[1].type==="blockQuoteMarker"||k0[1].type==="listItemIndent");else break}if(c0&&(!T0||c0<T0))v0._spread=!0;v0.end=Object.assign({},T0?g[T0][1].start:A1[1].end),g.splice(T0||W0,0,["exit",v0,A1[2]]),W0++,e++}if(A1[1].type==="listItemPrefix"){let d0={type:"listItem",_spread:!1,start:Object.assign({},A1[1].start),end:void 0};v0=d0,g.splice(W0,0,["enter",d0,A1[2]]),W0++,e++,c0=void 0,G1=!0}}}return g[u][1]._spread=h0,e}function Q(g,u){return e;function e(W0){if(z.call(this,g(W0),W0),u)u.call(this,W0)}}function X(){this.stack.push({type:"fragment",children:[]})}function z(g,u,e){this.stack[this.stack.length-1].children.push(g),this.stack.push(g),this.tokenStack.push([u,e||void 0]),g.position={start:j7(u.start),end:void 0}}function G(g){return u;function u(e){if(g)g.call(this,e);U.call(this,e)}}function U(g,u){let e=this.stack.pop(),W0=this.tokenStack.pop();if(!W0)throw Error("Cannot close `"+g.type+"` ("+P7({start:g.start,end:g.end})+"): it’s not open");else if(W0[0].type!==g.type)if(u)u.call(this,g,W0[0]);else(W0[1]||Yu).call(this,g,W0[0]);e.position.end=j7(g.end)}function Y(){return r$(this.stack.pop())}function K(){this.data.expectingFirstListItemValue=!0}function F(g){if(this.data.expectingFirstListItemValue){let u=this.stack[this.stack.length-2];u.start=Number.parseInt(this.sliceSerialize(g),10),this.data.expectingFirstListItemValue=void 0}}function W(){let g=this.resume(),u=this.stack[this.stack.length-1];u.lang=g}function q(){let g=this.resume(),u=this.stack[this.stack.length-1];u.meta=g}function N(){if(this.data.flowCodeInside)return;this.buffer(),this.data.flowCodeInside=!0}function D(){let g=this.resume(),u=this.stack[this.stack.length-1];u.value=g.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function A(){let g=this.resume(),u=this.stack[this.stack.length-1];u.value=g.replace(/(\r?\n|\r)$/g,"")}function V(g){let u=this.resume(),e=this.stack[this.stack.length-1];e.label=u,e.identifier=L4(this.sliceSerialize(g)).toLowerCase()}function L(){let g=this.resume(),u=this.stack[this.stack.length-1];u.title=g}function O(){let g=this.resume(),u=this.stack[this.stack.length-1];u.url=g}function M(g){let u=this.stack[this.stack.length-1];if(!u.depth){let e=this.sliceSerialize(g).length;u.depth=e}}function _(){this.data.setextHeadingSlurpLineEnding=!0}function w(g){let u=this.stack[this.stack.length-1];u.depth=this.sliceSerialize(g).codePointAt(0)===61?1:2}function C(){this.data.setextHeadingSlurpLineEnding=void 0}function E(g){let e=this.stack[this.stack.length-1].children,W0=e[e.length-1];if(!W0||W0.type!=="text")W0=A0(),W0.position={start:j7(g.start),end:void 0},e.push(W0);this.stack.push(W0)}function j(g){let u=this.stack.pop();u.value+=this.sliceSerialize(g),u.position.end=j7(g.end)}function k(g){let u=this.stack[this.stack.length-1];if(this.data.atHardBreak){let e=u.children[u.children.length-1];e.position.end=j7(g.end),this.data.atHardBreak=void 0;return}if(!this.data.setextHeadingSlurpLineEnding&&Z.canContainEols.includes(u.type))E.call(this,g),j.call(this,g)}function S(){this.data.atHardBreak=!0}function I(){let g=this.resume(),u=this.stack[this.stack.length-1];u.value=g}function T(){let g=this.resume(),u=this.stack[this.stack.length-1];u.value=g}function y(){let g=this.resume(),u=this.stack[this.stack.length-1];u.value=g}function R(){let g=this.stack[this.stack.length-1];if(this.data.inReference){let u=this.data.referenceType||"shortcut";g.type+="Reference",g.referenceType=u,delete g.url,delete g.title}else delete g.identifier,delete g.label;this.data.referenceType=void 0}function x(){let g=this.stack[this.stack.length-1];if(this.data.inReference){let u=this.data.referenceType||"shortcut";g.type+="Reference",g.referenceType=u,delete g.url,delete g.title}else delete g.identifier,delete g.label;this.data.referenceType=void 0}function v(g){let u=this.sliceSerialize(g),e=this.stack[this.stack.length-2];e.label=Uu(u),e.identifier=L4(u).toLowerCase()}function f(){let g=this.stack[this.stack.length-1],u=this.resume(),e=this.stack[this.stack.length-1];if(this.data.inReference=!0,e.type==="link"){let W0=g.children;e.children=W0}else e.alt=u}function b(){let g=this.resume(),u=this.stack[this.stack.length-1];u.url=g}function l(){let g=this.resume(),u=this.stack[this.stack.length-1];u.title=g}function r(){this.data.inReference=void 0}function h(){this.data.referenceType="collapsed"}function d(g){let u=this.resume(),e=this.stack[this.stack.length-1];e.label=u,e.identifier=L4(this.sliceSerialize(g)).toLowerCase(),this.data.referenceType="full"}function o(g){this.data.characterReferenceType=g.type}function p(g){let u=this.sliceSerialize(g),e=this.data.characterReferenceType,W0;if(e)W0=JW(u,e==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0;else W0=FH(u);let S0=this.stack[this.stack.length-1];S0.value+=W0}function i(g){let u=this.stack.pop();u.position.end=j7(g.end)}function n(g){j.call(this,g);let u=this.stack[this.stack.length-1];u.url=this.sliceSerialize(g)}function Z0(g){j.call(this,g);let u=this.stack[this.stack.length-1];u.url="mailto:"+this.sliceSerialize(g)}function J0(){return{type:"blockquote",children:[]}}function U0(){return{type:"code",lang:null,meta:null,value:""}}function z0(){return{type:"inlineCode",value:""}}function X0(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function q0(){return{type:"emphasis",children:[]}}function N0(){return{type:"heading",depth:0,children:[]}}function F0(){return{type:"break"}}function s(){return{type:"html",value:""}}function a(){return{type:"image",title:null,url:"",alt:null}}function $0(){return{type:"link",title:null,url:"",children:[]}}function t(g){return{type:"list",ordered:g.type==="listOrdered",start:null,spread:g._spread,children:[]}}function B0(g){return{type:"listItem",spread:g._spread,checked:null,children:[]}}function _0(){return{type:"paragraph",children:[]}}function P0(){return{type:"strong",children:[]}}function A0(){return{type:"text",value:""}}function L0(){return{type:"thematicBreak"}}}function j7($){return{line:$.line,column:$.column,offset:$.offset}}function Fu($,Z){let J=-1;while(++J<Z.length){let H=Z[J];if(Array.isArray(H))Fu($,H);else xJ0($,H)}}function xJ0($,Z){let J;for(J in Z)if(Ku.call(Z,J))switch(J){case"canContainEols":{let H=Z[J];if(H)$[J].push(...H);break}case"transforms":{let H=Z[J];if(H)$[J].push(...H);break}case"enter":case"exit":{let H=Z[J];if(H)Object.assign($[J],H);break}}}function Yu($,Z){if($)throw Error("Cannot close `"+$.type+"` ("+P7({start:$.start,end:$.end})+"): a different token (`"+Z.type+"`, "+P7({start:Z.start,end:Z.end})+") is open");else throw Error("Cannot close document, a token (`"+Z.type+"`, "+P7({start:Z.start,end:Z.end})+") is still open")}function FW($){let Z=this;Z.parser=J;function J(H){return rM(H,{...Z.data("settings"),...$,extensions:Z.data("micromarkExtensions")||[],mdastExtensions:Z.data("fromMarkdownExtensions")||[]})}}var WW=-1,WH=0,e$=1,qH=2,KX=3,FX=4,WX=5,qX=6,qW=7,NW=8;var Wu=typeof self==="object"?self:globalThis,hJ0=($,Z)=>{let J=(B,Q)=>{return $.set(Q,B),B},H=(B)=>{if($.has(B))return $.get(B);let[Q,X]=Z[B];switch(Q){case WH:case WW:return J(X,B);case e$:{let z=J([],B);for(let G of X)z.push(H(G));return z}case qH:{let z=J({},B);for(let[G,U]of X)z[H(G)]=H(U);return z}case KX:return J(new Date(X),B);case FX:{let{source:z,flags:G}=X;return J(new RegExp(z,G),B)}case WX:{let z=J(new Map,B);for(let[G,U]of X)z.set(H(G),H(U));return z}case qX:{let z=J(new Set,B);for(let G of X)z.add(H(G));return z}case qW:{let{name:z,message:G}=X;return J(new Wu[z](G),B)}case NW:return J(BigInt(X),B);case"BigInt":return J(Object(BigInt(X)),B);case"ArrayBuffer":return J(new Uint8Array(X).buffer,X);case"DataView":{let{buffer:z}=new Uint8Array(X);return J(new DataView(z),X)}}return J(new Wu[Q](X),B)};return H},aM=($)=>hJ0(new Map,$)(0);var NH="",{toString:vJ0}={},{keys:fJ0}=Object,NX=($)=>{let Z=typeof $;if(Z!=="object"||!$)return[WH,Z];let J=vJ0.call($).slice(8,-1);switch(J){case"Array":return[e$,NH];case"Object":return[qH,NH];case"Date":return[KX,NH];case"RegExp":return[FX,NH];case"Map":return[WX,NH];case"Set":return[qX,NH];case"DataView":return[e$,J]}if(J.includes("Array"))return[e$,J];if(J.includes("Error"))return[qW,J];return[qH,J]},AW=([$,Z])=>$===WH&&(Z==="function"||Z==="symbol"),gJ0=($,Z,J,H)=>{let B=(X,z)=>{let G=H.push(X)-1;return J.set(z,G),G},Q=(X)=>{if(J.has(X))return J.get(X);let[z,G]=NX(X);switch(z){case WH:{let Y=X;switch(G){case"bigint":z=NW,Y=X.toString();break;case"function":case"symbol":if($)throw TypeError("unable to serialize "+G);Y=null;break;case"undefined":return B([WW],X)}return B([z,Y],X)}case e$:{if(G){let F=X;if(G==="DataView")F=new Uint8Array(X.buffer);else if(G==="ArrayBuffer")F=new Uint8Array(X);return B([G,[...F]],X)}let Y=[],K=B([z,Y],X);for(let F of X)Y.push(Q(F));return K}case qH:{if(G)switch(G){case"BigInt":return B([G,X.toString()],X);case"Boolean":case"Number":case"String":return B([G,X.valueOf()],X)}if(Z&&"toJSON"in X)return Q(X.toJSON());let Y=[],K=B([z,Y],X);for(let F of fJ0(X))if($||!AW(NX(X[F])))Y.push([Q(F),Q(X[F])]);return K}case KX:return B([z,X.toISOString()],X);case FX:{let{source:Y,flags:K}=X;return B([z,{source:Y,flags:K}],X)}case WX:{let Y=[],K=B([z,Y],X);for(let[F,W]of X)if($||!(AW(NX(F))||AW(NX(W))))Y.push([Q(F),Q(W)]);return K}case qX:{let Y=[],K=B([z,Y],X);for(let F of X)if($||!AW(NX(F)))Y.push(Q(F));return K}}let{message:U}=X;return B([z,{name:G,message:U}],X)};return Q},oM=($,{json:Z,lossy:J}={})=>{let H=[];return gJ0(!(Z||J),!!Z,new Map,H)($),H};var AH=typeof structuredClone==="function"?($,Z)=>Z&&(("json"in Z)||("lossy"in Z))?aM(oM($,Z)):structuredClone($):($,Z)=>aM(oM($,Z));function mJ0($,Z){let J=[{type:"text",value:"↩"}];if(Z>1)J.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(Z)}]});return J}function uJ0($,Z){return"Back to reference "+($+1)+(Z>1?"-"+Z:"")}function qu($){let Z=typeof $.options.clobberPrefix==="string"?$.options.clobberPrefix:"user-content-",J=$.options.footnoteBackContent||mJ0,H=$.options.footnoteBackLabel||uJ0,B=$.options.footnoteLabel||"Footnotes",Q=$.options.footnoteLabelTagName||"h2",X=$.options.footnoteLabelProperties||{className:["sr-only"]},z=[],G=-1;while(++G<$.footnoteOrder.length){let U=$.footnoteById.get($.footnoteOrder[G]);if(!U)continue;let Y=$.all(U),K=String(U.identifier).toUpperCase(),F=l8(K.toLowerCase()),W=0,q=[],N=$.footnoteCounts.get(K);while(N!==void 0&&++W<=N){if(q.length>0)q.push({type:"text",value:" "});let V=typeof J==="string"?J:J(G,W);if(typeof V==="string")V={type:"text",value:V};q.push({type:"element",tagName:"a",properties:{href:"#"+Z+"fnref-"+F+(W>1?"-"+W:""),dataFootnoteBackref:"",ariaLabel:typeof H==="string"?H:H(G,W),className:["data-footnote-backref"]},children:Array.isArray(V)?V:[V]})}let D=Y[Y.length-1];if(D&&D.type==="element"&&D.tagName==="p"){let V=D.children[D.children.length-1];if(V&&V.type==="text")V.value+=" ";else D.children.push({type:"text",value:" "});D.children.push(...q)}else Y.push(...q);let A={type:"element",tagName:"li",properties:{id:Z+"fn-"+F},children:$.wrap(Y,!0)};$.patch(U,A),z.push(A)}if(z.length===0)return;return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:Q,properties:{...AH(X),id:"footnote-label"},children:[{type:"text",value:B}]},{type:"text",value:`
21
+ `},{type:"element",tagName:"ol",properties:{},children:$.wrap(z,!0)},{type:"text",value:`
22
+ `}]}}var F3=function($){if($===null||$===void 0)return lJ0;if(typeof $==="function")return DW($);if(typeof $==="object")return Array.isArray($)?pJ0($):cJ0($);if(typeof $==="string")return dJ0($);throw Error("Expected function, string, or object as test")};function pJ0($){let Z=[],J=-1;while(++J<$.length)Z[J]=F3($[J]);return DW(H);function H(...B){let Q=-1;while(++Q<Z.length)if(Z[Q].apply(this,B))return!0;return!1}}function cJ0($){let Z=$;return DW(J);function J(H){let B=H,Q;for(Q in $)if(B[Q]!==Z[Q])return!1;return!0}}function dJ0($){return DW(Z);function Z(J){return J&&J.type===$}}function DW($){return Z;function Z(J,H,B){return Boolean(iJ0(J)&&$.call(this,J,typeof H==="number"?H:void 0,B||void 0))}}function lJ0(){return!0}function iJ0($){return $!==null&&typeof $==="object"&&"type"in $}function Nu($){return $}var Au=[],VW=!0,$Z=!1,LW="skip";function AX($,Z,J,H){let B;if(typeof Z==="function"&&typeof J!=="function")H=J,J=Z;else B=Z;let Q=F3(B),X=H?-1:1;z($,void 0,[])();function z(G,U,Y){let K=G&&typeof G==="object"?G:{};if(typeof K.type==="string"){let W=typeof K.tagName==="string"?K.tagName:typeof K.name==="string"?K.name:void 0;Object.defineProperty(F,"name",{value:"node ("+Nu(G.type+(W?"<"+W+">":""))+")"})}return F;function F(){let W=Au,q,N,D;if(!Z||Q(G,U,Y[Y.length-1]||void 0)){if(W=rJ0(J(G,Y)),W[0]===$Z)return W}if("children"in G&&G.children){let A=G;if(A.children&&W[0]!==LW){N=(H?A.children.length:-1)+X,D=Y.concat(A);while(N>-1&&N<A.children.length){let V=A.children[N];if(q=z(V,N,D)(),q[0]===$Z)return q;N=typeof q[1]==="number"?q[1]:N+X}}}return W}}}function rJ0($){if(Array.isArray($))return $;if(typeof $==="number")return[VW,$];return $===null||$===void 0?Au:[$]}function l3($,Z,J,H){let B,Q,X;if(typeof Z==="function"&&typeof J!=="function")Q=void 0,X=Z,B=J;else Q=Z,X=J,B=H;AX($,Q,z,B);function z(G,U){let Y=U[U.length-1],K=Y?Y.children.indexOf(G):void 0;return X(G,K,Y)}}function Du($,Z){let J={type:"element",tagName:"blockquote",properties:{},children:$.wrap($.all(Z),!0)};return $.patch(Z,J),$.applyData(Z,J)}function Vu($,Z){let J={type:"element",tagName:"br",properties:{},children:[]};return $.patch(Z,J),[$.applyData(Z,J),{type:"text",value:`
23
+ `}]}function Lu($,Z){let J=Z.value?Z.value+`
24
+ `:"",H={},B=Z.lang?Z.lang.split(/\s+/):[];if(B.length>0)H.className=["language-"+B[0]];let Q={type:"element",tagName:"code",properties:H,children:[{type:"text",value:J}]};if(Z.meta)Q.data={meta:Z.meta};return $.patch(Z,Q),Q=$.applyData(Z,Q),Q={type:"element",tagName:"pre",properties:{},children:[Q]},$.patch(Z,Q),Q}function Mu($,Z){let J={type:"element",tagName:"del",properties:{},children:$.all(Z)};return $.patch(Z,J),$.applyData(Z,J)}function Pu($,Z){let J={type:"element",tagName:"em",properties:{},children:$.all(Z)};return $.patch(Z,J),$.applyData(Z,J)}function _u($,Z){let J=typeof $.options.clobberPrefix==="string"?$.options.clobberPrefix:"user-content-",H=String(Z.identifier).toUpperCase(),B=l8(H.toLowerCase()),Q=$.footnoteOrder.indexOf(H),X,z=$.footnoteCounts.get(H);if(z===void 0)z=0,$.footnoteOrder.push(H),X=$.footnoteOrder.length;else X=Q+1;z+=1,$.footnoteCounts.set(H,z);let G={type:"element",tagName:"a",properties:{href:"#"+J+"fn-"+B,id:J+"fnref-"+B+(z>1?"-"+z:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(X)}]};$.patch(Z,G);let U={type:"element",tagName:"sup",properties:{},children:[G]};return $.patch(Z,U),$.applyData(Z,U)}function Ou($,Z){let J={type:"element",tagName:"h"+Z.depth,properties:{},children:$.all(Z)};return $.patch(Z,J),$.applyData(Z,J)}function ju($,Z){if($.options.allowDangerousHtml){let J={type:"raw",value:Z.value};return $.patch(Z,J),$.applyData(Z,J)}return}function MW($,Z){let J=Z.referenceType,H="]";if(J==="collapsed")H+="[]";else if(J==="full")H+="["+(Z.label||Z.identifier)+"]";if(Z.type==="imageReference")return[{type:"text",value:"!["+Z.alt+H}];let B=$.all(Z),Q=B[0];if(Q&&Q.type==="text")Q.value="["+Q.value;else B.unshift({type:"text",value:"["});let X=B[B.length-1];if(X&&X.type==="text")X.value+=H;else B.push({type:"text",value:H});return B}function Tu($,Z){let J=String(Z.identifier).toUpperCase(),H=$.definitionById.get(J);if(!H)return MW($,Z);let B={src:l8(H.url||""),alt:Z.alt};if(H.title!==null&&H.title!==void 0)B.title=H.title;let Q={type:"element",tagName:"img",properties:B,children:[]};return $.patch(Z,Q),$.applyData(Z,Q)}function Cu($,Z){let J={src:l8(Z.url)};if(Z.alt!==null&&Z.alt!==void 0)J.alt=Z.alt;if(Z.title!==null&&Z.title!==void 0)J.title=Z.title;let H={type:"element",tagName:"img",properties:J,children:[]};return $.patch(Z,H),$.applyData(Z,H)}function Eu($,Z){let J={type:"text",value:Z.value.replace(/\r?\n|\r/g," ")};$.patch(Z,J);let H={type:"element",tagName:"code",properties:{},children:[J]};return $.patch(Z,H),$.applyData(Z,H)}function bu($,Z){let J=String(Z.identifier).toUpperCase(),H=$.definitionById.get(J);if(!H)return MW($,Z);let B={href:l8(H.url||"")};if(H.title!==null&&H.title!==void 0)B.title=H.title;let Q={type:"element",tagName:"a",properties:B,children:$.all(Z)};return $.patch(Z,Q),$.applyData(Z,Q)}function wu($,Z){let J={href:l8(Z.url)};if(Z.title!==null&&Z.title!==void 0)J.title=Z.title;let H={type:"element",tagName:"a",properties:J,children:$.all(Z)};return $.patch(Z,H),$.applyData(Z,H)}function Su($,Z,J){let H=$.all(Z),B=J?aJ0(J):Ru(Z),Q={},X=[];if(typeof Z.checked==="boolean"){let Y=H[0],K;if(Y&&Y.type==="element"&&Y.tagName==="p")K=Y;else K={type:"element",tagName:"p",properties:{},children:[]},H.unshift(K);if(K.children.length>0)K.children.unshift({type:"text",value:" "});K.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:Z.checked,disabled:!0},children:[]}),Q.className=["task-list-item"]}let z=-1;while(++z<H.length){let Y=H[z];if(B||z!==0||Y.type!=="element"||Y.tagName!=="p")X.push({type:"text",value:`
25
+ `});if(Y.type==="element"&&Y.tagName==="p"&&!B)X.push(...Y.children);else X.push(Y)}let G=H[H.length-1];if(G&&(B||G.type!=="element"||G.tagName!=="p"))X.push({type:"text",value:`
26
+ `});let U={type:"element",tagName:"li",properties:Q,children:X};return $.patch(Z,U),$.applyData(Z,U)}function aJ0($){let Z=!1;if($.type==="list"){Z=$.spread||!1;let J=$.children,H=-1;while(!Z&&++H<J.length)Z=Ru(J[H])}return Z}function Ru($){let Z=$.spread;return Z===null||Z===void 0?$.children.length>1:Z}function Iu($,Z){let J={},H=$.all(Z),B=-1;if(typeof Z.start==="number"&&Z.start!==1)J.start=Z.start;while(++B<H.length){let X=H[B];if(X.type==="element"&&X.tagName==="li"&&X.properties&&Array.isArray(X.properties.className)&&X.properties.className.includes("task-list-item")){J.className=["contains-task-list"];break}}let Q={type:"element",tagName:Z.ordered?"ol":"ul",properties:J,children:$.wrap(H,!0)};return $.patch(Z,Q),$.applyData(Z,Q)}function ku($,Z){let J={type:"element",tagName:"p",properties:{},children:$.all(Z)};return $.patch(Z,J),$.applyData(Z,J)}function yu($,Z){let J={type:"root",children:$.wrap($.all(Z))};return $.patch(Z,J),$.applyData(Z,J)}function xu($,Z){let J={type:"element",tagName:"strong",properties:{},children:$.all(Z)};return $.patch(Z,J),$.applyData(Z,J)}function hu($,Z){let J=$.all(Z),H=J.shift(),B=[];if(H){let X={type:"element",tagName:"thead",properties:{},children:$.wrap([H],!0)};$.patch(Z.children[0],X),B.push(X)}if(J.length>0){let X={type:"element",tagName:"tbody",properties:{},children:$.wrap(J,!0)},z=KH(Z.children[1]),G=$W(Z.children[Z.children.length-1]);if(z&&G)X.position={start:z,end:G};B.push(X)}let Q={type:"element",tagName:"table",properties:{},children:$.wrap(B,!0)};return $.patch(Z,Q),$.applyData(Z,Q)}function vu($,Z,J){let H=J?J.children:void 0,Q=(H?H.indexOf(Z):1)===0?"th":"td",X=J&&J.type==="table"?J.align:void 0,z=X?X.length:Z.children.length,G=-1,U=[];while(++G<z){let K=Z.children[G],F={},W=X?X[G]:void 0;if(W)F.align=W;let q={type:"element",tagName:Q,properties:F,children:[]};if(K)q.children=$.all(K),$.patch(K,q),q=$.applyData(K,q);U.push(q)}let Y={type:"element",tagName:"tr",properties:{},children:$.wrap(U,!0)};return $.patch(Z,Y),$.applyData(Z,Y)}function fu($,Z){let J={type:"element",tagName:"td",properties:{},children:$.all(Z)};return $.patch(Z,J),$.applyData(Z,J)}function mu($){let Z=String($),J=/\r?\n|\r/g,H=J.exec(Z),B=0,Q=[];while(H)Q.push(gu(Z.slice(B,H.index),B>0,!0),H[0]),B=H.index+H[0].length,H=J.exec(Z);return Q.push(gu(Z.slice(B),B>0,!1)),Q.join("")}function gu($,Z,J){let H=0,B=$.length;if(Z){let Q=$.codePointAt(H);while(Q===9||Q===32)H++,Q=$.codePointAt(H)}if(J){let Q=$.codePointAt(B-1);while(Q===9||Q===32)B--,Q=$.codePointAt(B-1)}return B>H?$.slice(H,B):""}function uu($,Z){let J={type:"text",value:mu(String(Z.value))};return $.patch(Z,J),$.applyData(Z,J)}function pu($,Z){let J={type:"element",tagName:"hr",properties:{},children:[]};return $.patch(Z,J),$.applyData(Z,J)}var cu={blockquote:Du,break:Vu,code:Lu,delete:Mu,emphasis:Pu,footnoteReference:_u,heading:Ou,html:ju,imageReference:Tu,image:Cu,inlineCode:Eu,linkReference:bu,link:wu,listItem:Su,list:Iu,paragraph:ku,root:yu,strong:xu,table:hu,tableCell:fu,tableRow:vu,text:uu,thematicBreak:pu,toml:PW,yaml:PW,definition:PW,footnoteDefinition:PW};function PW(){return}var nM={}.hasOwnProperty,oJ0={};function lu($,Z){let J=Z||oJ0,H=new Map,B=new Map,Q=new Map,X={...cu,...J.handlers},z={all:U,applyData:sJ0,definitionById:H,footnoteById:B,footnoteCounts:Q,footnoteOrder:[],handlers:X,one:G,options:J,patch:nJ0,wrap:eJ0};return l3($,function(Y){if(Y.type==="definition"||Y.type==="footnoteDefinition"){let K=Y.type==="definition"?H:B,F=String(Y.identifier).toUpperCase();if(!K.has(F))K.set(F,Y)}}),z;function G(Y,K){let F=Y.type,W=z.handlers[F];if(nM.call(z.handlers,F)&&W)return W(z,Y,K);if(z.options.passThrough&&z.options.passThrough.includes(F)){if("children"in Y){let{children:N,...D}=Y,A=AH(D);return A.children=z.all(Y),A}return AH(Y)}return(z.options.unknownHandler||tJ0)(z,Y,K)}function U(Y){let K=[];if("children"in Y){let F=Y.children,W=-1;while(++W<F.length){let q=z.one(F[W],Y);if(q){if(W&&F[W-1].type==="break"){if(!Array.isArray(q)&&q.type==="text")q.value=du(q.value);if(!Array.isArray(q)&&q.type==="element"){let N=q.children[0];if(N&&N.type==="text")N.value=du(N.value)}}if(Array.isArray(q))K.push(...q);else K.push(q)}}}return K}}function nJ0($,Z){if($.position)Z.position=TM($)}function sJ0($,Z){let J=Z;if($&&$.data){let H=$.data.hName,B=$.data.hChildren,Q=$.data.hProperties;if(typeof H==="string")if(J.type==="element")J.tagName=H;else{let X="children"in J?J.children:[J];J={type:"element",tagName:H,properties:{},children:X}}if(J.type==="element"&&Q)Object.assign(J.properties,AH(Q));if("children"in J&&J.children&&B!==null&&B!==void 0)J.children=B}return J}function tJ0($,Z){let J=Z.data||{},H="value"in Z&&!(nM.call(J,"hProperties")||nM.call(J,"hChildren"))?{type:"text",value:Z.value}:{type:"element",tagName:"div",properties:{},children:$.all(Z)};return $.patch(Z,H),$.applyData(Z,H)}function eJ0($,Z){let J=[],H=-1;if(Z)J.push({type:"text",value:`
27
+ `});while(++H<$.length){if(H)J.push({type:"text",value:`
28
+ `});J.push($[H])}if(Z&&$.length>0)J.push({type:"text",value:`
29
+ `});return J}function du($){let Z=0,J=$.charCodeAt(Z);while(J===9||J===32)Z++,J=$.charCodeAt(Z);return $.slice(Z)}function _W($,Z){let J=lu($,Z),H=J.one($,void 0),B=qu(J),Q=Array.isArray(H)?{type:"root",children:H}:H||{type:"root",children:[]};if(B)X5("children"in Q),Q.children.push({type:"text",value:`
30
+ `},B);return Q}function OW($,Z){if($&&"run"in $)return async function(J,H){let B=_W(J,{file:H,...Z});await $.run(B,H)};return function(J,H){return _W(J,{file:H,...$||Z})}}function sM($){if($)throw $}var CW=P($p(),1);function DX($){if(typeof $!=="object"||$===null)return!1;let Z=Object.getPrototypeOf($);return(Z===null||Z===Object.prototype||Object.getPrototypeOf(Z)===null)&&!(Symbol.toStringTag in $)&&!(Symbol.iterator in $)}function tM(){let $=[],Z={run:J,use:H};return Z;function J(...B){let Q=-1,X=B.pop();if(typeof X!=="function")throw TypeError("Expected function as last argument, not "+X);z(null,...B);function z(G,...U){let Y=$[++Q],K=-1;if(G){X(G);return}while(++K<B.length)if(U[K]===null||U[K]===void 0)U[K]=B[K];if(B=U,Y)Zp(Y,z)(...U);else X(null,...U)}}function H(B){if(typeof B!=="function")throw TypeError("Expected `middelware` to be a function, not "+B);return $.push(B),Z}}function Zp($,Z){let J;return H;function H(...X){let z=$.length>X.length,G;if(z)X.push(B);try{G=$.apply(this,X)}catch(U){let Y=U;if(z&&J)throw Y;return B(Y)}if(!z)if(G&&G.then&&typeof G.then==="function")G.then(Q,B);else if(G instanceof Error)B(G);else Q(G)}function B(X,...z){if(!J)J=!0,Z(X,...z)}function Q(X){B(null,X)}}var F9={basename:$H0,dirname:ZH0,extname:JH0,join:HH0,sep:"/"};function $H0($,Z){if(Z!==void 0&&typeof Z!=="string")throw TypeError('"ext" argument must be a string');VX($);let J=0,H=-1,B=$.length,Q;if(Z===void 0||Z.length===0||Z.length>$.length){while(B--)if($.codePointAt(B)===47){if(Q){J=B+1;break}}else if(H<0)Q=!0,H=B+1;return H<0?"":$.slice(J,H)}if(Z===$)return"";let X=-1,z=Z.length-1;while(B--)if($.codePointAt(B)===47){if(Q){J=B+1;break}}else{if(X<0)Q=!0,X=B+1;if(z>-1)if($.codePointAt(B)===Z.codePointAt(z--)){if(z<0)H=B}else z=-1,H=X}if(J===H)H=X;else if(H<0)H=$.length;return $.slice(J,H)}function ZH0($){if(VX($),$.length===0)return".";let Z=-1,J=$.length,H;while(--J)if($.codePointAt(J)===47){if(H){Z=J;break}}else if(!H)H=!0;return Z<0?$.codePointAt(0)===47?"/":".":Z===1&&$.codePointAt(0)===47?"//":$.slice(0,Z)}function JH0($){VX($);let Z=$.length,J=-1,H=0,B=-1,Q=0,X;while(Z--){let z=$.codePointAt(Z);if(z===47){if(X){H=Z+1;break}continue}if(J<0)X=!0,J=Z+1;if(z===46){if(B<0)B=Z;else if(Q!==1)Q=1}else if(B>-1)Q=-1}if(B<0||J<0||Q===0||Q===1&&B===J-1&&B===H+1)return"";return $.slice(B,J)}function HH0(...$){let Z=-1,J;while(++Z<$.length)if(VX($[Z]),$[Z])J=J===void 0?$[Z]:J+"/"+$[Z];return J===void 0?".":BH0(J)}function BH0($){VX($);let Z=$.codePointAt(0)===47,J=QH0($,!Z);if(J.length===0&&!Z)J=".";if(J.length>0&&$.codePointAt($.length-1)===47)J+="/";return Z?"/"+J:J}function QH0($,Z){let J="",H=0,B=-1,Q=0,X=-1,z,G;while(++X<=$.length){if(X<$.length)z=$.codePointAt(X);else if(z===47)break;else z=47;if(z===47){if(B===X-1||Q===1);else if(B!==X-1&&Q===2){if(J.length<2||H!==2||J.codePointAt(J.length-1)!==46||J.codePointAt(J.length-2)!==46){if(J.length>2){if(G=J.lastIndexOf("/"),G!==J.length-1){if(G<0)J="",H=0;else J=J.slice(0,G),H=J.length-1-J.lastIndexOf("/");B=X,Q=0;continue}}else if(J.length>0){J="",H=0,B=X,Q=0;continue}}if(Z)J=J.length>0?J+"/..":"..",H=2}else{if(J.length>0)J+="/"+$.slice(B+1,X);else J=$.slice(B+1,X);H=X-B-1}B=X,Q=0}else if(z===46&&Q>-1)Q++;else Q=-1}return J}function VX($){if(typeof $!=="string")throw TypeError("Path must be a string. Received "+JSON.stringify($))}var Jp={cwd:XH0};function XH0(){return"/"}function DH($){return Boolean($!==null&&typeof $==="object"&&"href"in $&&$.href&&"protocol"in $&&$.protocol&&$.auth===void 0)}function Hp($){if(typeof $==="string")$=new URL($);else if(!DH($)){let Z=TypeError('The "path" argument must be of type string or an instance of URL. Received `'+$+"`");throw Z.code="ERR_INVALID_ARG_TYPE",Z}if($.protocol!=="file:"){let Z=TypeError("The URL must be of scheme file");throw Z.code="ERR_INVALID_URL_SCHEME",Z}return zH0($)}function zH0($){if($.hostname!==""){let H=TypeError('File URL host must be "localhost" or empty on darwin');throw H.code="ERR_INVALID_FILE_URL_HOST",H}let Z=$.pathname,J=-1;while(++J<Z.length)if(Z.codePointAt(J)===37&&Z.codePointAt(J+1)===50){let H=Z.codePointAt(J+2);if(H===70||H===102){let B=TypeError("File URL path must not include encoded / characters");throw B.code="ERR_INVALID_FILE_URL_PATH",B}}return decodeURIComponent(Z)}var eM=["history","path","basename","stem","extname","dirname"];class VH{constructor($){let Z;if(!$)Z={};else if(DH($))Z={path:$};else if(typeof $==="string"||GH0($))Z={value:$};else Z=$;this.cwd="cwd"in Z?"":Jp.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let J=-1;while(++J<eM.length){let B=eM[J];if(B in Z&&Z[B]!==void 0&&Z[B]!==null)this[B]=B==="history"?[...Z[B]]:Z[B]}let H;for(H in Z)if(!eM.includes(H))this[H]=Z[H]}get basename(){return typeof this.path==="string"?F9.basename(this.path):void 0}set basename($){ZP($,"basename"),$P($,"basename"),this.path=F9.join(this.dirname||"",$)}get dirname(){return typeof this.path==="string"?F9.dirname(this.path):void 0}set dirname($){Bp(this.basename,"dirname"),this.path=F9.join($||"",this.basename)}get extname(){return typeof this.path==="string"?F9.extname(this.path):void 0}set extname($){if($P($,"extname"),Bp(this.dirname,"extname"),$){if($.codePointAt(0)!==46)throw Error("`extname` must start with `.`");if($.includes(".",1))throw Error("`extname` cannot contain multiple dots")}this.path=F9.join(this.dirname,this.stem+($||""))}get path(){return this.history[this.history.length-1]}set path($){if(DH($))$=Hp($);if(ZP($,"path"),this.path!==$)this.history.push($)}get stem(){return typeof this.path==="string"?F9.basename(this.path,this.extname):void 0}set stem($){ZP($,"stem"),$P($,"stem"),this.path=F9.join(this.dirname||"",$+(this.extname||""))}fail($,Z,J){let H=this.message($,Z,J);throw H.fatal=!0,H}info($,Z,J){let H=this.message($,Z,J);return H.fatal=void 0,H}message($,Z,J){let H=new N2($,Z,J);if(this.path)H.name=this.path+":"+H.name,H.file=this.path;return H.fatal=!1,this.messages.push(H),H}toString($){if(this.value===void 0)return"";if(typeof this.value==="string")return this.value;return new TextDecoder($||void 0).decode(this.value)}}function $P($,Z){if($&&$.includes(F9.sep))throw Error("`"+Z+"` cannot be a path: did not expect `"+F9.sep+"`")}function ZP($,Z){if(!$)throw Error("`"+Z+"` cannot be empty")}function Bp($,Z){if(!$)throw Error("Setting `"+Z+"` requires `path` to be set too")}function GH0($){return Boolean($&&typeof $==="object"&&"byteLength"in $&&"byteOffset"in $)}var Qp=function($){let H=this.constructor.prototype,B=H[$],Q=function(){return B.apply(Q,arguments)};return Object.setPrototypeOf(Q,H),Q};var UH0={}.hasOwnProperty;class QP extends Qp{constructor(){super("copy");this.Compiler=void 0,this.Parser=void 0,this.attachers=[],this.compiler=void 0,this.freezeIndex=-1,this.frozen=void 0,this.namespace={},this.parser=void 0,this.transformers=tM()}copy(){let $=new QP,Z=-1;while(++Z<this.attachers.length){let J=this.attachers[Z];$.use(...J)}return $.data(CW.default(!0,{},this.namespace)),$}data($,Z){if(typeof $==="string"){if(arguments.length===2)return BP("data",this.frozen),this.namespace[$]=Z,this;return UH0.call(this.namespace,$)&&this.namespace[$]||void 0}if($)return BP("data",this.frozen),this.namespace=$,this;return this.namespace}freeze(){if(this.frozen)return this;let $=this;while(++this.freezeIndex<this.attachers.length){let[Z,...J]=this.attachers[this.freezeIndex];if(J[0]===!1)continue;if(J[0]===!0)J[0]=void 0;let H=Z.call($,...J);if(typeof H==="function")this.transformers.use(H)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse($){this.freeze();let Z=TW($),J=this.parser||this.Parser;return JP("parse",J),J(String(Z),Z)}process($,Z){let J=this;return this.freeze(),JP("process",this.parser||this.Parser),HP("process",this.compiler||this.Compiler),Z?H(void 0,Z):new Promise(H);function H(B,Q){let X=TW($),z=J.parse(X);J.run(z,X,function(U,Y,K){if(U||!Y||!K)return G(U);let F=Y,W=J.stringify(F,K);if(KH0(W))K.value=W;else K.result=W;G(U,K)});function G(U,Y){if(U||!Y)Q(U);else if(B)B(Y);else X5(Z,"`done` is defined if `resolve` is not"),Z(void 0,Y)}}}processSync($){let Z=!1,J;return this.freeze(),JP("processSync",this.parser||this.Parser),HP("processSync",this.compiler||this.Compiler),this.process($,H),zp("processSync","process",Z),X5(J,"we either bailed on an error or have a tree"),J;function H(B,Q){Z=!0,sM(B),J=Q}}run($,Z,J){Xp($),this.freeze();let H=this.transformers;if(!J&&typeof Z==="function")J=Z,Z=void 0;return J?B(void 0,J):new Promise(B);function B(Q,X){X5(typeof Z!=="function","`file` can’t be a `done` anymore, we checked");let z=TW(Z);H.run($,z,G);function G(U,Y,K){let F=Y||$;if(U)X(U);else if(Q)Q(F);else X5(J,"`done` is defined if `resolve` is not"),J(void 0,F,K)}}}runSync($,Z){let J=!1,H;return this.run($,Z,B),zp("runSync","run",J),X5(H,"we either bailed on an error or have a tree"),H;function B(Q,X){sM(Q),H=X,J=!0}}stringify($,Z){this.freeze();let J=TW(Z),H=this.compiler||this.Compiler;return HP("stringify",H),Xp($),H($,J)}use($,...Z){let J=this.attachers,H=this.namespace;if(BP("use",this.frozen),$===null||$===void 0);else if(typeof $==="function")z($,Z);else if(typeof $==="object")if(Array.isArray($))X($);else Q($);else throw TypeError("Expected usable value, not `"+$+"`");return this;function B(G){if(typeof G==="function")z(G,[]);else if(typeof G==="object")if(Array.isArray(G)){let[U,...Y]=G;z(U,Y)}else Q(G);else throw TypeError("Expected usable value, not `"+G+"`")}function Q(G){if(!("plugins"in G)&&!("settings"in G))throw Error("Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither");if(X(G.plugins),G.settings)H.settings=CW.default(!0,H.settings,G.settings)}function X(G){let U=-1;if(G===null||G===void 0);else if(Array.isArray(G))while(++U<G.length){let Y=G[U];B(Y)}else throw TypeError("Expected a list of plugins, not `"+G+"`")}function z(G,U){let Y=-1,K=-1;while(++Y<J.length)if(J[Y][0]===G){K=Y;break}if(K===-1)J.push([G,...U]);else if(U.length>0){let[F,...W]=U,q=J[K][1];if(DX(q)&&DX(F))F=CW.default(!0,q,F);J[K]=[G,F,...W]}}}}var XP=new QP().freeze();function JP($,Z){if(typeof Z!=="function")throw TypeError("Cannot `"+$+"` without `parser`")}function HP($,Z){if(typeof Z!=="function")throw TypeError("Cannot `"+$+"` without `compiler`")}function BP($,Z){if(Z)throw Error("Cannot call `"+$+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function Xp($){if(!DX($)||typeof $.type!=="string")throw TypeError("Expected node, got `"+$+"`")}function zp($,Z,J){if(!J)throw Error("`"+$+"` finished async. Use `"+Z+"` instead")}function TW($){return YH0($)?$:new VH($)}function YH0($){return Boolean($&&typeof $==="object"&&"message"in $&&"messages"in $)}function KH0($){return typeof $==="string"||FH0($)}function FH0($){return Boolean($&&typeof $==="object"&&"byteLength"in $&&"byteOffset"in $)}var WH0="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",Gp=[],Up={allowDangerousHtml:!0},qH0=/^(https?|ircs?|mailto|xmpp)$/i,NH0=[{from:"astPlugins",id:"remove-buggy-html-in-markdown-parser"},{from:"allowDangerousHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"allowNode",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowElement"},{from:"allowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowedElements"},{from:"className",id:"remove-classname"},{from:"disallowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"disallowedElements"},{from:"escapeHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"includeElementIndex",id:"#remove-includeelementindex"},{from:"includeNodeIndex",id:"change-includenodeindex-to-includeelementindex"},{from:"linkTarget",id:"remove-linktarget"},{from:"plugins",id:"change-plugins-to-remarkplugins",to:"remarkPlugins"},{from:"rawSourcePos",id:"#remove-rawsourcepos"},{from:"renderers",id:"change-renderers-to-components",to:"components"},{from:"source",id:"change-source-to-children",to:"children"},{from:"sourcePos",id:"#remove-sourcepos"},{from:"transformImageUri",id:"#add-urltransform",to:"urlTransform"},{from:"transformLinkUri",id:"#add-urltransform",to:"urlTransform"}];function EW($){let Z=AH0($),J=DH0($);return VH0(Z.runSync(Z.parse(J),J),$)}function AH0($){let Z=$.rehypePlugins||Gp,J=$.remarkPlugins||Gp,H=$.remarkRehypeOptions?{...$.remarkRehypeOptions,...Up}:Up;return XP().use(FW).use(J).use(OW,H).use(Z)}function DH0($){let Z=$.children||"",J=new VH;if(typeof Z==="string")J.value=Z;else aF("Unexpected value `"+Z+"` for `children` prop, expected `string`");return J}function VH0($,Z){let{allowedElements:J,allowElement:H,components:B,disallowedElements:Q,skipHtml:X,unwrapDisallowed:z}=Z,G=Z.urlTransform||bW;for(let Y of NH0)if(Object.hasOwn(Z,Y.from))aF("Unexpected `"+Y.from+"` prop, "+(Y.to?"use `"+Y.to+"` instead":"remove it")+" (see <"+WH0+"#"+Y.id+"> for more info)");if(J&&Q)aF("Unexpected combined `allowedElements` and `disallowedElements`, expected one or the other");return l3($,U),bM($,{Fragment:LH.Fragment,components:B,ignoreInvalidStyle:!0,jsx:LH.jsx,jsxs:LH.jsxs,passKeys:!0,passNode:!0});function U(Y,K,F){if(Y.type==="raw"&&F&&typeof K==="number"){if(X)F.children.splice(K,1);else F.children[K]={type:"text",value:Y.value};return K}if(Y.type==="element"){let W;for(W in QX)if(Object.hasOwn(QX,W)&&Object.hasOwn(Y.properties,W)){let q=Y.properties[W],N=QX[W];if(N===null||N.includes(Y.tagName))Y.properties[W]=G(String(q||""),W,Y)}}if(Y.type==="element"){let W=J?!J.includes(Y.tagName):Q?Q.includes(Y.tagName):!1;if(!W&&H&&typeof K==="number")W=!H(Y,K,F);if(W&&F&&typeof K==="number"){if(z&&Y.children)F.children.splice(K,1,...Y.children);else F.children.splice(K,1);return K}}}}function bW($){let Z=$.indexOf(":"),J=$.indexOf("?"),H=$.indexOf("#"),B=$.indexOf("/");if(Z===-1||B!==-1&&Z>B||J!==-1&&Z>J||H!==-1&&Z>H||qH0.test($.slice(0,Z)))return $;return""}var wW=function($,Z,J){let H=F3(J);if(!$||!$.type||!$.children)throw Error("Expected parent node");if(typeof Z==="number"){if(Z<0||Z===Number.POSITIVE_INFINITY)throw Error("Expected positive finite number as index")}else if(Z=$.children.indexOf(Z),Z<0)throw Error("Expected child node or index");while(++Z<$.children.length)if(H($.children[Z],Z,$))return $.children[Z];return};var i3=function($){if($===null||$===void 0)return PH0;if(typeof $==="string")return MH0($);if(typeof $==="object")return LH0($);if(typeof $==="function")return zP($);throw Error("Expected function, string, or array as `test`")};function LH0($){let Z=[],J=-1;while(++J<$.length)Z[J]=i3($[J]);return zP(H);function H(...B){let Q=-1;while(++Q<Z.length)if(Z[Q].apply(this,B))return!0;return!1}}function MH0($){return zP(Z);function Z(J){return J.tagName===$}}function zP($){return Z;function Z(J,H,B){return Boolean(_H0(J)&&$.call(this,J,typeof H==="number"?H:void 0,B||void 0))}}function PH0($){return Boolean($&&typeof $==="object"&&"type"in $&&$.type==="element"&&"tagName"in $&&typeof $.tagName==="string")}function _H0($){return $!==null&&typeof $==="object"&&"type"in $&&"tagName"in $}var Kp=/\n/g,Fp=/[\t ]+/g,GP=i3("br"),Wp=i3(wH0),OH0=i3("p"),qp=i3("tr"),jH0=i3(["datalist","head","noembed","noframes","noscript","rp","script","style","template","title",bH0,SH0]),Np=i3(["address","article","aside","blockquote","body","caption","center","dd","dialog","dir","dl","dt","div","figure","figcaption","footer","form,","h1","h2","h3","h4","h5","h6","header","hgroup","hr","html","legend","li","listing","main","menu","nav","ol","p","plaintext","pre","section","ul","xmp"]);function UP($,Z){let J=Z||{},H="children"in $?$.children:[],B=Np($),Q=Vp($,{whitespace:J.whitespace||"normal",breakBefore:!1,breakAfter:!1}),X=[];if($.type==="text"||$.type==="comment")X.push(...Dp($,{whitespace:Q,breakBefore:!0,breakAfter:!0}));let z=-1;while(++z<H.length)X.push(...Ap(H[z],$,{whitespace:Q,breakBefore:z?void 0:B,breakAfter:z<H.length-1?GP(H[z+1]):B}));let G=[],U;z=-1;while(++z<X.length){let Y=X[z];if(typeof Y==="number"){if(U!==void 0&&Y>U)U=Y}else if(Y){if(U!==void 0&&U>-1)G.push(`
31
+ `.repeat(U)||" ");U=-1,G.push(Y)}}return G.join("")}function Ap($,Z,J){if($.type==="element")return TH0($,Z,J);if($.type==="text")return J.whitespace==="normal"?Dp($,J):CH0($);return[]}function TH0($,Z,J){let H=Vp($,J),B=$.children||[],Q=-1,X=[];if(jH0($))return X;let z,G;if(GP($))G=`
32
+ `;else if(qp($)&&wW(Z,$,qp))G=`
33
+ `;else if(OH0($))z=2,G=2;else if(Np($))z=1,G=1;while(++Q<B.length)X=X.concat(Ap(B[Q],$,{whitespace:H,breakBefore:Q?void 0:z,breakAfter:Q<B.length-1?GP(B[Q+1]):G}));if(Wp($)&&wW(Z,$,Wp))X.push("\t");if(z)X.unshift(z);if(G)X.push(G);return X}function Dp($,Z){let J=String($.value),H=[],B=[],Q=0;while(Q<=J.length){Kp.lastIndex=Q;let G=Kp.exec(J),U=G&&"index"in G?G.index:J.length;H.push(EH0(J.slice(Q,U).replace(/[\u061C\u200E\u200F\u202A-\u202E\u2066-\u2069]/g,""),Q===0?Z.breakBefore:!0,U===J.length?Z.breakAfter:!0)),Q=U+1}let X=-1,z;while(++X<H.length)if(H[X].charCodeAt(H[X].length-1)===8203||X<H.length-1&&H[X+1].charCodeAt(0)===8203)B.push(H[X]),z=void 0;else if(H[X]){if(typeof z==="number")B.push(z);B.push(H[X]),z=0}else if(X===0||X===H.length-1)B.push(0);return B}function CH0($){return[String($.value)]}function EH0($,Z,J){let H=[],B=0,Q;while(B<$.length){Fp.lastIndex=B;let X=Fp.exec($);if(Q=X?X.index:$.length,!B&&!Q&&X&&!Z)H.push("");if(B!==Q)H.push($.slice(B,Q));B=X?Q+X[0].length:Q}if(B!==Q&&!J)H.push("");return H.join(" ")}function Vp($,Z){if($.type==="element"){let J=$.properties||{};switch($.tagName){case"listing":case"plaintext":case"xmp":return"pre";case"nobr":return"nowrap";case"pre":return J.wrap?"pre-wrap":"pre";case"td":case"th":return J.noWrap?"nowrap":Z.whitespace;case"textarea":return"pre-wrap";default:}}return Z.whitespace}function bH0($){return Boolean(($.properties||{}).hidden)}function wH0($){return $.tagName==="td"||$.tagName==="th"}function SH0($){return $.tagName==="dialog"&&!($.properties||{}).open}function RH0($){let Z=$.regex,J=$.COMMENT("//","$",{contains:[{begin:/\\\n/}]}),H="decltype\\(auto\\)",B="[a-zA-Z_]\\w*::",Q="<[^<>]+>",X="(?!struct)(decltype\\(auto\\)|"+Z.optional("[a-zA-Z_]\\w*::")+"[a-zA-Z_]\\w*"+Z.optional("<[^<>]+>")+")",z={className:"type",begin:"\\b[a-z\\d_]*_t\\b"},G="\\\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4,8}|[0-7]{3}|\\S)",U={className:"string",variants:[{begin:'(u8?|U|L)?"',end:'"',illegal:"\\n",contains:[$.BACKSLASH_ESCAPE]},{begin:"(u8?|U|L)?'(\\\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4,8}|[0-7]{3}|\\S)|.)",end:"'",illegal:"."},$.END_SAME_AS_BEGIN({begin:/(?:u8?|U|L)?R"([^()\\ ]{0,16})\(/,end:/\)([^()\\ ]{0,16})"/})]},Y={className:"number",variants:[{begin:"[+-]?(?:(?:[0-9](?:'?[0-9])*\\.(?:[0-9](?:'?[0-9])*)?|\\.[0-9](?:'?[0-9])*)(?:[Ee][+-]?[0-9](?:'?[0-9])*)?|[0-9](?:'?[0-9])*[Ee][+-]?[0-9](?:'?[0-9])*|0[Xx](?:[0-9A-Fa-f](?:'?[0-9A-Fa-f])*(?:\\.(?:[0-9A-Fa-f](?:'?[0-9A-Fa-f])*)?)?|\\.[0-9A-Fa-f](?:'?[0-9A-Fa-f])*)[Pp][+-]?[0-9](?:'?[0-9])*)(?:[Ff](?:16|32|64|128)?|(BF|bf)16|[Ll]|)"},{begin:"[+-]?\\b(?:0[Bb][01](?:'?[01])*|0[Xx][0-9A-Fa-f](?:'?[0-9A-Fa-f])*|0(?:'?[0-7])*|[1-9](?:'?[0-9])*)(?:[Uu](?:LL?|ll?)|[Uu][Zz]?|(?:LL?|ll?)[Uu]?|[Zz][Uu]|)"}],relevance:0},K={className:"meta",begin:/#\s*[a-z]+\b/,end:/$/,keywords:{keyword:"if else elif endif define undef warning error line pragma _Pragma ifdef ifndef include"},contains:[{begin:/\\\n/,relevance:0},$.inherit(U,{className:"string"}),{className:"string",begin:/<.*?>/},J,$.C_BLOCK_COMMENT_MODE]},F={className:"title",begin:Z.optional("[a-zA-Z_]\\w*::")+$.IDENT_RE,relevance:0},W=Z.optional("[a-zA-Z_]\\w*::")+$.IDENT_RE+"\\s*\\(",q=["alignas","alignof","and","and_eq","asm","atomic_cancel","atomic_commit","atomic_noexcept","auto","bitand","bitor","break","case","catch","class","co_await","co_return","co_yield","compl","concept","const_cast|10","consteval","constexpr","constinit","continue","decltype","default","delete","do","dynamic_cast|10","else","enum","explicit","export","extern","false","final","for","friend","goto","if","import","inline","module","mutable","namespace","new","noexcept","not","not_eq","nullptr","operator","or","or_eq","override","private","protected","public","reflexpr","register","reinterpret_cast|10","requires","return","sizeof","static_assert","static_cast|10","struct","switch","synchronized","template","this","thread_local","throw","transaction_safe","transaction_safe_dynamic","true","try","typedef","typeid","typename","union","using","virtual","volatile","while","xor","xor_eq"],N=["bool","char","char16_t","char32_t","char8_t","double","float","int","long","short","void","wchar_t","unsigned","signed","const","static"],D=["any","auto_ptr","barrier","binary_semaphore","bitset","complex","condition_variable","condition_variable_any","counting_semaphore","deque","false_type","flat_map","flat_set","future","imaginary","initializer_list","istringstream","jthread","latch","lock_guard","multimap","multiset","mutex","optional","ostringstream","packaged_task","pair","promise","priority_queue","queue","recursive_mutex","recursive_timed_mutex","scoped_lock","set","shared_future","shared_lock","shared_mutex","shared_timed_mutex","shared_ptr","stack","string_view","stringstream","timed_mutex","thread","true_type","tuple","unique_lock","unique_ptr","unordered_map","unordered_multimap","unordered_multiset","unordered_set","variant","vector","weak_ptr","wstring","wstring_view"],A=["abort","abs","acos","apply","as_const","asin","atan","atan2","calloc","ceil","cerr","cin","clog","cos","cosh","cout","declval","endl","exchange","exit","exp","fabs","floor","fmod","forward","fprintf","fputs","free","frexp","fscanf","future","invoke","isalnum","isalpha","iscntrl","isdigit","isgraph","islower","isprint","ispunct","isspace","isupper","isxdigit","labs","launder","ldexp","log","log10","make_pair","make_shared","make_shared_for_overwrite","make_tuple","make_unique","malloc","memchr","memcmp","memcpy","memset","modf","move","pow","printf","putchar","puts","realloc","scanf","sin","sinh","snprintf","sprintf","sqrt","sscanf","std","stderr","stdin","stdout","strcat","strchr","strcmp","strcpy","strcspn","strlen","strncat","strncmp","strncpy","strpbrk","strrchr","strspn","strstr","swap","tan","tanh","terminate","to_underlying","tolower","toupper","vfprintf","visit","vprintf","vsprintf"],O={type:N,keyword:q,literal:["NULL","false","nullopt","nullptr","true"],built_in:["_Pragma"],_type_hints:D},M={className:"function.dispatch",relevance:0,keywords:{_hint:A},begin:Z.concat(/\b/,/(?!decltype)/,/(?!if)/,/(?!for)/,/(?!switch)/,/(?!while)/,$.IDENT_RE,Z.lookahead(/(<[^<>]+>|)\s*\(/))},_=[M,K,z,J,$.C_BLOCK_COMMENT_MODE,Y,U],w={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}],keywords:O,contains:_.concat([{begin:/\(/,end:/\)/,keywords:O,contains:_.concat(["self"]),relevance:0}]),relevance:0},C={className:"function",begin:"("+X+"[\\*&\\s]+)+"+W,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:O,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:"decltype\\(auto\\)",keywords:O,relevance:0},{begin:W,returnBegin:!0,contains:[F],relevance:0},{begin:/::/,relevance:0},{begin:/:/,endsWithParent:!0,contains:[U,Y]},{relevance:0,match:/,/},{className:"params",begin:/\(/,end:/\)/,keywords:O,relevance:0,contains:[J,$.C_BLOCK_COMMENT_MODE,U,Y,z,{begin:/\(/,end:/\)/,keywords:O,relevance:0,contains:["self",J,$.C_BLOCK_COMMENT_MODE,U,Y,z]}]},z,J,$.C_BLOCK_COMMENT_MODE,K]};return{name:"C++",aliases:["cc","c++","h++","hpp","hh","hxx","cxx"],keywords:O,illegal:"</",classNameAliases:{"function.dispatch":"built_in"},contains:[].concat(w,C,M,_,[K,{begin:"\\b(deque|list|queue|priority_queue|pair|stack|vector|map|set|bitset|multiset|multimap|unordered_map|unordered_set|unordered_multiset|unordered_multimap|array|tuple|optional|variant|function|flat_map|flat_set)\\s*<(?!<)",end:">",keywords:O,contains:["self",z]},{begin:$.IDENT_RE+"::",keywords:O},{match:[/\b(?:enum(?:\s+(?:class|struct))?|class|struct|union)/,/\s+/,/\w+/],className:{1:"keyword",3:"title.class"}}])}}function Lp($){let Z={type:["boolean","byte","word","String"],built_in:["KeyboardController","MouseController","SoftwareSerial","EthernetServer","EthernetClient","LiquidCrystal","RobotControl","GSMVoiceCall","EthernetUDP","EsploraTFT","HttpClient","RobotMotor","WiFiClient","GSMScanner","FileSystem","Scheduler","GSMServer","YunClient","YunServer","IPAddress","GSMClient","GSMModem","Keyboard","Ethernet","Console","GSMBand","Esplora","Stepper","Process","WiFiUDP","GSM_SMS","Mailbox","USBHost","Firmata","PImage","Client","Server","GSMPIN","FileIO","Bridge","Serial","EEPROM","Stream","Mouse","Audio","Servo","File","Task","GPRS","WiFi","Wire","TFT","GSM","SPI","SD"],_hints:["setup","loop","runShellCommandAsynchronously","analogWriteResolution","retrieveCallingNumber","printFirmwareVersion","analogReadResolution","sendDigitalPortPair","noListenOnLocalhost","readJoystickButton","setFirmwareVersion","readJoystickSwitch","scrollDisplayRight","getVoiceCallStatus","scrollDisplayLeft","writeMicroseconds","delayMicroseconds","beginTransmission","getSignalStrength","runAsynchronously","getAsynchronously","listenOnLocalhost","getCurrentCarrier","readAccelerometer","messageAvailable","sendDigitalPorts","lineFollowConfig","countryNameWrite","runShellCommand","readStringUntil","rewindDirectory","readTemperature","setClockDivider","readLightSensor","endTransmission","analogReference","detachInterrupt","countryNameRead","attachInterrupt","encryptionType","readBytesUntil","robotNameWrite","readMicrophone","robotNameRead","cityNameWrite","userNameWrite","readJoystickY","readJoystickX","mouseReleased","openNextFile","scanNetworks","noInterrupts","digitalWrite","beginSpeaker","mousePressed","isActionDone","mouseDragged","displayLogos","noAutoscroll","addParameter","remoteNumber","getModifiers","keyboardRead","userNameRead","waitContinue","processInput","parseCommand","printVersion","readNetworks","writeMessage","blinkVersion","cityNameRead","readMessage","setDataMode","parsePacket","isListening","setBitOrder","beginPacket","isDirectory","motorsWrite","drawCompass","digitalRead","clearScreen","serialEvent","rightToLeft","setTextSize","leftToRight","requestFrom","keyReleased","compassRead","analogWrite","interrupts","WiFiServer","disconnect","playMelody","parseFloat","autoscroll","getPINUsed","setPINUsed","setTimeout","sendAnalog","readSlider","analogRead","beginWrite","createChar","motorsStop","keyPressed","tempoWrite","readButton","subnetMask","debugPrint","macAddress","writeGreen","randomSeed","attachGPRS","readString","sendString","remotePort","releaseAll","mouseMoved","background","getXChange","getYChange","answerCall","getResult","voiceCall","endPacket","constrain","getSocket","writeJSON","getButton","available","connected","findUntil","readBytes","exitValue","readGreen","writeBlue","startLoop","IPAddress","isPressed","sendSysex","pauseMode","gatewayIP","setCursor","getOemKey","tuneWrite","noDisplay","loadImage","switchPIN","onRequest","onReceive","changePIN","playFile","noBuffer","parseInt","overflow","checkPIN","knobRead","beginTFT","bitClear","updateIR","bitWrite","position","writeRGB","highByte","writeRed","setSpeed","readBlue","noStroke","remoteIP","transfer","shutdown","hangCall","beginSMS","endWrite","attached","maintain","noCursor","checkReg","checkPUK","shiftOut","isValid","shiftIn","pulseIn","connect","println","localIP","pinMode","getIMEI","display","noBlink","process","getBand","running","beginSD","drawBMP","lowByte","setBand","release","bitRead","prepare","pointTo","readRed","setMode","noFill","remove","listen","stroke","detach","attach","noTone","exists","buffer","height","bitSet","circle","config","cursor","random","IRread","setDNS","endSMS","getKey","micros","millis","begin","print","write","ready","flush","width","isPIN","blink","clear","press","mkdir","rmdir","close","point","yield","image","BSSID","click","delay","read","text","move","peek","beep","rect","line","open","seek","fill","size","turn","stop","home","find","step","tone","sqrt","RSSI","SSID","end","bit","tan","cos","sin","pow","map","abs","max","min","get","run","put"],literal:["DIGITAL_MESSAGE","FIRMATA_STRING","ANALOG_MESSAGE","REPORT_DIGITAL","REPORT_ANALOG","INPUT_PULLUP","SET_PIN_MODE","INTERNAL2V56","SYSTEM_RESET","LED_BUILTIN","INTERNAL1V1","SYSEX_START","INTERNAL","EXTERNAL","DEFAULT","OUTPUT","INPUT","HIGH","LOW"]},J=RH0($),H=J.keywords;return H.type=[...H.type,...Z.type],H.literal=[...H.literal,...Z.literal],H.built_in=[...H.built_in,...Z.built_in],H._hints=Z._hints,J.name="Arduino",J.aliases=["ino"],J.supersetOf="cpp",J}function Mp($){let Z=$.regex,J={},H={begin:/\$\{/,end:/\}/,contains:["self",{begin:/:-/,contains:[J]}]};Object.assign(J,{className:"variable",variants:[{begin:Z.concat(/\$[\w\d#@][\w\d_]*/,"(?![\\w\\d])(?![$])")},H]});let B={className:"subst",begin:/\$\(/,end:/\)/,contains:[$.BACKSLASH_ESCAPE]},Q=$.inherit($.COMMENT(),{match:[/(^|\s)/,/#.*$/],scope:{2:"comment"}}),X={begin:/<<-?\s*(?=\w+)/,starts:{contains:[$.END_SAME_AS_BEGIN({begin:/(\w+)/,end:/(\w+)/,className:"string"})]}},z={className:"string",begin:/"/,end:/"/,contains:[$.BACKSLASH_ESCAPE,J,B]};B.contains.push(z);let G={match:/\\"/},U={className:"string",begin:/'/,end:/'/},Y={match:/\\'/},K={begin:/\$?\(\(/,end:/\)\)/,contains:[{begin:/\d+#[0-9a-f]+/,className:"number"},$.NUMBER_MODE,J]},F=["fish","bash","zsh","sh","csh","ksh","tcsh","dash","scsh"],W=$.SHEBANG({binary:`(${F.join("|")})`,relevance:10}),q={className:"function",begin:/\w[\w\d_]*\s*\(\s*\)\s*\{/,returnBegin:!0,contains:[$.inherit($.TITLE_MODE,{begin:/\w[\w\d_]*/})],relevance:0},N=["if","then","else","elif","fi","time","for","while","until","in","do","done","case","esac","coproc","function","select"],D=["true","false"],A={match:/(\/[a-z._-]+)+/},V=["break","cd","continue","eval","exec","exit","export","getopts","hash","pwd","readonly","return","shift","test","times","trap","umask","unset"],L=["alias","bind","builtin","caller","command","declare","echo","enable","help","let","local","logout","mapfile","printf","read","readarray","source","sudo","type","typeset","ulimit","unalias"],O=["autoload","bg","bindkey","bye","cap","chdir","clone","comparguments","compcall","compctl","compdescribe","compfiles","compgroups","compquote","comptags","comptry","compvalues","dirs","disable","disown","echotc","echoti","emulate","fc","fg","float","functions","getcap","getln","history","integer","jobs","kill","limit","log","noglob","popd","print","pushd","pushln","rehash","sched","setcap","setopt","stat","suspend","ttyctl","unfunction","unhash","unlimit","unsetopt","vared","wait","whence","where","which","zcompile","zformat","zftp","zle","zmodload","zparseopts","zprof","zpty","zregexparse","zsocket","zstyle","ztcp"],M=["chcon","chgrp","chown","chmod","cp","dd","df","dir","dircolors","ln","ls","mkdir","mkfifo","mknod","mktemp","mv","realpath","rm","rmdir","shred","sync","touch","truncate","vdir","b2sum","base32","base64","cat","cksum","comm","csplit","cut","expand","fmt","fold","head","join","md5sum","nl","numfmt","od","paste","ptx","pr","sha1sum","sha224sum","sha256sum","sha384sum","sha512sum","shuf","sort","split","sum","tac","tail","tr","tsort","unexpand","uniq","wc","arch","basename","chroot","date","dirname","du","echo","env","expr","factor","groups","hostid","id","link","logname","nice","nohup","nproc","pathchk","pinky","printenv","printf","pwd","readlink","runcon","seq","sleep","stat","stdbuf","stty","tee","test","timeout","tty","uname","unlink","uptime","users","who","whoami","yes"];return{name:"Bash",aliases:["sh","zsh"],keywords:{$pattern:/\b[a-z][a-z0-9._-]+\b/,keyword:N,literal:D,built_in:[...V,...L,"set","shopt",...O,...M]},contains:[W,$.SHEBANG(),q,K,Q,X,A,z,G,U,Y,J]}}function Pp($){let Z=$.regex,J=$.COMMENT("//","$",{contains:[{begin:/\\\n/}]}),H="decltype\\(auto\\)",B="[a-zA-Z_]\\w*::",Q="<[^<>]+>",X="(decltype\\(auto\\)|"+Z.optional("[a-zA-Z_]\\w*::")+"[a-zA-Z_]\\w*"+Z.optional("<[^<>]+>")+")",z={className:"type",variants:[{begin:"\\b[a-z\\d_]*_t\\b"},{match:/\batomic_[a-z]{3,6}\b/}]},G="\\\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4,8}|[0-7]{3}|\\S)",U={className:"string",variants:[{begin:'(u8?|U|L)?"',end:'"',illegal:"\\n",contains:[$.BACKSLASH_ESCAPE]},{begin:"(u8?|U|L)?'(\\\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4,8}|[0-7]{3}|\\S)|.)",end:"'",illegal:"."},$.END_SAME_AS_BEGIN({begin:/(?:u8?|U|L)?R"([^()\\ ]{0,16})\(/,end:/\)([^()\\ ]{0,16})"/})]},Y={className:"number",variants:[{match:/\b(0b[01']+)/},{match:/(-?)\b([\d']+(\.[\d']*)?|\.[\d']+)((ll|LL|l|L)(u|U)?|(u|U)(ll|LL|l|L)?|f|F|b|B)/},{match:/(-?)\b(0[xX][a-fA-F0-9]+(?:'[a-fA-F0-9]+)*(?:\.[a-fA-F0-9]*(?:'[a-fA-F0-9]*)*)?(?:[pP][-+]?[0-9]+)?(l|L)?(u|U)?)/},{match:/(-?)\b\d+(?:'\d+)*(?:\.\d*(?:'\d*)*)?(?:[eE][-+]?\d+)?/}],relevance:0},K={className:"meta",begin:/#\s*[a-z]+\b/,end:/$/,keywords:{keyword:"if else elif endif define undef warning error line pragma _Pragma ifdef ifndef elifdef elifndef include"},contains:[{begin:/\\\n/,relevance:0},$.inherit(U,{className:"string"}),{className:"string",begin:/<.*?>/},J,$.C_BLOCK_COMMENT_MODE]},F={className:"title",begin:Z.optional("[a-zA-Z_]\\w*::")+$.IDENT_RE,relevance:0},W=Z.optional("[a-zA-Z_]\\w*::")+$.IDENT_RE+"\\s*\\(",D={keyword:["asm","auto","break","case","continue","default","do","else","enum","extern","for","fortran","goto","if","inline","register","restrict","return","sizeof","typeof","typeof_unqual","struct","switch","typedef","union","volatile","while","_Alignas","_Alignof","_Atomic","_Generic","_Noreturn","_Static_assert","_Thread_local","alignas","alignof","noreturn","static_assert","thread_local","_Pragma"],type:["float","double","signed","unsigned","int","short","long","char","void","_Bool","_BitInt","_Complex","_Imaginary","_Decimal32","_Decimal64","_Decimal96","_Decimal128","_Decimal64x","_Decimal128x","_Float16","_Float32","_Float64","_Float128","_Float32x","_Float64x","_Float128x","const","static","constexpr","complex","bool","imaginary"],literal:"true false NULL",built_in:"std string wstring cin cout cerr clog stdin stdout stderr stringstream istringstream ostringstream auto_ptr deque list queue stack vector map set pair bitset multiset multimap unordered_set unordered_map unordered_multiset unordered_multimap priority_queue make_pair array shared_ptr abort terminate abs acos asin atan2 atan calloc ceil cosh cos exit exp fabs floor fmod fprintf fputs free frexp fscanf future isalnum isalpha iscntrl isdigit isgraph islower isprint ispunct isspace isupper isxdigit tolower toupper labs ldexp log10 log malloc realloc memchr memcmp memcpy memset modf pow printf putchar puts scanf sinh sin snprintf sprintf sqrt sscanf strcat strchr strcmp strcpy strcspn strlen strncat strncmp strncpy strpbrk strrchr strspn strstr tanh tan vfprintf vprintf vsprintf endl initializer_list unique_ptr"},A=[K,z,J,$.C_BLOCK_COMMENT_MODE,Y,U],V={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}],keywords:D,contains:A.concat([{begin:/\(/,end:/\)/,keywords:D,contains:A.concat(["self"]),relevance:0}]),relevance:0},L={begin:"("+X+"[\\*&\\s]+)+"+W,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:D,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:"decltype\\(auto\\)",keywords:D,relevance:0},{begin:W,returnBegin:!0,contains:[$.inherit(F,{className:"title.function"})],relevance:0},{relevance:0,match:/,/},{className:"params",begin:/\(/,end:/\)/,keywords:D,relevance:0,contains:[J,$.C_BLOCK_COMMENT_MODE,U,Y,z,{begin:/\(/,end:/\)/,keywords:D,relevance:0,contains:["self",J,$.C_BLOCK_COMMENT_MODE,U,Y,z]}]},z,J,$.C_BLOCK_COMMENT_MODE,K]};return{name:"C",aliases:["h"],keywords:D,disableAutodetect:!0,illegal:"</",contains:[].concat(V,L,A,[K,{begin:$.IDENT_RE+"::",keywords:D},{className:"class",beginKeywords:"enum class struct union",end:/[{;:<>=]/,contains:[{beginKeywords:"final class struct"},$.TITLE_MODE]}]),exports:{preprocessor:K,strings:U,keywords:D}}}function _p($){let Z=$.regex,J=$.COMMENT("//","$",{contains:[{begin:/\\\n/}]}),H="decltype\\(auto\\)",B="[a-zA-Z_]\\w*::",Q="<[^<>]+>",X="(?!struct)(decltype\\(auto\\)|"+Z.optional("[a-zA-Z_]\\w*::")+"[a-zA-Z_]\\w*"+Z.optional("<[^<>]+>")+")",z={className:"type",begin:"\\b[a-z\\d_]*_t\\b"},G="\\\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4,8}|[0-7]{3}|\\S)",U={className:"string",variants:[{begin:'(u8?|U|L)?"',end:'"',illegal:"\\n",contains:[$.BACKSLASH_ESCAPE]},{begin:"(u8?|U|L)?'(\\\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4,8}|[0-7]{3}|\\S)|.)",end:"'",illegal:"."},$.END_SAME_AS_BEGIN({begin:/(?:u8?|U|L)?R"([^()\\ ]{0,16})\(/,end:/\)([^()\\ ]{0,16})"/})]},Y={className:"number",variants:[{begin:"[+-]?(?:(?:[0-9](?:'?[0-9])*\\.(?:[0-9](?:'?[0-9])*)?|\\.[0-9](?:'?[0-9])*)(?:[Ee][+-]?[0-9](?:'?[0-9])*)?|[0-9](?:'?[0-9])*[Ee][+-]?[0-9](?:'?[0-9])*|0[Xx](?:[0-9A-Fa-f](?:'?[0-9A-Fa-f])*(?:\\.(?:[0-9A-Fa-f](?:'?[0-9A-Fa-f])*)?)?|\\.[0-9A-Fa-f](?:'?[0-9A-Fa-f])*)[Pp][+-]?[0-9](?:'?[0-9])*)(?:[Ff](?:16|32|64|128)?|(BF|bf)16|[Ll]|)"},{begin:"[+-]?\\b(?:0[Bb][01](?:'?[01])*|0[Xx][0-9A-Fa-f](?:'?[0-9A-Fa-f])*|0(?:'?[0-7])*|[1-9](?:'?[0-9])*)(?:[Uu](?:LL?|ll?)|[Uu][Zz]?|(?:LL?|ll?)[Uu]?|[Zz][Uu]|)"}],relevance:0},K={className:"meta",begin:/#\s*[a-z]+\b/,end:/$/,keywords:{keyword:"if else elif endif define undef warning error line pragma _Pragma ifdef ifndef include"},contains:[{begin:/\\\n/,relevance:0},$.inherit(U,{className:"string"}),{className:"string",begin:/<.*?>/},J,$.C_BLOCK_COMMENT_MODE]},F={className:"title",begin:Z.optional("[a-zA-Z_]\\w*::")+$.IDENT_RE,relevance:0},W=Z.optional("[a-zA-Z_]\\w*::")+$.IDENT_RE+"\\s*\\(",q=["alignas","alignof","and","and_eq","asm","atomic_cancel","atomic_commit","atomic_noexcept","auto","bitand","bitor","break","case","catch","class","co_await","co_return","co_yield","compl","concept","const_cast|10","consteval","constexpr","constinit","continue","decltype","default","delete","do","dynamic_cast|10","else","enum","explicit","export","extern","false","final","for","friend","goto","if","import","inline","module","mutable","namespace","new","noexcept","not","not_eq","nullptr","operator","or","or_eq","override","private","protected","public","reflexpr","register","reinterpret_cast|10","requires","return","sizeof","static_assert","static_cast|10","struct","switch","synchronized","template","this","thread_local","throw","transaction_safe","transaction_safe_dynamic","true","try","typedef","typeid","typename","union","using","virtual","volatile","while","xor","xor_eq"],N=["bool","char","char16_t","char32_t","char8_t","double","float","int","long","short","void","wchar_t","unsigned","signed","const","static"],D=["any","auto_ptr","barrier","binary_semaphore","bitset","complex","condition_variable","condition_variable_any","counting_semaphore","deque","false_type","flat_map","flat_set","future","imaginary","initializer_list","istringstream","jthread","latch","lock_guard","multimap","multiset","mutex","optional","ostringstream","packaged_task","pair","promise","priority_queue","queue","recursive_mutex","recursive_timed_mutex","scoped_lock","set","shared_future","shared_lock","shared_mutex","shared_timed_mutex","shared_ptr","stack","string_view","stringstream","timed_mutex","thread","true_type","tuple","unique_lock","unique_ptr","unordered_map","unordered_multimap","unordered_multiset","unordered_set","variant","vector","weak_ptr","wstring","wstring_view"],A=["abort","abs","acos","apply","as_const","asin","atan","atan2","calloc","ceil","cerr","cin","clog","cos","cosh","cout","declval","endl","exchange","exit","exp","fabs","floor","fmod","forward","fprintf","fputs","free","frexp","fscanf","future","invoke","isalnum","isalpha","iscntrl","isdigit","isgraph","islower","isprint","ispunct","isspace","isupper","isxdigit","labs","launder","ldexp","log","log10","make_pair","make_shared","make_shared_for_overwrite","make_tuple","make_unique","malloc","memchr","memcmp","memcpy","memset","modf","move","pow","printf","putchar","puts","realloc","scanf","sin","sinh","snprintf","sprintf","sqrt","sscanf","std","stderr","stdin","stdout","strcat","strchr","strcmp","strcpy","strcspn","strlen","strncat","strncmp","strncpy","strpbrk","strrchr","strspn","strstr","swap","tan","tanh","terminate","to_underlying","tolower","toupper","vfprintf","visit","vprintf","vsprintf"],O={type:N,keyword:q,literal:["NULL","false","nullopt","nullptr","true"],built_in:["_Pragma"],_type_hints:D},M={className:"function.dispatch",relevance:0,keywords:{_hint:A},begin:Z.concat(/\b/,/(?!decltype)/,/(?!if)/,/(?!for)/,/(?!switch)/,/(?!while)/,$.IDENT_RE,Z.lookahead(/(<[^<>]+>|)\s*\(/))},_=[M,K,z,J,$.C_BLOCK_COMMENT_MODE,Y,U],w={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}],keywords:O,contains:_.concat([{begin:/\(/,end:/\)/,keywords:O,contains:_.concat(["self"]),relevance:0}]),relevance:0},C={className:"function",begin:"("+X+"[\\*&\\s]+)+"+W,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:O,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:"decltype\\(auto\\)",keywords:O,relevance:0},{begin:W,returnBegin:!0,contains:[F],relevance:0},{begin:/::/,relevance:0},{begin:/:/,endsWithParent:!0,contains:[U,Y]},{relevance:0,match:/,/},{className:"params",begin:/\(/,end:/\)/,keywords:O,relevance:0,contains:[J,$.C_BLOCK_COMMENT_MODE,U,Y,z,{begin:/\(/,end:/\)/,keywords:O,relevance:0,contains:["self",J,$.C_BLOCK_COMMENT_MODE,U,Y,z]}]},z,J,$.C_BLOCK_COMMENT_MODE,K]};return{name:"C++",aliases:["cc","c++","h++","hpp","hh","hxx","cxx"],keywords:O,illegal:"</",classNameAliases:{"function.dispatch":"built_in"},contains:[].concat(w,C,M,_,[K,{begin:"\\b(deque|list|queue|priority_queue|pair|stack|vector|map|set|bitset|multiset|multimap|unordered_map|unordered_set|unordered_multiset|unordered_multimap|array|tuple|optional|variant|function|flat_map|flat_set)\\s*<(?!<)",end:">",keywords:O,contains:["self",z]},{begin:$.IDENT_RE+"::",keywords:O},{match:[/\b(?:enum(?:\s+(?:class|struct))?|class|struct|union)/,/\s+/,/\w+/],className:{1:"keyword",3:"title.class"}}])}}function Op($){let Z=["bool","byte","char","decimal","delegate","double","dynamic","enum","float","int","long","nint","nuint","object","sbyte","short","string","ulong","uint","ushort"],J=["public","private","protected","static","internal","protected","abstract","async","extern","override","unsafe","virtual","new","sealed","partial"],H=["default","false","null","true"],B=["abstract","as","base","break","case","catch","class","const","continue","do","else","event","explicit","extern","finally","fixed","for","foreach","goto","if","implicit","in","interface","internal","is","lock","namespace","new","operator","out","override","params","private","protected","public","readonly","record","ref","return","scoped","sealed","sizeof","stackalloc","static","struct","switch","this","throw","try","typeof","unchecked","unsafe","using","virtual","void","volatile","while"],Q=["add","alias","and","ascending","args","async","await","by","descending","dynamic","equals","file","from","get","global","group","init","into","join","let","nameof","not","notnull","on","or","orderby","partial","record","remove","required","scoped","select","set","unmanaged","value|0","var","when","where","with","yield"],X={keyword:B.concat(Q),built_in:Z,literal:H},z=$.inherit($.TITLE_MODE,{begin:"[a-zA-Z](\\.?\\w)*"}),G={className:"number",variants:[{begin:"\\b(0b[01']+)"},{begin:"(-?)\\b([\\d']+(\\.[\\d']*)?|\\.[\\d']+)(u|U|l|L|ul|UL|f|F|b|B)"},{begin:"(-?)(\\b0[xX][a-fA-F0-9']+|(\\b[\\d']+(\\.[\\d']*)?|\\.[\\d']+)([eE][-+]?[\\d']+)?)"}],relevance:0},U={className:"string",begin:/"""("*)(?!")(.|\n)*?"""\1/,relevance:1},Y={className:"string",begin:'@"',end:'"',contains:[{begin:'""'}]},K=$.inherit(Y,{illegal:/\n/}),F={className:"subst",begin:/\{/,end:/\}/,keywords:X},W=$.inherit(F,{illegal:/\n/}),q={className:"string",begin:/\$"/,end:'"',illegal:/\n/,contains:[{begin:/\{\{/},{begin:/\}\}/},$.BACKSLASH_ESCAPE,W]},N={className:"string",begin:/\$@"/,end:'"',contains:[{begin:/\{\{/},{begin:/\}\}/},{begin:'""'},F]},D=$.inherit(N,{illegal:/\n/,contains:[{begin:/\{\{/},{begin:/\}\}/},{begin:'""'},W]});F.contains=[N,q,Y,$.APOS_STRING_MODE,$.QUOTE_STRING_MODE,G,$.C_BLOCK_COMMENT_MODE],W.contains=[D,q,K,$.APOS_STRING_MODE,$.QUOTE_STRING_MODE,G,$.inherit($.C_BLOCK_COMMENT_MODE,{illegal:/\n/})];let A={variants:[U,N,q,Y,$.APOS_STRING_MODE,$.QUOTE_STRING_MODE]},V={begin:"<",end:">",contains:[{beginKeywords:"in out"},z]},L=$.IDENT_RE+"(<"+$.IDENT_RE+"(\\s*,\\s*"+$.IDENT_RE+")*>)?(\\[\\])?",O={begin:"@"+$.IDENT_RE,relevance:0};return{name:"C#",aliases:["cs","c#"],keywords:X,illegal:/::/,contains:[$.COMMENT("///","$",{returnBegin:!0,contains:[{className:"doctag",variants:[{begin:"///",relevance:0},{begin:"<!--|-->"},{begin:"</?",end:">"}]}]}),$.C_LINE_COMMENT_MODE,$.C_BLOCK_COMMENT_MODE,{className:"meta",begin:"#",end:"$",keywords:{keyword:"if else elif endif define undef warning error line region endregion pragma checksum"}},A,G,{beginKeywords:"class interface",relevance:0,end:/[{;=]/,illegal:/[^\s:,]/,contains:[{beginKeywords:"where class"},z,V,$.C_LINE_COMMENT_MODE,$.C_BLOCK_COMMENT_MODE]},{beginKeywords:"namespace",relevance:0,end:/[{;=]/,illegal:/[^\s:]/,contains:[z,$.C_LINE_COMMENT_MODE,$.C_BLOCK_COMMENT_MODE]},{beginKeywords:"record",relevance:0,end:/[{;=]/,illegal:/[^\s:]/,contains:[z,V,$.C_LINE_COMMENT_MODE,$.C_BLOCK_COMMENT_MODE]},{className:"meta",begin:"^\\s*\\[(?=[\\w])",excludeBegin:!0,end:"\\]",excludeEnd:!0,contains:[{className:"string",begin:/"/,end:/"/}]},{beginKeywords:"new return throw await else",relevance:0},{className:"function",begin:"("+L+"\\s+)+"+$.IDENT_RE+"\\s*(<[^=]+>\\s*)?\\(",returnBegin:!0,end:/\s*[{;=]/,excludeEnd:!0,keywords:X,contains:[{beginKeywords:J.join(" "),relevance:0},{begin:$.IDENT_RE+"\\s*(<[^=]+>\\s*)?\\(",returnBegin:!0,contains:[$.TITLE_MODE,V],relevance:0},{match:/\(\)/},{className:"params",begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:X,relevance:0,contains:[A,G,$.C_BLOCK_COMMENT_MODE]},$.C_LINE_COMMENT_MODE,$.C_BLOCK_COMMENT_MODE]},O]}}var IH0=($)=>{return{IMPORTANT:{scope:"meta",begin:"!important"},BLOCK_COMMENT:$.C_BLOCK_COMMENT_MODE,HEXCOLOR:{scope:"number",begin:/#(([0-9a-fA-F]{3,4})|(([0-9a-fA-F]{2}){3,4}))\b/},FUNCTION_DISPATCH:{className:"built_in",begin:/[\w-]+(?=\()/},ATTRIBUTE_SELECTOR_MODE:{scope:"selector-attr",begin:/\[/,end:/\]/,illegal:"$",contains:[$.APOS_STRING_MODE,$.QUOTE_STRING_MODE]},CSS_NUMBER_MODE:{scope:"number",begin:$.NUMBER_RE+"(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?",relevance:0},CSS_VARIABLE:{className:"attr",begin:/--[A-Za-z_][A-Za-z0-9_-]*/}}},kH0=["a","abbr","address","article","aside","audio","b","blockquote","body","button","canvas","caption","cite","code","dd","del","details","dfn","div","dl","dt","em","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","html","i","iframe","img","input","ins","kbd","label","legend","li","main","mark","menu","nav","object","ol","optgroup","option","p","picture","q","quote","samp","section","select","source","span","strong","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","ul","var","video"],yH0=["defs","g","marker","mask","pattern","svg","switch","symbol","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feFlood","feGaussianBlur","feImage","feMerge","feMorphology","feOffset","feSpecularLighting","feTile","feTurbulence","linearGradient","radialGradient","stop","circle","ellipse","image","line","path","polygon","polyline","rect","text","use","textPath","tspan","foreignObject","clipPath"],xH0=[...kH0,...yH0],hH0=["any-hover","any-pointer","aspect-ratio","color","color-gamut","color-index","device-aspect-ratio","device-height","device-width","display-mode","forced-colors","grid","height","hover","inverted-colors","monochrome","orientation","overflow-block","overflow-inline","pointer","prefers-color-scheme","prefers-contrast","prefers-reduced-motion","prefers-reduced-transparency","resolution","scan","scripting","update","width","min-width","max-width","min-height","max-height"].sort().reverse(),vH0=["active","any-link","blank","checked","current","default","defined","dir","disabled","drop","empty","enabled","first","first-child","first-of-type","fullscreen","future","focus","focus-visible","focus-within","has","host","host-context","hover","indeterminate","in-range","invalid","is","lang","last-child","last-of-type","left","link","local-link","not","nth-child","nth-col","nth-last-child","nth-last-col","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","past","placeholder-shown","read-only","read-write","required","right","root","scope","target","target-within","user-invalid","valid","visited","where"].sort().reverse(),fH0=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),gH0=["accent-color","align-content","align-items","align-self","alignment-baseline","all","anchor-name","animation","animation-composition","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-range","animation-range-end","animation-range-start","animation-timeline","animation-timing-function","appearance","aspect-ratio","backdrop-filter","backface-visibility","background","background-attachment","background-blend-mode","background-clip","background-color","background-image","background-origin","background-position","background-position-x","background-position-y","background-repeat","background-size","baseline-shift","block-size","border","border-block","border-block-color","border-block-end","border-block-end-color","border-block-end-style","border-block-end-width","border-block-start","border-block-start-color","border-block-start-style","border-block-start-width","border-block-style","border-block-width","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-end-end-radius","border-end-start-radius","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-inline","border-inline-color","border-inline-end","border-inline-end-color","border-inline-end-style","border-inline-end-width","border-inline-start","border-inline-start-color","border-inline-start-style","border-inline-start-width","border-inline-style","border-inline-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-start-end-radius","border-start-start-radius","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-align","box-decoration-break","box-direction","box-flex","box-flex-group","box-lines","box-ordinal-group","box-orient","box-pack","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","caret-color","clear","clip","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","color-scheme","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","contain","contain-intrinsic-block-size","contain-intrinsic-height","contain-intrinsic-inline-size","contain-intrinsic-size","contain-intrinsic-width","container","container-name","container-type","content","content-visibility","counter-increment","counter-reset","counter-set","cue","cue-after","cue-before","cursor","cx","cy","direction","display","dominant-baseline","empty-cells","enable-background","field-sizing","fill","fill-opacity","fill-rule","filter","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","flood-color","flood-opacity","flow","font","font-display","font-family","font-feature-settings","font-kerning","font-language-override","font-optical-sizing","font-palette","font-size","font-size-adjust","font-smooth","font-smoothing","font-stretch","font-style","font-synthesis","font-synthesis-position","font-synthesis-small-caps","font-synthesis-style","font-synthesis-weight","font-variant","font-variant-alternates","font-variant-caps","font-variant-east-asian","font-variant-emoji","font-variant-ligatures","font-variant-numeric","font-variant-position","font-variation-settings","font-weight","forced-color-adjust","gap","glyph-orientation-horizontal","glyph-orientation-vertical","grid","grid-area","grid-auto-columns","grid-auto-flow","grid-auto-rows","grid-column","grid-column-end","grid-column-start","grid-gap","grid-row","grid-row-end","grid-row-start","grid-template","grid-template-areas","grid-template-columns","grid-template-rows","hanging-punctuation","height","hyphenate-character","hyphenate-limit-chars","hyphens","icon","image-orientation","image-rendering","image-resolution","ime-mode","initial-letter","initial-letter-align","inline-size","inset","inset-area","inset-block","inset-block-end","inset-block-start","inset-inline","inset-inline-end","inset-inline-start","isolation","justify-content","justify-items","justify-self","kerning","left","letter-spacing","lighting-color","line-break","line-height","line-height-step","list-style","list-style-image","list-style-position","list-style-type","margin","margin-block","margin-block-end","margin-block-start","margin-bottom","margin-inline","margin-inline-end","margin-inline-start","margin-left","margin-right","margin-top","margin-trim","marker","marker-end","marker-mid","marker-start","marks","mask","mask-border","mask-border-mode","mask-border-outset","mask-border-repeat","mask-border-slice","mask-border-source","mask-border-width","mask-clip","mask-composite","mask-image","mask-mode","mask-origin","mask-position","mask-repeat","mask-size","mask-type","masonry-auto-flow","math-depth","math-shift","math-style","max-block-size","max-height","max-inline-size","max-width","min-block-size","min-height","min-inline-size","min-width","mix-blend-mode","nav-down","nav-index","nav-left","nav-right","nav-up","none","normal","object-fit","object-position","offset","offset-anchor","offset-distance","offset-path","offset-position","offset-rotate","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-anchor","overflow-block","overflow-clip-margin","overflow-inline","overflow-wrap","overflow-x","overflow-y","overlay","overscroll-behavior","overscroll-behavior-block","overscroll-behavior-inline","overscroll-behavior-x","overscroll-behavior-y","padding","padding-block","padding-block-end","padding-block-start","padding-bottom","padding-inline","padding-inline-end","padding-inline-start","padding-left","padding-right","padding-top","page","page-break-after","page-break-before","page-break-inside","paint-order","pause","pause-after","pause-before","perspective","perspective-origin","place-content","place-items","place-self","pointer-events","position","position-anchor","position-visibility","print-color-adjust","quotes","r","resize","rest","rest-after","rest-before","right","rotate","row-gap","ruby-align","ruby-position","scale","scroll-behavior","scroll-margin","scroll-margin-block","scroll-margin-block-end","scroll-margin-block-start","scroll-margin-bottom","scroll-margin-inline","scroll-margin-inline-end","scroll-margin-inline-start","scroll-margin-left","scroll-margin-right","scroll-margin-top","scroll-padding","scroll-padding-block","scroll-padding-block-end","scroll-padding-block-start","scroll-padding-bottom","scroll-padding-inline","scroll-padding-inline-end","scroll-padding-inline-start","scroll-padding-left","scroll-padding-right","scroll-padding-top","scroll-snap-align","scroll-snap-stop","scroll-snap-type","scroll-timeline","scroll-timeline-axis","scroll-timeline-name","scrollbar-color","scrollbar-gutter","scrollbar-width","shape-image-threshold","shape-margin","shape-outside","shape-rendering","speak","speak-as","src","stop-color","stop-opacity","stroke","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","tab-size","table-layout","text-align","text-align-all","text-align-last","text-anchor","text-combine-upright","text-decoration","text-decoration-color","text-decoration-line","text-decoration-skip","text-decoration-skip-ink","text-decoration-style","text-decoration-thickness","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-indent","text-justify","text-orientation","text-overflow","text-rendering","text-shadow","text-size-adjust","text-transform","text-underline-offset","text-underline-position","text-wrap","text-wrap-mode","text-wrap-style","timeline-scope","top","touch-action","transform","transform-box","transform-origin","transform-style","transition","transition-behavior","transition-delay","transition-duration","transition-property","transition-timing-function","translate","unicode-bidi","user-modify","user-select","vector-effect","vertical-align","view-timeline","view-timeline-axis","view-timeline-inset","view-timeline-name","view-transition-name","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","white-space","white-space-collapse","widows","width","will-change","word-break","word-spacing","word-wrap","writing-mode","x","y","z-index","zoom"].sort().reverse();function jp($){let Z=$.regex,J=IH0($),H={begin:/-(webkit|moz|ms|o)-(?=[a-z])/},B="and or not only",Q=/@-?\w[\w]*(-\w+)*/,X="[a-zA-Z-][a-zA-Z0-9_-]*",z=[$.APOS_STRING_MODE,$.QUOTE_STRING_MODE];return{name:"CSS",case_insensitive:!0,illegal:/[=|'\$]/,keywords:{keyframePosition:"from to"},classNameAliases:{keyframePosition:"selector-tag"},contains:[J.BLOCK_COMMENT,H,J.CSS_NUMBER_MODE,{className:"selector-id",begin:/#[A-Za-z0-9_-]+/,relevance:0},{className:"selector-class",begin:"\\.[a-zA-Z-][a-zA-Z0-9_-]*",relevance:0},J.ATTRIBUTE_SELECTOR_MODE,{className:"selector-pseudo",variants:[{begin:":("+vH0.join("|")+")"},{begin:":(:)?("+fH0.join("|")+")"}]},J.CSS_VARIABLE,{className:"attribute",begin:"\\b("+gH0.join("|")+")\\b"},{begin:/:/,end:/[;}{]/,contains:[J.BLOCK_COMMENT,J.HEXCOLOR,J.IMPORTANT,J.CSS_NUMBER_MODE,...z,{begin:/(url|data-uri)\(/,end:/\)/,relevance:0,keywords:{built_in:"url data-uri"},contains:[...z,{className:"string",begin:/[^)]/,endsWithParent:!0,excludeEnd:!0}]},J.FUNCTION_DISPATCH]},{begin:Z.lookahead(/@/),end:"[{;]",relevance:0,illegal:/:/,contains:[{className:"keyword",begin:Q},{begin:/\s/,endsWithParent:!0,excludeEnd:!0,relevance:0,keywords:{$pattern:/[a-z-]+/,keyword:"and or not only",attribute:hH0.join(" ")},contains:[{begin:/[a-z-]+(?=:)/,className:"attribute"},...z,J.CSS_NUMBER_MODE]}]},{className:"selector-tag",begin:"\\b("+xH0.join("|")+")\\b"}]}}function Tp($){let Z=$.regex;return{name:"Diff",aliases:["patch"],contains:[{className:"meta",relevance:10,match:Z.either(/^@@ +-\d+,\d+ +\+\d+,\d+ +@@/,/^\*\*\* +\d+,\d+ +\*\*\*\*$/,/^--- +\d+,\d+ +----$/)},{className:"comment",variants:[{begin:Z.either(/Index: /,/^index/,/={3,}/,/^-{3}/,/^\*{3} /,/^\+{3}/,/^diff --git/),end:/$/},{match:/^\*{15}$/}]},{className:"addition",begin:/^\+/,end:/$/},{className:"deletion",begin:/^-/,end:/$/},{className:"addition",begin:/^!/,end:/$/}]}}function Cp($){let Q={keyword:["break","case","chan","const","continue","default","defer","else","fallthrough","for","func","go","goto","if","import","interface","map","package","range","return","select","struct","switch","type","var"],type:["bool","byte","complex64","complex128","error","float32","float64","int8","int16","int32","int64","string","uint8","uint16","uint32","uint64","int","uint","uintptr","rune"],literal:["true","false","iota","nil"],built_in:["append","cap","close","complex","copy","imag","len","make","new","panic","print","println","real","recover","delete"]};return{name:"Go",aliases:["golang"],keywords:Q,illegal:"</",contains:[$.C_LINE_COMMENT_MODE,$.C_BLOCK_COMMENT_MODE,{className:"string",variants:[$.QUOTE_STRING_MODE,$.APOS_STRING_MODE,{begin:"`",end:"`"}]},{className:"number",variants:[{match:/-?\b0[xX]\.[a-fA-F0-9](_?[a-fA-F0-9])*[pP][+-]?\d(_?\d)*i?/,relevance:0},{match:/-?\b0[xX](_?[a-fA-F0-9])+((\.([a-fA-F0-9](_?[a-fA-F0-9])*)?)?[pP][+-]?\d(_?\d)*)?i?/,relevance:0},{match:/-?\b0[oO](_?[0-7])*i?/,relevance:0},{match:/-?\.\d(_?\d)*([eE][+-]?\d(_?\d)*)?i?/,relevance:0},{match:/-?\b\d(_?\d)*(\.(\d(_?\d)*)?)?([eE][+-]?\d(_?\d)*)?i?/,relevance:0}]},{begin:/:=/},{className:"function",beginKeywords:"func",end:"\\s*(\\{|$)",excludeEnd:!0,contains:[$.TITLE_MODE,{className:"params",begin:/\(/,end:/\)/,endsParent:!0,keywords:Q,illegal:/["']/}]}]}}function Ep($){let Z=$.regex,J=/[_A-Za-z][_0-9A-Za-z]*/;return{name:"GraphQL",aliases:["gql"],case_insensitive:!0,disableAutodetect:!1,keywords:{keyword:["query","mutation","subscription","type","input","schema","directive","interface","union","scalar","fragment","enum","on"],literal:["true","false","null"]},contains:[$.HASH_COMMENT_MODE,$.QUOTE_STRING_MODE,$.NUMBER_MODE,{scope:"punctuation",match:/[.]{3}/,relevance:0},{scope:"punctuation",begin:/[\!\(\)\:\=\[\]\{\|\}]{1}/,relevance:0},{scope:"variable",begin:/\$/,end:/\W/,excludeEnd:!0,relevance:0},{scope:"meta",match:/@\w+/,excludeEnd:!0},{scope:"symbol",begin:Z.concat(J,Z.lookahead(/\s*:/)),relevance:0}],illegal:[/[;<']/,/BEGIN/]}}function bp($){let Z=$.regex,J={className:"number",relevance:0,variants:[{begin:/([+-]+)?[\d]+_[\d_]+/},{begin:$.NUMBER_RE}]},H=$.COMMENT();H.variants=[{begin:/;/,end:/$/},{begin:/#/,end:/$/}];let B={className:"variable",variants:[{begin:/\$[\w\d"][\w\d_]*/},{begin:/\$\{(.*?)\}/}]},Q={className:"literal",begin:/\bon|off|true|false|yes|no\b/},X={className:"string",contains:[$.BACKSLASH_ESCAPE],variants:[{begin:"'''",end:"'''",relevance:10},{begin:'"""',end:'"""',relevance:10},{begin:'"',end:'"'},{begin:"'",end:"'"}]},z={begin:/\[/,end:/\]/,contains:[H,Q,B,X,J,"self"],relevance:0},G=/[A-Za-z0-9_-]+/,U=/"(\\"|[^"])*"/,Y=/'[^']*'/,K=Z.either(G,U,Y),F=Z.concat(K,"(\\s*\\.\\s*",K,")*",Z.lookahead(/\s*=\s*[^#\s]/));return{name:"TOML, also INI",aliases:["toml"],case_insensitive:!0,illegal:/\S/,contains:[H,{className:"section",begin:/\[+/,end:/\]+/},{begin:F,className:"attr",starts:{end:/$/,contains:[H,z,Q,B,X,J]}}]}}var MH="[0-9](_*[0-9])*",SW=`\\.(${MH})`,RW="[0-9a-fA-F](_*[0-9a-fA-F])*",wp={className:"number",variants:[{begin:`(\\b(${MH})((${SW})|\\.)?|(${SW}))[eE][+-]?(${MH})[fFdD]?\\b`},{begin:`\\b(${MH})((${SW})[fFdD]?\\b|\\.([fFdD]\\b)?)`},{begin:`(${SW})[fFdD]?\\b`},{begin:`\\b(${MH})[fFdD]\\b`},{begin:`\\b0[xX]((${RW})\\.?|(${RW})?\\.(${RW}))[pP][+-]?(${MH})[fFdD]?\\b`},{begin:"\\b(0|[1-9](_*[0-9])*)[lL]?\\b"},{begin:`\\b0[xX](${RW})[lL]?\\b`},{begin:"\\b0(_*[0-7])*[lL]?\\b"},{begin:"\\b0[bB][01](_*[01])*[lL]?\\b"}],relevance:0};function Sp($,Z,J){if(J===-1)return"";return $.replace(Z,(H)=>{return Sp($,Z,J-1)})}function Rp($){let Z=$.regex,J="[À-ʸa-zA-Z_$][À-ʸa-zA-Z_$0-9]*",H="[À-ʸa-zA-Z_$][À-ʸa-zA-Z_$0-9]*"+Sp("(?:<"+"[À-ʸa-zA-Z_$][À-ʸa-zA-Z_$0-9]*"+"~~~(?:\\s*,\\s*"+"[À-ʸa-zA-Z_$][À-ʸa-zA-Z_$0-9]*"+"~~~)*>)?",/~~~/g,2),G={keyword:["synchronized","abstract","private","var","static","if","const ","for","while","strictfp","finally","protected","import","native","final","void","enum","else","break","transient","catch","instanceof","volatile","case","assert","package","default","public","try","switch","continue","throws","protected","public","private","module","requires","exports","do","sealed","yield","permits","goto","when"],literal:["false","true","null"],type:["char","boolean","long","float","int","byte","short","double"],built_in:["super","this"]},U={className:"meta",begin:"@"+"[À-ʸa-zA-Z_$][À-ʸa-zA-Z_$0-9]*",contains:[{begin:/\(/,end:/\)/,contains:["self"]}]},Y={className:"params",begin:/\(/,end:/\)/,keywords:G,relevance:0,contains:[$.C_BLOCK_COMMENT_MODE],endsParent:!0};return{name:"Java",aliases:["jsp"],keywords:G,illegal:/<\/|#/,contains:[$.COMMENT("/\\*\\*","\\*/",{relevance:0,contains:[{begin:/\w+@/,relevance:0},{className:"doctag",begin:"@[A-Za-z]+"}]}),{begin:/import java\.[a-z]+\./,keywords:"import",relevance:2},$.C_LINE_COMMENT_MODE,$.C_BLOCK_COMMENT_MODE,{begin:/"""/,end:/"""/,className:"string",contains:[$.BACKSLASH_ESCAPE]},$.APOS_STRING_MODE,$.QUOTE_STRING_MODE,{match:[/\b(?:class|interface|enum|extends|implements|new)/,/\s+/,"[À-ʸa-zA-Z_$][À-ʸa-zA-Z_$0-9]*"],className:{1:"keyword",3:"title.class"}},{match:/non-sealed/,scope:"keyword"},{begin:[Z.concat(/(?!else)/,"[À-ʸa-zA-Z_$][À-ʸa-zA-Z_$0-9]*"),/\s+/,"[À-ʸa-zA-Z_$][À-ʸa-zA-Z_$0-9]*",/\s+/,/=(?!=)/],className:{1:"type",3:"variable",5:"operator"}},{begin:[/record/,/\s+/,"[À-ʸa-zA-Z_$][À-ʸa-zA-Z_$0-9]*"],className:{1:"keyword",3:"title.class"},contains:[Y,$.C_LINE_COMMENT_MODE,$.C_BLOCK_COMMENT_MODE]},{beginKeywords:"new throw return else",relevance:0},{begin:["(?:"+H+"\\s+)",$.UNDERSCORE_IDENT_RE,/\s*(?=\()/],className:{2:"title.function"},keywords:G,contains:[{className:"params",begin:/\(/,end:/\)/,keywords:G,relevance:0,contains:[U,$.APOS_STRING_MODE,$.QUOTE_STRING_MODE,wp,$.C_BLOCK_COMMENT_MODE]},$.C_LINE_COMMENT_MODE,$.C_BLOCK_COMMENT_MODE]},wp,U]}}var mH0=["as","in","of","if","for","while","finally","var","new","function","do","return","void","else","break","catch","instanceof","with","throw","case","default","try","switch","continue","typeof","delete","let","yield","const","class","debugger","async","await","static","import","from","export","extends","using"],uH0=["true","false","null","undefined","NaN","Infinity"],Ip=["Object","Function","Boolean","Symbol","Math","Date","Number","BigInt","String","RegExp","Array","Float32Array","Float64Array","Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Int32Array","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array","Set","Map","WeakSet","WeakMap","ArrayBuffer","SharedArrayBuffer","Atomics","DataView","JSON","Promise","Generator","GeneratorFunction","AsyncFunction","Reflect","Proxy","Intl","WebAssembly"],kp=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],yp=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],pH0=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],cH0=[].concat(yp,Ip,kp);function xp($){let Z=$.regex,J=(v,{after:f})=>{let b="</"+v[0].slice(1);return v.input.indexOf(b,f)!==-1},H="[A-Za-z$_][0-9A-Za-z$_]*",B={begin:"<>",end:"</>"},Q=/<[A-Za-z0-9\\._:-]+\s*\/>/,X={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(v,f)=>{let b=v[0].length+v.index,l=v.input[b];if(l==="<"||l===","){f.ignoreMatch();return}if(l===">"){if(!J(v,{after:b}))f.ignoreMatch()}let r,h=v.input.substring(b);if(r=h.match(/^\s*=/)){f.ignoreMatch();return}if(r=h.match(/^\s+extends\s+/)){if(r.index===0){f.ignoreMatch();return}}}},z={$pattern:"[A-Za-z$_][0-9A-Za-z$_]*",keyword:mH0,literal:uH0,built_in:cH0,"variable.language":pH0},G="[0-9](_?[0-9])*",U="\\.([0-9](_?[0-9])*)",Y="0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*",K={className:"number",variants:[{begin:"(\\b(0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*)((\\.([0-9](_?[0-9])*))|\\.)?|(\\.([0-9](_?[0-9])*)))[eE][+-]?([0-9](_?[0-9])*)\\b"},{begin:"\\b(0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*)\\b((\\.([0-9](_?[0-9])*))\\b|\\.)?|(\\.([0-9](_?[0-9])*))\\b"},{begin:"\\b(0|[1-9](_?[0-9])*)n\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*n?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*n?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*n?\\b"},{begin:"\\b0[0-7]+n?\\b"}],relevance:0},F={className:"subst",begin:"\\$\\{",end:"\\}",keywords:z,contains:[]},W={begin:".?html`",end:"",starts:{end:"`",returnEnd:!1,contains:[$.BACKSLASH_ESCAPE,F],subLanguage:"xml"}},q={begin:".?css`",end:"",starts:{end:"`",returnEnd:!1,contains:[$.BACKSLASH_ESCAPE,F],subLanguage:"css"}},N={begin:".?gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[$.BACKSLASH_ESCAPE,F],subLanguage:"graphql"}},D={className:"string",begin:"`",end:"`",contains:[$.BACKSLASH_ESCAPE,F]},V={className:"comment",variants:[$.COMMENT(/\/\*\*(?!\/)/,"\\*/",{relevance:0,contains:[{begin:"(?=@[A-Za-z]+)",relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"},{className:"type",begin:"\\{",end:"\\}",excludeEnd:!0,excludeBegin:!0,relevance:0},{className:"variable",begin:"[A-Za-z$_][0-9A-Za-z$_]*(?=\\s*(-)|$)",endsParent:!0,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}]}),$.C_BLOCK_COMMENT_MODE,$.C_LINE_COMMENT_MODE]},L=[$.APOS_STRING_MODE,$.QUOTE_STRING_MODE,W,q,N,D,{match:/\$\d+/},K];F.contains=L.concat({begin:/\{/,end:/\}/,keywords:z,contains:["self"].concat(L)});let O=[].concat(V,F.contains),M=O.concat([{begin:/(\s*)\(/,end:/\)/,keywords:z,contains:["self"].concat(O)}]),_={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:z,contains:M},w={variants:[{match:[/class/,/\s+/,"[A-Za-z$_][0-9A-Za-z$_]*",/\s+/,/extends/,/\s+/,Z.concat("[A-Za-z$_][0-9A-Za-z$_]*","(",Z.concat(/\./,"[A-Za-z$_][0-9A-Za-z$_]*"),")*")],scope:{1:"keyword",3:"title.class",5:"keyword",7:"title.class.inherited"}},{match:[/class/,/\s+/,"[A-Za-z$_][0-9A-Za-z$_]*"],scope:{1:"keyword",3:"title.class"}}]},C={relevance:0,match:Z.either(/\bJSON/,/\b[A-Z][a-z]+([A-Z][a-z]*|\d)*/,/\b[A-Z]{2,}([A-Z][a-z]+|\d)+([A-Z][a-z]*)*/,/\b[A-Z]{2,}[a-z]+([A-Z][a-z]+|\d)*([A-Z][a-z]*)*/),className:"title.class",keywords:{_:[...Ip,...kp]}},E={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},j={variants:[{match:[/function/,/\s+/,"[A-Za-z$_][0-9A-Za-z$_]*",/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[_],illegal:/%/},k={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function S(v){return Z.concat("(?!",v.join("|"),")")}let I={match:Z.concat(/\b/,S([...yp,"super","import"].map((v)=>`${v}\\s*\\(`)),"[A-Za-z$_][0-9A-Za-z$_]*",Z.lookahead(/\s*\(/)),className:"title.function",relevance:0},T={begin:Z.concat(/\./,Z.lookahead(Z.concat("[A-Za-z$_][0-9A-Za-z$_]*",/(?![0-9A-Za-z$_(])/))),end:"[A-Za-z$_][0-9A-Za-z$_]*",excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},y={match:[/get|set/,/\s+/,"[A-Za-z$_][0-9A-Za-z$_]*",/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},_]},R="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+$.UNDERSCORE_IDENT_RE+")\\s*=>",x={match:[/const|var|let/,/\s+/,"[A-Za-z$_][0-9A-Za-z$_]*",/\s*/,/=\s*/,/(async\s*)?/,Z.lookahead(R)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[_]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:z,exports:{PARAMS_CONTAINS:M,CLASS_REFERENCE:C},illegal:/#(?![$_A-z])/,contains:[$.SHEBANG({label:"shebang",binary:"node",relevance:5}),E,$.APOS_STRING_MODE,$.QUOTE_STRING_MODE,W,q,N,D,V,{match:/\$\d+/},K,C,{scope:"attr",match:"[A-Za-z$_][0-9A-Za-z$_]*"+Z.lookahead(":"),relevance:0},x,{begin:"("+$.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[V,$.REGEXP_MODE,{className:"function",begin:R,returnBegin:!0,end:"\\s*=>",contains:[{className:"params",variants:[{begin:$.UNDERSCORE_IDENT_RE,relevance:0},{className:null,begin:/\(\s*\)/,skip:!0},{begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:z,contains:M}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:B.begin,end:B.end},{match:Q},{begin:X.begin,"on:begin":X.isTrulyOpeningTag,end:X.end}],subLanguage:"xml",contains:[{begin:X.begin,end:X.end,skip:!0,contains:["self"]}]}]},j,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+$.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[_,$.inherit($.TITLE_MODE,{begin:"[A-Za-z$_][0-9A-Za-z$_]*",className:"title.function"})]},{match:/\.\.\./,relevance:0},T,{match:"\\$[A-Za-z$_][0-9A-Za-z$_]*",relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[_]},I,k,w,y,{match:/\$[(.]/}]}}function hp($){let Z={className:"attr",begin:/"(\\.|[^\\"\r\n])*"(?=\s*:)/,relevance:1.01},J={match:/[{}[\],:]/,className:"punctuation",relevance:0},H=["true","false","null"],B={scope:"literal",beginKeywords:H.join(" ")};return{name:"JSON",aliases:["jsonc"],keywords:{literal:H},contains:[Z,J,$.QUOTE_STRING_MODE,B,$.C_NUMBER_MODE,$.C_LINE_COMMENT_MODE,$.C_BLOCK_COMMENT_MODE],illegal:"\\S"}}var PH="[0-9](_*[0-9])*",IW=`\\.(${PH})`,kW="[0-9a-fA-F](_*[0-9a-fA-F])*",dH0={className:"number",variants:[{begin:`(\\b(${PH})((${IW})|\\.)?|(${IW}))[eE][+-]?(${PH})[fFdD]?\\b`},{begin:`\\b(${PH})((${IW})[fFdD]?\\b|\\.([fFdD]\\b)?)`},{begin:`(${IW})[fFdD]?\\b`},{begin:`\\b(${PH})[fFdD]\\b`},{begin:`\\b0[xX]((${kW})\\.?|(${kW})?\\.(${kW}))[pP][+-]?(${PH})[fFdD]?\\b`},{begin:"\\b(0|[1-9](_*[0-9])*)[lL]?\\b"},{begin:`\\b0[xX](${kW})[lL]?\\b`},{begin:"\\b0(_*[0-7])*[lL]?\\b"},{begin:"\\b0[bB][01](_*[01])*[lL]?\\b"}],relevance:0};function vp($){let Z={keyword:"abstract as val var vararg get set class object open private protected public noinline crossinline dynamic final enum if else do while for when throw try catch finally import package is in fun override companion reified inline lateinit init interface annotation data sealed internal infix operator out by constructor super tailrec where const inner suspend typealias external expect actual",built_in:"Byte Short Char Int Long Boolean Float Double Void Unit Nothing",literal:"true false null"},J={className:"keyword",begin:/\b(break|continue|return|this)\b/,starts:{contains:[{className:"symbol",begin:/@\w+/}]}},H={className:"symbol",begin:$.UNDERSCORE_IDENT_RE+"@"},B={className:"subst",begin:/\$\{/,end:/\}/,contains:[$.C_NUMBER_MODE]},Q={className:"variable",begin:"\\$"+$.UNDERSCORE_IDENT_RE},X={className:"string",variants:[{begin:'"""',end:'"""(?=[^"])',contains:[Q,B]},{begin:"'",end:"'",illegal:/\n/,contains:[$.BACKSLASH_ESCAPE]},{begin:'"',end:'"',illegal:/\n/,contains:[$.BACKSLASH_ESCAPE,Q,B]}]};B.contains.push(X);let z={className:"meta",begin:"@(?:file|property|field|get|set|receiver|param|setparam|delegate)\\s*:(?:\\s*"+$.UNDERSCORE_IDENT_RE+")?"},G={className:"meta",begin:"@"+$.UNDERSCORE_IDENT_RE,contains:[{begin:/\(/,end:/\)/,contains:[$.inherit(X,{className:"string"}),"self"]}]},U=dH0,Y=$.COMMENT("/\\*","\\*/",{contains:[$.C_BLOCK_COMMENT_MODE]}),K={variants:[{className:"type",begin:$.UNDERSCORE_IDENT_RE},{begin:/\(/,end:/\)/,contains:[]}]},F=K;return F.variants[1].contains=[K],K.variants[1].contains=[F],{name:"Kotlin",aliases:["kt","kts"],keywords:Z,contains:[$.COMMENT("/\\*\\*","\\*/",{relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"}]}),$.C_LINE_COMMENT_MODE,Y,J,H,z,G,{className:"function",beginKeywords:"fun",end:"[(]|$",returnBegin:!0,excludeEnd:!0,keywords:Z,relevance:5,contains:[{begin:$.UNDERSCORE_IDENT_RE+"\\s*\\(",returnBegin:!0,relevance:0,contains:[$.UNDERSCORE_TITLE_MODE]},{className:"type",begin:/</,end:/>/,keywords:"reified",relevance:0},{className:"params",begin:/\(/,end:/\)/,endsParent:!0,keywords:Z,relevance:0,contains:[{begin:/:/,end:/[=,\/]/,endsWithParent:!0,contains:[K,$.C_LINE_COMMENT_MODE,Y],relevance:0},$.C_LINE_COMMENT_MODE,Y,z,G,X,$.C_NUMBER_MODE]},Y]},{begin:[/class|interface|trait/,/\s+/,$.UNDERSCORE_IDENT_RE],beginScope:{3:"title.class"},keywords:"class interface trait",end:/[:\{(]|$/,excludeEnd:!0,illegal:"extends implements",contains:[{beginKeywords:"public protected internal private constructor"},$.UNDERSCORE_TITLE_MODE,{className:"type",begin:/</,end:/>/,excludeBegin:!0,excludeEnd:!0,relevance:0},{className:"type",begin:/[,:]\s*/,end:/[<\(,){\s]|$/,excludeBegin:!0,returnEnd:!0},z,G]},X,{className:"meta",begin:"^#!/usr/bin/env",end:"$",illegal:`
34
+ `},U]}}var lH0=($)=>{return{IMPORTANT:{scope:"meta",begin:"!important"},BLOCK_COMMENT:$.C_BLOCK_COMMENT_MODE,HEXCOLOR:{scope:"number",begin:/#(([0-9a-fA-F]{3,4})|(([0-9a-fA-F]{2}){3,4}))\b/},FUNCTION_DISPATCH:{className:"built_in",begin:/[\w-]+(?=\()/},ATTRIBUTE_SELECTOR_MODE:{scope:"selector-attr",begin:/\[/,end:/\]/,illegal:"$",contains:[$.APOS_STRING_MODE,$.QUOTE_STRING_MODE]},CSS_NUMBER_MODE:{scope:"number",begin:$.NUMBER_RE+"(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?",relevance:0},CSS_VARIABLE:{className:"attr",begin:/--[A-Za-z_][A-Za-z0-9_-]*/}}},iH0=["a","abbr","address","article","aside","audio","b","blockquote","body","button","canvas","caption","cite","code","dd","del","details","dfn","div","dl","dt","em","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","html","i","iframe","img","input","ins","kbd","label","legend","li","main","mark","menu","nav","object","ol","optgroup","option","p","picture","q","quote","samp","section","select","source","span","strong","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","ul","var","video"],rH0=["defs","g","marker","mask","pattern","svg","switch","symbol","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feFlood","feGaussianBlur","feImage","feMerge","feMorphology","feOffset","feSpecularLighting","feTile","feTurbulence","linearGradient","radialGradient","stop","circle","ellipse","image","line","path","polygon","polyline","rect","text","use","textPath","tspan","foreignObject","clipPath"],aH0=[...iH0,...rH0],oH0=["any-hover","any-pointer","aspect-ratio","color","color-gamut","color-index","device-aspect-ratio","device-height","device-width","display-mode","forced-colors","grid","height","hover","inverted-colors","monochrome","orientation","overflow-block","overflow-inline","pointer","prefers-color-scheme","prefers-contrast","prefers-reduced-motion","prefers-reduced-transparency","resolution","scan","scripting","update","width","min-width","max-width","min-height","max-height"].sort().reverse(),fp=["active","any-link","blank","checked","current","default","defined","dir","disabled","drop","empty","enabled","first","first-child","first-of-type","fullscreen","future","focus","focus-visible","focus-within","has","host","host-context","hover","indeterminate","in-range","invalid","is","lang","last-child","last-of-type","left","link","local-link","not","nth-child","nth-col","nth-last-child","nth-last-col","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","past","placeholder-shown","read-only","read-write","required","right","root","scope","target","target-within","user-invalid","valid","visited","where"].sort().reverse(),gp=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),nH0=["accent-color","align-content","align-items","align-self","alignment-baseline","all","anchor-name","animation","animation-composition","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-range","animation-range-end","animation-range-start","animation-timeline","animation-timing-function","appearance","aspect-ratio","backdrop-filter","backface-visibility","background","background-attachment","background-blend-mode","background-clip","background-color","background-image","background-origin","background-position","background-position-x","background-position-y","background-repeat","background-size","baseline-shift","block-size","border","border-block","border-block-color","border-block-end","border-block-end-color","border-block-end-style","border-block-end-width","border-block-start","border-block-start-color","border-block-start-style","border-block-start-width","border-block-style","border-block-width","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-end-end-radius","border-end-start-radius","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-inline","border-inline-color","border-inline-end","border-inline-end-color","border-inline-end-style","border-inline-end-width","border-inline-start","border-inline-start-color","border-inline-start-style","border-inline-start-width","border-inline-style","border-inline-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-start-end-radius","border-start-start-radius","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-align","box-decoration-break","box-direction","box-flex","box-flex-group","box-lines","box-ordinal-group","box-orient","box-pack","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","caret-color","clear","clip","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","color-scheme","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","contain","contain-intrinsic-block-size","contain-intrinsic-height","contain-intrinsic-inline-size","contain-intrinsic-size","contain-intrinsic-width","container","container-name","container-type","content","content-visibility","counter-increment","counter-reset","counter-set","cue","cue-after","cue-before","cursor","cx","cy","direction","display","dominant-baseline","empty-cells","enable-background","field-sizing","fill","fill-opacity","fill-rule","filter","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","flood-color","flood-opacity","flow","font","font-display","font-family","font-feature-settings","font-kerning","font-language-override","font-optical-sizing","font-palette","font-size","font-size-adjust","font-smooth","font-smoothing","font-stretch","font-style","font-synthesis","font-synthesis-position","font-synthesis-small-caps","font-synthesis-style","font-synthesis-weight","font-variant","font-variant-alternates","font-variant-caps","font-variant-east-asian","font-variant-emoji","font-variant-ligatures","font-variant-numeric","font-variant-position","font-variation-settings","font-weight","forced-color-adjust","gap","glyph-orientation-horizontal","glyph-orientation-vertical","grid","grid-area","grid-auto-columns","grid-auto-flow","grid-auto-rows","grid-column","grid-column-end","grid-column-start","grid-gap","grid-row","grid-row-end","grid-row-start","grid-template","grid-template-areas","grid-template-columns","grid-template-rows","hanging-punctuation","height","hyphenate-character","hyphenate-limit-chars","hyphens","icon","image-orientation","image-rendering","image-resolution","ime-mode","initial-letter","initial-letter-align","inline-size","inset","inset-area","inset-block","inset-block-end","inset-block-start","inset-inline","inset-inline-end","inset-inline-start","isolation","justify-content","justify-items","justify-self","kerning","left","letter-spacing","lighting-color","line-break","line-height","line-height-step","list-style","list-style-image","list-style-position","list-style-type","margin","margin-block","margin-block-end","margin-block-start","margin-bottom","margin-inline","margin-inline-end","margin-inline-start","margin-left","margin-right","margin-top","margin-trim","marker","marker-end","marker-mid","marker-start","marks","mask","mask-border","mask-border-mode","mask-border-outset","mask-border-repeat","mask-border-slice","mask-border-source","mask-border-width","mask-clip","mask-composite","mask-image","mask-mode","mask-origin","mask-position","mask-repeat","mask-size","mask-type","masonry-auto-flow","math-depth","math-shift","math-style","max-block-size","max-height","max-inline-size","max-width","min-block-size","min-height","min-inline-size","min-width","mix-blend-mode","nav-down","nav-index","nav-left","nav-right","nav-up","none","normal","object-fit","object-position","offset","offset-anchor","offset-distance","offset-path","offset-position","offset-rotate","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-anchor","overflow-block","overflow-clip-margin","overflow-inline","overflow-wrap","overflow-x","overflow-y","overlay","overscroll-behavior","overscroll-behavior-block","overscroll-behavior-inline","overscroll-behavior-x","overscroll-behavior-y","padding","padding-block","padding-block-end","padding-block-start","padding-bottom","padding-inline","padding-inline-end","padding-inline-start","padding-left","padding-right","padding-top","page","page-break-after","page-break-before","page-break-inside","paint-order","pause","pause-after","pause-before","perspective","perspective-origin","place-content","place-items","place-self","pointer-events","position","position-anchor","position-visibility","print-color-adjust","quotes","r","resize","rest","rest-after","rest-before","right","rotate","row-gap","ruby-align","ruby-position","scale","scroll-behavior","scroll-margin","scroll-margin-block","scroll-margin-block-end","scroll-margin-block-start","scroll-margin-bottom","scroll-margin-inline","scroll-margin-inline-end","scroll-margin-inline-start","scroll-margin-left","scroll-margin-right","scroll-margin-top","scroll-padding","scroll-padding-block","scroll-padding-block-end","scroll-padding-block-start","scroll-padding-bottom","scroll-padding-inline","scroll-padding-inline-end","scroll-padding-inline-start","scroll-padding-left","scroll-padding-right","scroll-padding-top","scroll-snap-align","scroll-snap-stop","scroll-snap-type","scroll-timeline","scroll-timeline-axis","scroll-timeline-name","scrollbar-color","scrollbar-gutter","scrollbar-width","shape-image-threshold","shape-margin","shape-outside","shape-rendering","speak","speak-as","src","stop-color","stop-opacity","stroke","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","tab-size","table-layout","text-align","text-align-all","text-align-last","text-anchor","text-combine-upright","text-decoration","text-decoration-color","text-decoration-line","text-decoration-skip","text-decoration-skip-ink","text-decoration-style","text-decoration-thickness","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-indent","text-justify","text-orientation","text-overflow","text-rendering","text-shadow","text-size-adjust","text-transform","text-underline-offset","text-underline-position","text-wrap","text-wrap-mode","text-wrap-style","timeline-scope","top","touch-action","transform","transform-box","transform-origin","transform-style","transition","transition-behavior","transition-delay","transition-duration","transition-property","transition-timing-function","translate","unicode-bidi","user-modify","user-select","vector-effect","vertical-align","view-timeline","view-timeline-axis","view-timeline-inset","view-timeline-name","view-transition-name","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","white-space","white-space-collapse","widows","width","will-change","word-break","word-spacing","word-wrap","writing-mode","x","y","z-index","zoom"].sort().reverse(),sH0=fp.concat(gp).sort().reverse();function mp($){let Z=lH0($),J=sH0,H="and or not only",B="[\\w-]+",Q="([\\w-]+|@\\{[\\w-]+\\})",X=[],z=[],G=function(L){return{className:"string",begin:"~?"+L+".*?"+L}},U=function(L,O,M){return{className:L,begin:O,relevance:M}},Y={$pattern:/[a-z-]+/,keyword:"and or not only",attribute:oH0.join(" ")},K={begin:"\\(",end:"\\)",contains:z,keywords:Y,relevance:0};z.push($.C_LINE_COMMENT_MODE,$.C_BLOCK_COMMENT_MODE,G("'"),G('"'),Z.CSS_NUMBER_MODE,{begin:"(url|data-uri)\\(",starts:{className:"string",end:"[\\)\\n]",excludeEnd:!0}},Z.HEXCOLOR,K,U("variable","@@?[\\w-]+",10),U("variable","@\\{[\\w-]+\\}"),U("built_in","~?`[^`]*?`"),{className:"attribute",begin:"[\\w-]+\\s*:",end:":",returnBegin:!0,excludeEnd:!0},Z.IMPORTANT,{beginKeywords:"and not"},Z.FUNCTION_DISPATCH);let F=z.concat({begin:/\{/,end:/\}/,contains:X}),W={beginKeywords:"when",endsWithParent:!0,contains:[{beginKeywords:"and not"}].concat(z)},q={begin:Q+"\\s*:",returnBegin:!0,end:/[;}]/,relevance:0,contains:[{begin:/-(webkit|moz|ms|o)-/},Z.CSS_VARIABLE,{className:"attribute",begin:"\\b("+nH0.join("|")+")\\b",end:/(?=:)/,starts:{endsWithParent:!0,illegal:"[<=$]",relevance:0,contains:z}}]},N={className:"keyword",begin:"@(import|media|charset|font-face|(-[a-z]+-)?keyframes|supports|document|namespace|page|viewport|host)\\b",starts:{end:"[;{}]",keywords:Y,returnEnd:!0,contains:z,relevance:0}},D={className:"variable",variants:[{begin:"@[\\w-]+\\s*:",relevance:15},{begin:"@[\\w-]+"}],starts:{end:"[;}]",returnEnd:!0,contains:F}},A={variants:[{begin:"[\\.#:&\\[>]",end:"[;{}]"},{begin:Q,end:/\{/}],returnBegin:!0,returnEnd:!0,illegal:`[<='$"]`,relevance:0,contains:[$.C_LINE_COMMENT_MODE,$.C_BLOCK_COMMENT_MODE,W,U("keyword","all\\b"),U("variable","@\\{[\\w-]+\\}"),{begin:"\\b("+aH0.join("|")+")\\b",className:"selector-tag"},Z.CSS_NUMBER_MODE,U("selector-tag",Q,0),U("selector-id","#"+Q),U("selector-class","\\."+Q,0),U("selector-tag","&",0),Z.ATTRIBUTE_SELECTOR_MODE,{className:"selector-pseudo",begin:":("+fp.join("|")+")"},{className:"selector-pseudo",begin:":(:)?("+gp.join("|")+")"},{begin:/\(/,end:/\)/,relevance:0,contains:F},{begin:"!important"},Z.FUNCTION_DISPATCH]},V={begin:`[\\w-]+:(:)?(${J.join("|")})`,returnBegin:!0,contains:[A]};return X.push($.C_LINE_COMMENT_MODE,$.C_BLOCK_COMMENT_MODE,N,D,V,q,A,W,Z.FUNCTION_DISPATCH),{name:"Less",case_insensitive:!0,illegal:`[=>'/<($"]`,contains:X}}function up($){let H={begin:"\\[=*\\[",end:"\\]=*\\]",contains:["self"]},B=[$.COMMENT("--(?!\\[=*\\[)","$"),$.COMMENT("--\\[=*\\[","\\]=*\\]",{contains:[H],relevance:10})];return{name:"Lua",aliases:["pluto"],keywords:{$pattern:$.UNDERSCORE_IDENT_RE,literal:"true false nil",keyword:"and break do else elseif end for goto if in local not or repeat return then until while",built_in:"_G _ENV _VERSION __index __newindex __mode __call __metatable __tostring __len __gc __add __sub __mul __div __mod __pow __concat __unm __eq __lt __le assert collectgarbage dofile error getfenv getmetatable ipairs load loadfile loadstring module next pairs pcall print rawequal rawget rawset require select setfenv setmetatable tonumber tostring type unpack xpcall arg self coroutine resume yield status wrap create running debug getupvalue debug sethook getmetatable gethook setmetatable setlocal traceback setfenv getinfo setupvalue getlocal getregistry getfenv io lines write close flush open output type read stderr stdin input stdout popen tmpfile math log max acos huge ldexp pi cos tanh pow deg tan cosh sinh random randomseed frexp ceil floor rad abs sqrt modf asin min mod fmod log10 atan2 exp sin atan os exit setlocale date getenv difftime remove time clock tmpname rename execute package preload loadlib loaded loaders cpath config path seeall string sub upper len gfind rep find match char dump gmatch reverse byte format gsub lower table setn insert getn foreachi maxn foreach concat sort remove"},contains:B.concat([{className:"function",beginKeywords:"function",end:"\\)",contains:[$.inherit($.TITLE_MODE,{begin:"([_a-zA-Z]\\w*\\.)*([_a-zA-Z]\\w*:)?[_a-zA-Z]\\w*"}),{className:"params",begin:"\\(",endsWithParent:!0,contains:B}].concat(B)},$.C_NUMBER_MODE,$.APOS_STRING_MODE,$.QUOTE_STRING_MODE,{className:"string",begin:"\\[=*\\[",end:"\\]=*\\]",contains:[H],relevance:5}])}}function pp($){let Z={className:"variable",variants:[{begin:"\\$\\("+$.UNDERSCORE_IDENT_RE+"\\)",contains:[$.BACKSLASH_ESCAPE]},{begin:/\$[@%<?\^\+\*]/}]},J={className:"string",begin:/"/,end:/"/,contains:[$.BACKSLASH_ESCAPE,Z]},H={className:"variable",begin:/\$\([\w-]+\s/,end:/\)/,keywords:{built_in:"subst patsubst strip findstring filter filter-out sort word wordlist firstword lastword dir notdir suffix basename addsuffix addprefix join wildcard realpath abspath error warning shell origin flavor foreach if or and call eval file value"},contains:[Z,J]},B={begin:"^"+$.UNDERSCORE_IDENT_RE+"\\s*(?=[:+?]?=)"},Q={className:"meta",begin:/^\.PHONY:/,end:/$/,keywords:{$pattern:/[\.\w]+/,keyword:".PHONY"}},X={className:"section",begin:/^[^\s]+:/,end:/$/,contains:[Z]};return{name:"Makefile",aliases:["mk","mak","make"],keywords:{$pattern:/[\w-]+/,keyword:"define endef undefine ifdef ifndef ifeq ifneq else endif include -include sinclude override export unexport private vpath"},contains:[$.HASH_COMMENT_MODE,Z,J,H,B,Q,X]}}function cp($){let Z=$.regex,J={begin:/<\/?[A-Za-z_]/,end:">",subLanguage:"xml",relevance:0},H={begin:"^[-\\*]{3,}",end:"$"},B={className:"code",variants:[{begin:"(`{3,})[^`](.|\\n)*?\\1`*[ ]*"},{begin:"(~{3,})[^~](.|\\n)*?\\1~*[ ]*"},{begin:"```",end:"```+[ ]*$"},{begin:"~~~",end:"~~~+[ ]*$"},{begin:"`.+?`"},{begin:"(?=^( {4}|\\t))",contains:[{begin:"^( {4}|\\t)",end:"(\\n)$"}],relevance:0}]},Q={className:"bullet",begin:"^[ \t]*([*+-]|(\\d+\\.))(?=\\s+)",end:"\\s+",excludeEnd:!0},X={begin:/^\[[^\n]+\]:/,returnBegin:!0,contains:[{className:"symbol",begin:/\[/,end:/\]/,excludeBegin:!0,excludeEnd:!0},{className:"link",begin:/:\s*/,end:/$/,excludeBegin:!0}]},z=/[A-Za-z][A-Za-z0-9+.-]*/,G={variants:[{begin:/\[.+?\]\[.*?\]/,relevance:0},{begin:/\[.+?\]\(((data|javascript|mailto):|(?:http|ftp)s?:\/\/).*?\)/,relevance:2},{begin:Z.concat(/\[.+?\]\(/,z,/:\/\/.*?\)/),relevance:2},{begin:/\[.+?\]\([./?&#].*?\)/,relevance:1},{begin:/\[.*?\]\(.*?\)/,relevance:0}],returnBegin:!0,contains:[{match:/\[(?=\])/},{className:"string",relevance:0,begin:"\\[",end:"\\]",excludeBegin:!0,returnEnd:!0},{className:"link",relevance:0,begin:"\\]\\(",end:"\\)",excludeBegin:!0,excludeEnd:!0},{className:"symbol",relevance:0,begin:"\\]\\[",end:"\\]",excludeBegin:!0,excludeEnd:!0}]},U={className:"strong",contains:[],variants:[{begin:/_{2}(?!\s)/,end:/_{2}/},{begin:/\*{2}(?!\s)/,end:/\*{2}/}]},Y={className:"emphasis",contains:[],variants:[{begin:/\*(?![*\s])/,end:/\*/},{begin:/_(?![_\s])/,end:/_/,relevance:0}]},K=$.inherit(U,{contains:[]}),F=$.inherit(Y,{contains:[]});U.contains.push(F),Y.contains.push(K);let W=[J,G];return[U,Y,K,F].forEach((A)=>{A.contains=A.contains.concat(W)}),W=W.concat(U,Y),{name:"Markdown",aliases:["md","mkdown","mkd"],contains:[{className:"section",variants:[{begin:"^#{1,6}",end:"$",contains:W},{begin:"(?=^.+?\\n[=-]{2,}$)",contains:[{begin:"^[=-]*$"},{begin:"^",end:"\\n",contains:W}]}]},J,Q,U,Y,{className:"quote",begin:"^>\\s+",contains:W,end:"$"},B,H,G,X,{scope:"literal",match:/&([a-zA-Z0-9]+|#[0-9]{1,7}|#[Xx][0-9a-fA-F]{1,6});/}]}}function dp($){let Z={className:"built_in",begin:"\\b(AV|CA|CF|CG|CI|CL|CM|CN|CT|MK|MP|MTK|MTL|NS|SCN|SK|UI|WK|XC)\\w+"},J=/[a-zA-Z@][a-zA-Z0-9_]*/,z={"variable.language":["this","super"],$pattern:J,keyword:["while","export","sizeof","typedef","const","struct","for","union","volatile","static","mutable","if","do","return","goto","enum","else","break","extern","asm","case","default","register","explicit","typename","switch","continue","inline","readonly","assign","readwrite","self","@synchronized","id","typeof","nonatomic","IBOutlet","IBAction","strong","weak","copy","in","out","inout","bycopy","byref","oneway","__strong","__weak","__block","__autoreleasing","@private","@protected","@public","@try","@property","@end","@throw","@catch","@finally","@autoreleasepool","@synthesize","@dynamic","@selector","@optional","@required","@encode","@package","@import","@defs","@compatibility_alias","__bridge","__bridge_transfer","__bridge_retained","__bridge_retain","__covariant","__contravariant","__kindof","_Nonnull","_Nullable","_Null_unspecified","__FUNCTION__","__PRETTY_FUNCTION__","__attribute__","getter","setter","retain","unsafe_unretained","nonnull","nullable","null_unspecified","null_resettable","class","instancetype","NS_DESIGNATED_INITIALIZER","NS_UNAVAILABLE","NS_REQUIRES_SUPER","NS_RETURNS_INNER_POINTER","NS_INLINE","NS_AVAILABLE","NS_DEPRECATED","NS_ENUM","NS_OPTIONS","NS_SWIFT_UNAVAILABLE","NS_ASSUME_NONNULL_BEGIN","NS_ASSUME_NONNULL_END","NS_REFINED_FOR_SWIFT","NS_SWIFT_NAME","NS_SWIFT_NOTHROW","NS_DURING","NS_HANDLER","NS_ENDHANDLER","NS_VALUERETURN","NS_VOIDRETURN"],literal:["false","true","FALSE","TRUE","nil","YES","NO","NULL"],built_in:["dispatch_once_t","dispatch_queue_t","dispatch_sync","dispatch_async","dispatch_once"],type:["int","float","char","unsigned","signed","short","long","double","wchar_t","unichar","void","bool","BOOL","id|0","_Bool"]},G={$pattern:J,keyword:["@interface","@class","@protocol","@implementation"]};return{name:"Objective-C",aliases:["mm","objc","obj-c","obj-c++","objective-c++"],keywords:z,illegal:"</",contains:[Z,$.C_LINE_COMMENT_MODE,$.C_BLOCK_COMMENT_MODE,$.C_NUMBER_MODE,$.QUOTE_STRING_MODE,$.APOS_STRING_MODE,{className:"string",variants:[{begin:'@"',end:'"',illegal:"\\n",contains:[$.BACKSLASH_ESCAPE]}]},{className:"meta",begin:/#\s*[a-z]+\b/,end:/$/,keywords:{keyword:"if else elif endif define undef warning error line pragma ifdef ifndef include"},contains:[{begin:/\\\n/,relevance:0},$.inherit($.QUOTE_STRING_MODE,{className:"string"}),{className:"string",begin:/<.*?>/,end:/$/,illegal:"\\n"},$.C_LINE_COMMENT_MODE,$.C_BLOCK_COMMENT_MODE]},{className:"class",begin:"("+G.keyword.join("|")+")\\b",end:/(\{|$)/,excludeEnd:!0,keywords:G,contains:[$.UNDERSCORE_TITLE_MODE]},{begin:"\\."+$.UNDERSCORE_IDENT_RE,relevance:0}]}}function lp($){let Z=$.regex,J=["abs","accept","alarm","and","atan2","bind","binmode","bless","break","caller","chdir","chmod","chomp","chop","chown","chr","chroot","class","close","closedir","connect","continue","cos","crypt","dbmclose","dbmopen","defined","delete","die","do","dump","each","else","elsif","endgrent","endhostent","endnetent","endprotoent","endpwent","endservent","eof","eval","exec","exists","exit","exp","fcntl","field","fileno","flock","for","foreach","fork","format","formline","getc","getgrent","getgrgid","getgrnam","gethostbyaddr","gethostbyname","gethostent","getlogin","getnetbyaddr","getnetbyname","getnetent","getpeername","getpgrp","getpriority","getprotobyname","getprotobynumber","getprotoent","getpwent","getpwnam","getpwuid","getservbyname","getservbyport","getservent","getsockname","getsockopt","given","glob","gmtime","goto","grep","gt","hex","if","index","int","ioctl","join","keys","kill","last","lc","lcfirst","length","link","listen","local","localtime","log","lstat","lt","ma","map","method","mkdir","msgctl","msgget","msgrcv","msgsnd","my","ne","next","no","not","oct","open","opendir","or","ord","our","pack","package","pipe","pop","pos","print","printf","prototype","push","q|0","qq","quotemeta","qw","qx","rand","read","readdir","readline","readlink","readpipe","recv","redo","ref","rename","require","reset","return","reverse","rewinddir","rindex","rmdir","say","scalar","seek","seekdir","select","semctl","semget","semop","send","setgrent","sethostent","setnetent","setpgrp","setpriority","setprotoent","setpwent","setservent","setsockopt","shift","shmctl","shmget","shmread","shmwrite","shutdown","sin","sleep","socket","socketpair","sort","splice","split","sprintf","sqrt","srand","stat","state","study","sub","substr","symlink","syscall","sysopen","sysread","sysseek","system","syswrite","tell","telldir","tie","tied","time","times","tr","truncate","uc","ucfirst","umask","undef","unless","unlink","unpack","unshift","untie","until","use","utime","values","vec","wait","waitpid","wantarray","warn","when","while","write","x|0","xor","y|0"],H=/[dualxmsipngr]{0,12}/,B={$pattern:/[\w.]+/,keyword:J.join(" ")},Q={className:"subst",begin:"[$@]\\{",end:"\\}",keywords:B},X={begin:/->\{/,end:/\}/},z={scope:"attr",match:/\s+:\s*\w+(\s*\(.*?\))?/},G={scope:"variable",variants:[{begin:/\$\d/},{begin:Z.concat(/[$%@](?!")(\^\w\b|#\w+(::\w+)*|\{\w+\}|\w+(::\w*)*)/,"(?![A-Za-z])(?![@$%])")},{begin:/[$%@](?!")[^\s\w{=]|\$=/,relevance:0}],contains:[z]},U={className:"number",variants:[{match:/0?\.[0-9][0-9_]+\b/},{match:/\bv?(0|[1-9][0-9_]*(\.[0-9_]+)?|[1-9][0-9_]*)\b/},{match:/\b0[0-7][0-7_]*\b/},{match:/\b0x[0-9a-fA-F][0-9a-fA-F_]*\b/},{match:/\b0b[0-1][0-1_]*\b/}],relevance:0},Y=[$.BACKSLASH_ESCAPE,Q,G],K=[/!/,/\//,/\|/,/\?/,/'/,/"/,/#/],F=(N,D,A="\\1")=>{let V=A==="\\1"?A:Z.concat(A,D);return Z.concat(Z.concat("(?:",N,")"),D,/(?:\\.|[^\\\/])*?/,V,/(?:\\.|[^\\\/])*?/,A,H)},W=(N,D,A)=>{return Z.concat(Z.concat("(?:",N,")"),D,/(?:\\.|[^\\\/])*?/,A,H)},q=[G,$.HASH_COMMENT_MODE,$.COMMENT(/^=\w/,/=cut/,{endsWithParent:!0}),X,{className:"string",contains:Y,variants:[{begin:"q[qwxr]?\\s*\\(",end:"\\)",relevance:5},{begin:"q[qwxr]?\\s*\\[",end:"\\]",relevance:5},{begin:"q[qwxr]?\\s*\\{",end:"\\}",relevance:5},{begin:"q[qwxr]?\\s*\\|",end:"\\|",relevance:5},{begin:"q[qwxr]?\\s*<",end:">",relevance:5},{begin:"qw\\s+q",end:"q",relevance:5},{begin:"'",end:"'",contains:[$.BACKSLASH_ESCAPE]},{begin:'"',end:'"'},{begin:"`",end:"`",contains:[$.BACKSLASH_ESCAPE]},{begin:/\{\w+\}/,relevance:0},{begin:"-?\\w+\\s*=>",relevance:0}]},U,{begin:"(\\/\\/|"+$.RE_STARTERS_RE+"|\\b(split|return|print|reverse|grep)\\b)\\s*",keywords:"split return print reverse grep",relevance:0,contains:[$.HASH_COMMENT_MODE,{className:"regexp",variants:[{begin:F("s|tr|y",Z.either(...K,{capture:!0}))},{begin:F("s|tr|y","\\(","\\)")},{begin:F("s|tr|y","\\[","\\]")},{begin:F("s|tr|y","\\{","\\}")}],relevance:2},{className:"regexp",variants:[{begin:/(m|qr)\/\//,relevance:0},{begin:W("(?:m|qr)?",/\//,/\//)},{begin:W("m|qr",Z.either(...K,{capture:!0}),/\1/)},{begin:W("m|qr",/\(/,/\)/)},{begin:W("m|qr",/\[/,/\]/)},{begin:W("m|qr",/\{/,/\}/)}]}]},{className:"function",beginKeywords:"sub method",end:"(\\s*\\(.*?\\))?[;{]",excludeEnd:!0,relevance:5,contains:[$.TITLE_MODE,z]},{className:"class",beginKeywords:"class",end:"[;{]",excludeEnd:!0,relevance:5,contains:[$.TITLE_MODE,z,U]},{begin:"-\\w\\b",relevance:0},{begin:"^__DATA__$",end:"^__END__$",subLanguage:"mojolicious",contains:[{begin:"^@@.*",end:"$",className:"comment"}]}];return Q.contains=q,X.contains=q,{name:"Perl",aliases:["pl","pm"],keywords:B,contains:q}}function ip($){let Z=$.regex,J=/(?![A-Za-z0-9])(?![$])/,H=Z.concat(/[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*/,J),B=Z.concat(/(\\?[A-Z][a-z0-9_\x7f-\xff]+|\\?[A-Z]+(?=[A-Z][a-z0-9_\x7f-\xff])){1,}/,J),Q=Z.concat(/[A-Z]+/,J),X={scope:"variable",match:"\\$+"+H},z={scope:"meta",variants:[{begin:/<\?php/,relevance:10},{begin:/<\?=/},{begin:/<\?/,relevance:0.1},{begin:/\?>/}]},G={scope:"subst",variants:[{begin:/\$\w+/},{begin:/\{\$/,end:/\}/}]},U=$.inherit($.APOS_STRING_MODE,{illegal:null}),Y=$.inherit($.QUOTE_STRING_MODE,{illegal:null,contains:$.QUOTE_STRING_MODE.contains.concat(G)}),K={begin:/<<<[ \t]*(?:(\w+)|"(\w+)")\n/,end:/[ \t]*(\w+)\b/,contains:$.QUOTE_STRING_MODE.contains.concat(G),"on:begin":(T,y)=>{y.data._beginMatch=T[1]||T[2]},"on:end":(T,y)=>{if(y.data._beginMatch!==T[1])y.ignoreMatch()}},F=$.END_SAME_AS_BEGIN({begin:/<<<[ \t]*'(\w+)'\n/,end:/[ \t]*(\w+)\b/}),W=`[
35
+ ]`,q={scope:"string",variants:[Y,U,K,F]},N={scope:"number",variants:[{begin:"\\b0[bB][01]+(?:_[01]+)*\\b"},{begin:"\\b0[oO][0-7]+(?:_[0-7]+)*\\b"},{begin:"\\b0[xX][\\da-fA-F]+(?:_[\\da-fA-F]+)*\\b"},{begin:"(?:\\b\\d+(?:_\\d+)*(\\.(?:\\d+(?:_\\d+)*))?|\\B\\.\\d+)(?:[eE][+-]?\\d+)?"}],relevance:0},D=["false","null","true"],A=["__CLASS__","__DIR__","__FILE__","__FUNCTION__","__COMPILER_HALT_OFFSET__","__LINE__","__METHOD__","__NAMESPACE__","__TRAIT__","die","echo","exit","include","include_once","print","require","require_once","array","abstract","and","as","binary","bool","boolean","break","callable","case","catch","class","clone","const","continue","declare","default","do","double","else","elseif","empty","enddeclare","endfor","endforeach","endif","endswitch","endwhile","enum","eval","extends","final","finally","float","for","foreach","from","global","goto","if","implements","instanceof","insteadof","int","integer","interface","isset","iterable","list","match|0","mixed","new","never","object","or","private","protected","public","readonly","real","return","string","switch","throw","trait","try","unset","use","var","void","while","xor","yield"],V=["Error|0","AppendIterator","ArgumentCountError","ArithmeticError","ArrayIterator","ArrayObject","AssertionError","BadFunctionCallException","BadMethodCallException","CachingIterator","CallbackFilterIterator","CompileError","Countable","DirectoryIterator","DivisionByZeroError","DomainException","EmptyIterator","ErrorException","Exception","FilesystemIterator","FilterIterator","GlobIterator","InfiniteIterator","InvalidArgumentException","IteratorIterator","LengthException","LimitIterator","LogicException","MultipleIterator","NoRewindIterator","OutOfBoundsException","OutOfRangeException","OuterIterator","OverflowException","ParentIterator","ParseError","RangeException","RecursiveArrayIterator","RecursiveCachingIterator","RecursiveCallbackFilterIterator","RecursiveDirectoryIterator","RecursiveFilterIterator","RecursiveIterator","RecursiveIteratorIterator","RecursiveRegexIterator","RecursiveTreeIterator","RegexIterator","RuntimeException","SeekableIterator","SplDoublyLinkedList","SplFileInfo","SplFileObject","SplFixedArray","SplHeap","SplMaxHeap","SplMinHeap","SplObjectStorage","SplObserver","SplPriorityQueue","SplQueue","SplStack","SplSubject","SplTempFileObject","TypeError","UnderflowException","UnexpectedValueException","UnhandledMatchError","ArrayAccess","BackedEnum","Closure","Fiber","Generator","Iterator","IteratorAggregate","Serializable","Stringable","Throwable","Traversable","UnitEnum","WeakReference","WeakMap","Directory","__PHP_Incomplete_Class","parent","php_user_filter","self","static","stdClass"],O={keyword:A,literal:((T)=>{let y=[];return T.forEach((R)=>{if(y.push(R),R.toLowerCase()===R)y.push(R.toUpperCase());else y.push(R.toLowerCase())}),y})(D),built_in:V},M=(T)=>{return T.map((y)=>{return y.replace(/\|\d+$/,"")})},_={variants:[{match:[/new/,Z.concat(`[
36
+ ]`,"+"),Z.concat("(?!",M(V).join("\\b|"),"\\b)"),B],scope:{1:"keyword",4:"title.class"}}]},w=Z.concat(H,"\\b(?!\\()"),C={variants:[{match:[Z.concat(/::/,Z.lookahead(/(?!class\b)/)),w],scope:{2:"variable.constant"}},{match:[/::/,/class/],scope:{2:"variable.language"}},{match:[B,Z.concat(/::/,Z.lookahead(/(?!class\b)/)),w],scope:{1:"title.class",3:"variable.constant"}},{match:[B,Z.concat("::",Z.lookahead(/(?!class\b)/))],scope:{1:"title.class"}},{match:[B,/::/,/class/],scope:{1:"title.class",3:"variable.language"}}]},E={scope:"attr",match:Z.concat(H,Z.lookahead(":"),Z.lookahead(/(?!::)/))},j={relevance:0,begin:/\(/,end:/\)/,keywords:O,contains:[E,X,C,$.C_BLOCK_COMMENT_MODE,q,N,_]},k={relevance:0,match:[/\b/,Z.concat("(?!fn\\b|function\\b|",M(A).join("\\b|"),"|",M(V).join("\\b|"),"\\b)"),H,Z.concat(`[
37
+ ]`,"*"),Z.lookahead(/(?=\()/)],scope:{3:"title.function.invoke"},contains:[j]};j.contains.push(k);let S=[E,C,$.C_BLOCK_COMMENT_MODE,q,N,_],I={begin:Z.concat(/#\[\s*\\?/,Z.either(B,Q)),beginScope:"meta",end:/]/,endScope:"meta",keywords:{literal:D,keyword:["new","array"]},contains:[{begin:/\[/,end:/]/,keywords:{literal:D,keyword:["new","array"]},contains:["self",...S]},...S,{scope:"meta",variants:[{match:B},{match:Q}]}]};return{case_insensitive:!1,keywords:O,contains:[I,$.HASH_COMMENT_MODE,$.COMMENT("//","$"),$.COMMENT("/\\*","\\*/",{contains:[{scope:"doctag",match:"@[A-Za-z]+"}]}),{match:/__halt_compiler\(\);/,keywords:"__halt_compiler",starts:{scope:"comment",end:$.MATCH_NOTHING_RE,contains:[{match:/\?>/,scope:"meta",endsParent:!0}]}},z,{scope:"variable.language",match:/\$this\b/},X,k,C,{match:[/const/,/\s/,H],scope:{1:"keyword",3:"variable.constant"}},_,{scope:"function",relevance:0,beginKeywords:"fn function",end:/[;{]/,excludeEnd:!0,illegal:"[$%\\[]",contains:[{beginKeywords:"use"},$.UNDERSCORE_TITLE_MODE,{begin:"=>",endsParent:!0},{scope:"params",begin:"\\(",end:"\\)",excludeBegin:!0,excludeEnd:!0,keywords:O,contains:["self",I,X,C,$.C_BLOCK_COMMENT_MODE,q,N]}]},{scope:"class",variants:[{beginKeywords:"enum",illegal:/[($"]/},{beginKeywords:"class interface trait",illegal:/[:($"]/}],relevance:0,end:/\{/,excludeEnd:!0,contains:[{beginKeywords:"extends implements"},$.UNDERSCORE_TITLE_MODE]},{beginKeywords:"namespace",relevance:0,end:";",illegal:/[.']/,contains:[$.inherit($.UNDERSCORE_TITLE_MODE,{scope:"title.class"})]},{beginKeywords:"use",relevance:0,end:";",contains:[{match:/\b(as|const|function)\b/,scope:"keyword"},$.UNDERSCORE_TITLE_MODE]},q,N]}}function rp($){return{name:"PHP template",subLanguage:"xml",contains:[{begin:/<\?(php|=)?/,end:/\?>/,subLanguage:"php",contains:[{begin:"/\\*",end:"\\*/",skip:!0},{begin:'b"',end:'"',skip:!0},{begin:"b'",end:"'",skip:!0},$.inherit($.APOS_STRING_MODE,{illegal:null,className:null,contains:null,skip:!0}),$.inherit($.QUOTE_STRING_MODE,{illegal:null,className:null,contains:null,skip:!0})]}]}}function ap($){return{name:"Plain text",aliases:["text","txt"],disableAutodetect:!0}}function op($){let Z=$.regex,J=/[\p{XID_Start}_]\p{XID_Continue}*/u,H=["and","as","assert","async","await","break","case","class","continue","def","del","elif","else","except","finally","for","from","global","if","import","in","is","lambda","match","nonlocal|10","not","or","pass","raise","return","try","while","with","yield"],z={$pattern:/[A-Za-z]\w+|__\w+__/,keyword:H,built_in:["__import__","abs","all","any","ascii","bin","bool","breakpoint","bytearray","bytes","callable","chr","classmethod","compile","complex","delattr","dict","dir","divmod","enumerate","eval","exec","filter","float","format","frozenset","getattr","globals","hasattr","hash","help","hex","id","input","int","isinstance","issubclass","iter","len","list","locals","map","max","memoryview","min","next","object","oct","open","ord","pow","print","property","range","repr","reversed","round","set","setattr","slice","sorted","staticmethod","str","sum","super","tuple","type","vars","zip"],literal:["__debug__","Ellipsis","False","None","NotImplemented","True"],type:["Any","Callable","Coroutine","Dict","List","Literal","Generic","Optional","Sequence","Set","Tuple","Type","Union"]},G={className:"meta",begin:/^(>>>|\.\.\.) /},U={className:"subst",begin:/\{/,end:/\}/,keywords:z,illegal:/#/},Y={begin:/\{\{/,relevance:0},K={className:"string",contains:[$.BACKSLASH_ESCAPE],variants:[{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?'''/,end:/'''/,contains:[$.BACKSLASH_ESCAPE,G],relevance:10},{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?"""/,end:/"""/,contains:[$.BACKSLASH_ESCAPE,G],relevance:10},{begin:/([fF][rR]|[rR][fF]|[fF])'''/,end:/'''/,contains:[$.BACKSLASH_ESCAPE,G,Y,U]},{begin:/([fF][rR]|[rR][fF]|[fF])"""/,end:/"""/,contains:[$.BACKSLASH_ESCAPE,G,Y,U]},{begin:/([uU]|[rR])'/,end:/'/,relevance:10},{begin:/([uU]|[rR])"/,end:/"/,relevance:10},{begin:/([bB]|[bB][rR]|[rR][bB])'/,end:/'/},{begin:/([bB]|[bB][rR]|[rR][bB])"/,end:/"/},{begin:/([fF][rR]|[rR][fF]|[fF])'/,end:/'/,contains:[$.BACKSLASH_ESCAPE,Y,U]},{begin:/([fF][rR]|[rR][fF]|[fF])"/,end:/"/,contains:[$.BACKSLASH_ESCAPE,Y,U]},$.APOS_STRING_MODE,$.QUOTE_STRING_MODE]},F="[0-9](_?[0-9])*",W="(\\b([0-9](_?[0-9])*))?\\.([0-9](_?[0-9])*)|\\b([0-9](_?[0-9])*)\\.",q=`\\b|${H.join("|")}`,N={className:"number",relevance:0,variants:[{begin:`(\\b([0-9](_?[0-9])*)|((\\b([0-9](_?[0-9])*))?\\.([0-9](_?[0-9])*)|\\b([0-9](_?[0-9])*)\\.))[eE][+-]?([0-9](_?[0-9])*)[jJ]?(?=${q})`},{begin:"((\\b([0-9](_?[0-9])*))?\\.([0-9](_?[0-9])*)|\\b([0-9](_?[0-9])*)\\.)[jJ]?"},{begin:`\\b([1-9](_?[0-9])*|0+(_?0)*)[lLjJ]?(?=${q})`},{begin:`\\b0[bB](_?[01])+[lL]?(?=${q})`},{begin:`\\b0[oO](_?[0-7])+[lL]?(?=${q})`},{begin:`\\b0[xX](_?[0-9a-fA-F])+[lL]?(?=${q})`},{begin:`\\b([0-9](_?[0-9])*)[jJ](?=${q})`}]},D={className:"comment",begin:Z.lookahead(/# type:/),end:/$/,keywords:z,contains:[{begin:/# type:/},{begin:/#/,end:/\b\B/,endsWithParent:!0}]},A={className:"params",variants:[{className:"",begin:/\(\s*\)/,skip:!0},{begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:z,contains:["self",G,N,K,$.HASH_COMMENT_MODE]}]};return U.contains=[K,N,G],{name:"Python",aliases:["py","gyp","ipython"],unicodeRegex:!0,keywords:z,illegal:/(<\/|\?)|=>/,contains:[G,N,{scope:"variable.language",match:/\bself\b/},{beginKeywords:"if",relevance:0},{match:/\bor\b/,scope:"keyword"},K,D,$.HASH_COMMENT_MODE,{match:[/\bdef/,/\s+/,J],scope:{1:"keyword",3:"title.function"},contains:[A]},{variants:[{match:[/\bclass/,/\s+/,J,/\s*/,/\(\s*/,J,/\s*\)/]},{match:[/\bclass/,/\s+/,J]}],scope:{1:"keyword",3:"title.class",6:"title.class.inherited"}},{className:"meta",begin:/^[\t ]*@/,end:/(?=#)|$/,contains:[N,A,K]}]}}function np($){return{aliases:["pycon"],contains:[{className:"meta.prompt",starts:{end:/ |$/,starts:{end:"$",subLanguage:"python"}},variants:[{begin:/^>>>(?=[ ]|$)/},{begin:/^\.\.\.(?=[ ]|$)/}]}]}}function sp($){let Z=$.regex,J=/(?:(?:[a-zA-Z]|\.[._a-zA-Z])[._a-zA-Z0-9]*)|\.(?!\d)/,H=Z.either(/0[xX][0-9a-fA-F]+\.[0-9a-fA-F]*[pP][+-]?\d+i?/,/0[xX][0-9a-fA-F]+(?:[pP][+-]?\d+)?[Li]?/,/(?:\d+(?:\.\d*)?|\.\d+)(?:[eE][+-]?\d+)?[Li]?/),B=/[=!<>:]=|\|\||&&|:::?|<-|<<-|->>|->|\|>|[-+*\/?!$&|:<=>@^~]|\*\*/,Q=Z.either(/[()]/,/[{}]/,/\[\[/,/[[\]]/,/\\/,/,/);return{name:"R",keywords:{$pattern:J,keyword:"function if in break next repeat else for while",literal:"NULL NA TRUE FALSE Inf NaN NA_integer_|10 NA_real_|10 NA_character_|10 NA_complex_|10",built_in:"LETTERS letters month.abb month.name pi T F abs acos acosh all any anyNA Arg as.call as.character as.complex as.double as.environment as.integer as.logical as.null.default as.numeric as.raw asin asinh atan atanh attr attributes baseenv browser c call ceiling class Conj cos cosh cospi cummax cummin cumprod cumsum digamma dim dimnames emptyenv exp expression floor forceAndCall gamma gc.time globalenv Im interactive invisible is.array is.atomic is.call is.character is.complex is.double is.environment is.expression is.finite is.function is.infinite is.integer is.language is.list is.logical is.matrix is.na is.name is.nan is.null is.numeric is.object is.pairlist is.raw is.recursive is.single is.symbol lazyLoadDBfetch length lgamma list log max min missing Mod names nargs nzchar oldClass on.exit pos.to.env proc.time prod quote range Re rep retracemem return round seq_along seq_len seq.int sign signif sin sinh sinpi sqrt standardGeneric substitute sum switch tan tanh tanpi tracemem trigamma trunc unclass untracemem UseMethod xtfrm"},contains:[$.COMMENT(/#'/,/$/,{contains:[{scope:"doctag",match:/@examples/,starts:{end:Z.lookahead(Z.either(/\n^#'\s*(?=@[a-zA-Z]+)/,/\n^(?!#')/)),endsParent:!0}},{scope:"doctag",begin:"@param",end:/$/,contains:[{scope:"variable",variants:[{match:J},{match:/`(?:\\.|[^`\\])+`/}],endsParent:!0}]},{scope:"doctag",match:/@[a-zA-Z]+/},{scope:"keyword",match:/\\[a-zA-Z]+/}]}),$.HASH_COMMENT_MODE,{scope:"string",contains:[$.BACKSLASH_ESCAPE],variants:[$.END_SAME_AS_BEGIN({begin:/[rR]"(-*)\(/,end:/\)(-*)"/}),$.END_SAME_AS_BEGIN({begin:/[rR]"(-*)\{/,end:/\}(-*)"/}),$.END_SAME_AS_BEGIN({begin:/[rR]"(-*)\[/,end:/\](-*)"/}),$.END_SAME_AS_BEGIN({begin:/[rR]'(-*)\(/,end:/\)(-*)'/}),$.END_SAME_AS_BEGIN({begin:/[rR]'(-*)\{/,end:/\}(-*)'/}),$.END_SAME_AS_BEGIN({begin:/[rR]'(-*)\[/,end:/\](-*)'/}),{begin:'"',end:'"',relevance:0},{begin:"'",end:"'",relevance:0}]},{relevance:0,variants:[{scope:{1:"operator",2:"number"},match:[B,H]},{scope:{1:"operator",2:"number"},match:[/%[^%]*%/,H]},{scope:{1:"punctuation",2:"number"},match:[Q,H]},{scope:{2:"number"},match:[/[^a-zA-Z0-9._]|^/,H]}]},{scope:{3:"operator"},match:[J,/\s+/,/<-/,/\s+/]},{scope:"operator",relevance:0,variants:[{match:B},{match:/%[^%]*%/}]},{scope:"punctuation",relevance:0,match:Q},{begin:"`",end:"`",contains:[{begin:/\\./}]}]}}function tp($){let Z=$.regex,J="([a-zA-Z_]\\w*[!?=]?|[-+~]@|<<|>>|=~|===?|<=>|[<>]=?|\\*\\*|[-/+%^&*~`|]|\\[\\]=?)",H=Z.either(/\b([A-Z]+[a-z0-9]+)+/,/\b([A-Z]+[a-z0-9]+)+[A-Z]+/),B=Z.concat(H,/(::\w+)*/),X={"variable.constant":["__FILE__","__LINE__","__ENCODING__"],"variable.language":["self","super"],keyword:["alias","and","begin","BEGIN","break","case","class","defined","do","else","elsif","end","END","ensure","for","if","in","module","next","not","or","redo","require","rescue","retry","return","then","undef","unless","until","when","while","yield",...["include","extend","prepend","public","private","protected","raise","throw"]],built_in:["proc","lambda","attr_accessor","attr_reader","attr_writer","define_method","private_constant","module_function"],literal:["true","false","nil"]},z={className:"doctag",begin:"@[A-Za-z]+"},G={begin:"#<",end:">"},U=[$.COMMENT("#","$",{contains:[z]}),$.COMMENT("^=begin","^=end",{contains:[z],relevance:10}),$.COMMENT("^__END__",$.MATCH_NOTHING_RE)],Y={className:"subst",begin:/#\{/,end:/\}/,keywords:X},K={className:"string",contains:[$.BACKSLASH_ESCAPE,Y],variants:[{begin:/'/,end:/'/},{begin:/"/,end:/"/},{begin:/`/,end:/`/},{begin:/%[qQwWx]?\(/,end:/\)/},{begin:/%[qQwWx]?\[/,end:/\]/},{begin:/%[qQwWx]?\{/,end:/\}/},{begin:/%[qQwWx]?</,end:/>/},{begin:/%[qQwWx]?\//,end:/\//},{begin:/%[qQwWx]?%/,end:/%/},{begin:/%[qQwWx]?-/,end:/-/},{begin:/%[qQwWx]?\|/,end:/\|/},{begin:/\B\?(\\\d{1,3})/},{begin:/\B\?(\\x[A-Fa-f0-9]{1,2})/},{begin:/\B\?(\\u\{?[A-Fa-f0-9]{1,6}\}?)/},{begin:/\B\?(\\M-\\C-|\\M-\\c|\\c\\M-|\\M-|\\C-\\M-)[\x20-\x7e]/},{begin:/\B\?\\(c|C-)[\x20-\x7e]/},{begin:/\B\?\\?\S/},{begin:Z.concat(/<<[-~]?'?/,Z.lookahead(/(\w+)(?=\W)[^\n]*\n(?:[^\n]*\n)*?\s*\1\b/)),contains:[$.END_SAME_AS_BEGIN({begin:/(\w+)/,end:/(\w+)/,contains:[$.BACKSLASH_ESCAPE,Y]})]}]},F="[1-9](_?[0-9])*|0",W="[0-9](_?[0-9])*",q={className:"number",relevance:0,variants:[{begin:"\\b([1-9](_?[0-9])*|0)(\\.([0-9](_?[0-9])*))?([eE][+-]?([0-9](_?[0-9])*)|r)?i?\\b"},{begin:"\\b0[dD][0-9](_?[0-9])*r?i?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*r?i?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*r?i?\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*r?i?\\b"},{begin:"\\b0(_?[0-7])+r?i?\\b"}]},N={variants:[{match:/\(\)/},{className:"params",begin:/\(/,end:/(?=\))/,excludeBegin:!0,endsParent:!0,keywords:X}]},_=[K,{variants:[{match:[/class\s+/,B,/\s+<\s+/,B]},{match:[/\b(class|module)\s+/,B]}],scope:{2:"title.class",4:"title.class.inherited"},keywords:X},{match:[/(include|extend)\s+/,B],scope:{2:"title.class"},keywords:X},{relevance:0,match:[B,/\.new[. (]/],scope:{1:"title.class"}},{relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"},{relevance:0,match:H,scope:"title.class"},{match:[/def/,/\s+/,"([a-zA-Z_]\\w*[!?=]?|[-+~]@|<<|>>|=~|===?|<=>|[<>]=?|\\*\\*|[-/+%^&*~`|]|\\[\\]=?)"],scope:{1:"keyword",3:"title.function"},contains:[N]},{begin:$.IDENT_RE+"::"},{className:"symbol",begin:$.UNDERSCORE_IDENT_RE+"(!|\\?)?:",relevance:0},{className:"symbol",begin:":(?!\\s)",contains:[K,{begin:"([a-zA-Z_]\\w*[!?=]?|[-+~]@|<<|>>|=~|===?|<=>|[<>]=?|\\*\\*|[-/+%^&*~`|]|\\[\\]=?)"}],relevance:0},q,{className:"variable",begin:"(\\$\\W)|((\\$|@@?)(\\w+))(?=[^@$?])(?![A-Za-z])(?![@$?'])"},{className:"params",begin:/\|(?!=)/,end:/\|/,excludeBegin:!0,excludeEnd:!0,relevance:0,keywords:X},{begin:"("+$.RE_STARTERS_RE+"|unless)\\s*",keywords:"unless",contains:[{className:"regexp",contains:[$.BACKSLASH_ESCAPE,Y],illegal:/\n/,variants:[{begin:"/",end:"/[a-z]*"},{begin:/%r\{/,end:/\}[a-z]*/},{begin:"%r\\(",end:"\\)[a-z]*"},{begin:"%r!",end:"![a-z]*"},{begin:"%r\\[",end:"\\][a-z]*"}]}].concat(G,U),relevance:0}].concat(G,U);Y.contains=_,N.contains=_;let w="[>?]>",C="[\\w#]+\\(\\w+\\):\\d+:\\d+[>*]",E="(\\w+-)?\\d+\\.\\d+\\.\\d+(p\\d+)?[^\\d][^>]+>",j=[{begin:/^\s*=>/,starts:{end:"$",contains:_}},{className:"meta.prompt",begin:"^("+w+"|"+C+"|"+E+")(?=[ ])",starts:{end:"$",keywords:X,contains:_}}];return U.unshift(G),{name:"Ruby",aliases:["rb","gemspec","podspec","thor","irb"],keywords:X,illegal:/\/\*/,contains:[$.SHEBANG({binary:"ruby"})].concat(j).concat(U).concat(_)}}function ep($){let Z=$.regex,J=/(r#)?/,H=Z.concat(J,$.UNDERSCORE_IDENT_RE),B=Z.concat(J,$.IDENT_RE),Q={className:"title.function.invoke",relevance:0,begin:Z.concat(/\b/,/(?!let|for|while|if|else|match\b)/,B,Z.lookahead(/\s*\(/))},X="([ui](8|16|32|64|128|size)|f(32|64))?",z=["abstract","as","async","await","become","box","break","const","continue","crate","do","dyn","else","enum","extern","false","final","fn","for","if","impl","in","let","loop","macro","match","mod","move","mut","override","priv","pub","ref","return","self","Self","static","struct","super","trait","true","try","type","typeof","union","unsafe","unsized","use","virtual","where","while","yield"],G=["true","false","Some","None","Ok","Err"],U=["drop ","Copy","Send","Sized","Sync","Drop","Fn","FnMut","FnOnce","ToOwned","Clone","Debug","PartialEq","PartialOrd","Eq","Ord","AsRef","AsMut","Into","From","Default","Iterator","Extend","IntoIterator","DoubleEndedIterator","ExactSizeIterator","SliceConcatExt","ToString","assert!","assert_eq!","bitflags!","bytes!","cfg!","col!","concat!","concat_idents!","debug_assert!","debug_assert_eq!","env!","eprintln!","panic!","file!","format!","format_args!","include_bytes!","include_str!","line!","local_data_key!","module_path!","option_env!","print!","println!","select!","stringify!","try!","unimplemented!","unreachable!","vec!","write!","writeln!","macro_rules!","assert_ne!","debug_assert_ne!"],Y=["i8","i16","i32","i64","i128","isize","u8","u16","u32","u64","u128","usize","f32","f64","str","char","bool","Box","Option","Result","String","Vec"];return{name:"Rust",aliases:["rs"],keywords:{$pattern:$.IDENT_RE+"!?",type:Y,keyword:z,literal:G,built_in:U},illegal:"</",contains:[$.C_LINE_COMMENT_MODE,$.COMMENT("/\\*","\\*/",{contains:["self"]}),$.inherit($.QUOTE_STRING_MODE,{begin:/b?"/,illegal:null}),{className:"symbol",begin:/'[a-zA-Z_][a-zA-Z0-9_]*(?!')/},{scope:"string",variants:[{begin:/b?r(#*)"(.|\n)*?"\1(?!#)/},{begin:/b?'/,end:/'/,contains:[{scope:"char.escape",match:/\\('|\w|x\w{2}|u\w{4}|U\w{8})/}]}]},{className:"number",variants:[{begin:"\\b0b([01_]+)([ui](8|16|32|64|128|size)|f(32|64))?"},{begin:"\\b0o([0-7_]+)([ui](8|16|32|64|128|size)|f(32|64))?"},{begin:"\\b0x([A-Fa-f0-9_]+)([ui](8|16|32|64|128|size)|f(32|64))?"},{begin:"\\b(\\d[\\d_]*(\\.[0-9_]+)?([eE][+-]?[0-9_]+)?)([ui](8|16|32|64|128|size)|f(32|64))?"}],relevance:0},{begin:[/fn/,/\s+/,H],className:{1:"keyword",3:"title.function"}},{className:"meta",begin:"#!?\\[",end:"\\]",contains:[{className:"string",begin:/"/,end:/"/,contains:[$.BACKSLASH_ESCAPE]}]},{begin:[/let/,/\s+/,/(?:mut\s+)?/,H],className:{1:"keyword",3:"keyword",4:"variable"}},{begin:[/for/,/\s+/,H,/\s+/,/in/],className:{1:"keyword",3:"variable",5:"keyword"}},{begin:[/type/,/\s+/,H],className:{1:"keyword",3:"title.class"}},{begin:[/(?:trait|enum|struct|union|impl|for)/,/\s+/,H],className:{1:"keyword",3:"title.class"}},{begin:$.IDENT_RE+"::",keywords:{keyword:"Self",built_in:U,type:Y}},{className:"punctuation",begin:"->"},Q]}}var tH0=($)=>{return{IMPORTANT:{scope:"meta",begin:"!important"},BLOCK_COMMENT:$.C_BLOCK_COMMENT_MODE,HEXCOLOR:{scope:"number",begin:/#(([0-9a-fA-F]{3,4})|(([0-9a-fA-F]{2}){3,4}))\b/},FUNCTION_DISPATCH:{className:"built_in",begin:/[\w-]+(?=\()/},ATTRIBUTE_SELECTOR_MODE:{scope:"selector-attr",begin:/\[/,end:/\]/,illegal:"$",contains:[$.APOS_STRING_MODE,$.QUOTE_STRING_MODE]},CSS_NUMBER_MODE:{scope:"number",begin:$.NUMBER_RE+"(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?",relevance:0},CSS_VARIABLE:{className:"attr",begin:/--[A-Za-z_][A-Za-z0-9_-]*/}}},eH0=["a","abbr","address","article","aside","audio","b","blockquote","body","button","canvas","caption","cite","code","dd","del","details","dfn","div","dl","dt","em","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","html","i","iframe","img","input","ins","kbd","label","legend","li","main","mark","menu","nav","object","ol","optgroup","option","p","picture","q","quote","samp","section","select","source","span","strong","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","ul","var","video"],$B0=["defs","g","marker","mask","pattern","svg","switch","symbol","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feFlood","feGaussianBlur","feImage","feMerge","feMorphology","feOffset","feSpecularLighting","feTile","feTurbulence","linearGradient","radialGradient","stop","circle","ellipse","image","line","path","polygon","polyline","rect","text","use","textPath","tspan","foreignObject","clipPath"],ZB0=[...eH0,...$B0],JB0=["any-hover","any-pointer","aspect-ratio","color","color-gamut","color-index","device-aspect-ratio","device-height","device-width","display-mode","forced-colors","grid","height","hover","inverted-colors","monochrome","orientation","overflow-block","overflow-inline","pointer","prefers-color-scheme","prefers-contrast","prefers-reduced-motion","prefers-reduced-transparency","resolution","scan","scripting","update","width","min-width","max-width","min-height","max-height"].sort().reverse(),HB0=["active","any-link","blank","checked","current","default","defined","dir","disabled","drop","empty","enabled","first","first-child","first-of-type","fullscreen","future","focus","focus-visible","focus-within","has","host","host-context","hover","indeterminate","in-range","invalid","is","lang","last-child","last-of-type","left","link","local-link","not","nth-child","nth-col","nth-last-child","nth-last-col","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","past","placeholder-shown","read-only","read-write","required","right","root","scope","target","target-within","user-invalid","valid","visited","where"].sort().reverse(),BB0=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),QB0=["accent-color","align-content","align-items","align-self","alignment-baseline","all","anchor-name","animation","animation-composition","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-range","animation-range-end","animation-range-start","animation-timeline","animation-timing-function","appearance","aspect-ratio","backdrop-filter","backface-visibility","background","background-attachment","background-blend-mode","background-clip","background-color","background-image","background-origin","background-position","background-position-x","background-position-y","background-repeat","background-size","baseline-shift","block-size","border","border-block","border-block-color","border-block-end","border-block-end-color","border-block-end-style","border-block-end-width","border-block-start","border-block-start-color","border-block-start-style","border-block-start-width","border-block-style","border-block-width","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-end-end-radius","border-end-start-radius","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-inline","border-inline-color","border-inline-end","border-inline-end-color","border-inline-end-style","border-inline-end-width","border-inline-start","border-inline-start-color","border-inline-start-style","border-inline-start-width","border-inline-style","border-inline-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-start-end-radius","border-start-start-radius","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-align","box-decoration-break","box-direction","box-flex","box-flex-group","box-lines","box-ordinal-group","box-orient","box-pack","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","caret-color","clear","clip","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","color-scheme","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","contain","contain-intrinsic-block-size","contain-intrinsic-height","contain-intrinsic-inline-size","contain-intrinsic-size","contain-intrinsic-width","container","container-name","container-type","content","content-visibility","counter-increment","counter-reset","counter-set","cue","cue-after","cue-before","cursor","cx","cy","direction","display","dominant-baseline","empty-cells","enable-background","field-sizing","fill","fill-opacity","fill-rule","filter","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","flood-color","flood-opacity","flow","font","font-display","font-family","font-feature-settings","font-kerning","font-language-override","font-optical-sizing","font-palette","font-size","font-size-adjust","font-smooth","font-smoothing","font-stretch","font-style","font-synthesis","font-synthesis-position","font-synthesis-small-caps","font-synthesis-style","font-synthesis-weight","font-variant","font-variant-alternates","font-variant-caps","font-variant-east-asian","font-variant-emoji","font-variant-ligatures","font-variant-numeric","font-variant-position","font-variation-settings","font-weight","forced-color-adjust","gap","glyph-orientation-horizontal","glyph-orientation-vertical","grid","grid-area","grid-auto-columns","grid-auto-flow","grid-auto-rows","grid-column","grid-column-end","grid-column-start","grid-gap","grid-row","grid-row-end","grid-row-start","grid-template","grid-template-areas","grid-template-columns","grid-template-rows","hanging-punctuation","height","hyphenate-character","hyphenate-limit-chars","hyphens","icon","image-orientation","image-rendering","image-resolution","ime-mode","initial-letter","initial-letter-align","inline-size","inset","inset-area","inset-block","inset-block-end","inset-block-start","inset-inline","inset-inline-end","inset-inline-start","isolation","justify-content","justify-items","justify-self","kerning","left","letter-spacing","lighting-color","line-break","line-height","line-height-step","list-style","list-style-image","list-style-position","list-style-type","margin","margin-block","margin-block-end","margin-block-start","margin-bottom","margin-inline","margin-inline-end","margin-inline-start","margin-left","margin-right","margin-top","margin-trim","marker","marker-end","marker-mid","marker-start","marks","mask","mask-border","mask-border-mode","mask-border-outset","mask-border-repeat","mask-border-slice","mask-border-source","mask-border-width","mask-clip","mask-composite","mask-image","mask-mode","mask-origin","mask-position","mask-repeat","mask-size","mask-type","masonry-auto-flow","math-depth","math-shift","math-style","max-block-size","max-height","max-inline-size","max-width","min-block-size","min-height","min-inline-size","min-width","mix-blend-mode","nav-down","nav-index","nav-left","nav-right","nav-up","none","normal","object-fit","object-position","offset","offset-anchor","offset-distance","offset-path","offset-position","offset-rotate","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-anchor","overflow-block","overflow-clip-margin","overflow-inline","overflow-wrap","overflow-x","overflow-y","overlay","overscroll-behavior","overscroll-behavior-block","overscroll-behavior-inline","overscroll-behavior-x","overscroll-behavior-y","padding","padding-block","padding-block-end","padding-block-start","padding-bottom","padding-inline","padding-inline-end","padding-inline-start","padding-left","padding-right","padding-top","page","page-break-after","page-break-before","page-break-inside","paint-order","pause","pause-after","pause-before","perspective","perspective-origin","place-content","place-items","place-self","pointer-events","position","position-anchor","position-visibility","print-color-adjust","quotes","r","resize","rest","rest-after","rest-before","right","rotate","row-gap","ruby-align","ruby-position","scale","scroll-behavior","scroll-margin","scroll-margin-block","scroll-margin-block-end","scroll-margin-block-start","scroll-margin-bottom","scroll-margin-inline","scroll-margin-inline-end","scroll-margin-inline-start","scroll-margin-left","scroll-margin-right","scroll-margin-top","scroll-padding","scroll-padding-block","scroll-padding-block-end","scroll-padding-block-start","scroll-padding-bottom","scroll-padding-inline","scroll-padding-inline-end","scroll-padding-inline-start","scroll-padding-left","scroll-padding-right","scroll-padding-top","scroll-snap-align","scroll-snap-stop","scroll-snap-type","scroll-timeline","scroll-timeline-axis","scroll-timeline-name","scrollbar-color","scrollbar-gutter","scrollbar-width","shape-image-threshold","shape-margin","shape-outside","shape-rendering","speak","speak-as","src","stop-color","stop-opacity","stroke","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","tab-size","table-layout","text-align","text-align-all","text-align-last","text-anchor","text-combine-upright","text-decoration","text-decoration-color","text-decoration-line","text-decoration-skip","text-decoration-skip-ink","text-decoration-style","text-decoration-thickness","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-indent","text-justify","text-orientation","text-overflow","text-rendering","text-shadow","text-size-adjust","text-transform","text-underline-offset","text-underline-position","text-wrap","text-wrap-mode","text-wrap-style","timeline-scope","top","touch-action","transform","transform-box","transform-origin","transform-style","transition","transition-behavior","transition-delay","transition-duration","transition-property","transition-timing-function","translate","unicode-bidi","user-modify","user-select","vector-effect","vertical-align","view-timeline","view-timeline-axis","view-timeline-inset","view-timeline-name","view-transition-name","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","white-space","white-space-collapse","widows","width","will-change","word-break","word-spacing","word-wrap","writing-mode","x","y","z-index","zoom"].sort().reverse();function $c($){let Z=tH0($),J=BB0,H=HB0,B="@[a-z-]+",Q="and or not only",X="[a-zA-Z-][a-zA-Z0-9_-]*",z={className:"variable",begin:"(\\$[a-zA-Z-][a-zA-Z0-9_-]*)\\b",relevance:0};return{name:"SCSS",case_insensitive:!0,illegal:"[=/|']",contains:[$.C_LINE_COMMENT_MODE,$.C_BLOCK_COMMENT_MODE,Z.CSS_NUMBER_MODE,{className:"selector-id",begin:"#[A-Za-z0-9_-]+",relevance:0},{className:"selector-class",begin:"\\.[A-Za-z0-9_-]+",relevance:0},Z.ATTRIBUTE_SELECTOR_MODE,{className:"selector-tag",begin:"\\b("+ZB0.join("|")+")\\b",relevance:0},{className:"selector-pseudo",begin:":("+H.join("|")+")"},{className:"selector-pseudo",begin:":(:)?("+J.join("|")+")"},z,{begin:/\(/,end:/\)/,contains:[Z.CSS_NUMBER_MODE]},Z.CSS_VARIABLE,{className:"attribute",begin:"\\b("+QB0.join("|")+")\\b"},{begin:"\\b(whitespace|wait|w-resize|visible|vertical-text|vertical-ideographic|uppercase|upper-roman|upper-alpha|underline|transparent|top|thin|thick|text|text-top|text-bottom|tb-rl|table-header-group|table-footer-group|sw-resize|super|strict|static|square|solid|small-caps|separate|se-resize|scroll|s-resize|rtl|row-resize|ridge|right|repeat|repeat-y|repeat-x|relative|progress|pointer|overline|outside|outset|oblique|nowrap|not-allowed|normal|none|nw-resize|no-repeat|no-drop|newspaper|ne-resize|n-resize|move|middle|medium|ltr|lr-tb|lowercase|lower-roman|lower-alpha|loose|list-item|line|line-through|line-edge|lighter|left|keep-all|justify|italic|inter-word|inter-ideograph|inside|inset|inline|inline-block|inherit|inactive|ideograph-space|ideograph-parenthesis|ideograph-numeric|ideograph-alpha|horizontal|hidden|help|hand|groove|fixed|ellipsis|e-resize|double|dotted|distribute|distribute-space|distribute-letter|distribute-all-lines|disc|disabled|default|decimal|dashed|crosshair|collapse|col-resize|circle|char|center|capitalize|break-word|break-all|bottom|both|bolder|bold|block|bidi-override|below|baseline|auto|always|all-scroll|absolute|table|table-cell)\\b"},{begin:/:/,end:/[;}{]/,relevance:0,contains:[Z.BLOCK_COMMENT,z,Z.HEXCOLOR,Z.CSS_NUMBER_MODE,$.QUOTE_STRING_MODE,$.APOS_STRING_MODE,Z.IMPORTANT,Z.FUNCTION_DISPATCH]},{begin:"@(page|font-face)",keywords:{$pattern:"@[a-z-]+",keyword:"@page @font-face"}},{begin:"@",end:"[{;]",returnBegin:!0,keywords:{$pattern:/[a-z-]+/,keyword:"and or not only",attribute:JB0.join(" ")},contains:[{begin:"@[a-z-]+",className:"keyword"},{begin:/[a-z-]+(?=:)/,className:"attribute"},z,$.QUOTE_STRING_MODE,$.APOS_STRING_MODE,Z.HEXCOLOR,Z.CSS_NUMBER_MODE]},Z.FUNCTION_DISPATCH]}}function Zc($){return{name:"Shell Session",aliases:["console","shellsession"],contains:[{className:"meta.prompt",begin:/^\s{0,3}[/~\w\d[\]()@-]*[>%$#][ ]?/,starts:{end:/[^\\](?=\s*$)/,subLanguage:"bash"}}]}}function Jc($){let Z=$.regex,J=$.COMMENT("--","$"),H={scope:"string",variants:[{begin:/'/,end:/'/,contains:[{match:/''/}]}]},B={begin:/"/,end:/"/,contains:[{match:/""/}]},Q=["true","false","unknown"],X=["double precision","large object","with timezone","without timezone"],z=["bigint","binary","blob","boolean","char","character","clob","date","dec","decfloat","decimal","float","int","integer","interval","nchar","nclob","national","numeric","real","row","smallint","time","timestamp","varchar","varying","varbinary"],G=["add","asc","collation","desc","final","first","last","view"],U=["abs","acos","all","allocate","alter","and","any","are","array","array_agg","array_max_cardinality","as","asensitive","asin","asymmetric","at","atan","atomic","authorization","avg","begin","begin_frame","begin_partition","between","bigint","binary","blob","boolean","both","by","call","called","cardinality","cascaded","case","cast","ceil","ceiling","char","char_length","character","character_length","check","classifier","clob","close","coalesce","collate","collect","column","commit","condition","connect","constraint","contains","convert","copy","corr","corresponding","cos","cosh","count","covar_pop","covar_samp","create","cross","cube","cume_dist","current","current_catalog","current_date","current_default_transform_group","current_path","current_role","current_row","current_schema","current_time","current_timestamp","current_path","current_role","current_transform_group_for_type","current_user","cursor","cycle","date","day","deallocate","dec","decimal","decfloat","declare","default","define","delete","dense_rank","deref","describe","deterministic","disconnect","distinct","double","drop","dynamic","each","element","else","empty","end","end_frame","end_partition","end-exec","equals","escape","every","except","exec","execute","exists","exp","external","extract","false","fetch","filter","first_value","float","floor","for","foreign","frame_row","free","from","full","function","fusion","get","global","grant","group","grouping","groups","having","hold","hour","identity","in","indicator","initial","inner","inout","insensitive","insert","int","integer","intersect","intersection","interval","into","is","join","json_array","json_arrayagg","json_exists","json_object","json_objectagg","json_query","json_table","json_table_primitive","json_value","lag","language","large","last_value","lateral","lead","leading","left","like","like_regex","listagg","ln","local","localtime","localtimestamp","log","log10","lower","match","match_number","match_recognize","matches","max","member","merge","method","min","minute","mod","modifies","module","month","multiset","national","natural","nchar","nclob","new","no","none","normalize","not","nth_value","ntile","null","nullif","numeric","octet_length","occurrences_regex","of","offset","old","omit","on","one","only","open","or","order","out","outer","over","overlaps","overlay","parameter","partition","pattern","per","percent","percent_rank","percentile_cont","percentile_disc","period","portion","position","position_regex","power","precedes","precision","prepare","primary","procedure","ptf","range","rank","reads","real","recursive","ref","references","referencing","regr_avgx","regr_avgy","regr_count","regr_intercept","regr_r2","regr_slope","regr_sxx","regr_sxy","regr_syy","release","result","return","returns","revoke","right","rollback","rollup","row","row_number","rows","running","savepoint","scope","scroll","search","second","seek","select","sensitive","session_user","set","show","similar","sin","sinh","skip","smallint","some","specific","specifictype","sql","sqlexception","sqlstate","sqlwarning","sqrt","start","static","stddev_pop","stddev_samp","submultiset","subset","substring","substring_regex","succeeds","sum","symmetric","system","system_time","system_user","table","tablesample","tan","tanh","then","time","timestamp","timezone_hour","timezone_minute","to","trailing","translate","translate_regex","translation","treat","trigger","trim","trim_array","true","truncate","uescape","union","unique","unknown","unnest","update","upper","user","using","value","values","value_of","var_pop","var_samp","varbinary","varchar","varying","versioning","when","whenever","where","width_bucket","window","with","within","without","year"],Y=["abs","acos","array_agg","asin","atan","avg","cast","ceil","ceiling","coalesce","corr","cos","cosh","count","covar_pop","covar_samp","cume_dist","dense_rank","deref","element","exp","extract","first_value","floor","json_array","json_arrayagg","json_exists","json_object","json_objectagg","json_query","json_table","json_table_primitive","json_value","lag","last_value","lead","listagg","ln","log","log10","lower","max","min","mod","nth_value","ntile","nullif","percent_rank","percentile_cont","percentile_disc","position","position_regex","power","rank","regr_avgx","regr_avgy","regr_count","regr_intercept","regr_r2","regr_slope","regr_sxx","regr_sxy","regr_syy","row_number","sin","sinh","sqrt","stddev_pop","stddev_samp","substring","substring_regex","sum","tan","tanh","translate","translate_regex","treat","trim","trim_array","unnest","upper","value_of","var_pop","var_samp","width_bucket"],K=["current_catalog","current_date","current_default_transform_group","current_path","current_role","current_schema","current_transform_group_for_type","current_user","session_user","system_time","system_user","current_time","localtime","current_timestamp","localtimestamp"],F=["create table","insert into","primary key","foreign key","not null","alter table","add constraint","grouping sets","on overflow","character set","respect nulls","ignore nulls","nulls first","nulls last","depth first","breadth first"],W=Y,q=[...U,...G].filter((M)=>{return!Y.includes(M)}),N={scope:"variable",match:/@[a-z0-9][a-z0-9_]*/},D={scope:"operator",match:/[-+*/=%^~]|&&?|\|\|?|!=?|<(?:=>?|<|>)?|>[>=]?/,relevance:0},A={match:Z.concat(/\b/,Z.either(...W),/\s*\(/),relevance:0,keywords:{built_in:W}};function V(M){return Z.concat(/\b/,Z.either(...M.map((_)=>{return _.replace(/\s+/,"\\s+")})),/\b/)}let L={scope:"keyword",match:V(F),relevance:0};function O(M,{exceptions:_,when:w}={}){let C=w;return _=_||[],M.map((E)=>{if(E.match(/\|\d+$/)||_.includes(E))return E;else if(C(E))return`${E}|0`;else return E})}return{name:"SQL",case_insensitive:!0,illegal:/[{}]|<\//,keywords:{$pattern:/\b[\w\.]+/,keyword:O(q,{when:(M)=>M.length<3}),literal:Q,type:z,built_in:K},contains:[{scope:"type",match:V(X)},L,A,N,H,B,$.C_NUMBER_MODE,$.C_BLOCK_COMMENT_MODE,J,D]}}function Xc($){if(!$)return null;if(typeof $==="string")return $;return $.source}function LX($){return C5("(?=",$,")")}function C5(...$){return $.map((J)=>Xc(J)).join("")}function XB0($){let Z=$[$.length-1];if(typeof Z==="object"&&Z.constructor===Object)return $.splice($.length-1,1),Z;else return{}}function y4(...$){return"("+(XB0($).capture?"":"?:")+$.map((H)=>Xc(H)).join("|")+")"}var FP=($)=>C5(/\b/,$,/\w$/.test($)?/\b/:/\B/),zB0=["Protocol","Type"].map(FP),Hc=["init","self"].map(FP),GB0=["Any","Self"],YP=["actor","any","associatedtype","async","await",/as\?/,/as!/,"as","borrowing","break","case","catch","class","consume","consuming","continue","convenience","copy","default","defer","deinit","didSet","distributed","do","dynamic","each","else","enum","extension","fallthrough",/fileprivate\(set\)/,"fileprivate","final","for","func","get","guard","if","import","indirect","infix",/init\?/,/init!/,"inout",/internal\(set\)/,"internal","in","is","isolated","nonisolated","lazy","let","macro","mutating","nonmutating",/open\(set\)/,"open","operator","optional","override","package","postfix","precedencegroup","prefix",/private\(set\)/,"private","protocol",/public\(set\)/,"public","repeat","required","rethrows","return","set","some","static","struct","subscript","super","switch","throws","throw",/try\?/,/try!/,"try","typealias",/unowned\(safe\)/,/unowned\(unsafe\)/,"unowned","var","weak","where","while","willSet"],Bc=["false","nil","true"],UB0=["assignment","associativity","higherThan","left","lowerThan","none","right"],YB0=["#colorLiteral","#column","#dsohandle","#else","#elseif","#endif","#error","#file","#fileID","#fileLiteral","#filePath","#function","#if","#imageLiteral","#keyPath","#line","#selector","#sourceLocation","#warning"],Qc=["abs","all","any","assert","assertionFailure","debugPrint","dump","fatalError","getVaList","isKnownUniquelyReferenced","max","min","numericCast","pointwiseMax","pointwiseMin","precondition","preconditionFailure","print","readLine","repeatElement","sequence","stride","swap","swift_unboxFromSwiftValueWithType","transcode","type","unsafeBitCast","unsafeDowncast","withExtendedLifetime","withUnsafeMutablePointer","withUnsafePointer","withVaList","withoutActuallyEscaping","zip"],zc=y4(/[/=\-+!*%<>&|^~?]/,/[\u00A1-\u00A7]/,/[\u00A9\u00AB]/,/[\u00AC\u00AE]/,/[\u00B0\u00B1]/,/[\u00B6\u00BB\u00BF\u00D7\u00F7]/,/[\u2016-\u2017]/,/[\u2020-\u2027]/,/[\u2030-\u203E]/,/[\u2041-\u2053]/,/[\u2055-\u205E]/,/[\u2190-\u23FF]/,/[\u2500-\u2775]/,/[\u2794-\u2BFF]/,/[\u2E00-\u2E7F]/,/[\u3001-\u3003]/,/[\u3008-\u3020]/,/[\u3030]/),Gc=y4(zc,/[\u0300-\u036F]/,/[\u1DC0-\u1DFF]/,/[\u20D0-\u20FF]/,/[\uFE00-\uFE0F]/,/[\uFE20-\uFE2F]/),KP=C5(zc,Gc,"*"),Uc=y4(/[a-zA-Z_]/,/[\u00A8\u00AA\u00AD\u00AF\u00B2-\u00B5\u00B7-\u00BA]/,/[\u00BC-\u00BE\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u00FF]/,/[\u0100-\u02FF\u0370-\u167F\u1681-\u180D\u180F-\u1DBF]/,/[\u1E00-\u1FFF]/,/[\u200B-\u200D\u202A-\u202E\u203F-\u2040\u2054\u2060-\u206F]/,/[\u2070-\u20CF\u2100-\u218F\u2460-\u24FF\u2776-\u2793]/,/[\u2C00-\u2DFF\u2E80-\u2FFF]/,/[\u3004-\u3007\u3021-\u302F\u3031-\u303F\u3040-\uD7FF]/,/[\uF900-\uFD3D\uFD40-\uFDCF\uFDF0-\uFE1F\uFE30-\uFE44]/,/[\uFE47-\uFEFE\uFF00-\uFFFD]/),xW=y4(Uc,/\d/,/[\u0300-\u036F\u1DC0-\u1DFF\u20D0-\u20FF\uFE20-\uFE2F]/),W3=C5(Uc,xW,"*"),yW=C5(/[A-Z]/,xW,"*"),KB0=["attached","autoclosure",C5(/convention\(/,y4("swift","block","c"),/\)/),"discardableResult","dynamicCallable","dynamicMemberLookup","escaping","freestanding","frozen","GKInspectable","IBAction","IBDesignable","IBInspectable","IBOutlet","IBSegueAction","inlinable","main","nonobjc","NSApplicationMain","NSCopying","NSManaged",C5(/objc\(/,W3,/\)/),"objc","objcMembers","propertyWrapper","requires_stored_property_inits","resultBuilder","Sendable","testable","UIApplicationMain","unchecked","unknown","usableFromInline","warn_unqualified_access"],FB0=["iOS","iOSApplicationExtension","macOS","macOSApplicationExtension","macCatalyst","macCatalystApplicationExtension","watchOS","watchOSApplicationExtension","tvOS","tvOSApplicationExtension","swift"];function Yc($){let Z={match:/\s+/,relevance:0},J=$.COMMENT("/\\*","\\*/",{contains:["self"]}),H=[$.C_LINE_COMMENT_MODE,J],B={match:[/\./,y4(...zB0,...Hc)],className:{2:"keyword"}},Q={match:C5(/\./,y4(...YP)),relevance:0},X=YP.filter((F0)=>typeof F0==="string").concat(["_|0"]),z=YP.filter((F0)=>typeof F0!=="string").concat(GB0).map(FP),G={variants:[{className:"keyword",match:y4(...z,...Hc)}]},U={$pattern:y4(/\b\w+/,/#\w+/),keyword:X.concat(YB0),literal:Bc},Y=[B,Q,G],K={match:C5(/\./,y4(...Qc)),relevance:0},F={className:"built_in",match:C5(/\b/,y4(...Qc),/(?=\()/)},W=[K,F],q={match:/->/,relevance:0},N={className:"operator",relevance:0,variants:[{match:KP},{match:`\\.(\\.|${Gc})+`}]},D=[q,N],A="([0-9]_*)+",V="([0-9a-fA-F]_*)+",L={className:"number",relevance:0,variants:[{match:"\\b(([0-9]_*)+)(\\.(([0-9]_*)+))?([eE][+-]?(([0-9]_*)+))?\\b"},{match:"\\b0x(([0-9a-fA-F]_*)+)(\\.(([0-9a-fA-F]_*)+))?([pP][+-]?(([0-9]_*)+))?\\b"},{match:/\b0o([0-7]_*)+\b/},{match:/\b0b([01]_*)+\b/}]},O=(F0="")=>({className:"subst",variants:[{match:C5(/\\/,F0,/[0\\tnr"']/)},{match:C5(/\\/,F0,/u\{[0-9a-fA-F]{1,8}\}/)}]}),M=(F0="")=>({className:"subst",match:C5(/\\/,F0,/[\t ]*(?:[\r\n]|\r\n)/)}),_=(F0="")=>({className:"subst",label:"interpol",begin:C5(/\\/,F0,/\(/),end:/\)/}),w=(F0="")=>({begin:C5(F0,/"""/),end:C5(/"""/,F0),contains:[O(F0),M(F0),_(F0)]}),C=(F0="")=>({begin:C5(F0,/"/),end:C5(/"/,F0),contains:[O(F0),_(F0)]}),E={className:"string",variants:[w(),w("#"),w("##"),w("###"),C(),C("#"),C("##"),C("###")]},j=[$.BACKSLASH_ESCAPE,{begin:/\[/,end:/\]/,relevance:0,contains:[$.BACKSLASH_ESCAPE]}],k={begin:/\/[^\s](?=[^/\n]*\/)/,end:/\//,contains:j},S=(F0)=>{let s=C5(F0,/\//),a=C5(/\//,F0);return{begin:s,end:a,contains:[...j,{scope:"comment",begin:`#(?!.*${a})`,end:/$/}]}},I={scope:"regexp",variants:[S("###"),S("##"),S("#"),k]},T={match:C5(/`/,W3,/`/)},y={className:"variable",match:/\$\d+/},R={className:"variable",match:`\\$${xW}+`},x=[T,y,R],v={match:/(@|#(un)?)available/,scope:"keyword",starts:{contains:[{begin:/\(/,end:/\)/,keywords:FB0,contains:[...D,L,E]}]}},f={scope:"keyword",match:C5(/@/,y4(...KB0),LX(y4(/\(/,/\s+/)))},b={scope:"meta",match:C5(/@/,W3)},l=[v,f,b],r={match:LX(/\b[A-Z]/),relevance:0,contains:[{className:"type",match:C5(/(AV|CA|CF|CG|CI|CL|CM|CN|CT|MK|MP|MTK|MTL|NS|SCN|SK|UI|WK|XC)/,xW,"+")},{className:"type",match:yW,relevance:0},{match:/[?!]+/,relevance:0},{match:/\.\.\./,relevance:0},{match:C5(/\s+&\s+/,LX(yW)),relevance:0}]},h={begin:/</,end:/>/,keywords:U,contains:[...H,...Y,...l,q,r]};r.contains.push(h);let d={match:C5(W3,/\s*:/),keywords:"_|0",relevance:0},o={begin:/\(/,end:/\)/,relevance:0,keywords:U,contains:["self",d,...H,I,...Y,...W,...D,L,E,...x,...l,r]},p={begin:/</,end:/>/,keywords:"repeat each",contains:[...H,r]},i={begin:y4(LX(C5(W3,/\s*:/)),LX(C5(W3,/\s+/,W3,/\s*:/))),end:/:/,relevance:0,contains:[{className:"keyword",match:/\b_\b/},{className:"params",match:W3}]},n={begin:/\(/,end:/\)/,keywords:U,contains:[i,...H,...Y,...D,L,E,...l,r,o],endsParent:!0,illegal:/["']/},Z0={match:[/(func|macro)/,/\s+/,y4(T.match,W3,KP)],className:{1:"keyword",3:"title.function"},contains:[p,n,Z],illegal:[/\[/,/%/]},J0={match:[/\b(?:subscript|init[?!]?)/,/\s*(?=[<(])/],className:{1:"keyword"},contains:[p,n,Z],illegal:/\[|%/},U0={match:[/operator/,/\s+/,KP],className:{1:"keyword",3:"title"}},z0={begin:[/precedencegroup/,/\s+/,yW],className:{1:"keyword",3:"title"},contains:[r],keywords:[...UB0,...Bc],end:/}/},X0={match:[/class\b/,/\s+/,/func\b/,/\s+/,/\b[A-Za-z_][A-Za-z0-9_]*\b/],scope:{1:"keyword",3:"keyword",5:"title.function"}},q0={match:[/class\b/,/\s+/,/var\b/],scope:{1:"keyword",3:"keyword"}},N0={begin:[/(struct|protocol|class|extension|enum|actor)/,/\s+/,W3,/\s*/],beginScope:{1:"keyword",3:"title.class"},keywords:U,contains:[p,...Y,{begin:/:/,end:/\{/,keywords:U,contains:[{scope:"title.class.inherited",match:yW},...Y],relevance:0}]};for(let F0 of E.variants){let s=F0.contains.find(($0)=>$0.label==="interpol");s.keywords=U;let a=[...Y,...W,...D,L,E,...x];s.contains=[...a,{begin:/\(/,end:/\)/,contains:["self",...a]}]}return{name:"Swift",keywords:U,contains:[...H,Z0,J0,X0,q0,N0,U0,z0,{beginKeywords:"import",end:/$/,contains:[...H],relevance:0},I,...Y,...W,...D,L,E,...x,...l,r,o]}}var Kc=["as","in","of","if","for","while","finally","var","new","function","do","return","void","else","break","catch","instanceof","with","throw","case","default","try","switch","continue","typeof","delete","let","yield","const","class","debugger","async","await","static","import","from","export","extends","using"],Fc=["true","false","null","undefined","NaN","Infinity"],Wc=["Object","Function","Boolean","Symbol","Math","Date","Number","BigInt","String","RegExp","Array","Float32Array","Float64Array","Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Int32Array","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array","Set","Map","WeakSet","WeakMap","ArrayBuffer","SharedArrayBuffer","Atomics","DataView","JSON","Promise","Generator","GeneratorFunction","AsyncFunction","Reflect","Proxy","Intl","WebAssembly"],qc=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],Nc=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],Ac=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],Dc=[].concat(Nc,Wc,qc);function WB0($){let Z=$.regex,J=(v,{after:f})=>{let b="</"+v[0].slice(1);return v.input.indexOf(b,f)!==-1},H="[A-Za-z$_][0-9A-Za-z$_]*",B={begin:"<>",end:"</>"},Q=/<[A-Za-z0-9\\._:-]+\s*\/>/,X={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(v,f)=>{let b=v[0].length+v.index,l=v.input[b];if(l==="<"||l===","){f.ignoreMatch();return}if(l===">"){if(!J(v,{after:b}))f.ignoreMatch()}let r,h=v.input.substring(b);if(r=h.match(/^\s*=/)){f.ignoreMatch();return}if(r=h.match(/^\s+extends\s+/)){if(r.index===0){f.ignoreMatch();return}}}},z={$pattern:"[A-Za-z$_][0-9A-Za-z$_]*",keyword:Kc,literal:Fc,built_in:Dc,"variable.language":Ac},G="[0-9](_?[0-9])*",U="\\.([0-9](_?[0-9])*)",Y="0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*",K={className:"number",variants:[{begin:"(\\b(0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*)((\\.([0-9](_?[0-9])*))|\\.)?|(\\.([0-9](_?[0-9])*)))[eE][+-]?([0-9](_?[0-9])*)\\b"},{begin:"\\b(0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*)\\b((\\.([0-9](_?[0-9])*))\\b|\\.)?|(\\.([0-9](_?[0-9])*))\\b"},{begin:"\\b(0|[1-9](_?[0-9])*)n\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*n?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*n?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*n?\\b"},{begin:"\\b0[0-7]+n?\\b"}],relevance:0},F={className:"subst",begin:"\\$\\{",end:"\\}",keywords:z,contains:[]},W={begin:".?html`",end:"",starts:{end:"`",returnEnd:!1,contains:[$.BACKSLASH_ESCAPE,F],subLanguage:"xml"}},q={begin:".?css`",end:"",starts:{end:"`",returnEnd:!1,contains:[$.BACKSLASH_ESCAPE,F],subLanguage:"css"}},N={begin:".?gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[$.BACKSLASH_ESCAPE,F],subLanguage:"graphql"}},D={className:"string",begin:"`",end:"`",contains:[$.BACKSLASH_ESCAPE,F]},V={className:"comment",variants:[$.COMMENT(/\/\*\*(?!\/)/,"\\*/",{relevance:0,contains:[{begin:"(?=@[A-Za-z]+)",relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"},{className:"type",begin:"\\{",end:"\\}",excludeEnd:!0,excludeBegin:!0,relevance:0},{className:"variable",begin:"[A-Za-z$_][0-9A-Za-z$_]*(?=\\s*(-)|$)",endsParent:!0,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}]}),$.C_BLOCK_COMMENT_MODE,$.C_LINE_COMMENT_MODE]},L=[$.APOS_STRING_MODE,$.QUOTE_STRING_MODE,W,q,N,D,{match:/\$\d+/},K];F.contains=L.concat({begin:/\{/,end:/\}/,keywords:z,contains:["self"].concat(L)});let O=[].concat(V,F.contains),M=O.concat([{begin:/(\s*)\(/,end:/\)/,keywords:z,contains:["self"].concat(O)}]),_={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:z,contains:M},w={variants:[{match:[/class/,/\s+/,"[A-Za-z$_][0-9A-Za-z$_]*",/\s+/,/extends/,/\s+/,Z.concat("[A-Za-z$_][0-9A-Za-z$_]*","(",Z.concat(/\./,"[A-Za-z$_][0-9A-Za-z$_]*"),")*")],scope:{1:"keyword",3:"title.class",5:"keyword",7:"title.class.inherited"}},{match:[/class/,/\s+/,"[A-Za-z$_][0-9A-Za-z$_]*"],scope:{1:"keyword",3:"title.class"}}]},C={relevance:0,match:Z.either(/\bJSON/,/\b[A-Z][a-z]+([A-Z][a-z]*|\d)*/,/\b[A-Z]{2,}([A-Z][a-z]+|\d)+([A-Z][a-z]*)*/,/\b[A-Z]{2,}[a-z]+([A-Z][a-z]+|\d)*([A-Z][a-z]*)*/),className:"title.class",keywords:{_:[...Wc,...qc]}},E={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},j={variants:[{match:[/function/,/\s+/,"[A-Za-z$_][0-9A-Za-z$_]*",/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[_],illegal:/%/},k={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function S(v){return Z.concat("(?!",v.join("|"),")")}let I={match:Z.concat(/\b/,S([...Nc,"super","import"].map((v)=>`${v}\\s*\\(`)),"[A-Za-z$_][0-9A-Za-z$_]*",Z.lookahead(/\s*\(/)),className:"title.function",relevance:0},T={begin:Z.concat(/\./,Z.lookahead(Z.concat("[A-Za-z$_][0-9A-Za-z$_]*",/(?![0-9A-Za-z$_(])/))),end:"[A-Za-z$_][0-9A-Za-z$_]*",excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},y={match:[/get|set/,/\s+/,"[A-Za-z$_][0-9A-Za-z$_]*",/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},_]},R="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+$.UNDERSCORE_IDENT_RE+")\\s*=>",x={match:[/const|var|let/,/\s+/,"[A-Za-z$_][0-9A-Za-z$_]*",/\s*/,/=\s*/,/(async\s*)?/,Z.lookahead(R)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[_]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:z,exports:{PARAMS_CONTAINS:M,CLASS_REFERENCE:C},illegal:/#(?![$_A-z])/,contains:[$.SHEBANG({label:"shebang",binary:"node",relevance:5}),E,$.APOS_STRING_MODE,$.QUOTE_STRING_MODE,W,q,N,D,V,{match:/\$\d+/},K,C,{scope:"attr",match:"[A-Za-z$_][0-9A-Za-z$_]*"+Z.lookahead(":"),relevance:0},x,{begin:"("+$.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[V,$.REGEXP_MODE,{className:"function",begin:R,returnBegin:!0,end:"\\s*=>",contains:[{className:"params",variants:[{begin:$.UNDERSCORE_IDENT_RE,relevance:0},{className:null,begin:/\(\s*\)/,skip:!0},{begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:z,contains:M}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:B.begin,end:B.end},{match:Q},{begin:X.begin,"on:begin":X.isTrulyOpeningTag,end:X.end}],subLanguage:"xml",contains:[{begin:X.begin,end:X.end,skip:!0,contains:["self"]}]}]},j,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+$.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[_,$.inherit($.TITLE_MODE,{begin:"[A-Za-z$_][0-9A-Za-z$_]*",className:"title.function"})]},{match:/\.\.\./,relevance:0},T,{match:"\\$[A-Za-z$_][0-9A-Za-z$_]*",relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[_]},I,k,w,y,{match:/\$[(.]/}]}}function Vc($){let Z=$.regex,J=WB0($),H="[A-Za-z$_][0-9A-Za-z$_]*",B=["any","void","number","boolean","string","object","never","symbol","bigint","unknown"],Q={begin:[/namespace/,/\s+/,$.IDENT_RE],beginScope:{1:"keyword",3:"title.class"}},X={beginKeywords:"interface",end:/\{/,excludeEnd:!0,keywords:{keyword:"interface extends",built_in:B},contains:[J.exports.CLASS_REFERENCE]},z={className:"meta",relevance:10,begin:/^\s*['"]use strict['"]/},G=["type","interface","public","private","protected","implements","declare","abstract","readonly","enum","override","satisfies"],U={$pattern:"[A-Za-z$_][0-9A-Za-z$_]*",keyword:Kc.concat(G),literal:Fc,built_in:Dc.concat(B),"variable.language":Ac},Y={className:"meta",begin:"@[A-Za-z$_][0-9A-Za-z$_]*"},K=(N,D,A)=>{let V=N.contains.findIndex((L)=>L.label===D);if(V===-1)throw Error("can not find mode to replace");N.contains.splice(V,1,A)};Object.assign(J.keywords,U),J.exports.PARAMS_CONTAINS.push(Y);let F=J.contains.find((N)=>N.scope==="attr"),W=Object.assign({},F,{match:Z.concat("[A-Za-z$_][0-9A-Za-z$_]*",Z.lookahead(/\s*\?:/))});J.exports.PARAMS_CONTAINS.push([J.exports.CLASS_REFERENCE,F,W]),J.contains=J.contains.concat([Y,Q,X,W]),K(J,"shebang",$.SHEBANG()),K(J,"use_strict",z);let q=J.contains.find((N)=>N.label==="func.def");return q.relevance=0,Object.assign(J,{name:"TypeScript",aliases:["ts","tsx","mts","cts"]}),J}function Lc($){let Z=$.regex,J={className:"string",begin:/"(""|[^/n])"C\b/},H={className:"string",begin:/"/,end:/"/,illegal:/\n/,contains:[{begin:/""/}]},B=/\d{1,2}\/\d{1,2}\/\d{4}/,Q=/\d{4}-\d{1,2}-\d{1,2}/,X=/(\d|1[012])(:\d+){0,2} *(AM|PM)/,z=/\d{1,2}(:\d{1,2}){1,2}/,G={className:"literal",variants:[{begin:Z.concat(/# */,Z.either(Q,B),/ *#/)},{begin:Z.concat(/# */,z,/ *#/)},{begin:Z.concat(/# */,X,/ *#/)},{begin:Z.concat(/# */,Z.either(Q,B),/ +/,Z.either(X,z),/ *#/)}]},U={className:"number",relevance:0,variants:[{begin:/\b\d[\d_]*((\.[\d_]+(E[+-]?[\d_]+)?)|(E[+-]?[\d_]+))[RFD@!#]?/},{begin:/\b\d[\d_]*((U?[SIL])|[%&])?/},{begin:/&H[\dA-F_]+((U?[SIL])|[%&])?/},{begin:/&O[0-7_]+((U?[SIL])|[%&])?/},{begin:/&B[01_]+((U?[SIL])|[%&])?/}]},Y={className:"label",begin:/^\w+:/},K=$.COMMENT(/'''/,/$/,{contains:[{className:"doctag",begin:/<\/?/,end:/>/}]}),F=$.COMMENT(null,/$/,{variants:[{begin:/'/},{begin:/([\t ]|^)REM(?=\s)/}]});return{name:"Visual Basic .NET",aliases:["vb"],case_insensitive:!0,classNameAliases:{label:"symbol"},keywords:{keyword:"addhandler alias aggregate ansi as async assembly auto binary by byref byval call case catch class compare const continue custom declare default delegate dim distinct do each equals else elseif end enum erase error event exit explicit finally for friend from function get global goto group handles if implements imports in inherits interface into iterator join key let lib loop me mid module mustinherit mustoverride mybase myclass namespace narrowing new next notinheritable notoverridable of off on operator option optional order overloads overridable overrides paramarray partial preserve private property protected public raiseevent readonly redim removehandler resume return select set shadows shared skip static step stop structure strict sub synclock take text then throw to try unicode until using when where while widening with withevents writeonly yield",built_in:"addressof and andalso await directcast gettype getxmlnamespace is isfalse isnot istrue like mod nameof new not or orelse trycast typeof xor cbool cbyte cchar cdate cdbl cdec cint clng cobj csbyte cshort csng cstr cuint culng cushort",type:"boolean byte char date decimal double integer long object sbyte short single string uinteger ulong ushort",literal:"true false nothing"},illegal:"//|\\{|\\}|endif|gosub|variant|wend|^\\$ ",contains:[J,H,G,U,Y,K,F,{className:"meta",begin:/[\t ]*#(const|disable|else|elseif|enable|end|externalsource|if|region)\b/,end:/$/,keywords:{keyword:"const disable else elseif enable end externalsource if region then"},contains:[F]}]}}function Mc($){$.regex;let Z=$.COMMENT(/\(;/,/;\)/);Z.contains.push("self");let J=$.COMMENT(/;;/,/$/),H=["anyfunc","block","br","br_if","br_table","call","call_indirect","data","drop","elem","else","end","export","func","global.get","global.set","local.get","local.set","local.tee","get_global","get_local","global","if","import","local","loop","memory","memory.grow","memory.size","module","mut","nop","offset","param","result","return","select","set_global","set_local","start","table","tee_local","then","type","unreachable"],B={begin:[/(?:func|call|call_indirect)/,/\s+/,/\$[^\s)]+/],className:{1:"keyword",3:"title.function"}},Q={className:"variable",begin:/\$[\w_]+/},X={match:/(\((?!;)|\))+/,className:"punctuation",relevance:0},z={className:"number",relevance:0,match:/[+-]?\b(?:\d(?:_?\d)*(?:\.\d(?:_?\d)*)?(?:[eE][+-]?\d(?:_?\d)*)?|0x[\da-fA-F](?:_?[\da-fA-F])*(?:\.[\da-fA-F](?:_?[\da-fA-D])*)?(?:[pP][+-]?\d(?:_?\d)*)?)\b|\binf\b|\bnan(?::0x[\da-fA-F](?:_?[\da-fA-D])*)?\b/},G={match:/(i32|i64|f32|f64)(?!\.)/,className:"type"},U={className:"keyword",match:/\b(f32|f64|i32|i64)(?:\.(?:abs|add|and|ceil|clz|const|convert_[su]\/i(?:32|64)|copysign|ctz|demote\/f64|div(?:_[su])?|eqz?|extend_[su]\/i32|floor|ge(?:_[su])?|gt(?:_[su])?|le(?:_[su])?|load(?:(?:8|16|32)_[su])?|lt(?:_[su])?|max|min|mul|nearest|neg?|or|popcnt|promote\/f32|reinterpret\/[fi](?:32|64)|rem_[su]|rot[lr]|shl|shr_[su]|store(?:8|16|32)?|sqrt|sub|trunc(?:_[su]\/f(?:32|64))?|wrap\/i64|xor))\b/};return{name:"WebAssembly",keywords:{$pattern:/[\w.]+/,keyword:H},contains:[J,Z,{match:[/(?:offset|align)/,/\s*/,/=/],className:{1:"keyword",3:"operator"}},Q,X,B,$.QUOTE_STRING_MODE,G,U,z]}}function Pc($){let Z=$.regex,J=Z.concat(/[\p{L}_]/u,Z.optional(/[\p{L}0-9_.-]*:/u),/[\p{L}0-9_.-]*/u),H=/[\p{L}0-9._:-]+/u,B={className:"symbol",begin:/&[a-z]+;|&#[0-9]+;|&#x[a-f0-9]+;/},Q={begin:/\s/,contains:[{className:"keyword",begin:/#?[a-z_][a-z1-9_-]+/,illegal:/\n/}]},X=$.inherit(Q,{begin:/\(/,end:/\)/}),z=$.inherit($.APOS_STRING_MODE,{className:"string"}),G=$.inherit($.QUOTE_STRING_MODE,{className:"string"}),U={endsWithParent:!0,illegal:/</,relevance:0,contains:[{className:"attr",begin:H,relevance:0},{begin:/=\s*/,relevance:0,contains:[{className:"string",endsParent:!0,variants:[{begin:/"/,end:/"/,contains:[B]},{begin:/'/,end:/'/,contains:[B]},{begin:/[^\s"'=<>`]+/}]}]}]};return{name:"HTML, XML",aliases:["html","xhtml","rss","atom","xjb","xsd","xsl","plist","wsf","svg"],case_insensitive:!0,unicodeRegex:!0,contains:[{className:"meta",begin:/<![a-z]/,end:/>/,relevance:10,contains:[Q,G,z,X,{begin:/\[/,end:/\]/,contains:[{className:"meta",begin:/<![a-z]/,end:/>/,contains:[Q,X,G,z]}]}]},$.COMMENT(/<!--/,/-->/,{relevance:10}),{begin:/<!\[CDATA\[/,end:/\]\]>/,relevance:10},B,{className:"meta",end:/\?>/,variants:[{begin:/<\?xml/,relevance:10,contains:[G]},{begin:/<\?[a-z][a-z0-9]+/}]},{className:"tag",begin:/<style(?=\s|>)/,end:/>/,keywords:{name:"style"},contains:[U],starts:{end:/<\/style>/,returnEnd:!0,subLanguage:["css","xml"]}},{className:"tag",begin:/<script(?=\s|>)/,end:/>/,keywords:{name:"script"},contains:[U],starts:{end:/<\/script>/,returnEnd:!0,subLanguage:["javascript","handlebars","xml"]}},{className:"tag",begin:/<>|<\/>/},{className:"tag",begin:Z.concat(/</,Z.lookahead(Z.concat(J,Z.either(/\/>/,/>/,/\s/)))),end:/\/?>/,contains:[{className:"name",begin:J,relevance:0,starts:U}]},{className:"tag",begin:Z.concat(/<\//,Z.lookahead(Z.concat(J,/>/))),contains:[{className:"name",begin:J,relevance:0},{begin:/>/,relevance:0,endsParent:!0}]}]}}function _c($){let H={className:"attr",variants:[{begin:/[\w*@][\w*@ :()\./-]*:(?=[ \t]|$)/},{begin:/"[\w*@][\w*@ :()\./-]*":(?=[ \t]|$)/},{begin:/'[\w*@][\w*@ :()\./-]*':(?=[ \t]|$)/}]},B={className:"template-variable",variants:[{begin:/\{\{/,end:/\}\}/},{begin:/%\{/,end:/\}/}]},Q={className:"string",relevance:0,begin:/'/,end:/'/,contains:[{match:/''/,scope:"char.escape",relevance:0}]},X={className:"string",relevance:0,variants:[{begin:/"/,end:/"/},{begin:/\S+/}],contains:[$.BACKSLASH_ESCAPE,B]},z=$.inherit(X,{variants:[{begin:/'/,end:/'/,contains:[{begin:/''/,relevance:0}]},{begin:/"/,end:/"/},{begin:/[^\s,{}[\]]+/}]}),G="[0-9]{4}(-[0-9][0-9]){0,2}",U="([Tt \\t][0-9][0-9]?(:[0-9][0-9]){2})?",Y="(\\.[0-9]*)?",K="([ \\t])*(Z|[-+][0-9][0-9]?(:[0-9][0-9])?)?",F={className:"number",begin:"\\b[0-9]{4}(-[0-9][0-9]){0,2}([Tt \\t][0-9][0-9]?(:[0-9][0-9]){2})?(\\.[0-9]*)?([ \\t])*(Z|[-+][0-9][0-9]?(:[0-9][0-9])?)?\\b"},W={end:",",endsWithParent:!0,excludeEnd:!0,keywords:"true false yes no null",relevance:0},q={begin:/\{/,end:/\}/,contains:[W],illegal:"\\n",relevance:0},N={begin:"\\[",end:"\\]",contains:[W],illegal:"\\n",relevance:0},D=[H,{className:"meta",begin:"^---\\s*$",relevance:10},{className:"string",begin:"[\\|>]([1-9]?[+-])?[ ]*\\n( +)[^ ][^\\n]*\\n(\\2[^\\n]+\\n?)*"},{begin:"<%[%=-]?",end:"[%-]?%>",subLanguage:"ruby",excludeBegin:!0,excludeEnd:!0,relevance:0},{className:"type",begin:"!\\w+![\\w#;/?:@&=+$,.~*'()[\\]]+"},{className:"type",begin:"!<[\\w#;/?:@&=+$,.~*'()[\\]]+>"},{className:"type",begin:"![\\w#;/?:@&=+$,.~*'()[\\]]+"},{className:"type",begin:"!![\\w#;/?:@&=+$,.~*'()[\\]]+"},{className:"meta",begin:"&"+$.UNDERSCORE_IDENT_RE+"$"},{className:"meta",begin:"\\*"+$.UNDERSCORE_IDENT_RE+"$"},{className:"bullet",begin:"-(?=[ ]|$)",relevance:0},$.HASH_COMMENT_MODE,{beginKeywords:"true false yes no null",keywords:{literal:"true false yes no null"}},F,{className:"number",begin:$.C_NUMBER_RE+"\\b",relevance:0},q,N,Q,X],A=[...D];return A.pop(),A.push(z),W.contains=A,{name:"YAML",case_insensitive:!0,aliases:["yml"],contains:D}}var WP={arduino:Lp,bash:Mp,c:Pp,cpp:_p,csharp:Op,css:jp,diff:Tp,go:Cp,graphql:Ep,ini:bp,java:Rp,javascript:xp,json:hp,kotlin:vp,less:mp,lua:up,makefile:pp,markdown:cp,objectivec:dp,perl:lp,php:ip,"php-template":rp,plaintext:ap,python:op,"python-repl":np,r:sp,ruby:tp,rust:ep,scss:$c,shell:Zc,sql:Jc,swift:Yc,typescript:Vc,vbnet:Lc,wasm:Mc,xml:Pc,yaml:_c};var ic=P(lc(),1);var rc=ic.default;var ac={},HQ0="hljs-";function MP($){let Z=rc.newInstance();if($)Q($);return{highlight:J,highlightAuto:H,listLanguages:B,register:Q,registerAlias:X,registered:z};function J(G,U,Y){X5(typeof G==="string","expected `string` as `name`"),X5(typeof U==="string","expected `string` as `value`");let K=Y||ac,F=typeof K.prefix==="string"?K.prefix:HQ0;if(!Z.getLanguage(G))throw Error("Unknown language: `"+G+"` is not registered");Z.configure({__emitter:oc,classPrefix:F});let W=Z.highlight(U,{ignoreIllegals:!0,language:G});if(W.errorRaised)throw Error("Could not highlight with `Highlight.js`",{cause:W.errorRaised});let q=W._emitter.root,N=q.data;return N.language=W.language,N.relevance=W.relevance,q}function H(G,U){X5(typeof G==="string","expected `string` as `value`");let K=(U||ac).subset||B(),F=-1,W=0,q;while(++F<K.length){let N=K[F];if(!Z.getLanguage(N))continue;let D=J(N,G,U);if(D.data&&D.data.relevance!==void 0&&D.data.relevance>W)W=D.data.relevance,q=D}return q||{type:"root",children:[],data:{language:void 0,relevance:W}}}function B(){return Z.listLanguages()}function Q(G,U){if(typeof G==="string")X5(U!==void 0,"expected `grammar`"),Z.registerLanguage(G,U);else{let Y;for(Y in G)if(Object.hasOwn(G,Y))Z.registerLanguage(Y,G[Y])}}function X(G,U){if(typeof G==="string")X5(U!==void 0),Z.registerAliases(typeof U==="string"?U:[...U],{languageName:G});else{let Y;for(Y in G)if(Object.hasOwn(G,Y)){let K=G[Y];Z.registerAliases(typeof K==="string"?K:[...K],{languageName:Y})}}}function z(G){return Boolean(Z.getLanguage(G))}}class oc{constructor($){this.options=$,this.root={type:"root",children:[],data:{language:void 0,relevance:0}},this.stack=[this.root]}addText($){if($==="")return;let Z=this.stack[this.stack.length-1],J=Z.children[Z.children.length-1];if(J&&J.type==="text")J.value+=$;else Z.children.push({type:"text",value:$})}startScope($){this.openNode(String($))}endScope(){this.closeNode()}__addSublanguage($,Z){let J=this.stack[this.stack.length-1],H=$.root.children;if(Z)J.children.push({type:"element",tagName:"span",properties:{className:[Z]},children:H});else J.children.push(...H)}openNode($){let Z=this,J=$.split(".").map(function(Q,X){return X?Q+"_".repeat(X):Z.options.classPrefix+Q}),H=this.stack[this.stack.length-1],B={type:"element",tagName:"span",properties:{className:J},children:[]};H.children.push(B),this.stack.push(B)}closeNode(){this.stack.pop()}finalize(){}toHTML(){return""}}var BQ0={};function gW($){let Z=$||BQ0,J=Z.aliases,H=Z.detect||!1,B=Z.languages||WP,Q=Z.plainText,X=Z.prefix,z=Z.subset,G="hljs",U=MP(B);if(J)U.registerAlias(J);if(X){let Y=X.indexOf("-");G=Y===-1?X:X.slice(0,Y)}return function(Y,K){l3(Y,"element",function(F,W,q){if(F.tagName!=="code"||!q||q.type!=="element"||q.tagName!=="pre")return;let N=QQ0(F);if(N===!1||!N&&!H||N&&Q&&Q.includes(N))return;if(!Array.isArray(F.properties.className))F.properties.className=[];if(!F.properties.className.includes(G))F.properties.className.unshift(G);let D=UP(F,{whitespace:"pre"}),A;try{A=N?U.highlight(N,D,{prefix:X}):U.highlightAuto(D,{prefix:X,subset:z})}catch(V){let L=V;if(N&&/Unknown language/.test(L.message)){K.message("Cannot highlight as `"+N+"`, it’s not registered",{ancestors:[q,F],cause:L,place:F.position,ruleId:"missing-language",source:"rehype-highlight"});return}throw L}if(!N&&A.data&&A.data.language)F.properties.className.push("language-"+A.data.language);if(A.children.length>0)F.children=A.children})}}function QQ0($){let Z=$.properties.className,J=-1;if(!Array.isArray(Z))return;let H;while(++J<Z.length){let B=String(Z[J]);if(B==="no-highlight"||B==="nohighlight")return!1;if(!H&&B.slice(0,5)==="lang-")H=B.slice(5);if(!H&&B.slice(0,9)==="language-")H=B.slice(9)}return H}function PP($,Z){let J=String($);if(typeof Z!=="string")throw TypeError("Expected character");let H=0,B=J.indexOf(Z);while(B!==-1)H++,B=J.indexOf(Z,B+Z.length);return H}function _P($){if(typeof $!=="string")throw TypeError("Expected a string");return $.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function OP($,Z,J){let B=F3((J||{}).ignore||[]),Q=XQ0(Z),X=-1;while(++X<Q.length)AX($,"text",z);function z(U,Y){let K=-1,F;while(++K<Y.length){let W=Y[K],q=F?F.children:void 0;if(B(W,q?q.indexOf(W):void 0,F))return;F=W}if(F)return G(U,Y)}function G(U,Y){let K=Y[Y.length-1],F=Q[X][0],W=Q[X][1],q=0,D=K.children.indexOf(U),A=!1,V=[];F.lastIndex=0;let L=F.exec(U.value);while(L){let O=L.index,M={index:L.index,input:L.input,stack:[...Y,U]},_=W(...L,M);if(typeof _==="string")_=_.length>0?{type:"text",value:_}:void 0;if(_===!1)F.lastIndex=O+1;else{if(q!==O)V.push({type:"text",value:U.value.slice(q,O)});if(Array.isArray(_))V.push(..._);else if(_)V.push(_);q=O+L[0].length,A=!0}if(!F.global)break;L=F.exec(U.value)}if(A){if(q<U.value.length)V.push({type:"text",value:U.value.slice(q)});K.children.splice(D,1,...V)}else V=[U];return D+V.length}}function XQ0($){let Z=[];if(!Array.isArray($))throw TypeError("Expected find and replace tuple or list of tuples");let J=!$[0]||Array.isArray($[0])?$:[$],H=-1;while(++H<J.length){let B=J[H];Z.push([zQ0(B[0]),GQ0(B[1])])}return Z}function zQ0($){return typeof $==="string"?new RegExp(_P($),"g"):$}function GQ0($){return typeof $==="function"?$:function(){return $}}var jP="phrasing",TP=["autolink","link","image","label"];function EP(){return{transforms:[qQ0],enter:{literalAutolink:UQ0,literalAutolinkEmail:CP,literalAutolinkHttp:CP,literalAutolinkWww:CP},exit:{literalAutolink:WQ0,literalAutolinkEmail:FQ0,literalAutolinkHttp:YQ0,literalAutolinkWww:KQ0}}}function bP(){return{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:jP,notInConstruct:TP},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:jP,notInConstruct:TP},{character:":",before:"[ps]",after:"\\/",inConstruct:jP,notInConstruct:TP}]}}function UQ0($){this.enter({type:"link",title:null,url:"",children:[]},$)}function CP($){this.config.enter.autolinkProtocol.call(this,$)}function YQ0($){this.config.exit.autolinkProtocol.call(this,$)}function KQ0($){this.config.exit.data.call(this,$);let Z=this.stack[this.stack.length-1];X5(Z.type==="link"),Z.url="http://"+this.sliceSerialize($)}function FQ0($){this.config.exit.autolinkEmail.call(this,$)}function WQ0($){this.exit($)}function qQ0($){OP($,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,NQ0],[/(?<=^|\s|\p{P}|\p{S})([-.\w+]+)@([-\w]+(?:\.[-\w]+)+)/gu,AQ0]],{ignore:["link","linkReference"]})}function NQ0($,Z,J,H,B){let Q="";if(!nc(B))return!1;if(/^w/i.test(Z))J=Z+J,Z="",Q="http://";if(!DQ0(J))return!1;let X=VQ0(J+H);if(!X[0])return!1;let z={type:"link",title:null,url:Q+Z+X[0],children:[{type:"text",value:Z+X[0]}]};if(X[1])return[z,{type:"text",value:X[1]}];return z}function AQ0($,Z,J,H){if(!nc(H,!0)||/[-\d_]$/.test(J))return!1;return{type:"link",title:null,url:"mailto:"+Z+"@"+J,children:[{type:"text",value:Z+"@"+J}]}}function DQ0($){let Z=$.split(".");if(Z.length<2||Z[Z.length-1]&&(/_/.test(Z[Z.length-1])||!/[a-zA-Z\d]/.test(Z[Z.length-1]))||Z[Z.length-2]&&(/_/.test(Z[Z.length-2])||!/[a-zA-Z\d]/.test(Z[Z.length-2])))return!1;return!0}function VQ0($){let Z=/[!"&'),.:;<>?\]}]+$/.exec($);if(!Z)return[$,void 0];$=$.slice(0,Z.index);let J=Z[0],H=J.indexOf(")"),B=PP($,"("),Q=PP($,")");while(H!==-1&&B>Q)$+=J.slice(0,H+1),J=J.slice(H+1),H=J.indexOf(")"),Q++;return[$,J]}function nc($,Z){let J=$.input.charCodeAt($.index-1);return($.index===0||Y3(J)||o$(J))&&(!Z||J!==47)}sc.peek=EQ0;function LQ0(){this.buffer()}function MQ0($){this.enter({type:"footnoteReference",identifier:"",label:""},$)}function PQ0(){this.buffer()}function _Q0($){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},$)}function OQ0($){let Z=this.resume(),J=this.stack[this.stack.length-1];X5(J.type==="footnoteReference"),J.identifier=L4(this.sliceSerialize($)).toLowerCase(),J.label=Z}function jQ0($){this.exit($)}function TQ0($){let Z=this.resume(),J=this.stack[this.stack.length-1];X5(J.type==="footnoteDefinition"),J.identifier=L4(this.sliceSerialize($)).toLowerCase(),J.label=Z}function CQ0($){this.exit($)}function EQ0(){return"["}function sc($,Z,J,H){let B=J.createTracker(H),Q=B.move("[^"),X=J.enter("footnoteReference"),z=J.enter("reference");return Q+=B.move(J.safe(J.associationId($),{after:"]",before:Q})),z(),X(),Q+=B.move("]"),Q}function wP(){return{enter:{gfmFootnoteCallString:LQ0,gfmFootnoteCall:MQ0,gfmFootnoteDefinitionLabelString:PQ0,gfmFootnoteDefinition:_Q0},exit:{gfmFootnoteCallString:OQ0,gfmFootnoteCall:jQ0,gfmFootnoteDefinitionLabelString:TQ0,gfmFootnoteDefinition:CQ0}}}function SP($){let Z=!1;if($&&$.firstLineBlank)Z=!0;return{handlers:{footnoteDefinition:J,footnoteReference:sc},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function J(H,B,Q,X){let z=Q.createTracker(X),G=z.move("[^"),U=Q.enter("footnoteDefinition"),Y=Q.enter("label");if(G+=z.move(Q.safe(Q.associationId(H),{before:G,after:"]"})),Y(),G+=z.move("]:"),H.children&&H.children.length>0)z.shift(4),G+=z.move((Z?`
38
+ `:" ")+Q.indentLines(Q.containerFlow(H,z.current()),Z?tc:bQ0));return U(),G}}function bQ0($,Z,J){return Z===0?$:tc($,Z,J)}function tc($,Z,J){return(J?"":" ")+$}var wQ0=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];ec.peek=IQ0;function RP(){return{canContainEols:["delete"],enter:{strikethrough:SQ0},exit:{strikethrough:RQ0}}}function IP(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:wQ0}],handlers:{delete:ec}}}function SQ0($){this.enter({type:"delete",children:[]},$)}function RQ0($){this.exit($)}function ec($,Z,J,H){let B=J.createTracker(H),Q=J.enter("strikethrough"),X=B.move("~~");return X+=J.containerPhrasing($,{...B.current(),before:X,after:"~"}),X+=B.move("~~"),Q(),X}function IQ0(){return"~"}function kQ0($){return $.length}function Zd($,Z){let J=Z||{},H=(J.align||[]).concat(),B=J.stringLength||kQ0,Q=[],X=[],z=[],G=[],U=0,Y=-1;while(++Y<$.length){let N=[],D=[],A=-1;if($[Y].length>U)U=$[Y].length;while(++A<$[Y].length){let V=yQ0($[Y][A]);if(J.alignDelimiters!==!1){let L=B(V);if(D[A]=L,G[A]===void 0||L>G[A])G[A]=L}N.push(V)}X[Y]=N,z[Y]=D}let K=-1;if(typeof H==="object"&&"length"in H)while(++K<U)Q[K]=$d(H[K]);else{let N=$d(H);while(++K<U)Q[K]=N}K=-1;let F=[],W=[];while(++K<U){let N=Q[K],D="",A="";if(N===99)D=":",A=":";else if(N===108)D=":";else if(N===114)A=":";let V=J.alignDelimiters===!1?1:Math.max(1,G[K]-D.length-A.length),L=D+"-".repeat(V)+A;if(J.alignDelimiters!==!1){if(V=D.length+V+A.length,V>G[K])G[K]=V;W[K]=V}F[K]=L}X.splice(1,0,F),z.splice(1,0,W),Y=-1;let q=[];while(++Y<X.length){let N=X[Y],D=z[Y];K=-1;let A=[];while(++K<U){let V=N[K]||"",L="",O="";if(J.alignDelimiters!==!1){let M=G[K]-(D[K]||0),_=Q[K];if(_===114)L=" ".repeat(M);else if(_===99)if(M%2)L=" ".repeat(M/2+0.5),O=" ".repeat(M/2-0.5);else L=" ".repeat(M/2),O=L;else O=" ".repeat(M)}if(J.delimiterStart!==!1&&!K)A.push("|");if(J.padding!==!1&&!(J.alignDelimiters===!1&&V==="")&&(J.delimiterStart!==!1||K))A.push(" ");if(J.alignDelimiters!==!1)A.push(L);if(A.push(V),J.alignDelimiters!==!1)A.push(O);if(J.padding!==!1)A.push(" ");if(J.delimiterEnd!==!1||K!==U-1)A.push("|")}q.push(J.delimiterEnd===!1?A.join("").replace(/ +$/,""):A.join(""))}return q.join(`
39
+ `)}function yQ0($){return $===null||$===void 0?"":String($)}function $d($){let Z=typeof $==="string"?$.codePointAt(0):0;return Z===67||Z===99?99:Z===76||Z===108?108:Z===82||Z===114?114:0}function Jd($,Z,J,H){let B=J.enter("blockquote"),Q=J.createTracker(H);Q.move("> "),Q.shift(2);let X=J.indentLines(J.containerFlow($,Q.current()),xQ0);return B(),X}function xQ0($,Z,J){return">"+(J?"":" ")+$}function Bd($,Z){return Hd($,Z.inConstruct,!0)&&!Hd($,Z.notInConstruct,!1)}function Hd($,Z,J){if(typeof Z==="string")Z=[Z];if(!Z||Z.length===0)return J;let H=-1;while(++H<Z.length)if($.includes(Z[H]))return!0;return!1}function kP($,Z,J,H){let B=-1;while(++B<J.unsafe.length)if(J.unsafe[B].character===`
40
+ `&&Bd(J.stack,J.unsafe[B]))return/[ \t]/.test(H.before)?"":" ";return"\\\n"}function Qd($,Z){let J=String($),H=J.indexOf(Z),B=H,Q=0,X=0;if(typeof Z!=="string")throw TypeError("Expected substring");while(H!==-1){if(H===B){if(++Q>X)X=Q}else Q=1;B=H+Z.length,H=J.indexOf(Z,B)}return X}function Xd($,Z){return Boolean(Z.options.fences===!1&&$.value&&!$.lang&&/[^ \r\n]/.test($.value)&&!/^[\t ]*(?:[\r\n]|$)|(?:^|[\r\n])[\t ]*$/.test($.value))}function zd($){let Z=$.options.fence||"`";if(Z!=="`"&&Z!=="~")throw Error("Cannot serialize code with `"+Z+"` for `options.fence`, expected `` ` `` or `~`");return Z}function Gd($,Z,J,H){let B=zd(J),Q=$.value||"",X=B==="`"?"GraveAccent":"Tilde";if(Xd($,J)){let K=J.enter("codeIndented"),F=J.indentLines(Q,hQ0);return K(),F}let z=J.createTracker(H),G=B.repeat(Math.max(Qd(Q,B)+1,3)),U=J.enter("codeFenced"),Y=z.move(G);if($.lang){let K=J.enter(`codeFencedLang${X}`);Y+=z.move(J.safe($.lang,{before:Y,after:" ",encode:["`"],...z.current()})),K()}if($.lang&&$.meta){let K=J.enter(`codeFencedMeta${X}`);Y+=z.move(" "),Y+=z.move(J.safe($.meta,{before:Y,after:`
41
+ `,encode:["`"],...z.current()})),K()}if(Y+=z.move(`
42
+ `),Q)Y+=z.move(Q+`
43
+ `);return Y+=z.move(G),U(),Y}function hQ0($,Z,J){return(J?"":" ")+$}function jH($){let Z=$.options.quote||'"';if(Z!=='"'&&Z!=="'")throw Error("Cannot serialize title with `"+Z+"` for `options.quote`, expected `\"`, or `'`");return Z}function Ud($,Z,J,H){let B=jH(J),Q=B==='"'?"Quote":"Apostrophe",X=J.enter("definition"),z=J.enter("label"),G=J.createTracker(H),U=G.move("[");if(U+=G.move(J.safe(J.associationId($),{before:U,after:"]",...G.current()})),U+=G.move("]: "),z(),!$.url||/[\0- \u007F]/.test($.url))z=J.enter("destinationLiteral"),U+=G.move("<"),U+=G.move(J.safe($.url,{before:U,after:">",...G.current()})),U+=G.move(">");else z=J.enter("destinationRaw"),U+=G.move(J.safe($.url,{before:U,after:$.title?" ":`
44
+ `,...G.current()}));if(z(),$.title)z=J.enter(`title${Q}`),U+=G.move(" "+B),U+=G.move(J.safe($.title,{before:U,after:B,...G.current()})),U+=G.move(B),z();return X(),U}function Yd($){let Z=$.options.emphasis||"*";if(Z!=="*"&&Z!=="_")throw Error("Cannot serialize emphasis with `"+Z+"` for `options.emphasis`, expected `*`, or `_`");return Z}function C7($){return"&#x"+$.toString(16).toUpperCase()+";"}function TH($,Z,J){let H=d3($),B=d3(Z);if(H===void 0)return B===void 0?J==="_"?{inside:!0,outside:!0}:{inside:!1,outside:!1}:B===1?{inside:!0,outside:!0}:{inside:!1,outside:!0};if(H===1)return B===void 0?{inside:!1,outside:!1}:B===1?{inside:!0,outside:!0}:{inside:!1,outside:!1};return B===void 0?{inside:!1,outside:!1}:B===1?{inside:!0,outside:!1}:{inside:!1,outside:!1}}yP.peek=vQ0;function yP($,Z,J,H){let B=Yd(J),Q=J.enter("emphasis"),X=J.createTracker(H),z=X.move(B),G=X.move(J.containerPhrasing($,{after:B,before:z,...X.current()})),U=G.charCodeAt(0),Y=TH(H.before.charCodeAt(H.before.length-1),U,B);if(Y.inside)G=C7(U)+G.slice(1);let K=G.charCodeAt(G.length-1),F=TH(H.after.charCodeAt(0),K,B);if(F.inside)G=G.slice(0,-1)+C7(K);let W=X.move(B);return Q(),J.attentionEncodeSurroundingInfo={after:F.outside,before:Y.outside},z+G+W}function vQ0($,Z,J){return J.options.emphasis||"*"}function Kd($,Z){let J=!1;return l3($,function(H){if("value"in H&&/\r?\n|\r/.test(H.value)||H.type==="break")return J=!0,$Z}),Boolean((!$.depth||$.depth<3)&&r$($)&&(Z.options.setext||J))}function Fd($,Z,J,H){let B=Math.max(Math.min(6,$.depth||1),1),Q=J.createTracker(H);if(Kd($,J)){let Y=J.enter("headingSetext"),K=J.enter("phrasing"),F=J.containerPhrasing($,{...Q.current(),before:`
45
+ `,after:`
46
+ `});return K(),Y(),F+`
47
+ `+(B===1?"=":"-").repeat(F.length-(Math.max(F.lastIndexOf("\r"),F.lastIndexOf(`
48
+ `))+1))}let X="#".repeat(B),z=J.enter("headingAtx"),G=J.enter("phrasing");Q.move(X+" ");let U=J.containerPhrasing($,{before:"# ",after:`
49
+ `,...Q.current()});if(/^[\t ]/.test(U))U=C7(U.charCodeAt(0))+U.slice(1);if(U=U?X+" "+U:X,J.options.closeAtx)U+=" "+X;return G(),z(),U}xP.peek=fQ0;function xP($){return $.value||""}function fQ0(){return"<"}hP.peek=gQ0;function hP($,Z,J,H){let B=jH(J),Q=B==='"'?"Quote":"Apostrophe",X=J.enter("image"),z=J.enter("label"),G=J.createTracker(H),U=G.move("![");if(U+=G.move(J.safe($.alt,{before:U,after:"]",...G.current()})),U+=G.move("]("),z(),!$.url&&$.title||/[\0- \u007F]/.test($.url))z=J.enter("destinationLiteral"),U+=G.move("<"),U+=G.move(J.safe($.url,{before:U,after:">",...G.current()})),U+=G.move(">");else z=J.enter("destinationRaw"),U+=G.move(J.safe($.url,{before:U,after:$.title?" ":")",...G.current()}));if(z(),$.title)z=J.enter(`title${Q}`),U+=G.move(" "+B),U+=G.move(J.safe($.title,{before:U,after:B,...G.current()})),U+=G.move(B),z();return U+=G.move(")"),X(),U}function gQ0(){return"!"}vP.peek=mQ0;function vP($,Z,J,H){let B=$.referenceType,Q=J.enter("imageReference"),X=J.enter("label"),z=J.createTracker(H),G=z.move("!["),U=J.safe($.alt,{before:G,after:"]",...z.current()});G+=z.move(U+"]["),X();let Y=J.stack;J.stack=[],X=J.enter("reference");let K=J.safe(J.associationId($),{before:G,after:"]",...z.current()});if(X(),J.stack=Y,Q(),B==="full"||!U||U!==K)G+=z.move(K+"]");else if(B==="shortcut")G=G.slice(0,-1);else G+=z.move("]");return G}function mQ0(){return"!"}fP.peek=uQ0;function fP($,Z,J){let H=$.value||"",B="`",Q=-1;while(new RegExp("(^|[^`])"+B+"([^`]|$)").test(H))B+="`";if(/[^ \r\n]/.test(H)&&(/^[ \r\n]/.test(H)&&/[ \r\n]$/.test(H)||/^`|`$/.test(H)))H=" "+H+" ";while(++Q<J.unsafe.length){let X=J.unsafe[Q],z=J.compilePattern(X),G;if(!X.atBreak)continue;while(G=z.exec(H)){let U=G.index;if(H.charCodeAt(U)===10&&H.charCodeAt(U-1)===13)U--;H=H.slice(0,U)+" "+H.slice(G.index+1)}}return B+H+B}function uQ0(){return"`"}function gP($,Z){let J=r$($);return Boolean(!Z.options.resourceLink&&$.url&&!$.title&&$.children&&$.children.length===1&&$.children[0].type==="text"&&(J===$.url||"mailto:"+J===$.url)&&/^[a-z][a-z+.-]+:/i.test($.url)&&!/[\0- <>\u007F]/.test($.url))}mP.peek=pQ0;function mP($,Z,J,H){let B=jH(J),Q=B==='"'?"Quote":"Apostrophe",X=J.createTracker(H),z,G;if(gP($,J)){let Y=J.stack;J.stack=[],z=J.enter("autolink");let K=X.move("<");return K+=X.move(J.containerPhrasing($,{before:K,after:">",...X.current()})),K+=X.move(">"),z(),J.stack=Y,K}z=J.enter("link"),G=J.enter("label");let U=X.move("[");if(U+=X.move(J.containerPhrasing($,{before:U,after:"](",...X.current()})),U+=X.move("]("),G(),!$.url&&$.title||/[\0- \u007F]/.test($.url))G=J.enter("destinationLiteral"),U+=X.move("<"),U+=X.move(J.safe($.url,{before:U,after:">",...X.current()})),U+=X.move(">");else G=J.enter("destinationRaw"),U+=X.move(J.safe($.url,{before:U,after:$.title?" ":")",...X.current()}));if(G(),$.title)G=J.enter(`title${Q}`),U+=X.move(" "+B),U+=X.move(J.safe($.title,{before:U,after:B,...X.current()})),U+=X.move(B),G();return U+=X.move(")"),z(),U}function pQ0($,Z,J){return gP($,J)?"<":"["}uP.peek=cQ0;function uP($,Z,J,H){let B=$.referenceType,Q=J.enter("linkReference"),X=J.enter("label"),z=J.createTracker(H),G=z.move("["),U=J.containerPhrasing($,{before:G,after:"]",...z.current()});G+=z.move(U+"]["),X();let Y=J.stack;J.stack=[],X=J.enter("reference");let K=J.safe(J.associationId($),{before:G,after:"]",...z.current()});if(X(),J.stack=Y,Q(),B==="full"||!U||U!==K)G+=z.move(K+"]");else if(B==="shortcut")G=G.slice(0,-1);else G+=z.move("]");return G}function cQ0(){return"["}function CH($){let Z=$.options.bullet||"*";if(Z!=="*"&&Z!=="+"&&Z!=="-")throw Error("Cannot serialize items with `"+Z+"` for `options.bullet`, expected `*`, `+`, or `-`");return Z}function Wd($){let Z=CH($),J=$.options.bulletOther;if(!J)return Z==="*"?"-":"*";if(J!=="*"&&J!=="+"&&J!=="-")throw Error("Cannot serialize items with `"+J+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(J===Z)throw Error("Expected `bullet` (`"+Z+"`) and `bulletOther` (`"+J+"`) to be different");return J}function qd($){let Z=$.options.bulletOrdered||".";if(Z!=="."&&Z!==")")throw Error("Cannot serialize items with `"+Z+"` for `options.bulletOrdered`, expected `.` or `)`");return Z}function mW($){let Z=$.options.rule||"*";if(Z!=="*"&&Z!=="-"&&Z!=="_")throw Error("Cannot serialize rules with `"+Z+"` for `options.rule`, expected `*`, `-`, or `_`");return Z}function Nd($,Z,J,H){let B=J.enter("list"),Q=J.bulletCurrent,X=$.ordered?qd(J):CH(J),z=$.ordered?X==="."?")":".":Wd(J),G=Z&&J.bulletLastUsed?X===J.bulletLastUsed:!1;if(!$.ordered){let Y=$.children?$.children[0]:void 0;if((X==="*"||X==="-")&&Y&&(!Y.children||!Y.children[0])&&J.stack[J.stack.length-1]==="list"&&J.stack[J.stack.length-2]==="listItem"&&J.stack[J.stack.length-3]==="list"&&J.stack[J.stack.length-4]==="listItem"&&J.indexStack[J.indexStack.length-1]===0&&J.indexStack[J.indexStack.length-2]===0&&J.indexStack[J.indexStack.length-3]===0)G=!0;if(mW(J)===X&&Y){let K=-1;while(++K<$.children.length){let F=$.children[K];if(F&&F.type==="listItem"&&F.children&&F.children[0]&&F.children[0].type==="thematicBreak"){G=!0;break}}}}if(G)X=z;J.bulletCurrent=X;let U=J.containerFlow($,H);return J.bulletLastUsed=X,J.bulletCurrent=Q,B(),U}function Ad($){let Z=$.options.listItemIndent||"one";if(Z!=="tab"&&Z!=="one"&&Z!=="mixed")throw Error("Cannot serialize items with `"+Z+"` for `options.listItemIndent`, expected `tab`, `one`, or `mixed`");return Z}function Dd($,Z,J,H){let B=Ad(J),Q=J.bulletCurrent||CH(J);if(Z&&Z.type==="list"&&Z.ordered)Q=(typeof Z.start==="number"&&Z.start>-1?Z.start:1)+(J.options.incrementListMarker===!1?0:Z.children.indexOf($))+Q;let X=Q.length+1;if(B==="tab"||B==="mixed"&&(Z&&Z.type==="list"&&Z.spread||$.spread))X=Math.ceil(X/4)*4;let z=J.createTracker(H);z.move(Q+" ".repeat(X-Q.length)),z.shift(X);let G=J.enter("listItem"),U=J.indentLines(J.containerFlow($,z.current()),Y);return G(),U;function Y(K,F,W){if(F)return(W?"":" ".repeat(X))+K;return(W?Q:Q+" ".repeat(X-Q.length))+K}}function Vd($,Z,J,H){let B=J.enter("paragraph"),Q=J.enter("phrasing"),X=J.containerPhrasing($,H);return Q(),B(),X}var pP=F3(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function Ld($,Z,J,H){return($.children.some(function(X){return pP(X)})?J.containerPhrasing:J.containerFlow).call(J,$,H)}function Md($){let Z=$.options.strong||"*";if(Z!=="*"&&Z!=="_")throw Error("Cannot serialize strong with `"+Z+"` for `options.strong`, expected `*`, or `_`");return Z}cP.peek=dQ0;function cP($,Z,J,H){let B=Md(J),Q=J.enter("strong"),X=J.createTracker(H),z=X.move(B+B),G=X.move(J.containerPhrasing($,{after:B,before:z,...X.current()})),U=G.charCodeAt(0),Y=TH(H.before.charCodeAt(H.before.length-1),U,B);if(Y.inside)G=C7(U)+G.slice(1);let K=G.charCodeAt(G.length-1),F=TH(H.after.charCodeAt(0),K,B);if(F.inside)G=G.slice(0,-1)+C7(K);let W=X.move(B+B);return Q(),J.attentionEncodeSurroundingInfo={after:F.outside,before:Y.outside},z+G+W}function dQ0($,Z,J){return J.options.strong||"*"}function Pd($,Z,J,H){return J.safe($.value,H)}function _d($){let Z=$.options.ruleRepetition||3;if(Z<3)throw Error("Cannot serialize rules with repetition `"+Z+"` for `options.ruleRepetition`, expected `3` or more");return Z}function Od($,Z,J){let H=(mW(J)+(J.options.ruleSpaces?" ":"")).repeat(_d(J));return J.options.ruleSpaces?H.slice(0,-1):H}var _X={blockquote:Jd,break:kP,code:Gd,definition:Ud,emphasis:yP,hardBreak:kP,heading:Fd,html:xP,image:hP,imageReference:vP,inlineCode:fP,link:mP,linkReference:uP,list:Nd,listItem:Dd,paragraph:Vd,root:Ld,strong:cP,text:Pd,thematicBreak:Od};function lP(){return{enter:{table:lQ0,tableData:jd,tableHeader:jd,tableRow:rQ0},exit:{codeText:aQ0,table:iQ0,tableData:dP,tableHeader:dP,tableRow:dP}}}function lQ0($){let Z=$._align;X5(Z,"expected `_align` on table"),this.enter({type:"table",align:Z.map(function(J){return J==="none"?null:J}),children:[]},$),this.data.inTable=!0}function iQ0($){this.exit($),this.data.inTable=void 0}function rQ0($){this.enter({type:"tableRow",children:[]},$)}function dP($){this.exit($)}function jd($){this.enter({type:"tableCell",children:[]},$)}function aQ0($){let Z=this.resume();if(this.data.inTable)Z=Z.replace(/\\([\\|])/g,oQ0);let J=this.stack[this.stack.length-1];X5(J.type==="inlineCode"),J.value=Z,this.exit($)}function oQ0($,Z){return Z==="|"?Z:$}function iP($){let Z=$||{},J=Z.tableCellPadding,H=Z.tablePipeAlign,B=Z.stringLength,Q=J?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:`
50
+ `,inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[\t :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{inlineCode:F,table:X,tableCell:G,tableRow:z}};function X(W,q,N,D){return U(Y(W,N,D),W.align)}function z(W,q,N,D){let A=K(W,N,D),V=U([A]);return V.slice(0,V.indexOf(`
51
+ `))}function G(W,q,N,D){let A=N.enter("tableCell"),V=N.enter("phrasing"),L=N.containerPhrasing(W,{...D,before:Q,after:Q});return V(),A(),L}function U(W,q){return Zd(W,{align:q,alignDelimiters:H,padding:J,stringLength:B})}function Y(W,q,N){let D=W.children,A=-1,V=[],L=q.enter("table");while(++A<D.length)V[A]=K(D[A],q,N);return L(),V}function K(W,q,N){let D=W.children,A=-1,V=[],L=q.enter("tableRow");while(++A<D.length)V[A]=G(D[A],W,q,N);return L(),V}function F(W,q,N){let D=_X.inlineCode(W,q,N);if(N.stack.includes("tableCell"))D=D.replace(/\|/g,"\\$&");return D}}function rP(){return{exit:{taskListCheckValueChecked:Td,taskListCheckValueUnchecked:Td,paragraph:nQ0}}}function aP(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:sQ0}}}function Td($){let Z=this.stack[this.stack.length-2];X5(Z.type==="listItem"),Z.checked=$.type==="taskListCheckValueChecked"}function nQ0($){let Z=this.stack[this.stack.length-2];if(Z&&Z.type==="listItem"&&typeof Z.checked==="boolean"){let J=this.stack[this.stack.length-1];X5(J.type==="paragraph");let H=J.children[0];if(H&&H.type==="text"){let B=Z.children,Q=-1,X;while(++Q<B.length){let z=B[Q];if(z.type==="paragraph"){X=z;break}}if(X===J){if(H.value=H.value.slice(1),H.value.length===0)J.children.shift();else if(J.position&&H.position&&typeof H.position.start.offset==="number")H.position.start.column++,H.position.start.offset++,J.position.start=Object.assign({},H.position.start)}}}this.exit($)}function sQ0($,Z,J,H){let B=$.children[0],Q=typeof $.checked==="boolean"&&B&&B.type==="paragraph",X="["+($.checked?"x":" ")+"] ",z=J.createTracker(H);if(Q)z.move(X);let G=_X.listItem($,Z,J,{...H,...z.current()});if(Q)G=G.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,U);return G;function U(Y){return Y+X}}function oP(){return[EP(),wP(),RP(),lP(),rP()]}function nP($){return{extensions:[bP(),SP($),IP(),iP($),aP()]}}var tQ0={tokenize:HX0,partial:!0},Cd={tokenize:BX0,partial:!0},Ed={tokenize:QX0,partial:!0},bd={tokenize:XX0,partial:!0},eQ0={tokenize:zX0,partial:!0},wd={name:"wwwAutolink",tokenize:ZX0,previous:Rd},Sd={name:"protocolAutolink",tokenize:JX0,previous:Id},r3={name:"emailAutolink",tokenize:$X0,previous:kd},q3={};function tP(){return{text:q3}}var HZ=48;while(HZ<123)if(q3[HZ]=r3,HZ++,HZ===58)HZ=65;else if(HZ===91)HZ=97;q3[43]=r3;q3[45]=r3;q3[46]=r3;q3[95]=r3;q3[72]=[r3,Sd];q3[104]=[r3,Sd];q3[87]=[r3,wd];q3[119]=[r3,wd];function $X0($,Z,J){let H=this,B,Q;return X;function X(K){if(!sP(K)||!kd.call(H,H.previous)||eP(H.events))return J(K);return $.enter("literalAutolink"),$.enter("literalAutolinkEmail"),z(K)}function z(K){if(sP(K))return $.consume(K),z;if(K===64)return $.consume(K),G;return J(K)}function G(K){if(K===46)return $.check(eQ0,Y,U)(K);if(K===45||K===95||t5(K))return Q=!0,$.consume(K),G;return Y(K)}function U(K){return $.consume(K),B=!0,G}function Y(K){if(Q&&B&&_2(H.previous))return $.exit("literalAutolinkEmail"),$.exit("literalAutolink"),Z(K);return J(K)}}function ZX0($,Z,J){let H=this;return B;function B(X){if(X!==87&&X!==119||!Rd.call(H,H.previous)||eP(H.events))return J(X);return $.enter("literalAutolink"),$.enter("literalAutolinkWww"),$.check(tQ0,$.attempt(Cd,$.attempt(Ed,Q),J),J)(X)}function Q(X){return $.exit("literalAutolinkWww"),$.exit("literalAutolink"),Z(X)}}function JX0($,Z,J){let H=this,B="",Q=!1;return X;function X(K){if((K===72||K===104)&&Id.call(H,H.previous)&&!eP(H.events))return $.enter("literalAutolink"),$.enter("literalAutolinkHttp"),B+=String.fromCodePoint(K),$.consume(K),z;return J(K)}function z(K){if(_2(K)&&B.length<5)return B+=String.fromCodePoint(K),$.consume(K),z;if(K===58){let F=B.toLowerCase();if(F==="http"||F==="https")return $.consume(K),G}return J(K)}function G(K){if(K===47){if($.consume(K),Q)return U;return Q=!0,G}return J(K)}function U(K){return K===null||a$(K)||h1(K)||Y3(K)||o$(K)?J(K):$.attempt(Cd,$.attempt(Ed,Y),J)(K)}function Y(K){return $.exit("literalAutolinkHttp"),$.exit("literalAutolink"),Z(K)}}function HX0($,Z,J){let H=0;return B;function B(X){if((X===87||X===119)&&H<3)return H++,$.consume(X),B;if(X===46&&H===3)return $.consume(X),Q;return J(X)}function Q(X){return X===null?J(X):Z(X)}}function BX0($,Z,J){let H,B,Q;return X;function X(U){if(U===46||U===95)return $.check(bd,G,z)(U);if(U===null||h1(U)||Y3(U)||U!==45&&o$(U))return G(U);return Q=!0,$.consume(U),X}function z(U){if(U===95)H=!0;else B=H,H=void 0;return $.consume(U),X}function G(U){if(B||H||!Q)return J(U);return Z(U)}}function QX0($,Z){let J=0,H=0;return B;function B(X){if(X===40)return J++,$.consume(X),B;if(X===41&&H<J)return Q(X);if(X===33||X===34||X===38||X===39||X===41||X===42||X===44||X===46||X===58||X===59||X===60||X===63||X===93||X===95||X===126)return $.check(bd,Z,Q)(X);if(X===null||h1(X)||Y3(X))return Z(X);return $.consume(X),B}function Q(X){if(X===41)H++;return $.consume(X),B}}function XX0($,Z,J){return H;function H(z){if(z===33||z===34||z===39||z===41||z===42||z===44||z===46||z===58||z===59||z===63||z===95||z===126)return $.consume(z),H;if(z===38)return $.consume(z),Q;if(z===93)return $.consume(z),B;if(z===60||z===null||h1(z)||Y3(z))return Z(z);return J(z)}function B(z){if(z===null||z===40||z===91||h1(z)||Y3(z))return Z(z);return H(z)}function Q(z){return _2(z)?X(z):J(z)}function X(z){if(z===59)return $.consume(z),H;if(_2(z))return $.consume(z),X;return J(z)}}function zX0($,Z,J){return H;function H(Q){return $.consume(Q),B}function B(Q){return t5(Q)?J(Q):Z(Q)}}function Rd($){return $===null||$===40||$===42||$===95||$===91||$===93||$===126||h1($)}function Id($){return!_2($)}function kd($){return!($===47||sP($))}function sP($){return $===43||$===45||$===46||$===95||t5($)}function eP($){let Z=$.length,J=!1;while(Z--){let H=$[Z][1];if((H.type==="labelLink"||H.type==="labelImage")&&!H._balanced){J=!0;break}if(H._gfmAutolinkLiteralWalkedInto){J=!1;break}}if($.length>0&&!J)$[$.length-1][1]._gfmAutolinkLiteralWalkedInto=!0;return J}var GX0={tokenize:NX0,partial:!0};function $_(){return{document:{[91]:{name:"gfmFootnoteDefinition",tokenize:FX0,continuation:{tokenize:WX0},exit:qX0}},text:{[91]:{name:"gfmFootnoteCall",tokenize:KX0},[93]:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:UX0,resolveTo:YX0}}}}function UX0($,Z,J){let H=this,B=H.events.length,Q=H.parser.gfmFootnotes||(H.parser.gfmFootnotes=[]),X;while(B--){let G=H.events[B][1];if(G.type==="labelImage"){X=G;break}if(G.type==="gfmFootnoteCall"||G.type==="labelLink"||G.type==="label"||G.type==="image"||G.type==="link")break}return z;function z(G){if(!X||!X._balanced)return J(G);let U=L4(H.sliceSerialize({start:X.end,end:H.now()}));if(U.codePointAt(0)!==94||!Q.includes(U.slice(1)))return J(G);return $.enter("gfmFootnoteCallLabelMarker"),$.consume(G),$.exit("gfmFootnoteCallLabelMarker"),Z(G)}}function YX0($,Z){let J=$.length,H;while(J--)if($[J][1].type==="labelImage"&&$[J][0]==="enter"){H=$[J][1];break}$[J+1][1].type="data",$[J+3][1].type="gfmFootnoteCallLabelMarker";let B={type:"gfmFootnoteCall",start:Object.assign({},$[J+3][1].start),end:Object.assign({},$[$.length-1][1].end)},Q={type:"gfmFootnoteCallMarker",start:Object.assign({},$[J+3][1].end),end:Object.assign({},$[J+3][1].end)};Q.end.column++,Q.end.offset++,Q.end._bufferIndex++;let X={type:"gfmFootnoteCallString",start:Object.assign({},Q.end),end:Object.assign({},$[$.length-1][1].start)},z={type:"chunkString",contentType:"string",start:Object.assign({},X.start),end:Object.assign({},X.end)},G=[$[J+1],$[J+2],["enter",B,Z],$[J+3],$[J+4],["enter",Q,Z],["exit",Q,Z],["enter",X,Z],["enter",z,Z],["exit",z,Z],["exit",X,Z],$[$.length-2],$[$.length-1],["exit",B,Z]];return $.splice(J,$.length-J+1,...G),$}function KX0($,Z,J){let H=this,B=H.parser.gfmFootnotes||(H.parser.gfmFootnotes=[]),Q=0,X;return z;function z(K){return $.enter("gfmFootnoteCall"),$.enter("gfmFootnoteCallLabelMarker"),$.consume(K),$.exit("gfmFootnoteCallLabelMarker"),G}function G(K){if(K!==94)return J(K);return $.enter("gfmFootnoteCallMarker"),$.consume(K),$.exit("gfmFootnoteCallMarker"),$.enter("gfmFootnoteCallString"),$.enter("chunkString").contentType="string",U}function U(K){if(Q>999||K===93&&!X||K===null||K===91||h1(K))return J(K);if(K===93){$.exit("chunkString");let F=$.exit("gfmFootnoteCallString");if(!B.includes(L4(H.sliceSerialize(F))))return J(K);return $.enter("gfmFootnoteCallLabelMarker"),$.consume(K),$.exit("gfmFootnoteCallLabelMarker"),$.exit("gfmFootnoteCall"),Z}if(!h1(K))X=!0;return Q++,$.consume(K),K===92?Y:U}function Y(K){if(K===91||K===92||K===93)return $.consume(K),Q++,U;return U(K)}}function FX0($,Z,J){let H=this,B=H.parser.gfmFootnotes||(H.parser.gfmFootnotes=[]),Q,X=0,z;return G;function G(q){return $.enter("gfmFootnoteDefinition")._container=!0,$.enter("gfmFootnoteDefinitionLabel"),$.enter("gfmFootnoteDefinitionLabelMarker"),$.consume(q),$.exit("gfmFootnoteDefinitionLabelMarker"),U}function U(q){if(q===94)return $.enter("gfmFootnoteDefinitionMarker"),$.consume(q),$.exit("gfmFootnoteDefinitionMarker"),$.enter("gfmFootnoteDefinitionLabelString"),$.enter("chunkString").contentType="string",Y;return J(q)}function Y(q){if(X>999||q===93&&!z||q===null||q===91||h1(q))return J(q);if(q===93){$.exit("chunkString");let N=$.exit("gfmFootnoteDefinitionLabelString");return Q=L4(H.sliceSerialize(N)),$.enter("gfmFootnoteDefinitionLabelMarker"),$.consume(q),$.exit("gfmFootnoteDefinitionLabelMarker"),$.exit("gfmFootnoteDefinitionLabel"),F}if(!h1(q))z=!0;return X++,$.consume(q),q===92?K:Y}function K(q){if(q===91||q===92||q===93)return $.consume(q),X++,Y;return Y(q)}function F(q){if(q===58){if($.enter("definitionMarker"),$.consume(q),$.exit("definitionMarker"),!B.includes(Q))B.push(Q);return J1($,W,"gfmFootnoteDefinitionWhitespace")}return J(q)}function W(q){return Z(q)}}function WX0($,Z,J){return $.check(K3,Z,$.attempt(GX0,Z,J))}function qX0($){$.exit("gfmFootnoteDefinition")}function NX0($,Z,J){let H=this;return J1($,B,"gfmFootnoteDefinitionIndent",5);function B(Q){let X=H.events[H.events.length-1];return X&&X[1].type==="gfmFootnoteDefinitionIndent"&&X[2].sliceSerialize(X[1],!0).length===4?Z(Q):J(Q)}}function Z_($){let J=($||{}).singleTilde,H={name:"strikethrough",tokenize:Q,resolveAll:B};if(J===null||J===void 0)J=!0;return{text:{[126]:H},insideSpan:{null:[H]},attentionMarkers:{null:[126]}};function B(X,z){let G=-1;while(++G<X.length)if(X[G][0]==="enter"&&X[G][1].type==="strikethroughSequenceTemporary"&&X[G][1]._close){let U=G;while(U--)if(X[U][0]==="exit"&&X[U][1].type==="strikethroughSequenceTemporary"&&X[U][1]._open&&X[G][1].end.offset-X[G][1].start.offset===X[U][1].end.offset-X[U][1].start.offset){X[G][1].type="strikethroughSequence",X[U][1].type="strikethroughSequence";let Y={type:"strikethrough",start:Object.assign({},X[U][1].start),end:Object.assign({},X[G][1].end)},K={type:"strikethroughText",start:Object.assign({},X[U][1].end),end:Object.assign({},X[G][1].start)},F=[["enter",Y,z],["enter",X[U][1],z],["exit",X[U][1],z],["enter",K,z]],W=z.parser.constructs.insideSpan.null;if(W)Q2(F,F.length,0,O7(W,X.slice(U+1,G),z));Q2(F,F.length,0,[["exit",K,z],["enter",X[G][1],z],["exit",X[G][1],z],["exit",Y,z]]),Q2(X,U-1,G-U+3,F),G=U+F.length-2;break}}G=-1;while(++G<X.length)if(X[G][1].type==="strikethroughSequenceTemporary")X[G][1].type="data";return X}function Q(X,z,G){let U=this.previous,Y=this.events,K=0;return F;function F(q){if(U===126&&Y[Y.length-1][1].type!=="characterEscape")return G(q);return X.enter("strikethroughSequenceTemporary"),W(q)}function W(q){let N=d3(U);if(q===126){if(K>1)return G(q);return X.consume(q),K++,W}if(K<2&&!J)return G(q);let D=X.exit("strikethroughSequenceTemporary"),A=d3(q);return D._open=!A||A===2&&Boolean(N),D._close=!N||N===2&&Boolean(A),z(q)}}}class J_{constructor(){this.map=[]}add($,Z,J){AX0(this,$,Z,J)}consume($){if(this.map.sort(function(B,Q){return B[0]-Q[0]}),this.map.length===0)return;let Z=this.map.length,J=[];while(Z>0)Z-=1,J.push($.slice(this.map[Z][0]+this.map[Z][1]),this.map[Z][2]),$.length=this.map[Z][0];J.push($.slice()),$.length=0;let H=J.pop();while(H){for(let B of H)$.push(B);H=J.pop()}this.map.length=0}}function AX0($,Z,J,H){let B=0;if(J===0&&H.length===0)return;while(B<$.map.length){if($.map[B][0]===Z){$.map[B][1]+=J,$.map[B][2].push(...H);return}B+=1}$.map.push([Z,J,H])}function yd($,Z){let J=!1,H=[];while(Z<$.length){let B=$[Z];if(J){if(B[0]==="enter"){if(B[1].type==="tableContent")H.push($[Z+1][1].type==="tableDelimiterMarker"?"left":"none")}else if(B[1].type==="tableContent"){if($[Z-1][1].type==="tableDelimiterMarker"){let Q=H.length-1;H[Q]=H[Q]==="left"?"center":"right"}}else if(B[1].type==="tableDelimiterRow")break}else if(B[0]==="enter"&&B[1].type==="tableDelimiterRow")J=!0;Z+=1}return H}function H_(){return{flow:{null:{name:"table",tokenize:DX0,resolveAll:VX0}}}}function DX0($,Z,J){let H=this,B=0,Q=0,X;return z;function z(j){let k=H.events.length-1;while(k>-1){let T=H.events[k][1].type;if(T==="lineEnding"||T==="linePrefix")k--;else break}let S=k>-1?H.events[k][1].type:null,I=S==="tableHead"||S==="tableRow"?_:G;if(I===_&&H.parser.lazy[H.now().line])return J(j);return I(j)}function G(j){return $.enter("tableHead"),$.enter("tableRow"),U(j)}function U(j){if(j===124)return Y(j);return X=!0,Q+=1,Y(j)}function Y(j){if(j===null)return J(j);if(u0(j)){if(Q>1)return Q=0,H.interrupt=!0,$.exit("tableRow"),$.enter("lineEnding"),$.consume(j),$.exit("lineEnding"),W;return J(j)}if(X1(j))return J1($,Y,"whitespace")(j);if(Q+=1,X)X=!1,B+=1;if(j===124)return $.enter("tableCellDivider"),$.consume(j),$.exit("tableCellDivider"),X=!0,Y;return $.enter("data"),K(j)}function K(j){if(j===null||j===124||h1(j))return $.exit("data"),Y(j);return $.consume(j),j===92?F:K}function F(j){if(j===92||j===124)return $.consume(j),K;return K(j)}function W(j){if(H.interrupt=!1,H.parser.lazy[H.now().line])return J(j);if($.enter("tableDelimiterRow"),X=!1,X1(j))return J1($,q,"linePrefix",H.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(j);return q(j)}function q(j){if(j===45||j===58)return D(j);if(j===124)return X=!0,$.enter("tableCellDivider"),$.consume(j),$.exit("tableCellDivider"),N;return M(j)}function N(j){if(X1(j))return J1($,D,"whitespace")(j);return D(j)}function D(j){if(j===58)return Q+=1,X=!0,$.enter("tableDelimiterMarker"),$.consume(j),$.exit("tableDelimiterMarker"),A;if(j===45)return Q+=1,A(j);if(j===null||u0(j))return O(j);return M(j)}function A(j){if(j===45)return $.enter("tableDelimiterFiller"),V(j);return M(j)}function V(j){if(j===45)return $.consume(j),V;if(j===58)return X=!0,$.exit("tableDelimiterFiller"),$.enter("tableDelimiterMarker"),$.consume(j),$.exit("tableDelimiterMarker"),L;return $.exit("tableDelimiterFiller"),L(j)}function L(j){if(X1(j))return J1($,O,"whitespace")(j);return O(j)}function O(j){if(j===124)return q(j);if(j===null||u0(j)){if(!X||B!==Q)return M(j);return $.exit("tableDelimiterRow"),$.exit("tableHead"),Z(j)}return M(j)}function M(j){return J(j)}function _(j){return $.enter("tableRow"),w(j)}function w(j){if(j===124)return $.enter("tableCellDivider"),$.consume(j),$.exit("tableCellDivider"),w;if(j===null||u0(j))return $.exit("tableRow"),Z(j);if(X1(j))return J1($,w,"whitespace")(j);return $.enter("data"),C(j)}function C(j){if(j===null||j===124||h1(j))return $.exit("data"),w(j);return $.consume(j),j===92?E:C}function E(j){if(j===92||j===124)return $.consume(j),C;return C(j)}}function VX0($,Z){let J=-1,H=!0,B=0,Q=[0,0,0,0],X=[0,0,0,0],z=!1,G=0,U,Y,K,F=new J_;while(++J<$.length){let W=$[J],q=W[1];if(W[0]==="enter"){if(q.type==="tableHead"){if(z=!1,G!==0)xd(F,Z,G,U,Y),Y=void 0,G=0;U={type:"table",start:Object.assign({},q.start),end:Object.assign({},q.end)},F.add(J,0,[["enter",U,Z]])}else if(q.type==="tableRow"||q.type==="tableDelimiterRow"){if(H=!0,K=void 0,Q=[0,0,0,0],X=[0,J+1,0,0],z)z=!1,Y={type:"tableBody",start:Object.assign({},q.start),end:Object.assign({},q.end)},F.add(J,0,[["enter",Y,Z]]);B=q.type==="tableDelimiterRow"?2:Y?3:1}else if(B&&(q.type==="data"||q.type==="tableDelimiterMarker"||q.type==="tableDelimiterFiller")){if(H=!1,X[2]===0){if(Q[1]!==0)X[0]=X[1],K=uW(F,Z,Q,B,void 0,K),Q=[0,0,0,0];X[2]=J}}else if(q.type==="tableCellDivider")if(H)H=!1;else{if(Q[1]!==0)X[0]=X[1],K=uW(F,Z,Q,B,void 0,K);Q=X,X=[Q[1],J,0,0]}}else if(q.type==="tableHead")z=!0,G=J;else if(q.type==="tableRow"||q.type==="tableDelimiterRow"){if(G=J,Q[1]!==0)X[0]=X[1],K=uW(F,Z,Q,B,J,K);else if(X[1]!==0)K=uW(F,Z,X,B,J,K);B=0}else if(B&&(q.type==="data"||q.type==="tableDelimiterMarker"||q.type==="tableDelimiterFiller"))X[3]=J}if(G!==0)xd(F,Z,G,U,Y);F.consume(Z.events),J=-1;while(++J<Z.events.length){let W=Z.events[J];if(W[0]==="enter"&&W[1].type==="table")W[1]._align=yd(Z.events,J)}return $}function uW($,Z,J,H,B,Q){let X=H===1?"tableHeader":H===2?"tableDelimiter":"tableData",z="tableContent";if(J[0]!==0)Q.end=Object.assign({},EH(Z.events,J[0])),$.add(J[0],0,[["exit",Q,Z]]);let G=EH(Z.events,J[1]);if(Q={type:X,start:Object.assign({},G),end:Object.assign({},G)},$.add(J[1],0,[["enter",Q,Z]]),J[2]!==0){let U=EH(Z.events,J[2]),Y=EH(Z.events,J[3]),K={type:"tableContent",start:Object.assign({},U),end:Object.assign({},Y)};if($.add(J[2],0,[["enter",K,Z]]),H!==2){let F=Z.events[J[2]],W=Z.events[J[3]];if(F[1].end=Object.assign({},W[1].end),F[1].type="chunkText",F[1].contentType="text",J[3]>J[2]+1){let q=J[2]+1,N=J[3]-J[2]-1;$.add(q,N,[])}}$.add(J[3]+1,0,[["exit",K,Z]])}if(B!==void 0)Q.end=Object.assign({},EH(Z.events,B)),$.add(B,0,[["exit",Q,Z]]),Q=void 0;return Q}function xd($,Z,J,H,B){let Q=[],X=EH(Z.events,J);if(B)B.end=Object.assign({},X),Q.push(["exit",B,Z]);H.end=Object.assign({},X),Q.push(["exit",H,Z]),$.add(J+1,0,Q)}function EH($,Z){let J=$[Z],H=J[0]==="enter"?"start":"end";return J[1][H]}var LX0={name:"tasklistCheck",tokenize:MX0};function B_(){return{text:{[91]:LX0}}}function MX0($,Z,J){let H=this;return B;function B(G){if(H.previous!==null||!H._gfmTasklistFirstContentOfListItem)return J(G);return $.enter("taskListCheck"),$.enter("taskListCheckMarker"),$.consume(G),$.exit("taskListCheckMarker"),Q}function Q(G){if(h1(G))return $.enter("taskListCheckValueUnchecked"),$.consume(G),$.exit("taskListCheckValueUnchecked"),X;if(G===88||G===120)return $.enter("taskListCheckValueChecked"),$.consume(G),$.exit("taskListCheckValueChecked"),X;return J(G)}function X(G){if(G===93)return $.enter("taskListCheckMarker"),$.consume(G),$.exit("taskListCheckMarker"),$.exit("taskListCheck"),z;return J(G)}function z(G){if(u0(G))return Z(G);if(X1(G))return $.check({tokenize:PX0},Z,J)(G);return J(G)}}function PX0($,Z,J){return J1($,H,"whitespace");function H(B){return B===null?J(B):Z(B)}}function hd($){return ZW([tP(),$_(),Z_($),H_(),B_()])}var _X0={};function pW($){let Z=this,J=$||_X0,H=Z.data(),B=H.micromarkExtensions||(H.micromarkExtensions=[]),Q=H.fromMarkdownExtensions||(H.fromMarkdownExtensions=[]),X=H.toMarkdownExtensions||(H.toMarkdownExtensions=[]);B.push(hd(J)),Q.push(oP()),X.push(nP(J))}var BZ=P(c(),1),OX0=[pW],jX0=[gW],TX0={code({node:$,className:Z,children:J,...H}){return BZ.jsx("code",{className:Q0("rounded-xs bg-accent px-1 py-0.5 font-mono font-normal before:content-none after:content-none",Z),...H,children:J})},pre({children:$}){return BZ.jsx("div",{className:"not-prose my-2 rounded-lg border border-border bg-accent px-3 py-2.5",children:BZ.jsx("pre",{className:"overflow-auto font-mono text-xs leading-relaxed whitespace-pre text-foreground [&>code]:rounded-none [&>code]:bg-transparent [&>code]:p-0",children:$})})}};function vd({size:$="sm",content:Z}){let J=p1(),{base:H}=C2();return BZ.jsx("div",{className:Q0("prose max-w-full min-w-0 wrap-anywhere prose-inherit",$==="sm"&&"prose-sm"),children:BZ.jsx(EW,{remarkPlugins:OX0,rehypePlugins:jX0,components:TX0,urlTransform:(B,Q,X)=>{if(X.tagName==="a"&&Q==="href"&&B.startsWith("moi:"))try{return A8(B,{workspaceId:J,base:H})}catch{return""}return bW(B)},children:Z})})}function fd({content:$}){return BZ.jsx(EW,{allowedElements:[],skipHtml:!0,unwrapDisallowed:!0,children:$})}var C_=P(m(),1);var gd="/airtable-hsa66v6q.png";var md="/apollo-2ed5dy2d.png";var ud="/asana-tvgtwbx2.png";var pd="/atlassian-b3tq39hs.png";var cd="/box-w3n36t5g.png";var Q_="/chrome-tspm94rw.svg";var dd="/clickup-qqrqqvqb.png";var ld="/cloudflare-j9p931v6.png";var id="/context7-8ht0xjfy.png";var rd="/datadog-70ne3yzt.png";var ad="/discord-vejhptwx.png";var od="/dropbox-4m5s9mgr.png";var nd="/elevenlabs-2nzzej1t.png";var sd="/exa-qqj3vr0x.png";var td="/figma-y9898rry.png";var ed="/firecrawl-w2t8nehx.png";var $l="/github-av5r5y3e.png";var Zl="/gitlab-4pv5vm6b.png";var Jl="/gmail-sg6a5v3x.png";var Hl="/googlecalendar-nqhh2v7r.png";var Bl="/googledrive-6s8xyab7.png";var Ql="/grafana-1yfsnwr6.png";var Xl="/granola-7j3b0nk2.png";var zl="/hubspot-hghcmc2t.png";var Gl="/huggingface-kxzaxj83.png";var Ul="/intercom-td763jt8.png";var Yl="/linear-v9s3az2d.png";var Kl="/monday-jdbs4wwf.png";var Fl="/mongodb-emzxvhd5.png";var Wl="/neon-zj4qar44.png";var ql="/notion-w034c0b8.png";var Nl="/paper-zbt34fab.png";var Al="/paypal-kwwf7xsc.png";var Dl="/perplexity-4y63rxvj.png";var Vl="/postgresql-qsspbsr1.png";var Ll="/posthog-sphppc4w.png";var Ml="/puppeteer-2xjt1a9b.png";var Pl="/railway-834de8d2.png";var _l="/redis-spm6w2m1.png";var Ol="/salesforce-1mk56v4z.png";var jl="/sentry-hdwpmvek.png";var Tl="/shopify-90dadaav.png";var Cl="/slack-1c1wj62s.png";var El="/snowflake-hfpykpgy.png";var bl="/stripe-zrfaqbj3.png";var wl="/supabase-4vg33zf2.png";var Sl="/telegram-v6tjyrs7.png";var Rl="/twilio-dpyjdwpj.png";var Il="/vercel-7d0ssw28.png";var kl="/zapier-p67qfch0.png";var _z0={airtable:gd,apollo:md,asana:ud,atlassian:pd,box:cd,chrome:Q_,"chrome-devtools":Q_,clickup:dd,cloudflare:ld,context7:id,datadog:rd,discord:ad,dropbox:od,elevenlabs:nd,exa:sd,figma:td,firecrawl:ed,github:$l,gitlab:Zl,gmail:Jl,googlecalendar:Hl,googledrive:Bl,grafana:Ql,granola:Xl,hubspot:zl,huggingface:Gl,intercom:Ul,linear:Yl,monday:Kl,mongodb:Fl,neon:Wl,notion:ql,paper:Nl,paypal:Al,perplexity:Dl,postgresql:Vl,posthog:Ll,puppeteer:Ml,railway:Pl,redis:_l,salesforce:Ol,sentry:jl,shopify:Tl,slack:Cl,snowflake:El,stripe:bl,supabase:wl,telegram:Sl,twilio:Rl,vercel:Il,zapier:kl},Oz0={"google drive":"googledrive","google calendar":"googlecalendar",gcal:"googlecalendar",gdrive:"googledrive","apollo.io":"apollo","paper-desktop":"paper","granola-mcp":"granola","claude-in-chrome":"chrome",postgres:"postgresql","hugging face":"huggingface",jira:"atlassian",confluence:"atlassian"};function yl($){let Z=$.match(/^claude[._]ai[._\s]+(.+)$/i);if(!Z)return $;return Z[1].replace(/_/g," ")}function cW($){return $.toLowerCase().replace(/[\s._-]+/g,"")}var jz0=new Map(Object.entries(_z0).map(([$,Z])=>[cW($),Z])),Tz0=new Map(Object.entries(Oz0).map(([$,Z])=>[cW($),cW(Z)]));function dW($){let Z=cW(yl($));return jz0.get(Tz0.get(Z)??Z)}function lW($){return yl($).split(/[\s._-]+/).filter(Boolean).map((Z)=>Z[0].toUpperCase()+Z.slice(1)).join(" ")}var X_=P(c(),1);function OX({open:$,children:Z}){return X_.jsx(I4,{initial:!1,children:$&&X_.jsx(Y5.div,{initial:{height:0,opacity:0},animate:{height:"auto",opacity:1},exit:{height:0,opacity:0},transition:{type:"spring",duration:0.25,bounce:0.1},className:"overflow-hidden",children:Z},"content")})}var xl=P(m(),1);var fl=P(c(),1),Cz0=/\.(png|jpe?g|gif|webp|avif|svg)$/i;function hl($,Z){if($.name!=="Read"||!Z)return null;let J=$.input,H=typeof J.file_path==="string"?J.file_path:null;if(!H||!Cz0.test(H))return null;let B=Z.endsWith("/")?Z:`${Z}/`;if(!H.startsWith(B))return null;return H.slice(B.length)}function vl({relPath:$}){let Z=p1(),[J,H]=xl.useState(!1);if(J)return null;let B=`/api/workspaces/${Z}/preview/${$.split("/").map(encodeURIComponent).join("/")}`;return fl.jsx("img",{src:B,alt:$,loading:"lazy",onError:()=>H(!0),className:"max-h-64 max-w-full self-start rounded-lg border border-border object-contain"})}var EX=P(m(),1);var ml=P(c(),1),Ez0=Q0("animate-[text-shimmer_2s_ease-in-out_infinite]","bg-clip-text text-transparent","bg-[length:200%_auto]","bg-[linear-gradient(90deg,var(--muted-foreground)_0%,var(--muted-foreground)_40%,var(--foreground)_50%,var(--muted-foreground)_60%,var(--muted-foreground)_100%)]");function gl({children:$,active:Z=!0,className:J}){return ml.jsx("span",{className:Q0(J,Z&&Ez0),children:$})}var jX=P(c(),1);function iW({className:$}){return jX.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round",className:$,"aria-hidden":"true",children:[jX.jsx("path",{d:"M3.49994 11.7501L11.6717 3.57855C12.7762 2.47398 14.5672 2.47398 15.6717 3.57855C16.7762 4.68312 16.7762 6.47398 15.6717 7.57855M15.6717 7.57855L9.49994 13.7501M15.6717 7.57855C16.7762 6.47398 18.5672 6.47398 19.6717 7.57855C20.7762 8.68312 20.7762 10.474 19.6717 11.5785L12.7072 18.543C12.3167 18.9335 12.3167 19.5667 12.7072 19.9572L13.9999 21.2499"}),jX.jsx("path",{d:"M17.4999 9.74921L11.3282 15.921C10.2238 17.0255 8.43275 17.0255 7.32825 15.921C6.22376 14.8164 6.22376 13.0255 7.32825 11.921L13.4999 5.74939"})]})}var O2=P(c(),1),rW="group/row flex w-full items-center gap-2 py-1.5 text-left select-none";function wH({isFirst:$,isLast:Z,marker:J,loading:H=!1,isError:B=!1,children:Q}){let X=J!=null||H;return O2.jsxs("div",{className:"relative flex gap-2.5",children:[O2.jsxs("div",{className:"relative w-[13px] shrink-0",children:[!$&&O2.jsx("span",{className:Q0("absolute top-0 left-1/2 w-px -translate-x-1/2 bg-border",X?"h-1":"h-2.5")}),!Z&&O2.jsx("span",{className:Q0("absolute bottom-0 left-1/2 w-px -translate-x-1/2 bg-border",X?"top-[26px]":"top-5")}),J?O2.jsx("span",{className:"absolute top-[15px] left-1/2 z-10 -translate-x-1/2 -translate-y-1/2",children:J}):H?O2.jsx("span",{className:"absolute top-[15px] left-1/2 z-10 flex -translate-x-1/2 -translate-y-1/2 p-0.5",children:O2.jsx(d5,{size:12,stroke:1.75,className:"animate-spin text-muted-foreground"})}):O2.jsx("span",{className:Q0("absolute top-[15px] left-1/2 z-10 size-[5px] -translate-x-1/2 -translate-y-1/2 rounded-full",B?"bg-destructive":"bg-border")})]}),Q]})}function TX({open:$}){return O2.jsx(Y5.span,{animate:{rotate:$?90:0},transition:{type:"spring",duration:0.2,bounce:0.1},className:Q0("flex shrink-0",$?"opacity-100":"opacity-0 group-hover/row:opacity-100"),children:O2.jsx(u3,{size:12,stroke:1.75})})}function bH({children:$,className:Z}){return O2.jsx("span",{className:Q0("flex size-4 items-center justify-center overflow-hidden rounded-xs bg-muted",Z),children:$})}function ul({icon:$,size:Z=12,stroke:J=1.75}){return O2.jsx(bH,{children:O2.jsx($,{size:Z,stroke:J,className:"text-muted-foreground"})})}function pl({src:$}){if(!$)return O2.jsx(bH,{children:O2.jsx(iW,{className:"size-3 text-muted-foreground"})});return O2.jsx(bH,{children:O2.jsx("img",{src:$,alt:"",className:"size-full object-cover"})})}var fz0=ll(),z_=tl();function gz0($){if(!$)return"$";return/^[A-Za-z_][A-Za-z0-9_]*$/.test($)?`$${$}`:`\${${$}}`}function mz0($){try{return z_($,gz0)}catch{return null}}function el($){return $.split("/").pop()??$}var uz0=new Set(["bash","sh","zsh","fish","dash","ash","ksh","mksh","csh","tcsh","nu","pwsh","powershell"]),pz0=new Set(["-o","+o","-O","+O","--rcfile","--init-file"]),cz0=/^[A-Za-z_][A-Za-z0-9_]*=/;function dz0($){if(/^-[a-zA-Z]*c$/.test($))return!0;let Z=$.toLowerCase();return Z==="--command"||Z==="-command"}function lz0($){let Z=mz0($);if(!Z||Z.length<3)return null;let J=(Q)=>{let X=Z[Q];return typeof X==="string"?X:null},H=0,B=()=>{while(cz0.test(J(H)??""))H++};if(B(),el(J(H)??"")==="env")H++,B();if(!uz0.has(el(J(H)??"")))return null;H++;while(H<Z.length){let Q=J(H);if(Q===null)return null;if(dz0(Q)){if(H+2!==Z.length)return null;return J(H+1)?.trim()||null}if(!Q.startsWith("-")&&!Q.startsWith("+"))return null;H+=pz0.has(Q)?2:1}return null}function iz0($){let Z=$;for(let J=0;J<3;J++){let H=lz0(Z);if(H===null)return Z;Z=H}return Z}function rz0($){return $.replace(/\\\r?\n[ \t]*/g," ").replace(/[ \t]*\r?\n[ \t]*/g," ").replace(/[ \t]{2,}/g," ").trim()}function XZ($){return rz0(iz0($))}function SH($,Z){let J=XZ($);return J?Z(`$ ${J}`):""}var az0=/^[A-Za-z]:\//;function oz0($=""){if(!$)return $;return $.replace(/\\/g,"/").replace(az0,(Z)=>Z.toUpperCase())}var nz0=/^[/\\](?![/\\])|^[/\\]{2}(?!\.)|^[A-Za-z]:[/\\]/;var $i=/^\/([A-Za-z]:)?$/;function sz0(){if(typeof process<"u"&&typeof process.cwd==="function")return process.cwd().replace(/\\/g,"/");return"/"}var G_=function(...$){$=$.map((H)=>oz0(H));let Z="",J=!1;for(let H=$.length-1;H>=-1&&!J;H--){let B=H>=0?$[H]:sz0();if(!B||B.length===0)continue;Z=`${B}/${Z}`,J=U_(B)}if(Z=Zi(Z,!J),J&&!U_(Z))return`/${Z}`;return Z.length>0?Z:"."};function Zi($,Z){let J="",H=0,B=-1,Q=0,X=null;for(let z=0;z<=$.length;++z){if(z<$.length)X=$[z];else if(X==="/")break;else X="/";if(X==="/"){if(B===z-1||Q===1);else if(Q===2){if(J.length<2||H!==2||J[J.length-1]!=="."||J[J.length-2]!=="."){if(J.length>2){let G=J.lastIndexOf("/");if(G===-1)J="",H=0;else J=J.slice(0,G),H=J.length-1-J.lastIndexOf("/");B=z,Q=0;continue}else if(J.length>0){J="",H=0,B=z,Q=0;continue}}if(Z)J+=J.length>0?"/..":"..",H=2}else{if(J.length>0)J+=`/${$.slice(B+1,z)}`;else J=$.slice(B+1,z);H=z-B-1}B=z,Q=0}else if(X==="."&&Q!==-1)++Q;else Q=-1}return J}var U_=function($){return nz0.test($)};var Y_=function($,Z){let J=G_($).replace($i,"$1").split("/"),H=G_(Z).replace($i,"$1").split("/");if(H[0][1]===":"&&J[0][1]===":"&&J[0]!==H[0])return H.join("/");let B=[...J];for(let Q of B){if(H[0]!==Q)break;J.shift(),H.shift()}return[...J.map(()=>".."),...H].join("/")};function RH($){return $.input??{}}function q1($,Z){let J=$[Z];return typeof J==="string"?J:""}function Ji($){return(Z)=>Z.replace(/\/[^\s"']+/g,(J)=>{if(!$)return J;let H=Y_($,J);return H.startsWith("..")?J:H})}function zZ($){let Z=Math.max(1,Math.round($/1000));if(Z<60)return`${Z}s`;let J=Math.floor(Z/60),H=Z%60;return H?`${J}m ${H}s`:`${J}m`}var tz0={ToolSearch:"Tool search",WebSearch:"Web search",WebFetch:"Web fetch"};function ez0($){if(!$.startsWith("mcp__"))return $;let Z=$.slice(5).split("__");return Z.length>=2?Z.slice(1).join("__"):Z[0]}function $G0($,Z){let J=$.name,H=RH($);if(J==="Bash")return SH(q1(H,"command"),Z);if(J==="Read"||J==="Write"||J==="Edit")return Z(q1(H,"file_path"));if(J==="Glob")return Z(q1(H,"pattern"));if(J==="Grep")return`/${q1(H,"pattern")}/ ${Z(q1(H,"path"))}`;if(J==="WebSearch")return q1(H,"query");if(J==="WebFetch")return q1(H,"url");if(J==="ToolSearch"){let B=q1(H,"query");if(B.startsWith("select:"))return B.slice(7).split(",").map(ez0).join(", ");return B}return""}var CX={displayName:($)=>tz0[$.name]??$.name,brief:$G0};var K_={exec:"Bash",apply_patch:"Edit",web_search:"Web search",update_plan:"Update plan",subagent:"Run sub-agent",subagent_activity:"Sub-agent",review:"Review",view_image:"View image",generate_image:"Generate image",list_mcp_resources:"List MCP resources",list_mcp_resource_templates:"List MCP templates",read_mcp_resource:"Read MCP resource"},Bi={read:"Read",listFiles:"List files",search:"Search"};function Qi($){let Z=$?.commandActions;if(!Array.isArray(Z)||Z.length===0)return null;let J=Z[0],H=J?.type;if(!H||!(H in Bi))return null;if(Z.some((B)=>B?.type!==H))return null;return J}var Hi={spawn_agent:"Run sub-agent",send_input:"Message the agent",resume_agent:"Resume the agent",close_agent:"Stopping the agent"};function ZG0($){if($.name==="exec"){let Z=Qi($.input);if(Z?.type)return Bi[Z.type]}if($.name==="subagent"){let Z=$.input?.action;if(typeof Z==="string"&&Z in Hi)return Hi[Z]}return K_[$.name]??$.name}function JG0($,Z){let J=$.name,H=RH($);if(J==="exec"){let B=Qi(H);if(B?.type==="read")return Z(B.path||B.name||"");if(B?.type==="search")return[B.query&&`/${B.query}/`,B.path&&Z(B.path)].filter(Boolean).join(" ");if(B?.type==="listFiles")return B.path?Z(B.path):"";return SH(q1(H,"command"),Z)}if(J==="apply_patch"){let B=H.changes;if(Array.isArray(B))return B.map((X)=>X&&typeof X==="object"?X.path:void 0).filter((X)=>typeof X==="string").map(Z).join(", ");return""}if(J==="web_search"){let B=H.queries;if(Array.isArray(B)&&B.length>0)return B.filter((Q)=>typeof Q==="string").join(" · ");return q1(H,"query")||[q1(H,"url"),q1(H,"pattern")].filter(Boolean).join(" · ")}if(J==="update_plan"){let B=H.plan;return typeof B==="string"?B.split(`
52
+ `)[0]:""}if(J==="subagent"){if(q1(H,"action")==="close_agent")return"";return q1(H,"prompt")}if(J==="subagent_activity")return q1(H,"kind");if(J==="generate_image")return q1(H,"prompt").split(`
53
+ `)[0];if(J==="read_mcp_resource")return q1(H,"uri");if(J==="list_mcp_resources"||J==="list_mcp_resource_templates")return q1(H,"server");return""}var Xi={displayName:ZG0,brief:JG0};function zi($){let Z=$.indexOf(":"),J=(Z>0?$.slice(0,Z):$).trim(),H=Z>0?$.slice(Z+1).trim():"",B=J.match(/^(.*?)\s*\(([^)]*)\)$/);if(!B)return{action:J,qualifier:"",detail:H};return{action:B[1].trim(),qualifier:B[2].trim(),detail:H}}var HG0={terminal:"Run command",read:"Read",write:"Write",edit:"Edit",patch:"Edit",search:"Search",extract:"Fetch webpage","web extract":"Fetch webpage","web search":"Web search",delegate:"Delegate task","delegate batch":"Delegate tasks",todo:"Update TODO",python:"Run Python","process wait":"Wait for process","session search":"Search sessions","skills list":"List skills","skill view":"View skill"};function BG0($){let{action:Z}=zi($.name),J=HG0[Z];if(J)return J;let H=Z.replace(/_/g," ");return H.charAt(0).toUpperCase()+H.slice(1)}function QG0($,Z){let{action:J,qualifier:H,detail:B}=zi($.name),Q=B||H;if(!Q)return"";return J==="terminal"?`$ ${XZ(Q)}`:Z(Q)}var Gi={displayName:BG0,brief:QG0};var XG0={read:"Read file",write:"Write file",edit:"Edit file",apply_patch:"Edit",exec:"Bash",bash:"Bash",ls:"List files",find:"Find files",grep:"Search",process:"Manage process",web_search:"Web search",web_fetch:"Fetch",sessions_list:"List sessions",sessions_history:"Recall session",sessions_yield:"Yield to session",sessions_send:"Send to session",sessions_spawn:"Spawn session",subagents:"Run sub-agent",agents_list:"List agents",session_status:"Session status",image:"Analyze image",image_generate:"Generate image",memory_get:"Read memory",memory_search:"Search memory",update_plan:"Update plan",message:"Send message",browser:"Browser",canvas:"Canvas",cron:"Cron",gateway:"Gateway",code_execution:"Run Python",tts:"Text-to-speech",music_generate:"Generate music",video_generate:"Generate video",x_search:"Search X"};function zG0($,Z){let J=$.name,H=RH($);if(J==="read"||J==="write"||J==="edit")return Z(q1(H,"path"));if(J==="apply_patch"){let B=H.changes;if(Array.isArray(B)&&B.length>0){let z=B.map((G)=>G&&typeof G==="object"?q1(G,"path"):"").filter(Boolean);if(z.length===1)return Z(z[0]);if(z.length>1)return`${z.length} files`}let Q=q1(H,"patch")||q1(H,"input"),X=Q.split(`
54
+ `).find((z)=>z.startsWith("*** "))??Q.split(`
55
+ `)[0];return Z(X??"")}if(J==="exec"||J==="bash"){let B=q1(H,"command")||q1(H,"code");return SH(B,Z)}if(J==="ls"||J==="find"||J==="grep")return Z(q1(H,"path")||q1(H,"pattern"));if(J==="process"){let B=q1(H,"action"),Q=q1(H,"name");return[B,Q].filter(Boolean).join(" ")||Z(XZ(q1(H,"command")))}if(J==="web_search"||J==="x_search")return q1(H,"query");if(J==="web_fetch")return q1(H,"url");if(J==="memory_search")return q1(H,"query");if(J==="memory_get")return q1(H,"key")||q1(H,"name");if(J==="sessions_history"||J==="sessions_send"||J==="sessions_yield")return q1(H,"sessionKey")||q1(H,"agentId");if(J==="sessions_list"||J==="agents_list")return q1(H,"agentId");if(J==="subagents"||J==="sessions_spawn")return q1(H,"task")||q1(H,"agentId");if(J==="image"||J==="image_generate")return q1(H,"prompt")||Z(q1(H,"path"));if(J==="message")return q1(H,"recipient")||q1(H,"to");if(J==="update_plan"){let B=H.plan;if(Array.isArray(B)){let X=B.find((z)=>!!z&&typeof z==="object"&&z.status==="in_progress")?.step??B[0]?.step;if(typeof X==="string")return X}return""}return""}var Ui={displayName:($)=>XG0[$.name]??CX.displayName($),brief:($,Z)=>zG0($,Z)||CX.brief($,Z)};function F_($){if(!($.name==="Bash"||$.name==="exec"||$.name==="bash"))return null;let J=$.input??{},H=typeof J.command==="string"?J.command:"";if(!H)return null;let Q=XZ(H).match(/(?:^|\s|\$\()mcporter(?:\)?)\s+call\s+([A-Za-z0-9_-]+)\.([A-Za-z0-9_-]+)((?:\s+(?!&&|\|\||;|\|)\S+)*)/);if(!Q)return null;return{server:Q[1],tool:Q[2],rest:(Q[3]??"").trim()}}function W_($){let Z=$.name;if(!Z.startsWith("mcp__"))return null;let J=Z.slice(5),H=J.indexOf("__");if(H<=0)return null;return{server:J.slice(0,H),tool:J.slice(H+2),rest:""}}function q_($){if($.provider!=="codex"||!$.mcpServer)return null;if($.name in K_)return null;if($.mcpServer==="codex")return null;let Z=$.name.indexOf(".");if(Z>0)return{server:$.name.slice(0,Z),tool:$.name.slice(Z+1),rest:""};return{server:$.mcpServer,tool:$.name,rest:""}}function N_($,Z){let J=Z.toLowerCase();return["-","_","."].find((B)=>J.startsWith($.toLowerCase()+B))?Z.slice($.length+1):Z}var GG0={"claude-code":CX,openclaw:Ui,codex:Xi,hermes:Gi};function Yi($){return GG0[$.provider??"claude-code"]}function Ki($){return Yi($).displayName($)}function Fi($,Z){return Yi($).brief($,Ji(Z))}var X2=P(c(),1),Wi=[qi,Ni,A_];function UG0(){let[$,Z]=EX.useState(0);EX.useEffect(()=>{let H=setInterval(()=>Z((B)=>(B+1)%Wi.length),600);return()=>clearInterval(H)},[]);let J=Wi[$];return X2.jsx(bH,{className:"size-5",children:X2.jsx(J,{size:16,stroke:1.75,className:"text-foreground"})})}function Ai({call:$,cwd:Z,isFirst:J,isLast:H,renderNestedParts:B}){let[Q,X]=EX.useState(!1),z=$.subagent,G=$.input??{},U=z?.description??G.description??"Subtask",Y=z?.status,K=$.state==="error"||Y==="failed",F=$.state==="running"||Y==="running",W=z?.usage?.toolUses,q=z?.usage?.durationMs,D=(F&&z?.progress?.length?z.progress[z.progress.length-1]:null)??(W!=null?`Took ${W} step${W===1?"":"s"}`:null),A=(z?.transcript??[]).flatMap((O)=>O.parts),V=typeof $.output==="string"?$.output:"",L=A.length>0||!!V;return X2.jsx(wH,{isFirst:J,isLast:H,marker:F?X2.jsx(UG0,{}):X2.jsx(bH,{className:"size-5",children:X2.jsx(A_,{size:16,stroke:1.75,className:"text-foreground"})}),isError:K,children:X2.jsxs("div",{className:"min-w-0 flex-1",children:[X2.jsxs("button",{type:"button",title:`Agent: ${U}`,onClick:()=>L&&X((O)=>!O),className:Q0("group/row flex w-full flex-col items-start gap-0.5 py-1.5 text-left select-none",L?"cursor-pointer":"cursor-default"),children:[X2.jsxs("span",{className:"flex w-full items-center gap-2",children:[X2.jsxs(gl,{active:F,className:"min-w-0 flex-1 truncate text-xs font-medium",children:["Agent: ",U]}),!F&&q!=null&&X2.jsx("span",{className:"shrink-0 rounded-full border border-border px-1.5 text-[10px] font-medium text-muted-foreground tabular-nums",children:zZ(q)}),Y==="failed"&&X2.jsx("span",{className:"shrink-0 text-xs text-destructive",children:"✗"}),Y==="stopped"&&X2.jsx("span",{className:"shrink-0 text-xs text-muted-foreground",children:"✗"}),L&&X2.jsx(TX,{open:Q})]}),D&&X2.jsx("span",{className:"w-full truncate text-xs text-muted-foreground",children:D})]}),L&&X2.jsx(OX,{open:Q,children:X2.jsxs("div",{className:"mt-1 mb-1 overflow-hidden rounded-lg border border-border",children:[A.length>0&&X2.jsx("div",{className:"py-1.5 pr-2 pl-3",children:B(A,Z)}),V&&X2.jsx("div",{className:Q0("bg-muted/30 px-3.5 py-3 text-xs leading-relaxed whitespace-pre-wrap text-muted-foreground",A.length>0&&"border-t border-border"),children:V})]})})]})})}var GZ=P(m(),1);var Ci=P(m(),1);var V_=new Set(["<",">","{","}","[","]"]),__=new Set(["for","do","while","if","else","return","function","var","let","const","true","false","undefined","this","new","delete","typeof","in","instanceof","void","break","continue","switch","case","default","throw","try","catch","finally","debugger","with","yield","async","await","class","extends","super","import","export","from","static"]),YG0=new Set([...__,"type","interface","enum","implements","readonly","abstract","declare","namespace","module","private","protected","public","override","keyof","infer","is","asserts","satisfies","as","unknown","never","any","number","string","boolean","bigint","symbol","object"]),Mi=new Set(["+","-","*","/","%","=","!","&","|","^","~","!","?",":",".",",",";","'",'"',".","(",")","[","]","#","@","\\",...V_]),KG0={keywords:__,onCommentStart:ji,onCommentEnd:PG0};function FG0($){let Z=0;if(/\binterface\s+[A-Za-z_$][\w$]*/.test($))Z+=2;if(/\btype\s+[A-Za-z_$][\w$]*\s*=/.test($))Z+=2;if(/\benum\s+[A-Za-z_$][\w$]*/.test($))Z+=2;if(/\b(?:implements|readonly|declare|namespace|satisfies|infer|keyof|asserts)\b/.test($))Z+=2;if(/:\s*[A-Za-z_$][\w$]*(?:<[^>\n]+>)?(?:\[\])?(?=\s*[,)=;{])/m.test($))Z+=1;if(/\b(?:const|let|var)\s+[A-Za-z_$][\w$]*\s*:\s*/.test($))Z+=1;if(/\)\s*:\s*[A-Za-z_$][\w$]*(?:<[^>\n]+>)?(?:\[\])?\s*(?:=>|\{)/.test($))Z+=1;return Z>=2}function WG0($,Z){if($[Z]!=="<")return!1;let J=0,H=!1;for(let B=Z;B<$.length;B++){let Q=$[B];if(Q==="<"){J++;continue}if(Q===">"){if(J--,J===0){let X=B+1;while(X<$.length&&/\s/.test($[X]))X++;if(!(H&&$[X]==="("))return!1;let z=$.slice(X,X+320);return/\)\s*(?::[\s\S]{0,120}?)?=>/.test(z)}continue}if(J===0)continue;if(/[$A-Za-z_]/.test(Q)){H=!0;continue}if(/[\s,\.\=\?\:\|\&\[\]]/.test(Q))continue;return!1}return!1}var sW=["identifier","keyword","string","class","property","entity","jsxliterals","sign","comment","break","space"],[IH,qG0,E7,D_,nW,NG0,AG0,N3,Di,L_,Vi]=sW.map(($,Z)=>Z);function bX($){return/^[^\S\r\n]+$/g.test($)}function DG0($){return Mi.has($)}var VG0={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#039;"};function LG0($){if(!/[&<>"']/.test($))return $;return $.replace(/[&<>"']/g,(Z)=>VG0[Z])}function tW($){return/^[\w_]+$/.test($)||Pi($)}function Li($){let Z=$[0];return tW(Z)&&Z===Z.toUpperCase()||$==="null"}function Pi($){return/[^\u0000-\u007f]/.test($)}function _i($){return/^[a-zA-Z]$/.test($)}function Oi($){return _i($)||Pi($)}function kH($){return Oi($[0])&&($.length===1||tW($.slice(1)))}function M_($){return $==="`"}function P_($){return $==='"'||$==="'"}function MG0($){return P_($)||M_($)}function ji($,Z){let J=$+Z;if(J==="/*")return 2;return J==="//"?1:0}function PG0($,Z){return $+Z==="*/"?2:Z===`
56
+ `?1:0}function _G0($){return $[0]==="/"&&!ji($[0],$[1])}function OG0($,Z){let J=Z+1;while(J<$.length&&/\s/.test($[J]))J++;return $[J]===":"}function jG0($,Z){let J={...KG0,...Z},H=!!(Z&&Z.keywords instanceof Set),B=FG0($),Q=H?J.keywords:B?YG0:__,{onCommentStart:X,onCommentEnd:z}=J,G=J.typeKeywords instanceof Set?J.typeKeywords:null,U="",Y=-1,K=[-1,""],F=[-2,""],W=[],q=!1,N=0,D=!1,A=0,V=()=>q&&!D&&!N,L=()=>N&&!V(),O=()=>!N&&V()&&!D&&A>0,M=null,_=0,w=!1,C=0,E=0,j=()=>M!==null,k=()=>w,S=()=>E>C,I=()=>E>0&&E===C,T=()=>j()||S();function y(x){let v=x===`
57
+ `;if(L()){if(j())return E7;let[,b]=K;if(kH(x)){if(b==="<"||b==="</")return NG0}}if(O())return AG0;if(j()||S())return E7;else if(G&&G.has(x))return K[1]==="."?IH:D_;else if(Q.has(x))return K[1]==="."?IH:qG0;else if(v)return L_;else if(bX(x))return Vi;else if(x.split("").every(DG0))return N3;else if(Li(x))return L()?IH:D_;else{if(kH(x)){let b=K[1]==="."&&kH(F[1]);if(!T()&&!b)return IH;if(b)return nW}return E7}}let R=(x,v)=>{if(v)U=v;if(U){Y=typeof x==="number"?x:y(U);let f=[Y,U];if(Y!==Vi&&Y!==L_)F=K,K=f;W.push(f)}U=""};for(let x=0;x<$.length;x++){let v=$[x],f=$[x-1],b=$[x+1],l=f+v,r=v+b;if(typeof J.onQuote==="function"&&v==="'"&&!j()&&!O()&&!S()){let i=J.onQuote(v,x,$);if(typeof i==="number"&&i>=1&&!Number.isNaN(i)){let n=Math.min(i,$.length-x),Z0=x+n;R(),U=$.slice(x,Z0),R(IH),x=Z0-1;continue}}if(P_(v)&&!O()&&!S()){R();let i=!1;if(f!=="\\"){if(M&&v===M)M=null,i=!0;else if(!M)M=v,_=W.length}if(R(E7,v),J.quotedKeys&&i&&OG0($,x))for(let n=_;n<W.length;n++)W[n][0]=nW;continue}if(!S()){if(f!=="\\n"&&M_(v)){R(),R(E7,v),E++;continue}}if(S()){if(f!=="\\n"&&M_(v)){if(E>0){R(),E--,R(E7,v);continue}}if(r==="${"){C++,R(E7),R(N3,r),x++;continue}}if(I()&&v==="}"){R(),C--,R(N3,v);continue}if(V()){if(v==="{"){R(),R(N3,v),D=!0;continue}}if(q){if(!N&&v==="<"){if(R(),b==="/")N=2,U=r,x++;else N=1,U=v;R(N3);continue}if(N){if(v===">"&&!"/=".includes(f)){if(R(),N===1)N=0,A++;else N=0,q=!1;R(N3,v);continue}if(r==="/>"||r==="</"){if(U!=="<"&&U!=="/")R();if(r==="/>")N=0;else A--;if(!A)q=!1;U=r,x++,R(N3);continue}if(v==="<"){R(),U=v,R(N3);continue}if(b==="-"&&!T()&&!O()){if(U){R(nW,U+v+b),x++;continue}}if(b==="="&&!T()){if(!bX(v)){if(bX(U))R();let i=U+v;if(kH(i)){R(nW,i);continue}}}}}if(!N&&(v==="<"&&Oi(b)||r==="</")){let i=x-1;while(i>=0&&/\s/.test($[i]))i--;let n=i>=0?$[i]:"",[Z0,J0]=K,U0=!1,z0=!1;if(U&&!bX(U)){let N0=U;if(Li(N0)||N0==="true"||N0==="false")U0=!0;else if(Q.has(N0)&&kH(N0))z0=!0;else if(kH(N0))U0=!0}let X0=v==="<"&&/[$\w\]\)]/.test(n)&&(U0||!z0&&(Z0===IH||Z0===D_||Z0===N3&&(J0===")"||J0==="]"))),q0=v==="<"&&WG0($,x);if(!X0&&!q0)N=b==="/"?2:1;if(v==="<"&&(b==="/"||_i(b))){if(!X0&&!q0&&!T()&&!O()&&!k())q=!0}}let h=MG0(v),d=S(),o=!q&&_G0(r),p=O();if(h||d||P_(M))U+=v;else if(o){R();let[i,n]=K;if(o&&i!==-1&&!(i===N3&&n!==")"||i===Di)){U=v,R();continue}w=!0;let Z0=x++,J0=()=>x>=$.length,U0=()=>J0()||$[x]===`
58
+ `,z0=!1,X0=!1;for(;!U0();x++){let q0=$[x],N0=$[x-1]==="\\";if(!N0&&q0==="[")X0=!0;if(!N0&&q0==="]")X0=!1;if(q0==="/"&&!X0&&!N0){z0=!0;while(Z0!==x&&/^[a-z]$/.test($[x+1])&&!U0())x++;break}}if(w=!1,Z0!==x&&z0)U=$.slice(Z0,x+1),R(E7);else U=v,R(),x=Z0}else if(X(v,b)){R();let i=x,n=X(v,b);if(n){for(;x<$.length;x++)if(z($[x-1],$[x])==n)break}U=$.slice(i,x+1),R(Di)}else if(v===" "||v===`
59
+ `)if(v===" "&&(bX(U)||!U||p)){let i=x+1;while($[i]===" ")i++;if(U+=$.slice(x,i),x=i-1,$[i]==="<")R()}else R(),U=v,R();else if(D&&v==="}")R(),U=v,R(),D=!1;else if(p&&!V_.has(v)||S()||(tW(v)===tW(U[U.length-1])||V())&&!Mi.has(v))U+=v;else{if(l==="</")U=l;if(R(),l!=="</")U=v;if(r==="</"||r==="/>")U=r,R(),x++;else if(V_.has(v))R()}}return R(),W}function TG0($,Z){let J=[],H=Z&&typeof Z.lineClassName==="function"?Z.lineClassName:null,B=0,Q=(U,Y)=>{let K=H?H(Y,B):"";return B++,{type:"element",tagName:"span",children:U,properties:{className:K?`sh__line ${K}`:"sh__line"}}};function X(U){let Y=U.map(([,F])=>F).join(""),K=U.map(([F,W])=>{let q=sW[F];return{type:"element",tagName:"span",children:[{type:"text",value:W}],properties:{className:`sh__token--${q}`,style:{color:`var(--sh-${q})`}}}});J.push(Q(K,Y))}let z=[],G=!1;for(let U=0;U<$.length;U++){let Y=$[U],[K,F]=Y,W=U===$.length-1;if(K!==L_){if(F.includes(`
60
+ `)){let q=F.split(`
61
+ `);for(let N=0;N<q.length;N++)if(z.push([K,q[N]]),N<q.length-1)X(z),z.length=0}else z.push(Y);G=!1}else{if(G)X([]);else X(z),z.length=0;if(W)X([]);G=!0}}if(z.length)X(z);return J}var CG0=($)=>{let Z=`class="${$.className}"`;if($.style){let J=Object.entries($.style).map(([H,B])=>`${H}:${B}`).join(";");Z+=` style="${J}"`}return Z};function EG0($){return $.map((Z)=>{let{tagName:J}=Z,H=Z.children.map((B)=>{let{tagName:Q,children:X,properties:z}=B;return`<${Q} ${CG0(z)}>${LG0(X[0].value)}</${Q}>`}).join("");return`<${J} class="${Z.properties.className}">${H}</${J}>`}).join(`
62
+ `)}function Ti($,Z){let J=jG0($,Z),H=TG0(J,Z);return EG0(H)}var JV1={TokenTypes:sW,TokenMap:new Map(sW.map(($,Z)=>[$,Z]))};var O_=P(c(),1),bG0=Q0("[--sh-identifier:#1f2937]","[--sh-keyword:#cf222e]","[--sh-string:#16a34a]","[--sh-class:#2d6e7e]","[--sh-property:#0550ae]","[--sh-entity:#6f42c1]","[--sh-jsxliterals:#6f42c1]","[--sh-sign:#8b949e]","[--sh-comment:#9ca3af]");function Ei({code:$,className:Z}){let J=Ci.useMemo(()=>Ti($),[$]);return O_.jsx("pre",{className:Q0("overflow-auto font-mono text-xs leading-relaxed whitespace-pre",bG0,Z),children:O_.jsx("code",{className:"font-mono",dangerouslySetInnerHTML:{__html:J}})})}var wG0={ts:"ts",tsx:"tsx",js:"js",jsx:"jsx",mjs:"js",cjs:"js",json:"json",md:"md",mdx:"mdx",css:"css",scss:"scss",html:"html",py:"py",rb:"rb",go:"go",rs:"rs",java:"java",c:"c",h:"c",cpp:"cpp",sh:"sh",bash:"sh",yml:"yaml",yaml:"yaml",toml:"toml",sql:"sql",php:"php",swift:"swift",kt:"kt"};function SG0($){let Z=$.split(/[\\/]/).pop()??"",J=Z.lastIndexOf("."),H=J>0?Z.slice(J+1).toLowerCase():"";return wG0[H]??null}function RG0($){let Z=$.trim();if(Z.length<2||!(Z.startsWith("{")||Z.startsWith("[")))return null;try{return JSON.stringify(JSON.parse(Z),null,2)}catch{return null}}function IG0($){let Z=$.split(`
63
+ `);if(!Z.some((J)=>/^\s*\d+\t/.test(J)))return $;return Z.map((J)=>J.replace(/^\s*\d+\t/,"")).join(`
64
+ `)}function bi($,Z){let J=$.input??{},H=typeof J.file_path==="string"?J.file_path:typeof J.path==="string"?J.path:"",B=H?SG0(H):null,Q=$.name==="Read"||$.name==="read",X=$.name==="Write"||$.name==="write";if(B&&Q&&Z)return{kind:"highlight",code:IG0(Z),label:B};if(B&&X&&typeof J.content==="string"&&J.content)return{kind:"highlight",code:J.content,label:B};let z=RG0(Z);if(z)return{kind:"highlight",code:z,label:"json"};return{kind:"plain"}}var x4=P(c(),1),j_="max-h-[280px] overflow-auto px-3 py-2.5 font-mono text-xs leading-relaxed";function wi({call:$,output:Z,isError:J}){let[H,B]=GZ.useState(!1),Q=GZ.useMemo(()=>J?{kind:"plain"}:bi($,Z),[$,Z,J]);if(Q.kind==="plain")return x4.jsx("div",{className:Q0("rounded-lg border",J?"border-destructive/30 bg-destructive/10":"border-border bg-muted"),children:x4.jsx("pre",{className:Q0(j_,"break-all whitespace-pre-wrap",J?"text-destructive":"text-muted-foreground"),children:Z||"(empty)"})});return x4.jsxs("div",{className:"overflow-hidden rounded-lg border border-border bg-muted",children:[x4.jsx(kG0,{raw:H,onRaw:B,label:Q.label,copyText:H?Z:Q.code}),H?x4.jsx("pre",{className:Q0(j_,"break-all whitespace-pre-wrap text-muted-foreground"),children:Z||"(empty)"}):x4.jsx(Ei,{code:Q.code,className:Q0(j_,"text-muted-foreground")})]})}function kG0({raw:$,onRaw:Z,label:J,copyText:H}){return x4.jsxs("div",{className:"flex items-center gap-1 border-b border-border p-2",children:[[[!1,J],[!0,"raw"]].map(([Q,X])=>x4.jsx(M0,{type:"button",variant:$===Q?"outline":"ghost",size:"sm",onClick:()=>Z(Q),className:"rounded-full text-xs uppercase",children:X},X)),x4.jsx("div",{className:"flex-1"}),x4.jsx(yG0,{text:H})]})}function yG0({text:$}){let[Z,J]=GZ.useState(!1);return GZ.useEffect(()=>{if(!Z)return;let B=setTimeout(()=>J(!1),1500);return()=>clearTimeout(B)},[Z]),x4.jsx(M0,{type:"button",variant:"ghost",size:"icon-sm",onClick:()=>{navigator.clipboard?.writeText($).then(()=>J(!0)).catch(()=>{})},"aria-label":Z?"Copied":"Copy",children:Z?x4.jsx(g8,{stroke:1.75}):x4.jsx(eW,{stroke:1.75})})}var c1=P(c(),1);function $q({parts:$,cwd:Z=null,processing:J=!1}){let H=$.filter((B)=>B.type==="reasoning"||B.type==="tool-call");return c1.jsx("div",{className:"flex flex-col",children:H.map((B,Q)=>{let X=Q===H.length-1,z={isFirst:Q===0,isLast:X};if(B.type==="reasoning")return c1.jsx(xG0,{text:B.text,durationMs:B.durationMs,inProgress:J&&X,...z},Q);return c1.jsx(hG0,{call:B.call,cwd:Z,...z},B.call.toolCallId||Q)})})}function T_({isFirst:$,isLast:Z,call:J,leading:H,marker:B,name:Q,brief:X,preview:z}){let[G,U]=C_.useState(!1),Y=J.state==="error",K=J.state==="running"||J.state==="pending",F=Y?J.errorText??"":typeof J.output==="string"?J.output:"",W=!!(F||Y||z),q=X?`${Q}: ${X}`:Q;return c1.jsx(wH,{isFirst:$,isLast:Z,marker:B,loading:K,isError:Y,children:c1.jsxs("div",{className:"min-w-0 flex-1",children:[c1.jsxs("button",{type:"button",title:q,onClick:()=>W&&U((N)=>!N),className:Q0(rW,W?"cursor-pointer":"cursor-default"),children:[H,c1.jsx("span",{className:"shrink-0 text-xs font-medium whitespace-nowrap",children:Q}),X&&c1.jsx("span",{className:"min-w-0 self-baseline truncate text-[12px] text-muted-foreground",children:X}),K&&B&&c1.jsx(d5,{size:12,stroke:1.75,className:"shrink-0 animate-spin text-muted-foreground"}),W&&c1.jsx(TX,{open:G})]}),W&&c1.jsx(OX,{open:G,children:c1.jsxs("div",{className:"mt-1 mb-1 flex flex-col gap-1.5",children:[z,(F||Y)&&c1.jsx(wi,{call:J,output:F,isError:Y})]})})]})})}function xG0({isFirst:$,isLast:Z,text:J,inProgress:H=!1,durationMs:B}){let[Q,X]=C_.useState(!1);if(!J){let U=B===void 0?"Thought":`Thought for ${zZ(B)}`;return c1.jsx(wH,{isFirst:$,isLast:Z,loading:H,children:c1.jsx("div",{className:Q0(rW,"min-w-0 flex-1 cursor-default"),children:c1.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:H?"Thinking":U})})})}let z=H?"Thinking":"Thought",G=H||Q;return c1.jsx(wH,{isFirst:$,isLast:Z,loading:H,children:c1.jsxs("div",{className:"min-w-0 flex-1",children:[c1.jsxs("button",{type:"button","aria-expanded":G,onClick:()=>X((U)=>!U),className:Q0(rW,"cursor-pointer"),children:[c1.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:z}),c1.jsx(TX,{open:G})]}),c1.jsx(OX,{open:G,children:c1.jsx("div",{className:"mt-1 mb-1 pr-2 text-xs leading-relaxed whitespace-pre-wrap text-muted-foreground",children:c1.jsx(fd,{content:J})})})]})})}function hG0({call:$,cwd:Z,isFirst:J,isLast:H}){if($.caller==="subagent")return c1.jsx(Ai,{call:$,cwd:Z,isFirst:J,isLast:H,renderNestedParts:(X,z)=>c1.jsx($q,{parts:X,cwd:z})});if($.name==="Skill"&&$.skill){let X=$.state==="success";return c1.jsx(T_,{isFirst:J,isLast:H,call:$,marker:X?c1.jsx(ul,{icon:Si,size:16,stroke:1.75}):void 0,name:"Loading skill",brief:$.skill.skillName})}let B=F_($)??W_($)??q_($);if(B){let X=N_(B.server,B.tool);return c1.jsx(T_,{isFirst:J,isLast:H,call:$,marker:c1.jsx(pl,{src:dW(B.server)}),name:lW(B.server),brief:B.rest?`${X} ${B.rest}`:X})}let Q=$.state==="error"?null:hl($,Z);return c1.jsx(T_,{isFirst:J,isLast:H,call:$,leading:c1.jsx(vG0,{call:$}),name:Ki($),brief:Fi($,Z),preview:Q?c1.jsx(vl,{relPath:Q}):void 0})}function vG0({call:$}){if($.caller!=="mcp"&&$.caller!=="server-tool")return null;let Z=$.caller==="mcp"?`mcp${$.mcpServer?`:${$.mcpServer.slice(0,8)}`:""}`:"server";return c1.jsx("span",{className:"shrink-0 rounded border border-border px-1 text-[9px] text-muted-foreground uppercase",children:Z})}var v1=P(c(),1);function ki($){if($.type==="reasoning")return!0;if($.type==="tool-call")return!0;return!1}function fG0($){let Z=[];for(let J of $)if(ki(J)){let H=Z[Z.length-1];if(H&&H.kind==="run")H.parts.push(J);else Z.push({kind:"run",parts:[J]})}else Z.push({kind:"single",part:J});return Z}function Zq({parts:$,cwd:Z,processing:J=!1}){let H=fG0($);return v1.jsx("div",{className:"flex flex-col",children:H.map((B,Q)=>{let X=Q===0?"":"mt-3",z=Q===H.length-1;return v1.jsx("div",{className:X,children:B.kind==="run"?v1.jsx($q,{parts:B.parts,cwd:Z,processing:J&&z}):v1.jsx(cG0,{part:B.part})},Q)})})}function gG0($){return $.some((Z)=>Z.type!=="text"||Z.text.trim().length>0)}function mG0($){let Z=-1;for(let H=$.length-1;H>=0;H--)if(ki($[H])){Z=H;break}if(Z<0)return null;let J=$.slice(Z+1);if(!gG0(J))return null;return{work:$.slice(0,Z+1),response:J}}function uG0({parts:$,cwd:Z,durationMs:J,defaultOpen:H}){let B=J===void 0?"Worked":`Worked for ${zZ(J)}`;return v1.jsxs(SK,{defaultOpen:H,className:"group/collapsible",children:[v1.jsxs(RK,{className:"flex w-fit items-center gap-1 rounded-sm py-1 text-left text-sm text-muted-foreground transition-colors outline-none hover:text-foreground focus-visible:ring-2 focus-visible:ring-ring",children:[v1.jsx("span",{children:B}),v1.jsx(u3,{size:16,stroke:1.5,className:"shrink-0 transition-transform group-data-open/collapsible:rotate-90"})]}),v1.jsx(IK,{className:"overflow-hidden pt-2",children:v1.jsx(Zq,{parts:$,cwd:Z})})]})}function pG0({parts:$,cwd:Z,processing:J=!1,durationMs:H}){let B=J?null:mG0($);return v1.jsx("div",{className:"w-full min-w-0",children:J?v1.jsx(Zq,{parts:$,cwd:Z,processing:!0}):B?v1.jsxs("div",{className:"flex flex-col gap-3",children:[v1.jsx(uG0,{parts:B.work,cwd:Z,durationMs:H}),v1.jsx(Zq,{parts:B.response,cwd:Z})]}):v1.jsx(Zq,{parts:$,cwd:Z})})}var yi=Ii.memo(function({turn:Z,processing:J=!1}){let H=b1().cwd;if(Z.role==="user"&&Z.origin.kind==="user-input"){let B=Z.parts.filter((z)=>z.type==="file-attachment"),Q=Z.parts.filter((z)=>z.type==="text-attachment"),X=Z.parts.filter((z)=>z.type==="text").map((z)=>z.type==="text"?z.text:"").join(`
65
+ `);if(!X&&B.length===0&&Q.length===0)return null;return v1.jsxs("div",{className:"flex w-full min-w-0 flex-col items-end gap-1.5 pl-8",children:[Q.map((z,G)=>v1.jsx(iQ,{label:z.label},`text-attachment:${G}`)),B.map((z,G)=>v1.jsx(xi,{mediaType:z.mediaType,previewUrl:z.previewUrl,label:z.label},G)),X&&v1.jsx("p",{className:Q0("max-w-full min-w-0 rounded-lg bg-primary px-3 py-2 text-sm leading-normal wrap-anywhere whitespace-pre-wrap text-primary-foreground","inset-shadow-[0_0_10px_color-mix(in_oklab,var(--color-white)_30%,transparent)]"),children:X})]})}return v1.jsx(pG0,{parts:Z.parts,cwd:H,processing:J,durationMs:Z.meta?.durationMs})});function cG0({part:$}){switch($.type){case"text-attachment":return v1.jsx(iQ,{label:$.label});case"text":return v1.jsx(vd,{content:$.text});case"tool-call":return v1.jsx($q,{parts:[$],cwd:null});case"file-attachment":return v1.jsx(xi,{mediaType:$.mediaType,previewUrl:$.previewUrl,label:$.label});case"source-url":return v1.jsx(Ri,{url:$.url,title:$.title});case"source-document":return v1.jsx(Ri,{url:"#",title:$.title});case"data":return v1.jsx(dG0,{name:$.name,data:$.data});case"reasoning":return null}}function xi({mediaType:$,previewUrl:Z,label:J}){if($.startsWith("image/")&&Z)return v1.jsx("img",{src:Z,alt:J??"attachment",className:"max-h-64 max-w-full rounded-lg border border-border object-contain"});return v1.jsxs("div",{className:"flex items-center gap-1.5 rounded-lg border border-border bg-accent px-2.5 py-1.5 text-xs text-accent-foreground",children:[v1.jsx(bJ,{size:16,stroke:1.75}),v1.jsx("span",{className:"truncate",children:J??$})]})}function Ri({url:$,title:Z}){return v1.jsx("a",{href:$,target:"_blank",rel:"noreferrer",className:"text-xs underline",children:Z??$})}function dG0({name:$,data:Z}){return v1.jsxs("details",{children:[v1.jsxs("summary",{className:"cursor-pointer list-none text-xs text-muted-foreground marker:hidden [&::-webkit-details-marker]:hidden",children:["data:",$]}),v1.jsx("pre",{className:"mt-1 overflow-auto rounded bg-muted p-2 font-mono text-xs text-muted-foreground",children:JSON.stringify(Z,null,2)})]})}var $5=P(c(),1),lG0=[],iG0=[];function E_({forkedFromSessionId:$,agent:Z,active:J=!0,focusRequest:H=0,docked:B=!1,chatLoaded:Q,hasWorkspaceApplets:X,view:z,previewTurn:G,sessionId:U,processing:Y,composerBanner:K,agentAvailability:F,annotation:W,send:q,stop:N,onNavigateFromWelcome:D,onClose:A,viewDraft:V}){let L=p1(),{base:O}=C2(),{data:M}=MJ(L),_=M?.find((X0)=>X0.sessionId===$)?.summary,w=h3(),C=$8.useRef(null),E=$8.useRef(null),j=V?.sessionId??U??F2(w),k=V?null:U??null,S=V?lG0:z.turns,I=T1((X0)=>X0.hasSentMessageFromMoi),T=T1((X0)=>(X0.workspaceIdsPendingAnalysis??[]).includes(L)),y=G4((X0)=>(X0.attachments[F8(L,j)]??[]).some((q0)=>q0.kind!=="text"&&q0.status==="uploading")),R=Q||!!V,x=!R||!lQ(!0,y,F),v=V?null:G,f=V?iG0:z.notices,b=$8.useMemo(()=>vv(S),[S]),l=$8.useMemo(()=>hv(b,v),[b,v]),r=$8.useMemo(()=>gv(l,f),[l,f]),h=l.length>0?l[l.length-1].id:null,d=V?!1:Y,o=!!V||!$&&Q&&r.length===0&&!d,p=Q&&!o,i=Qm({tabId:w,isViewDraft:!!V,hasSentMessageFromMoi:I,isWorkspacePendingAnalysis:T}),{atBottom:n,scrollToBottom:Z0,scrollToTop:J0}=yv(E,j);$8.useLayoutEffect(()=>{if(o&&i!=="overview-empty"&&i!=="tab-empty")J0()},[o,i,J0]),$8.useEffect(()=>{if(J)fL(C.current)},[J,H]);let U0=$8.useCallback(async(X0,q0)=>{await q(X0,q0),Z0()},[q,Z0]),z0=$8.useCallback((X0)=>{if(x)return;U0(X0.prompt,{directives:X0.context})},[U0,x]);return $5.jsxs("div",{className:"flex min-h-0 flex-1 flex-col pt-2 pb-3",children:[$5.jsxs("header",{className:"flex w-full min-w-0 items-center justify-between pr-2 pb-2 pl-2",children:[$5.jsx("div",{className:"flex h-7 min-w-0 flex-1",children:$5.jsx(Fm,{className:Q0("text-foreground",B&&"text-muted-foreground")})}),B&&$5.jsxs(i1,{children:[$5.jsx(r1,{render:$5.jsx(M0,{variant:"ghost",size:"icon-sm",onClick:A,"aria-label":"Undock chat",children:$5.jsx(hi,{className:"size-5! text-muted-foreground",stroke:1.5})})}),$5.jsx(a1,{children:"Undock chat"})]}),!V&&!B&&$5.jsx(M0,{variant:"ghost",size:"icon-sm",onClick:A,"aria-label":"Close chat",children:$5.jsx(e5,{stroke:2})})]}),$5.jsxs("div",{className:"relative flex min-h-0 flex-1 flex-col",children:[$5.jsx("div",{ref:E,className:"flex scrollbar-thin flex-1 scroll-fade flex-col overflow-y-auto overscroll-contain px-5 pt-4 pb-8 [--scroll-fade-reveal:8px]",children:$5.jsxs("div",{className:"mx-auto flex w-full max-w-(--chat-max-container) flex-1 flex-col gap-6",children:[$&&$5.jsx("a",{href:A8(`moi:/chats/${encodeURIComponent($)}`,{workspaceId:L,base:O}),className:"block text-sm outline-none focus-visible:ring-3 focus-visible:ring-ring/50",children:$5.jsxs("div",{className:"flex items-center gap-3",children:[$5.jsx(sK,{size:20,stroke:1.5,"aria-hidden":"true",className:"shrink-0 text-muted-foreground"}),$5.jsxs("div",{className:"flex min-w-0 flex-1 flex-col gap-0.5",children:[$5.jsx("span",{className:"text-muted-foreground",children:"Started from another chat"}),$5.jsx("span",{className:"truncate font-medium",title:_,children:_||"Another chat"})]})]})}),o&&$5.jsx(Xm,{agent:Z,kind:i,hasWorkspaceApplets:X,disabled:x,onSelectPrompt:z0,onNavigate:D}),p&&r.map((X0)=>X0.kind==="notice"?$5.jsx(rG0,{notice:X0.notice},`notice:${X0.notice.id}`):$5.jsx(yi,{turn:X0.turn,processing:d&&X0.turn.id===h},X0.turn.id)),p&&$5.jsx("div",{className:"mt-auto -ml-3 pt-2",children:$5.jsx(H3,{preset:Z,color:"primary",animated:d,expression:d?"thinking":void 0})})]})}),p&&!n&&S.length>0&&$5.jsx(M0,{type:"button",variant:"outline",size:"icon",onClick:()=>Z0("smooth"),"aria-label":"Jump to latest",className:"absolute bottom-3 left-1/2 -translate-x-1/2 animate-in rounded-full fade-in slide-in-from-bottom-1",children:$5.jsx(VU,{stroke:1.5})})]}),$5.jsx("div",{className:"mx-auto flex w-full max-w-[calc(var(--chat-max-container)+24px)] flex-col px-3",children:$5.jsxs("div",{className:Q0("@container flex w-full flex-col transition-[padding]",K&&"gap-2 rounded-t-lg rounded-b-2xl p-2",K?.tone==="default"&&"bg-accent",K?.tone==="error"&&"bg-destructive/10"),children:[K?.content,$5.jsx(Zm,{composerRef:C,onSend:U0,onStop:N,processing:d,sessionId:j,modelSessionId:k,availability:F,chatReady:R,annotation:V?void 0:W,onRemoveDrawing:V?.onRemoveDrawing??W?.onRemove,allowFiles:!V,placeholder:V?"Drop in the details":void 0})]})})]})}function rG0({notice:$}){let Z=gL($);if(!Z)return null;return $5.jsx("div",{className:"flex justify-center",children:$5.jsx("span",{className:"max-w-full truncate text-xs text-muted-foreground",children:Z})})}var fH=P(m(),1);var wr=P(r_(),1);var q9=P(c(),1);function Sr({agent:$,loading:Z,open:J,onOpenChange:H,onOpenChangeComplete:B,children:Q}){let X=fH.useRef(null),z=T1((N)=>N.popupChatWidth),G=T1((N)=>N.setPopupChatWidth),[U,Y]=fH.useState({width:z,min:0,max:z}),K=fH.useCallback((N)=>{if(X.current=N,!N)return;N.style.setProperty("--chat-popup-width",`${z}px`);let D=new ResizeObserver(([A])=>{if(!A)return;let{minWidth:V,maxWidth:L}=getComputedStyle(N);Y({width:Math.round(A.contentRect.width),min:parseFloat(V),max:parseFloat(L)})});return D.observe(N),()=>{D.disconnect(),X.current=null}},[z]),F=(N)=>{if(!X.current)return;let{minWidth:D,maxWidth:A}=getComputedStyle(X.current);G(Math.round(Math.min(parseFloat(A),Math.max(parseFloat(D),N))))},W=()=>H(!1);return q9.jsxs(C6,{open:J,onOpenChange:(N,D)=>{if(!N&&(D.reason==="outside-press"||D.reason==="focus-out")){D.cancel();return}H(N)},onOpenChangeComplete:B,children:[q9.jsx(E6,{render:q9.jsx("div",{className:"fixed right-3 bottom-3",children:q9.jsx(Y5.div,{variants:{from:{opacity:0,scale:0.8,filter:"blur(4px)"},to:{opacity:1,scale:1,filter:"blur(0px)"},invisible:{opacity:0,scale:1,filter:"blur(4px)"}},initial:"from",animate:J?"invisible":"to",transition:{type:"spring",duration:0.3,delay:0.2,bounce:0},children:q9.jsx("button",{type:"button",className:"group block cursor-pointer p-0 drop-shadow-[0_0_4px_var(--background)] outline-none focus-visible:ring-3 focus-visible:ring-ring/50","aria-label":"Agent",children:q9.jsx(H3,{preset:$,color:"primary",animated:Z,size:Z?80:64,expression:Z?"thinking":void 0,className:Q0("drop-shadow-md drop-shadow-primary/25","group-hover:drop-shadow-lg group-hover:drop-shadow-primary/40","transition-[width,height,filter] duration-300 ease-in-out motion-reduce:transition-none")})})})})}),q9.jsx(wr.Resizable,{axis:"x",width:U.width,height:0,resizeHandles:["w"],minConstraints:[U.min,0],maxConstraints:[U.max,0],onResize:(N,{size:D})=>G(Math.round(D.width)),handle:q9.jsx("div",{role:"separator","aria-label":"Resize chat popup","aria-orientation":"vertical","aria-valuemin":U.min,"aria-valuemax":U.max,"aria-valuenow":U.width,"aria-valuetext":`${U.width} pixels wide`,tabIndex:0,className:"absolute inset-y-6 -left-1 w-2 cursor-ew-resize touch-none rounded-full outline-none focus-visible:ring-3 focus-visible:ring-ring/50",onKeyDown:(N)=>{let D=X.current?.offsetWidth??z,A=N.shiftKey?32:16;if(N.key==="ArrowLeft")F(D+A);else if(N.key==="ArrowRight")F(D-A);else if(N.key==="Home")F(-1/0);else if(N.key==="End")F(1/0);else return;N.preventDefault()}}),children:q9.jsx(b6,{ref:K,side:"top",sideOffset:({anchor:N})=>-N.height,align:"end",className:"relative flex h-[calc(100vh-2rem)] w-(--chat-popup-width) max-w-[calc(100vw-1.5rem)] min-w-[min(440px,calc(100vw-1.5rem))] flex-col gap-0 rounded-3xl p-0 transition-[opacity,transform] sm:h-[calc(100vh-8rem)]",keepMounted:!0,children:Q(W)})})]})}var a3=P(c(),1);function Wq({actions:$,className:Z,title:J,children:H,onClose:B,ref:Q}){return a3.jsxs(Y5.div,{ref:Q,className:Q0("absolute inset-x-4 bottom-4 no-scrollbar flex max-h-full flex-col gap-4 overflow-y-auto rounded-2xl bg-popover text-popover-foreground shadow-md","mx-auto max-w-[calc(var(--chat-max-container)+var(--page-pad)*2)] p-(--page-pad)",H&&"pb-0",Z),variants:{hidden:{opacity:0,y:40,filter:"blur(4px)"},visible:{opacity:1,y:0,filter:"blur(0px)"}},initial:"hidden",animate:"visible",exit:"hidden",transition:{type:"spring",duration:0.25,bounce:0},children:[a3.jsxs("div",{className:"flex shrink-0 items-center justify-between gap-4",children:[a3.jsx("p",{className:"text-sm font-medium",children:J}),a3.jsxs("div",{className:"flex items-center gap-2",children:[$,a3.jsx(M0,{type:"button",variant:"ghost",size:"icon-sm",onClick:B,"aria-label":"Close panel",children:a3.jsx(e5,{stroke:1.75})})]})]}),H&&a3.jsx("div",{className:"flex-1 pb-(--page-pad)",children:H})]})}var A5=P(c(),1),ZK0=Object.entries($7),JK0=Object.entries(ZK),HK0=Object.entries(qQ),BK0=Object.entries(NQ),QK0="relative w-full rounded-lg text-left ring-1 ring-border transition-opacity outline-none focus-visible:ring-3 focus-visible:ring-ring/50";function qq({children:$,className:Z,gridClassName:J,label:H}){return A5.jsxs("div",{className:Q0("flex flex-col gap-2",Z),children:[A5.jsx("p",{className:"text-xs font-medium",children:H}),A5.jsx("div",{role:"group","aria-label":H,className:Q0("grid grid-cols-4 gap-2 @4xl/workspace:grid-cols-2",J),children:$})]})}function Nq({active:$,children:Z,className:J,onSelect:H,style:B}){return A5.jsxs("button",{type:"button","aria-pressed":$,onClick:H,className:Q0(QK0,"flex items-center gap-2 p-3",J,!$&&"cursor-pointer pr-9 opacity-70 hover:opacity-100"),style:B,children:[A5.jsx("div",{className:"flex flex-1 flex-col justify-center",children:Z}),$&&A5.jsx(zK,{size:20,stroke:1.5,"aria-hidden":"true"})]})}function Rr({onClose:$,ref:Z}){xK();let{layout:J,setLayout:H}=b1(),B=U9(J.theme);function Q(X){H({theme:{...B,...X}})}return A5.jsx(Wq,{ref:Z,title:"Theme",onClose:$,className:"@4xl/workspace:max-w-5xl",children:A5.jsxs("div",{className:"grid grid-cols-1 gap-4 @4xl/workspace:grid-cols-[repeat(2,minmax(0,1fr))_0.5rem_repeat(2,minmax(0,1fr))_0.5rem_minmax(0,1fr)_0.5rem_minmax(0,1fr)] @4xl/workspace:gap-x-2",children:[A5.jsx(qq,{label:"Font",className:"@4xl/workspace:col-span-2 @4xl/workspace:col-start-1",children:ZK0.map(([X,z])=>A5.jsx(Nq,{active:X===B.font,onSelect:()=>Q({font:X}),style:{fontFamily:z.sans},children:A5.jsx("span",{className:"text-sm font-medium",children:z.label})},X))}),A5.jsx(qq,{label:"Colors",className:"@4xl/workspace:col-span-2 @4xl/workspace:col-start-4",children:JK0.map(([X,z])=>A5.jsx(Nq,{active:X===B.color,className:z.primary&&"bg-background text-foreground",onSelect:()=>Q({color:X}),style:K9({...B,color:X}),children:A5.jsxs("div",{className:"flex gap-2",children:[A5.jsx("span",{className:Q0("flex size-5 shrink-0 items-center justify-center rounded-sm text-[9px] leading-none font-bold",z.primary?"bg-primary text-primary-foreground":"bg-foreground text-background"),children:"Aa"}),A5.jsx("span",{className:"text-sm font-medium",children:z.label})]})},X))}),A5.jsx(qq,{label:"Radius",className:"@4xl/workspace:col-start-7",gridClassName:"@4xl/workspace:grid-cols-1",children:HK0.map(([X,z])=>A5.jsx(Nq,{active:X===B.radius,onSelect:()=>Q({radius:X}),style:K9({...B,radius:X}),children:A5.jsxs("div",{className:"flex items-center gap-2",children:[A5.jsx("span",{className:"size-5 shrink-0 rounded-sm bg-card texture-checker-2.5 shadow-xs","aria-hidden":"true"}),A5.jsx("span",{className:"text-sm font-medium",children:z.label})]})},X))}),A5.jsx(qq,{label:"Agent",className:"@4xl/workspace:col-start-9",gridClassName:"@4xl/workspace:grid-cols-1",children:BK0.map(([X,z])=>A5.jsx(Nq,{active:X===B.agent,onSelect:()=>Q({agent:X}),children:A5.jsxs("div",{className:"flex items-center gap-2",children:[A5.jsx("span",{className:"flex size-5 shrink-0 items-center justify-center",children:A5.jsx(H3,{preset:X,color:"primary",size:28})}),A5.jsx("span",{className:"text-sm font-medium",children:z.label})]})},X))})]})})}var XN=P(m(),1);var yr=P(m(),1);function Ir($){return s1({queryKey:O0.appletThumbnails($),queryFn:async()=>(await B1(`/api/workspaces/${$}/applet-thumbnails`)).thumbnails,...W8})}function kr($){let Z=$1();return F5({mutationFn:(J)=>U4(`/api/workspaces/${$}/applet-thumbnails`,_5("PUT",J),"Failed to save applet thumbnails"),onSuccess:()=>{Z.invalidateQueries({queryKey:O0.appletThumbnails($)}),Z.invalidateQueries({queryKey:O0.previews})}})}var XK0=1000,zK0=3,GK0=10800000,UK0=1000,YK0="1000px-3x-webp-q80-v1",KK0=5000,FK0=1000,WK0=1e4,qK0=100,NK0=5000;function AK0($){return Math.min(zK0,XK0/Math.max($.offsetWidth,$.offsetHeight))}function DK0($){return`${YK0}:${$??""}`}function VK0($,Z,J=Date.now()){if(!$||$.revision!==Z)return!0;let H=Date.parse($.capturedAt);return!Number.isFinite(H)||J-H>=GK0}function LK0($,Z){return $!==void 0&&$.revision===Z&&$.captureMs!==void 0&&$.captureMs>=UK0}var MK0=($)=>new Promise((Z)=>{setTimeout(()=>Z(null),$)});function PK0($,Z=qK0){let J=$.getBoundingClientRect(),H=J.top-Z,B=J.bottom+Z,Q=J.left-Z,X=J.right+Z;return(z)=>{if(z.nodeType!==1)return!0;let G=z,U=G.getBoundingClientRect();if(U.width===0&&U.height===0)return G.ownerDocument?.defaultView?.getComputedStyle(G).display!=="none";return U.bottom>H&&U.top<B&&U.right>Q&&U.left<X}}function _K0($,Z,J=NK0){let H=J,B=(Q)=>{for(let X of Q.children){if(!Z(X))continue;if(--H<0)return!0;if(B(X))return!0}return!1};return B($)}async function OK0($,Z){let{createContext:J,destroyContext:H,domToDataUrl:B}=await import("/chunk-hvh9f5h0.js"),Q=PK0($);if(_K0($,Q))return null;let X=async()=>{let z=await J($,{scale:AK0($),type:"image/webp",quality:0.8,backgroundColor:"#ffffff",timeout:FK0,filter:Q,...Z&&{onCreateForeignObjectSvg:(G)=>{let U=document.createElement("style");U.textContent="[data-widget-chrome] { border-radius: 0 !important; box-shadow: none !important; }[data-widget-chrome]::after { display: none !important; }",G.append(U)}}});try{return await B(z)}finally{H(z)}};return Promise.race([X(),MK0(WK0)])}async function jK0($,Z,J,H,B=OK0,Q=Date.now()){let X=[];for(let z of J){if(H())return null;let G=DK0(z.revision),U=Z.find((W)=>W.kind===$&&W.id===z.id);if(!VK0(U,G,Q)){X.push({id:z.id,revision:G});continue}if(LK0(U,G)){X.push({id:z.id,revision:G});continue}if(!z.element){X.push({id:z.id,revision:G,image:null});continue}let Y=performance.now(),K=await B(z.element,$==="widget").catch(()=>null),F=Math.round(performance.now()-Y);if(H())return null;X.push({id:z.id,revision:G,image:K,captureMs:F})}return X}function Aq({kind:$,enabled:Z,targets:J}){let H=p1(),B=Ir(H).data,Q=kr(H),X=q5(J),z=q5(B??[]),G=q5(Q.mutate),U=J.map((K)=>`${K.id}@${K.revision??""}`).join(`
66
+ `),Y=B!==void 0;yr.useEffect(()=>{if(!Z||!Y||U==="")return;let K=!1,F=0,W,q=()=>{F+=1;let N=F;if(W!==void 0)clearTimeout(W);if(document.visibilityState!=="visible")return;W=setTimeout(async()=>{W=void 0;let D=await jK0($,z.current,X.current.map((A)=>({...A,element:document.querySelector(`[data-applet-thumbnail="${CSS.escape(z7($==="view"?"views":"widgets",A.id))}"]`)})),()=>K||F!==N||document.visibilityState!=="visible");if(!D||K||document.visibilityState!=="visible")return;G.current({kind:$,thumbnails:D})},KK0)};return document.addEventListener("visibilitychange",q),q(),()=>{if(K=!0,W!==void 0)clearTimeout(W);document.removeEventListener("visibilitychange",q)}},[Z,$,Y,z,G,U,X])}var Ua=P(m(),1);var f2=P(c(),1);function TK0($){if($==="needs-auth")return"Needs auth";return $[0].toUpperCase()+$.slice(1)}function CK0({name:$,status:Z}){let J=dW($),H="size-full rounded-lg ring-2 ring-background";return f2.jsxs("span",{className:"relative size-10 shrink-0",children:[J?f2.jsx("img",{src:J,alt:"",className:"size-full rounded-lg ring-2 ring-background"}):f2.jsx("span",{className:"flex size-full items-center justify-center rounded-lg bg-muted text-muted-foreground ring-2 ring-background",children:f2.jsx(iW,{className:"size-5"})}),Z!=="connected"&&f2.jsx(xr,{"aria-hidden":"true",size:16,stroke:1.75,className:"absolute -top-1 -right-1 rounded-full bg-card text-amber-400"})]})}function hr($){return[...$].sort((Z,J)=>Number(J.status==="connected")-Number(Z.status==="connected"))}function vr({icon:$,children:Z}){return f2.jsxs("div",{className:"flex items-center gap-3 text-card-foreground",children:[$,f2.jsx("div",{className:"flex min-w-0 flex-1 flex-col justify-center gap-0.5",children:Z})]})}function fr({server:$}){return f2.jsxs(vr,{icon:f2.jsx(CK0,{name:$.name,status:$.status}),children:[f2.jsx("div",{className:"truncate text-sm font-medium text-foreground",children:lW($.name)}),f2.jsx("span",{className:"text-sm text-muted-foreground",children:TK0($.status)})]})}function gr(){return f2.jsxs(vr,{icon:f2.jsx(S$,{className:"size-10 shrink-0 rounded-lg"}),children:[f2.jsx(S$,{className:"h-4 w-36 max-w-full"}),f2.jsx(S$,{className:"h-4 w-20"})]})}function a_({children:$}){return f2.jsx("div",{className:"grid grid-cols-1 gap-6 sm:grid-cols-2",children:$})}function mr($,Z){return s1({queryKey:O0.mcp($),queryFn:()=>B1(`/api/workspaces/${$}/mcp`),enabled:Z,staleTime:1/0,gcTime:1/0,refetchOnMount:!1,refetchOnWindowFocus:!1})}var Z8=P(c(),1);function gH({title:$,description:Z,children:J}){return Z8.jsxs("div",{className:"flex flex-col gap-6",children:[Z8.jsxs("header",{className:"flex flex-col gap-0.5",children:[Z8.jsx("h2",{className:"text-lg font-medium",children:$}),Z&&Z8.jsx("p",{className:"text-sm text-muted-foreground",children:Z})]}),J]})}function mH({label:$,children:Z}){return Z8.jsxs("section",{className:"flex flex-col gap-2",children:[$&&Z8.jsx("p",{className:"px-0.5 text-xs font-medium text-muted-foreground",children:$}),Z8.jsx("div",{className:"flex flex-col divide-y divide-dashed divide-border overflow-hidden rounded-xl border",children:Z})]})}function yX({title:$,description:Z,control:J}){return Z8.jsxs("div",{className:"flex items-center gap-3 px-3.5 py-3",children:[Z8.jsxs("div",{className:"flex min-w-0 flex-col",children:[Z8.jsx("span",{className:"text-sm font-medium",children:$}),Z&&Z8.jsx("span",{className:"text-xs text-muted-foreground",children:Z})]}),J&&Z8.jsx("div",{className:"ml-auto flex shrink-0 items-center pl-3",children:J})]})}var _4=P(c(),1),EK0=Array.from({length:4},($,Z)=>Z);function bK0({connectors:$}){if($.isPending)return _4.jsx("div",{role:"status","aria-label":"Loading connectors",children:_4.jsx(a_,{children:EK0.map((Z)=>_4.jsx(gr,{},Z))})});if($.isError)return _4.jsxs(ur,{children:[_4.jsx("p",{className:"text-sm text-muted-foreground",children:"Could not load connectors."}),_4.jsx(M0,{variant:"outline",size:"sm",onClick:()=>$.refetch(),children:"Retry"})]});if($.data.length===0)return _4.jsxs(ur,{children:[_4.jsx(Dq,{size:24,stroke:1.5,className:"text-muted-foreground"}),_4.jsx("p",{className:"text-sm text-foreground",children:"No connectors configured."})]});return _4.jsx(a_,{children:hr($.data).map((Z)=>_4.jsx(fr,{server:Z},Z.name))})}function ur({children:$}){return _4.jsx("div",{className:"flex min-h-48 flex-col items-center justify-center gap-3 rounded-xl border border-dashed border-border px-8 py-12 text-center",children:$})}function pr(){let{workspaceId:$}=b1(),Z=mr($,!0);return _4.jsx(gH,{title:"Connectors",description:"Connectors available to the agent in this workspace.",children:_4.jsx(bK0,{connectors:Z})})}var t_=P(m(),1);var hX={};I5(hX,{Thumb:()=>or,Root:()=>rr});var UZ=P(m(),1);var Vq=P(m(),1),o_=Vq.createContext(void 0);function cr(){let $=Vq.useContext(o_);if($===void 0)throw Error(I0(63));return $}var dr="data-checked",lr="data-unchecked";var Lq={...k2,checked($){if($)return{[dr]:""};return{[lr]:""}}};var ir=P(m(),1);function Mq($,Z,J,H=!0,B){let[Q,X]=ir.useState(),z=s0(B?`${B}-label`:void 0),G=$??Z??Q;return H0(()=>{let U=$||Z||!H?void 0:SK0(J.current,z);if(Q!==U)X(U)}),G}function SK0($,Z){let J=RK0($);if(!J)return;if(!J.id&&Z)J.id=Z;return J.id||void 0}function RK0($){if(!$)return;let Z=$.parentElement;if(Z&&Z.tagName==="LABEL")return Z;let J=$.id;if(J){let B=$.nextElementSibling;if(B&&B.htmlFor===J)return B}let H=$.labels;return H&&H[0]}var xX=P(c(),1),rr=UZ.forwardRef(function(Z,J){let{checked:H,className:B,defaultChecked:Q,"aria-labelledby":X,form:z,id:G,inputRef:U,name:Y,nativeButton:K=!1,onCheckedChange:F,readOnly:W=!1,required:q=!1,disabled:N=!1,render:D,uncheckedValue:A,value:V,style:L,...O}=Z,{clearErrors:M}=K4(),{state:_,setTouched:w,setDirty:C,validityData:E,setFilled:j,setFocused:k,validationMode:S,disabled:I,name:T,validation:y}=o5(),{labelId:R}=n5(),x=I||N,v=T??Y,f=UZ.useRef(null),b=p2(f,U,y.inputRef),l=UZ.useRef(null),r=s0(),h=p6({id:G}),d=K?void 0:h,[o,p]=F4({controlled:H,default:Boolean(Q),name:"Switch",state:"checked"});u6(l,r,o,void 0,!x,Y),H0(()=>{j(o)},[o,j]),i9(o,()=>{M(v),C(o!==E.initialValue),y.change(o)});let{getButtonProps:i,buttonRef:n}=w5({disabled:x,native:K}),Z0=Mq(X,R,f,!K,d),J0={id:K?h:r,role:"switch","aria-checked":o,"aria-readonly":W||void 0,"aria-required":q||void 0,"aria-labelledby":Z0,onFocus(){if(!x)k(!0)},onBlur(){let q0=f.current;if(!q0||x)return;if(w(!0),k(!1),S==="onBlur")y.commit(q0.checked)},onClick(q0){if(W||x)return;q0.preventDefault();let N0=f.current;if(!N0)return;ZH(N0,q0)}},U0={...y.getValidationProps(x),checked:o,disabled:x,form:z,id:d,name:v,required:q,style:v?dz:n8,tabIndex:-1,type:"checkbox","aria-hidden":!0,ref:b,onChange(q0){if(q0.nativeEvent.defaultPrevented)return;if(W){q0.preventDefault();return}let N0=q0.currentTarget.checked,F0=w0(K0.none,q0.nativeEvent);if(F?.(N0,F0),F0.isCanceled)return;p(N0)},onClick(q0){q0.stopPropagation()},onFocus(){l.current?.focus()},...V!==void 0?{value:V}:D1},z0=UZ.useMemo(()=>({..._,checked:o,disabled:x,readOnly:W,required:q}),[_,o,x,W,q]),X0=G0("span",Z,{state:z0,ref:[J,l,n],props:[J0,O,i,(q0)=>y.getValidationProps(x,q0)],stateAttributesMapping:Lq});return xX.jsxs(o_.Provider,{value:z0,children:[X0,!o&&v&&A!==void 0&&xX.jsx("input",{type:"hidden",form:z,name:v,value:A,disabled:x}),xX.jsx("input",{...U0,suppressHydrationWarning:!0})]})});var ar=P(m(),1);var or=ar.forwardRef(function(Z,J){let{render:H,className:B,style:Q,...X}=Z,z=cr();return G0("span",Z,{state:z,ref:J,stateAttributesMapping:Lq,props:X})});var n_=P(c(),1);function nr({className:$,...Z}){return n_.jsx(hX.Root,{"data-slot":"switch",className:i0('peer relative inline-flex h-5 w-9 shrink-0 cursor-pointer items-center rounded-sm border border-transparent p-px transition-all outline-none after:absolute after:-inset-x-3 after:-inset-y-2 focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 data-checked:bg-primary data-unchecked:bg-accent data-disabled:cursor-not-allowed data-disabled:opacity-50 [:where([class~="group/field-label"]:has(:focus-visible))_&]:border-transparent [:where([class~="group/field-label"]:has(:focus-visible))_&]:ring-0',$),...Z,children:n_.jsx(hX.Thumb,{"data-slot":"switch-thumb",className:"pointer-events-none block size-4 rounded-xs bg-background shadow-xs ring-0 transition-transform data-checked:translate-x-full data-checked:bg-white data-unchecked:translate-x-0"})})}var s_=["app-settings"];function sr(){let $=$1();return L2((Z)=>{if(Z.type==="settings:updated")$.setQueryData(s_,Z.settings)}),s1({queryKey:s_,queryFn:()=>B1("/api/settings"),staleTime:30000})}function tr(){let $=$1();return F5({mutationFn:(Z)=>B1("/api/settings",_5("PATCH",Z),"Failed to save settings"),onSuccess:(Z)=>{$.setQueryData(s_,Z)}})}function er($){return s1({queryKey:O0.env($),queryFn:()=>B1(`/api/workspaces/${$}/env`),...W8})}function $a($){let Z=$1();return F5({mutationFn:(J)=>B1(`/api/workspaces/${$}/env`,_5("PUT",J)),onSuccess:(J)=>{Z.setQueryData(O0.env($),J)}})}function Za($){let Z=$1();return F5({mutationFn:(J)=>U4(`/api/workspaces/${$}/config`,_5("PUT",{name:J}),"Failed to save name"),onSuccess:()=>{Z.invalidateQueries({queryKey:O0.layout($)}),Z.invalidateQueries({queryKey:O0.all})}})}function Ja($){let Z=$1(),J=["workspace-icon",$];return F5({mutationKey:J,scope:{id:`workspace-icon:${$}`},mutationFn:async(H)=>{if(H.kind==="set"){await U4(`/api/workspaces/${$}/config`,_5("PUT",{icon:H.icon,origin:a9}),"Failed to save icon");return}if(H.kind==="reset"){await U4(`/api/workspaces/${$}/icon`,{method:"DELETE"},"Failed to reset icon");return}await B1(`/api/workspaces/${$}/icon`,{method:"PUT",headers:{"Content-Type":H.file.type||"application/octet-stream"},body:H.file})},onMutate:async(H)=>{if(H.kind!=="set")return;await Promise.all([Z.cancelQueries({queryKey:O0.layout($)}),Z.cancelQueries({queryKey:O0.all,exact:!0})]);let B={icon:H.icon};Z.setQueryData(O0.layout($),(Q)=>Q?{...Q,...B}:Q),Z.setQueryData(O0.all,(Q)=>Q?.map((X)=>X.id===$?{...X,...B}:X))},onSettled:()=>{if(Z.isMutating({mutationKey:J})>1)return;Z.invalidateQueries({queryKey:O0.layout($)}),Z.invalidateQueries({queryKey:O0.all,exact:!0})}})}function Ha($){let Z=$1();return L2((J)=>{if(J.type==="env:updated"&&J.workspaceId===$)Z.invalidateQueries({queryKey:O0.env($)})}),{env:er($),update:$a($)}}var l5=P(c(),1),IK0={dotenv:".env",custom:"secret",both:"override"},kK0=/^[A-Za-z_][A-Za-z0-9_]*$/;function Ba(){let{workspaceId:$}=b1(),{env:Z,update:J}=Ha($),[H,B]=t_.useState(""),[Q,X]=t_.useState(""),z=kK0.test(H),G=z&&Q.length>0&&!J.isPending,U=()=>{if(!G)return;J.mutate({set:{[H]:Q}},{onSuccess:()=>{B(""),X("")}})},Y=Z.data?.vars??[],K=Z.data?.files.reduce((W,q)=>W+q.count,0)??0,F=Z.data?.files.length??0;return l5.jsxs(gH,{title:"Environment",description:"Secrets injected into widgets and the agent at run time. Values are write-only — they're never shown again once saved.",children:[l5.jsxs(mH,{label:"Variables",children:[Z.isLoading?l5.jsx("div",{className:"flex items-center justify-center px-3.5 py-6 text-muted-foreground",children:l5.jsx(d5,{className:"size-4 animate-spin",stroke:1.75})}):Y.length===0?l5.jsx("p",{className:"px-3.5 py-4 text-sm text-muted-foreground",children:"No variables yet."}):Y.map((W)=>{let q=W.source!=="dotenv";return l5.jsxs("div",{className:"flex items-center gap-3 px-3.5 py-2.5",children:[l5.jsx("code",{className:"min-w-0 flex-1 truncate font-mono text-xs text-foreground",children:W.key}),l5.jsx("span",{className:"text-xs tracking-widest text-muted-foreground/60 select-none",children:"••••••"}),l5.jsx("span",{className:Q0("rounded-lg px-1.5 py-0.5 text-[11px] font-medium",W.source==="dotenv"?"bg-muted text-muted-foreground":"bg-primary/10 text-primary"),children:IK0[W.source]}),!q&&l5.jsx("span",{className:"text-right text-[11px] text-muted-foreground/60",children:"from file"}),l5.jsx(M0,{type:"button",variant:"ghost",size:"icon-sm",onClick:()=>J.mutate({remove:[W.key]}),disabled:!q,"aria-label":`Delete ${W.key}`,className:"disabled:invisible",children:l5.jsx(Pq,{stroke:1.75})})]},W.key)}),l5.jsxs("div",{className:"flex items-center gap-2 px-3.5 py-2.5",children:[l5.jsx(C$,{value:H,onChange:(W)=>B(W.target.value),placeholder:"NEW_KEY","aria-invalid":H.length>0&&!z,className:"h-7 w-40 font-mono text-xs"}),l5.jsx(C$,{value:Q,onChange:(W)=>X(W.target.value),onKeyDown:(W)=>{if(W.key==="Enter")U()},type:"password",placeholder:"value",className:"h-7 flex-1 text-xs"}),l5.jsxs(M0,{variant:"outline",size:"sm",onClick:U,disabled:!G,children:[J.isPending?l5.jsx(d5,{stroke:1.75,className:"animate-spin"}):l5.jsx(a2,{stroke:1.75}),"Add"]})]})]}),l5.jsx(mH,{label:"From .env files",children:l5.jsx(yX,{title:"Inherit .env files",description:F>0?`Discovered ${K} ${K===1?"key":"keys"} across ${F} ${F===1?"file":"files"} in this space.`:"No .env files found in this space.",control:l5.jsx(nr,{checked:Z.data?.inheritDotenv??!0,disabled:Z.isLoading,onCheckedChange:(W)=>J.mutate({inheritDotenv:W})})})})]})}var N9={};I5(N9,{createHandle:()=>za,Viewport:()=>oU,Trigger:()=>Xa,Title:()=>nU,Root:()=>Qa,Portal:()=>iU,Popup:()=>lU,Handle:()=>_q,Description:()=>uU,Close:()=>mU,Backdrop:()=>gU});function Qa($){return aU("alert-dialog",$)}var Xa=sU;class _q extends _J{}function za(){return new _q}var O4=P(c(),1);function Oq({...$}){return O4.jsx(N9.Root,{"data-slot":"alert-dialog",...$})}function jq({...$}){return O4.jsx(N9.Trigger,{"data-slot":"alert-dialog-trigger",...$})}function yK0({...$}){return O4.jsx(I8,{portal:N9.Portal,"data-slot":"alert-dialog-portal",...$})}function xK0({className:$,...Z}){return O4.jsx(N9.Backdrop,{"data-slot":"alert-dialog-overlay",className:i0("fixed inset-0 isolate z-50 bg-black/10 duration-100 supports-backdrop-filter:backdrop-blur-xs data-open:animate-in data-open:fade-in-0 data-closed:animate-out data-closed:fade-out-0",$),...Z})}function Tq({className:$,size:Z="default",...J}){return O4.jsxs(yK0,{children:[O4.jsx(xK0,{}),O4.jsx(N9.Popup,{"data-slot":"alert-dialog-content","data-size":Z,className:i0("group/alert-dialog-content fixed top-1/2 left-1/2 z-50 grid w-full -translate-x-1/2 -translate-y-1/2 gap-4 rounded-xl bg-popover p-6 text-sm text-popover-foreground shadow-xl duration-100 outline-none data-[size=default]:max-w-xs data-[size=sm]:max-w-xs data-[size=default]:sm:max-w-sm data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95",$),...J})]})}function Cq({className:$,...Z}){return O4.jsx("div",{"data-slot":"alert-dialog-header",className:i0("grid grid-rows-[auto_1fr] place-items-center gap-1.5 text-center has-data-[slot=alert-dialog-media]:grid-rows-[auto_auto_1fr] has-data-[slot=alert-dialog-media]:gap-x-4 sm:group-data-[size=default]/alert-dialog-content:place-items-start sm:group-data-[size=default]/alert-dialog-content:text-left sm:group-data-[size=default]/alert-dialog-content:has-data-[slot=alert-dialog-media]:grid-rows-[auto_1fr]",$),...Z})}function Eq({className:$,...Z}){return O4.jsx("div",{"data-slot":"alert-dialog-footer",className:i0("-mx-6 -mb-6 flex flex-col-reverse gap-2 rounded-b-xl p-6 group-data-[size=sm]/alert-dialog-content:grid group-data-[size=sm]/alert-dialog-content:grid-cols-2 sm:flex-row sm:justify-end",$),...Z})}function bq({className:$,...Z}){return O4.jsx(N9.Title,{"data-slot":"alert-dialog-title",className:i0('text-base font-medium sm:group-data-[size=default]/alert-dialog-content:[:where([class~="group/alert-dialog-content"]):has([data-slot=alert-dialog-media])_&]:col-start-2',$),...Z})}function wq({className:$,...Z}){return O4.jsx(N9.Description,{"data-slot":"alert-dialog-description",className:i0("text-sm text-balance text-muted-foreground md:text-pretty *:[a]:underline *:[a]:underline-offset-3 *:[a]:hover:text-foreground",$),...Z})}function Sq({className:$,...Z}){return O4.jsx(M0,{"data-slot":"alert-dialog-action",className:i0($),...Z})}function Rq({className:$,variant:Z="outline",size:J="default",...H}){return O4.jsx(N9.Close,{"data-slot":"alert-dialog-cancel",className:i0($),render:O4.jsx(M0,{variant:Z,size:J}),...H})}var A2=P(c(),1);function Ga(){let{demo:$}=a4(),{name:Z,cwd:J,workspaceId:H}=b1(),[,B]=m4(),Q=hU(),X=Z??J??"this space",z=()=>{Q.mutate(H,{onSuccess:()=>B("/")})};return A2.jsxs(gH,{title:"General",description:"Basic details for this space.",children:[A2.jsx(mH,{children:A2.jsx(yX,{title:"Path",control:A2.jsx(C$,{value:J??"","aria-label":"Workspace path",title:J??void 0,className:"w-56",readOnly:!0})})}),!$&&A2.jsx(mH,{label:"Danger zone",children:A2.jsx(yX,{title:"Remove space",description:"Remove this space from Moi. Its folder and sessions stay on disk.",control:A2.jsxs(Oq,{children:[A2.jsx(jq,{render:A2.jsx(M0,{type:"button",variant:"destructive",size:"sm"}),disabled:Q.isPending,children:"Remove"}),A2.jsxs(Tq,{children:[A2.jsxs(Cq,{children:[A2.jsxs(bq,{children:["Remove “",X,"” from your workspaces?"]}),A2.jsx(wq,{children:"This only removes it from your list. The folder and its sessions stay on disk. You can add it back any time."})]}),Q.isError&&A2.jsx("p",{className:"text-xs text-destructive",children:Q.error.message}),A2.jsxs(Eq,{children:[A2.jsx(Rq,{disabled:Q.isPending,children:"Cancel"}),A2.jsxs(Sq,{type:"button",variant:"destructive",onClick:z,disabled:Q.isPending,children:[Q.isPending&&A2.jsx(d5,{"data-icon":"inline-start",stroke:1.75,className:"animate-spin"}),"Remove"]})]})]})]})})})]})}var J8=P(c(),1),hK0=[{id:"general",label:"General",icon:c6},{id:"connectors",label:"Connectors",icon:Dq},{id:"environment",label:"Environment",icon:AY}];function Iq({children:$}){let[Z,J]=Ua.useState("general");return J8.jsxs(f6,{children:[$,J8.jsxs(OJ,{className:"flex h-[min(680px,90vh)] w-[880px] gap-0 overflow-hidden p-0 sm:max-w-[94vw]",children:[J8.jsx(g6,{className:"sr-only",children:"Space settings"}),J8.jsxs("nav",{className:"flex w-48 shrink-0 flex-col gap-0.5 border-r bg-muted p-3",children:[J8.jsx("p",{className:"px-2.5 pt-4 pb-2 text-xs text-muted-foreground",children:"Settings"}),hK0.map((H)=>J8.jsxs(M0,{type:"button",variant:Z===H.id?"secondary":"ghost",size:"sm",onClick:()=>J(H.id),className:"justify-start",children:[J8.jsx(H.icon,{stroke:1.75}),H.label]},H.id))]}),J8.jsx("div",{className:"relative scrollbar-thin min-w-0 flex-1 overflow-y-auto",children:J8.jsxs("div",{className:"px-8 py-7",children:[Z==="general"&&J8.jsx(Ga,{}),Z==="connectors"&&J8.jsx(pr,{}),Z==="environment"&&J8.jsx(Ba,{})]})})]})]})}var Na=P(m(),1);function kq($){let Z=$1();return L2((J)=>{if((J.type==="views:changed"||J.type==="view:deleted")&&J.workspaceId===$){if(Z.invalidateQueries({queryKey:O0.views($)}),J.type==="view:deleted")Z.invalidateQueries({queryKey:O0.sessions($)})}}),s1({queryKey:O0.views($),queryFn:async()=>(await B1(`/api/workspaces/${$}/views`)).views,...W8})}function vX($,Z){let J=$1();return F5({mutationFn:Z,onSuccess:()=>J.invalidateQueries({queryKey:O0.views($)})})}function Ya($){return vX($,({viewId:Z,title:J})=>B1(`/api/workspaces/${$}/views/${encodeURIComponent(Z)}`,_5("PATCH",{title:J}),"Couldn’t rename view"))}function e_($){return vX($,(Z)=>U4(`/api/workspaces/${$}/views/${encodeURIComponent(Z)}`,{method:"DELETE"},"Couldn’t delete view"))}function Ka($){return vX($,()=>B1(`/api/workspaces/${$}/views`,_5("POST"),"Couldn’t create view"))}function Fa($){return vX($,({viewId:Z,requirements:J})=>B1(`/api/workspaces/${$}/views/${Z}`,_5("PATCH",{requirements:J}),"Couldn’t save view requirements"))}function Wa($){return vX($,({viewId:Z,...J})=>B1(`/api/workspaces/${$}/views/${Z}/submit`,_5("POST",J),"Couldn’t start view chat"))}var qa=e_;function fX($){return $.title||($.status==="compiled"?$.id:"New view")}function gX($){return LY($.icon)??dF}var E1=P(c(),1);function vK0({outlined:$,onClick:Z}){return E1.jsxs("button",{type:"button","aria-label":"Create new view",onClick:Z,className:Q0("group flex w-20 shrink-0 cursor-pointer flex-col items-center gap-2 text-sm",$?"text-foreground":"text-muted-foreground"),children:[E1.jsx("div",{className:Q0("size-16 rounded-2xl squircle",$&&"shadow-xs transition-shadow duration-300 ease-out group-hover:shadow-2xl"),children:E1.jsx("div",{className:Q0("flex size-full items-center justify-center rounded-2xl squircle",$?"bg-background text-foreground":"bg-accent"),children:E1.jsx(a2,{size:32,stroke:1.25})})}),E1.jsx("span",{className:"line-clamp-2 w-full text-xs leading-snug font-medium text-ellipsis",children:"New view"})]})}function fK0({view:$,Icon:Z,onOpen:J}){let{workspaceId:H}=b1(),B=Ya(H),Q=e_(H),X=fX($),[z,G]=Na.useState(!1);function U(){G(!0)}function Y(K){let F=K.trim();if(!F||F===X)return;B.mutate({viewId:$.id,title:F},{onError:(W)=>{e1.add({title:"Couldn’t rename view",description:W.message,type:"error"})}})}return E1.jsxs("div",{className:"group/item relative w-20 shrink-0",children:[E1.jsxs("button",{type:"button","aria-label":`Open ${X}`,onClick:J,className:"group flex w-20 cursor-pointer flex-col items-center gap-2 text-sm text-foreground",children:[E1.jsx("div",{className:"size-16 rounded-2xl transition-shadow duration-300 ease-out squircle group-hover:shadow-xl group-hover/item:shadow-xl",children:E1.jsx("div",{"data-vivid":!0,className:"flex size-full items-center justify-center rounded-2xl bg-primary text-primary-foreground inset-shadow-[0_0_10px_color-mix(in_oklab,var(--color-white)_30%,transparent)] squircle",children:E1.jsx(Z,{size:32,stroke:1.25})})}),E1.jsx("span",{className:"line-clamp-2 w-full text-xs leading-snug font-medium text-ellipsis",children:z?"":X})]}),z&&E1.jsx(HK,{autoFocus:!0,selectOnFocus:!0,"aria-label":`Rename ${X}`,defaultValue:X,onBlur:()=>G(!1),onValueCommit:Y,className:"absolute top-18 left-0 m-0 h-auto w-20 max-w-20 min-w-0 rounded-xs px-1 py-0 text-center text-xs leading-snug font-medium"}),E1.jsxs(Oq,{children:[E1.jsxs(X3,{children:[E1.jsx(z3,{render:E1.jsx(M0,{type:"button",variant:"outline",size:"icon-xs","aria-label":`View actions for ${X}`,className:"absolute -top-1 right-1 border-0 opacity-0 shadow-xs transition-opacity group-hover/item:opacity-100 group-hover/item:delay-400 focus-visible:opacity-100 data-popup-open:opacity-100",children:E1.jsx(NY,{stroke:1.75})})}),E1.jsxs(G3,{align:"end",className:"min-w-32",children:[E1.jsxs(U3,{onClick:U,disabled:B.isPending,children:[E1.jsx(rF,{stroke:1.75}),"Rename"]}),E1.jsxs(U3,{nativeButton:!0,render:E1.jsx(jq,{}),disabled:Q.isPending,onClick:()=>Q.reset(),className:"w-full",children:[E1.jsx(Pq,{stroke:1.75}),"Delete"]})]})]}),E1.jsxs(Tq,{children:[E1.jsxs(Cq,{children:[E1.jsxs(bq,{children:["Delete “",X,"”?"]}),E1.jsx(wq,{children:"This deletes the view and its source code. Related data and shared files stay in the workspace."})]}),Q.isError&&E1.jsx("p",{className:"text-xs text-destructive",children:Q.error.message}),E1.jsxs(Eq,{children:[E1.jsx(Rq,{disabled:Q.isPending,children:"Cancel"}),E1.jsxs(Sq,{type:"button",variant:"destructive",disabled:Q.isPending,onClick:()=>Q.mutate($.id),children:[Q.isPending&&E1.jsx(d5,{"data-icon":"inline-start",stroke:1.75,className:"animate-spin"}),"Delete view"]})]})]})]})]})}function Aa({views:$,onOpenView:Z,onCreateView:J,showOnboarding:H}){let B=$.length===0;return E1.jsxs("div",{className:"relative no-scrollbar flex size-full items-center overflow-hidden bg-muted",children:[B&&E1.jsx("div",{className:"pointer-events-none absolute inset-0 texture-checker [mask-image:linear-gradient(to_right,transparent_40%,black_80%)]","aria-hidden":!0}),E1.jsx("h2",{className:"relative pr-6 pl-12 text-2xl font-semibold text-foreground",children:"Views"}),E1.jsxs("div",{className:"relative no-scrollbar flex scroll-fade-x gap-2 overflow-x-auto px-6 pt-4 [--scroll-fade-reveal:16px]",children:[$.map((Q)=>E1.jsx(fK0,{view:Q,Icon:gX(Q),onOpen:()=>Z(Q.id)},Q.id)),E1.jsx(vK0,{outlined:B,onClick:J})]}),B&&H&&E1.jsx("p",{className:"relative mr-8 ml-auto max-w-56 text-right text-sm text-muted-foreground",children:"Create new views when you need separate pages for focused tasks"})]})}var Va=P(c(),1),gK0={[RL.id]:($)=>Va.jsx(Aa,{views:$.views,onOpenView:$.onOpenView,onCreateView:$.onCreateView,showOnboarding:$.showOnboarding})};function Da($,Z){if(!B3($))return;return gK0[$](Z)}function La($,Z,J,H){let B=$.reduce((Q,X)=>Math.max(Q,X.y+X.h),0);for(let Q=0;Q<=B+J;Q++)for(let X=0;X<=H-Z;X++)if(!$.some((G)=>!(X+Z<=G.x||G.x+G.w<=X||Q+J<=G.y||G.y+G.h<=Q)))return{x:X,y:Q};return{x:0,y:B}}function mX($,Z=[],J=4){let H=[];for(let B of $){let{x:Q,y:X}=B.x!==void 0&&B.y!==void 0?{x:B.x,y:B.y}:La([...Z,...H],B.w,B.h,J);H.push({i:B.id,x:Q,y:X,w:B.w,h:B.h})}return H}function yq($,Z,J){return La($,Z,J,4)}function Ma($,Z){let J=new Map(Z.map((H)=>[H.id,H]));return $.map((H)=>{let B=J.get(H.i);return B?{...H,x:B.x,y:B.y}:H})}var $O=P(m(),1),xq=new Map;function mK0($){let Z=window.__moiAppletCss?.get($)??"",J=xq.get($);if(!J){let Q=document.createElement("style");Q.dataset.appletStyle=$,document.head.appendChild(Q),J={el:Q,refs:0},xq.set($,J)}if(J.el.textContent!==Z)J.el.textContent=Z;J.refs++;let H=J,B=!1;return()=>{if(B)return;if(B=!0,H.refs--,H.refs<=0)H.el.remove(),xq.delete($)}}function uK0($){let Z=xq.get($);if(!Z||Z.el===document.head.lastElementChild)return;document.head.appendChild(Z.el)}function hq($,Z,J=!1){$O.useInsertionEffect(()=>mK0($),[$,Z]),$O.useInsertionEffect(()=>{if(J)uK0($)},[$,J,Z])}var ZO=P(c(),1);function Pa({segment:$,name:Z,version:J,children:H}){let B=p1(),Q=z7($,Z);return hq(dK($,B,Z),J),ZO.jsx("div",{"data-applet":Q,className:"size-full",children:ZO.jsx(xB,{appletId:Q,children:H})})}var _a=P(m(),1);var uH=P(c(),1);class uX extends _a.Component{state={error:null};static getDerivedStateFromError($){return{error:$}}componentDidCatch($,Z){console.error(`[widget:${this.props.name}]`,$,Z.componentStack),K8(this.props.workspaceId,{source:"render",kind:this.props.kind,name:this.props.name,message:$.message||String($),stack:[$.stack,Z.componentStack].filter(Boolean).join(`
67
+ `)})}componentDidUpdate($){if($.resetKey!==this.props.resetKey&&this.state.error)this.setState({error:null})}render(){if(this.state.error)return uH.jsxs("div",{className:"flex h-full w-full flex-col items-start justify-start gap-1.5 p-4 text-xs",children:[uH.jsxs("div",{className:"flex items-center gap-1.5 font-semibold text-destructive",children:[uH.jsx(IG,{size:16,stroke:1.75}),"Widget crashed"]}),uH.jsx("div",{className:"font-mono break-words text-muted-foreground",children:this.state.error.message})]});return this.props.children}}var S7=P(c(),1);function Oa({name:$}){let Z=p1(),J=Bv($);return S7.jsxs(I4,{mode:"wait",initial:!1,children:[J.status==="ready"&&S7.jsx(Y5.div,{className:"absolute inset-0",initial:{opacity:0,filter:"blur(4px)"},animate:{opacity:1,filter:"blur(0px)"},exit:{opacity:0,filter:"blur(4px)"},transition:{duration:0.45,ease:"easeInOut"},children:S7.jsx(uX,{name:$,kind:"widget",workspaceId:Z,resetKey:J.version,children:S7.jsx(Pa,{segment:"widgets",name:$,version:J.version,children:S7.jsx(J.Component,{})})})},J.version),J.status==="error"&&S7.jsx(Y5.p,{className:"absolute inset-0 p-4 text-xs text-destructive",initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:0.45,ease:"easeInOut"},children:J.error},`err-${J.version}`)]})}var Ta=P(m(),1);var R7=P(c(),1);function vq({customizing:$,hidden:Z,widgetId:J,onRemove:H,children:B}){let Q=Av(),X=!J||!B3(J);return R7.jsxs(Y5.div,{variants:{idle:{rotate:0},wiggle:{rotate:[0.5,-0.5],transition:{rotate:{repeat:1/0,repeatType:"reverse",duration:0.15,ease:"easeInOut"}}}},animate:$?"wiggle":"idle",transition:{type:"spring",duration:0.35,bounce:0},className:"group/widget relative size-full",children:[R7.jsx("div",{"data-widget-chrome":!0,"data-vivid":X?!0:void 0,style:X?K9(Q,"widget"):void 0,className:Q0("absolute inset-0 overflow-hidden rounded-2xl text-foreground squircle",$&&"pointer-events-none"),children:B}),$&&H&&R7.jsx("div",{className:"absolute -top-2 -right-2 opacity-0 transition-opacity group-hover/widget:opacity-100",children:R7.jsx(M0,{size:"icon-sm",variant:"outline",className:"rounded-full","aria-label":Z?"Restore widget":"Hide widget",onPointerDown:(z)=>z.stopPropagation(),onClick:H,children:Z?R7.jsx(a2,{stroke:1.75}):R7.jsx(ja,{stroke:1.75})})})]})}var o3=P(c(),1),pK0={0:"col-start-1",1:"col-start-2",2:"col-start-3",3:"col-start-4"},cK0={0:"row-start-1",1:"row-start-2",2:"row-start-3",3:"row-start-4",4:"row-start-5",5:"row-start-6",6:"row-start-7",7:"row-start-8"},dK0={1:"col-span-1",2:"col-span-2",3:"col-span-3",4:"col-span-4"},lK0={1:"row-span-1",2:"row-span-2",3:"row-span-3",4:"row-span-4"};function Ca({items:$,renderItem:Z,onCreateWidget:J,onClose:H,onRestore:B,ref:Q}){let X=Ta.useMemo(()=>mX($),[$]);return o3.jsx(Wq,{ref:Q,title:"Widgets",actions:o3.jsxs(M0,{type:"button",variant:"secondary",size:"sm",onClick:J,children:[o3.jsx(a2,{"data-icon":"inline-start",stroke:1.75}),"New widget"]}),onClose:H,className:"max-h-[60vh]",children:X.length>0&&o3.jsx("div",{className:"grid auto-rows-[160px] grid-cols-4 gap-2",children:o3.jsx(I4,{children:X.map((z)=>o3.jsx(Y5.div,{layoutId:z.i,className:Q0(pK0[z.x],cK0[z.y],dK0[z.w],lK0[z.h]),transition:{type:"spring",duration:0.35,bounce:0},children:o3.jsx(vq,{customizing:!0,widgetId:z.i,onRemove:()=>B(z.i),hidden:!0,children:Z(z.i)})},z.i))})})})}var eq=P(m(),1);var f4=P(m(),1);var H1=P(m(),1),pH=P(m(),1),P8=P(m(),1),aa=P(c(),1),gq=P(m(),1),mq=P(m(),1),f1=P(c(),1),iK0=Object.defineProperty,rK0=($,Z)=>{for(var J in Z)iK0($,J,{get:Z[J],enumerable:!0})},n3={};rK0(n3,{ActiveEmoji:()=>Yo,Empty:()=>Uo,List:()=>Xo,Loading:()=>Go,Root:()=>ea,Search:()=>$o,SkinTone:()=>Ko,SkinToneSelector:()=>zo,Viewport:()=>Zo});var pa="'Apple Color Emoji', 'Noto Color Emoji', 'Twemoji Mozilla', 'Android Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol', EmojiSymbols, sans-serif",BO=["none","light","medium-light","medium","medium-dark","dark"];function JO($){return $.charAt(0).toUpperCase()+$.slice(1)}var A9=2,j4=null;function Ea($){try{j4??=document.createElement("canvas").getContext("2d",{willReadFrequently:!0})}catch{}if(!j4||(queueMicrotask(()=>{j4&&(j4=null)}),j4.canvas.width=A9,j4.canvas.height=A9,j4.font=`2px ${pa}`,j4.textBaseline="middle",j4.measureText($).width>=A9*2))return!1;j4.fillStyle="#00f",j4.fillText($,0,0);let Z=j4.getImageData(0,0,A9,A9).data;j4.clearRect(0,0,A9,A9),j4.fillStyle="#f00",j4.fillText($,0,0);let J=j4.getImageData(0,0,A9,A9).data;for(let H=0;H<A9*A9*4;H+=4)if(Z[H]!==J[H]||Z[H+1]!==J[H+1]||Z[H+2]!==J[H+2])return!1;return!0}function ba($,Z,J){try{let H=$.getItem(Z);if(!H)throw Error(`No value found for "${Z}".`);let B=JSON.parse(H);return J(B)}catch{return null}}function ca($,Z,J){$.setItem(Z,JSON.stringify(J))}function wa($){return(Z)=>Z===void 0?void 0:$(Z)}function Sa($){return(Z)=>Z===null?null:$(Z)}function n2($){if(typeof $!="string")throw Error();return $}function fq($){if(typeof $!="number")throw Error();return $}function da($){if(typeof $!="boolean")throw Error();return $}function I7($){return(Z)=>{if(typeof Z!="object"||Z===null)throw Error();let J={};for(let H in $){let B=Z[H];B===void 0&&$[H](void 0),J[H]=$[H](B)}return J}}function HO($){return(Z)=>{if(!Array.isArray(Z))throw Error();return Z.length>0&&$(Z[0]),Z}}var la=($,Z)=>`${$}/${Z}/data.json`,ia=($,Z)=>`${$}/${Z}/messages.json`,aK0=["bn","da","de","en-gb","en","es-mx","es","et","fi","fr","hi","hu","it","ja","ko","lt","ms","nb","nl","pl","pt","ru","sv","th","uk","vi","zh-hant","zh"],Ra="en",ra=($)=>`frimousse/data/${$}`,Ia="frimousse/metadata";async function ka($,Z){try{return(await fetch($,{method:"HEAD",signal:Z})).headers.get("etag")}catch{return null}}async function oK0($,Z,J){let[{emojis:H,emojisEtag:B},{messages:Q,messagesEtag:X}]=await Promise.all([fetch(la($,Z),{signal:J}).then(async(z)=>({emojis:await z.json(),emojisEtag:z.headers.get("etag")})),fetch(ia($,Z),{signal:J}).then(async(z)=>({messages:await z.json(),messagesEtag:z.headers.get("etag")}))]);return{emojis:H,messages:Q,emojisEtag:B,messagesEtag:X}}async function nK0($,Z,J){let[H,B]=await Promise.all([ka(la($,Z),J),ka(ia($,Z),J)]);return{emojisEtag:H,messagesEtag:B}}function sK0($){return $.skins?$.skins.filter((Z)=>typeof Z.tone=="number").reduce((Z,J)=>{let H=BO[J.tone];return Z[H]=J.emoji,Z},{}):void 0}async function ya($,Z,J){let{emojis:H,emojisEtag:B,messages:Q,messagesEtag:X}=await oK0($,Z,J),z=Q.subgroups.find((q)=>q.key==="country-flag"||q.key==="subdivision-flag"),G=Q.groups.filter((q)=>q.key!=="component"),U=H.filter((q)=>("group"in q)),Y=G.map((q)=>({index:q.order,label:JO(q.message)})),K=Q.skinTones.reduce((q,N)=>(q[N.key]=JO(N.message),q),{}),F=U.map((q)=>({emoji:q.emoji,category:q.group,version:q.version,label:JO(q.label),tags:q.tags??[],countryFlag:z&&q.subgroup===z.order||void 0,skins:sK0(q)})),W={locale:Z,emojis:F,categories:Y,skinTones:K};return ca(localStorage,ra(Z),{data:W,metadata:{emojisEtag:B,messagesEtag:X}}),W}function tK0($,Z){let J=new Map;for(let X of $)J.has(X.version)||J.set(X.version,X.emoji);let H=[...J.keys()].sort((X,z)=>z-X),B=H[0]??0,Q=Ea("\uD83C\uDDEA\uD83C\uDDFA");if(typeof Z=="number")return{emojiVersion:Z,countryFlags:Q};for(let X of H){let z=J.get(X);if(Ea(z))return{emojiVersion:X,countryFlags:Q}}return{emojiVersion:B,countryFlags:Q}}var eK0=I7({emojiVersion:fq,countryFlags:da}),$F0=I7({data:I7({locale:n2,emojis:HO(I7({emoji:n2,category:fq,label:n2,version:fq,tags:HO(n2),countryFlag:wa(da),skins:wa(I7({light:n2,"medium-light":n2,medium:n2,"medium-dark":n2,dark:n2}))})),categories:HO(I7({index:fq,label:n2})),skinTones:I7({light:n2,"medium-light":n2,medium:n2,"medium-dark":n2,dark:n2})}),metadata:I7({emojisEtag:Sa(n2),messagesEtag:Sa(n2)})});async function ZF0({locale:$,emojiVersion:Z,emojibaseUrl:J,signal:H}){let B=typeof J=="string"?J:`https://cdn.jsdelivr.net/npm/emojibase-data@${typeof Z=="number"?Math.floor(Z):"latest"}`,Q=ba(sessionStorage,Ia,eK0),X=ba(localStorage,ra($),$F0),z;if(!X)z=await ya(B,$,H);else if(Q)z=X.data;else try{let{emojisEtag:U,messagesEtag:Y}=await nK0(B,$,H);z=!U||!Y||U!==X.metadata.emojisEtag||Y!==X.metadata.messagesEtag?await ya(B,$,H):X.data}catch{z=X.data}Q??=tK0(z.emojis,Z),ca(sessionStorage,Ia,Q);let G=z.emojis.filter((U)=>{let Y=U.version<=Q.emojiVersion;return U.countryFlag?Y&&Q.countryFlags:Y});return{locale:$,emojis:G,categories:z.categories,skinTones:z.skinTones}}function xa($){return aK0.includes($)?$:(console.warn(`Locale "${$}" is not supported, using "${Ra}" instead.`),Ra)}function ha($){return BO.includes($)?$:(console.warn(`Skin tone "${$}" is not valid, using "none" instead.`),"none")}function JF0($,Z){let J=[];if(Z<=0)return J;for(let H=0,B=$.length;H<B;H+=Z)J.push($.slice(H,H+Z));return J}function HF0($,Z){if(!Z)return $;let J=Z.toLowerCase().trim(),H=new WeakMap;return $.filter((B)=>{let Q=0;B.label.toLowerCase().includes(J)&&(Q+=10);for(let X of B.tags)X.toLowerCase().includes(J)&&(Q+=1);return Q>0?(H.set(B,Q),!0):!1}).sort((B,Q)=>(H.get(Q)??0)-(H.get(B)??0))}function BF0($,Z,J,H){let B=HF0($.emojis,H),Q=[],X=[],z=[],G={},U=0,Y=0;for(let K of B)G[K.category]||(G[K.category]=[]),G[K.category].push({emoji:J&&J!=="none"&&K.skins?K.skins[J]:K.emoji,label:K.label});for(let K of $.categories){let F=G[K.index];if(!F||F.length===0)continue;let W=JF0(Array.from(F),Z).map((q)=>({categoryIndex:U,emojis:q}));Q.push(...W),X.push({label:K.label,rowsCount:W.length,startRowIndex:Y}),z.push(Y),U++,Y+=W.length}return{count:B.length,categories:X,categoriesStartRowIndices:z,rows:Q,skinTones:$.skinTones}}function QF0($){let Z={},J=null,H=null,B=new Set,Q=()=>{if(J){Z=J,J=null;for(let U of B)U(Z)}H=null},X=()=>J??Z,z=(U)=>{J??=Z,Object.assign(J,typeof U=="function"?U(X()):U),H||(H=requestAnimationFrame(Q))},G=(U)=>(B.add(U),()=>B.delete(U));return Z=$(z,X),{get:X,set:z,subscribe:G}}function XF0($){let[Z]=P8.useState($);return Z}function zF0($){let Z=P8.createContext(null);return{useStore:()=>{let J=P8.useContext(Z);if(!J)throw Error($);return J},Provider:({store:J,children:H})=>aa.jsx(Z.Provider,{value:J,children:H})}}function M8($,Z,J=Object.is){let[H,B]=P8.useState(()=>Z($.get()));return P8.useEffect(()=>$.subscribe(()=>{let Q=Z($.get());B((X)=>J(X,Q)?X:Q)}),[$,Z,J]),P8.useDebugValue(H),H}function A3($,Z,J){let H=P8.useCallback((B)=>B[Z],[Z]);return M8($,H,J)}var va=2;function GF0($,Z,J,H,B){let Q=0;return QF0((X,z)=>({locale:Z,columns:J,sticky:H,skinTone:B,onEmojiSelect:$,data:null,search:"",interaction:"none",activeColumnIndex:0,activeRowIndex:0,rowHeight:null,categoryHeaderHeight:null,viewportWidth:null,viewportHeight:null,viewportCurrentCategoryIndex:null,viewportStartCategoryIndex:0,viewportStartRowIndex:0,viewportEndRowIndex:0,rootRef:null,searchRef:null,viewportRef:null,listRef:null,updateViewportState:(G)=>{let U=z(),Y=G?.data??U.data,K=G?.categoryHeaderHeight??U.categoryHeaderHeight,F=G?.rowHeight??U.rowHeight,W=G?.viewportHeight??U.viewportHeight;if(!Y||Y.rows.length===0||!K||!F||!W)return X({...G,viewportStartCategoryIndex:0,viewportStartRowIndex:0,viewportEndRowIndex:0});let q=0,N=0;for(let C of Y.categories)if(N++*K+C.startRowIndex*F<Q)q+=K;else break;let D=Y.categories.length*K+Y.rows.length*F,A=Math.floor(va*F/2),V=Math.ceil(va*F/2),L=Math.min(Q-q-A,D-W),O=L+W+V,M=Math.max(0,Math.floor(L/F)),_=Math.min(Y.rows.length-1,Math.ceil(O/F)),w=Y.rows[M]?.categoryIndex;return X(w===void 0&&G?G:{...G,viewportStartCategoryIndex:w,viewportStartRowIndex:M,viewportEndRowIndex:_})},onDataChange:(G)=>{z().updateViewportState({data:G,activeColumnIndex:0,activeRowIndex:0})},onSearchChange:(G)=>{X({search:G,interaction:G?"keyboard":"none"})},onActiveEmojiChange:(G,U,Y)=>{if(X({interaction:G,activeColumnIndex:U,activeRowIndex:Y}),G!=="keyboard")return;let{listRef:K,viewportRef:F,sticky:W,rowHeight:q,viewportHeight:N,categoryHeaderHeight:D}=z(),A=K?.current,V=F?.current;if(!A||!V||!q||!D||!N)return;let L=Y;L===0&&V.scrollTo({top:0,behavior:"instant"});let O=A.querySelector(`[aria-rowindex="${L}"]`);if(!(O instanceof HTMLElement))return;let M=O.offsetTop,_=getComputedStyle(O),w=Number.parseFloat(_.scrollMarginTop),C=Number.parseFloat(_.scrollMarginBottom),E=Q+w;W&&M<Q+N/2&&(E+=D);let j=E+N-C;(M<E||M+q>j)&&V.scrollTo({top:Math.max(M<E+D?M-Math.max(W?D:0,w):M-N+q+C,0),behavior:"instant"})},onActiveEmojiReset:()=>{X({interaction:"none",activeColumnIndex:0,activeRowIndex:0})},onRowHeightChange:(G)=>{z().updateViewportState({rowHeight:G})},onCategoryHeaderHeightChange:(G)=>{z().updateViewportState({categoryHeaderHeight:G})},onViewportSizeChange:(G,U)=>{z().updateViewportState({viewportWidth:G,viewportHeight:U})},onViewportScroll:(G)=>{Q=G,z().updateViewportState()}}))}var{useStore:H8,Provider:UF0}=zF0("EmojiPicker.Root is missing.");function YF0($){return $.search}function QO($){return $.interaction==="none"?void 0:$.data?.rows[$.activeRowIndex]?.emojis[$.activeColumnIndex]}function KF0($){return $.data===void 0||typeof $.data?.count=="number"&&$.data.count===0}function FF0($){return $.data===null||$.viewportHeight===null||$.rowHeight===null||$.categoryHeaderHeight===null}function oa($){return $.data?.rows.length}function WF0($){return $.data?.categories.length}function qF0($){return $.data?.categoriesStartRowIndices}function NF0($){return $.data?.skinTones}function na($,Z){return $?.emoji===Z?.emoji}function AF0($,Z){return $?.categoryIndex!==Z?.categoryIndex||$?.emojis.length!==Z?.emojis.length?!1:!!$?.emojis.every((J,H)=>na(J,Z?.emojis[H]))}var pX="‍",fa=/\p{Emoji_Modifier_Base}/u,DF0=/\uFE0F$/,VF0=/\u{1F3FB}|\u{1F3FC}|\u{1F3FD}|\u{1F3FE}|\u{1F3FF}/gu,LF0={light:"\uD83C\uDFFB","medium-light":"\uD83C\uDFFC",medium:"\uD83C\uDFFD","medium-dark":"\uD83C\uDFFE",dark:"\uD83C\uDFFF"};function MF0($,Z){if(!$.split(pX).some((H)=>fa.test(H)))return $;let J=$.split(pX).map((H)=>H.replace(VF0,"")).join(pX);return Z==="none"?J:J.split(pX).map((H,B,Q)=>{let X=Q.length>1;return!fa.test(H)||X&&H==="\uD83E\uDD1D"?H:H.replace(DF0,"")+LF0[Z]}).join(pX)}function PF0($){return BO.map((Z)=>({skinTone:Z,emoji:MF0($,Z)}))}function sa(){let $=H8(),Z=M8($,QO,na);return pH.useDeferredValue(Z)}function ta($="✋"){let Z=H8(),J=A3(Z,"skinTone"),H=pH.useMemo(()=>PF0($),[$]),B=pH.useCallback((Q)=>{Z.set({skinTone:Q})},[]);return[J,B,H]}function XO($,Z){if(Object.is($,Z))return!0;if(typeof $!="object"||typeof Z!="object"||$===null||Z===null||Array.isArray($)!==Array.isArray(Z))return!1;let J=Object.keys($),H=Object.keys(Z);return J.length!==H.length?!1:J.every((B)=>(B in Z)&&$[B]===Z[B])}function _F0(...$){}function OF0($,Z){let J=null;if(typeof window.requestIdleCallback=="function")J=window.requestIdleCallback($,Z);else{let H=Date.now();J=window.setTimeout(()=>{$({didTimeout:!1,timeRemaining:()=>Math.max(0,(Z?.timeout??50)-(Date.now()-H))})},10)}return()=>{typeof window.cancelIdleCallback=="function"?window.cancelIdleCallback(J):window.clearTimeout(J)}}var D9=typeof window<"u"?gq.useLayoutEffect:gq.useEffect;function jF0($){let Z=mq.useRef($);return D9(()=>{Z.current=$}),mq.useCallback((...J)=>Z.current(...J),[])}function TF0({emojiVersion:$,emojibaseUrl:Z}){let[J,H]=H1.useState(void 0),B=H8(),Q=A3(B,"locale"),X=A3(B,"columns"),z=A3(B,"skinTone"),G=A3(B,"search");return H1.useEffect(()=>{let U=new AbortController,Y=U.signal;return ZF0({locale:Q,emojiVersion:$,emojibaseUrl:Z,signal:Y}).then((K)=>{H(K)}).catch((K)=>{Y.aborted||console.error(K)}),()=>{U.abort()}},[$,Z,Q]),H1.useEffect(()=>{if(J)return OF0(()=>{B.get().onDataChange(BF0(J,X,z,G))},{timeout:100})},[J,X,z,G]),null}var ea=H1.forwardRef(({locale:$="en",columns:Z=9,skinTone:J="none",onEmojiSelect:H=_F0,emojiVersion:B,emojibaseUrl:Q,onFocusCapture:X,onBlurCapture:z,children:G,style:U,sticky:Y=!0,...K},F)=>{let W=jF0(H),q=XF0(()=>GF0(W,xa($),Z,Y,ha(J))),[N,D]=H1.useState(!1),A=H1.useRef(null),V=H1.useCallback((M)=>{M&&(A.current=M,q.set({rootRef:A}))},[]);D9(()=>{q.set({locale:xa($)})},[$]),D9(()=>{q.set({columns:Z})},[Z]),D9(()=>{q.set({sticky:Y})},[Y]),D9(()=>{q.set({skinTone:ha(J)})},[J]);let L=H1.useCallback((M)=>{X?.(M);let{searchRef:_,viewportRef:w}=q.get(),C=M.target===_?.current||M.target.hasAttribute("frimousse-search"),E=M.target===w?.current||M.target.hasAttribute("frimousse-viewport");M.isDefaultPrevented()||(D(C||E),M.isDefaultPrevented()||(D(C||E),E?q.get().onActiveEmojiChange("keyboard",0,0):C&&q.get().search===""&&q.set({interaction:"none"})))},[X]),O=H1.useCallback((M)=>{z?.(M),!M.isDefaultPrevented()&&!M.currentTarget.contains(M.relatedTarget)&&D(!1)},[z]);return D9(()=>{N||q.get().onActiveEmojiReset()},[N]),H1.useImperativeHandle(F,()=>A.current),H1.useEffect(()=>{if(!N)return;function M(_){if(_.defaultPrevented||!_.key.startsWith("Arrow")&&_.key!=="Enter")return;let{data:w,onEmojiSelect:C,onActiveEmojiChange:E,interaction:j,activeColumnIndex:k,activeRowIndex:S}=q.get();if(_.key==="Enter"){let I=QO(q.get());I&&(_.preventDefault(),C(I))}if(_.key.startsWith("Arrow")){let I=k,T=S;if(_.preventDefault(),j!=="none"){if(w?.rows&&w.rows.length>0)switch(_.key){case"ArrowLeft":{if(I===0){let y=T-1,R=w.rows[y];R&&(T=y,I=R.emojis.length-1)}else I-=1;break}case"ArrowRight":{if(I===w.rows[T].emojis.length-1){let y=T+1;w.rows[y]&&(T=y,I=0)}else I+=1;break}case"ArrowUp":{let y=w.rows[T-1];y&&(T-=1,y.emojis[I]||(I=y.emojis.length-1));break}case"ArrowDown":{let y=w.rows[T+1];y&&(T+=1,y.emojis[I]||(I=y.emojis.length-1));break}}E("keyboard",I,T)}else E("keyboard",0,0)}}return document.addEventListener("keydown",M),()=>{document.removeEventListener("keydown",M)}},[N]),D9(()=>{let M=null,_=null,w=null,C=null,E=q.subscribe((T)=>{A.current&&(M!==T.viewportWidth&&(M=T.viewportWidth,A.current.style.setProperty("--frimousse-viewport-width",`${T.viewportWidth}px`)),_!==T.viewportHeight&&(_=T.viewportHeight,A.current.style.setProperty("--frimousse-viewport-height",`${T.viewportHeight}px`)),w!==T.rowHeight&&(w=T.rowHeight,A.current.style.setProperty("--frimousse-row-height",`${T.rowHeight}px`)),C!==T.categoryHeaderHeight&&(C=T.categoryHeaderHeight,A.current.style.setProperty("--frimousse-category-header-height",`${T.categoryHeaderHeight}px`)))}),{viewportWidth:j,viewportHeight:k,rowHeight:S,categoryHeaderHeight:I}=q.get();return j&&A.current.style.setProperty("--frimousse-viewport-width",`${j}px`),k&&A.current.style.setProperty("--frimousse-viewport-height",`${k}px`),S&&A.current.style.setProperty("--frimousse-row-height",`${S}px`),I&&A.current.style.setProperty("--frimousse-category-header-height",`${I}px`),E},[]),f1.jsx("div",{"data-focused":N?"":void 0,"frimousse-root":"",onBlurCapture:O,onFocusCapture:L,...K,ref:V,style:{"--frimousse-emoji-font":pa,...U},children:f1.jsxs(UF0,{store:q,children:[f1.jsx(TF0,{emojiVersion:B,emojibaseUrl:Q}),G]})})}),$o=H1.forwardRef(({value:$,defaultValue:Z,onChange:J,...H},B)=>{let Q=H8(),X=H1.useRef(null),z=H1.useCallback((K)=>{K&&(X.current=K,Q.set({searchRef:X}))},[]),G=typeof $=="string",U=H1.useRef(G);H1.useEffect(()=>{U.current=G},[G]),D9(()=>{Q.set({search:typeof $=="string"?$:typeof Z=="string"?Z:""})},[]),D9(()=>{typeof $=="string"&&Q.get().onSearchChange($)},[$]);let Y=H1.useCallback((K)=>{J?.(K),K.isDefaultPrevented()||Q.get().onSearchChange(K.target.value)},[J]);return H1.useImperativeHandle(B,()=>X.current),f1.jsx("input",{autoCapitalize:"off",autoComplete:"off",autoCorrect:"off",enterKeyHint:"done","frimousse-search":"",placeholder:"Search…",spellCheck:!1,type:"search",...H,defaultValue:Z,onChange:Y,ref:z,value:$})}),CF0=H1.memo(()=>{let $=sa();return $?f1.jsx("div",{"aria-live":"polite",style:{border:0,clip:"rect(0, 0, 0, 0)",height:1,margin:-1,overflow:"hidden",padding:0,position:"absolute",whiteSpace:"nowrap",width:1,wordWrap:"normal"},children:$.label}):null}),Zo=H1.forwardRef(({children:$,onScroll:Z,onKeyDown:J,style:H,...B},Q)=>{let X=H8(),z=H1.useRef(null),G=H1.useCallback((F)=>{F&&(z.current=F,X.set({viewportRef:z}))},[]),U=M8(X,oa),Y=M8(X,WF0),K=H1.useCallback((F)=>{Z?.(F),X.get().onViewportScroll(F.currentTarget.scrollTop)},[Z]);return D9(()=>{if(!z.current)return;let F=new ResizeObserver(([W])=>{let q=W?.borderBoxSize[0]?.inlineSize??0,N=W?.borderBoxSize[0]?.blockSize??0,{onViewportSizeChange:D,viewportHeight:A,viewportWidth:V}=X.get();(A!==N||V!==q)&&D(q,N)});return F.observe(z.current),X.get().onViewportSizeChange(z.current.offsetWidth,z.current.clientHeight),()=>{F.disconnect()}},[]),H1.useImperativeHandle(Q,()=>z.current),f1.jsxs("div",{"frimousse-viewport":"",...B,onScroll:K,ref:G,style:{position:"relative",boxSizing:"border-box",contain:"layout paint",containIntrinsicSize:typeof U=="number"&&typeof Y=="number"?`var(--frimousse-viewport-width, auto) calc(${U} * var(--frimousse-row-height) + ${Y} * var(--frimousse-category-header-height))`:void 0,overflowY:"auto",overscrollBehavior:"contain",scrollbarGutter:"stable",willChange:"scroll-position",...H},children:[f1.jsx(CF0,{}),$]})});function Jo($,Z,J){return{emoji:{...$,isActive:J},role:"gridcell","aria-colindex":Z,"aria-selected":J||void 0,"aria-label":$.label,"data-active":J?"":void 0,"frimousse-emoji":"",style:{fontFamily:"var(--frimousse-emoji-font)"},tabIndex:-1}}function Ho($,Z=!1){return{role:Z?void 0:"row","aria-rowindex":Z?void 0:$,"frimousse-row":"",style:{contain:Z?void 0:"content",height:Z?void 0:"var(--frimousse-row-height)",display:"flex"}}}function Bo($,Z){return{"frimousse-category":"",style:{contain:"content",top:Z?`calc(${$} * var(--frimousse-category-header-height) + ${Z.startRowIndex} * var(--frimousse-row-height))`:void 0,height:Z?`calc(var(--frimousse-category-header-height) + ${Z.rowsCount} * var(--frimousse-row-height))`:void 0,width:"100%",pointerEvents:"none",position:"absolute"}}}function Qo($,Z=!1,J=!0){return{category:$,"frimousse-category-header":"",style:{contain:Z?void 0:"layout paint",height:Z?void 0:"var(--frimousse-category-header-height)",pointerEvents:"auto",position:J?"sticky":void 0,top:0}}}function ga($,Z,J,H){return{"frimousse-list-sizer":"",style:{position:"relative",boxSizing:"border-box",height:`calc(${$} * var(--frimousse-row-height) + ${Z} * var(--frimousse-category-header-height))`,paddingTop:`calc(${J} * var(--frimousse-row-height) + ${H} * var(--frimousse-category-header-height))`}}}function ma($,Z,J){return{"aria-colcount":$,"aria-rowcount":Z,"frimousse-list":"",style:{"--frimousse-list-columns":$,...J},role:"grid"}}function EF0($){$.preventDefault()}var bF0=H1.memo(({Emoji:$,emoji:Z,columnIndex:J,rowIndex:H})=>{let B=H8(),Q=M8(B,(U)=>QO(U)?.emoji===Z.emoji),X=H1.useCallback(()=>{B.get().onEmojiSelect(Z)},[Z]),z=H1.useCallback(()=>{B.get().onActiveEmojiChange("pointer",J,H)},[J,H]),G=H1.useCallback(()=>{B.get().onActiveEmojiReset()},[]);return f1.jsx($,{...Jo(Z,J,Q),onClick:X,onPointerDown:EF0,onPointerEnter:z,onPointerLeave:G})}),wF0=H1.memo(({Row:$,Emoji:Z,rowIndex:J})=>{let H=H8(),B=M8(H,(Q)=>Q.data?.rows[J],AF0);return B?f1.jsx($,{...Ho(J),children:B.emojis.map((Q,X)=>f1.jsx(bF0,{Emoji:Z,columnIndex:X,emoji:Q,rowIndex:J},Q.label))}):null}),SF0=H1.memo(({CategoryHeader:$,categoryIndex:Z})=>{let J=H8(),H=M8(J,(Q)=>Q.data?.categories[Z],XO),B=A3(J,"sticky");return H?f1.jsx("div",{...Bo(Z,H),children:f1.jsx($,{...Qo({label:H.label},!1,B)})}):null}),ua=H1.memo(({CategoryHeader:$,Row:Z,Emoji:J})=>{let H=H1.useRef(null),B=H8(),Q=A3(B,"columns"),X=H1.useMemo(()=>Array(Q).fill({emoji:"\uD83D\uDE42",label:""}),[Q]),z=H1.useMemo(()=>({label:"Category"}),[]),G=H1.useRef(null),U=H1.useRef(null);return D9(()=>{let Y=H.current?.parentElement?.parentElement;if(!Y||!G.current||!U.current)return;let K=new ResizeObserver((q)=>{for(let N of q){let D=N.contentRect.height,{onRowHeightChange:A,onCategoryHeaderHeightChange:V,rowHeight:L,categoryHeaderHeight:O}=B.get();N.target===G.current&&L!==D&&A(D),N.target===U.current&&O!==D&&V(D)}});K.observe(Y),K.observe(G.current),K.observe(U.current);let{onRowHeightChange:F,onCategoryHeaderHeightChange:W}=B.get();return F(G.current.clientHeight),W(U.current.clientHeight),()=>{K.disconnect()}},[]),f1.jsxs("div",{"aria-hidden":!0,ref:H,style:{height:0,visibility:"hidden"},children:[f1.jsx("div",{"frimousse-row-sizer":"",ref:G,children:f1.jsx(Z,{...Ho(-1,!0),children:X.map((Y,K)=>f1.jsx(J,{...Jo(Y,K,!1)},K))})}),f1.jsx("div",{...Bo(-1),children:f1.jsx("div",{"frimousse-category-header-sizer":"",ref:U,children:f1.jsx($,{...Qo(z,!0)})})})]})});function RF0({category:$,...Z}){return f1.jsx("div",{...Z,children:$.label})}function IF0({emoji:$,...Z}){return f1.jsx("button",{type:"button",...Z,children:$.emoji})}function kF0({...$}){return f1.jsx("div",{...$})}var Xo=H1.forwardRef(({style:$,components:Z,...J},H)=>{let B=H8(),Q=H1.useRef(null),X=H1.useCallback((A)=>{A&&(Q.current=A,B.set({listRef:Q}))},[]),z=Z?.CategoryHeader??RF0,G=Z?.Emoji??IF0,U=Z?.Row??kF0,Y=A3(B,"columns"),K=A3(B,"viewportStartRowIndex"),F=A3(B,"viewportEndRowIndex"),W=M8(B,oa),q=M8(B,qF0,XO),N=H1.useMemo(()=>q?.filter((A)=>A<K).length??0,[q,K]),D=q?.length??0;return H1.useImperativeHandle(H,()=>Q.current),!W||!q||D===0?f1.jsx("div",{...ma(Y,0,$),...J,children:f1.jsx("div",{...ga(0,0,0,0),children:f1.jsx(ua,{CategoryHeader:z,Emoji:G,Row:U})})}):f1.jsx("div",{...ma(Y,W,$),...J,ref:X,children:f1.jsxs("div",{...ga(W,D,K,N),children:[f1.jsx(ua,{CategoryHeader:z,Emoji:G,Row:U}),Array.from({length:F-K+1},(A,V)=>{let L=K+V,O=q.indexOf(L);return f1.jsxs(H1.Fragment,{children:[O>=0&&f1.jsx("div",{style:{height:"var(--frimousse-category-header-height)"}}),f1.jsx(wF0,{Emoji:G,Row:U,rowIndex:L})]},L)}),Array.from({length:D},(A,V)=>f1.jsx(SF0,{CategoryHeader:z,categoryIndex:V},V))]})})}),zo=H1.forwardRef(({emoji:$,onClick:Z,"aria-label":J="Change skin tone",...H},B)=>{let Q=H8(),X=M8(Q,NF0,XO),[z,G,U]=ta($),Y=H1.useMemo(()=>Math.max(0,U.findIndex((D)=>D.skinTone===z)),[z,U]),K=U[Y],F=U[(Y+1)%U.length].skinTone,W=z==="none"?void 0:X?.[z],q=F==="none"?void 0:X?.[F],N=H1.useCallback((D)=>{Z?.(D),D.isDefaultPrevented()||G(F)},[Z,G,F]);return f1.jsx("button",{type:"button",...H,"aria-label":J+(q?` (${q})`:""),"aria-live":"polite","aria-valuetext":W,"frimousse-skin-tone-selector":"",onClick:N,ref:B,children:K.emoji})});function Go({children:$,...Z}){let J=H8();return M8(J,FF0)?f1.jsx("span",{"frimousse-loading":"",...Z,children:$}):null}function yF0({children:$}){let Z=H8(),J=M8(Z,YF0);return $({search:J})}function Uo({children:$,...Z}){let J=H8();return M8(J,KF0)?f1.jsx("span",{"frimousse-empty":"",...Z,children:typeof $=="function"?f1.jsx(yF0,{children:$}):$}):null}function Yo({children:$}){let Z=sa();return $({emoji:Z})}function Ko({children:$,emoji:Z}){let[J,H,B]=ta(Z);return $({skinTone:J,setSkinTone:H,skinToneVariations:B})}ea.displayName="EmojiPicker.Root";$o.displayName="EmojiPicker.Search";Zo.displayName="EmojiPicker.Viewport";Xo.displayName="EmojiPicker.List";Go.displayName="EmojiPicker.Loading";Uo.displayName="EmojiPicker.Empty";zo.displayName="EmojiPicker.SkinToneSelector";Yo.displayName="EmojiPicker.ActiveEmoji";Ko.displayName="EmojiPicker.SkinTone";var dX={};I5(dX,{Root:()=>Do,Indicator:()=>Vo});var V9=P(m(),1);function Fo($){if(!$)return null;for(let Z of $.elements){let J=Z.tagName;if(J==="BUTTON"||J==="INPUT"){let H=Z;if(H.type==="submit")return H}}return null}var Wo="data-checked",qo="data-unchecked";function uq($){return{checked(Z){if($.indeterminate)return{};if(Z)return{[Wo]:""};return{[qo]:""}},...k2}}var pq=P(m(),1),hF0=pq.createContext(void 0);function No(){return pq.useContext(hF0)}var cq=P(m(),1),zO=cq.createContext(void 0);function Ao(){let $=cq.useContext(zO);if($===void 0)throw Error(I0(14));return $}var cX=P(c(),1),vF0="data-parent",Do=V9.forwardRef(function(Z,J){let{checked:H,className:B,defaultChecked:Q=!1,"aria-labelledby":X,disabled:z=!1,form:G,id:U,indeterminate:Y=!1,inputRef:K,name:F,onCheckedChange:W,parent:q=!1,readOnly:N=!1,render:D,required:A=!1,uncheckedValue:V,value:L,nativeButton:O=!1,style:M,..._}=Z,{clearErrors:w}=K4(),{disabled:C,name:E,setDirty:j,setFilled:k,setFocused:S,setTouched:I,state:T,validationMode:y,validityData:R,validation:x}=o5(),v=TJ(),{labelId:f,registerControlId:b,getDescriptionProps:l}=n5(),r=No(),h=r?.allValues===void 0?void 0:r.parent,d=h!==void 0,o=C||v.disabled||r?.disabled||z,p=E??F,i=L??p,n=s0(),Z0=r?.registerControlId!==b,J0=p6({id:U||void 0,enabled:Z0}),U0=O?J0:n,z0={};if(d){if(q)z0=h.getParentProps();else if(i!==void 0)z0=h.getChildProps(i)}let{checked:X0=H,indeterminate:q0=Y,onCheckedChange:N0,...F0}=z0,s=r?.value,a=V9.useRef(null),{getButtonProps:$0,buttonRef:t}=w5({disabled:o,native:O}),B0=r?.validation??x,[_0,P0]=F4({controlled:i!==void 0&&s!==void 0&&!q?s.includes(i):X0,default:Q,name:"Checkbox",state:"checked"}),A0=d?Boolean(X0):_0,L0=d?q0||Y:Y;u6(a,n,_0,void 0,!r&&!o,F);let g=h?.registerChildId,u=V9.useRef(null),e=B0.registerInput,W0=r?i:void 0,S0=V9.useCallback((k0)=>e(k0,{controlRef:a,value:W0}),[e,W0]),h0=p2(K,u,q?void 0:S0),v0=Mq(X,f,u,!O,J0);H0(()=>{if(u.current)u.current.indeterminate=L0;if(!r)k(_0)},[_0,L0,r,k]),i9(_0,()=>{if(r)return;w(p),j(_0!==R.initialValue),B0.change(_0)});let T0=Y2({checked:_0,disabled:o,form:G,name:q?void 0:p,id:O?void 0:J0,required:A,ref:h0,style:p?dz:n8,tabIndex:-1,type:"checkbox","aria-hidden":!0,onChange(k0){if(k0.nativeEvent.defaultPrevented)return;if(N){k0.preventDefault();return}let S1=k0.currentTarget.checked,K1=w0(K0.none,k0.nativeEvent);if(W?.(S1,K1),K1.isCanceled)return;if(N0?.(S1,K1),K1.isCanceled)return;if(P0(S1),i!==void 0&&r!==void 0&&!q&&!d){let z5=S1?[...r.value,i]:r.value.filter((C0)=>C0!==i);r.setValue(z5,K1)}},onClick(k0){k0.stopPropagation()},onFocus(){a.current?.focus()}},L!==void 0?{value:(r?_0&&L:L)||""}:D1,l,(k0)=>B0.getValidationProps(o,k0));V9.useEffect(()=>{if(!h||i===void 0)return;let k0=h.disabledStatesRef.current;return k0.set(i,o),()=>{k0.delete(i)}},[h,o,i]);let c0=V9.useMemo(()=>({...T,checked:A0,disabled:o,readOnly:N,required:A,indeterminate:L0}),[T,A0,o,N,A,L0]),G1=uq(c0),A1=G0("span",Z,{state:c0,ref:[t,a,J],props:[{id:U0,role:"checkbox","aria-checked":L0?"mixed":A0,"aria-readonly":N||void 0,"aria-required":A||void 0,"aria-labelledby":v0,[vF0]:q?"":void 0,onFocus(){if(!o)S(!0)},onBlur(){let k0=u.current;if(!k0)return;if(I(!0),S(!1),y==="onBlur")B0.commit(r?s:k0.checked)},onKeyDown(k0){if(k0.key!=="Enter")return;if(k0.preventBaseUIHandler(),k0.defaultPrevented)return;let S1=u.current?.form??null,K1=k0.currentTarget,z5=k0.nativeEvent,C0=k0.preventDefault,p0=z5.preventDefault,r0=!1;k0.preventDefault=()=>{r0=!0,C0.call(k0)},z5.preventDefault=()=>{r0=!0,p0.call(z5)},p0.call(z5),I1(K1).queueMicrotask(()=>{if(k0.preventDefault=C0,z5.preventDefault=p0,!r0)Fo(S1)?.click()})},onClick(k0){if(N||o)return;k0.preventDefault();let S1=u.current;if(!S1)return;ZH(S1,k0)}},_,F0,$0,l,(k0)=>B0.getValidationProps(o,k0)],stateAttributesMapping:G1}),d0=A1.props.id;return H0(()=>{if(!g||q||i===void 0||d0===void 0)return;return g(i,d0)},[g,q,i,d0]),cX.jsxs(zO.Provider,{value:c0,children:[A1,!_0&&!r&&p&&!q&&V!==void 0&&cX.jsx("input",{type:"hidden",form:G,name:p,value:V,disabled:o}),cX.jsx("input",{...T0,suppressHydrationWarning:!0})]})});var dq=P(m(),1);var Vo=dq.forwardRef(function(Z,J){let{render:H,className:B,style:Q,keepMounted:X=!1,...z}=Z,G=Ao(),U=G.checked||G.indeterminate,{mounted:Y,transitionStatus:K,setMounted:F}=S2(U),W=dq.useRef(null),q={...G,transitionStatus:K};V5({batch:!0,enabled:!U,open:U,ref:W,onComplete(){if(!U)F(!1)}});let D={...uq(G),...G2},A=X||Y,V=G0("span",Z,{ref:[J,W],state:q,stateAttributesMapping:D,props:z});if(!A)return null;return V});var lq=P(c(),1);function Lo({className:$,...Z}){return lq.jsx(dX.Root,{"data-slot":"checkbox",className:i0('peer relative flex size-4 shrink-0 items-center justify-center rounded-[4px] border transition-colors outline-none after:absolute after:-inset-x-3 after:-inset-y-2 focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 aria-invalid:aria-checked:border-primary dark:bg-input/30 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 data-checked:border-primary data-checked:bg-primary data-checked:text-primary-foreground [:where([class~="group/field"]):has(:disabled)_&]:opacity-50 [:where([class~="group/field-label"]):has(:focus-visible)_&]:not-data-checked:border-border [:where([class~="group/field-label"]):has(:focus-visible)_&]:data-checked:border-primary [:where([class~="group/field-label"]:has(:focus-visible))_&]:ring-0',$),...Z,children:lq.jsx(dX.Indicator,{"data-slot":"checkbox-indicator",className:"grid place-content-center text-current transition-none [&>svg]:size-3.5",children:lq.jsx(g8,{stroke:2})})})}var KZ={};I5(KZ,{Tab:()=>Oo,Root:()=>_o,Panel:()=>ho,List:()=>uo,Indicator:()=>yo});var z2=P(m(),1);var iq=P(m(),1),GO=iq.createContext(void 0);function k7(){let $=iq.useContext(GO);if($===void 0)throw Error(I0(64));return $}var Mo="data-activation-direction";var D3={tabActivationDirection:($)=>({[Mo]:$})};var UO=P(c(),1),_o=z2.forwardRef(function(Z,J){let{className:H,defaultValue:B=0,onValueChange:Q,orientation:X="horizontal",render:z,value:G,style:U,...Y}=Z,K=Z.defaultValue!==void 0,F=z2.useRef([]),[W,q]=z2.useState(()=>new Map),[N,D]=F4({controlled:G,default:B,name:"Tabs",state:"value"}),A=G!==void 0,[V,L]=z2.useState(()=>new Map),O=z2.useRef(void 0),M=z2.useCallback((n)=>YO(V,n),[V]),[_,w]=z2.useState(()=>({previousValue:N,tabActivationDirection:"none"})),{previousValue:C,tabActivationDirection:E}=_,j=E,k=!1;if(C!==N)j=Po(C,N,X,V),k=C!=null&&N!=null&&M(N)==null;let S=k?C:N,I=C!==S||E!==j;H0(()=>{if(!I)return;w({previousValue:S,tabActivationDirection:j})},[S,I,j]);let T=Y0((n,Z0)=>{let J0=Po(N,n,X,V);if(Z0.activationDirection=J0,Q?.(n,Z0),Z0.isCanceled)return;D(n)}),y=Y0((n,Z0)=>{Q?.(n,w0(Z0,void 0,void 0,{activationDirection:"none"}))}),R=Y0((n,Z0)=>{return q((J0)=>{let U0=new Map(J0);return U0.set(n,Z0),U0}),()=>{q((J0)=>{if(J0.get(n)!==Z0)return J0;let U0=new Map(J0);return U0.delete(n),U0})}}),x=z2.useCallback((n)=>{return W.get(n)},[W]),v=z2.useCallback((n)=>{for(let Z0 of V.values())if(n===Z0.value)return Z0.id;return},[V]),f=z2.useMemo(()=>({getTabElementBySelectedValue:M,getTabIdByPanelValue:v,getTabPanelIdByValue:x,onValueChange:T,orientation:X,registerMountedTabPanel:R,setTabMap:L,tabActivationDirection:j,value:N}),[M,v,x,T,X,R,L,j,N]),b=z2.useMemo(()=>{for(let n of V.values())if(n.value===N)return n;return},[V,N]),l=z2.useMemo(()=>{for(let n of V.values())if(!n.disabled)return n.value;return},[V]),r=z2.useRef(!K),h=z2.useRef(B),d=z2.useRef(K),o=z2.useRef(!1);H0(()=>{if(A)return;function n(z0,X0){D(z0),w({previousValue:z0,tabActivationDirection:"none"}),y(z0,X0),r.current=!1}if(V.size===0){if(o.current&&N!==null&&!O.current?.isConnected)n(null,K0.missing);return}o.current=!0,O.current=V.keys().next().value;let Z0=b?.disabled,J0=b==null&&N!==null;if(!Z0&&N===h.current)d.current=!1;if(d.current&&Z0&&N===h.current)return;let U0=r.current;if(Z0||J0){let z0=l??null;if(N===z0){r.current=!1;return}let X0=K0.missing;if(U0)X0=K0.initial;else if(Z0)X0=K0.disabled;n(z0,X0);return}if(U0&&b!=null)y(N,K0.initial),r.current=!1},[l,A,y,b,D,V,N]);let i=G0("div",Z,{state:{orientation:X,tabActivationDirection:j},ref:J,props:Y,stateAttributesMapping:D3});return UO.jsx(GO.Provider,{value:f,children:UO.jsx(q7,{elementsRef:F,children:i})})});function YO($,Z){for(let[J,H]of $.entries())if(Z===H.value)return J;return null}function Po($,Z,J,H){if($==null||Z==null)return"none";let[B,Q,X]=J==="horizontal"?["left","left","right"]:["top","up","down"],z=YO(H,$),G=YO(H,Z);if(z==null||G==null){if(z!==G&&(typeof $==="number"||typeof $==="string")&&typeof $===typeof Z)return Z>$?X:Q;return"none"}let U=z.getBoundingClientRect()[B],Y=G.getBoundingClientRect()[B];if(Y<U)return Q;if(Y>U)return X;return"none"}var s3=P(m(),1);var lX="data-composite-item-active";var rq=P(m(),1),KO=rq.createContext(void 0);function aq(){let $=rq.useContext(KO);if($===void 0)throw Error(I0(65));return $}var Oo=s3.forwardRef(function(Z,J){let{className:H,disabled:B=!1,render:Q,value:X,id:z,nativeButton:G=!0,style:U,...Y}=Z,{value:K,getTabPanelIdByValue:F,onValueChange:W,orientation:q,tabActivationDirection:N}=k7(),{activateOnFocus:D,registerTabResizeObserverElement:A,tabsListElement:V}=aq(),{highlightedIndex:L,onHighlightedIndexChange:O}=BH(),M=s0(z),_=s3.useMemo(()=>({disabled:B,id:M,value:X}),[B,M,X]),{compositeProps:w,compositeRef:C,index:E}=wF({metadata:_}),j=X===K,k=s3.useRef(!1),S=s3.useRef(null),I=Y0((o)=>{S.current?.(),S.current=o?A(o):null});H0(()=>{if(k.current){k.current=!1;return}if(!(j&&E>-1&&L!==E))return;let o=V;if(o!=null){let p=l1(m0(o));if(p&&R0(o,p))return}if(!B)O(E)},[j,E,L,O,B,V]);let{getButtonProps:T,buttonRef:y}=w5({disabled:B,native:G,focusableWhenDisabled:!0}),R=F(X),x=s3.useRef(!1),v=s3.useRef(!1);function f(o){W(X,w0(K0.none,o.nativeEvent,void 0,{activationDirection:"none"}))}function b(o){if(j||B)return;f(o)}function l(o){if(j||B)return;if(D&&(!x.current||v.current))f(o)}function r(o){if(j||B)return;x.current=!0,v.current=o.button===0;let p=m0(o.currentTarget);function i(){x.current=!1,v.current=!1,p.removeEventListener("pointerup",i),p.removeEventListener("pointercancel",i)}p.addEventListener("pointerup",i),p.addEventListener("pointercancel",i)}return G0("button",Z,{state:{disabled:B,active:j,orientation:q,tabActivationDirection:N},ref:[J,y,C,I],props:[w,{role:"tab","aria-controls":R,"aria-selected":j,id:M,onClick:b,onFocus:l,onPointerDown:r,[lX]:j?"":void 0,onKeyDownCapture(){k.current=!0}},Y,T],stateAttributesMapping:D3})});var cH=P(m(),1);var jo="--active-tab-left",To="--active-tab-right",Co="--active-tab-top",Eo="--active-tab-bottom",bo="--active-tab-width",wo="--active-tab-height";var oq=P(c(),1),So,mF0={...D3,activeTabPosition:()=>null,activeTabSize:()=>null},Ro=2,yo=cH.forwardRef(function(Z,J){let{className:H,render:B,renderBeforeHydration:Q=!1,style:X,...z}=Z,{getTabElementBySelectedValue:G,orientation:U,tabActivationDirection:Y,value:K}=k7(),{tabsListElement:F,registerIndicatorUpdateListener:W}=aq(),q=YT();cH.useEffect(()=>{return W(q)},[W,q]);let N=0,D=0,A=0,V=0,L=0,O=0,M=!1;if(K!=null&&F!=null){let S=G(K);if(S!=null){M=!0;let{width:I,height:T}=rZ(S),{width:y,height:R}=rZ(F),x=S.getBoundingClientRect(),v=F.getBoundingClientRect(),f=y>0?v.width/y:1,b=R>0?v.height/R:1,l=uF0(S,F);N=l.left,A=l.top;let r=(x.left-v.left)/f+F.scrollLeft-F.clientLeft,h=(x.top-v.top)/b+F.scrollTop-F.clientTop,d=pF0(S);if(Math.abs(r-d.x-N)<=Ro&&Math.abs(h-d.y-A)<=Ro)N=r,A=h;L=I,O=T,D=F.scrollWidth-N-L,V=F.scrollHeight-A-O}}let _=M?{left:N,right:D,top:A,bottom:V}:null,w=M?{width:L,height:O}:null,C=M?{[jo]:`${N}px`,[To]:`${D}px`,[Co]:`${A}px`,[Eo]:`${V}px`,[bo]:`${L}px`,[wo]:`${O}px`}:void 0,E=M&&L>0&&O>0,k=G0("span",Z,{state:{orientation:U,activeTabPosition:_,activeTabSize:w,tabActivationDirection:Y},ref:J,props:[{role:"presentation",style:C,hidden:!E},z,{suppressHydrationWarning:!0}],stateAttributesMapping:mF0});if(K==null)return null;return oq.jsxs(cH.Fragment,{children:[k,Q&&(So||(So=oq.jsx(pF,{script:mF})))]})});function uF0($,Z){let J=Io($),H=Io(Z),B=J.left-H.left-Z.clientLeft,Q=J.top-H.top-Z.clientTop,X=S8($);while(L1(X)&&X!==Z&&!w8(X))B-=X.scrollLeft,Q-=X.scrollTop,X=S8(X);return{left:B,top:Q}}function Io($){let Z=0,J=0,H=$;while(H!=null){Z+=H.offsetLeft,J+=H.offsetTop;let B=H.offsetParent;if(B!=null)Z+=B.clientLeft,J+=B.clientTop;H=B}return{left:Z,top:J}}function pF0($){let Z=I1($).getComputedStyle($),{x:J,y:H}=oz($,Z),B=J,Q=H,{translate:X}=Z;if(X&&X!=="none"){let z=X.split(" ");B+=ko(z[0],$.offsetWidth),Q+=ko(z[1],$.offsetHeight)}return{x:B,y:Q}}function ko($,Z){if(!$)return 0;let J=parseFloat($);if(!Number.isFinite(J))return 0;return $.endsWith("%")?J/100*Z:J}var nq=P(m(),1);var xo="data-index";var nj1=X8.startingStyle,sj1=X8.endingStyle;var dF0={...D3,...G2},ho=nq.forwardRef(function(Z,J){let{className:H,value:B,render:Q,keepMounted:X=!1,style:z,...G}=Z,{value:U,getTabIdByPanelValue:Y,orientation:K,tabActivationDirection:F,registerMountedTabPanel:W}=k7(),q=s0(),{ref:N,index:D}=A4(),A=B===U,{mounted:V,transitionStatus:L,setMounted:O}=S2(A),M=!V,_=Y(B),w={hidden:M,orientation:K,tabActivationDirection:F,transitionStatus:L},C=nq.useRef(null),E=G0("div",Z,{state:w,ref:[J,N,C],props:[{"aria-labelledby":_,hidden:M,id:q,role:"tabpanel",tabIndex:A?0:-1,inert:b8(!A),[xo]:D},G],stateAttributesMapping:dF0});if(V5({open:A,ref:C,onComplete(){if(!A)O(!1)}}),H0(()=>{if(q==null||M&&!X)return;return W(B,q)},[M,X,B,q,W]),!(X||V))return null;return E});var L9=P(m(),1);var go=P(m(),1);var YZ=P(m(),1);function vo($){let{loopFocus:Z=!0,orientation:J="both",grid:H,onLoop:B,direction:Q,highlightedIndex:X,onHighlightedIndexChange:z,rootRef:G,enableHomeAndEndKeys:U=!1,stopEventPropagation:Y,disabledIndices:K,modifierKeys:F=Z4}=$,[W,q]=YZ.useState(0),N=H!=null,D=YZ.useRef(null),A=p2(D,G),V=YZ.useRef([]),L=YZ.useRef(!1),O=YZ.useRef(null),M=X??W,_=Y0((k,S=!1)=>{if(O.current=V.current[k]??null,(z??q)(k),S){let I=V.current[k];xD(D.current,I,Q,J)}}),w=Y0((k)=>{if(k.size===0)return;if(L.current){let y=V.current,R=y.indexOf(O.current);if(R===-1){let x=y[M];if(!x||j3(y,M,K))_(lF0(y,K));else O.current=x}else if(R!==M)_(R);return}L.current=!0;let S=Array.from(k.keys()),I=S.find((y)=>y?.hasAttribute(lX))??null,T=I?k.get(I)?.index??-1:-1;if(T!==-1)_(T);else if(j3(S,M,K)){let y=C8(S,{disabledIndices:K});if(!F6(S,y))_(y)}xD(D.current,I,Q,J)});H0(()=>{if(K==null||X!=null||!L.current)return;let k=V.current;if(j3(k,M,K)){let S=C8(k,{disabledIndices:K});if(!F6(k,S))_(S)}},[K,X,M,V,_]);let C=Y0((k,S,I)=>{if(!B)return I;return B(k,S,I,V)}),E=Y0((k)=>{let S=k.key===zJ||k.key===GJ;if(!B9.has(k.key)||!U&&S)return;if(iF0(k,F))return;if(!D.current)return;let T=Q==="rtl",y=T?QJ:XJ,R=T?XJ:QJ,x=J==="vertical"?BJ:y,v=J==="vertical"?HJ:R,f=V1(k.nativeEvent);if(f!=null&&yD(f)&&!Pg(f)){let{selectionStart:o,selectionEnd:p,value:i}=f;if(o==null||k.shiftKey||o!==p)return;if(k.key!==v&&o<i.length)return;if(k.key!==x&&o>0)return}let b=M,l=J$(V,K),r=yZ(V,K);if(H!=null)b=H({disabledIndices:K,elementsRef:V,event:k,highlightedIndex:M,loopFocus:Z,maxIndex:r,minIndex:l,onLoop:C,orientation:J,rtl:T});let h=J!=="vertical"&&k.key===y||J!=="horizontal"&&k.key===BJ,d=J!=="vertical"&&k.key===R||J!=="horizontal"&&k.key===HJ;if(U){if(k.key===zJ)b=l;else if(k.key===GJ)b=r}if(b===M&&(h||d))if(Z&&b===r&&h){if(b=l,B)b=B(k,M,b,V)}else if(Z&&b===l&&d){if(b=r,B)b=B(k,M,b,V)}else b=C8(V.current,{startingIndex:b,decrement:d,disabledIndices:K});if(b!==M&&!F6(V.current,b)){if(Y)k.stopPropagation();if(N||S||h||d)k.preventDefault();_(b,!0),queueMicrotask(()=>{V.current[b]?.focus()})}});return{props:{ref:A,onFocus(k){let S=D.current,I=V1(k.nativeEvent);if(!S||I==null||!yD(I))return;I.setSelectionRange(0,I.value.length)},onKeyDown:E},highlightedIndex:M,onHighlightedIndexChange:_,elementsRef:V,onMapChange:w,relayKeyboardEvent:E}}function lF0($,Z){let J=-1;for(let H=0;H<$.length;H+=1){let B=$[H];if(!B||j3($,H,Z))continue;if(B.hasAttribute(lX))return H;if(J===-1)J=H}return Math.max(J,0)}function iF0($,Z){for(let J of Tw){if(Z.includes(J))continue;if($.getModifierState(J))return!0}return!1}var FO=P(c(),1);function mo($){let{render:Z,className:J,style:H,refs:B=Z4,props:Q=Z4,state:X=D1,stateAttributesMapping:z,highlightedIndex:G,onHighlightedIndexChange:U,orientation:Y,grid:K,loopFocus:F,onLoop:W,enableHomeAndEndKeys:q,onMapChange:N,stopEventPropagation:D=!0,rootRef:A,disabledIndices:V,modifierKeys:L,highlightItemOnHover:O=!1,tag:M="div",..._}=$,w=i4(),{props:C,highlightedIndex:E,onHighlightedIndexChange:j,elementsRef:k,onMapChange:S,relayKeyboardEvent:I}=vo({grid:K,loopFocus:F,onLoop:W,orientation:Y,highlightedIndex:G,onHighlightedIndexChange:U,rootRef:A,stopEventPropagation:D,enableHomeAndEndKeys:q,direction:w,disabledIndices:V,modifierKeys:L}),T=G0(M,$,{state:X,ref:B,props:[C,...Q,_],stateAttributesMapping:z}),y=go.useMemo(()=>({highlightedIndex:E,onHighlightedIndexChange:j,highlightItemOnHover:O,relayKeyboardEvent:I}),[E,j,O,I]);return FO.jsx(fo.Provider,{value:y,children:FO.jsx(q7,{elementsRef:k,onMapChange:(R)=>{N?.(R),S(R)},children:T})})}var WO=P(c(),1),uo=L9.forwardRef(function(Z,J){let{activateOnFocus:H=!1,className:B,loopFocus:Q=!0,render:X,style:z,...G}=Z,{orientation:U,setTabMap:Y,tabActivationDirection:K}=k7(),[F,W]=L9.useState(0),[q,N]=L9.useState(null),D=L9.useRef(new Set),A=L9.useRef(new Set),V=L9.useRef(null);H0(()=>{if(typeof ResizeObserver>"u")return;let C=new ResizeObserver(()=>{D.current.forEach((E)=>{E()})});if(V.current=C,q)C.observe(q);return A.current.forEach((E)=>{C.observe(E)}),()=>{C.disconnect(),V.current=null}},[q]);let L=Y0((C)=>{return D.current.add(C),()=>{D.current.delete(C)}}),O=Y0((C)=>{return A.current.add(C),V.current?.observe(C),()=>{A.current.delete(C),V.current?.unobserve(C)}}),M={orientation:U,tabActivationDirection:K},_={"aria-orientation":U==="vertical"?"vertical":void 0,role:"tablist"},w=L9.useMemo(()=>({activateOnFocus:H,registerIndicatorUpdateListener:L,registerTabResizeObserverElement:O,tabsListElement:q}),[H,L,O,q]);return WO.jsx(KO.Provider,{value:w,children:WO.jsx(mo,{render:X,className:B,style:z,state:M,refs:[J,N],props:[_,G],stateAttributesMapping:D3,highlightedIndex:F,enableHomeAndEndKeys:!0,loopFocus:Q,orientation:U,onHighlightedIndexChange:W,onMapChange:Y,disabledIndices:Z4})})});var iX=P(c(),1);function po({className:$,orientation:Z="horizontal",...J}){return iX.jsx(KZ.Root,{"data-slot":"tabs","data-orientation":Z,orientation:Z,className:i0("group/tabs flex gap-2 data-horizontal:flex-col",$),...J})}var rF0=AJ("group/tabs-list inline-flex w-fit items-center justify-center rounded-lg p-[3px] text-muted-foreground group-data-horizontal/tabs:h-8 group-data-vertical/tabs:h-fit group-data-vertical/tabs:flex-col data-[variant=line]:rounded-none",{variants:{variant:{default:"bg-accent",line:"gap-1 bg-transparent"}},defaultVariants:{variant:"default"}});function co({className:$,variant:Z="default",...J}){return iX.jsx(KZ.List,{"data-slot":"tabs-list","data-variant":Z,className:i0(rF0({variant:Z}),$),...J})}function sq({className:$,...Z}){return iX.jsx(KZ.Tab,{"data-slot":"tabs-trigger",className:i0("relative inline-flex h-[calc(100%-1px)] flex-1 items-center justify-center gap-1.5 rounded-md border border-transparent px-1.5 py-0.5 text-sm font-medium whitespace-nowrap text-muted-foreground transition-all group-data-vertical/tabs:w-full group-data-vertical/tabs:justify-start hover:text-foreground focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 focus-visible:outline-1 focus-visible:outline-ring disabled:pointer-events-none disabled:opacity-50 has-data-[icon=inline-end]:pr-1 has-data-[icon=inline-start]:pl-1 aria-disabled:pointer-events-none aria-disabled:opacity-50 group-data-[variant=line]/tabs-list:data-active:shadow-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4","group-data-[variant=line]/tabs-list:bg-transparent group-data-[variant=line]/tabs-list:data-active:bg-transparent","data-active:bg-background data-active:text-foreground data-active:ring-1 data-active:ring-border","after:absolute after:bg-foreground after:opacity-0 after:transition-opacity group-data-horizontal/tabs:after:inset-x-0 group-data-horizontal/tabs:after:bottom-[-5px] group-data-horizontal/tabs:after:h-0.5 group-data-vertical/tabs:after:inset-y-0 group-data-vertical/tabs:after:-right-1 group-data-vertical/tabs:after:w-0.5 group-data-[variant=line]/tabs-list:data-active:after:opacity-100",$),...Z})}function tq({className:$,...Z}){return iX.jsx(KZ.Panel,{"data-slot":"tabs-content",className:i0("flex-1 text-sm outline-none",$),...Z})}var lo=["\uD83D\uDE80","✨","\uD83D\uDD25","⚡","\uD83D\uDCA1","\uD83E\uDDE0","\uD83E\uDD16","\uD83E\uDE84","\uD83E\uDDEA","⚙️","\uD83D\uDEE0️","\uD83D\uDCBB","\uD83D\uDCE6","\uD83D\uDCCA","\uD83D\uDCC8","\uD83D\uDCDD","\uD83D\uDCDA","\uD83C\uDFAF","\uD83C\uDFC6","\uD83D\uDC8E","\uD83E\uDE90","\uD83C\uDF0D","\uD83E\uDDED","\uD83C\uDFA8","\uD83C\uDFAE","☕"],qO="font-[Apple_Color_Emoji,Segoe_UI_Emoji,Noto_Color_Emoji,sans-serif]";var N1=P(c(),1),aF0=32,io=4,oF0=12,to="flex pt-4 pb-2 items-center bg-background px-3 text-xs font-medium text-muted-foreground",eo=f4.createContext(null);function ro($,Z){if(Z)return{...$,background:"theme"};if($.type==="emoji")return{type:"emoji",value:$.value};return{type:"glyph",value:$.value}}function nF0({category:$,className:Z,...J}){return N1.jsx("div",{...J,className:Q0(to,Z),children:$.label})}function ao({className:$,...Z}){return N1.jsx("div",{className:Q0("flex flex-wrap content-start gap-1",$),...Z})}function NO({className:$,selected:Z=!1,...J}){return N1.jsx(M0,{type:"button",variant:"ghost",size:"icon","aria-pressed":Z,className:Q0("shrink-0 data-active:bg-accent",Z&&"bg-accent",$),...J})}function sF0({children:$,className:Z,...J}){return N1.jsx("div",{...J,className:Q0("flex h-8 gap-1 px-1.5",Z),children:$})}function tF0({emoji:$,...Z}){let J=f4.useContext(eo);return N1.jsx(NO,{selected:J===$.emoji,className:qO,...Z,children:N1.jsx("span",{className:"text-xl leading-none",children:$.emoji})})}function $n(){let{layout:$,workspaceId:Z}=b1(),{icon:J}=$,H=Ja(Z),[B,Q]=f4.useState(J?.type??"glyph"),[X,z]=f4.useState(!J||J.type!=="upload"&&J.background==="theme"),G=J?.type==="upload"?void 0:J,[U,Y]=f4.useState(""),[K,F]=f4.useState(13),[W,q]=f4.useState(null),[N,D]=f4.useState(!1),A=f4.useRef(null),V=(M)=>{let _=ro(M,X);H.mutate({kind:"set",icon:_})},L=(M)=>{H.mutate({kind:"upload",file:M})},O=(M)=>{if(z(M),G){let _=ro(G,M);H.mutate({kind:"set",icon:_})}};return f4.useEffect(()=>{if(!W)return;let M=(w)=>{let C=Math.max(1,Math.floor((w-oF0+io)/(aF0+io)));F((E)=>E===C?E:C)};M(W.clientWidth);let _=new ResizeObserver(([w])=>{M(w?.contentRect.width??W.clientWidth)});return _.observe(W),()=>_.disconnect()},[W]),N1.jsxs(po,{value:B,onValueChange:(M)=>Q(M),className:"min-w-0 gap-4",children:[N1.jsxs("div",{className:"flex items-center justify-between gap-4",children:[N1.jsxs(co,{"aria-label":"Icon source",children:[N1.jsx(sq,{value:"glyph",children:"Icon"}),N1.jsx(sq,{value:"emoji",children:"Emoji"}),N1.jsx(sq,{value:"upload",children:"Upload"})]}),J&&N1.jsxs(M0,{type:"button",variant:"ghost",onClick:()=>{z(!0),H.mutate({kind:"reset"})},className:"text-muted-foreground",children:[N1.jsx(oo,{"data-icon":"inline-start",stroke:1.5}),"Reset"]})]}),N1.jsx(tq,{value:"emoji",className:"flex-none",children:N1.jsx(eo,{value:G?.type==="emoji"?G.value:null,children:N1.jsxs(n3.Root,{onEmojiSelect:(M)=>V({type:"emoji",value:M.emoji}),emojibaseUrl:"/vendor/emojibase",columns:K,className:"isolate flex h-72 flex-col overflow-hidden rounded-xl border border-border bg-background",children:[N1.jsxs("div",{className:"flex items-center gap-1.5 p-1.5 pb-0",children:[N1.jsx(n3.Search,{placeholder:"Search emoji",onChange:(M)=>Y(M.target.value),className:"h-8 min-w-0 flex-1 appearance-none rounded-md bg-muted px-2.5 text-sm outline-none placeholder:text-muted-foreground"}),N1.jsx(n3.SkinToneSelector,{className:"size-8 shrink-0 rounded-lg text-lg hover:bg-accent"})]}),N1.jsxs(n3.Viewport,{ref:q,className:"relative scrollbar-thin flex-1 overflow-y-auto outline-none",children:[N1.jsxs(n3.Loading,{className:"absolute inset-0 flex items-center justify-center gap-2 text-xs text-muted-foreground",children:[N1.jsx(d5,{size:16,stroke:1.75,className:"animate-spin"}),"Loading emoji…"]}),U.trim()===""&&N1.jsxs("div",{className:"border-b border-dashed border-border",children:[N1.jsx("p",{className:Q0("sticky top-0",to),children:"Favorites"}),N1.jsx(ao,{className:"px-1.5 pb-1.5",children:lo.map((M)=>N1.jsx(NO,{onClick:()=>V({type:"emoji",value:M}),selected:G?.type==="emoji"&&G.value===M,className:qO,children:N1.jsx("span",{className:"text-xl leading-none",children:M})},M))})]}),N1.jsxs(n3.Empty,{className:"absolute inset-0 flex flex-col items-center justify-center gap-1 text-xs text-muted-foreground",children:[N1.jsx(no,{size:20,stroke:1.5}),"No emoji found"]}),N1.jsx(n3.List,{className:"select-none",components:{CategoryHeader:nF0,Row:sF0,Emoji:tF0}})]})]})})}),N1.jsx(tq,{value:"glyph",className:"scrollbar-thin h-72 overflow-y-auto rounded-xl border border-border bg-background p-1.5",children:N1.jsx(ao,{children:Vk.map(({id:M,Icon:_})=>N1.jsx(NO,{"aria-label":M,onClick:()=>V({type:"glyph",value:M}),selected:G?.type==="glyph"&&G.value===M,className:"text-muted-foreground aria-pressed:text-accent-foreground",children:N1.jsx(_,{stroke:1.75})},M))})}),N1.jsx(tq,{value:"upload",className:"flex-none",children:N1.jsxs("button",{type:"button",onClick:()=>A.current?.click(),onDragOver:(M)=>{M.preventDefault(),D(!0)},onDragLeave:()=>D(!1),onDrop:(M)=>{M.preventDefault(),D(!1);let _=M.dataTransfer.files?.[0];if(_)L(_)},className:Q0("flex h-72 w-full flex-col items-center justify-center gap-2 rounded-xl border border-dashed transition-colors",N?"border-primary bg-primary/5 text-primary":"border-border text-muted-foreground hover:border-muted-foreground/30 hover:text-foreground"),children:[N1.jsx(so,{size:24,stroke:1.5}),N1.jsx("span",{className:"text-xs font-medium",children:"Click or drop an image"}),N1.jsx("span",{className:"text-[11px] text-muted-foreground/70",children:"PNG, JPG, GIF, or WebP"})]})}),B!=="upload"&&N1.jsxs("label",{htmlFor:"workspace-icon-theme-background",className:"flex w-fit cursor-pointer items-center gap-2 text-sm font-medium",children:[N1.jsx(Lo,{id:"workspace-icon-theme-background",checked:X,onCheckedChange:O}),"Use theme background"]}),H.error&&N1.jsx("p",{className:"text-xs text-destructive","aria-live":"polite",children:H.error.message}),N1.jsx("input",{ref:A,type:"file",accept:"image/png,image/jpeg,image/gif,image/webp",className:"hidden",onChange:(M)=>{let _=M.target.files?.[0];if(_)L(_);M.target.value=""}})]})}var y7=P(c(),1);function Zn(){let{layout:$,name:Z,provider:J,workspaceId:H}=b1(),B=Z??"Workspace",Q=Za(H),[X,z]=eq.useState(B);eq.useEffect(()=>z(B),[B]);function G(U){let Y=U.trim();if(z(Y),Y!==B)Q.mutate(Y===""?null:Y)}return y7.jsx(BK,{name:X,icon:$.icon,workspaceType:J,workspaceTheme:$.theme,onNameChange:z,onNameCommit:G,renderIcon:(U)=>y7.jsxs(C6,{children:[y7.jsx(E6,{render:y7.jsx("button",{type:"button","aria-label":"Change workspace icon",className:"group inline-flex size-10 shrink-0 cursor-pointer items-center justify-center rounded-lg p-0 outline-none focus-visible:ring-3 focus-visible:ring-ring/50",children:U})}),y7.jsx(b6,{align:"start",sideOffset:8,className:"w-[min(32rem,calc(100vw-2rem))] gap-4 rounded-2xl p-6",children:y7.jsx($n,{})})]})})}var Zz=P(m(),1);function h7($){let{margin:Z,containerPadding:J,containerWidth:H,cols:B}=$;return(H-Z[0]*(B-1)-J[0]*2)/B}function M9($,Z,J){if(!Number.isFinite($))return $;return Math.round(Z*$+Math.max(0,$-1)*J)}function aX($,Z,J,H,B,Q,X){let{margin:z,containerPadding:G,rowHeight:U}=$,Y=h7($),K,F,W,q;if(X)K=Math.round(X.width),F=Math.round(X.height);else K=M9(H,Y,z[0]),F=M9(B,U,z[1]);if(Q)W=Math.round(Q.top),q=Math.round(Q.left);else if(X)W=Math.round(X.top),q=Math.round(X.left);else W=Math.round((U+z[1])*J+G[1]),q=Math.round((Y+z[0])*Z+G[0]);if(!Q&&!X){if(Number.isFinite(H)){let D=Math.round((Y+z[0])*(Z+H)+G[0])-q-K;if(D!==z[0])K+=D-z[0]}if(Number.isFinite(B)){let D=Math.round((U+z[1])*(J+B)+G[1])-W-F;if(D!==z[1])F+=D-z[1]}}return{top:W,left:q,width:K,height:F}}function Hn($,Z,J,H,B){let{margin:Q,containerPadding:X,cols:z,rowHeight:G,maxRows:U}=$,Y=h7($),K=Math.round((J-X[0])/(Y+Q[0])),F=Math.round((Z-X[1])/(G+Q[1]));return K=rX(K,0,z-H),F=rX(F,0,U-B),{x:K,y:F}}function oX($,Z,J){let{margin:H,containerPadding:B,rowHeight:Q}=$,X=h7($),z=Math.round((J-B[0])/(X+H[0])),G=Math.round((Z-B[1])/(Q+H[1]));return{x:z,y:G}}function Bn($,Z,J){let{margin:H,rowHeight:B}=$,Q=h7($),X=Math.max(1,Math.round((Z+H[0])/(Q+H[0]))),z=Math.max(1,Math.round((J+H[1])/(B+H[1])));return{w:X,h:z}}function rX($,Z,J){return Math.max(Math.min($,J),Z)}function ZN($,Z){if($.i===Z.i)return!1;if($.x+$.w<=Z.x)return!1;if($.x>=Z.x+Z.w)return!1;if($.y+$.h<=Z.y)return!1;if($.y>=Z.y+Z.h)return!1;return!0}function v7($,Z){for(let J=0;J<$.length;J++){let H=$[J];if(H!==void 0&&ZN(H,Z))return H}return}function AO($,Z){return $.filter((J)=>ZN(J,Z))}function eF0($,Z){if(Z==="horizontal")return DO($);if(Z==="vertical")return $N($);if(Z==="wrap")return $N($);return[...$]}function $N($){return[...$].sort((Z,J)=>{if(Z.y!==J.y)return Z.y-J.y;return Z.x-J.x})}function DO($){return[...$].sort((Z,J)=>{if(Z.x!==J.x)return Z.x-J.x;return Z.y-J.y})}function nX($){let Z=0;for(let J=0;J<$.length;J++){let H=$[J];if(H!==void 0){let B=H.y+H.h;if(B>Z)Z=B}}return Z}function f7($,Z){for(let J=0;J<$.length;J++){let H=$[J];if(H!==void 0&&H.i===Z)return H}return}function sX($){return $.filter((Z)=>Z.static===!0)}function t3($){return{i:$.i,x:$.x,y:$.y,w:$.w,h:$.h,minW:$.minW,maxW:$.maxW,minH:$.minH,maxH:$.maxH,moved:Boolean($.moved),static:Boolean($.static),isDraggable:$.isDraggable,isResizable:$.isResizable,resizeHandles:$.resizeHandles,constraints:$.constraints,isBounded:$.isBounded}}function dH($){let Z=Array($.length);for(let J=0;J<$.length;J++){let H=$[J];if(H!==void 0)Z[J]=t3(H)}return Z}function $W0($,Z){let J=Array($.length);for(let H=0;H<$.length;H++){let B=$[H];if(B!==void 0)if(Z.i===B.i)J[H]=Z;else J[H]=B}return J}function Qn($,Z,J){let H=f7($,Z);if(!H)return[[...$],null];return H=J(t3(H)),[$W0($,H),H]}function VO($,Z){let J=sX($);for(let H=0;H<$.length;H++){let B=$[H];if(B===void 0)continue;if(B.x+B.w>Z.cols)B.x=Z.cols-B.w;if(B.x<0)B.x=0,B.w=Z.cols;if(!B.static)J.push(B);else while(v7(J,B))B.y++}return $}function x7($,Z,J,H,B,Q,X,z,G){if(Z.static&&Z.isDraggable!==!0)return[...$];if(Z.y===H&&Z.x===J)return[...$];let{x:U,y:Y}=Z;if(typeof J==="number")Z.x=J;if(typeof H==="number")Z.y=H;Z.moved=!0;let K=eF0($,X);if(X==="vertical"&&typeof H==="number"?Y>=H:X==="horizontal"&&typeof J==="number"?U>=J:!1)K=K.reverse();let W=AO(K,Z),q=W.length>0;if(q&&G)return dH($);if(q&&Q)return Z.x=U,Z.y=Y,Z.moved=!1,$;let N=[...$];for(let D=0;D<W.length;D++){let A=W[D];if(A===void 0)continue;if(A.moved)continue;if(A.static)N=Jn(N,A,Z,B,X);else N=Jn(N,Z,A,B,X)}return N}function Jn($,Z,J,H,B,Q){let X=B==="horizontal",z=B==="vertical",G=Z.static;if(H){H=!1;let K={x:X?Math.max(Z.x-J.w,0):J.x,y:z?Math.max(Z.y-J.h,0):J.y,w:J.w,h:J.h,i:"-1"},F=v7($,K),W=F!==void 0&&F.y+F.h>Z.y,q=F!==void 0&&Z.x+Z.w>F.x;if(!F)return x7($,J,X?K.x:void 0,z?K.y:void 0,H,G,B);if(W&&z)return x7($,J,void 0,J.y+1,H,G,B);if(W&&B===null)return Z.y=J.y,J.y=J.y+J.h,[...$];if(q&&X)return x7($,Z,J.x,void 0,H,G,B)}let U=X?J.x+1:void 0,Y=z?J.y+1:void 0;if(U===void 0&&Y===void 0)return[...$];return x7($,J,U,Y,H,G,B)}function lH($,Z,J){return Math.max(Z,Math.min(J,$))}var ZW0={name:"gridBounds",constrainPosition($,Z,J,{cols:H,maxRows:B}){return{x:lH(Z,0,Math.max(0,H-$.w)),y:lH(J,0,Math.max(0,B-$.h))}},constrainSize($,Z,J,H,{cols:B,maxRows:Q}){let X=H==="w"||H==="nw"||H==="sw"?$.x+$.w:B-$.x,z=H==="n"||H==="nw"||H==="ne"?$.y+$.h:Q-$.y;return{w:lH(Z,1,Math.max(1,X)),h:lH(J,1,Math.max(1,z))}}},JW0={name:"minMaxSize",constrainSize($,Z,J){return{w:lH(Z,$.minW??1,$.maxW??1/0),h:lH(J,$.minH??1,$.maxH??1/0)}}};var LO=[ZW0,JW0];function tX($,Z,J,H,B){let Q={x:J,y:H};for(let X of $)if(X.constrainPosition)Q=X.constrainPosition(Z,Q.x,Q.y,B);if(Z.constraints){for(let X of Z.constraints)if(X.constrainPosition)Q=X.constrainPosition(Z,Q.x,Q.y,B)}return Q}function Xn($,Z,J,H,B,Q){let X={w:J,h:H};for(let z of $)if(z.constrainSize)X=z.constrainSize(Z,X.w,X.h,B,Q);if(Z.constraints){for(let z of Z.constraints)if(z.constrainSize)X=z.constrainSize(Z,X.w,X.h,B,Q)}return X}function HN({top:$,left:Z,width:J,height:H}){let B=`translate(${Z}px,${$}px)`;return{transform:B,WebkitTransform:B,MozTransform:B,msTransform:B,OTransform:B,width:`${J}px`,height:`${H}px`,position:"absolute"}}function MO({top:$,left:Z,width:J,height:H}){return{top:`${$}px`,left:`${Z}px`,width:`${J}px`,height:`${H}px`,position:"absolute"}}function PO($){return $*100+"%"}function HW0($,Z,J,H){return $+J>H?Z:J}function zn($,Z,J){return $<0?Z:J}function BW0($){return Math.max(0,$)}function JN($){return Math.max(0,$)}var _O=($,Z,J)=>{let{left:H,height:B,width:Q}=Z,X=$.top-(B-$.height);return{left:H,width:Q,height:zn(X,$.height,B),top:JN(X)}},OO=($,Z,J)=>{let{top:H,left:B,height:Q,width:X}=Z;return{top:H,height:Q,width:HW0($.left,$.width,X,J),left:BW0(B)}},jO=($,Z,J)=>{let{top:H,height:B,width:Q}=Z,X=$.left+$.width-Q;if(X<0)return{height:B,width:$.left+$.width,top:JN(H),left:0};return{height:B,width:Q,top:JN(H),left:X}},TO=($,Z,J)=>{let{top:H,left:B,height:Q,width:X}=Z;return{width:X,left:B,height:zn(H,$.height,Q),top:JN(H)}},QW0=($,Z,J)=>_O($,OO($,Z,J)),XW0=($,Z,J)=>_O($,jO($,Z)),zW0=($,Z,J)=>TO($,OO($,Z,J)),GW0=($,Z,J)=>TO($,jO($,Z)),UW0={n:_O,ne:QW0,e:OO,se:zW0,s:TO,sw:GW0,w:jO,nw:XW0};function Gn($,Z,J,H){let B=UW0[$];if(!B)return J;return B(Z,{...Z,...J},H)}var YW0={type:"transform",scale:1,calcStyle($){return HN($)}};var Un=YW0,Yn={cols:12,rowHeight:150,margin:[10,10],containerPadding:null,maxRows:1/0},Kn={enabled:!0,bounded:!1,threshold:3},Fn={enabled:!0,handles:["se"]},Wn={enabled:!1,defaultItem:{w:1,h:1}};function CO($,Z,J,H,B){let Q=H==="x"?"w":"h";Z[H]+=1;let X=$.findIndex((G)=>G.i===Z.i),z=B??sX($).length>0;for(let G=X+1;G<$.length;G++){let U=$[G];if(U===void 0)continue;if(U.static)continue;if(!z&&U.y>Z.y+Z.h)break;if(ZN(Z,U))CO($,U,J+Z[Q],H,z)}Z[H]=J}function KW0($,Z,J,H){Z.x=Math.max(Z.x,0),Z.y=Math.max(Z.y,0),Z.y=Math.min(H,Z.y);while(Z.y>0&&!v7($,Z))Z.y--;let B;while((B=v7($,Z))!==void 0)CO(J,Z,B.y+B.h,"y");return Z.y=Math.max(Z.y,0),Z}function FW0($,Z,J,H){Z.x=Math.max(Z.x,0),Z.y=Math.max(Z.y,0);while(Z.x>0&&!v7($,Z))Z.x--;let B;while((B=v7($,Z))!==void 0)if(CO(H,Z,B.x+B.w,"x"),Z.x+Z.w>J){Z.x=J-Z.w,Z.y++;while(Z.x>0&&!v7($,Z))Z.x--}return Z.x=Math.max(Z.x,0),Z}var eX={type:"vertical",allowOverlap:!1,compact($,Z){let J=sX($),H=nX(J),B=$N($),Q=Array($.length);for(let X=0;X<B.length;X++){let z=B[X];if(z===void 0)continue;let G=t3(z);if(!G.static)G=KW0(J,G,B,H),H=Math.max(H,G.y+G.h),J.push(G);let U=$.indexOf(z);Q[U]=G,G.moved=!1}return Q}},EO={type:"horizontal",allowOverlap:!1,compact($,Z){let J=sX($),H=DO($),B=Array($.length);for(let Q=0;Q<H.length;Q++){let X=H[Q];if(X===void 0)continue;let z=t3(X);if(!z.static)z=FW0(J,z,Z,H),J.push(z);let G=$.indexOf(X);B[G]=z,z.moved=!1}return B}},bO={type:null,allowOverlap:!1,compact($,Z){return dH($)}},WW0={...eX,allowOverlap:!0,compact($,Z){return dH($)}},qW0={...EO,allowOverlap:!0,compact($,Z){return dH($)}},NW0={...bO,allowOverlap:!0};function wO($,Z=!1,J=!1){let H;if(Z)if($==="vertical")H=WW0;else if($==="horizontal")H=qW0;else H=NW0;else if($==="vertical")H=eX;else if($==="horizontal")H=EO;else H=bO;if(J)return{...H,preventCollision:J};return H}var P9=P(m(),1);function AW0($){let Z=typeof globalThis.getComputedStyle==="function"?globalThis.getComputedStyle($):null;if(!Z)return $.clientWidth;let J=(B)=>{let Q=Number.parseFloat(B);return Number.isFinite(Q)?Q:0},H=Number.parseFloat(Z.width);if(Number.isFinite(H))return Math.max(0,H);return Math.max(0,$.clientWidth-J(Z.paddingLeft)-J(Z.paddingRight))}function SO($={}){let{measureBeforeMount:Z=!1,initialWidth:J=1280}=$,[H,B]=P9.useState(J),[Q,X]=P9.useState(!Z),z=P9.useRef(null),G=P9.useRef(null),U=P9.useCallback(()=>{let Y=z.current;if(Y){let K=Math.round(AW0(Y));if(B((F)=>F===K?F:K),!Q)X(!0)}},[Q]);return P9.useEffect(()=>{let Y=z.current;if(!Y)return;if(U(),typeof ResizeObserver<"u"){let K=null;return G.current=new ResizeObserver((F)=>{let W=F[0];if(W){let q=Math.round(W.contentRect.width);if(K!==null)cancelAnimationFrame(K);K=requestAnimationFrame(()=>{B((N)=>N===q?N:q),K=null})}}),G.current.observe(Y),()=>{if(K!==null)cancelAnimationFrame(K);if(G.current)G.current.disconnect(),G.current=null}}return()=>{if(G.current)G.current.disconnect(),G.current=null}},[U]),{width:H,mounted:Q,containerRef:z,measureWidth:U}}var g0=P(m(),1),Vn=P(Uq(),1),Ln=P(r_(),1);var $6=P(c(),1),FZ=P(Nn(),1);function RO($){let{children:Z,cols:J,containerWidth:H,margin:B,containerPadding:Q,rowHeight:X,maxRows:z,isDraggable:G,isResizable:U,isBounded:Y,static:K,useCSSTransforms:F=!0,usePercentages:W=!1,transformScale:q=1,positionStrategy:N,dragThreshold:D=0,droppingPosition:A,className:V="",style:L,handle:O="",cancel:M="",x:_,y:w,w:C,h:E,minW:j=1,maxW:k=1/0,minH:S=1,maxH:I=1/0,i:T,resizeHandles:y,resizeHandle:R,constraints:x=LO,layoutItem:v,layout:f=[],onDragStart:b,onDrag:l,onDragStop:r,onResizeStart:h,onResize:d,onResizeStop:o}=$,[p,i]=g0.useState(!1),[n,Z0]=g0.useState(!1),J0=g0.useRef(null),U0=g0.useRef({left:0,top:0}),z0=g0.useRef({top:0,left:0,width:0,height:0}),X0=g0.useRef(void 0),q0=g0.useRef(f);q0.current=f;let N0=g0.useRef(null),F0=g0.useRef(null),s=g0.useRef(!1),a=g0.useRef({x:0,y:0}),$0=g0.useRef(!1),t=g0.useMemo(()=>({cols:J,containerPadding:Q,containerWidth:H,margin:B,maxRows:z,rowHeight:X}),[J,Q,H,B,z,X]),B0=g0.useMemo(()=>({cols:J,maxRows:z,containerWidth:H,containerHeight:0,rowHeight:X,margin:B,layout:[]}),[J,z,H,X,B]),_0=g0.useCallback(()=>({...B0,layout:q0.current}),[B0]),P0=g0.useMemo(()=>v??{i:T,x:_,y:w,w:C,h:E,minW:j,maxW:k,minH:S,maxH:I},[v,T,_,w,C,E,j,k,S,I]),A0=g0.useCallback((C0)=>{if(N?.calcStyle)return N.calcStyle(C0);if(F)return HN(C0);let p0=MO(C0);if(W)return{...p0,left:PO(C0.left/H),width:PO(C0.width/H)};return p0},[N,F,W,H]),L0=g0.useCallback((C0,{node:p0})=>{if(!b)return;let{offsetParent:r0}=p0;if(!r0)return;let o0=r0.getBoundingClientRect(),D0=p0.getBoundingClientRect(),y0=D0.left/q,W1=o0.left/q,R1=D0.top/q,f0=o0.top/q,t0;if(N?.calcDragPosition){let e0=C0;t0=N.calcDragPosition(e0.clientX,e0.clientY,e0.clientX-D0.left,e0.clientY-D0.top)}else t0={left:y0-W1+r0.scrollLeft,top:R1-f0+r0.scrollTop};if(U0.current=t0,D>0){let e0=C0;a.current={x:e0.clientX,y:e0.clientY},s.current=!0,$0.current=!1,i(!0);return}i(!0);let O1=oX(t,t0.top,t0.left),{x:j1,y:x0}=tX(x,P0,O1.x,O1.y,_0());b(T,j1,x0,{e:C0,node:p0,newPosition:t0})},[b,q,t,N,D,x,P0,_0,T]),g=g0.useCallback((C0,{node:p0,deltaX:r0,deltaY:o0})=>{if(!l||!p)return;let D0=C0;if(s.current&&!$0.current){let j1=D0.clientX-a.current.x,x0=D0.clientY-a.current.y;if(Math.hypot(j1,x0)<D)return;if($0.current=!0,s.current=!1,b){let l0=oX(t,U0.current.top,U0.current.left),{x:P1,y:m1}=tX(x,P0,l0.x,l0.y,_0());b(T,P1,m1,{e:C0,node:p0,newPosition:U0.current})}}let y0=U0.current.top+o0,W1=U0.current.left+r0;if(Y){let{offsetParent:j1}=p0;if(j1){let x0=j1.clientHeight-M9(E,X,B[1]);y0=rX(y0,0,x0);let e0=h7(t),l0=H-M9(C,e0,B[0]);W1=rX(W1,0,l0)}}let R1={top:y0,left:W1};U0.current=R1;let f0=oX(t,y0,W1),{x:t0,y:O1}=tX(x,P0,f0.x,f0.y,_0());l(T,t0,O1,{e:C0,node:p0,newPosition:R1})},[l,b,p,D,Y,E,X,B,t,H,C,T,x,P0,_0]),u=g0.useCallback((C0,{node:p0})=>{if(!r||!p)return;let r0=s.current;if(s.current=!1,$0.current=!1,a.current={x:0,y:0},r0){i(!1),U0.current={left:0,top:0};return}let{left:o0,top:D0}=U0.current,y0={top:D0,left:o0};i(!1),U0.current={left:0,top:0};let W1=oX(t,D0,o0),{x:R1,y:f0}=tX(x,P0,W1.x,W1.y,_0());r(T,R1,f0,{e:C0,node:p0,newPosition:y0})},[r,p,t,x,P0,_0,T]);N0.current=L0,F0.current=g;let e=g0.useCallback((C0,{node:p0,size:r0,handle:o0},D0,y0)=>{let W1=y0==="onResizeStart"?h:y0==="onResize"?d:o;if(!W1)return;let R1;if(p0)R1=Gn(o0,D0,r0,H);else R1={...r0,top:D0.top,left:D0.left};z0.current=R1;let f0=Bn(t,R1.width,R1.height),{w:t0,h:O1}=Xn(x,P0,f0.w,f0.h,o0,_0());W1(T,t0,O1,{e:C0.nativeEvent??C0,node:p0,size:R1,handle:o0})},[h,d,o,H,t,T,x,P0,_0]),W0=g0.useCallback((C0,p0)=>{Z0(!0);let r0=aX(t,_,w,C,E),o0={...p0,handle:p0.handle};e(C0,o0,r0,"onResizeStart")},[e,t,_,w,C,E]),S0=g0.useCallback((C0,p0)=>{let r0=aX(t,_,w,C,E),o0={...p0,handle:p0.handle};e(C0,o0,r0,"onResize")},[e,t,_,w,C,E]),h0=g0.useCallback((C0,p0)=>{Z0(!1),z0.current={top:0,left:0,width:0,height:0};let r0=aX(t,_,w,C,E),o0={...p0,handle:p0.handle};e(C0,o0,r0,"onResizeStop")},[e,t,_,w,C,E]);g0.useEffect(()=>{if(!A)return;let C0=J0.current;if(!C0)return;let p0=X0.current||{left:0,top:0},r0=p&&(A.left!==p0.left||A.top!==p0.top);if(!p){let o0={node:C0,deltaX:A.left,deltaY:A.top,lastX:0,lastY:0,x:A.left,y:A.top};N0.current?.(A.e,o0)}else if(r0){let o0=A.left-U0.current.left,D0=A.top-U0.current.top,y0={node:C0,deltaX:o0,deltaY:D0,lastX:U0.current.left,lastY:U0.current.top,x:A.left,y:A.top};F0.current?.(A.e,y0)}X0.current=A},[A,p,T]);let v0=aX(t,_,w,C,E,p?U0.current:null,n?z0.current:null),T0=g0.default.Children.only(Z),c0=h7(t),G1=[M9(j,c0,B[0]),M9(S,X,B[1])],A1=[M9(k,c0,B[0]),M9(I,X,B[1])],d0=T0.props,k0=d0.className,S1=d0.style,K1=g0.default.cloneElement(T0,{ref:J0,className:IO("react-grid-item",k0,V,{static:K,resizing:n,"react-draggable":G,"react-draggable-dragging":p,dropping:Boolean(A),cssTransforms:F}),style:{...L,...S1,...A0(v0)}}),z5=R;return K1=$6.jsx(Ln.Resizable,{draggableOpts:{disabled:!U},className:U?void 0:"react-resizable-hide",width:v0.width,height:v0.height,minConstraints:G1,maxConstraints:A1,onResizeStart:W0,onResize:S0,onResizeStop:h0,transformScale:q,resizeHandles:y,handle:z5,children:K1}),K1=$6.jsx(Vn.DraggableCore,{disabled:!G,onStart:L0,onDrag:g,onStop:u,handle:O,cancel:".react-resizable-handle"+(M?","+M:""),scale:q,nodeRef:J0,children:K1}),K1}var e3=()=>{},An="react-grid-layout",Mn=!1;try{Mn=/firefox/i.test(navigator.userAgent)}catch{}function MW0($,Z){let J=g0.default.Children.toArray($),H=g0.default.Children.toArray(Z);if(J.length!==H.length)return!1;for(let B=0;B<J.length;B++){let Q=J[B],X=H[B];if(Q?.key!==X?.key)return!1}return!0}function Dn($,Z,J,H){let B=[],Q=new Set;g0.default.Children.forEach(Z,(z)=>{if(!g0.default.isValidElement(z)||z.key===null)return;let G=String(z.key);Q.add(G);let U=$.find((Y)=>Y.i===G);if(U)B.push(t3(U));else{let K=z.props["data-grid"];if(K)B.push({i:G,x:K.x??0,y:K.y??0,w:K.w??1,h:K.h??1,minW:K.minW,maxW:K.maxW,minH:K.minH,maxH:K.maxH,static:K.static,isDraggable:K.isDraggable,isResizable:K.isResizable,resizeHandles:K.resizeHandles,isBounded:K.isBounded});else B.push({i:G,x:0,y:nX(B),w:1,h:1})}});let X=VO(B,{cols:J});return H.compact(X,J)}function $z($){let{children:Z,width:J,gridConfig:H,dragConfig:B,resizeConfig:Q,dropConfig:X,positionStrategy:z=Un,compactor:G,constraints:U=LO,layout:Y=[],droppingItem:K,autoSize:F=!0,className:W="",style:q={},innerRef:N,onLayoutChange:D=e3,onDragStart:A=e3,onDrag:V=e3,onDragStop:L=e3,onResizeStart:O=e3,onResize:M=e3,onResizeStop:_=e3,onDrop:w=e3,onDropDragOver:C=e3}=$,E=g0.useMemo(()=>({...Yn,...H}),[H]),j=g0.useMemo(()=>({...Kn,...B}),[B]),k=g0.useMemo(()=>({...Fn,...Q}),[Q]),S=g0.useMemo(()=>({...Wn,...X}),[X]),{cols:I,rowHeight:T,maxRows:y,margin:R,containerPadding:x}=E,{enabled:v,bounded:f,handle:b,cancel:l,threshold:r}=j,{enabled:h,handles:d,handleComponent:o}=k,{enabled:p,defaultItem:i,onDragOver:n}=S,Z0=G??wO("vertical"),J0=Z0.type,U0=Z0.allowOverlap,z0=Z0.preventCollision??!1,X0=g0.useMemo(()=>K??{i:"__dropping-elem__",...i},[K,i]),q0=z.type==="transform",N0=z.scale,F0=x??R,[s,a]=g0.useState(!1),[$0,t]=g0.useState(()=>Dn(Y,Z,I,Z0)),[B0,_0]=g0.useState(null),[P0,A0]=g0.useState(!1),[L0,g]=g0.useState(null),[u,e]=g0.useState(),W0=g0.useRef(null),S0=g0.useRef(null),h0=g0.useRef(null),v0=g0.useRef(0),T0=g0.useRef($0),c0=g0.useRef(Y),G1=g0.useRef(Z),A1=g0.useRef(J0),d0=g0.useRef($0);d0.current=$0,g0.useEffect(()=>{if(a(!0),!FZ.deepEqual($0,Y))D($0)},[]),g0.useEffect(()=>{if(B0)return;if(L0)return;let x0=!FZ.deepEqual(Y,c0.current),e0=!MW0(Z,G1.current),l0=J0!==A1.current;if(x0||e0||l0){let m1=Dn(x0?Y:$0,Z,I,Z0);if(!FZ.deepEqual(m1,$0))t(m1)}c0.current=Y,G1.current=Z,A1.current=J0},[Y,Z,I,J0,Z0,B0,L0,$0]),g0.useEffect(()=>{if(!B0&&!FZ.deepEqual($0,T0.current)){T0.current=$0;let x0=$0.filter((e0)=>e0.i!==X0.i);D(x0)}},[$0,B0,D,X0.i]);let k0=g0.useMemo(()=>{if(!F)return;let x0=nX($0),e0=F0[1];return x0*T+(x0-1)*R[1]+e0*2+"px"},[F,$0,T,R,F0]),S1=g0.useCallback((x0,e0,l0,P1)=>{let m1=d0.current,d1=f7(m1,x0);if(!d1)return;let g5={w:d1.w,h:d1.h,x:d1.x,y:d1.y,i:x0};W0.current=t3(d1),h0.current=m1,_0(g5),A(m1,d1,d1,null,P1.e,P1.node)},[A]),K1=g0.useCallback((x0,e0,l0,P1)=>{let m1=d0.current,d1=W0.current,g5=f7(m1,x0);if(!g5)return;let T2={w:g5.w,h:g5.h,x:g5.x,y:g5.y,i:x0},m5=x7(m1,g5,e0,l0,!0,z0,J0,I,U0);V(m5,d1,g5,T2,P1.e,P1.node),t(Z0.compact(m5,I)),_0(T2)},[z0,J0,I,U0,Z0,V]),z5=g0.useCallback((x0,e0,l0,P1)=>{if(!B0)return;let m1=d0.current,d1=W0.current,g5=f7(m1,x0);if(!g5)return;let T2=x7(m1,g5,e0,l0,!0,z0,J0,I,U0),m5=Z0.compact(T2,I);L(m5,d1,g5,null,P1.e,P1.node);let $4=h0.current;if(W0.current=null,h0.current=null,_0(null),t(m5),$4&&!FZ.deepEqual($4,m5))D(m5)},[B0,z0,J0,I,U0,Z0,L,D]),C0=g0.useCallback((x0,e0,l0,P1)=>{let m1=d0.current,d1=f7(m1,x0);if(!d1)return;S0.current=t3(d1),h0.current=m1,A0(!0),O(m1,d1,d1,null,P1.e,P1.node)},[O]),p0=g0.useCallback((x0,e0,l0,P1)=>{let m1=d0.current,d1=S0.current,{handle:g5}=P1,T2=!1,m5,$4,[zz,P3]=Qn(m1,x0,(p5)=>{if(m5=p5.x,$4=p5.y,["sw","w","nw","n","ne"].includes(g5)){if(["sw","nw","w"].includes(g5))m5=p5.x+(p5.w-e0),e0=p5.x!==m5&&m5<0?p5.w:e0,m5=m5<0?0:m5;if(["ne","n","nw"].includes(g5))$4=p5.y+(p5.h-l0),l0=p5.y!==$4&&$4<0?p5.h:l0,$4=$4<0?0:$4;T2=!0}if(z0&&!U0){if(AO(m1,{...p5,w:e0,h:l0,x:m5??p5.x,y:$4??p5.y}).filter((Uz)=>Uz.i!==p5.i).length>0)$4=p5.y,l0=p5.h,m5=p5.x,e0=p5.w,T2=!1}return p5.w=e0,p5.h=l0,p5});if(!P3)return;let ZB=zz;if(T2&&m5!==void 0&&$4!==void 0)ZB=x7(zz,P3,m5,$4,!0,z0,J0,I,U0);let Gz={w:P3.w,h:P3.h,x:P3.x,y:P3.y,i:x0,static:!0};M(ZB,d1,P3,Gz,P1.e,P1.node),t(Z0.compact(ZB,I)),_0(Gz)},[z0,J0,I,U0,Z0,M]),r0=g0.useCallback((x0,e0,l0,P1)=>{let m1=d0.current,d1=S0.current,g5=f7(m1,x0),T2=Z0.compact(m1,I);_(T2,d1,g5??null,null,P1.e,P1.node);let m5=h0.current;if(S0.current=null,h0.current=null,_0(null),A0(!1),t(T2),m5&&!FZ.deepEqual(m5,T2))D(T2)},[I,Z0,_,D]),o0=g0.useCallback(()=>{let x0=d0.current;if(!x0.some((P1)=>P1.i===X0.i)){g(null),_0(null),e(void 0);return}let l0=Z0.compact(x0.filter((P1)=>P1.i!==X0.i),I);t(l0),g(null),_0(null),e(void 0)},[X0.i,I,Z0]),D0=g0.useCallback((x0)=>{if(x0.preventDefault(),x0.stopPropagation(),Mn&&!x0.nativeEvent.target?.classList.contains(An))return!1;let e0=n?n(x0.nativeEvent):C(x0);if(e0===!1){if(L0)o0();return!1}let{dragOffsetX:l0=0,dragOffsetY:P1=0,...m1}=e0??{},d1={...X0,...m1},g5=x0.currentTarget.getBoundingClientRect(),T2={cols:I,margin:R,maxRows:y,rowHeight:T,containerWidth:J,containerPadding:F0},m5=h7(T2),$4=M9(d1.w,m5,R[0]),zz=M9(d1.h,T,R[1]),P3=$4/2,ZB=zz/2,Gz=x0.clientX-g5.left+l0-P3,p5=x0.clientY-g5.top+P1-ZB,EN=Math.max(0,Gz),Uz=Math.max(0,p5),Yz={left:EN/N0,top:Uz/N0,e:x0.nativeEvent};if(!L0){let bN=Hn(T2,Uz,EN,d1.w,d1.h);g($6.jsx("div",{},d1.i)),e(Yz);let It=d0.current.filter((kt)=>kt.i!==d1.i);t([...It,{...d1,x:bN.x,y:bN.y,static:!1,isDraggable:!0}])}else if(u){if(u.left!==Yz.left||u.top!==Yz.top)e(Yz)}},[L0,u,X0,n,C,o0,N0,I,R,y,T,J,F0]),y0=g0.useCallback((x0)=>{if(x0.preventDefault(),x0.stopPropagation(),v0.current--,v0.current<0)v0.current=0;if(v0.current===0)o0()},[o0]),W1=g0.useCallback((x0)=>{x0.preventDefault(),x0.stopPropagation(),v0.current++},[]),R1=g0.useCallback((x0)=>{x0.preventDefault(),x0.stopPropagation();let e0=d0.current,l0=e0.find((P1)=>P1.i===X0.i);v0.current=0,o0(),w(e0,l0,x0.nativeEvent)},[X0.i,o0,w]),f0=g0.useCallback((x0,e0)=>{if(!x0||!x0.key)return null;let l0=f7($0,String(x0.key));if(!l0)return null;let P1=typeof l0.isDraggable==="boolean"?l0.isDraggable:!l0.static&&v,m1=typeof l0.isResizable==="boolean"?l0.isResizable:!l0.static&&h,d1=l0.resizeHandles||[...d],g5=P1&&f&&l0.isBounded!==!1,T2=o;return $6.jsx(RO,{containerWidth:J,cols:I,margin:R,containerPadding:F0,maxRows:y,rowHeight:T,cancel:l,handle:b,onDragStart:S1,onDrag:K1,onDragStop:z5,onResizeStart:C0,onResize:p0,onResizeStop:r0,isDraggable:P1,isResizable:m1,isBounded:g5,useCSSTransforms:q0&&s,usePercentages:!s,transformScale:N0,positionStrategy:z,dragThreshold:r,w:l0.w,h:l0.h,x:l0.x,y:l0.y,i:l0.i,minH:l0.minH,minW:l0.minW,maxH:l0.maxH,maxW:l0.maxW,static:l0.static,droppingPosition:e0?u:void 0,resizeHandles:d1,resizeHandle:T2,constraints:U,layoutItem:l0,layout:$0,children:x0},l0.i)},[$0,J,I,R,F0,y,T,l,b,S1,K1,z5,C0,p0,r0,v,h,f,q0,s,N0,z,r,u,d,o,U]),t0=()=>{if(!B0)return null;return $6.jsx(RO,{w:B0.w,h:B0.h,x:B0.x,y:B0.y,i:B0.i,className:`react-grid-placeholder ${P0?"placeholder-resizing":""}`,containerWidth:J,cols:I,margin:R,containerPadding:F0,maxRows:y,rowHeight:T,isDraggable:!1,isResizable:!1,isBounded:!1,useCSSTransforms:q0,transformScale:N0,constraints:U,layout:$0,children:$6.jsx("div",{})})},O1=IO(An,W),j1={height:k0,...q};return $6.jsxs("div",{ref:N,className:O1,style:j1,onDrop:p?R1:void 0,onDragLeave:p?y0:void 0,onDragEnter:p?W1:void 0,onDragOver:p?D0:void 0,children:[g0.default.Children.map(Z,(x0)=>{if(!g0.default.isValidElement(x0))return null;return f0(x0)}),p&&L0&&f0(L0,!0),t0()]})}var _8=P(c(),1),kO="moi:empty-state",Pn={type:"spring",duration:0.35,bounce:0};function _W0({items:$,customizing:Z,emptyState:J,renderItem:H,onMove:B,onRemove:Q}){let[X,z]=Zz.useState(()=>mX($)),[G,U]=Zz.useState($),{width:Y,containerRef:K,mounted:F}=SO({measureBeforeMount:!0});if(G!==$)U($),z((N)=>{let D=new Map(N.map((L)=>[L.i,L])),A=$.filter((L)=>D.has(L.id)).map((L)=>({...D.get(L.id),w:L.w,h:L.h})),V=new Set(A.map((L)=>L.i));return[...A,...mX($.filter((L)=>!V.has(L.id)),A)]});let W=J?[...X,{i:kO,x:0,y:X.reduce((N,D)=>Math.max(N,D.y+D.h),0),w:4,h:2,static:!0}]:X,q=Zz.useCallback((N)=>{let D=N.filter((A)=>A.i!==kO);z(D),B?.(D.map((A)=>({id:A.i,x:A.x,y:A.y})))},[B]);return _8.jsx("div",{ref:K,className:"w-full",children:F&&_8.jsxs($z,{width:Y,layout:W,gridConfig:{cols:4,rowHeight:160,margin:[8,8],containerPadding:[0,0]},dragConfig:{enabled:!!Z},resizeConfig:{enabled:!1},compactor:eX,onLayoutChange:q,children:[X.map((N)=>_8.jsx("div",{children:_8.jsx(Y5.div,{layoutId:N.i,"data-applet-thumbnail":z7("widgets",N.i),className:"size-full",transition:Pn,children:_8.jsx(vq,{customizing:Z,widgetId:N.i,onRemove:Q?()=>Q(N.i):void 0,children:H(N.i)})})},N.i)),J&&_8.jsx("div",{children:_8.jsx(Y5.div,{layout:!0,className:"size-full",transition:Pn,children:J})},kO)]})})}function _n({items:$,customizing:Z,header:J,emptyState:H,bottomInset:B=0,renderItem:Q,onMove:X,onRemove:z}){return _8.jsxs("div",{className:"size-full overflow-y-auto p-4",children:[_8.jsx("div",{className:"mx-auto h-32 w-full max-w-(--column-w)",children:J}),_8.jsx(Y5.div,{className:"mx-auto flex min-h-0 w-full max-w-(--column-w) flex-col gap-2",animate:{marginBottom:B},transition:{type:"spring",duration:0.3,bounce:0},children:($.length>0||H)&&_8.jsx(_W0,{items:$,customizing:Z,emptyState:H,renderItem:Q,onMove:X,onRemove:z})})]})}var n1=P(c(),1);function OW0({onCreateWidget:$,showOnboarding:Z}){return n1.jsxs("div",{className:"relative grid size-full grid-cols-4 grid-rows-2 gap-2 overflow-hidden",children:[n1.jsx("div",{className:"col-span-2 overflow-hidden rounded-2xl bg-muted texture-checker squircle",children:n1.jsx("div",{className:"flex size-full items-start justify-start bg-radial-[at_top_left] from-muted from-40% to-transparent p-12",children:n1.jsx("h2",{className:"text-2xl font-semibold text-foreground",children:"Widgets"})})}),n1.jsx("div",{className:"col-span-2 overflow-hidden rounded-2xl bg-muted texture-checker squircle"}),n1.jsx("div",{className:"col-span-2 overflow-hidden rounded-2xl bg-muted texture-checker squircle"}),n1.jsx("div",{className:"col-span-2 overflow-hidden rounded-2xl bg-muted texture-checker squircle",children:Z&&n1.jsx("div",{className:"flex size-full items-end justify-end",children:n1.jsx("span",{className:"m-8 max-w-56 text-right text-sm text-muted-foreground",children:"Widgets can surface information, read data, and perform actions"})})}),n1.jsxs(M0,{type:"button",variant:"outline",className:Q0("absolute inset-0 m-auto h-fit w-fit","flex-col gap-1 rounded-2xl border-0 py-4 pr-12 pl-12! text-xs shadow-sm transition-shadow duration-300 ease-out squircle hover:bg-background hover:shadow-lg [&_svg]:size-8"),onClick:$,children:[n1.jsx(a2,{"data-icon":"inline-start",stroke:1}),"New widget"]})]})}function yO({Icon:$,label:Z,active:J,className:H,...B}){return n1.jsx(M0,{type:"button",variant:J?"default":"secondary",className:Q0("relative h-16 w-24 rounded-lg px-4 py-0 text-xs [&_svg]:size-5",H),"aria-pressed":J,...B,children:n1.jsx(I4,{mode:"popLayout",initial:!1,children:n1.jsxs(Y5.span,{className:"flex flex-col items-center gap-1.5",variants:{from:{opacity:0,filter:"blur(4px)"},to:{opacity:1,filter:"blur(0px)"}},initial:"from",animate:"to",exit:"from",transition:{type:"spring",duration:0.2,bounce:0},children:[J?n1.jsx(g8,{stroke:1.5}):n1.jsx($,{stroke:1.5}),n1.jsx("span",{children:J?"Done":Z})]},J?"done":"action")})})}function jW0({customizing:$,theming:Z,onCustomizingChange:J,onThemingChange:H}){return n1.jsxs("div",{className:"flex size-full items-center gap-4",children:[n1.jsx(Zn,{}),n1.jsxs("div",{className:"flex shrink-0 items-center gap-2",children:[n1.jsx(yO,{Icon:On,label:"Customize",active:$,onClick:()=>J(!$)}),n1.jsx(yO,{Icon:QN,label:"Theme",active:Z,onClick:()=>H(!Z)}),n1.jsx(Iq,{children:n1.jsx(g3,{render:n1.jsx(yO,{Icon:c6,label:"Settings"})})})]})]})}function TW0(){let[$,Z]=XN.useState(0);return[XN.useCallback((H)=>{if(!H)return;let B=new ResizeObserver(([Q])=>{let X=Q.borderBoxSize?.[0];Z(X?X.blockSize:Q.contentRect.height)});return B.observe(H),()=>B.disconnect()},[]),$]}function jn({onCreateWidget:$,onCreateView:Z,onOpenView:J,customizing:H,theming:B,onThemingChange:Q,onCustomizingChange:X,widgets:z,views:G}){let{layout:U,setLayout:Y}=b1(),K=T1((E)=>E.hasSentMessageFromMoi),F=new Map(z.map((E)=>[E.id,E])),W=new Set(U.widgetGrid.map((E)=>E.i)),q=U.widgetGrid.filter((E)=>F.has(E.i)).map((E)=>{let j=F.get(E.i);return{id:E.i,w:j.config.colSpan,h:j.config.rowSpan,x:E.x,y:E.y}}),N=z.filter((E)=>!W.has(E.id)).map((E)=>({id:E.id,w:E.config.colSpan,h:E.config.rowSpan})),D=!H&&q.every((E)=>B3(E.id)),A=!K&&z.every((E)=>B3(E.id)),[V,L]=TW0(),O=H;Aq({kind:"widget",enabled:!H,targets:q.filter((E)=>!B3(E.id)).map((E)=>({id:E.id,revision:F.get(E.id)?.revision}))});function M(E){let j=Da(E,{views:G,onOpenView:J,onCreateView:Z,showOnboarding:A});if(j)return j;return n1.jsx(Oa,{name:E})}function _(E){Y({widgetGrid:U.widgetGrid.filter((j)=>j.i!==E)})}function w(E){let j=F.get(E);if(!j)return;let k=U.widgetGrid.map((I)=>{let T=F.get(I.i);return{...I,w:T?.config.colSpan??1,h:T?.config.rowSpan??1}}),S=yq(k,j.config.colSpan,j.config.rowSpan);Y({widgetGrid:[...U.widgetGrid,{i:E,x:S.x,y:S.y}]})}function C(E){Y({widgetGrid:Ma(U.widgetGrid,E)})}return n1.jsx("div",{className:"relative min-h-0 flex-1 bg-background",children:n1.jsxs(CU,{children:[n1.jsx(_n,{items:q,customizing:H,header:n1.jsx(jW0,{customizing:H,theming:B,onCustomizingChange:X,onThemingChange:Q}),emptyState:D?n1.jsx(OW0,{onCreateWidget:$,showOnboarding:A}):void 0,bottomInset:O?L:0,renderItem:M,onMove:C,onRemove:_}),n1.jsx(I4,{children:H&&n1.jsx(Ca,{ref:V,items:N,renderItem:M,onCreateWidget:$,onClose:()=>X(!1),onRestore:w})})]})})}var Cn=P(c(),1);function Tn({children:$}){return Cn.jsx("header",{className:Q0("@container relative flex shrink-0 items-center gap-1 py-2 pr-3 pl-4","after:absolute after:top-full after:left-0 after:h-px after:w-full after:bg-border"),children:$})}var En=!0;var CW0=64;function bn($,Z=[]){let J=TL($),H=J.attachments.map(CL);return(ih(J.text).trim()||(H.length?H:Z).filter(Boolean).join(", ")).replace(/\s+/gu," ").trim().slice(0,CW0).trimEnd()}function zN($,Z,J={}){if("id"in $){let X={source:J.source,...$.kind==="image"?{purpose:J.purpose}:{}};return{attachment:{type:"upload",uploadId:$.id,...X},part:{type:"file-attachment",mediaType:$.mediaType,label:$.filename,...X,previewUrl:$.kind==="image"?Z:void 0}}}let{source:H,label:B,text:Q}=$;return{attachment:{type:"text",source:H,label:B,text:Q},part:lh({type:"text",source:H,label:B,text:Q})}}function wn($){return{attachments:$.map((Z)=>Z.attachment),parts:$.map((Z)=>Z.part)}}async function Sn($,Z){let J=gK(Z);if(J)throw Error(J);return wn(await Promise.all(Z.map(async(H)=>{if(H.type==="text")return zN(H);let B=await cQ($,H.file??H.path);return zN(B,`/api/workspaces/${$}/uploads/${B.id}`,{source:H.source})})))}function xO($){return wn($.flatMap((Z)=>{if(Z.kind==="text")return[zN(Z)];if(!Z.upload)return[];return[zN({...Z.upload,filename:Z.label,mediaType:Z.mediaType},Z.previewUrl,{source:Z.source,purpose:Z.kind==="drawing"?Z.purpose:void 0})]}))}function hO($){return!$?.applet&&!$?.preparedAttachments}function GN($,Z,J){if(!hO(J))return[];return(y1.getState().attachments[F8($,Z)]??[]).filter((B)=>B.kind==="text"||B.status==="ready"&&B.upload)}function EW0({queryClient:$,workspaceId:Z,sessionId:J,parts:H}){let B=`optimistic:${crypto.randomUUID()}`;return $.setQueryData(O0.events(Z,J),(Q)=>rG(Q??yB(),{kind:"turn",turn:{id:B,role:"user",origin:{kind:"user-input"},parts:H,timestamp:new Date().toISOString()}})),y1.getState().setActivity(Z,J,"running"),y1.getState().setError(Z,J,null),B}function UN({tabId:$,queryClient:Z,workspaceId:J,sessionId:H,text:B,filenames:Q=[]}){let X=bn(B,Q);if(!X)return;Z.setQueryData(O0.sessions(J),(z)=>[{sessionId:H,summary:X,lastModified:Date.now(),...$?{tabId:$}:{}},...(z??[]).filter((G)=>G.sessionId!==H)])}function YN($,Z,J,H){let B=$?.models,Q=!Z||!B||B.some((K)=>K.value===Z)?Z:void 0,X=$?.provider==="codex"?QF($.models,Z):B?.find((K)=>K.value===(Q??"default")),z=$?.provider==="codex"&&X?X.resolvedModel??X.value:Q,G=J&&(!X||(X.supportedEffortLevels??[]).includes(J))?J:void 0,U=H===void 0||!X||X.supportsFastMode?H:!1,Y=En&&$?.supportsStreaming?!0:void 0;return{model:z,effort:G,...U!==void 0?{fastMode:U}:{},stream:Y}}function g7($,Z,J){y1.getState().renameSession($,Z,J),T1.getState().moveComposerDraft(V2($,Z),V2($,J))}function KN($,Z,J=xO(Z)){let H=[...J.parts];if($.text)H.push({type:"text",text:$.text});return{attachments:J.attachments,optimisticId:EW0({...$,parts:H})}}function FN($,Z){for(let J of Z)y1.getState().removeAttachment($,J.localId);T1.getState().markMessageSentFromMoi($)}var In=P(m(),1);function Rn($){if($.status==="available")return null;if($.status==="checking")return"The agent is still connecting";if($.status==="disconnected")return"This workspace is disconnected from Moi";if($.status==="login-required")return"Sign in to the agent to send this message";return"The agent is unavailable in this workspace"}function bW0($,Z,J,H="shared"){let B=new Set,Q=!1,X=()=>{let G=Z.getQueryData(i2($,H)),U=Z.getQueryData(i2($));return rD(U,J().tabId,H==="browser-tab"?G:void 0)??null};async function z(G){if(Q)return;let U=(L)=>{e1.add({title:"Couldn’t send message",description:L,type:"error"}),K8($,{source:"runtime",message:`sendChatMessage() from ${G.applet.kind}:${G.applet.id}: ${L}`})},Y=Rn(J().agentAvailability);if(Y){U(Y);return}let K=X(),F=J().tabId,W=!0,q,N=()=>{if(W=!1,A(),B.delete(D),q)e1.close(q)},D=()=>{if(!W)return;N(),e1.add({title:"Message canceled",description:"The active chat changed before attachments were ready",type:"info"})},A=Z.getQueryCache().subscribe(()=>{if(X()!==K||J().tabId!==F)D()});if(B.add(D),J().sessionId!==K){D();return}J().revealChat();let V;try{if(G.attachments.some((M)=>M.type==="file"))q=e1.add({title:"Preparing attachments…",type:"loading",timeout:0});if(V=await Sn($,G.attachments),!W)return;let L=J(),O=Rn(L.agentAvailability);if(O)throw Error(O);if(L.sessionId!==K||L.tabId!==F){D();return}}catch(L){if(W)N(),U(L instanceof Error?L.message:"Couldn’t prepare the attachments");return}N();try{J().send(G.message,{applet:G.applet,preparedAttachments:V})}catch(L){U(L instanceof Error?L.message:"Something went wrong while sending this message")}}return{handle:z,dispose(){Q=!0;for(let G of B)G()}}}function kn($){let Z=p1(),J=$1(),H=h3(),B=l2(),Q=q5({...$,tabId:H});In.useLayoutEffect(()=>{let X=bW0(Z,J,()=>Q.current,B?"browser-tab":"shared"),z=uK(Z).on("sendChatMessage",(G)=>{X.handle(G)});return()=>{z(),X.dispose()}},[Z,J,Q,H,B])}function yn($,Z){let J=p1();pK(J,"addChatAttachment",(H)=>{Ev({workspaceId:J,sessionId:$},H),Z()})}var WZ=P(m(),1);var hn=P(m(),1);var xn=new Map;function wW0($){let Z=xn.get($)??[];return xn.delete($),Z}function SW0($,Z=[]){return[...wW0($),...Z]}function RW0($,Z){if(!$.startsWith("views/"))return;return Object.keys(Z).length>0?Z:void 0}function IW0($,Z){if($.startsWith("views/"))return Z?.find((J)=>J.id===$.slice(6))?.title||void 0;return}function vn({activeTab:$,appletParams:Z}){let J=p1(),H=kq(J).data;return hn.useCallback((B={})=>{let Q=SW0(J,B.directives??[]),X=RW0($,Z);return{activeTab:{id:$,title:IW0($,H),...X?{params:X}:{}},...B.applet?{applet:B.applet}:{},...Q.length>0?{directives:Q}:{}}},[J,$,Z,H])}function fn($,Z){if(!Z?.forkedFromSessionId||!Z.forkedThroughMessageId)return $;let J=Z.forkedThroughMessageId,H=$.turns.findIndex((Q)=>Q.id===J);if(H<0)return $;let B=new Set(Z.forkedNoticeIds);return{...$,turns:$.turns.slice(H+1),notices:$.notices.filter((Q)=>!B.has(Q.id))}}function kW0($){return $.filter((Z)=>Z.text.length>0).map((Z)=>Z.kind==="reasoning"?{type:"reasoning",text:Z.text}:{type:"text",text:Z.text})}function gn($){let Z=kW0($?.blocks??[]);if(Z.length===0)return null;return{id:"live-preview",role:"assistant",origin:{kind:"user-input"},parts:Z}}var mn=yB();function un($){let Z=p1(),J=$1(),{layout:H}=b1(),[B,Q]=v3($.activeTab),X=l2(),z=v8(Z).data,G=MJ(Z).data,U=B??null,Y=U??F2($.activeTab),K=vn($),F=G4((T)=>U?T.activity[`${Z}:${U}`]??"idle":"idle"),W=kB(F),q=G4((T)=>U?T.errors[`${Z}:${U}`]??null:null),N=iS(Z,U),{refetch:D}=N,A=wU(Z,U),{refetch:V}=A,L=WZ.useCallback(async()=>{await D(),await V()},[D,V]),O=A.data?.forkedFromSessionId,M=!U||A.data!==void 0,_=M?N.data??mn:mn;if(N.data&&O)_=fn(N.data,A.data);let w=B!==void 0&&M&&G!==void 0&&(U===null||N.data!==void 0),C=G4((T)=>cb(T.previews,Z,U).root),E=WZ.useMemo(()=>gn(C),[C]),j=A.data?.config,k=WZ.useCallback((T,y)=>{let R=T.trim(),x=GN(Z,Y,y);if(!R&&x.length===0&&!y?.preparedAttachments?.attachments.length)return;let v=y?.preparedAttachments??xO(x),f=gK(v.attachments);if(f){e1.add({title:"Couldn’t send message",description:f,type:"error"});return}let b=U,l=!1;if(!b){if(b=crypto.randomUUID(),l=!0,!hO(y))g7(Z,Y,b);Q(b),UN({tabId:$.activeTab,queryClient:J,workspaceId:Z,sessionId:b,text:R,filenames:x.map((U0)=>U0.label)})}let{attachments:r,optimisticId:h}=KN({queryClient:J,workspaceId:Z,sessionId:b,text:R},x,v),d=j?.model??H.selectedModel,o=j?.effort??H.selectedEffort,p=j?.fastMode??H.selectedFastMode,{model:i,effort:n,fastMode:Z0,stream:J0}=YN(z,d,o,p);if(IU({type:"chat",workspaceId:Z,content:R,sessionId:b,isNew:l,selectedSessionScope:X?"browser-tab":"shared",optimisticId:h,model:i,effort:n,fastMode:Z0,stream:J0,context:K(y),...r.length>0?{attachments:r}:{}}),FN(Z,x),l)J.invalidateQueries({queryKey:O0.previews})},[$.activeTab,Y,U,Z,J,H.selectedModel,H.selectedEffort,H.selectedFastMode,K,j?.model,j?.effort,j?.fastMode,Q,X,z]),S=WZ.useCallback(()=>{if(!U)return;y1.getState().setError(Z,U,null)},[U,Z]),I=WZ.useCallback(()=>{if(!W||!U)return;IU({type:"stop",workspaceId:Z,sessionId:U})},[W,U,Z]);return{view:_,forkedFromSessionId:O,chatLoaded:w,previewTurn:E,sessionId:U,composerSessionId:Y,processing:W,error:q,loadError:A.error?.message??N.error?.message??null,retryLoad:L,send:k,stop:I,selectSession:Q,dismissError:S}}var cn=P(m(),1);var s2=P(m(),1);function pn({active:$,viewId:Z,sessionId:J,source:H,workspaceId:B,onEditingStart:Q,onContinueInChat:X}){let z=s2.useRef(`sketch:${Z}`),G=s2.useRef(0),U=s2.useRef(null),Y=s2.useRef(null),K=s2.useRef(!0),[F,W]=s2.useState(!1),q=q5(Q),N=q5(X),D=s2.useCallback((C)=>{if(!K.current)return;if(!C){G.current+=1,U.current=null,Y.current=null,y1.getState().removeAttachment(B,z.current);return}dQ({workspaceId:B,sessionId:J,localId:z.current,purpose:"sketch",source:H,blob:C})},[J,H,B]),A=s2.useCallback((C)=>{if(!C)return Y.current??Promise.resolve();if(C===U.current){if(y1.getState().attachments[F8(B,J)]?.some((S)=>S.localId===z.current&&S.kind!=="text"&&(S.status==="ready"||S.status==="uploading")))return Y.current??Promise.resolve()}U.current=C;let E=++G.current,j=eK({workspaceId:B,sessionId:J,localId:z.current,purpose:"sketch",source:H,blob:C,isCurrent:()=>G.current===E});return Y.current=j,j},[J,H,B]),V=nK({mode:"sketch",onChange:D,onEditingStart:()=>q.current()}),{controls:L}=V,O=s2.useCallback(async()=>{await A(await L.flush())},[L,A]),M=s2.useCallback(async()=>{await A(await L.deactivate())},[L,A]),_=s2.useCallback(async()=>{if(F)return;W(!0);try{await M(),N.current()}finally{W(!1)}},[F,M,N]),w=s2.useCallback(async()=>{K.current=!1,G.current+=1,U.current=null,Y.current=null,y1.getState().removeAttachment(B,z.current);try{await L.cancel()}finally{K.current=!0}},[L,B]);return s2.useEffect(()=>{if(!$&&L.active)M()},[$,L.active,M]),{...V,continuing:F,continueInChat:_,prepareForSend:O,resetDocument:w}}var g1=P(c(),1);function dn({ref:$,active:Z,pendingView:J,running:H,sketchSessionId:B,chatDocked:Q,workspaceId:X,onEditingStart:z,onContinueInChat:G,onOpenChat:U,onDiscard:Y}){let K=J.status==="submitted"?H?"building":"waiting":J.status,F=pn({active:Z&&J.status==="draft",viewId:J.id,sessionId:B??J.executionSessionId??F2(S5(J.id)),source:S5(J.id),workspaceId:X,onEditingStart:z,onContinueInChat:G});return cn.useImperativeHandle($,()=>({prepareSketchForSend:F.prepareForSend,resetSketch:F.resetDocument}),[F.prepareForSend,F.resetDocument]),g1.jsx(hW0,{active:Z,chatDocked:Q,error:J.error,sketch:F,displayStatus:K,onDiscard:Y,onOpenChat:U})}function yW0(){return g1.jsx(WN,{children:g1.jsxs("div",{className:"flex max-w-md flex-col items-center gap-4 p-8 text-center",children:[g1.jsx(r2,{className:"size-6 text-muted-foreground"}),g1.jsx("p",{className:"text-sm text-muted-foreground",children:"Starting view chat…"})]})})}function xW0({error:$,onOpenChat:Z,onDiscard:J}){return g1.jsx(WN,{children:g1.jsxs("div",{className:"pointer-events-auto flex max-w-md flex-col items-center gap-4 bg-radial from-background from-50% to-transparent to-75% p-8 text-center",children:[g1.jsx("p",{className:"text-sm text-muted-foreground",children:$}),g1.jsx(M0,{onClick:Z,children:"Open chat"}),g1.jsx(M0,{variant:"secondary",onClick:J,children:"Discard view"})]})})}function hW0({active:$,chatDocked:Z,error:J,sketch:H,displayStatus:B,onDiscard:Q,onOpenChat:X}){let z=B==="draft";return g1.jsxs("div",{className:Q0("relative min-h-0 flex-1 overflow-hidden bg-background",$?"flex":"hidden"),children:[g1.jsx(vW0,{chatDocked:Z,sketch:H,draft:z}),g1.jsx("div",{inert:z?void 0:!0,className:Q0("absolute inset-0",!z&&"pointer-events-none opacity-50"),children:g1.jsx(aK,{...H.layerProps,children:z&&g1.jsx(tK,{controls:H.controls,title:"Sketch the view",busy:H.continuing,onComplete:()=>void H.continueInChat()})})}),g1.jsx("div",{"aria-hidden":!0,className:Q0("pointer-events-none absolute inset-0 transition-shadow duration-500 ease-in-out",B==="building"&&"animate-glow texture-inset-shadow-50% motion-reduce:animate-none")}),B==="building"&&g1.jsx(gW0,{controls:H.controls}),B==="starting"&&g1.jsx(yW0,{}),B==="waiting"&&g1.jsx(fW0,{error:J,onDiscard:Q,onOpenChat:X}),B==="failed"&&g1.jsx(xW0,{error:J,onOpenChat:X,onDiscard:Q})]})}function vW0({chatDocked:$,sketch:Z,draft:J}){let{controls:H,targetRef:B}=Z,{hasStrokes:Q}=pQ(H);return g1.jsx("div",{ref:B,className:"absolute inset-0 flex items-center justify-center texture-checker-20",children:J&&!H.active&&!Q&&g1.jsxs("div",{className:Q0("mb-4 flex h-full flex-col items-center justify-center gap-2 p-12 text-center text-sm text-muted-foreground","bg-radial from-background from-10% to-transparent",$?"w-full":"mr-auto w-[calc(100%-var(--chat-max))]"),children:[g1.jsx($H,{size:56,stroke:0.5}),g1.jsx("span",{className:"max-w-32",children:"Sketch how the view should look"})]})})}function fW0({error:$,onDiscard:Z,onOpenChat:J}){return g1.jsx(WN,{children:g1.jsxs("div",{className:"pointer-events-auto flex max-w-md flex-col items-center gap-4 bg-radial from-background from-50% to-transparent to-75% p-12 text-center",children:[g1.jsxs("div",{className:"flex flex-col gap-1",children:[g1.jsx("h1",{className:"font-medium",children:"The view needs your attention"}),g1.jsx("p",{className:"text-sm text-muted-foreground",children:$??"Open the chat to answer or ask the agent to continue"})]}),g1.jsxs("div",{className:"flex gap-2",children:[g1.jsx(M0,{onClick:J,children:"Open chat"}),g1.jsx(M0,{variant:"secondary",onClick:Z,children:"Discard view"})]})]})})}function gW0({controls:$}){let{hasStrokes:Z}=pQ($);return g1.jsx(WN,{children:!Z&&g1.jsx(r2,{className:"size-6 text-muted-foreground"})})}function WN({children:$}){return g1.jsx("div",{className:"pointer-events-none absolute inset-0 flex items-center justify-center",children:$})}var B8=P(m(),1);function ln($,{activeId:Z,available:J,now:H}){let B=[];if(Z!==null&&J.has(Z))B.push({id:Z,releasedAt:null});for(let Q of $){if(Q.id===Z||!J.has(Q.id))continue;let X=Q.releasedAt??H;if(H-X>=60000)continue;if(B.length>=4)break;B.push({id:Q.id,releasedAt:X})}return B}function rn($,Z){let J=null;for(let{releasedAt:H}of $){if(H===null)continue;let B=H+60000;if(J===null||B<J)J=B}return J===null?null:Math.max(0,J-Z)}function an($,Z){return $.length===Z.length&&$.every((J,H)=>{let B=Z[H];return J.id===B.id&&J.releasedAt===B.releasedAt})}var j2=P(c(),1),nn=B8.memo(function({views:Z,activeViewId:J,params:H}){let B=mW0(J,Z),Q=new Set(B.map((X)=>X.id));return j2.jsx("div",{className:Q0("relative min-h-0 flex-1 overflow-hidden",!J&&"hidden"),children:Z.filter((X)=>Q.has(X.id)).map((X)=>j2.jsx(uW0,{view:X,active:X.id===J,params:H},X.id))})});function mW0($,Z){let[J,H]=B8.useState([]),B=q5(Z),Q=Z.map((z)=>z.id).join(`
68
+ `),X=B8.useCallback(()=>{H((z)=>{let G=ln(z,{activeId:$,available:new Set(B.current.map((U)=>U.id)),now:Date.now()});return an(z,G)?z:G})},[$,B]);return B8.useEffect(()=>{X()},[Q,X]),B8.useEffect(()=>{let z=rn(J,Date.now());if(z===null)return;let G=setTimeout(X,z);return()=>clearTimeout(G)},[X,J]),J}function uW0({view:$,active:Z,params:J}){let H=p1(),B=Qv($.id),{current:Q,outgoing:X}=cW0(B,Z),[z,G]=B8.useState(J);if(Z&&z!==J)G(J);hq(dK("views",H,$.id),Q?.version??B.version,Z);let U=B.status==="error";return Aq({kind:"view",enabled:Z&&Boolean(Q)&&!U,targets:[{id:$.id,revision:$.revision}]}),j2.jsxs(j2.Fragment,{children:[Z&&U&&j2.jsx("p",{className:"absolute inset-0 p-4 text-xs text-destructive",children:B.error}),Z&&!U&&!Q&&j2.jsx(dW0,{}),Q&&!U&&j2.jsxs(B8.Activity,{mode:Z?"visible":"hidden",children:[X&&j2.jsx(on,{view:$,build:X,params:z},X.version),j2.jsx(on,{view:$,build:Q,params:z,entering:X!==null,current:!0},Q.version)]})]})}function on({view:$,build:Z,params:J,entering:H,current:B=!1}){let Q=p1(),X=z7("views",$.id);return j2.jsx("div",{"data-applet-thumbnail":B?X:void 0,"data-applet":X,className:Q0("absolute inset-0 isolate",H&&"animate-in duration-200 ease-out blur-in-4 fade-in"),children:j2.jsx("div",{className:"size-full overflow-auto",children:j2.jsx(uX,{name:$.id,kind:"view",workspaceId:Q,resetKey:Z.version,children:j2.jsx(xB,{appletId:X,active:B,children:j2.jsx(Z.Component,{params:J})})})})})}var pW0=200;function cW0($,Z){let[J,H]=B8.useState({current:null,outgoing:null});if($.status==="ready"&&J.current?.version!==$.version){let B={Component:$.Component,version:$.version};H((Q)=>({current:B,outgoing:Z?Q.current:null}))}return B8.useEffect(()=>{if(!J.outgoing)return;let B=setTimeout(()=>H((Q)=>({...Q,outgoing:null})),pW0);return()=>clearTimeout(B)},[J.outgoing]),J}function dW0(){return j2.jsx("div",{className:"absolute inset-0 flex animate-in items-center justify-center delay-150 duration-200 fill-mode-both fade-in",children:j2.jsx(r2,{className:"text-muted-foreground"})})}function sn($){return $?.status==="compiled"?void 0:$}async function tn($,Z,J,H,B,Q,X="shared"){let G=sn($.getQueryData(O0.views(Z))?.find((K)=>K.id===J))?.executionSessionId??H;try{let[{views:K},F]=await Promise.all([B1(`/api/workspaces/${Z}/views`),B1(`/api/workspaces/${Z}/selected-session`)]),W=sn(K.find((q)=>q.id===J));if(!Q&&W?.status==="draft")G=F2(S5(J)),$.setQueryData(O0.sessions(Z),(q)=>q?.filter((N)=>N.sessionId!==H)),$.removeQueries({queryKey:O0.events(Z,H)});else G=W?.executionSessionId??(Q?F.pinned:F.selected[S5(J)])??H;if(g7(Z,H,G),W?.status==="draft"||W?.status==="failed")y1.getState().setActivity(Z,G,"idle");if($.setQueryData(O0.views(Z),K),$.setQueryData(x3.sessionSelection(Z),F),X==="browser-tab"&&!Q){let N={...($.getQueryData(i2(Z,"browser-tab"))??x6(Z)).selected};if(W?.status==="draft")delete N[S5(J)];else N[S5(J)]=G;let D={selected:N,pinned:null};$.setQueryData(i2(Z,"browser-tab"),D),h6(Z,D)}}catch{g7(Z,H,G),$.invalidateQueries({queryKey:O0.views(Z)}),$.invalidateQueries({queryKey:x3.sessionSelection(Z)})}let U=V2(Z,G),Y=T1.getState();Y.setComposerDraft(U,Y.composerDrafts[U]??B)}function en(){let $=$1(),J=l2()?"browser-tab":"shared",{workspaceId:H,layout:B}=b1(),{pinnedSessionId:Q}=v6(),X=v8(H).data,z=Ka(H),G=Fa(H),U=Wa(H),Y=qa(H);return{create:()=>z.mutateAsync(),save:(N,D)=>G.mutateAsync({viewId:N,requirements:D}),submit:async(N,D)=>{let A=D.trim(),V=Q??F2(S5(N.id)),L=Q??crypto.randomUUID(),O=GN(H,V);if(!A&&O.length===0)return;if(!Q)UN({tabId:S5(N.id),queryClient:$,workspaceId:H,sessionId:L,text:A,filenames:O.map((k)=>k.label)});if(!Q)g7(H,V,L),rB($,H,L,S5(N.id),J);let M=KN({queryClient:$,workspaceId:H,sessionId:L,text:A},O),_=$.getQueryData(O0.session(H,L))?.config,{model:w,effort:C,fastMode:E,stream:j}=YN(X,_?.model??B.selectedModel,_?.effort??B.selectedEffort,_?.fastMode??B.selectedFastMode);$.setQueryData(O0.views(H),(k)=>k?.map((S)=>S.id===N.id&&S.status==="draft"?{...S,status:"starting",requirements:A,executionSessionId:L}:S));try{let k=await U.mutateAsync({viewId:N.id,sessionId:L,requirements:A,optimisticId:M.optimisticId,selectedSessionScope:J,...O.length>0?{attachments:M.attachments}:{},model:w,effort:C,fastMode:E,stream:j});if(g7(H,L,k.sessionId),bU($,H,L,k.sessionId),!Q)rB($,H,k.sessionId,S5(N.id),J);FN(H,O);let S=V2(H,k.sessionId),I=T1.getState();if(I.composerDrafts[S]?.trim()===A)I.setComposerDraft(S,null)}catch(k){throw await tn($,H,N.id,L,A,!!Q,J),k}},discard:(N)=>Y.mutateAsync(N)}}var m7=P(m(),1);function $s({workspaceId:$,pendingViews:Z,onSave:J}){let H=m7.useRef(new Set),B=m7.useRef(new Map),Q=q5(Z),X=q5(J),z=m7.useCallback((G)=>{clearTimeout(B.current.get(G)),B.current.delete(G),T1.getState().setComposerDraft(V2($,F2(S5(G))),null)},[$]);return m7.useEffect(()=>{for(let G of Z){let U=F2(S5(G.id)),Y=V2($,U);if(T1.getState().moveComposerDraft(U,Y),G.status!=="draft")z(G.id);else if(!H.current.has(Y)){if(H.current.add(Y),T1.getState().composerDrafts[Y]===void 0)T1.getState().setComposerDraft(Y,G.requirements)}}},[$,Z,z]),m7.useEffect(()=>{let G=B.current,U=(K)=>{if(Q.current.find((q)=>q.id===K)?.status!=="draft")return;let F=V2($,F2(S5(K))),W=T1.getState().composerDrafts[F];if(W===void 0)return;X.current(K,W).catch(()=>{e1.add({title:"Couldn’t save view description",type:"error"})})},Y=T1.subscribe((K,F)=>{for(let W of Q.current){if(W.status!=="draft")continue;let q=V2($,F2(S5(W.id))),N=K.composerDrafts[q];if(N===F.composerDrafts[q])continue;if(clearTimeout(G.get(W.id)),G.delete(W.id),N===void 0)continue;G.set(W.id,setTimeout(()=>{G.delete(W.id),U(W.id)},500))}});return()=>{Y();for(let[K,F]of G)clearTimeout(F),U(K);G.clear()}},[$,Q,X]),{clear:z}}function Zs($,Z){if(Z)return{status:"disconnected"};return $??{status:"checking"}}var Js=P(c(),1);function Jz({className:$,...Z}){return Js.jsx("div",{...Z,className:Q0("w-full p-2 text-sm @xl:p-1 @xl:pl-3",$)})}var qZ=P(c(),1);function qN({error:$,onDismiss:Z,onRetry:J}){return qZ.jsxs(Jz,{role:"alert",className:"flex items-center gap-2 text-destructive",children:[qZ.jsx("span",{className:"flex-1 wrap-break-word",children:$}),J&&qZ.jsx(M0,{type:"button",variant:"ghost",size:"sm",onClick:J,children:"Retry"}),Z&&qZ.jsx(M0,{type:"button",variant:"ghost",size:"icon-sm",onClick:Z,className:"text-destructive hover:text-destructive","aria-label":"Dismiss error",children:qZ.jsx(e5,{stroke:1.75})})]})}var t2=P(c(),1);function Bs({error:$,pendingAction:Z,onUpdate:J,onDismiss:H}){if(!$&&Z==="auto")return t2.jsxs(Jz,{role:"status",className:"flex items-center gap-1.5 text-muted-foreground",children:[t2.jsx(d5,{size:20,stroke:1.5,className:"shrink-0 animate-spin"}),t2.jsx("span",{className:"wrap-break-word",children:"Updating Moi skills…"})]});let B=Z!==null;return t2.jsxs(Jz,{role:$?"alert":"status",className:Q0("grid grid-cols-[minmax(0,1fr)_auto] gap-x-2 gap-y-2","@xl:flex @xl:items-center",$&&"text-destructive"),children:[t2.jsxs("div",{className:"flex min-w-0 items-start gap-1.5 @xl:order-1 @xl:flex-1 @xl:items-center",children:[t2.jsx(Hs,{size:20,stroke:1.5,className:"shrink-0"}),$?t2.jsx("span",{className:"wrap-break-word",children:`Update failed: ${$}`}):t2.jsx("span",{className:"wrap-break-word",children:"This workspace is using old Moi skills"})]}),t2.jsx(M0,{type:"button",variant:"ghost",size:"icon-sm",onClick:H,className:"col-start-2 row-start-1 -mt-1 -mr-1 text-muted-foreground hover:text-foreground @xl:order-4 @xl:m-0","aria-label":"Dismiss skill update",children:t2.jsx(e5,{stroke:1.75})}),t2.jsxs("div",{className:"col-span-2 flex flex-wrap gap-1.5 @xl:contents",children:[t2.jsxs(M0,{type:"button",variant:"default",size:"sm",onClick:()=>J("auto"),disabled:B,className:"@xl:order-2",children:[Z==="auto"&&t2.jsx(d5,{stroke:1.75,className:"animate-spin"}),Z==="auto"?"Updating…":"Auto-update"]}),t2.jsxs(M0,{type:"button",variant:"secondary",size:"sm",onClick:()=>J("once"),disabled:B,className:"@xl:order-3",children:[Z==="once"&&t2.jsx(d5,{stroke:1.75,className:"animate-spin"}),Z==="once"?"Updating…":"Update once"]})]})]})}var u7=P(m(),1);function vO($){return{workspaceId:$,phase:"idle",pendingAction:null,error:null}}function lW0($){return $.phase==="active"||$.phase==="idle"&&$.updateAvailable&&!$.autoUpdateEnabled}function iW0($){return $.updateAvailable&&$.autoUpdateEnabled&&!$.updatePending&&$.phase==="idle"}function Qs($){let Z=Gv($),{isPending:J,mutate:H,reset:B}=Uv($),Q=sr(),{mutate:X}=tr(),z=Q.data!==void 0,G=Q.data?.autoUpdateSkills??!1,U=u7.useCallback(()=>X({autoUpdateSkills:!0}),[X]),[Y,K]=u7.useState(()=>vO($)),F=Y.workspaceId===$?Y:vO($);u7.useEffect(()=>{K(vO($)),B()},[$,B]);let W=u7.useCallback((D)=>{if(J)return;if(D==="auto")U();K({workspaceId:$,phase:"active",pendingAction:D,error:null}),H(void 0,{onSuccess:()=>{K((A)=>A.workspaceId===$?{...A,phase:"dismissed",pendingAction:null,error:null}:A)},onError:(A)=>{K((V)=>V.workspaceId===$&&V.phase!=="dismissed"?{...V,phase:"active",pendingAction:null,error:A.message}:V)}})},[U,J,H,$]),q=Z.data?.updateAvailable??!1;return u7.useEffect(()=>{if(z&&iW0({updateAvailable:q,autoUpdateEnabled:G,updatePending:J,phase:F.phase}))W("auto")},[G,F.phase,W,z,q,J]),{bannerProps:z&&lW0({updateAvailable:q,autoUpdateEnabled:G,phase:F.phase})?{error:F.error,pendingAction:F.pendingAction,onUpdate:W,onDismiss:()=>{K((D)=>D.workspaceId===$?{...D,phase:"dismissed",pendingAction:null,error:null}:D)}}:null}}var Hz=P(c(),1);function Xs($,{chatError:Z,onDismissChatError:J,chatLoadError:H,onRetryChatLoad:B}){let{data:Q,error:X,refetch:z}=v8($),G=Q?.availability,{bannerProps:U}=Qs($),Y=Zs(G,Boolean(X)),K=X?{tone:"error",content:Hz.jsx(qN,{error:"Could not check agent availability",onRetry:()=>void z()})}:void 0,F;if(H)F={tone:"error",content:Hz.jsx(qN,{error:H,onRetry:B})};else if(Z)F={tone:"error",content:Hz.jsx(qN,{error:Z,onDismiss:J})};let W=U?{tone:"default",content:Hz.jsx(Bs,{...U})}:void 0;return{agentAvailability:Y,composerBanner:K??F??W,viewDraftComposerBanner:K??W}}var zs=P(m(),1);var Q8=P(c(),1);function Gs({onOpenTheme:$}){let{layout:Z,name:J,provider:H}=b1(),[B,Q]=zs.useState(!1);return Q8.jsx(Iq,{children:Q8.jsxs(X3,{children:[Q8.jsxs(z3,{className:"flex min-w-0 cursor-pointer items-center gap-2 rounded-sm outline-none focus-visible:ring-3 focus-visible:ring-ring/50","aria-label":`${J??"Workspace"} menu`,onPointerEnter:()=>Q(!0),onPointerLeave:()=>Q(!1),children:[Q8.jsx(Z7,{icon:B?{...Z.icon,type:"glyph",value:"dots"}:Z.icon,workspaceType:H,workspaceTheme:Z.theme,className:"size-5 rounded-sm"}),J&&Q8.jsx("span",{className:"truncate text-sm font-medium text-foreground",children:J})]}),Q8.jsx(G3,{align:"start",sideOffset:6,className:"w-36",children:Q8.jsxs(D7,{children:[Q8.jsxs(U3,{onClick:$,children:[Q8.jsx(QN,{stroke:1.75}),"Theme"]}),Q8.jsxs(U3,{nativeButton:!0,render:Q8.jsx(g3,{}),className:"w-full",children:[Q8.jsx(c6,{stroke:1.75}),"Settings"]})]})})]})})}var rW0=iK();function Z6($,Z){if($==="overview"||$==="scratchpad")return!0;let J=eZ($);return J?Z.some((H)=>H.id===J):!1}function NN($,Z){let J=$.open.filter((H)=>Z6(H,Z));return J.length>0?J:rW0.open}function fO($,Z,J){if($!==void 0)return $;let H=NN(Z,J);return H.includes(Z.active)?Z.active:H[0]??"overview"}var D2=P(m(),1);var iH=P(m(),1);var Us=($)=>`moi:collab:${$}:tabs`;function aW0($,Z){try{let J=sessionStorage.getItem(Us($));return J?rK(JSON.parse(J)):Z}catch{return Z}}function oW0($,Z){try{sessionStorage.setItem(Us($),JSON.stringify(Z))}catch{}}function Ys(){let{workspaceId:$,layout:Z,setLayout:J}=b1(),H=l2(),B=iH.useMemo(()=>rK(Z.tabs),[Z.tabs]),[Q,X]=iH.useState(()=>H?aW0($,B):B),z=iH.useCallback((G)=>{let U=rK(G);if(H)X(U),oW0($,U);else J({tabs:U});return U},[H,J,$]);return[H?Q:B,z]}function Ws($){let Z=new URLSearchParams($);Z.sort();let J=Z.toString();return J?`?${J}`:""}function gO(){return window.location.pathname+Ws(window.location.search)}function mO($,Z){return $.get(Z)??`moi:/${Z}`}var Ks=new Map;function qs({views:$,onOpenChat:Z}){let J=$1(),{workspaceId:H}=b1(),[B,Q]=Ys(),X=D2.useRef({views:$,tabsState:B,onOpenChat:Z});D2.useLayoutEffect(()=>{X.current={views:$,tabsState:B,onOpenChat:Z}},[$,B,Z]);let z=dS(),G=D2.useRef(null),[,U]=m4(),Y=C2(),{base:K}=Y,F=`${K.replace(/\/$/,"")}/workspace/${encodeURIComponent(H)}/`,W=r7(Y).slice(F.length),q=Ws(Oz(Y)),N=D2.useMemo(()=>{let S=new URLSearchParams(q);return Object.fromEntries(Array.from(S.keys(),(I)=>[I,S.get(I)]))},[q]),D=D2.useMemo(()=>{let S=Ks.get(H);if(!S)Ks.set(H,S=new Map);return S},[H]),A=A$(W),V=W==="chat"||W==="chats"||W.startsWith("chats/"),L=fO(A,B,$),O=Boolean(W)&&!V&&(!A||!Z6(A,$)),M=A!==void 0&&!O,_=D2.useCallback((S)=>{X.current={...X.current,tabsState:Q(S)}},[X,Q]),w=D2.useCallback(()=>{let S=A$(window.location.pathname.slice(F.length)),{tabsState:I,views:T}=X.current,y=S??fO(void 0,I,T),R=S?`moi:/${y}${window.location.search}`:mO(D,y);return{tab:y,href:R}},[X,F,D]),C=D2.useCallback(async(S,{replace:I=!1}={},T=new AbortController)=>{let y=A8(S,{workspaceId:H,base:K});if(G.current?.controller.abort(),!y.startsWith(F)){G.current=null,T.signal.throwIfAborted(),window.location.assign(y);return}G.current={controller:T,address:gO()};let R=(x)=>{if(T.signal.throwIfAborted(),G.current=null,gO()!==x||window.location.hash)U(`~${x}`,{replace:I})};try{let x=y.slice(F.length).split("?",1)[0];if(x==="chat"||x.startsWith("chats/")){let{tab:b,href:l}=w(),r=x==="chat"?!0:await z(decodeURIComponent(x.slice(6)),b,T.signal);if(R(A8(l,{workspaceId:H,base:K})),r)X.current.onOpenChat();return}if(!d9(x))throw Error("This destination is unavailable in this workspace");let v=O0.views(H),f=J.getQueryData(v)??X.current.views;if(!Z6(x,f))await J.refetchQueries({queryKey:v,exact:!0},{throwOnError:!0}),f=J.getQueryData(v)??X.current.views;if(!Z6(x,f))throw Error("This destination is unavailable in this workspace");R(y)}finally{if(G.current?.controller===T)G.current=null}},[K,w,X,F,J,z,U,H]);D2.useEffect(()=>{let S=G.current;if(S&&S.address!==gO())S.controller.abort()},[W,q,H]),D2.useEffect(()=>()=>G.current?.controller.abort(),[]);let E=D2.useCallback((S)=>{if(S instanceof Error&&S.name==="AbortError")return;let I=S instanceof Error?S.message:"Navigation failed";e1.add({type:"error",title:"Could not navigate",description:I}),K8(H,{source:"runtime",message:I})},[H]),j=D2.useCallback((S,I={})=>{C(mO(D,S),I).catch(E)},[C,D,E]);pK(H,"navigate",(S)=>{C(S).catch(E)}),Fs(H,C),D2.useEffect(()=>{if(W&&!V)return;let S=mO(D,L);if(V)try{S=A8(`moi:/${W}`)}catch{}let I=new AbortController;return C(S,{replace:!0},I).catch((T)=>{if(!I.signal.aborted)E(T)}),()=>I.abort()},[L,V,C,W,D,E,q]),D2.useEffect(()=>{if(!M)return;D.set(L,`moi:/${L}${q}`);let S=X.current.tabsState,I=S.open.includes(L)?S.open:[...S.open,L];if(I!==S.open||S.active!==L)_({open:I,active:L})},[L,M,X,D,q,_]);let k=D2.useCallback((S)=>{if(S.defaultPrevented||S.button!==0||S.metaKey||S.ctrlKey||S.altKey||S.shiftKey)return;let I=S.target instanceof Element?S.target.closest("a[href]"):null;if(!(I instanceof HTMLAnchorElement)||I.hasAttribute("download")||I.target&&I.target!=="_self")return;let T=new URL(I.href);if(T.origin!==window.location.origin||!T.pathname.startsWith(F))return;if(T.hash)return;S.preventDefault(),C(`moi:/${T.pathname.slice(F.length)}${T.search}`).catch(E)},[C,F,E]);return{tabsState:B,activeTab:L,appletParams:N,navigateToTab:j,setTabs:_,isUnavailable:O,onNavigationClick:k}}var f5=P(c(),1),nW0=AJ([z9({variant:"ghost",size:"sm"}),"group/tab min-w-0"],{variants:{active:{true:"bg-accent text-accent-foreground"},dragging:{true:"invisible"},preview:{true:"cursor-grabbing ring-1 ring-border"}},compoundVariants:[{preview:!0}]});function sW0({items:$}){return f5.jsxs(X3,{children:[f5.jsx(z3,{render:f5.jsx(M0,{type:"button",variant:"ghost",size:"icon-sm",className:"text-muted-foreground","aria-label":"Create tab",children:f5.jsx(a2,{stroke:1.75})})}),f5.jsx(G3,{align:"start",className:"min-w-48",children:f5.jsx(D7,{children:$.map((Z)=>f5.jsxs(U3,{onClick:Z.onClick,className:"font-medium",children:[f5.jsx(Z.Icon,{stroke:2}),Z.label]},Z.key))})})]})}function Ns($){let{tab:Z,active:J}=$,H=$.preview===!0;return f5.jsxs("button",{type:"button","aria-hidden":H||void 0,"aria-label":Z.label,disabled:H,tabIndex:H?-1:void 0,onClick:$.preview?void 0:()=>$.onSelect(Z.key),className:nW0({active:J,dragging:$.preview?!1:$.state.isDragging,preview:H}),...$.preview?{}:$.state.dragHandleProps,children:[f5.jsxs("div",{className:Q0("flex items-center gap-1 overflow-hidden select-none",Z.closable&&"group-hover/tab:mr-3"),children:[Z.loading?f5.jsx(r2,{"data-icon":"inline-start",className:"shrink-0"}):f5.jsx(Z.Icon,{"data-icon":"inline-start",stroke:2,className:"size-4 shrink-0"}),f5.jsx("span",{className:Q0("truncate",Z.closable&&"group-hover/tab:-mr-3 group-hover/tab:mask-r-from-[calc(100%-24px)] group-hover/tab:mask-r-to-[calc(100%-12px)]"),children:Z.label})]}),Z.closable&&f5.jsx("div",{"aria-label":`Close ${Z.label}`,tabIndex:H?-1:void 0,className:Q0("absolute right-2 hidden size-3 items-center justify-center text-muted-foreground group-hover/tab:flex hover:text-foreground",H&&"pointer-events-none"),onClick:$.preview?void 0:(B)=>{B.stopPropagation(),$.onClose(Z.key)},children:f5.jsx(e5,{stroke:1.75,className:"size-4 shrink-0"})})]})}function As({tabs:$,active:Z,createItems:J,onSelect:H,onClose:B,onReorder:Q}){return f5.jsxs("div",{className:"flex min-w-0 flex-1 items-center gap-1",children:[f5.jsx("div",{className:"no-scrollbar min-w-0 scroll-fade-x overflow-x-auto overflow-y-hidden [--scroll-fade-reveal:16px]",children:f5.jsx(MK,{items:$,getId:(X)=>X.key,isItemDragDisabled:(X)=>X.reorderable===!1,className:"flex w-max items-center gap-1",onReorder:(X)=>Q(X),renderPlaceholder:()=>f5.jsx("div",{className:"pointer-events-none absolute inset-0 rounded-md bg-muted"}),renderOverlay:(X)=>f5.jsx(Ns,{tab:X,active:Z===X.key,preview:!0}),renderItem:(X,z)=>f5.jsx(Ns,{tab:X,active:Z===X.key,state:z,onSelect:H,onClose:B})})}),f5.jsx("div",{className:"shrink-0",children:f5.jsx(sW0,{items:J})})]})}var rH=P(m(),1);function uO($){let Z=document.documentElement,J=getComputedStyle(Z).getPropertyValue($).trim(),H=Number.parseFloat(J);if(!Number.isFinite(H))return 0;return J.endsWith("rem")?H*Number.parseFloat(getComputedStyle(Z).fontSize):H}function Ds(){let $=rH.useRef(null),[Z,J]=rH.useState(null);return rH.useLayoutEffect(()=>{let H=$.current;if(!H)return;let B=(X)=>{let z=uO("--column-w"),G=uO("--chat-min"),U=uO("--chat-max"),Y={fits:X-G>=z,workspaceMinWidth:z,chatMinWidth:G,chatMaxWidth:U};J((K)=>K?.fits===Y.fits&&K.workspaceMinWidth===Y.workspaceMinWidth&&K.chatMinWidth===Y.chatMinWidth&&K.chatMaxWidth===Y.chatMaxWidth?K:Y)};B(H.getBoundingClientRect().width);let Q=()=>B(H.getBoundingClientRect().width);return window.addEventListener("resize",Q),()=>window.removeEventListener("resize",Q)},[]),{ref:$,fits:Z?.fits??!1,constraints:Z?{workspaceMinWidth:Z.workspaceMinWidth,chatMinWidth:Z.chatMinWidth,chatMaxWidth:Z.chatMaxWidth}:null}}var l7=P(m(),1);var tH=P(c(),1),k1=P(m(),1);function tW0($,Z){let J=getComputedStyle($),H=parseFloat(J.fontSize);return Z*H}function eW0($,Z){let J=getComputedStyle($.ownerDocument.documentElement),H=parseFloat(J.fontSize);return Z*H}function $q0($){return $/100*window.innerHeight}function Zq0($){return $/100*window.innerWidth}function Jq0($){switch(typeof $){case"number":return[$,"px"];case"string":{let Z=parseFloat($);return $.endsWith("%")?[Z,"%"]:$.endsWith("px")?[Z,"px"]:$.endsWith("rem")?[Z,"rem"]:$.endsWith("em")?[Z,"em"]:$.endsWith("vh")?[Z,"vh"]:$.endsWith("vw")?[Z,"vw"]:[Z,"%"]}}}function Bz({groupSize:$,panelElement:Z,styleProp:J}){let H,[B,Q]=Jq0(J);switch(Q){case"%":{H=B/100*$;break}case"px":{H=B;break}case"rem":{H=eW0(Z,B);break}case"em":{H=tW0(Z,B);break}case"vh":{H=$q0(B);break}case"vw":{H=Zq0(B);break}}return H}function g4($){return parseFloat($.toFixed(3))}function eH({group:$}){let{orientation:Z,panels:J}=$;return J.reduce((H,B)=>(H+=Z==="horizontal"?B.element.offsetWidth:B.element.offsetHeight,H),0)}function cO($){let{panels:Z}=$,J=eH({group:$});return J===0?Z.map((H)=>({groupResizeBehavior:H.panelConstraints.groupResizeBehavior,collapsedSize:0,collapsible:H.panelConstraints.collapsible===!0,defaultSize:void 0,disabled:H.panelConstraints.disabled,minSize:0,maxSize:100,panelId:H.id})):Z.map((H)=>{let{element:B,panelConstraints:Q}=H,X=0;if(Q.collapsedSize!==void 0){let Y=Bz({groupSize:J,panelElement:B,styleProp:Q.collapsedSize});X=g4(Y/J*100)}let z;if(Q.defaultSize!==void 0){let Y=Bz({groupSize:J,panelElement:B,styleProp:Q.defaultSize});z=g4(Y/J*100)}let G=0;if(Q.minSize!==void 0){let Y=Bz({groupSize:J,panelElement:B,styleProp:Q.minSize});G=g4(Y/J*100)}let U=100;if(Q.maxSize!==void 0){let Y=Bz({groupSize:J,panelElement:B,styleProp:Q.maxSize});U=g4(Y/J*100)}return{groupResizeBehavior:Q.groupResizeBehavior,collapsedSize:X,collapsible:Q.collapsible===!0,defaultSize:z,disabled:Q.disabled,minSize:G,maxSize:U,panelId:H.id}})}function E5($,Z="Assertion error"){if(!$)throw Error(Z)}function dO($,Z){return Array.from(Z).sort($==="horizontal"?Hq0:Bq0)}function Hq0($,Z){let J=$.element.offsetLeft-Z.element.offsetLeft;return J!==0?J:$.element.offsetWidth-Z.element.offsetWidth}function Bq0($,Z){let J=$.element.offsetTop-Z.element.offsetTop;return J!==0?J:$.element.offsetHeight-Z.element.offsetHeight}function xs($){return $!==null&&typeof $=="object"&&"nodeType"in $&&$.nodeType===Node.ELEMENT_NODE}function hs($,Z){return{x:$.x>=Z.left&&$.x<=Z.right?0:Math.min(Math.abs($.x-Z.left),Math.abs($.x-Z.right)),y:$.y>=Z.top&&$.y<=Z.bottom?0:Math.min(Math.abs($.y-Z.top),Math.abs($.y-Z.bottom))}}function Qq0({orientation:$,rects:Z,targetRect:J}){let H={x:J.x+J.width/2,y:J.y+J.height/2},B,Q=Number.MAX_VALUE;for(let X of Z){let{x:z,y:G}=hs(H,X),U=$==="horizontal"?z:G;U<Q&&(Q=U,B=X)}return E5(B,"No rect found"),B}var AN;function Xq0(){return AN===void 0&&(typeof matchMedia=="function"?AN=!!matchMedia("(pointer:coarse)").matches:AN=!1),AN}function vs($){let{element:Z,orientation:J,panels:H,separators:B}=$,Q=dO(J,Array.from(Z.children).filter(xs).map((q)=>({element:q}))).map(({element:q})=>q),X=[],z=!1,G=!1,U=-1,Y=-1,K=0,F,W=[];{let q=-1;for(let N of Q)N.hasAttribute("data-panel")&&(q++,N.hasAttribute("data-disabled")||(K++,U===-1&&(U=q),Y=q))}if(K>1){let q=-1;for(let N of Q)if(N.hasAttribute("data-panel")){q++;let D=H.find((A)=>A.element===N);if(D){if(F){let A=F.element.getBoundingClientRect(),V=N.getBoundingClientRect(),L;if(G){let O=J==="horizontal"?new DOMRect(A.right,A.top,0,A.height):new DOMRect(A.left,A.bottom,A.width,0),M=J==="horizontal"?new DOMRect(V.left,V.top,0,V.height):new DOMRect(V.left,V.top,V.width,0);switch(W.length){case 0:{L=[O,M];break}case 1:{let _=W[0],w=Qq0({orientation:J,rects:[A,V],targetRect:_.element.getBoundingClientRect()});L=[_,w===A?M:O];break}default:{L=W;break}}}else W.length?L=W:L=[J==="horizontal"?new DOMRect(A.right,V.top,V.left-A.right,V.height):new DOMRect(V.left,A.bottom,V.width,V.top-A.bottom)];for(let O of L){let M="width"in O?O:O.element.getBoundingClientRect(),_=Xq0()?$.resizeTargetMinimumSize.coarse:$.resizeTargetMinimumSize.fine;if(M.width<_){let C=_-M.width;M=new DOMRect(M.x-C/2,M.y,M.width+C,M.height)}if(M.height<_){let C=_-M.height;M=new DOMRect(M.x,M.y-C/2,M.width,M.height+C)}let w=q<=U||q>Y;!z&&!w&&X.push({group:$,groupSize:eH({group:$}),panels:[F,D],separator:"width"in O?void 0:O,rect:M}),z=!1}}G=!1,F=D,W=[]}}else if(N.hasAttribute("data-separator")){N.ariaDisabled!==null&&(z=!0);let D=B.find((A)=>A.element===N);D?W.push(D):(F=void 0,W=[])}else G=!0}return X}class lO{#$={};addListener($,Z){let J=this.#$[$];return J===void 0?this.#$[$]=[Z]:J.includes(Z)||J.push(Z),()=>{this.removeListener($,Z)}}emit($,Z){let J=this.#$[$];if(J!==void 0)if(J.length===1)J[0].call(null,Z);else{let H=!1,B=null,Q=Array.from(J);for(let X=0;X<Q.length;X++){let z=Q[X];try{z.call(null,Z)}catch(G){B===null&&(H=!0,B=G)}}if(H)throw B}}removeAllListeners(){this.#$={}}removeListener($,Z){let J=this.#$[$];if(J!==void 0){let H=J.indexOf(Z);H>=0&&J.splice(H,1)}}}var nH={cursorFlags:0,state:"inactive"},iO=new lO;function AZ(){return nH}function zq0($){return iO.addListener("change",$)}function Gq0($){let Z=nH,J={...nH};J.cursorFlags=$,nH=J,iO.emit("change",{prev:Z,next:J})}function sH($){let Z=nH;nH=$,iO.emit("change",{prev:Z,next:$})}var Uq0=($)=>$,pO=()=>{},fs=1,gs=2,ms=4,us=8,Vs=3,Ls=12,DN;function Ms(){return DN===void 0&&(DN=!1,typeof window<"u"&&(window.navigator.userAgent.includes("Chrome")||window.navigator.userAgent.includes("Firefox"))&&(DN=!0)),DN}function Yq0({cursorFlags:$,groups:Z,state:J}){let H=0,B=0;switch(J){case"active":case"hover":Z.forEach((Q)=>{if(!Q.mutableState.disableCursor)switch(Q.orientation){case"horizontal":{H++;break}case"vertical":{B++;break}}})}if(!(H===0&&B===0)){switch(J){case"active":{if($&&Ms()){let Q=($&fs)!==0,X=($&gs)!==0,z=($&ms)!==0,G=($&us)!==0;if(Q)return z?"se-resize":G?"ne-resize":"e-resize";if(X)return z?"sw-resize":G?"nw-resize":"w-resize";if(z)return"s-resize";if(G)return"n-resize"}break}}return Ms()?H>0&&B>0?"move":H>0?"ew-resize":"ns-resize":H>0&&B>0?"grab":H>0?"col-resize":"row-resize"}}var Ps=new WeakMap;function rO($){if(!$.defaultView||!$.adoptedStyleSheets)return;let{prevStyle:Z,styleSheet:J}=Ps.get($)??{};J===void 0&&(J=new $.defaultView.CSSStyleSheet,$.adoptedStyleSheets&&(Object.isExtensible($.adoptedStyleSheets)?$.adoptedStyleSheets.push(J):$.adoptedStyleSheets=[...$.adoptedStyleSheets,J]));let H=AZ();switch(H.state){case"active":case"hover":{let B=Yq0({cursorFlags:H.cursorFlags,groups:H.hitRegions.map((X)=>X.group),state:H.state}),Q=`*, *:hover {cursor: ${B} !important; }`;if(Z===Q)return;Z=Q,B?J.cssRules.length===0?J.insertRule(Q):J.replaceSync(Q):J.cssRules.length===1&&J.deleteRule(0);break}case"inactive":{Z=void 0,J.cssRules.length===1&&J.deleteRule(0);break}}Ps.set($,{prevStyle:Z,styleSheet:J})}var L3=new Map,ps=new lO;function Kq0($){L3=new Map(L3),L3.delete($)}function _s($,Z){for(let[J]of L3)if(J.id===$)return J}function p7($,Z){for(let[J,H]of L3)if(J.id===$)return H;if(Z)throw Error(`Could not find data for Group with id ${$}`)}function c7(){return L3}function aO($,Z){return ps.addListener("groupChange",(J)=>{J.group.id===$&&Z(J)})}function J6($,Z,J){let H=L3.get($);L3=new Map(L3),L3.set($,Z),ps.emit("groupChange",{group:$,isUserInteraction:J?.isUserInteraction===!0,prev:H,next:Z})}function cs($){let Z=AZ(),J=c7(),H=!1;switch(Z.state){case"active":sH({cursorFlags:0,state:"inactive"}),Z.hitRegions.length>0&&(rO($),H=!0,Z.hitRegions.forEach((B)=>{if(!J.has(B.group))return;let Q=p7(B.group.id,!0);J6(B.group,Q,{isUserInteraction:!0})}))}return H}function Os($){$.defaultPrevented||cs($.currentTarget)}function Fq0($,Z,J){let H,B={x:1/0,y:1/0};for(let Q of Z){let X=hs(J,Q.rect);switch($){case"horizontal":{X.x<=B.x&&(H=Q,B=X);break}case"vertical":{X.y<=B.y&&(H=Q,B=X);break}}}return H?{distance:B,hitRegion:H}:void 0}function Wq0($){return $!==null&&typeof $=="object"&&"nodeType"in $&&$.nodeType===Node.DOCUMENT_FRAGMENT_NODE}function qq0($,Z){if($===Z)throw Error("Cannot compare node with itself");let J={a:Cs($),b:Cs(Z)},H;for(;J.a.at(-1)===J.b.at(-1);)H=J.a.pop(),J.b.pop();E5(H,"Stacking order can only be calculated for elements with a common ancestor");let B={a:Ts(js(J.a)),b:Ts(js(J.b))};if(B.a===B.b){let Q=H.childNodes,X={a:J.a.at(-1),b:J.b.at(-1)},z=Q.length;for(;z--;){let G=Q[z];if(G===X.a)return 1;if(G===X.b)return-1}}return Math.sign(B.a-B.b)}var Nq0=/\b(?:position|zIndex|opacity|transform|webkitTransform|mixBlendMode|filter|webkitFilter|isolation)\b/;function Aq0($){let Z=getComputedStyle(ds($)??$).display;return Z==="flex"||Z==="inline-flex"}function Dq0($){let Z=getComputedStyle($);return!!(Z.position==="fixed"||Z.zIndex!=="auto"&&(Z.position!=="static"||Aq0($))||+Z.opacity<1||("transform"in Z)&&Z.transform!=="none"||("webkitTransform"in Z)&&Z.webkitTransform!=="none"||("mixBlendMode"in Z)&&Z.mixBlendMode!=="normal"||("filter"in Z)&&Z.filter!=="none"||("webkitFilter"in Z)&&Z.webkitFilter!=="none"||("isolation"in Z)&&Z.isolation==="isolate"||Nq0.test(Z.willChange)||Z.webkitOverflowScrolling==="touch")}function js($){let Z=$.length;for(;Z--;){let J=$[Z];if(E5(J,"Missing node"),Dq0(J))return J}return null}function Ts($){return $&&Number(getComputedStyle($).zIndex)||0}function Cs($){let Z=[];for(;$;)Z.push($),$=ds($);return Z}function ds($){let{parentNode:Z}=$;return Wq0(Z)?Z.host:Z}function Vq0($,Z){return $.x<Z.x+Z.width&&$.x+$.width>Z.x&&$.y<Z.y+Z.height&&$.y+$.height>Z.y}function Lq0({groupElement:$,hitRegion:Z,pointerEventTarget:J}){if(!xs(J)||J.contains($)||$.contains(J))return!0;if(qq0(J,$)>0){let H=J;for(;H;){if(H.contains($))return!0;if(Vq0(H.getBoundingClientRect(),Z))return!1;H=H.parentElement}}return!0}function oO($,Z){let J=[];return Z.forEach((H,B)=>{if(B.disabled)return;let Q=vs(B),X=Fq0(B.orientation,Q,{x:$.clientX,y:$.clientY});X&&X.distance.x<=0&&X.distance.y<=0&&Lq0({groupElement:B.element,hitRegion:X.hitRegion.rect,pointerEventTarget:$.target})&&J.push(X.hitRegion)}),J}function Mq0($,Z){if($.length!==Z.length)return!1;for(let J=0;J<$.length;J++)if($[J]!=Z[J])return!1;return!0}function T4($,Z,J=0){return Math.abs(g4($)-g4(Z))<=J}function V3($,Z){return T4($,Z)?0:$>Z?1:-1}function oH({overrideDisabledPanels:$,panelConstraints:Z,prevSize:J,size:H}){let{collapsedSize:B=0,collapsible:Q,disabled:X,maxSize:z=100,minSize:G=0}=Z;if(X&&!$)return J;if(V3(H,G)<0)if(Q){let U=(B+G)/2;V3(H,U)<0?H=B:H=G}else H=G;return H=Math.min(z,H),H=g4(H),H}function Xz({delta:$,initialLayout:Z,panelConstraints:J,pivotIndices:H,prevLayout:B,trigger:Q}){if(T4($,0))return Z;let X=Q==="imperative-api",z=Object.values(Z),G=Object.values(B),U=[...z],[Y,K]=H;E5(Y!=null,"Invalid first pivot index"),E5(K!=null,"Invalid second pivot index");let F=0;switch(Q){case"keyboard":{{let N=$<0?K:Y,D=J[N];E5(D,`Panel constraints not found for index ${N}`);let{collapsedSize:A=0,collapsible:V,minSize:L=0}=D;if(V){let O=z[N];if(E5(O!=null,`Previous layout not found for panel index ${N}`),T4(O,A)){let M=L-O;V3(M,Math.abs($))>0&&($=$<0?0-M:M)}}}{let N=$<0?Y:K,D=J[N];E5(D,`No panel constraints found for index ${N}`);let{collapsedSize:A=0,collapsible:V,minSize:L=0}=D;if(V){let O=z[N];if(E5(O!=null,`Previous layout not found for panel index ${N}`),T4(O,L)){let M=O-A;V3(M,Math.abs($))>0&&($=$<0?0-M:M)}}}break}default:{let N=$<0?K:Y,D=J[N];E5(D,`Panel constraints not found for index ${N}`);let A=z[N],{collapsible:V,collapsedSize:L,minSize:O}=D;if(V&&V3(A,O)<0)if($>0){let M=O-L,_=M/2,w=A+$;V3(w,O)<0&&($=V3($,_)<=0?0:M)}else{let M=O-L,_=100-M/2,w=A-$;V3(w,O)<0&&($=V3(100+$,_)>0?0:-M)}break}}{let N=$<0?1:-1,D=$<0?K:Y,A=0;for(;;){let L=z[D];E5(L!=null,`Previous layout not found for panel index ${D}`);let O=oH({overrideDisabledPanels:X,panelConstraints:J[D],prevSize:L,size:100})-L;if(A+=O,D+=N,D<0||D>=J.length)break}let V=Math.min(Math.abs($),Math.abs(A));$=$<0?0-V:V}{let N=$<0?Y:K;for(;N>=0&&N<J.length;){let D=Math.abs($)-Math.abs(F),A=z[N];E5(A!=null,`Previous layout not found for panel index ${N}`);let V=A-D,L=oH({overrideDisabledPanels:X,panelConstraints:J[N],prevSize:A,size:V});if(!T4(A,L)&&(F+=A-L,U[N]=L,F.toFixed(3).localeCompare(Math.abs($).toFixed(3),void 0,{numeric:!0})>=0))break;$<0?N--:N++}}if(Mq0(G,U))return B;{let N=$<0?K:Y,D=z[N];E5(D!=null,`Previous layout not found for panel index ${N}`);let A=D+F,V=oH({overrideDisabledPanels:X,panelConstraints:J[N],prevSize:D,size:A});if(U[N]=V,!T4(V,A)){let L=A-V,O=$<0?K:Y;for(;O>=0&&O<J.length;){let M=U[O];E5(M!=null,`Previous layout not found for panel index ${O}`);let _=M+L,w=oH({overrideDisabledPanels:X,panelConstraints:J[O],prevSize:M,size:_});if(T4(M,w)||(L-=w-M,U[O]=w),T4(L,0))break;$>0?O--:O++}}}let W=Object.values(U).reduce((N,D)=>D+N,0);if(!T4(W,100,0.1))return B;let q=Object.keys(B);return U.reduce((N,D,A)=>(N[q[A]]=D,N),{})}function DZ($,Z){if(Object.keys($).length!==Object.keys(Z).length)return!1;for(let J in $)if(Z[J]===void 0||V3($[J],Z[J])!==0)return!1;return!0}function VZ({layout:$,panelConstraints:Z}){let J=Object.values($),H=[...J],B=H.reduce((z,G)=>z+G,0);if(H.length!==Z.length)throw Error(`Invalid ${Z.length} panel layout: ${H.map((z)=>`${z}%`).join(", ")}`);if(!T4(B,100)&&H.length>0)for(let z=0;z<Z.length;z++){let G=H[z];E5(G!=null,`No layout data found for index ${z}`);let U=100/B*G;H[z]=U}let Q=0;for(let z=0;z<Z.length;z++){let G=J[z];E5(G!=null,`No layout data found for index ${z}`);let U=H[z];E5(U!=null,`No layout data found for index ${z}`);let Y=oH({overrideDisabledPanels:!0,panelConstraints:Z[z],prevSize:G,size:U});U!=Y&&(Q+=U-Y,H[z]=Y)}if(!T4(Q,0))for(let z=0;z<Z.length;z++){let G=H[z];E5(G!=null,`No layout data found for index ${z}`);let U=G+Q,Y=oH({overrideDisabledPanels:!0,panelConstraints:Z[z],prevSize:G,size:U});if(G!==Y&&(Q-=Y-G,H[z]=Y,T4(Q,0)))break}let X=Object.keys($);return H.reduce((z,G,U)=>(z[X[U]]=G,z),{})}function ls({groupId:$,panelId:Z}){let J=()=>{let G=c7();for(let[U,{defaultLayoutDeferred:Y,derivedPanelConstraints:K,layout:F,groupSize:W,separatorToPanels:q}]of G)if(U.id===$)return{defaultLayoutDeferred:Y,derivedPanelConstraints:K,group:U,groupSize:W,layout:F,separatorToPanels:q};throw Error(`Group ${$} not found`)},H=()=>{let G=J().derivedPanelConstraints.find((U)=>U.panelId===Z);if(G!==void 0)return G;throw Error(`Panel constraints not found for Panel ${Z}`)},B=()=>{let G=J().group.panels.find((U)=>U.id===Z);if(G!==void 0)return G;throw Error(`Layout not found for Panel ${Z}`)},Q=()=>{let G=J().layout[Z];if(G!==void 0)return G;throw Error(`Layout not found for Panel ${Z}`)},X=({nextSize:G,panels:U,prevLayout:Y,derivedPanelConstraints:K})=>{let F=Q(),W=U.findIndex((D)=>D.id===Z),q=W===0,N=W===U.length-1;if(N&&G<F&&(q||U.slice(0,W).every((D,A)=>{let V=K[A];return V?.collapsible&&T4(V.collapsedSize,Y[V.panelId])}))){let D=U.slice(0,W).reduce((A,V)=>A+Y[V.id],0);return{...Y,[Z]:g4(100-D)}}return Xz({delta:N?F-G:G-F,initialLayout:Y,panelConstraints:K,pivotIndices:N?[W-1,W]:[W,W+1],prevLayout:Y,trigger:"imperative-api"})},z=(G)=>{let U=Q();if(G===U)return;let{defaultLayoutDeferred:Y,derivedPanelConstraints:K,group:F,groupSize:W,layout:q,separatorToPanels:N}=J(),D=X({nextSize:G,panels:F.panels,prevLayout:q,derivedPanelConstraints:K}),A=VZ({layout:D,panelConstraints:K});DZ(q,A)||J6(F,{defaultLayoutDeferred:Y,derivedPanelConstraints:K,groupSize:W,layout:A,separatorToPanels:N})};return{collapse:()=>{let{collapsible:G,collapsedSize:U}=H(),{mutableValues:Y}=B(),K=Q();G&&K!==U&&(Y.expandToSize=K,z(U))},expand:()=>{let{collapsible:G,collapsedSize:U,minSize:Y}=H(),{mutableValues:K}=B(),F=Q();if(G&&F===U){let W=K.expandToSize??Y;W===0&&(W=1),z(W)}},getSize:()=>{let{group:G}=J(),U=Q(),{element:Y}=B(),K=G.orientation==="horizontal"?Y.offsetWidth:Y.offsetHeight;return{asPercentage:U,inPixels:K}},isCollapsed:()=>{let{collapsible:G,collapsedSize:U}=H(),Y=Q();return G&&T4(U,Y)},resize:(G)=>{let{group:U}=J(),{element:Y}=B(),K=eH({group:U}),F=Bz({groupSize:K,panelElement:Y,styleProp:G}),W=g4(F/K*100);z(W)}}}function Es($){if($.defaultPrevented)return;let Z=c7();oO($,Z).forEach((J)=>{if(J.separator&&!J.separator.disableDoubleClick){let H=J.panels.find((B)=>B.panelConstraints.defaultSize!==void 0);if(H){let B=H.panelConstraints.defaultSize,Q=ls({groupId:J.group.id,panelId:H.id});Q&&B!==void 0&&(Q.resize(B),$.preventDefault())}}})}function VN($){let Z=c7();for(let[J]of Z)if(J.separators.some((H)=>H.element===$))return J;throw Error("Could not find parent Group for separator element")}function is({groupId:$}){let Z=()=>{let J=c7();for(let[H,B]of J)if(H.id===$)return{group:H,...B};throw Error(`Could not find Group with id "${$}"`)};return{getLayout(){let{defaultLayoutDeferred:J,layout:H}=Z();return J?{}:H},setLayout(J){let{defaultLayoutDeferred:H,derivedPanelConstraints:B,group:Q,groupSize:X,layout:z,separatorToPanels:G}=Z(),U=VZ({layout:J,panelConstraints:B});return H?z:(DZ(z,U)||J6(Q,{defaultLayoutDeferred:H,derivedPanelConstraints:B,groupSize:X,layout:U,separatorToPanels:G}),U)}}}function NZ($,Z){let J=VN($),H=p7(J.id,!0),B=J.separators.find((Y)=>Y.element===$);E5(B,"Matching separator not found");let Q=H.separatorToPanels.get(B);E5(Q,"Matching panels not found");let X=Q.map((Y)=>J.panels.indexOf(Y)),z=is({groupId:J.id}).getLayout(),G=Xz({delta:Z,initialLayout:z,panelConstraints:H.derivedPanelConstraints,pivotIndices:X,prevLayout:z,trigger:"keyboard"}),U=VZ({layout:G,panelConstraints:H.derivedPanelConstraints});DZ(z,U)||J6(J,{defaultLayoutDeferred:H.defaultLayoutDeferred,derivedPanelConstraints:H.derivedPanelConstraints,groupSize:H.groupSize,layout:U,separatorToPanels:H.separatorToPanels},{isUserInteraction:!0})}function bs($){if($.defaultPrevented)return;let Z=$.currentTarget,J=VN(Z);if(!J.disabled)switch($.key){case"ArrowDown":{$.preventDefault(),J.orientation==="vertical"&&NZ(Z,5);break}case"ArrowLeft":{$.preventDefault(),J.orientation==="horizontal"&&NZ(Z,-5);break}case"ArrowRight":{$.preventDefault(),J.orientation==="horizontal"&&NZ(Z,5);break}case"ArrowUp":{$.preventDefault(),J.orientation==="vertical"&&NZ(Z,-5);break}case"End":{$.preventDefault(),NZ(Z,100);break}case"Enter":{$.preventDefault();let H=VN(Z),B=p7(H.id,!0),{derivedPanelConstraints:Q,layout:X,separatorToPanels:z}=B,G=H.separators.find((F)=>F.element===Z);E5(G,"Matching separator not found");let U=z.get(G);E5(U,"Matching panels not found");let Y=U[0],K=Q.find((F)=>F.panelId===Y.id);if(E5(K,"Panel metadata not found"),K.collapsible){let F=X[Y.id],W=K.collapsedSize===F?H.mutableState.expandedPanelSizes[Y.id]??K.minSize:K.collapsedSize;NZ(Z,W-F)}break}case"F6":{$.preventDefault();let H=VN(Z).separators.map((X)=>X.element),B=Array.from(H).findIndex((X)=>X===$.currentTarget);E5(B!==null,"Index not found");let Q=$.shiftKey?B>0?B-1:H.length-1:B+1<H.length?B+1:0;H[Q].focus({preventScroll:!0});break}case"Home":{$.preventDefault(),NZ(Z,-100);break}}}function ws($){if($.defaultPrevented)return;if($.pointerType==="mouse"&&$.button>0)return;let Z=c7(),J=oO($,Z),H=new Map,B=!1;J.forEach((Q)=>{Q.separator&&(B||(B=!0,Q.separator.element.focus({focusVisible:!1,preventScroll:!0})));let X=Z.get(Q.group);X&&H.set(Q.group,X.layout)}),sH({cursorFlags:0,hitRegions:J,initialLayoutMap:H,pointerDownAtPoint:{x:$.clientX,y:$.clientY},state:"active"}),J.length&&$.preventDefault()}function rs({document:$,event:Z,hitRegions:J,initialLayoutMap:H,mountedGroups:B,pointerDownAtPoint:Q,prevCursorFlags:X}){let z=0;J.forEach((U)=>{let{group:Y,groupSize:K}=U,{orientation:F,panels:W}=Y,{disableCursor:q}=Y.mutableState,N=0;Q?F==="horizontal"?N=(Z.clientX-Q.x)/K*100:N=(Z.clientY-Q.y)/K*100:F==="horizontal"?N=Z.clientX<0?-100:100:N=Z.clientY<0?-100:100;let D=H.get(Y),A=B.get(Y);if(!D||!A)return;let{defaultLayoutDeferred:V,derivedPanelConstraints:L,groupSize:O,layout:M,separatorToPanels:_}=A;if(L&&M&&_){let w=Xz({delta:N,initialLayout:D,panelConstraints:L,pivotIndices:U.panels.map((C)=>W.indexOf(C)),prevLayout:M,trigger:"mouse-or-touch"});if(DZ(w,M)){if(N!==0&&!q)switch(F){case"horizontal":{z|=N<0?fs:gs;break}case"vertical":{z|=N<0?ms:us;break}}}else J6(U.group,{defaultLayoutDeferred:V,derivedPanelConstraints:L,groupSize:O,layout:w,separatorToPanels:_})}});let G=0;Z.movementX===0?G|=X&Vs:G|=z&Vs,Z.movementY===0?G|=X&Ls:G|=z&Ls,Gq0(G),rO($)}function Ss($){let Z=c7(),J=AZ();switch(J.state){case"active":rs({document:$.currentTarget,event:$,hitRegions:J.hitRegions,initialLayoutMap:J.initialLayoutMap,mountedGroups:Z,prevCursorFlags:J.cursorFlags})}}function Rs($){if($.defaultPrevented)return;let Z=AZ(),J=c7();switch(Z.state){case"active":{if($.buttons===0){sH({cursorFlags:0,state:"inactive"}),Z.hitRegions.forEach((H)=>{if(!J.has(H.group))return;let B=p7(H.group.id,!0);J6(H.group,B,{isUserInteraction:!0})});return}for(let H of Z.hitRegions)if(H.separator){let{element:B}=H.separator;B.isConnected&&!B.hasPointerCapture?.($.pointerId)&&B.setPointerCapture?.($.pointerId)}rs({document:$.currentTarget,event:$,hitRegions:Z.hitRegions,initialLayoutMap:Z.initialLayoutMap,mountedGroups:J,pointerDownAtPoint:Z.pointerDownAtPoint,prevCursorFlags:Z.cursorFlags});break}default:{let H=oO($,J);H.length===0?Z.state!=="inactive"&&sH({cursorFlags:0,state:"inactive"}):sH({cursorFlags:0,hitRegions:H,state:"hover"}),rO($.currentTarget);break}}}function Is($){if($.relatedTarget instanceof HTMLIFrameElement)switch(AZ().state){case"hover":sH({cursorFlags:0,state:"inactive"})}}function ks($){if($.defaultPrevented)return;if($.pointerType==="mouse"&&$.button>0)return;cs($.currentTarget)&&$.preventDefault()}function ys($){let Z=0,J=0,H={};for(let Q of $)if(Q.defaultSize!==void 0){Z++;let X=g4(Q.defaultSize);J+=X,H[Q.panelId]=X}else H[Q.panelId]=void 0;let B=$.length-Z;if(B!==0){let Q=g4((100-J)/B);for(let X of $)X.defaultSize===void 0&&(H[X.panelId]=Q)}return H}function Pq0($,Z,J){if(!J[0])return;let H=$.panels.find((G)=>G.element===Z);if(!H||!H.onResize)return;let B=eH({group:$}),Q=$.orientation==="horizontal"?H.element.offsetWidth:H.element.offsetHeight,X=H.mutableValues.prevSize,z={asPercentage:g4(Q/B*100),inPixels:Q};H.mutableValues.prevSize=z,H.onResize(z,H.id,X)}function _q0($,Z){if(Object.keys($).length!==Object.keys(Z).length)return!1;for(let J in $)if($[J]!==Z[J])return!1;return!0}function Oq0($,Z){return $.length!==Z.length?!1:$.every((J,H)=>_q0(J,Z[H]))}function jq0({group:$,nextGroupSize:Z,prevGroupSize:J,prevLayout:H}){if(J<=0||Z<=0||J===Z)return H;let B=0,Q=0,X=!1,z=new Map,G=[];for(let K of $.panels){let F=H[K.id]??0;switch(K.panelConstraints.groupResizeBehavior){case"preserve-pixel-size":{X=!0;let W=F/100*J,q=g4(W/Z*100);z.set(K.id,q),B+=q;break}case"preserve-relative-size":default:{G.push(K.id),Q+=F;break}}}if(!X||G.length===0)return H;let U=100-B,Y={...H};if(z.forEach((K,F)=>{Y[F]=K}),Q>0)for(let K of G){let F=H[K]??0;Y[K]=g4(F/Q*U)}else{let K=g4(U/G.length);for(let F of G)Y[F]=K}return Y}function Tq0($,Z){let J=$.map((B)=>B.id),H=Object.keys(Z);if(J.length!==H.length)return!1;for(let B of J)if(!H.includes(B))return!1;return!0}var aH=new Map;function Cq0($){let Z=!0;E5($.element.ownerDocument.defaultView,"Cannot register an unmounted Group");let J=$.element.ownerDocument.defaultView.ResizeObserver,H=new Set,B=new Set,Q=new J((q)=>{for(let N of q){let{borderBoxSize:D,target:A}=N;if(A===$.element){if(Z){let V=eH({group:$});if(V===0)return;let L=p7($.id);if(!L)return;let O=cO($),M=L.defaultLayoutDeferred?ys(O):L.layout,_=jq0({group:$,nextGroupSize:V,prevGroupSize:L.groupSize,prevLayout:M}),w=VZ({layout:_,panelConstraints:O});if(!L.defaultLayoutDeferred&&DZ(L.layout,w)&&Oq0(L.derivedPanelConstraints,O)&&L.groupSize===V)continue;J6($,{defaultLayoutDeferred:!1,derivedPanelConstraints:O,groupSize:V,layout:w,separatorToPanels:L.separatorToPanels})}}else Pq0($,A,D)}});Q.observe($.element),$.panels.forEach((q)=>{E5(!H.has(q.id),`Panel ids must be unique; id "${q.id}" was used more than once`),H.add(q.id),q.onResize&&Q.observe(q.element)});let X=eH({group:$}),z=cO($),G=$.panels.map(({id:q})=>q).join(","),U=$.mutableState.defaultLayout;U&&(Tq0($.panels,U)||(U=void 0));let Y=$.mutableState.layouts[G]??U??ys(z),K=VZ({layout:Y,panelConstraints:z}),F=$.element.ownerDocument;aH.set(F,(aH.get(F)??0)+1);let W=new Map;return vs($).forEach((q)=>{q.separator&&W.set(q.separator,q.panels)}),J6($,{defaultLayoutDeferred:X===0,derivedPanelConstraints:z,groupSize:X,layout:K,separatorToPanels:W}),$.separators.forEach((q)=>{E5(!B.has(q.id),`Separator ids must be unique; id "${q.id}" was used more than once`),B.add(q.id),q.element.addEventListener("keydown",bs)}),aH.get(F)===1&&(F.addEventListener("contextmenu",Os,!0),F.addEventListener("dblclick",Es,!0),F.addEventListener("pointerdown",ws,!0),F.addEventListener("pointerleave",Ss),F.addEventListener("pointermove",Rs),F.addEventListener("pointerout",Is),F.addEventListener("pointerup",ks,!0)),function(){Z=!1,aH.set(F,Math.max(0,(aH.get(F)??0)-1)),Kq0($),$.separators.forEach((q)=>{q.element.removeEventListener("keydown",bs)}),aH.get(F)||(F.removeEventListener("contextmenu",Os,!0),F.removeEventListener("dblclick",Es,!0),F.removeEventListener("pointerdown",ws,!0),F.removeEventListener("pointerleave",Ss),F.removeEventListener("pointermove",Rs),F.removeEventListener("pointerout",Is),F.removeEventListener("pointerup",ks,!0)),Q.disconnect()}}function Eq0(){let[$,Z]=k1.useState({}),J=k1.useCallback(()=>Z({}),[]);return[$,J]}function nO($){let Z=k1.useId();return`${$??Z}`}var LZ=typeof window<"u"?k1.useLayoutEffect:k1.useEffect;function Qz($){let Z=k1.useRef($);return LZ(()=>{Z.current=$},[$]),k1.useCallback((...J)=>Z.current?.(...J),[Z])}function sO(...$){return Qz((Z)=>{$.forEach((J)=>{if(J)switch(typeof J){case"function":{J(Z);break}case"object":{J.current=Z;break}}})})}function tO($){let Z=k1.useRef({...$});return LZ(()=>{for(let J in $)Z.current[J]=$[J]},[$]),Z.current}var as=k1.createContext(null);function bq0($,Z){let J=k1.useRef({getLayout:()=>({}),setLayout:Uq0});k1.useImperativeHandle(Z,()=>J.current,[]),LZ(()=>{Object.assign(J.current,is({groupId:$}))})}function eO({children:$,className:Z,defaultLayout:J,disableCursor:H,disabled:B,elementRef:Q,groupRef:X,id:z,onLayoutChange:G,onLayoutChanged:U,orientation:Y="horizontal",resizeTargetMinimumSize:K={coarse:20,fine:10},style:F,...W}){let q=k1.useRef({onLayoutChange:{},onLayoutChanged:{}}),N=Qz((k)=>{DZ(q.current.onLayoutChange,k)||(q.current.onLayoutChange=k,G?.(k))}),D=Qz((k,S)=>{DZ(q.current.onLayoutChanged,k)||(q.current.onLayoutChanged=k,U?.(k,{isUserInteraction:S}))}),A=nO(z),V=k1.useRef(null),[L,O]=Eq0(),M=k1.useRef({lastExpandedPanelSizes:{},layouts:{},panels:[],resizeTargetMinimumSize:K,separators:[]}),_=sO(V,Q);bq0(A,X);let w=Qz((k,S)=>{let I=AZ(),T=_s(k),y=p7(k);if(y){let R=!1;switch(I.state){case"active":{R=I.hitRegions.some((x)=>x.group===T);break}}return{flexGrow:y.layout[S]??1,pointerEvents:R?"none":void 0}}if(J?.[S])return{flexGrow:J?.[S]}}),C=tO({defaultLayout:J,disableCursor:H}),E=k1.useMemo(()=>({get disableCursor(){return!!C.disableCursor},getPanelStyles:w,id:A,orientation:Y,registerPanel:(k)=>{let S=M.current;return S.panels=dO(Y,[...S.panels,k]),O(),()=>{S.panels=S.panels.filter((I)=>I!==k),O()}},registerSeparator:(k)=>{let S=M.current;return S.separators=dO(Y,[...S.separators,k]),O(),()=>{S.separators=S.separators.filter((I)=>I!==k),O()}},updatePanelProps:(k,{disabled:S})=>{let I=M.current.panels.find((R)=>R.id===k);I&&(I.panelConstraints.disabled=S);let T=_s(A),y=p7(A);T&&y&&J6(T,{...y,derivedPanelConstraints:cO(T)})},updateSeparatorProps:(k,{disabled:S,disableDoubleClick:I})=>{let T=M.current.separators.find((y)=>y.id===k);T&&(T.disabled=S,T.disableDoubleClick=I)}}),[w,A,O,Y,C]),j=k1.useRef(null);return LZ(()=>{let k=V.current;if(k===null)return;let S=M.current,I;if(C.defaultLayout!==void 0&&Object.keys(C.defaultLayout).length===S.panels.length){I={};for(let b of S.panels){let l=C.defaultLayout[b.id];l!==void 0&&(I[b.id]=l)}}let T={disabled:!!B,element:k,id:A,mutableState:{defaultLayout:I,disableCursor:!!C.disableCursor,expandedPanelSizes:M.current.lastExpandedPanelSizes,layouts:M.current.layouts},orientation:Y,panels:S.panels,resizeTargetMinimumSize:S.resizeTargetMinimumSize,separators:S.separators};j.current=T;let y=Cq0(T),{defaultLayoutDeferred:R,derivedPanelConstraints:x,layout:v}=p7(T.id,!0);!R&&x.length>0&&(N(v),D(v,!1));let f=aO(A,(b)=>{let{defaultLayoutDeferred:l,derivedPanelConstraints:r,layout:h}=b.next;if(l||r.length===0)return;let d=T.panels.map(({id:p})=>p).join(",");T.mutableState.layouts[d]=h,r.forEach((p)=>{if(p.collapsible){let{layout:i}=b.prev??{};if(i){let n=T4(p.collapsedSize,h[p.panelId]),Z0=T4(p.collapsedSize,i[p.panelId]);n&&!Z0&&(T.mutableState.expandedPanelSizes[p.panelId]=i[p.panelId])}}});let o=AZ().state!=="active";N(h),o&&D(h,b.isUserInteraction)});return()=>{j.current=null,y(),f()}},[B,A,D,N,Y,L,C]),k1.useEffect(()=>{let k=j.current;k&&(k.mutableState.defaultLayout=J,k.mutableState.disableCursor=!!H)}),tH.jsx(as.Provider,{value:E,children:tH.jsx("div",{...W,className:Z,"data-group":!0,"data-testid":A,id:A,ref:_,style:{height:"100%",width:"100%",overflow:"hidden",...F,display:"flex",flexDirection:Y==="horizontal"?"row":"column",flexWrap:"nowrap",touchAction:Y==="horizontal"?"pan-y":"pan-x"},children:$})})}eO.displayName="Group";function $j(){let $=k1.useContext(as);return E5($,"Group Context not found; did you render a Panel or Separator outside of a Group?"),$}function wq0($,Z){let{id:J}=$j(),H=k1.useRef({collapse:pO,expand:pO,getSize:()=>({asPercentage:0,inPixels:0}),isCollapsed:()=>!1,resize:pO});k1.useImperativeHandle(Z,()=>H.current,[]),LZ(()=>{Object.assign(H.current,ls({groupId:J,panelId:$}))})}function Zj({children:$,className:Z,collapsedSize:J="0%",collapsible:H=!1,defaultSize:B,disabled:Q,elementRef:X,groupResizeBehavior:z="preserve-relative-size",id:G,maxSize:U="100%",minSize:Y="0%",onResize:K,panelRef:F,style:W,...q}){let N=!!G,D=nO(G),A=tO({disabled:Q}),V=k1.useRef(null),L=sO(V,X),{getPanelStyles:O,id:M,orientation:_,registerPanel:w,updatePanelProps:C}=$j(),E=K!==null,j=Qz((T,y,R)=>{K?.(T,G,R)});LZ(()=>{let T=V.current;if(T!==null){let y={element:T,id:D,idIsStable:N,mutableValues:{expandToSize:void 0,prevSize:void 0},onResize:E?j:void 0,panelConstraints:{groupResizeBehavior:z,collapsedSize:J,collapsible:H,defaultSize:B,disabled:A.disabled,maxSize:U,minSize:Y}};return w(y)}},[z,J,H,B,E,D,N,U,Y,j,w,A]),k1.useEffect(()=>{C(D,{disabled:Q})},[Q,D,C]),wq0(D,F);let k=()=>{let T=O(M,D);if(T)return JSON.stringify(T)},S=k1.useSyncExternalStore((T)=>aO(M,T),k,k),I;return S?I=JSON.parse(S):B!==void 0?I={flexGrow:void 0,flexShrink:void 0,flexBasis:B}:I={flexGrow:1},tH.jsx("div",{...q,"data-disabled":Q||void 0,"data-panel":!0,"data-testid":D,id:D,ref:L,style:{...Sq0,display:"flex",flexBasis:0,flexShrink:1,overflow:"visible",...I},children:tH.jsx("div",{className:Z,style:{maxHeight:"100%",maxWidth:"100%",flexGrow:1,overflow:"auto",...W,touchAction:_==="horizontal"?"pan-y":"pan-x"},children:$})})}Zj.displayName="Panel";var Sq0={minHeight:0,maxHeight:"100%",height:"auto",minWidth:0,maxWidth:"100%",width:"auto",border:"none",borderWidth:0,padding:0,margin:0};function Rq0({layout:$,panelConstraints:Z,panelId:J,panelIndex:H}){let B,Q,X=$[J],z=Z.find((G)=>G.panelId===J);if(z){let G=z.maxSize,U=z.collapsible?z.collapsedSize:z.minSize,Y=[H,H+1];Q=VZ({layout:Xz({delta:U-X,initialLayout:$,panelConstraints:Z,pivotIndices:Y,prevLayout:$}),panelConstraints:Z})[J],B=VZ({layout:Xz({delta:G-X,initialLayout:$,panelConstraints:Z,pivotIndices:Y,prevLayout:$}),panelConstraints:Z})[J]}return{valueControls:J,valueMax:B,valueMin:Q,valueNow:X}}function Jj({children:$,className:Z,disabled:J,disableDoubleClick:H,elementRef:B,id:Q,style:X,...z}){let G=nO(Q),U=tO({disabled:J,disableDoubleClick:H}),[Y,K]=k1.useState({}),[F,W]=k1.useState("inactive"),[q,N]=k1.useState(!1),D=k1.useRef(null),A=sO(D,B),{disableCursor:V,id:L,orientation:O,registerSeparator:M,updateSeparatorProps:_}=$j(),w=O==="horizontal"?"vertical":"horizontal";LZ(()=>{let j=D.current;if(j!==null){let k={disabled:U.disabled,disableDoubleClick:U.disableDoubleClick,element:j,id:G},S=M(k),I=zq0((y)=>{W(y.next.state!=="inactive"&&y.next.hitRegions.some((R)=>R.separator===k)?y.next.state:"inactive")}),T=aO(L,(y)=>{let{derivedPanelConstraints:R,layout:x,separatorToPanels:v}=y.next,f=v.get(k);if(f){let b=f[0],l=R.findIndex((r)=>r.panelId===b.id);K(Rq0({layout:x,panelConstraints:R,panelId:b.id,panelIndex:l}))}});return()=>{I(),T(),S()}}},[L,G,M,U]),k1.useEffect(()=>{_(G,{disabled:J,disableDoubleClick:H})},[J,H,G,_]);let C;J&&!V&&(C="not-allowed");let E;if(J)E="disabled";else switch(F){case"active":{E="active";break}default:q?E="focus":E=F}return tH.jsx("div",{...z,"aria-controls":Y.valueControls,"aria-disabled":J||void 0,"aria-orientation":w,"aria-valuemax":Y.valueMax,"aria-valuemin":Y.valueMin,"aria-valuenow":Y.valueNow,children:$,className:Z,"data-separator":E,"data-testid":G,id:G,onBlur:()=>N(!1),onFocus:()=>N(!0),ref:A,role:"separator",style:{flexBasis:"auto",cursor:C,...X,flexGrow:0,flexShrink:0,touchAction:"none"},tabIndex:J?void 0:0})}Jj.displayName="Separator";var LN=P(c(),1);function os({className:$,...Z}){return LN.jsx(eO,{"data-slot":"resizable-panel-group",className:i0("flex h-full w-full aria-[orientation=vertical]:flex-col",$),...Z})}function Hj({...$}){return LN.jsx(Zj,{"data-slot":"resizable-panel",...$})}function ns({showDivider:$=!0,className:Z,...J}){return LN.jsx(Jj,{"data-slot":"resizable-handle",className:i0("relative flex items-center justify-center ring-offset-background after:absolute after:inset-y-0 after:left-1/2 after:w-1 after:-translate-x-1/2 focus-visible:ring-1 focus-visible:ring-ring focus-visible:outline-hidden aria-[orientation=horizontal]:w-full aria-[orientation=horizontal]:after:left-0 aria-[orientation=horizontal]:after:h-1 aria-[orientation=horizontal]:after:w-full aria-[orientation=horizontal]:after:translate-x-0 aria-[orientation=horizontal]:after:-translate-y-1/2",$?"w-px bg-border aria-[orientation=horizontal]:h-px":"w-0 aria-[orientation=horizontal]:h-0",Z),...J})}var d7=P(c(),1);function ss({workspace:$,chat:Z,open:J,workspaceMinWidth:H,chatMinWidth:B,chatMaxWidth:Q,chatWidth:X,onCollapse:z,onChatWidthChange:G}){let U=l7.useRef(null),Y=l7.useRef(null),[K,F]=l7.useState(!1),W=Math.min(Math.max(X,B),Q),[q]=l7.useState(()=>J?W:0);return l7.useLayoutEffect(()=>{let N=U.current;if(!N)return;if(J)N.resize(W);else N.collapse()},[W,J]),d7.jsxs(os,{orientation:"horizontal",className:Q0("overflow-visible!",K&&"[&>#chat]:transition-[flex-grow] [&>#chat]:duration-200 [&>#chat]:ease-in-out motion-reduce:[&>#chat]:transition-none!",K&&"has-[[data-separator=active]]:[&>#chat]:transition-none!"),onLayoutChanged:(N,D)=>{if(!K&&Y.current===null)Y.current=requestAnimationFrame(()=>{F(!0)});if(D.isUserInteraction)requestAnimationFrame(()=>{let A=U.current;if(!A)return;let V=A.getSize();if(V.inPixels>0)G(Math.round(V.inPixels))})},children:[d7.jsx(Hj,{id:"workspace",className:"overflow-visible!",minSize:H,children:d7.jsx("div",{"data-slot":"workspace-split-workspace",className:"flex h-full min-h-0 min-w-0 flex-col",children:$})}),d7.jsx(ns,{"aria-label":"Resize chat",showDivider:!1,hidden:!J,disabled:!J}),d7.jsx(Hj,{id:"chat","aria-hidden":!J,inert:!J,collapsible:!0,collapsedSize:0,defaultSize:q,minSize:B,maxSize:Q,groupResizeBehavior:"preserve-pixel-size",panelRef:U,onResize:(N,D,A)=>{if(J&&N.inPixels===0&&A&&A.inPixels>0)z()},className:Q0("overflow-hidden!",K&&"transition-opacity duration-200 ease-in-out motion-reduce:transition-none",J?"opacity-100":"opacity-0"),children:d7.jsx("div",{"data-slot":"workspace-split-chat",className:"flex h-full min-h-0 min-w-(--chat-min) flex-col",children:Z})})]})}var $B=P(c(),1);function MN($=!1){let{layout:Z,setLayout:J}=b1(),{ref:H,fits:B,constraints:Q}=Ds(),X=T1((Y)=>Y.dockedChatWidth),z=T1((Y)=>Y.setDockedChatWidth),G=!$&&B&&Z.layoutMode==="split"?"split":"fullscreen";return{ref:H,canUseSplit:B,constraints:Q,mode:G,setMode:(Y)=>J({layoutMode:Y}),chatWidth:X,setChatWidth:z}}function PN({frame:$,workspace:Z,chat:J,children:H,onClick:B}){let{ref:Q,canUseSplit:X,constraints:z,mode:G,setMode:U,chatWidth:Y,setChatWidth:K}=$;return $B.jsxs("div",{onClick:B,className:"relative flex h-full min-h-0 flex-1 flex-col font-sans text-foreground",children:[$B.jsx("div",{ref:Q,className:"flex min-h-0 flex-1",children:X&&z?$B.jsx(ss,{...z,workspace:Z,chat:J,open:G==="split",chatWidth:Y,onCollapse:()=>U("fullscreen"),onChatWidthChange:K}):Z}),H]})}function _N({mode:$,children:Z}){return $B.jsx("div",{"data-slot":"workspace-pane",className:Q0("@container/workspace relative flex h-full min-h-0 min-w-0 flex-1 flex-col-reverse overflow-hidden bg-background shadow-md transition-[border-radius,background-color] duration-100 ease-out motion-reduce:transition-none",$==="split"&&"rounded-xl"),children:Z})}var MZ=P(c(),1);function ts({onOpenOverview:$}){return MZ.jsxs("div",{className:"flex flex-1 flex-col items-center justify-center gap-4 p-6 text-center",children:[MZ.jsxs("div",{className:"flex flex-col items-center justify-center gap-2",children:[MZ.jsx(lF,{size:56,stroke:0.5,"aria-hidden":!0}),MZ.jsx("p",{className:"text-sm",children:"There's no such page in this workspace"})]}),MZ.jsx(M0,{variant:"secondary",onClick:$,children:"Back to overview"})]})}var D5=P(c(),1),kq0=e2.lazy(()=>import("/chunk-y8nbwp21.js").then(($)=>({default:$.Scratchpad})));function es($,Z,J,H){if($==="overview")return{key:$,Icon:iF,label:"Overview",closable:!1,reorderable:!1};if($==="scratchpad")return{key:$,Icon:tQ,label:"Scratchpad",closable:J};let B=eZ($),Q=B?Z.find((X)=>X.id===B):null;return Q?{key:$,Icon:gX(Q),label:fX(Q),closable:J||Q.status!=="compiled",loading:Q.status!=="compiled"&&!!Q.executionSessionId&&H(Q.executionSessionId)}:null}function Zt({widgets:$,views:Z}){let{layout:J,workspaceId:H}=b1(),B=U9(J.theme),Q=en(),X=MN(),{mode:z,canUseSplit:G,setMode:U}=X,[Y,K]=e2.useState("idle"),[F,W]=e2.useState(!1),[q,N]=e2.useState(0),D=e2.useRef(new Map),A=G4((D0)=>D0.activity),V=Z.filter((D0)=>D0.status==="compiled"),L=Z.filter((D0)=>D0.status!=="compiled"),O=iG(A,H),M=$s({workspaceId:H,pendingViews:L,onSave:(D0,y0)=>Q.save(D0,y0)}),_=$.some((D0)=>!B3(D0.id)),w=_||V.length>0,C=e2.useCallback(()=>{W(!0),N((D0)=>D0+1)},[]),{tabsState:E,activeTab:j,appletParams:k,navigateToTab:S,setTabs:I,isUnavailable:T,onNavigationClick:y}=qs({views:Z,onOpenChat:C}),{view:R,forkedFromSessionId:x,chatLoaded:v,previewTurn:f,sessionId:b,composerSessionId:l,processing:r,error:h,loadError:d,retryLoad:o,send:p,stop:i,selectSession:n,dismissError:Z0}=un({activeTab:j,appletParams:k}),{pinnedSessionId:J0}=v6(),{composerBanner:U0,viewDraftComposerBanner:z0,agentAvailability:X0}=Xs(H,{chatError:h,onDismissChatError:Z0,chatLoadError:d,onRetryChatLoad:o}),q0=NN(E,Z),N0=new Set(E.open),F0=q0.length>1,s=q0.map((D0)=>es(D0,Z,F0,(y0)=>tZ(A,H,y0))).filter((D0)=>Boolean(D0)),a=eZ(j),$0=a?V.find((D0)=>D0.id===a):void 0,t=a?L.find((D0)=>D0.id===a):void 0,B0=!J0&&b===null&&t?.status==="draft"&&(!t.executionSessionId||!tZ(A,H,t.executionSessionId))?t:void 0,_0=B0?.id,P0=!J0&&t?.status==="starting",A0=v&&!P0,L0=Y==="idle"&&(j==="overview"&&_||$0!==void 0),{controls:g,docked:u,layerProps:e,popup:W0,targetRef:S0}=bv({workspaceId:H,sessionId:l,activeTab:j,mode:z,available:L0,closePopup:()=>W(!1),openPopup:()=>W(!0)});e2.useEffect(()=>{if(E.open.filter((W1)=>Z6(W1,Z)).length===E.open.length)return;let y0=NN(E,Z);I({open:y0,active:y0.includes(E.active)?E.active:y0[0]})},[Z,I,E]),e2.useEffect(()=>{if(z!=="fullscreen")W(!1)},[z]),e2.useEffect(()=>{if(!_0)return;if(z==="fullscreen")W(!0);N((D0)=>D0+1)},[_0,z]);let h0=S,v0=()=>{Q.create().then((D0)=>h0(S5(D0.id)))},T0=(D0)=>{if(D0==="views"){let y0=V[0];if(y0)h0(S5(y0.id));else v0()}else h0(D0);W(!1)};L2((D0)=>{if(D0.type==="view:deleted"&&D0.workspaceId===H&&j===S5(D0.name))h0("overview")});let c0=async(D0)=>{let y0=D.current.get(D0.id);try{await Q.discard(D0.id)}catch(W1){return e1.add({title:W1 instanceof Error?W1.message:"Couldn’t discard view",type:"error"}),!1}return await y0?.resetSketch(),M.clear(D0.id),!0},G1=(D0)=>{if(D0==="overview")return;let y0=eZ(D0),W1=y0?L.find((j1)=>j1.id===y0):void 0;if(!F0&&!W1||!N0.has(D0))return;let R1=E.open.filter((j1)=>j1!==D0);if(R1.length===0)R1=["overview"];let f0=q0.indexOf(D0),t0=q0[f0+1]??q0[f0-1]??R1.find((j1)=>Z6(j1,Z))??"overview",O1=E.active===D0||!R1.includes(E.active)?t0:E.active;if(I({open:R1,active:O1}),j===D0)S(t0);if(W1?.status==="draft")c0(W1)},A1=async(D0)=>{if(!await c0(D0))return;let y0=S5(D0.id);if(!N0.has(y0))return;let W1=E.open.filter((t0)=>t0!==y0);if(W1.length===0)W1=["overview"];let R1=W1.find((t0)=>Z6(t0,Z))??"overview",f0=E.active===y0?R1:E.active;if(I({open:W1,active:f0}),j===y0)S(R1,{replace:!0})},d0=(D0)=>{I({open:D0,active:E.active})},k0=(D0)=>{if(D0!==void 0)T1.getState().setComposerDraft(V2(H,l),D0);if(z==="fullscreen"){if(W(!0),F)N((y0)=>y0+1);return}N((y0)=>y0+1)};kn({sessionId:b,send:p,revealChat:k0,agentAvailability:X0}),yn(l,k0);let S1=[...!N0.has("scratchpad")?[{key:"scratchpad",Icon:tQ,label:"Scratchpad",onClick:()=>h0("scratchpad")}]:[],...Z.map((D0)=>({view:D0,tab:S5(D0.id)})).filter(({tab:D0})=>!N0.has(D0)).map(({view:D0,tab:y0})=>({key:y0,Icon:gX(D0),label:fX(D0),onClick:()=>h0(y0)})),{key:"create-view",Icon:qY,label:"New view",onClick:v0}],K1=e2.useCallback(()=>{if(B0)D.current.get(B0.id)?.resetSketch()},[B0]),z5=async(D0,y0)=>{if(t?.status==="draft")await D.current.get(t.id)?.prepareSketchForSend(),await Q.submit(t,D0),M.clear(t.id);else await p(D0,y0)},C0=B0?{sessionId:F2(S5(B0.id)),onRemoveDrawing:K1}:void 0,p0={agent:B.agent,focusRequest:q,chatLoaded:A0,hasWorkspaceApplets:w,view:R,forkedFromSessionId:x,previewTurn:f,sessionId:b,processing:r,composerBanner:B0?z0:U0,agentAvailability:X0,send:z5,stop:i,onNavigateFromWelcome:T0,viewDraft:C0},r0=D5.jsx(E_,{...p0,active:z==="split",onClose:()=>U("fullscreen"),annotation:u,docked:!0}),o0=D5.jsxs(_N,{mode:z,children:[D5.jsxs("div",{className:"relative flex min-h-0 flex-1",children:[D5.jsxs("div",{ref:S0,inert:g.active||void 0,"aria-hidden":g.active||void 0,className:"flex min-h-0 min-w-0 flex-1 flex-col overflow-hidden bg-background transition-colors duration-100 ease-out motion-reduce:transition-none",children:[T?D5.jsx(ts,{onOpenOverview:()=>h0("overview")}):j==="overview"?D5.jsx(jn,{customizing:Y==="customizing",theming:Y==="theming",onThemingChange:(D0)=>K(D0?"theming":"idle"),onCustomizingChange:(D0)=>K(D0?"customizing":"idle"),widgets:$,views:V,onOpenView:(D0)=>h0(S5(D0)),onCreateView:v0,onCreateWidget:()=>{n(null),k0("Create widget")}}):j==="scratchpad"?D5.jsx(e2.Suspense,{fallback:null,children:D5.jsx(kq0,{})}):null,L.map((D0)=>D5.jsx(dn,{ref:(y0)=>{if(y0)D.current.set(D0.id,y0);else D.current.delete(D0.id)},active:!T&&t?.id===D0.id,pendingView:D0,running:!!D0.executionSessionId&&tZ(A,H,D0.executionSessionId),sketchSessionId:D0.status==="draft"?J0??F2(S5(D0.id)):void 0,chatDocked:z==="split",workspaceId:H,onEditingStart:()=>{if(z==="fullscreen")W(!1)},onContinueInChat:k0,onOpenChat:()=>k0(),onDiscard:()=>A1(D0)},D0.id)),D5.jsx(nn,{views:V,activeViewId:T?null:$0?.id??null,params:k})]}),D5.jsx(aK,{...e,children:D5.jsx(tK,{controls:g,title:"Draw annotation",busy:g.finishing,onComplete:()=>void g.finish()})})]}),D5.jsx(I4,{children:Y==="theming"&&D5.jsx(Rr,{onClose:()=>K("idle")})}),D5.jsxs(Tn,{children:[D5.jsxs("div",{className:"flex min-w-0 flex-1 items-center gap-4",children:[D5.jsx(Gs,{onOpenTheme:()=>K("theming")}),D5.jsx(As,{tabs:s,active:j,createItems:S1,onSelect:h0,onClose:G1,onReorder:d0})]}),D5.jsx(dD,{workspaceId:H,describeTab:(D0)=>es(D0,Z,!1,()=>!1),onOpenTab:h0}),G&&z==="fullscreen"&&D5.jsxs(i1,{children:[D5.jsx(r1,{render:D5.jsx(M0,{variant:"ghost",size:"icon-sm",onClick:()=>U("split"),"aria-label":"Dock chat",className:"text-muted-foreground",children:D5.jsx($t,{stroke:1.75})})}),D5.jsx(a1,{children:"Dock chat"})]})]})]});return D5.jsx(PN,{frame:X,workspace:o0,chat:r0,onClick:y,children:z==="fullscreen"&&D5.jsx(Sr,{agent:B.agent,loading:O,open:F,onOpenChange:W,onOpenChangeComplete:(D0)=>{if(D0)N((y0)=>y0+1)},children:(D0)=>D5.jsx(E_,{...p0,active:F,onClose:D0,annotation:W0})})})}var Vt=P(m(),1);var PZ=P(m(),1);var Ht=P(c(),1);function Jt({className:$,...Z}){return Ht.jsx("textarea",{"data-slot":"textarea",className:i0("flex field-sizing-content min-h-16 w-full rounded-lg border bg-transparent px-2.5 py-2 text-base transition-colors outline-none placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:bg-input/50 disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 md:text-sm dark:bg-input/30 dark:disabled:bg-input/80 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40",$),...Z})}function Bt($){return B1(`/api/harnesses/${$}/auth/login`,{method:"POST"},"Could not start sign-in")}function Qt($){return s1({queryKey:["harness-auth",$],queryFn:()=>B1(`/api/harnesses/${$}/auth`),staleTime:2000,refetchInterval:2000})}function Xt($,Z,J){return U4(`/api/harnesses/${$}/auth/login/${Z}/code`,_5("POST",{code:J}))}var ON=P(m(),1);var i5=P(c(),1);function Yt({code:$,url:Z}){let[J,H]=ON.useState(!1);return ON.useEffect(()=>{if(!J)return;let Q=setTimeout(()=>H(!1),3000);return()=>clearTimeout(Q)},[J]),i5.jsxs("ol",{className:"mx-auto grid w-full max-w-64 gap-6 text-left text-sm lg:max-w-3xl lg:grid-cols-3 lg:text-center",children:[i5.jsxs("li",{className:"flex flex-col items-start gap-3 lg:items-center",children:[i5.jsx(zt,{size:24,stroke:1.5,className:"shrink-0"}),i5.jsxs("div",{className:"flex min-w-0 flex-col items-start gap-3 lg:items-center",children:[i5.jsx("p",{children:"Enable device code sign-in for Codex in ChatGPT settings"}),i5.jsxs("a",{href:"https://chatgpt.com/settings/security",target:"_blank",rel:"noopener noreferrer",className:"inline-flex h-8 flex-wrap items-center gap-1 font-semibold focus-visible:ring-3 focus-visible:ring-ring/50",children:["Settings",i5.jsx(u3,{size:16,stroke:2,"aria-hidden":"true"}),"Security and login"]})]})]}),i5.jsxs("li",{className:"flex flex-col items-start gap-3 lg:items-center",children:[i5.jsx(Gt,{size:24,stroke:1.5,className:"shrink-0"}),i5.jsxs("div",{className:"flex min-w-0 flex-col items-start gap-3 lg:items-center",children:[i5.jsx("p",{children:"Copy the one-time device code provided below"}),i5.jsxs("div",{className:"flex h-8 items-center gap-2 rounded-lg border border-input bg-accent pr-2 pl-3",children:[i5.jsx("code",{className:"cursor-text text-sm font-medium select-text",children:$}),i5.jsxs("button",{type:"button",className:"relative size-4 cursor-pointer text-muted-foreground outline-none hover:text-foreground focus-visible:text-foreground","aria-label":J?"Code copied":"Copy code",onClick:()=>{navigator.clipboard?.writeText($).then(()=>H(!0)).catch(()=>{})},children:[i5.jsx(eW,{className:Q0("absolute inset-0 transition-[opacity,filter] duration-200 motion-reduce:transition-none",J&&"opacity-0 blur-[2px]"),stroke:1.75,size:16}),i5.jsx(g8,{className:Q0("absolute inset-0 transition-[opacity,filter] duration-200 motion-reduce:transition-none",!J&&"opacity-0 blur-[2px]"),stroke:1.75,size:16})]})]})]})]}),i5.jsxs("li",{className:"flex flex-col items-start gap-3 lg:items-center",children:[i5.jsx(Ut,{size:24,stroke:1.5,className:"shrink-0"}),i5.jsxs("div",{className:"flex min-w-0 flex-col items-start gap-3 lg:items-center",children:[i5.jsx("p",{children:"Sign in to ChatGPT, paste the code, and then come back to Moi"}),i5.jsx("a",{href:Z,target:"_blank",rel:"noopener noreferrer",className:z9(),children:"Open ChatGPT"})]})]})]})}var K5=P(c(),1);function Kt({type:$,reason:Z,checking:J,onRecheck:H}){let{environment:B}=a4(),Q=Qt($),X=$1(),[z,G]=PZ.useState(""),[U,Y]=PZ.useState(!1),K=PZ.useId(),F=R$[$],W=Q.data?.login,q=W?.state==="pending"?W:void 0,N=W?.state==="starting",D=B==="local"&&!U,A=!N&&!q&&Q.data?.availability.status==="available";PZ.useEffect(()=>{if(A)H()},[A,H]);let V=F5({mutationFn:async(M)=>{if(M==="start")Y(!1),G(""),await Bt($);if(M==="submit"&&q)await Xt($,q.id,z),G("")},onSettled:()=>X.invalidateQueries({queryKey:["harness-auth"]})}),L=Q.isError||Q.data?.availability.status==="unavailable",O=V.error?.message??(W?.state==="failed"?W.reason:void 0);return K5.jsx("div",{className:"flex flex-1 items-center justify-center p-6",children:K5.jsxs("div",{className:"flex w-full max-w-5xl flex-col text-center",children:[K5.jsx("img",{src:e9[$],alt:"",className:"mb-4 size-10 self-center"}),K5.jsxs("h1",{className:"mb-6 text-center text-xl font-medium",children:["Log in to ",F]}),K5.jsxs("section",{className:Q0("flex w-full flex-col gap-3 self-center",!q?.userCode&&"max-w-xs"),"aria-label":F,children:[Q.isPending?K5.jsx(r2,{className:"size-6 self-center text-muted-foreground",stroke:1.5}):L?K5.jsxs("div",{role:"alert",className:"flex flex-col items-start gap-2",children:[K5.jsx("p",{children:"Could not check agent sign-in status."}),K5.jsx(M0,{variant:"secondary",disabled:Q.isFetching,onClick:()=>void Q.refetch(),children:"Try again"})]}):A?K5.jsxs("div",{role:"status",className:"flex flex-col items-center gap-4",children:[K5.jsx("p",{className:"text-sm text-muted-foreground",children:J?"Checking workspace access…":`Signed in to ${F}, but this workspace still needs attention. ${Z}`}),K5.jsx(M0,{variant:"secondary",disabled:J,onClick:H,children:"Try again"})]}):K5.jsx(K5.Fragment,{children:q?.userCode?K5.jsx(Yt,{code:q.userCode,url:q.url}):q?K5.jsxs(K5.Fragment,{children:[K5.jsx("p",{role:"status",className:"text-sm text-muted-foreground",children:q.codeUrl&&!D?`Sign in to ${F} to get the authorization code.`:`Sign in to ${F}, then come back to Moi. Your workspace will open once you’re connected.`}),K5.jsxs("a",{className:z9({variant:"secondary"}),href:U?q.codeUrl??q.url:q.url,target:"_blank",rel:"noopener noreferrer",children:["Open ",F]}),D&&q.codeUrl&&K5.jsx(M0,{variant:"ghost",onClick:()=>Y(!0),children:"Having trouble signing in?"}),!D&&q.codeUrl&&K5.jsxs("form",{className:"mt-3 flex flex-col gap-3",onSubmit:(M)=>{M.preventDefault(),V.mutate("submit")},children:[K5.jsx("label",{htmlFor:K,className:"text-sm text-muted-foreground",children:"Paste the code here:"}),K5.jsx(Jt,{id:K,"aria-label":"Authorization code",rows:3,className:"field-sizing-fixed resize-none",value:z,onChange:(M)=>G(M.target.value),autoComplete:"off",spellCheck:!1}),K5.jsx(M0,{type:"submit",className:"mt-3",disabled:!z.trim()||V.isPending,children:V.isPending?"Connecting…":"Continue"})]})]}):K5.jsxs(M0,{className:"self-center",disabled:V.isPending||N,onClick:()=>V.mutate("start"),children:["Continue",K5.jsx(WY,{stroke:1.75,"data-icon":"inline-end"})]})}),O&&K5.jsx("p",{role:"alert",className:"text-sm text-destructive",children:O})]})]})})}var R5=P(c(),1);function Wt($){return R5.jsx(Dt,{title:"Could not check your agent",...$,children:"Could not check this workspace’s agent. Try again."})}function qt({workspaceId:$}){let[,Z]=m4(),J=hU();return R5.jsxs("div",{className:"flex flex-1 flex-col items-center justify-center gap-4 p-6 text-center",children:[R5.jsx(Ft,{size:56,stroke:0.5,className:"text-muted-foreground","aria-hidden":!0}),R5.jsx("h1",{className:"font-medium",children:"The workspace folder is missing"}),R5.jsx(M0,{variant:"secondary",disabled:J.isPending,onClick:()=>J.mutate($,{onSuccess:()=>Z("/")}),children:J.isPending?"Deleting workspace…":"Delete workspace"}),J.error&&R5.jsx("p",{role:"alert",className:"text-sm text-destructive",children:J.error.message})]})}function Nt({type:$,availability:Z,...J}){if(Z.status==="unavailable"&&Z.code==="not-installed")return R5.jsxs("div",{className:"flex flex-1 flex-col items-center justify-center gap-4 p-6 text-center",children:[R5.jsx("img",{src:e9[$],alt:"",className:"size-10"}),R5.jsxs("h1",{className:"font-medium",children:[R$[$]," is uninstalled from the device"]}),R5.jsx(M0,{variant:"secondary",disabled:J.retrying,onClick:J.onRetry,children:"Check again"})]});let H=Z.status==="login-required";return R5.jsxs(Dt,{title:H?"Connect your agent":"Your agent is unavailable",type:$,...J,children:[Z.reason,H&&R5.jsxs(R5.Fragment,{children:[R5.jsx("br",{}),R5.jsx("br",{}),"Complete sign-in in your agent’s terminal, then try again."]})]})}function At(){return R5.jsx("div",{className:"flex flex-1 items-center justify-center",children:R5.jsx(r2,{className:"size-6 text-muted-foreground",stroke:1.5})})}function Dt({title:$,type:Z,children:J,retrying:H,onRetry:B}){return R5.jsx("div",{className:"flex flex-1 items-center justify-center p-6",children:R5.jsxs("div",{className:"flex w-full max-w-md flex-col gap-6",children:[Z&&R5.jsx("img",{src:e9[Z],alt:"",className:"size-10 self-center"}),R5.jsx("h1",{className:"text-center text-xl font-medium",children:$}),R5.jsxs("div",{role:"alert",className:"flex flex-col items-center gap-4",children:[R5.jsx("p",{className:"text-sm wrap-anywhere whitespace-pre-wrap text-muted-foreground",children:J}),R5.jsx(M0,{variant:"secondary",disabled:H,onClick:B,children:"Try again"})]})]})})}var _Z=P(c(),1);function Lt($,Z=!1,J={}){let{data:H,isError:B,isPending:Q,isFetching:X,isFetchedAfterMount:z,refetch:G}=v8($),U=Q||X&&!z&&H?.availability.status!=="available",Y=Vt.useCallback(()=>{G()},[G]);function K(){if(U)return;if(B&&H?.availability.status==="available")return;if(B||!H)return _Z.jsx(Wt,{retrying:X,onRetry:Y});if(H.workspaceFolderMissing)return _Z.jsx(qt,{workspaceId:$});let{provider:N,availability:D}=H;if(D.status==="available")return;if(D.status==="login-required"&&(N==="claude-code"||N==="codex"))return _Z.jsx(Kt,{type:N,reason:D.reason,checking:X,onRecheck:Y});return _Z.jsx(Nt,{type:N,availability:D,retrying:X,onRetry:Y})}let F=K(),W=!F&&!Z&&!U,q=fy($);return{content:q?_Z.jsx(gy,{...J}):F??_Z.jsx(At,{}),ready:W&&!q,setupRequired:q||!!F}}var Bj=P(c(),1);function Mt({children:$}){return Bj.jsx("section",{"aria-label":"Workspace setup",className:"flex min-h-0 flex-1 flex-col overflow-y-auto bg-muted texture-checker-20",children:Bj.jsx("div",{className:"flex flex-1 flex-col bg-radial from-background from-25% to-transparent",children:$})})}var jN=P(c(),1);function Pt({setupRequired:$=!1,children:Z}){let J=MN($);return jN.jsx(PN,{frame:J,workspace:jN.jsx(_N,{mode:J.mode,children:$?jN.jsx(Mt,{children:Z}):Z})})}var Qj=P(c(),1);function _t({contentPending:$,widgets:Z,views:J}){let{layout:H,workspaceId:B,name:Q,provider:X}=b1(),{content:z,ready:G,setupRequired:U}=Lt(B,$,{name:Q??"Workspace",icon:H.icon,workspaceType:X,workspaceTheme:H.theme});return G?Qj.jsx(Zt,{widgets:Z,views:J}):Qj.jsx(Pt,{setupRequired:U,children:z})}var jt=P(m(),1);var TN=P(m(),1);function yq0($){return new Map($.map((Z)=>[Z.id,{w:Z.config.colSpan,h:Z.config.rowSpan}]))}function xq0($,Z,J){let H=new Set($.map((Y)=>Y.i)),B=Z.filter((Y)=>{let K=J.get(Y.id);if(!K)return!H.has(Y.id);if(!H.has(Y.id))return!1;return K.w!==Y.config.colSpan||K.h!==Y.config.rowSpan});if(B.length===0)return null;let Q=new Set(B.map((Y)=>Y.id)),X=new Map(Z.map((Y)=>[Y.id,Y.config])),z=$.filter((Y)=>!Q.has(Y.i)&&X.has(Y.i)).map((Y)=>{let K=X.get(Y.i);return{...Y,w:K.colSpan,h:K.rowSpan}}),G=z.map(({i:Y,x:K,y:F})=>({i:Y,x:K,y:F})),U=[...z];for(let Y of B){let K=yq(U,Y.config.colSpan,Y.config.rowSpan);G.push({i:Y.id,...K}),U.push({i:Y.id,...K,w:Y.config.colSpan,h:Y.config.rowSpan})}return G}function Ot($,Z,J,H){let B=TN.useRef(null);TN.useEffect(()=>{if(!Z)return;let Q=yq0(Z);if(B.current?.workspaceId!==$){B.current={workspaceId:$,sizes:Q};return}let X=xq0(J.widgetGrid,Z,B.current.sizes);if(B.current={workspaceId:$,sizes:Q},X)H({widgetGrid:X})},[$,Z,J.widgetGrid,H])}function Tt($){let{layout:Z,setLayout:J}=b1(),H=s1({queryKey:O0.widgets($),queryFn:async()=>{return(await B1(`/api/workspaces/${$}/widgets`)).widgets},...W8}),B=jt.useMemo(()=>Kv(H.data??[]),[H.data]);return Ot($,H.data?B:void 0,Z,J),{...H,data:B}}var OZ=P(c(),1);function Et({id:$}){let{experimental:Z}=a4();return OZ.jsx(Ct,{id:$,children:OZ.jsx(Dv,{id:$,children:OZ.jsx(OD,{workspaceId:$,enabled:Z.collab,children:OZ.jsx(hq0,{id:$})})})})}function hq0({id:$}){let Z=l2(),J=$1(),[H]=v3(),{isLoading:B,layout:Q}=b1();hh(Q.theme);let X=Tt($),z=kq($);Xv(),L2((U)=>{if(U.type==="theme:updated"||U.type==="workspace:updated"){if(U.origin===a9)return;J.invalidateQueries({queryKey:O0.layout($)})}else if(U.type==="widget-layout:updated"||U.type==="widget:updated")J.invalidateQueries({queryKey:O0.widgets($)});else if(U.type==="view-layout:updated"||U.type==="view:updated")J.invalidateQueries({queryKey:O0.views($)})});let G=B||H===void 0||X.isLoading||z.isLoading;return OZ.jsx(PK,{children:OZ.jsx(_t,{contentPending:G,widgets:X.data,views:z.data??[]},Z?"browser-tab":"shared")})}var M3=P(c(),1),bt=null;function vq0(){if(!bt)return M3.jsx(BT,{to:"/"});return M3.jsx(CN.Suspense,{fallback:null,children:M3.jsx(bt,{})})}function wt(){let[,$]=m4();return CN.useEffect(()=>{return sD((Z)=>$(`/workspace/${Z}`)),()=>sD(null)},[$]),M3.jsxs(HT,{children:[M3.jsx(jz,{path:"/dev/*?",component:vq0}),M3.jsx(jz,{path:"/",component:ph}),M3.jsx(jz,{path:"/workspace/:id/*?",children:(Z)=>M3.jsx(Et,{id:Z.id},Z.id)})]})}var H6=P(c(),1),Rt=new mN;tS(Rt);gb();function tI1($){function Z(){return H6.jsx(SN,{client:Rt,children:H6.jsx(ZR,{children:H6.jsxs(cG,{children:[H6.jsx(rN,{children:H6.jsx(wt,{})}),H6.jsx(Jb,{})]})})})}St.createRoot($).render(H6.jsx(Z,{}))}export{tI1 as mount};